@xopcai/xopc 0.0.447 → 0.0.448
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-D_KDDoA1.js → activity-store-Tn5McYcg.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CGHzO0HR.js → agent-avatar-dicebear-BX5HhrTI.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-Dm1YHaAt.js → agent-avatar-display-C7Dx9nt1.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BGTfRvG5.js → agent-defaults-settings-panel-AAJsxEjB.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-D0AQB-2O.js → agent-plugin-dialog-BhtzU8qr.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-Ckr-T2KU.js → agents-CbGYb9WI.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-D0qHxAok.js → agents-admin-api-CShyoj9I.js} +1 -1
- package/dist/gateway/static/root/assets/{api-uriioEZx.js → api-B3M6ifoo.js} +1 -1
- package/dist/gateway/static/root/assets/{api-pQXrYBTk.js → api-BET9vZ1l.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CQbKhrjd.js → app-management-settings-panel-BxOShFPO.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Dm0GM368.js → appearance-settings-L450QlMW.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DCeINCy-.js → apps-page-BNhpN8RA.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Cd4FOTEH.js → archive-plugin-BCXEOal7.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-B3df53ms.js → automation-api-B3Jnoa2G.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-CpgaWu2r.js → automation-result-state-BHAKc5QI.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-DrJfwJN_.js → automation-run-list-De7gini_.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-Clf0fe_n.js +3 -0
- package/dist/gateway/static/root/assets/{automations-page-B5bnb-N8.js → automations-page-CJ1rfmZd.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CHFTlLiA.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-C0QOjfJV.js → binary-plugins-B7tuUWzS.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BY1Mb-WW.js → block-editor-D-YHASZr.js} +55 -55
- package/dist/gateway/static/root/assets/{browser-settings-page-DUsk02LK.js → browser-settings-page-DdMMia7Y.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-Cxh3nYa6.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-Bu7efUpH.js → capabilities-YfkMBZCb.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-DFv5-mPY.js → capabilities-page-DosENGaK.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BtRMZjAx.js → capabilities-settings-panel-qZ3S06yZ.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CByFQQ_H.js → channels-BBgyZnHB.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-SruH_oEQ.js → chat-agents-api-CgasFAm4.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-BBchFbUa.js → chat-chart-block-Cgks7rH3.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-C3ttsYGZ.js → chat-page-CCwdk6yE.js} +29 -29
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DCNAz0CB.js → chat-terminal-dock-CbP1mS4v.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-r8U5soT7.js → command-palette-api-Bku_h283.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-RaEQXTjj.js → composer-payload-handoff-CrTYMPL_.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-C7cj9Zyx.js → computer-settings-page-zvWUPPAr.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-DgJ7I1do.js → connected-providers-grid-w3htbAyh.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-De6QJt8B.js → connection-usage-guide-DL2T6cSN.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-qSYlFATU.js → connector-service-page-a0gQC-nc.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CqyteNnT.js → connectors-api-DNVUmf9M.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BB3V-zJS.js → connectors-page-CPGlpvoB.js} +1 -1
- package/dist/gateway/static/root/assets/constants-DpkUgykJ.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-E0cqnNlR.js +1 -0
- package/dist/gateway/static/root/assets/date-time-picker-CrC_VKpw.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-wqyOn6xs.js → desktop-pet-D1MkNl5F.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-Cm1O5CEG.js → desktop-pet-settings-BA6u5Md-.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-BxPWx1Gi.js → dev-view-store-DnqJb6NS.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CqgjknYy.js → device-pairing-wizard-Ba3d606o.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BCOUShCs.js → directory-picker-path-field-lcps-hsZ.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-uvwyXFX3.js → discussion-annotation-sync-BmvCn1Xn.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-C7ZJumIY.js → extension-debug-page-DED5LHxs.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-B0rM3Ohp.js → extension-iframe-host-B0oIml1X.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DIGw487r.js → extension-marketplace-api-BrLsjJLA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C5LnL_Dy.js → extension-page-Ber9sWpz.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-D5L3t0e3.js → extension-provider-dpOtxmuc.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DnXoNNDa.js → extension-settings-page-BSG-nJ_7.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-Bfqc0ZKv.js → file-preview-surface-B3nLuoQO.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Db2fE-gT.js → gateway-config-swr-CtZy1Qw0.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-nI6k8qP8.js → gateway-realtime-CG65gHUY.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-Vl3uKAHV.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-CyhN9Fk3.js → gateway-restart-Cr5xtfZU.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Nr0Bzbsy.js → gateway-settings-BwMwdwXh.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Du7l0oxt.js → gateway-startup-retry-DztAHGru.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-qGBKLt28.js → global-defaults-api-yHc-ZfjU.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-DGsDrtlA.js +3 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DeolJQxY.js → image-generation-api-D5eo_stq.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-B3kUV_dq.js → imports-page-CLbpRE5i.js} +1 -1
- package/dist/gateway/static/root/assets/index-D1EDrkUo.css +1 -0
- package/dist/gateway/static/root/assets/index-Dw5NFmnZ.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-Brl22l1N.js → install-connector-dialog-B-v1FT3P.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CFrEEDZu.js → keyboard-shortcuts-settings-BLBASsCP.js} +1 -1
- package/dist/gateway/static/root/assets/linkify-it-BkqEorO0.js +1 -0
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CbHgQzs4.js → local-app-workbench-page-u0lVT4rD.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Cdeawk2X.js → local-apps-page-Db93n4Zy.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-oWhYPECv.js → local-session-drafts-C6oPrCYY.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-BY-fRY-q.js → locale-store-CQcW9_qA.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Dtoheh2t.js +2 -0
- package/dist/gateway/static/root/assets/{management-api-BzdYxqsC.js → management-api-Dh2r5GrQ.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-yWWgFlzF.js → management-settings-Fj25fafb.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-ClNfoiYC.js → markdown-view-CkihBz06.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-C0M7yW4O.js → mcp-conversation-setup-page-jh3dwNfg.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DmVG3TQ5.js → media-plugins-BUapXtQZ.js} +1 -1
- package/dist/gateway/static/root/assets/messages-orB1BMgI.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-DkytsBae.js → model-selector-DYxgKUju.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CESzQ_tk.js → models-hub-cache-D2cdb8nZ.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-CQIrUO6h.js → note-detail-panel-Bw5VDFPV.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-C6aTUp-c.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-32qiHxz2.js → notes-api-BhRyWe3S.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-gl59x-7l.js → notes-page-BmmeGUUy.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CMpfoRed.js → oauth-api-D5iBtOid.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-XzlLkqnK.js → oauth-provider-connect-CmHsHynu.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CdMxGZaM.js → page-context-capture-button-CQoRZ1b-.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-CrgFs0h3.js → page-context-draft-aApa5ApP.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-B2Ahfm0W.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BHMRbUIc.js → personal-avatar-Dp5LHjk3.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-DUuJe2P9.js → personal-page-gdKGnAPi.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CZjvI9rl.js → personal-settings-panel-CtJL6qIN.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-BCEI4PGp.js → phone-dependencies-card-BBk6k0t0.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-BqOzyoRr.js → phone-model-connection-QJt8SAb7.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BGAAMeo6.js → phone-model-picker-CRxUxJNZ.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-BdoFCa2J.js → phone-settings-page-Df64khPY.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-D1BS7otl.js → phone-workspace-store-DAuPd2ie.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BP-ZS2g2.js → plugin-details-dialog-Bcer4RC3.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-RITbo_ES.js → preference-select-fields-DdV7q9Bd.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-CQvcSORB.js → product-automation-feedback-uKndNxpU.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-CJfYOVkw.js → product-open-page-A7lyoXVv.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-B0-rh4uS.js → product-preview-content-BrdvkWOg.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-modal-BxHKejcX.js +2 -0
- package/dist/gateway/static/root/assets/{project-detail-page-CgU7vGyT.js → project-detail-page-BedOnA0G.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-szQw-qin.js → project-understanding-BVhSoQHu.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-BFZsIyzp.js → projects-page-DSPoyFda.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-j511FMYv.js → providers-api-B47s6_9Q.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-jq70ER5Y.js → recording-upload-B-IHTsVC.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BnEoY6_B.js → registry-api-Bo8YiUE0.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-B8AHjzC5.js → remote-access-hub-BRf9znLV.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-AT-LkLIB.js → resource-unavailable-CAljzZx8.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-cpv-TDla.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-BDjAwlQF.js → runtime-tools-api-C28pB9__.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-kvbXN_HV.js → runtime-tools-settings-panel-XYeadnhL.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-DquxQCKH.js → service-recommendation-list-C6ydoBSU.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CgTDekPG.js → session-api-D7FWdG43.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-V8cj3NVD.js → session-manager-7qKSmROh.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-KFescmNm.js → sessions-page-CyYkCsfy.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-B3rOBkm_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-Daxv3VGf.js → settings-advanced-section-3HwfHbqz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-LUeLxacj.js → settings-mode-store-BVvIXZlg.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-Bi6rvZGw.js → settings-page-DLmsK1x2.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-Dmw3nYJ1.js → settings-page-header-CheboxIM.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-YJXlkr_Z.js → settings-page-layout-CPFMZaLF.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-Dd3Ovfgm.js → setup-interaction-page-BbCzYq9S.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BZZXpXiB.js → setup-status-panel-DUNgVqtz.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-B1g7Xero.js → share-link-dialog-0P9ghttc.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-1GlB7603.js → share-preview-page-OOKslNfX.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DXOD--vt.js → shares-api-iiw4F-ra.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Bj-HKS3s.js → shares-settings-DUB9Ek8Q.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-HQEXke4-.js → skill-api-CLtIjE8K.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-CJBrtxil.js → skill-list-api-DY0rRlUk.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-CO6jhwui.js → skill-reload-api-DJC8uWLu.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DAxov1a8.js → skills-page-CQYf7s9f.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-By3gokfs.js → system-settings-panel-DdBmyc93.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BskTta5G.js +3 -0
- package/dist/gateway/static/root/assets/task-input-card-5BDu71NL.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-D_xuHn6V.js → tasks-BTLabOMp.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DBC-pqGy.js → terminal-panel-store-B1EVdx4L.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-C57ZxHqm.js → theme-store-BTkYFJOE.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-C1PXAXZF.js +1 -0
- package/dist/gateway/static/root/assets/{tracing-settings-page-BQ7regHS.js → tracing-settings-page-h-gbBAtl.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BOJVQPqI.js → tunnel-api-BDoegsWD.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-YrDh1XvR.js → understanding-activity-store-DyFJDqHy.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-D6gM1s8M.js → understanding-refresh-store-C0SRcgyd.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DpC6gP1I.js → usage-page-CbJsT3zT.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-NOpNkLFw.js → use-autosave-CB2B4NMO.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-R6kKpDgc.js → use-composer-attachments-DBsGBWDR.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-M7LSoDLc.js → use-file-preview-expanded-RpLp7VdL.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-JPLBYzew.js → use-personal-profile-r0OuOlBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-jzKVAl3N.js → use-workspace-tree-BGco62Ny.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-CPZgl93P.js → user-model-page-BudrJ73l.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-R_KAYzHp.js → voice-api-key-field-C8wd8ijq.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-D6ueBjfw.js → voice-config-api-yBcUSvvn.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-04u9YoRg.js → voice-input-shortcut-events-TAmJNcsN.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-transcribe-api-B2NVJYnu.js → voice-transcribe-api-By2znMrG.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BHaemIrQ.js → work-discovery-overlay-DsyYo1p0.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-Bt_j5iQ5.js → work-discovery-page-BJ9VN5Zd.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-5EsBeKBO.js → working-directory-picker-modal-CFj-ZOJE.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-BmUCKePi.js → workspace-api-CD2aXy2n.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-2Lt7rQfw.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-hYGX2hWZ.js → workspace-file-preview-dialog-B23lE7H0.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-DqLui4B1.js → workspace-open-location-menu-CJUf755Q.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-CVq7U7Ft.js → xopc-cloud-account-card-DN4DdOWZ.js} +1 -1
- package/dist/gateway/static/root/index.html +86 -84
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/home.js +21 -0
- package/dist/packages/gateway-contract/src/task-research-result.js +1 -0
- package/dist/packages/gateway-contract/src/tasks.js +10 -2
- package/dist/src/agent/orchestration/turn-recovery.js +7 -3
- package/dist/src/agent/tools/task-result-tool.js +6 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +49 -22
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/personal-agent/reply-composer.js +6 -2
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +1 -1
- package/dist/src/storage/sqlite/upgrades/271_task_criterion_unverified.sql +21 -0
- package/dist/src/tasks/attention-governor.d.ts +2 -0
- package/dist/src/tasks/attention-governor.js +8 -3
- package/dist/src/tasks/home-query-service.d.ts +3 -0
- package/dist/src/tasks/home-query-service.js +187 -41
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/task-application-service.js +2 -2
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-contract-planner.js +6 -4
- package/dist/src/tasks/task-criterion-review-repository.d.ts +3 -12
- package/dist/src/tasks/task-criterion-review-repository.js +3 -2
- package/dist/src/tasks/task-final-reply.d.ts +2 -0
- package/dist/src/tasks/task-final-reply.js +11 -0
- package/dist/src/tasks/task-repository.d.ts +1 -0
- package/dist/src/tasks/task-repository.js +1 -0
- package/dist/src/tasks/task-research-repair.d.ts +1 -0
- package/dist/src/tasks/task-research-repair.js +4 -1
- package/dist/src/tasks/task-research-result.d.ts +1 -0
- package/dist/src/tasks/task-research-result.js +35 -1
- package/dist/src/tasks/task-result-delivery-repository.js +10 -5
- package/dist/src/tasks/task-result-delivery-service.js +2 -2
- package/dist/src/tasks/task-run-coordinator.js +7 -5
- package/dist/src/voice/tts/index.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/automation-task-card-C2mxNw5Q.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-7R4mL3M-.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-Bt1fAcDI.js +0 -1
- package/dist/gateway/static/root/assets/constants-CsVXarqA.js +0 -1
- package/dist/gateway/static/root/assets/date-picker-CB6IVCiq.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CjYSSi_l.js +0 -1
- package/dist/gateway/static/root/assets/home-page-h6D4Pqqc.js +0 -2
- package/dist/gateway/static/root/assets/index-Bj6IrJGJ.js +0 -11
- package/dist/gateway/static/root/assets/index-D3YWUSNe.css +0 -1
- package/dist/gateway/static/root/assets/logs-page-3dWLrUy0.js +0 -2
- package/dist/gateway/static/root/assets/messages-DFCLetQl.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-Cw-TaViX.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-BNjlQHqU.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-CSFxc7oy.js +0 -2
- package/dist/gateway/static/root/assets/route-preload-ByDpGuZp.js +0 -2
- package/dist/gateway/static/root/assets/settings-advanced-gate-JCPJyeK-.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-Cf58C6gC.js +0 -3
- package/dist/gateway/static/root/assets/task-result-evidence-DWfp9UIc.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Sy1CLe2K.js +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
3
4
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
4
6
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
5
7
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
-
import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -251,7 +251,8 @@ var PersonalReplyComposer = class {
|
|
|
251
251
|
db.prepare("UPDATE task_result_deliveries SET reply_status = 'stale', reply_lease_token = NULL, reply_lease_until = 0 WHERE delivery_id = ?").run(row.delivery_id);
|
|
252
252
|
continue;
|
|
253
253
|
}
|
|
254
|
-
const
|
|
254
|
+
const prefix = packet.delivery.outcome.status === "succeeded" ? "" : packet.delivery.outcome.status === "partial" ? "部分完成 / Partial result.\n\n" : "未完成 / Incomplete result.\n\n";
|
|
255
|
+
const text = packet.delivery.text && packet.delivery.text === packet.delivery.outcome.research?.finalText ? packet.delivery.text : prefix + sanitizePersonalResultFileLinks(packet.preservedText ?? packet.report);
|
|
255
256
|
const delivery = TaskResultDeliverySchema.parse({
|
|
256
257
|
...packet.delivery,
|
|
257
258
|
deliveryId: `reply:${packet.delivery.deliveryId}`,
|
|
@@ -328,7 +329,10 @@ var PersonalReplyComposer = class {
|
|
|
328
329
|
}
|
|
329
330
|
const transcriptId = readCurrentTranscriptId(db, packet.delivery.conversationId);
|
|
330
331
|
let text = row.draft_transcript_id === transcriptId && row.context_revision === conversation.revision ? row.text : null;
|
|
331
|
-
if (
|
|
332
|
+
if (packet.delivery.text && packet.delivery.text === packet.delivery.outcome.research?.finalText) {
|
|
333
|
+
text = packet.delivery.text;
|
|
334
|
+
db.prepare("UPDATE task_result_deliveries SET reply_text = ?, reply_draft_transcript_id = ?, reply_context_revision = ?, reply_status = 'ready' WHERE delivery_id = ? AND reply_lease_token = ?").run(text, transcriptId, conversation.revision, row.delivery_id, row.lease_token);
|
|
335
|
+
} else if (!text) {
|
|
332
336
|
const controller = new AbortController();
|
|
333
337
|
composingReplies.set(row.delivery_id, controller);
|
|
334
338
|
const compositionStartedAt = performance.now();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, readSchemaVersionForTest, readSchemaVersion, setSchemaVersion, ensureSchemaMetaTable } from './schema-version.js';
|
|
3
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
4
|
-
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
3
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 271;
|
|
4
|
+
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 271;
|
|
5
5
|
export { XOPC_DB_MINIMUM_SCHEMA_VERSION } from './schema-upgrade.js';
|
|
6
6
|
/** Initialize fresh databases directly; upgrade supported installed databases transactionally. */
|
|
7
7
|
export declare function ensureXopcDatabaseSchema(db: DatabaseSync): void;
|
|
@@ -14,18 +14,18 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
14
14
|
const hasMetadata = tables.some((row) => row.name === "schema_meta");
|
|
15
15
|
if (!hasMetadata && tables.length) throw new Error("An unversioned database cannot be initialized");
|
|
16
16
|
const version = hasMetadata ? readSchemaVersion(db) : 0;
|
|
17
|
-
if (version >
|
|
17
|
+
if (version > 271) throw new DatabaseSchemaTooNewError(version, 271);
|
|
18
18
|
if (version > 0 && version < 202) throw new DatabaseSchemaTooOldError(version, 202);
|
|
19
|
-
if (version >= 202 && version <
|
|
20
|
-
upgradeXopcDatabase(db, version,
|
|
19
|
+
if (version >= 202 && version < 271) {
|
|
20
|
+
upgradeXopcDatabase(db, version, 271);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if (version ===
|
|
23
|
+
if (version === 271) return;
|
|
24
24
|
if (db.prepare("SELECT name FROM sqlite_master WHERE type = 'table' AND name != 'schema_meta' AND name NOT LIKE 'sqlite_%' LIMIT 1").get()) throw new Error("An unversioned database cannot be initialized");
|
|
25
25
|
db.exec("BEGIN IMMEDIATE");
|
|
26
26
|
try {
|
|
27
27
|
db.exec(readSqliteAsset("schema.sql"));
|
|
28
|
-
setSchemaVersion(db,
|
|
28
|
+
setSchemaVersion(db, 271);
|
|
29
29
|
db.exec("COMMIT");
|
|
30
30
|
} catch (error) {
|
|
31
31
|
db.exec("ROLLBACK");
|
|
@@ -40,8 +40,8 @@ var init_schema = __esmMin((() => {
|
|
|
40
40
|
init_schema_version();
|
|
41
41
|
init_schema_errors();
|
|
42
42
|
init_schema_upgrade();
|
|
43
|
-
XOPC_DB_SCHEMA_VERSION =
|
|
44
|
-
XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
43
|
+
XOPC_DB_SCHEMA_VERSION = 271;
|
|
44
|
+
XOPC_DB_BASELINE_SCHEMA_VERSION = 271;
|
|
45
45
|
}));
|
|
46
46
|
//#endregion
|
|
47
47
|
init_schema();
|
|
@@ -574,7 +574,7 @@ CREATE TABLE task_criterion_reviews (
|
|
|
574
574
|
contract_version INTEGER NOT NULL,
|
|
575
575
|
criterion_index INTEGER NOT NULL,
|
|
576
576
|
criterion_text TEXT NOT NULL,
|
|
577
|
-
status TEXT NOT NULL CHECK (status IN ('passed', 'failed')),
|
|
577
|
+
status TEXT NOT NULL CHECK (status IN ('passed', 'failed', 'unverified')),
|
|
578
578
|
note TEXT,
|
|
579
579
|
reviewed_by_json TEXT NOT NULL,
|
|
580
580
|
reviewed_at INTEGER NOT NULL,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
ALTER TABLE task_criterion_reviews RENAME TO task_criterion_reviews_v270;
|
|
2
|
+
|
|
3
|
+
CREATE TABLE task_criterion_reviews (
|
|
4
|
+
task_id TEXT NOT NULL,
|
|
5
|
+
contract_version INTEGER NOT NULL,
|
|
6
|
+
criterion_index INTEGER NOT NULL,
|
|
7
|
+
criterion_text TEXT NOT NULL,
|
|
8
|
+
status TEXT NOT NULL CHECK (status IN ('passed', 'failed', 'unverified')),
|
|
9
|
+
note TEXT,
|
|
10
|
+
reviewed_by_json TEXT NOT NULL,
|
|
11
|
+
reviewed_at INTEGER NOT NULL,
|
|
12
|
+
PRIMARY KEY (task_id, contract_version, criterion_index),
|
|
13
|
+
FOREIGN KEY (task_id, contract_version) REFERENCES task_contracts(task_id, version) ON DELETE CASCADE
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
INSERT INTO task_criterion_reviews
|
|
17
|
+
(task_id, contract_version, criterion_index, criterion_text, status, note, reviewed_by_json, reviewed_at)
|
|
18
|
+
SELECT task_id, contract_version, criterion_index, criterion_text, status, note, reviewed_by_json, reviewed_at
|
|
19
|
+
FROM task_criterion_reviews_v270;
|
|
20
|
+
|
|
21
|
+
DROP TABLE task_criterion_reviews_v270;
|
|
@@ -9,6 +9,7 @@ export interface AttentionProjection {
|
|
|
9
9
|
suppressedAttentionCount: number;
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
+
export declare function compareHomeDecisions(left: HomeDecision, right: HomeDecision, now: number): number;
|
|
12
13
|
export declare class AttentionGovernor {
|
|
13
14
|
project(input: {
|
|
14
15
|
decisions: HomeDecision[];
|
|
@@ -16,5 +17,6 @@ export declare class AttentionGovernor {
|
|
|
16
17
|
includeAll?: boolean;
|
|
17
18
|
maxDecisions?: number;
|
|
18
19
|
maxAttention?: number;
|
|
20
|
+
nowMs?: number;
|
|
19
21
|
}): AttentionProjection;
|
|
20
22
|
}
|
|
@@ -6,6 +6,10 @@ function decisionScore(item) {
|
|
|
6
6
|
if (item.reason === "overdue") return 70;
|
|
7
7
|
return 50;
|
|
8
8
|
}
|
|
9
|
+
function compareHomeDecisions(left, right, now) {
|
|
10
|
+
const deadline = (item) => item.dueAt !== void 0 && item.dueAt <= now + 1440 * 6e4 ? item.dueAt : Infinity;
|
|
11
|
+
return deadline(left) - deadline(right) || Number(right.urgency === "now") - Number(left.urgency === "now") || decisionScore(right) - decisionScore(left) || right.updatedAt - left.updatedAt;
|
|
12
|
+
}
|
|
9
13
|
function decisionKey(item) {
|
|
10
14
|
const title = item.title.trim().toLocaleLowerCase();
|
|
11
15
|
return item.response ? item.id : `${item.projectId ?? "global"}:${title}:${item.reason === "approval_required" ? item.id : ""}`;
|
|
@@ -15,7 +19,8 @@ var AttentionGovernor = class {
|
|
|
15
19
|
const maxDecisions = Math.max(1, Math.min(20, input.maxDecisions ?? 7));
|
|
16
20
|
const maxAttention = Math.max(1, Math.min(10, input.maxAttention ?? 5));
|
|
17
21
|
const seen = /* @__PURE__ */ new Set();
|
|
18
|
-
const
|
|
22
|
+
const now = input.nowMs ?? Date.now();
|
|
23
|
+
const eligible = [...input.decisions].sort((left, right) => compareHomeDecisions(left, right, now)).filter((item) => {
|
|
19
24
|
const key = decisionKey(item);
|
|
20
25
|
if (seen.has(key)) return false;
|
|
21
26
|
seen.add(key);
|
|
@@ -28,7 +33,7 @@ var AttentionGovernor = class {
|
|
|
28
33
|
attention,
|
|
29
34
|
policy: {
|
|
30
35
|
visibleDecisionCount: decisions.length,
|
|
31
|
-
suppressedDecisionCount:
|
|
36
|
+
suppressedDecisionCount: input.decisions.length - decisions.length,
|
|
32
37
|
visibleAttentionCount: attention.length,
|
|
33
38
|
suppressedAttentionCount: Math.max(0, input.attention.length - attention.length)
|
|
34
39
|
}
|
|
@@ -36,4 +41,4 @@ var AttentionGovernor = class {
|
|
|
36
41
|
}
|
|
37
42
|
};
|
|
38
43
|
//#endregion
|
|
39
|
-
export { AttentionGovernor };
|
|
44
|
+
export { AttentionGovernor, compareHomeDecisions };
|
|
@@ -37,6 +37,7 @@ export declare function buildHomeWorkbench(input: {
|
|
|
37
37
|
attention: HomeAttention[];
|
|
38
38
|
runningTasks: TaskAggregate[];
|
|
39
39
|
waitingTaskReasons?: Record<string, string>;
|
|
40
|
+
pausedTaskIds?: ReadonlySet<string>;
|
|
40
41
|
scheduled: HomeAutomation[];
|
|
41
42
|
nowMs: number;
|
|
42
43
|
}): Pick<HomeResponse, 'needsUser' | 'background' | 'backgroundCount'>;
|
|
@@ -46,5 +47,7 @@ export declare class HomeQueryService {
|
|
|
46
47
|
private readonly getAdvisor;
|
|
47
48
|
constructor(service: HomeGatewayPort, getAdvisor?: (locale?: string) => HomeAdvisor);
|
|
48
49
|
getSnapshot(locale?: string, includeAll?: boolean): Promise<HomeResponse>;
|
|
50
|
+
private recentDeliveries;
|
|
51
|
+
private resumableWork;
|
|
49
52
|
}
|
|
50
53
|
export {};
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
2
2
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
3
3
|
import { listConnectorApprovals } from "../storage/sqlite/connector-repository.js";
|
|
4
|
+
import { listSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
4
5
|
import { isHomeAttentionAcknowledged } from "../storage/sqlite/home-attention-repository.js";
|
|
5
6
|
import "../storage/sqlite/index.js";
|
|
6
7
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
7
8
|
import "../automations/domain/defaults.js";
|
|
8
|
-
import { AttentionGovernor } from "./attention-governor.js";
|
|
9
|
+
import { AttentionGovernor, compareHomeDecisions } from "./attention-governor.js";
|
|
9
10
|
import "../automations/index.js";
|
|
11
|
+
import { stripMarkdown } from "../voice/tts/preprocess.js";
|
|
10
12
|
//#region src/tasks/home-query-service.ts
|
|
11
13
|
init_task_repository();
|
|
12
14
|
init_task_run_repository();
|
|
15
|
+
const RECENT_WORK_MS = 10080 * 6e4;
|
|
16
|
+
const DELIVERY_HISTORY_LIMIT = 30;
|
|
17
|
+
function deliverySummary(summary) {
|
|
18
|
+
return stripMarkdown(summary).replace(/\s+/g, " ").trim().slice(0, 240);
|
|
19
|
+
}
|
|
20
|
+
function automationRunHref(run) {
|
|
21
|
+
return `/automations?automation=${encodeURIComponent(run.automationId)}&view=run&run=${encodeURIComponent(run.id)}`;
|
|
22
|
+
}
|
|
13
23
|
function triggerLabel(automation) {
|
|
14
24
|
const trigger = automation.trigger;
|
|
15
25
|
if (trigger.kind === "manual") return "manual";
|
|
@@ -97,6 +107,7 @@ function decisionFromTask(model, projectName, locale) {
|
|
|
97
107
|
detail: isChinese ? {
|
|
98
108
|
"Agent run returned no result or evidence": "本次执行没有返回结果或依据,请重试。",
|
|
99
109
|
"The latest run failed": "最近一次执行失败,请查看详情后重试。",
|
|
110
|
+
"Assistant response was truncated before completion": "回复未完整生成,可查看已有结果或重试。",
|
|
100
111
|
"Task is overdue": "任务已逾期。"
|
|
101
112
|
}[item.summary] ?? item.summary : item.summary,
|
|
102
113
|
reason,
|
|
@@ -115,11 +126,14 @@ function homeActionCopy(locale) {
|
|
|
115
126
|
review: "查看并处理",
|
|
116
127
|
reviewResult: "查看结果并验收",
|
|
117
128
|
retry: "重试",
|
|
118
|
-
acknowledge: "
|
|
129
|
+
acknowledge: "移除本次提醒",
|
|
119
130
|
viewProgress: "查看进度",
|
|
120
131
|
viewSchedule: "查看计划",
|
|
121
132
|
runningTask: "任务正在推进",
|
|
122
133
|
waitingTask: "等待条件",
|
|
134
|
+
pausedTask: "已暂停",
|
|
135
|
+
pausedByUser: "已由你暂停",
|
|
136
|
+
viewPausedTask: "查看并恢复",
|
|
123
137
|
dependencyRecommendation: "先查看并处理依赖任务,再继续推进。",
|
|
124
138
|
scheduled: "下一项定时工作",
|
|
125
139
|
inputRecommendation: "建议补充所需信息,让工作继续推进。",
|
|
@@ -132,11 +146,14 @@ function homeActionCopy(locale) {
|
|
|
132
146
|
review: "Review",
|
|
133
147
|
reviewResult: "Review result",
|
|
134
148
|
retry: "Retry",
|
|
135
|
-
acknowledge: "
|
|
149
|
+
acknowledge: "Remove this alert",
|
|
136
150
|
viewProgress: "View progress",
|
|
137
151
|
viewSchedule: "View schedule",
|
|
138
152
|
runningTask: "Task in progress",
|
|
139
153
|
waitingTask: "Waiting",
|
|
154
|
+
pausedTask: "Paused",
|
|
155
|
+
pausedByUser: "Paused by you",
|
|
156
|
+
viewPausedTask: "Review and resume",
|
|
140
157
|
dependencyRecommendation: "Resolve the dependency before continuing.",
|
|
141
158
|
scheduled: "Next scheduled work",
|
|
142
159
|
inputRecommendation: "Provide the missing information so the work can continue.",
|
|
@@ -163,7 +180,7 @@ function decisionRecommendation(decision, copy) {
|
|
|
163
180
|
}
|
|
164
181
|
function buildHomeWorkbench(input) {
|
|
165
182
|
const copy = homeActionCopy(input.locale);
|
|
166
|
-
const decisions = input.decisions.map((decision) => {
|
|
183
|
+
const decisions = [...input.decisions].sort((a, b) => compareHomeDecisions(a, b, input.nowMs)).map((decision) => {
|
|
167
184
|
const openAction = {
|
|
168
185
|
type: "open",
|
|
169
186
|
label: copy.review,
|
|
@@ -191,6 +208,7 @@ function buildHomeWorkbench(input) {
|
|
|
191
208
|
kind: "decision",
|
|
192
209
|
title: decision.title,
|
|
193
210
|
summary: decision.detail || copy.review,
|
|
211
|
+
projectName: decision.projectName,
|
|
194
212
|
recommendation: decisionRecommendation(decision, copy),
|
|
195
213
|
dueAt: decision.dueAt,
|
|
196
214
|
updatedAt: decision.updatedAt,
|
|
@@ -238,17 +256,25 @@ function buildHomeWorkbench(input) {
|
|
|
238
256
|
}]
|
|
239
257
|
}));
|
|
240
258
|
const tasks = input.runningTasks.map((task) => {
|
|
259
|
+
const reason = input.waitingTaskReasons?.[task.id];
|
|
260
|
+
const paused = input.pausedTaskIds?.has(task.id);
|
|
241
261
|
const openAction = {
|
|
242
262
|
type: "open",
|
|
243
|
-
label: copy.viewProgress,
|
|
263
|
+
label: paused ? copy.viewPausedTask : copy.viewProgress,
|
|
244
264
|
href: `/tasks/${encodeURIComponent(task.id)}`
|
|
245
265
|
};
|
|
246
266
|
return {
|
|
247
267
|
id: `task:${task.id}`,
|
|
248
268
|
kind: "running",
|
|
249
269
|
title: task.title,
|
|
250
|
-
summary:
|
|
251
|
-
...
|
|
270
|
+
summary: paused && reason === "Paused by user" ? copy.pausedByUser : reason ?? (paused ? copy.pausedTask : copy.runningTask),
|
|
271
|
+
...paused ? {
|
|
272
|
+
backgroundState: "paused",
|
|
273
|
+
statusLabel: copy.pausedTask
|
|
274
|
+
} : reason ? {
|
|
275
|
+
backgroundState: "waiting",
|
|
276
|
+
statusLabel: copy.waitingTask
|
|
277
|
+
} : {},
|
|
252
278
|
updatedAt: task.updatedAt,
|
|
253
279
|
openAction,
|
|
254
280
|
secondaryActions: []
|
|
@@ -268,11 +294,6 @@ function buildHomeWorkbench(input) {
|
|
|
268
294
|
},
|
|
269
295
|
secondaryActions: []
|
|
270
296
|
}));
|
|
271
|
-
const urgencyById = new Map(input.decisions.map((decision) => [decision.id, decision.urgency]));
|
|
272
|
-
decisions.sort((left, right) => {
|
|
273
|
-
const leftUrgency = urgencyById.get(left.id) === "now" ? 1 : 0;
|
|
274
|
-
return (urgencyById.get(right.id) === "now" ? 1 : 0) - leftUrgency || right.updatedAt - left.updatedAt;
|
|
275
|
-
});
|
|
276
297
|
failures.sort((left, right) => right.updatedAt - left.updatedAt);
|
|
277
298
|
const needsUser = [...decisions, ...failures];
|
|
278
299
|
const allBackground = [...tasks, ...scheduled];
|
|
@@ -284,6 +305,7 @@ function buildHomeWorkbench(input) {
|
|
|
284
305
|
}
|
|
285
306
|
var HomeQueryService = class {
|
|
286
307
|
#tasks = new TaskRepository();
|
|
308
|
+
#runs = new TaskRunRepository();
|
|
287
309
|
#projector = new TaskReadModelProjector();
|
|
288
310
|
#attentionGovernor = new AttentionGovernor();
|
|
289
311
|
constructor(service, getAdvisor = () => ({
|
|
@@ -295,11 +317,20 @@ var HomeQueryService = class {
|
|
|
295
317
|
}
|
|
296
318
|
async getSnapshot(locale, includeAll = false) {
|
|
297
319
|
const nowMs = Date.now();
|
|
298
|
-
const
|
|
320
|
+
const activeTasks = [];
|
|
321
|
+
for (let offset = 0;; offset += 200) {
|
|
322
|
+
const page = this.#tasks.list({
|
|
323
|
+
excludeClosed: true,
|
|
324
|
+
limit: 200,
|
|
325
|
+
offset
|
|
326
|
+
});
|
|
327
|
+
activeTasks.push(...page);
|
|
328
|
+
if (page.length < 200) break;
|
|
329
|
+
}
|
|
299
330
|
const activeRuns = this.service.sessions.listActiveRuns();
|
|
300
331
|
const [automations, automationRuns, projects, connectorApprovals, activeRunSessions] = await Promise.all([
|
|
301
332
|
this.service.automationServiceInstance.list(),
|
|
302
|
-
this.service.automationServiceInstance.listRuns({ limit:
|
|
333
|
+
this.service.automationServiceInstance.listRuns({ limit: 200 }),
|
|
303
334
|
this.service.projects.list({ limit: 500 }),
|
|
304
335
|
Promise.resolve(listConnectorApprovals({
|
|
305
336
|
principalId: "local-owner",
|
|
@@ -311,7 +342,12 @@ var HomeQueryService = class {
|
|
|
311
342
|
session: await this.service.sessions.getSession(run.conversationId)
|
|
312
343
|
})))
|
|
313
344
|
]);
|
|
314
|
-
const
|
|
345
|
+
const linkedConversations = new Set(automationRuns.flatMap((run) => run.conversationId ? [run.conversationId] : []));
|
|
346
|
+
if (activeRuns.length) for (const task of activeTasks) {
|
|
347
|
+
const run = this.#runs.getActiveRoot(task.id);
|
|
348
|
+
if (run?.conversationId) linkedConversations.add(run.conversationId);
|
|
349
|
+
}
|
|
350
|
+
const runningConversations = activeRunSessions.filter((item) => item.session && !linkedConversations.has(item.conversationId)).map((item) => {
|
|
315
351
|
const session = item.session;
|
|
316
352
|
const updatedAt = Date.parse(session.lastInteractionAt ?? session.updatedAt);
|
|
317
353
|
return {
|
|
@@ -322,18 +358,24 @@ var HomeQueryService = class {
|
|
|
322
358
|
updatedAt: Number.isFinite(updatedAt) ? updatedAt : nowMs
|
|
323
359
|
};
|
|
324
360
|
}).sort((left, right) => right.updatedAt - left.updatedAt);
|
|
325
|
-
const
|
|
361
|
+
const models = activeTasks.map((task) => this.#projector.project(task, nowMs));
|
|
326
362
|
const projectsById = new Map(projects.items.map((project) => [project.id, project]));
|
|
327
363
|
const upcomingAutomations = automations.filter((automation) => automation.delivery.notificationPolicy !== "none").map(toHomeAutomation).filter((automation) => Boolean(automation)).sort((a, b) => Date.parse(a.nextRunAt) - Date.parse(b.nextRunAt));
|
|
328
|
-
const latestAutomationRuns = [...automationRuns].sort((left, right) => right.createdAtMs - left.createdAtMs).filter((run, index, all) => all.findIndex((candidate) => candidate.automationId === run.automationId) === index);
|
|
329
364
|
const automationsById = new Map(automations.map((automation) => [automation.id, automation]));
|
|
330
|
-
const
|
|
365
|
+
const visibleRuns = automationRuns.filter((run) => automationsById.has(run.automationId) && automationsById.get(run.automationId)?.delivery.notificationPolicy !== "none");
|
|
366
|
+
const latestAutomationRuns = /* @__PURE__ */ new Map();
|
|
367
|
+
for (const run of visibleRuns) {
|
|
368
|
+
const current = latestAutomationRuns.get(run.automationId);
|
|
369
|
+
if (!current || current.createdAtMs < run.createdAtMs) latestAutomationRuns.set(run.automationId, run);
|
|
370
|
+
}
|
|
371
|
+
const decisionCandidates = [...models.map((model) => decisionFromTask(model, model.task.projectId ? projectsById.get(model.task.projectId)?.name : void 0, locale)).filter((item) => Boolean(item)), ...connectorApprovals.filter((approval) => Date.parse(approval.expiresAt) > nowMs).map((approval) => ({
|
|
331
372
|
id: `connector-approval:${approval.id}`,
|
|
332
373
|
kind: "connector_approval",
|
|
333
374
|
title: approval.actionId,
|
|
334
375
|
detail: `${approval.connectorId} · ${approval.scope}\n${JSON.stringify(approval.argumentsPreview).slice(0, 1600)}`,
|
|
335
376
|
reason: "approval_required",
|
|
336
377
|
urgency: "now",
|
|
378
|
+
dueAt: Date.parse(approval.expiresAt),
|
|
337
379
|
href: approval.conversationId ? `/chat/${encodeURIComponent(approval.conversationId)}` : "/connectors",
|
|
338
380
|
updatedAt: Date.parse(approval.createdAt),
|
|
339
381
|
response: {
|
|
@@ -341,7 +383,7 @@ var HomeQueryService = class {
|
|
|
341
383
|
approvalId: approval.id
|
|
342
384
|
}
|
|
343
385
|
}))];
|
|
344
|
-
const attentionCandidates = [...latestAutomationRuns.filter((run) => run.status === "failed" || run.status === "timeout").filter((run) =>
|
|
386
|
+
const attentionCandidates = [...[...latestAutomationRuns.values()].filter((run) => run.status === "failed" || run.status === "timeout").filter((run) => !isHomeAttentionAcknowledged("automation_run", run.id)).map((run) => ({
|
|
345
387
|
id: `automation_run:${run.id}`,
|
|
346
388
|
kind: "automation_run",
|
|
347
389
|
runId: run.id,
|
|
@@ -355,39 +397,143 @@ var HomeQueryService = class {
|
|
|
355
397
|
const governed = this.#attentionGovernor.project({
|
|
356
398
|
includeAll,
|
|
357
399
|
decisions: decisionCandidates,
|
|
358
|
-
attention: attentionCandidates
|
|
400
|
+
attention: attentionCandidates,
|
|
401
|
+
nowMs
|
|
359
402
|
});
|
|
360
403
|
const decisions = governed.decisions;
|
|
361
404
|
const attention = governed.attention;
|
|
362
405
|
const waitingTaskReasons = {};
|
|
406
|
+
const pausedTaskIds = /* @__PURE__ */ new Set();
|
|
407
|
+
const workbench = buildHomeWorkbench({
|
|
408
|
+
locale,
|
|
409
|
+
decisions,
|
|
410
|
+
attention,
|
|
411
|
+
runningTasks: models.filter((model) => {
|
|
412
|
+
const task = model.task;
|
|
413
|
+
if (model.operationalState === "waiting" && model.attention.length === 0) {
|
|
414
|
+
const waits = this.#runs.listActiveWaits(task.id);
|
|
415
|
+
const pause = waits.find((wait) => wait.kind === "paused");
|
|
416
|
+
if (pause) pausedTaskIds.add(task.id);
|
|
417
|
+
waitingTaskReasons[task.id] = (pause ?? waits[0])?.reason ?? homeActionCopy(locale).waitingTask;
|
|
418
|
+
return true;
|
|
419
|
+
}
|
|
420
|
+
return [
|
|
421
|
+
"allocating",
|
|
422
|
+
"queued",
|
|
423
|
+
"running",
|
|
424
|
+
"verifying"
|
|
425
|
+
].includes(model.operationalState);
|
|
426
|
+
}).map((model) => model.task),
|
|
427
|
+
waitingTaskReasons,
|
|
428
|
+
pausedTaskIds,
|
|
429
|
+
scheduled: upcomingAutomations,
|
|
430
|
+
nowMs
|
|
431
|
+
});
|
|
432
|
+
const copy = homeActionCopy(locale);
|
|
433
|
+
const runningAutomations = visibleRuns.filter((run) => [
|
|
434
|
+
"queued",
|
|
435
|
+
"running",
|
|
436
|
+
"cancelling"
|
|
437
|
+
].includes(run.status)).map((run) => ({
|
|
438
|
+
id: `automation_run:${run.id}`,
|
|
439
|
+
kind: "running",
|
|
440
|
+
title: run.automationName || run.automationId,
|
|
441
|
+
summary: copy.runningTask,
|
|
442
|
+
updatedAt: run.startedAtMs ?? run.createdAtMs,
|
|
443
|
+
openAction: {
|
|
444
|
+
type: "open",
|
|
445
|
+
label: copy.viewProgress,
|
|
446
|
+
href: automationRunHref(run)
|
|
447
|
+
},
|
|
448
|
+
secondaryActions: []
|
|
449
|
+
}));
|
|
363
450
|
return {
|
|
364
|
-
...
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
attention,
|
|
368
|
-
runningTasks: tasks.filter((task) => {
|
|
369
|
-
if (task.phase === "closed") return false;
|
|
370
|
-
const model = this.#projector.project(task);
|
|
371
|
-
if (model.operationalState === "waiting" && model.attention.length === 0) {
|
|
372
|
-
waitingTaskReasons[task.id] = new TaskRunRepository().listActiveWaits(task.id)[0]?.reason ?? homeActionCopy(locale).waitingTask;
|
|
373
|
-
return true;
|
|
374
|
-
}
|
|
375
|
-
return [
|
|
376
|
-
"queued",
|
|
377
|
-
"running",
|
|
378
|
-
"verifying"
|
|
379
|
-
].includes(model.operationalState);
|
|
380
|
-
}),
|
|
381
|
-
waitingTaskReasons,
|
|
382
|
-
scheduled: upcomingAutomations,
|
|
383
|
-
nowMs
|
|
384
|
-
}),
|
|
451
|
+
...workbench,
|
|
452
|
+
background: [...runningAutomations, ...workbench.background],
|
|
453
|
+
backgroundCount: runningAutomations.length + workbench.backgroundCount,
|
|
385
454
|
runningConversations,
|
|
455
|
+
recentDeliveries: this.recentDeliveries(visibleRuns),
|
|
456
|
+
resumable: this.resumableWork(models, decisionCandidates, projectsById, activeRuns, nowMs),
|
|
386
457
|
decisions,
|
|
387
458
|
advisor: this.getAdvisor(locale),
|
|
388
459
|
attentionPolicy: governed.policy
|
|
389
460
|
};
|
|
390
461
|
}
|
|
462
|
+
recentDeliveries(automationRuns) {
|
|
463
|
+
const deliveries = [];
|
|
464
|
+
for (const task of this.#tasks.list({
|
|
465
|
+
phase: "closed",
|
|
466
|
+
limit: 100
|
|
467
|
+
})) {
|
|
468
|
+
if (task.resolution !== "done") continue;
|
|
469
|
+
const run = this.#runs.getLatestRoot(task.id);
|
|
470
|
+
if (!run || run.contractVersion !== task.latestContractVersion) continue;
|
|
471
|
+
const receipt = this.#runs.getReceipt(run.id);
|
|
472
|
+
if (!receipt || receipt.status !== "succeeded" || !receipt.summary.trim() && !receipt.evidence.length) continue;
|
|
473
|
+
deliveries.push({
|
|
474
|
+
id: `task:${run.id}`,
|
|
475
|
+
kind: "task",
|
|
476
|
+
subjectId: task.id,
|
|
477
|
+
title: task.title,
|
|
478
|
+
summary: deliverySummary(receipt.summary),
|
|
479
|
+
completedAt: receipt.finalizedAt,
|
|
480
|
+
read: task.contract?.acceptancePolicy === "manual",
|
|
481
|
+
href: `/tasks/${encodeURIComponent(task.id)}`
|
|
482
|
+
});
|
|
483
|
+
}
|
|
484
|
+
for (const run of automationRuns) {
|
|
485
|
+
if (run.status !== "succeeded" || !run.endedAtMs || !run.summary?.trim() && !run.conversationId) continue;
|
|
486
|
+
deliveries.push({
|
|
487
|
+
id: `automation:${run.id}`,
|
|
488
|
+
kind: "automation",
|
|
489
|
+
subjectId: run.id,
|
|
490
|
+
title: run.automationName || run.automationId,
|
|
491
|
+
summary: deliverySummary(run.summary ?? ""),
|
|
492
|
+
completedAt: run.endedAtMs,
|
|
493
|
+
read: run.readAtMs !== void 0,
|
|
494
|
+
href: automationRunHref(run)
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
return deliveries.sort((a, b) => b.completedAt - a.completedAt).slice(0, DELIVERY_HISTORY_LIMIT);
|
|
498
|
+
}
|
|
499
|
+
resumableWork(models, decisions, projects, activeRuns, now) {
|
|
500
|
+
const cutoff = now - RECENT_WORK_MS;
|
|
501
|
+
const decisionIds = new Set(decisions.flatMap((item) => item.response?.kind === "task" ? [item.response.taskId] : []));
|
|
502
|
+
const runningIds = new Set(activeRuns.map((item) => item.conversationId));
|
|
503
|
+
const resumable = [];
|
|
504
|
+
for (const { task, operationalState, allowedCommands } of models) {
|
|
505
|
+
if (task.updatedAt < cutoff || decisionIds.has(task.id) || operationalState !== "idle" || !allowedCommands.includes("start")) continue;
|
|
506
|
+
resumable.push({
|
|
507
|
+
id: task.id,
|
|
508
|
+
kind: "task",
|
|
509
|
+
title: task.title,
|
|
510
|
+
summary: task.contract?.objective,
|
|
511
|
+
projectName: task.projectId ? projects.get(task.projectId)?.name : void 0,
|
|
512
|
+
updatedAt: task.updatedAt,
|
|
513
|
+
href: `/tasks/${encodeURIComponent(task.id)}`
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
for (const session of listSessionMetadata({
|
|
517
|
+
limit: 20,
|
|
518
|
+
excludeArchived: true,
|
|
519
|
+
excludeAutomationRuns: true,
|
|
520
|
+
rootConversationsOnly: true,
|
|
521
|
+
activity: "manual",
|
|
522
|
+
updatedAfter: cutoff
|
|
523
|
+
}).items) {
|
|
524
|
+
const updatedAt = Date.parse(session.lastInteractionAt ?? session.updatedAt);
|
|
525
|
+
if (!session.messageCount || !session.name?.trim() || updatedAt < cutoff || runningIds.has(session.key)) continue;
|
|
526
|
+
resumable.push({
|
|
527
|
+
id: session.key,
|
|
528
|
+
kind: "conversation",
|
|
529
|
+
title: session.name,
|
|
530
|
+
projectName: session.projectId ? projects.get(session.projectId)?.name : void 0,
|
|
531
|
+
updatedAt,
|
|
532
|
+
href: `/chat/${encodeURIComponent(session.key)}`
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
return resumable.sort((a, b) => b.updatedAt - a.updatedAt).slice(0, 3);
|
|
536
|
+
}
|
|
391
537
|
};
|
|
392
538
|
//#endregion
|
|
393
539
|
export { HomeQueryService, buildHomeWorkbench, decisionFromTask };
|
package/dist/src/tasks/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { TaskDeletionService } from "./task-deletion-service.js";
|
|
|
10
10
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
11
11
|
import { TaskSignalService } from "./task-signal-service.js";
|
|
12
12
|
import { resolveExecutionContext } from "./execution-context.js";
|
|
13
|
-
import { AttentionGovernor } from "./attention-governor.js";
|
|
13
|
+
import { AttentionGovernor, compareHomeDecisions } from "./attention-governor.js";
|
|
14
14
|
import { HomeQueryService, buildHomeWorkbench, decisionFromTask } from "./home-query-service.js";
|
|
15
15
|
import { defineTaskContract } from "./task-contract-definition.js";
|
|
16
16
|
import { ModelTaskContractPlanner, parseTaskContractResponse } from "./task-contract-planner.js";
|
|
@@ -24,4 +24,4 @@ init_task_repository();
|
|
|
24
24
|
init_task_change_events();
|
|
25
25
|
init_task_run_repository();
|
|
26
26
|
//#endregion
|
|
27
|
-
export { AttentionGovernor, HomeQueryService, ModelTaskContractPlanner, ProjectOperatingViewService, TaskApplicationService, TaskContextRepository, TaskConversationConflictError, TaskConversationRepository, TaskDeletionService, TaskDependencyError, TaskDependencyService, TaskHandoffService, TaskReadModelProjector, TaskRepository, TaskRunCoordinator, TaskRunDispatcher, TaskRunRepository, TaskSignalService, TaskValueMetricsService, assembleTaskContext, buildDelegatedTaskDirective, buildHomeWorkbench, buildTaskExecutionDirective, buildTaskRunMessage, decisionFromTask, defineTaskContract, enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent, getTaskContextManifest, getTaskExecutionBrief, parseTaskContractResponse, resolveExecutionContext, summarizeProjectOperatingView };
|
|
27
|
+
export { AttentionGovernor, HomeQueryService, ModelTaskContractPlanner, ProjectOperatingViewService, TaskApplicationService, TaskContextRepository, TaskConversationConflictError, TaskConversationRepository, TaskDeletionService, TaskDependencyError, TaskDependencyService, TaskHandoffService, TaskReadModelProjector, TaskRepository, TaskRunCoordinator, TaskRunDispatcher, TaskRunRepository, TaskSignalService, TaskValueMetricsService, assembleTaskContext, buildDelegatedTaskDirective, buildHomeWorkbench, buildTaskExecutionDirective, buildTaskRunMessage, compareHomeDecisions, decisionFromTask, defineTaskContract, enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent, getTaskContextManifest, getTaskExecutionBrief, parseTaskContractResponse, resolveExecutionContext, summarizeProjectOperatingView };
|
|
@@ -749,9 +749,9 @@ var TaskApplicationService = class {
|
|
|
749
749
|
const verifiedCriteria = verifiedTaskCriteria(input.receipt);
|
|
750
750
|
const criteria = task.contract?.acceptanceCriteria ?? [];
|
|
751
751
|
const criteriaVerified = criteria.length > 0 && criteria.every((criterion) => verifiedCriteria.has(criterion));
|
|
752
|
-
const
|
|
752
|
+
const humanReviewBlocksCompletion = new TaskCriterionReviewRepository().list(task.id, task.latestContractVersion).some((review) => review.status !== "passed");
|
|
753
753
|
const hasWaits = this.#runs.listActiveWaits(task.id).length > 0;
|
|
754
|
-
const verified = !
|
|
754
|
+
const verified = !humanReviewBlocksCompletion && !hasWaits && criteriaVerified && input.receipt.verification.status === "passed" && input.receipt.completionVerdict === "achieved" && input.receipt.remainingWork.length === 0 && !input.receipt.needsUser;
|
|
755
755
|
const phase = task.contract?.acceptancePolicy === "verified_auto" && verified ? "closed" : "review";
|
|
756
756
|
const updated = this.#tasks.setLifecycle({
|
|
757
757
|
taskId: task.id,
|
|
@@ -150,7 +150,7 @@ function buildTaskExecutionDirective(conversationId) {
|
|
|
150
150
|
criterionIndex,
|
|
151
151
|
criterion
|
|
152
152
|
})))}`,
|
|
153
|
-
"For research or evidence-based conclusions, use publish_task_result before finishing when that tool is available. Cite exact excerpts from successful reads in this TaskRun, link each claim to source ids, and distinguish facts, inferences and recommendations. Publish required files first, then supply finalArtifactIds selecting only the final deliverables from their publication receipts; do not include intermediate or obsolete files. Read its per-criterion review; correct unsupported claims or explicitly disclose unmet/unverified criteria. Never replace missing evidence with a self-declared pass. Use task_collaboration get section evidence to recover real toolCallIds and exact excerpts.
|
|
153
|
+
"For research or evidence-based conclusions, use publish_task_result before finishing when that tool is available. Cite exact excerpts from successful reads in this TaskRun, link each claim to source ids, and distinguish facts, inferences and recommendations. Publish required files first, then supply finalArtifactIds selecting only the final deliverables from their publication receipts; do not include intermediate or obsolete files. Read its per-criterion review; correct unsupported claims or explicitly disclose unmet/unverified criteria. Never replace missing evidence with a self-declared pass. Use task_collaboration get section evidence to recover real toolCallIds and exact excerpts. If the chat reply itself is a deliverable, include the exact reply in finalText, including any required limitations, links and formatting. The host will review that text and deliver it verbatim. Keep it within the requested limits and amend finalText if the review finds gaps. Do not cite it as a source or create a separate file to prove its wording. A source quote match proves provenance, not factual truth. Keep the final reply concise; full evidence belongs in the result and report.",
|
|
154
154
|
`Acceptance policy: ${contract.acceptancePolicy}. Automatic tasks close after verified completion. Request user input only for a real missing decision or authorization; do not ask for routine acceptance.`,
|
|
155
155
|
contract.constraints.length ? `Constraints: ${contract.constraints.join("; ")}` : "",
|
|
156
156
|
contract.assumptions.length ? `Assumptions: ${contract.assumptions.join("; ")}` : "",
|
|
@@ -3,6 +3,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { PERSONAL_WORKER_RESULT_GUIDANCE } from "../../packages/gateway-contract/src/task-display.js";
|
|
4
4
|
import { getAgentDefaultChatModelConfig, init_schema } from "../config/schema.js";
|
|
5
5
|
import { hasUnlocalizedTaskText, resolveTaskLocale } from "./task-language.js";
|
|
6
|
+
import { finalReplyCharacterLimit, isChatReplyOutput } from "./task-final-reply.js";
|
|
6
7
|
import { defineTaskContract } from "./task-contract-definition.js";
|
|
7
8
|
import { completeTaskModelCall } from "./task-model-call.js";
|
|
8
9
|
import "../personal-agent/communication.js";
|
|
@@ -47,11 +48,12 @@ function parseTaskContractResponse(raw) {
|
|
|
47
48
|
const plannedCriteria = strings(parsed.acceptanceCriteria, 40);
|
|
48
49
|
const writeBoundary = (criterion) => /(?:仅|只)(?:能)?写入|未(?:覆盖|修改).*其他文件|(?:write only|only write)|(?:not|never) (?:overwrite|modify).*other files/i.test(criterion);
|
|
49
50
|
const deliveryPhrase = /最终(?:的)?(?:回复|答复)|交付说明(?:仅|只|中|不|未)|(?:final|future) (?:chat )?(?:reply|response)|(?:delivery|chat) (?:message|reply)/i;
|
|
50
|
-
const
|
|
51
|
+
const chatReplyOutput = expectedOutputs.some(isChatReplyOutput);
|
|
52
|
+
const deliveryBoundary = (criterion) => !chatReplyOutput && finalReplyCharacterLimit(criterion) === void 0 && deliveryPhrase.test(criterion);
|
|
51
53
|
const boundary = (criterion) => writeBoundary(criterion) || deliveryBoundary(criterion);
|
|
52
54
|
const acceptanceCriteria = plannedCriteria.filter((criterion) => !writeBoundary(criterion)).flatMap((criterion) => {
|
|
55
|
+
if (!deliveryBoundary(criterion)) return [criterion];
|
|
53
56
|
const position = criterion.search(deliveryPhrase);
|
|
54
|
-
if (position < 0) return [criterion];
|
|
55
57
|
const prefix = criterion.slice(0, position).replace(/[,,;;。\s]*(?:并且|且|并|and)?\s*$/i, "").trim();
|
|
56
58
|
return prefix && /运行|执行|发布|生成|校验|\b(?:run|execut|publish|generat|verif)/i.test(prefix) ? [prefix] : [];
|
|
57
59
|
}).filter((criterion) => !(/publish_task_result/.test(criterion) && /调用|使用|提交|返回|检查|验收|call|submit|review/i.test(criterion) && !/报告.*(?:说明|描述)|文档.*(?:说明|描述)|(?:report|document).*describe/i.test(criterion)));
|
|
@@ -91,7 +93,7 @@ var ModelTaskContractPlanner = class {
|
|
|
91
93
|
"Acceptance criteria must describe externally checkable finished states, not activities.",
|
|
92
94
|
"Write boundaries and prohibitions on unrelated actions belong in constraints, not criteria requiring proof that no unobserved action ever occurred. Criteria may check the actual delivered output paths and unchanged supplied input bytes. Never remove an explicit scope restriction.",
|
|
93
95
|
"Keep each criterion concise and concrete; do not repeat the full brief. Include all required deliverable conditions without splitting trivial wording into unnecessary items.",
|
|
94
|
-
"Define criteria for the
|
|
96
|
+
"Define criteria for the deliverables requested by the user. When the requested answer is a chat reply, list it explicitly in expectedOutputs and preserve its concrete requirements, including language and character limits. Keep source support, calculations, completeness and requested limitations as separate criteria. Do not create self-referential criteria about calling publish_task_result, receiving this review or wording a routine delivery acknowledgement.",
|
|
95
97
|
"requiredCapabilities is a minimal subset of read_input, execute_code, publish_files, web_research, browser, generate_image. Include only operations necessary for the requested inputs/outputs; this list selects registered tools and grants no permissions. Do not require browser when ordinary web fetch suffices. Preserve explicit executor/Skill and scope constraints.",
|
|
96
98
|
"List assumptions explicitly. Put only irreversible, external, financial, privacy, or permission decisions in approvalRequired.",
|
|
97
99
|
"Return one JSON object only. Every array contains flat strings, never objects or nested arrays. Schema example: {\"objective\":\"Deliver the requested work\",\"expectedOutputs\":[\"report.md\"],\"acceptanceCriteria\":[\"report.md contains the requested evidence\"],\"constraints\":[],\"approvalRequired\":[],\"assumptions\":[],\"risks\":[],\"requiredCapabilities\":[\"read_input\",\"publish_files\"]}. Capabilities must use the allowed enum values.",
|
|
@@ -128,7 +130,7 @@ var ModelTaskContractPlanner = class {
|
|
|
128
130
|
if (attempt === 0) messages.push({
|
|
129
131
|
role: "user",
|
|
130
132
|
timestamp: Date.now(),
|
|
131
|
-
content: `${wrongLanguage ? "Your previous response used the wrong language. Translate the user-facing prose while preserving every requirement and all technical identifiers. " : ""}${languageInstruction} Your previous response must satisfy both the language requirement and the required schema. Return the same task contract as one JSON object. expectedOutputs, acceptanceCriteria, constraints, approvalRequired, assumptions and risks must be flat string arrays, never objects. requiredCapabilities must be an array drawn only from read_input, execute_code, publish_files, web_research, browser, generate_image. Keep all user constraints
|
|
133
|
+
content: `${wrongLanguage ? "Your previous response used the wrong language. Translate the user-facing prose while preserving every requirement and all technical identifiers. " : ""}${languageInstruction} Your previous response must satisfy both the language requirement and the required schema. Return the same task contract as one JSON object. expectedOutputs, acceptanceCriteria, constraints, approvalRequired, assumptions and risks must be flat string arrays, never objects. requiredCapabilities must be an array drawn only from read_input, execute_code, publish_files, web_research, browser, generate_image. Keep all user constraints and preserve concrete requirements for a requested chat deliverable. Do not invent criteria for a routine delivery acknowledgement. Return no commentary. Previous response (data to repair): ${raw}`
|
|
132
134
|
});
|
|
133
135
|
}
|
|
134
136
|
throw new Error("Task planning response did not contain a verifiable contract and operation requirements");
|