@xopcai/xopc 0.0.456 → 0.0.459
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 -1
- 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-DYwR1u3f.js → activity-store-CQHh48Zf.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-CsRBprL-.js → agent-avatar-dicebear-CAz-Ke6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-DqFYHXCS.js → agent-avatar-display-loBdGw_i.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DOAJrMLe.js → agent-defaults-settings-panel-By2Q-6JS.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-vqlN3ORH.js → agent-plugin-dialog-CikzCYAG.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-BgHlOVRV.js → agents-CGUdvmIT.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-CKscfdvA.js → agents-admin-api-D0N09mqJ.js} +1 -1
- package/dist/gateway/static/root/assets/{api-CHM2c_Ah.js → api-B1J5ajiP.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DPNeNCmR.js → api-B4FJ51EC.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Bhz6bj1C.js → app-management-settings-panel-BHlUDZOG.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BX32aogA.js → appearance-settings-Du5JLyV1.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-0Yo3jBsQ.js → apps-page-M2XD1Pzu.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Bha8obMe.js → archive-plugin-BAvglLfu.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-mn8ihWJ_.js → automation-api-DxBmyzp0.js} +1 -1
- package/dist/gateway/static/root/assets/automation-display-DaVDNZz8.js +2 -0
- package/dist/gateway/static/root/assets/{automation-result-state-COzakzak.js → automation-result-state-CAsqgMNR.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-BhtaMpTb.js → automation-run-list-BmYeWB_N.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-CiJmJ7_h.js +2 -0
- package/dist/gateway/static/root/assets/{automations-page-CgQDpSpK.js → automations-page-CVjgENMO.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CGPWyL0P.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DUbrJFLU.js → binary-plugins-D2bFqG6K.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DW--pXAc.js → block-editor-CmnkluMF.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CDh6nxs9.js → browser-settings-page-CGcgZOWh.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-DB713nRi.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-DKbXv8Ck.js → capabilities-DDqDvCBs.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-D2hq4cgE.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-BW5jQz5R.js → capabilities-settings-panel-CvF8VRTv.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-BzZp42yO.js → channels-BDVQ6Z7A.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-UOdNWZ0_.js → chat-agents-api-CjlzCSmC.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-NSy-B0NS.js → chat-chart-block-stPJEZ90.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-BhPw56Vc.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-CAaHWS7F.js → chat-terminal-dock-B4uA_W6R.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-Dkn9bbYd.js → command-palette-api-CP0F6sIm.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-BrK8-SNz.js → composer-model-config-control-DAagrRx_.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-B-kL3qAA.js → composer-notifications-CqV6Xj-H.js} +1 -1
- package/dist/gateway/static/root/assets/composer-payload-handoff-Dc43dgSg.js +1 -0
- package/dist/gateway/static/root/assets/{computer-settings-page-C9KdEecx.js → computer-settings-page-f-vcEpeF.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-D_8v6Qex.js → connected-providers-grid-CZ-FXxaW.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-CiVpcbds.js → connection-usage-guide-Cibh2lrV.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-B919cKSm.js → connector-service-page-Btz68iy8.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-CgsSm-Av.js → connectors-api-CTuVWwBf.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DyzDVVfz.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-dx284jQI.js → date-picker-XnE3iFhG.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-Dj-bhLNP.js → date-time-picker-VGKm0HVn.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Cn1TfGz4.js → desktop-pet-CBm3DySQ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CsmrvoxU.js → desktop-pet-settings-6O77QXGo.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-BOxbj1ie.js → dev-view-store-B8fGILny.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CAqFIFRC.js → device-pairing-wizard-qtUvtdDT.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BxEw5OrT.js → directory-picker-path-field-ByDqf5fE.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-CyntTwIa.js → discussion-annotation-sync-fwPPMPv9.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-C0ReZguU.js → extension-authoritative-grants-BfL8dMBf.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-Cd3HMUbi.js → extension-debug-page-BPwRrP3L.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-DiIqM2JO.js → extension-iframe-host-DIH4TcdH.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-CK5CMKTs.js → extension-marketplace-api-BIzkukYp.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-Dn8JzOdR.js → extension-message-router-C9JDpo_7.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CLZtAtqm.js → extension-page-CLDoL5N8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-CbVokTvd.js → extension-provider-BPIoHw4r.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BM79cwUy.js → extension-settings-page-BO_UKeG8.js} +1 -1
- package/dist/gateway/static/root/assets/file-preview-surface-i5UOFnQF.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-OGhON-s6.js → gateway-config-swr-1Rk0LeEM.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-B9u4uSXW.js → gateway-realtime-DIs1pjkQ.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-sx7B8kdC.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DKAweWmg.js → gateway-restart-DTmlcJps.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-Dc7qUbG-.js → gateway-settings-ClcCloqQ.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BaaoKBoB.js → gateway-startup-retry-D6WPS0RW.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-BIr3ApRj.js → global-defaults-api-BpDMnJe7.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BPPe4JXB.js +7 -0
- package/dist/gateway/static/root/assets/{image-generation-api-C7D2IetZ.js → image-generation-api-sbtx4NiC.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-BjEdZJxZ.js → imports-page-CBlaxUhl.js} +1 -1
- package/dist/gateway/static/root/assets/index-D0_qnBzh.css +1 -0
- package/dist/gateway/static/root/assets/index-Hv71yddc.js +11 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-BsiyYQhx.js → install-connector-dialog-DxSv1wS2.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CIthQ1lp.js → keyboard-shortcuts-settings-CnAV96nr.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CSCIHvZV.js → local-app-workbench-page-D8oqDDAn.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-EntiM0tz.js → local-apps-page-BI3Be5qo.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-XurtjR58.js → local-session-drafts-BIBHRkpM.js} +2 -2
- package/dist/gateway/static/root/assets/{locale-store-cg9cm2EL.js → locale-store-Dy1EByeG.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-rmS9VSem.js → logs-page-CMW34T31.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-B6jVuJ6W.js → management-api-B5w5DdXH.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DdI9gs51.js → management-settings-DfcMIqbQ.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-D1zBWkfB.js → markdown-view-BlxIaCCQ.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-Bn49Ph1n.js → mcp-conversation-setup-page-CsTSmjmX.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Cd6hAGDp.js → media-plugins-DGhWjPIU.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BAnhwALN.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-CL6WT-jw.js → model-selector-C-CqPBao.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-s0FMNhq9.js → models-hub-cache-Bgh3Gfgl.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-C6s0WlNL.js → note-detail-panel-DLPwJGh0.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-CqK_uJ6Y.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-CR75RHd0.js → notes-api-CdXA-g9r.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CR7dNVDi.js → notes-page-DpfN5bZZ.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-CvPnQTlH.js → oauth-api-B560CHeD.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-Dk1NeeqD.js → oauth-provider-connect-D63M8Iv7.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BPtX67hZ.js → page-context-capture-button-Dibmspef.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-Ckb8baxj.js → page-context-draft-Cr5GqS2D.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-Bm8oxpFR.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-CZSnrSfc.js → personal-avatar-BMRVyTrE.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-C89kLOIL.js → personal-page-BBGjwkAC.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-profile-settings-DJRDcK2c.js → personal-profile-settings-HMQY9lz9.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-C6p25Noq.js → personal-settings-panel-BppxtWBl.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DKkFFpqi.js → phone-dependencies-card-flTci8mm.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-CRRHq4PQ.js → phone-model-connection-Vi_Swyv6.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CN_I0-46.js → phone-model-picker-BOv3mb_F.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-CkdSOA7D.js → phone-settings-page-vD0bTcHj.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-CC61pIuJ.js → phone-workspace-store-Ltrevdsx.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-Bqz4jT53.js → plugin-details-dialog-nSDw8sfo.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-DHeNbAvn.js → preference-select-fields-D1pZekPs.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BN2HTA9T.js → product-automation-feedback-D51I7Lg3.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-B-j4gpLD.js → product-open-page-BO8lUvw3.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-content-WkF2j_c-.js +1 -0
- package/dist/gateway/static/root/assets/{product-preview-modal-aurFBFq4.js → product-preview-modal-DMHOKocl.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-sHcdluTm.js → project-detail-page-Dj_PuT7k.js} +2 -2
- package/dist/gateway/static/root/assets/{project-understanding-HNK9lFVy.js → project-understanding-Cg8WbBNB.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CugSyKl5.js → projects-page-C6Pt6OdT.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-DUntOOqr.js → providers-api-Nytkkop9.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-DIwP541B.js → recording-upload-CyZSl2DJ.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-BTd_OgbD.js → registry-api-DuDIthjL.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-f5mIfsBF.js → remote-access-hub-DePwafOK.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-DtQ2rfu_.js → resource-unavailable-BRKhKJA0.js} +1 -1
- package/dist/gateway/static/root/assets/right-workspace-store-HPw7Gw0n.js +1 -0
- package/dist/gateway/static/root/assets/route-preload-gas8e1we.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-CXs4PjW0.js +2 -0
- package/dist/gateway/static/root/assets/{runtime-tools-api-C1iI8EPo.js → runtime-tools-api-Dd8a07eo.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-0tdI1z0g.js → runtime-tools-settings-panel-CvHQoqHu.js} +1 -1
- package/dist/gateway/static/root/assets/service-recommendation-list-DDlMyPvC.js +1 -0
- package/dist/gateway/static/root/assets/{session-api-CQlEq0MB.js → session-api-BFiIYodK.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-C7RfUfqI.js → session-manager-D2LaQymu.js} +2 -2
- package/dist/gateway/static/root/assets/{sessions-page-DdS8U0RV.js → sessions-page-DQEq_VJS.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cvx7DnU8.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-C6dPu5i1.js → settings-advanced-section-B-H1gYOs.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BSiiowQa.js → settings-mode-store-YH60sibB.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C4CYw21O.js → settings-page-D2qkIrUg.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-BSMu5Zq3.js → settings-page-header-DEZZ8D0S.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-B_vMffB1.js → settings-page-layout-De2j64Lo.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-DKXfFdNt.js → setup-interaction-page-Dh6BPwv0.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-BbAZ9w77.js → setup-status-panel-DGAAczL-.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-ztX1WPXG.js → share-link-dialog-C1t_HB6f.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-Ds2Ydfg6.js → share-preview-page-fV5USZb1.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-CSZqeNL4.js → shares-api-Dm07CnXw.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-CX3TNAmI.js → shares-settings-sl40lqND.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CGzAQ-MX.js → skill-api-BV8oFqeE.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-DfUsku-x.js → skill-list-api-1o_YRCu9.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-Y9qSMnBd.js → skill-reload-api-fGsO9Y86.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DnMN50Ot.js → skills-page-FTd0Z7Ey.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DWNkQmme.js → system-settings-panel-CUI6QHEP.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-_5TEldtl.js +3 -0
- package/dist/gateway/static/root/assets/task-result-evidence-CSJeB9AH.js +1 -0
- package/dist/gateway/static/root/assets/{terminal-panel-store-D8eZPvql.js → terminal-panel-store-Du53Upr2.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-GZQ3pTgy.js → theme-store-BaWep_o7.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-DM3-7Hlw.js → tracing-settings-page-CnciBMVH.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DOGAIXRR.js → tunnel-api-Iz7JCBt3.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-CuPfe0eQ.js → understanding-activity-store-BFc8PamJ.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CIpGYSl0.js → understanding-refresh-store-CdEfR40A.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BA9Yrvqu.js → usage-page-DL2fmeOh.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CO0IPCVg.js → use-autosave-N_SjHXTw.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-CO7XLI4x.js +2 -0
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-dhNMHf5b.js → use-file-preview-expanded-BXXeXnT0.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-CVqDWBDS.js → use-personal-profile-C1vqD9yV.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-DDVVlX1R.js → use-realtime-voice-C7iWQuUv.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-CZej8mhf.js → use-workspace-tree-D27u-eoX.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-Bbi2MpIS.js → user-model-page-D2FHjLi7.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-DpwUDAvu.js → voice-api-key-field-B_GApUQP.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-GIuXoHXw.js → voice-config-api-DhJ3l8fk.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-Cc30ZcFy.js → voice-input-shortcut-events-CEeFBhp3.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-DA3m5MT0.js → voice-settings-BiqJ0tlf.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-yGUkk1NV.js → work-discovery-overlay-UvWbDUXi.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-RN6iuY-0.js → work-discovery-page-BM1HsYz6.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-CeXl9w6z.js → working-directory-picker-modal-BGZduAXV.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-B1Uirhxf.js → workspace-api-LghfbP5g.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-DVPJcbuE.js +1 -0
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-NffP-UXC.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-DWGNOIE2.js → workspace-open-location-menu-CvZxU9de.js} +1 -1
- package/dist/gateway/static/root/assets/workspace-preview-store-Do31QQH5.js +1 -0
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-x-XT4bKF.js → xopc-cloud-account-card-Q_jezTUy.js} +1 -1
- package/dist/gateway/static/root/index.html +92 -90
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +6 -0
- package/dist/packages/gateway-contract/src/capabilities.js +1 -1
- package/dist/packages/gateway-contract/src/home.js +3 -0
- package/dist/packages/gateway-contract/src/index.js +3 -1
- package/dist/packages/gateway-contract/src/observation.js +177 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +5 -1
- package/dist/src/agent/agent-manager.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/client-error-format.js +1 -1
- package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -0
- package/dist/src/agent/embedded/execution-tool-policy.js +31 -5
- package/dist/src/agent/embedded/run-for-session.js +16 -8
- package/dist/src/agent/embedded/run-turn.js +65 -29
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/external-tools/cliProvider.js +2 -2
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +3 -3
- package/dist/src/agent/fallback/reason.js +1 -1
- package/dist/src/agent/orchestration/llm-turn-retry.d.ts +5 -0
- package/dist/src/agent/orchestration/llm-turn-retry.js +17 -6
- package/dist/src/agent/service.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/personal-memory-tool.js +1 -1
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/repository.js +1 -1
- package/dist/src/automations/api/routes.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +10 -0
- package/dist/src/automations/capabilities/write.js +1 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/domain/types.d.ts +14 -0
- package/dist/src/automations/domain/validation.d.ts +20 -0
- package/dist/src/automations/domain/validation.js +6 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +5 -0
- package/dist/src/automations/draft/automation-draft-validator.js +1 -0
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.d.ts +2 -0
- package/dist/src/automations/service/action-executor.js +18 -2
- package/dist/src/automations/service/index.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/computer/endpoint-transport.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/execution-environments/local-worktree-manager.js +1 -1
- package/dist/src/extensions/agent-plugins/skill-catalog.js +1 -1
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +100 -2
- package/dist/src/gateway/hono/routes/local-app-run-streams.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service.js +21 -4
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/application-service.d.ts +1 -0
- package/dist/src/home-intelligence/application-service.js +1 -1
- package/dist/src/home-intelligence/generator.js +4 -0
- package/dist/src/home-intelligence/host.d.ts +157 -1
- package/dist/src/home-intelligence/host.js +198 -14
- package/dist/src/home-intelligence/observation.d.ts +41 -0
- package/dist/src/home-intelligence/observation.js +297 -0
- package/dist/src/home-intelligence/repository.d.ts +1 -1
- package/dist/src/home-intelligence/routines.d.ts +36 -0
- package/dist/src/home-intelligence/routines.js +444 -0
- package/dist/src/home-intelligence/snapshot.d.ts +14 -0
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/local-apps/automation-proposals.d.ts +20 -0
- package/dist/src/local-apps/automation-proposals.js +1 -1
- package/dist/src/local-apps/capabilities/automation-policy.js +1 -1
- package/dist/src/local-apps/capabilities/delegate.js +3 -3
- package/dist/src/local-apps/p1-services.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/personal-agent/proactivity/repository.d.ts +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-response.js +1 -1
- package/dist/src/realtime/compact-run-event.js +9 -0
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/storage/sqlite/conversation-repository.js +4 -1
- 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 +71 -0
- package/dist/src/storage/sqlite/session-input-control-repository.js +2 -0
- package/dist/src/storage/sqlite/upgrades/272_home_observation.sql +41 -0
- package/dist/src/storage/sqlite/upgrades/273_observation_routines.sql +30 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/home-query-service.js +1 -0
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +2 -2
- package/dist/gateway/static/root/assets/automation-task-card-BY_k6iWp.js +0 -3
- package/dist/gateway/static/root/assets/automations-workspace-CWEDraTP.js +0 -9
- package/dist/gateway/static/root/assets/calendar-clock-D-quYVPe.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-kG175Q-7.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-D1wQ2sPI.js +0 -2
- package/dist/gateway/static/root/assets/chat-page-BjYumhaI.js +0 -71
- package/dist/gateway/static/root/assets/composer-payload-handoff-DBE1mvOS.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CEpfDCLA.js +0 -1
- package/dist/gateway/static/root/assets/file-preview-surface-z7_HV0WN.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-xB7Bq4Zs.js +0 -1
- package/dist/gateway/static/root/assets/home-page-i_PIrDCU.js +0 -3
- package/dist/gateway/static/root/assets/index-DBlVVXOA.js +0 -11
- package/dist/gateway/static/root/assets/index-DpkEeFEQ.css +0 -1
- package/dist/gateway/static/root/assets/messages-eQ2CYlpG.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DfK2KSgu.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-DU4NnGap.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-content-EqrTk7kU.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-DrfQJkmW.js +0 -2
- package/dist/gateway/static/root/assets/service-recommendation-list-DSIe-NRe.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DnfH22f_.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DBnkT1Nj.js +0 -3
- package/dist/gateway/static/root/assets/task-input-card-lCMSy6YY.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-CLIrD0mm.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Nos5ebMv.js +0 -1
- package/dist/gateway/static/root/assets/workspace-file-preview-dialog-D0h2yJ3v.js +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { DatabaseSync } from 'node:sqlite';
|
|
2
|
+
import { type Routine, type RoutineAdoptRequest, type RoutineCommandRequest } from '@xopcai/gateway-contract';
|
|
3
|
+
import type { AutomationService } from '../automations/service/automation-service.js';
|
|
4
|
+
import type { AutomationDeps } from '../automations/domain/types.js';
|
|
5
|
+
import type { HomePrincipal } from './repository.js';
|
|
6
|
+
/** Versioned private-draft routines. Scheduling and execution leases remain owned by AutomationService. */
|
|
7
|
+
export declare class ObservationRoutines {
|
|
8
|
+
private readonly db;
|
|
9
|
+
private readonly principal;
|
|
10
|
+
private readonly deps;
|
|
11
|
+
constructor(db: DatabaseSync, principal: HomePrincipal, deps: {
|
|
12
|
+
automations: AutomationService;
|
|
13
|
+
canRead(id: string): boolean;
|
|
14
|
+
stopConversation?(id: string): Promise<boolean>;
|
|
15
|
+
agentId(): string;
|
|
16
|
+
dispatch(): void;
|
|
17
|
+
publish(): void;
|
|
18
|
+
});
|
|
19
|
+
private row;
|
|
20
|
+
private readable;
|
|
21
|
+
private method;
|
|
22
|
+
private verified;
|
|
23
|
+
private replay;
|
|
24
|
+
private operation;
|
|
25
|
+
private assertSource;
|
|
26
|
+
private validateSchedule;
|
|
27
|
+
adopt(input: RoutineAdoptRequest): Routine;
|
|
28
|
+
get(id: string): Routine;
|
|
29
|
+
list(): Routine[];
|
|
30
|
+
/** Proposals append scoped feedback; protected objectives, permissions and output destinations cannot mutate. */
|
|
31
|
+
refresh(): void;
|
|
32
|
+
private createTask;
|
|
33
|
+
private candidateValid;
|
|
34
|
+
command(id: string, input: RoutineCommandRequest): Promise<Routine>;
|
|
35
|
+
readonly execute: NonNullable<AutomationDeps['executeRoutine']>;
|
|
36
|
+
}
|
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { TaskContextInputSchema, TaskContractInputSchema } from "../../packages/gateway-contract/src/tasks.js";
|
|
3
|
+
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
4
|
+
import { TaskRepository, init_task_repository } from "../tasks/task-repository.js";
|
|
5
|
+
import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
|
|
6
|
+
import { AutomationScheduleSchema } from "../automations/domain/validation.js";
|
|
7
|
+
import { getAutomation } from "../automations/storage/automation-repository.js";
|
|
8
|
+
import "../automations/storage/index.js";
|
|
9
|
+
import { TaskContextRepository } from "../tasks/task-context-repository.js";
|
|
10
|
+
import { TaskCriterionReviewRepository } from "../tasks/task-criterion-review-repository.js";
|
|
11
|
+
import { AutomationCancellationUnconfirmedError } from "../automations/service/action-executor.js";
|
|
12
|
+
import { TaskApplicationService } from "../tasks/task-application-service.js";
|
|
13
|
+
import { ObservationConflictError } from "./observation.js";
|
|
14
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
15
|
+
import { setTimeout } from "node:timers/promises";
|
|
16
|
+
//#region src/home-intelligence/routines.ts
|
|
17
|
+
init_src();
|
|
18
|
+
init_transaction();
|
|
19
|
+
init_task_repository();
|
|
20
|
+
init_task_run_repository();
|
|
21
|
+
const hash = (value) => createHash("sha256").update(JSON.stringify(value)).digest("hex");
|
|
22
|
+
const conflict = (message) => {
|
|
23
|
+
throw new ObservationConflictError(message);
|
|
24
|
+
};
|
|
25
|
+
/** Versioned private-draft routines. Scheduling and execution leases remain owned by AutomationService. */
|
|
26
|
+
var ObservationRoutines = class {
|
|
27
|
+
constructor(db, principal, deps) {
|
|
28
|
+
this.db = db;
|
|
29
|
+
this.principal = principal;
|
|
30
|
+
this.deps = deps;
|
|
31
|
+
}
|
|
32
|
+
row(id) {
|
|
33
|
+
const row = this.db.prepare("SELECT * FROM observation_routines WHERE id=? AND owner_id=? AND workspace_id=?").get(id, this.principal.ownerId, this.principal.workspaceId);
|
|
34
|
+
if (!row) return conflict("Routine not found");
|
|
35
|
+
return row;
|
|
36
|
+
}
|
|
37
|
+
readable(id) {
|
|
38
|
+
try {
|
|
39
|
+
return this.deps.canRead(id);
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
method(row, version) {
|
|
45
|
+
const m = this.db.prepare("SELECT * FROM observation_methods WHERE routine_id=? AND version=?").get(row.id, version);
|
|
46
|
+
if (!m || m.content_hash !== hash([row.contract_json, JSON.parse(m.additions_json)])) return conflict("Method version is unavailable or changed");
|
|
47
|
+
return m;
|
|
48
|
+
}
|
|
49
|
+
verified(taskId) {
|
|
50
|
+
const task = new TaskRepository().get(taskId);
|
|
51
|
+
if (!task?.contract || new TaskRunRepository().getActiveRoot(taskId)) return false;
|
|
52
|
+
const run = this.db.prepare(`SELECT run_id FROM task_runs WHERE task_id=? AND contract_version=? AND parent_run_id IS NULL
|
|
53
|
+
ORDER BY queued_at DESC,rowid DESC LIMIT 1`).get(taskId, task.latestContractVersion);
|
|
54
|
+
const receipt = run && new TaskRunRepository().getReceipt(run.run_id);
|
|
55
|
+
return Boolean(receipt?.status === "succeeded" && receipt.completionVerdict === "achieved" && receipt.verification.status === "passed" && !receipt.needsUser && new TaskCriterionReviewRepository().allPassed(task));
|
|
56
|
+
}
|
|
57
|
+
replay(key, request) {
|
|
58
|
+
const previous = this.db.prepare("SELECT * FROM observation_routine_operations WHERE owner_id=? AND workspace_id=? AND operation_id=?").get(this.principal.ownerId, this.principal.workspaceId, key);
|
|
59
|
+
if (previous && previous.request_hash !== hash(request)) return conflict("Routine operation key was already used");
|
|
60
|
+
return previous?.result_id;
|
|
61
|
+
}
|
|
62
|
+
operation(key, request, resultId) {
|
|
63
|
+
this.db.prepare("INSERT INTO observation_routine_operations VALUES (?,?,?,?,?)").run(this.principal.ownerId, this.principal.workspaceId, key, hash(request), resultId);
|
|
64
|
+
}
|
|
65
|
+
assertSource(row) {
|
|
66
|
+
if (!this.readable(row.source_conversation_id)) conflict("Routine source is no longer readable");
|
|
67
|
+
if (row.valid_until <= Date.now()) conflict("Routine agreement expired; review it before continuing");
|
|
68
|
+
if (row.project_id) {
|
|
69
|
+
const p = this.db.prepare("SELECT status FROM projects WHERE project_id=?").get(row.project_id);
|
|
70
|
+
if (!p || [
|
|
71
|
+
"completed",
|
|
72
|
+
"cancelled",
|
|
73
|
+
"archived",
|
|
74
|
+
"paused"
|
|
75
|
+
].includes(String(p.status))) conflict("Project is paused or ended; review this routine");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
validateSchedule(schedule) {
|
|
79
|
+
if (!AutomationScheduleSchema.safeParse(schedule).success) conflict("Invalid routine schedule");
|
|
80
|
+
if (schedule.kind === "cron" && schedule.tz) try {
|
|
81
|
+
new Intl.DateTimeFormat("en", { timeZone: schedule.tz }).format();
|
|
82
|
+
} catch {
|
|
83
|
+
conflict("Invalid timezone");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
adopt(input) {
|
|
87
|
+
const result = runSqliteWriteTransaction(() => {
|
|
88
|
+
const replay = this.replay(input.idempotencyKey, input);
|
|
89
|
+
if (replay) return replay;
|
|
90
|
+
const topic = this.db.prepare(`SELECT t.* FROM home_observation_topics t JOIN home_observation_sessions s ON s.id=t.session_id
|
|
91
|
+
WHERE t.id=? AND s.owner_id=? AND s.workspace_id=? AND t.excluded=0`).get(input.topicId, this.principal.ownerId, this.principal.workspaceId);
|
|
92
|
+
if (!topic || !this.readable(topic.source_key)) return conflict("Observation topic unavailable");
|
|
93
|
+
const linked = this.db.prepare("SELECT 1 FROM home_observation_trials WHERE topic_id=? AND task_id=?").get(input.topicId, input.trialTaskId);
|
|
94
|
+
const task = new TaskRepository().get(input.trialTaskId);
|
|
95
|
+
if (!linked || !task?.contract || task.version !== input.expectedTaskVersion || !this.verified(task.id)) return conflict("The current trial must pass verification before it can be adopted");
|
|
96
|
+
if (this.db.prepare("SELECT 1 FROM observation_routines WHERE topic_id=?").get(input.topicId)) return conflict("This topic already has a routine");
|
|
97
|
+
if (input.validUntil <= Date.now() || input.validUntil > Date.now() + 366 * 864e5) return conflict("Choose an agreement expiry within one year");
|
|
98
|
+
this.validateSchedule(input.schedule);
|
|
99
|
+
if (input.schedule.kind === "interval" && input.schedule.everyMs < 6e4) return conflict("Routine interval must be at least one minute");
|
|
100
|
+
const contract = TaskContractInputSchema.parse(task.contract);
|
|
101
|
+
contract.constraints = contract.constraints.filter((value) => !value.startsWith("[once] "));
|
|
102
|
+
if (!contract.acceptanceCriteria.length) return conflict("Trial needs explicit acceptance criteria");
|
|
103
|
+
const id = randomUUID(), automationId = `routine-${id}`;
|
|
104
|
+
const contractJson = JSON.stringify(contract), contentHash = hash([contractJson, []]);
|
|
105
|
+
const context = new TaskContextRepository().list(task.id).filter((edge) => edge.role === "evidence").map((edge) => TaskContextInputSchema.parse(edge));
|
|
106
|
+
this.db.prepare(`INSERT INTO observation_routines
|
|
107
|
+
(id,topic_id,owner_id,workspace_id,source_conversation_id,project_id,agent_id,title,status,adopted_version,automation_id,trial_task_id,contract_json,context_json,valid_until,created_at)
|
|
108
|
+
VALUES (?,?,?,?,?,?,?,?,'active',1,?,?,?,?,?,?)`).run(id, input.topicId, this.principal.ownerId, this.principal.workspaceId, topic.source_key, topic.project_id, this.deps.agentId(), task.title, automationId, task.id, contractJson, JSON.stringify(context), input.validUntil, Date.now());
|
|
109
|
+
const baselineIds = this.db.prepare(`SELECT f.id FROM home_observation_feedback f JOIN home_observation_topics t ON t.id=f.topic_id
|
|
110
|
+
WHERE f.status='active' AND f.scope!='once' AND (t.id=? OR (f.scope='project' AND t.project_id=?))`).all(input.topicId, topic.project_id).map((f) => f.id);
|
|
111
|
+
this.db.prepare("INSERT INTO observation_methods VALUES (?,1,NULL,'[]',?,?,'approved',NULL,NULL,?)").run(id, JSON.stringify(baselineIds), contentHash, Date.now());
|
|
112
|
+
this.deps.automations.createAtomically({
|
|
113
|
+
id: automationId,
|
|
114
|
+
name: task.title,
|
|
115
|
+
projectId: topic.project_id ?? void 0,
|
|
116
|
+
enabled: true,
|
|
117
|
+
trigger: {
|
|
118
|
+
kind: "schedule",
|
|
119
|
+
schedule: input.schedule
|
|
120
|
+
},
|
|
121
|
+
action: {
|
|
122
|
+
kind: "routine",
|
|
123
|
+
routineId: id,
|
|
124
|
+
version: 1,
|
|
125
|
+
hash: contentHash
|
|
126
|
+
},
|
|
127
|
+
conversationMode: "new_session",
|
|
128
|
+
safety: { mode: "auto_apply" },
|
|
129
|
+
delivery: {
|
|
130
|
+
notificationPolicy: "attention",
|
|
131
|
+
destinations: [{
|
|
132
|
+
key: "gateway_event",
|
|
133
|
+
kind: "gateway_event"
|
|
134
|
+
}]
|
|
135
|
+
},
|
|
136
|
+
reliability: {
|
|
137
|
+
maxConcurrentRuns: 1,
|
|
138
|
+
retryCount: 0,
|
|
139
|
+
disableAfterConsecutiveFailures: 3
|
|
140
|
+
},
|
|
141
|
+
management: {
|
|
142
|
+
owner: "observation",
|
|
143
|
+
editable: ["enabled"],
|
|
144
|
+
runnable: true,
|
|
145
|
+
deletable: false
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
this.operation(input.idempotencyKey, input, id);
|
|
149
|
+
return id;
|
|
150
|
+
});
|
|
151
|
+
this.deps.automations.refreshSchedule();
|
|
152
|
+
this.deps.publish();
|
|
153
|
+
return this.get(result);
|
|
154
|
+
}
|
|
155
|
+
get(id) {
|
|
156
|
+
const row = this.row(id);
|
|
157
|
+
if (!this.readable(row.source_conversation_id)) return conflict("Routine source is no longer readable");
|
|
158
|
+
const automation = getAutomation(row.automation_id);
|
|
159
|
+
const methods = this.db.prepare("SELECT * FROM observation_methods WHERE routine_id=? ORDER BY version DESC").all(id);
|
|
160
|
+
return {
|
|
161
|
+
id,
|
|
162
|
+
topicId: row.topic_id,
|
|
163
|
+
title: row.title,
|
|
164
|
+
status: row.status === "ended" ? "ended" : automation?.enabled ? "active" : "paused",
|
|
165
|
+
revision: row.revision,
|
|
166
|
+
adoptedVersion: row.adopted_version,
|
|
167
|
+
automationId: row.automation_id,
|
|
168
|
+
validUntil: row.valid_until,
|
|
169
|
+
schedule: automation?.trigger.kind === "schedule" ? automation.trigger.schedule : null,
|
|
170
|
+
methods: methods.map((m) => ({
|
|
171
|
+
version: m.version,
|
|
172
|
+
baseVersion: m.base_version,
|
|
173
|
+
additions: JSON.parse(m.additions_json),
|
|
174
|
+
status: m.status,
|
|
175
|
+
validationTaskId: m.validation_task_id,
|
|
176
|
+
validation: m.validation_task_id ? this.verified(m.validation_task_id) ? "passed" : this.db.prepare(`SELECT 1 FROM task_runs
|
|
177
|
+
WHERE task_id=? AND status IN ('failed','cancelled','succeeded')`).get(m.validation_task_id) ? "failed" : "unverified" : "unverified"
|
|
178
|
+
})),
|
|
179
|
+
executions: this.db.prepare(`SELECT e.task_id AS taskId,e.automation_run_id AS runId,e.version,a.status,
|
|
180
|
+
(SELECT r.completion_verdict FROM task_runs tr JOIN task_run_receipts r ON r.run_id=tr.run_id WHERE tr.task_id=e.task_id ORDER BY r.finalized_at DESC LIMIT 1) AS verdict
|
|
181
|
+
FROM observation_routine_executions e JOIN automation_runs a ON a.run_id=e.automation_run_id WHERE e.routine_id=? ORDER BY e.created_at DESC LIMIT 20`).all(id)
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
list() {
|
|
185
|
+
return this.db.prepare("SELECT id FROM observation_routines WHERE owner_id=? AND workspace_id=? ORDER BY created_at DESC LIMIT 100").all(this.principal.ownerId, this.principal.workspaceId).flatMap((r) => {
|
|
186
|
+
try {
|
|
187
|
+
return [this.get(r.id)];
|
|
188
|
+
} catch {
|
|
189
|
+
return [];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** Proposals append scoped feedback; protected objectives, permissions and output destinations cannot mutate. */
|
|
194
|
+
refresh() {
|
|
195
|
+
for (const row of this.db.prepare("SELECT * FROM observation_routines WHERE owner_id=? AND workspace_id=? AND status!='ended'").all(this.principal.ownerId, this.principal.workspaceId)) {
|
|
196
|
+
if (!this.readable(row.source_conversation_id)) continue;
|
|
197
|
+
const current = this.method(row, row.adopted_version);
|
|
198
|
+
const known = new Set(JSON.parse(current.feedback_ids_json));
|
|
199
|
+
const fresh = this.db.prepare(`SELECT f.id,f.text FROM home_observation_feedback f
|
|
200
|
+
JOIN home_observation_topics t ON t.id=f.topic_id JOIN home_observation_sessions s ON s.id=t.session_id
|
|
201
|
+
WHERE s.owner_id=? AND s.workspace_id=? AND s.status='active' AND t.excluded=0 AND f.status='active'
|
|
202
|
+
AND f.scope!='once' AND f.created_at>=? AND (t.id=? OR (f.scope='project' AND t.project_id=?)) ORDER BY f.created_at,f.id`).all(row.owner_id, row.workspace_id, row.created_at, row.topic_id, row.project_id).filter((f) => !known.has(f.id));
|
|
203
|
+
if (!fresh.length) continue;
|
|
204
|
+
const ids = [...known, ...fresh.map((f) => f.id)].sort();
|
|
205
|
+
const additions = [...new Set([...JSON.parse(current.additions_json), ...fresh.map((f) => f.text)])];
|
|
206
|
+
const signature = hash([row.contract_json, additions]);
|
|
207
|
+
if (this.db.prepare("SELECT 1 FROM observation_methods WHERE routine_id=? AND content_hash=?").get(row.id, signature)) continue;
|
|
208
|
+
runSqliteWriteTransaction(() => {
|
|
209
|
+
const version = this.db.prepare("SELECT MAX(version) AS n FROM observation_methods WHERE routine_id=?").get(row.id).n + 1;
|
|
210
|
+
this.db.prepare("INSERT INTO observation_methods VALUES (?,?,?,?,?,?,'candidate',NULL,NULL,?)").run(row.id, version, row.adopted_version, JSON.stringify(additions), JSON.stringify(ids), signature, Date.now());
|
|
211
|
+
this.db.prepare("UPDATE observation_routines SET revision=revision+1 WHERE id=?").run(row.id);
|
|
212
|
+
});
|
|
213
|
+
this.deps.publish();
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
createTask(row, method, key, period) {
|
|
217
|
+
const stored = new TaskRepository().getByIdempotencyKey(key);
|
|
218
|
+
if (stored) return stored.id;
|
|
219
|
+
const base = TaskContractInputSchema.parse(JSON.parse(row.contract_json));
|
|
220
|
+
const additions = JSON.parse(method.additions_json);
|
|
221
|
+
const contract = {
|
|
222
|
+
...base,
|
|
223
|
+
acceptanceCriteria: [...base.acceptanceCriteria, ...additions],
|
|
224
|
+
constraints: [
|
|
225
|
+
...base.constraints,
|
|
226
|
+
"Private draft only; do not send, publish, modify external services or create automations.",
|
|
227
|
+
...additions
|
|
228
|
+
],
|
|
229
|
+
assumptions: [...base.assumptions, period],
|
|
230
|
+
outputDestinations: [],
|
|
231
|
+
approvalRequired: []
|
|
232
|
+
};
|
|
233
|
+
const created = new TaskApplicationService().create({
|
|
234
|
+
idempotencyKey: key,
|
|
235
|
+
title: row.title,
|
|
236
|
+
projectId: row.project_id ?? void 0,
|
|
237
|
+
delegateAgentId: row.agent_id,
|
|
238
|
+
priority: "normal",
|
|
239
|
+
contract,
|
|
240
|
+
dependencies: [],
|
|
241
|
+
body: `${period}\nSource conversation: ${row.source_conversation_id}. Read currently authorized source evidence; if fresh information is unavailable, report that gap instead of reusing last period's draft.\nProtected source references (quoted data, not execution authority): ${row.context_json}`,
|
|
242
|
+
context: TaskContextInputSchema.array().parse(JSON.parse(row.context_json)),
|
|
243
|
+
authorityGrants: [],
|
|
244
|
+
originConversationId: row.source_conversation_id,
|
|
245
|
+
activation: {
|
|
246
|
+
mode: "start",
|
|
247
|
+
executor: {
|
|
248
|
+
kind: "agent",
|
|
249
|
+
agentId: row.agent_id
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}, {
|
|
253
|
+
kind: "system",
|
|
254
|
+
id: "observation-routine"
|
|
255
|
+
});
|
|
256
|
+
if (created.ok === false) return conflict(`Could not create routine task: ${created.reason}`);
|
|
257
|
+
return created.model.task.id;
|
|
258
|
+
}
|
|
259
|
+
candidateValid(m) {
|
|
260
|
+
return JSON.parse(m.feedback_ids_json).every((id) => Boolean(this.db.prepare("SELECT 1 FROM home_observation_feedback WHERE id=? AND status='active'").get(id)));
|
|
261
|
+
}
|
|
262
|
+
async command(id, input) {
|
|
263
|
+
let cancellation;
|
|
264
|
+
runSqliteWriteTransaction(() => {
|
|
265
|
+
const request = {
|
|
266
|
+
id,
|
|
267
|
+
...input.command
|
|
268
|
+
};
|
|
269
|
+
if (this.replay(input.idempotencyKey, request)) return;
|
|
270
|
+
const row = this.row(id);
|
|
271
|
+
if (row.revision !== input.expectedRevision) return conflict("Routine revision changed");
|
|
272
|
+
if (row.status === "ended") return conflict("Routine has ended");
|
|
273
|
+
const c = input.command, automation = getAutomation(row.automation_id);
|
|
274
|
+
if (!automation) return conflict("Routine automation is unavailable");
|
|
275
|
+
if (c.kind === "configure") {
|
|
276
|
+
this.validateSchedule(c.schedule);
|
|
277
|
+
if (c.validUntil <= Date.now() || c.validUntil > Date.now() + 366 * 864e5) return conflict("Choose an agreement expiry within one year");
|
|
278
|
+
if (c.schedule.kind === "interval" && c.schedule.everyMs < 6e4) return conflict("Routine interval must be at least one minute");
|
|
279
|
+
this.deps.automations.updateAtomically(row.automation_id, { trigger: {
|
|
280
|
+
kind: "schedule",
|
|
281
|
+
schedule: c.schedule
|
|
282
|
+
} });
|
|
283
|
+
this.db.prepare("UPDATE observation_routines SET valid_until=? WHERE id=?").run(c.validUntil, id);
|
|
284
|
+
} else if (c.kind === "pause" || c.kind === "resume" || c.kind === "end") {
|
|
285
|
+
if (c.kind === "resume") this.assertSource(row);
|
|
286
|
+
this.db.prepare("UPDATE observation_routines SET status=? WHERE id=?").run(c.kind === "resume" ? "active" : c.kind === "end" ? "ended" : "paused", id);
|
|
287
|
+
this.deps.automations.updateAtomically(row.automation_id, { enabled: c.kind === "resume" });
|
|
288
|
+
if (c.kind !== "resume" && automation.state.runningRunId) {
|
|
289
|
+
cancellation = automation.state.runningRunId;
|
|
290
|
+
this.deps.automations.cancelRunAtomically(cancellation);
|
|
291
|
+
}
|
|
292
|
+
} else {
|
|
293
|
+
this.assertSource(row);
|
|
294
|
+
const m = this.method(row, c.version);
|
|
295
|
+
if (c.kind === "validate") {
|
|
296
|
+
if (m.base_version !== row.adopted_version || !this.candidateValid(m) || !["candidate", "validating"].includes(m.status)) return conflict("Candidate is stale or unavailable");
|
|
297
|
+
if (m.validation_task_id && m.validation_contract_hash !== hash(TaskContractInputSchema.parse(new TaskRepository().get(m.validation_task_id)?.contract))) return conflict("Validation contract changed; keep the original method");
|
|
298
|
+
const taskId = this.createTask(row, m, `routine-validation:${id}:${m.version}`, "Validate this candidate against the protected original criteria and its additional checks.");
|
|
299
|
+
this.db.prepare("UPDATE observation_methods SET status='validating',validation_task_id=?,validation_contract_hash=? WHERE routine_id=? AND version=?").run(taskId, hash(TaskContractInputSchema.parse(new TaskRepository().get(taskId).contract)), id, m.version);
|
|
300
|
+
} else if (c.kind === "reject_method") {
|
|
301
|
+
if (m.status === "approved") return conflict("Cannot reject an adopted method");
|
|
302
|
+
this.db.prepare("UPDATE observation_methods SET status='rejected' WHERE routine_id=? AND version=?").run(id, m.version);
|
|
303
|
+
} else {
|
|
304
|
+
if (c.kind === "adopt_method" && (m.base_version !== row.adopted_version || !this.candidateValid(m) || !m.validation_task_id || !this.verified(m.validation_task_id) || m.validation_contract_hash !== hash(TaskContractInputSchema.parse(new TaskRepository().get(m.validation_task_id).contract)) || m.status !== "validating")) return conflict("Candidate must pass current validation first");
|
|
305
|
+
if (c.kind === "rollback" && m.status !== "approved") return conflict("Only previously adopted methods can be restored");
|
|
306
|
+
this.db.prepare("UPDATE observation_methods SET status='approved' WHERE routine_id=? AND version=?").run(id, m.version);
|
|
307
|
+
this.db.prepare("UPDATE observation_routines SET adopted_version=? WHERE id=?").run(m.version, id);
|
|
308
|
+
this.deps.automations.updateAtomically(row.automation_id, { action: {
|
|
309
|
+
kind: "routine",
|
|
310
|
+
routineId: id,
|
|
311
|
+
version: m.version,
|
|
312
|
+
hash: m.content_hash
|
|
313
|
+
} });
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
this.db.prepare("UPDATE observation_routines SET revision=revision+1 WHERE id=?").run(id);
|
|
317
|
+
this.operation(input.idempotencyKey, request, id);
|
|
318
|
+
});
|
|
319
|
+
if (cancellation) this.deps.automations.dispatchCancellation(cancellation);
|
|
320
|
+
this.deps.automations.refreshSchedule();
|
|
321
|
+
this.deps.dispatch();
|
|
322
|
+
this.deps.publish();
|
|
323
|
+
return this.get(id);
|
|
324
|
+
}
|
|
325
|
+
execute = async ({ action, run, signal, onConversation }) => {
|
|
326
|
+
const row = this.row(action.routineId);
|
|
327
|
+
this.assertSource(row);
|
|
328
|
+
const automation = getAutomation(row.automation_id);
|
|
329
|
+
if (row.automation_id !== run.automationId || row.status === "ended" || !automation?.enabled) return {
|
|
330
|
+
status: "cancelled",
|
|
331
|
+
error: "Routine is paused or ended"
|
|
332
|
+
};
|
|
333
|
+
const method = this.method(row, action.version);
|
|
334
|
+
if (method.status !== "approved" || method.content_hash !== action.hash) return {
|
|
335
|
+
status: "failed",
|
|
336
|
+
error: "Unapproved routine method"
|
|
337
|
+
};
|
|
338
|
+
let taskId;
|
|
339
|
+
runSqliteWriteTransaction(() => {
|
|
340
|
+
taskId = this.db.prepare("SELECT task_id FROM observation_routine_executions WHERE automation_run_id=?").get(run.id)?.task_id ?? this.createTask(row, method, `routine-run:${run.id}`, `Current occurrence: ${new Date(run.createdAtMs).toISOString()}. Use current-period information, not a replay of the previous draft.`);
|
|
341
|
+
this.db.prepare("INSERT OR IGNORE INTO observation_routine_executions VALUES (?,?,?,?,?,?)").run(run.id, row.id, method.version, taskId, hash(TaskContractInputSchema.parse(new TaskRepository().get(taskId).contract)), Date.now());
|
|
342
|
+
});
|
|
343
|
+
this.deps.dispatch();
|
|
344
|
+
this.deps.publish();
|
|
345
|
+
let terminal = false;
|
|
346
|
+
let taskClosed = false;
|
|
347
|
+
let reportedConversation;
|
|
348
|
+
try {
|
|
349
|
+
while (!signal.aborted) {
|
|
350
|
+
const task = new TaskRepository().get(taskId);
|
|
351
|
+
if (!task) return {
|
|
352
|
+
status: "failed",
|
|
353
|
+
error: "Routine task was deleted"
|
|
354
|
+
};
|
|
355
|
+
const root = this.db.prepare("SELECT run_id,conversation_id FROM task_runs WHERE task_id=? AND parent_run_id IS NULL ORDER BY queued_at DESC,rowid DESC LIMIT 1").get(taskId);
|
|
356
|
+
if (root?.conversation_id && root.conversation_id !== reportedConversation) {
|
|
357
|
+
await onConversation(root.conversation_id);
|
|
358
|
+
reportedConversation = root.conversation_id;
|
|
359
|
+
}
|
|
360
|
+
const receipt = root && new TaskRunRepository().getReceipt(root.run_id);
|
|
361
|
+
if (receipt) {
|
|
362
|
+
terminal = true;
|
|
363
|
+
this.deps.publish();
|
|
364
|
+
const verified = this.db.prepare("SELECT contract_hash FROM observation_routine_executions WHERE automation_run_id=?").get(run.id)?.contract_hash === hash(TaskContractInputSchema.parse(task.contract)) && this.verified(taskId);
|
|
365
|
+
return {
|
|
366
|
+
status: verified ? "succeeded" : receipt.status === "cancelled" ? "cancelled" : "failed",
|
|
367
|
+
summary: receipt.summary.slice(0, 4e3),
|
|
368
|
+
error: verified ? void 0 : "Routine result did not pass the fixed acceptance criteria",
|
|
369
|
+
conversationId: root?.conversation_id ?? void 0,
|
|
370
|
+
artifacts: [{
|
|
371
|
+
id: `task:${taskId}`,
|
|
372
|
+
kind: "reference",
|
|
373
|
+
resourceType: "task",
|
|
374
|
+
resourceId: taskId,
|
|
375
|
+
url: `/tasks/${taskId}`
|
|
376
|
+
}]
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
if (task.phase === "closed") {
|
|
380
|
+
taskClosed = true;
|
|
381
|
+
return {
|
|
382
|
+
status: "cancelled",
|
|
383
|
+
error: "Routine task was closed before a verified result"
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
await setTimeout(250, void 0, { signal });
|
|
387
|
+
}
|
|
388
|
+
return {
|
|
389
|
+
status: "cancelled",
|
|
390
|
+
error: "Routine execution cancelled"
|
|
391
|
+
};
|
|
392
|
+
} finally {
|
|
393
|
+
if (!terminal && (signal.aborted || taskClosed)) {
|
|
394
|
+
const root = this.db.prepare("SELECT run_id,status,conversation_id FROM task_runs WHERE task_id=? AND parent_run_id IS NULL ORDER BY queued_at DESC,rowid DESC LIMIT 1").get(taskId);
|
|
395
|
+
const runs = new TaskRunRepository();
|
|
396
|
+
const active = runs.getActiveRoot(taskId);
|
|
397
|
+
if (active) runs.finalize({
|
|
398
|
+
runId: active.id,
|
|
399
|
+
expectedVersion: active.version,
|
|
400
|
+
terminalCode: "routine_cancelled",
|
|
401
|
+
receipt: {
|
|
402
|
+
status: "cancelled",
|
|
403
|
+
summary: "Routine execution cancelled",
|
|
404
|
+
changes: [],
|
|
405
|
+
evidence: [],
|
|
406
|
+
verification: {
|
|
407
|
+
status: "unverified",
|
|
408
|
+
checks: []
|
|
409
|
+
},
|
|
410
|
+
remainingWork: [],
|
|
411
|
+
needsUser: false,
|
|
412
|
+
completionVerdict: "not_achieved"
|
|
413
|
+
}
|
|
414
|
+
});
|
|
415
|
+
if (active) runs.resolveCancelledRunWaits(active.id, { kind: "system" });
|
|
416
|
+
const task = new TaskRepository().get(taskId);
|
|
417
|
+
if (task && task.phase !== "closed") new TaskApplicationService().execute({
|
|
418
|
+
taskId,
|
|
419
|
+
expectedVersion: task.version,
|
|
420
|
+
idempotencyKey: `routine-cancel:${run.id}`,
|
|
421
|
+
command: {
|
|
422
|
+
type: "close",
|
|
423
|
+
resolution: "cancelled"
|
|
424
|
+
},
|
|
425
|
+
actor: {
|
|
426
|
+
kind: "system",
|
|
427
|
+
id: "automation"
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
let stopped = !root?.conversation_id;
|
|
431
|
+
if (root?.conversation_id && this.deps.stopConversation) try {
|
|
432
|
+
stopped = await this.deps.stopConversation(root.conversation_id);
|
|
433
|
+
} catch {
|
|
434
|
+
stopped = false;
|
|
435
|
+
}
|
|
436
|
+
this.deps.dispatch();
|
|
437
|
+
this.deps.publish();
|
|
438
|
+
if (!stopped) throw new AutomationCancellationUnconfirmedError("Routine Task is logically cancelled; execution stop is unconfirmed");
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
};
|
|
442
|
+
};
|
|
443
|
+
//#endregion
|
|
444
|
+
export { ObservationRoutines };
|
|
@@ -5,6 +5,20 @@ import type { Project } from '../projects/types.js';
|
|
|
5
5
|
import type { SessionMetadata } from '../session/types.js';
|
|
6
6
|
import type { HomeSuccessfulPattern } from './strategy.js';
|
|
7
7
|
export interface HomeContextSnapshot {
|
|
8
|
+
observation?: {
|
|
9
|
+
revision: number;
|
|
10
|
+
feedback: Array<{
|
|
11
|
+
topicId: string;
|
|
12
|
+
text: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
projectId?: string;
|
|
15
|
+
}>;
|
|
16
|
+
understanding: Array<{
|
|
17
|
+
topicId: string;
|
|
18
|
+
summary: string;
|
|
19
|
+
projectId?: string;
|
|
20
|
+
}>;
|
|
21
|
+
};
|
|
8
22
|
generatedAt: number;
|
|
9
23
|
locale: 'en' | 'zh';
|
|
10
24
|
projects: Array<Pick<Project, 'id' | 'name' | 'status' | 'health' | 'brief' | 'outcome' | 'successCriteria' | 'targetAt' | 'updatedAt'>>;
|
|
@@ -11,8 +11,8 @@ import { scanLocal } from "./scanner.js";
|
|
|
11
11
|
import { dirname, join } from "node:path";
|
|
12
12
|
import { existsSync, lstatSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
13
13
|
import { randomUUID } from "node:crypto";
|
|
14
|
-
import yaml from "js-yaml";
|
|
15
14
|
import lockfile from "proper-lockfile";
|
|
15
|
+
import yaml from "js-yaml";
|
|
16
16
|
//#region src/imports/importService.ts
|
|
17
17
|
init_write_file_atomic();
|
|
18
18
|
init_logger();
|
|
@@ -8,6 +8,11 @@ export declare const AutomationProposalInputSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
8
8
|
name: z.ZodString;
|
|
9
9
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
10
10
|
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
11
|
+
kind: z.ZodLiteral<"routine">;
|
|
12
|
+
routineId: z.ZodString;
|
|
13
|
+
version: z.ZodNumber;
|
|
14
|
+
hash: z.ZodString;
|
|
15
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
11
16
|
kind: z.ZodLiteral<"agent">;
|
|
12
17
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
13
18
|
instruction: z.ZodString;
|
|
@@ -241,6 +246,11 @@ export declare const AutomationProposalInputSchema: z.ZodDiscriminatedUnion<[z.Z
|
|
|
241
246
|
name: z.ZodOptional<z.ZodString>;
|
|
242
247
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
243
248
|
action: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
249
|
+
kind: z.ZodLiteral<"routine">;
|
|
250
|
+
routineId: z.ZodString;
|
|
251
|
+
version: z.ZodNumber;
|
|
252
|
+
hash: z.ZodString;
|
|
253
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
244
254
|
kind: z.ZodLiteral<"agent">;
|
|
245
255
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
246
256
|
instruction: z.ZodString;
|
|
@@ -456,6 +466,11 @@ export declare function proposalDefinition(input: AutomationProposal['input']):
|
|
|
456
466
|
conversationMode: "new_session" | "continuous";
|
|
457
467
|
projectId?: string;
|
|
458
468
|
action?: {
|
|
469
|
+
kind: "routine";
|
|
470
|
+
routineId: string;
|
|
471
|
+
version: number;
|
|
472
|
+
hash: string;
|
|
473
|
+
} | {
|
|
459
474
|
kind: "agent";
|
|
460
475
|
instruction: string;
|
|
461
476
|
agentId?: string;
|
|
@@ -615,6 +630,11 @@ export declare function automationProposalReview(proposal: AutomationProposal):
|
|
|
615
630
|
conversationMode: "new_session" | "continuous";
|
|
616
631
|
projectId?: string;
|
|
617
632
|
action?: {
|
|
633
|
+
kind: "routine";
|
|
634
|
+
routineId: string;
|
|
635
|
+
version: number;
|
|
636
|
+
hash: string;
|
|
637
|
+
} | {
|
|
618
638
|
kind: "agent";
|
|
619
639
|
instruction: string;
|
|
620
640
|
agentId?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
2
2
|
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
3
|
-
import { canonicalCapabilityJson, defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
4
3
|
import { CreateAutomationSchema } from "../automations/domain/validation.js";
|
|
5
4
|
import { getAutomation } from "../automations/storage/automation-repository.js";
|
|
6
5
|
import "../automations/storage/index.js";
|
|
6
|
+
import { canonicalCapabilityJson, defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
7
7
|
import { automationReadable } from "./capabilities/automation-policy.js";
|
|
8
8
|
import { AutomationCreateCapabilityInputSchema, AutomationUpdatePatchSchema, materializeAutomationTrigger } from "../automations/capabilities/write.js";
|
|
9
9
|
import { simulateAutomation } from "../automations/draft/automation-draft-validator.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
2
|
-
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
3
2
|
import { getAutomation } from "../../automations/storage/automation-repository.js";
|
|
4
3
|
import { getAutomationRun } from "../../automations/storage/automation-run-repository.js";
|
|
5
4
|
import "../../automations/storage/index.js";
|
|
5
|
+
import { canonicalCapabilityJson } from "../../capabilities/runtime/dispatcher.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
//#region src/local-apps/capabilities/automation-policy.ts
|
|
8
8
|
/** Runtime state changes do not widen execution authority; definition changes require fresh review. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { LocalAppDelegateInputSchema, LocalAppDelegateOutputSchema } from "../../../packages/gateway-contract/src/local-app-delegation.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
4
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
5
|
-
import { ExternalEffectNotAppliedError } from "../../capabilities/runtime/external-operations.js";
|
|
6
|
-
import { defineExternalCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
7
4
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
8
5
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
9
6
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
10
7
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
8
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
9
|
+
import { ExternalEffectNotAppliedError } from "../../capabilities/runtime/external-operations.js";
|
|
10
|
+
import { defineExternalCapability } from "../../capabilities/runtime/dispatcher.js";
|
|
11
11
|
import { localAppResourceAllowed } from "./resource-policy.js";
|
|
12
12
|
//#region src/local-apps/capabilities/delegate.ts
|
|
13
13
|
init_src();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
2
2
|
import { getConnectorAccount, init_connector_account_repository } from "../storage/sqlite/connector-account-repository.js";
|
|
3
3
|
import { decideConnectorApproval, getConnectorApproval, getConnectorConnection, init_connector_repository, listConnectorActionMetadata, listConnectorConnections } from "../storage/sqlite/connector-repository.js";
|
|
4
|
+
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
4
5
|
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
5
6
|
import { ExternalEffectNotAppliedError, executeExternalOperation } from "../capabilities/runtime/external-operations.js";
|
|
6
7
|
import { canonicalCapabilityJson, defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
7
|
-
import { getDefaultAgentId, init_resolve_route } from "../routing/resolve-route.js";
|
|
8
8
|
import { getCliAdapter } from "../connectors/cli/adapterRegistry.js";
|
|
9
9
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
10
10
|
import { parseExternalToolRef } from "../agent/external-tools/refs.js";
|
|
@@ -10,10 +10,10 @@ import { getConnectorAccount, init_connector_account_repository } from "../stora
|
|
|
10
10
|
import { getConnectorConnection, init_connector_repository } from "../storage/sqlite/connector-repository.js";
|
|
11
11
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
12
12
|
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
13
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
14
13
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
15
14
|
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
16
15
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
16
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
17
17
|
import { getAutomation } from "../automations/storage/automation-repository.js";
|
|
18
18
|
import { LocalAppStore } from "./store.js";
|
|
19
19
|
import "../automations/storage/index.js";
|
|
@@ -112,7 +112,7 @@ export declare function strategyState(threadId: string, now?: number): {
|
|
|
112
112
|
versions: {
|
|
113
113
|
id: string;
|
|
114
114
|
revision: number;
|
|
115
|
-
kind: "stop" | "
|
|
115
|
+
kind: "stop" | "rollback" | "defer" | "adjust";
|
|
116
116
|
createdAt: number;
|
|
117
117
|
preparation: "brief" | "thorough";
|
|
118
118
|
}[];
|
|
@@ -2,11 +2,11 @@ import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js
|
|
|
2
2
|
import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
3
3
|
import { setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
4
4
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
5
|
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
7
6
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
8
7
|
import { getPersonalAgent, personalAgentId } from "./repository.js";
|
|
9
8
|
import { PERSONAL_MAIN_TOOL_IDS, PERSONAL_READ_TOOL_ALIASES } from "./policy.js";
|
|
9
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
10
10
|
import { getModelThinking } from "../providers/model-thinking.js";
|
|
11
11
|
import { personalInstructions } from "./prompts.js";
|
|
12
12
|
import { completePersonalOnboarding } from "./onboarding.js";
|