@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,17 +0,0 @@
|
|
|
1
|
-
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
-
import type { ProductNotification } from '@xopcai/gateway-contract';
|
|
3
|
-
import { type SceneActivation, type ScenePermission } from './contracts.js';
|
|
4
|
-
/** Page notifications commit with the result outbox; transport routing is never inferred. */
|
|
5
|
-
export declare class SceneResultNotifications {
|
|
6
|
-
private readonly db;
|
|
7
|
-
private readonly authorize;
|
|
8
|
-
private readonly publish;
|
|
9
|
-
private readonly clock;
|
|
10
|
-
private readonly outbox;
|
|
11
|
-
private committed;
|
|
12
|
-
constructor(db: DatabaseSync, authorize: (activation: SceneActivation) => ScenePermission, publish: (notification: ProductNotification) => void, clock?: () => number);
|
|
13
|
-
/** Realtime is a hint after commit; durable results and events survive a disconnected page. */
|
|
14
|
-
drain(limit?: number): number;
|
|
15
|
-
private reserveBudget;
|
|
16
|
-
private flushDigests;
|
|
17
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
import { init_transaction, runSqliteSavepoint } from "../storage/sqlite/transaction.js";
|
|
2
|
-
import { intersectPermissions, sceneContentHash } from "./contracts.js";
|
|
3
|
-
import { nextSceneScheduleAt } from "./schedule.js";
|
|
4
|
-
import { SceneRepository } from "./repository.js";
|
|
5
|
-
import { createNotificationEvent } from "../notifications/store.js";
|
|
6
|
-
import { enqueueBrowserDispatches } from "../notifications/browserSubscriptions.js";
|
|
7
|
-
import { ScenePreferenceService, sceneChecksAllowed } from "./preferences.js";
|
|
8
|
-
import { notificationQuietUntil } from "../notifications/quietHours.js";
|
|
9
|
-
import { sceneNotificationEligibility } from "./notificationEligibility.js";
|
|
10
|
-
import { createSceneNotificationOutbox } from "./notificationPublication.js";
|
|
11
|
-
import { randomUUID } from "node:crypto";
|
|
12
|
-
//#region src/scenes/resultNotifications.ts
|
|
13
|
-
init_transaction();
|
|
14
|
-
/** Page notifications commit with the result outbox; transport routing is never inferred. */
|
|
15
|
-
var SceneResultNotifications = class {
|
|
16
|
-
outbox;
|
|
17
|
-
committed = [];
|
|
18
|
-
constructor(db, authorize, publish, clock = Date.now) {
|
|
19
|
-
this.db = db;
|
|
20
|
-
this.authorize = authorize;
|
|
21
|
-
this.publish = publish;
|
|
22
|
-
this.clock = clock;
|
|
23
|
-
const repository = new SceneRepository(db);
|
|
24
|
-
const preferences = new ScenePreferenceService(db);
|
|
25
|
-
this.outbox = createSceneNotificationOutbox(db, (result, eligible) => {
|
|
26
|
-
const activation = repository.getActivation(result, eligible.activationId);
|
|
27
|
-
if (sceneContentHash(intersectPermissions(activation.permissions, authorize(activation))) !== sceneContentHash(intersectPermissions(activation.permissions))) return {
|
|
28
|
-
action: "settle",
|
|
29
|
-
reason: "permission_revoked"
|
|
30
|
-
};
|
|
31
|
-
const now = clock();
|
|
32
|
-
const policy = preferences.get(result);
|
|
33
|
-
if (policy.digestEnabled) {
|
|
34
|
-
const due = nextSceneScheduleAt({
|
|
35
|
-
weekdays: [
|
|
36
|
-
0,
|
|
37
|
-
1,
|
|
38
|
-
2,
|
|
39
|
-
3,
|
|
40
|
-
4,
|
|
41
|
-
5,
|
|
42
|
-
6
|
|
43
|
-
],
|
|
44
|
-
hour: policy.digestHour,
|
|
45
|
-
minute: policy.digestMinute,
|
|
46
|
-
timeZone: policy.timezone
|
|
47
|
-
}, now);
|
|
48
|
-
db.prepare(`INSERT INTO notification_digest_queue(subject_id, owner_id, workspace_id, subject_revision, mode, due_at, status)
|
|
49
|
-
VALUES (?, ?, ?, ?, 'daily', ?, 'pending') ON CONFLICT(subject_id) DO UPDATE SET
|
|
50
|
-
subject_revision = excluded.subject_revision, due_at = excluded.due_at, status = 'pending', consumed_at = NULL`).run(result.subjectId, result.ownerId, result.workspaceId, eligible.revision, due);
|
|
51
|
-
return {
|
|
52
|
-
action: "settle",
|
|
53
|
-
reason: "digest_queued"
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
const key = `scene.result:${eligible.presentationId}:${eligible.revision}`;
|
|
57
|
-
if (!this.reserveBudget(result, key, policy, now)) return {
|
|
58
|
-
action: "settle",
|
|
59
|
-
reason: "daily_budget"
|
|
60
|
-
};
|
|
61
|
-
const event = createNotificationEvent({
|
|
62
|
-
dedupeKey: key,
|
|
63
|
-
createdAt: now,
|
|
64
|
-
deviceIds: [],
|
|
65
|
-
notification: {
|
|
66
|
-
type: "scene.result",
|
|
67
|
-
priority: "normal",
|
|
68
|
-
target: {
|
|
69
|
-
kind: "scene_result",
|
|
70
|
-
activationId: eligible.activationId,
|
|
71
|
-
presentationId: eligible.presentationId
|
|
72
|
-
},
|
|
73
|
-
title: {
|
|
74
|
-
en: "A scene result is ready",
|
|
75
|
-
zh: "场景有新成果"
|
|
76
|
-
},
|
|
77
|
-
body: {
|
|
78
|
-
en: "Open the scene to review it.",
|
|
79
|
-
zh: "打开场景查看并反馈。"
|
|
80
|
-
},
|
|
81
|
-
payload: {
|
|
82
|
-
ownerId: result.ownerId,
|
|
83
|
-
workspaceId: result.workspaceId,
|
|
84
|
-
notificationRevision: eligible.revision,
|
|
85
|
-
deliveryChannel: "in_app"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, db);
|
|
89
|
-
if (policy.preferredChannel === "browser") enqueueBrowserDispatches(db, result, event.notification.id, result.subjectId, eligible.revision, now);
|
|
90
|
-
if (event.created) this.committed.push(event.notification);
|
|
91
|
-
return {
|
|
92
|
-
action: "settle",
|
|
93
|
-
reason: "page_notification"
|
|
94
|
-
};
|
|
95
|
-
}, clock);
|
|
96
|
-
}
|
|
97
|
-
/** Realtime is a hint after commit; durable results and events survive a disconnected page. */
|
|
98
|
-
drain(limit = 100) {
|
|
99
|
-
if (!Number.isInteger(limit) || limit < 1 || limit > 1e3) throw new Error("Invalid scene notification batch size");
|
|
100
|
-
let drained = 0;
|
|
101
|
-
for (; drained < limit; drained++) {
|
|
102
|
-
this.committed = [];
|
|
103
|
-
if (!this.outbox.drainOne()) break;
|
|
104
|
-
for (const event of this.committed) if (this.db.prepare("SELECT 1 FROM notification_events WHERE event_id = ?").get(event.id)) this.publish(event);
|
|
105
|
-
}
|
|
106
|
-
this.flushDigests();
|
|
107
|
-
return drained;
|
|
108
|
-
}
|
|
109
|
-
reserveBudget(owner, key, policy, now) {
|
|
110
|
-
const day = new Intl.DateTimeFormat("en-CA", {
|
|
111
|
-
timeZone: policy.timezone,
|
|
112
|
-
year: "numeric",
|
|
113
|
-
month: "2-digit",
|
|
114
|
-
day: "2-digit"
|
|
115
|
-
}).format(now);
|
|
116
|
-
if (this.db.prepare("SELECT 1 FROM notification_attention_budget WHERE dedupe_key = ?").get(key)) return true;
|
|
117
|
-
if (Number(this.db.prepare(`SELECT count(*) AS n FROM notification_attention_budget
|
|
118
|
-
WHERE owner_id = ? AND workspace_id = ? AND local_day = ?`).get(owner.ownerId, owner.workspaceId, day)?.n) >= policy.dailyNotificationLimit) return false;
|
|
119
|
-
this.db.prepare("INSERT INTO notification_attention_budget VALUES (?, ?, ?, ?, ?)").run(key, owner.ownerId, owner.workspaceId, day, now);
|
|
120
|
-
return true;
|
|
121
|
-
}
|
|
122
|
-
flushDigests() {
|
|
123
|
-
const now = this.clock();
|
|
124
|
-
const owners = this.db.prepare(`SELECT DISTINCT owner_id, workspace_id FROM notification_digest_queue
|
|
125
|
-
WHERE status = 'pending' AND due_at <= ? ORDER BY owner_id, workspace_id LIMIT 100`).all(now);
|
|
126
|
-
for (const owner of owners) {
|
|
127
|
-
const event = runSqliteSavepoint(this.db, () => {
|
|
128
|
-
const principal = {
|
|
129
|
-
ownerId: String(owner.owner_id),
|
|
130
|
-
workspaceId: String(owner.workspace_id)
|
|
131
|
-
};
|
|
132
|
-
const policy = new ScenePreferenceService(this.db).get(principal);
|
|
133
|
-
const rows = this.db.prepare(`SELECT * FROM notification_digest_queue WHERE owner_id = ? AND workspace_id = ?
|
|
134
|
-
AND status = 'pending' AND due_at <= ? ORDER BY due_at, subject_id LIMIT 100`).all(principal.ownerId, principal.workspaceId, now);
|
|
135
|
-
const quiet = notificationQuietUntil(policy, now);
|
|
136
|
-
const members = [];
|
|
137
|
-
for (const row of rows) {
|
|
138
|
-
const result = {
|
|
139
|
-
...principal,
|
|
140
|
-
id: String(row.subject_id),
|
|
141
|
-
subjectId: String(row.subject_id)
|
|
142
|
-
};
|
|
143
|
-
const eligible = sceneNotificationEligibility(this.db, result, now, Number(row.subject_revision));
|
|
144
|
-
let until = eligible.action === "defer" ? eligible.until : null;
|
|
145
|
-
let allowed = eligible.action === "eligible" && sceneChecksAllowed(policy, now) && !policy.notificationsMuted && policy.level !== "quiet";
|
|
146
|
-
if (allowed && eligible.action === "eligible") {
|
|
147
|
-
const activation = new SceneRepository(this.db).getActivation(principal, eligible.activationId);
|
|
148
|
-
allowed = sceneContentHash(intersectPermissions(activation.permissions, this.authorize(activation))) === sceneContentHash(intersectPermissions(activation.permissions));
|
|
149
|
-
if (policy.suppressWhileViewing && this.db.prepare(`SELECT 1 FROM notification_presence WHERE owner_id = ? AND workspace_id = ?
|
|
150
|
-
AND subject_id = ? AND subject_revision = ? AND expires_at > ?`).get(principal.ownerId, principal.workspaceId, row.subject_id, row.subject_revision, now)) allowed = false;
|
|
151
|
-
if (allowed) until = quiet;
|
|
152
|
-
}
|
|
153
|
-
if (until !== null) {
|
|
154
|
-
this.db.prepare("UPDATE notification_digest_queue SET due_at = ? WHERE subject_id = ?").run(until, row.subject_id);
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
this.db.prepare("UPDATE notification_digest_queue SET status = 'consumed', consumed_at = ? WHERE subject_id = ?").run(now, row.subject_id);
|
|
158
|
-
if (allowed) members.push({
|
|
159
|
-
id: String(row.subject_id),
|
|
160
|
-
revision: Number(row.subject_revision)
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
if (!members.length) return null;
|
|
164
|
-
const occurrence = `daily:${rows[0].due_at}:${members[0].id}`;
|
|
165
|
-
const key = `scene.digest:${sceneContentHash([principal, occurrence])}`;
|
|
166
|
-
if (!this.reserveBudget(principal, key, policy, now)) return null;
|
|
167
|
-
const id = randomUUID();
|
|
168
|
-
const created = createNotificationEvent({
|
|
169
|
-
dedupeKey: key,
|
|
170
|
-
createdAt: now,
|
|
171
|
-
deviceIds: [],
|
|
172
|
-
notification: {
|
|
173
|
-
type: "scene.digest",
|
|
174
|
-
priority: "normal",
|
|
175
|
-
target: {
|
|
176
|
-
kind: "scene_digest",
|
|
177
|
-
digestId: id
|
|
178
|
-
},
|
|
179
|
-
title: {
|
|
180
|
-
en: "Your scene digest is ready",
|
|
181
|
-
zh: "场景摘要已就绪"
|
|
182
|
-
},
|
|
183
|
-
body: {
|
|
184
|
-
en: "Open the app to review your results.",
|
|
185
|
-
zh: "打开页面查看成果。"
|
|
186
|
-
},
|
|
187
|
-
payload: {
|
|
188
|
-
...principal,
|
|
189
|
-
deliveryChannel: "in_app"
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
}, this.db);
|
|
193
|
-
this.db.prepare("INSERT INTO notification_digests VALUES (?, ?, ?, ?, ?, ?)").run(id, principal.ownerId, principal.workspaceId, occurrence, now, created.notification.id);
|
|
194
|
-
const insert = this.db.prepare("INSERT INTO notification_digest_members VALUES (?, ?, ?)");
|
|
195
|
-
for (const member of members) insert.run(id, member.id, member.revision);
|
|
196
|
-
if (policy.preferredChannel === "browser") enqueueBrowserDispatches(this.db, principal, created.notification.id, null, 1, now);
|
|
197
|
-
return created.created ? created.notification : null;
|
|
198
|
-
});
|
|
199
|
-
if (event) this.publish(event);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
//#endregion
|
|
204
|
-
export { SceneResultNotifications };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { SceneExecutionService } from './execution.js';
|
|
2
|
-
import type { SceneRepository } from './repository.js';
|
|
3
|
-
import type { SceneMailObservationService } from './mailObservations.js';
|
|
4
|
-
/** Single-Gateway pump. Durable occurrence, lease and budget rules remain in the domain. */
|
|
5
|
-
export declare class SceneRuntime {
|
|
6
|
-
private readonly repository;
|
|
7
|
-
private readonly execution;
|
|
8
|
-
private readonly observations;
|
|
9
|
-
private readonly clock;
|
|
10
|
-
private readonly intervalMs;
|
|
11
|
-
private readonly worker;
|
|
12
|
-
private controller;
|
|
13
|
-
private timer?;
|
|
14
|
-
private running?;
|
|
15
|
-
private observing?;
|
|
16
|
-
private observationCursor;
|
|
17
|
-
private stopping?;
|
|
18
|
-
constructor(repository: SceneRepository, execution: SceneExecutionService, observations: Pick<SceneMailObservationService, 'scan'>, clock?: () => number, intervalMs?: number);
|
|
19
|
-
start(): void;
|
|
20
|
-
/** Ingests due occurrences even when an earlier model call is still running. */
|
|
21
|
-
tick(): Promise<void>;
|
|
22
|
-
private observe;
|
|
23
|
-
/** Cancels the active read/model call before the host closes SQLite. */
|
|
24
|
-
stop(): Promise<void>;
|
|
25
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
-
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { randomUUID } from "node:crypto";
|
|
4
|
-
//#region src/scenes/runtime.ts
|
|
5
|
-
init_logger();
|
|
6
|
-
const log = createLogger("SceneRuntime");
|
|
7
|
-
/** Single-Gateway pump. Durable occurrence, lease and budget rules remain in the domain. */
|
|
8
|
-
var SceneRuntime = class {
|
|
9
|
-
worker = `scene:${randomUUID()}`;
|
|
10
|
-
controller = new AbortController();
|
|
11
|
-
timer;
|
|
12
|
-
running;
|
|
13
|
-
observing;
|
|
14
|
-
observationCursor = "";
|
|
15
|
-
stopping;
|
|
16
|
-
constructor(repository, execution, observations, clock = Date.now, intervalMs = 5e3) {
|
|
17
|
-
this.repository = repository;
|
|
18
|
-
this.execution = execution;
|
|
19
|
-
this.observations = observations;
|
|
20
|
-
this.clock = clock;
|
|
21
|
-
this.intervalMs = intervalMs;
|
|
22
|
-
if (!Number.isInteger(intervalMs) || intervalMs < 100 || intervalMs > 6e4) throw new Error("Invalid scene poll interval");
|
|
23
|
-
}
|
|
24
|
-
start() {
|
|
25
|
-
if (this.stopping) throw new Error("Scene runtime is stopping");
|
|
26
|
-
if (this.timer) return;
|
|
27
|
-
if (this.controller.signal.aborted) this.controller = new AbortController();
|
|
28
|
-
const poll = () => {
|
|
29
|
-
this.tick().catch((err) => log.error({
|
|
30
|
-
err,
|
|
31
|
-
phase: "scene_poll"
|
|
32
|
-
}, "Scene poll failed"));
|
|
33
|
-
};
|
|
34
|
-
this.timer = setInterval(poll, this.intervalMs);
|
|
35
|
-
this.timer.unref();
|
|
36
|
-
poll();
|
|
37
|
-
}
|
|
38
|
-
/** Ingests due occurrences even when an earlier model call is still running. */
|
|
39
|
-
async tick() {
|
|
40
|
-
this.controller.signal.throwIfAborted();
|
|
41
|
-
const now = this.clock();
|
|
42
|
-
this.repository.enqueueDueWorkItems(now);
|
|
43
|
-
this.repository.enqueueDueSchedules(now);
|
|
44
|
-
if (!this.observing) this.observe();
|
|
45
|
-
if (this.running) {
|
|
46
|
-
await Promise.all([this.running, this.observing]);
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
const signal = this.controller.signal;
|
|
50
|
-
const run = this.execution.runNext(this.worker, signal).then(() => void 0);
|
|
51
|
-
this.running = run;
|
|
52
|
-
const execution = run.finally(() => {
|
|
53
|
-
if (this.running === run) this.running = void 0;
|
|
54
|
-
});
|
|
55
|
-
await Promise.all([execution, this.observing]);
|
|
56
|
-
}
|
|
57
|
-
observe() {
|
|
58
|
-
const controller = new AbortController();
|
|
59
|
-
const outer = this.controller.signal;
|
|
60
|
-
const abort = () => controller.abort(outer.reason);
|
|
61
|
-
outer.addEventListener("abort", abort, { once: true });
|
|
62
|
-
const timeout = setTimeout(() => controller.abort(/* @__PURE__ */ new Error("Scene mail observation timed out")), 3e4);
|
|
63
|
-
let removeListener = () => {};
|
|
64
|
-
const aborted = new Promise((_, reject) => {
|
|
65
|
-
const listener = () => reject(controller.signal.reason);
|
|
66
|
-
controller.signal.addEventListener("abort", listener, { once: true });
|
|
67
|
-
removeListener = () => controller.signal.removeEventListener("abort", listener);
|
|
68
|
-
});
|
|
69
|
-
const scan = Promise.resolve().then(() => {
|
|
70
|
-
controller.signal.throwIfAborted();
|
|
71
|
-
return this.observations.scan(controller.signal, this.observationCursor, (id) => {
|
|
72
|
-
if (!controller.signal.aborted) this.observationCursor = id;
|
|
73
|
-
});
|
|
74
|
-
}).then((result) => {
|
|
75
|
-
controller.signal.throwIfAborted();
|
|
76
|
-
this.observationCursor = result.nextCursor ?? "";
|
|
77
|
-
});
|
|
78
|
-
const observing = Promise.race([scan, aborted]).finally(() => {
|
|
79
|
-
clearTimeout(timeout);
|
|
80
|
-
removeListener();
|
|
81
|
-
outer.removeEventListener("abort", abort);
|
|
82
|
-
if (this.observing === observing) this.observing = void 0;
|
|
83
|
-
});
|
|
84
|
-
this.observing = observing;
|
|
85
|
-
}
|
|
86
|
-
/** Cancels the active read/model call before the host closes SQLite. */
|
|
87
|
-
stop() {
|
|
88
|
-
if (this.stopping) return this.stopping;
|
|
89
|
-
if (this.timer) clearInterval(this.timer);
|
|
90
|
-
this.timer = void 0;
|
|
91
|
-
this.controller.abort(/* @__PURE__ */ new Error("Scene runtime stopped"));
|
|
92
|
-
const stopped = Promise.allSettled([this.running, this.observing]).then(() => void 0);
|
|
93
|
-
this.stopping = stopped;
|
|
94
|
-
stopped.finally(() => {
|
|
95
|
-
if (this.stopping === stopped) this.stopping = void 0;
|
|
96
|
-
});
|
|
97
|
-
return stopped;
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
//#endregion
|
|
101
|
-
export { SceneRuntime };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { sceneScheduleSchema } from "../../packages/gateway-contract/src/scenes.js";
|
|
2
|
-
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { DateTime } from "luxon";
|
|
4
|
-
//#region src/scenes/schedule.ts
|
|
5
|
-
init_src();
|
|
6
|
-
function nextSceneScheduleAt(value, now) {
|
|
7
|
-
if (!Number.isSafeInteger(now) || now < 0) throw new Error("Invalid scene schedule time");
|
|
8
|
-
const schedule = sceneScheduleSchema.parse(value);
|
|
9
|
-
const today = DateTime.fromMillis(now, { zone: schedule.timeZone }).startOf("day");
|
|
10
|
-
for (let day = 0; day < 15; day += 1) {
|
|
11
|
-
const date = today.plus({ days: day });
|
|
12
|
-
if (!schedule.weekdays.includes(date.weekday % 7)) continue;
|
|
13
|
-
let candidate = date.set({
|
|
14
|
-
hour: schedule.hour,
|
|
15
|
-
minute: schedule.minute,
|
|
16
|
-
second: 0,
|
|
17
|
-
millisecond: 0
|
|
18
|
-
});
|
|
19
|
-
if (candidate.hour !== schedule.hour || candidate.minute !== schedule.minute) {
|
|
20
|
-
const requestedMinute = schedule.hour * 60 + schedule.minute;
|
|
21
|
-
for (let step = 0; step < 1440; step += 1) {
|
|
22
|
-
const previous = candidate.minus({ minutes: 1 });
|
|
23
|
-
if (previous.toISODate() !== date.toISODate() || previous.hour * 60 + previous.minute < requestedMinute) break;
|
|
24
|
-
candidate = previous;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const first = Math.min(...candidate.getPossibleOffsets().map((value) => value.toMillis()));
|
|
28
|
-
if (first > now) return first;
|
|
29
|
-
}
|
|
30
|
-
throw new Error("No scene schedule occurrence within the search window");
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { nextSceneScheduleAt, sceneScheduleSchema };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type SceneActivation, type ScenePermission, type ScenePrincipal } from './contracts.js';
|
|
2
|
-
import type { SceneContextProvider } from './execution.js';
|
|
3
|
-
import { SceneCapabilityRegistry } from './registry.js';
|
|
4
|
-
import { SceneRepository } from './repository.js';
|
|
5
|
-
export declare class SceneSetupError extends Error {
|
|
6
|
-
readonly missing: string[];
|
|
7
|
-
constructor(missing: string[]);
|
|
8
|
-
}
|
|
9
|
-
/** User-facing operations share one authorization boundary, independent of the UI. */
|
|
10
|
-
export declare class SceneApplicationService {
|
|
11
|
-
private readonly repository;
|
|
12
|
-
private readonly providers;
|
|
13
|
-
private readonly authorize;
|
|
14
|
-
private readonly clock;
|
|
15
|
-
private readonly modelReadiness;
|
|
16
|
-
constructor(repository: SceneRepository, providers: SceneCapabilityRegistry<SceneContextProvider>, authorize: (activation: SceneActivation) => Promise<ScenePermission>, clock?: () => number, modelReadiness?: () => string[]);
|
|
17
|
-
get database(): import("node:sqlite").DatabaseSync;
|
|
18
|
-
preflight(principal: ScenePrincipal, value: unknown): Promise<{
|
|
19
|
-
ready: boolean;
|
|
20
|
-
missing: string[];
|
|
21
|
-
}>;
|
|
22
|
-
private checkReadiness;
|
|
23
|
-
start(principal: ScenePrincipal, value: unknown, requestId: string): Promise<SceneActivation>;
|
|
24
|
-
/** Commit only after a successful preflight; contains no asynchronous effects. */
|
|
25
|
-
startAfterPreflight(principal: ScenePrincipal, value: unknown, requestId: string): SceneActivation;
|
|
26
|
-
check(principal: ScenePrincipal, activationId: string, requestId: string): string;
|
|
27
|
-
transition(principal: ScenePrincipal, id: string, value: unknown): Promise<SceneActivation>;
|
|
28
|
-
prepareTransition(principal: ScenePrincipal, id: string, value: unknown): Promise<void>;
|
|
29
|
-
/** The exact revision fences changes made while asynchronous readiness checks were running. */
|
|
30
|
-
transitionAfterPreflight(principal: ScenePrincipal, id: string, value: unknown): SceneActivation;
|
|
31
|
-
configure(principal: ScenePrincipal, id: string, value: unknown): SceneActivation;
|
|
32
|
-
writeNotes(principal: ScenePrincipal, id: string, value: unknown): number;
|
|
33
|
-
createWorkItem(principal: ScenePrincipal, id: string, value: unknown): import("./repository.js").SceneWorkItem;
|
|
34
|
-
setSchedule(principal: ScenePrincipal, id: string, triggerKey: string, value: unknown): number;
|
|
35
|
-
updateWorkItem(principal: ScenePrincipal, id: string, value: unknown): import("./repository.js").SceneWorkItem;
|
|
36
|
-
}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { SceneConfigureSchema, SceneTransitionSchema, SceneWorkItemCreateSchema, SceneWorkItemUpdateSchema, activationInputSchema, sceneScheduleSchema } from "../../packages/gateway-contract/src/scenes.js";
|
|
2
|
-
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { intersectPermissions, validateTemplate } from "./contracts.js";
|
|
4
|
-
import "./schedule.js";
|
|
5
|
-
import { SceneConflictError } from "./repository.js";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
//#region src/scenes/service.ts
|
|
8
|
-
init_src();
|
|
9
|
-
var SceneSetupError = class extends Error {
|
|
10
|
-
constructor(missing) {
|
|
11
|
-
super(`Scene setup is incomplete: ${missing.join(", ")}`);
|
|
12
|
-
this.missing = missing;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
/** User-facing operations share one authorization boundary, independent of the UI. */
|
|
16
|
-
var SceneApplicationService = class {
|
|
17
|
-
constructor(repository, providers, authorize, clock = Date.now, modelReadiness = () => []) {
|
|
18
|
-
this.repository = repository;
|
|
19
|
-
this.providers = providers;
|
|
20
|
-
this.authorize = authorize;
|
|
21
|
-
this.clock = clock;
|
|
22
|
-
this.modelReadiness = modelReadiness;
|
|
23
|
-
}
|
|
24
|
-
get database() {
|
|
25
|
-
return this.repository.database;
|
|
26
|
-
}
|
|
27
|
-
async preflight(principal, value) {
|
|
28
|
-
const input = activationInputSchema.parse(value);
|
|
29
|
-
return this.checkReadiness({
|
|
30
|
-
...input,
|
|
31
|
-
...principal,
|
|
32
|
-
id: "preflight",
|
|
33
|
-
revision: 1,
|
|
34
|
-
status: "needs_setup"
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
async checkReadiness(activation) {
|
|
38
|
-
const input = activation;
|
|
39
|
-
const template = validateTemplate(this.repository.getTemplate(input.templateKey, input.templateVersion), {
|
|
40
|
-
contextProviders: this.providers.ids(),
|
|
41
|
-
effectHandlers: [],
|
|
42
|
-
executionAdapters: ["agent"]
|
|
43
|
-
});
|
|
44
|
-
const permissions = intersectPermissions(input.permissions, await this.authorize(activation));
|
|
45
|
-
const missing = template.contextProviders.filter((provider) => !permissions.contextProviders.includes(provider)).map((id) => `context:${id}`);
|
|
46
|
-
missing.push(...this.modelReadiness());
|
|
47
|
-
missing.push(...input.permissions.accountIds.filter((id) => !permissions.accountIds.includes(id)).map((id) => `account:${id}`));
|
|
48
|
-
if (input.permissions.effectHandlers.length > 0) missing.push("read_only_execution");
|
|
49
|
-
if (input.permissions.contextProviders.some((id) => !template.contextProviders.includes(id))) missing.push("unrequested_context");
|
|
50
|
-
for (const providerId of template.contextProviders) missing.push(...this.providers.get(providerId).setupIssues?.(activation) ?? []);
|
|
51
|
-
return {
|
|
52
|
-
ready: missing.length === 0,
|
|
53
|
-
missing
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
async start(principal, value, requestId) {
|
|
57
|
-
if (!requestId.trim()) throw new Error("Scene request identity is required");
|
|
58
|
-
const preflight = await this.preflight(principal, value);
|
|
59
|
-
if (!preflight.ready) throw new SceneSetupError(preflight.missing);
|
|
60
|
-
return this.startAfterPreflight(principal, value, requestId);
|
|
61
|
-
}
|
|
62
|
-
/** Commit only after a successful preflight; contains no asynchronous effects. */
|
|
63
|
-
startAfterPreflight(principal, value, requestId) {
|
|
64
|
-
const activation = this.repository.createActivation(principal, value, requestId);
|
|
65
|
-
if (activation.status !== "needs_setup") return activation;
|
|
66
|
-
return this.repository.transitionActivation(principal, activation.id, activation.revision, "active", this.clock());
|
|
67
|
-
}
|
|
68
|
-
check(principal, activationId, requestId) {
|
|
69
|
-
if (!requestId.trim() || requestId.length > 200) throw new Error("Scene request identity is required");
|
|
70
|
-
const activation = this.repository.getActivation(principal, activationId);
|
|
71
|
-
const trigger = this.repository.getTemplate(activation.templateKey, activation.templateVersion).triggers.find((item) => item.type === "manual");
|
|
72
|
-
if (!trigger) throw new Error("Scene template does not support manual checks");
|
|
73
|
-
return this.repository.acceptManualCheck(principal, activationId, trigger.id, requestId, this.clock());
|
|
74
|
-
}
|
|
75
|
-
async transition(principal, id, value) {
|
|
76
|
-
await this.prepareTransition(principal, id, value);
|
|
77
|
-
return this.transitionAfterPreflight(principal, id, value);
|
|
78
|
-
}
|
|
79
|
-
async prepareTransition(principal, id, value) {
|
|
80
|
-
const input = SceneTransitionSchema.parse(value);
|
|
81
|
-
const activation = this.repository.getActivation(principal, id);
|
|
82
|
-
if (this.repository.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== "agent") throw new SceneConflictError("Use the activation execution adapter");
|
|
83
|
-
if (activation.revision !== input.expectedRevision) throw new SceneConflictError("Scene activation changed");
|
|
84
|
-
if (input.status === "active") {
|
|
85
|
-
const result = await this.checkReadiness(activation);
|
|
86
|
-
if (!result.ready) throw new SceneSetupError(result.missing);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/** The exact revision fences changes made while asynchronous readiness checks were running. */
|
|
90
|
-
transitionAfterPreflight(principal, id, value) {
|
|
91
|
-
const input = SceneTransitionSchema.parse(value);
|
|
92
|
-
const activation = this.repository.getActivation(principal, id);
|
|
93
|
-
if (this.repository.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== "agent") throw new SceneConflictError("Use the activation execution adapter");
|
|
94
|
-
return this.repository.transitionActivation(principal, id, input.expectedRevision, input.status, this.clock());
|
|
95
|
-
}
|
|
96
|
-
configure(principal, id, value) {
|
|
97
|
-
const activation = this.repository.getActivation(principal, id);
|
|
98
|
-
if (this.repository.getTemplate(activation.templateKey, activation.templateVersion).execution.kind !== "agent") throw new SceneConflictError("Use the activation execution adapter");
|
|
99
|
-
const { expectedRevision, ...input } = SceneConfigureSchema.parse(value);
|
|
100
|
-
return this.repository.configureActivation(principal, id, expectedRevision, input);
|
|
101
|
-
}
|
|
102
|
-
writeNotes(principal, id, value) {
|
|
103
|
-
return this.repository.writeNotes(principal, id, value, this.clock());
|
|
104
|
-
}
|
|
105
|
-
createWorkItem(principal, id, value) {
|
|
106
|
-
const input = SceneWorkItemCreateSchema.parse(value);
|
|
107
|
-
return this.repository.createWorkItem(principal, id, input, this.clock());
|
|
108
|
-
}
|
|
109
|
-
setSchedule(principal, id, triggerKey, value) {
|
|
110
|
-
const input = z.strictObject({
|
|
111
|
-
expectedRevision: z.number().int().nonnegative(),
|
|
112
|
-
schedule: sceneScheduleSchema
|
|
113
|
-
}).parse(value);
|
|
114
|
-
return this.repository.setSchedule(principal, id, triggerKey, input.expectedRevision, input.schedule, this.clock());
|
|
115
|
-
}
|
|
116
|
-
updateWorkItem(principal, id, value) {
|
|
117
|
-
const input = SceneWorkItemUpdateSchema.parse(value);
|
|
118
|
-
return this.repository.updateWorkItem(principal, id, input, this.clock());
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
//#endregion
|
|
122
|
-
export { SceneApplicationService, SceneSetupError };
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { Api, Model } from '@earendil-works/pi-ai';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
import type { Config } from '../../config/schema.js';
|
|
4
|
-
import { type TaskFollowUpInput } from './contracts.js';
|
|
5
|
-
export declare const followUpResultSchema: z.ZodObject<{
|
|
6
|
-
summary: z.ZodString;
|
|
7
|
-
needsUser: z.ZodBoolean;
|
|
8
|
-
continueAutomatically: z.ZodBoolean;
|
|
9
|
-
remainingWork: z.ZodArray<z.ZodString>;
|
|
10
|
-
}, z.core.$strict>;
|
|
11
|
-
export type FollowUpResult = z.infer<typeof followUpResultSchema>;
|
|
12
|
-
export type FollowUpExecution = {
|
|
13
|
-
runId: string;
|
|
14
|
-
conversationId: string;
|
|
15
|
-
workspace: string;
|
|
16
|
-
goal: string;
|
|
17
|
-
instruction: string;
|
|
18
|
-
evidence: string;
|
|
19
|
-
capabilities: TaskFollowUpInput['capabilities'];
|
|
20
|
-
signal: AbortSignal;
|
|
21
|
-
guard: () => void;
|
|
22
|
-
verify?: () => Promise<{
|
|
23
|
-
passed: boolean;
|
|
24
|
-
output: string;
|
|
25
|
-
}>;
|
|
26
|
-
};
|
|
27
|
-
export interface FollowUpExecutor {
|
|
28
|
-
execute(input: FollowUpExecution): Promise<FollowUpResult>;
|
|
29
|
-
}
|
|
30
|
-
/** Adapts task context to the existing embedded harness, not a separate agent loop. */
|
|
31
|
-
export declare class FollowUpAgentExecutor implements FollowUpExecutor {
|
|
32
|
-
private readonly model;
|
|
33
|
-
private readonly config;
|
|
34
|
-
constructor(model: () => Model<Api>, config: () => Config);
|
|
35
|
-
execute(input: FollowUpExecution): Promise<FollowUpResult>;
|
|
36
|
-
}
|