@xopcai/xopc 0.0.312 → 0.0.314
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/assets/{auth-C3yV1y_l.js → auth-DKo-NMUY.js} +18 -1
- package/dist/browser-ext/dist/background.js +68 -2
- package/dist/browser-ext/dist/sidepanel.html +1 -1
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BVIJMP8w.js → agent-avatar-dicebear-BFkjfurL.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-BdOZ6q8Z.js +1 -0
- package/dist/gateway/static/root/assets/{agents-D6g_SeWI.js → agents-CCcavsHq.js} +1 -1
- package/dist/gateway/static/root/assets/{api-_aHQA8bd.js → api-BYhRsTAc.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-CKueEVbT.js → app-link-nL8iPwEr.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CLg_aXYG.js → app-management-settings-panel-B4kihr-A.js} +1 -1
- package/dist/gateway/static/root/assets/appearance-settings-N9sYmNOx.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-BMcy10_s.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-CHO3heHX.js → archive-plugin-k_SuYWyV.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BsmsBCI2.js → attachment-load-DRv5QWUK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CftigJlf.js → automations-page-CkJV3DN0.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BEa2doeR.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-CRCLWBo2.js → binary-plugins-Dg3h3TA7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-D0LDiOTT.js → block-editor-DVhdHntT.js} +29 -29
- package/dist/gateway/static/root/assets/{browser-automation-inputs-C611KRBx.js → browser-automation-inputs-BMRYUW8_.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-Djyv3vy-.js → browser-automations-page-Byv6-FY2.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DRCHGFpO.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-D0S3DuAD.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-mxRP0gl0.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-DBt_6GsB.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CIsKqdET.js → chat-terminal-dock-D4AHa51o.js} +2 -2
- package/dist/gateway/static/root/assets/{computer-settings-page-C0YL9J7m.js → computer-settings-page-eXPe500D.js} +1 -1
- package/dist/gateway/static/root/assets/connector-service-page-BQTFlq_k.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-BKeBWwcI.js +2 -0
- package/dist/gateway/static/root/assets/conversation-identity-Cw0n9uzK.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-CDsfv8R0.js → date-picker-7MtovynY.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-DvhPj3CZ.js → dependency-picker-Bj_xkXID.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Cyg8XMpL.js → desktop-pet-CTmba9zH.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DNM_BlWN.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-C2XE0QhT.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-D-AVJU3q.js → extension-debug-page-J_olaL7e.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DrFoQ9xt.js → extension-page-pK5RvqN8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DxWjESC1.js → extension-settings-page-BwroEN08.js} +1 -1
- package/dist/gateway/static/root/assets/files-BK6enEvD.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-DUDX42qY.js → gateway-config-swr-FuJTIg_a.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-CLLDp23J.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cf8OxlvY.js → gateway-startup-retry-CKg_gu8_.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-B5Epb1PH.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D2YorS--.js → image-generation-api-Bo6NZ7zb.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BKucJlXI.js → imports-page-C8-hX8gS.js} +1 -1
- package/dist/gateway/static/root/assets/index-14F1yGJI.js +89 -0
- package/dist/gateway/static/root/assets/index-cB7rWIDY.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BxLXD-yU.js → keyboard-shortcuts-settings-BkBEjUZD.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-6jC3vQpY.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BAsQJQKJ.js → local-apps-page-CrbKIixo.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DA0Z5jM_.js → locale-store-CvGwNbml.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DBHlZts9.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-DsUWLu5m.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-view-DYGPxPee.js → markdown-view-nXo5nrsv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-CQtQzLyg.js → media-plugins-upxXJ-4l.js} +1 -1
- package/dist/gateway/static/root/assets/messages-B_AwRroN.js +3 -0
- package/dist/gateway/static/root/assets/note-detail-panel-0Q9TOtJG.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-D0NmcwNw.js +8 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-DUyA-K4L.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-B6DjkyMM.js → page-tabs-Cl-NFPNr.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Dn57uLhr.js → preview-open-alternatives-DX81PwJ3.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-chCjIpvu.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-H2YMk8TY.js → product-open-page-CrfIGwm8.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-BVfVrYmn.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-nM9a9XNS.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-C0DCx3wv.js → registry-api-CHxgohY0.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C8b_k88G.js +1 -0
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-D3dLOW04.js +5 -0
- package/dist/gateway/static/root/assets/scenes-page-DEowreZV.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-CblI9WUA.js → schema-form-ZxuIvD2_.js} +1 -1
- package/dist/gateway/static/root/assets/schemas-88fK3zzl.js +64 -0
- package/dist/gateway/static/root/assets/sessions-page-B_nPhera.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-BqhIOuus.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BAaVyxJH.js → settings-form-section-TZRfg4yo.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CKNPbm5q.js → settings-page-a8qcJpdZ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DqNCGKxQ.js → settings-page-layout-BfvlRT9q.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CRj5Ruqn.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-BzMfp_HM.js → share-preview-page-DCt1pTWB.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BNbXPk--.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CNMCLbav.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-DIht92q6.js → skills-page-BIOcg44X.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page.utils-DLYRiEn3.js → skills-page.utils-CgZdzT4I.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-yYs4YgYk.js → system-settings-panel-_YaRncA6.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-CAcfAG-c.js +1 -0
- package/dist/gateway/static/root/assets/tasks-CDR_RVbQ.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-BasDYxvx.js → tunnel-api-uOupJOoS.js} +1 -1
- package/dist/gateway/static/root/assets/turn-outcome-D0SnyZ3Z.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-CWAUHhcb.js → use-autosave-BezzHBLE.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-BFFeneDq.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-Kc4UlxZs.js → voice-api-key-field-BmYifdwL.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DTyMdGOR.js → voice-config-api-D_5Q2_A3.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BPC_c9dO.js → work-discovery-overlay-4DmyEckJ.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DBTciOrq.js → workflow-run-setup-panel-DeZe8bTZ.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Sv4hEc6W.js +6 -0
- package/dist/gateway/static/root/index.html +16 -16
- package/dist/package.js +1 -1
- package/dist/packages/computer-control-contract/src/index.js +10 -1
- package/dist/packages/gateway-contract/src/app-context.js +55 -0
- package/dist/packages/gateway-contract/src/automations.js +16 -17
- package/dist/packages/gateway-contract/src/capabilities.js +1078 -0
- package/dist/packages/gateway-contract/src/extension-capabilities.js +26 -0
- package/dist/packages/gateway-contract/src/home.js +3 -3
- package/dist/packages/gateway-contract/src/index.js +8 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +19 -4
- package/dist/packages/gateway-contract/src/scenes.js +199 -0
- package/dist/packages/gateway-contract/src/task-runs.js +8 -4
- package/dist/packages/gateway-contract/src/tasks.js +5 -4
- package/dist/packages/realtime-client/src/index.js +17 -4
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/child-agent-factory.d.ts +2 -0
- package/dist/src/agent/child-agent-factory.js +5 -0
- package/dist/src/agent/commands/approved-verification.d.ts +14 -0
- package/dist/src/agent/commands/approved-verification.js +48 -0
- package/dist/src/agent/context/execution-scope.js +2 -1
- package/dist/src/agent/context/project-context.js +2 -1
- package/dist/src/agent/external-tools/cliProvider.js +123 -75
- package/dist/src/agent/external-tools/composio-provider.d.ts +1 -1
- package/dist/src/agent/external-tools/composio-provider.js +70 -12
- package/dist/src/agent/external-tools/endpoint-provider.js +14 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +2 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +2 -1
- package/dist/src/agent/memory/compaction-chunks.d.ts +6 -1
- package/dist/src/agent/memory/compaction-chunks.js +16 -3
- package/dist/src/agent/memory/compaction-ledger.d.ts +3 -1
- package/dist/src/agent/memory/compaction-ledger.js +31 -18
- package/dist/src/agent/memory/compaction-request.d.ts +2 -0
- package/dist/src/agent/memory/compaction-request.js +6 -1
- package/dist/src/agent/memory/compaction.d.ts +19 -1
- package/dist/src/agent/memory/compaction.js +112 -30
- package/dist/src/agent/service/process-direct-streaming.d.ts +3 -0
- package/dist/src/agent/service/process-direct-streaming.js +19 -10
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/skills/config.js +2 -0
- package/dist/src/agent/skills/format-skills-prompt.js +14 -1
- package/dist/src/agent/skills/index.js +16 -8
- package/dist/src/agent/skills/types.d.ts +1 -1
- package/dist/src/agent/source-context/app-context.d.ts +4 -0
- package/dist/src/agent/source-context/app-context.js +36 -0
- package/dist/src/agent/source-context/injector.js +1 -0
- package/dist/src/agent/source-context/types.d.ts +5 -1
- package/dist/src/agent/tasks/task-judge-service.js +2 -1
- package/dist/src/agent/tool-manuals/computer.d.ts +1 -1
- package/dist/src/agent/tool-manuals/computer.js +1 -1
- package/dist/src/agent/tools/automation-tool.d.ts +12 -1
- package/dist/src/agent/tools/automation-tool.js +106 -32
- package/dist/src/agent/tools/factory.d.ts +1 -0
- package/dist/src/agent/tools/factory.js +6 -1
- package/dist/src/agent/tools/scoped-workspace-tools.d.ts +8 -0
- package/dist/src/agent/tools/scoped-workspace-tools.js +81 -0
- package/dist/src/agent/tools/xopc-use-tool.d.ts +6 -3
- package/dist/src/agent/tools/xopc-use-tool.js +997 -908
- package/dist/src/agent/workflow/subagent-runner.js +1 -0
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +5 -0
- package/dist/src/agent-config/schema.js +14 -10
- package/dist/src/automations/api/routes.js +244 -164
- package/dist/src/automations/capabilities/drafts.d.ts +4 -0
- package/dist/src/automations/capabilities/drafts.js +95 -0
- package/dist/src/automations/capabilities/read.d.ts +4 -0
- package/dist/src/automations/capabilities/read.js +119 -0
- package/dist/src/automations/capabilities/write.d.ts +349 -0
- package/dist/src/automations/capabilities/write.js +172 -0
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/validation.d.ts +77 -77
- package/dist/src/automations/domain/validation.js +9 -6
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/automations/index.js +6 -6
- package/dist/src/automations/service/automation-service.d.ts +31 -0
- package/dist/src/automations/service/automation-service.js +213 -75
- package/dist/src/automations/service/index.js +2 -2
- package/dist/src/automations/storage/automation-repository.d.ts +2 -0
- package/dist/src/automations/storage/automation-repository.js +9 -1
- package/dist/src/automations/storage/automation-run-repository.d.ts +4 -1
- package/dist/src/automations/storage/automation-run-repository.js +16 -3
- package/dist/src/automations/storage/index.js +3 -3
- package/dist/src/browser/automations/schema.d.ts +1 -1
- package/dist/src/browser/automations/service.d.ts +1 -1
- package/dist/src/browser/observation/format.js +4 -0
- package/dist/src/capabilities/adapters/http.d.ts +4 -0
- package/dist/src/capabilities/adapters/http.js +44 -0
- package/dist/src/capabilities/readiness/from-config.js +11 -7
- package/dist/src/capabilities/runtime/app-context.d.ts +3 -0
- package/dist/src/capabilities/runtime/app-context.js +72 -0
- package/dist/src/capabilities/runtime/atomic-operations.d.ts +11 -0
- package/dist/src/capabilities/runtime/atomic-operations.js +34 -0
- package/dist/src/capabilities/runtime/dispatcher.d.ts +67 -0
- package/dist/src/capabilities/runtime/dispatcher.js +170 -0
- package/dist/src/capabilities/runtime/errors.d.ts +6 -0
- package/dist/src/capabilities/runtime/errors.js +11 -0
- package/dist/src/capabilities/runtime/external-operations.d.ts +16 -0
- package/dist/src/capabilities/runtime/external-operations.js +92 -0
- package/dist/src/capabilities/runtime/product.d.ts +12 -0
- package/dist/src/capabilities/runtime/product.js +69 -0
- package/dist/src/capabilities/runtime/settings.d.ts +3 -0
- package/dist/src/capabilities/runtime/settings.js +27 -0
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/manager.js +1 -1
- package/dist/src/cli/cli-log-level-preset.d.ts +2 -0
- package/dist/src/cli/cli-log-level-preset.js +4 -0
- package/dist/src/cli/command-catalog.js +4 -0
- package/dist/src/cli/command-loaders.js +1 -0
- package/dist/src/cli/command-manifest.js +4 -0
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +1 -1
- package/dist/src/cli/commands/mcp.d.ts +1 -0
- package/dist/src/cli/commands/mcp.js +51 -0
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +1 -1
- package/dist/src/computer/broker.d.ts +0 -1
- package/dist/src/computer/broker.js +4 -6
- package/dist/src/computer/evaluation-harness.d.ts +45 -0
- package/dist/src/computer/evaluation-harness.js +108 -0
- package/dist/src/computer/model-adapter.d.ts +37 -2
- package/dist/src/computer/model-adapter.js +333 -42
- package/dist/src/computer/model-policy.d.ts +4 -1
- package/dist/src/computer/model-policy.js +11 -3
- package/dist/src/computer/release-gate.d.ts +22 -0
- package/dist/src/computer/release-gate.js +19 -0
- package/dist/src/computer/runtime.js +14 -10
- package/dist/src/computer/task-state.d.ts +1 -0
- package/dist/src/computer/task-state.js +1 -0
- package/dist/src/config/models-json.d.ts +14 -8
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +4 -0
- package/dist/src/config/schema.js +3 -9
- package/dist/src/connectors/composio-sessions.d.ts +4 -2
- package/dist/src/connectors/composio-sessions.js +10 -9
- package/dist/src/connectors/composio.js +10 -8
- package/dist/src/discussions/action-tasks.js +2 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.d.ts +1 -0
- package/dist/src/execution-environments/local-worktree-manager.js +13 -2
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/api.js +1 -1
- package/dist/src/extensions/normalize-manifest.js +6 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/extensions/types/manifest.d.ts +3 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/middleware/scopes.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +5 -2
- package/dist/src/gateway/hono/routes/capability-operations.d.ts +3 -0
- package/dist/src/gateway/hono/routes/capability-operations.js +52 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/local-app-capabilities.d.ts +4 -0
- package/dist/src/gateway/hono/routes/local-app-capabilities.js +41 -0
- package/dist/src/gateway/hono/routes/local-apps.js +41 -9
- package/dist/src/gateway/hono/routes/models.js +2 -2
- package/dist/src/gateway/hono/routes/notes.js +215 -146
- package/dist/src/gateway/hono/routes/projects.js +217 -374
- package/dist/src/gateway/hono/routes/scenes.js +188 -75
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +60 -16
- package/dist/src/gateway/hono/routes/session-input-handler.js +43 -1
- package/dist/src/gateway/hono/routes/sessions.js +17 -0
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +182 -326
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +4 -4
- package/dist/src/gateway/hono/routes/workflows.js +1 -1
- package/dist/src/gateway/media-access.js +2 -1
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/scenes/host.js +14 -3
- package/dist/src/gateway/scenes/mailContext.js +1 -1
- package/dist/src/gateway/scenes/slackThreadSource.d.ts +41 -0
- package/dist/src/gateway/scenes/slackThreadSource.js +168 -0
- package/dist/src/gateway/security/gateway-scopes.d.ts +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +5 -0
- package/dist/src/gateway/service/app-context-access.d.ts +11 -0
- package/dist/src/gateway/service/app-context-access.js +70 -0
- package/dist/src/gateway/service/run-gateway-agent.js +11 -2
- package/dist/src/gateway/service/session-input-coordinator.js +54 -15
- package/dist/src/gateway/service/sessions-api.d.ts +1 -0
- package/dist/src/gateway/service/sessions-api.js +3 -0
- package/dist/src/gateway/service/task-conversation-query-service.d.ts +3 -1
- package/dist/src/gateway/service/task-conversation-query-service.js +32 -3
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +69 -15
- package/dist/src/gateway/session-context-summary.js +2 -1
- package/dist/src/{tasks/task-outbox-dispatcher.d.ts → infra/domain-outbox-dispatcher.d.ts} +2 -2
- package/dist/src/{tasks/task-outbox-dispatcher.js → infra/domain-outbox-dispatcher.js} +10 -9
- package/dist/src/infra/operation-context.d.ts +2 -0
- package/dist/src/infra/operation-context.js +16 -0
- package/dist/src/local-apps/capabilities/contracts.d.ts +2 -0
- package/dist/src/local-apps/capabilities/contracts.js +32 -0
- package/dist/src/local-apps/capabilities/read.d.ts +3 -0
- package/dist/src/local-apps/capabilities/read.js +48 -0
- package/dist/src/local-apps/capabilities/runtime.d.ts +16 -0
- package/dist/src/local-apps/capabilities/runtime.js +66 -0
- package/dist/src/local-apps/capabilities/write.d.ts +3 -0
- package/dist/src/local-apps/capabilities/write.js +35 -0
- package/dist/src/local-apps/release-lock.d.ts +2 -0
- package/dist/src/local-apps/release-lock.js +20 -0
- package/dist/src/local-apps/runtime-entry.d.ts +0 -2
- package/dist/src/local-apps/runtime-entry.js +1 -14
- package/dist/src/local-apps/scaffold.js +4 -1
- package/dist/src/local-apps/service.d.ts +24 -1
- package/dist/src/local-apps/service.js +186 -43
- package/dist/src/local-apps/store.js +0 -2
- package/dist/src/mcp/capability-server.d.ts +4 -0
- package/dist/src/mcp/capability-server.js +96 -0
- package/dist/src/mcp/channel-bridge.js +1 -1
- package/dist/src/mcp/gateway-http-client.d.ts +7 -0
- package/dist/src/mcp/gateway-http-client.js +27 -5
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/capabilities/read.d.ts +3 -0
- package/dist/src/notes/capabilities/read.js +96 -0
- package/dist/src/notes/capabilities/write.d.ts +7 -0
- package/dist/src/notes/capabilities/write.js +152 -0
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.d.ts +12 -4
- package/dist/src/notes/service.js +188 -175
- package/dist/src/notes/store.d.ts +14 -9
- package/dist/src/notes/store.js +81 -21
- package/dist/src/notifications/service.d.ts +1 -0
- package/dist/src/notifications/service.js +5 -0
- package/dist/src/platform/client.d.ts +1 -1
- package/dist/src/platform/contracts.d.ts +1 -1
- package/dist/src/projects/capabilities/read.d.ts +3 -0
- package/dist/src/projects/capabilities/read.js +81 -0
- package/dist/src/projects/capabilities/write.d.ts +9 -0
- package/dist/src/projects/capabilities/write.js +260 -0
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/project-change-events.d.ts +2 -0
- package/dist/src/projects/project-change-events.js +18 -0
- package/dist/src/projects/project-service.d.ts +11 -0
- package/dist/src/projects/project-service.js +121 -42
- package/dist/src/projects/project-store.js +12 -2
- package/dist/src/projects/project-workspace-creation.d.ts +3 -0
- package/dist/src/projects/project-workspace-creation.js +45 -0
- package/dist/src/projects/workspace-project.js +6 -0
- package/dist/src/providers/model-catalog-types.d.ts +2 -1
- package/dist/src/providers/model-reference-auditor.js +4 -4
- package/dist/src/providers/model-supplements.js +13 -3
- package/dist/src/providers/presentation.js +3 -3
- package/dist/src/providers/xopc-cloud-model-source.js +4 -2
- package/dist/src/realtime/runtime.js +4 -0
- package/dist/src/scenes/capabilities/read.d.ts +3 -0
- package/dist/src/scenes/capabilities/read.js +187 -0
- package/dist/src/scenes/capabilities/write.d.ts +3 -0
- package/dist/src/scenes/capabilities/write.js +151 -0
- package/dist/src/scenes/contracts.d.ts +2 -105
- package/dist/src/scenes/contracts.js +3 -88
- package/dist/src/scenes/execution.d.ts +1 -1
- package/dist/src/scenes/httpServices.d.ts +2 -0
- package/dist/src/scenes/inbox.d.ts +1 -0
- package/dist/src/scenes/inbox.js +7 -7
- package/dist/src/scenes/preferences.d.ts +3 -24
- package/dist/src/scenes/preferences.js +8 -30
- package/dist/src/scenes/repository.d.ts +1 -0
- package/dist/src/scenes/repository.js +7 -3
- package/dist/src/scenes/resultNotifications.js +2 -2
- package/dist/src/scenes/schedule.d.ts +1 -8
- package/dist/src/scenes/schedule.js +3 -15
- package/dist/src/scenes/service.d.ts +6 -0
- package/dist/src/scenes/service.js +29 -25
- package/dist/src/scenes/taskFollowUp/agentExecutor.d.ts +36 -0
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +149 -0
- package/dist/src/scenes/taskFollowUp/branchInventory.d.ts +38 -0
- package/dist/src/scenes/taskFollowUp/branchInventory.js +70 -0
- package/dist/src/scenes/taskFollowUp/contracts.d.ts +91 -0
- package/dist/src/scenes/taskFollowUp/contracts.js +100 -0
- package/dist/src/scenes/taskFollowUp/resources.d.ts +19 -0
- package/dist/src/scenes/taskFollowUp/resources.js +97 -0
- package/dist/src/scenes/taskFollowUp/service.d.ts +810 -0
- package/dist/src/scenes/taskFollowUp/service.js +710 -0
- package/dist/src/scenes/taskFollowUp/workspaceFingerprint.d.ts +2 -0
- package/dist/src/scenes/taskFollowUp/workspaceFingerprint.js +46 -0
- package/dist/src/scenes/templates.d.ts +2 -2
- package/dist/src/scenes/templates.js +1 -1
- package/dist/src/session/session-find.d.ts +17 -0
- package/dist/src/session/session-find.js +56 -0
- package/dist/src/session/store.d.ts +4 -0
- package/dist/src/session/store.js +43 -7
- package/dist/src/share/note-share-revocation.d.ts +3 -0
- package/dist/src/share/note-share-revocation.js +26 -0
- package/dist/src/storage/sqlite/migrations/190_scene_development.sql +37 -0
- package/dist/src/storage/sqlite/migrations/191_scene_task_follow_up.sql +27 -0
- package/dist/src/storage/sqlite/migrations/192_capability_operations.sql +20 -0
- package/dist/src/storage/sqlite/migrations/193_note_file_cleanup.sql +8 -0
- package/dist/src/storage/sqlite/migrations/194_capability_external_outcomes.sql +11 -0
- package/dist/src/storage/sqlite/migrations/195_automation_deleted_revisions.sql +4 -0
- package/dist/src/storage/sqlite/migrations/196_automation_run_requests.sql +23 -0
- package/dist/src/storage/sqlite/migrations/197_note_deletion_cleanup.sql +8 -0
- package/dist/src/storage/sqlite/migrations/198_project_workspace_creation.sql +7 -0
- package/dist/src/storage/sqlite/migrations/199_scene_resource_events.sql +488 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +6 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/transaction.d.ts +5 -0
- package/dist/src/storage/sqlite/transaction.js +34 -3
- package/dist/src/tasks/capabilities/management.d.ts +195 -0
- package/dist/src/tasks/capabilities/management.js +111 -0
- package/dist/src/tasks/capabilities/read.d.ts +2 -0
- package/dist/src/tasks/capabilities/read.js +141 -0
- package/dist/src/tasks/capabilities/relations.d.ts +204 -0
- package/dist/src/tasks/capabilities/relations.js +140 -0
- package/dist/src/tasks/capabilities/runs.d.ts +2 -0
- package/dist/src/tasks/capabilities/runs.js +89 -0
- package/dist/src/tasks/capabilities/write.d.ts +207 -0
- package/dist/src/tasks/capabilities/write.js +107 -0
- package/dist/src/tasks/home-query-service.js +3 -2
- package/dist/src/tasks/index.d.ts +0 -1
- package/dist/src/tasks/index.js +9 -9
- package/dist/src/tasks/project-operating-view-service.js +2 -1
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +3 -2
- package/dist/src/tasks/task-change-events.js +5 -3
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-deletion-service.js +2 -1
- package/dist/src/tasks/task-dependency-service.js +2 -1
- package/dist/src/tasks/task-handoff-service.js +2 -1
- package/dist/src/tasks/task-read-model-projector.js +2 -1
- package/dist/src/tasks/task-repository.d.ts +12 -7
- package/dist/src/tasks/task-repository.js +175 -154
- package/dist/src/tasks/task-run-coordinator.js +2 -1
- package/dist/src/tasks/task-run-dispatcher.js +2 -1
- package/dist/src/tasks/task-run-repository.d.ts +1 -0
- package/dist/src/tasks/task-run-repository.js +29 -14
- package/dist/src/tasks/task-signal-service.js +2 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/user-context/config.d.ts +13 -0
- package/dist/src/user-context/config.js +2 -0
- package/dist/src/voice/platform-catalog.d.ts +1 -1
- package/dist/src/voice/realtime/runtime.js +3 -3
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/repository.d.ts +1 -1
- package/dist/src/work-discovery/repository.js +3 -2
- package/dist/src/work-discovery/service.d.ts +4 -0
- package/dist/src/work-discovery/service.js +36 -11
- package/dist/src/workflows/context/workflow-context.js +3 -2
- package/dist/src/workflows/service/workflow-run-service.js +2 -1
- package/package.json +6 -2
- package/skills/THIRD_PARTY_NOTICES.md +2 -2
- package/skills/documents/xlsx/SKILL.md +5 -0
- package/skills/engineering/build-xopc-local-app/SKILL.md +2 -0
- package/skills/tools/find-skills/SKILL.md +3 -0
- package/dist/gateway/static/root/assets/activity-store-DVUTs1fk.js +0 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-K3hTmu9d.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-CU52MfIT.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-ZpA1-6ad.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-IEAxKRME.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-CU4VWsmX.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-settings-panel-C9XQk3HL.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-Bqlhjooi.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BmH17JnO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-zkx8Q-e6.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-settings-CE4GOlMM.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-CdKJqnnw.js +0 -1
- package/dist/gateway/static/root/assets/files-Be5viEFY.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-CGOW0-b4.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-D4um_sV7.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CgXp2zq4.js +0 -1
- package/dist/gateway/static/root/assets/home-page-D6Idk732.js +0 -1
- package/dist/gateway/static/root/assets/index-1wIKA-kM.css +0 -1
- package/dist/gateway/static/root/assets/index-PFQHPGgi.js +0 -79
- package/dist/gateway/static/root/assets/local-app-workbench-page-BmAqTRb4.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-ZjVYXXyM.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CSTkYVOZ.js +0 -1
- package/dist/gateway/static/root/assets/messages-4BtQKYlM.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-DuXCt-MM.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-BjOgBVq5.js +0 -8
- package/dist/gateway/static/root/assets/product-delivery-CrAI8ZEa.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-0zi4-i9X.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B18OxmJj.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-z-DxbuaE.js +0 -1
- package/dist/gateway/static/root/assets/runtime-tools-settings-panel-DGsBTbo6.js +0 -5
- package/dist/gateway/static/root/assets/scenes-page-Bgba03B_.js +0 -1
- package/dist/gateway/static/root/assets/schemas-BaskVM5g.js +0 -64
- package/dist/gateway/static/root/assets/sessions-page-B1t3bMsm.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CBX0Ezhf.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Bw71C2X3.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-BoVDQolc.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DtTptpAt.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-vgkiGo-D.js +0 -1
- package/dist/gateway/static/root/assets/theme-store-CegIlB8d.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-CAGafNfP.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CSxHVs1p.js +0 -6
- package/skills/creative/algorithmic-art/SKILL.md +0 -44
- package/skills/creative/algorithmic-art/templates/generator-template.js +0 -27
- package/skills/creative/algorithmic-art/templates/viewer.html +0 -27
|
@@ -5,6 +5,12 @@ function nextSavepointName() {
|
|
|
5
5
|
nextSavepointId += 1;
|
|
6
6
|
return `xopc_tx_${nextSavepointId}`;
|
|
7
7
|
}
|
|
8
|
+
/** Schedule a synchronous effect after an owned transaction commits. Persist its recovery intent first. */
|
|
9
|
+
function afterSqliteCommit(effect) {
|
|
10
|
+
const effects = commitEffectsByDatabase.get(getSqliteDatabase());
|
|
11
|
+
if (!effects) throw new Error("Commit effects require a transaction owned by runSqliteWriteTransaction");
|
|
12
|
+
effects.push(effect);
|
|
13
|
+
}
|
|
8
14
|
function getTransactionDepth(db) {
|
|
9
15
|
return transactionDepthByDatabase.get(db) ?? 0;
|
|
10
16
|
}
|
|
@@ -54,6 +60,8 @@ function runSqliteWriteTransaction(fn) {
|
|
|
54
60
|
const { db } = getXopcDatabase();
|
|
55
61
|
const depth = getTransactionDepth(db);
|
|
56
62
|
if (depth > 0) {
|
|
63
|
+
const effects = commitEffectsByDatabase.get(db);
|
|
64
|
+
const effectCount = effects?.length ?? 0;
|
|
57
65
|
const savepoint = nextSavepointName();
|
|
58
66
|
db.exec(`SAVEPOINT ${savepoint}`);
|
|
59
67
|
setTransactionDepth(db, depth + 1);
|
|
@@ -63,6 +71,7 @@ function runSqliteWriteTransaction(fn) {
|
|
|
63
71
|
db.exec(`RELEASE SAVEPOINT ${savepoint}`);
|
|
64
72
|
return result;
|
|
65
73
|
} catch (error) {
|
|
74
|
+
effects?.splice(effectCount);
|
|
66
75
|
try {
|
|
67
76
|
db.exec(`ROLLBACK TO SAVEPOINT ${savepoint}`);
|
|
68
77
|
} finally {
|
|
@@ -75,12 +84,15 @@ function runSqliteWriteTransaction(fn) {
|
|
|
75
84
|
}
|
|
76
85
|
db.exec("BEGIN IMMEDIATE");
|
|
77
86
|
setTransactionDepth(db, 1);
|
|
87
|
+
const effects = [];
|
|
88
|
+
commitEffectsByDatabase.set(db, effects);
|
|
78
89
|
let transactionActive = true;
|
|
79
90
|
let result;
|
|
80
91
|
try {
|
|
81
92
|
result = fn(db);
|
|
82
93
|
assertSyncTransactionResult(result);
|
|
83
94
|
} catch (error) {
|
|
95
|
+
commitEffectsByDatabase.delete(db);
|
|
84
96
|
try {
|
|
85
97
|
abortImmediateTransaction(db);
|
|
86
98
|
transactionActive = false;
|
|
@@ -92,8 +104,8 @@ function runSqliteWriteTransaction(fn) {
|
|
|
92
104
|
try {
|
|
93
105
|
commitImmediateTransaction(db);
|
|
94
106
|
transactionActive = false;
|
|
95
|
-
return result;
|
|
96
107
|
} catch (error) {
|
|
108
|
+
commitEffectsByDatabase.delete(db);
|
|
97
109
|
try {
|
|
98
110
|
abortImmediateTransaction(db);
|
|
99
111
|
transactionActive = false;
|
|
@@ -102,6 +114,15 @@ function runSqliteWriteTransaction(fn) {
|
|
|
102
114
|
} finally {
|
|
103
115
|
if (!transactionActive) setTransactionDepth(db, 0);
|
|
104
116
|
}
|
|
117
|
+
commitEffectsByDatabase.delete(db);
|
|
118
|
+
let failure;
|
|
119
|
+
for (const effect of effects) try {
|
|
120
|
+
assertSyncTransactionResult(effect());
|
|
121
|
+
} catch (error) {
|
|
122
|
+
failure ??= { error };
|
|
123
|
+
}
|
|
124
|
+
if (failure) throw new SqliteCommitEffectError(failure.error);
|
|
125
|
+
return result;
|
|
105
126
|
}
|
|
106
127
|
function getSqliteDatabase() {
|
|
107
128
|
return getXopcDatabase().db;
|
|
@@ -110,6 +131,8 @@ function getSqliteDatabase() {
|
|
|
110
131
|
function runSqliteSavepoint(db, operation) {
|
|
111
132
|
const name = nextSavepointName();
|
|
112
133
|
const depth = getTransactionDepth(db);
|
|
134
|
+
const effects = commitEffectsByDatabase.get(db);
|
|
135
|
+
const effectCount = effects?.length ?? 0;
|
|
113
136
|
db.exec(`SAVEPOINT ${name}`);
|
|
114
137
|
setTransactionDepth(db, depth + 1);
|
|
115
138
|
try {
|
|
@@ -118,6 +141,7 @@ function runSqliteSavepoint(db, operation) {
|
|
|
118
141
|
db.exec(`RELEASE ${name}`);
|
|
119
142
|
return result;
|
|
120
143
|
} catch (error) {
|
|
144
|
+
effects?.splice(effectCount);
|
|
121
145
|
db.exec(`ROLLBACK TO ${name}`);
|
|
122
146
|
db.exec(`RELEASE ${name}`);
|
|
123
147
|
throw error;
|
|
@@ -125,14 +149,21 @@ function runSqliteSavepoint(db, operation) {
|
|
|
125
149
|
setTransactionDepth(db, depth);
|
|
126
150
|
}
|
|
127
151
|
}
|
|
128
|
-
var RETRYABLE_COMMIT_CODES, MAX_COMMIT_ATTEMPTS, nextSavepointId, transactionDepthByDatabase;
|
|
152
|
+
var RETRYABLE_COMMIT_CODES, MAX_COMMIT_ATTEMPTS, nextSavepointId, transactionDepthByDatabase, commitEffectsByDatabase, SqliteCommitEffectError;
|
|
129
153
|
var init_transaction = __esmMin((() => {
|
|
130
154
|
init_connection();
|
|
131
155
|
RETRYABLE_COMMIT_CODES = new Set(["SQLITE_BUSY", "SQLITE_LOCKED"]);
|
|
132
156
|
MAX_COMMIT_ATTEMPTS = 8;
|
|
133
157
|
nextSavepointId = 0;
|
|
134
158
|
transactionDepthByDatabase = /* @__PURE__ */ new WeakMap();
|
|
159
|
+
commitEffectsByDatabase = /* @__PURE__ */ new WeakMap();
|
|
160
|
+
SqliteCommitEffectError = class extends Error {
|
|
161
|
+
constructor(cause) {
|
|
162
|
+
super("Transaction committed; post-commit work is pending recovery", { cause });
|
|
163
|
+
this.name = "SqliteCommitEffectError";
|
|
164
|
+
}
|
|
165
|
+
};
|
|
135
166
|
}));
|
|
136
167
|
//#endregion
|
|
137
168
|
init_transaction();
|
|
138
|
-
export { getSqliteDatabase, init_transaction, runSqliteSavepoint, runSqliteWriteTransaction };
|
|
169
|
+
export { SqliteCommitEffectError, afterSqliteCommit, getSqliteDatabase, init_transaction, runSqliteSavepoint, runSqliteWriteTransaction };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type CapabilityDispatcher } from '../../capabilities/runtime/dispatcher.js';
|
|
3
|
+
export declare const TaskEditOutputSchema: z.ZodObject<{
|
|
4
|
+
ok: z.ZodLiteral<true>;
|
|
5
|
+
task: z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
title: z.ZodString;
|
|
8
|
+
body: z.ZodOptional<z.ZodString>;
|
|
9
|
+
phase: z.ZodEnum<{
|
|
10
|
+
backlog: "backlog";
|
|
11
|
+
ready: "ready";
|
|
12
|
+
active: "active";
|
|
13
|
+
review: "review";
|
|
14
|
+
closed: "closed";
|
|
15
|
+
}>;
|
|
16
|
+
resolution: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
cancelled: "cancelled";
|
|
18
|
+
done: "done";
|
|
19
|
+
duplicate: "duplicate";
|
|
20
|
+
wont_do: "wont_do";
|
|
21
|
+
}>>;
|
|
22
|
+
priority: z.ZodEnum<{
|
|
23
|
+
low: "low";
|
|
24
|
+
normal: "normal";
|
|
25
|
+
high: "high";
|
|
26
|
+
critical: "critical";
|
|
27
|
+
}>;
|
|
28
|
+
dueAt: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
30
|
+
milestoneId: z.ZodOptional<z.ZodString>;
|
|
31
|
+
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
32
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
33
|
+
delegateAgentId: z.ZodOptional<z.ZodString>;
|
|
34
|
+
source: z.ZodString;
|
|
35
|
+
locale: z.ZodOptional<z.ZodEnum<{
|
|
36
|
+
en: "en";
|
|
37
|
+
zh: "zh";
|
|
38
|
+
}>>;
|
|
39
|
+
latestContractVersion: z.ZodNumber;
|
|
40
|
+
boardRank: z.ZodDefault<z.ZodNumber>;
|
|
41
|
+
version: z.ZodNumber;
|
|
42
|
+
contract: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
taskId: z.ZodString;
|
|
44
|
+
version: z.ZodNumber;
|
|
45
|
+
objective: z.ZodString;
|
|
46
|
+
expectedOutputs: z.ZodArray<z.ZodString>;
|
|
47
|
+
acceptanceCriteria: z.ZodArray<z.ZodString>;
|
|
48
|
+
constraints: z.ZodArray<z.ZodString>;
|
|
49
|
+
approvalRequired: z.ZodArray<z.ZodString>;
|
|
50
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
51
|
+
risks: z.ZodArray<z.ZodString>;
|
|
52
|
+
acceptancePolicy: z.ZodEnum<{
|
|
53
|
+
verified_auto: "verified_auto";
|
|
54
|
+
verified_then_review: "verified_then_review";
|
|
55
|
+
manual: "manual";
|
|
56
|
+
}>;
|
|
57
|
+
outputDestinations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
58
|
+
createdBy: z.ZodObject<{
|
|
59
|
+
kind: z.ZodEnum<{
|
|
60
|
+
user: "user";
|
|
61
|
+
agent: "agent";
|
|
62
|
+
system: "system";
|
|
63
|
+
integration: "integration";
|
|
64
|
+
}>;
|
|
65
|
+
id: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
createdAt: z.ZodNumber;
|
|
68
|
+
}, z.core.$strip>>;
|
|
69
|
+
createdAt: z.ZodNumber;
|
|
70
|
+
updatedAt: z.ZodNumber;
|
|
71
|
+
closedAt: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
}, z.core.$strip>;
|
|
74
|
+
export declare const TaskDeleteOutputSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
75
|
+
ok: z.ZodLiteral<true>;
|
|
76
|
+
task: z.ZodObject<{
|
|
77
|
+
id: z.ZodString;
|
|
78
|
+
title: z.ZodString;
|
|
79
|
+
body: z.ZodOptional<z.ZodString>;
|
|
80
|
+
phase: z.ZodEnum<{
|
|
81
|
+
backlog: "backlog";
|
|
82
|
+
ready: "ready";
|
|
83
|
+
active: "active";
|
|
84
|
+
review: "review";
|
|
85
|
+
closed: "closed";
|
|
86
|
+
}>;
|
|
87
|
+
resolution: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
cancelled: "cancelled";
|
|
89
|
+
done: "done";
|
|
90
|
+
duplicate: "duplicate";
|
|
91
|
+
wont_do: "wont_do";
|
|
92
|
+
}>>;
|
|
93
|
+
priority: z.ZodEnum<{
|
|
94
|
+
low: "low";
|
|
95
|
+
normal: "normal";
|
|
96
|
+
high: "high";
|
|
97
|
+
critical: "critical";
|
|
98
|
+
}>;
|
|
99
|
+
dueAt: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
101
|
+
milestoneId: z.ZodOptional<z.ZodString>;
|
|
102
|
+
parentTaskId: z.ZodOptional<z.ZodString>;
|
|
103
|
+
ownerId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
delegateAgentId: z.ZodOptional<z.ZodString>;
|
|
105
|
+
source: z.ZodString;
|
|
106
|
+
locale: z.ZodOptional<z.ZodEnum<{
|
|
107
|
+
en: "en";
|
|
108
|
+
zh: "zh";
|
|
109
|
+
}>>;
|
|
110
|
+
latestContractVersion: z.ZodNumber;
|
|
111
|
+
boardRank: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
version: z.ZodNumber;
|
|
113
|
+
contract: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
taskId: z.ZodString;
|
|
115
|
+
version: z.ZodNumber;
|
|
116
|
+
objective: z.ZodString;
|
|
117
|
+
expectedOutputs: z.ZodArray<z.ZodString>;
|
|
118
|
+
acceptanceCriteria: z.ZodArray<z.ZodString>;
|
|
119
|
+
constraints: z.ZodArray<z.ZodString>;
|
|
120
|
+
approvalRequired: z.ZodArray<z.ZodString>;
|
|
121
|
+
assumptions: z.ZodArray<z.ZodString>;
|
|
122
|
+
risks: z.ZodArray<z.ZodString>;
|
|
123
|
+
acceptancePolicy: z.ZodEnum<{
|
|
124
|
+
verified_auto: "verified_auto";
|
|
125
|
+
verified_then_review: "verified_then_review";
|
|
126
|
+
manual: "manual";
|
|
127
|
+
}>;
|
|
128
|
+
outputDestinations: z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
129
|
+
createdBy: z.ZodObject<{
|
|
130
|
+
kind: z.ZodEnum<{
|
|
131
|
+
user: "user";
|
|
132
|
+
agent: "agent";
|
|
133
|
+
system: "system";
|
|
134
|
+
integration: "integration";
|
|
135
|
+
}>;
|
|
136
|
+
id: z.ZodOptional<z.ZodString>;
|
|
137
|
+
}, z.core.$strip>;
|
|
138
|
+
createdAt: z.ZodNumber;
|
|
139
|
+
}, z.core.$strip>>;
|
|
140
|
+
createdAt: z.ZodNumber;
|
|
141
|
+
updatedAt: z.ZodNumber;
|
|
142
|
+
closedAt: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
}, z.core.$strip>;
|
|
144
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
145
|
+
ok: z.ZodLiteral<false>;
|
|
146
|
+
reason: z.ZodLiteral<"not_found">;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
ok: z.ZodLiteral<false>;
|
|
149
|
+
reason: z.ZodLiteral<"active_run">;
|
|
150
|
+
run: z.ZodObject<{
|
|
151
|
+
id: z.ZodString;
|
|
152
|
+
taskId: z.ZodString;
|
|
153
|
+
rootRunId: z.ZodString;
|
|
154
|
+
parentRunId: z.ZodOptional<z.ZodString>;
|
|
155
|
+
attempt: z.ZodNumber;
|
|
156
|
+
status: z.ZodEnum<{
|
|
157
|
+
failed: "failed";
|
|
158
|
+
succeeded: "succeeded";
|
|
159
|
+
waiting: "waiting";
|
|
160
|
+
cancelled: "cancelled";
|
|
161
|
+
queued: "queued";
|
|
162
|
+
running: "running";
|
|
163
|
+
verifying: "verifying";
|
|
164
|
+
}>;
|
|
165
|
+
executorKind: z.ZodEnum<{
|
|
166
|
+
agent: "agent";
|
|
167
|
+
workflow: "workflow";
|
|
168
|
+
human: "human";
|
|
169
|
+
external: "external";
|
|
170
|
+
}>;
|
|
171
|
+
executorRef: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
172
|
+
trigger: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
173
|
+
correlationId: z.ZodString;
|
|
174
|
+
causationId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
idempotencyKey: z.ZodString;
|
|
176
|
+
contractVersion: z.ZodNumber;
|
|
177
|
+
contextSnapshotId: z.ZodOptional<z.ZodString>;
|
|
178
|
+
policySnapshot: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
179
|
+
conversationId: z.ZodOptional<z.ZodString>;
|
|
180
|
+
queuedAt: z.ZodNumber;
|
|
181
|
+
scheduledAt: z.ZodOptional<z.ZodNumber>;
|
|
182
|
+
startedAt: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
heartbeatAt: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
completedAt: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
timeoutAt: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
leaseOwner: z.ZodOptional<z.ZodString>;
|
|
187
|
+
leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
retryPolicy: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
189
|
+
retryOfRunId: z.ZodOptional<z.ZodString>;
|
|
190
|
+
terminalCode: z.ZodOptional<z.ZodString>;
|
|
191
|
+
terminalMessage: z.ZodOptional<z.ZodString>;
|
|
192
|
+
version: z.ZodNumber;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
}, z.core.$strip>]>;
|
|
195
|
+
export declare function registerTaskManagementCapabilities(dispatcher: CapabilityDispatcher, wake?: (runs: boolean) => void): void;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
+
import { TaskRunSchema } from "../../../packages/gateway-contract/src/task-runs.js";
|
|
3
|
+
import { TaskBoardPositionRequestSchema, TaskPatchRequestSchema, TaskSchema } from "../../../packages/gateway-contract/src/tasks.js";
|
|
4
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
|
+
import { enqueueTaskChangedEvent, init_task_change_events } from "../task-change-events.js";
|
|
6
|
+
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
7
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
|
+
import { defineAtomicCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
9
|
+
import { TaskDeletionService } from "../task-deletion-service.js";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
//#region src/tasks/capabilities/management.ts
|
|
12
|
+
init_src();
|
|
13
|
+
init_transaction();
|
|
14
|
+
init_task_change_events();
|
|
15
|
+
init_task_repository();
|
|
16
|
+
const TaskEditOutputSchema = z.object({
|
|
17
|
+
ok: z.literal(true),
|
|
18
|
+
task: TaskSchema
|
|
19
|
+
});
|
|
20
|
+
const TaskDeleteOutputSchema = z.union([
|
|
21
|
+
z.object({
|
|
22
|
+
ok: z.literal(true),
|
|
23
|
+
task: TaskSchema
|
|
24
|
+
}),
|
|
25
|
+
z.object({
|
|
26
|
+
ok: z.literal(false),
|
|
27
|
+
reason: z.literal("not_found")
|
|
28
|
+
}),
|
|
29
|
+
z.object({
|
|
30
|
+
ok: z.literal(false),
|
|
31
|
+
reason: z.literal("active_run"),
|
|
32
|
+
run: TaskRunSchema
|
|
33
|
+
})
|
|
34
|
+
]);
|
|
35
|
+
function registerTaskManagementCapabilities(dispatcher, wake) {
|
|
36
|
+
const tasks = new TaskRepository();
|
|
37
|
+
const policy = {
|
|
38
|
+
majorVersion: 1,
|
|
39
|
+
effect: "local-write",
|
|
40
|
+
surfaces: ["http"],
|
|
41
|
+
scopes: ["tasks.write"],
|
|
42
|
+
afterCommit: () => wake?.(false)
|
|
43
|
+
};
|
|
44
|
+
dispatcher.register(defineAtomicCapability({
|
|
45
|
+
...policy,
|
|
46
|
+
id: "xopc.tasks.update",
|
|
47
|
+
description: "Update task metadata at an exact version.",
|
|
48
|
+
input: TaskPatchRequestSchema.extend({ taskId: z.string().min(1) }),
|
|
49
|
+
output: TaskEditOutputSchema,
|
|
50
|
+
execute({ taskId, ...patch }, caller) {
|
|
51
|
+
const task = tasks.update(taskId, patch);
|
|
52
|
+
if (!task) throw new CapabilityError("REVISION_CONFLICT", "Task changed or was not found");
|
|
53
|
+
enqueueTaskChangedEvent(getSqliteDatabase(), {
|
|
54
|
+
taskId,
|
|
55
|
+
projectId: task.projectId,
|
|
56
|
+
version: task.version,
|
|
57
|
+
changedFields: Object.keys(patch).filter((field) => field !== "expectedVersion"),
|
|
58
|
+
actor: caller.actor
|
|
59
|
+
});
|
|
60
|
+
return {
|
|
61
|
+
ok: true,
|
|
62
|
+
task
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}));
|
|
66
|
+
dispatcher.register(defineAtomicCapability({
|
|
67
|
+
...policy,
|
|
68
|
+
id: "xopc.tasks.reorder",
|
|
69
|
+
description: "Reorder a task in its current board at an exact version.",
|
|
70
|
+
input: TaskBoardPositionRequestSchema.extend({ taskId: z.string().min(1) }),
|
|
71
|
+
output: TaskEditOutputSchema,
|
|
72
|
+
execute(input, caller) {
|
|
73
|
+
let task;
|
|
74
|
+
try {
|
|
75
|
+
task = tasks.reorder(input);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
throw new CapabilityError("INVALID_INPUT", error instanceof Error ? error.message : "Invalid board position");
|
|
78
|
+
}
|
|
79
|
+
if (!task) throw new CapabilityError("REVISION_CONFLICT", "Task changed or was not found");
|
|
80
|
+
enqueueTaskChangedEvent(getSqliteDatabase(), {
|
|
81
|
+
taskId: task.id,
|
|
82
|
+
projectId: task.projectId,
|
|
83
|
+
version: task.version,
|
|
84
|
+
changedFields: ["boardRank"],
|
|
85
|
+
actor: caller.actor
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
ok: true,
|
|
89
|
+
task
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}));
|
|
93
|
+
dispatcher.register(defineAtomicCapability({
|
|
94
|
+
...policy,
|
|
95
|
+
surfaces: ["http", "agent"],
|
|
96
|
+
id: "xopc.tasks.delete",
|
|
97
|
+
description: "Delete a task only when no active run exists.",
|
|
98
|
+
input: z.strictObject({
|
|
99
|
+
taskId: z.string().min(1),
|
|
100
|
+
expectedVersion: z.number().int().positive().optional()
|
|
101
|
+
}),
|
|
102
|
+
output: TaskDeleteOutputSchema,
|
|
103
|
+
execute(input) {
|
|
104
|
+
const task = tasks.get(input.taskId);
|
|
105
|
+
if (task && input.expectedVersion !== void 0 && task.version !== input.expectedVersion) throw new CapabilityError("REVISION_CONFLICT", "Task changed");
|
|
106
|
+
return new TaskDeletionService().delete(input.taskId);
|
|
107
|
+
}
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { TaskDeleteOutputSchema, TaskEditOutputSchema, registerTaskManagementCapabilities };
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { ProductReadContracts } from "../../../packages/gateway-contract/src/capabilities.js";
|
|
2
|
+
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { TaskRepository, init_task_repository } from "../task-repository.js";
|
|
4
|
+
import { TaskRunRepository, init_task_run_repository } from "../task-run-repository.js";
|
|
5
|
+
import { TaskConversationRepository } from "../task-conversation-repository.js";
|
|
6
|
+
import { TaskReadModelProjector } from "../task-read-model-projector.js";
|
|
7
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
8
|
+
import { defineReadCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
9
|
+
import { TaskContextRepository } from "../task-context-repository.js";
|
|
10
|
+
import { TaskDependencyService } from "../task-dependency-service.js";
|
|
11
|
+
import { TaskValueMetricsService } from "../task-value-metrics-service.js";
|
|
12
|
+
//#region src/tasks/capabilities/read.ts
|
|
13
|
+
init_src();
|
|
14
|
+
init_task_repository();
|
|
15
|
+
init_task_run_repository();
|
|
16
|
+
function registerTaskReadCapabilities(dispatcher) {
|
|
17
|
+
dispatcher.register(defineReadCapability({
|
|
18
|
+
id: "xopc.tasks.metrics",
|
|
19
|
+
majorVersion: 1,
|
|
20
|
+
description: "Read task outcome metrics for this personal workspace.",
|
|
21
|
+
effect: "read",
|
|
22
|
+
surfaces: [
|
|
23
|
+
"http",
|
|
24
|
+
"agent",
|
|
25
|
+
"cli"
|
|
26
|
+
],
|
|
27
|
+
scopes: ["tasks.read"],
|
|
28
|
+
...ProductReadContracts["xopc.tasks.metrics"],
|
|
29
|
+
execute: () => ({
|
|
30
|
+
ok: true,
|
|
31
|
+
metrics: new TaskValueMetricsService().get()
|
|
32
|
+
})
|
|
33
|
+
}));
|
|
34
|
+
const tasks = new TaskRepository();
|
|
35
|
+
const runs = new TaskRunRepository();
|
|
36
|
+
const projector = new TaskReadModelProjector();
|
|
37
|
+
const context = new TaskContextRepository();
|
|
38
|
+
const conversations = new TaskConversationRepository();
|
|
39
|
+
const dependencies = new TaskDependencyService();
|
|
40
|
+
dispatcher.register(defineReadCapability({
|
|
41
|
+
id: "xopc.task_runs.get",
|
|
42
|
+
majorVersion: 1,
|
|
43
|
+
description: "Read a task run, receipt, events and active waits.",
|
|
44
|
+
effect: "read",
|
|
45
|
+
surfaces: [
|
|
46
|
+
"http",
|
|
47
|
+
"agent",
|
|
48
|
+
"cli"
|
|
49
|
+
],
|
|
50
|
+
scopes: ["tasks.read"],
|
|
51
|
+
...ProductReadContracts["xopc.task_runs.get"],
|
|
52
|
+
execute({ id }) {
|
|
53
|
+
const run = runs.get(id);
|
|
54
|
+
if (!run) throw new CapabilityError("NOT_FOUND", `TaskRun not found: ${id}`);
|
|
55
|
+
return {
|
|
56
|
+
ok: true,
|
|
57
|
+
run,
|
|
58
|
+
receipt: runs.getReceipt(id),
|
|
59
|
+
events: runs.listEvents(id),
|
|
60
|
+
activeWaits: runs.listActiveWaits(run.taskId)
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
dispatcher.register(defineReadCapability({
|
|
65
|
+
id: "xopc.task_runs.list",
|
|
66
|
+
majorVersion: 1,
|
|
67
|
+
description: "List executions and receipts for a task.",
|
|
68
|
+
effect: "read",
|
|
69
|
+
surfaces: [
|
|
70
|
+
"http",
|
|
71
|
+
"agent",
|
|
72
|
+
"cli"
|
|
73
|
+
],
|
|
74
|
+
scopes: ["tasks.read"],
|
|
75
|
+
...ProductReadContracts["xopc.task_runs.list"],
|
|
76
|
+
execute({ taskId, limit }) {
|
|
77
|
+
if (!tasks.get(taskId)) throw new CapabilityError("NOT_FOUND", `Task not found: ${taskId}`);
|
|
78
|
+
return {
|
|
79
|
+
ok: true,
|
|
80
|
+
taskId,
|
|
81
|
+
items: runs.listByTask(taskId, limit),
|
|
82
|
+
receipts: runs.listReceipts(taskId, limit),
|
|
83
|
+
activeWaits: runs.listActiveWaits(taskId)
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}));
|
|
87
|
+
dispatcher.register(defineReadCapability({
|
|
88
|
+
id: "xopc.tasks.get",
|
|
89
|
+
majorVersion: 1,
|
|
90
|
+
description: "Read a task, its current execution, context and dependencies.",
|
|
91
|
+
effect: "read",
|
|
92
|
+
surfaces: [
|
|
93
|
+
"http",
|
|
94
|
+
"agent",
|
|
95
|
+
"cli",
|
|
96
|
+
"extension"
|
|
97
|
+
],
|
|
98
|
+
scopes: ["tasks.read"],
|
|
99
|
+
...ProductReadContracts["xopc.tasks.get"],
|
|
100
|
+
execute({ id }) {
|
|
101
|
+
const task = tasks.get(id);
|
|
102
|
+
if (!task) throw new CapabilityError("NOT_FOUND", `Task not found: ${id}`);
|
|
103
|
+
return {
|
|
104
|
+
ok: true,
|
|
105
|
+
...projector.project(task),
|
|
106
|
+
waits: runs.listActiveWaits(id),
|
|
107
|
+
runs: runs.listByTask(id),
|
|
108
|
+
receipts: runs.listReceipts(id),
|
|
109
|
+
context: context.list(id),
|
|
110
|
+
conversation: conversations.requireState(id),
|
|
111
|
+
sessions: conversations.listSessions(id),
|
|
112
|
+
authorityGrants: context.listActiveGrants(id),
|
|
113
|
+
dependencies: dependencies.listDependencies(id),
|
|
114
|
+
dependents: dependencies.listDependents(id)
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}));
|
|
118
|
+
dispatcher.register(defineReadCapability({
|
|
119
|
+
id: "xopc.tasks.list",
|
|
120
|
+
majorVersion: 1,
|
|
121
|
+
description: "List tasks with filters and pagination.",
|
|
122
|
+
effect: "read",
|
|
123
|
+
surfaces: [
|
|
124
|
+
"http",
|
|
125
|
+
"agent",
|
|
126
|
+
"cli",
|
|
127
|
+
"extension"
|
|
128
|
+
],
|
|
129
|
+
scopes: ["tasks.read"],
|
|
130
|
+
...ProductReadContracts["xopc.tasks.list"],
|
|
131
|
+
execute(input) {
|
|
132
|
+
return {
|
|
133
|
+
ok: true,
|
|
134
|
+
items: tasks.list(input).map((task) => projector.project(task)),
|
|
135
|
+
total: tasks.count(input)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
//#endregion
|
|
141
|
+
export { registerTaskReadCapabilities };
|