@xopcai/xopc 0.0.325 → 0.0.330
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 +4 -3
- package/README.zh-CN.md +4 -3
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CxfXpPWs.js → agent-avatar-dicebear-BDG0hI-J.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-ArM6Sm9S.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BX_Bhre1.js +1 -0
- package/dist/gateway/static/root/assets/agents-BiQqpMw0.js +70 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-p7fZB4dT.js → app-management-settings-panel-DgttzUCG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-C-clVcfp.js → appearance-settings-CHpyWV8Z.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-BhfYQcm8.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-Xm6xChUX.js → archive-plugin-B7Q7Oeo7.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-Di8kuG4L.js → attachment-load-BYwqQ8qN.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-GUZgDhKj.js → automations-page-CsvAtTNd.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DMH_1Ped.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-OCrDjC9O.js → binary-plugins-DdgWCI-M.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-m9tqvu7x.js → block-editor-DyOagNnn.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DSWXq9lI.js → browser-automation-inputs-CwF8OQFN.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DuOaridE.js → browser-automations-page-D_EQjiiu.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-BE6691Jz.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-page-MweWNrC1.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CdSWkh89.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-C5F2GNE9.js +1 -0
- package/dist/gateway/static/root/assets/capability-icon-BYm2-nS-.js +1 -0
- package/dist/gateway/static/root/assets/channels-NGfwR3He.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BfnVh8oo.js → chat-terminal-dock-C6tl9Rfw.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-C0MsVw4l.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-DsF60pPs.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BE8NdQcR.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-CtDyij_x.js → date-picker-CELKKqYN.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-BcEwCnI5.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-BsIYCAkG.js → desktop-pet-Ww7Gm8-x.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-D-dbAxGu.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-DsYY6szg.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-CVmuCRyO.js +1 -0
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-Ct9pABNW.js → extension-debug-page-UUHNJj-d.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BktsR4hj.js → extension-page-BvL452mX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BQJc-vXH.js → extension-settings-page-CrNnUSOs.js} +1 -1
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +1 -0
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +1 -0
- package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-CoQVulMd.js → gateway-config-swr-DMm1vU51.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-DrHhtZqv.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B5GJ-CQV.js → gateway-startup-retry-Ck6tj6yE.js} +1 -1
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +1 -0
- package/dist/gateway/static/root/assets/home-page-YgI6jfGA.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DvWDkbk1.js → image-generation-api-BOh6j0BF.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-BuqdzA7h.js +1 -0
- package/dist/gateway/static/root/assets/index-DJmO2VAY.css +1 -0
- package/dist/gateway/static/root/assets/index-vCIBfJp7.js +121 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ctJLm8TP.js → keyboard-shortcuts-settings-D9L7IdUg.js} +1 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +1 -0
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-DO8uUtos.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BxC_LTqq.js → local-apps-page-BEvyufm7.js} +1 -1
- package/dist/gateway/static/root/assets/locale-store-DAOwT3Zp.js +1 -0
- package/dist/gateway/static/root/assets/logs-page-Jev1m9sS.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-41i7B1RO.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-Dft8ASFD.js → markdown-view-nL4xzvI8.js} +2 -2
- package/dist/gateway/static/root/assets/{media-plugins-ni5zJ4Ok.js → media-plugins-dHbcqMan.js} +1 -1
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +1 -0
- package/dist/gateway/static/root/assets/messages-BZbt9x1y.js +3 -0
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-DonP0E6Q.js +5 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-1qg2v-9j.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-CYHMeVKo.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-BKsMcPOy.js +1 -0
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-Du18QgWc.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DQctU8z3.js → product-open-page-IY1QL6s0.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-Bpw9mxfV.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BdYbDNUn.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-DWWO6ajd.js → registry-api-DCFXWBOt.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CLhbz3TF.js +1 -0
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-xhOSYfiX.js → runtime-tools-settings-panel-CuTFmXyj.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-XwK2IEmr.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-z8IeSdBp.js → schema-form-qWQii8IU.js} +1 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-4-QoiDES.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BggQVM1y.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-B0ZBr0L9.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-Br9no5e4.js → settings-page-DpII4NO3.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-layout-X1x-2Cp9.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-HPpC7EE0.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CE0SER59.js → share-preview-page-B2CGYZHc.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-DhVCRYGP.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-_ddww47C.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-XPZkWJJe.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-uF7DkJMC.js +2 -0
- package/dist/gateway/static/root/assets/system-settings-panel-25ABVt7H.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-gepxhO4j.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-CwQGBI_4.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-CL3wytbs.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-DldQW9Wh.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-By6Lgbse.js → voice-api-key-field-zjAzQrx4.js} +1 -1
- package/dist/gateway/static/root/assets/voice-config-api-DvzQ-128.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DdhgIlyf.js → work-discovery-overlay-MaPPjWwl.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BOJYQaxX.js → workflow-run-setup-panel-C3dQN1fE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-B9lnTU3U.js +6 -0
- package/dist/gateway/static/root/connector-icons/SOURCES.md +1 -0
- package/dist/gateway/static/root/connector-icons/wecom.svg +9 -0
- package/dist/gateway/static/root/index.html +20 -8
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -2
- package/dist/src/agent/agent-manager.d.ts +5 -2
- package/dist/src/agent/agent-manager.js +77 -23
- package/dist/src/agent/background-review/coordinator.d.ts +2 -7
- package/dist/src/agent/background-review/coordinator.js +17 -34
- package/dist/src/agent/background-review/prompts.d.ts +13 -5
- package/dist/src/agent/background-review/prompts.js +17 -12
- package/dist/src/agent/background-review/run-background-review.d.ts +3 -3
- package/dist/src/agent/background-review/run-background-review.js +59 -44
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/capabilities/definitions.d.ts +3 -2
- package/dist/src/agent/capabilities/definitions.js +3 -2
- package/dist/src/agent/context/execution-context.js +5 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/mcp/index.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +2 -2
- package/dist/src/agent/mcp/oauth/index.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +2 -2
- package/dist/src/agent/mcp/oauth/mcp-oauth-provider.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.js +2 -15
- package/dist/src/agent/prompt/sections/tooling.js +3 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -2
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.d.ts +12 -0
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/factory.js +3 -2
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/user-context-tool.js +29 -4
- package/dist/src/agent/tools/workflow-manage-tool.d.ts +2 -0
- package/dist/src/agent/tools/workflow-manage-tool.js +225 -0
- package/dist/src/agent/tools/xopc-use-tool.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/domain/types.d.ts +7 -1
- package/dist/src/automations/draft/automation-draft-service.js +13 -4
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +36 -13
- package/dist/src/automations/service/automation-service.js +2 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/automations/index.js +2 -2
- package/dist/src/browser/automations/service.d.ts +11 -2
- package/dist/src/browser/automations/service.js +19 -5
- package/dist/src/capabilities/readiness/from-config.d.ts +0 -1
- package/dist/src/capabilities/readiness/from-config.js +2 -4
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/chat-previews/service.js +1 -2
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +3 -3
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.js +5 -5
- package/dist/src/connectors/china-catalog.js +5 -1
- package/dist/src/connectors/connected-source-ingestion.js +6 -1
- package/dist/src/connectors/connected-source-observations.d.ts +10 -0
- package/dist/src/connectors/connected-source-observations.js +80 -0
- package/dist/src/connectors/connected-source-understanding.js +198 -8
- package/dist/src/connectors/learning-coordinator.js +63 -26
- package/dist/src/connectors/learning-recipes.js +19 -2
- package/dist/src/discussions/audio-repair.d.ts +1 -1
- package/dist/src/discussions/live-worker.js +1 -3
- package/dist/src/discussions/recording.js +2 -2
- package/dist/src/discussions/sealer.js +2 -2
- package/dist/src/extensions/agent-plugins/auth.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/auth.js +6 -35
- package/dist/src/extensions/agent-plugins/credentials.d.ts +2 -0
- package/dist/src/extensions/agent-plugins/credentials.js +37 -0
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.d.ts +1 -0
- package/dist/src/extensions/agent-plugins/plugin-oauth-scope.js +8 -0
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/bundled-extension-activation.d.ts +3 -1
- package/dist/src/extensions/bundled-extension-activation.js +5 -8
- package/dist/src/extensions/marketplace.d.ts +4 -0
- package/dist/src/extensions/marketplace.js +4 -0
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/file-space-service.d.ts +9 -2
- package/dist/src/gateway/gateway-workflow-host.types.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-plugins.js +2 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +27 -5
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/config.js +0 -3
- package/dist/src/gateway/hono/routes/connectors.js +3 -10
- package/dist/src/gateway/hono/routes/context-sources.d.ts +0 -1
- package/dist/src/gateway/hono/routes/context-sources.js +12 -15
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +0 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +21 -3
- package/dist/src/gateway/hono/routes/voice.js +0 -67
- package/dist/src/gateway/hono/routes/workflows.js +1 -23
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +4 -4
- package/dist/src/gateway/service/config-coordinator.js +6 -6
- package/dist/src/gateway/service/marketplace-service.js +8 -6
- package/dist/src/gateway/service.d.ts +1 -1
- package/dist/src/gateway/service.js +20 -18
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +7 -6
- package/dist/src/home-intelligence/host.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media-understanding/types.d.ts +1 -1
- package/dist/src/memory-maintenance/service.d.ts +1 -0
- package/dist/src/memory-maintenance/service.js +13 -0
- package/dist/src/migrations/retired-local-stt.d.ts +2 -0
- package/dist/src/migrations/retired-local-stt.js +52 -0
- package/dist/src/migrations/runner.js +2 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-response.d.ts +2 -0
- package/dist/src/providers/model-response.js +24 -1
- package/dist/src/session/turn-outcome-projector.js +1 -1
- package/dist/src/storage/sqlite/connection.js +1 -0
- package/dist/src/storage/sqlite/migrations/207_user_model_policy_contract.sql +121 -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/schema.js +1 -1
- package/dist/src/storage/sqlite/sql-assets.d.ts +1 -0
- package/dist/src/storage/sqlite/sql-assets.js +7 -4
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +4 -2
- package/dist/src/tasks/task-context-assembler.js +10 -1
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +15 -2
- package/dist/src/tui/backends/embedded-backend.js +6 -3
- package/dist/src/tui/tui-commands.js +2 -2
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/user-context/sources/consent-repository.d.ts +7 -0
- package/dist/src/user-context/sources/consent-repository.js +81 -0
- package/dist/src/user-context/sources/index.d.ts +1 -0
- package/dist/src/user-context/sources/index.js +2 -1
- package/dist/src/user-context/sources/repository.js +73 -1
- package/dist/src/user-context/sources/types.d.ts +16 -0
- package/dist/src/user-model/action-rule-suggestions.d.ts +11 -0
- package/dist/src/user-model/action-rule-suggestions.js +29 -0
- package/dist/src/user-model/bootstrap.js +1 -1
- package/dist/src/user-model/capture/executor.js +83 -7
- package/dist/src/user-model/capture/semantic.d.ts +5 -2
- package/dist/src/user-model/capture/semantic.js +27 -11
- package/dist/src/user-model/domain.d.ts +26 -0
- package/dist/src/user-model/domain.js +40 -2
- package/dist/src/user-model/index.d.ts +2 -0
- package/dist/src/user-model/index.js +6 -4
- package/dist/src/user-model/maintenance-policy.d.ts +1 -0
- package/dist/src/user-model/maintenance-policy.js +13 -0
- package/dist/src/user-model/observation-repository.d.ts +48 -0
- package/dist/src/user-model/observation-repository.js +100 -0
- package/dist/src/user-model/repository.d.ts +5 -0
- package/dist/src/user-model/repository.js +121 -10
- package/dist/src/user-model/usage-policy.d.ts +5 -2
- package/dist/src/user-model/usage-policy.js +2 -2
- package/dist/src/voice/audio/normalize.d.ts +1 -1
- package/dist/src/voice/audio/normalize.js +1 -1
- package/dist/src/voice/{local → audio}/wav.js +1 -1
- package/dist/src/voice/language-profile.js +10 -16
- package/dist/src/voice/metadata/builtin.js +0 -46
- package/dist/src/voice/platform-streams.js +15 -7
- package/dist/src/voice/realtime/agentEngine.js +19 -3
- package/dist/src/voice/realtime/pcmFrameBuffer.js +2 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/playback-echo.js +16 -1
- package/dist/src/voice/stt/providers/index.d.ts +0 -1
- package/dist/src/voice/stt/providers/index.js +1 -2
- package/dist/src/voice/stt/types.js +3 -4
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/speech-registry.d.ts +1 -1
- package/dist/src/voice/tts/types.d.ts +1 -1
- package/dist/src/work-discovery/analyzer.js +6 -5
- package/dist/src/work-discovery/service.js +2 -2
- package/dist/src/work-discovery/types.d.ts +1 -1
- package/dist/src/workflows/authoring/index.d.ts +1 -0
- package/dist/src/workflows/authoring/index.js +2 -1
- package/dist/src/workflows/authoring/workflow-draft-defaults.d.ts +3 -0
- package/dist/src/workflows/authoring/workflow-draft-defaults.js +63 -0
- package/dist/src/workflows/context/workflow-context.js +5 -1
- package/dist/src/workflows/domain/index.js +1 -1
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/index.js +4 -4
- package/dist/src/workflows/service/workflow-run-service.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +39 -7
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
- package/package.json +12 -16
- package/skills/engineering/workflow-authoring/SKILL.md +32 -0
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CDHe8gJf.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DMv-udoZ.js +0 -1
- package/dist/gateway/static/root/assets/agents-D_xOAXgj.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Dz2g7eAN.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BUZhG9aJ.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-D2_PgHep.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-7Y_pJqyt.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-B-Igy1ro.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-aRG2lU4w.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-B5EhnfJH.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-7HfRt1LW.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-z6ouWxmz.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-z-0aQ5ct.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DlmhQvY5.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BfDVlvy6.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CI_eQTPL.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DFpQfHVU.js +0 -1
- package/dist/gateway/static/root/assets/index-19rMUT3d.js +0 -121
- package/dist/gateway/static/root/assets/index-BKL5tg2f.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-C9kaP3Dy.js +0 -1
- package/dist/gateway/static/root/assets/locale-store-BPZR8x9b.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-Ok5SpG-G.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-aOzRaQHM.js +0 -1
- package/dist/gateway/static/root/assets/messages-kFWhF6_t.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-C9OEltN9.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-Dj9rMgdi.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-BJA3d8vU.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-Dyc3wKkl.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-tIOIQbNX.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-Dy-EwZcc.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-JaGKa6rM.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Cb8-nd60.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-ClBkFdRY.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-BYW5l_nY.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDNwmXuH.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-BXTJAser.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-D6745w0p.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-D2N9764S.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Dk3_QOKQ.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CPt61fEv.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-Db6PB2C6.js +0 -2
- package/dist/gateway/static/root/assets/skills-page.utils-DrtW5FBy.js +0 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CuY1Zh5s.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-o7RiDUMi.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-PGHDgvWb.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-B55oBQUt.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DspelwAa.js +0 -2
- package/dist/gateway/static/root/assets/voice-config-api-BaxITrwZ.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-6ObD0IQZ.js +0 -6
- package/dist/src/voice/local/model-files.d.ts +0 -14
- package/dist/src/voice/local/model-files.js +0 -92
- package/dist/src/voice/local/model-manager.d.ts +0 -18
- package/dist/src/voice/local/model-manager.js +0 -133
- package/dist/src/voice/local/models.d.ts +0 -28
- package/dist/src/voice/local/models.js +0 -99
- package/dist/src/voice/local/provider-switch.d.ts +0 -4
- package/dist/src/voice/local/provider-switch.js +0 -36
- package/dist/src/voice/local/runtime-client.d.ts +0 -28
- package/dist/src/voice/local/runtime-client.js +0 -183
- package/dist/src/voice/local/runtime-worker.d.ts +0 -1
- package/dist/src/voice/local/runtime-worker.js +0 -271
- package/dist/src/voice/stt/providers/local-transcription.d.ts +0 -2
- package/dist/src/voice/stt/providers/local-transcription.js +0 -53
- package/dist/src/workflows/draft/index.d.ts +0 -3
- package/dist/src/workflows/draft/index.js +0 -3
- package/dist/src/workflows/draft/workflow-draft-prompt.d.ts +0 -22
- package/dist/src/workflows/draft/workflow-draft-prompt.js +0 -54
- package/dist/src/workflows/draft/workflow-draft-service.d.ts +0 -12
- package/dist/src/workflows/draft/workflow-draft-service.js +0 -125
- package/dist/src/workflows/draft/workflow-draft-validator.d.ts +0 -4
- package/dist/src/workflows/draft/workflow-draft-validator.js +0 -123
- package/dist/src/workflows/draft/workflow-draft.types.d.ts +0 -44
- package/dist/src/workflows/draft/workflow-draft.types.js +0 -1
- /package/dist/src/voice/{local → audio}/wav.d.ts +0 -0
|
@@ -2,13 +2,13 @@ import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../../utils/logger.js";
|
|
4
4
|
import { init_string_coerce, normalizeOptionalString } from "../../utils/string-coerce.js";
|
|
5
|
-
import { McpOAuthStore } from "./oauth/mcp-oauth-store.js";
|
|
6
|
-
import { pluginOAuthScope } from "../../extensions/agent-plugins/auth.js";
|
|
7
5
|
import { buildRuntimeEnvironment, resolveRuntimeCommand } from "../../runtime-tools/environment.js";
|
|
8
6
|
import { XopcStdioClientTransport } from "./mcp-stdio-transport.js";
|
|
9
7
|
import { resolveMcpTransportConfig } from "./mcp-transport-config.js";
|
|
8
|
+
import { McpOAuthStore } from "./oauth/mcp-oauth-store.js";
|
|
10
9
|
import { XopcMcpOAuthClientProvider } from "./oauth/mcp-oauth-provider.js";
|
|
11
10
|
import { createPluginHttpFetch } from "./plugin-http-fetch.js";
|
|
11
|
+
import { pluginOAuthScope } from "../../extensions/agent-plugins/plugin-oauth-scope.js";
|
|
12
12
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
13
13
|
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
14
14
|
import { getDefaultEnvironment } from "@modelcontextprotocol/sdk/client/stdio.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpOAuthStore, canonicalMcpServerUrl, mcpOAuthServerKey } from "./mcp-oauth-store.js";
|
|
2
1
|
import { McpAuthorizationRequiredError, isMcpAuthorizationError } from "./mcp-oauth-errors.js";
|
|
2
|
+
import { McpOAuthStore, canonicalMcpServerUrl, mcpOAuthServerKey } from "./mcp-oauth-store.js";
|
|
3
3
|
import { XopcMcpOAuthClientProvider } from "./mcp-oauth-provider.js";
|
|
4
4
|
import { McpOAuthSession } from "./mcp-oauth-session.js";
|
|
5
5
|
import { McpOAuthManager, getMcpOAuthManager } from "./mcp-oauth-manager.js";
|
|
@@ -4,11 +4,11 @@ import { init_global_singleton, resolveGlobalSingleton } from "../../../utils/gl
|
|
|
4
4
|
import { resolveConnectorSecretReferences } from "../../../connectors/secret-store.js";
|
|
5
5
|
import { recordPluginMcpHealth } from "../../../extensions/agent-plugins/health.js";
|
|
6
6
|
import { redactSensitiveUrlLikeString } from "../../../utils/redact-sensitive-url.js";
|
|
7
|
-
import { McpOAuthStore, canonicalMcpServerUrl } from "./mcp-oauth-store.js";
|
|
8
|
-
import { pluginOAuthScope } from "../../../extensions/agent-plugins/auth.js";
|
|
9
7
|
import { resolveMcpTransportConfig } from "../mcp-transport-config.js";
|
|
10
8
|
import { isMcpAuthorizationError } from "./mcp-oauth-errors.js";
|
|
9
|
+
import { McpOAuthStore, canonicalMcpServerUrl } from "./mcp-oauth-store.js";
|
|
11
10
|
import { XopcMcpOAuthClientProvider } from "./mcp-oauth-provider.js";
|
|
11
|
+
import { pluginOAuthScope } from "../../../extensions/agent-plugins/plugin-oauth-scope.js";
|
|
12
12
|
import { resolveMcpTransport } from "../mcp-transport.js";
|
|
13
13
|
import { disposeAllSessionMcpRuntimes } from "../bundle-mcp-runtime.js";
|
|
14
14
|
import { McpOAuthSession } from "./mcp-oauth-session.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { McpOAuthStore } from "./mcp-oauth-store.js";
|
|
2
1
|
import { McpAuthorizationRequiredError } from "./mcp-oauth-errors.js";
|
|
2
|
+
import { McpOAuthStore } from "./mcp-oauth-store.js";
|
|
3
3
|
//#region src/agent/mcp/oauth/mcp-oauth-provider.ts
|
|
4
4
|
var XopcMcpOAuthClientProvider = class {
|
|
5
5
|
store;
|
|
@@ -117,7 +117,7 @@ var AgentOrchestrator = class {
|
|
|
117
117
|
clearPendingTranscriptUserMessage(conversationId, userMessage);
|
|
118
118
|
}
|
|
119
119
|
})();
|
|
120
|
-
|
|
120
|
+
this.agentManager.scheduleUserUnderstandingMaintenance(conversationId, userPlainForMemory, turnId);
|
|
121
121
|
this.agentManager.scheduleBackgroundReviewAfterUserTurn(conversationId);
|
|
122
122
|
if (turnResult.ok) {
|
|
123
123
|
this.onEmbeddedTurnComplete?.(conversationId, turnResult.lastAssistantText);
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
+
import { isTransientProviderErrorMessage } from "../../providers/model-response.js";
|
|
1
2
|
import { isContextOverflowError } from "./context-overflow.js";
|
|
2
3
|
//#region src/agent/orchestration/llm-turn-retry.ts
|
|
3
|
-
const TRANSIENT_LLM_ERROR_SUBSTRINGS = [
|
|
4
|
-
"fetch failed",
|
|
5
|
-
"econnreset",
|
|
6
|
-
"econnrefused",
|
|
7
|
-
"enotfound",
|
|
8
|
-
"socket hang up",
|
|
9
|
-
"getaddrinfo",
|
|
10
|
-
"networkerror",
|
|
11
|
-
"etimedout",
|
|
12
|
-
"certificate",
|
|
13
|
-
"ssl",
|
|
14
|
-
"tls"
|
|
15
|
-
];
|
|
16
4
|
function isTransientLlmErrorMessage(message) {
|
|
17
|
-
|
|
18
|
-
return TRANSIENT_LLM_ERROR_SUBSTRINGS.some((s) => lower.includes(s));
|
|
5
|
+
return isTransientProviderErrorMessage(message);
|
|
19
6
|
}
|
|
20
7
|
function classifyLlmFailure(message) {
|
|
21
8
|
const normalized = message.trim().toLowerCase();
|
|
@@ -128,6 +128,7 @@ function buildToolingSection(params) {
|
|
|
128
128
|
const hasExec = availableTools.has("exec_command");
|
|
129
129
|
const hasPlan = availableTools.has("update_plan");
|
|
130
130
|
const hasPublishArtifacts = availableTools.has("publish_artifacts");
|
|
131
|
+
const hasXopcUse = availableTools.has("xopc_use");
|
|
131
132
|
const orchestrationLines = [];
|
|
132
133
|
if (hasDelegate) orchestrationLines.push("- Sub-agent delegation → use `delegate_task(goal, context?, mode?, capabilities?, toolset?)`. Default research inherits available read capabilities; pass necessary context explicitly. Use implement for isolated worktree changes. Check rejectedTools and partial results before relying on the answer.");
|
|
133
134
|
if (hasWorkflow) orchestrationLines.push("- Multi-phase workflows → use `workflow` to start persisted runs with subagents when a script defines phases.");
|
|
@@ -141,6 +142,8 @@ function buildToolingSection(params) {
|
|
|
141
142
|
hasRead ? `Use \`${readToolName}\` for targeted file inspection before editing; do not rely on filenames alone.` : "",
|
|
142
143
|
hasPatch ? `Use \`${patchToolName}\` for source changes; keep patches focused and inspect failures carefully.` : "",
|
|
143
144
|
hasWrite ? `Use \`${writeToolName}\` only for new files or intentional complete rewrites.` : "",
|
|
145
|
+
hasXopcUse && hasRead && hasWrite ? `When the user explicitly asks to change or customize the current agent's name, identity, personality, instructions, working style, tools, workspace, or heartbeat, persist the change instead of only drafting advice. Inspect the current state first; use \`${readToolName}\` and \`${writeToolName}\` for the current agent's profile Markdown, and use \`xopc_use\` mode \`agent\` for structured settings. Target only the current runtime agent unless the user names another one, verify the saved result, and ask before consequential capability or scope expansion when intent is ambiguous.` : "",
|
|
146
|
+
hasXopcUse ? "When the user explicitly asks to create an Agent, use `xopc_use` mode `agent`: list first, create the Agent without a Project or custom workspace unless the user requests one, verify the result, and clearly identify the created Agent so the user can open its own conversation for further customization." : "",
|
|
144
147
|
hasGrep || hasFind ? `Use ${[hasGrep ? `\`${grepToolName}\`` : "", hasFind ? `\`${findToolName}\`` : ""].filter(Boolean).join(" and ")} for text/file discovery; use code graph or symbol tools when available for definitions and call relationships.` : "",
|
|
145
148
|
hasExec ? `Use \`${execToolName}\` for verification and safe inspection, not routine file editing.` : "",
|
|
146
149
|
hasWrite || hasExec ? "When delivering a user-facing workspace file, include a clickable Markdown link in the final response using `xopc://workspace/file?path=<workspace-relative-path>`; URL-encode spaces and special characters, and do not invent an HTTP or `file://` URL." : "",
|
|
@@ -127,7 +127,7 @@ async function runDirectAgentTurn(deps, input) {
|
|
|
127
127
|
beforeTurn: isResume ? void 0 : () => deps.agentManager.beginBackgroundReviewUserTurn(input.conversationId),
|
|
128
128
|
onEvent: input.onEvent
|
|
129
129
|
});
|
|
130
|
-
if (!isResume)
|
|
130
|
+
if (!isResume) deps.agentManager.scheduleUserUnderstandingMaintenance(input.conversationId, userPlain, turnId);
|
|
131
131
|
if (!isResume && result.stopReason !== "connection_required" && result.stopReason !== "clarification_required") deps.agentManager.scheduleBackgroundReviewAfterUserTurn(input.conversationId);
|
|
132
132
|
return result;
|
|
133
133
|
}
|
|
@@ -112,6 +112,7 @@ export declare class AgentService {
|
|
|
112
112
|
setWorkspaceTrust(workspacePath: string, trusted: boolean): WorkspaceTrustState;
|
|
113
113
|
getCapabilityCatalog(conversationId?: string): AgentCapabilityCatalogEntry[];
|
|
114
114
|
getSkillMarkdownSource(skillName: string): SkillMarkdownPreviewPayload | null;
|
|
115
|
+
getWorkflowSkillInstructions(agentId: string, names: readonly string[]): string | undefined;
|
|
115
116
|
refreshSkillsAfterDiskChange(): void;
|
|
116
117
|
refreshSkillsAfterTrustChange(): void;
|
|
117
118
|
installSkillFromSource(opts: SkillInstallToolOptions): Promise<SkillInstallToolResult>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { init_attachment_ref, parseNoteAttachmentTarget } from "../notes/attachment-ref.js";
|
|
4
|
-
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
5
|
-
import { extractTextContent } from "./context/workspace.js";
|
|
6
4
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
7
5
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
6
|
+
import { init_agent_scope, resolveAgentHomeDir, resolveDefaultAgentId } from "./agent-scope.js";
|
|
8
7
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
9
8
|
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
10
9
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
10
|
+
import { extractTextContent } from "./context/workspace.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
13
13
|
import { runWithEmbeddedExecutionSession } from "./embedded/execution-context.js";
|
|
@@ -524,6 +524,9 @@ var AgentService = class {
|
|
|
524
524
|
getSkillMarkdownSource(skillName) {
|
|
525
525
|
return this.agentManager.getSkillMarkdownSource(skillName);
|
|
526
526
|
}
|
|
527
|
+
getWorkflowSkillInstructions(agentId, names) {
|
|
528
|
+
return this.agentManager.getWorkflowSkillInstructions(agentId, names);
|
|
529
|
+
}
|
|
527
530
|
refreshSkillsAfterDiskChange() {
|
|
528
531
|
this.agentManager.refreshSkillsAfterDiskChange();
|
|
529
532
|
}
|
|
@@ -51,6 +51,10 @@ export interface SkillsStorePackageListItem {
|
|
|
51
51
|
stars?: number;
|
|
52
52
|
/** Short provenance label for the row (e.g. ClawHub). */
|
|
53
53
|
sourceLabel?: string;
|
|
54
|
+
branding?: {
|
|
55
|
+
iconUrl: string;
|
|
56
|
+
iconSha256: string;
|
|
57
|
+
};
|
|
54
58
|
/** Published Connector V1 manifest, present for Store connector listings. */
|
|
55
59
|
connectorManifest?: unknown;
|
|
56
60
|
}
|
|
@@ -88,6 +92,10 @@ export interface MarketplacePackageDetail {
|
|
|
88
92
|
name: string;
|
|
89
93
|
type: string;
|
|
90
94
|
description: string;
|
|
95
|
+
branding?: {
|
|
96
|
+
iconUrl: string;
|
|
97
|
+
iconSha256: string;
|
|
98
|
+
};
|
|
91
99
|
readme: string | null;
|
|
92
100
|
downloads: number;
|
|
93
101
|
author: {
|
|
@@ -105,6 +113,10 @@ export interface StoreConnectorPackageDetail {
|
|
|
105
113
|
name: string;
|
|
106
114
|
type: 'connector';
|
|
107
115
|
description: string;
|
|
116
|
+
branding?: {
|
|
117
|
+
iconUrl: string;
|
|
118
|
+
iconSha256: string;
|
|
119
|
+
};
|
|
108
120
|
latestVersion: {
|
|
109
121
|
version: string;
|
|
110
122
|
manifest: unknown;
|
|
@@ -8,8 +8,8 @@ import { getApiKey, init_providers, resolveModel } from "../../providers/index.j
|
|
|
8
8
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
9
9
|
import { readWorkspaceRevision } from "../coding/workspace-revision.js";
|
|
10
10
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
11
|
-
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
12
11
|
import { extractAssistantText, getAssistantMessageErrorReason, stripCodeFences } from "../../providers/model-response.js";
|
|
12
|
+
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
13
13
|
//#region src/agent/tasks/task-judge-service.ts
|
|
14
14
|
init_schema();
|
|
15
15
|
init_providers();
|
|
@@ -46,6 +46,8 @@ import "../../browser/index.js";
|
|
|
46
46
|
import { getPendingTranscriptUserText } from "../inbound/attachment-pipeline.js";
|
|
47
47
|
import { createDelegateTool } from "./delegate-tool.js";
|
|
48
48
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
49
|
+
import { createWorkflowCatalog } from "../workflow/catalog.js";
|
|
50
|
+
import { createWorkflowManageTool } from "./workflow-manage-tool.js";
|
|
49
51
|
import { createAutomationTool } from "./automation-tool.js";
|
|
50
52
|
import { createBrowserAutomationTool } from "./browser-automation-tool.js";
|
|
51
53
|
import { createXopcUseTool } from "./xopc-use-tool.js";
|
|
@@ -66,7 +68,6 @@ import { createComputerUseTool } from "./computer-use-tool.js";
|
|
|
66
68
|
import { createReviewWorkspaceTool } from "./review-workspace.js";
|
|
67
69
|
import { createLanguageDiagnosticsTool } from "./language-diagnostics.js";
|
|
68
70
|
import { createDelegationParentPolicy } from "./delegation-parent-policy.js";
|
|
69
|
-
import { createWorkflowCatalog } from "../workflow/catalog.js";
|
|
70
71
|
import { mergeTtsConfigFromAppConfig } from "../../voice/tts/merge-config.js";
|
|
71
72
|
import { createTextToSpeechTool } from "./tts-tool.js";
|
|
72
73
|
import { getAgentCapabilityToolNames } from "../capabilities/registry.js";
|
|
@@ -464,7 +465,7 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
464
465
|
getTaskId: () => options?.conversationId ?? this.deps.getCurrentContext()?.conversationId ?? "default",
|
|
465
466
|
getReadiness: () => this.checkBrowserReadinessCached()
|
|
466
467
|
})] : [],
|
|
467
|
-
...primary ? [createWorkflowTool({
|
|
468
|
+
...primary ? [createWorkflowManageTool(), createWorkflowTool({
|
|
468
469
|
catalog: createWorkflowCatalog(),
|
|
469
470
|
getCurrentConversationId: () => this.deps.getCurrentContext()?.conversationId,
|
|
470
471
|
getConfig: () => this.deps.getConfig?.(),
|
|
@@ -27,6 +27,7 @@ export { createClarifyTool, type ClarifyRequestPayload, type GatewayClarifyReque
|
|
|
27
27
|
export { BrowserRuntime, assertBrowserUrlAllowed } from '../../browser/index.js';
|
|
28
28
|
export { createDelegateTool, DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, } from './delegate-tool.js';
|
|
29
29
|
export { createWorkflowTool, type WorkflowToolDeps, type WorkflowToolInput } from './workflow-tool.js';
|
|
30
|
+
export { createWorkflowManageTool } from './workflow-manage-tool.js';
|
|
30
31
|
export { createAutomationTool, type AutomationToolDeps } from './automation-tool.js';
|
|
31
32
|
export { createBrowserAutomationTool } from './browser-automation-tool.js';
|
|
32
33
|
export { createXopcUseTool, type XopcUseToolDeps, type XopcUseToolInput } from './xopc-use-tool.js';
|
|
@@ -32,6 +32,7 @@ import "../../browser/index.js";
|
|
|
32
32
|
import { resolveImageModelConfigForTool } from "../image/tool-model-config.js";
|
|
33
33
|
import { DEFAULT_DELEGATE_TOOLS, DELEGATE_BLOCKED_TOOLS, createDelegateTool } from "./delegate-tool.js";
|
|
34
34
|
import { createWorkflowTool } from "./workflow-tool.js";
|
|
35
|
+
import { createWorkflowManageTool } from "./workflow-manage-tool.js";
|
|
35
36
|
import { createAutomationTool } from "./automation-tool.js";
|
|
36
37
|
import { createBrowserAutomationTool } from "./browser-automation-tool.js";
|
|
37
38
|
import { createXopcUseTool } from "./xopc-use-tool.js";
|
|
@@ -44,4 +45,4 @@ import { createDesktopPetTool } from "./desktop-pet-tool.js";
|
|
|
44
45
|
import { createManagedJobTool } from "./managed-job-tool.js";
|
|
45
46
|
import { createImageTool } from "./image-tool.js";
|
|
46
47
|
import { createImageGenerateTool, resolveImageGenerationModelConfigForTool } from "./image-generate-tool.js";
|
|
47
|
-
export { BrowserRuntime, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, createApplyPatchTool, createAutomationTool, createBrowserAutomationTool, createClarifyTool, createCreateShareTool, createDataBatchTool, createDelegateTool, createDesktopPetTool, createExecCommandTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createKnowledgeGetTool, createKnowledgeSearchTool, createKnowledgeWriteTool, createListDirTool, createManagedJobTool, createMemoryMaintenanceTool, createMessageTool, createPublishArtifactsTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createUserContextGetTool, createUserContextSearchTool, createUserContextUpdateTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
48
|
+
export { BrowserRuntime, DEFAULT_DELEGATE_TOOLS, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, DEFAULT_TOOL_METADATA, DEFAULT_WEB_EXTRACT_MAX_LENGTH, DELEGATE_BLOCKED_TOOLS, GREP_MAX_LINE_LENGTH, MAX_RAW_HTML_CHARS_FOR_WEB_EXTRACT, TodoStore, ToolConcurrencyController, assertBrowserUrlAllowed, createApplyPatchTool, createAutomationTool, createBrowserAutomationTool, createClarifyTool, createCreateShareTool, createDataBatchTool, createDelegateTool, createDesktopPetTool, createExecCommandTool, createFindTool, createGrepTool, createImageGenerateTool, createImageTool, createKnowledgeGetTool, createKnowledgeSearchTool, createKnowledgeWriteTool, createListDirTool, createManagedJobTool, createMemoryMaintenanceTool, createMessageTool, createPublishArtifactsTool, createReadFileTool, createReadMediaTool, createSendMediaTool, createSessionRecallTool, createSessionSearchTool, createSessionStatusTool, createSkillInstallTool, createSkillManageTool, createSkillViewTool, createSkillsListTool, createSkillsMarketplaceSearchTool, createTodoTool, createToolManualTool, createUpdatePlanTool, createUserContextGetTool, createUserContextSearchTool, createUserContextUpdateTool, createWebExtractTool, createWebFetchTool, createWebSearchTool, createWorkflowManageTool, createWorkflowTool, createWriteFileTool, createXopcUseTool, findTool, formatSize, fuzzyFindText, generateDiffString, getToolMetadata, grepTool, isShareToolAvailable, listDirTool, normalizeForFuzzyMatch, normalizeToLF, resolveImageGenerationModelConfigForTool, resolveImageModelConfigForTool, resolveToolLockMode, restoreLineEndings, stripBom, stripHtmlBoilerplate, truncateHead, truncateLine, truncateTail, writeFileTool };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { retrievalLexicalSimilarity } from "../../retrieval/textFeatures.js";
|
|
2
|
-
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../user-model/repository.js";
|
|
2
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../user-model/repository.js";
|
|
3
3
|
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
4
4
|
import "../../user-model/index.js";
|
|
5
5
|
import { Type } from "@sinclair/typebox";
|
|
@@ -49,7 +49,10 @@ function createUserContextSearchTool(options) {
|
|
|
49
49
|
const results = listUserAssertions({
|
|
50
50
|
statuses: ["active", "candidate"],
|
|
51
51
|
limit: 1e3
|
|
52
|
-
}).filter((assertion) => visible(options, assertion.slotId)).filter((item) => canUseAssertion(item
|
|
52
|
+
}).filter((assertion) => visible(options, assertion.slotId)).filter((item) => canUseAssertion(item, Date.now(), {
|
|
53
|
+
use: "answer",
|
|
54
|
+
agentId: options.agentId
|
|
55
|
+
})).map((assertion) => ({
|
|
53
56
|
assertion,
|
|
54
57
|
score: retrievalLexicalSimilarity(input.query, `${assertion.statement} ${assertion.normalizedValue}`)
|
|
55
58
|
})).filter((item) => item.score > 0).sort((left, right) => right.score - left.score).slice(0, input.maxResults ?? 12).map(({ assertion, score }) => ({
|
|
@@ -58,6 +61,14 @@ function createUserContextSearchTool(options) {
|
|
|
58
61
|
statement: assertion.statement,
|
|
59
62
|
status: assertion.status,
|
|
60
63
|
authority: assertion.authority,
|
|
64
|
+
domain: assertion.domain,
|
|
65
|
+
layer: assertion.layer,
|
|
66
|
+
confidence: assertion.confidence,
|
|
67
|
+
evidence: {
|
|
68
|
+
supportCount: assertion.supportCount,
|
|
69
|
+
independentSourceCount: assertion.independentSourceCount,
|
|
70
|
+
lastSupportedAt: assertion.lastSupportedAt
|
|
71
|
+
},
|
|
61
72
|
score
|
|
62
73
|
}));
|
|
63
74
|
return {
|
|
@@ -86,7 +97,10 @@ function createUserContextGetTool(options) {
|
|
|
86
97
|
};
|
|
87
98
|
const id = raw.id;
|
|
88
99
|
const assertion = getUserAssertion(id);
|
|
89
|
-
if (!assertion || !visible(options, assertion.slotId) || !canUseAssertion(assertion)
|
|
100
|
+
if (!assertion || !visible(options, assertion.slotId) || !canUseAssertion(assertion, Date.now(), {
|
|
101
|
+
use: "answer",
|
|
102
|
+
agentId: options.agentId
|
|
103
|
+
})) return {
|
|
90
104
|
content: [{
|
|
91
105
|
type: "text",
|
|
92
106
|
text: `User assertion not found: ${id}`
|
|
@@ -95,7 +109,8 @@ function createUserContextGetTool(options) {
|
|
|
95
109
|
};
|
|
96
110
|
const result = {
|
|
97
111
|
assertion,
|
|
98
|
-
slot: getAssertionSlot(assertion.slotId)
|
|
112
|
+
slot: getAssertionSlot(assertion.slotId),
|
|
113
|
+
sources: listUserAssertionSources([assertion.id]).get(assertion.id) ?? []
|
|
99
114
|
};
|
|
100
115
|
return {
|
|
101
116
|
content: [{
|
|
@@ -180,7 +195,17 @@ function createUserContextUpdateTool(options) {
|
|
|
180
195
|
volatility: current.volatility,
|
|
181
196
|
sensitivity: current.sensitivity,
|
|
182
197
|
disclosurePolicy: current.disclosurePolicy,
|
|
198
|
+
domain: current.domain,
|
|
199
|
+
layer: current.layer,
|
|
200
|
+
sensitivityCategories: current.sensitivityCategories,
|
|
201
|
+
purposeIds: current.purposeIds,
|
|
202
|
+
allowedUses: current.allowedUses,
|
|
203
|
+
allowedAgentIds: current.allowedAgentIds,
|
|
204
|
+
deleteAfter: current.deleteAfter,
|
|
183
205
|
applicability: current.applicability,
|
|
206
|
+
...current.validFrom === void 0 ? {} : { validFrom: current.validFrom },
|
|
207
|
+
...current.validTo === void 0 ? {} : { validTo: current.validTo },
|
|
208
|
+
...current.reviewAt === void 0 ? {} : { reviewAt: current.reviewAt },
|
|
184
209
|
observedAt: Date.now(),
|
|
185
210
|
createdBy: "user",
|
|
186
211
|
correctionOfAssertionId: current.id
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
2
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { validateWorkflowDefinitionInput } from "../../workflows/domain/validation.js";
|
|
4
|
+
import { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog } from "../workflow/catalog.js";
|
|
5
|
+
import "../../workflows/domain/index.js";
|
|
6
|
+
import { WorkflowDraftConflictError, WorkflowDraftStore } from "../../workflows/authoring/workflow-draft-store.js";
|
|
7
|
+
import { createStarterWorkflowGraph, createStarterWorkflowManifest } from "../../workflows/authoring/workflow-draft-defaults.js";
|
|
8
|
+
import "../../workflows/authoring/index.js";
|
|
9
|
+
import { Type } from "@sinclair/typebox";
|
|
10
|
+
//#region src/agent/tools/workflow-manage-tool.ts
|
|
11
|
+
init_src();
|
|
12
|
+
const WorkflowManageSchema = Type.Object({
|
|
13
|
+
action: Type.Union([
|
|
14
|
+
Type.Literal("list"),
|
|
15
|
+
Type.Literal("open_draft"),
|
|
16
|
+
Type.Literal("get_draft"),
|
|
17
|
+
Type.Literal("replace_draft"),
|
|
18
|
+
Type.Literal("validate_draft"),
|
|
19
|
+
Type.Literal("publish_draft")
|
|
20
|
+
]),
|
|
21
|
+
workflowName: Type.Optional(Type.String({ description: "Saved or new lowercase snake_case workflow name." })),
|
|
22
|
+
draftId: Type.Optional(Type.String({ description: "Draft id returned by open_draft." })),
|
|
23
|
+
graph: Type.Optional(Type.Any({ description: "Complete workflow graph for replace_draft." })),
|
|
24
|
+
manifest: Type.Optional(Type.Any({ description: "Complete workflow manifest for replace_draft." })),
|
|
25
|
+
expectedUpdatedAtMs: Type.Optional(Type.Number({ description: "Latest draft updatedAtMs; required for replace_draft and publish_draft." })),
|
|
26
|
+
confirmed: Type.Optional(Type.Boolean({ description: "Must be true for publish_draft after the user explicitly confirms this draft." }))
|
|
27
|
+
});
|
|
28
|
+
function createWorkflowManageTool() {
|
|
29
|
+
const store = new WorkflowDraftStore();
|
|
30
|
+
return {
|
|
31
|
+
name: "workflow_manage",
|
|
32
|
+
label: "◆ Workflow builder",
|
|
33
|
+
description: "Create and edit saved workflows through durable validated drafts. Use list/open/get/replace/validate, then publish only after user confirmation.",
|
|
34
|
+
parameters: WorkflowManageSchema,
|
|
35
|
+
async execute(_toolCallId, input) {
|
|
36
|
+
try {
|
|
37
|
+
if (input.action === "list") return listWorkflows();
|
|
38
|
+
if (input.action === "open_draft") return openDraft(store, input.workflowName);
|
|
39
|
+
const draft = requireDraft(store, input.draftId);
|
|
40
|
+
if (input.action === "get_draft") return success(JSON.stringify(draft, null, 2), { draft });
|
|
41
|
+
if (input.action === "validate_draft") return validateDraft(draft);
|
|
42
|
+
if (input.action === "replace_draft") return replaceDraft(store, draft, input);
|
|
43
|
+
return publishDraft(store, draft, input.expectedUpdatedAtMs, input.confirmed);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
return failure(error instanceof Error ? error.message : String(error));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function listWorkflows() {
|
|
51
|
+
const workflows = createWorkflowCatalog().list().slice(0, 100).map((entry) => ({
|
|
52
|
+
name: entry.name,
|
|
53
|
+
title: entry.title,
|
|
54
|
+
description: entry.description,
|
|
55
|
+
revision: entry.revision
|
|
56
|
+
}));
|
|
57
|
+
return success(workflows.length ? JSON.stringify(workflows, null, 2) : "No saved workflows.", { workflows });
|
|
58
|
+
}
|
|
59
|
+
function openDraft(store, rawName) {
|
|
60
|
+
const workflowName = rawName?.trim();
|
|
61
|
+
if (!workflowName) return failure("workflowName is required for open_draft.");
|
|
62
|
+
const catalog = createWorkflowCatalog();
|
|
63
|
+
let graph = createStarterWorkflowGraph();
|
|
64
|
+
let manifest = createStarterWorkflowManifest(workflowName);
|
|
65
|
+
let baseRevision = 0;
|
|
66
|
+
if (catalog.list().some((entry) => entry.name === workflowName)) {
|
|
67
|
+
const definition = catalog.load(workflowName);
|
|
68
|
+
graph = definition.graph;
|
|
69
|
+
manifest = {
|
|
70
|
+
title: definition.title,
|
|
71
|
+
description: definition.description,
|
|
72
|
+
version: definition.version,
|
|
73
|
+
inputSchema: definition.inputSchema,
|
|
74
|
+
outputSchema: definition.outputSchema,
|
|
75
|
+
defaults: definition.defaults,
|
|
76
|
+
tags: definition.metadata.tags,
|
|
77
|
+
whenToUse: definition.metadata.whenToUse,
|
|
78
|
+
estimatedAgents: definition.metadata.estimatedAgents,
|
|
79
|
+
examplePrompts: definition.metadata.examplePrompts,
|
|
80
|
+
i18n: definition.metadata.i18n,
|
|
81
|
+
permissions: definition.permissions,
|
|
82
|
+
resources: definition.resources,
|
|
83
|
+
connectors: definition.connectors
|
|
84
|
+
};
|
|
85
|
+
baseRevision = definition.revision;
|
|
86
|
+
}
|
|
87
|
+
const draft = store.save({
|
|
88
|
+
workflowName,
|
|
89
|
+
graph,
|
|
90
|
+
manifest,
|
|
91
|
+
baseRevision
|
|
92
|
+
});
|
|
93
|
+
return success(`Opened durable draft ${draft.id} for ${workflowName}.`, { draft });
|
|
94
|
+
}
|
|
95
|
+
function requireDraft(store, draftId) {
|
|
96
|
+
const id = draftId?.trim();
|
|
97
|
+
if (!id) throw new Error("draftId is required for this action.");
|
|
98
|
+
const draft = store.get(id);
|
|
99
|
+
if (!draft) throw new Error("Workflow draft not found.");
|
|
100
|
+
return draft;
|
|
101
|
+
}
|
|
102
|
+
function validateDraft(draft) {
|
|
103
|
+
const validation = validateWorkflowDefinitionInput({
|
|
104
|
+
name: draft.workflowName,
|
|
105
|
+
graph: draft.graph,
|
|
106
|
+
manifest: draft.manifest
|
|
107
|
+
});
|
|
108
|
+
const text = validation.valid ? `Workflow draft is valid${validation.warnings.length ? ` with ${validation.warnings.length} warning(s)` : ""}.` : `Workflow draft is invalid: ${validation.errors.map((issue) => issue.message).join(" ")}`;
|
|
109
|
+
return validation.valid ? success(text, {
|
|
110
|
+
validation,
|
|
111
|
+
updatedAtMs: draft.updatedAtMs
|
|
112
|
+
}) : failure(text, {
|
|
113
|
+
validation,
|
|
114
|
+
updatedAtMs: draft.updatedAtMs
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
function replaceDraft(store, draft, input) {
|
|
118
|
+
if (!input.graph) return failure("graph is required for replace_draft.");
|
|
119
|
+
if (input.expectedUpdatedAtMs === void 0) return failure("expectedUpdatedAtMs is required for replace_draft.");
|
|
120
|
+
const workflowName = input.workflowName?.trim() || draft.workflowName;
|
|
121
|
+
const manifest = input.manifest ?? draft.manifest;
|
|
122
|
+
const validation = validateWorkflowDefinitionInput({
|
|
123
|
+
name: workflowName,
|
|
124
|
+
graph: input.graph,
|
|
125
|
+
manifest
|
|
126
|
+
});
|
|
127
|
+
if (!validation.valid) return failure(`Draft was not changed. ${validation.errors.map((issue) => issue.message).join(" ")}`, { validation });
|
|
128
|
+
try {
|
|
129
|
+
const saved = store.save({
|
|
130
|
+
id: draft.id,
|
|
131
|
+
workflowName,
|
|
132
|
+
graph: input.graph,
|
|
133
|
+
manifest,
|
|
134
|
+
expectedUpdatedAtMs: input.expectedUpdatedAtMs
|
|
135
|
+
});
|
|
136
|
+
return success(`Workflow draft saved at version ${saved.updatedAtMs}.`, {
|
|
137
|
+
draft: saved,
|
|
138
|
+
validation
|
|
139
|
+
});
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (error instanceof WorkflowDraftConflictError) return failure("Draft changed since it was read. Read it again before applying changes.", {
|
|
142
|
+
code: "WORKFLOW_DRAFT_CONFLICT",
|
|
143
|
+
currentUpdatedAtMs: error.currentUpdatedAtMs
|
|
144
|
+
});
|
|
145
|
+
throw error;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function publishDraft(store, draft, expectedUpdatedAtMs, confirmed) {
|
|
149
|
+
if (confirmed !== true) return failure("Publishing requires explicit user confirmation. Ask the user to confirm this validated draft first.");
|
|
150
|
+
if (expectedUpdatedAtMs === void 0) return failure("expectedUpdatedAtMs is required for publish_draft.");
|
|
151
|
+
if (draft.updatedAtMs !== expectedUpdatedAtMs) return failure("Draft changed since it was read. Read and validate it again before publishing.", {
|
|
152
|
+
code: "WORKFLOW_DRAFT_CONFLICT",
|
|
153
|
+
currentUpdatedAtMs: draft.updatedAtMs
|
|
154
|
+
});
|
|
155
|
+
const validation = validateWorkflowDefinitionInput({
|
|
156
|
+
name: draft.workflowName,
|
|
157
|
+
graph: draft.graph,
|
|
158
|
+
manifest: draft.manifest
|
|
159
|
+
});
|
|
160
|
+
if (!validation.valid) return failure(`Workflow was not published. ${validation.errors.map((issue) => issue.message).join(" ")}`, { validation });
|
|
161
|
+
try {
|
|
162
|
+
const { definition } = createWorkflowCatalog().save({
|
|
163
|
+
name: draft.workflowName,
|
|
164
|
+
graph: draft.graph,
|
|
165
|
+
manifest: draft.manifest,
|
|
166
|
+
expectedRevision: draft.baseRevision,
|
|
167
|
+
intent: draft.baseRevision === 0 ? "create" : "update"
|
|
168
|
+
});
|
|
169
|
+
store.save({
|
|
170
|
+
...draft,
|
|
171
|
+
baseRevision: definition.revision,
|
|
172
|
+
expectedUpdatedAtMs: draft.updatedAtMs
|
|
173
|
+
});
|
|
174
|
+
const delivery = {
|
|
175
|
+
version: 2,
|
|
176
|
+
operation: draft.baseRevision === 0 ? "created" : "updated",
|
|
177
|
+
primary: {
|
|
178
|
+
kind: "workflow_definition",
|
|
179
|
+
id: definition.id,
|
|
180
|
+
title: definition.title,
|
|
181
|
+
summary: definition.description,
|
|
182
|
+
status: "ready",
|
|
183
|
+
capabilities: [
|
|
184
|
+
"open",
|
|
185
|
+
"edit",
|
|
186
|
+
"run"
|
|
187
|
+
]
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
return success(appendProductDeliveryText(`Published workflow \`${definition.name}\` revision ${definition.revision}.`, delivery), {
|
|
191
|
+
definition,
|
|
192
|
+
delivery
|
|
193
|
+
});
|
|
194
|
+
} catch (error) {
|
|
195
|
+
if (error instanceof WorkflowNameConflictError) return failure(`Workflow name "${error.workflowName}" is already in use.`, { code: "WORKFLOW_NAME_EXISTS" });
|
|
196
|
+
if (error instanceof WorkflowRevisionConflictError) return failure("The saved workflow changed. Open a fresh draft before publishing.", {
|
|
197
|
+
code: "WORKFLOW_REVISION_CONFLICT",
|
|
198
|
+
currentRevision: error.currentRevision
|
|
199
|
+
});
|
|
200
|
+
throw error;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function success(text, details) {
|
|
204
|
+
return {
|
|
205
|
+
content: [{
|
|
206
|
+
type: "text",
|
|
207
|
+
text
|
|
208
|
+
}],
|
|
209
|
+
details
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function failure(message, details = {}) {
|
|
213
|
+
return {
|
|
214
|
+
content: [{
|
|
215
|
+
type: "text",
|
|
216
|
+
text: message
|
|
217
|
+
}],
|
|
218
|
+
details: {
|
|
219
|
+
error: message,
|
|
220
|
+
...details
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
export { createWorkflowManageTool };
|
|
@@ -9,9 +9,9 @@ import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
|
9
9
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
11
|
import "../../activity/index.js";
|
|
12
|
+
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
12
13
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
13
14
|
import "../../capabilities/runtime/dispatcher.js";
|
|
14
|
-
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
15
15
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
16
16
|
import "../../projects/index.js";
|
|
17
17
|
import { TaskDeletionService } from "../../tasks/task-deletion-service.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AgentEntrySchema, EffectiveAgentConfigSchema } from "../agent-config/schema.js";
|
|
2
2
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
3
|
import { init_agent_config } from "../agent-config/index.js";
|
|
4
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
5
|
-
import { defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
6
4
|
import { AgentCatalogRepository, init_repository } from "./repository.js";
|
|
7
5
|
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
7
|
+
import { defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
8
8
|
import { AgentCatalogService } from "./service.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/agent-catalog/capabilities.ts
|
|
@@ -2,8 +2,8 @@ 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
4
|
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveCredentialsDir, resolveOAuthPath } from "../config/paths.js";
|
|
5
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
6
5
|
import { getOAuthProviderDefinition, init_registry } from "./oauth/registry.js";
|
|
6
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "../providers/env-keys.js";
|
|
8
8
|
import { init_oauth_provider_lock, withOAuthProviderLock } from "./oauth-provider-lock.js";
|
|
9
9
|
import { dirname, join } from "path";
|
|
@@ -3,8 +3,8 @@ import { init_paths, resolveOAuthPath } from "../config/paths.js";
|
|
|
3
3
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
4
4
|
import { dirname } from "node:path";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
|
-
import { mkdir, open, readFile, rm, stat } from "node:fs/promises";
|
|
7
6
|
import { setTimeout } from "node:timers/promises";
|
|
7
|
+
import { mkdir, open, readFile, rm, stat } from "node:fs/promises";
|
|
8
8
|
//#region src/auth/oauth-provider-lock.ts
|
|
9
9
|
function lockPath(providerId) {
|
|
10
10
|
return `${resolveOAuthPath(providerId.toLowerCase())}.lock`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
3
2
|
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
3
|
+
import { init_paths, resolveAgentAuthProfilesPath, resolveAuthProfilesPath, resolveOAuthPath } from "../config/paths.js";
|
|
4
4
|
import { init_registry, isOAuthOnlyProvider } from "./oauth/registry.js";
|
|
5
5
|
import { existsSync, readFileSync } from "node:fs";
|
|
6
6
|
//#region src/auth/sync-provider-auth.ts
|
|
@@ -3,10 +3,10 @@ import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
|
3
3
|
import { init_trust_policy, resolveAutomationSafetyForTrust } from "../../user-context/trust-policy.js";
|
|
4
4
|
import { getUserTrustPolicy } from "../../storage/sqlite/user-trust-repository.js";
|
|
5
5
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
6
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
6
7
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
7
8
|
import { ExternalEffectNotAppliedError } from "../../capabilities/runtime/external-operations.js";
|
|
8
9
|
import { defineExternalCapability, defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
9
|
-
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
10
10
|
import { AutomationCreateCapabilityInputSchema } from "./write.js";
|
|
11
11
|
import { simulateAutomation } from "../draft/automation-draft-validator.js";
|
|
12
12
|
import { AutomationDraftService } from "../draft/automation-draft-service.js";
|