@xopcai/xopc 0.0.391 → 0.0.393
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/dist/sidepanel.js +1 -1
- 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-CzS0TUv9.js → agent-avatar-dicebear-1AF2KGju.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CPJr7NRR.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-cjJXJj_3.js +1 -0
- package/dist/gateway/static/root/assets/agents-DW3TlnIg.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-Bb3Kvz3X.js → agents-admin-api-B5aykqg_.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-BV_eGr7l.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-B_MFhXXU.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-TYGidVnd.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-DOkyvOF0.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DFnHPNie.js → archive-plugin-BrFfEp0u.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CnBLPVNh.js → automations-page-B7OofUPF.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DIod-bfm.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BQC0Tzoi.js → binary-plugins-BfAWnYG8.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DSh5019z.js → block-editor-_Y-QwZ-3.js} +5 -5
- package/dist/gateway/static/root/assets/browser-automation-inputs-DH9QHI9m.js +1 -0
- package/dist/gateway/static/root/assets/browser-automations-page-B_SnD9B0.js +3 -0
- package/dist/gateway/static/root/assets/browser-settings-page-BPlqYpMM.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-page-BtzZvMIK.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-pt2M56-E.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-WzoG3oBb.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-CFVx3iaZ.js +1 -0
- package/dist/gateway/static/root/assets/channels-BXA55GY2.js +1 -0
- package/dist/gateway/static/root/assets/chat-terminal-dock-D3GuiG3N.js +36 -0
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE--EKdQGRF.js → chunk-KS7C4IRE-B2HK1psj.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-CIbHDlp8.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-CDyCHkpK.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-DA2b6cJu.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-C424c_g9.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-BVJh9sYc.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-Q52A8vjp.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-CZr1CXxu.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-sprite-Bd-aOI7N.js +30 -0
- package/dist/gateway/static/root/assets/desktop-pet-sprite-BuB0g8zv.css +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-D_WWTsze.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-C6cUgrvg.js +1 -0
- package/dist/gateway/static/root/assets/echarts-runtime-tcHc9TOS.js +18 -0
- package/dist/gateway/static/root/assets/extension-debug-page-DyyfC4gA.js +1 -0
- package/dist/gateway/static/root/assets/extension-page-Dho9o3ZZ.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-CdnIGyCH.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-Dv_A5FMu.js → gateway-config-swr-BEePO3Wl.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-DghCGfY_.js → gateway-realtime-Dng_VOvI.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DtlBf7oH.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-D0KSQRNZ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CkTVSESs.js → gateway-startup-retry-CDCiy7Cd.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-DV2wNqBn.js → highlighted-body-KQOG7T2V-BNpj_mIM.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-CH_A0W29.js +2 -0
- package/dist/gateway/static/root/assets/image-generation-api-DwkO2y46.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-BrYvomnU.js +1 -0
- package/dist/gateway/static/root/assets/index-CKdOZoVu.js +260 -0
- package/dist/gateway/static/root/assets/index-Rxjt-jc3.css +1 -0
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-BveDYfYk.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-CcIi1BhT.js +1 -0
- package/dist/gateway/static/root/assets/local-apps-page-B1a69mlV.js +1 -0
- package/dist/gateway/static/root/assets/local-session-drafts-CYEDUPH7.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-BpK9AiDq.js → locale-store-CE7L6MlS.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Us1jv3C4.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-C9RAM7-s.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-PrKvVpRh.js +324 -0
- package/dist/gateway/static/root/assets/{media-plugins-oSChWbcP.js → media-plugins-CR1fp6IL.js} +1 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DQdcaMiu.js +1 -0
- package/dist/gateway/static/root/assets/messages-CaeL_miw.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-Q4yRx9iZ.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-C9qu16IN.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-Cn_WK68Y.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-DrP6hEcg.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-3NbiWGRG.js +1 -0
- package/dist/gateway/static/root/assets/product-delivery-DwmnNJvk.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-KKE5-V8k.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-content-BM0oqNxi.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-CPZrwf8n.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Besfx_07.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-Dsa2LvRt.js → registry-api-BO2Ck3aA.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CTDghL5L.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-C2Uw89eY.js → runtime-tools-api-B1sb8nlw.js} +1 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-W0X_Fy7b.js +1 -0
- package/dist/gateway/static/root/assets/schema-form-DNM2Zdyr.js +1 -0
- package/dist/gateway/static/root/assets/{session-api-ga-SUOq_.js → session-api-CaAUJvu1.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-DoFTlgNz.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-Dxtablvd.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C7zklouD.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-DCSHPFAN.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-DPCgrICd.js → settings-page-B18UbbaJ.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-JoSfluza.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-BLnS3hoH.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DcIuPJK3.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-CcYGkRPL.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-PnUZjoPK.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-D3JAw62U.js +2 -0
- package/dist/gateway/static/root/assets/style-BQqU-1pP.js +7 -0
- package/dist/gateway/static/root/assets/system-settings-panel-C974myUM.js +1 -0
- package/dist/gateway/static/root/assets/tab-completion-input-CxtEp0aP.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-CiljFekC.js +2 -0
- package/dist/gateway/static/root/assets/{task-expandable-content-DAZGz5YC.js → task-expandable-content-DTEVoNrM.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-DEE75MUn.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-DWyI3uA3.js +1 -0
- package/dist/gateway/static/root/assets/usage-page-DJYvbxk7.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-CY0YuljR.js +1 -0
- package/dist/gateway/static/root/assets/user-model-page-eHZJD6Fw.js +2 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-BNG4ixJE.js +1 -0
- package/dist/gateway/static/root/assets/{voice-config-api-Dl39b27p.js → voice-config-api-D0Wscn9W.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-CohIoAre.js +1 -0
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BXI8eyYh.js +3 -0
- package/dist/gateway/static/root/assets/workflows-page-CVti0u-l.js +6 -0
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-C_COnY_B.js +1 -0
- package/dist/gateway/static/root/index.html +22 -72
- package/dist/gateway/static/root/notification-sw.js +0 -15
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +8 -0
- package/dist/packages/gateway-contract/src/app-context.js +0 -1
- package/dist/packages/gateway-contract/src/capabilities.js +2 -249
- package/dist/packages/gateway-contract/src/home.js +0 -5
- package/dist/packages/gateway-contract/src/index.js +0 -4
- package/dist/packages/gateway-contract/src/notifications.js +0 -11
- package/dist/packages/gateway-contract/src/product-delivery.js +0 -2
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -0
- package/dist/src/agent/agent-manager.d.ts +1 -3
- package/dist/src/agent/agent-manager.js +8 -18
- package/dist/src/agent/child-agent-factory.d.ts +2 -1
- package/dist/src/agent/child-agent-factory.js +2 -1
- package/dist/src/agent/coding/projectEvidence.d.ts +9 -0
- package/dist/src/agent/coding/projectEvidence.js +177 -0
- package/dist/src/agent/coding/repository-instructions.d.ts +8 -1
- package/dist/src/agent/coding/repository-instructions.js +9 -4
- package/dist/src/agent/coding/run-verification.d.ts +17 -2
- package/dist/src/agent/coding/run-verification.js +82 -12
- package/dist/src/agent/coding/workspace-revision.js +1 -1
- package/dist/src/agent/embedded/codemode-extension.js +1 -1
- package/dist/src/agent/embedded/execution-context.d.ts +1 -0
- package/dist/src/agent/embedded/execution-context.js +4 -1
- package/dist/src/agent/embedded/external-tool-discovery.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -0
- package/dist/src/agent/embedded/run-turn.js +41 -5
- package/dist/src/agent/embedded/session-runner.js +1 -1
- package/dist/src/agent/embedded/session-tool-result-guard.js +5 -0
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +2 -1
- package/dist/src/agent/external-tools/extension-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/memory-provider.js +1 -1
- package/dist/src/agent/independent-execution.d.ts +2 -0
- package/dist/src/agent/independent-execution.js +12 -0
- package/dist/src/agent/mcp/connection-drafts.js +15 -10
- package/dist/src/agent/memory/compaction.js +1 -1
- package/dist/src/agent/orchestration/delegation-scope.d.ts +1 -0
- package/dist/src/agent/orchestration/delegation-scope.js +4 -1
- package/dist/src/agent/orchestration/loop-guard.js +6 -2
- package/dist/src/agent/prompt/sections/agent-identity.js +3 -2
- package/dist/src/agent/prompt/sections/behavior.d.ts +3 -2
- package/dist/src/agent/prompt/sections/behavior.js +35 -25
- package/dist/src/agent/prompt/sections/memory-skills.d.ts +1 -1
- package/dist/src/agent/prompt/sections/memory-skills.js +10 -11
- package/dist/src/agent/prompt/sections/messaging-runtime.d.ts +3 -2
- package/dist/src/agent/prompt/sections/messaging-runtime.js +21 -24
- package/dist/src/agent/prompt/sections/response-language.js +7 -5
- package/dist/src/agent/prompt/sections/tooling.js +11 -10
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -1
- package/dist/src/agent/prompt/system-prompt-params.d.ts +2 -1
- package/dist/src/agent/prompt/system-prompt-params.js +2 -0
- package/dist/src/agent/prompt/system-prompt.d.ts +2 -1
- package/dist/src/agent/prompt/system-prompt.js +21 -18
- package/dist/src/agent/prompt/types.d.ts +2 -0
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/service.types.d.ts +0 -2
- package/dist/src/agent/skills/format-skills-prompt.js +5 -2
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +9 -1
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +6 -48
- package/dist/src/agent/tools/computer-use-tool.js +17 -3
- package/dist/src/agent/tools/dataBatch.d.ts +1 -0
- package/dist/src/agent/tools/dataBatch.js +4 -1
- package/dist/src/agent/tools/delegate-tool.d.ts +1 -0
- package/dist/src/agent/tools/delegate-tool.js +1 -0
- package/dist/src/agent/tools/error-tracker.js +4 -2
- package/dist/src/agent/tools/exec-command.js +4 -3
- package/dist/src/agent/tools/factory.d.ts +1 -2
- package/dist/src/agent/tools/factory.js +20 -22
- package/dist/src/agent/tools/{delegation-parent-policy.d.ts → noninteractive-tool-policy.d.ts} +1 -1
- package/dist/src/agent/tools/{delegation-parent-policy.js → noninteractive-tool-policy.js} +4 -4
- package/dist/src/agent/tools/personal-task-tool.js +1 -1
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/search/cache.d.ts +3 -1
- package/dist/src/agent/tools/search/cache.js +4 -1
- package/dist/src/agent/tools/search/providers/deepseek-protocol.d.ts +9 -0
- package/dist/src/agent/tools/search/providers/deepseek-protocol.js +84 -0
- package/dist/src/agent/tools/search/providers/deepseek.d.ts +9 -0
- package/dist/src/agent/tools/search/providers/deepseek.js +55 -0
- package/dist/src/agent/tools/search/providers/xopc-cloud.d.ts +2 -1
- package/dist/src/agent/tools/search/providers/xopc-cloud.js +36 -1
- package/dist/src/agent/tools/search/registry.d.ts +1 -0
- package/dist/src/agent/tools/search/registry.js +32 -6
- package/dist/src/agent/tools/search/request-gate.d.ts +13 -0
- package/dist/src/agent/tools/search/request-gate.js +41 -0
- package/dist/src/agent/tools/search/resolve-config.js +1 -1
- package/dist/src/agent/tools/search/search-info.d.ts +8 -0
- package/dist/src/agent/tools/search/search-info.js +34 -0
- package/dist/src/agent/tools/search/types.d.ts +19 -1
- package/dist/src/agent/tools/toolExposure.d.ts +3 -0
- package/dist/src/agent/tools/toolExposure.js +25 -0
- package/dist/src/agent/tools/web.js +8 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +2 -4
- package/dist/src/agent/tools/xopc-use-tool.js +11 -135
- package/dist/src/agent/workflow/builtins/index.js +98 -0
- package/dist/src/agent/workflow/subagent-runner.d.ts +1 -0
- package/dist/src/agent/workflow/subagent-runner.js +3 -3
- package/dist/src/agent/workflow/types.d.ts +3 -2
- package/dist/src/agent/workflow/workflow-child-tools.js +13 -8
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -2
- package/dist/src/automations/domain/validation.d.ts +8 -8
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/automations/events/event-catalog.js +0 -18
- package/dist/src/backup/archive.js +1 -2
- package/dist/src/capabilities/runtime/app-context.js +2 -6
- package/dist/src/capabilities/runtime/product.d.ts +1 -3
- package/dist/src/capabilities/runtime/product.js +0 -6
- package/dist/src/cli/command-manifest.js +1 -1
- package/dist/src/cli/commands/search.d.ts +2 -2
- package/dist/src/cli/commands/search.js +8 -6
- package/dist/src/computer/config.d.ts +1 -0
- package/dist/src/computer/config.js +1 -0
- package/dist/src/computer/diagnostics.d.ts +223 -0
- package/dist/src/computer/diagnostics.js +360 -0
- package/dist/src/computer/errors.d.ts +1 -1
- package/dist/src/computer/errors.js +8 -1
- package/dist/src/computer/evaluation-comparison.d.ts +125 -0
- package/dist/src/computer/evaluation-comparison.js +65 -0
- package/dist/src/computer/evaluation-harness.d.ts +2 -1
- package/dist/src/computer/evaluation-harness.js +59 -8
- package/dist/src/computer/evaluation.d.ts +102 -7
- package/dist/src/computer/evaluation.js +64 -15
- package/dist/src/computer/flows.d.ts +62 -0
- package/dist/src/computer/flows.js +158 -0
- package/dist/src/computer/model-adapter.d.ts +11 -0
- package/dist/src/computer/model-adapter.js +156 -11
- package/dist/src/computer/model-policy.d.ts +1 -1
- package/dist/src/computer/model-policy.js +13 -6
- package/dist/src/computer/release-gate.d.ts +11 -0
- package/dist/src/computer/runtime.d.ts +27 -2
- package/dist/src/computer/runtime.js +261 -44
- package/dist/src/computer/semantic-actions.d.ts +3 -0
- package/dist/src/computer/semantic-actions.js +29 -0
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/models-json.d.ts +14 -8
- package/dist/src/config/models-json.js +2 -0
- package/dist/src/config/outbound-proxy.d.ts +11 -0
- package/dist/src/config/outbound-proxy.js +30 -0
- package/dist/src/config/rules.js +5 -0
- package/dist/src/config/schema.d.ts +25 -10
- package/dist/src/config/schema.js +21 -10
- package/dist/src/connectors/cli/authorization.d.ts +1 -1
- package/dist/src/connectors/cli/store.d.ts +1 -1
- package/dist/src/endpoint-tools/invocation-service.js +5 -0
- package/dist/src/gateway/config-tools-web.js +15 -4
- package/dist/src/gateway/gateway-workflow-host.types.d.ts +3 -0
- package/dist/src/gateway/hono/app.d.ts +0 -2
- package/dist/src/gateway/hono/app.js +1 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +6 -3
- package/dist/src/gateway/hono/lib/config-payload.js +5 -1
- package/dist/src/gateway/hono/routes/capability-operations.js +0 -7
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +7 -0
- package/dist/src/gateway/hono/routes/deps.d.ts +0 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +0 -8
- package/dist/src/gateway/hono/routes/models.js +5 -2
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -2
- package/dist/src/gateway/service/config-coordinator.d.ts +8 -5
- package/dist/src/gateway/service/session-input-coordinator.js +1 -1
- package/dist/src/gateway/service.d.ts +0 -3
- package/dist/src/gateway/service.js +10 -44
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/home-intelligence/policy.js +0 -5
- package/dist/src/home-intelligence/repository.d.ts +1 -1
- package/dist/src/infra/domain-outbox-dispatcher.js +1 -1
- package/dist/src/infra/http-proxy-env.d.ts +3 -0
- package/dist/src/infra/http-proxy-env.js +22 -2
- package/dist/src/notifications/service.d.ts +2 -18
- package/dist/src/notifications/service.js +8 -39
- package/dist/src/notifications/store.d.ts +0 -1
- package/dist/src/notifications/store.js +1 -4
- package/dist/src/personal-agent/communication.d.ts +2 -1
- package/dist/src/personal-agent/communication.js +11 -2
- package/dist/src/personal-agent/persona.d.ts +2 -1
- package/dist/src/personal-agent/persona.js +3 -2
- package/dist/src/personal-agent/prompts.d.ts +2 -0
- package/dist/src/personal-agent/prompts.js +69 -7
- package/dist/src/personal-agent/reply-composer.js +2 -2
- package/dist/src/personal-agent/reply-style.d.ts +4 -2
- package/dist/src/personal-agent/reply-style.js +19 -3
- package/dist/src/personal-agent/request-service.js +14 -9
- package/dist/src/pets/loopi-artwork.d.ts +2 -0
- package/dist/src/pets/loopi-artwork.js +36 -0
- package/dist/src/pets/pointer.d.ts +6 -0
- package/dist/src/pets/pointer.js +16 -0
- package/dist/src/platform/contracts.d.ts +3 -3
- package/dist/src/project-trust/trust-store.d.ts +5 -0
- package/dist/src/project-trust/trust-store.js +7 -1
- package/dist/src/providers/index.js +3 -3
- package/dist/src/providers/model-registry.js +2 -0
- package/dist/src/providers/model-supplements.d.ts +0 -2
- package/dist/src/providers/model-supplements.js +2 -18
- package/dist/src/providers/xopc-cloud-credit-budget.d.ts +1 -0
- package/dist/src/providers/xopc-cloud-credit-budget.js +4 -1
- package/dist/src/realtime/compact-run-event.js +17 -2
- package/dist/src/realtime/runtime.js +1 -1
- package/dist/src/routing/agent-session-key.js +1 -1
- package/dist/src/routing/resolve-route.js +1 -1
- package/dist/src/routing/session-key.js +1 -1
- package/dist/src/session/compact-history.js +16 -6
- package/dist/src/storage/sqlite/connection.js +2 -2
- package/dist/src/storage/sqlite/conversation-repository.js +1 -1
- package/dist/src/storage/sqlite/migrations/conversation-backup.d.ts +0 -2
- package/dist/src/storage/sqlite/migrations/conversation-backup.js +8 -18
- package/dist/src/storage/sqlite/migrations/conversation-windows-owners.js +28 -33
- package/dist/src/storage/sqlite/migrations/errors.js +1 -1
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +5 -40
- package/dist/src/storage/sqlite/migrations/types.d.ts +0 -2
- package/dist/src/storage/sqlite/schema.d.ts +1 -3
- package/dist/src/storage/sqlite/schema.js +4 -8
- package/dist/src/storage/sqlite/schema.sql +1356 -1282
- package/dist/src/tasks/capabilities/management.d.ts +2 -2
- package/dist/src/tasks/capabilities/relations.d.ts +4 -4
- package/dist/src/tasks/capabilities/write.d.ts +4 -4
- package/dist/src/tasks/task-allocation-service.js +51 -40
- package/dist/src/tasks/task-application-service.js +5 -1
- package/dist/src/tasks/task-contract-planner.js +21 -6
- package/dist/src/tasks/task-language.d.ts +2 -0
- package/dist/src/tasks/task-language.js +13 -2
- package/dist/src/tasks/task-research-result.d.ts +2 -2
- package/dist/src/tasks/task-run-coordinator.js +5 -1
- package/dist/src/tasks/task-run-dispatcher.js +2 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/usage/scenario-registry.js +0 -5
- package/dist/src/usage/types.d.ts +1 -1
- package/dist/src/work-discovery/probe.js +1 -1
- package/dist/src/workflows/domain/definition.d.ts +1 -0
- package/dist/src/workflows/service/workflow-run-service.js +2 -1
- package/package.json +10 -6
- package/skills/THIRD_PARTY_NOTICES.md +0 -6
- package/skills/creative/chat-charts/SKILL.md +26 -0
- package/skills/creative/chat-charts/references/bar-example.json +10 -0
- package/skills/creative/chat-charts/references/chart-spec.md +25 -0
- package/skills/creative/chat-charts/references/line-example.json +13 -0
- package/dist/gateway/static/root/assets/activity-YogQEteU.js +0 -1
- package/dist/gateway/static/root/assets/activity-store-DWQCDi8M.js +0 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DE910MyU.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-0SlvsYl7.js +0 -1
- package/dist/gateway/static/root/assets/agents-BZh28Qn1.js +0 -77
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +0 -1
- package/dist/gateway/static/root/assets/app-link-4gpFbdsr.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-9A7JN5V5.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-BPdLEo6L.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Cz7LypV9.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BBjS-sk-.js +0 -6
- package/dist/gateway/static/root/assets/browser-automation-inputs-C5tIrIRL.js +0 -1
- package/dist/gateway/static/root/assets/browser-automations-page-CFCMNfJN.js +0 -3
- package/dist/gateway/static/root/assets/browser-settings-page-C__tyPwu.js +0 -3
- package/dist/gateway/static/root/assets/button-aIC072nz.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-D6RJG4QY.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-DGEmBQnF.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-B5AZa7ir.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Dskz2_bh.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-xzjWZVbg.js +0 -1
- package/dist/gateway/static/root/assets/channels-DRse_dD3.js +0 -1
- package/dist/gateway/static/root/assets/chat-terminal-dock-CQF0M4kE.js +0 -36
- package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +0 -1
- package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +0 -1
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +0 -1
- package/dist/gateway/static/root/assets/circle-dashed-8qMD7gHf.js +0 -1
- package/dist/gateway/static/root/assets/circle-dot-BAseJTrF.js +0 -1
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-ZfzCTS0N.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-CwAeWVLK.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CanakKaj.js +0 -1
- package/dist/gateway/static/root/assets/copy-text-row-C7egVuKr.js +0 -1
- package/dist/gateway/static/root/assets/date-formatters-CUZAyDEg.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-hmJlEAQZ.js +0 -1
- package/dist/gateway/static/root/assets/dependency-picker-Us_Juz6I.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-CvOTI4uw.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DYg-Gb8t.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-sprite-BP6iMVw1.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-B1FbZ8C1.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-DZN9EDvM.js +0 -1
- package/dist/gateway/static/root/assets/dist-C3DSFZCi.js +0 -1
- package/dist/gateway/static/root/assets/electron-env-Dit0bHgy.js +0 -1
- package/dist/gateway/static/root/assets/extension-debug-page-YIibp6Kk.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-DkcGyb28.js +0 -1
- package/dist/gateway/static/root/assets/extension-provider-B1PQGTtY.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-C_rJiSKo.js +0 -1
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CMJVSnvi.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CjCWPHNJ.js +0 -1
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +0 -1
- package/dist/gateway/static/root/assets/home-page-fAYsd7kG.js +0 -2
- package/dist/gateway/static/root/assets/image-generation-api-B98iXt6A.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-DoBCBN8G.js +0 -1
- package/dist/gateway/static/root/assets/index-DFgXwLsv.js +0 -260
- package/dist/gateway/static/root/assets/index-a6ZvhclR.css +0 -1
- package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +0 -1
- package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +0 -1
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +0 -1
- package/dist/gateway/static/root/assets/keyboard-shortcuts-settings-DXVu4lqV.js +0 -1
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-B3fz6uRi.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-page-BC6xhmUh.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-DFnZQu9A.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CSqSFDRU.js +0 -2
- package/dist/gateway/static/root/assets/loopi-C09I2mNj.css +0 -1
- package/dist/gateway/static/root/assets/loopi-Djb8XU3l.js +0 -1
- package/dist/gateway/static/root/assets/management-settings-gq5L0THs.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-IsYTotu6.js +0 -324
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-C_QKwqDN.js +0 -1
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +0 -1
- package/dist/gateway/static/root/assets/messages-CKTo_sIF.js +0 -3
- package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +0 -1
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-TjpL7hZ5.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CdpNXre-.js +0 -5
- package/dist/gateway/static/root/assets/notes-api-CBb944yw.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-EGvGw8MN.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-CoWb7BYP.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-HLrKIjXH.js +0 -1
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-DYzbNTyN.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-DHC7J4lG.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BJU2fmPn.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-BAks11S4.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-CTyy7H7-.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-D4xqTaEy.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DIVCw0QQ.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B4L9VnBN.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-B8PvgLVz.js +0 -1
- package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +0 -1
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-Bqnp3tyt.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-D50g4GM2.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-h_RCNfiO.js +0 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +0 -1
- package/dist/gateway/static/root/assets/secret-input-BxWHx6J6.js +0 -1
- package/dist/gateway/static/root/assets/send-session-input-DypbVTT7.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-C_OiKblh.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-BsqDIbIr.js +0 -1
- package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-D3zJAW4p.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-num14vSv.js +0 -1
- package/dist/gateway/static/root/assets/settings-shell-dialog-layer-BU3UuiJr.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-jjSYJpDd.js +0 -1
- package/dist/gateway/static/root/assets/share-link-dialog-BGicglAS.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-BORe9rLB.js +0 -2
- package/dist/gateway/static/root/assets/shares-api-Dbx3z6-1.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-C13FgfWk.js +0 -1
- package/dist/gateway/static/root/assets/skeleton-BI5TyibZ.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-Cq6O1DZK.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Cq7QDjMA.js +0 -1
- package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BM1ShEjx.js +0 -2
- package/dist/gateway/static/root/assets/style-TIDOdKy0.js +0 -7
- package/dist/gateway/static/root/assets/system-settings-panel-BNCGFO1e.js +0 -1
- package/dist/gateway/static/root/assets/tab-completion-input-D64VNmiA.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-4VG82wcF.js +0 -2
- package/dist/gateway/static/root/assets/theme-store-Db7hDESt.js +0 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-C6p2Mu92.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-Dw15EJp0.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-DDrIqgGe.js +0 -1
- package/dist/gateway/static/root/assets/use-async-resource-GrnWNwMZ.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-DDjIdW4U.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-DNl7O3Vb.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-DMHehhwG.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-CaS9dOIr.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-ByAxHE4P.js +0 -1
- package/dist/gateway/static/root/assets/voice-transcribe-api-CVaU83Jc.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-BvVvPA1T.js +0 -1
- package/dist/gateway/static/root/assets/workflow-run-setup-panel-BcFm9QcC.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-DMec_XZB.js +0 -6
- package/dist/gateway/static/root/assets/workspace-api-BpfKsrtP.js +0 -2
- package/dist/gateway/static/root/assets/xopc-cloud-account-card-CU5lzzE9.js +0 -1
- package/dist/packages/gateway-contract/src/project-monitoring.js +0 -36
- package/dist/packages/gateway-contract/src/scenes.js +0 -200
- package/dist/src/agent/bootstrap/project-agents-context.d.ts +0 -2
- package/dist/src/agent/bootstrap/project-agents-context.js +0 -30
- package/dist/src/gateway/hono/routes/scenes.d.ts +0 -3
- package/dist/src/gateway/hono/routes/scenes.js +0 -271
- package/dist/src/gateway/scenes/browserNotifications.d.ts +0 -4
- package/dist/src/gateway/scenes/browserNotifications.js +0 -54
- package/dist/src/gateway/scenes/host.d.ts +0 -34
- package/dist/src/gateway/scenes/host.js +0 -154
- package/dist/src/gateway/scenes/mailContext.d.ts +0 -32
- package/dist/src/gateway/scenes/mailContext.js +0 -235
- package/dist/src/gateway/scenes/slackThreadSource.d.ts +0 -41
- package/dist/src/gateway/scenes/slackThreadSource.js +0 -168
- package/dist/src/notifications/browser-endpoint.d.ts +0 -2
- package/dist/src/notifications/browser-endpoint.js +0 -13
- package/dist/src/notifications/browserSubscriptions.d.ts +0 -20
- package/dist/src/notifications/browserSubscriptions.js +0 -59
- package/dist/src/notifications/browserTransport.d.ts +0 -9
- package/dist/src/notifications/browserTransport.js +0 -64
- package/dist/src/notifications/dispatch.d.ts +0 -46
- package/dist/src/notifications/dispatch.js +0 -109
- package/dist/src/notifications/domain-delivery.d.ts +0 -21
- package/dist/src/notifications/domain-delivery.js +0 -1
- package/dist/src/notifications/quietHours.d.ts +0 -6
- package/dist/src/notifications/quietHours.js +0 -23
- package/dist/src/notifications/resultOutbox.d.ts +0 -23
- package/dist/src/notifications/resultOutbox.js +0 -49
- package/dist/src/scenes/activationAdapter.d.ts +0 -19
- package/dist/src/scenes/activationAdapter.js +0 -1
- package/dist/src/scenes/agentExecutor.d.ts +0 -9
- package/dist/src/scenes/agentExecutor.js +0 -61
- package/dist/src/scenes/capabilities/read.d.ts +0 -3
- package/dist/src/scenes/capabilities/read.js +0 -187
- package/dist/src/scenes/capabilities/write.d.ts +0 -3
- package/dist/src/scenes/capabilities/write.js +0 -151
- package/dist/src/scenes/contracts.d.ts +0 -9
- package/dist/src/scenes/contracts.js +0 -61
- package/dist/src/scenes/execution.d.ts +0 -62
- package/dist/src/scenes/execution.js +0 -169
- package/dist/src/scenes/httpServices.d.ts +0 -39
- package/dist/src/scenes/httpServices.js +0 -1
- package/dist/src/scenes/inbox.d.ts +0 -17
- package/dist/src/scenes/inbox.js +0 -68
- package/dist/src/scenes/mailContext.d.ts +0 -24
- package/dist/src/scenes/mailContext.js +0 -115
- package/dist/src/scenes/mailObservations.d.ts +0 -20
- package/dist/src/scenes/mailObservations.js +0 -107
- package/dist/src/scenes/maintenance.d.ts +0 -3
- package/dist/src/scenes/maintenance.js +0 -20
- package/dist/src/scenes/metrics.d.ts +0 -31
- package/dist/src/scenes/metrics.js +0 -89
- package/dist/src/scenes/model.d.ts +0 -3
- package/dist/src/scenes/model.js +0 -10
- package/dist/src/scenes/notificationEligibility.d.ts +0 -17
- package/dist/src/scenes/notificationEligibility.js +0 -72
- package/dist/src/scenes/notificationPublication.d.ts +0 -7
- package/dist/src/scenes/notificationPublication.js +0 -43
- package/dist/src/scenes/preferences.d.ts +0 -19
- package/dist/src/scenes/preferences.js +0 -86
- package/dist/src/scenes/readiness.d.ts +0 -7
- package/dist/src/scenes/readiness.js +0 -20
- package/dist/src/scenes/registry.d.ts +0 -11
- package/dist/src/scenes/registry.js +0 -28
- package/dist/src/scenes/repository.d.ts +0 -178
- package/dist/src/scenes/repository.js +0 -782
- package/dist/src/scenes/resultNotifications.d.ts +0 -17
- package/dist/src/scenes/resultNotifications.js +0 -204
- package/dist/src/scenes/runtime.d.ts +0 -25
- package/dist/src/scenes/runtime.js +0 -101
- package/dist/src/scenes/schedule.d.ts +0 -2
- package/dist/src/scenes/schedule.js +0 -33
- package/dist/src/scenes/service.d.ts +0 -36
- package/dist/src/scenes/service.js +0 -122
- package/dist/src/scenes/taskFollowUp/agentExecutor.d.ts +0 -36
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +0 -149
- package/dist/src/scenes/taskFollowUp/branchInventory.d.ts +0 -38
- package/dist/src/scenes/taskFollowUp/branchInventory.js +0 -70
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +0 -121
- package/dist/src/scenes/taskFollowUp/contracts.js +0 -119
- package/dist/src/scenes/taskFollowUp/resources.d.ts +0 -19
- package/dist/src/scenes/taskFollowUp/resources.js +0 -97
- package/dist/src/scenes/taskFollowUp/service.d.ts +0 -848
- package/dist/src/scenes/taskFollowUp/service.js +0 -770
- package/dist/src/scenes/taskFollowUp/workspaceFingerprint.d.ts +0 -2
- package/dist/src/scenes/taskFollowUp/workspaceFingerprint.js +0 -46
- package/dist/src/scenes/templates.d.ts +0 -64
- package/dist/src/scenes/templates.js +0 -76
- package/dist/src/scenes/userNotes.d.ts +0 -13
- package/dist/src/scenes/userNotes.js +0 -40
- package/dist/src/storage/sqlite/migrations/166_remove_proactive_previews.sql +0 -1
- package/dist/src/storage/sqlite/migrations/167_discussion_recording_chunks.sql +0 -7
- package/dist/src/storage/sqlite/migrations/168_discussion_evidence.sql +0 -16
- package/dist/src/storage/sqlite/migrations/169_discussion_action_tasks.sql +0 -8
- package/dist/src/storage/sqlite/migrations/170_discussion_edits.sql +0 -8
- package/dist/src/storage/sqlite/migrations/171_discussion_recording_jobs.sql +0 -14
- package/dist/src/storage/sqlite/migrations/172_project_understanding.sql +0 -3
- package/dist/src/storage/sqlite/migrations/173_mobile_discussion_source.sql +0 -5
- package/dist/src/storage/sqlite/migrations/174_capability_imports.sql +0 -11
- package/dist/src/storage/sqlite/migrations/175_import_selections.sql +0 -8
- package/dist/src/storage/sqlite/migrations/176_proactive_quality.sql +0 -5
- package/dist/src/storage/sqlite/migrations/177_proactive_check_controls.sql +0 -25
- package/dist/src/storage/sqlite/migrations/178_conversation_uuid.sql +0 -2
- package/dist/src/storage/sqlite/migrations/179_harmonyos_devices.sql +0 -41
- package/dist/src/storage/sqlite/migrations/180_execution_environment_ownership.sql +0 -7
- package/dist/src/storage/sqlite/migrations/181_knowledge_item_status_events.sql +0 -12
- package/dist/src/storage/sqlite/migrations/182_connector_account_policies.sql +0 -92
- package/dist/src/storage/sqlite/migrations/183_connector_backend_consistency.sql +0 -20
- package/dist/src/storage/sqlite/migrations/184_memory_suppressions.sql +0 -12
- package/dist/src/storage/sqlite/migrations/185_understanding_refresh_batches.sql +0 -6
- package/dist/src/storage/sqlite/migrations/186_sidebar_layout.sql +0 -16
- package/dist/src/storage/sqlite/migrations/187_cli_connectors.sql +0 -34
- package/dist/src/storage/sqlite/migrations/188_scene_storage.sql +0 -2
- package/dist/src/storage/sqlite/migrations/189_scene_source_health.sql +0 -8
- package/dist/src/storage/sqlite/migrations/190_scene_development.sql +0 -37
- package/dist/src/storage/sqlite/migrations/191_scene_task_follow_up.sql +0 -27
- package/dist/src/storage/sqlite/migrations/192_capability_operations.sql +0 -20
- package/dist/src/storage/sqlite/migrations/193_note_file_cleanup.sql +0 -8
- package/dist/src/storage/sqlite/migrations/194_capability_external_outcomes.sql +0 -11
- package/dist/src/storage/sqlite/migrations/195_automation_deleted_revisions.sql +0 -4
- package/dist/src/storage/sqlite/migrations/196_automation_run_requests.sql +0 -23
- package/dist/src/storage/sqlite/migrations/197_note_deletion_cleanup.sql +0 -8
- package/dist/src/storage/sqlite/migrations/198_project_workspace_creation.sql +0 -7
- package/dist/src/storage/sqlite/migrations/199_scene_resource_events.sql +0 -488
- package/dist/src/storage/sqlite/migrations/200_connected_work_threads.sql +0 -92
- package/dist/src/storage/sqlite/migrations/201_connector_extraction_audit.sql +0 -127
- package/dist/src/storage/sqlite/migrations/202_chat_previews.sql +0 -26
- package/dist/src/storage/sqlite/migrations/203_remove_retired_proactive_contracts.sql +0 -70
- package/dist/src/storage/sqlite/migrations/204_home_intelligence.sql +0 -78
- package/dist/src/storage/sqlite/migrations/205_agent_catalog.sql +0 -66
- package/dist/src/storage/sqlite/migrations/206_home_advice_strategy_version.sql +0 -3
- package/dist/src/storage/sqlite/migrations/207_user_model_policy_contract.sql +0 -121
- package/dist/src/storage/sqlite/migrations/208_automation_management.sql +0 -2
- package/dist/src/storage/sqlite/migrations/209_automation_event_hub.sql +0 -48
- package/dist/src/storage/sqlite/migrations/210_remove_legacy_automation_timeout.sql +0 -14
- package/dist/src/storage/sqlite/migrations/211_automation_result_deliveries.sql +0 -16
- package/dist/src/storage/sqlite/migrations/212_automation_delivery_policy.sql +0 -30
- package/dist/src/storage/sqlite/migrations/213_automation_reliability_contract.sql +0 -188
- package/dist/src/storage/sqlite/migrations/214_ai_usage_ledger.sql +0 -41
- package/dist/src/storage/sqlite/migrations/215_scene_execution_adapters.sql +0 -6
- package/dist/src/storage/sqlite/migrations/216_remove_scene_model_usage.sql +0 -1
- package/dist/src/storage/sqlite/migrations/217_remove_legacy_memory_tables.sql +0 -4
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.d.ts +0 -8
- package/dist/src/storage/sqlite/migrations/conversation-key-decoder.js +0 -87
- package/dist/src/storage/sqlite/migrations/conversation-uuid.d.ts +0 -8
- package/dist/src/storage/sqlite/migrations/conversation-uuid.js +0 -366
- package/dist/src/storage/sqlite/migrations/scene-reset.d.ts +0 -5
- package/dist/src/storage/sqlite/migrations/scene-reset.js +0 -40
- package/dist/src/storage/sqlite/scenes-schema.d.ts +0 -8
- package/dist/src/storage/sqlite/scenes-schema.js +0 -60
- package/dist/src/storage/sqlite/schemas/notifications.sql +0 -65
- package/dist/src/storage/sqlite/schemas/scenes.sql +0 -205
- package/skills/engineering/design-recurring-work/SKILL.md +0 -75
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import { ProductReadContracts } from "../../../packages/gateway-contract/src/capabilities.js";
|
|
2
|
-
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
4
|
-
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
5
|
-
import { SceneNotFoundError } from "../repository.js";
|
|
6
|
-
//#region src/scenes/capabilities/read.ts
|
|
7
|
-
init_src();
|
|
8
|
-
function registerSceneReadCapabilities(dispatcher, getAccess) {
|
|
9
|
-
const policy = {
|
|
10
|
-
majorVersion: 1,
|
|
11
|
-
effect: "read",
|
|
12
|
-
surfaces: ["http", "agent"],
|
|
13
|
-
scopes: ["gateway.admin"]
|
|
14
|
-
};
|
|
15
|
-
const read = async (context, fn) => {
|
|
16
|
-
const access = getAccess(context);
|
|
17
|
-
if (!access) throw new CapabilityError("UNAVAILABLE", "Scene service is unavailable");
|
|
18
|
-
try {
|
|
19
|
-
return await fn(access);
|
|
20
|
-
} catch (error) {
|
|
21
|
-
if (error instanceof SceneNotFoundError) throw new CapabilityError("NOT_FOUND", "Scene not found");
|
|
22
|
-
throw error;
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
dispatcher.register(defineReadCapability({
|
|
26
|
-
...policy,
|
|
27
|
-
id: "xopc.scenes.mail_accounts",
|
|
28
|
-
description: "List eligible scene mail accounts under current account policy.",
|
|
29
|
-
...ProductReadContracts["xopc.scenes.mail_accounts"],
|
|
30
|
-
execute: (_input, context) => read(context, ({ services, principal }) => ({ accounts: services.mailDiscovery?.listAccounts(principal) ?? [] }))
|
|
31
|
-
}));
|
|
32
|
-
dispatcher.register(defineReadCapability({
|
|
33
|
-
...policy,
|
|
34
|
-
id: "xopc.scenes.mail_sources",
|
|
35
|
-
description: "List cached eligible mail source metadata without fetching message bodies.",
|
|
36
|
-
...ProductReadContracts["xopc.scenes.mail_sources"],
|
|
37
|
-
execute: ({ limit, afterId }, context) => read(context, ({ services, principal }) => {
|
|
38
|
-
const sources = services.mail.listSources(principal, limit, afterId);
|
|
39
|
-
return {
|
|
40
|
-
sources,
|
|
41
|
-
nextCursor: sources.length === limit ? sources.at(-1).id : null
|
|
42
|
-
};
|
|
43
|
-
})
|
|
44
|
-
}));
|
|
45
|
-
dispatcher.register(defineReadCapability({
|
|
46
|
-
...policy,
|
|
47
|
-
id: "xopc.scenes.results",
|
|
48
|
-
description: "List visible scene outcomes scoped to the trusted owner and workspace.",
|
|
49
|
-
...ProductReadContracts["xopc.scenes.results"],
|
|
50
|
-
execute: ({ limit, afterId, activationId }, context) => read(context, ({ services, principal }) => {
|
|
51
|
-
const outcomes = services.repository.listInbox(principal, limit, afterId, activationId ?? null);
|
|
52
|
-
return ProductReadContracts["xopc.scenes.results"].output.parse({
|
|
53
|
-
outcomes,
|
|
54
|
-
nextCursor: outcomes.length === limit ? outcomes.at(-1).id : null
|
|
55
|
-
});
|
|
56
|
-
})
|
|
57
|
-
}));
|
|
58
|
-
dispatcher.register(defineReadCapability({
|
|
59
|
-
...policy,
|
|
60
|
-
id: "xopc.scenes.get_presentation",
|
|
61
|
-
description: "Read one visible scene presentation.",
|
|
62
|
-
...ProductReadContracts["xopc.scenes.get_presentation"],
|
|
63
|
-
execute: ({ id }, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.get_presentation"].output.parse({ outcome: services.repository.getPresentation(principal, id) }))
|
|
64
|
-
}));
|
|
65
|
-
dispatcher.register(defineReadCapability({
|
|
66
|
-
...policy,
|
|
67
|
-
id: "xopc.scenes.get_feedback",
|
|
68
|
-
description: "Read feedback for an authorized scene presentation.",
|
|
69
|
-
...ProductReadContracts["xopc.scenes.get_feedback"],
|
|
70
|
-
execute: ({ id }, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.get_feedback"].output.parse({ feedback: services.inbox.getFeedback(principal, id) }))
|
|
71
|
-
}));
|
|
72
|
-
dispatcher.register(defineReadCapability({
|
|
73
|
-
...policy,
|
|
74
|
-
id: "xopc.scenes.digest_results",
|
|
75
|
-
description: "Read a page of authorized digest outcomes.",
|
|
76
|
-
...ProductReadContracts["xopc.scenes.digest_results"],
|
|
77
|
-
execute: ({ id, limit, afterId }, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.digest_results"].output.parse(services.repository.listDigestResults(principal, id, limit, afterId)))
|
|
78
|
-
}));
|
|
79
|
-
dispatcher.register(defineReadCapability({
|
|
80
|
-
...policy,
|
|
81
|
-
id: "xopc.scenes.metrics",
|
|
82
|
-
description: "Read owner-scoped scene usefulness metrics in an explicit time window.",
|
|
83
|
-
...ProductReadContracts["xopc.scenes.metrics"],
|
|
84
|
-
execute: ({ days }, context) => read(context, ({ services, principal }) => services.metrics.forUser(principal, days))
|
|
85
|
-
}));
|
|
86
|
-
dispatcher.register(defineReadCapability({
|
|
87
|
-
...policy,
|
|
88
|
-
id: "xopc.scenes.diagnostics",
|
|
89
|
-
description: "Read bounded scene queue and execution diagnostics.",
|
|
90
|
-
...ProductReadContracts["xopc.scenes.diagnostics"],
|
|
91
|
-
execute: (_input, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.diagnostics"].output.parse(services.metrics.diagnostics(principal)))
|
|
92
|
-
}));
|
|
93
|
-
dispatcher.register(defineReadCapability({
|
|
94
|
-
...policy,
|
|
95
|
-
id: "xopc.scenes.get_preferences",
|
|
96
|
-
description: "Read owner-scoped scene preferences without changing execution policy.",
|
|
97
|
-
...ProductReadContracts["xopc.scenes.get_preferences"],
|
|
98
|
-
execute: (_input, context) => read(context, ({ services, principal }) => services.preferences.get(principal))
|
|
99
|
-
}));
|
|
100
|
-
dispatcher.register(defineReadCapability({
|
|
101
|
-
...policy,
|
|
102
|
-
id: "xopc.scenes.preflight",
|
|
103
|
-
description: "Check scene setup and requested account/provider permissions without starting execution.",
|
|
104
|
-
...ProductReadContracts["xopc.scenes.preflight"],
|
|
105
|
-
execute: (input, context) => read(context, ({ services, principal }) => services.application.preflight(principal, input))
|
|
106
|
-
}));
|
|
107
|
-
dispatcher.register(defineReadCapability({
|
|
108
|
-
...policy,
|
|
109
|
-
id: "xopc.scenes.templates",
|
|
110
|
-
description: "List installed scene templates.",
|
|
111
|
-
...ProductReadContracts["xopc.scenes.templates"],
|
|
112
|
-
execute: (_input, context) => read(context, ({ services }) => ({ templates: services.repository.listTemplates() }))
|
|
113
|
-
}));
|
|
114
|
-
dispatcher.register(defineReadCapability({
|
|
115
|
-
...policy,
|
|
116
|
-
id: "xopc.scenes.get_template",
|
|
117
|
-
description: "Read an exact installed scene template version.",
|
|
118
|
-
...ProductReadContracts["xopc.scenes.get_template"],
|
|
119
|
-
execute: ({ key, version }, context) => read(context, ({ services }) => ({ template: services.repository.getTemplate(key, version) }))
|
|
120
|
-
}));
|
|
121
|
-
dispatcher.register(defineReadCapability({
|
|
122
|
-
...policy,
|
|
123
|
-
id: "xopc.scenes.list",
|
|
124
|
-
description: "List scenes within the trusted owner and workspace boundary.",
|
|
125
|
-
...ProductReadContracts["xopc.scenes.list"],
|
|
126
|
-
execute: ({ limit, afterId }, context) => read(context, ({ services, principal }) => {
|
|
127
|
-
const activations = services.repository.listActivations(principal, limit, afterId);
|
|
128
|
-
return {
|
|
129
|
-
activations,
|
|
130
|
-
nextCursor: activations.length === limit ? activations.at(-1).id : null
|
|
131
|
-
};
|
|
132
|
-
})
|
|
133
|
-
}));
|
|
134
|
-
dispatcher.register(defineReadCapability({
|
|
135
|
-
...policy,
|
|
136
|
-
id: "xopc.scenes.get",
|
|
137
|
-
description: "Read a scene and its runs and schedules under the same resource authorization.",
|
|
138
|
-
...ProductReadContracts["xopc.scenes.get"],
|
|
139
|
-
execute: ({ id }, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.get"].output.parse({
|
|
140
|
-
activation: services.repository.getActivation(principal, id),
|
|
141
|
-
runs: services.repository.listRuns(principal, id),
|
|
142
|
-
schedules: services.repository.listSchedules(principal, id)
|
|
143
|
-
}))
|
|
144
|
-
}));
|
|
145
|
-
dispatcher.register(defineReadCapability({
|
|
146
|
-
...policy,
|
|
147
|
-
id: "xopc.scenes.read_notes",
|
|
148
|
-
description: "Read scene notes at their stored revision.",
|
|
149
|
-
...ProductReadContracts["xopc.scenes.read_notes"],
|
|
150
|
-
execute: ({ id }, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.read_notes"].output.parse({ notes: services.repository.readNotes(principal, id) }))
|
|
151
|
-
}));
|
|
152
|
-
dispatcher.register(defineReadCapability({
|
|
153
|
-
...policy,
|
|
154
|
-
id: "xopc.scenes.list_runs",
|
|
155
|
-
description: "Page through runs belonging to an authorized scene.",
|
|
156
|
-
...ProductReadContracts["xopc.scenes.list_runs"],
|
|
157
|
-
execute: ({ id, limit, afterId }, context) => read(context, ({ services, principal }) => {
|
|
158
|
-
const runs = services.repository.listRuns(principal, id, limit, afterId);
|
|
159
|
-
return ProductReadContracts["xopc.scenes.list_runs"].output.parse({
|
|
160
|
-
runs,
|
|
161
|
-
nextCursor: runs.length === limit ? runs.at(-1).id : null
|
|
162
|
-
});
|
|
163
|
-
})
|
|
164
|
-
}));
|
|
165
|
-
dispatcher.register(defineReadCapability({
|
|
166
|
-
...policy,
|
|
167
|
-
id: "xopc.scenes.list_schedules",
|
|
168
|
-
description: "Read the schedules of an authorized scene.",
|
|
169
|
-
...ProductReadContracts["xopc.scenes.list_schedules"],
|
|
170
|
-
execute: ({ id }, context) => read(context, ({ services, principal }) => ProductReadContracts["xopc.scenes.list_schedules"].output.parse({ schedules: services.repository.listSchedules(principal, id) }))
|
|
171
|
-
}));
|
|
172
|
-
dispatcher.register(defineReadCapability({
|
|
173
|
-
...policy,
|
|
174
|
-
id: "xopc.scenes.list_work_items",
|
|
175
|
-
description: "Page through work items belonging to an authorized scene.",
|
|
176
|
-
...ProductReadContracts["xopc.scenes.list_work_items"],
|
|
177
|
-
execute: ({ id, limit, afterId }, context) => read(context, ({ services, principal }) => {
|
|
178
|
-
const workItems = services.repository.listWorkItems(principal, id, limit, afterId);
|
|
179
|
-
return ProductReadContracts["xopc.scenes.list_work_items"].output.parse({
|
|
180
|
-
workItems,
|
|
181
|
-
nextCursor: workItems.length === limit ? workItems.at(-1).id : null
|
|
182
|
-
});
|
|
183
|
-
})
|
|
184
|
-
}));
|
|
185
|
-
}
|
|
186
|
-
//#endregion
|
|
187
|
-
export { registerSceneReadCapabilities };
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { type CapabilityContext, type CapabilityDispatcher } from '../../capabilities/runtime/dispatcher.js';
|
|
2
|
-
import type { SceneAccess } from '../httpServices.js';
|
|
3
|
-
export declare function registerSceneWriteCapabilities(dispatcher: CapabilityDispatcher, getAccess: (context: CapabilityContext) => SceneAccess | undefined): void;
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
-
import { SceneWriteContracts } from "../../../packages/gateway-contract/src/capabilities.js";
|
|
3
|
-
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
4
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
5
|
-
import { defineAtomicCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
6
|
-
import { SceneConflictError, SceneInputError, SceneNotFoundError } from "../repository.js";
|
|
7
|
-
import { SceneSetupError } from "../service.js";
|
|
8
|
-
import { z } from "zod";
|
|
9
|
-
//#region src/scenes/capabilities/write.ts
|
|
10
|
-
init_src();
|
|
11
|
-
init_transaction();
|
|
12
|
-
function registerSceneWriteCapabilities(dispatcher, getAccess) {
|
|
13
|
-
const policy = {
|
|
14
|
-
majorVersion: 1,
|
|
15
|
-
effect: "local-write",
|
|
16
|
-
surfaces: ["http", "agent"],
|
|
17
|
-
scopes: ["gateway.admin"],
|
|
18
|
-
requestScope: (context) => {
|
|
19
|
-
const access = getAccess(context);
|
|
20
|
-
if (!access) throw new CapabilityError("UNAVAILABLE", "Scene service is unavailable");
|
|
21
|
-
return JSON.stringify([access.principal.ownerId, access.principal.workspaceId]);
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
const write = (context, fn) => {
|
|
25
|
-
const access = getAccess(context);
|
|
26
|
-
if (!access) throw new CapabilityError("UNAVAILABLE", "Scene service is unavailable");
|
|
27
|
-
if (access.services.application.database !== getSqliteDatabase()) throw new CapabilityError("UNAVAILABLE", "Scene writes require the operation database");
|
|
28
|
-
try {
|
|
29
|
-
return fn(access);
|
|
30
|
-
} catch (error) {
|
|
31
|
-
if (error instanceof SceneNotFoundError) throw new CapabilityError("NOT_FOUND", "Scene not found");
|
|
32
|
-
if (error instanceof SceneConflictError) throw new CapabilityError("REVISION_CONFLICT", error.message);
|
|
33
|
-
if (error instanceof SceneInputError || error instanceof z.ZodError) throw new CapabilityError("INVALID_INPUT", error.message);
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
const prepare = async (context, fn) => {
|
|
38
|
-
const access = getAccess(context);
|
|
39
|
-
if (!access) throw new CapabilityError("UNAVAILABLE", "Scene service is unavailable");
|
|
40
|
-
try {
|
|
41
|
-
await fn(access);
|
|
42
|
-
} catch (error) {
|
|
43
|
-
if (error instanceof SceneSetupError) {
|
|
44
|
-
const failure = new CapabilityError("INVALID_INPUT", error.message);
|
|
45
|
-
failure.cause = error;
|
|
46
|
-
throw failure;
|
|
47
|
-
}
|
|
48
|
-
if (error instanceof SceneNotFoundError) throw new CapabilityError("NOT_FOUND", "Scene not found");
|
|
49
|
-
if (error instanceof SceneConflictError) throw new CapabilityError("REVISION_CONFLICT", error.message);
|
|
50
|
-
throw error;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
dispatcher.register(defineAtomicCapability({
|
|
54
|
-
...policy,
|
|
55
|
-
id: "xopc.scenes.start",
|
|
56
|
-
description: "Start a scene after authorization and readiness checks, with an atomic durable receipt.",
|
|
57
|
-
...SceneWriteContracts["xopc.scenes.start"],
|
|
58
|
-
prepare: (input, context) => prepare(context, async ({ services, principal }) => {
|
|
59
|
-
const result = await services.application.preflight(principal, input);
|
|
60
|
-
if (!result.ready) throw new SceneSetupError(result.missing);
|
|
61
|
-
}),
|
|
62
|
-
execute: (input, context) => write(context, ({ services, principal }) => ({ activation: services.application.startAfterPreflight(principal, input, context.idempotencyKey) }))
|
|
63
|
-
}));
|
|
64
|
-
dispatcher.register(defineAtomicCapability({
|
|
65
|
-
...policy,
|
|
66
|
-
id: "xopc.scenes.transition",
|
|
67
|
-
description: "Transition a scene at its exact revision, checking readiness before activation.",
|
|
68
|
-
...SceneWriteContracts["xopc.scenes.transition"],
|
|
69
|
-
prepare: ({ id, ...input }, context) => prepare(context, ({ services, principal }) => services.application.prepareTransition(principal, id, input)),
|
|
70
|
-
execute: ({ id, ...input }, context) => write(context, ({ services, principal }) => ({ activation: services.application.transitionAfterPreflight(principal, id, input) }))
|
|
71
|
-
}));
|
|
72
|
-
dispatcher.register(defineAtomicCapability({
|
|
73
|
-
...policy,
|
|
74
|
-
id: "xopc.scenes.schedule",
|
|
75
|
-
description: "Update a scene schedule at its exact revision.",
|
|
76
|
-
...SceneWriteContracts["xopc.scenes.schedule"],
|
|
77
|
-
execute: ({ id, triggerKey, ...input }, context) => write(context, ({ services, principal }) => ({ revision: services.application.setSchedule(principal, id, triggerKey, input) }))
|
|
78
|
-
}));
|
|
79
|
-
dispatcher.register(defineAtomicCapability({
|
|
80
|
-
...policy,
|
|
81
|
-
id: "xopc.scenes.set_preferences",
|
|
82
|
-
description: "Update owner-scoped scene preferences at their exact revision.",
|
|
83
|
-
...SceneWriteContracts["xopc.scenes.set_preferences"],
|
|
84
|
-
execute: (input, context) => write(context, ({ services, principal }) => {
|
|
85
|
-
if (services.preferences.database !== getSqliteDatabase()) throw new CapabilityError("UNAVAILABLE", "Scene preferences require the operation database");
|
|
86
|
-
return services.preferences.update(principal, input);
|
|
87
|
-
})
|
|
88
|
-
}));
|
|
89
|
-
dispatcher.register(defineAtomicCapability({
|
|
90
|
-
...policy,
|
|
91
|
-
id: "xopc.scenes.feedback",
|
|
92
|
-
description: "Record an explicit user judgment at the exact feedback revision.",
|
|
93
|
-
...SceneWriteContracts["xopc.scenes.feedback"],
|
|
94
|
-
execute: ({ id, ...input }, context) => write(context, ({ services, principal }) => {
|
|
95
|
-
if (services.inbox.database !== getSqliteDatabase()) throw new CapabilityError("UNAVAILABLE", "Scene feedback requires the operation database");
|
|
96
|
-
return { revision: services.inbox.feedback(principal, id, input) };
|
|
97
|
-
})
|
|
98
|
-
}));
|
|
99
|
-
dispatcher.register(defineAtomicCapability({
|
|
100
|
-
...policy,
|
|
101
|
-
id: "xopc.scenes.mark_read",
|
|
102
|
-
description: "Set the read state of an actionable scene presentation once per request.",
|
|
103
|
-
...SceneWriteContracts["xopc.scenes.mark_read"],
|
|
104
|
-
execute: ({ id, read }, context) => write(context, ({ services, principal }) => {
|
|
105
|
-
if (services.inbox.database !== getSqliteDatabase()) throw new CapabilityError("UNAVAILABLE", "Scene presentation requires the operation database");
|
|
106
|
-
services.inbox.setRead(principal, id, read);
|
|
107
|
-
return {
|
|
108
|
-
ok: true,
|
|
109
|
-
presentationId: id,
|
|
110
|
-
read
|
|
111
|
-
};
|
|
112
|
-
})
|
|
113
|
-
}));
|
|
114
|
-
dispatcher.register(defineAtomicCapability({
|
|
115
|
-
...policy,
|
|
116
|
-
id: "xopc.scenes.configure",
|
|
117
|
-
description: "Configure a scene at an exact revision and invalidate prior pending work atomically.",
|
|
118
|
-
...SceneWriteContracts["xopc.scenes.configure"],
|
|
119
|
-
execute: ({ id, ...input }, context) => write(context, ({ services, principal }) => ({ activation: services.application.configure(principal, id, input) }))
|
|
120
|
-
}));
|
|
121
|
-
dispatcher.register(defineAtomicCapability({
|
|
122
|
-
...policy,
|
|
123
|
-
id: "xopc.scenes.check",
|
|
124
|
-
description: "Queue a scene check exactly once per request; this does not imply model execution completed.",
|
|
125
|
-
...SceneWriteContracts["xopc.scenes.check"],
|
|
126
|
-
execute: ({ id }, context) => write(context, ({ services, principal }) => ({ intentId: services.application.check(principal, id, context.idempotencyKey) }))
|
|
127
|
-
}));
|
|
128
|
-
dispatcher.register(defineAtomicCapability({
|
|
129
|
-
...policy,
|
|
130
|
-
id: "xopc.scenes.notes",
|
|
131
|
-
description: "Replace scene notes at an exact notes revision, canceling stale work in the same transaction.",
|
|
132
|
-
...SceneWriteContracts["xopc.scenes.notes"],
|
|
133
|
-
execute: ({ id, ...input }, context) => write(context, ({ services, principal }) => ({ revision: services.application.writeNotes(principal, id, input) }))
|
|
134
|
-
}));
|
|
135
|
-
dispatcher.register(defineAtomicCapability({
|
|
136
|
-
...policy,
|
|
137
|
-
id: "xopc.scenes.work_item",
|
|
138
|
-
description: "Create an authorized scene work item with a durable request receipt.",
|
|
139
|
-
...SceneWriteContracts["xopc.scenes.work_item"],
|
|
140
|
-
execute: ({ id, ...input }, context) => write(context, ({ services, principal }) => ({ workItem: services.application.createWorkItem(principal, id, input) }))
|
|
141
|
-
}));
|
|
142
|
-
dispatcher.register(defineAtomicCapability({
|
|
143
|
-
...policy,
|
|
144
|
-
id: "xopc.scenes.update_work_item",
|
|
145
|
-
description: "Edit an authorized scene work item at its exact revision.",
|
|
146
|
-
...SceneWriteContracts["xopc.scenes.update_work_item"],
|
|
147
|
-
execute: ({ id, ...input }, context) => write(context, ({ services, principal }) => ({ workItem: services.application.updateWorkItem(principal, id, input) }))
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
150
|
-
//#endregion
|
|
151
|
-
export { registerSceneWriteCapabilities };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { sceneOutcomeKinds, activationStatuses, sceneScopeSchema, sceneTemplateSchema, scenePermissionSchema, sceneNotesSchema, activationInputSchema, type ActivationStatus, type SceneScope, type SceneTemplate, type ScenePrincipal, type ScenePermission, type ActivationInput, type SceneActivation, } from '@xopcai/gateway-contract';
|
|
2
|
-
import { type SceneTemplate, type ScenePermission, type ActivationStatus } from '@xopcai/gateway-contract';
|
|
3
|
-
/** Stable JSON hashing binds approvals and immutable versions to exact content. */
|
|
4
|
-
export declare function sceneContentHash(value: unknown): string;
|
|
5
|
-
export declare function validateTemplate(value: unknown, registered: Pick<ScenePermission, 'contextProviders' | 'effectHandlers'> & {
|
|
6
|
-
executionAdapters?: string[];
|
|
7
|
-
}): SceneTemplate;
|
|
8
|
-
export declare function intersectPermissions(...permissions: ScenePermission[]): ScenePermission;
|
|
9
|
-
export declare function canTransitionActivation(from: ActivationStatus, to: ActivationStatus): boolean;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { activationInputSchema, activationStatuses, sceneNotesSchema, sceneOutcomeKinds, scenePermissionSchema, sceneScopeSchema, sceneTemplateSchema } from "../../packages/gateway-contract/src/scenes.js";
|
|
2
|
-
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { createHash } from "node:crypto";
|
|
4
|
-
//#region src/scenes/contracts.ts
|
|
5
|
-
init_src();
|
|
6
|
-
/** Stable JSON hashing binds approvals and immutable versions to exact content. */
|
|
7
|
-
function sceneContentHash(value) {
|
|
8
|
-
const canonical = (item) => {
|
|
9
|
-
if (item === null || typeof item === "string" || typeof item === "boolean") return JSON.stringify(item);
|
|
10
|
-
if (typeof item === "number" && Number.isFinite(item)) return JSON.stringify(item);
|
|
11
|
-
if (Array.isArray(item)) return `[${item.map(canonical).join(",")}]`;
|
|
12
|
-
if (typeof item === "object" && Object.getPrototypeOf(item) === Object.prototype) return `{${Object.keys(item).sort().map((key) => `${JSON.stringify(key)}:${canonical(item[key])}`).join(",")}}`;
|
|
13
|
-
throw new Error("Scene content must be finite JSON");
|
|
14
|
-
};
|
|
15
|
-
return createHash("sha256").update(canonical(value)).digest("hex");
|
|
16
|
-
}
|
|
17
|
-
function validateTemplate(value, registered) {
|
|
18
|
-
const template = sceneTemplateSchema.parse(value);
|
|
19
|
-
for (const provider of template.contextProviders) if (!registered.contextProviders.includes(provider)) throw new Error(`Unknown scene context provider: ${provider}`);
|
|
20
|
-
for (const handler of template.allowedEffectHandlers) if (!registered.effectHandlers.includes(handler)) throw new Error(`Unknown scene effect handler: ${handler}`);
|
|
21
|
-
if (registered.executionAdapters && !registered.executionAdapters.includes(template.execution.kind)) throw new Error(`Unknown scene execution adapter: ${template.execution.kind}`);
|
|
22
|
-
return template;
|
|
23
|
-
}
|
|
24
|
-
function intersectPermissions(...permissions) {
|
|
25
|
-
if (permissions.length === 0) return {
|
|
26
|
-
accountIds: [],
|
|
27
|
-
contextProviders: [],
|
|
28
|
-
effectHandlers: []
|
|
29
|
-
};
|
|
30
|
-
const common = (key) => [...new Set(permissions[0][key])].filter((id) => permissions.every((permission) => permission[key].includes(id))).sort();
|
|
31
|
-
return {
|
|
32
|
-
accountIds: common("accountIds"),
|
|
33
|
-
contextProviders: common("contextProviders"),
|
|
34
|
-
effectHandlers: common("effectHandlers")
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function canTransitionActivation(from, to) {
|
|
38
|
-
return {
|
|
39
|
-
needs_setup: [
|
|
40
|
-
"active",
|
|
41
|
-
"paused",
|
|
42
|
-
"archived"
|
|
43
|
-
],
|
|
44
|
-
active: [
|
|
45
|
-
"needs_setup",
|
|
46
|
-
"paused",
|
|
47
|
-
"completed",
|
|
48
|
-
"archived"
|
|
49
|
-
],
|
|
50
|
-
paused: [
|
|
51
|
-
"needs_setup",
|
|
52
|
-
"active",
|
|
53
|
-
"completed",
|
|
54
|
-
"archived"
|
|
55
|
-
],
|
|
56
|
-
completed: ["archived"],
|
|
57
|
-
archived: []
|
|
58
|
-
}[from].includes(to);
|
|
59
|
-
}
|
|
60
|
-
//#endregion
|
|
61
|
-
export { activationInputSchema, activationStatuses, canTransitionActivation, intersectPermissions, sceneContentHash, sceneNotesSchema, sceneOutcomeKinds, scenePermissionSchema, sceneScopeSchema, sceneTemplateSchema, validateTemplate };
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import type { AiUsageContext } from '../usage/types.js';
|
|
3
|
-
import { type SceneActivation, type ScenePermission, type SceneTemplate } from './contracts.js';
|
|
4
|
-
import { SceneRepository } from './repository.js';
|
|
5
|
-
import { SceneCapabilityRegistry } from './registry.js';
|
|
6
|
-
export declare const readOnlyResultSchema: z.ZodObject<{
|
|
7
|
-
kind: z.ZodEnum<{
|
|
8
|
-
decision: "decision";
|
|
9
|
-
artifact: "artifact";
|
|
10
|
-
observation: "observation";
|
|
11
|
-
no_change: "no_change";
|
|
12
|
-
}>;
|
|
13
|
-
summary: z.ZodString;
|
|
14
|
-
evidenceIds: z.ZodArray<z.ZodString>;
|
|
15
|
-
}, z.core.$strict>;
|
|
16
|
-
export type ReadOnlySceneResult = z.infer<typeof readOnlyResultSchema>;
|
|
17
|
-
export interface SceneEvidence {
|
|
18
|
-
id: string;
|
|
19
|
-
subjectId: string;
|
|
20
|
-
ownerId: string;
|
|
21
|
-
workspaceId: string;
|
|
22
|
-
accountId?: string;
|
|
23
|
-
projectId?: string;
|
|
24
|
-
conversationId?: string;
|
|
25
|
-
revision: string;
|
|
26
|
-
occurredAt?: number;
|
|
27
|
-
freshUntil: number;
|
|
28
|
-
content: string;
|
|
29
|
-
}
|
|
30
|
-
export interface SceneContextProvider {
|
|
31
|
-
id: string;
|
|
32
|
-
setupIssues?(activation: SceneActivation): string[];
|
|
33
|
-
authorization?(activation: SceneActivation): string[] | null;
|
|
34
|
-
tracksHealth?: boolean;
|
|
35
|
-
requiresAccountIdentity?: boolean;
|
|
36
|
-
read(input: {
|
|
37
|
-
activation: SceneActivation;
|
|
38
|
-
subjectId: string;
|
|
39
|
-
permissions: ScenePermission;
|
|
40
|
-
notBefore?: number;
|
|
41
|
-
signal: AbortSignal;
|
|
42
|
-
}): Promise<SceneEvidence[]>;
|
|
43
|
-
}
|
|
44
|
-
export interface SceneReadOnlyExecutor {
|
|
45
|
-
execute(input: {
|
|
46
|
-
template: SceneTemplate;
|
|
47
|
-
goal: string;
|
|
48
|
-
evidence: SceneEvidence[];
|
|
49
|
-
signal: AbortSignal;
|
|
50
|
-
usage: AiUsageContext;
|
|
51
|
-
}): Promise<unknown>;
|
|
52
|
-
}
|
|
53
|
-
/** Runs one durable claim without exposing messaging, filesystem or write tools. */
|
|
54
|
-
export declare class SceneExecutionService {
|
|
55
|
-
private readonly repository;
|
|
56
|
-
private readonly providers;
|
|
57
|
-
private readonly executor;
|
|
58
|
-
private readonly authorize;
|
|
59
|
-
private readonly clock;
|
|
60
|
-
constructor(repository: SceneRepository, providers: SceneCapabilityRegistry<SceneContextProvider>, executor: SceneReadOnlyExecutor, authorize: (activation: SceneActivation) => Promise<ScenePermission>, clock?: () => number);
|
|
61
|
-
runNext(worker: string, outerSignal?: AbortSignal): Promise<'idle' | 'completed' | 'discarded' | 'failed' | 'deferred'>;
|
|
62
|
-
}
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { intersectPermissions, sceneContentHash } from "./contracts.js";
|
|
2
|
-
import { SceneSourceNotReady, sceneSourceFailureReason } from "./readiness.js";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
//#region src/scenes/execution.ts
|
|
5
|
-
const readOnlyResultSchema = z.strictObject({
|
|
6
|
-
kind: z.enum([
|
|
7
|
-
"no_change",
|
|
8
|
-
"observation",
|
|
9
|
-
"artifact",
|
|
10
|
-
"decision"
|
|
11
|
-
]),
|
|
12
|
-
summary: z.string().max(32e3),
|
|
13
|
-
evidenceIds: z.array(z.string().min(1)).max(100)
|
|
14
|
-
}).refine((result) => result.kind === "no_change" || result.summary.trim().length > 0 && result.evidenceIds.length > 0, "A useful result requires evidence");
|
|
15
|
-
var SceneExecutionRejected = class extends Error {
|
|
16
|
-
constructor(reason) {
|
|
17
|
-
super(reason);
|
|
18
|
-
this.reason = reason;
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
function evidenceAllowed(item, activation, permissions, now) {
|
|
22
|
-
if (!item.id || !item.revision || !Number.isFinite(item.freshUntil) || item.freshUntil <= now) return false;
|
|
23
|
-
if (item.ownerId !== activation.ownerId || item.workspaceId !== activation.workspaceId) return false;
|
|
24
|
-
if (item.accountId !== void 0 && !permissions.accountIds.includes(item.accountId)) return false;
|
|
25
|
-
const scope = activation.scope;
|
|
26
|
-
if (scope.kind === "objects") return scope.ids.includes(item.subjectId);
|
|
27
|
-
if (scope.kind === "project") return item.projectId === scope.id;
|
|
28
|
-
if (scope.kind === "conversation") return item.conversationId === scope.id;
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
/** Runs one durable claim without exposing messaging, filesystem or write tools. */
|
|
32
|
-
var SceneExecutionService = class {
|
|
33
|
-
constructor(repository, providers, executor, authorize, clock = Date.now) {
|
|
34
|
-
this.repository = repository;
|
|
35
|
-
this.providers = providers;
|
|
36
|
-
this.executor = executor;
|
|
37
|
-
this.authorize = authorize;
|
|
38
|
-
this.clock = clock;
|
|
39
|
-
}
|
|
40
|
-
async runNext(worker, outerSignal) {
|
|
41
|
-
outerSignal?.throwIfAborted();
|
|
42
|
-
const claim = this.repository.claimNext(worker, this.clock(), 62e4);
|
|
43
|
-
if (!claim) return "idle";
|
|
44
|
-
const runInput = this.repository.getRunInput(claim, this.clock());
|
|
45
|
-
if (!runInput) return "discarded";
|
|
46
|
-
const { activation, subjectId, accountId, notBefore } = runInput;
|
|
47
|
-
const template = this.repository.getTemplate(activation.templateKey, activation.templateVersion);
|
|
48
|
-
if (template.execution.kind !== "agent") throw new SceneExecutionRejected("executor_unavailable");
|
|
49
|
-
if (!this.repository.renewLease(claim, this.clock(), template.execution.limits.timeoutSeconds * 1e3 + 5e3)) return "discarded";
|
|
50
|
-
const controller = new AbortController();
|
|
51
|
-
const abort = () => controller.abort(outerSignal?.reason);
|
|
52
|
-
outerSignal?.addEventListener("abort", abort, { once: true });
|
|
53
|
-
if (outerSignal?.aborted) abort();
|
|
54
|
-
const timeout = setTimeout(() => controller.abort(/* @__PURE__ */ new Error("Scene execution timed out")), template.execution.limits.timeoutSeconds * 1e3);
|
|
55
|
-
let stopWaiting;
|
|
56
|
-
const aborted = new Promise((_, reject) => {
|
|
57
|
-
const listener = () => reject(controller.signal.reason ?? /* @__PURE__ */ new Error("Scene execution aborted"));
|
|
58
|
-
controller.signal.addEventListener("abort", listener, { once: true });
|
|
59
|
-
stopWaiting = () => controller.signal.removeEventListener("abort", listener);
|
|
60
|
-
if (controller.signal.aborted) listener();
|
|
61
|
-
});
|
|
62
|
-
const assertCurrent = () => {
|
|
63
|
-
controller.signal.throwIfAborted();
|
|
64
|
-
if (!this.repository.getRunInput(claim, this.clock())) throw new SceneExecutionRejected("activation_changed");
|
|
65
|
-
};
|
|
66
|
-
const readContext = async () => {
|
|
67
|
-
assertCurrent();
|
|
68
|
-
let granted;
|
|
69
|
-
try {
|
|
70
|
-
granted = await this.authorize(activation);
|
|
71
|
-
} catch (error) {
|
|
72
|
-
if (template.contextProviders.some((id) => this.providers.get(id).tracksHealth)) this.repository.recordSourceHealth(activation, sceneSourceFailureReason(error), this.clock(), this.clock() + 6e4);
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
assertCurrent();
|
|
76
|
-
const permissions = intersectPermissions(granted, activation.permissions, {
|
|
77
|
-
accountIds: accountId === void 0 ? activation.permissions.accountIds : [accountId],
|
|
78
|
-
contextProviders: template.contextProviders,
|
|
79
|
-
effectHandlers: []
|
|
80
|
-
});
|
|
81
|
-
const evidence = [];
|
|
82
|
-
for (const providerId of template.contextProviders) {
|
|
83
|
-
const provider = this.providers.get(providerId);
|
|
84
|
-
if (!permissions.contextProviders.includes(providerId)) {
|
|
85
|
-
if (provider.tracksHealth) this.repository.recordSourceHealth(activation, "needs_permission", this.clock(), this.clock() + 6e4);
|
|
86
|
-
throw new SceneExecutionRejected("needs_permission");
|
|
87
|
-
}
|
|
88
|
-
let items;
|
|
89
|
-
try {
|
|
90
|
-
items = await provider.read({
|
|
91
|
-
activation,
|
|
92
|
-
subjectId,
|
|
93
|
-
permissions,
|
|
94
|
-
notBefore,
|
|
95
|
-
signal: controller.signal
|
|
96
|
-
});
|
|
97
|
-
} catch (error) {
|
|
98
|
-
if (provider.tracksHealth && !outerSignal?.aborted) this.repository.recordSourceHealth(activation, sceneSourceFailureReason(error), this.clock(), this.clock() + 6e4);
|
|
99
|
-
throw error;
|
|
100
|
-
}
|
|
101
|
-
assertCurrent();
|
|
102
|
-
if (provider.requiresAccountIdentity && items.some((item) => item.accountId === void 0)) throw new SceneExecutionRejected("missing_account_identity");
|
|
103
|
-
if (items.some((item) => !evidenceAllowed(item, activation, permissions, this.clock()))) throw new SceneExecutionRejected("unauthorized_or_stale_evidence");
|
|
104
|
-
evidence.push(...items);
|
|
105
|
-
}
|
|
106
|
-
if (evidence.length > 100 || evidence.reduce((size, item) => size + item.content.length, 0) > 12e4) throw new SceneExecutionRejected("context_budget_exceeded");
|
|
107
|
-
if (new Set(evidence.map((item) => item.id)).size !== evidence.length) throw new SceneExecutionRejected("duplicate_evidence");
|
|
108
|
-
evidence.sort((left, right) => left.id.localeCompare(right.id));
|
|
109
|
-
const fingerprint = sceneContentHash(evidence.map(({ freshUntil: _freshUntil, ...item }) => item));
|
|
110
|
-
if (template.contextProviders.some((id) => this.providers.get(id).tracksHealth)) this.repository.recordSourceHealth(activation, null, this.clock());
|
|
111
|
-
return {
|
|
112
|
-
evidence,
|
|
113
|
-
fingerprint,
|
|
114
|
-
permissions
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
const execute = async () => {
|
|
118
|
-
const snapshot = await readContext();
|
|
119
|
-
if (!this.repository.saveSnapshot(claim, snapshot.fingerprint, snapshot.evidence.map((item) => item.id), this.clock())) return "discarded";
|
|
120
|
-
if (this.repository.reuseUnchangedResult(claim, snapshot.fingerprint, this.clock(), true)) {
|
|
121
|
-
const current = await readContext();
|
|
122
|
-
assertCurrent();
|
|
123
|
-
if (current.fingerprint !== snapshot.fingerprint || sceneContentHash(current.permissions) !== sceneContentHash(snapshot.permissions)) throw new SceneExecutionRejected("source_changed");
|
|
124
|
-
if (this.repository.reuseUnchangedResult(claim, snapshot.fingerprint, this.clock())) return "completed";
|
|
125
|
-
}
|
|
126
|
-
if (snapshot.evidence.length > 0 && !this.repository.reserveModelCall(claim, this.clock())) {
|
|
127
|
-
const now = this.clock();
|
|
128
|
-
return this.repository.deferRun(claim, now, "daily_budget", (Math.floor(now / 864e5) + 1) * 864e5);
|
|
129
|
-
}
|
|
130
|
-
const raw = snapshot.evidence.length === 0 ? {
|
|
131
|
-
kind: "no_change",
|
|
132
|
-
summary: "",
|
|
133
|
-
evidenceIds: []
|
|
134
|
-
} : await this.executor.execute({
|
|
135
|
-
template,
|
|
136
|
-
goal: activation.goal,
|
|
137
|
-
evidence: snapshot.evidence,
|
|
138
|
-
signal: controller.signal,
|
|
139
|
-
usage: {
|
|
140
|
-
operation: "scene.execute",
|
|
141
|
-
traceId: claim.id,
|
|
142
|
-
runId: claim.id,
|
|
143
|
-
...activation.scope.kind === "conversation" ? { conversationId: activation.scope.id } : {}
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
assertCurrent();
|
|
147
|
-
const result = readOnlyResultSchema.parse(raw);
|
|
148
|
-
if (!template.allowedOutcomeKinds.includes(result.kind)) throw new SceneExecutionRejected("invalid_model_result");
|
|
149
|
-
if (result.evidenceIds.some((id) => !snapshot.evidence.some((item) => item.id === id))) throw new SceneExecutionRejected("unknown_evidence");
|
|
150
|
-
const current = await readContext();
|
|
151
|
-
assertCurrent();
|
|
152
|
-
if (current.fingerprint !== snapshot.fingerprint || sceneContentHash(current.permissions) !== sceneContentHash(snapshot.permissions)) throw new SceneExecutionRejected("source_changed");
|
|
153
|
-
return this.repository.finishReadOnlyRun(claim, result, this.clock()) ? "completed" : "discarded";
|
|
154
|
-
};
|
|
155
|
-
try {
|
|
156
|
-
return await Promise.race([execute(), aborted]);
|
|
157
|
-
} catch (error) {
|
|
158
|
-
if (!controller.signal.aborted && error instanceof SceneSourceNotReady) return this.repository.deferRun(claim, this.clock(), "source_not_ready", this.clock() + 6e4);
|
|
159
|
-
this.repository.failRun(claim, this.clock(), controller.signal.aborted ? "execution_aborted" : error instanceof SceneExecutionRejected ? error.reason : error instanceof z.ZodError || error instanceof SyntaxError ? "invalid_model_result" : "execution_failed");
|
|
160
|
-
return "failed";
|
|
161
|
-
} finally {
|
|
162
|
-
clearTimeout(timeout);
|
|
163
|
-
stopWaiting?.();
|
|
164
|
-
outerSignal?.removeEventListener("abort", abort);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
//#endregion
|
|
169
|
-
export { SceneExecutionService, readOnlyResultSchema };
|