@xopcai/xopc 0.0.230 → 0.0.232
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/schema/config-schema.d.ts +3 -3
- package/dist/extensions/telegram/src/config-schema.d.ts +4 -4
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/config-schema.d.ts +3 -3
- package/dist/gateway/static/root/assets/{activity-store-M0nAY5XB.js → activity-store-VXCWz43N.js} +1 -1
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-BXRaZYW8.js +1 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-dR7HMaRX.js +1 -0
- package/dist/gateway/static/root/assets/agents-Bileycwe.js +1 -0
- package/dist/gateway/static/root/assets/api-wGPgL8xY.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CwAPK4Jm.js → app-management-settings-panel-BJfClfPx.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DsGLvqTb.js → appearance-settings-C_R0vUAu.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Ee9qOQEx.js → apps-page-CBow8pBI.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-7_DXaMTP.js → archive-plugin-DnFHkSHE.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B4qqigAQ.js → attachment-load-DZrEwytM.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-B8ImehSW.js → automations-page-DpkKajui.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BBntVWgv.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DaJbyYc2.js → binary-plugins-Ckc_Csue.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Kl25XWJc.js → block-editor-DAC6w-iV.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page-DrsMd-Po.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-BGd7R8GO.js +1 -0
- package/dist/gateway/static/root/assets/{browser-workflows-page-DjMxs33B.js → browser-workflows-page-DUfj7ntM.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-97gkGeSV.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-CuBsz8UI.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-C5ABr73b.js → channels-status-swr-CfboECLt.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BiU_4Rq6.js → chat-terminal-dock-CA9fndbZ.js} +2 -2
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
- package/dist/gateway/static/root/assets/{code-editor-dFzqyDXS.js → code-editor-D4_k-6QN.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-SuL7td7Z.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-CqPu7HYJ.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-C8dJsCgk.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-Iz2wYimy.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-ux9DxchT.js → desktop-pet-C3h40FmG.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-BVVCBgYK.js → desktop-pet-settings-YfeVVzLe.js} +1 -1
- package/dist/gateway/static/root/assets/dist-DqPZM2MH2.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-Dh6DDuvQ.js → extension-debug-page-CChgztz_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-8OKQDEat.js → extension-page-DF6ct6_y.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-jgBsjn0F.js +1 -0
- package/dist/gateway/static/root/assets/files-Dp8_uGTO.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-Dlc6eaTG.js → gateway-config-api-CVajuIGL.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-BGQn8duh.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-DqQgiAUv.js → gateway-settings-BbssNGid.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B_zrtccP.js → gateway-startup-retry-D2Rnh9fX.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-CJtXu8iD.js +1 -0
- package/dist/gateway/static/root/assets/home-page-Be1o1AXQ.js +1 -0
- package/dist/gateway/static/root/assets/html-workspace-editor-C3DKAkMc.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-YKP2me5Z.js → image-generation-api-D7W2p5_8.js} +1 -1
- package/dist/gateway/static/root/assets/index-B2OJSXX9.js +70 -0
- package/dist/gateway/static/root/assets/index-rHjAElxG.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BSFNqxzY.js → keyboard-shortcuts-settings-BvHYyNus.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-COfelgk7.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-DzU6yZ9-.js → local-apps-page-Cb8t2wWM.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-DLwVxS3V.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-DA8oDjeB.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-B8Jie4-J.js +1 -0
- package/dist/gateway/static/root/assets/markdown-editor-nDLmA_LF.js +2 -0
- package/dist/gateway/static/root/assets/markdown-split-BD1r4o2i.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DvM5PWEH.js → markdown-view-B-BHEcNd.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-B1bGSQqt.css +1 -0
- package/dist/gateway/static/root/assets/{media-plugins-B8vMe5VX.js → media-plugins-BCev8fkW.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Dp1OxSKt.js +3 -0
- package/dist/gateway/static/root/assets/mobile-device-api-DACoHhhk.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-C8zjqmIv.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BFsOGYkd.js → notes-api-DEdNKw0I.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-B-YZ7iuK.js → notes-page-BBTLjJwa.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DICgUGPv.js +4 -0
- package/dist/gateway/static/root/assets/oauth-api-BNCO2YK5.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-3E24E65N.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DkWcyki5.js → product-open-page-fEBbRekH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CqdkznYJ.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-dHDXpMCg.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BFZrVYfy.js → registry-api-Cvr4Qm7N.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-2feZudJw.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bq_ETeal.js → runtime-tools-settings-panel-BT5B74IH.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BogTlrsP.js → schema-form-C4tB34S5.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-CO2JCFdy.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DxMVaqdn.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Coy1Cbp6.js → settings-form-section-D1oXhkgI.js} +1 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-CldfX6FJ.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-c3LJnbvE.js +1 -0
- package/dist/gateway/static/root/assets/settings-shell-layer-context-DCp6ykjQ.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-DZNHb6A5.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-DptCK_mk.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DakZ2AGN.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-BOiNkWJC.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-Brxb6QnW.js → skills-page-OHBeBtSg.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-FB5LtEGm.js → skills-page.utils-B9WZbOLC.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-ChosWt8n.js → system-settings-panel-Dj_DpOGw.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-D5Nbe3C8.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-Cpd3Gd5R.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-2SqnmSKD.js → use-autosave-DCl5Yq7N.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-CAPSUK8B.js +1 -0
- package/dist/gateway/static/root/assets/{vendor-codemirror-DRr7hFaD.js → vendor-codemirror--gTq3YAI.js} +16 -16
- package/dist/gateway/static/root/assets/voice-api-key-field-BB_ZQV8F.js +1 -0
- package/dist/gateway/static/root/assets/voice-config-api-BNiYmpl5.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CK3aZDdE.js → work-discovery-overlay-BrIdtdum.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BjOuddkX.js → workflow-run-setup-panel-hKh-uCLo.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-ahDvypGO.js +5 -0
- package/dist/gateway/static/root/index.html +19 -15
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-manager.d.ts +1 -2
- package/dist/src/agent/agent-manager.js +29 -44
- package/dist/src/agent/background-review/run-background-review.js +10 -15
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +3 -13
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +13 -14
- package/dist/src/agent/mcp/bundle-mcp-policy.d.ts +0 -9
- package/dist/src/agent/mcp/bundle-mcp-policy.js +1 -13
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +1 -1
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/media-generation/runtime-shared.d.ts +1 -1
- package/dist/src/agent/media-generation/runtime-shared.js +1 -1
- package/dist/src/agent/memory/create-memory-manager.js +1 -1
- package/dist/src/agent/memory/manager.d.ts +1 -1
- package/dist/src/{agent-runtime/memory-runtime.d.ts → agent/memory/runtime.d.ts} +1 -1
- package/dist/src/{agent-runtime/memory-runtime.js → agent/memory/runtime.js} +2 -3
- package/dist/src/agent/orchestration/agent-orchestrator.d.ts +0 -3
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -3
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +2 -2
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -3
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/starter-agents.js +1 -8
- package/dist/src/agent/tools/executor.d.ts +1 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -5
- package/dist/src/agent/tools/write.js +9 -12
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-config/index.d.ts +2 -0
- package/dist/src/agent-config/index.js +11 -0
- package/dist/src/agent-config/resolver.d.ts +11 -0
- package/dist/src/agent-config/resolver.js +113 -0
- package/dist/src/agent-config/schema.d.ts +491 -0
- package/dist/src/agent-config/schema.js +172 -0
- package/dist/src/auth/oauth/index.js +2 -2
- package/dist/src/auth/oauth/registry.d.ts +1 -1
- package/dist/src/auth/oauth/registry.js +5 -1
- package/dist/src/auth/oauth/xopc-cloud.d.ts +1 -0
- package/dist/src/auth/oauth/xopc-cloud.js +8 -2
- 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/config-paths.js +1 -1
- package/dist/src/cli/commands/agents.js +2 -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 +12 -4
- package/dist/src/cli/commands/image.js +3 -4
- package/dist/src/cli/commands/models.js +9 -3
- package/dist/src/cli/commands/onboard/model.js +12 -11
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -18
- package/dist/src/cli/utils/init-workspace-core.d.ts +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/commands/agents.config.d.ts +1 -3
- package/dist/src/commands/agents.config.js +9 -26
- package/dist/src/config/agent-model-intents.d.ts +10 -0
- package/dist/src/config/agent-model-intents.js +39 -0
- package/dist/src/config/agent-profile.d.ts +7 -9
- package/dist/src/config/agent-profile.js +30 -28
- package/dist/src/config/default-model.d.ts +1 -11
- package/dist/src/config/default-model.js +3 -11
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/integration.d.ts +1 -1
- package/dist/src/config/reload.js +1 -1
- package/dist/src/config/rules.js +3 -3
- package/dist/src/config/schema.d.ts +187 -452
- package/dist/src/config/schema.js +53 -131
- package/dist/src/extensions/activation-context.js +7 -11
- package/dist/src/files/file-service.d.ts +36 -0
- package/dist/src/files/file-service.js +282 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +250 -6
- package/dist/src/gateway/agent-builtin-tools.js +284 -46
- package/dist/src/gateway/agents-admin.d.ts +20 -62
- package/dist/src/gateway/agents-admin.js +36 -228
- package/dist/src/gateway/device-routes.d.ts +3 -0
- package/dist/src/gateway/device-routes.js +47 -0
- package/dist/src/gateway/global-defaults-admin.d.ts +6 -20
- package/dist/src/gateway/global-defaults-admin.js +20 -120
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/app.js +6 -4
- package/dist/src/gateway/hono/lib/config-payload.d.ts +54 -137
- package/dist/src/gateway/hono/lib/config-payload.js +2 -4
- package/dist/src/gateway/hono/middleware/auth.js +33 -1
- package/dist/src/gateway/hono/middleware/scopes.d.ts +2 -12
- package/dist/src/gateway/hono/middleware/scopes.js +9 -18
- package/dist/src/gateway/hono/routes/agents.js +64 -100
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/device-push.d.ts +2 -0
- package/dist/src/gateway/hono/routes/{mobile.js → device-push.js} +40 -18
- package/dist/src/gateway/hono/routes/devices.d.ts +4 -0
- package/dist/src/gateway/hono/routes/devices.js +214 -0
- package/dist/src/gateway/hono/routes/files.d.ts +3 -0
- package/dist/src/gateway/hono/routes/files.js +176 -0
- package/dist/src/gateway/hono/routes/global-defaults.js +5 -9
- package/dist/src/gateway/hono/routes/index.js +4 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +12 -20
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +0 -508
- package/dist/src/gateway/hono/routes/realtime.js +8 -1
- package/dist/src/gateway/hono/routes/shares.js +410 -21
- package/dist/src/gateway/hono/routes/status.js +9 -16
- package/dist/src/gateway/hono/routes/tunnel.d.ts +0 -2
- package/dist/src/gateway/hono/routes/tunnel.js +10 -199
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/workspace.js +15 -974
- package/dist/src/gateway/image-generation-setup.d.ts +2 -2
- package/dist/src/gateway/image-generation-setup.js +8 -7
- package/dist/src/gateway/public-url.d.ts +1 -1
- package/dist/src/gateway/security/gateway-principal.d.ts +11 -0
- package/dist/src/gateway/security/gateway-principal.js +12 -0
- package/dist/src/gateway/security/gateway-scopes.d.ts +7 -0
- package/dist/src/gateway/security/gateway-scopes.js +66 -0
- package/dist/src/gateway/security/index.d.ts +2 -1
- package/dist/src/gateway/security/index.js +3 -2
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +19 -21
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/migrations/index.d.ts +0 -1
- package/dist/src/migrations/index.js +1 -2
- package/dist/src/migrations/runner.js +1 -2
- package/dist/src/notifications/device-store.d.ts +1 -1
- package/dist/src/notifications/device-store.js +11 -11
- package/dist/src/notifications/store.js +3 -3
- package/dist/src/providers/index.js +1 -1
- package/dist/src/providers/model-reference-auditor.js +14 -9
- package/dist/src/realtime/runtime.d.ts +2 -0
- package/dist/src/realtime/runtime.js +27 -3
- package/dist/src/realtime/tickets.d.ts +6 -1
- package/dist/src/realtime/tickets.js +2 -1
- package/dist/src/remote-access/exposure-manager.js +3 -3
- package/dist/src/share/hosted-session-share.d.ts +104 -0
- package/dist/src/share/hosted-session-share.js +276 -0
- package/dist/src/share/note-share-service.js +4 -24
- package/dist/src/share/session-share-projector.d.ts +31 -0
- package/dist/src/share/session-share-projector.js +79 -0
- package/dist/src/share/session-share-service.d.ts +89 -0
- package/dist/src/share/session-share-service.js +325 -0
- package/dist/src/share/share-asset-ticket.d.ts +7 -0
- package/dist/src/share/share-asset-ticket.js +30 -0
- package/dist/src/share/share-landing.d.ts +4 -3
- package/dist/src/share/share-landing.js +5 -5
- package/dist/src/share/share-store.d.ts +27 -2
- package/dist/src/share/share-store.js +71 -8
- package/dist/src/share/share-types.d.ts +17 -2
- package/dist/src/share/share-url.js +2 -2
- package/dist/src/storage/sqlite/device-access-repository.d.ts +54 -0
- package/dist/src/storage/sqlite/device-access-repository.js +194 -0
- package/dist/src/storage/sqlite/device-pairing-repository.d.ts +22 -0
- package/dist/src/storage/sqlite/device-pairing-repository.js +86 -0
- package/dist/src/storage/sqlite/gateway-identity-repository.d.ts +10 -0
- package/dist/src/storage/sqlite/gateway-identity-repository.js +50 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -0
- package/dist/src/storage/sqlite/index.js +4 -1
- package/dist/src/storage/sqlite/migrations/138_device_access.sql +96 -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/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +11 -3
- package/dist/src/tunnel/consent.d.ts +1 -1
- package/dist/src/tunnel/consent.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/tunnel/index.d.ts +1 -4
- package/dist/src/tunnel/index.js +3 -5
- package/dist/src/tunnel/tunnel-audit.d.ts +1 -1
- package/dist/src/tunnel/tunnel-config.js +1 -1
- package/dist/src/tunnel/tunnel-service.d.ts +2 -3
- package/dist/src/tunnel/tunnel-service.js +1 -20
- package/dist/src/tunnel/tunnel-types.d.ts +0 -6
- package/dist/src/workflows/draft/workflow-draft-service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +3 -3
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-Bp_wmuGW.js +0 -1
- package/dist/gateway/static/root/assets/agents-CKG93dlc.js +0 -68
- package/dist/gateway/static/root/assets/api-BywYxpaS.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BNFAfNwC.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Cg6NgwE_.js +0 -8
- package/dist/gateway/static/root/assets/browser-workflow-inputs-8NC2qDRF.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-NvJKgF1u.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-api-o0y9WgAI.js +0 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-C2uBdALe.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-CIcYKMEs.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-38FsOnR0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CEEcmUiP.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-Cs_5pUPT.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-y1kWrFVU.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-skc62zrn.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-V8vZP0Dy.js +0 -1
- package/dist/gateway/static/root/assets/dist-J_ySZvz0.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BgSV0Nny.js +0 -1
- package/dist/gateway/static/root/assets/file-code-corner-byQA1VfD.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-BWGjnmDl.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-Pxqk5GFH.js +0 -1
- package/dist/gateway/static/root/assets/home-page-1xjo6wE4.js +0 -1
- package/dist/gateway/static/root/assets/html-workspace-editor-bXK5tq64.js +0 -1
- package/dist/gateway/static/root/assets/index-Bbd_dXui.js +0 -70
- package/dist/gateway/static/root/assets/index-D_hrEKXM.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-heQ4-PJ7.js +0 -2
- package/dist/gateway/static/root/assets/locale-store-CXhjfe4q.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BblnS6Jy.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-B8hM56HS.js +0 -1
- package/dist/gateway/static/root/assets/markdown-editor-TWGaF7Xa.js +0 -2
- package/dist/gateway/static/root/assets/markdown-split-DRbZjxMK.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-CLzTdVLW.css +0 -1
- package/dist/gateway/static/root/assets/messages-BMdD0LWk.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-CAM09C8b.js +0 -4
- package/dist/gateway/static/root/assets/popover-select-CccGri5Y.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BIPIwgU2.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B_kzTn1K.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CtD8DsD-.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B8n9HI1y.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-xlhdRTME.js +0 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-B5GU7iCG.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-Dd-BRu12.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CwEFAVWx.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-DzXw9UQJ.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Bk6UQOwS.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DrmQZ3Au.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CW2sJbdc.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-DOdCjyuw.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-Bq9KB-Oj.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DtTIF6M8.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-CcbGEQol.js +0 -5
- package/dist/src/agent-manifest/index.d.ts +0 -5
- package/dist/src/agent-manifest/index.js +0 -10
- package/dist/src/agent-manifest/preset-chain.d.ts +0 -10
- package/dist/src/agent-manifest/preset-chain.js +0 -30
- package/dist/src/agent-manifest/prompt.d.ts +0 -2
- package/dist/src/agent-manifest/prompt.js +0 -49
- package/dist/src/agent-manifest/resolver.d.ts +0 -32
- package/dist/src/agent-manifest/resolver.js +0 -114
- package/dist/src/agent-manifest/schema.d.ts +0 -695
- package/dist/src/agent-manifest/schema.js +0 -226
- package/dist/src/agent-manifest/validator.d.ts +0 -25
- package/dist/src/agent-manifest/validator.js +0 -74
- package/dist/src/agent-runtime/boundary-guard.d.ts +0 -12
- package/dist/src/agent-runtime/boundary-guard.js +0 -21
- package/dist/src/agent-runtime/index.d.ts +0 -7
- package/dist/src/agent-runtime/index.js +0 -8
- package/dist/src/agent-runtime/model-router.d.ts +0 -11
- package/dist/src/agent-runtime/model-router.js +0 -14
- package/dist/src/agent-runtime/run-trace.d.ts +0 -27
- package/dist/src/agent-runtime/run-trace.js +0 -51
- package/dist/src/agent-runtime/runtime-profile.d.ts +0 -26
- package/dist/src/agent-runtime/runtime-profile.js +0 -42
- package/dist/src/agent-runtime/tool-registry.d.ts +0 -28
- package/dist/src/agent-runtime/tool-registry.js +0 -50
- package/dist/src/agent-runtime/workflow-runtime.d.ts +0 -31
- package/dist/src/agent-runtime/workflow-runtime.js +0 -32
- package/dist/src/config/agent-typed-models.d.ts +0 -13
- package/dist/src/config/agent-typed-models.js +0 -48
- package/dist/src/gateway/capability-presets-admin.d.ts +0 -88
- package/dist/src/gateway/capability-presets-admin.js +0 -303
- package/dist/src/gateway/file-path-classifier.d.ts +0 -30
- package/dist/src/gateway/file-path-classifier.js +0 -105
- package/dist/src/gateway/file-reference-errors.d.ts +0 -6
- package/dist/src/gateway/file-reference-errors.js +0 -21
- package/dist/src/gateway/file-reference-registry.d.ts +0 -34
- package/dist/src/gateway/file-reference-registry.js +0 -45
- package/dist/src/gateway/hono/lib/agent-model.d.ts +0 -35
- package/dist/src/gateway/hono/lib/agent-model.js +0 -97
- package/dist/src/gateway/hono/routes/capability-presets.d.ts +0 -3
- package/dist/src/gateway/hono/routes/capability-presets.js +0 -187
- package/dist/src/gateway/hono/routes/mobile.d.ts +0 -3
- package/dist/src/gateway/security/operator-scopes.d.ts +0 -37
- package/dist/src/gateway/security/operator-scopes.js +0 -147
- package/dist/src/migrations/config/default-capability-preset.d.ts +0 -10
- package/dist/src/migrations/config/default-capability-preset.js +0 -133
- package/dist/src/tunnel/enable-lan-pairing.d.ts +0 -8
- package/dist/src/tunnel/enable-lan-pairing.js +0 -41
- package/dist/src/tunnel/pair-context.d.ts +0 -36
- package/dist/src/tunnel/pair-context.js +0 -77
- package/dist/src/tunnel/pair-url.d.ts +0 -43
- package/dist/src/tunnel/pair-url.js +0 -117
- package/dist/src/tunnel/pairing-rate-limit.d.ts +0 -12
- package/dist/src/tunnel/pairing-rate-limit.js +0 -28
- package/dist/src/tunnel/pairing.d.ts +0 -21
- package/dist/src/tunnel/pairing.js +0 -103
- package/dist/src/tunnel/tunnel-qr.d.ts +0 -9
- package/dist/src/tunnel/tunnel-qr.js +0 -29
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { loadCompactionSourceSnapshot } from "../../../storage/sqlite/transcript-repository.js";
|
|
2
|
+
import "../../../storage/sqlite/index.js";
|
|
1
3
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
2
4
|
import { SHARE_CONFIG_DEFAULTS } from "../../../share/share-types.js";
|
|
3
5
|
import { resolveSiteShareConfig } from "../../../share/site-share-config.js";
|
|
@@ -10,7 +12,9 @@ import { audienceDefaults, cleanupStagedSite, decideShareKind, forgetStagedSite,
|
|
|
10
12
|
import { deleteThumbnail, placeholderSvg, readThumbnail, scheduleThumbnail, thumbnailContentType, thumbnailExists } from "../../../share/share-thumbnail.js";
|
|
11
13
|
import { extractToken } from "../../auth.js";
|
|
12
14
|
import { getClientIpFromHeaders } from "../../security/loopback.js";
|
|
13
|
-
import { renderFolderLandingPage,
|
|
15
|
+
import { renderFolderLandingPage, renderShareExpiredPage, renderShareLandingPage, renderSnapshotShareLandingPage } from "../../../share/share-landing.js";
|
|
16
|
+
import { SessionShareService, SessionShareSnapshotConflictError } from "../../../share/session-share-service.js";
|
|
17
|
+
import { HostedSessionShareBuilder, HostedSessionSharePublisher, HostedShareAuthorizationError, HostedShareBindingStore } from "../../../share/hosted-session-share.js";
|
|
14
18
|
import { NoteShareService } from "../../../share/note-share-service.js";
|
|
15
19
|
import { consumeSharePublicLimit } from "../../../share/share-rate-limit.js";
|
|
16
20
|
import { createZipStream, planDirectoryFiles } from "../../../share/share-zip.js";
|
|
@@ -95,6 +99,7 @@ function rfc5987ContentDisposition(disposition, fileName) {
|
|
|
95
99
|
function registerSharePublicRoutes(app, service) {
|
|
96
100
|
const store = getShareStore(resolveShareConfig(service));
|
|
97
101
|
const noteShares = new NoteShareService(store, service.notesServiceInstance);
|
|
102
|
+
const sessionShares = createSessionShareService(service, store);
|
|
98
103
|
/** Landing page — does NOT consume downloadCount. */
|
|
99
104
|
app.get("/s/:token", async (c) => {
|
|
100
105
|
const clientIp = getClientIpFromHeaders({ get: (n) => c.req.header(n) ?? void 0 });
|
|
@@ -117,12 +122,15 @@ function registerSharePublicRoutes(app, service) {
|
|
|
117
122
|
return c.html(renderShareExpiredPage(validation.reason), 410);
|
|
118
123
|
}
|
|
119
124
|
if (record.kind === "directory") return renderDirectoryLanding(c, store, service, record, token);
|
|
120
|
-
if (record.kind === "note") {
|
|
125
|
+
if (record.kind === "note" || record.kind === "session") {
|
|
121
126
|
const previewUrl = `/#/share/${encodeURIComponent(token)}`;
|
|
122
127
|
c.header("Content-Security-Policy", "default-src 'none'; script-src 'unsafe-inline'; base-uri 'none'; frame-ancestors 'none'");
|
|
123
128
|
c.header("X-Frame-Options", "DENY");
|
|
124
129
|
c.header("Referrer-Policy", "no-referrer");
|
|
125
|
-
return c.html(
|
|
130
|
+
return c.html(renderSnapshotShareLandingPage(record, previewUrl, {
|
|
131
|
+
label: record.kind === "note" ? "Note" : "conversation",
|
|
132
|
+
og: buildLandingOg(service, record)
|
|
133
|
+
}));
|
|
126
134
|
}
|
|
127
135
|
if (c.req.query("dl") === "1") return handleFileDownload(c, store, record, clientIp);
|
|
128
136
|
if (c.req.query("inline") === "1") {
|
|
@@ -169,7 +177,7 @@ function registerSharePublicRoutes(app, service) {
|
|
|
169
177
|
if (record.kind !== "file") return c.html(renderShareExpiredPage("not_found"), 404);
|
|
170
178
|
return handleFileDownload(c, store, record, clientIp);
|
|
171
179
|
});
|
|
172
|
-
/** Claim one
|
|
180
|
+
/** Claim one state-owned snapshot view. POST prevents social unfurlers from consuming maxViews. */
|
|
173
181
|
app.post("/s/:token/view", async (c) => {
|
|
174
182
|
const clientIp = getClientIpFromHeaders({ get: (n) => c.req.header(n) ?? void 0 });
|
|
175
183
|
const rateResult = consumeSharePublicLimit(clientIp);
|
|
@@ -182,7 +190,7 @@ function registerSharePublicRoutes(app, service) {
|
|
|
182
190
|
}
|
|
183
191
|
const token = c.req.param("token");
|
|
184
192
|
const record = store.getByToken(token);
|
|
185
|
-
if (!record || record.kind !== "note") return c.json({
|
|
193
|
+
if (!record || record.kind !== "note" && record.kind !== "session") return c.json({
|
|
186
194
|
ok: false,
|
|
187
195
|
error: { message: "not_found" }
|
|
188
196
|
}, 404);
|
|
@@ -192,6 +200,39 @@ function registerSharePublicRoutes(app, service) {
|
|
|
192
200
|
error: { message: validation.reason }
|
|
193
201
|
}, 410);
|
|
194
202
|
try {
|
|
203
|
+
if (record.kind === "session") {
|
|
204
|
+
const manifest = await sessionShares.readManifest(record);
|
|
205
|
+
const consumed = store.consumeAccess(record.id);
|
|
206
|
+
if (consumed.valid === false) return c.json({
|
|
207
|
+
ok: false,
|
|
208
|
+
error: { message: consumed.reason }
|
|
209
|
+
}, 410);
|
|
210
|
+
logShareAudit("share.access", {
|
|
211
|
+
shareId: record.id,
|
|
212
|
+
sourceSessionId: record.sourceSessionId,
|
|
213
|
+
tokenPrefix: token.slice(0, 8),
|
|
214
|
+
clientIp,
|
|
215
|
+
snapshotRevision: record.snapshotRevision
|
|
216
|
+
}, `Session share viewed: ${record.fileName}`);
|
|
217
|
+
const ticket = manifest.attachments.length ? sessionShares.issueAssetTicket(record) : null;
|
|
218
|
+
return c.json({
|
|
219
|
+
ok: true,
|
|
220
|
+
payload: {
|
|
221
|
+
kind: "session",
|
|
222
|
+
title: manifest.title,
|
|
223
|
+
snapshotAt: manifest.snapshotAt,
|
|
224
|
+
expiresAt: record.expiresAt,
|
|
225
|
+
description: record.description ?? null,
|
|
226
|
+
snapshotRevision: record.snapshotRevision,
|
|
227
|
+
messages: manifest.messages,
|
|
228
|
+
toolActivities: manifest.toolActivities,
|
|
229
|
+
attachments: manifest.attachments.map(({ artifactFileName: _artifactFileName, checksum: _checksum, ...attachment }) => ({
|
|
230
|
+
...attachment,
|
|
231
|
+
url: `/s/${encodeURIComponent(token)}/assets/${encodeURIComponent(attachment.id)}?ticket=${encodeURIComponent(ticket ?? "")}`
|
|
232
|
+
}))
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}
|
|
195
236
|
const manifest = await noteShares.readManifest(record);
|
|
196
237
|
const consumed = store.consumeAccess(record.id);
|
|
197
238
|
if (consumed.valid === false) return c.json({
|
|
@@ -220,21 +261,21 @@ function registerSharePublicRoutes(app, service) {
|
|
|
220
261
|
attachments: manifest.attachments.map(({ artifactFileName: _artifactFileName, checksum: _checksum, ...attachment }) => attachment)
|
|
221
262
|
}
|
|
222
263
|
});
|
|
223
|
-
} catch
|
|
264
|
+
} catch {
|
|
224
265
|
logShareAudit("share.access_denied", {
|
|
225
266
|
shareId: record.id,
|
|
226
|
-
noteId: record.sourceNoteId,
|
|
267
|
+
...record.kind === "note" ? { noteId: record.sourceNoteId } : { sourceSessionId: record.sourceSessionId },
|
|
227
268
|
tokenPrefix: token.slice(0, 8),
|
|
228
269
|
clientIp,
|
|
229
270
|
reason: "artifact_missing"
|
|
230
|
-
}, "
|
|
271
|
+
}, "Share artifact could not be read");
|
|
231
272
|
return c.json({
|
|
232
273
|
ok: false,
|
|
233
|
-
error: { message:
|
|
274
|
+
error: { message: "artifact_missing" }
|
|
234
275
|
}, 410);
|
|
235
276
|
}
|
|
236
277
|
});
|
|
237
|
-
/** Serve one snapshotted
|
|
278
|
+
/** Serve one snapshotted attachment through a short-lived view ticket. */
|
|
238
279
|
app.get("/s/:token/assets/:attachmentId", async (c) => {
|
|
239
280
|
const rateResult = consumeSharePublicLimit(getClientIpFromHeaders({ get: (n) => c.req.header(n) ?? void 0 }));
|
|
240
281
|
if (!rateResult.allowed) {
|
|
@@ -242,15 +283,15 @@ function registerSharePublicRoutes(app, service) {
|
|
|
242
283
|
return c.text("Too many requests", 429);
|
|
243
284
|
}
|
|
244
285
|
const record = store.getByToken(c.req.param("token"));
|
|
245
|
-
if (!record || record.kind !== "note") return c.text("Not found", 404);
|
|
286
|
+
if (!record || record.kind !== "note" && record.kind !== "session") return c.text("Not found", 404);
|
|
246
287
|
if (record.revoked || Date.now() >= new Date(record.expiresAt).getTime()) return c.text("Gone", 410);
|
|
247
288
|
const ticket = c.req.query("ticket") ?? "";
|
|
248
|
-
if (!noteShares.verifyAssetTicket(record, ticket)) return c.text("Forbidden", 403);
|
|
249
|
-
const resolved = await noteShares.resolveAsset(record, c.req.param("attachmentId")).catch(() => null);
|
|
289
|
+
if (!(record.kind === "note" ? noteShares.verifyAssetTicket(record, ticket) : sessionShares.verifyAssetTicket(record, ticket))) return c.text("Forbidden", 403);
|
|
290
|
+
const resolved = record.kind === "note" ? await noteShares.resolveAsset(record, c.req.param("attachmentId")).catch(() => null) : await sessionShares.resolveAsset(record, c.req.param("attachmentId")).catch(() => null);
|
|
250
291
|
if (!resolved) return c.text("Not found", 404);
|
|
251
292
|
const fileStat = await stat(resolved.path).catch(() => null);
|
|
252
293
|
if (!fileStat?.isFile()) return c.text("Not found", 404);
|
|
253
|
-
const inline = resolved.attachment.type !== "file";
|
|
294
|
+
const inline = record.kind === "session" ? isSafeInlineSessionMime(resolved.attachment.mimeType) : "type" in resolved.attachment && resolved.attachment.type !== "file";
|
|
254
295
|
const stream = createReadStream(resolved.path);
|
|
255
296
|
return new Response(Readable.toWeb(stream), {
|
|
256
297
|
status: 200,
|
|
@@ -261,7 +302,8 @@ function registerSharePublicRoutes(app, service) {
|
|
|
261
302
|
"Cache-Control": "private, no-store",
|
|
262
303
|
"X-Content-Type-Options": "nosniff",
|
|
263
304
|
"X-Frame-Options": "DENY",
|
|
264
|
-
"Referrer-Policy": "no-referrer"
|
|
305
|
+
"Referrer-Policy": "no-referrer",
|
|
306
|
+
...record.kind === "session" ? { "Content-Security-Policy": "sandbox; default-src 'none'" } : {}
|
|
265
307
|
}
|
|
266
308
|
});
|
|
267
309
|
});
|
|
@@ -361,6 +403,12 @@ function registerSharePublicRoutes(app, service) {
|
|
|
361
403
|
sourceVersion: record.sourceVersion,
|
|
362
404
|
snapshotRevision: record.snapshotRevision,
|
|
363
405
|
attachmentCount: record.attachmentCount
|
|
406
|
+
} : record.kind === "session" ? {
|
|
407
|
+
cutoffSeq: record.cutoffSeq,
|
|
408
|
+
snapshotRevision: record.snapshotRevision,
|
|
409
|
+
messageCount: record.messageCount,
|
|
410
|
+
attachmentCount: record.attachmentCount,
|
|
411
|
+
includeToolActivities: record.includeToolActivities
|
|
364
412
|
} : {}
|
|
365
413
|
});
|
|
366
414
|
});
|
|
@@ -392,7 +440,7 @@ function registerSharePublicRoutes(app, service) {
|
|
|
392
440
|
"X-Content-Type-Options": "nosniff"
|
|
393
441
|
}
|
|
394
442
|
});
|
|
395
|
-
if (record.kind === "note") {
|
|
443
|
+
if (record.kind === "note" || record.kind === "session") {
|
|
396
444
|
const placeholder = placeholderSvg(record.fileName, "text");
|
|
397
445
|
return new Response(placeholder, {
|
|
398
446
|
status: 200,
|
|
@@ -474,10 +522,285 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
474
522
|
const { service } = deps;
|
|
475
523
|
const store = getShareStore(resolveShareConfig(service));
|
|
476
524
|
const noteShares = new NoteShareService(store, service.notesServiceInstance);
|
|
525
|
+
const sessionShares = createSessionShareService(service, store);
|
|
526
|
+
const hostedBuilder = new HostedSessionShareBuilder(createSessionShareSource(service));
|
|
527
|
+
const hostedPublisher = new HostedSessionSharePublisher();
|
|
528
|
+
const hostedBindings = new HostedShareBindingStore();
|
|
477
529
|
getSiteShareStore(resolveSiteShareConfig(service)).setCleanupHook((rec) => {
|
|
478
530
|
const dir = forgetStagedSite(rec.id);
|
|
479
531
|
if (dir) cleanupStagedSite(dir);
|
|
480
532
|
});
|
|
533
|
+
authenticated.get("/api/sessions/:key/share-preview", async (c) => {
|
|
534
|
+
try {
|
|
535
|
+
const preview = await sessionShares.preview(c.req.param("key"));
|
|
536
|
+
return c.json({
|
|
537
|
+
ok: true,
|
|
538
|
+
payload: preview
|
|
539
|
+
});
|
|
540
|
+
} catch (err) {
|
|
541
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
542
|
+
return c.json({
|
|
543
|
+
ok: false,
|
|
544
|
+
error: { message }
|
|
545
|
+
}, message === "Session not found" ? 404 : 400);
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
authenticated.get("/api/sessions/:key/shares", async (c) => {
|
|
549
|
+
const metadata = await service.sessionIndexInstance.getSessionMetadata(c.req.param("key"));
|
|
550
|
+
if (!metadata?.sessionId) return c.json({
|
|
551
|
+
ok: false,
|
|
552
|
+
error: { message: "Session not found" }
|
|
553
|
+
}, 404);
|
|
554
|
+
const urlCtx = getShareUrlContext(service);
|
|
555
|
+
const now = Date.now();
|
|
556
|
+
const items = sessionShares.list(metadata.sessionId).map((record) => {
|
|
557
|
+
const resolved = resolveShareUrl(record.token, urlCtx);
|
|
558
|
+
return {
|
|
559
|
+
id: record.id,
|
|
560
|
+
kind: record.kind,
|
|
561
|
+
delivery: "local",
|
|
562
|
+
fileName: record.fileName,
|
|
563
|
+
shareUrl: resolved.shareUrl,
|
|
564
|
+
lanUrl: resolved.lanUrl,
|
|
565
|
+
reachability: resolved.reachability,
|
|
566
|
+
reachabilityHint: resolved.reachabilityHint,
|
|
567
|
+
createdAt: record.createdAt,
|
|
568
|
+
expiresAt: record.expiresAt,
|
|
569
|
+
viewCount: record.downloadCount,
|
|
570
|
+
maxViews: record.maxViews,
|
|
571
|
+
revoked: record.revoked,
|
|
572
|
+
expired: now >= new Date(record.expiresAt).getTime(),
|
|
573
|
+
description: record.description ?? null,
|
|
574
|
+
cutoffSeq: record.cutoffSeq,
|
|
575
|
+
snapshotRevision: record.snapshotRevision,
|
|
576
|
+
messageCount: record.messageCount,
|
|
577
|
+
attachmentCount: record.attachmentCount,
|
|
578
|
+
includeToolActivities: record.includeToolActivities
|
|
579
|
+
};
|
|
580
|
+
});
|
|
581
|
+
return c.json({
|
|
582
|
+
ok: true,
|
|
583
|
+
payload: { shares: items }
|
|
584
|
+
});
|
|
585
|
+
});
|
|
586
|
+
authenticated.post("/api/sessions/:key/shares", async (c) => {
|
|
587
|
+
const gatewayToken = extractToken({ authorization: c.req.header("authorization") ?? void 0 });
|
|
588
|
+
if (!gatewayToken) return c.json({
|
|
589
|
+
ok: false,
|
|
590
|
+
error: { message: "Token required" }
|
|
591
|
+
}, 401);
|
|
592
|
+
const body = await c.req.json().catch(() => ({}));
|
|
593
|
+
if (typeof body.expectedSessionId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
594
|
+
ok: false,
|
|
595
|
+
error: { message: "Share preview fingerprint is required" }
|
|
596
|
+
}, 400);
|
|
597
|
+
try {
|
|
598
|
+
const record = await sessionShares.create(c.req.param("key"), {
|
|
599
|
+
expectedSessionId: body.expectedSessionId,
|
|
600
|
+
expectedCutoffSeq: body.expectedCutoffSeq,
|
|
601
|
+
expectedMetadataUpdatedAt: body.expectedMetadataUpdatedAt,
|
|
602
|
+
ttlMs: typeof body.ttlMs === "number" ? body.ttlMs : void 0,
|
|
603
|
+
maxViews: body.maxViews === null ? null : typeof body.maxViews === "number" ? body.maxViews : void 0,
|
|
604
|
+
description: typeof body.description === "string" ? body.description.trim() || void 0 : void 0,
|
|
605
|
+
includeToolActivities: body.includeToolActivities === true,
|
|
606
|
+
attachmentIds: Array.isArray(body.attachmentIds) ? body.attachmentIds.filter((id) => typeof id === "string") : void 0,
|
|
607
|
+
gatewayTokenHash: hashGatewayToken(gatewayToken)
|
|
608
|
+
});
|
|
609
|
+
const resolved = resolveShareUrl(record.token, getShareUrlContext(service));
|
|
610
|
+
return c.json({
|
|
611
|
+
ok: true,
|
|
612
|
+
payload: {
|
|
613
|
+
id: record.id,
|
|
614
|
+
kind: record.kind,
|
|
615
|
+
delivery: "local",
|
|
616
|
+
shareUrl: resolved.shareUrl,
|
|
617
|
+
lanUrl: resolved.lanUrl,
|
|
618
|
+
reachability: resolved.reachability,
|
|
619
|
+
reachabilityHint: resolved.reachabilityHint,
|
|
620
|
+
expiresAt: record.expiresAt,
|
|
621
|
+
maxViews: record.maxViews,
|
|
622
|
+
fileName: record.fileName,
|
|
623
|
+
messageCount: record.messageCount,
|
|
624
|
+
attachmentCount: record.attachmentCount,
|
|
625
|
+
snapshotRevision: record.snapshotRevision,
|
|
626
|
+
includeToolActivities: record.includeToolActivities
|
|
627
|
+
}
|
|
628
|
+
}, 201);
|
|
629
|
+
} catch (err) {
|
|
630
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
631
|
+
const status = err instanceof SessionShareSnapshotConflictError ? 409 : message === "Session not found" ? 404 : 400;
|
|
632
|
+
return c.json({
|
|
633
|
+
ok: false,
|
|
634
|
+
error: {
|
|
635
|
+
message,
|
|
636
|
+
code: status === 409 ? "session_snapshot_conflict" : void 0
|
|
637
|
+
}
|
|
638
|
+
}, status);
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
authenticated.post("/api/sessions/:key/shares/:shareId/refresh", async (c) => {
|
|
642
|
+
const body = await c.req.json().catch(() => ({}));
|
|
643
|
+
if (typeof body.expectedSessionId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
644
|
+
ok: false,
|
|
645
|
+
error: { message: "Share preview fingerprint is required" }
|
|
646
|
+
}, 400);
|
|
647
|
+
try {
|
|
648
|
+
const record = await sessionShares.refresh(c.req.param("key"), c.req.param("shareId"), {
|
|
649
|
+
expectedSessionId: body.expectedSessionId,
|
|
650
|
+
expectedCutoffSeq: body.expectedCutoffSeq,
|
|
651
|
+
expectedMetadataUpdatedAt: body.expectedMetadataUpdatedAt,
|
|
652
|
+
includeToolActivities: typeof body.includeToolActivities === "boolean" ? body.includeToolActivities : void 0,
|
|
653
|
+
attachmentIds: Array.isArray(body.attachmentIds) ? body.attachmentIds.filter((id) => typeof id === "string") : void 0
|
|
654
|
+
});
|
|
655
|
+
const resolved = resolveShareUrl(record.token, getShareUrlContext(service));
|
|
656
|
+
return c.json({
|
|
657
|
+
ok: true,
|
|
658
|
+
payload: {
|
|
659
|
+
id: record.id,
|
|
660
|
+
kind: record.kind,
|
|
661
|
+
delivery: "local",
|
|
662
|
+
shareUrl: resolved.shareUrl,
|
|
663
|
+
lanUrl: resolved.lanUrl,
|
|
664
|
+
reachability: resolved.reachability,
|
|
665
|
+
reachabilityHint: resolved.reachabilityHint,
|
|
666
|
+
expiresAt: record.expiresAt,
|
|
667
|
+
maxViews: record.maxViews,
|
|
668
|
+
fileName: record.fileName,
|
|
669
|
+
messageCount: record.messageCount,
|
|
670
|
+
attachmentCount: record.attachmentCount,
|
|
671
|
+
snapshotRevision: record.snapshotRevision,
|
|
672
|
+
includeToolActivities: record.includeToolActivities
|
|
673
|
+
}
|
|
674
|
+
});
|
|
675
|
+
} catch (err) {
|
|
676
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
677
|
+
const status = err instanceof SessionShareSnapshotConflictError ? 409 : message === "Session share not found" || message === "Session not found" ? 404 : 400;
|
|
678
|
+
return c.json({
|
|
679
|
+
ok: false,
|
|
680
|
+
error: {
|
|
681
|
+
message,
|
|
682
|
+
code: status === 409 ? "session_snapshot_conflict" : void 0
|
|
683
|
+
}
|
|
684
|
+
}, status);
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
authenticated.get("/api/sessions/:key/hosted-shares", async (c) => {
|
|
688
|
+
const metadata = await service.sessionIndexInstance.getSessionMetadata(c.req.param("key"));
|
|
689
|
+
if (!metadata?.sessionId) return c.json({
|
|
690
|
+
ok: false,
|
|
691
|
+
error: { message: "Session not found" }
|
|
692
|
+
}, 404);
|
|
693
|
+
try {
|
|
694
|
+
await hostedBindings.reconcile(await hostedPublisher.list());
|
|
695
|
+
return c.json({
|
|
696
|
+
ok: true,
|
|
697
|
+
payload: { shares: (await hostedBindings.list(metadata.sessionId)).map(hostedBindingResponse) }
|
|
698
|
+
});
|
|
699
|
+
} catch (err) {
|
|
700
|
+
return hostedShareErrorResponse(c, err);
|
|
701
|
+
}
|
|
702
|
+
});
|
|
703
|
+
authenticated.post("/api/sessions/:key/hosted-shares", async (c) => {
|
|
704
|
+
const body = await c.req.json().catch(() => ({}));
|
|
705
|
+
if (typeof body.expectedSessionId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
706
|
+
ok: false,
|
|
707
|
+
error: { message: "Share preview fingerprint is required" }
|
|
708
|
+
}, 400);
|
|
709
|
+
try {
|
|
710
|
+
const snapshot = await hostedBuilder.build(c.req.param("key"), hostedBuildInput(body));
|
|
711
|
+
const result = await hostedPublisher.create(snapshot, {
|
|
712
|
+
ttlMs: typeof body.ttlMs === "number" ? body.ttlMs : 864e5,
|
|
713
|
+
maxViews: body.maxViews === null ? null : typeof body.maxViews === "number" ? body.maxViews : null
|
|
714
|
+
});
|
|
715
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
716
|
+
const binding = {
|
|
717
|
+
...result,
|
|
718
|
+
sessionId: snapshot.sessionId,
|
|
719
|
+
cutoffSeq: snapshot.cutoffSeq,
|
|
720
|
+
title: snapshot.manifest.title,
|
|
721
|
+
description: snapshot.manifest.description ?? null,
|
|
722
|
+
messageCount: snapshot.manifest.messages.length,
|
|
723
|
+
attachmentCount: snapshot.manifest.attachments.length,
|
|
724
|
+
includeToolActivities: body.includeToolActivities === true,
|
|
725
|
+
attachmentIds: snapshot.manifest.attachments.map((attachment) => attachment.id),
|
|
726
|
+
createdAt: now,
|
|
727
|
+
updatedAt: now,
|
|
728
|
+
revoked: false
|
|
729
|
+
};
|
|
730
|
+
await hostedBindings.upsert(binding);
|
|
731
|
+
return c.json({
|
|
732
|
+
ok: true,
|
|
733
|
+
payload: hostedBindingResponse(binding)
|
|
734
|
+
}, 201);
|
|
735
|
+
} catch (err) {
|
|
736
|
+
return hostedShareErrorResponse(c, err);
|
|
737
|
+
}
|
|
738
|
+
});
|
|
739
|
+
authenticated.post("/api/sessions/:key/hosted-shares/:shareId/refresh", async (c) => {
|
|
740
|
+
const body = await c.req.json().catch(() => ({}));
|
|
741
|
+
if (typeof body.expectedSessionId !== "string" || typeof body.expectedCutoffSeq !== "number" || typeof body.expectedMetadataUpdatedAt !== "string") return c.json({
|
|
742
|
+
ok: false,
|
|
743
|
+
error: { message: "Share preview fingerprint is required" }
|
|
744
|
+
}, 400);
|
|
745
|
+
const previous = (await hostedBindings.list(body.expectedSessionId)).find((binding) => binding.id === c.req.param("shareId") && !binding.revoked);
|
|
746
|
+
if (!previous) return c.json({
|
|
747
|
+
ok: false,
|
|
748
|
+
error: { message: "Hosted share not found" }
|
|
749
|
+
}, 404);
|
|
750
|
+
try {
|
|
751
|
+
const snapshot = await hostedBuilder.build(c.req.param("key"), {
|
|
752
|
+
...hostedBuildInput(body),
|
|
753
|
+
description: previous.description ?? void 0,
|
|
754
|
+
includeToolActivities: typeof body.includeToolActivities === "boolean" ? body.includeToolActivities : previous.includeToolActivities,
|
|
755
|
+
attachmentIds: Array.isArray(body.attachmentIds) ? body.attachmentIds.filter((id) => typeof id === "string") : previous.attachmentIds
|
|
756
|
+
});
|
|
757
|
+
const result = await hostedPublisher.refresh(previous.id, previous.snapshotRevision, previous.shareUrl, snapshot);
|
|
758
|
+
const binding = {
|
|
759
|
+
...previous,
|
|
760
|
+
...result,
|
|
761
|
+
cutoffSeq: snapshot.cutoffSeq,
|
|
762
|
+
title: snapshot.manifest.title,
|
|
763
|
+
messageCount: snapshot.manifest.messages.length,
|
|
764
|
+
attachmentCount: snapshot.manifest.attachments.length,
|
|
765
|
+
includeToolActivities: typeof body.includeToolActivities === "boolean" ? body.includeToolActivities : previous.includeToolActivities,
|
|
766
|
+
attachmentIds: snapshot.manifest.attachments.map((attachment) => attachment.id),
|
|
767
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
768
|
+
};
|
|
769
|
+
await hostedBindings.upsert(binding);
|
|
770
|
+
return c.json({
|
|
771
|
+
ok: true,
|
|
772
|
+
payload: hostedBindingResponse(binding)
|
|
773
|
+
});
|
|
774
|
+
} catch (err) {
|
|
775
|
+
return hostedShareErrorResponse(c, err);
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
authenticated.delete("/api/sessions/:key/hosted-shares/:shareId", async (c) => {
|
|
779
|
+
const metadata = await service.sessionIndexInstance.getSessionMetadata(c.req.param("key"));
|
|
780
|
+
if (!metadata?.sessionId) return c.json({
|
|
781
|
+
ok: false,
|
|
782
|
+
error: { message: "Session not found" }
|
|
783
|
+
}, 404);
|
|
784
|
+
const binding = (await hostedBindings.list(metadata.sessionId)).find((item) => item.id === c.req.param("shareId"));
|
|
785
|
+
if (!binding) return c.json({
|
|
786
|
+
ok: false,
|
|
787
|
+
error: { message: "Hosted share not found" }
|
|
788
|
+
}, 404);
|
|
789
|
+
try {
|
|
790
|
+
await hostedPublisher.revoke(binding.id);
|
|
791
|
+
await hostedBindings.upsert({
|
|
792
|
+
...binding,
|
|
793
|
+
revoked: true,
|
|
794
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
795
|
+
});
|
|
796
|
+
return c.json({
|
|
797
|
+
ok: true,
|
|
798
|
+
payload: { revoked: binding.id }
|
|
799
|
+
});
|
|
800
|
+
} catch (err) {
|
|
801
|
+
return hostedShareErrorResponse(c, err);
|
|
802
|
+
}
|
|
803
|
+
});
|
|
481
804
|
authenticated.post("/api/shares", async (c) => {
|
|
482
805
|
const gatewayToken = extractToken({ authorization: c.req.header("authorization") ?? void 0 });
|
|
483
806
|
if (!gatewayToken) return c.json({
|
|
@@ -756,6 +1079,13 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
756
1079
|
sourceVersion: r.sourceVersion,
|
|
757
1080
|
snapshotRevision: r.snapshotRevision,
|
|
758
1081
|
attachmentCount: r.attachmentCount
|
|
1082
|
+
} : r.kind === "session" ? {
|
|
1083
|
+
sourceSessionId: r.sourceSessionId,
|
|
1084
|
+
cutoffSeq: r.cutoffSeq,
|
|
1085
|
+
snapshotRevision: r.snapshotRevision,
|
|
1086
|
+
messageCount: r.messageCount,
|
|
1087
|
+
attachmentCount: r.attachmentCount,
|
|
1088
|
+
includeToolActivities: r.includeToolActivities
|
|
759
1089
|
} : {}
|
|
760
1090
|
};
|
|
761
1091
|
});
|
|
@@ -795,6 +1125,7 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
795
1125
|
error: { message: "Not found" }
|
|
796
1126
|
}, 404);
|
|
797
1127
|
if (record?.kind === "note") await noteShares.removeArtifact(record.id);
|
|
1128
|
+
if (record?.kind === "session") await sessionShares.removeArtifact(record.id);
|
|
798
1129
|
return c.json({ ok: true });
|
|
799
1130
|
});
|
|
800
1131
|
authenticated.delete("/api/shares", async (c) => {
|
|
@@ -803,9 +1134,9 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
803
1134
|
body = await c.req.json();
|
|
804
1135
|
} catch {}
|
|
805
1136
|
if (body.expired === true) {
|
|
806
|
-
const
|
|
1137
|
+
const expiredStateShares = store.getAllShares().filter((record) => (record.kind === "note" || record.kind === "session") && !record.revoked && Date.now() >= new Date(record.expiresAt).getTime());
|
|
807
1138
|
const count = store.revokeExpired();
|
|
808
|
-
await Promise.all(
|
|
1139
|
+
await Promise.all(expiredStateShares.map((record) => record.kind === "note" ? noteShares.removeArtifact(record.id) : sessionShares.removeArtifact(record.id)));
|
|
809
1140
|
return c.json({
|
|
810
1141
|
ok: true,
|
|
811
1142
|
payload: { revokedCount: count }
|
|
@@ -816,9 +1147,9 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
816
1147
|
ok: false,
|
|
817
1148
|
error: { message: "Provide ids array or expired: true" }
|
|
818
1149
|
}, 400);
|
|
819
|
-
const
|
|
1150
|
+
const stateRecords = ids.map((id) => store.getById(id)).filter((record) => record?.kind === "note" || record?.kind === "session");
|
|
820
1151
|
const count = store.revokeMany(ids);
|
|
821
|
-
await Promise.all(
|
|
1152
|
+
await Promise.all(stateRecords.map((record) => record.kind === "note" ? noteShares.removeArtifact(record.id) : sessionShares.removeArtifact(record.id)));
|
|
822
1153
|
return c.json({
|
|
823
1154
|
ok: true,
|
|
824
1155
|
payload: { revokedCount: count }
|
|
@@ -856,6 +1187,60 @@ function registerShareRoutes(authenticated, deps) {
|
|
|
856
1187
|
});
|
|
857
1188
|
});
|
|
858
1189
|
}
|
|
1190
|
+
function createSessionShareService(service, store) {
|
|
1191
|
+
return new SessionShareService(store, createSessionShareSource(service));
|
|
1192
|
+
}
|
|
1193
|
+
function createSessionShareSource(service) {
|
|
1194
|
+
return {
|
|
1195
|
+
getMetadata: (sessionKey) => service.sessionIndexInstance.getSessionMetadata(sessionKey),
|
|
1196
|
+
getSnapshot: async (sessionKey) => loadCompactionSourceSnapshot(sessionKey)
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
function hostedBuildInput(body) {
|
|
1200
|
+
return {
|
|
1201
|
+
expectedSessionId: String(body.expectedSessionId),
|
|
1202
|
+
expectedCutoffSeq: Number(body.expectedCutoffSeq),
|
|
1203
|
+
expectedMetadataUpdatedAt: String(body.expectedMetadataUpdatedAt),
|
|
1204
|
+
description: typeof body.description === "string" ? body.description.trim() || void 0 : void 0,
|
|
1205
|
+
includeToolActivities: body.includeToolActivities === true,
|
|
1206
|
+
attachmentIds: Array.isArray(body.attachmentIds) ? body.attachmentIds.filter((id) => typeof id === "string") : void 0
|
|
1207
|
+
};
|
|
1208
|
+
}
|
|
1209
|
+
function hostedBindingResponse(binding) {
|
|
1210
|
+
return {
|
|
1211
|
+
id: binding.id,
|
|
1212
|
+
kind: "session",
|
|
1213
|
+
delivery: "hosted",
|
|
1214
|
+
shareUrl: binding.shareUrl,
|
|
1215
|
+
lanUrl: null,
|
|
1216
|
+
reachability: "public",
|
|
1217
|
+
reachabilityHint: null,
|
|
1218
|
+
expiresAt: binding.expiresAt,
|
|
1219
|
+
maxViews: binding.maxViews,
|
|
1220
|
+
fileName: binding.title,
|
|
1221
|
+
messageCount: binding.messageCount,
|
|
1222
|
+
attachmentCount: binding.attachmentCount,
|
|
1223
|
+
snapshotRevision: binding.snapshotRevision,
|
|
1224
|
+
includeToolActivities: binding.includeToolActivities,
|
|
1225
|
+
createdAt: binding.createdAt,
|
|
1226
|
+
viewCount: binding.viewCount,
|
|
1227
|
+
revoked: binding.revoked,
|
|
1228
|
+
expired: Date.now() >= new Date(binding.expiresAt).getTime(),
|
|
1229
|
+
description: binding.description,
|
|
1230
|
+
cutoffSeq: binding.cutoffSeq
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
function hostedShareErrorResponse(c, err) {
|
|
1234
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
1235
|
+
const status = err instanceof HostedShareAuthorizationError ? 401 : err instanceof SessionShareSnapshotConflictError ? 409 : message === "Session not found" || message === "Hosted share not found" ? 404 : 400;
|
|
1236
|
+
return c.json({
|
|
1237
|
+
ok: false,
|
|
1238
|
+
error: {
|
|
1239
|
+
message,
|
|
1240
|
+
code: err instanceof HostedShareAuthorizationError ? "hosted_share_auth_required" : status === 409 ? "session_snapshot_conflict" : void 0
|
|
1241
|
+
}
|
|
1242
|
+
}, status);
|
|
1243
|
+
}
|
|
859
1244
|
async function renderDirectoryLanding(c, store, service, record, token, subPath = "") {
|
|
860
1245
|
store.updateConfig(resolveShareConfig(service));
|
|
861
1246
|
const urls = {
|
|
@@ -885,9 +1270,13 @@ function buildLandingOg(service, record) {
|
|
|
885
1270
|
absoluteShareUrl: resolved.shareUrl,
|
|
886
1271
|
absoluteThumbnailUrl: `${resolved.shareUrl}/thumbnail`,
|
|
887
1272
|
title: record.fileName,
|
|
888
|
-
description: record.description ?? void 0
|
|
1273
|
+
description: record.description ?? (record.kind === "session" ? `${record.messageCount} messages shared via xopc` : void 0)
|
|
889
1274
|
};
|
|
890
1275
|
}
|
|
1276
|
+
function isSafeInlineSessionMime(mimeType) {
|
|
1277
|
+
const normalized = mimeType.split(";")[0]?.trim().toLowerCase();
|
|
1278
|
+
return normalized === "image/png" || normalized === "image/jpeg" || normalized === "image/gif" || normalized === "image/webp" || normalized?.startsWith("audio/") === true || normalized?.startsWith("video/") === true;
|
|
1279
|
+
}
|
|
891
1280
|
async function handleDirectoryFile(c, store, service, record, relPath, clientIp, inline) {
|
|
892
1281
|
if (!acquireDownloadSlot(record.token)) return new Response("Too many concurrent downloads for this share", { status: 429 });
|
|
893
1282
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
2
|
-
import {
|
|
2
|
+
import { getGatewayAgentEffectiveConfig } from "../../agents-admin.js";
|
|
3
3
|
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
4
4
|
import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
|
|
5
5
|
import "../../../voice/stt/index.js";
|
|
@@ -14,9 +14,6 @@ function stableValue(value) {
|
|
|
14
14
|
function contentHash(value) {
|
|
15
15
|
return createHash("sha256").update(JSON.stringify(stableValue(value))).digest("hex");
|
|
16
16
|
}
|
|
17
|
-
function asRecord(value) {
|
|
18
|
-
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
19
|
-
}
|
|
20
17
|
function buildEvalRuntimeIdentity(service, agentId) {
|
|
21
18
|
const config = service.currentConfig;
|
|
22
19
|
if (!config) return {
|
|
@@ -24,16 +21,13 @@ function buildEvalRuntimeIdentity(service, agentId) {
|
|
|
24
21
|
error: "Gateway configuration is unavailable",
|
|
25
22
|
status: 503
|
|
26
23
|
};
|
|
27
|
-
const effective =
|
|
24
|
+
const effective = getGatewayAgentEffectiveConfig(config, agentId);
|
|
28
25
|
if ("error" in effective) return {
|
|
29
26
|
ok: false,
|
|
30
27
|
error: effective.error,
|
|
31
28
|
status: effective.status ?? 400
|
|
32
29
|
};
|
|
33
|
-
const
|
|
34
|
-
const models = asRecord(manifest.models);
|
|
35
|
-
const tools = asRecord(manifest.tools);
|
|
36
|
-
const skills = manifest.skills ?? [];
|
|
30
|
+
const agentConfig = effective.data.config;
|
|
37
31
|
return {
|
|
38
32
|
ok: true,
|
|
39
33
|
payload: {
|
|
@@ -41,13 +35,12 @@ function buildEvalRuntimeIdentity(service, agentId) {
|
|
|
41
35
|
version: service.getHealth().version,
|
|
42
36
|
buildCommit: process.env.XOPC_BUILD_COMMIT?.trim() || process.env.GITHUB_SHA?.trim() || null,
|
|
43
37
|
agentId,
|
|
44
|
-
modelRef: models.primary
|
|
45
|
-
thinkingLevel:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
presetChain: effective.data.sources
|
|
38
|
+
modelRef: agentConfig.models.chat.primary,
|
|
39
|
+
thinkingLevel: null,
|
|
40
|
+
configHash: contentHash(agentConfig),
|
|
41
|
+
toolPolicyHash: contentHash(agentConfig.tools),
|
|
42
|
+
skillPolicyHash: contentHash(agentConfig.skills),
|
|
43
|
+
sources: effective.data.sources
|
|
51
44
|
}
|
|
52
45
|
};
|
|
53
46
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
3
|
-
import type { GatewayService } from '../../service.js';
|
|
4
|
-
export declare function registerTunnelPublicRoutes(app: Hono, service: GatewayService): void;
|
|
5
3
|
export declare function registerTunnelRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|