@xopcai/xopc 0.0.455 → 0.0.457
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-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-BY_k6iWp.js → automation-task-card-BjqxvYqc.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-Dt_Z1UTT.js → automations-page-BSnPWyYd.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-DIaCdxtX.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-D1wQ2sPI.js → capabilities-page-dXDa0i5o.js} +2 -2
- 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-Bx_A__qB.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-CEpfDCLA.js → connectors-page-BwJHhyRb.js} +1 -1
- 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-DlTuGzZ2.js → desktop-pet-CBm3DySQ.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-cBFIPXzR.js → desktop-pet-narrative-JqMsz4rn.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-D1sTZYAY.js +3 -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-CHAVhyVb.js +11 -0
- package/dist/gateway/static/root/assets/index-CQABygtM.css +1 -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-anM38aV6.js → note-detail-panel-B1cq9sU2.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-BsZmT7Zw.js → notes-page-Do0l5Ddr.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-BSCNuRMT.js → personal-page-DrYh0NPE.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-EqrTk7kU.js → product-preview-content-CUaHxyiE.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-aurFBFq4.js → product-preview-modal-BUeyRD5W.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-ibZZ_w51.js → project-detail-page-D3k1NzXQ.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-CTuS4GFj.js +2 -0
- package/dist/gateway/static/root/assets/routine-panel-9UC3NU5V.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-DSIe-NRe.js → service-recommendation-list-8mVIWB38.js} +1 -1
- 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-DAc5n-mM.js → settings-page-CGiZCF8z.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-BJok6V1K.js → task-detail-page-CWwwumsy.js} +3 -3
- 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/tool-friendly-title-CP35P4VA.js +2 -0
- 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-CdEfR40A.js +1 -0
- 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-D2FHjLi7.js +2 -0
- 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-BNZK4hQ4.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-RN6iuY-0.js → work-discovery-page-KwSPhukU.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 +6 -1
- package/dist/src/agent/background-review/prompts.d.ts +1 -1
- package/dist/src/agent/background-review/prompts.js +8 -1
- package/dist/src/agent/background-review/run-background-review.js +47 -3
- package/dist/src/agent/client-error-format.js +1 -1
- package/dist/src/agent/context/audit.js +18 -0
- package/dist/src/agent/context/coordinator.d.ts +4 -0
- package/dist/src/agent/context/coordinator.js +33 -7
- package/dist/src/agent/context/deep-recall.d.ts +33 -0
- package/dist/src/agent/context/deep-recall.js +190 -0
- package/dist/src/agent/context/execution-context.js +29 -5
- package/dist/src/agent/context/execution-context.types.d.ts +2 -0
- package/dist/src/agent/context/memory-claim-grounding.d.ts +2 -0
- package/dist/src/agent/context/memory-claim-grounding.js +20 -0
- package/dist/src/agent/context/recall-grounding.d.ts +3 -0
- package/dist/src/agent/context/recall-grounding.js +31 -0
- 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 +111 -29
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/fallback/reason.js +1 -1
- package/dist/src/agent/memory/context-recovery.d.ts +1 -1
- package/dist/src/agent/memory/index.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/process-direct-streaming.js +1 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -2
- package/dist/src/agent/tools/factory.js +22 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +7 -1
- package/dist/src/agent/tools/personal-memory-tool.d.ts +11 -0
- package/dist/src/agent/tools/personal-memory-tool.js +387 -0
- package/dist/src/agent/tools/session-search-tool.d.ts +2 -0
- package/dist/src/agent/tools/session-search-tool.js +21 -7
- package/dist/src/agent/tools/user-context-tool.js +11 -1
- package/dist/src/automations/capabilities/write.d.ts +10 -0
- 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/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/schema.d.ts +6 -0
- package/dist/src/config/schema.js +6 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +6 -0
- package/dist/src/gateway/hono/routes/home.js +100 -2
- package/dist/src/gateway/hono/routes/user-model.js +47 -7
- package/dist/src/gateway/security/gateway-scopes.js +1 -0
- package/dist/src/gateway/service/config-coordinator.d.ts +6 -0
- package/dist/src/gateway/service.js +17 -0
- 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 +196 -12
- 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/knowledge-memory/index.js +2 -2
- package/dist/src/knowledge-memory/repository.d.ts +6 -0
- package/dist/src/knowledge-memory/repository.js +49 -1
- package/dist/src/knowledge-memory/usage-policy.js +7 -7
- package/dist/src/local-apps/automation-proposals.d.ts +20 -0
- package/dist/src/memory-learning/work-capture.js +3 -1
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +2 -1
- package/dist/src/personal-agent/proactivity/repository.d.ts +1 -1
- package/dist/src/personal-agent/prompts.js +7 -1
- package/dist/src/providers/model-response.js +1 -1
- package/dist/src/realtime/compact-run-event.js +9 -0
- package/dist/src/session/history-recall-policy.d.ts +6 -0
- package/dist/src/session/history-recall-policy.js +48 -0
- 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/home-query-service.js +1 -0
- package/dist/src/user-context/config.d.ts +12 -0
- package/dist/src/user-context/config.js +14 -1
- package/dist/src/user-context/memory-version.d.ts +2 -0
- package/dist/src/user-context/memory-version.js +12 -0
- package/dist/src/user-model/capture/evidence-policy.d.ts +45 -0
- package/dist/src/user-model/capture/evidence-policy.js +143 -0
- package/dist/src/user-model/capture/executor.d.ts +1 -0
- package/dist/src/user-model/capture/executor.js +68 -8
- package/dist/src/user-model/capture/semantic.d.ts +16 -0
- package/dist/src/user-model/capture/semantic.js +66 -12
- package/dist/src/user-model/repository.js +11 -0
- package/dist/src/user-model/usage-policy.js +5 -5
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BhHgruhH.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-kG175Q-7.js +0 -1
- package/dist/gateway/static/root/assets/chat-page-dY6aCCRx.js +0 -71
- package/dist/gateway/static/root/assets/composer-payload-handoff-DBE1mvOS.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-Bj5exyow.css +0 -1
- package/dist/gateway/static/root/assets/index-CZI3VGGW.js +0 -11
- 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/route-preload-anuckzRl.js +0 -2
- package/dist/gateway/static/root/assets/settings-advanced-gate-DnfH22f_.js +0 -1
- package/dist/gateway/static/root/assets/task-input-card-lCMSy6YY.js +0 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-DC8_9-Lo.js +0 -2
- package/dist/gateway/static/root/assets/understanding-refresh-store-Ihz2p9Vg.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-CLIrD0mm.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-1eYattnk.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
|
@@ -22,6 +22,7 @@ import { getEmbeddedExecutionRunId, getEmbeddedExecutionSession } from "../embed
|
|
|
22
22
|
import { createPhoneUseTool } from "./phone-use-tool.js";
|
|
23
23
|
import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
|
|
24
24
|
import { createPersonalAttentionTool } from "./personal-attention-tool.js";
|
|
25
|
+
import { createPersonalMemoryTool } from "./personal-memory-tool.js";
|
|
25
26
|
import { withCoreToolExposure } from "./toolExposure.js";
|
|
26
27
|
import { markCodemodeCoreRead } from "./codemode-permissions.js";
|
|
27
28
|
import "../../../packages/browser-control-contract/src/index.js";
|
|
@@ -74,6 +75,7 @@ import { createImageGenerateTool } from "./image-generate-tool.js";
|
|
|
74
75
|
import { createPersonalReadTool } from "./personal-read-tool.js";
|
|
75
76
|
import { createTaskCollaborationTool } from "./task-collaboration-tool.js";
|
|
76
77
|
import "./index.js";
|
|
78
|
+
import { canRecallConversation, canRecallHistoryEntry } from "../../session/history-recall-policy.js";
|
|
77
79
|
import { createPersonalResultTool } from "./personal-result-tool.js";
|
|
78
80
|
import { createPersonalTaskTool } from "./personal-task-tool.js";
|
|
79
81
|
import { withTaskEvidenceIdentity } from "./task-evidence.js";
|
|
@@ -566,6 +568,14 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
566
568
|
workspace,
|
|
567
569
|
getConfig: () => this.deps.getConfig?.()
|
|
568
570
|
})] : [],
|
|
571
|
+
...personalToolsConfigured ? [createPersonalMemoryTool({
|
|
572
|
+
getConversationId: currentConversationId,
|
|
573
|
+
getCurrentUserText: () => currentConversationId() ? getActiveTranscriptUserText(currentConversationId()) : void 0,
|
|
574
|
+
getConfig: () => this.deps.getConfig?.(),
|
|
575
|
+
agentId: resolvedAgentId,
|
|
576
|
+
workspaceId: workspace,
|
|
577
|
+
getProjectId: currentProjectId
|
|
578
|
+
})] : [],
|
|
569
579
|
...personalToolsConfigured || allowed?.has("user_context_read") ? [createUserContextReadTool({
|
|
570
580
|
getCurrentUserText: () => currentConversationId() ? getActiveTranscriptUserText(currentConversationId()) : void 0,
|
|
571
581
|
agentId: resolvedAgentId,
|
|
@@ -659,6 +669,18 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
659
669
|
})] : [],
|
|
660
670
|
...this.deps.getSessionStore && getPrimary ? [createSessionSearchTool({
|
|
661
671
|
localOnly: personalToolsConfigured,
|
|
672
|
+
canRecallConversation: (id) => canRecallConversation(this.deps.getConfig?.(), {
|
|
673
|
+
agentId: resolvedAgentId,
|
|
674
|
+
workspaceId: workspace,
|
|
675
|
+
conversationId: currentConversationId() ?? "",
|
|
676
|
+
projectId: currentProjectId()
|
|
677
|
+
}, id),
|
|
678
|
+
canRecallEntry: (id, entryId, text) => canRecallHistoryEntry({
|
|
679
|
+
agentId: resolvedAgentId,
|
|
680
|
+
workspaceId: workspace,
|
|
681
|
+
conversationId: currentConversationId() ?? "",
|
|
682
|
+
projectId: currentProjectId()
|
|
683
|
+
}, id, entryId, text),
|
|
662
684
|
getHistoryContext: () => ({
|
|
663
685
|
agentId: resolvedAgentId,
|
|
664
686
|
workspaceId: workspace,
|
|
@@ -4,6 +4,7 @@ import { getKnowledgeItem, searchKnowledgeItems, writeKnowledgeItem } from "../.
|
|
|
4
4
|
import "../../knowledge-memory/index.js";
|
|
5
5
|
import { projectForgottenEvidence } from "../../memory-learning/forgotten-history.js";
|
|
6
6
|
import "./local-read-budget.js";
|
|
7
|
+
import { memoryVersion } from "../../user-context/memory-version.js";
|
|
7
8
|
import { Type } from "@sinclair/typebox";
|
|
8
9
|
//#region src/agent/tools/knowledge-memory-tool.ts
|
|
9
10
|
const SearchSchema = Type.Object({
|
|
@@ -70,6 +71,7 @@ function createKnowledgeSearchTool(options) {
|
|
|
70
71
|
limit: input.maxResults ?? 12
|
|
71
72
|
}).map((item) => ({
|
|
72
73
|
...item,
|
|
74
|
+
version: memoryVersion(item),
|
|
73
75
|
source: projectForgottenEvidence(item.source, visibility(options), options.getCurrentUserText?.(), [item.sourceConversationId, item.sourceTurnId].filter((ref) => !!ref))
|
|
74
76
|
}));
|
|
75
77
|
return {
|
|
@@ -107,10 +109,14 @@ function createKnowledgeGetTool(options) {
|
|
|
107
109
|
return visible ? {
|
|
108
110
|
content: [{
|
|
109
111
|
type: "text",
|
|
110
|
-
text: JSON.stringify(
|
|
112
|
+
text: JSON.stringify({
|
|
113
|
+
...projected,
|
|
114
|
+
version: memoryVersion(item)
|
|
115
|
+
}, null, 2)
|
|
111
116
|
}],
|
|
112
117
|
details: {
|
|
113
118
|
item: projected,
|
|
119
|
+
version: memoryVersion(item),
|
|
114
120
|
complete: true
|
|
115
121
|
}
|
|
116
122
|
} : {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import type { Config } from '../../config/schema.js';
|
|
3
|
+
/** Explicit owner mutations use the existing domain transactions and atomic operation receipts. */
|
|
4
|
+
export declare function createPersonalMemoryTool(deps: {
|
|
5
|
+
getConversationId: () => string | undefined;
|
|
6
|
+
getCurrentUserText: () => string | undefined;
|
|
7
|
+
getConfig: () => Config | undefined;
|
|
8
|
+
agentId: string;
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
getProjectId: () => string | undefined;
|
|
11
|
+
}): AgentTool;
|
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../../storage/sqlite/transaction.js";
|
|
2
|
+
import { createCollaborationRule } from "../../storage/sqlite/collaboration-rule-repository.js";
|
|
3
|
+
import { createContextEvidence } from "../../storage/sqlite/context-evidence-repository.js";
|
|
4
|
+
import { init_session_instance_repository, readCurrentTranscriptId } from "../../storage/sqlite/session-instance-repository.js";
|
|
5
|
+
import { init_changes, notifyUserContextChange } from "../../user-context/changes.js";
|
|
6
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
7
|
+
import { learningRoleSql, learningTranscriptMessage } from "../../memory-learning/transcript-source.js";
|
|
8
|
+
import { inferMemorySensitivity } from "../memory/sensitivity.js";
|
|
9
|
+
import { canUseKnowledge, knowledgeContentSources } from "../../knowledge-memory/usage-policy.js";
|
|
10
|
+
import { deleteKnowledgeItem, getKnowledgeItem, reviewKnowledgeItem, setKnowledgeScope, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
11
|
+
import "../../knowledge-memory/index.js";
|
|
12
|
+
import { isUnquotedOwnerEvidence } from "../../memory-learning/owner-directive.js";
|
|
13
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../user-model/repository.js";
|
|
14
|
+
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
15
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
16
|
+
import { getSessionInteractionPolicy } from "../session/interaction-policy.js";
|
|
17
|
+
import { executeAtomicOperation } from "../../capabilities/runtime/atomic-operations.js";
|
|
18
|
+
import { memoryVersion } from "../../user-context/memory-version.js";
|
|
19
|
+
import "../../user-model/index.js";
|
|
20
|
+
import { extractAgentUserPlainText } from "../memory/user-message-text.js";
|
|
21
|
+
import { createHash } from "node:crypto";
|
|
22
|
+
import { Type } from "@sinclair/typebox";
|
|
23
|
+
import { Value } from "@sinclair/typebox/value";
|
|
24
|
+
//#region src/agent/tools/personal-memory-tool.ts
|
|
25
|
+
init_session_instance_repository();
|
|
26
|
+
init_transaction();
|
|
27
|
+
init_changes();
|
|
28
|
+
const schema = Type.Object({
|
|
29
|
+
command: Type.Union([
|
|
30
|
+
"remember",
|
|
31
|
+
"correct",
|
|
32
|
+
"forget",
|
|
33
|
+
"scope"
|
|
34
|
+
].map((value) => Type.Literal(value))),
|
|
35
|
+
target: Type.Union([Type.Literal("user"), Type.Literal("knowledge")]),
|
|
36
|
+
userEvidence: Type.String({
|
|
37
|
+
minLength: 1,
|
|
38
|
+
maxLength: 1e3
|
|
39
|
+
}),
|
|
40
|
+
content: Type.Optional(Type.String({
|
|
41
|
+
minLength: 1,
|
|
42
|
+
maxLength: 600
|
|
43
|
+
})),
|
|
44
|
+
id: Type.Optional(Type.String({
|
|
45
|
+
minLength: 1,
|
|
46
|
+
maxLength: 200
|
|
47
|
+
})),
|
|
48
|
+
version: Type.Optional(Type.String({
|
|
49
|
+
minLength: 1,
|
|
50
|
+
maxLength: 100
|
|
51
|
+
})),
|
|
52
|
+
scope: Type.Optional(Type.Union([
|
|
53
|
+
"global",
|
|
54
|
+
"agent",
|
|
55
|
+
"workspace",
|
|
56
|
+
"project",
|
|
57
|
+
"session"
|
|
58
|
+
].map((value) => Type.Literal(value)))),
|
|
59
|
+
predicate: Type.Optional(Type.String({ pattern: "^[a-z][a-z0-9_.-]{2,119}$" })),
|
|
60
|
+
userKind: Type.Optional(Type.Union([
|
|
61
|
+
"identity",
|
|
62
|
+
"preference",
|
|
63
|
+
"value",
|
|
64
|
+
"routine",
|
|
65
|
+
"capability",
|
|
66
|
+
"relationship",
|
|
67
|
+
"current_state"
|
|
68
|
+
].map((value) => Type.Literal(value)))),
|
|
69
|
+
knowledgeKind: Type.Optional(Type.Union([
|
|
70
|
+
"project_fact",
|
|
71
|
+
"workspace_fact",
|
|
72
|
+
"decision",
|
|
73
|
+
"task_lesson",
|
|
74
|
+
"commitment",
|
|
75
|
+
"open_question",
|
|
76
|
+
"episode",
|
|
77
|
+
"note"
|
|
78
|
+
].map((value) => Type.Literal(value)))),
|
|
79
|
+
validTo: Type.Optional(Type.Number({ minimum: 1 }))
|
|
80
|
+
}, { additionalProperties: false });
|
|
81
|
+
function visible(scope, context) {
|
|
82
|
+
return scope.type === "global" || scope.id === {
|
|
83
|
+
agent: context.agentId,
|
|
84
|
+
workspace: context.workspaceId,
|
|
85
|
+
project: context.projectId,
|
|
86
|
+
session: context.conversationId
|
|
87
|
+
}[scope.type];
|
|
88
|
+
}
|
|
89
|
+
function explicitRequest(text, quote, command) {
|
|
90
|
+
if (command === "forget") return isUnquotedOwnerEvidence(text, quote);
|
|
91
|
+
const author = text.replace(/```[\s\S]*?```|~~~[\s\S]*?~~~|^\s*>.*$/gmu, "").replace(/“[^”]*”|「[^」]*」|『[^』]*』|"[^"\n]*"/gu, (span) => /记住|保存|纠正|修改|remember|save|correct|scope/iu.test(span) ? "" : span);
|
|
92
|
+
if (!quote.trim() || !author.includes(quote.trim())) return false;
|
|
93
|
+
if (command === "remember") return !/不要.*(?:记住|保存)|别.*(?:记住|保存)|(?:don't|do not|never)\s+(?:remember|save|store)/iu.test(author) && /记住|保存|记下|记着|\b(?:remember|save|store)\b/iu.test(quote);
|
|
94
|
+
return /纠正|修正|改成|改为|修改|更正|不是|仅|只(?:在|用|对)|范围|所有|全局|\b(?:correct|change|update|instead|only|scope|global|all)\b/iu.test(quote) && !/(?:不要|别|不必)(?:再)?(?:修改|更正|纠正)|(?:don't|do not|never)\s+(?:change|correct|update)/iu.test(author);
|
|
95
|
+
}
|
|
96
|
+
/** Explicit owner mutations use the existing domain transactions and atomic operation receipts. */
|
|
97
|
+
function createPersonalMemoryTool(deps) {
|
|
98
|
+
return {
|
|
99
|
+
name: "personal_memory",
|
|
100
|
+
label: "Manage memory",
|
|
101
|
+
parameters: schema,
|
|
102
|
+
description: "Remember, correct, forget, or change the scope of memory only on an explicit current owner request. Quote that request in userEvidence. User identity/preferences use target=user; project facts/decisions/lessons use knowledge. For existing items first read their id and version with user_context_read or knowledge_read. Scope IDs come from the current conversation; never guess another agent/project. Report the committed receipt status and scope: saved is durable, pending is not yet usable, forgotten keeps original sources. Changes apply to future turns, not already running prompts. Memory never grants action authority.",
|
|
103
|
+
async execute(_callId, raw) {
|
|
104
|
+
const fail = (error) => ({
|
|
105
|
+
content: [{
|
|
106
|
+
type: "text",
|
|
107
|
+
text: JSON.stringify({
|
|
108
|
+
status: "failed",
|
|
109
|
+
error
|
|
110
|
+
})
|
|
111
|
+
}],
|
|
112
|
+
details: {
|
|
113
|
+
status: "failed",
|
|
114
|
+
error
|
|
115
|
+
},
|
|
116
|
+
isError: true
|
|
117
|
+
});
|
|
118
|
+
if (!Value.Check(schema, raw)) return fail("invalid_memory_arguments");
|
|
119
|
+
const input = raw;
|
|
120
|
+
try {
|
|
121
|
+
const conversationId = deps.getConversationId();
|
|
122
|
+
const config = deps.getConfig();
|
|
123
|
+
if (!conversationId || !config || !getPersonalAgentByConversation(conversationId)) return fail("personal_memory_unavailable");
|
|
124
|
+
const interaction = getSessionInteractionPolicy(conversationId);
|
|
125
|
+
if (interaction.mode === "plan" || interaction.access === "read-only") return fail("memory_write_denied");
|
|
126
|
+
const access = resolveUserContextSessionAccess(config, conversationId);
|
|
127
|
+
if (!(input.target === "user" ? access.userModel : access.knowledge)) return fail("memory_access_denied");
|
|
128
|
+
const writePolicy = input.target === "user" ? config.userContext.userModel.writePolicy : config.userContext.knowledgeMemory.writePolicy;
|
|
129
|
+
if (input.command !== "forget" && writePolicy !== "allow") return fail("memory_write_denied");
|
|
130
|
+
const db = getSqliteDatabase();
|
|
131
|
+
const transcriptId = readCurrentTranscriptId(db, conversationId);
|
|
132
|
+
const source = db.prepare(`SELECT entry_id, role, payload_json FROM transcript_entries
|
|
133
|
+
WHERE transcript_id = ? AND ${learningRoleSql("user")} ORDER BY seq DESC LIMIT 1`).get(transcriptId);
|
|
134
|
+
const message = source && learningTranscriptMessage(source);
|
|
135
|
+
const text = deps.getCurrentUserText();
|
|
136
|
+
if (!source || !message || !text || !extractAgentUserPlainText(message).includes(text) || !explicitRequest(text, input.userEvidence, input.command)) return fail("explicit_current_user_request_required");
|
|
137
|
+
const context = {
|
|
138
|
+
agentId: deps.agentId,
|
|
139
|
+
workspaceId: deps.workspaceId,
|
|
140
|
+
conversationId,
|
|
141
|
+
projectId: deps.getProjectId()
|
|
142
|
+
};
|
|
143
|
+
const resolveScope = (type) => {
|
|
144
|
+
if (type === "global") return { type };
|
|
145
|
+
const id = {
|
|
146
|
+
agent: context.agentId,
|
|
147
|
+
workspace: context.workspaceId,
|
|
148
|
+
project: context.projectId,
|
|
149
|
+
session: conversationId
|
|
150
|
+
}[type];
|
|
151
|
+
if (!id) throw new Error(`missing_${type}_scope`);
|
|
152
|
+
return {
|
|
153
|
+
type,
|
|
154
|
+
id
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
const requestedScope = [
|
|
158
|
+
["project", /(?:只|仅)(?:在|用|对|限于)?.{0,6}(?:本项目|这个项目|当前项目)|only.{0,20}(?:this|current) project/iu],
|
|
159
|
+
["workspace", /(?:只|仅)(?:在|用|对|限于)?.{0,6}(?:本工作区|这个工作区|当前工作区)|only.{0,20}(?:this|current) workspace/iu],
|
|
160
|
+
["session", /(?:只|仅)(?:在|用|对|限于)?.{0,6}(?:本会话|这个会话|当前会话|这次对话)|only.{0,20}(?:this|current) (?:chat|session|conversation)/iu],
|
|
161
|
+
["agent", /(?:只|仅)(?:在|用|对|限于)?.{0,6}(?:本助手|这个助手|当前助手)|only.{0,20}(?:this|current) (?:agent|assistant)/iu]
|
|
162
|
+
].find(([, pattern]) => pattern.test(input.userEvidence))?.[0];
|
|
163
|
+
if (requestedScope && input.scope && requestedScope !== input.scope) return fail("requested_scope_mismatch");
|
|
164
|
+
const digest = createHash("sha256").update(JSON.stringify(input)).digest("hex");
|
|
165
|
+
const receipt = executeAtomicOperation({
|
|
166
|
+
principalId: "local-owner",
|
|
167
|
+
capabilityId: "xopc.personal.memory",
|
|
168
|
+
idempotencyKey: `${source.entry_id}:${digest}`,
|
|
169
|
+
requestDigest: digest,
|
|
170
|
+
descriptorDigest: "chat-memory-v1",
|
|
171
|
+
surface: "personal_chat"
|
|
172
|
+
}, (operationId) => {
|
|
173
|
+
const now = Date.now();
|
|
174
|
+
const user = input.target === "user" && input.id ? getUserAssertion(input.id) : void 0;
|
|
175
|
+
const slot = user && getAssertionSlot(user.slotId);
|
|
176
|
+
const knowledge = input.target === "knowledge" && input.id ? getKnowledgeItem(input.id) : void 0;
|
|
177
|
+
const current = user || knowledge;
|
|
178
|
+
const currentScope = slot?.scope ?? knowledge?.scope;
|
|
179
|
+
if (input.command !== "remember") {
|
|
180
|
+
if (!current || !currentScope || !visible(currentScope, context) || slot && slot.principalId !== "local-owner" || knowledge && (knowledge.principalId !== "local-owner" || knowledge.recordClass !== "memory" || !access.knowledgePolicy.scopes.includes(knowledge.scope.type) || !knowledgeContentSources(knowledge).every((kind) => access.knowledgePolicy.contentSources.includes(kind)))) throw new Error("memory_not_found");
|
|
181
|
+
if (!input.version || input.version !== memoryVersion(user ? {
|
|
182
|
+
assertion: user,
|
|
183
|
+
scope: currentScope
|
|
184
|
+
} : knowledge)) throw new Error("memory_version_conflict_read_again");
|
|
185
|
+
} else if (input.id || input.version) throw new Error("remember_does_not_accept_existing_id");
|
|
186
|
+
if (input.command !== "scope" && currentScope && requestedScope && currentScope.type !== requestedScope) throw new Error("requested_scope_mismatch");
|
|
187
|
+
const scope = input.command === "scope" ? input.scope ?? requestedScope ? resolveScope(input.scope ?? requestedScope) : void 0 : currentScope ?? resolveScope(input.scope ?? requestedScope ?? (input.target === "user" ? "global" : context.projectId ? "project" : "workspace"));
|
|
188
|
+
if (!scope) throw new Error("scope_required");
|
|
189
|
+
if (input.target === "knowledge" && input.command !== "forget" && (!access.knowledgePolicy.scopes.includes(scope.type) || !access.knowledgePolicy.contentSources.includes("memory"))) throw new Error("memory_scope_denied");
|
|
190
|
+
if (input.command !== "scope" && input.command !== "remember" && input.scope) {
|
|
191
|
+
const suppliedScope = resolveScope(input.scope);
|
|
192
|
+
if (suppliedScope.type !== scope.type || suppliedScope.id !== scope.id) throw new Error("use_scope_command_to_change_scope");
|
|
193
|
+
}
|
|
194
|
+
let id = input.id;
|
|
195
|
+
let status = "saved";
|
|
196
|
+
if (input.command === "forget") {
|
|
197
|
+
const links = db.prepare(`SELECT DISTINCT e.conversation_id FROM context_evidence e WHERE e.conversation_id IS NOT NULL
|
|
198
|
+
AND (e.evidence_id IN (SELECT evidence_id FROM user_assertion_evidence WHERE assertion_id IN (SELECT assertion_id FROM user_assertions WHERE slot_id = ?))
|
|
199
|
+
OR e.evidence_id IN (SELECT evidence_id FROM knowledge_evidence_links WHERE knowledge_id = ?)
|
|
200
|
+
OR e.message_id IN (SELECT value FROM knowledge_revisions r, json_each(r.source_json, '$.evidenceRefs') WHERE r.knowledge_id = ?))`).all(user?.slotId ?? "", knowledge?.id ?? "", knowledge?.id ?? "");
|
|
201
|
+
createCollaborationRule({
|
|
202
|
+
category: "boundary",
|
|
203
|
+
priority: 0,
|
|
204
|
+
scope,
|
|
205
|
+
status: "active",
|
|
206
|
+
conditions: {
|
|
207
|
+
enforcementLevel: "prompt",
|
|
208
|
+
forgottenHistoryEntries: [...new Set([
|
|
209
|
+
conversationId,
|
|
210
|
+
knowledge?.sourceConversationId,
|
|
211
|
+
...links.map((link) => link.conversation_id)
|
|
212
|
+
].filter(Boolean))].map((id) => `${id}:*`)
|
|
213
|
+
},
|
|
214
|
+
statement: "Do not automatically recall forgotten information from the marked original conversations."
|
|
215
|
+
});
|
|
216
|
+
if (!(user ? deleteUserAssertion(id) : deleteKnowledgeItem(id, now, { includeRelated: false }))) throw new Error("memory_delete_failed");
|
|
217
|
+
status = "forgotten";
|
|
218
|
+
} else if (input.command === "scope") if (user) status = canUseAssertion(setUserAssertionScope(id, scope), now, {
|
|
219
|
+
use: "answer",
|
|
220
|
+
agentId: context.agentId
|
|
221
|
+
}) ? "saved" : "pending";
|
|
222
|
+
else status = canUseKnowledge(setKnowledgeScope(id, scope), context, access.knowledgePolicy) ? "saved" : "pending";
|
|
223
|
+
else {
|
|
224
|
+
const content = input.content?.trim();
|
|
225
|
+
if (!content) throw new Error("content_required");
|
|
226
|
+
const sensitivity = inferMemorySensitivity(`${content}\n${input.userEvidence}`);
|
|
227
|
+
if (sensitivity === "secret" || sensitivity === "regulated") throw new Error("sensitive_memory_denied");
|
|
228
|
+
const personal = sensitivity === "personal" || user?.sensitivity === "personal";
|
|
229
|
+
const sensitivePolicy = config.userContext.userModel.sensitiveWritePolicy;
|
|
230
|
+
if (personal && sensitivePolicy === "deny") throw new Error("sensitive_memory_denied");
|
|
231
|
+
const evidence = createContextEvidence({
|
|
232
|
+
sourceType: "conversation",
|
|
233
|
+
sourceRef: `chat-memory:${source.entry_id}:${digest}`,
|
|
234
|
+
conversationId,
|
|
235
|
+
messageId: source.entry_id,
|
|
236
|
+
trustLevel: "owner",
|
|
237
|
+
redactedExcerpt: input.userEvidence,
|
|
238
|
+
observedAt: now
|
|
239
|
+
});
|
|
240
|
+
if (input.target === "user") {
|
|
241
|
+
if (!slot && !input.predicate) throw new Error("predicate_required");
|
|
242
|
+
const result = reconcileAssertion({
|
|
243
|
+
subject: slot?.subject ?? {
|
|
244
|
+
type: "user",
|
|
245
|
+
id: "self"
|
|
246
|
+
},
|
|
247
|
+
predicate: slot?.predicate ?? input.predicate,
|
|
248
|
+
cardinality: slot?.cardinality ?? "single",
|
|
249
|
+
scope,
|
|
250
|
+
kind: user?.kind ?? input.userKind ?? "preference",
|
|
251
|
+
value: content,
|
|
252
|
+
normalizedValue: content.normalize("NFKC").toLowerCase(),
|
|
253
|
+
statement: content,
|
|
254
|
+
authority: "user_explicit",
|
|
255
|
+
confidence: 1,
|
|
256
|
+
inferredImportance: user?.inferredImportance ?? .7,
|
|
257
|
+
consequence: user?.consequence ?? "medium",
|
|
258
|
+
actionability: user?.actionability ?? .8,
|
|
259
|
+
volatility: user?.volatility ?? (input.userKind === "current_state" ? "dynamic" : "stable"),
|
|
260
|
+
sensitivity: personal ? "personal" : user?.sensitivity ?? "normal",
|
|
261
|
+
disclosurePolicy: user?.disclosurePolicy ?? "referenceable",
|
|
262
|
+
applicability: user?.applicability,
|
|
263
|
+
domain: user?.domain,
|
|
264
|
+
layer: user?.layer,
|
|
265
|
+
sensitivityCategories: user?.sensitivityCategories,
|
|
266
|
+
purposeIds: user?.purposeIds,
|
|
267
|
+
allowedUses: user?.allowedUses,
|
|
268
|
+
allowedAgentIds: user?.allowedAgentIds,
|
|
269
|
+
validFrom: user?.validFrom,
|
|
270
|
+
reviewAt: user?.reviewAt,
|
|
271
|
+
deleteAfter: user?.deleteAfter,
|
|
272
|
+
validTo: input.validTo ?? user?.validTo,
|
|
273
|
+
observedAt: now,
|
|
274
|
+
createdBy: "user",
|
|
275
|
+
evidenceId: evidence.id,
|
|
276
|
+
...user ? { correctionOfAssertionId: user.id } : {}
|
|
277
|
+
});
|
|
278
|
+
if (!result.assertion) throw new Error("memory_suppressed");
|
|
279
|
+
id = result.assertion.id;
|
|
280
|
+
if (personal && sensitivePolicy === "confirm") setAssertionStatus(id, "needs_review", {
|
|
281
|
+
actor: "user",
|
|
282
|
+
reason: "Sensitive memory requires review."
|
|
283
|
+
});
|
|
284
|
+
status = canUseAssertion(getUserAssertion(id), now, {
|
|
285
|
+
use: "answer",
|
|
286
|
+
agentId: context.agentId
|
|
287
|
+
}) ? "saved" : "pending";
|
|
288
|
+
} else if (knowledge) {
|
|
289
|
+
if (input.validTo !== void 0) throw new Error("change_expiry_in_memory_management");
|
|
290
|
+
const item = reviewKnowledgeItem({
|
|
291
|
+
id,
|
|
292
|
+
action: "edit_and_approve",
|
|
293
|
+
content,
|
|
294
|
+
actor: "user",
|
|
295
|
+
reason: "Explicit correction in chat.",
|
|
296
|
+
expectedStatus: knowledge.status,
|
|
297
|
+
evidence: [{
|
|
298
|
+
id: evidence.id,
|
|
299
|
+
contentHash: evidence.contentHash
|
|
300
|
+
}],
|
|
301
|
+
source: {
|
|
302
|
+
tool: "personal_memory",
|
|
303
|
+
evidenceRefs: [source.entry_id]
|
|
304
|
+
}
|
|
305
|
+
});
|
|
306
|
+
if (!item) throw new Error("memory_not_found");
|
|
307
|
+
if (personal && sensitivePolicy === "confirm") throw new Error("sensitive_correction_requires_management_review");
|
|
308
|
+
status = canUseKnowledge(item, context, access.knowledgePolicy) ? "saved" : "pending";
|
|
309
|
+
} else {
|
|
310
|
+
const result = writeKnowledgeItem({
|
|
311
|
+
scope,
|
|
312
|
+
kind: input.knowledgeKind ?? "note",
|
|
313
|
+
content,
|
|
314
|
+
canonicalKey: `chat:${memoryVersion(content.normalize("NFKC").toLowerCase())}`,
|
|
315
|
+
status: personal && sensitivePolicy === "confirm" ? "needs_review" : "active",
|
|
316
|
+
verification: "supported",
|
|
317
|
+
claimMode: "explicit",
|
|
318
|
+
confidence: 1,
|
|
319
|
+
importance: .7,
|
|
320
|
+
originClass: "owner",
|
|
321
|
+
sourceAgentId: context.agentId,
|
|
322
|
+
sourceConversationId: conversationId,
|
|
323
|
+
sensitivity,
|
|
324
|
+
validTo: input.validTo,
|
|
325
|
+
evidence: [{
|
|
326
|
+
id: evidence.id,
|
|
327
|
+
contentHash: evidence.contentHash
|
|
328
|
+
}],
|
|
329
|
+
source: {
|
|
330
|
+
tool: "personal_memory",
|
|
331
|
+
evidenceRefs: [source.entry_id]
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
if (!result.item) throw new Error("memory_suppressed");
|
|
335
|
+
id = result.item.id;
|
|
336
|
+
status = canUseKnowledge(result.item, context, access.knowledgePolicy) ? "saved" : "pending";
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
receiptId: operationId,
|
|
341
|
+
status,
|
|
342
|
+
command: input.command,
|
|
343
|
+
target: input.target,
|
|
344
|
+
id,
|
|
345
|
+
scope,
|
|
346
|
+
committedAt: now,
|
|
347
|
+
effectiveFrom: "next_turn",
|
|
348
|
+
...status === "forgotten" ? { originalSourcesRetained: true } : {}
|
|
349
|
+
};
|
|
350
|
+
});
|
|
351
|
+
notifyUserContextChange({
|
|
352
|
+
kind: "session",
|
|
353
|
+
id: conversationId
|
|
354
|
+
});
|
|
355
|
+
const assertion = receipt.target === "user" ? getUserAssertion(receipt.id) : void 0;
|
|
356
|
+
const item = receipt.target === "knowledge" ? getKnowledgeItem(receipt.id) : void 0;
|
|
357
|
+
const currentScope = assertion ? getAssertionSlot(assertion.slotId)?.scope : item?.scope;
|
|
358
|
+
const current = assertion ?? item;
|
|
359
|
+
const result = {
|
|
360
|
+
...receipt,
|
|
361
|
+
committedScope: receipt.scope,
|
|
362
|
+
scope: currentScope ?? receipt.scope,
|
|
363
|
+
...current ? { version: memoryVersion(assertion ? {
|
|
364
|
+
assertion,
|
|
365
|
+
scope: currentScope
|
|
366
|
+
} : item) } : {},
|
|
367
|
+
available: Boolean(current),
|
|
368
|
+
usable: assertion ? canUseAssertion(assertion, Date.now(), {
|
|
369
|
+
use: "answer",
|
|
370
|
+
agentId: context.agentId
|
|
371
|
+
}) : item ? canUseKnowledge(item, context, access.knowledgePolicy) : false
|
|
372
|
+
};
|
|
373
|
+
return {
|
|
374
|
+
content: [{
|
|
375
|
+
type: "text",
|
|
376
|
+
text: JSON.stringify(result)
|
|
377
|
+
}],
|
|
378
|
+
details: result
|
|
379
|
+
};
|
|
380
|
+
} catch (error) {
|
|
381
|
+
return fail(error instanceof Error ? error.message : "memory_operation_failed");
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
export { createPersonalMemoryTool };
|
|
@@ -7,6 +7,8 @@ export interface SessionSearchToolDeps {
|
|
|
7
7
|
getPrimaryModel: () => Model<Api>;
|
|
8
8
|
getCurrentConversationId?: () => string | undefined;
|
|
9
9
|
canAccess?: () => boolean;
|
|
10
|
+
canRecallConversation?: (conversationId: string) => boolean;
|
|
11
|
+
canRecallEntry?: (conversationId: string, entryId: string, content: string) => boolean;
|
|
10
12
|
localOnly?: boolean;
|
|
11
13
|
getHistoryContext?: () => CaptureScopeContext;
|
|
12
14
|
getCurrentUserText?: () => string | undefined;
|
|
@@ -5,6 +5,7 @@ import { readAgentMessageContent } from "../memory/agent-message-access.js";
|
|
|
5
5
|
import { init_providers, resolveModel } from "../../providers/index.js";
|
|
6
6
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
7
7
|
import { FORGOTTEN_HISTORY_EXCERPT, forgottenHistoryEntries, projectUnadmittedForgottenFields } from "../../memory-learning/forgotten-history.js";
|
|
8
|
+
import { stripRuntimeContextFromUserMessage } from "../../session/user-message-display.js";
|
|
8
9
|
import "./local-read-budget.js";
|
|
9
10
|
import { Type } from "@sinclair/typebox";
|
|
10
11
|
//#region src/agent/tools/session-search-tool.ts
|
|
@@ -95,7 +96,7 @@ function createSessionSearchTool(deps) {
|
|
|
95
96
|
return {
|
|
96
97
|
name: "session_search",
|
|
97
98
|
label: "Session search",
|
|
98
|
-
description: deps.localOnly ? "Search
|
|
99
|
+
description: deps.localOnly ? "Search chats in the current agent, workspace and project scope and return short matching transcript excerpts. Omit query to list recent allowed chats. No model or network calls. Switch project context to search a different project." : "Search other chat sessions by keywords and get short summaries, or omit `query` to list recent sessions (no LLM cost). Uses the same session store as the gateway. Narrow with roleFilter if needed.",
|
|
99
100
|
parameters: deps.localOnly ? Type.Object({
|
|
100
101
|
...SessionSearchSchema.properties,
|
|
101
102
|
query: Type.Optional(Type.String({
|
|
@@ -137,7 +138,7 @@ function createSessionSearchTool(deps) {
|
|
|
137
138
|
sortBy: "updatedAt",
|
|
138
139
|
sortOrder: "desc"
|
|
139
140
|
});
|
|
140
|
-
const items = listed.items.slice(0, limit).map((s) => ({
|
|
141
|
+
const items = listed.items.filter((item) => !deps.canRecallConversation || deps.canRecallConversation(item.key)).slice(0, limit).map((s) => ({
|
|
141
142
|
key: s.key,
|
|
142
143
|
name: projectTitle(s.key, s.name),
|
|
143
144
|
updatedAt: s.updatedAt,
|
|
@@ -151,7 +152,7 @@ function createSessionSearchTool(deps) {
|
|
|
151
152
|
success: true,
|
|
152
153
|
mode: "recent",
|
|
153
154
|
results: items,
|
|
154
|
-
total: listed.total
|
|
155
|
+
total: deps.canRecallConversation ? items.length : listed.total
|
|
155
156
|
}, null, 2)
|
|
156
157
|
}],
|
|
157
158
|
details: {
|
|
@@ -166,7 +167,7 @@ function createSessionSearchTool(deps) {
|
|
|
166
167
|
sortBy: "updatedAt",
|
|
167
168
|
sortOrder: "desc"
|
|
168
169
|
});
|
|
169
|
-
let matches = listed.items.map((item) => ({
|
|
170
|
+
let matches = listed.items.filter((item) => !deps.canRecallConversation || deps.canRecallConversation(item.key)).map((item) => ({
|
|
170
171
|
key: item.key,
|
|
171
172
|
score: 1
|
|
172
173
|
}));
|
|
@@ -180,8 +181,8 @@ function createSessionSearchTool(deps) {
|
|
|
180
181
|
excerpts: store.recallSession(key, query, {
|
|
181
182
|
limit: 2,
|
|
182
183
|
matchMode: "keyword"
|
|
183
|
-
}).filter((match) => !p.roleFilter || match.role === p.roleFilter).map((match) => {
|
|
184
|
-
const content = protectedEntries.has(`${key}:*`) || protectedEntries.has(`${key}:${match.entryId}`) ? FORGOTTEN_HISTORY_EXCERPT : deps.getHistoryContext ? projectUnadmittedForgottenFields(match.content, deps.getHistoryContext(), deps.getCurrentUserText?.()) : match.content;
|
|
184
|
+
}).filter((match) => (!p.roleFilter || match.role === p.roleFilter) && (!deps.canRecallEntry || deps.canRecallEntry(key, match.entryId, match.content))).map((match) => {
|
|
185
|
+
const content = stripRuntimeContextFromUserMessage(protectedEntries.has(`${key}:*`) || protectedEntries.has(`${key}:${match.entryId}`) ? FORGOTTEN_HISTORY_EXCERPT : deps.getHistoryContext ? projectUnadmittedForgottenFields(match.content, deps.getHistoryContext(), deps.getCurrentUserText?.()) : match.content);
|
|
185
186
|
const positions = sessionSearchTerms(query).map((term) => content.toLowerCase().indexOf(term.toLowerCase())).filter((at) => at >= 0);
|
|
186
187
|
const at = positions.length ? Math.min(...positions) : 0;
|
|
187
188
|
const start = Math.max(0, at - 200);
|
|
@@ -200,7 +201,8 @@ function createSessionSearchTool(deps) {
|
|
|
200
201
|
mode: "keyword",
|
|
201
202
|
query,
|
|
202
203
|
results,
|
|
203
|
-
truncated: false
|
|
204
|
+
truncated: false,
|
|
205
|
+
...deps.canRecallConversation ? { historyScope: "current_agent_workspace_project" } : {}
|
|
204
206
|
};
|
|
205
207
|
while (JSON.stringify(payload).length > 8e3 && results.length) {
|
|
206
208
|
payload.truncated = true;
|
|
@@ -229,6 +231,18 @@ function createSessionSearchTool(deps) {
|
|
|
229
231
|
score,
|
|
230
232
|
summary: FORGOTTEN_HISTORY_EXCERPT
|
|
231
233
|
};
|
|
234
|
+
if (deps.canRecallEntry) return {
|
|
235
|
+
conversationId: key,
|
|
236
|
+
score,
|
|
237
|
+
summary: await summarizeSession(store.recallSession(key, query, {
|
|
238
|
+
limit: 8,
|
|
239
|
+
matchMode: "keyword"
|
|
240
|
+
}).filter((match) => (!p.roleFilter || match.role === p.roleFilter) && deps.canRecallEntry(key, match.entryId, match.content)).map((match) => ({
|
|
241
|
+
role: match.role,
|
|
242
|
+
content: deps.getHistoryContext ? projectUnadmittedForgottenFields(stripRuntimeContextFromUserMessage(match.content), deps.getHistoryContext(), deps.getCurrentUserText?.()) : stripRuntimeContextFromUserMessage(match.content),
|
|
243
|
+
timestamp: match.createdAt
|
|
244
|
+
})), query, deps, signal, { summarizingConversationId: key })
|
|
245
|
+
};
|
|
232
246
|
let messages = await store.load(key);
|
|
233
247
|
if (deps.getHistoryContext) messages = projectUnadmittedForgottenFields(messages, deps.getHistoryContext(), deps.getCurrentUserText?.());
|
|
234
248
|
if (p.roleFilter) messages = messages.filter((m) => m.role === p.roleFilter);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { projectForgottenEvidence } from "../../memory-learning/forgotten-history.js";
|
|
2
|
+
import { retrievalLexicalSimilarity } from "../../retrieval/textFeatures.js";
|
|
2
3
|
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, listUserAssertionSources, listUserAssertions, reconcileAssertion, setAssertionStatus } from "../../user-model/repository.js";
|
|
3
4
|
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
4
5
|
import "./local-read-budget.js";
|
|
6
|
+
import { memoryVersion } from "../../user-context/memory-version.js";
|
|
5
7
|
import "../../user-model/index.js";
|
|
6
|
-
import { retrievalLexicalSimilarity } from "../../retrieval/textFeatures.js";
|
|
7
8
|
import { Type } from "@sinclair/typebox";
|
|
8
9
|
//#region src/agent/tools/user-context-tool.ts
|
|
9
10
|
const SearchSchema = Type.Object({
|
|
@@ -59,6 +60,11 @@ function createUserContextSearchTool(options) {
|
|
|
59
60
|
score: retrievalLexicalSimilarity(input.query, `${assertion.statement} ${assertion.normalizedValue}`)
|
|
60
61
|
})).filter((item) => item.score > 0).sort((left, right) => right.score - left.score).slice(0, input.maxResults ?? 12).map(({ assertion, score }) => ({
|
|
61
62
|
id: assertion.id,
|
|
63
|
+
scope: getAssertionSlot(assertion.slotId)?.scope,
|
|
64
|
+
version: memoryVersion({
|
|
65
|
+
assertion,
|
|
66
|
+
scope: getAssertionSlot(assertion.slotId)?.scope
|
|
67
|
+
}),
|
|
62
68
|
kind: assertion.kind,
|
|
63
69
|
statement: assertion.statement,
|
|
64
70
|
status: assertion.status,
|
|
@@ -111,6 +117,10 @@ function createUserContextGetTool(options) {
|
|
|
111
117
|
};
|
|
112
118
|
const result = {
|
|
113
119
|
assertion,
|
|
120
|
+
version: memoryVersion({
|
|
121
|
+
assertion,
|
|
122
|
+
scope: getAssertionSlot(assertion.slotId)?.scope
|
|
123
|
+
}),
|
|
114
124
|
slot: getAssertionSlot(assertion.slotId),
|
|
115
125
|
sources: projectForgottenEvidence(listUserAssertionSources([assertion.id]).get(assertion.id) ?? [], {
|
|
116
126
|
agentId: options.agentId,
|
|
@@ -41,6 +41,11 @@ export declare const AutomationCreateCapabilityInputSchema: z.ZodObject<{
|
|
|
41
41
|
name: z.ZodString;
|
|
42
42
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
43
43
|
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
44
|
+
kind: z.ZodLiteral<"routine">;
|
|
45
|
+
routineId: z.ZodString;
|
|
46
|
+
version: z.ZodNumber;
|
|
47
|
+
hash: z.ZodString;
|
|
48
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
44
49
|
kind: z.ZodLiteral<"agent">;
|
|
45
50
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
46
51
|
instruction: z.ZodString;
|
|
@@ -270,6 +275,11 @@ export declare const AutomationUpdatePatchSchema: z.ZodObject<{
|
|
|
270
275
|
name: z.ZodOptional<z.ZodString>;
|
|
271
276
|
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
272
277
|
action: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
278
|
+
kind: z.ZodLiteral<"routine">;
|
|
279
|
+
routineId: z.ZodString;
|
|
280
|
+
version: z.ZodNumber;
|
|
281
|
+
hash: z.ZodString;
|
|
282
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
273
283
|
kind: z.ZodLiteral<"agent">;
|
|
274
284
|
agentId: z.ZodPipe<z.ZodOptional<z.ZodNullable<z.ZodString>>, z.ZodTransform<string, string>>;
|
|
275
285
|
instruction: z.ZodString;
|
|
@@ -34,6 +34,11 @@ export type AutomationAction = {
|
|
|
34
34
|
workingDirectory?: string;
|
|
35
35
|
model?: string;
|
|
36
36
|
timeoutSeconds?: number;
|
|
37
|
+
} | {
|
|
38
|
+
kind: 'routine';
|
|
39
|
+
routineId: string;
|
|
40
|
+
version: number;
|
|
41
|
+
hash: string;
|
|
37
42
|
} | {
|
|
38
43
|
kind: 'task_command';
|
|
39
44
|
taskId: string;
|
|
@@ -314,6 +319,15 @@ export interface PrepareAutomationAgentSessionInput {
|
|
|
314
319
|
runId: string;
|
|
315
320
|
}
|
|
316
321
|
export interface AutomationDeps {
|
|
322
|
+
executeRoutine?: (input: {
|
|
323
|
+
action: Extract<AutomationAction, {
|
|
324
|
+
kind: 'routine';
|
|
325
|
+
}>;
|
|
326
|
+
run: AutomationRun;
|
|
327
|
+
signal: AbortSignal;
|
|
328
|
+
deadlineAtMs: number;
|
|
329
|
+
onConversation: (id: string) => Promise<void>;
|
|
330
|
+
}) => Promise<AutomationActionTask>;
|
|
317
331
|
getConfig?: () => unknown;
|
|
318
332
|
agentService?: {
|
|
319
333
|
sessionConfig?: {
|