@xopcai/xopc 0.0.331 → 0.0.333
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B0BtF24E.js → agent-avatar-dicebear-DiI2O7lC.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CVp3J969.js +1 -0
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DbvLXQO2.js → agent-plugin-dialog-CacyndrS.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DXYZSuUV.js +70 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fwzTRJfP.js → app-management-settings-panel-BcszTlqr.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-v_GGe8UZ.js → appearance-settings-B1XPe8qz.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-C9ZMEuuA.js → apps-page-ZqANbUZv.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-B6EgADeH.js → archive-plugin-MjUsJcNb.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-B4H_IFeX.js → attachment-load-DHa-BI9a.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-UlVCvg4r.js → automations-page-Dsjivdxs.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-B37vs5tk.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BxTSx30f.js → binary-plugins-DQYcuBHP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CVzdrpjl.js → block-editor-Bx0uXbJP.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C5s1yHOu.js → browser-automation-inputs-1ZIPGDeq.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CBVD8k6O.js → browser-automations-page-CCjYipHc.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CSv4rvmx.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-BnO9LV7U.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-page-BAT7Vvb8.js → capabilities-page-BfvDvIY1.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CoW7-ESq.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-EETjXmkG.js → capability-header-actions-D_hbWRRF.js} +1 -1
- package/dist/gateway/static/root/assets/channels-BhMaRh1x.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DCqm9j9W.js → chat-terminal-dock-Fnum_IEm.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-CxFWdovV.js → computer-settings-page-DI1zfCTA.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-wxsEhmlU.js → connector-service-page-CiGDAubm.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-Ono0Pha1.js +2 -0
- package/dist/gateway/static/root/assets/{date-picker-h_OS6uBR.js → date-picker-D-JhzZyW.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DNgSSH3z.js → dependency-picker-DpD3xaEB.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CflvPnB-.js → desktop-pet-CCoDxKqh.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CXy0X5Js.js → desktop-pet-settings-GxndKfCx.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-BDMiJcsK.js → device-pairing-wizard-B71w3ptm.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BqkOh13m.js → directory-picker-path-field-CUzjJvjs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-VT4s-9pK.js → extension-debug-page-BtDY8ntX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CBSeGhGA.js → extension-page-D9_XF-XC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DRB6uOo8.js → extension-settings-page-CjhUFAaC.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-cR-tz7-Q.js → gateway-config-swr-CgIjCxM8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-lF-FpnZy.js → gateway-settings-BWaCnwT1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-6jLRcQsu.js → gateway-startup-retry-i-1lTrwY.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BTjGLngn.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-CSSkwsyC.js → image-generation-api-gilc-u7M.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-DGkOijwE.js → imports-page-BEtq5BRU.js} +1 -1
- package/dist/gateway/static/root/assets/index-DHL16aYZ.js +121 -0
- package/dist/gateway/static/root/assets/index-N1e6PDwx.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-iU6c2zg1.js → keyboard-shortcuts-settings-JUYY_18v.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-uI7mtoVz.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-C0BWC8D2.js → local-apps-page-BlYESNqz.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-wNXWkWu5.js → locale-store-BY30D6tg.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-Dpoi-r-_.js → logs-page-BbLQreeN.js} +2 -2
- package/dist/gateway/static/root/assets/management-settings-c4krhYU7.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DlT9KqwF.js → markdown-view-BEeXMfDw.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C8E_F2F_.js → media-plugins-DEFN1I73.js} +1 -1
- package/dist/gateway/static/root/assets/messages-_6IXbP2u.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel--09xGxyE.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-DsxcVBXF.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-qqWG_gs_.js → page-context-capture-button-D43aVpCj.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-b3lheKy4.js → page-tabs-BhYBCqls.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-0Q4rTfGX.js → preview-open-alternatives-CP8agNlc.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-jnJZCrKQ.js → product-open-page-CU7fRhfT.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-U-EdDfAW.js +1 -0
- package/dist/gateway/static/root/assets/{projects-page-r96k_2wB.js → projects-page-DUOKZLt7.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BIpltJ47.js → registry-api-BvVx0G1o.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B1d8pB_y.js → remote-access-hub-fVPQe5YS.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Do_iF13W.js → runtime-tools-settings-panel-Czvzsuj_.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-C0-WHOY3.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-Cfft26Je.js → schema-form-B9Ni5O93.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DdXvW09N.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BtF83fBY.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-iI0MTyuU.js → settings-form-section-jquf1P7n.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C2Ka9oJm.js → settings-page-DPomsvba.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-nnmS_p5h.js → setup-status-panel-BvVlqpHf.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-D0Knvtlp.js → share-preview-page-b9DI0N1J.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-R_qwc4DN.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BuZKcy9b.js → skill-api-Bu7-3w-L.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-CNJAQ_e-.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DcxWxIrR.js → skills-page-D7XPEQu_.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-CMG0ZAsd.js → system-settings-panel-BwFR0Uci.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-PFjGW2g1.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-DGYA6GyO.js → tunnel-api-PfucxMP3.js} +1 -1
- package/dist/gateway/static/root/assets/usage-page-t_zdQHcy.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CDemMoSX.js → use-autosave-DLyy2wHz.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-OyfPVfB9.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CXArY4t5.js → voice-api-key-field-CQDY5EBK.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-ujEySjyc.js → voice-config-api-Bwy3Al3J.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Dk5KsKOm.js → work-discovery-overlay-CJzqJ47I.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DNpdaI-2.js → workflow-run-setup-panel-sCOk-esV.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-DYBGjN7C.js +6 -0
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +59 -14
- package/dist/packages/gateway-contract/src/capabilities.js +106 -8
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/scenes.js +7 -6
- package/dist/packages/gateway-contract/src/sessions.js +2 -1
- package/dist/packages/gateway-contract/src/usage.js +6 -0
- package/dist/src/agent/agent-manager.js +13 -7
- package/dist/src/agent/background-review/run-background-review.js +7 -2
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +7 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.d.ts +2 -1
- package/dist/src/agent/external-tools/gateway-tools.js +44 -11
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/image/understanding/pi-ai-provider.js +1 -1
- package/dist/src/agent/memory/compaction.js +4 -0
- package/dist/src/agent/orchestration/agent-orchestrator.js +0 -21
- package/dist/src/agent/service/btw-query.js +8 -2
- package/dist/src/agent/service.js +3 -3
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +2 -2
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +4 -0
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +5 -4
- package/dist/src/agent/tools/automation-tool.d.ts +4 -1
- package/dist/src/agent/tools/automation-tool.js +42 -4
- package/dist/src/agent/tools/session-search-tool.js +1 -1
- package/dist/src/agent/tools/web-extract.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +50 -9
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/ai-assist/text-assist.js +5 -1
- 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/api/routes.js +65 -0
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/read.js +24 -0
- package/dist/src/automations/capabilities/write.d.ts +69 -14
- package/dist/src/automations/capabilities/write.js +78 -5
- package/dist/src/automations/delivery/delivery-router.d.ts +50 -0
- package/dist/src/automations/delivery/delivery-router.js +318 -0
- package/dist/src/automations/delivery/index.d.ts +1 -0
- package/dist/src/automations/delivery/index.js +2 -0
- package/dist/src/automations/domain/defaults.d.ts +0 -1
- package/dist/src/automations/domain/defaults.js +2 -2
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +180 -7
- package/dist/src/automations/domain/validation.d.ts +172 -22
- package/dist/src/automations/domain/validation.js +82 -13
- package/dist/src/automations/draft/automation-draft-prompt.js +3 -4
- package/dist/src/automations/draft/automation-draft-service.js +6 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +31 -3
- package/dist/src/automations/draft/automation-draft-validator.js +5 -4
- package/dist/src/automations/events/event-catalog.d.ts +14 -0
- package/dist/src/automations/events/event-catalog.js +117 -0
- package/dist/src/automations/events/event-dispatcher.d.ts +27 -0
- package/dist/src/automations/events/event-dispatcher.js +140 -0
- package/dist/src/automations/events/event-repository.d.ts +59 -0
- package/dist/src/automations/events/event-repository.js +361 -0
- package/dist/src/automations/events/index.d.ts +3 -0
- package/dist/src/automations/events/index.js +4 -0
- package/dist/src/automations/index.d.ts +3 -1
- package/dist/src/automations/index.js +9 -3
- package/dist/src/automations/service/action-executor.d.ts +20 -1
- package/dist/src/automations/service/action-executor.js +80 -24
- package/dist/src/automations/service/automation-service.d.ts +21 -4
- package/dist/src/automations/service/automation-service.js +150 -100
- package/dist/src/automations/storage/automation-repository.js +7 -7
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +26 -1
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/automations/webhook-secrets.d.ts +1 -0
- package/dist/src/automations/webhook-secrets.js +16 -0
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/capabilities/store-connector.d.ts +17 -1
- package/dist/src/capabilities/store-connector.js +69 -3
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/connectors.js +4 -3
- package/dist/src/cli/commands/doctor/checks/automation-integrity.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/automation-integrity.js +55 -0
- package/dist/src/cli/commands/doctor/checks/database-relations.d.ts +2 -0
- package/dist/src/cli/commands/doctor/checks/database-relations.js +81 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/flow.js +5 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/skills.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.d.ts +4 -0
- package/dist/src/config/schema.js +5 -1
- package/dist/src/connectors/approval-resume.js +1 -1
- package/dist/src/connectors/cli/store.js +1 -1
- package/dist/src/connectors/composio-backends.js +14 -4
- package/dist/src/connectors/composio-managed-events.d.ts +5 -2
- package/dist/src/connectors/composio-managed-events.js +4 -1
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -1
- package/dist/src/connectors/connection-recovery-service.js +89 -4
- package/dist/src/discussions/analyzer.js +4 -4
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/home-intelligence-automation-reconciler.d.ts +3 -0
- package/dist/src/gateway/home-intelligence-automation-reconciler.js +52 -0
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/capabilities.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +18 -4
- package/dist/src/gateway/hono/routes/connection-waits.js +3 -2
- package/dist/src/gateway/hono/routes/home.js +0 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +14 -1
- 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/public-gateway.js +93 -3
- package/dist/src/gateway/hono/routes/scenes.js +57 -41
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +15 -0
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/update.js +6 -1
- package/dist/src/gateway/hono/routes/usage.d.ts +3 -0
- package/dist/src/gateway/hono/routes/usage.js +61 -0
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +2 -2
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +21 -15
- package/dist/src/gateway/scenes/host.js +27 -14
- package/dist/src/gateway/scenes/slackThreadSource.d.ts +2 -2
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/active-execution.d.ts +19 -0
- package/dist/src/gateway/service/active-execution.js +16 -0
- package/dist/src/gateway/service/agent-runner.d.ts +4 -0
- package/dist/src/gateway/service/agent-runner.js +19 -1
- package/dist/src/gateway/service/marketplace-service.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.d.ts +2 -0
- package/dist/src/gateway/service/run-gateway-agent.js +9 -1
- package/dist/src/gateway/service/sessions-api.d.ts +13 -0
- package/dist/src/gateway/service/sessions-api.js +23 -0
- package/dist/src/gateway/service.d.ts +7 -3
- package/dist/src/gateway/service.js +108 -89
- package/dist/src/gateway/side-chat/run-service.js +10 -7
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +4 -1
- package/dist/src/home-intelligence/host.d.ts +1 -1
- package/dist/src/home-intelligence/host.js +2 -10
- package/dist/src/home-intelligence/notification.js +1 -1
- package/dist/src/home-intelligence/repository.d.ts +1 -1
- package/dist/src/infra/domain-outbox-dispatcher.d.ts +0 -3
- package/dist/src/infra/domain-outbox-dispatcher.js +15 -7
- package/dist/src/infra/update-check.d.ts +8 -4
- package/dist/src/infra/update-check.js +43 -41
- package/dist/src/infra/update-startup.d.ts +7 -1
- package/dist/src/infra/update-startup.js +15 -6
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/memory-maintenance/index.js +2 -2
- package/dist/src/memory-maintenance/schedule.d.ts +0 -3
- package/dist/src/memory-maintenance/schedule.js +1 -8
- package/dist/src/notes/service.js +2 -3
- package/dist/src/projects/project-service.js +1 -2
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/providers/model-call.d.ts +3 -2
- package/dist/src/providers/model-call.js +30 -5
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/scenes/activationAdapter.d.ts +19 -0
- package/dist/src/scenes/activationAdapter.js +1 -0
- package/dist/src/scenes/agentExecutor.js +3 -10
- package/dist/src/scenes/contracts.d.ts +3 -9
- package/dist/src/scenes/contracts.js +1 -0
- package/dist/src/scenes/execution.d.ts +9 -3
- package/dist/src/scenes/execution.js +12 -11
- package/dist/src/scenes/httpServices.d.ts +5 -2
- package/dist/src/scenes/mailContext.d.ts +4 -0
- package/dist/src/scenes/mailContext.js +9 -0
- package/dist/src/scenes/maintenance.js +1 -5
- package/dist/src/scenes/metrics.d.ts +0 -6
- package/dist/src/scenes/metrics.js +0 -11
- package/dist/src/scenes/registry.d.ts +11 -0
- package/dist/src/scenes/registry.js +28 -0
- package/dist/src/scenes/repository.d.ts +6 -3
- package/dist/src/scenes/repository.js +43 -5
- package/dist/src/scenes/service.d.ts +2 -1
- package/dist/src/scenes/service.js +9 -7
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +37 -7
- package/dist/src/scenes/taskFollowUp/contracts.js +36 -17
- package/dist/src/scenes/taskFollowUp/service.d.ts +35 -7
- package/dist/src/scenes/taskFollowUp/service.js +86 -28
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/scenes/userNotes.d.ts +3 -0
- package/dist/src/scenes/userNotes.js +6 -0
- package/dist/src/session/client-history.d.ts +3 -0
- package/dist/src/session/client-history.js +10 -5
- package/dist/src/session/manager.d.ts +1 -0
- package/dist/src/session/resolve-session.js +4 -3
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.d.ts +1 -0
- package/dist/src/session/store.js +3 -2
- package/dist/src/storage/sqlite/ai-usage-repository.d.ts +137 -0
- package/dist/src/storage/sqlite/ai-usage-repository.js +175 -0
- package/dist/src/storage/sqlite/connector-account-repository.js +7 -5
- package/dist/src/storage/sqlite/connector-repository.js +36 -34
- package/dist/src/storage/sqlite/index.d.ts +2 -2
- package/dist/src/storage/sqlite/index.js +3 -3
- package/dist/src/storage/sqlite/migrations/208_automation_management.sql +2 -0
- package/dist/src/storage/sqlite/migrations/209_automation_event_hub.sql +48 -0
- package/dist/src/storage/sqlite/migrations/210_remove_legacy_automation_timeout.sql +14 -0
- package/dist/src/storage/sqlite/migrations/211_automation_result_deliveries.sql +16 -0
- package/dist/src/storage/sqlite/migrations/212_automation_delivery_policy.sql +30 -0
- package/dist/src/storage/sqlite/migrations/213_automation_reliability_contract.sql +188 -0
- package/dist/src/storage/sqlite/migrations/214_ai_usage_ledger.sql +41 -0
- package/dist/src/storage/sqlite/migrations/215_scene_execution_adapters.sql +6 -0
- package/dist/src/storage/sqlite/migrations/216_remove_scene_model_usage.sql +1 -0
- package/dist/src/storage/sqlite/migrations/217_remove_legacy_memory_tables.sql +4 -0
- package/dist/src/storage/sqlite/migrations/218_core_relation_indexes.sql +26 -0
- package/dist/src/storage/sqlite/migrations/219_json_contracts.sql +123 -0
- package/dist/src/storage/sqlite/migrations/220_normalize_timestamps.sql +339 -0
- package/dist/src/storage/sqlite/migrations/221_ai_usage_retention_index.sql +2 -0
- package/dist/src/storage/sqlite/migrations/222_session_config_authority.sql +13 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +4 -4
- package/dist/src/storage/sqlite/row-mappers.d.ts +3 -7
- package/dist/src/storage/sqlite/row-mappers.js +6 -6
- package/dist/src/storage/sqlite/scenes-schema.d.ts +1 -1
- package/dist/src/storage/sqlite/scenes-schema.js +0 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +0 -52
- package/dist/src/storage/sqlite/schemas/scenes.sql +0 -7
- package/dist/src/storage/sqlite/session-input-repository.d.ts +8 -0
- package/dist/src/storage/sqlite/session-input-repository.js +18 -1
- package/dist/src/storage/sqlite/session-read-repository.d.ts +1 -1
- package/dist/src/storage/sqlite/session-read-repository.js +0 -1
- package/dist/src/storage/sqlite/session-repository.d.ts +0 -4
- package/dist/src/storage/sqlite/session-repository.js +8 -18
- package/dist/src/storage/sqlite/timestamps.d.ts +4 -0
- package/dist/src/storage/sqlite/timestamps.js +20 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +23 -15
- package/dist/src/storage/sqlite/user-trust-repository.js +4 -2
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.d.ts +1 -1
- package/dist/src/tasks/home-query-service.js +4 -3
- package/dist/src/tasks/task-contract-planner.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/usage/cost.d.ts +4 -0
- package/dist/src/usage/cost.js +28 -0
- package/dist/src/usage/recorder.d.ts +13 -0
- package/dist/src/usage/recorder.js +117 -0
- package/dist/src/usage/scenario-registry.d.ts +8 -0
- package/dist/src/usage/scenario-registry.js +117 -0
- package/dist/src/usage/types.d.ts +55 -0
- package/dist/src/usage/types.js +1 -0
- package/dist/src/user-context/config.d.ts +9 -0
- package/dist/src/user-context/config.js +13 -4
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/tts/summarize.js +1 -1
- package/dist/src/work-discovery/analyzer.js +2 -2
- package/dist/src/work-discovery/investigator.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +15 -2
- package/package.json +6 -6
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DgP5DEJF.js +0 -1
- package/dist/gateway/static/root/assets/agents-Bh4XNLyk.js +0 -70
- package/dist/gateway/static/root/assets/automations-workspace-C7VS-yb7.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-CC43CC43.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-sAZT4brT.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DPETQOfF.js +0 -8
- package/dist/gateway/static/root/assets/channels-CwA619os.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-l7goF6QS.js +0 -2
- package/dist/gateway/static/root/assets/home-page-DSaXXoLm.js +0 -1
- package/dist/gateway/static/root/assets/index-BEw0xrde.css +0 -1
- package/dist/gateway/static/root/assets/index-D99vN3es.js +0 -121
- package/dist/gateway/static/root/assets/local-app-workbench-page-rH33N8I9.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-RFDLaquR.js +0 -1
- package/dist/gateway/static/root/assets/messages-fmf0dnr4.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DI7CIjmM.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BkqnU-Jh.js +0 -8
- package/dist/gateway/static/root/assets/project-detail-page-BvvcTH2F.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DK316w9a.js +0 -2
- package/dist/gateway/static/root/assets/sessions-page-EIk8iJTK.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DcOsdz78.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BcaxGQLC.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Cb_CUL-U.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-Cvr1qUTW.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-VXfz3rE7.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-DDNDLdId.js +0 -6
- package/dist/src/automations/product-events.d.ts +0 -5
- package/dist/src/automations/product-events.js +0 -19
|
@@ -54,18 +54,54 @@ export type AutomationAction = {
|
|
|
54
54
|
kind: 'task_command';
|
|
55
55
|
taskId: string;
|
|
56
56
|
command: TaskCommand;
|
|
57
|
+
} | {
|
|
58
|
+
kind: 'system';
|
|
59
|
+
capability: 'home.advisor.refresh' | 'memory.temporal_sweep' | 'memory.daily_reconciliation' | 'memory.weekly_knowledge';
|
|
57
60
|
};
|
|
61
|
+
export type AutomationEditableField = 'enabled' | 'trigger';
|
|
62
|
+
export interface AutomationManagement {
|
|
63
|
+
owner: string;
|
|
64
|
+
editable: AutomationEditableField[];
|
|
65
|
+
runnable: boolean;
|
|
66
|
+
deletable: boolean;
|
|
67
|
+
}
|
|
58
68
|
export type AutomationConversationMode = 'new_session' | 'continuous';
|
|
59
69
|
export type AutomationNotificationPolicy = 'attention' | 'all' | 'none';
|
|
70
|
+
export type AutomationDeliveryDestination = {
|
|
71
|
+
key: string;
|
|
72
|
+
kind: 'gateway_event';
|
|
73
|
+
} | {
|
|
74
|
+
key: string;
|
|
75
|
+
kind: 'webhook';
|
|
76
|
+
endpoint: string;
|
|
77
|
+
secretId: string;
|
|
78
|
+
} | {
|
|
79
|
+
key: string;
|
|
80
|
+
kind: 'file';
|
|
81
|
+
targetId: string;
|
|
82
|
+
pathTemplate: string;
|
|
83
|
+
} | {
|
|
84
|
+
key: string;
|
|
85
|
+
kind: 'card';
|
|
86
|
+
channelId: string;
|
|
87
|
+
templateId: string;
|
|
88
|
+
};
|
|
89
|
+
export interface AutomationDeliveryPolicy {
|
|
90
|
+
notificationPolicy: AutomationNotificationPolicy;
|
|
91
|
+
destinations: AutomationDeliveryDestination[];
|
|
92
|
+
}
|
|
93
|
+
export interface AutomationRunDeliveryContext {
|
|
94
|
+
notificationPolicy: AutomationNotificationPolicy;
|
|
95
|
+
requiresAttention: boolean;
|
|
96
|
+
projectId?: string;
|
|
97
|
+
}
|
|
60
98
|
export interface AutomationReliability {
|
|
61
|
-
/** Overall run deadline. `timeoutSeconds` remains a read-only legacy fallback. */
|
|
62
99
|
executionTimeoutSeconds?: number;
|
|
63
|
-
timeoutSeconds?: number;
|
|
64
100
|
retryCount?: number;
|
|
65
101
|
maxConcurrentRuns?: number;
|
|
66
102
|
disableAfterConsecutiveFailures?: number;
|
|
67
103
|
}
|
|
68
|
-
export type AutomationRunPhase = 'queued' | 'action' | '
|
|
104
|
+
export type AutomationRunPhase = 'queued' | 'action' | 'cancelling' | 'completed';
|
|
69
105
|
export interface AutomationRunTermination {
|
|
70
106
|
reason: 'completed' | 'failed' | 'user_cancelled' | 'deadline_exceeded';
|
|
71
107
|
component?: 'automation' | 'agent_turn' | 'tool' | 'mcp' | 'process';
|
|
@@ -94,9 +130,9 @@ export interface Automation {
|
|
|
94
130
|
action: AutomationAction;
|
|
95
131
|
safety?: AutomationSafetyPolicy;
|
|
96
132
|
conversationMode: AutomationConversationMode;
|
|
97
|
-
|
|
98
|
-
completionWebhookUrl?: string;
|
|
133
|
+
delivery: AutomationDeliveryPolicy;
|
|
99
134
|
reliability?: AutomationReliability;
|
|
135
|
+
management?: AutomationManagement;
|
|
100
136
|
state: AutomationState;
|
|
101
137
|
createdAtMs: number;
|
|
102
138
|
updatedAtMs: number;
|
|
@@ -131,7 +167,7 @@ export interface AutomationRun {
|
|
|
131
167
|
rootRunId?: string;
|
|
132
168
|
readAtMs?: number;
|
|
133
169
|
}
|
|
134
|
-
export type AutomationRunEventType = 'run.queued' | 'run.started' | 'run.deadline_resolved' | 'run.cancel_requested' | 'run.cancel_confirmed' | 'run.cancellation_unconfirmed' | 'run.recovered' | 'action.started' | 'action.retry_scheduled' | 'action.completed' | 'action.failed' | '
|
|
170
|
+
export type AutomationRunEventType = 'run.queued' | 'run.started' | 'run.deadline_resolved' | 'run.cancel_requested' | 'run.cancel_confirmed' | 'run.cancellation_unconfirmed' | 'run.recovered' | 'action.started' | 'action.retry_scheduled' | 'action.completed' | 'action.failed' | 'run.completed';
|
|
135
171
|
export interface AutomationRunEvent {
|
|
136
172
|
id: string;
|
|
137
173
|
runId: string;
|
|
@@ -146,10 +182,60 @@ export interface AutomationProductEventRun {
|
|
|
146
182
|
triggerEvent: AutomationRunEvent;
|
|
147
183
|
}
|
|
148
184
|
export interface AutomationEvent {
|
|
185
|
+
id?: string;
|
|
149
186
|
type: string;
|
|
150
187
|
source?: string;
|
|
188
|
+
schemaVersion?: number;
|
|
189
|
+
subject?: {
|
|
190
|
+
kind: string;
|
|
191
|
+
id: string;
|
|
192
|
+
};
|
|
151
193
|
payload?: Record<string, unknown>;
|
|
152
194
|
occurredAtMs?: number;
|
|
195
|
+
correlationId?: string;
|
|
196
|
+
causationId?: string;
|
|
197
|
+
rootEventId?: string;
|
|
198
|
+
chainDepth?: number;
|
|
199
|
+
dedupeKey?: string;
|
|
200
|
+
trust?: 'system' | 'user' | 'connector' | 'untrusted_webhook';
|
|
201
|
+
}
|
|
202
|
+
export interface AutomationEventEnvelope extends AutomationEvent {
|
|
203
|
+
id: string;
|
|
204
|
+
source: string;
|
|
205
|
+
schemaVersion: number;
|
|
206
|
+
occurredAtMs: number;
|
|
207
|
+
ingestedAtMs: number;
|
|
208
|
+
correlationId: string;
|
|
209
|
+
rootEventId: string;
|
|
210
|
+
chainDepth: number;
|
|
211
|
+
trust: 'system' | 'user' | 'connector' | 'untrusted_webhook';
|
|
212
|
+
payload: Record<string, unknown>;
|
|
213
|
+
}
|
|
214
|
+
export type AutomationEventProjectionStatus = 'pending' | 'projecting' | 'retrying' | 'projected' | 'dead_letter';
|
|
215
|
+
export type AutomationEventDeliveryStatus = 'pending' | 'retrying' | 'queued' | 'completed' | 'failed' | 'cancelled' | 'skipped' | 'dead_letter';
|
|
216
|
+
export interface AutomationEventRecord {
|
|
217
|
+
event: AutomationEventEnvelope;
|
|
218
|
+
projectionStatus: AutomationEventProjectionStatus;
|
|
219
|
+
projectionAttempts: number;
|
|
220
|
+
projectionError?: string;
|
|
221
|
+
deliveries: Array<{
|
|
222
|
+
automationId: string;
|
|
223
|
+
status: AutomationEventDeliveryStatus;
|
|
224
|
+
runId?: string;
|
|
225
|
+
attempts: number;
|
|
226
|
+
lastError?: string;
|
|
227
|
+
}>;
|
|
228
|
+
}
|
|
229
|
+
export interface AutomationResultDeliveryRecord {
|
|
230
|
+
runId: string;
|
|
231
|
+
destinationKey: string;
|
|
232
|
+
kind: string;
|
|
233
|
+
status: 'pending' | 'delivering' | 'retrying' | 'delivered' | 'dead_letter';
|
|
234
|
+
attempts: number;
|
|
235
|
+
nextAttemptAtMs: number;
|
|
236
|
+
lastError?: string;
|
|
237
|
+
createdAtMs: number;
|
|
238
|
+
updatedAtMs: number;
|
|
153
239
|
}
|
|
154
240
|
export interface AutomationMetrics {
|
|
155
241
|
totalAutomations: number;
|
|
@@ -161,7 +247,73 @@ export interface AutomationMetrics {
|
|
|
161
247
|
name: string;
|
|
162
248
|
runAtMs: number;
|
|
163
249
|
};
|
|
250
|
+
pendingEvents: number;
|
|
251
|
+
oldestPendingEventAgeMs: number;
|
|
252
|
+
projectionDeadLetters: number;
|
|
253
|
+
pendingRunDeliveries: number;
|
|
254
|
+
runDeliveryDeadLetters: number;
|
|
255
|
+
pendingResultDeliveries: number;
|
|
256
|
+
resultDeliveryDeadLetters: number;
|
|
257
|
+
activeExecutions: number;
|
|
258
|
+
activeDeliveryLeases: number;
|
|
259
|
+
}
|
|
260
|
+
export type AutomationArtifact = {
|
|
261
|
+
id: string;
|
|
262
|
+
kind: 'text';
|
|
263
|
+
text: string;
|
|
264
|
+
mediaType: 'text/plain' | 'text/markdown';
|
|
265
|
+
} | {
|
|
266
|
+
id: string;
|
|
267
|
+
kind: 'json';
|
|
268
|
+
schema: string;
|
|
269
|
+
data: Record<string, unknown>;
|
|
270
|
+
} | {
|
|
271
|
+
id: string;
|
|
272
|
+
kind: 'file';
|
|
273
|
+
uri: string;
|
|
274
|
+
name: string;
|
|
275
|
+
mediaType: string;
|
|
276
|
+
bytes?: number;
|
|
277
|
+
sha256?: string;
|
|
278
|
+
} | {
|
|
279
|
+
id: string;
|
|
280
|
+
kind: 'card';
|
|
281
|
+
schema: string;
|
|
282
|
+
data: Record<string, unknown>;
|
|
283
|
+
} | {
|
|
284
|
+
id: string;
|
|
285
|
+
kind: 'reference';
|
|
286
|
+
resourceType: string;
|
|
287
|
+
resourceId: string;
|
|
288
|
+
url?: string;
|
|
289
|
+
};
|
|
290
|
+
export interface AutomationResultEnvelope {
|
|
291
|
+
schemaVersion: 1;
|
|
292
|
+
resultId: string;
|
|
293
|
+
runId: string;
|
|
294
|
+
automationId: string;
|
|
295
|
+
status: Extract<AutomationRunStatus, 'succeeded' | 'failed' | 'cancelled' | 'timeout'>;
|
|
296
|
+
summary?: string;
|
|
297
|
+
error?: {
|
|
298
|
+
code: string;
|
|
299
|
+
message: string;
|
|
300
|
+
retryable: boolean;
|
|
301
|
+
};
|
|
302
|
+
artifacts: AutomationArtifact[];
|
|
303
|
+
correlationId: string;
|
|
304
|
+
rootEventId: string;
|
|
305
|
+
createdAtMs: number;
|
|
306
|
+
completedAtMs: number;
|
|
164
307
|
}
|
|
308
|
+
export type AutomationRetrySafety = {
|
|
309
|
+
mode: 'never';
|
|
310
|
+
} | {
|
|
311
|
+
mode: 'idempotent';
|
|
312
|
+
key: 'run_id';
|
|
313
|
+
} | {
|
|
314
|
+
mode: 'transient_only';
|
|
315
|
+
classify: (error: unknown) => boolean;
|
|
316
|
+
};
|
|
165
317
|
export interface PrepareAutomationAgentSessionInput {
|
|
166
318
|
automationName?: string;
|
|
167
319
|
conversationId: string;
|
|
@@ -199,7 +351,16 @@ export interface AutomationDeps {
|
|
|
199
351
|
error?: string;
|
|
200
352
|
}>;
|
|
201
353
|
};
|
|
202
|
-
onRunCompleted?: (run: AutomationRun) => void
|
|
354
|
+
onRunCompleted?: (run: AutomationRun, context: AutomationRunDeliveryContext) => void | Promise<void>;
|
|
355
|
+
onEvent?: (event: AutomationEventEnvelope, signal?: AbortSignal) => void | Promise<void>;
|
|
356
|
+
onReliabilityAttention?: (input: {
|
|
357
|
+
phase: 'event_projection' | 'event_delivery' | 'result_delivery';
|
|
358
|
+
eventId?: string;
|
|
359
|
+
automationId?: string;
|
|
360
|
+
runId?: string;
|
|
361
|
+
destinationKey?: string;
|
|
362
|
+
error: string;
|
|
363
|
+
}) => void;
|
|
203
364
|
executeTaskCommand?: (input: {
|
|
204
365
|
taskId: string;
|
|
205
366
|
idempotencyKey: string;
|
|
@@ -210,6 +371,17 @@ export interface AutomationDeps {
|
|
|
210
371
|
reason?: string;
|
|
211
372
|
runId?: string;
|
|
212
373
|
};
|
|
374
|
+
executeSystemAction?: (input: {
|
|
375
|
+
capability: Extract<AutomationAction, {
|
|
376
|
+
kind: 'system';
|
|
377
|
+
}>['capability'];
|
|
378
|
+
automationId: string;
|
|
379
|
+
runId: string;
|
|
380
|
+
}) => Promise<{
|
|
381
|
+
summary?: string;
|
|
382
|
+
}> | {
|
|
383
|
+
summary?: string;
|
|
384
|
+
};
|
|
213
385
|
}
|
|
214
386
|
export interface AutomationActionTask {
|
|
215
387
|
status: 'succeeded' | 'failed' | 'timeout' | 'cancelled';
|
|
@@ -220,6 +392,7 @@ export interface AutomationActionTask {
|
|
|
220
392
|
model?: string;
|
|
221
393
|
deadlineAtMs?: number;
|
|
222
394
|
termination?: AutomationRunTermination;
|
|
395
|
+
artifacts?: AutomationArtifact[];
|
|
223
396
|
}
|
|
224
397
|
export interface AutomationActionExecutionHooks {
|
|
225
398
|
onRunPatch?: (patch: Partial<AutomationRun>) => void | Promise<void>;
|
|
@@ -151,10 +151,26 @@ export declare const AutomationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
151
151
|
outputDestinations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
152
152
|
}, z.core.$strip>;
|
|
153
153
|
}, z.core.$strip>], "type">;
|
|
154
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
155
|
+
kind: z.ZodLiteral<"system">;
|
|
156
|
+
capability: z.ZodEnum<{
|
|
157
|
+
"home.advisor.refresh": "home.advisor.refresh";
|
|
158
|
+
"memory.temporal_sweep": "memory.temporal_sweep";
|
|
159
|
+
"memory.daily_reconciliation": "memory.daily_reconciliation";
|
|
160
|
+
"memory.weekly_knowledge": "memory.weekly_knowledge";
|
|
161
|
+
}>;
|
|
154
162
|
}, z.core.$strict>], "kind">;
|
|
163
|
+
export declare const AutomationManagementSchema: z.ZodObject<{
|
|
164
|
+
owner: z.ZodString;
|
|
165
|
+
editable: z.ZodArray<z.ZodEnum<{
|
|
166
|
+
enabled: "enabled";
|
|
167
|
+
trigger: "trigger";
|
|
168
|
+
}>>;
|
|
169
|
+
runnable: z.ZodBoolean;
|
|
170
|
+
deletable: z.ZodBoolean;
|
|
171
|
+
}, z.core.$strict>;
|
|
155
172
|
export declare const AutomationReliabilitySchema: z.ZodObject<{
|
|
156
173
|
executionTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
157
|
-
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
158
174
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
159
175
|
maxConcurrentRuns: z.ZodOptional<z.ZodNumber>;
|
|
160
176
|
disableAfterConsecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
@@ -166,6 +182,32 @@ export declare const AutomationSafetyPolicySchema: z.ZodObject<{
|
|
|
166
182
|
auto_apply: "auto_apply";
|
|
167
183
|
}>;
|
|
168
184
|
}, z.core.$strict>;
|
|
185
|
+
export declare const AutomationDeliveryPolicySchema: z.ZodObject<{
|
|
186
|
+
notificationPolicy: z.ZodDefault<z.ZodEnum<{
|
|
187
|
+
attention: "attention";
|
|
188
|
+
all: "all";
|
|
189
|
+
none: "none";
|
|
190
|
+
}>>;
|
|
191
|
+
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
192
|
+
key: z.ZodString;
|
|
193
|
+
kind: z.ZodLiteral<"gateway_event">;
|
|
194
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
195
|
+
key: z.ZodString;
|
|
196
|
+
kind: z.ZodLiteral<"webhook">;
|
|
197
|
+
endpoint: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
198
|
+
secretId: z.ZodString;
|
|
199
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
200
|
+
key: z.ZodString;
|
|
201
|
+
kind: z.ZodLiteral<"file">;
|
|
202
|
+
targetId: z.ZodString;
|
|
203
|
+
pathTemplate: z.ZodString;
|
|
204
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
205
|
+
key: z.ZodString;
|
|
206
|
+
kind: z.ZodLiteral<"card">;
|
|
207
|
+
channelId: z.ZodString;
|
|
208
|
+
templateId: z.ZodString;
|
|
209
|
+
}, z.core.$strict>], "kind">>>;
|
|
210
|
+
}, z.core.$strict>;
|
|
169
211
|
export declare const AutomationStateSchema: z.ZodObject<{
|
|
170
212
|
nextRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
171
213
|
runningRunId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
@@ -328,6 +370,14 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
328
370
|
outputDestinations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
329
371
|
}, z.core.$strip>;
|
|
330
372
|
}, z.core.$strip>], "type">;
|
|
373
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
374
|
+
kind: z.ZodLiteral<"system">;
|
|
375
|
+
capability: z.ZodEnum<{
|
|
376
|
+
"home.advisor.refresh": "home.advisor.refresh";
|
|
377
|
+
"memory.temporal_sweep": "memory.temporal_sweep";
|
|
378
|
+
"memory.daily_reconciliation": "memory.daily_reconciliation";
|
|
379
|
+
"memory.weekly_knowledge": "memory.weekly_knowledge";
|
|
380
|
+
}>;
|
|
331
381
|
}, z.core.$strict>], "kind">;
|
|
332
382
|
safety: z.ZodOptional<z.ZodObject<{
|
|
333
383
|
mode: z.ZodEnum<{
|
|
@@ -340,19 +390,47 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
340
390
|
new_session: "new_session";
|
|
341
391
|
continuous: "continuous";
|
|
342
392
|
}>>;
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
393
|
+
delivery: z.ZodDefault<z.ZodObject<{
|
|
394
|
+
notificationPolicy: z.ZodDefault<z.ZodEnum<{
|
|
395
|
+
attention: "attention";
|
|
396
|
+
all: "all";
|
|
397
|
+
none: "none";
|
|
398
|
+
}>>;
|
|
399
|
+
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
400
|
+
key: z.ZodString;
|
|
401
|
+
kind: z.ZodLiteral<"gateway_event">;
|
|
402
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
403
|
+
key: z.ZodString;
|
|
404
|
+
kind: z.ZodLiteral<"webhook">;
|
|
405
|
+
endpoint: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
406
|
+
secretId: z.ZodString;
|
|
407
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
408
|
+
key: z.ZodString;
|
|
409
|
+
kind: z.ZodLiteral<"file">;
|
|
410
|
+
targetId: z.ZodString;
|
|
411
|
+
pathTemplate: z.ZodString;
|
|
412
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
413
|
+
key: z.ZodString;
|
|
414
|
+
kind: z.ZodLiteral<"card">;
|
|
415
|
+
channelId: z.ZodString;
|
|
416
|
+
templateId: z.ZodString;
|
|
417
|
+
}, z.core.$strict>], "kind">>>;
|
|
418
|
+
}, z.core.$strict>>;
|
|
349
419
|
reliability: z.ZodOptional<z.ZodObject<{
|
|
350
420
|
executionTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
351
|
-
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
352
421
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
353
422
|
maxConcurrentRuns: z.ZodOptional<z.ZodNumber>;
|
|
354
423
|
disableAfterConsecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
355
424
|
}, z.core.$strict>>;
|
|
425
|
+
management: z.ZodOptional<z.ZodObject<{
|
|
426
|
+
owner: z.ZodString;
|
|
427
|
+
editable: z.ZodArray<z.ZodEnum<{
|
|
428
|
+
enabled: "enabled";
|
|
429
|
+
trigger: "trigger";
|
|
430
|
+
}>>;
|
|
431
|
+
runnable: z.ZodBoolean;
|
|
432
|
+
deletable: z.ZodBoolean;
|
|
433
|
+
}, z.core.$strict>>;
|
|
356
434
|
state: z.ZodDefault<z.ZodObject<{
|
|
357
435
|
nextRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
358
436
|
runningRunId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
@@ -490,6 +568,14 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
490
568
|
outputDestinations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
491
569
|
}, z.core.$strip>;
|
|
492
570
|
}, z.core.$strip>], "type">;
|
|
571
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
572
|
+
kind: z.ZodLiteral<"system">;
|
|
573
|
+
capability: z.ZodEnum<{
|
|
574
|
+
"home.advisor.refresh": "home.advisor.refresh";
|
|
575
|
+
"memory.temporal_sweep": "memory.temporal_sweep";
|
|
576
|
+
"memory.daily_reconciliation": "memory.daily_reconciliation";
|
|
577
|
+
"memory.weekly_knowledge": "memory.weekly_knowledge";
|
|
578
|
+
}>;
|
|
493
579
|
}, z.core.$strict>], "kind">;
|
|
494
580
|
trigger: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
495
581
|
kind: z.ZodLiteral<"manual">;
|
|
@@ -528,19 +614,47 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
528
614
|
new_session: "new_session";
|
|
529
615
|
continuous: "continuous";
|
|
530
616
|
}>>;
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
617
|
+
delivery: z.ZodDefault<z.ZodObject<{
|
|
618
|
+
notificationPolicy: z.ZodDefault<z.ZodEnum<{
|
|
619
|
+
attention: "attention";
|
|
620
|
+
all: "all";
|
|
621
|
+
none: "none";
|
|
622
|
+
}>>;
|
|
623
|
+
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
624
|
+
key: z.ZodString;
|
|
625
|
+
kind: z.ZodLiteral<"gateway_event">;
|
|
626
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
627
|
+
key: z.ZodString;
|
|
628
|
+
kind: z.ZodLiteral<"webhook">;
|
|
629
|
+
endpoint: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
630
|
+
secretId: z.ZodString;
|
|
631
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
632
|
+
key: z.ZodString;
|
|
633
|
+
kind: z.ZodLiteral<"file">;
|
|
634
|
+
targetId: z.ZodString;
|
|
635
|
+
pathTemplate: z.ZodString;
|
|
636
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
637
|
+
key: z.ZodString;
|
|
638
|
+
kind: z.ZodLiteral<"card">;
|
|
639
|
+
channelId: z.ZodString;
|
|
640
|
+
templateId: z.ZodString;
|
|
641
|
+
}, z.core.$strict>], "kind">>>;
|
|
642
|
+
}, z.core.$strict>>;
|
|
537
643
|
reliability: z.ZodOptional<z.ZodObject<{
|
|
538
644
|
executionTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
539
|
-
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
540
645
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
541
646
|
maxConcurrentRuns: z.ZodOptional<z.ZodNumber>;
|
|
542
647
|
disableAfterConsecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
543
648
|
}, z.core.$strict>>;
|
|
649
|
+
management: z.ZodOptional<z.ZodObject<{
|
|
650
|
+
owner: z.ZodString;
|
|
651
|
+
editable: z.ZodArray<z.ZodEnum<{
|
|
652
|
+
enabled: "enabled";
|
|
653
|
+
trigger: "trigger";
|
|
654
|
+
}>>;
|
|
655
|
+
runnable: z.ZodBoolean;
|
|
656
|
+
deletable: z.ZodBoolean;
|
|
657
|
+
}, z.core.$strict>>;
|
|
544
658
|
id: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
545
659
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
546
660
|
state: z.ZodOptional<z.ZodObject<{
|
|
@@ -679,6 +793,14 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
679
793
|
outputDestinations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
680
794
|
}, z.core.$strip>;
|
|
681
795
|
}, z.core.$strip>], "type">;
|
|
796
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
797
|
+
kind: z.ZodLiteral<"system">;
|
|
798
|
+
capability: z.ZodEnum<{
|
|
799
|
+
"home.advisor.refresh": "home.advisor.refresh";
|
|
800
|
+
"memory.temporal_sweep": "memory.temporal_sweep";
|
|
801
|
+
"memory.daily_reconciliation": "memory.daily_reconciliation";
|
|
802
|
+
"memory.weekly_knowledge": "memory.weekly_knowledge";
|
|
803
|
+
}>;
|
|
682
804
|
}, z.core.$strict>], "kind">>;
|
|
683
805
|
trigger: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
684
806
|
kind: z.ZodLiteral<"manual">;
|
|
@@ -713,23 +835,51 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
713
835
|
auto_apply: "auto_apply";
|
|
714
836
|
}>;
|
|
715
837
|
}, z.core.$strict>>>;
|
|
716
|
-
completionWebhookUrl: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>>;
|
|
717
838
|
reliability: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
718
839
|
executionTimeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
719
|
-
timeoutSeconds: z.ZodOptional<z.ZodNumber>;
|
|
720
840
|
retryCount: z.ZodOptional<z.ZodNumber>;
|
|
721
841
|
maxConcurrentRuns: z.ZodOptional<z.ZodNumber>;
|
|
722
842
|
disableAfterConsecutiveFailures: z.ZodOptional<z.ZodNumber>;
|
|
723
843
|
}, z.core.$strict>>>;
|
|
844
|
+
management: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
845
|
+
owner: z.ZodString;
|
|
846
|
+
editable: z.ZodArray<z.ZodEnum<{
|
|
847
|
+
enabled: "enabled";
|
|
848
|
+
trigger: "trigger";
|
|
849
|
+
}>>;
|
|
850
|
+
runnable: z.ZodBoolean;
|
|
851
|
+
deletable: z.ZodBoolean;
|
|
852
|
+
}, z.core.$strict>>>;
|
|
724
853
|
conversationMode: z.ZodOptional<z.ZodEnum<{
|
|
725
854
|
new_session: "new_session";
|
|
726
855
|
continuous: "continuous";
|
|
727
856
|
}>>;
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
857
|
+
delivery: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
858
|
+
notificationPolicy: z.ZodDefault<z.ZodEnum<{
|
|
859
|
+
attention: "attention";
|
|
860
|
+
all: "all";
|
|
861
|
+
none: "none";
|
|
862
|
+
}>>;
|
|
863
|
+
destinations: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
864
|
+
key: z.ZodString;
|
|
865
|
+
kind: z.ZodLiteral<"gateway_event">;
|
|
866
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
867
|
+
key: z.ZodString;
|
|
868
|
+
kind: z.ZodLiteral<"webhook">;
|
|
869
|
+
endpoint: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
870
|
+
secretId: z.ZodString;
|
|
871
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
872
|
+
key: z.ZodString;
|
|
873
|
+
kind: z.ZodLiteral<"file">;
|
|
874
|
+
targetId: z.ZodString;
|
|
875
|
+
pathTemplate: z.ZodString;
|
|
876
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
877
|
+
key: z.ZodString;
|
|
878
|
+
kind: z.ZodLiteral<"card">;
|
|
879
|
+
channelId: z.ZodString;
|
|
880
|
+
templateId: z.ZodString;
|
|
881
|
+
}, z.core.$strict>], "kind">>>;
|
|
882
|
+
}, z.core.$strict>>>;
|
|
733
883
|
state: z.ZodOptional<z.ZodObject<{
|
|
734
884
|
nextRunAtMs: z.ZodOptional<z.ZodNumber>;
|
|
735
885
|
runningRunId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
@@ -6,6 +6,19 @@ import { CronExpressionParser } from "cron-parser";
|
|
|
6
6
|
init_src();
|
|
7
7
|
const nonEmptyString = z.string().trim().min(1);
|
|
8
8
|
const optionalTrimmedString = (max) => z.string().trim().max(max).nullish().transform((value) => value || void 0);
|
|
9
|
+
const httpsUrl = z.string().trim().min(1).max(2e3).transform((value, ctx) => {
|
|
10
|
+
try {
|
|
11
|
+
const parsed = new URL(value);
|
|
12
|
+
if (parsed.protocol !== "https:") throw new Error("unsupported protocol");
|
|
13
|
+
return parsed.toString();
|
|
14
|
+
} catch {
|
|
15
|
+
ctx.addIssue({
|
|
16
|
+
code: "custom",
|
|
17
|
+
message: "Webhook endpoint must be a valid HTTPS URL"
|
|
18
|
+
});
|
|
19
|
+
return z.NEVER;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
9
22
|
const AutomationScheduleSchema = z.discriminatedUnion("kind", [
|
|
10
23
|
z.object({
|
|
11
24
|
kind: z.literal("once"),
|
|
@@ -89,11 +102,25 @@ const AutomationActionSchema = z.discriminatedUnion("kind", [
|
|
|
89
102
|
kind: z.literal("task_command"),
|
|
90
103
|
taskId: nonEmptyString.max(200),
|
|
91
104
|
command: TaskCommandSchema
|
|
105
|
+
}).strict(),
|
|
106
|
+
z.object({
|
|
107
|
+
kind: z.literal("system"),
|
|
108
|
+
capability: z.enum([
|
|
109
|
+
"home.advisor.refresh",
|
|
110
|
+
"memory.temporal_sweep",
|
|
111
|
+
"memory.daily_reconciliation",
|
|
112
|
+
"memory.weekly_knowledge"
|
|
113
|
+
])
|
|
92
114
|
}).strict()
|
|
93
115
|
]);
|
|
116
|
+
const AutomationManagementSchema = z.object({
|
|
117
|
+
owner: nonEmptyString.max(100),
|
|
118
|
+
editable: z.array(z.enum(["enabled", "trigger"])).max(2),
|
|
119
|
+
runnable: z.boolean(),
|
|
120
|
+
deletable: z.boolean()
|
|
121
|
+
}).strict();
|
|
94
122
|
const AutomationReliabilitySchema = z.object({
|
|
95
123
|
executionTimeoutSeconds: z.number().int().min(1).max(86400).optional(),
|
|
96
|
-
timeoutSeconds: z.number().int().min(1).max(86400).optional(),
|
|
97
124
|
retryCount: z.number().int().min(0).max(10).optional(),
|
|
98
125
|
maxConcurrentRuns: z.number().int().min(1).max(20).optional(),
|
|
99
126
|
disableAfterConsecutiveFailures: z.number().int().min(1).max(100).optional()
|
|
@@ -103,6 +130,50 @@ const AutomationSafetyPolicySchema = z.object({ mode: z.enum([
|
|
|
103
130
|
"ask_before_apply",
|
|
104
131
|
"auto_apply"
|
|
105
132
|
]) }).strict();
|
|
133
|
+
const AutomationDeliveryPolicySchema = z.object({
|
|
134
|
+
notificationPolicy: z.enum([
|
|
135
|
+
"attention",
|
|
136
|
+
"all",
|
|
137
|
+
"none"
|
|
138
|
+
]).default("attention"),
|
|
139
|
+
destinations: z.array(z.discriminatedUnion("kind", [
|
|
140
|
+
z.object({
|
|
141
|
+
key: nonEmptyString.max(100),
|
|
142
|
+
kind: z.literal("gateway_event")
|
|
143
|
+
}).strict(),
|
|
144
|
+
z.object({
|
|
145
|
+
key: nonEmptyString.max(100),
|
|
146
|
+
kind: z.literal("webhook"),
|
|
147
|
+
endpoint: httpsUrl,
|
|
148
|
+
secretId: nonEmptyString.max(200)
|
|
149
|
+
}).strict(),
|
|
150
|
+
z.object({
|
|
151
|
+
key: nonEmptyString.max(100),
|
|
152
|
+
kind: z.literal("file"),
|
|
153
|
+
targetId: nonEmptyString.max(200),
|
|
154
|
+
pathTemplate: nonEmptyString.max(2e3)
|
|
155
|
+
}).strict(),
|
|
156
|
+
z.object({
|
|
157
|
+
key: nonEmptyString.max(100),
|
|
158
|
+
kind: z.literal("card"),
|
|
159
|
+
channelId: nonEmptyString.max(200),
|
|
160
|
+
templateId: nonEmptyString.max(200)
|
|
161
|
+
}).strict()
|
|
162
|
+
])).max(20).superRefine((destinations, ctx) => {
|
|
163
|
+
const keys = /* @__PURE__ */ new Set();
|
|
164
|
+
destinations.forEach((destination, index) => {
|
|
165
|
+
if (keys.has(destination.key)) ctx.addIssue({
|
|
166
|
+
code: "custom",
|
|
167
|
+
path: [index, "key"],
|
|
168
|
+
message: `Duplicate destination key: ${destination.key}`
|
|
169
|
+
});
|
|
170
|
+
keys.add(destination.key);
|
|
171
|
+
});
|
|
172
|
+
}).default([{
|
|
173
|
+
key: "gateway_event",
|
|
174
|
+
kind: "gateway_event"
|
|
175
|
+
}])
|
|
176
|
+
}).strict();
|
|
106
177
|
const AutomationStateSchema = z.object({
|
|
107
178
|
nextRunAtMs: z.number().int().nonnegative().optional(),
|
|
108
179
|
runningRunId: optionalTrimmedString(100),
|
|
@@ -129,13 +200,15 @@ const AutomationSchema = z.object({
|
|
|
129
200
|
action: AutomationActionSchema,
|
|
130
201
|
safety: AutomationSafetyPolicySchema.optional(),
|
|
131
202
|
conversationMode: z.enum(["new_session", "continuous"]).default("new_session"),
|
|
132
|
-
|
|
133
|
-
"attention",
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
203
|
+
delivery: AutomationDeliveryPolicySchema.default({
|
|
204
|
+
notificationPolicy: "attention",
|
|
205
|
+
destinations: [{
|
|
206
|
+
key: "gateway_event",
|
|
207
|
+
kind: "gateway_event"
|
|
208
|
+
}]
|
|
209
|
+
}),
|
|
138
210
|
reliability: AutomationReliabilitySchema.optional(),
|
|
211
|
+
management: AutomationManagementSchema.optional(),
|
|
139
212
|
state: AutomationStateSchema.default({}),
|
|
140
213
|
createdAtMs: z.number().int().nonnegative(),
|
|
141
214
|
updatedAtMs: z.number().int().nonnegative()
|
|
@@ -157,12 +230,8 @@ const UpdateAutomationSchema = AutomationSchema.omit({
|
|
|
157
230
|
updatedAtMs: true
|
|
158
231
|
}).extend({
|
|
159
232
|
conversationMode: z.enum(["new_session", "continuous"]),
|
|
160
|
-
|
|
161
|
-
"attention",
|
|
162
|
-
"all",
|
|
163
|
-
"none"
|
|
164
|
-
]),
|
|
233
|
+
delivery: AutomationDeliveryPolicySchema.optional(),
|
|
165
234
|
state: AutomationStateSchema
|
|
166
235
|
}).partial().refine((data) => Object.keys(data).length > 0, { message: "At least one field must be provided" });
|
|
167
236
|
//#endregion
|
|
168
|
-
export { AutomationActionSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, UpdateAutomationSchema };
|
|
237
|
+
export { AutomationActionSchema, AutomationDeliveryPolicySchema, AutomationManagementSchema, AutomationReliabilitySchema, AutomationSafetyPolicySchema, AutomationScheduleSchema, AutomationSchema, AutomationStateSchema, AutomationTriggerSchema, CreateAutomationSchema, UpdateAutomationSchema };
|