@xopcai/xopc 0.0.468 → 0.0.470
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 +5 -0
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agents-CIV2R_El.js → agents-DZftplJc.js} +3 -3
- package/dist/gateway/static/root/assets/{api-Cl08_xtM.js → api-BnS9d0p6.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-BkEO3eBe.js → app-link-CauYDM-y.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-CncU5JvR.js → apps-page-CXKTWj1s.js} +1 -1
- package/dist/gateway/static/root/assets/arrow-down-to-line-C5D8Vt-L.js +1 -0
- package/dist/gateway/static/root/assets/{attachment-load-DrVGNxJm.js → attachment-load-C9iZLUHv.js} +1 -1
- package/dist/gateway/static/root/assets/attachment-preview-renderer-_6GhoCYk.js +12 -0
- package/dist/gateway/static/root/assets/attachment-utils-core-BPYdUI6y.js +1 -0
- package/dist/gateway/static/root/assets/{automation-task-card-sR61FFLn.js → automation-task-card-BNT3n0qu.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BNzj3R7A.js → automations-page-DqrAOReO.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BYmFhO8E.js +9 -0
- package/dist/gateway/static/root/assets/binary-plugins-CnFVuJtL.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-B4Yqbxab.js → block-editor-jy5CCmhH.js} +9 -9
- package/dist/gateway/static/root/assets/{capabilities-CBSMm_jo.js → capabilities-CaJjMTli.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-YmBD7oK8.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-XgIRdqCb.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DfyND0IO.js +8 -0
- package/dist/gateway/static/root/assets/channels-DwUmMnA1.js +1 -0
- package/dist/gateway/static/root/assets/{chat-chart-block-CS-cORJt.js → chat-chart-block-B_c5sy7q.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-DfFXhDRv.js +72 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-D6LH3W5H.js → chat-terminal-dock-Dn7Cm1O4.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-CxeXJKxg.js → connected-providers-grid-DUHMZjyV.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-Bsec3-eZ.js → connector-service-page-DLbBblN2.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-C0ZCUtxF.js → connectors-page-HHGB3r3Q.js} +1 -1
- package/dist/gateway/static/root/assets/constants-D5Z-mUto.js +1 -0
- package/dist/gateway/static/root/assets/{device-pairing-wizard-diuSsk-H.js → device-pairing-wizard-eWeHH6Ru.js} +1 -1
- package/dist/gateway/static/root/assets/extension-authoritative-grants-BqtUnmq-.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-DrpE2lQ3.js → extension-debug-page-DIAyDA-a.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-hr60GwXQ.js → extension-iframe-host-CCe4R7L7.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-aoF3x4-X.js → extension-message-router-BD0ZamBV.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BfM8zli6.js → extension-page-C09dlV3J.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-BcSgVeKW.js → extension-provider-BhluafoX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Db5t2Mz0.js → extension-settings-page-CB8KLYoG.js} +1 -1
- package/dist/gateway/static/root/assets/file-CStvVK2S.js +1 -0
- package/dist/gateway/static/root/assets/{file-BqMS_3DT.js → file-code-corner-byQA1VfD.js} +1 -1
- package/dist/gateway/static/root/assets/file-icon-N6WjUhq_.js +1 -0
- package/dist/gateway/static/root/assets/file-tree-CYUkQR1t.js +1 -0
- package/dist/gateway/static/root/assets/{home-page-DsS2UT08.js → home-page-8KwhWlYt.js} +3 -3
- package/dist/gateway/static/root/assets/index-CQNwlXpQ.js +11 -0
- package/dist/gateway/static/root/assets/index-CZUfwwLp.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-0_PeJJqO.js → install-connector-dialog-BZjodnUC.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DmzgjJNj.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-yBqRl5Bi.js → local-apps-page-Ct8z2B7R.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-CH9amuGc.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-D9HGIYXx.js → management-settings-CUQd0FJ3.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CiGdWuN3.js → markdown-view-Dm01GIXv.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-C2lp7UmI.js → media-plugins-jsWNdARw.js} +1 -1
- package/dist/gateway/static/root/assets/models-hub-cache-B2QcrY4n.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-DeFb2HEC.js +7 -0
- package/dist/gateway/static/root/assets/note-image-lightbox-DUzoWZEe.js +1 -0
- package/dist/gateway/static/root/assets/notes-api-BMSPkAm8.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-nvqpOeHp.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-provider-connect-BW7zcXfb.js → oauth-provider-connect-BexlZuZ4.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-Cw58-5P3.js → page-context-capture-button-Cn4zi3Mt.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-1-lflHAx.js +1 -0
- package/dist/gateway/static/root/assets/personal-avatar-CM3vUGhL.js +1 -0
- package/dist/gateway/static/root/assets/personal-avatar-DsEp8QJ7.css +1 -0
- package/dist/gateway/static/root/assets/personal-page-HFjWZacf.js +1 -0
- package/dist/gateway/static/root/assets/{personal-profile-settings-CDrzvI35.js → personal-profile-settings-CNI5Eor6.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CoZ3qWSr.js → personal-settings-panel-BcrpYRn9.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-UHVwbC3H.js → phone-model-connection-DKvOEjWH.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-fS2IT-dK.js → phone-settings-page-DvX6okzz.js} +1 -1
- package/dist/gateway/static/root/assets/playback-coordinator-CWHIf0wr.js +1 -0
- package/dist/gateway/static/root/assets/presentation-D-Ui_vVA.js +1 -0
- package/dist/gateway/static/root/assets/preview-runtime-RnBDP-Lq.js +15 -0
- package/dist/gateway/static/root/assets/product-automation-feedback-xAcXeJM2.js +7 -0
- package/dist/gateway/static/root/assets/product-delivery-4gEqUIsK.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BMJ2x5m3.js → product-open-page-DXwOPgRP.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-lkkZPvMa.js → product-preview-content-DiQbeaCK.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-DtUBJGs5.js → product-preview-modal-BU7Qojpq.js} +2 -2
- package/dist/gateway/static/root/assets/project-detail-page-Dr5_WPRB.js +7 -0
- package/dist/gateway/static/root/assets/{projects-page-Dua6taaG.js → projects-page-DGATZB23.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-B6eZLEnh.js → providers-api-BXa2Aheb.js} +1 -1
- package/dist/gateway/static/root/assets/recording-upload-CQdhrRq3.js +1 -0
- package/dist/gateway/static/root/assets/{remote-access-hub-Dy3-oGK1.js → remote-access-hub-_7tmWand.js} +1 -1
- package/dist/gateway/static/root/assets/right-workspace-store-NXMrEuwH.js +1 -0
- package/dist/gateway/static/root/assets/route-preload-D-pdVwIK.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-rjq-8nZ8.js +2 -0
- package/dist/gateway/static/root/assets/scan-search-CSIGkseh.js +1 -0
- package/dist/gateway/static/root/assets/{service-recommendation-list-CsU74h1b.js → service-recommendation-list-2UOjV0Mx.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-BVS3zxRZ.js +22 -0
- package/dist/gateway/static/root/assets/{settings-page-ByFNIBfp.js → settings-page-bCW4rave.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-Bsn4Wa4p.js → setup-interaction-page-BYXDX0F2.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-CstjOb7g.js → setup-status-panel-Bhda3jS2.js} +1 -1
- package/dist/gateway/static/root/assets/share-preview-page-nzWjWhqF.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-LB3SYKFS.js +1 -0
- package/dist/gateway/static/root/assets/sheet-C2H8iR8Y.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-CkkHufmv.js → skills-page-CfhEcU8L.js} +1 -1
- package/dist/gateway/static/root/assets/space-api-DaKpHc_7.js +1 -0
- package/dist/gateway/static/root/assets/space-page-BXyQdUvp.js +2 -0
- package/dist/gateway/static/root/assets/star-BuMAkjC9.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-gffrDRvW.js +3 -0
- package/dist/gateway/static/root/assets/task-header-title-DwtjUOBg.js +1 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-dtN1sSjU.js → task-result-evidence-Bmgta9z9.js} +1 -1
- package/dist/gateway/static/root/assets/tasks-BIehlq7k.js +1 -0
- package/dist/gateway/static/root/assets/turn-outcome-BSbEJx8h.js +1 -0
- package/dist/gateway/static/root/assets/use-composer-attachments-sszsCdh5.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-D4b4fDeu.js +1 -0
- package/dist/gateway/static/root/assets/use-personal-profile-CNPszzzT.js +1 -0
- package/dist/gateway/static/root/assets/use-personal-work-C-rw8XVO.js +1 -0
- package/dist/gateway/static/root/assets/{use-realtime-voice-lRHVixh4.js → use-realtime-voice-cugjs8cK.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-DrWnW1aA.js → use-workspace-tree-Crfx5ctU.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Bw1_PGdD.js → user-model-page-BvnLbTYx.js} +1 -1
- package/dist/gateway/static/root/assets/video-generation-Cec49Jwg.js +1 -0
- package/dist/gateway/static/root/assets/voice-player-store-DZGlzjva.js +1 -0
- package/dist/gateway/static/root/assets/voice-settings-BzfNK5Jm.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DcZS4OMj.js → work-discovery-overlay-DpEYgcG2.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CZF9iWPT.js → work-discovery-page-DappIHQq.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-api-g-wCKoQU.js +2 -0
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-DxaxVC3q.js +1 -0
- package/dist/gateway/static/root/assets/workspace-preview-store-DoIjn_2j.js +1 -0
- package/dist/gateway/static/root/index.html +90 -77
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +7 -0
- package/dist/packages/gateway-contract/src/capabilities.js +1 -1
- package/dist/packages/gateway-contract/src/clarifications.js +20 -2
- package/dist/packages/gateway-contract/src/index.js +6 -4
- package/dist/packages/gateway-contract/src/space.js +23 -0
- package/dist/packages/gateway-contract/src/task-lifecycle.js +1 -0
- package/dist/packages/gateway-contract/src/task-result-delivery.js +1 -0
- package/dist/packages/gateway-contract/src/task-runs.js +1 -0
- package/dist/packages/gateway-contract/src/tasks.js +118 -6
- package/dist/packages/gateway-contract/src/turn-outcome.js +16 -2
- package/dist/packages/gateway-contract/src/video-generation.js +29 -4
- package/dist/src/agent/agent-manager.js +2 -2
- package/dist/src/agent/embedded/agent-profile-context.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/orchestration/delegation-budget.d.ts +2 -2
- package/dist/src/agent/orchestration/turn-recovery.d.ts +12 -3
- package/dist/src/agent/orchestration/turn-recovery.js +25 -6
- package/dist/src/agent/service/process-direct-streaming.js +1 -1
- package/dist/src/agent/service/webchat-tts.js +1 -1
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/apply-patch.js +1 -1
- package/dist/src/agent/tools/factory.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +1 -0
- package/dist/src/agent/tools/language-diagnostics.js +1 -1
- package/dist/src/agent/tools/personal-task-tool.d.ts +1 -0
- package/dist/src/agent/tools/personal-task-tool.js +12 -7
- package/dist/src/agent/tools/publish-artifacts.js +2 -1
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -0
- package/dist/src/agent/tools/tool-media.d.ts +3 -1
- package/dist/src/agent/tools/tool-media.js +2 -0
- package/dist/src/agent/tools/xopc-use-tool.js +21 -4
- package/dist/src/agent-catalog/test-support.js +1 -1
- package/dist/src/agent-matching/delegation-service.js +1 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +30 -6
- package/dist/src/automations/capabilities/write.js +2 -2
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/domain/types.d.ts +6 -0
- package/dist/src/automations/domain/validation.d.ts +60 -12
- package/dist/src/automations/domain/validation.js +7 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +12 -3
- package/dist/src/automations/draft/automation-draft-validator.js +1 -0
- package/dist/src/automations/service/action-executor.js +14 -2
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/computer/diagnostics.d.ts +9 -9
- package/dist/src/computer/errors.d.ts +2 -2
- package/dist/src/computer/evaluation.d.ts +7 -7
- package/dist/src/computer/runtime.d.ts +4 -4
- package/dist/src/config/schema.d.ts +2 -2
- package/dist/src/discussions/action-tasks.d.ts +2 -2
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/inventory.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/setup.d.ts +3 -3
- package/dist/src/gateway/hono/routes/commands-skills.js +1 -1
- package/dist/src/gateway/hono/routes/connectors.js +2 -2
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/music-generation.js +2 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +214 -5
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/space.d.ts +3 -0
- package/dist/src/gateway/hono/routes/space.js +105 -0
- package/dist/src/gateway/hono/routes/tasks.js +27 -28
- package/dist/src/gateway/hono/routes/video-generation.js +8 -5
- package/dist/src/gateway/html-preview-shell.d.ts +1 -1
- package/dist/src/gateway/html-preview-shell.js +3 -0
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service/config-coordinator.d.ts +1 -1
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +10 -3
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +2 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +18 -1
- package/dist/src/home-intelligence/follow-ups.js +2 -1
- package/dist/src/home-intelligence/routines.js +1 -1
- package/dist/src/local-apps/automation-proposals.d.ts +54 -12
- package/dist/src/local-apps/capabilities/projections.d.ts +7 -7
- package/dist/src/local-apps/preview-fixtures.d.ts +1 -1
- package/dist/src/media/session-references.d.ts +4 -1
- package/dist/src/media/session-references.js +40 -8
- package/dist/src/music-generation/artifact.js +3 -1
- package/dist/src/music-generation/providers.js +26 -15
- package/dist/src/music-generation/repository.js +8 -1
- package/dist/src/music-generation/xopc-cloud.d.ts +2 -0
- package/dist/src/music-generation/xopc-cloud.js +38 -0
- package/dist/src/personal-agent/capability-service.js +1 -1
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/prompt-context.js +1 -1
- package/dist/src/personal-agent/prompts.js +1 -1
- package/dist/src/personal-agent/reply-composer.js +16 -7
- package/dist/src/personal-agent/repository.js +1 -1
- package/dist/src/personal-agent/request-delivery.js +17 -7
- package/dist/src/personal-agent/request-service.js +6 -10
- package/dist/src/personal-agent/result-extraction.js +13 -13
- package/dist/src/personal-agent/schedules.d.ts +9 -0
- package/dist/src/personal-agent/schedules.js +44 -0
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +6 -1
- package/dist/src/providers/model-catalog-store.js +1 -0
- package/dist/src/providers/model-catalog-types.d.ts +2 -0
- package/dist/src/providers/xopc-cloud-media-manifest.d.ts +24 -0
- package/dist/src/providers/xopc-cloud-media-manifest.js +28 -0
- package/dist/src/providers/xopc-cloud-media.d.ts +28 -0
- package/dist/src/providers/xopc-cloud-media.js +67 -0
- package/dist/src/providers/xopc-cloud-model-source.js +4 -0
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/runtime-tools/phone-dependencies.js +1 -1
- package/dist/src/session/client-history.d.ts +4 -1
- package/dist/src/session/client-history.js +18 -0
- package/dist/src/session/compact-history.js +30 -1
- package/dist/src/session/turn-outcome-projector.js +1 -1
- package/dist/src/space/ingest.d.ts +36 -0
- package/dist/src/space/ingest.js +149 -0
- package/dist/src/space/repository.d.ts +39 -0
- package/dist/src/space/repository.js +325 -0
- package/dist/src/space/worker.d.ts +14 -0
- package/dist/src/space/worker.js +199 -0
- package/dist/src/storage/sqlite/clarification-wait-repository.js +7 -4
- package/dist/src/storage/sqlite/row-mappers.d.ts +1 -0
- package/dist/src/storage/sqlite/row-mappers.js +9 -2
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +8 -7
- package/dist/src/storage/sqlite/schema.sql +103 -0
- package/dist/src/storage/sqlite/transcript-repository.js +8 -0
- package/dist/src/storage/sqlite/upgrades/279_task_model_cutover.sql +288 -0
- package/dist/src/storage/sqlite/upgrades/280_space.sql +61 -0
- package/dist/src/tasks/capabilities/management.d.ts +15 -2
- package/dist/src/tasks/capabilities/management.js +8 -2
- package/dist/src/tasks/capabilities/read.js +14 -2
- package/dist/src/tasks/capabilities/relations.d.ts +13 -7
- package/dist/src/tasks/capabilities/write.d.ts +118 -2
- package/dist/src/tasks/capabilities/write.js +2 -0
- package/dist/src/tasks/home-query-service.js +7 -9
- package/dist/src/tasks/task-allocation-service.js +2 -2
- package/dist/src/tasks/task-application-service.d.ts +8 -2
- package/dist/src/tasks/task-application-service.js +94 -27
- package/dist/src/tasks/task-collaboration-repository.js +12 -1
- package/dist/src/tasks/task-context-assembler.js +9 -3
- package/dist/src/tasks/task-contract-planner.js +1 -3
- package/dist/src/tasks/task-conversation-summary.d.ts +33 -2
- package/dist/src/tasks/task-conversation-summary.js +3 -1
- package/dist/src/tasks/task-criterion-review-repository.d.ts +31 -2
- package/dist/src/tasks/task-criterion-review-repository.js +70 -23
- package/dist/src/tasks/task-deliverables.d.ts +7 -0
- package/dist/src/tasks/task-deliverables.js +112 -0
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-instruction-sequence.js +10 -3
- package/dist/src/tasks/task-json-acceptance.js +3 -5
- package/dist/src/tasks/task-origin-repository.d.ts +99 -1
- package/dist/src/tasks/task-origin-repository.js +67 -5
- package/dist/src/tasks/task-read-model-projector.d.ts +4 -1
- package/dist/src/tasks/task-read-model-projector.js +123 -9
- package/dist/src/tasks/task-repository.d.ts +4 -1
- package/dist/src/tasks/task-repository.js +34 -11
- package/dist/src/tasks/task-research-repair.d.ts +2 -2
- package/dist/src/tasks/task-research-result.d.ts +1 -0
- package/dist/src/tasks/task-research-result.js +13 -3
- package/dist/src/tasks/task-result-delivery-repository.d.ts +4 -3
- package/dist/src/tasks/task-result-delivery-repository.js +35 -17
- package/dist/src/tasks/task-result-delivery-service.js +22 -7
- package/dist/src/tasks/task-result-versions.d.ts +11 -0
- package/dist/src/tasks/task-result-versions.js +34 -0
- package/dist/src/tasks/task-run-coordinator.js +28 -15
- package/dist/src/tasks/task-run-dispatcher.js +29 -4
- package/dist/src/tasks/task-run-repository.d.ts +2 -0
- package/dist/src/tasks/task-run-repository.js +62 -19
- package/dist/src/tasks/task-workspace-verification.d.ts +16 -0
- package/dist/src/tasks/task-workspace-verification.js +95 -0
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/video-generation/artifact.js +3 -1
- package/dist/src/video-generation/drafts.js +4 -0
- package/dist/src/video-generation/providers.d.ts +1 -0
- package/dist/src/video-generation/providers.js +37 -5
- package/dist/src/video-generation/repository.js +8 -1
- package/dist/src/video-generation/settings.d.ts +1 -0
- package/dist/src/video-generation/settings.js +10 -4
- package/dist/src/voice/realtime/runtime.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/attachment-preview-renderer-DdOEgexg.js +0 -12
- package/dist/gateway/static/root/assets/attachment-utils-core-BIOUBrpT.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-BWpA-X_S.js +0 -9
- package/dist/gateway/static/root/assets/binary-plugins-BjEE5sVq.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-EmBa4Blq.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-BQf7oyqc.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-hlByP8SE.js +0 -8
- package/dist/gateway/static/root/assets/channels-oyMymJDx.js +0 -1
- package/dist/gateway/static/root/assets/chat-page-hcsqrv-7.js +0 -71
- package/dist/gateway/static/root/assets/constants-Bg1wM2nv.js +0 -1
- package/dist/gateway/static/root/assets/extension-authoritative-grants-CVQ7q0DU.js +0 -1
- package/dist/gateway/static/root/assets/file-tree-CFlZnV3Y.js +0 -1
- package/dist/gateway/static/root/assets/index-DFa0pZhC.js +0 -11
- package/dist/gateway/static/root/assets/index-DHPaL7Ku.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-OSinc6m6.js +0 -1
- package/dist/gateway/static/root/assets/local-apps-DeqzkJiF.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-BJxQ_Jd5.js +0 -2
- package/dist/gateway/static/root/assets/models-hub-cache-CmdULYFt.js +0 -1
- package/dist/gateway/static/root/assets/note-detail-panel-CVEG1JdF.js +0 -7
- package/dist/gateway/static/root/assets/note-image-lightbox-WA8FiHsm.js +0 -1
- package/dist/gateway/static/root/assets/notes-api-BQXOYFQ5.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-Cc-c1Yhg.js +0 -8
- package/dist/gateway/static/root/assets/page-header-store-DwFwq_lI.js +0 -1
- package/dist/gateway/static/root/assets/personal-avatar-B-Oes3ef.js +0 -1
- package/dist/gateway/static/root/assets/personal-avatar-BUCb7OiW.css +0 -1
- package/dist/gateway/static/root/assets/personal-page-DWPu-iwK.js +0 -1
- package/dist/gateway/static/root/assets/phone-DdhTnt6X.js +0 -1
- package/dist/gateway/static/root/assets/product-automation-feedback-DrBclzH1.js +0 -7
- package/dist/gateway/static/root/assets/product-delivery-CnvCn9L-.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DGFUj6jS.js +0 -7
- package/dist/gateway/static/root/assets/recording-upload-DXxD6grq.js +0 -1
- package/dist/gateway/static/root/assets/right-workspace-store-BzXnZDK5.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-8KCgPcjp.js +0 -2
- package/dist/gateway/static/root/assets/routine-panel-BALhliq6.js +0 -2
- package/dist/gateway/static/root/assets/session-manager-Cby6Nkib.js +0 -25
- package/dist/gateway/static/root/assets/share-preview-page-9pOnypJv.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-CJdVDQqf.js +0 -1
- package/dist/gateway/static/root/assets/star-CnYNmpLd.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BjBkKeIf.js +0 -3
- package/dist/gateway/static/root/assets/tasks-BTLabOMp.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-BEYkb8cs.js +0 -2
- package/dist/gateway/static/root/assets/use-file-preview-expanded-CQeo2Ztn.js +0 -15
- package/dist/gateway/static/root/assets/use-personal-profile-CKm5FaTl.js +0 -1
- package/dist/gateway/static/root/assets/video-generation-D08uZbsu.js +0 -1
- package/dist/gateway/static/root/assets/voice-settings-CssuMBjt.js +0 -1
- package/dist/gateway/static/root/assets/with-selector-xonYxPoM.js +0 -1
- package/dist/gateway/static/root/assets/workspace-api-BfApIXLw.js +0 -2
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-BRhsCs1S.js +0 -1
- package/dist/gateway/static/root/assets/workspace-preview-store-BrofEVle.js +0 -1
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
3
|
+
import { getClarification } from "../storage/sqlite/clarification-wait-repository.js";
|
|
2
4
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
5
|
+
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
3
6
|
//#region src/tasks/task-origin-repository.ts
|
|
4
7
|
init_transaction();
|
|
8
|
+
init_task_run_repository();
|
|
5
9
|
var TaskOriginRepository = class {
|
|
10
|
+
listCurrent(conversationId) {
|
|
11
|
+
const rows = getSqliteDatabase().prepare(`SELECT task.task_id AS id
|
|
12
|
+
FROM task_origin_links origin JOIN tasks task ON task.task_id = origin.task_id
|
|
13
|
+
WHERE origin.conversation_id = ? AND (task.phase <> 'closed' OR (task.resolution = 'done' AND EXISTS (
|
|
14
|
+
SELECT 1 FROM task_waits wait WHERE wait.task_id = task.task_id AND wait.status = 'active'
|
|
15
|
+
)))
|
|
16
|
+
ORDER BY task.updated_at DESC, task.task_id DESC`).all(conversationId);
|
|
17
|
+
const projector = new TaskReadModelProjector();
|
|
18
|
+
const runs = new TaskRunRepository();
|
|
19
|
+
const deliveries = new TaskResultDeliveryRepository();
|
|
20
|
+
return rows.flatMap(({ id }) => {
|
|
21
|
+
const model = projector.get(id);
|
|
22
|
+
if (!model) return [];
|
|
23
|
+
const { task, operationalState } = model;
|
|
24
|
+
const attention = model.attention.find((item) => item.kind === "approval_required" || item.kind === "input_required");
|
|
25
|
+
const clarificationId = attention?.sourceId ? runs.getWait(attention.sourceId)?.condition.clarificationId : void 0;
|
|
26
|
+
const clarification = typeof clarificationId === "string" ? getClarification(clarificationId) : void 0;
|
|
27
|
+
const prompt = clarification?.status === "open" && (!clarification.expiresAt || clarification.expiresAt > Date.now()) ? {
|
|
28
|
+
id: clarification.id,
|
|
29
|
+
conversationId: clarification.conversationId
|
|
30
|
+
} : void 0;
|
|
31
|
+
return [{
|
|
32
|
+
id,
|
|
33
|
+
title: task.title,
|
|
34
|
+
phase: task.phase,
|
|
35
|
+
operationalState,
|
|
36
|
+
resolution: task.resolution,
|
|
37
|
+
updatedAt: task.updatedAt,
|
|
38
|
+
presentation: model.presentation,
|
|
39
|
+
attention: clarification && !prompt ? void 0 : attention,
|
|
40
|
+
prompt,
|
|
41
|
+
artifact: task.phase === "review" ? deliveries.fileDeliveryState(id, conversationId, true).artifact : void 0
|
|
42
|
+
}];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
6
45
|
owns(taskId, conversationId) {
|
|
7
46
|
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM task_origin_links
|
|
8
47
|
WHERE task_id = ? AND conversation_id = ?`).get(taskId, conversationId));
|
|
@@ -27,17 +66,40 @@ var TaskOriginRepository = class {
|
|
|
27
66
|
const projector = new TaskReadModelProjector();
|
|
28
67
|
return {
|
|
29
68
|
total,
|
|
30
|
-
items: rows.
|
|
69
|
+
items: rows.flatMap(({ runStatus, ...row }) => {
|
|
31
70
|
const model = projector.get(row.id);
|
|
32
|
-
return {
|
|
71
|
+
return model ? [{
|
|
33
72
|
...row,
|
|
34
|
-
allocation: model
|
|
35
|
-
operationalState: model
|
|
73
|
+
allocation: model.allocation,
|
|
74
|
+
operationalState: model.operationalState,
|
|
75
|
+
presentation: model.presentation,
|
|
36
76
|
...runStatus ? { runStatus } : {}
|
|
37
|
-
};
|
|
77
|
+
}] : [];
|
|
38
78
|
})
|
|
39
79
|
};
|
|
40
80
|
}
|
|
81
|
+
listRecentEnded(conversationId, limit, offset) {
|
|
82
|
+
const db = getSqliteDatabase();
|
|
83
|
+
const ended = `FROM task_origin_links origin JOIN tasks task ON task.task_id = origin.task_id
|
|
84
|
+
WHERE origin.conversation_id = ? AND task.phase = 'closed' AND (task.resolution IS NOT 'done' OR NOT EXISTS (
|
|
85
|
+
SELECT 1 FROM task_waits wait WHERE wait.task_id = task.task_id AND wait.status = 'active'
|
|
86
|
+
))`;
|
|
87
|
+
const { total } = db.prepare(`SELECT count(*) AS total ${ended}`).get(conversationId);
|
|
88
|
+
const items = db.prepare(`SELECT task.task_id AS id, task.title, task.phase, task.resolution,
|
|
89
|
+
task.updated_at AS updatedAt ${ended} ORDER BY task.updated_at DESC, task.task_id DESC LIMIT ? OFFSET ?`).all(conversationId, limit, offset);
|
|
90
|
+
const deliveries = new TaskResultDeliveryRepository();
|
|
91
|
+
return {
|
|
92
|
+
total,
|
|
93
|
+
items: items.map((item) => ({
|
|
94
|
+
...item,
|
|
95
|
+
presentation: {
|
|
96
|
+
status: item.resolution === "done" ? "completed" : "ended",
|
|
97
|
+
primaryAction: { type: "view_results" }
|
|
98
|
+
},
|
|
99
|
+
artifact: item.resolution === "done" ? deliveries.fileDeliveryState(item.id, conversationId, true).artifact : void 0
|
|
100
|
+
}))
|
|
101
|
+
};
|
|
102
|
+
}
|
|
41
103
|
};
|
|
42
104
|
//#endregion
|
|
43
105
|
export { TaskOriginRepository };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import type { TaskAllocation, TaskAttentionItem, TaskDependencySummary, TaskOperationalState } from '@xopcai/gateway-contract';
|
|
1
|
+
import type { TaskAllocation, TaskAttentionItem, TaskDependencySummary, TaskOperationalState, TaskPresentation, TaskAcceptanceTarget } from '@xopcai/gateway-contract';
|
|
2
2
|
import { type TaskAggregate } from './task-repository.js';
|
|
3
3
|
export interface TaskReadModel {
|
|
4
4
|
task: TaskAggregate;
|
|
5
5
|
allocation?: TaskAllocation;
|
|
6
6
|
operationalState: TaskOperationalState;
|
|
7
|
+
presentation: TaskPresentation;
|
|
8
|
+
acceptanceTarget?: TaskAcceptanceTarget;
|
|
7
9
|
attention: TaskAttentionItem[];
|
|
8
10
|
allowedCommands: string[];
|
|
9
11
|
revisionBaseline?: {
|
|
@@ -17,6 +19,7 @@ export declare class TaskReadModelProjector {
|
|
|
17
19
|
#private;
|
|
18
20
|
get(taskId: string): TaskReadModel | undefined;
|
|
19
21
|
project(task: TaskAggregate, now?: number): TaskReadModel;
|
|
22
|
+
private presentation;
|
|
20
23
|
summary(taskId: string): TaskDependencySummary | undefined;
|
|
21
24
|
private operationalState;
|
|
22
25
|
private allowedCommands;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
3
|
+
import { init_task_instruction_sequence, taskInstructionSequence } from "./task-instruction-sequence.js";
|
|
3
4
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
4
5
|
import { resolveTaskLocale } from "./task-language.js";
|
|
5
6
|
import { TaskAllocationRepository } from "./task-allocation-repository.js";
|
|
7
|
+
import { TaskCriterionReviewRepository } from "./task-criterion-review-repository.js";
|
|
6
8
|
//#region src/tasks/task-read-model-projector.ts
|
|
7
9
|
init_transaction();
|
|
8
10
|
init_task_repository();
|
|
9
11
|
init_task_run_repository();
|
|
12
|
+
init_task_instruction_sequence();
|
|
10
13
|
var TaskReadModelProjector = class {
|
|
11
14
|
#tasks = new TaskRepository();
|
|
12
15
|
#runs = new TaskRunRepository();
|
|
@@ -33,6 +36,14 @@ var TaskReadModelProjector = class {
|
|
|
33
36
|
sourceId: allocation.id
|
|
34
37
|
});
|
|
35
38
|
for (const wait of waits) {
|
|
39
|
+
if (wait.kind === "external_event" && wait.condition.type === "run_decision") {
|
|
40
|
+
attention.push({
|
|
41
|
+
kind: "run_decision_required",
|
|
42
|
+
summary: wait.reason,
|
|
43
|
+
sourceId: wait.taskRunId
|
|
44
|
+
});
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
36
47
|
const kind = wait.kind === "approval" ? "approval_required" : wait.kind === "user_input" || wait.kind === "external_event" && typeof wait.condition.collaborationEntryId === "string" ? "input_required" : wait.kind === "dependency" ? "dependency_blocked" : void 0;
|
|
37
48
|
if (kind) attention.push({
|
|
38
49
|
kind,
|
|
@@ -40,7 +51,7 @@ var TaskReadModelProjector = class {
|
|
|
40
51
|
sourceId: wait.id
|
|
41
52
|
});
|
|
42
53
|
}
|
|
43
|
-
if (latestRun?.status === "failed") {
|
|
54
|
+
if (!attention.some((item) => item.kind === "run_decision_required") && latestRun?.status === "failed" && latestRun.contractVersion === task.latestContractVersion) {
|
|
44
55
|
const receipt = this.#runs.getReceipt(latestRun.id);
|
|
45
56
|
attention.push({
|
|
46
57
|
kind: receipt?.verification.status === "failed" ? "verification_failed" : "run_failed",
|
|
@@ -60,8 +71,9 @@ var TaskReadModelProjector = class {
|
|
|
60
71
|
hasIncompleteDependency
|
|
61
72
|
});
|
|
62
73
|
const allocating = allocation && ["pending", "selecting"].includes(allocation.status);
|
|
63
|
-
const
|
|
64
|
-
|
|
74
|
+
const hasResolvableWait = waits.some((wait) => wait.condition.type !== "connection" && wait.condition.type !== "run_decision");
|
|
75
|
+
const allowedCommands = this.allowedCommands(task, activeRun?.status, waits.length > 0, hasResolvableWait, paused).filter((command) => !(allocation && allocation.status !== "assigned" && command === "start")).filter((command) => command !== "start" || !hasIncompleteDependency).filter((command) => command !== "start" || !getSqliteDatabase().prepare("SELECT 1 FROM home_followups WHERE root_task_id=?").get(task.id));
|
|
76
|
+
if (allocation && ["blocked", "failed"].includes(allocation.status) && task.phase !== "closed" && !activeRun && !waits.length) allowedCommands.push("retry_allocation");
|
|
65
77
|
const resultRow = getSqliteDatabase().prepare(`SELECT payload_json FROM task_result_deliveries WHERE task_run_id IN
|
|
66
78
|
(SELECT run_id FROM task_runs WHERE task_id = ?) AND status IN ('pending','delivered','stale') ORDER BY created_at DESC, rowid DESC LIMIT 1`).get(task.id);
|
|
67
79
|
const result = resultRow ? JSON.parse(resultRow.payload_json) : void 0;
|
|
@@ -72,15 +84,117 @@ var TaskReadModelProjector = class {
|
|
|
72
84
|
expectedVersion: task.version
|
|
73
85
|
} : void 0;
|
|
74
86
|
if (revisionBaseline && !activeRun && !waits.length && ["closed", "review"].includes(task.phase) && (!task.resolution || task.resolution === "done") && !getSqliteDatabase().prepare("SELECT 1 FROM personal_requests WHERE task_id = ?").get(task.id)) allowedCommands.push("revise");
|
|
87
|
+
const operationalState = task.phase !== "closed" && !paused && !activeRun && waits.length === 0 && allocation ? allocating ? "allocating" : allocation.status === "blocked" ? "blocked" : allocation.status === "failed" ? "failed" : executionState : executionState;
|
|
88
|
+
const reviews = new TaskCriterionReviewRepository();
|
|
89
|
+
const target = reviews.target(task);
|
|
90
|
+
const workspaceBlocked = task.phase === "review" && !reviews.workspaceVerified(task, target);
|
|
91
|
+
const acceptanceTarget = target ? {
|
|
92
|
+
id: target.id,
|
|
93
|
+
...target.runId ? { runId: target.runId } : {},
|
|
94
|
+
canSignOff: !waits.length && !workspaceBlocked && reviews.canSignOff(task, target)
|
|
95
|
+
} : void 0;
|
|
75
96
|
return {
|
|
76
97
|
task,
|
|
77
98
|
allocation,
|
|
78
|
-
operationalState
|
|
99
|
+
operationalState,
|
|
100
|
+
presentation: this.presentation(task, operationalState, waits, attention, allowedCommands, latestRun, workspaceBlocked, acceptanceTarget),
|
|
101
|
+
acceptanceTarget,
|
|
79
102
|
attention: task.phase === "closed" && (task.resolution !== "done" || waits.length === 0) || paused ? [] : attention,
|
|
80
103
|
allowedCommands,
|
|
81
104
|
...revisionBaseline ? { revisionBaseline } : {}
|
|
82
105
|
};
|
|
83
106
|
}
|
|
107
|
+
presentation(task, state, waits, attention, commands, latestRun, workspaceBlocked, acceptance) {
|
|
108
|
+
if (task.phase === "closed") return {
|
|
109
|
+
status: task.resolution === "done" ? "completed" : "ended",
|
|
110
|
+
primaryAction: { type: "view_results" }
|
|
111
|
+
};
|
|
112
|
+
const pause = waits.find((wait) => wait.kind === "paused");
|
|
113
|
+
if (pause) return {
|
|
114
|
+
status: "paused",
|
|
115
|
+
reason: pause.reason,
|
|
116
|
+
primaryAction: {
|
|
117
|
+
type: "resume",
|
|
118
|
+
waitId: pause.id
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
const pending = attention.find((item) => item.kind === "input_required" || item.kind === "approval_required");
|
|
122
|
+
if (pending?.sourceId) return {
|
|
123
|
+
status: "needsUser",
|
|
124
|
+
reason: pending.summary,
|
|
125
|
+
primaryAction: {
|
|
126
|
+
type: "resolve_wait",
|
|
127
|
+
waitId: pending.sourceId
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const decision = attention.find((item) => item.kind === "run_decision_required");
|
|
131
|
+
if (decision?.sourceId) return {
|
|
132
|
+
status: "needsUser",
|
|
133
|
+
reason: decision.summary,
|
|
134
|
+
primaryAction: {
|
|
135
|
+
type: "inspect_run",
|
|
136
|
+
runId: decision.sourceId
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
if (state === "failed") {
|
|
140
|
+
const failure = attention.find((item) => item.kind === "run_failed" || item.kind === "verification_failed");
|
|
141
|
+
const canRetryExecutor = latestRun?.executorKind === "agent" && typeof latestRun.executorRef.agentId === "string";
|
|
142
|
+
if (failure?.sourceId) return {
|
|
143
|
+
status: "failed",
|
|
144
|
+
reason: failure.summary,
|
|
145
|
+
primaryAction: {
|
|
146
|
+
type: commands.includes("start") && canRetryExecutor ? "retry_run" : "inspect_run",
|
|
147
|
+
runId: failure.sourceId
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (commands.includes("retry_allocation")) return {
|
|
152
|
+
status: state === "failed" ? "failed" : "blocked",
|
|
153
|
+
reason: attention.find((item) => item.kind === "allocation_failed" || item.kind === "allocation_blocked")?.summary,
|
|
154
|
+
primaryAction: { type: "retry_allocation" }
|
|
155
|
+
};
|
|
156
|
+
if (state !== "idle") return {
|
|
157
|
+
status: state,
|
|
158
|
+
reason: waits[0]?.reason
|
|
159
|
+
};
|
|
160
|
+
if (task.phase === "review") {
|
|
161
|
+
if (workspaceBlocked) return {
|
|
162
|
+
status: "blocked",
|
|
163
|
+
reason: resolveTaskLocale(task) === "zh" ? "尚未确认成果已写入指定工作区。" : "The file has not been verified in the requested workspace.",
|
|
164
|
+
...latestRun ? { primaryAction: {
|
|
165
|
+
type: "inspect_run",
|
|
166
|
+
runId: latestRun.id
|
|
167
|
+
} } : {}
|
|
168
|
+
};
|
|
169
|
+
if (!acceptance && latestRun?.status === "succeeded" && taskInstructionSequence(task.id) !== (latestRun.instructionSequenceAtStart ?? 0)) return {
|
|
170
|
+
status: "blocked",
|
|
171
|
+
reason: resolveTaskLocale(task) === "zh" ? "尚未核验补充指令是否已落实。" : "Adoption of supplemental directions still needs verification.",
|
|
172
|
+
primaryAction: {
|
|
173
|
+
type: "inspect_run",
|
|
174
|
+
runId: latestRun.id
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
if (!acceptance) return {
|
|
178
|
+
status: "blocked",
|
|
179
|
+
reason: resolveTaskLocale(task) === "zh" ? "当前成果版本需要重新核验。" : "Verify the current result again."
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
status: "review",
|
|
183
|
+
primaryAction: acceptance.canSignOff ? {
|
|
184
|
+
type: "signoff",
|
|
185
|
+
resultId: acceptance.id
|
|
186
|
+
} : { type: "review" }
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (commands.includes("mark_ready")) return {
|
|
190
|
+
status: "captured",
|
|
191
|
+
primaryAction: { type: "mark_ready" }
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
status: "ready",
|
|
195
|
+
primaryAction: commands.includes("start") ? { type: "start" } : void 0
|
|
196
|
+
};
|
|
197
|
+
}
|
|
84
198
|
summary(taskId) {
|
|
85
199
|
const model = this.get(taskId);
|
|
86
200
|
if (!model) return void 0;
|
|
@@ -101,17 +215,17 @@ var TaskReadModelProjector = class {
|
|
|
101
215
|
if (input.activeRun?.status === "waiting") return "waiting";
|
|
102
216
|
if (input.waits.some((wait) => wait.kind !== "dependency")) return "waiting";
|
|
103
217
|
if (input.waits.some((wait) => wait.kind === "dependency")) return "blocked";
|
|
104
|
-
if (input.latestRun?.status === "failed") return "failed";
|
|
105
|
-
if (input.latestRun?.status === "cancelled") return "cancelled";
|
|
218
|
+
if (input.latestRun?.contractVersion === input.task.latestContractVersion && input.latestRun.status === "failed") return "failed";
|
|
219
|
+
if (input.latestRun?.contractVersion === input.task.latestContractVersion && input.latestRun.status === "cancelled") return "cancelled";
|
|
106
220
|
if (input.hasIncompleteDependency) return "blocked";
|
|
107
221
|
return "idle";
|
|
108
222
|
}
|
|
109
|
-
allowedCommands(task, activeRunStatus, hasWaits, paused) {
|
|
223
|
+
allowedCommands(task, activeRunStatus, hasWaits, hasResolvableWait, paused) {
|
|
110
224
|
if (task.phase === "closed") return [
|
|
111
225
|
"move",
|
|
112
226
|
"reopen",
|
|
113
227
|
...activeRunStatus ? ["close"] : [],
|
|
114
|
-
...task.resolution === "done" &&
|
|
228
|
+
...task.resolution === "done" && hasResolvableWait ? ["resolve_wait"] : []
|
|
115
229
|
];
|
|
116
230
|
const commands = [
|
|
117
231
|
"move",
|
|
@@ -119,7 +233,7 @@ var TaskReadModelProjector = class {
|
|
|
119
233
|
"close"
|
|
120
234
|
];
|
|
121
235
|
if (!paused) commands.push("add_wait");
|
|
122
|
-
if (
|
|
236
|
+
if (hasResolvableWait) commands.unshift("resolve_wait");
|
|
123
237
|
if (task.phase === "backlog") commands.unshift("mark_ready");
|
|
124
238
|
if (!activeRunStatus && !hasWaits && task.phase !== "backlog") commands.unshift("start");
|
|
125
239
|
if (task.phase === "active" && !activeRunStatus && !hasWaits) commands.push("request_review");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ActorRef, Task, TaskAcceptancePolicy, TaskContract, TaskPhase, TaskPriority, TaskResolution, TaskPhaseChange, TaskChangeSource } from '@xopcai/gateway-contract';
|
|
1
|
+
import type { ActorRef, Task, TaskAcceptancePolicy, TaskContract, TaskPhase, TaskPriority, TaskResolution, TaskResultPolicy, TaskPhaseChange, TaskChangeSource } from '@xopcai/gateway-contract';
|
|
2
2
|
import { type ResourceRestriction } from '../storage/sqlite/resource-scope.js';
|
|
3
3
|
export type TaskExecutionSource = 'chat' | 'cli' | 'cron' | 'channel' | 'api';
|
|
4
4
|
export type TaskUiLocale = 'en' | 'zh';
|
|
@@ -30,6 +30,7 @@ export interface TaskCreateInput {
|
|
|
30
30
|
source?: TaskExecutionSource;
|
|
31
31
|
locale?: TaskUiLocale;
|
|
32
32
|
objective: string;
|
|
33
|
+
resultPolicy?: TaskResultPolicy;
|
|
33
34
|
expectedOutputs?: string[];
|
|
34
35
|
acceptanceCriteria?: string[];
|
|
35
36
|
constraints?: string[];
|
|
@@ -61,6 +62,7 @@ export declare class TaskRepository {
|
|
|
61
62
|
dueAt?: number | null;
|
|
62
63
|
ownerId?: string | null;
|
|
63
64
|
now?: number;
|
|
65
|
+
actor?: ActorRef;
|
|
64
66
|
}): TaskAggregate | undefined;
|
|
65
67
|
setLifecycle(input: {
|
|
66
68
|
taskId: string;
|
|
@@ -88,6 +90,7 @@ export declare class TaskRepository {
|
|
|
88
90
|
reviseContract(input: {
|
|
89
91
|
taskId: string;
|
|
90
92
|
objective: string;
|
|
93
|
+
brief?: string | null;
|
|
91
94
|
expectedOutputs: string[];
|
|
92
95
|
acceptanceCriteria: string[];
|
|
93
96
|
constraints: string[];
|
|
@@ -22,9 +22,10 @@ function taskListFilter(input) {
|
|
|
22
22
|
params.push(value);
|
|
23
23
|
}
|
|
24
24
|
if (input.search?.trim()) {
|
|
25
|
-
clauses.push(`(instr(lower(title), lower(?)) > 0
|
|
25
|
+
clauses.push(`(instr(lower(title), lower(?)) > 0
|
|
26
26
|
OR EXISTS (SELECT 1 FROM task_contracts c WHERE c.task_id = tasks.task_id
|
|
27
|
-
AND c.version = tasks.latest_contract_version
|
|
27
|
+
AND c.version = tasks.latest_contract_version
|
|
28
|
+
AND (instr(lower(c.objective), lower(?)) > 0 OR instr(lower(coalesce(c.brief, '')), lower(?)) > 0)))`);
|
|
28
29
|
params.push(input.search.trim(), input.search.trim(), input.search.trim());
|
|
29
30
|
}
|
|
30
31
|
return {
|
|
@@ -40,6 +41,8 @@ function contractFromRow(row) {
|
|
|
40
41
|
taskId: row.task_id,
|
|
41
42
|
version: row.version,
|
|
42
43
|
objective: row.objective,
|
|
44
|
+
...row.brief ? { brief: row.brief } : {},
|
|
45
|
+
resultPolicy: row.result_policy,
|
|
43
46
|
expectedOutputs: parseJson(row.expected_outputs_json),
|
|
44
47
|
acceptanceCriteria: parseJson(row.acceptance_criteria_json),
|
|
45
48
|
constraints: parseJson(row.constraints_json),
|
|
@@ -56,7 +59,7 @@ function taskFromRow(row, contract) {
|
|
|
56
59
|
return {
|
|
57
60
|
id: row.task_id,
|
|
58
61
|
title: row.title,
|
|
59
|
-
...
|
|
62
|
+
...contract?.brief ? { body: contract.brief } : {},
|
|
60
63
|
phase: row.phase,
|
|
61
64
|
...row.resolution ? { resolution: row.resolution } : {},
|
|
62
65
|
priority: row.priority,
|
|
@@ -95,13 +98,15 @@ var init_task_repository = __esmMin((() => {
|
|
|
95
98
|
const boardRank = Number(db.prepare("SELECT COALESCE(MAX(board_rank), 0) + 1024 AS board_rank FROM tasks WHERE project_id IS ? AND phase = ?").get(input.projectId ?? null, phase).board_rank);
|
|
96
99
|
db.prepare(`INSERT INTO tasks (
|
|
97
100
|
task_id, creation_idempotency_key, project_id, milestone_id, parent_task_id,
|
|
98
|
-
title,
|
|
101
|
+
title, phase, priority, due_at, owner_id, delegate_agent_id,
|
|
99
102
|
source, locale, latest_contract_version, board_rank, version, created_at, updated_at
|
|
100
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
|
103
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1, ?, 1, ?, ?)`).run(id, input.idempotencyKey ?? null, input.projectId ?? null, input.milestoneId ?? null, input.parentTaskId ?? null, title, phase, input.priority ?? "normal", input.dueAt ?? null, input.ownerId ?? null, input.delegateAgentId ?? null, input.source ?? "api", input.locale ?? null, boardRank, now, now);
|
|
101
104
|
this.insertContract(db, {
|
|
102
105
|
taskId: id,
|
|
103
106
|
version: 1,
|
|
104
107
|
objective,
|
|
108
|
+
brief: input.body?.trim() || void 0,
|
|
109
|
+
resultPolicy: input.resultPolicy ?? "standard",
|
|
105
110
|
expectedOutputs: input.expectedOutputs ?? [],
|
|
106
111
|
acceptanceCriteria: input.acceptanceCriteria ?? [],
|
|
107
112
|
constraints: input.constraints ?? [],
|
|
@@ -157,10 +162,26 @@ var init_task_repository = __esmMin((() => {
|
|
|
157
162
|
const title = patch.title === void 0 ? current.title : patch.title.trim();
|
|
158
163
|
if (!title) throw new Error("Task title is required");
|
|
159
164
|
const now = Math.max(patch.now ?? Date.now(), current.updatedAt + 1);
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
165
|
+
const spec = current.contract;
|
|
166
|
+
const brief = patch.body === void 0 ? spec?.brief : patch.body?.trim() || void 0;
|
|
167
|
+
const changedBrief = spec && brief !== spec.brief;
|
|
168
|
+
const specVersion = current.latestContractVersion + Number(Boolean(changedBrief));
|
|
169
|
+
return runSqliteWriteTransaction((db) => {
|
|
170
|
+
if (changedBrief && db.prepare(`SELECT 1 FROM task_runs WHERE task_id = ? AND started_at IS NOT NULL
|
|
171
|
+
AND status IN ('running', 'waiting', 'verifying') LIMIT 1`).get(taskId)) return void 0;
|
|
172
|
+
if (db.prepare(`UPDATE tasks SET title = ?, project_id = ?, milestone_id = ?,
|
|
173
|
+
parent_task_id = ?, priority = ?, due_at = ?, owner_id = ?,
|
|
174
|
+
latest_contract_version = ?, version = version + 1, updated_at = ?
|
|
175
|
+
WHERE task_id = ? AND version = ?`).run(title, patch.projectId === void 0 ? current.projectId ?? null : patch.projectId, patch.milestoneId === void 0 ? current.milestoneId ?? null : patch.milestoneId, patch.parentTaskId === void 0 ? current.parentTaskId ?? null : patch.parentTaskId, patch.priority ?? current.priority, patch.dueAt === void 0 ? current.dueAt ?? null : patch.dueAt, patch.ownerId === void 0 ? current.ownerId ?? null : patch.ownerId, specVersion, now, taskId, patch.expectedVersion).changes === 0) return void 0;
|
|
176
|
+
if (changedBrief) this.insertContract(db, {
|
|
177
|
+
...spec,
|
|
178
|
+
version: specVersion,
|
|
179
|
+
brief,
|
|
180
|
+
createdBy: patch.actor ?? { kind: "user" },
|
|
181
|
+
createdAt: now
|
|
182
|
+
});
|
|
183
|
+
return this.get(taskId);
|
|
184
|
+
});
|
|
164
185
|
}
|
|
165
186
|
setLifecycle(input) {
|
|
166
187
|
if (input.phase === "closed" !== Boolean(input.resolution)) throw new Error("Closed tasks require a resolution and open tasks cannot have one");
|
|
@@ -237,6 +258,8 @@ var init_task_repository = __esmMin((() => {
|
|
|
237
258
|
taskId: input.taskId,
|
|
238
259
|
version: contractVersion,
|
|
239
260
|
objective,
|
|
261
|
+
brief: input.brief === void 0 ? current.contract?.brief : input.brief?.trim() || void 0,
|
|
262
|
+
resultPolicy: current.contract?.resultPolicy ?? "standard",
|
|
240
263
|
expectedOutputs: input.expectedOutputs,
|
|
241
264
|
acceptanceCriteria: input.acceptanceCriteria,
|
|
242
265
|
constraints: input.constraints,
|
|
@@ -280,10 +303,10 @@ var init_task_repository = __esmMin((() => {
|
|
|
280
303
|
}
|
|
281
304
|
insertContract(db, contract) {
|
|
282
305
|
db.prepare(`INSERT INTO task_contracts (
|
|
283
|
-
task_id, version, objective, expected_outputs_json, acceptance_criteria_json,
|
|
306
|
+
task_id, version, objective, brief, result_policy, expected_outputs_json, acceptance_criteria_json,
|
|
284
307
|
constraints_json, approval_required_json, assumptions_json, risks_json,
|
|
285
308
|
acceptance_policy, output_destinations_json, created_by_json, created_at
|
|
286
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(contract.taskId, contract.version, contract.objective, JSON.stringify(contract.expectedOutputs), JSON.stringify(contract.acceptanceCriteria), JSON.stringify(contract.constraints), JSON.stringify(contract.approvalRequired), JSON.stringify(contract.assumptions), JSON.stringify(contract.risks), contract.acceptancePolicy, JSON.stringify(contract.outputDestinations), JSON.stringify(contract.createdBy), contract.createdAt);
|
|
309
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(contract.taskId, contract.version, contract.objective, contract.brief ?? null, contract.resultPolicy, JSON.stringify(contract.expectedOutputs), JSON.stringify(contract.acceptanceCriteria), JSON.stringify(contract.constraints), JSON.stringify(contract.approvalRequired), JSON.stringify(contract.assumptions), JSON.stringify(contract.risks), contract.acceptancePolicy, JSON.stringify(contract.outputDestinations), JSON.stringify(contract.createdBy), contract.createdAt);
|
|
287
310
|
}
|
|
288
311
|
};
|
|
289
312
|
}));
|
|
@@ -6,10 +6,10 @@ export declare function inspectTaskPublications(runId: string, research?: TaskRe
|
|
|
6
6
|
latestPublishedArtifacts: {
|
|
7
7
|
artifactId: string;
|
|
8
8
|
title: string;
|
|
9
|
-
kind: "file" | "document" | "
|
|
9
|
+
kind: "file" | "document" | "presentation" | "spreadsheet" | "pdf" | "image" | "video" | "audio" | "site" | "archive";
|
|
10
10
|
availability: "expired" | "failed" | "materializing" | "available" | "missing";
|
|
11
11
|
location: "workspace" | "external_host" | "worktree" | "remote_runtime" | "artifact_store";
|
|
12
|
-
capabilities: ("open" | "preview" | "
|
|
12
|
+
capabilities: ("open" | "preview" | "share" | "download" | "import" | "regenerate")[];
|
|
13
13
|
sourceFileId?: string;
|
|
14
14
|
mimeType?: string;
|
|
15
15
|
sha256?: string;
|
|
@@ -100,6 +100,7 @@ export declare function applyResearchReview(result: TaskResearchResult, raw: unk
|
|
|
100
100
|
export declare const reviewResearchResult: ResearchReviewer;
|
|
101
101
|
export declare function currentTaskResearchResult(runId: string): TaskResearchResult | undefined;
|
|
102
102
|
export declare function supersededTaskInstructionIds(taskId: string): Set<string>;
|
|
103
|
+
export declare function verifiesTaskInstructions(taskId: string, research: TaskResearchResult): boolean;
|
|
103
104
|
/** Read the execution transcript only; worker drafts, failures and other runs never become evidence. */
|
|
104
105
|
export declare function taskResearchEvidence(conversationId: string): {
|
|
105
106
|
rows: {
|
|
@@ -8,6 +8,7 @@ import { TurnOutcomeDeliverableSchema } from "../../packages/gateway-contract/sr
|
|
|
8
8
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
9
9
|
import { init_session_instance_repository, readCurrentTranscriptId } from "../storage/sqlite/session-instance-repository.js";
|
|
10
10
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
11
|
+
import { init_task_instruction_sequence, taskInstructionSequence } from "./task-instruction-sequence.js";
|
|
11
12
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
12
13
|
import { resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
13
14
|
import { extractAssistantText, stripCodeFences } from "../providers/model-response.js";
|
|
@@ -15,7 +16,6 @@ import { resolveTaskLocale } from "./task-language.js";
|
|
|
15
16
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
16
17
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
17
18
|
import { sanitizePersonalResultFileLinks } from "../personal-agent/result-file-links.js";
|
|
18
|
-
import { taskInstructionSequence } from "./task-instruction-sequence.js";
|
|
19
19
|
import { finalReplyCharacterLimit } from "./task-final-reply.js";
|
|
20
20
|
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
21
21
|
import { readMediaReference } from "../media/media-reference.js";
|
|
@@ -34,6 +34,7 @@ init_session_instance_repository();
|
|
|
34
34
|
init_logger();
|
|
35
35
|
init_task_repository();
|
|
36
36
|
init_task_run_repository();
|
|
37
|
+
init_task_instruction_sequence();
|
|
37
38
|
const log = createLogger("TaskResearchResult");
|
|
38
39
|
const text = z.string().trim().min(1);
|
|
39
40
|
const TaskResearchSubmissionSchema = z.object({
|
|
@@ -315,6 +316,15 @@ function currentTaskResearchResult(runId) {
|
|
|
315
316
|
function supersededTaskInstructionIds(taskId) {
|
|
316
317
|
return new Set(getSqliteDatabase().prepare("SELECT supersedes_json FROM task_work_revisions WHERE task_id = ?").all(taskId).flatMap((row) => JSON.parse(row.supersedes_json)));
|
|
317
318
|
}
|
|
319
|
+
function applicableTaskInstructions(taskId) {
|
|
320
|
+
const superseded = supersededTaskInstructionIds(taskId);
|
|
321
|
+
return new TaskCollaborationRepository().coordination(taskId).filter((entry) => ["main_agent", "user"].includes(entry.authorKind) && ["answer", "instruction"].includes(entry.kind) && !superseded.has(entry.id));
|
|
322
|
+
}
|
|
323
|
+
function verifiesTaskInstructions(taskId, research) {
|
|
324
|
+
if (research.review !== "model_reviewed") return false;
|
|
325
|
+
const supported = new Set(research.claims.filter((claim) => claim.support === "supported").map((claim) => claim.id));
|
|
326
|
+
return applicableTaskInstructions(taskId).every((entry) => research.instructionChecks?.some((check) => check.sequence === entry.sequence && check.instruction === entry.body && check.status === "passed" && check.claimIds.length > 0 && check.claimIds.every((id) => supported.has(id))));
|
|
327
|
+
}
|
|
318
328
|
/** Read the execution transcript only; worker drafts, failures and other runs never become evidence. */
|
|
319
329
|
function taskResearchEvidence(conversationId) {
|
|
320
330
|
const link = new TaskConversationRepository().resolveActiveExecutionSession(conversationId);
|
|
@@ -389,7 +399,7 @@ async function submitTaskResearchResult(conversationId, toolCallId, raw, signal,
|
|
|
389
399
|
claimIds: [],
|
|
390
400
|
note: "Review unavailable."
|
|
391
401
|
})),
|
|
392
|
-
instructionChecks:
|
|
402
|
+
instructionChecks: applicableTaskInstructions(task.id).map((entry) => ({
|
|
393
403
|
sequence: entry.sequence,
|
|
394
404
|
instruction: entry.body,
|
|
395
405
|
status: "unverified",
|
|
@@ -537,4 +547,4 @@ async function submitTaskResearchResult(conversationId, toolCallId, raw, signal,
|
|
|
537
547
|
return result;
|
|
538
548
|
}
|
|
539
549
|
//#endregion
|
|
540
|
-
export { TaskResearchSubmissionSchema, applyResearchReview, bindResearchSources, currentTaskResearchResult, mergeResearchSubmission, reviewResearchResult, submitTaskResearchResult, supersededTaskInstructionIds, taskInstructionSequence, taskResearchEvidence };
|
|
550
|
+
export { TaskResearchSubmissionSchema, applyResearchReview, bindResearchSources, currentTaskResearchResult, mergeResearchSubmission, reviewResearchResult, submitTaskResearchResult, supersededTaskInstructionIds, taskInstructionSequence, taskResearchEvidence, verifiesTaskInstructions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TurnOutcome } from '@xopcai/gateway-contract';
|
|
1
|
+
import { type TurnOutcome, type TurnOutcomeDeliverable } from '@xopcai/gateway-contract';
|
|
2
2
|
export declare function onTaskResultQueued(listener: () => void): () => void;
|
|
3
3
|
export interface TaskResultDeliveryRow {
|
|
4
4
|
delivery_id: string;
|
|
@@ -9,17 +9,18 @@ export interface TaskResultDeliveryRow {
|
|
|
9
9
|
}
|
|
10
10
|
export declare class TaskResultDeliveryRepository {
|
|
11
11
|
/** Only cards persisted in this conversation's current transcript confirm file delivery. */
|
|
12
|
-
fileDeliveryState(taskId: string, conversationId: string): {
|
|
12
|
+
fileDeliveryState(taskId: string, conversationId: string, includeArtifact?: boolean): {
|
|
13
13
|
status: 'not_delivered' | 'pending' | 'delivered' | 'stale' | 'failed';
|
|
14
14
|
availableFileCount: number;
|
|
15
15
|
resultId?: string;
|
|
16
|
+
artifact?: TurnOutcomeDeliverable;
|
|
16
17
|
};
|
|
17
18
|
capture(runId: string, value: TurnOutcome): void;
|
|
18
19
|
/** Called inside the run completion transaction, after stale receipts are rejected. */
|
|
19
20
|
enqueue(runId: string, summary: string, status: 'succeeded' | 'failed', resultText?: string, hostArtifact?: {
|
|
20
21
|
id: string;
|
|
21
22
|
sha256?: string;
|
|
22
|
-
}): boolean;
|
|
23
|
+
}, incompleteWorkspace?: boolean): boolean;
|
|
23
24
|
hasForRun(runId: string): boolean;
|
|
24
25
|
hasCapturedOutcome(runId: string): boolean;
|
|
25
26
|
pending(limit?: number): TaskResultDeliveryRow[];
|