@xopcai/xopc 0.0.278 → 0.0.283
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/_locales/en/messages.json +34 -4
- package/dist/browser-ext/_locales/zh_CN/messages.json +34 -4
- package/dist/browser-ext/dist/assets/{auth-ClQTK565.js → auth-DB30ywek.js} +18 -53
- package/dist/browser-ext/dist/assets/pcm-capture-worklet-CGN9Mlhg.js +39 -0
- package/dist/browser-ext/dist/assets/{sidepanel-CeGqObOa.css → sidepanel-BbSQr-6P.css} +40 -6
- package/dist/browser-ext/dist/background.js +1 -1
- package/dist/browser-ext/dist/sidepanel.html +2 -2
- package/dist/browser-ext/dist/sidepanel.js +1219 -191
- package/dist/browser-ext/manifest.json +2 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{activity-store-SJZ5fS17.js → activity-store-iPtG94qr.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-lRVOwbrK.js → agent-avatar-dicebear-DQ74xqLi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-SElFkQd6.js +1 -0
- package/dist/gateway/static/root/assets/{agents-DNQNTDkU.js → agents-DYazUaZ6.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CnJAVHBu.js → api-KMJzMqvZ.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-oHTY5PDs.js → app-management-settings-panel-B42TpqIb.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-B0YnZ3ig.js → appearance-settings-D9Lfe7Sk.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BzrodN8C.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D4x142le.js → archive-plugin-BdmQwj4x.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-zibD2Hod.js → attachment-load-B4S0_nji.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-preview-renderer-CfEDFYPE.js → attachment-preview-renderer-wzIchDSv.js} +4 -4
- package/dist/gateway/static/root/assets/attachment-process-heavy-Db4nTY5N.js +5 -0
- package/dist/gateway/static/root/assets/{automations-page-Dkp7gp_S.js → automations-page-B3TmHNjQ.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace--A4I0jMu.js +6 -0
- package/dist/gateway/static/root/assets/binary-plugins-B3cXF_DP.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-r5nCBBan.js → block-editor-05zyBXBe.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DcVLoIzc.js → browser-automation-inputs-BTIufVbM.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BnL4JnTM.js → browser-automations-page-DRBA9nwe.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DDTXUNWK.js +8 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Ll5UeXq5.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-BzL15bkU.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-BTT2sIGg.js → channels-status-swr-DMYQNs-J.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CWVnJtBp.js → chat-terminal-dock-Dx5KQyo5.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-RPw1AOMb.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-XjPSlgq_.js → date-picker-CkDROZoe.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-CkyfEP88.js → dependency-picker-Bl8HcvzL.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAE_NVx5.js → desktop-pet-BcknAjbW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BUw6V2R9.js → desktop-pet-settings-BuCpXQPm.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-D0_tCX49.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-giBeIVUT.js → extension-debug-page-qRpb2FFa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Bqo9bNtx.js → extension-page-C7gs9wu4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BX-6AA3k.js → extension-settings-page-CyJP1CMZ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-Cpmyrr6j.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DOeeTdWE.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CVTa5HSS.js → gateway-startup-retry-DoiPeb65.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-DWFAopk_.js → heartbeat-settings-CV6Dolcn.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Djw1H_Go.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DtMRG1oF.js → image-generation-api-CqjHWl2T.js} +1 -1
- package/dist/gateway/static/root/assets/index-B_Sg5BKz.css +2 -0
- package/dist/gateway/static/root/assets/index-CHgOG1aR.js +74 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BKGPpBnV.js → keyboard-shortcuts-settings-B3XqA41D.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BPqgyYJq.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-B06ToOxB.js → local-apps-page-BcIVYp0J.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BkJ7g35d.js → locale-store-1urrBBCQ.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DibI1GsP.js → logs-page-BHax3XlS.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-DJ6yMZCd.js → management-settings-DNFCdgzR.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DF3aJP_5.js → markdown-view-BZmcFIWa.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CdrLNAks.js → media-plugins-BDxNhoBC.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYFcjtmG.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Cs46LFXO.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BUkcn_0t.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-B7LA4z-x.js → page-tabs-agH3a2PI.js} +1 -1
- package/dist/gateway/static/root/assets/pdf-runtime-DU_sMPjG.js +2 -0
- package/dist/gateway/static/root/assets/pdf.worker.min-B4E34YdZ.js +48 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DTQRN7WR.js → preview-open-alternatives-XEZ7zDOP.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-page-Bn484J9v.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BazdmFYo.js → product-open-page-lXAbj85Z.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-LcH21ixD.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DelBiwyB.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-CTq8EECj.js → registry-api-CxQstD00.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-3BjFYXCf.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-D-DZf4I1.js → runtime-tools-settings-panel-DErKZlVJ.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-B-Yj9DVW.js → schema-form-DhCmJQVJ.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CVFirgVd.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DyfBpqkY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BxPUqwY6.js → settings-form-section-Dg6chotg.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-zLn8lIrs.js → settings-page-LyuN5N3M.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CrXhTzHr.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-CZvmf4Ob.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DyM_D8hM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-Bys58-15.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-sWNvFo6D.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-BR5bk2vT.js → skills-page.utils-Eu0WVHTS.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C0ptJutB.js → system-settings-panel-DQKkM7B2.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-B18NcZQJ.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-mV6Cm2vj.js → theme-store-Dc5s20V3.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-TKQpPVd6.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Dc5aN2px.js → use-autosave-CkVlrFk1.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-ul-zr58b.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CY0DpJui.js → voice-api-key-field-B12fFN-L.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D3DdcH4H.js → voice-config-api-Mk78BrpP.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Brg9yJBr.js → work-discovery-overlay-CT9Zy36i.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-D3fq7boB.js → workflow-run-setup-panel-BwefQliE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BY_AWs7S.js +6 -0
- package/dist/gateway/static/root/index.html +10 -11
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/discussions.js +17 -0
- package/dist/packages/gateway-contract/src/proactive.js +4 -2
- package/dist/src/agent/agent-manager.js +17 -17
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +4 -4
- package/dist/src/agent/context/coordinator.js +3 -3
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.d.ts +1 -0
- package/dist/src/agent/context/project-context.js +16 -8
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -5
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/memory/index.js +2 -2
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +19 -19
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +3 -3
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/source-context/task-context.d.ts +3 -0
- package/dist/src/agent/source-context/task-context.js +24 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +5 -5
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +1 -0
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -13
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +5 -5
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +3 -3
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tui.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/extension-cli-register.js +4 -4
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/connection-recovery-service.js +3 -3
- package/dist/src/discussions/action-tasks.d.ts +21 -0
- package/dist/src/discussions/action-tasks.js +93 -0
- package/dist/src/discussions/analyzer.d.ts +21 -1
- package/dist/src/discussions/analyzer.js +229 -62
- package/dist/src/discussions/audio-repair.d.ts +8 -0
- package/dist/src/discussions/audio-repair.js +41 -0
- package/dist/src/discussions/edits.d.ts +22 -0
- package/dist/src/discussions/edits.js +81 -0
- package/dist/src/discussions/errors.d.ts +4 -0
- package/dist/src/discussions/errors.js +10 -0
- package/dist/src/discussions/export.d.ts +2 -0
- package/dist/src/discussions/export.js +23 -0
- package/dist/src/discussions/index.js +3 -2
- package/dist/src/discussions/live-worker.js +2 -2
- package/dist/src/discussions/organizer-worker.js +14 -5
- package/dist/src/discussions/organizer.d.ts +1 -1
- package/dist/src/discussions/organizer.js +60 -24
- package/dist/src/discussions/reconcile.d.ts +22 -0
- package/dist/src/discussions/reconcile.js +55 -0
- package/dist/src/discussions/recording.d.ts +9 -0
- package/dist/src/discussions/recording.js +219 -0
- package/dist/src/discussions/recordingJobs.d.ts +14 -0
- package/dist/src/discussions/recordingJobs.js +69 -0
- package/dist/src/discussions/repository.d.ts +4 -2
- package/dist/src/discussions/repository.js +15 -10
- package/dist/src/discussions/revisions.d.ts +12 -0
- package/dist/src/discussions/revisions.js +36 -0
- package/dist/src/discussions/sealer.d.ts +1 -0
- package/dist/src/discussions/sealer.js +62 -12
- package/dist/src/discussions/service.d.ts +16 -15
- package/dist/src/discussions/service.js +177 -91
- package/dist/src/discussions/types.d.ts +4 -139
- package/dist/src/discussions/types.js +1 -11
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/files/file-service.d.ts +1 -0
- package/dist/src/files/file-service.js +77 -0
- package/dist/src/gateway/agents-admin.js +4 -4
- package/dist/src/gateway/chat-stream/mapper.js +2 -2
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/hono/app.js +6 -5
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/lib/static-ui.js +1 -0
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -2
- package/dist/src/gateway/hono/routes/discussions.js +126 -19
- package/dist/src/gateway/hono/routes/files.js +1 -22
- package/dist/src/gateway/hono/routes/index.js +0 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/proactive-control.js +4 -38
- package/dist/src/gateway/hono/routes/project-understanding.d.ts +3 -0
- package/dist/src/gateway/hono/routes/project-understanding.js +65 -0
- package/dist/src/gateway/hono/routes/projects.js +22 -6
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +4 -3
- package/dist/src/gateway/hono/routes/user-model.js +4 -4
- package/dist/src/gateway/hono/routes/voice.js +3 -3
- package/dist/src/gateway/hono/routes/work-discovery.d.ts +0 -2
- package/dist/src/gateway/hono/routes/work-discovery.js +2 -16
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +10 -10
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/security/gateway-scopes.js +1 -2
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +2 -2
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/marketplace-service.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +45 -30
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/knowledge-memory/repository.d.ts +2 -0
- package/dist/src/knowledge-memory/repository.js +3 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media-shared/http/ssrf-guard.js +1 -1
- package/dist/src/media-understanding/audio-transcription-runner.d.ts +1 -0
- package/dist/src/media-understanding/audio-transcription-runner.js +1 -0
- package/dist/src/media-understanding/runner.js +1 -0
- package/dist/src/media-understanding/types.d.ts +8 -0
- package/dist/src/notes/agent-context.js +3 -3
- package/dist/src/notes/service.d.ts +3 -1
- package/dist/src/notes/store.d.ts +3 -1
- package/dist/src/notes/store.js +5 -3
- package/dist/src/proactive/actions/service.js +1 -1
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/proactive/execution/context.js +1 -1
- package/dist/src/proactive/execution/worker.js +1 -1
- package/dist/src/proactive/experience.d.ts +38 -21
- package/dist/src/proactive/experience.js +109 -13
- package/dist/src/proactive/follow-ups.js +1 -1
- package/dist/src/proactive/inbox/cards.js +9 -3
- package/dist/src/proactive/inbox/delivery.js +2 -2
- package/dist/src/proactive/inbox/digest.js +2 -2
- package/dist/src/proactive/inbox/notification-policy.js +1 -1
- package/dist/src/proactive/inbox/repository.js +1 -1
- package/dist/src/proactive/inbox/service.js +1 -1
- package/dist/src/proactive/index.js +1 -1
- package/dist/src/proactive/maintenance.js +0 -1
- package/dist/src/proactive/scenarios/control.d.ts +0 -35
- package/dist/src/proactive/scenarios/control.js +7 -53
- package/dist/src/proactive/temporal/worker.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/projects/project-store.js +6 -4
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/session/client-history.d.ts +1 -1
- package/dist/src/session/client-history.js +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +3 -3
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/166_remove_proactive_previews.sql +1 -0
- package/dist/src/storage/sqlite/migrations/167_discussion_recording_chunks.sql +7 -0
- package/dist/src/storage/sqlite/migrations/168_discussion_evidence.sql +16 -0
- package/dist/src/storage/sqlite/migrations/169_discussion_action_tasks.sql +8 -0
- package/dist/src/storage/sqlite/migrations/170_discussion_edits.sql +8 -0
- package/dist/src/storage/sqlite/migrations/171_discussion_recording_jobs.sql +14 -0
- package/dist/src/storage/sqlite/migrations/172_project_understanding.sql +3 -0
- package/dist/src/storage/sqlite/migrations/173_mobile_discussion_source.sql +5 -0
- package/dist/src/storage/sqlite/migrations/__tests__/mobile-discussion-source.test.ts +20 -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/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/task-application-service.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-repository.d.ts +1 -0
- package/dist/src/tasks/task-repository.js +4 -0
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +9 -9
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +5 -5
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/audio/normalize.js +28 -5
- package/dist/src/voice/local/runtime-worker.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/local-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +2 -1
- package/dist/src/voice/stt/types.d.ts +1 -0
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/analyzer.d.ts +1 -0
- package/dist/src/work-discovery/analyzer.js +28 -22
- package/dist/src/work-discovery/index.js +3 -3
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/work-discovery/project-understanding.d.ts +7 -0
- package/dist/src/work-discovery/project-understanding.js +38 -0
- package/dist/src/work-discovery/repository.d.ts +3 -1
- package/dist/src/work-discovery/repository.js +18 -5
- package/dist/src/work-discovery/service.d.ts +8 -0
- package/dist/src/work-discovery/service.js +165 -17
- package/dist/src/work-discovery/types.d.ts +2 -0
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +6 -6
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DAqn5DdL.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Bh0etSmL.js +0 -1
- package/dist/gateway/static/root/assets/attachment-process-heavy-C5CqLCsX.js +0 -5
- package/dist/gateway/static/root/assets/automations-workspace-w4McwueN.js +0 -6
- package/dist/gateway/static/root/assets/binary-plugins-CfUzu1Hc.js +0 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DxX-t0EJ.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvacBQAI.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-CJzSNo-L.js +0 -1
- package/dist/gateway/static/root/assets/config-reload-event-Bjh2zoKp.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DNBhBT0b.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-DsR5NQEC.js +0 -1
- package/dist/gateway/static/root/assets/excel-worksheet-utils-DpdB-DjU.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-cd8owslz.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dil7vuyU.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Dpeuvazg.js +0 -1
- package/dist/gateway/static/root/assets/index-B03HGpzt.js +0 -74
- package/dist/gateway/static/root/assets/index-CXF9-BpI.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-CBtemxFc.js +0 -2
- package/dist/gateway/static/root/assets/messages-BGc-OJWg.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-GOxomxOK.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CQBgk3_x.js +0 -8
- package/dist/gateway/static/root/assets/pdf.worker.min-CHFwMXne.mjs +0 -29
- package/dist/gateway/static/root/assets/proactive-card-BF3741px.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-1EM217v0.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-B1Pm-fQd.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DUrxyNR9.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C6VzHUwx.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-DtemHfkv.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByEVQe0c.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BwIrk3Jx.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-DAc_FkVc.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Dwdv6QyS.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CDzQWN60.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CO5XVkbY.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-DOjcKOzQ.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-BABuQvGD.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-UhsSP_pC.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-S7XXNBWa.js +0 -6
- package/dist/src/proactive/scenarios/preview.d.ts +0 -13
- package/dist/src/proactive/scenarios/preview.js +0 -81
|
@@ -8,10 +8,10 @@ import { areExtensionsGloballyDisabled, discoverExtensionsFromDisk, init_discove
|
|
|
8
8
|
import { ManifestRegistry, init_manifest_registry } from "./manifest-registry.js";
|
|
9
9
|
import { init_loader, loadConfig } from "../config/loader.js";
|
|
10
10
|
import { getProviderRegistry, init_plugin_registry } from "../providers/plugin-registry.js";
|
|
11
|
-
import { mergeActivationContext } from "./activation-context.js";
|
|
12
11
|
import { ExtensionRegistryImpl } from "./extension-registry-impl.js";
|
|
13
12
|
import { ExtensionApiImpl, createExtensionLogger, createPathResolver } from "./api.js";
|
|
14
13
|
import { ActivationPlanner } from "./activation-planner.js";
|
|
14
|
+
import { mergeActivationContext } from "./activation-context.js";
|
|
15
15
|
import { checkEngineCompatibility } from "./engine-check.js";
|
|
16
16
|
import { validateSpeechProviderContracts } from "./speech-provider-contracts.js";
|
|
17
17
|
import { validateMediaUnderstandingProviderContracts } from "./media-provider-contracts.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { init_paths, resolveExtensionsDir, resolveExtensionsLockPath } from "../config/paths.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { dirname, join } from "path";
|
|
6
6
|
import { existsSync } from "fs";
|
|
7
7
|
import { mkdir, readFile } from "fs/promises";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ProviderPluginRegistry, getProviderRegistry, init_plugin_registry } from "../../providers/plugin-registry.js";
|
|
2
|
-
import { defineChannelPluginEntry } from "./channel-entry.js";
|
|
3
2
|
import { HOOK_EXECUTION_MODES } from "../types/hooks.js";
|
|
4
3
|
import { TypedEventBus } from "../typed-event-bus.js";
|
|
5
4
|
import { ExtensionRegistryImpl } from "../extension-registry-impl.js";
|
|
@@ -8,6 +7,7 @@ import { SlotRegistry, getSlotRegistry, registerSlotType } from "../slots.js";
|
|
|
8
7
|
import { ExtensionDiagnostics, ExtensionLoaderCacheImpl, getExtensionCache, getExtensionDiagnostics } from "../diagnostics.js";
|
|
9
8
|
import "../loader.js";
|
|
10
9
|
import { ExtensionHookRunner, createHookContext, isHookEvent } from "../hooks.js";
|
|
10
|
+
import { defineChannelPluginEntry } from "./channel-entry.js";
|
|
11
11
|
import { registerExtensionCliProgram } from "./channel-helpers.js";
|
|
12
12
|
import { lazyFunction, lazyModule } from "./lazy.js";
|
|
13
13
|
import { createMockExtensionApi, createTestGateway } from "./testing.js";
|
|
@@ -167,10 +167,83 @@ const MIME_TYPES = {
|
|
|
167
167
|
mov: "video/quicktime",
|
|
168
168
|
webm: "video/webm"
|
|
169
169
|
};
|
|
170
|
+
const RECENT_DIRECTORY_CONCURRENCY = 8;
|
|
171
|
+
const RECENT_RESOURCE_CONCURRENCY = 16;
|
|
170
172
|
function isWithin(root, target) {
|
|
171
173
|
const rel = relative(root, target);
|
|
172
174
|
return rel === "" || !rel.startsWith(`..${sep}`) && rel !== ".." && !isAbsolute(rel);
|
|
173
175
|
}
|
|
176
|
+
async function mapWithConcurrency(values, concurrency, mapper) {
|
|
177
|
+
const results = new Array(values.length);
|
|
178
|
+
let next = 0;
|
|
179
|
+
await Promise.all(Array.from({ length: Math.min(concurrency, values.length) }, async () => {
|
|
180
|
+
while (next < values.length) {
|
|
181
|
+
const index = next++;
|
|
182
|
+
results[index] = await mapper(values[index]);
|
|
183
|
+
}
|
|
184
|
+
}));
|
|
185
|
+
return results;
|
|
186
|
+
}
|
|
187
|
+
async function collectRecentCandidates(space, limit, maxFiles) {
|
|
188
|
+
const directories = [{
|
|
189
|
+
absolutePath: space.root,
|
|
190
|
+
displayPath: space.root
|
|
191
|
+
}];
|
|
192
|
+
const visited = /* @__PURE__ */ new Set();
|
|
193
|
+
const candidates = [];
|
|
194
|
+
let filesSeen = 0;
|
|
195
|
+
while (directories.length > 0 && filesSeen < maxFiles) {
|
|
196
|
+
const batch = directories.splice(0, RECENT_DIRECTORY_CONCURRENCY).filter((directory) => {
|
|
197
|
+
if (visited.has(directory.absolutePath)) return false;
|
|
198
|
+
visited.add(directory.absolutePath);
|
|
199
|
+
return true;
|
|
200
|
+
});
|
|
201
|
+
const scanned = await Promise.all(batch.map(async (directory) => {
|
|
202
|
+
const entries = [];
|
|
203
|
+
const handle = await opendir(directory.absolutePath).catch(() => null);
|
|
204
|
+
if (!handle) return entries;
|
|
205
|
+
for await (const entry of handle) if (!SKIPPED_NAMES.has(entry.name)) entries.push(entry);
|
|
206
|
+
return mapWithConcurrency(entries, RECENT_RESOURCE_CONCURRENCY, async (entry) => {
|
|
207
|
+
const absolutePath = resolve(directory.absolutePath, entry.name);
|
|
208
|
+
const displayPath = resolve(directory.displayPath, entry.name);
|
|
209
|
+
if (entry.isDirectory()) return { directory: {
|
|
210
|
+
absolutePath,
|
|
211
|
+
displayPath
|
|
212
|
+
} };
|
|
213
|
+
if (entry.isFile()) {
|
|
214
|
+
const info = await stat(absolutePath).catch(() => null);
|
|
215
|
+
return info?.isFile() ? { file: {
|
|
216
|
+
space,
|
|
217
|
+
absolutePath,
|
|
218
|
+
displayPath,
|
|
219
|
+
modifiedAt: Math.max(0, Math.round(info.mtimeMs))
|
|
220
|
+
} } : {};
|
|
221
|
+
}
|
|
222
|
+
if (!entry.isSymbolicLink()) return {};
|
|
223
|
+
const canonicalTarget = await realpath(absolutePath).catch(() => null);
|
|
224
|
+
if (!canonicalTarget || !isWithin(space.root, canonicalTarget)) return {};
|
|
225
|
+
const info = await stat(canonicalTarget).catch(() => null);
|
|
226
|
+
if (info?.isDirectory()) return { directory: {
|
|
227
|
+
absolutePath: canonicalTarget,
|
|
228
|
+
displayPath
|
|
229
|
+
} };
|
|
230
|
+
return info?.isFile() ? { file: {
|
|
231
|
+
space,
|
|
232
|
+
absolutePath: canonicalTarget,
|
|
233
|
+
displayPath,
|
|
234
|
+
modifiedAt: Math.max(0, Math.round(info.mtimeMs))
|
|
235
|
+
} } : {};
|
|
236
|
+
});
|
|
237
|
+
}));
|
|
238
|
+
for (const result of scanned.flat()) {
|
|
239
|
+
if (result.directory) directories.push(result.directory);
|
|
240
|
+
if (!result.file || filesSeen >= maxFiles) continue;
|
|
241
|
+
filesSeen += 1;
|
|
242
|
+
candidates.push(result.file);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
return candidates.sort((a, b) => b.modifiedAt - a.modifiedAt).slice(0, limit);
|
|
246
|
+
}
|
|
174
247
|
function normalizeRelativePath(input) {
|
|
175
248
|
const normalized = input.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\/+$/, "");
|
|
176
249
|
if (normalized.includes("\0") || normalized.split("/").some((part) => part === "..")) throw new FileServiceError(400, "Invalid file path");
|
|
@@ -439,6 +512,10 @@ var FileSpaceService = class {
|
|
|
439
512
|
}
|
|
440
513
|
return entries.sort((a, b) => a.kind === b.kind ? a.name.localeCompare(b.name) : a.kind === "directory" ? -1 : 1);
|
|
441
514
|
}
|
|
515
|
+
async recent(limit, maxFilesPerSpace = 5e3) {
|
|
516
|
+
const spaces = await this.list();
|
|
517
|
+
return (await mapWithConcurrency((await Promise.all(spaces.map((space) => collectRecentCandidates(space, limit, maxFilesPerSpace)))).flat().sort((a, b) => b.modifiedAt - a.modifiedAt).slice(0, limit), RECENT_RESOURCE_CONCURRENCY, async (candidate) => fileResourceFromPath(candidate.space, candidate.absolutePath, candidate.displayPath).catch(() => null))).filter((resource) => resource !== null);
|
|
518
|
+
}
|
|
442
519
|
};
|
|
443
520
|
//#endregion
|
|
444
521
|
export { FileServiceError, FileSpaceService, fileResourceFromPath, fileResourceId, fileSpaceId, parseFileResourceId, resolveFilePath };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
-
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
|
-
import {
|
|
5
|
-
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
3
|
+
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
6
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
7
|
-
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
8
5
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
6
|
+
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
7
|
+
import { applyAgentConfig, findAgentEntryIndex, getAgentDeleteBlocker, pruneAgentConfig, removeAgentDirsFromDisk } from "../commands/agents.config.js";
|
|
8
|
+
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
9
9
|
import { join, resolve } from "node:path";
|
|
10
10
|
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
11
11
|
//#region src/gateway/agents-admin.ts
|
|
@@ -442,9 +442,9 @@ function userMessageDisplayMetadata(value) {
|
|
|
442
442
|
if (!Array.isArray(rows)) return void 0;
|
|
443
443
|
const sourceContexts = rows.flatMap((value) => {
|
|
444
444
|
const row = asRecord(value);
|
|
445
|
-
if (row?.kind !== "note" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
445
|
+
if (row?.kind !== "note" && row?.kind !== "task" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
446
446
|
return [{
|
|
447
|
-
kind:
|
|
447
|
+
kind: row.kind,
|
|
448
448
|
sourceId: row.sourceId,
|
|
449
449
|
version: row.version,
|
|
450
450
|
title: row.title,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { getTailscaleExposureState } from "./tailscale-lifecycle.js";
|
|
2
|
-
import { resolveReverseProxyPublicUrl } from "./public-url.js";
|
|
3
1
|
import { getTunnelService } from "../tunnel/tunnel-service.js";
|
|
2
|
+
import { resolveReverseProxyPublicUrl } from "./public-url.js";
|
|
3
|
+
import { getTailscaleExposureState } from "./tailscale-lifecycle.js";
|
|
4
4
|
import crypto from "node:crypto";
|
|
5
5
|
//#region src/gateway/device-routes.ts
|
|
6
6
|
function secureUrl(value) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../config/paths-state.js";
|
|
2
2
|
import { init_agent_scope, resolveAgentProfileDir } from "../agent/agent-scope.js";
|
|
3
|
-
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
4
3
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
5
|
-
import {
|
|
4
|
+
import { init_paths, resolveConfigPath, resolveSkillsDir } from "../config/paths.js";
|
|
6
5
|
import { isBareProfileMarkdownFileName, resolveProfileMarkdownPathIfBareName } from "../agent/tools/tool-paths.js";
|
|
6
|
+
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
7
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
8
8
|
import { stat } from "node:fs/promises";
|
|
9
9
|
//#region src/gateway/file-path-classifier.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
3
|
import { listDevices } from "../../storage/sqlite/device-access-repository.js";
|
|
4
|
-
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
5
4
|
import { resolveAllowedBrowserOrigins, resolveGatewayServiceListenPort } from "../host.js";
|
|
6
5
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
6
|
+
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
7
|
+
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
7
8
|
import { maxSessionInputRequestBodyBytes } from "../chat-limits.js";
|
|
9
|
+
import { BROWSER_EXTENSION_ID } from "../../browser/extension-identity.js";
|
|
8
10
|
import { isLoopbackIpAddress, isTrustedProxyAddress } from "../client-ip.js";
|
|
9
|
-
import { resolveReverseProxyPublicUrl } from "../public-url.js";
|
|
10
|
-
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
11
11
|
import { buildGatewayConsoleCspHeader } from "../security/csp.js";
|
|
12
12
|
import { checkBrowserOrigin, isChromeExtensionOrigin } from "../security/origin-check.js";
|
|
13
13
|
import { auth } from "./middleware/auth.js";
|
|
@@ -180,8 +180,9 @@ function createHonoApp(config) {
|
|
|
180
180
|
};
|
|
181
181
|
const isFileUploadRequest = (path, method, contentType) => method === "POST" && /^\/api\/files\/spaces\/[^/]+\/upload$/.test(path) && contentType?.includes("multipart/form-data") === true;
|
|
182
182
|
const discussionUploadBodyMax = (path, method, contentType) => {
|
|
183
|
-
if (method !== "PUT"
|
|
184
|
-
if (/^\/api\/discussions\/[^/]+\/recording
|
|
183
|
+
if (method !== "PUT") return void 0;
|
|
184
|
+
if (/^\/api\/discussions\/[^/]+\/recording\/chunks\/\d+$/.test(path)) return 8 * 1024 * 1024;
|
|
185
|
+
if (contentType?.includes("multipart/form-data") !== true) return void 0;
|
|
185
186
|
if (/^\/api\/discussions\/[^/]+\/segments\/\d+$/.test(path)) return 2 * 1024 * 1024;
|
|
186
187
|
};
|
|
187
188
|
app.use("/api/skills/upload", bodyLimit({
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ContextPlanningConfigSchema, KnowledgeMemoryConfigSchema, UserModelConfigSchema, init_config } from "../../../user-context/config.js";
|
|
2
2
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
3
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
4
|
+
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
4
5
|
import { init_models_json, loadModelsJson } from "../../../config/models-json.js";
|
|
5
6
|
import { CredentialResolver, init_credentials } from "../../../auth/credentials.js";
|
|
6
|
-
import { buildChannelCatalogForConfig, buildChannelCatalogFromSnapshot, getChannelSetupStatus, init_channel_catalog_service } from "../../../channels/catalog/channel-catalog-service.js";
|
|
7
7
|
import { getProviderRegistry, init_plugin_registry } from "../../../providers/plugin-registry.js";
|
|
8
8
|
import { getAllProviders, init_providers, isProviderConfigured } from "../../../providers/index.js";
|
|
9
9
|
import { normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
10
|
+
import { resolveShareConfig } from "../../../share/share-config.js";
|
|
11
|
+
import { maskTunnelSecretForWeb } from "../../../tunnel/env.js";
|
|
10
12
|
import { resolveSessionConfigForWeb, resolveUpdateConfigForWeb } from "../../../config/web-patch.js";
|
|
11
13
|
import { GENERIC_MASKED_SECRET, maskSecretLength } from "./mask-secret-length.js";
|
|
12
14
|
import { safeToolsWebForGet } from "../../config-tools-web.js";
|
|
13
|
-
import { maskTunnelSecretForWeb } from "../../../tunnel/env.js";
|
|
14
|
-
import { resolveShareConfig } from "../../../share/share-config.js";
|
|
15
15
|
import { buildSafeProvidersConfigForWeb } from "./safe-providers-config.js";
|
|
16
16
|
import { maskRealtimeVoiceConfigForWeb, maskSttConfigForWeb, maskTtsConfigForWeb } from "./safe-voice-config.js";
|
|
17
17
|
//#region src/gateway/hono/lib/config-payload.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentModelsOverrideSchema, AgentProfileSchema, RuntimePolicySchema, SkillOverrideSchema, ToolPoliciesSchema, WorkflowPolicySchema } from "../../../agent-config/schema.js";
|
|
2
2
|
import { init_agent_config } from "../../../agent-config/index.js";
|
|
3
3
|
import { init_agent_scope, normalizeAgentId } from "../../../agent/agent-scope.js";
|
|
4
|
-
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
5
4
|
import { deleteAgentAvatarFile, finalizeCreateAgentDirs, getGatewayAgentEffectiveConfig, listAgentProfileFiles, listGatewayAgents, prepareCreateAgent, prepareDeleteAgent, prepareUpdateAgent, readAgentAvatarFile, readAgentProfileFile, runAfterDeletePurge, writeAgentAvatarFromBase64, writeAgentProfileFile } from "../../agents-admin.js";
|
|
5
|
+
import { getVoiceModelsConfig } from "../../../config/voice.js";
|
|
6
6
|
//#region src/gateway/hono/routes/agents.ts
|
|
7
7
|
init_agent_config();
|
|
8
8
|
init_agent_scope();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAllModels, getAvailableModels, init_providers } from "../../../providers/index.js";
|
|
2
|
-
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
3
2
|
import { ActivationPlanner } from "../../../extensions/activation-planner.js";
|
|
3
|
+
import { mergeActivationContext } from "../../../extensions/activation-context.js";
|
|
4
4
|
import { fetchRegistry, listExtensions, searchExtensions } from "../../../extensions/marketplace.js";
|
|
5
5
|
import { buildWhenContextSnapshot } from "../../../extensions/when-context.js";
|
|
6
6
|
import { createOAuthAsyncHandler } from "../oauth-async.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { deleteBrowserTabBinding, getBrowserTabBinding, setBrowserTabBinding } from "../../../storage/sqlite/browser-tab-binding-repository.js";
|
|
2
2
|
import { browserTabBindingRequestSchema } from "../../../../packages/gateway-contract/src/browser-tab-binding.js";
|
|
3
3
|
import { getDevice } from "../../../storage/sqlite/device-access-repository.js";
|
|
4
|
-
import { decideBrowserApproval, listBrowserApprovals } from "../../../browser/policy/approval-store.js";
|
|
5
4
|
import "../../../../packages/browser-control-contract/src/index.js";
|
|
5
|
+
import { decideBrowserApproval, listBrowserApprovals } from "../../../browser/policy/approval-store.js";
|
|
6
6
|
import { createBrowserDriver } from "../../../browser/drivers/create-driver.js";
|
|
7
7
|
import { checkBrowserReadiness } from "../../../browser/readiness.js";
|
|
8
8
|
import { isLoopbackClientIp } from "../../security/loopback.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
2
1
|
import { effectiveWorkspacePathForSession } from "../../../session/session-workspace.js";
|
|
3
2
|
import { getProjectForSession } from "../../../projects/workspace.js";
|
|
4
|
-
import { buildReviewContext, resolveGitRoot } from "../../../review/review-git.js";
|
|
5
|
-
import "../../../chat-commands/index.js";
|
|
6
3
|
import { isRegisteredProvider } from "../../../agent/skills/marketplace/registry.js";
|
|
7
4
|
import "../../../agent/skills/skills-marketplace.js";
|
|
8
5
|
import { isSkillInstallTarget } from "../../../agent/skills/install-target.js";
|
|
6
|
+
import { commandRegistry } from "../../../chat-commands/registry.js";
|
|
7
|
+
import { buildReviewContext, resolveGitRoot } from "../../../review/review-git.js";
|
|
8
|
+
import "../../../chat-commands/index.js";
|
|
9
9
|
//#region src/gateway/hono/routes/commands-skills.ts
|
|
10
10
|
function parseMarketplaceProviderQuery(raw) {
|
|
11
11
|
const v = raw?.trim().toLowerCase();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_public_url, validatePublicUrl } from "../../../../config/public-url.js";
|
|
2
2
|
import { isValidIPv4 } from "../../../../config/gateway-bind.js";
|
|
3
|
-
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
4
3
|
import { mergeShareConfigPatch } from "../../../../share/share-config.js";
|
|
5
4
|
import { mergeSiteShareConfigPatch } from "../../../../share/site-share-config.js";
|
|
5
|
+
import { isMaskedSecretPatchValue } from "../../lib/mask-secret-length.js";
|
|
6
6
|
import { PATCH_OK, patchError } from "./result.js";
|
|
7
7
|
//#region src/gateway/hono/routes/config-patch/gateway.ts
|
|
8
8
|
init_public_url();
|
|
@@ -7,7 +7,6 @@ import { setAssertionStatus } from "../../../user-model/repository.js";
|
|
|
7
7
|
import "../../../user-model/index.js";
|
|
8
8
|
import { listConnectedContentCandidates, readConnectedContent } from "../../../connectors/content-enrichment.js";
|
|
9
9
|
import { getUnderstandingSourceGrant, listUnderstandingSourceGrants, listUnderstandingSourceRuns, revokeUnderstandingSourceGrant, updateUnderstandingSourceGrantPolicies } from "../../../user-context/sources/repository.js";
|
|
10
|
-
import { getWorkDiscoveryService } from "./work-discovery.js";
|
|
11
10
|
import { listUnderstandingSourceDefinitions } from "../../../user-context/sources/catalog.js";
|
|
12
11
|
import { randomUUID } from "node:crypto";
|
|
13
12
|
//#region src/gateway/hono/routes/context-sources.ts
|
|
@@ -38,7 +37,7 @@ function markContextSourceAssertionsForReview(grantId) {
|
|
|
38
37
|
return ids.length;
|
|
39
38
|
}
|
|
40
39
|
function registerContextSourceRoutes(authenticated, deps) {
|
|
41
|
-
const service =
|
|
40
|
+
const service = deps.service.workDiscovery;
|
|
42
41
|
const limited = deps.strictRateLimitMiddleware;
|
|
43
42
|
authenticated.get("/api/context-sources/catalog", (c) => {
|
|
44
43
|
const requested = c.req.query("platform");
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import { DISCUSSION_STATUSES } from "
|
|
2
|
-
import {
|
|
1
|
+
import { DISCUSSION_STATUSES } from "../../../../packages/gateway-contract/src/discussions.js";
|
|
2
|
+
import { hasGatewayScope } from "../../security/gateway-scopes.js";
|
|
3
|
+
import { DiscussionServiceError } from "../../../discussions/errors.js";
|
|
4
|
+
import { convertMeetingAction, meetingActionTasks } from "../../../discussions/action-tasks.js";
|
|
5
|
+
import { MeetingEditSchema } from "../../../discussions/edits.js";
|
|
6
|
+
import { exportDiscussion } from "../../../discussions/export.js";
|
|
3
7
|
import "../../../discussions/index.js";
|
|
8
|
+
import { getGatewayPrincipal } from "../../security/gateway-principal.js";
|
|
9
|
+
import { createReadStream } from "node:fs";
|
|
10
|
+
import { stat } from "node:fs/promises";
|
|
11
|
+
import { Readable } from "node:stream";
|
|
4
12
|
//#region src/gateway/hono/routes/discussions.ts
|
|
5
13
|
function errorResponse(error) {
|
|
6
14
|
if (!(error instanceof DiscussionServiceError)) return null;
|
|
@@ -42,7 +50,8 @@ function registerDiscussionRoutes(authenticated, deps) {
|
|
|
42
50
|
clientRequestId: typeof body.clientRequestId === "string" ? body.clientRequestId : "",
|
|
43
51
|
...typeof body.contextProjectId === "string" && body.contextProjectId.trim() ? { contextProjectId: body.contextProjectId.trim() } : {},
|
|
44
52
|
consentPolicyVersion: Number(body.consentPolicyVersion),
|
|
45
|
-
source: body.source === "electron" ? "electron" : "web"
|
|
53
|
+
source: body.source === "mobile" ? "mobile" : body.source === "electron" ? "electron" : "web",
|
|
54
|
+
...body.recordedAt !== void 0 ? { recordedAt: typeof body.recordedAt === "number" ? body.recordedAt : NaN } : {}
|
|
46
55
|
});
|
|
47
56
|
return c.json(detail, 201);
|
|
48
57
|
} catch (error) {
|
|
@@ -74,7 +83,7 @@ function registerDiscussionRoutes(authenticated, deps) {
|
|
|
74
83
|
return detail ? c.json(detail) : c.json({ error: "Discussion not found" }, 404);
|
|
75
84
|
});
|
|
76
85
|
authenticated.get("/api/discussions/:id/transcript", (c) => {
|
|
77
|
-
const transcript = service.discussions.transcript(c.req.param("id"));
|
|
86
|
+
const transcript = service.discussions.transcript(c.req.param("id"), c.req.query("revision") === void 0 ? void 0 : Number(c.req.query("revision")));
|
|
78
87
|
return transcript ? c.json(transcript) : c.json({ error: "Discussion not found" }, 404);
|
|
79
88
|
});
|
|
80
89
|
authenticated.put("/api/discussions/:id/segments/:sequence", mediaRateLimitMiddleware, async (c) => {
|
|
@@ -107,36 +116,134 @@ function registerDiscussionRoutes(authenticated, deps) {
|
|
|
107
116
|
authenticated.patch("/api/discussions/:id/segments/:sequence", strictRateLimitMiddleware, async (c) => {
|
|
108
117
|
const body = await c.req.json().catch(() => ({}));
|
|
109
118
|
try {
|
|
110
|
-
return c.json(service.discussions.correctSegment(c.req.param("id"), Number.parseInt(c.req.param("sequence"), 10), typeof body.displayText === "string" ? body.displayText : "", Number(body.expectedRevision)));
|
|
119
|
+
return c.json(service.discussions.correctSegment(c.req.param("id"), Number.parseInt(c.req.param("sequence"), 10), typeof body.displayText === "string" ? body.displayText : "", Number(body.expectedRevision), typeof body.speakerLabel === "string" ? body.speakerLabel : void 0, body.applyToSpeakerGroup === true, typeof body.expectedTranscriptRevision === "number" ? body.expectedTranscriptRevision : void 0));
|
|
111
120
|
} catch (error) {
|
|
112
121
|
const response = errorResponse(error);
|
|
113
122
|
if (response) return c.json(response.body, response.status);
|
|
114
123
|
throw error;
|
|
115
124
|
}
|
|
116
125
|
});
|
|
117
|
-
authenticated.
|
|
118
|
-
const body = await
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
126
|
+
authenticated.post("/api/discussions/:id/organize", strictRateLimitMiddleware, async (c) => {
|
|
127
|
+
const body = await c.req.json().catch(() => ({}));
|
|
128
|
+
try {
|
|
129
|
+
return c.json(await service.discussions.reorganize(c.req.param("id"), typeof body.template === "string" ? body.template : "general"), 202);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
const response = errorResponse(error);
|
|
132
|
+
if (response) return c.json(response.body, response.status);
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
authenticated.patch("/api/discussions/:id/summary", strictRateLimitMiddleware, async (c) => {
|
|
137
|
+
const parsed = MeetingEditSchema.safeParse(await c.req.json().catch(() => null));
|
|
138
|
+
if (!parsed.success) return c.json({ error: "Invalid meeting edit" }, 400);
|
|
122
139
|
try {
|
|
123
|
-
|
|
124
|
-
name: file.name,
|
|
125
|
-
buffer: Buffer.from(await file.arrayBuffer()),
|
|
126
|
-
mimeType: file.type
|
|
127
|
-
}, Number(body.durationMs));
|
|
128
|
-
return detail ? c.json(detail, 201) : c.json({ error: "Discussion not found" }, 404);
|
|
140
|
+
return c.json(service.discussions.editSummary(c.req.param("id"), parsed.data));
|
|
129
141
|
} catch (error) {
|
|
130
142
|
const response = errorResponse(error);
|
|
131
143
|
if (response) return c.json(response.body, response.status);
|
|
132
144
|
throw error;
|
|
133
145
|
}
|
|
134
146
|
});
|
|
135
|
-
authenticated.
|
|
147
|
+
authenticated.get("/api/discussions/:id/actions", async (c) => {
|
|
148
|
+
if (!await service.discussions.get(c.req.param("id"))) return c.json({ error: "Discussion not found" }, 404);
|
|
149
|
+
return c.json(meetingActionTasks(c.req.param("id")));
|
|
150
|
+
});
|
|
151
|
+
authenticated.post("/api/discussions/:id/actions/:actionId/convert", strictRateLimitMiddleware, async (c) => {
|
|
152
|
+
if (!hasGatewayScope(getGatewayPrincipal(c).scopes, "tasks.write")) return c.json({ error: "Task write permission required" }, 403);
|
|
136
153
|
const body = await c.req.json().catch(() => ({}));
|
|
137
154
|
try {
|
|
138
|
-
|
|
139
|
-
|
|
155
|
+
return c.json(convertMeetingAction(c.req.param("id"), c.req.param("actionId"), Number(body.organizationRevision)));
|
|
156
|
+
} catch (error) {
|
|
157
|
+
const response = errorResponse(error);
|
|
158
|
+
if (response) return c.json(response.body, response.status);
|
|
159
|
+
throw error;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
authenticated.get("/api/discussions/:id/export", async (c) => {
|
|
163
|
+
const detail = await service.discussions.get(c.req.param("id"));
|
|
164
|
+
if (!detail) return c.json({ error: "Discussion not found" }, 404);
|
|
165
|
+
const format = c.req.query("format") ?? "md";
|
|
166
|
+
try {
|
|
167
|
+
const text = exportDiscussion(detail, format);
|
|
168
|
+
c.header("Content-Disposition", `attachment; filename="meeting.${format}"`);
|
|
169
|
+
c.header("Cache-Control", "no-store");
|
|
170
|
+
return c.text(text);
|
|
171
|
+
} catch (error) {
|
|
172
|
+
const response = errorResponse(error);
|
|
173
|
+
if (response) return c.json(response.body, response.status);
|
|
174
|
+
throw error;
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
authenticated.get("/api/discussions/:id/audio", async (c) => {
|
|
178
|
+
const detail = await service.discussions.get(c.req.param("id"));
|
|
179
|
+
if (!detail?.discussion.audioAttachmentId || detail.discussion.audioDeletedAt) return c.json({ error: "Recording unavailable" }, 404);
|
|
180
|
+
const attachment = await service.notesServiceInstance.getAttachmentPath(detail.note.id, detail.discussion.audioAttachmentId);
|
|
181
|
+
if (!attachment) return c.json({ error: "Recording unavailable" }, 404);
|
|
182
|
+
const info = await stat(attachment.filePath).catch(() => null);
|
|
183
|
+
if (!info) return c.json({ error: "Recording unavailable" }, 404);
|
|
184
|
+
let start = 0;
|
|
185
|
+
let end = info.size - 1;
|
|
186
|
+
const range = c.req.header("range");
|
|
187
|
+
if (range) {
|
|
188
|
+
const match = /^bytes=(\d*)-(\d*)$/.exec(range);
|
|
189
|
+
if (!match || !match[1] && !match[2]) return c.body(null, 416, { "Content-Range": `bytes */${info.size}` });
|
|
190
|
+
if (!match[1]) start = Math.max(0, info.size - Number(match[2]));
|
|
191
|
+
else {
|
|
192
|
+
start = Number(match[1]);
|
|
193
|
+
if (match[2]) end = Math.min(end, Number(match[2]));
|
|
194
|
+
}
|
|
195
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(end) || start > end || start >= info.size) return c.body(null, 416, { "Content-Range": `bytes */${info.size}` });
|
|
196
|
+
c.header("Content-Range", `bytes ${start}-${end}/${info.size}`);
|
|
197
|
+
}
|
|
198
|
+
c.header("Content-Type", attachment.mimeType);
|
|
199
|
+
c.header("Accept-Ranges", "bytes");
|
|
200
|
+
c.header("Content-Length", String(end - start + 1));
|
|
201
|
+
c.header("Cache-Control", "no-store");
|
|
202
|
+
return c.body(Readable.toWeb(createReadStream(attachment.filePath, {
|
|
203
|
+
start,
|
|
204
|
+
end
|
|
205
|
+
})), range ? 206 : 200);
|
|
206
|
+
});
|
|
207
|
+
authenticated.get("/api/discussions/:id/recording/chunks", (c) => {
|
|
208
|
+
try {
|
|
209
|
+
return c.json(service.discussions.recordingChunks(c.req.param("id")));
|
|
210
|
+
} catch (error) {
|
|
211
|
+
const response = errorResponse(error);
|
|
212
|
+
if (response) return c.json(response.body, response.status);
|
|
213
|
+
throw error;
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
authenticated.put("/api/discussions/:id/recording/chunks/:sequence", mediaRateLimitMiddleware, async (c) => {
|
|
217
|
+
if (!c.req.raw.body) return c.json({ error: "Missing audio body" }, 400);
|
|
218
|
+
try {
|
|
219
|
+
return c.json(await service.discussions.uploadRecordingChunk(c.req.param("id"), Number(c.req.param("sequence")), c.req.header("x-audio-sha256") ?? "", c.req.raw.body), 201);
|
|
220
|
+
} catch (error) {
|
|
221
|
+
const response = errorResponse(error);
|
|
222
|
+
if (response) return c.json(response.body, response.status);
|
|
223
|
+
throw error;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
authenticated.get("/api/discussions/:id/recording/job", (c) => {
|
|
227
|
+
try {
|
|
228
|
+
const job = service.discussions.recordingJob(c.req.param("id"));
|
|
229
|
+
return job ? c.json(job) : c.json({ error: "Recording job not found" }, 404);
|
|
230
|
+
} catch (error) {
|
|
231
|
+
const response = errorResponse(error);
|
|
232
|
+
if (response) return c.json(response.body, response.status);
|
|
233
|
+
throw error;
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
authenticated.post("/api/discussions/:id/capture/seal", strictRateLimitMiddleware, async (c) => {
|
|
237
|
+
const body = await c.req.json().catch(() => ({}));
|
|
238
|
+
if (body.containerMode !== void 0 && body.containerMode !== "independent_wav") return c.json({ error: "Unsupported container mode" }, 400);
|
|
239
|
+
try {
|
|
240
|
+
return c.json(await service.discussions.sealRecording(c.req.param("id"), {
|
|
241
|
+
lastSequence: Number(body.lastSequence),
|
|
242
|
+
chunkCount: Number(body.chunkCount),
|
|
243
|
+
mimeType: typeof body.mimeType === "string" ? body.mimeType : "",
|
|
244
|
+
fileName: typeof body.fileName === "string" ? body.fileName : "",
|
|
245
|
+
...body.containerMode === "independent_wav" ? { containerMode: "independent_wav" } : {}
|
|
246
|
+
}), 202);
|
|
140
247
|
} catch (error) {
|
|
141
248
|
const response = errorResponse(error);
|
|
142
249
|
if (response) return c.json(response.body, response.status);
|
|
@@ -34,25 +34,6 @@ function contentDisposition(disposition, fileName) {
|
|
|
34
34
|
const sanitized = fileName.replace(/[\u0000-\u001f\u007f]/g, "_");
|
|
35
35
|
return `${disposition}; filename="${sanitized.replace(/[^\x20-\x7e]/g, "_").replace(/["\\]/g, "_")}"; filename*=UTF-8''${encodeURIComponent(sanitized).replace(/['()*]/g, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`)}`;
|
|
36
36
|
}
|
|
37
|
-
async function collectFiles(files, spaceId, max) {
|
|
38
|
-
const output = [];
|
|
39
|
-
const directories = [""];
|
|
40
|
-
const visited = /* @__PURE__ */ new Set();
|
|
41
|
-
const space = await files.get(spaceId);
|
|
42
|
-
while (directories.length && output.length < max) {
|
|
43
|
-
const directory = directories.shift();
|
|
44
|
-
const canonical = await resolveFilePath(space.root, directory).catch(() => null);
|
|
45
|
-
if (!canonical || visited.has(canonical)) continue;
|
|
46
|
-
visited.add(canonical);
|
|
47
|
-
const children = await files.children(spaceId, directory);
|
|
48
|
-
for (const child of children) {
|
|
49
|
-
if (child.kind === "directory") directories.push(child.relativePath);
|
|
50
|
-
else output.push(child);
|
|
51
|
-
if (output.length >= max) break;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return output;
|
|
55
|
-
}
|
|
56
37
|
function registerFilesRoutes(authenticated, deps) {
|
|
57
38
|
const files = getGatewayFileSpaceService(deps.service);
|
|
58
39
|
registerFileReferenceRoutes(authenticated, deps);
|
|
@@ -96,9 +77,7 @@ function registerFilesRoutes(authenticated, deps) {
|
|
|
96
77
|
authenticated.get("/api/files/recent", async (c) => {
|
|
97
78
|
try {
|
|
98
79
|
const limit = Math.min(100, Math.max(1, Number(c.req.query("limit")) || 50));
|
|
99
|
-
|
|
100
|
-
const items = (await Promise.all(spaces.map((space) => collectFiles(files, space.id, 5e3)))).flat().sort((a, b) => b.modifiedAt - a.modifiedAt).slice(0, limit);
|
|
101
|
-
return c.json({ items });
|
|
80
|
+
return c.json({ items: await files.recent(limit) });
|
|
102
81
|
} catch (error) {
|
|
103
82
|
return errorResponse(c, error);
|
|
104
83
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { registerConnectionWaitRoutes } from "./connection-waits.js";
|
|
2
2
|
import { registerActivityRoutes } from "./activity.js";
|
|
3
3
|
import { registerAgentStreamRoutes } from "./agent-stream.js";
|
|
4
|
-
import { registerDiscussionRoutes } from "./discussions.js";
|
|
5
4
|
import { registerSessionsRoutes } from "./sessions.js";
|
|
6
5
|
import { registerExecutionEnvironmentRoutes } from "./execution-environments.js";
|
|
7
6
|
import { registerSideChatRoutes } from "./side-chats.js";
|
|
@@ -32,7 +31,6 @@ function registerCoreAuthenticatedRoutes(authenticated, deps) {
|
|
|
32
31
|
registerExecutionEnvironmentRoutes(authenticated, deps);
|
|
33
32
|
registerSideChatRoutes(authenticated, deps);
|
|
34
33
|
registerActivityRoutes(authenticated, deps);
|
|
35
|
-
registerDiscussionRoutes(authenticated, deps);
|
|
36
34
|
registerProjectsRoutes(authenticated, deps);
|
|
37
35
|
registerProjectSkillRoutes(authenticated, deps);
|
|
38
36
|
registerLocalAppsRoutes(authenticated, deps);
|
|
@@ -3,6 +3,14 @@ function startsWithAny(path, prefixes) {
|
|
|
3
3
|
return prefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
4
4
|
}
|
|
5
5
|
const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
6
|
+
{
|
|
7
|
+
id: "project-understanding",
|
|
8
|
+
match: (path) => /^\/api\/projects\/[^/]+\/understanding$/.test(path),
|
|
9
|
+
load: async () => {
|
|
10
|
+
const { registerProjectUnderstandingRoutes } = await import("./project-understanding.js");
|
|
11
|
+
return { register: registerProjectUnderstandingRoutes };
|
|
12
|
+
}
|
|
13
|
+
},
|
|
6
14
|
{
|
|
7
15
|
id: "browser-session",
|
|
8
16
|
match: (path) => path === "/api/browser-session",
|
|
@@ -210,6 +218,14 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
210
218
|
return { register: registerAutomationRoutes };
|
|
211
219
|
}
|
|
212
220
|
},
|
|
221
|
+
{
|
|
222
|
+
id: "discussions",
|
|
223
|
+
match: (path) => path === "/api/discussions" || path.startsWith("/api/discussions/") || path === "/api/discussion-capture/settings",
|
|
224
|
+
load: async () => {
|
|
225
|
+
const { registerDiscussionRoutes } = await import("./discussions.js");
|
|
226
|
+
return { register: registerDiscussionRoutes };
|
|
227
|
+
}
|
|
228
|
+
},
|
|
213
229
|
{
|
|
214
230
|
id: "notes",
|
|
215
231
|
match: (path) => startsWithAny(path, ["/api/notes"]) && !/^\/api\/notes\/[^/]+\/hosted-publications(?:\/.*)?$/.test(path),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
2
|
-
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
3
1
|
import { canonicalizeConfiguredMcpServer, normalizeConfiguredMcpServers } from "../../../config/mcp-config-normalize.js";
|
|
4
2
|
import { loadMergedBundleMcpConfig } from "../../../agent/mcp/bundle-mcp-config.js";
|
|
3
|
+
import { isManagedConnectorServer } from "../../../connectors/materialize.js";
|
|
4
|
+
import { getWorkspacePath } from "../../../config/workspace-path-helpers.js";
|
|
5
5
|
import { getMcpOAuthManager } from "../../../agent/mcp/oauth/mcp-oauth-manager.js";
|
|
6
6
|
import { listBundleMcpServerCapabilitiesForGateway, listBundleMcpServerToolsForGateway } from "../../../agent/mcp/bundle-mcp-gateway.js";
|
|
7
7
|
//#region src/gateway/hono/routes/mcp.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../../chat-limits.js";
|
|
2
1
|
import { mimeTypeFromMediaPath, saveMediaBuffer } from "../../../media/store.js";
|
|
3
2
|
import { readMediaReference } from "../../../media/media-reference.js";
|
|
3
|
+
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../../chat-limits.js";
|
|
4
4
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
5
5
|
import { resolveScopedMediaReference } from "../../media-access.js";
|
|
6
6
|
//#region src/gateway/hono/routes/media.ts
|