@xopcai/xopc 0.0.231 → 0.0.233
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-DQ5L3PTi.js} +1 -1
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-Bps8fvBp.js +1 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-JrK80PvP.js +1 -0
- package/dist/gateway/static/root/assets/agents-CJYEnz94.js +1 -0
- package/dist/gateway/static/root/assets/api-DE6tZKG0.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-DP7YVRPn.js → app-management-settings-panel-BryzDVod.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CVQ5n7y6.js → appearance-settings-BoweLBDm.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Bt8_sWtU.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-7_DXaMTP.js → archive-plugin-DyujzZNu.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-mmr_mHRr.js → attachment-load-DmXGUWve.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-preview-renderer-BDTD8YUe.js +12 -0
- package/dist/gateway/static/root/assets/{automations-page-DfY-T6Ga.js → automations-page-DrTVSK7o.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-86UTesz3.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CO9QMEh2.js → binary-plugins-mFyeC74W.js} +2 -2
- package/dist/gateway/static/root/assets/{block-editor-CE14CVOy.js → block-editor-D5yMFrgH.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page-DfMU7yXv.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-B6rLBtua.js +1 -0
- package/dist/gateway/static/root/assets/{browser-workflows-page-1wgXyoSO.js → browser-workflows-page-C74sg50f.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-lsHRuBlX.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-CxR_clkO.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-C5ABr73b.js → channels-status-swr-DowVNjNw.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CdRW6Euc.js → chat-terminal-dock-BO6_BgjE.js} +2 -2
- 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-CpNLyKB4.js +2 -0
- package/dist/gateway/static/root/assets/cron-expression-CYMXfk4M.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-DIM_OkQP.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-Cp8I6rsL.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-settings-MmOR4A3u.js → desktop-pet-settings-NjPiz3M_.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CMO-J3cG.js → desktop-pet-wzSzZ6S8.js} +1 -1
- package/dist/gateway/static/root/assets/dist-DqPZM2MH2.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DdH0dG2_.js → extension-debug-page-CoMl13ET.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-Clg-KktN.js → extension-page-CXc1Lc8x.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-CfEWpgjl.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-api-DEHnF4Wm.js → gateway-config-api-yH4KAEkK.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-config-swr-YyZJKvFf.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-DKkEXXj9.js → gateway-settings-BmjJIiKh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B_zrtccP.js → gateway-startup-retry-Dnrl91pU.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DGq9q4b6.js +1 -0
- package/dist/gateway/static/root/assets/home-page-Dj4B1wb3.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-BNzAAw4Y.js} +1 -1
- package/dist/gateway/static/root/assets/index-BGf-TiZj.js +70 -0
- package/dist/gateway/static/root/assets/index-BTUuTnc9.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BvpEeHnm.js → keyboard-shortcuts-settings-CfNV1ysF.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-IJg75WaN.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Bzvn99eH.js → local-apps-page-MPd4Fl_l.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-D_dq_0LV.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-NsfoazgK.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DeIjN4e0.js +1 -0
- package/dist/gateway/static/root/assets/markdown-editor-nDLmA_LF.js +2 -0
- package/dist/gateway/static/root/assets/markdown-split-BUAVv6Gu.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-CPkBOY3h.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-D8I7OGnT.js → media-plugins-DFsVnOY-.js} +1 -1
- package/dist/gateway/static/root/assets/messages-D4qOHT4D.js +3 -0
- package/dist/gateway/static/root/assets/mobile-device-api-D9JevyCE.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-C5y2gzMU.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-EpgG-OQc.js → notes-api-BWSfTP1w.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CCvjGMhN.js → notes-page-CV8UJj7g.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DrjMVgEI.js +4 -0
- package/dist/gateway/static/root/assets/{oauth-api-BwNLwbI8.js → oauth-api-DnanEBsf.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-3E24E65N.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-MmMswmOU.js → product-open-page-zNg1KOy2.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-tfcGYL-O.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BkjnXLdJ.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BFZrVYfy.js → registry-api-BeVzfRvs.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BXn-3n2d.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Dx6o7sLu.js → runtime-tools-settings-panel-BxoioSvT.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-Cdd9c4vt.js → schema-form-vzbmscrE.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-MLNjrOkw.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByNLBY2q.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-D0YxMnhm.js → settings-form-section-x9k7MWD3.js} +1 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-BLFOD9h9.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-CwgTooar.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-bnueBZg8.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-DiqBn-oE.js → share-preview-page-COTrPAd-.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-D-v_psqL.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-DJICr4wh.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CZwhWiRl.js → skills-page-D9wM6_Jn.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-kBGr8opZ.js → skills-page.utils-PtlQLM5a.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CPBs6lWi.js → system-settings-panel-BR74mNEK.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-B-rmeE8t.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-Qgvo0Ga7.js → theme-store-Bud54q9e.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-C4YcEiP9.js → use-autosave-DH47MH7s.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-B6eyxxOT.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-B59GaqRa.js +1 -0
- package/dist/gateway/static/root/assets/voice-config-api-C0ahrZ0e.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-CKIdPEen.js → work-discovery-overlay-DTn4RCcx.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BK44Vm5W.js → workflow-run-setup-panel-yDFoEX06.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BOwSbfWm.js +5 -0
- package/dist/gateway/static/root/index.html +16 -16
- package/dist/package.js +1 -1
- package/dist/packages/endpoint-tools-protocol/src/index.js +162 -2
- package/dist/packages/gateway-contract/src/product-delivery.js +6 -2
- package/dist/packages/gateway-contract/src/turn-outcome.js +77 -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/capabilities/definitions.d.ts +1 -1
- package/dist/src/agent/capabilities/definitions.js +2 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +5 -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/prompt/sections/tooling.js +5 -0
- package/dist/src/agent/service.js +0 -1
- package/dist/src/agent/starter-agents.js +1 -8
- package/dist/src/agent/tools/create-share-tool.js +2 -1
- package/dist/src/agent/tools/exec-command.js +2 -1
- package/dist/src/agent/tools/executor.d.ts +1 -1
- package/dist/src/agent/tools/factory.js +2 -0
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/publish-artifacts.d.ts +2 -0
- package/dist/src/agent/tools/publish-artifacts.js +82 -0
- package/dist/src/agent/tools/send-media.js +2 -1
- package/dist/src/agent/tools/workflow-tool.js +1 -5
- 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/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/command-catalog.js +4 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/agents.js +2 -1
- package/dist/src/cli/commands/auth.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 +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 +13 -12
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/cli/commands/support.d.ts +1 -0
- package/dist/src/cli/commands/support.js +51 -0
- 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/endpoint-tools/binding-service.d.ts +22 -0
- package/dist/src/endpoint-tools/binding-service.js +45 -0
- package/dist/src/endpoint-tools/index.d.ts +1 -0
- package/dist/src/endpoint-tools/index.js +2 -1
- package/dist/src/endpoint-tools/invocation-service.d.ts +1 -0
- package/dist/src/endpoint-tools/invocation-service.js +8 -0
- package/dist/src/endpoint-tools/policy.d.ts +4 -1
- package/dist/src/endpoint-tools/policy.js +68 -5
- package/dist/src/endpoint-tools/registry.js +1 -1
- package/dist/src/endpoint-tools/runtime.d.ts +2 -0
- package/dist/src/endpoint-tools/runtime.js +8 -0
- package/dist/src/extensions/activation-context.js +7 -11
- package/dist/src/files/file-service.js +14 -5
- 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/chat-stream/turn-outcome-collector.js +41 -6
- 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 +4 -2
- 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 +36 -3
- 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/endpoint-tools.js +68 -1
- package/dist/src/gateway/hono/routes/files.js +12 -1
- 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/media.js +46 -2
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/realtime.js +8 -1
- package/dist/src/gateway/hono/routes/status.js +9 -16
- package/dist/src/gateway/hono/routes/support.d.ts +3 -0
- package/dist/src/gateway/hono/routes/support.js +28 -0
- 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/you.js +24 -0
- 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 +7 -7
- package/dist/src/gateway/xopc-cloud-capability-setup.js +19 -21
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/media/store.js +9 -0
- 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/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/endpoint-session-binding-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/endpoint-session-binding-repository.js +32 -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 +4 -0
- package/dist/src/storage/sqlite/index.js +5 -1
- package/dist/src/storage/sqlite/migrations/138_device_access.sql +96 -0
- package/dist/src/storage/sqlite/migrations/139_turn_outcome_artifact_backfill.sql +231 -0
- package/dist/src/storage/sqlite/migrations/140_endpoint_session_bindings.sql +8 -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/support/build-support-investigation-prompt.d.ts +2 -0
- package/dist/src/support/build-support-investigation-prompt.js +29 -0
- package/dist/src/support/collect-support-report.d.ts +16 -0
- package/dist/src/support/collect-support-report.js +216 -0
- package/dist/src/support/redact-support-report.d.ts +16 -0
- package/dist/src/support/redact-support-report.js +89 -0
- package/dist/src/support/types.d.ts +76 -0
- package/dist/src/support/types.js +18 -0
- 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/user-context/user-avatar.d.ts +17 -0
- package/dist/src/user-context/user-avatar.js +116 -0
- 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 +4 -4
- package/dist/gateway/static/root/assets/agent-avatar-dicebear-CBqUnlvL.js +0 -1
- package/dist/gateway/static/root/assets/agents-7YO6znTT.js +0 -68
- package/dist/gateway/static/root/assets/api-BywYxpaS.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-DSCia0DT.js +0 -1
- package/dist/gateway/static/root/assets/attachment-preview-renderer-Cmo-5BP5.js +0 -11
- package/dist/gateway/static/root/assets/automations-workspace-BpvD54D6.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CeESA4Oj.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-B_OXTojB.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-D5nZecxV.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-BzmnWx6X.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-38FsOnR0.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DX6OkwFQ.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-DYSMZsms.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-DGCfX4tK.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-DHDa4ht1.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-B9qoxDcn.js +0 -1
- package/dist/gateway/static/root/assets/dist-J_ySZvz0.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-eP3fJ2M6.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-DlBPNubY.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BnOrLRfs.js +0 -1
- package/dist/gateway/static/root/assets/html-workspace-editor-bXK5tq64.js +0 -1
- package/dist/gateway/static/root/assets/index-0xQO5B_Q.js +0 -70
- package/dist/gateway/static/root/assets/index-CCyIdGuQ.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-Ch1rdUo8.js +0 -2
- package/dist/gateway/static/root/assets/locale-store-CXhjfe4q.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-zxx2ExlY.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-BQaeyOYm.js +0 -1
- package/dist/gateway/static/root/assets/markdown-editor-TWGaF7Xa.js +0 -2
- package/dist/gateway/static/root/assets/markdown-split-D9tmIiEm.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-RxNHwlNo.js +0 -201
- package/dist/gateway/static/root/assets/messages-BMdD0LWk.js +0 -3
- package/dist/gateway/static/root/assets/models-hub-cache-0RjEwafI.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-9cgh77VH.js +0 -4
- package/dist/gateway/static/root/assets/popover-select-CccGri5Y.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-hf6pmH4p.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-By2U-Wdh.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CUcpp7CQ.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-ByI82xS1.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BCoI5IJ8.js +0 -1
- package/dist/gateway/static/root/assets/settings-loading-skeleton-y53gEKsF.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-BoE_tToG.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BQmyb5KC.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Bf3VpZ-R.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CXHlbuGS.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-Bo0KSZ2v.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-Cnj7gMX2.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-BML8zCwZ.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-CB98MTwG.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/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,54 +1,32 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Gateway REST helpers for multi-agent management.
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
import type { AgentTypedModel } from '../config/schema.js';
|
|
7
|
-
export type GatewayAgentTypedModelsInfo = {
|
|
8
|
-
defaultRole: string;
|
|
9
|
-
preset: AgentTypedModel[];
|
|
10
|
-
entry?: AgentTypedModel[];
|
|
11
|
-
effective: AgentTypedModel[];
|
|
12
|
-
};
|
|
4
|
+
import type { AgentModelsOverride, EffectiveAgentConfig, SkillOverride } from '../agent-config/index.js';
|
|
5
|
+
import type { Config } from '../config/schema.js';
|
|
13
6
|
export type GatewayAgentRow = {
|
|
14
7
|
id: string;
|
|
15
8
|
name?: string;
|
|
16
9
|
description?: string;
|
|
17
10
|
language?: string;
|
|
18
|
-
role?: string;
|
|
19
|
-
responsibilities?: {
|
|
20
|
-
primary: string[];
|
|
21
|
-
secondary?: string[];
|
|
22
|
-
};
|
|
23
11
|
/** Value from `IDENTITY.md` **Avatar:** line when present (may be URL, `xopc:…`, etc.). */
|
|
24
12
|
avatar?: string;
|
|
25
13
|
workspace: string;
|
|
26
14
|
/** Absolute directory for profile Markdown (`SOUL.md`, …) and gateway avatars: `agents/<id>/profile/`. */
|
|
27
15
|
profileDir: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
};
|
|
32
|
-
typedModels: GatewayAgentTypedModelsInfo;
|
|
33
|
-
extends: string[];
|
|
16
|
+
override: Config['agents']['list'][number];
|
|
17
|
+
effective: EffectiveAgentConfig;
|
|
18
|
+
sources: Record<string, 'system' | 'global' | 'agent'>;
|
|
34
19
|
isDefault: boolean;
|
|
35
|
-
skills: {
|
|
36
|
-
preset: string[];
|
|
37
|
-
entry?: string[];
|
|
38
|
-
effectiveAllowlist?: string[];
|
|
39
|
-
};
|
|
40
|
-
tools: {
|
|
41
|
-
presetDenied: string[];
|
|
42
|
-
entryDisable: string[];
|
|
43
|
-
effectiveDisable: string[];
|
|
44
|
-
};
|
|
45
20
|
};
|
|
46
21
|
export type GatewayAgentsListResponse = {
|
|
47
22
|
defaultId: string;
|
|
48
23
|
agents: GatewayAgentRow[];
|
|
49
24
|
builtinToolIds: string[];
|
|
50
25
|
};
|
|
51
|
-
export type
|
|
26
|
+
export type GatewayAgentEffectiveConfigResponse = {
|
|
27
|
+
config: EffectiveAgentConfig;
|
|
28
|
+
sources: Record<string, 'system' | 'global' | 'agent'>;
|
|
29
|
+
};
|
|
52
30
|
/** Extract `**Avatar:**` value from profile IDENTITY.md (same line shape as the gateway console parser). */
|
|
53
31
|
export declare function extractAvatarFromIdentityMarkdown(content: string): string | undefined;
|
|
54
32
|
export declare function parseIdentityMarkdown(content: string): {
|
|
@@ -60,22 +38,12 @@ export declare function parseIdentityMarkdown(content: string): {
|
|
|
60
38
|
export declare function listGatewayAgents(cfg: Config, _options?: {
|
|
61
39
|
locale?: string;
|
|
62
40
|
}): Promise<GatewayAgentsListResponse>;
|
|
63
|
-
export declare function
|
|
41
|
+
export declare function getGatewayAgentEffectiveConfig(cfg: Config, agentIdRaw: string): AgentAdminResult<GatewayAgentEffectiveConfigResponse>;
|
|
64
42
|
export type CreateAgentBody = {
|
|
65
|
-
/** Optional id seed; normalized agent id defaults from
|
|
43
|
+
/** Optional id seed; normalized agent id defaults from the profile name when omitted. */
|
|
66
44
|
id?: string;
|
|
67
|
-
workspace
|
|
68
|
-
|
|
69
|
-
/** Reusable capability plans applied after the global baseline. */
|
|
70
|
-
extends?: string[];
|
|
71
|
-
/** Initial `agents.list[].skills` for the new entry. */
|
|
72
|
-
skills?: string[];
|
|
73
|
-
/** Initial `agents.list[].tools` for the new entry. */
|
|
74
|
-
tools?: NonNullable<Config['agents']['list']>[number]['tools'];
|
|
75
|
-
/** Profile markdown files to write after seeding (e.g. `IDENTITY.md`, `SOUL.md`). */
|
|
76
|
-
profileFiles?: Record<string, string>;
|
|
77
|
-
/** Clone from an existing agent id — copies config entry fields and profile directory. */
|
|
78
|
-
cloneFrom?: string;
|
|
45
|
+
workspace?: string;
|
|
46
|
+
profile: NonNullable<Config['agents']['list'][number]['profile']>;
|
|
79
47
|
};
|
|
80
48
|
export type AgentAdminHttpStatus = 400 | 404 | 409;
|
|
81
49
|
export type AgentAdminResult<T> = {
|
|
@@ -91,26 +59,16 @@ export declare function prepareCreateAgent(cfg: Config, body: CreateAgentBody):
|
|
|
91
59
|
agentId: string;
|
|
92
60
|
workspace: string;
|
|
93
61
|
}>;
|
|
94
|
-
export declare function finalizeCreateAgentDirs(cfg: Config, agentId: string
|
|
95
|
-
profileFiles?: Record<string, string>;
|
|
96
|
-
cloneFrom?: string;
|
|
97
|
-
}): Promise<AgentAdminResult<void>>;
|
|
62
|
+
export declare function finalizeCreateAgentDirs(cfg: Config, agentId: string): Promise<AgentAdminResult<void>>;
|
|
98
63
|
export type UpdateAgentBody = {
|
|
99
|
-
workspace?: string;
|
|
100
|
-
|
|
101
|
-
models?:
|
|
102
|
-
defaultRole?: string | null;
|
|
103
|
-
roles?: Record<string, {
|
|
104
|
-
model: string;
|
|
105
|
-
fallbacks?: string[];
|
|
106
|
-
description?: string;
|
|
107
|
-
}>;
|
|
108
|
-
} | null;
|
|
64
|
+
workspace?: string | null;
|
|
65
|
+
profile?: Config['agents']['list'][number]['profile'] | null;
|
|
66
|
+
models?: AgentModelsOverride | null;
|
|
109
67
|
setDefault?: boolean;
|
|
110
|
-
|
|
111
|
-
skills?: string[] | null;
|
|
112
|
-
/** Replace `agents.list[].tools`; `null` resets to no explicit policies. */
|
|
68
|
+
skills?: SkillOverride | null;
|
|
113
69
|
tools?: NonNullable<Config['agents']['list']>[number]['tools'] | null;
|
|
70
|
+
workflows?: NonNullable<Config['agents']['list']>[number]['workflows'] | null;
|
|
71
|
+
runtime?: NonNullable<Config['agents']['list']>[number]['runtime'] | null;
|
|
114
72
|
};
|
|
115
73
|
export declare function prepareUpdateAgent(cfg: Config, agentIdRaw: string, body: UpdateAgentBody): AgentAdminResult<{
|
|
116
74
|
nextConfig: Config;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, resolveUserPath, validateAgentIdForNewAgent } from "../agent/agent-scope.js";
|
|
2
|
-
import { resolveCapabilityPresetLayer, resolveEffectiveAgentManifest } from "../agent-manifest/resolver.js";
|
|
3
2
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
4
3
|
import { WORKSPACE_FILES, init_paths } from "../config/paths.js";
|
|
5
4
|
import { AGENT_PROFILE_MARKDOWN_SYSTEM_FILES, REQUIRED_AGENT_PROFILE_MARKDOWN_FILE_SET } from "../agent/context/workspace.js";
|
|
6
5
|
import { isPathUnderWorkspace, resolveWorkspaceSafePath } from "./workspace-editor-path.js";
|
|
7
6
|
import { seedAgentProfileMarkdownFiles } from "../agent/context/workspace-seed.js";
|
|
8
7
|
import { applyAgentConfig, findAgentEntryIndex, getAgentDeleteBlocker, pruneAgentConfig, removeAgentDirsFromDisk } from "../commands/agents.config.js";
|
|
9
|
-
import { resolveEffectiveTypedModels } from "../config/agent-typed-models.js";
|
|
10
8
|
import { GATEWAY_BUILTIN_TOOL_IDS } from "./agent-builtin-tools.js";
|
|
11
9
|
import { join, resolve } from "node:path";
|
|
12
|
-
import {
|
|
10
|
+
import { mkdir, readFile, realpath, stat, unlink, writeFile } from "node:fs/promises";
|
|
13
11
|
//#region src/gateway/agents-admin.ts
|
|
14
12
|
/**
|
|
15
13
|
* Gateway REST helpers for multi-agent management.
|
|
@@ -26,12 +24,6 @@ function collectAgentIdsForList(cfg) {
|
|
|
26
24
|
ids.add(defaultId);
|
|
27
25
|
return [...ids];
|
|
28
26
|
}
|
|
29
|
-
function rolesToTypedModels(roles) {
|
|
30
|
-
return Object.entries(roles ?? {}).map(([id, role]) => ({
|
|
31
|
-
id,
|
|
32
|
-
...role
|
|
33
|
-
})).sort((a, b) => a.id.localeCompare(b.id));
|
|
34
|
-
}
|
|
35
27
|
/** Extract `**Avatar:**` value from profile IDENTITY.md (same line shape as the gateway console parser). */
|
|
36
28
|
function extractAvatarFromIdentityMarkdown(content) {
|
|
37
29
|
return parseIdentityMarkdown(content).avatar || void 0;
|
|
@@ -58,58 +50,23 @@ async function listGatewayAgents(cfg, _options = {}) {
|
|
|
58
50
|
for (const id of collectAgentIdsForList(cfg)) {
|
|
59
51
|
const profile = resolveEffectiveAgentProfile(cfg, id);
|
|
60
52
|
const entry = listAgentEntries(cfg).find((e) => normalizeAgentId(e.id) === id);
|
|
61
|
-
|
|
62
|
-
presetIds: entry?.extends,
|
|
63
|
-
presets: cfg.agents.capabilityPresets,
|
|
64
|
-
defaultPresetId: cfg.agents.defaultPreset
|
|
65
|
-
});
|
|
66
|
-
const presetSkills = presetLayer.patch.skills?.mode === "allowlist" ? presetLayer.patch.skills.allow ?? [] : void 0;
|
|
67
|
-
const presetDenied = Object.entries(presetLayer.patch.tools?.builtin ?? {}).filter(([, policy]) => policy.mode === "deny").map(([name]) => name);
|
|
68
|
-
const presetTypedModels = rolesToTypedModels(presetLayer.patch.models?.roles);
|
|
69
|
-
const model = profile.primaryModelRef || profile.fallbacks.length > 0 ? {
|
|
70
|
-
...profile.primaryModelRef ? { primary: profile.primaryModelRef } : {},
|
|
71
|
-
...profile.fallbacks.length > 0 ? { fallbacks: profile.fallbacks } : {}
|
|
72
|
-
} : void 0;
|
|
73
|
-
const entrySkills = entry?.skills?.mode === "allowlist" ? entry.skills.allow ?? [] : void 0;
|
|
74
|
-
const entryDisable = Object.entries(entry?.tools?.builtin ?? {}).filter(([, policy]) => policy.mode === "deny").map(([name]) => name);
|
|
75
|
-
const entryTypedModels = rolesToTypedModels(entry?.models?.roles);
|
|
76
|
-
const effectiveTypedModels = [...resolveEffectiveTypedModels(cfg, id).values()].sort((a, b) => a.id.localeCompare(b.id));
|
|
53
|
+
if (!entry) continue;
|
|
77
54
|
let identity = {};
|
|
78
55
|
try {
|
|
79
56
|
identity = parseIdentityMarkdown(await readFile(join(resolveAgentProfileDir(cfg, id), WORKSPACE_FILES.IDENTITY), "utf-8"));
|
|
80
57
|
} catch {}
|
|
81
58
|
agents.push({
|
|
82
59
|
id,
|
|
83
|
-
|
|
60
|
+
name: entry.profile?.name ?? identity.name ?? id,
|
|
84
61
|
...identity.description ? { description: identity.description } : {},
|
|
85
62
|
...identity.language ? { language: identity.language } : {},
|
|
86
|
-
...profile.manifest.identity.role ? { role: profile.manifest.identity.role } : {},
|
|
87
|
-
responsibilities: {
|
|
88
|
-
primary: [...profile.manifest.responsibilities.primary],
|
|
89
|
-
...profile.manifest.responsibilities.secondary ? { secondary: [...profile.manifest.responsibilities.secondary] } : {}
|
|
90
|
-
},
|
|
91
63
|
...identity.avatar ? { avatar: identity.avatar } : {},
|
|
92
64
|
workspace: profile.resolvedWorkspacePath,
|
|
93
65
|
profileDir: resolveAgentProfileDir(cfg, id),
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
...entryTypedModels.length > 0 ? { entry: entryTypedModels } : {},
|
|
99
|
-
effective: effectiveTypedModels
|
|
100
|
-
},
|
|
101
|
-
extends: [...entry?.extends ?? []],
|
|
102
|
-
isDefault: id === defaultId,
|
|
103
|
-
skills: {
|
|
104
|
-
preset: presetSkills ? [...presetSkills] : [],
|
|
105
|
-
...entrySkills !== void 0 ? { entry: [...entrySkills] } : {},
|
|
106
|
-
...profile.skillsAllowlist !== void 0 ? { effectiveAllowlist: [...profile.skillsAllowlist] } : {}
|
|
107
|
-
},
|
|
108
|
-
tools: {
|
|
109
|
-
presetDenied: [...presetDenied],
|
|
110
|
-
entryDisable: [...entryDisable],
|
|
111
|
-
effectiveDisable: [...profile.tools.denied].sort((a, b) => a.localeCompare(b))
|
|
112
|
-
}
|
|
66
|
+
override: structuredClone(entry),
|
|
67
|
+
effective: structuredClone(profile.config),
|
|
68
|
+
sources: { ...profile.sources },
|
|
69
|
+
isDefault: id === defaultId
|
|
113
70
|
});
|
|
114
71
|
}
|
|
115
72
|
agents.sort((a, b) => a.id.localeCompare(b.id));
|
|
@@ -119,10 +76,9 @@ async function listGatewayAgents(cfg, _options = {}) {
|
|
|
119
76
|
builtinToolIds: [...GATEWAY_BUILTIN_TOOL_IDS]
|
|
120
77
|
};
|
|
121
78
|
}
|
|
122
|
-
function
|
|
79
|
+
function getGatewayAgentEffectiveConfig(cfg, agentIdRaw) {
|
|
123
80
|
const agentId = normalizeAgentId(agentIdRaw);
|
|
124
|
-
|
|
125
|
-
if (!entry) return {
|
|
81
|
+
if (!listAgentEntries(cfg).find((e) => normalizeAgentId(e.id) === agentId)) return {
|
|
126
82
|
ok: false,
|
|
127
83
|
error: `agent "${agentId}" not found`,
|
|
128
84
|
status: 404
|
|
@@ -130,11 +86,13 @@ function getGatewayAgentEffectiveManifest(cfg, agentIdRaw) {
|
|
|
130
86
|
try {
|
|
131
87
|
return {
|
|
132
88
|
ok: true,
|
|
133
|
-
data:
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
89
|
+
data: (() => {
|
|
90
|
+
const profile = resolveEffectiveAgentProfile(cfg, agentId);
|
|
91
|
+
return {
|
|
92
|
+
config: profile.config,
|
|
93
|
+
sources: profile.sources
|
|
94
|
+
};
|
|
95
|
+
})()
|
|
138
96
|
};
|
|
139
97
|
} catch (err) {
|
|
140
98
|
return {
|
|
@@ -145,35 +103,7 @@ function getGatewayAgentEffectiveManifest(cfg, agentIdRaw) {
|
|
|
145
103
|
}
|
|
146
104
|
}
|
|
147
105
|
function prepareCreateAgent(cfg, body) {
|
|
148
|
-
const
|
|
149
|
-
if (!workspace) return {
|
|
150
|
-
ok: false,
|
|
151
|
-
error: "workspace is required",
|
|
152
|
-
status: 400
|
|
153
|
-
};
|
|
154
|
-
if (body.profileFiles !== void 0) {
|
|
155
|
-
if (typeof body.profileFiles !== "object" || body.profileFiles === null || Array.isArray(body.profileFiles)) return {
|
|
156
|
-
ok: false,
|
|
157
|
-
error: "profileFiles must be an object",
|
|
158
|
-
status: 400
|
|
159
|
-
};
|
|
160
|
-
for (const [name, content] of Object.entries(body.profileFiles)) {
|
|
161
|
-
const bad = assertAllowedFile(name);
|
|
162
|
-
if (bad) return bad;
|
|
163
|
-
if (typeof content !== "string") return {
|
|
164
|
-
ok: false,
|
|
165
|
-
error: `profileFiles["${name}"] must be a string`,
|
|
166
|
-
status: 400
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
if (!body.cloneFrom && typeof body.profileFiles?.[WORKSPACE_FILES.IDENTITY] !== "string") return {
|
|
171
|
-
ok: false,
|
|
172
|
-
error: `profileFiles["${WORKSPACE_FILES.IDENTITY}"] is required`,
|
|
173
|
-
status: 400
|
|
174
|
-
};
|
|
175
|
-
const nameSeed = (body.profileFiles?.[WORKSPACE_FILES.IDENTITY] ? parseIdentityMarkdown(body.profileFiles[WORKSPACE_FILES.IDENTITY]) : {}).name ?? body.id ?? "";
|
|
176
|
-
const idRes = validateAgentIdForNewAgent(body.id, nameSeed);
|
|
106
|
+
const idRes = validateAgentIdForNewAgent(body.id, body.profile.name);
|
|
177
107
|
if (idRes.ok === false) return {
|
|
178
108
|
ok: false,
|
|
179
109
|
error: idRes.error,
|
|
@@ -185,50 +115,21 @@ function prepareCreateAgent(cfg, body) {
|
|
|
185
115
|
error: `agent "${agentId}" already exists`,
|
|
186
116
|
status: 409
|
|
187
117
|
};
|
|
188
|
-
|
|
189
|
-
if (body.cloneFrom) {
|
|
190
|
-
const srcId = normalizeAgentId(body.cloneFrom);
|
|
191
|
-
cloneSourceEntry = listAgentEntries(cfg).find((e) => normalizeAgentId(e.id) === srcId);
|
|
192
|
-
if (!cloneSourceEntry && srcId !== resolveDefaultAgentId(cfg)) return {
|
|
193
|
-
ok: false,
|
|
194
|
-
error: `source agent "${srcId}" not found`,
|
|
195
|
-
status: 404
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
const wsAbs = resolveUserPath(workspace);
|
|
199
|
-
const rawModels = body.models ?? cloneSourceEntry?.models;
|
|
200
|
-
const inheritedPresetIds = body.extends ?? cloneSourceEntry?.extends ?? [];
|
|
201
|
-
for (const presetId of inheritedPresetIds) if (!cfg.agents.capabilityPresets[presetId]) return {
|
|
202
|
-
ok: false,
|
|
203
|
-
error: `capability preset "${presetId}" not found`,
|
|
204
|
-
status: 400
|
|
205
|
-
};
|
|
206
|
-
const effectiveModels = rawModels?.roles ? {
|
|
207
|
-
defaultRole: rawModels.defaultRole ?? Object.keys(rawModels.roles)[0] ?? "deep",
|
|
208
|
-
roles: rawModels.roles
|
|
209
|
-
} : void 0;
|
|
210
|
-
if (effectiveModels && !effectiveModels.roles[effectiveModels.defaultRole]) return {
|
|
211
|
-
ok: false,
|
|
212
|
-
error: "models.defaultRole must reference models.roles",
|
|
213
|
-
status: 400
|
|
214
|
-
};
|
|
118
|
+
const wsAbs = resolveUserPath(body.workspace?.trim() || `~/.xopc/workspace/${agentId}`);
|
|
215
119
|
return {
|
|
216
120
|
ok: true,
|
|
217
121
|
data: {
|
|
218
122
|
nextConfig: applyAgentConfig(cfg, {
|
|
219
123
|
agentId,
|
|
220
|
-
workspace: wsAbs,
|
|
221
|
-
|
|
222
|
-
...effectiveModels ? { models: effectiveModels } : {},
|
|
223
|
-
...body.skills !== void 0 ? { skills: body.skills.map((s) => String(s).trim()).filter(Boolean) } : cloneSourceEntry?.skills?.mode === "allowlist" && body.cloneFrom ? { skills: [...cloneSourceEntry.skills.allow ?? []] } : {},
|
|
224
|
-
...body.tools !== void 0 ? { tools: body.tools } : cloneSourceEntry?.tools && body.cloneFrom ? { tools: cloneSourceEntry.tools } : {}
|
|
124
|
+
...body.workspace?.trim() ? { workspace: wsAbs } : {},
|
|
125
|
+
profile: structuredClone(body.profile)
|
|
225
126
|
}),
|
|
226
127
|
agentId,
|
|
227
128
|
workspace: wsAbs
|
|
228
129
|
}
|
|
229
130
|
};
|
|
230
131
|
}
|
|
231
|
-
async function finalizeCreateAgentDirs(cfg, agentId
|
|
132
|
+
async function finalizeCreateAgentDirs(cfg, agentId) {
|
|
232
133
|
const wsPath = resolveAgentWorkspaceDir(cfg, agentId);
|
|
233
134
|
const profilePath = resolveAgentProfileDir(cfg, agentId);
|
|
234
135
|
const adPath = resolveAgentDir(cfg, agentId);
|
|
@@ -236,29 +137,7 @@ async function finalizeCreateAgentDirs(cfg, agentId, opts) {
|
|
|
236
137
|
await mkdir(profilePath, { recursive: true });
|
|
237
138
|
await mkdir(adPath, { recursive: true });
|
|
238
139
|
const id = normalizeAgentId(agentId);
|
|
239
|
-
|
|
240
|
-
if (opts?.cloneFrom) {
|
|
241
|
-
const srcProfilePath = resolveAgentProfileDir(cfg, normalizeAgentId(opts.cloneFrom));
|
|
242
|
-
try {
|
|
243
|
-
if ((await stat(srcProfilePath)).isDirectory()) {
|
|
244
|
-
const srcFiles = await readdir(srcProfilePath);
|
|
245
|
-
for (const fileName of srcFiles) {
|
|
246
|
-
const srcFile = join(srcProfilePath, fileName);
|
|
247
|
-
const dstFile = join(profilePath, fileName);
|
|
248
|
-
try {
|
|
249
|
-
if ((await stat(srcFile)).isFile()) await cp(srcFile, dstFile);
|
|
250
|
-
} catch {}
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
} catch {
|
|
254
|
-
seedAgentProfileMarkdownFiles(profilePath, wsPath, { displayName });
|
|
255
|
-
}
|
|
256
|
-
} else seedAgentProfileMarkdownFiles(profilePath, wsPath, { displayName });
|
|
257
|
-
const profileFiles = opts?.profileFiles;
|
|
258
|
-
if (profileFiles && Object.keys(profileFiles).length > 0) for (const [name, content] of Object.entries(profileFiles)) {
|
|
259
|
-
const written = await writeAgentProfileFile(cfg, agentId, name, content);
|
|
260
|
-
if (written.ok === false) return written;
|
|
261
|
-
}
|
|
140
|
+
seedAgentProfileMarkdownFiles(profilePath, wsPath, { displayName: listAgentEntries(cfg).find((candidate) => normalizeAgentId(candidate.id) === id)?.profile?.name ?? id });
|
|
262
141
|
return {
|
|
263
142
|
ok: true,
|
|
264
143
|
data: void 0
|
|
@@ -266,23 +145,8 @@ async function finalizeCreateAgentDirs(cfg, agentId, opts) {
|
|
|
266
145
|
}
|
|
267
146
|
function prepareUpdateAgent(cfg, agentIdRaw, body) {
|
|
268
147
|
const agentId = normalizeAgentId(agentIdRaw);
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
if (idx < 0 && agentId === resolveDefaultAgentId(cfg)) {
|
|
272
|
-
list = [...list, {
|
|
273
|
-
id: agentId,
|
|
274
|
-
enabled: true,
|
|
275
|
-
identity: {
|
|
276
|
-
name: agentId,
|
|
277
|
-
role: "Agent",
|
|
278
|
-
language: "en",
|
|
279
|
-
tone: "direct"
|
|
280
|
-
},
|
|
281
|
-
responsibilities: { primary: ["Help the user complete tasks"] },
|
|
282
|
-
workspace: { root: `~/.xopc/workspace/${agentId}` }
|
|
283
|
-
}];
|
|
284
|
-
idx = list.length - 1;
|
|
285
|
-
}
|
|
148
|
+
const list = [...listAgentEntries(cfg)];
|
|
149
|
+
const idx = findAgentEntryIndex(list, agentId);
|
|
286
150
|
if (idx < 0) return {
|
|
287
151
|
ok: false,
|
|
288
152
|
error: `agent "${agentId}" not found`,
|
|
@@ -290,78 +154,22 @@ function prepareUpdateAgent(cfg, agentIdRaw, body) {
|
|
|
290
154
|
};
|
|
291
155
|
const entry = { ...list[idx] };
|
|
292
156
|
if (body.workspace !== void 0) {
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
295
|
-
|
|
296
|
-
if (body.extends !== void 0) {
|
|
297
|
-
const nextExtends = Array.from(new Set(body.extends.map((id) => normalizeAgentId(id)).filter(Boolean)));
|
|
298
|
-
for (const presetId of nextExtends) if (!cfg.agents.capabilityPresets[presetId]) return {
|
|
299
|
-
ok: false,
|
|
300
|
-
error: `capability preset "${presetId}" not found`,
|
|
301
|
-
status: 400
|
|
302
|
-
};
|
|
303
|
-
if (nextExtends.length > 0) entry.extends = nextExtends;
|
|
304
|
-
else delete entry.extends;
|
|
157
|
+
const workspace = body.workspace?.trim();
|
|
158
|
+
if (workspace) entry.workspace = resolveUserPath(workspace);
|
|
159
|
+
else delete entry.workspace;
|
|
305
160
|
}
|
|
161
|
+
if (body.profile !== void 0) if (body.profile === null) delete entry.profile;
|
|
162
|
+
else entry.profile = structuredClone(body.profile);
|
|
306
163
|
if (body.models !== void 0) if (body.models === null) delete entry.models;
|
|
307
|
-
else
|
|
308
|
-
if (body.models.defaultRole !== void 0) {
|
|
309
|
-
if (body.models.defaultRole === null || !body.models.defaultRole.trim()) return {
|
|
310
|
-
ok: false,
|
|
311
|
-
error: "models.defaultRole must be a non-empty string",
|
|
312
|
-
status: 400
|
|
313
|
-
};
|
|
314
|
-
entry.models = {
|
|
315
|
-
defaultRole: body.models.defaultRole.trim(),
|
|
316
|
-
roles: entry.models?.roles ?? {},
|
|
317
|
-
...entry.models?.policy ? { policy: entry.models.policy } : {}
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
if (Object.hasOwn(body.models, "roles")) {
|
|
321
|
-
if (body.models.roles !== void 0) {
|
|
322
|
-
const roles = Object.fromEntries(Object.entries(body.models.roles).map(([id, row]) => ({
|
|
323
|
-
id: id.trim(),
|
|
324
|
-
model: row.model.trim(),
|
|
325
|
-
fallbacks: (row.fallbacks ?? []).map((ref) => ref.trim()).filter(Boolean),
|
|
326
|
-
description: row.description?.trim()
|
|
327
|
-
})).filter((row) => row.id && row.model).map((row) => [row.id, {
|
|
328
|
-
model: row.model,
|
|
329
|
-
...row.fallbacks.length > 0 ? { fallbacks: row.fallbacks } : {},
|
|
330
|
-
...row.description ? { description: row.description } : {}
|
|
331
|
-
}]));
|
|
332
|
-
entry.models = {
|
|
333
|
-
defaultRole: entry.models?.defaultRole ?? Object.keys(roles)[0] ?? "deep",
|
|
334
|
-
roles,
|
|
335
|
-
...entry.models?.policy ? { policy: entry.models.policy } : {}
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
const roles = entry.models?.roles ?? {};
|
|
340
|
-
const defaultRole = entry.models?.defaultRole ?? Object.keys(roles)[0];
|
|
341
|
-
if (!defaultRole || !roles[defaultRole]) return {
|
|
342
|
-
ok: false,
|
|
343
|
-
error: "models.defaultRole must reference models.roles",
|
|
344
|
-
status: 400
|
|
345
|
-
};
|
|
346
|
-
entry.models = {
|
|
347
|
-
...entry.models,
|
|
348
|
-
defaultRole
|
|
349
|
-
};
|
|
350
|
-
}
|
|
164
|
+
else entry.models = structuredClone(body.models);
|
|
351
165
|
if (body.skills !== void 0) if (body.skills === null) delete entry.skills;
|
|
352
|
-
else
|
|
353
|
-
const next = body.skills.map((s) => String(s).trim()).filter(Boolean);
|
|
354
|
-
if (next.length === 0) entry.skills = {
|
|
355
|
-
mode: "allowlist",
|
|
356
|
-
allow: []
|
|
357
|
-
};
|
|
358
|
-
else entry.skills = {
|
|
359
|
-
mode: "allowlist",
|
|
360
|
-
allow: next
|
|
361
|
-
};
|
|
362
|
-
}
|
|
166
|
+
else entry.skills = structuredClone(body.skills);
|
|
363
167
|
if (body.tools !== void 0) if (body.tools === null) delete entry.tools;
|
|
364
168
|
else entry.tools = body.tools;
|
|
169
|
+
if (body.workflows !== void 0) if (body.workflows === null) delete entry.workflows;
|
|
170
|
+
else entry.workflows = structuredClone(body.workflows);
|
|
171
|
+
if (body.runtime !== void 0) if (body.runtime === null) delete entry.runtime;
|
|
172
|
+
else entry.runtime = structuredClone(body.runtime);
|
|
365
173
|
list[idx] = entry;
|
|
366
174
|
let next = {
|
|
367
175
|
...cfg,
|
|
@@ -672,4 +480,4 @@ async function deleteAgentAvatarFile(cfg, agentId) {
|
|
|
672
480
|
};
|
|
673
481
|
}
|
|
674
482
|
//#endregion
|
|
675
|
-
export { deleteAgentAvatarFile, extractAvatarFromIdentityMarkdown, finalizeCreateAgentDirs,
|
|
483
|
+
export { deleteAgentAvatarFile, extractAvatarFromIdentityMarkdown, finalizeCreateAgentDirs, getGatewayAgentEffectiveConfig, listAgentProfileFiles, listGatewayAgents, parseIdentityMarkdown, prepareCreateAgent, prepareDeleteAgent, prepareUpdateAgent, readAgentAvatarFile, readAgentProfileFile, runAfterDeletePurge, writeAgentAvatarFromBase64, writeAgentProfileFile };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { TurnOutcomeDeliverableSchema } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
1
|
+
import { TurnOutcomeDeliverableSchema, fileResourceArtifactUri, turnOutcomeKindFromFileName, turnOutcomeMimeTypeFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
|
+
import { parseProductDeliveryEnvelope } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
3
|
+
import { parseFileResourceId } from "../../files/file-service.js";
|
|
2
4
|
//#region src/gateway/chat-stream/turn-outcome-collector.ts
|
|
3
5
|
const VERIFICATION_COMMAND = /(^|[\s:/_-])(test|vitest|jest|pytest|lint|typecheck|type-check|build)([\s:/_-]|$)/i;
|
|
4
6
|
const MAX_OUTCOME_DIFF_CHARS = 2e5;
|
|
@@ -27,13 +29,46 @@ function changedFiles(changes) {
|
|
|
27
29
|
}];
|
|
28
30
|
});
|
|
29
31
|
}
|
|
30
|
-
function
|
|
32
|
+
function explicitArtifacts(details) {
|
|
31
33
|
if (!Array.isArray(details.artifacts)) return [];
|
|
32
34
|
return details.artifacts.flatMap((value) => {
|
|
33
35
|
const parsed = TurnOutcomeDeliverableSchema.safeParse(value);
|
|
34
36
|
return parsed.success ? [parsed.data] : [];
|
|
35
37
|
});
|
|
36
38
|
}
|
|
39
|
+
function fileReferenceDeliverable(reference, operation, environment) {
|
|
40
|
+
if (reference.kind !== "file") return null;
|
|
41
|
+
let workspaceRelativePath;
|
|
42
|
+
try {
|
|
43
|
+
workspaceRelativePath = parseFileResourceId(reference.id).relativePath;
|
|
44
|
+
} catch {}
|
|
45
|
+
const mimeType = turnOutcomeMimeTypeFromFileName(reference.title);
|
|
46
|
+
const available = operation !== "failed";
|
|
47
|
+
const capabilities = available ? [
|
|
48
|
+
...reference.capabilities.includes("preview") ? ["preview"] : [],
|
|
49
|
+
"download",
|
|
50
|
+
...reference.capabilities.includes("share") ? ["share"] : []
|
|
51
|
+
] : ["regenerate"];
|
|
52
|
+
return {
|
|
53
|
+
artifactId: reference.id,
|
|
54
|
+
title: reference.title,
|
|
55
|
+
kind: turnOutcomeKindFromFileName(reference.title),
|
|
56
|
+
...mimeType ? { mimeType } : {},
|
|
57
|
+
availability: available ? "available" : "failed",
|
|
58
|
+
location: environment,
|
|
59
|
+
capabilities,
|
|
60
|
+
...available && environment === "workspace" ? { uri: fileResourceArtifactUri(reference.id) } : {},
|
|
61
|
+
...workspaceRelativePath ? { workspaceRelativePath } : {}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function productDeliveryArtifacts(delivery, environment) {
|
|
65
|
+
if (!delivery) return [];
|
|
66
|
+
return [delivery.primary, ...delivery.related ?? []].flatMap((reference) => {
|
|
67
|
+
if (!reference) return [];
|
|
68
|
+
const artifact = fileReferenceDeliverable(reference, delivery.operation, environment);
|
|
69
|
+
return artifact ? [artifact] : [];
|
|
70
|
+
});
|
|
71
|
+
}
|
|
37
72
|
var TurnOutcomeCollector = class {
|
|
38
73
|
deliverables = /* @__PURE__ */ new Map();
|
|
39
74
|
evidence = /* @__PURE__ */ new Map();
|
|
@@ -52,9 +87,9 @@ var TurnOutcomeCollector = class {
|
|
|
52
87
|
this.failedToolCount += 1;
|
|
53
88
|
return;
|
|
54
89
|
}
|
|
55
|
-
const details = asRecord(event.payload.result?.details);
|
|
56
|
-
|
|
57
|
-
for (const artifact of
|
|
90
|
+
const details = asRecord(event.payload.result?.details) ?? {};
|
|
91
|
+
const artifacts = [...explicitArtifacts(details), ...productDeliveryArtifacts(parseProductDeliveryEnvelope(details.delivery), this.environment)];
|
|
92
|
+
for (const artifact of artifacts) this.deliverables.set(artifact.artifactId, artifact);
|
|
58
93
|
return;
|
|
59
94
|
}
|
|
60
95
|
if (event.type === "patch_applied") {
|
|
@@ -82,7 +117,7 @@ var TurnOutcomeCollector = class {
|
|
|
82
117
|
}
|
|
83
118
|
finalize(status, summary) {
|
|
84
119
|
const evidence = [...this.evidence.values()];
|
|
85
|
-
const partial = this.failedToolCount > 0 || evidence.some((item) => item.status === "failed");
|
|
120
|
+
const partial = this.failedToolCount > 0 || evidence.some((item) => item.status === "failed") || [...this.deliverables.values()].some((item) => item.availability === "failed");
|
|
86
121
|
const fullDiff = this.diffs.join("\n");
|
|
87
122
|
const diffTruncated = fullDiff.length > MAX_OUTCOME_DIFF_CHARS;
|
|
88
123
|
return {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { resolveReverseProxyPublicUrl } from "./public-url.js";
|
|
2
|
+
import { getTailscaleExposureState } from "./tailscale-lifecycle.js";
|
|
3
|
+
import { getTunnelService } from "../tunnel/tunnel-service.js";
|
|
4
|
+
import crypto from "node:crypto";
|
|
5
|
+
//#region src/gateway/device-routes.ts
|
|
6
|
+
function secureUrl(value) {
|
|
7
|
+
if (!value) return null;
|
|
8
|
+
try {
|
|
9
|
+
const parsed = new URL(value);
|
|
10
|
+
if (parsed.protocol !== "https:" || parsed.username || parsed.password) return null;
|
|
11
|
+
return parsed.origin;
|
|
12
|
+
} catch {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function routeId(kind, url) {
|
|
17
|
+
return `${kind}-${crypto.createHash("sha256").update(url).digest("hex").slice(0, 12)}`;
|
|
18
|
+
}
|
|
19
|
+
function resolveSecureDeviceRoutes(config) {
|
|
20
|
+
const tunnelStatus = getTunnelService().getStatus();
|
|
21
|
+
const candidates = [{
|
|
22
|
+
kind: "custom-https",
|
|
23
|
+
url: secureUrl(resolveReverseProxyPublicUrl(config))
|
|
24
|
+
}, {
|
|
25
|
+
kind: "xopc-secure-link",
|
|
26
|
+
url: tunnelStatus.state === "connected" ? secureUrl(tunnelStatus.publicUrl) : null
|
|
27
|
+
}];
|
|
28
|
+
const tailscale = getTailscaleExposureState();
|
|
29
|
+
if (tailscale.active && tailscale.hostname) candidates.push({
|
|
30
|
+
kind: "tailscale",
|
|
31
|
+
url: secureUrl(`https://${tailscale.hostname}`)
|
|
32
|
+
});
|
|
33
|
+
const seen = /* @__PURE__ */ new Set();
|
|
34
|
+
const routes = [];
|
|
35
|
+
for (const candidate of candidates) {
|
|
36
|
+
if (!candidate.url || seen.has(candidate.url)) continue;
|
|
37
|
+
seen.add(candidate.url);
|
|
38
|
+
routes.push({
|
|
39
|
+
id: routeId(candidate.kind, candidate.url),
|
|
40
|
+
kind: candidate.kind,
|
|
41
|
+
url: candidate.url
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return routes;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { resolveSecureDeviceRoutes };
|
|
@@ -1,25 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AgentDefaults } from '../agent-config/index.js';
|
|
2
2
|
import type { Config } from '../config/schema.js';
|
|
3
|
-
|
|
4
|
-
export type GlobalDefaultsProviderRow = {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
configured: boolean;
|
|
8
|
-
source: GlobalDefaultsProviderSource;
|
|
9
|
-
};
|
|
10
|
-
export type GlobalDefaultsRecommendation = {
|
|
11
|
-
provider: string;
|
|
12
|
-
model: string;
|
|
13
|
-
reason: 'configured-provider' | 'recommended';
|
|
14
|
-
};
|
|
3
|
+
import { type GatewayBuiltinToolSummary } from './agent-builtin-tools.js';
|
|
15
4
|
export type GlobalDefaultsPayload = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
providers: GlobalDefaultsProviderRow[];
|
|
19
|
-
recommendations: GlobalDefaultsRecommendation[];
|
|
5
|
+
defaults: AgentDefaults;
|
|
6
|
+
builtinTools: GatewayBuiltinToolSummary[];
|
|
20
7
|
};
|
|
21
8
|
export type UpdateGlobalDefaultsBody = {
|
|
22
|
-
|
|
9
|
+
defaults: AgentDefaults;
|
|
23
10
|
};
|
|
24
11
|
export type GlobalDefaultsAdminResult<T> = {
|
|
25
12
|
ok: true;
|
|
@@ -29,8 +16,7 @@ export type GlobalDefaultsAdminResult<T> = {
|
|
|
29
16
|
error: string;
|
|
30
17
|
status?: 400 | 404 | 500;
|
|
31
18
|
};
|
|
32
|
-
export declare function
|
|
33
|
-
export declare function listGlobalDefaults(cfg: Config): Promise<GlobalDefaultsPayload>;
|
|
19
|
+
export declare function listGlobalDefaults(cfg: Config): GlobalDefaultsPayload;
|
|
34
20
|
export declare function prepareUpdateGlobalDefaults(cfg: Config, body: UpdateGlobalDefaultsBody): GlobalDefaultsAdminResult<{
|
|
35
21
|
nextConfig: Config;
|
|
36
22
|
}>;
|