@xopcai/xopc 0.0.251 → 0.0.253
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 +8 -5
- package/README.zh-CN.md +8 -5
- package/dist/browser-ext/dist/background.js +358 -768
- package/dist/browser-ext/manifest.json +1 -2
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/plugin.js +3 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-DfBjTSo9.js → activity-store-CeS1bgXP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Bo_dmLv8.js → agent-avatar-dicebear-BdF3HhCW.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-Bs34Kp0K.js +1 -0
- package/dist/gateway/static/root/assets/{agents-yuUn8n-f.js → agents-DARlgjTm.js} +1 -1
- package/dist/gateway/static/root/assets/{api-zxpcJfgj.js → api-zMPeC0yU.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Cz56nrVF.js → app-management-settings-panel-BaAFln8W.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DxSws5U4.js → appearance-settings-CXvsoBlw.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BhgvfBJT.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-7k15-hqo.js → archive-plugin-C0o_mVQI.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B-SFpjd9.js → attachment-load-B5Ry3tGL.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Qy36j19q.js → automations-page-DY5QAEQd.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BzX4lILP.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CPOZQt8F.js → binary-plugins-BydpEgBA.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DhvVlIp9.js → block-editor-D0CpUOMo.js} +3 -3
- package/dist/gateway/static/root/assets/browser-automation-inputs-DzbTsGI6.js +1 -0
- package/dist/gateway/static/root/assets/browser-automations-page-D7fZYjni.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-BBdMqxl0.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D_WfftDW.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-bdRLT9KA.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CX-yWwLD.js → channels-status-swr-BGGRTkn6.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-1PJoxRuV.js → chat-terminal-dock-_CP4nvlg.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CPDjU5wU.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-CBCc6zFA.js → cron-expression-g2U8Rllf.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-u8K5Kt_N.js → date-picker-SmVlhtj_.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-y_i_cnpz.js → dependency-picker-D-0gcbbM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DyL0JxLm.js → desktop-pet-Cl3JRIu6.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-d2d_IsyP.js → desktop-pet-settings-D7kvWQ9H.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DqIBKJwl.js → extension-debug-page-DtP2tJHY.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DUW1xxj2.js → extension-page-CphZDdoT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BHY9qaNw.js → extension-settings-page-CsxVLV4-.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CMNbl0FZ.js → gateway-config-swr-BW3Bx-aV.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-DxBZ05dX.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CR7Xg8As.js → gateway-startup-retry-DAq74TZe.js} +1 -1
- package/dist/gateway/static/root/assets/{heartbeat-settings-7CD9iPR7.js → heartbeat-settings-DWcKsIoZ.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BdvLZKQZ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-C5mn73ca.js → image-generation-api-MPuaXDRs.js} +1 -1
- package/dist/gateway/static/root/assets/index-C7RDs6S-.js +74 -0
- package/dist/gateway/static/root/assets/index-Cu8xqZQ9.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BtlqMleF.js → keyboard-shortcuts-settings-CfhaTqgE.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-BjxfkjxE.js → local-app-workbench-page-CR6asX7L.js} +2 -2
- package/dist/gateway/static/root/assets/{local-apps-page-B7xqQe2s.js → local-apps-page-g01W3kEK.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CF4erhjB.js → locale-store-BkeaPZpn.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-kACaPZKL.js → logs-page-ZP4QTWoC.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-A432siER.js → management-settings-DeGxJF_Z.js} +1 -1
- package/dist/gateway/static/root/assets/markdown-view-Ca7BRBLL.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-CpvYiauZ.js → media-plugins-FmOhmzlD.js} +1 -1
- package/dist/gateway/static/root/assets/messages-C72stReU.js +3 -0
- package/dist/gateway/static/root/assets/{mobile-pairing-wizard-DyjVGngO.js → mobile-pairing-wizard-BXNbn05L.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-EeVeF4II.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-D7bMff96.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-B3FKzjR6.js → page-tabs-pyukZ1PJ.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-DnjrwAHD.js → preview-open-alternatives-slFHoMUe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-COcr_NUJ.js → product-open-page-CXa3FNNk.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BDF88VdN.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DeTD6pu1.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BsRBlji7.js → registry-api-CviQoUBf.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CxKrdQ6a.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-LO4wZ_dO.js → runtime-tools-settings-panel-O9D9o7-O.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-crcj4-Pm.js → schema-form-8FesicnL.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DUFJN-2t.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CcSYDjaH.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-Bl4MvTmq.js → settings-form-section-CBic9TFH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-DplrjZ6x.js → settings-page-Xz66_Mjg.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-C6DuwrP5.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CJP1kURj.js → share-preview-page--JpjwB58.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CemgzEi4.js → shares-settings-CovcdHSC.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CrHagTsE.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DsjcKg9Q.js → skills-page-fVKExKv5.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-D6gWBbvy.js → skills-page.utils-Yv9u3uJp.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-_eCXfqCo.js → system-settings-panel-CCWjVdc2.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-D0Z_K5JT.js → task-detail-page-I8hueJnG.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-BOgkc_9D.js → theme-store-BtkaVpMm.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-W5mktxl1.js → tunnel-api-C__W9BaN.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-Na2DYzT3.js → use-autosave-Dow9RRcq.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-CU6nxmoM.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-OXweUxS_.js → voice-api-key-field-CvF3lEyx.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-C-ryeIxj.js → voice-config-api-BEUVAyM6.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BqOsO47I.js → work-discovery-overlay-B9PDfReq.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-B9S_lfT1.js → workflow-run-setup-panel-kWGFkhjz.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-B4Is5E42.js +5 -0
- package/dist/gateway/static/root/index.html +10 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/new-session.js +9 -0
- package/dist/packages/realtime-protocol/src/voice.js +6 -1
- package/dist/src/agent/agent-manager.d.ts +2 -1
- package/dist/src/agent/agent-manager.js +26 -8
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/coding/repository-instructions.js +2 -2
- package/dist/src/agent/coding/workspace-revision.js +2 -2
- package/dist/src/agent/commands/command-isolation.js +2 -2
- package/dist/src/agent/embedded/execution-context.d.ts +2 -1
- package/dist/src/agent/embedded/execution-context.js +10 -4
- package/dist/src/agent/embedded/index.d.ts +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -4
- package/dist/src/agent/embedded/run-turn.js +22 -3
- package/dist/src/agent/embedded/types.d.ts +1 -1
- package/dist/src/agent/external-tools/composio-provider.d.ts +1 -0
- package/dist/src/agent/external-tools/composio-provider.js +64 -34
- package/dist/src/agent/external-tools/search-error.js +5 -3
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +6 -3
- package/dist/src/agent/service/process-direct-streaming.js +6 -3
- package/dist/src/agent/service.d.ts +2 -0
- package/dist/src/agent/service.js +25 -10
- package/dist/src/agent/service.types.d.ts +2 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +4 -0
- package/dist/src/agent/tasks/task-judge-service.js +3 -3
- package/dist/src/agent/tool-manuals/browser.d.ts +1 -1
- package/dist/src/agent/tool-manuals/browser.js +15 -226
- package/dist/src/agent/tools/browser/tool/browser-use-tool.d.ts +4 -21
- package/dist/src/agent/tools/browser/tool/browser-use-tool.js +48 -165
- package/dist/src/agent/tools/browser/tool/schemas.d.ts +203 -16
- package/dist/src/agent/tools/browser/tool/schemas.js +146 -16
- package/dist/src/agent/tools/browser-automation-tool.d.ts +121 -0
- package/dist/src/agent/tools/browser-automation-tool.js +197 -0
- package/dist/src/agent/tools/clarify-tool.d.ts +17 -3
- package/dist/src/agent/tools/clarify-tool.js +27 -32
- package/dist/src/agent/tools/cli-clarify.js +23 -8
- package/dist/src/agent/tools/factory.d.ts +6 -9
- package/dist/src/agent/tools/factory.js +42 -59
- package/dist/src/agent/tools/index.d.ts +2 -2
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/review-workspace.js +2 -2
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +3 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/defaults.js +1 -1
- package/dist/src/automations/domain/types.d.ts +5 -5
- package/dist/src/automations/domain/validation.d.ts +16 -16
- package/dist/src/automations/domain/validation.js +3 -3
- package/dist/src/automations/draft/automation-draft-validator.d.ts +4 -4
- package/dist/src/automations/draft/automation-draft-validator.js +1 -1
- package/dist/src/automations/service/action-executor.d.ts +1 -1
- package/dist/src/automations/service/action-executor.js +7 -7
- package/dist/src/browser/{recipes → automations}/index.d.ts +1 -0
- package/dist/src/browser/automations/index.js +4 -0
- package/dist/src/browser/automations/repository.d.ts +13 -0
- package/dist/src/browser/automations/repository.js +60 -0
- package/dist/src/browser/automations/runner.d.ts +17 -0
- package/dist/src/browser/automations/runner.js +173 -0
- package/dist/src/browser/automations/runtime-service.d.ts +6 -0
- package/dist/src/browser/automations/runtime-service.js +37 -0
- package/dist/src/browser/automations/schema.d.ts +144 -0
- package/dist/src/browser/automations/schema.js +135 -0
- package/dist/src/browser/automations/service.d.ts +146 -0
- package/dist/src/browser/automations/service.js +168 -0
- package/dist/src/browser/automations/types.d.ts +90 -0
- package/dist/src/browser/cache-dir-policy.d.ts +1 -1
- package/dist/src/browser/cache-dir-policy.js +1 -4
- package/dist/src/browser/drivers/browser-driver.d.ts +17 -0
- package/dist/src/browser/drivers/create-driver.d.ts +3 -0
- package/dist/src/browser/drivers/create-driver.js +84 -0
- package/dist/src/browser/drivers/extension-driver.d.ts +20 -0
- package/dist/src/browser/drivers/extension-driver.js +47 -0
- package/dist/src/browser/drivers/playwright-driver.d.ts +38 -0
- package/dist/src/browser/drivers/playwright-driver.js +406 -0
- package/dist/src/browser/index.d.ts +10 -15
- package/dist/src/browser/index.js +10 -15
- package/dist/src/browser/install-lock.d.ts +1 -2
- package/dist/src/browser/install-lock.js +3 -9
- package/dist/src/browser/install-progress.d.ts +1 -1
- package/dist/src/browser/observation/format.d.ts +2 -0
- package/dist/src/browser/observation/format.js +26 -0
- package/dist/src/browser/policy/approval-store.d.ts +17 -0
- package/dist/src/browser/policy/approval-store.js +62 -0
- package/dist/src/browser/policy/browser-policy.d.ts +3 -0
- package/dist/src/browser/policy/browser-policy.js +27 -0
- package/dist/src/browser/providers/browser-ext-install.d.ts +1 -1
- package/dist/src/browser/providers/browser-ext-install.js +4 -6
- package/dist/src/browser/providers/browser-use.js +1 -1
- package/dist/src/browser/providers/browserbase.js +1 -1
- package/dist/src/browser/providers/extension-ws-acquire.d.ts +1 -4
- package/dist/src/browser/providers/extension-ws-acquire.js +1 -13
- package/dist/src/browser/providers/extension.d.ts +3 -22
- package/dist/src/browser/providers/extension.js +7 -15
- package/dist/src/browser/providers/index.d.ts +2 -2
- package/dist/src/browser/providers/index.js +3 -3
- package/dist/src/browser/providers/types.d.ts +0 -94
- package/dist/src/browser/readiness.d.ts +4 -22
- package/dist/src/browser/readiness.js +55 -118
- package/dist/src/browser/runtime/browser-runtime.d.ts +30 -0
- package/dist/src/browser/runtime/browser-runtime.js +362 -0
- package/dist/src/browser/url-policy.d.ts +3 -3
- package/dist/src/browser/url-policy.js +7 -6
- package/dist/src/browser/verification/expectation.d.ts +2 -0
- package/dist/src/browser/verification/expectation.js +17 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +5 -1
- package/dist/src/cli/commands/browser-cli-helpers.d.ts +0 -6
- package/dist/src/cli/commands/browser-cli-helpers.js +11 -144
- package/dist/src/cli/commands/browser.d.ts +0 -5
- package/dist/src/cli/commands/browser.js +11 -152
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/node-version.js +25 -9
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/platform.d.ts +1 -0
- package/dist/src/cli/commands/platform.js +111 -0
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +10 -4
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +131 -84
- package/dist/src/config/schema.js +112 -59
- package/dist/src/connectors/composio-sessions.js +1 -3
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/marketplace.js +4 -0
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/chat-stream/mapper.js +5 -1
- package/dist/src/gateway/chat-stream/protocol.d.ts +5 -1
- package/dist/src/gateway/clarify-runtime.d.ts +7 -5
- package/dist/src/gateway/clarify-runtime.js +8 -11
- package/dist/src/gateway/ephemeral-clarification-waiter.d.ts +17 -0
- package/dist/src/gateway/ephemeral-clarification-waiter.js +46 -0
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +12 -26
- package/dist/src/gateway/hono/lib/config-payload.js +11 -40
- package/dist/src/gateway/hono/routes/agent-stream.js +44 -18
- package/dist/src/gateway/hono/routes/browser-automations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/browser-automations.js +77 -0
- package/dist/src/gateway/hono/routes/browser-install.js +0 -32
- package/dist/src/gateway/hono/routes/browser.d.ts +0 -17
- package/dist/src/gateway/hono/routes/browser.js +46 -568
- package/dist/src/gateway/hono/routes/config-patch/misc.js +8 -1
- package/dist/src/gateway/hono/routes/config.js +0 -11
- package/dist/src/gateway/hono/routes/lazy-bundles.js +5 -5
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +10 -2
- package/dist/src/gateway/hono/routes/side-chats.js +24 -4
- package/dist/src/gateway/security/gateway-scopes.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +25 -36
- package/dist/src/gateway/service/agent-runner.js +103 -32
- package/dist/src/gateway/service/config-coordinator.js +1 -1
- package/dist/src/gateway/service/run-gateway-agent.js +5 -2
- package/dist/src/gateway/service/session-input-coordinator.js +4 -1
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +8 -8
- package/dist/src/gateway/service.js +50 -37
- package/dist/src/gateway/side-chat/manager.d.ts +2 -1
- package/dist/src/gateway/side-chat/manager.js +5 -4
- package/dist/src/gateway/side-chat/run-service.d.ts +5 -1
- package/dist/src/gateway/side-chat/run-service.js +24 -23
- package/dist/src/gateway/side-chat/types.d.ts +3 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/platform/client.d.ts +121 -0
- package/dist/src/platform/client.js +108 -0
- package/dist/src/platform/contracts.d.ts +194 -0
- package/dist/src/platform/contracts.js +150 -0
- package/dist/src/platform/index.d.ts +4 -0
- package/dist/src/platform/index.js +9 -0
- package/dist/src/platform/resolution.d.ts +4 -0
- package/dist/src/platform/resolution.js +16 -0
- package/dist/src/platform/worker.d.ts +6 -0
- package/dist/src/platform/worker.js +75 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/providers/xopc-cloud-config.js +3 -1
- package/dist/src/session/session-context-for-llm.js +41 -1
- package/dist/src/share/hosted-session-share.js +3 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/storage/sqlite/clarification-wait-repository.d.ts +41 -0
- package/dist/src/storage/sqlite/clarification-wait-repository.js +418 -0
- package/dist/src/storage/sqlite/index.d.ts +2 -1
- package/dist/src/storage/sqlite/index.js +2 -1
- package/dist/src/storage/sqlite/migrations/153_browser_control_v2.sql +45 -0
- package/dist/src/storage/sqlite/migrations/154_session_clarification_waits.sql +60 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +16 -20
- package/dist/src/storage/sqlite/session-input-repository.d.ts +11 -6
- package/dist/src/tasks/home-query-service.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/tunnel/env.js +3 -1
- package/dist/src/voice/realtime/agentEngine.js +7 -2
- package/dist/src/voice/realtime/runtime.types.d.ts +5 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +7 -7
- package/skills/creative/hatch-pet/SKILL.md +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-kILWelNb.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BnizTdgs.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CZRKqSqY.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-pN5LbChY.js +0 -8
- package/dist/gateway/static/root/assets/browser-workflow-inputs-BX1-uM9L.js +0 -1
- package/dist/gateway/static/root/assets/browser-workflows-page-C65MI57t.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CJw2e16J.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-CRgjb4Ck.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Dcpdy06y.js +0 -2
- package/dist/gateway/static/root/assets/gateway-config-api-e3BRcgDx.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Cheo0Rkc.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DVrTRqNc.js +0 -1
- package/dist/gateway/static/root/assets/index-B7CX4Qob.css +0 -2
- package/dist/gateway/static/root/assets/index-BHrpyJ4t.js +0 -72
- package/dist/gateway/static/root/assets/markdown-view-CQvzsE24.js +0 -201
- package/dist/gateway/static/root/assets/messages-Cf5hpZE6.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CUd8O4K7.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BLQwd39W.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-NttW338u.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BzH8pjEz.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BxpjSDnL.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BLMaibOb.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BRvvKhoH.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DTOsxQC1.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-BWYanBlQ.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-B_-SNat-.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CNOT2Coo.js +0 -5
- package/dist/src/agent/tools/browser-recipe-tool.d.ts +0 -12
- package/dist/src/agent/tools/browser-recipe-tool.js +0 -113
- package/dist/src/browser/actions/extension-registry-bridge.d.ts +0 -5
- package/dist/src/browser/actions/extension-registry-bridge.js +0 -312
- package/dist/src/browser/actions/registry.d.ts +0 -5
- package/dist/src/browser/actions/registry.js +0 -741
- package/dist/src/browser/actions/types.d.ts +0 -65
- package/dist/src/browser/backend-from-config.d.ts +0 -22
- package/dist/src/browser/backend-from-config.js +0 -99
- package/dist/src/browser/browser-command-timeout.d.ts +0 -2
- package/dist/src/browser/browser-command-timeout.js +0 -11
- package/dist/src/browser/cdp-local-launcher.d.ts +0 -35
- package/dist/src/browser/cdp-local-launcher.js +0 -154
- package/dist/src/browser/cdp-supervisor.d.ts +0 -58
- package/dist/src/browser/cdp-supervisor.js +0 -133
- package/dist/src/browser/humanize.d.ts +0 -80
- package/dist/src/browser/humanize.js +0 -363
- package/dist/src/browser/manager.d.ts +0 -50
- package/dist/src/browser/manager.js +0 -251
- package/dist/src/browser/pipeline/output.d.ts +0 -35
- package/dist/src/browser/pipeline/output.js +0 -74
- package/dist/src/browser/pipeline/runner.d.ts +0 -27
- package/dist/src/browser/pipeline/runner.js +0 -453
- package/dist/src/browser/pipeline/schema.d.ts +0 -42
- package/dist/src/browser/pipeline/schema.js +0 -116
- package/dist/src/browser/pipeline/template.d.ts +0 -30
- package/dist/src/browser/pipeline/template.js +0 -112
- package/dist/src/browser/providers/cloakbrowser.d.ts +0 -83
- package/dist/src/browser/providers/cloakbrowser.js +0 -612
- package/dist/src/browser/recipes/index.js +0 -3
- package/dist/src/browser/recipes/repository.d.ts +0 -13
- package/dist/src/browser/recipes/repository.js +0 -81
- package/dist/src/browser/recipes/runtime-service.d.ts +0 -6
- package/dist/src/browser/recipes/runtime-service.js +0 -30
- package/dist/src/browser/recipes/service.d.ts +0 -36
- package/dist/src/browser/recipes/service.js +0 -186
- package/dist/src/browser/recipes/types.d.ts +0 -36
- package/dist/src/browser/schemas.d.ts +0 -53
- package/dist/src/browser/schemas.js +0 -68
- package/dist/src/browser/session-lifecycle.d.ts +0 -40
- package/dist/src/browser/session-lifecycle.js +0 -136
- package/dist/src/browser/snapshot-helpers.d.ts +0 -24
- package/dist/src/browser/snapshot-helpers.js +0 -70
- package/dist/src/browser/stealth.d.ts +0 -46
- package/dist/src/browser/stealth.js +0 -163
- package/dist/src/gateway/clarify-bridge.d.ts +0 -46
- package/dist/src/gateway/clarify-bridge.js +0 -111
- package/dist/src/gateway/hono/routes/browser-workflows.d.ts +0 -3
- package/dist/src/gateway/hono/routes/browser-workflows.js +0 -78
- /package/dist/src/browser/{actions → automations}/types.js +0 -0
- /package/dist/src/browser/{recipes/types.js → drivers/browser-driver.js} +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const PlatformCapabilitySchema: z.ZodEnum<{
|
|
3
|
+
models: "models";
|
|
4
|
+
connectors: "connectors";
|
|
5
|
+
tunnels: "tunnels";
|
|
6
|
+
shares: "shares";
|
|
7
|
+
managedRuntime: "managedRuntime";
|
|
8
|
+
runtimeFleet: "runtimeFleet";
|
|
9
|
+
traceUpload: "traceUpload";
|
|
10
|
+
a2a: "a2a";
|
|
11
|
+
}>;
|
|
12
|
+
export declare const PlatformDiscoverySchema: z.ZodObject<{
|
|
13
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
14
|
+
platformId: z.ZodString;
|
|
15
|
+
displayName: z.ZodString;
|
|
16
|
+
deploymentMode: z.ZodEnum<{
|
|
17
|
+
development: "development";
|
|
18
|
+
private: "private";
|
|
19
|
+
cloud: "cloud";
|
|
20
|
+
}>;
|
|
21
|
+
region: z.ZodString;
|
|
22
|
+
endpoints: z.ZodObject<{
|
|
23
|
+
authorizationServer: z.ZodString;
|
|
24
|
+
controlApi: z.ZodString;
|
|
25
|
+
modelApi: z.ZodOptional<z.ZodString>;
|
|
26
|
+
storeApi: z.ZodOptional<z.ZodString>;
|
|
27
|
+
tunnelApi: z.ZodOptional<z.ZodString>;
|
|
28
|
+
shareApi: z.ZodOptional<z.ZodString>;
|
|
29
|
+
agentApi: z.ZodOptional<z.ZodString>;
|
|
30
|
+
a2aApi: z.ZodOptional<z.ZodString>;
|
|
31
|
+
realtime: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strict>;
|
|
33
|
+
capabilities: z.ZodRecord<z.ZodEnum<{
|
|
34
|
+
models: "models";
|
|
35
|
+
connectors: "connectors";
|
|
36
|
+
tunnels: "tunnels";
|
|
37
|
+
shares: "shares";
|
|
38
|
+
managedRuntime: "managedRuntime";
|
|
39
|
+
runtimeFleet: "runtimeFleet";
|
|
40
|
+
traceUpload: "traceUpload";
|
|
41
|
+
a2a: "a2a";
|
|
42
|
+
}>, z.ZodBoolean>;
|
|
43
|
+
protocols: z.ZodObject<{
|
|
44
|
+
xopc: z.ZodObject<{
|
|
45
|
+
min: z.ZodString;
|
|
46
|
+
max: z.ZodString;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
mcp: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
49
|
+
a2a: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
}, z.core.$strict>;
|
|
52
|
+
export type PlatformDiscovery = z.infer<typeof PlatformDiscoverySchema>;
|
|
53
|
+
export declare const PlatformConfigSchema: z.ZodDefault<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
54
|
+
mode: z.ZodLiteral<"standalone">;
|
|
55
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
56
|
+
mode: z.ZodLiteral<"connected">;
|
|
57
|
+
url: z.ZodString;
|
|
58
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
59
|
+
discovery: z.ZodObject<{
|
|
60
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
61
|
+
platformId: z.ZodString;
|
|
62
|
+
displayName: z.ZodString;
|
|
63
|
+
deploymentMode: z.ZodEnum<{
|
|
64
|
+
development: "development";
|
|
65
|
+
private: "private";
|
|
66
|
+
cloud: "cloud";
|
|
67
|
+
}>;
|
|
68
|
+
region: z.ZodString;
|
|
69
|
+
endpoints: z.ZodObject<{
|
|
70
|
+
authorizationServer: z.ZodString;
|
|
71
|
+
controlApi: z.ZodString;
|
|
72
|
+
modelApi: z.ZodOptional<z.ZodString>;
|
|
73
|
+
storeApi: z.ZodOptional<z.ZodString>;
|
|
74
|
+
tunnelApi: z.ZodOptional<z.ZodString>;
|
|
75
|
+
shareApi: z.ZodOptional<z.ZodString>;
|
|
76
|
+
agentApi: z.ZodOptional<z.ZodString>;
|
|
77
|
+
a2aApi: z.ZodOptional<z.ZodString>;
|
|
78
|
+
realtime: z.ZodOptional<z.ZodString>;
|
|
79
|
+
}, z.core.$strict>;
|
|
80
|
+
capabilities: z.ZodRecord<z.ZodEnum<{
|
|
81
|
+
models: "models";
|
|
82
|
+
connectors: "connectors";
|
|
83
|
+
tunnels: "tunnels";
|
|
84
|
+
shares: "shares";
|
|
85
|
+
managedRuntime: "managedRuntime";
|
|
86
|
+
runtimeFleet: "runtimeFleet";
|
|
87
|
+
traceUpload: "traceUpload";
|
|
88
|
+
a2a: "a2a";
|
|
89
|
+
}>, z.ZodBoolean>;
|
|
90
|
+
protocols: z.ZodObject<{
|
|
91
|
+
xopc: z.ZodObject<{
|
|
92
|
+
min: z.ZodString;
|
|
93
|
+
max: z.ZodString;
|
|
94
|
+
}, z.core.$strict>;
|
|
95
|
+
mcp: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
96
|
+
a2a: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
97
|
+
}, z.core.$strict>;
|
|
98
|
+
}, z.core.$strict>;
|
|
99
|
+
}, z.core.$strict>], "mode">>;
|
|
100
|
+
export type PlatformConfig = z.infer<typeof PlatformConfigSchema>;
|
|
101
|
+
export declare const AgentManifestSchema: z.ZodObject<{
|
|
102
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
103
|
+
agentId: z.ZodString;
|
|
104
|
+
version: z.ZodString;
|
|
105
|
+
runtime: z.ZodObject<{
|
|
106
|
+
engine: z.ZodLiteral<"xopc">;
|
|
107
|
+
requires: z.ZodString;
|
|
108
|
+
execution: z.ZodArray<z.ZodEnum<{
|
|
109
|
+
local: "local";
|
|
110
|
+
managed: "managed";
|
|
111
|
+
enterprise: "enterprise";
|
|
112
|
+
}>>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
entry: z.ZodObject<{
|
|
115
|
+
instructions: z.ZodString;
|
|
116
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
models: z.ZodObject<{
|
|
119
|
+
intents: z.ZodArray<z.ZodEnum<{
|
|
120
|
+
review: "review";
|
|
121
|
+
coding: "coding";
|
|
122
|
+
understanding: "understanding";
|
|
123
|
+
fast: "fast";
|
|
124
|
+
reasoning: "reasoning";
|
|
125
|
+
vision: "vision";
|
|
126
|
+
}>>;
|
|
127
|
+
allow: z.ZodArray<z.ZodString>;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
dependencies: z.ZodObject<{
|
|
130
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
131
|
+
id: z.ZodString;
|
|
132
|
+
version: z.ZodString;
|
|
133
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
connectors: z.ZodArray<z.ZodObject<{
|
|
136
|
+
id: z.ZodString;
|
|
137
|
+
version: z.ZodString;
|
|
138
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
139
|
+
}, z.core.$strict>>;
|
|
140
|
+
extensions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
version: z.ZodString;
|
|
143
|
+
sha256: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, z.core.$strict>>>;
|
|
145
|
+
}, z.core.$strict>;
|
|
146
|
+
permissions: z.ZodObject<{
|
|
147
|
+
tools: z.ZodArray<z.ZodString>;
|
|
148
|
+
networkDomains: z.ZodArray<z.ZodString>;
|
|
149
|
+
filesystem: z.ZodArray<z.ZodString>;
|
|
150
|
+
effects: z.ZodArray<z.ZodEnum<{
|
|
151
|
+
delete: "delete";
|
|
152
|
+
read: "read";
|
|
153
|
+
write: "write";
|
|
154
|
+
execute: "execute";
|
|
155
|
+
admin: "admin";
|
|
156
|
+
send: "send";
|
|
157
|
+
purchase: "purchase";
|
|
158
|
+
publish: "publish";
|
|
159
|
+
}>>;
|
|
160
|
+
}, z.core.$strict>;
|
|
161
|
+
data: z.ZodObject<{
|
|
162
|
+
classification: z.ZodEnum<{
|
|
163
|
+
public: "public";
|
|
164
|
+
internal: "internal";
|
|
165
|
+
confidential: "confidential";
|
|
166
|
+
restricted: "restricted";
|
|
167
|
+
}>;
|
|
168
|
+
memory: z.ZodEnum<{
|
|
169
|
+
workspace: "workspace";
|
|
170
|
+
none: "none";
|
|
171
|
+
local: "local";
|
|
172
|
+
}>;
|
|
173
|
+
retentionPolicy: z.ZodString;
|
|
174
|
+
}, z.core.$strict>;
|
|
175
|
+
quality: z.ZodObject<{
|
|
176
|
+
evaluationSuite: z.ZodOptional<z.ZodString>;
|
|
177
|
+
releaseGate: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strict>;
|
|
179
|
+
}, z.core.$strict>;
|
|
180
|
+
export type AgentManifest = z.infer<typeof AgentManifestSchema>;
|
|
181
|
+
export declare const PlatformEventSchema: z.ZodObject<{
|
|
182
|
+
schemaVersion: z.ZodLiteral<"1">;
|
|
183
|
+
eventId: z.ZodString;
|
|
184
|
+
type: z.ZodString;
|
|
185
|
+
time: z.ZodString;
|
|
186
|
+
organizationId: z.ZodString;
|
|
187
|
+
workspaceId: z.ZodString;
|
|
188
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
189
|
+
traceId: z.ZodOptional<z.ZodString>;
|
|
190
|
+
sequence: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
producer: z.ZodString;
|
|
192
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
193
|
+
}, z.core.$strict>;
|
|
194
|
+
export type PlatformEvent = z.infer<typeof PlatformEventSchema>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/platform/contracts.ts
|
|
4
|
+
var identifier, sha256, exactVersion, PlatformCapabilitySchema, PlatformDiscoverySchema, PlatformConfigSchema, agentDependency, AgentManifestSchema, PlatformEventSchema;
|
|
5
|
+
var init_contracts = __esmMin((() => {
|
|
6
|
+
identifier = z.string().min(1).max(128).regex(/^[A-Za-z0-9][A-Za-z0-9._:-]*$/);
|
|
7
|
+
sha256 = z.string().regex(/^[a-f0-9]{64}$/);
|
|
8
|
+
exactVersion = z.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/);
|
|
9
|
+
PlatformCapabilitySchema = z.enum([
|
|
10
|
+
"models",
|
|
11
|
+
"connectors",
|
|
12
|
+
"tunnels",
|
|
13
|
+
"shares",
|
|
14
|
+
"managedRuntime",
|
|
15
|
+
"runtimeFleet",
|
|
16
|
+
"traceUpload",
|
|
17
|
+
"a2a"
|
|
18
|
+
]);
|
|
19
|
+
PlatformDiscoverySchema = z.object({
|
|
20
|
+
schemaVersion: z.literal("1"),
|
|
21
|
+
platformId: identifier,
|
|
22
|
+
displayName: z.string().min(1).max(120),
|
|
23
|
+
deploymentMode: z.enum([
|
|
24
|
+
"cloud",
|
|
25
|
+
"private",
|
|
26
|
+
"development"
|
|
27
|
+
]),
|
|
28
|
+
region: identifier,
|
|
29
|
+
endpoints: z.object({
|
|
30
|
+
authorizationServer: z.string().url(),
|
|
31
|
+
controlApi: z.string().url(),
|
|
32
|
+
modelApi: z.string().url().optional(),
|
|
33
|
+
storeApi: z.string().url().optional(),
|
|
34
|
+
tunnelApi: z.string().url().optional(),
|
|
35
|
+
shareApi: z.string().url().optional(),
|
|
36
|
+
agentApi: z.string().url().optional(),
|
|
37
|
+
a2aApi: z.string().url().optional(),
|
|
38
|
+
realtime: z.string().url().optional()
|
|
39
|
+
}).strict(),
|
|
40
|
+
capabilities: z.record(PlatformCapabilitySchema, z.boolean()),
|
|
41
|
+
protocols: z.object({
|
|
42
|
+
xopc: z.object({
|
|
43
|
+
min: z.string().min(1),
|
|
44
|
+
max: z.string().min(1)
|
|
45
|
+
}).strict(),
|
|
46
|
+
mcp: z.array(z.string().min(1)).default([]),
|
|
47
|
+
a2a: z.array(z.string().min(1)).default([])
|
|
48
|
+
}).strict()
|
|
49
|
+
}).strict();
|
|
50
|
+
PlatformConfigSchema = z.discriminatedUnion("mode", [z.object({ mode: z.literal("standalone") }).strict(), z.object({
|
|
51
|
+
mode: z.literal("connected"),
|
|
52
|
+
url: z.string().url(),
|
|
53
|
+
workspaceId: identifier.optional(),
|
|
54
|
+
discovery: PlatformDiscoverySchema
|
|
55
|
+
}).strict()]).default({ mode: "standalone" });
|
|
56
|
+
agentDependency = z.object({
|
|
57
|
+
id: identifier,
|
|
58
|
+
version: exactVersion,
|
|
59
|
+
sha256: sha256.optional()
|
|
60
|
+
}).strict();
|
|
61
|
+
AgentManifestSchema = z.object({
|
|
62
|
+
schemaVersion: z.literal("1"),
|
|
63
|
+
agentId: identifier,
|
|
64
|
+
version: exactVersion,
|
|
65
|
+
runtime: z.object({
|
|
66
|
+
engine: z.literal("xopc"),
|
|
67
|
+
requires: z.string().min(1),
|
|
68
|
+
execution: z.array(z.enum([
|
|
69
|
+
"local",
|
|
70
|
+
"managed",
|
|
71
|
+
"enterprise"
|
|
72
|
+
])).min(1)
|
|
73
|
+
}).strict(),
|
|
74
|
+
entry: z.object({
|
|
75
|
+
instructions: z.string().min(1),
|
|
76
|
+
workflow: z.string().min(1).optional()
|
|
77
|
+
}).strict(),
|
|
78
|
+
models: z.object({
|
|
79
|
+
intents: z.array(z.enum([
|
|
80
|
+
"fast",
|
|
81
|
+
"reasoning",
|
|
82
|
+
"coding",
|
|
83
|
+
"review",
|
|
84
|
+
"vision",
|
|
85
|
+
"understanding"
|
|
86
|
+
])),
|
|
87
|
+
allow: z.array(z.string().min(1))
|
|
88
|
+
}).strict(),
|
|
89
|
+
dependencies: z.object({
|
|
90
|
+
skills: z.array(agentDependency),
|
|
91
|
+
connectors: z.array(agentDependency),
|
|
92
|
+
extensions: z.array(agentDependency).default([])
|
|
93
|
+
}).strict(),
|
|
94
|
+
permissions: z.object({
|
|
95
|
+
tools: z.array(z.string().min(1)),
|
|
96
|
+
networkDomains: z.array(z.string().min(1)),
|
|
97
|
+
filesystem: z.array(z.string().min(1)),
|
|
98
|
+
effects: z.array(z.enum([
|
|
99
|
+
"read",
|
|
100
|
+
"write",
|
|
101
|
+
"send",
|
|
102
|
+
"execute",
|
|
103
|
+
"delete",
|
|
104
|
+
"purchase",
|
|
105
|
+
"publish",
|
|
106
|
+
"admin"
|
|
107
|
+
]))
|
|
108
|
+
}).strict(),
|
|
109
|
+
data: z.object({
|
|
110
|
+
classification: z.enum([
|
|
111
|
+
"public",
|
|
112
|
+
"internal",
|
|
113
|
+
"confidential",
|
|
114
|
+
"restricted"
|
|
115
|
+
]),
|
|
116
|
+
memory: z.enum([
|
|
117
|
+
"none",
|
|
118
|
+
"local",
|
|
119
|
+
"workspace"
|
|
120
|
+
]),
|
|
121
|
+
retentionPolicy: identifier
|
|
122
|
+
}).strict(),
|
|
123
|
+
quality: z.object({
|
|
124
|
+
evaluationSuite: identifier.optional(),
|
|
125
|
+
releaseGate: identifier.optional()
|
|
126
|
+
}).strict()
|
|
127
|
+
}).strict();
|
|
128
|
+
PlatformEventSchema = z.object({
|
|
129
|
+
schemaVersion: z.literal("1"),
|
|
130
|
+
eventId: identifier,
|
|
131
|
+
type: z.string().min(1).max(160).regex(/^xopc\.[a-z0-9_.-]+$/),
|
|
132
|
+
time: z.string().datetime(),
|
|
133
|
+
organizationId: identifier,
|
|
134
|
+
workspaceId: identifier,
|
|
135
|
+
runId: identifier.optional(),
|
|
136
|
+
traceId: identifier.optional(),
|
|
137
|
+
sequence: z.number().int().nonnegative().optional(),
|
|
138
|
+
producer: identifier,
|
|
139
|
+
payload: z.record(z.string(), z.unknown())
|
|
140
|
+
}).strict().superRefine((event, context) => {
|
|
141
|
+
if (event.runId && event.sequence === void 0) context.addIssue({
|
|
142
|
+
code: z.ZodIssueCode.custom,
|
|
143
|
+
message: "Run events require a sequence",
|
|
144
|
+
path: ["sequence"]
|
|
145
|
+
});
|
|
146
|
+
});
|
|
147
|
+
}));
|
|
148
|
+
//#endregion
|
|
149
|
+
init_contracts();
|
|
150
|
+
export { AgentManifestSchema, PlatformCapabilitySchema, PlatformConfigSchema, PlatformDiscoverySchema, PlatformEventSchema, init_contracts };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AgentManifestSchema, PlatformCapabilitySchema, PlatformConfigSchema, PlatformDiscoverySchema, PlatformEventSchema, init_contracts } from "./contracts.js";
|
|
2
|
+
import { init_resolution, resolveConnectedPlatformDiscovery, resolveConnectedPlatformEndpoint, setActivePlatformDiscovery } from "./resolution.js";
|
|
3
|
+
import { PLATFORM_RUNTIME_PROFILE, PLATFORM_RUNTIME_PROVIDER, PlatformRuntimeClient, RuntimeCommandSchema, discoverPlatform } from "./client.js";
|
|
4
|
+
import { processRuntimeCommand } from "./worker.js";
|
|
5
|
+
//#region src/platform/index.ts
|
|
6
|
+
init_contracts();
|
|
7
|
+
init_resolution();
|
|
8
|
+
//#endregion
|
|
9
|
+
export { AgentManifestSchema, PLATFORM_RUNTIME_PROFILE, PLATFORM_RUNTIME_PROVIDER, PlatformCapabilitySchema, PlatformConfigSchema, PlatformDiscoverySchema, PlatformEventSchema, PlatformRuntimeClient, RuntimeCommandSchema, discoverPlatform, processRuntimeCommand, resolveConnectedPlatformDiscovery, resolveConnectedPlatformEndpoint, setActivePlatformDiscovery };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PlatformDiscovery } from './contracts.js';
|
|
2
|
+
export declare function setActivePlatformDiscovery(discovery: PlatformDiscovery | undefined): void;
|
|
3
|
+
export declare function resolveConnectedPlatformDiscovery(): PlatformDiscovery | undefined;
|
|
4
|
+
export declare function resolveConnectedPlatformEndpoint(endpoint: keyof PlatformDiscovery['endpoints']): string | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
//#region src/platform/resolution.ts
|
|
3
|
+
function setActivePlatformDiscovery(discovery) {
|
|
4
|
+
activeDiscovery = discovery;
|
|
5
|
+
}
|
|
6
|
+
function resolveConnectedPlatformDiscovery() {
|
|
7
|
+
return activeDiscovery;
|
|
8
|
+
}
|
|
9
|
+
function resolveConnectedPlatformEndpoint(endpoint) {
|
|
10
|
+
return resolveConnectedPlatformDiscovery()?.endpoints[endpoint];
|
|
11
|
+
}
|
|
12
|
+
var activeDiscovery;
|
|
13
|
+
var init_resolution = __esmMin((() => {}));
|
|
14
|
+
//#endregion
|
|
15
|
+
init_resolution();
|
|
16
|
+
export { init_resolution, resolveConnectedPlatformDiscovery, resolveConnectedPlatformEndpoint, setActivePlatformDiscovery };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PlatformRuntimeClient, type RuntimeCommand } from './client.js';
|
|
2
|
+
export interface RuntimeExecutionResult {
|
|
3
|
+
output?: unknown;
|
|
4
|
+
}
|
|
5
|
+
export type RuntimeCommandHandler = (command: RuntimeCommand, signal: AbortSignal) => Promise<RuntimeExecutionResult>;
|
|
6
|
+
export declare function processRuntimeCommand(client: PlatformRuntimeClient, handler: RuntimeCommandHandler): Promise<'idle' | 'completed' | 'failed' | 'cancelled'>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
//#region src/platform/worker.ts
|
|
3
|
+
var RuntimeCancellation = class extends Error {
|
|
4
|
+
constructor() {
|
|
5
|
+
super("Run cancellation requested by platform");
|
|
6
|
+
this.name = "RuntimeCancellation";
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
function commandIdentity(command) {
|
|
10
|
+
const { organizationId, workspaceId, traceId, runtimeId } = command.payload;
|
|
11
|
+
if ([
|
|
12
|
+
organizationId,
|
|
13
|
+
workspaceId,
|
|
14
|
+
traceId,
|
|
15
|
+
runtimeId
|
|
16
|
+
].some((value) => typeof value !== "string" || value.length === 0)) throw new Error("Runtime command is missing tenant or trace identity");
|
|
17
|
+
return {
|
|
18
|
+
organizationId,
|
|
19
|
+
workspaceId,
|
|
20
|
+
traceId,
|
|
21
|
+
runtimeId
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function event(command, type, sequence, payload) {
|
|
25
|
+
const identity = commandIdentity(command);
|
|
26
|
+
return {
|
|
27
|
+
schemaVersion: "1",
|
|
28
|
+
eventId: `event_${randomUUID()}`,
|
|
29
|
+
type,
|
|
30
|
+
time: (/* @__PURE__ */ new Date()).toISOString(),
|
|
31
|
+
organizationId: identity.organizationId,
|
|
32
|
+
workspaceId: identity.workspaceId,
|
|
33
|
+
runId: command.runId,
|
|
34
|
+
traceId: identity.traceId,
|
|
35
|
+
sequence,
|
|
36
|
+
producer: identity.runtimeId,
|
|
37
|
+
payload
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async function processRuntimeCommand(client, handler) {
|
|
41
|
+
const command = await client.lease();
|
|
42
|
+
if (!command) return "idle";
|
|
43
|
+
await client.report(event(command, "xopc.run.started", 1, {}), command.leaseToken);
|
|
44
|
+
const controller = new AbortController();
|
|
45
|
+
let renewing = false;
|
|
46
|
+
let renewalInFlight = Promise.resolve();
|
|
47
|
+
const renewalIntervalMs = Math.max(1e3, Math.min(3e4, Math.floor((command.leaseExpiresAt - Date.now()) / 3)));
|
|
48
|
+
const renewal = setInterval(() => {
|
|
49
|
+
if (renewing || controller.signal.aborted) return;
|
|
50
|
+
renewing = true;
|
|
51
|
+
renewalInFlight = client.renew(command.id, command.leaseToken).then((result) => {
|
|
52
|
+
if (result.cancelRequested) controller.abort(new RuntimeCancellation());
|
|
53
|
+
}).catch((error) => controller.abort(error)).finally(() => {
|
|
54
|
+
renewing = false;
|
|
55
|
+
});
|
|
56
|
+
}, renewalIntervalMs);
|
|
57
|
+
renewal.unref?.();
|
|
58
|
+
try {
|
|
59
|
+
const result = await handler(command, controller.signal);
|
|
60
|
+
await renewalInFlight;
|
|
61
|
+
if (controller.signal.aborted) throw controller.signal.reason;
|
|
62
|
+
await client.report(event(command, "xopc.run.succeeded", 2, { output: result.output }), command.leaseToken);
|
|
63
|
+
return "completed";
|
|
64
|
+
} catch (error) {
|
|
65
|
+
const effectiveError = controller.signal.aborted ? controller.signal.reason : error;
|
|
66
|
+
const cancelled = effectiveError instanceof RuntimeCancellation;
|
|
67
|
+
await client.report(event(command, cancelled ? "xopc.run.cancelled" : "xopc.run.failed", 2, cancelled ? {} : { error: effectiveError instanceof Error ? effectiveError.message : "Runtime command failed" }), command.leaseToken);
|
|
68
|
+
return cancelled ? "cancelled" : "failed";
|
|
69
|
+
} finally {
|
|
70
|
+
clearInterval(renewal);
|
|
71
|
+
await renewalInFlight;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { processRuntimeCommand };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
1
|
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
|
+
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
5
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
4
6
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
5
7
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
7
8
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
4
|
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
|
+
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
2
|
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
|
+
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { init_resolution, resolveConnectedPlatformEndpoint } from "../platform/resolution.js";
|
|
2
3
|
//#region src/providers/xopc-cloud-config.ts
|
|
3
4
|
function resolveXopcModelRouterUrl(override) {
|
|
4
|
-
return (override ?? process.env.XOPC_MODEL_ROUTER_URL ?? "https://router.xopc.ai/v1").replace(/\/+$/, "");
|
|
5
|
+
return (override ?? process.env.XOPC_MODEL_ROUTER_URL ?? resolveConnectedPlatformEndpoint("modelApi") ?? "https://router.xopc.ai/v1").replace(/\/+$/, "");
|
|
5
6
|
}
|
|
6
7
|
var XOPC_CLOUD_PROVIDER_ID, DEFAULT_XOPC_MODEL_ROUTER_URL;
|
|
7
8
|
var init_xopc_cloud_config = __esmMin((() => {
|
|
9
|
+
init_resolution();
|
|
8
10
|
XOPC_CLOUD_PROVIDER_ID = "xopc-cloud";
|
|
9
11
|
DEFAULT_XOPC_MODEL_ROUTER_URL = "https://router.xopc.ai/v1";
|
|
10
12
|
}));
|
|
@@ -127,6 +127,46 @@ function toolCallIds(message) {
|
|
|
127
127
|
}
|
|
128
128
|
return ids;
|
|
129
129
|
}
|
|
130
|
+
function browserToolCallIds(messages) {
|
|
131
|
+
const ids = /* @__PURE__ */ new Set();
|
|
132
|
+
for (const message of messages) {
|
|
133
|
+
if (message.role !== "assistant") continue;
|
|
134
|
+
const content = message.content;
|
|
135
|
+
if (!Array.isArray(content)) continue;
|
|
136
|
+
for (const block of content) {
|
|
137
|
+
const record = asRecord(block);
|
|
138
|
+
if (!record || stringValue(record.name) !== "browser_use") continue;
|
|
139
|
+
const id = toolCallIdFromBlock(record);
|
|
140
|
+
if (id) ids.add(id);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return ids;
|
|
144
|
+
}
|
|
145
|
+
/** Keep semantic browser text throughout history, but only the newest browser screenshot. */
|
|
146
|
+
function projectBrowserVisualContext(messages) {
|
|
147
|
+
const browserIds = browserToolCallIds(messages);
|
|
148
|
+
let latestVisualIndex = -1;
|
|
149
|
+
for (let index = 0; index < messages.length; index += 1) {
|
|
150
|
+
const message = messages[index];
|
|
151
|
+
if (!browserIds.has(toolResultId(message) ?? "")) continue;
|
|
152
|
+
const content = message.content;
|
|
153
|
+
if (Array.isArray(content) && content.some((block) => asRecord(block)?.type === "image")) latestVisualIndex = index;
|
|
154
|
+
}
|
|
155
|
+
if (latestVisualIndex < 0) return messages;
|
|
156
|
+
return messages.map((message, index) => {
|
|
157
|
+
if (index === latestVisualIndex || !browserIds.has(toolResultId(message) ?? "")) return message;
|
|
158
|
+
const record = message;
|
|
159
|
+
if (!Array.isArray(record.content)) return message;
|
|
160
|
+
const content = record.content.map((block) => asRecord(block)?.type === "image" ? {
|
|
161
|
+
type: "text",
|
|
162
|
+
text: "[Earlier browser screenshot omitted; semantic observation retained.]"
|
|
163
|
+
} : block);
|
|
164
|
+
return {
|
|
165
|
+
...record,
|
|
166
|
+
content
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
}
|
|
130
170
|
function filterAssistantToolCalls(message, pairedIds) {
|
|
131
171
|
const record = message;
|
|
132
172
|
const content = record.content;
|
|
@@ -257,7 +297,7 @@ function buildSessionContextForLlm(rows) {
|
|
|
257
297
|
}
|
|
258
298
|
if (isLikelyAgentMessage(r)) out.push(r);
|
|
259
299
|
}
|
|
260
|
-
return sanitizeToolPairs(out);
|
|
300
|
+
return projectBrowserVisualContext(sanitizeToolPairs(out));
|
|
261
301
|
}
|
|
262
302
|
/** Visible chat messages only - no LLM-only audit/context expansion. */
|
|
263
303
|
function buildSessionDisplayMessages(rows) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
2
2
|
import { runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
3
|
+
import { init_resolution, resolveConnectedPlatformEndpoint } from "../platform/resolution.js";
|
|
3
4
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
4
5
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
5
6
|
import { resolveMediaReference } from "../media/media-reference.js";
|
|
@@ -11,6 +12,7 @@ import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
|
11
12
|
import { readFile, stat } from "node:fs/promises";
|
|
12
13
|
//#region src/share/hosted-session-share.ts
|
|
13
14
|
init_credentials();
|
|
15
|
+
init_resolution();
|
|
14
16
|
const DEFAULT_SHARE_URL = "https://share.xopc.ai";
|
|
15
17
|
const MAX_MESSAGES = 1e4;
|
|
16
18
|
const MAX_ATTACHMENTS = 20;
|
|
@@ -105,7 +107,7 @@ var HostedSessionShareBuilder = class {
|
|
|
105
107
|
};
|
|
106
108
|
var HostedSessionSharePublisher = class {
|
|
107
109
|
baseUrl;
|
|
108
|
-
constructor(baseUrl = process.env.XOPC_SHARE_URL ?? DEFAULT_SHARE_URL, credentials = new CredentialResolver(), fetchImpl = fetch) {
|
|
110
|
+
constructor(baseUrl = process.env.XOPC_SHARE_URL ?? resolveConnectedPlatformEndpoint("shareApi") ?? DEFAULT_SHARE_URL, credentials = new CredentialResolver(), fetchImpl = fetch) {
|
|
109
111
|
this.credentials = credentials;
|
|
110
112
|
this.fetchImpl = fetchImpl;
|
|
111
113
|
this.baseUrl = baseUrl.replace(/\/+$/, "");
|
|
@@ -14,7 +14,7 @@ import { mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
|
14
14
|
* Responsibilities:
|
|
15
15
|
* - Render a 1200x630 jpeg preview for shareable artefacts.
|
|
16
16
|
* - HTML / sites: launch its own Playwright browser (does NOT share the user
|
|
17
|
-
*
|
|
17
|
+
* Browser Control runtime — the user-facing browser is for the agent and we mustn't
|
|
18
18
|
* pollute its context).
|
|
19
19
|
* - Images: pass through with size cap; downscale only if oversized.
|
|
20
20
|
* - Anything else: emit an SVG placeholder card with the file name + icon.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ClarificationKind, ClarificationResponseAction, ClarificationWait, ClarificationWaitSnapshot } from '@xopcai/gateway-contract';
|
|
2
|
+
import { type SessionInput } from './session-input-repository.js';
|
|
3
|
+
export type CreateClarificationInput = {
|
|
4
|
+
sessionKey: string;
|
|
5
|
+
runId: string;
|
|
6
|
+
toolCallId: string;
|
|
7
|
+
kind: ClarificationKind;
|
|
8
|
+
question: string;
|
|
9
|
+
choices?: string[];
|
|
10
|
+
suggestedAnswer?: string;
|
|
11
|
+
approvalKey?: string;
|
|
12
|
+
now?: number;
|
|
13
|
+
};
|
|
14
|
+
export type ResolveClarificationInput = {
|
|
15
|
+
id: string;
|
|
16
|
+
expectedVersion: number;
|
|
17
|
+
idempotencyKey: string;
|
|
18
|
+
action: ClarificationResponseAction;
|
|
19
|
+
answer?: string;
|
|
20
|
+
now?: number;
|
|
21
|
+
};
|
|
22
|
+
export type ResolveClarificationResult = {
|
|
23
|
+
ok: true;
|
|
24
|
+
clarification: ClarificationWait;
|
|
25
|
+
idempotent: boolean;
|
|
26
|
+
queued: boolean;
|
|
27
|
+
} | {
|
|
28
|
+
ok: false;
|
|
29
|
+
code: 'NOT_FOUND' | 'CONFLICT' | 'EXPIRED' | 'INVALID';
|
|
30
|
+
clarification?: ClarificationWait;
|
|
31
|
+
};
|
|
32
|
+
export declare function getClarification(id: string): ClarificationWait | undefined;
|
|
33
|
+
export declare function getActiveClarification(sessionKey: string): ClarificationWait | undefined;
|
|
34
|
+
export declare function getClarificationSnapshot(sessionKey: string): ClarificationWaitSnapshot | undefined;
|
|
35
|
+
export declare function createClarificationWait(input: CreateClarificationInput): ClarificationWait;
|
|
36
|
+
export declare function isClarificationSuspended(sessionKey: string, runId: string): boolean;
|
|
37
|
+
export declare function resolveClarification(input: ResolveClarificationInput): ResolveClarificationResult;
|
|
38
|
+
export declare function getClarificationResumeInput(sessionKey: string, runId: string): SessionInput | undefined;
|
|
39
|
+
export declare function consumeClarificationResume(input: SessionInput): boolean;
|
|
40
|
+
export declare function consumeClarificationApproval(sessionKey: string, approvalKey: string): 'approved' | 'denied' | undefined;
|
|
41
|
+
export declare function supersedeActiveClarification(sessionKey: string, now?: number): ClarificationWait | undefined;
|