@xopcai/xopc 0.0.454 → 0.0.456
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/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/eventEmitter2.js +40 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/index.js +56 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/shared/conout.js +16 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/terminal.js +190 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/unixTerminal.js +287 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/utils.js +49 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsConoutConnection.js +190 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsPtyAgent.js +265 -0
- package/dist/.pnpm/node-pty@1.1.0/node_modules/node-pty/lib/windowsTerminal.js +178 -0
- package/dist/_virtual/_rolldown/runtime.js +10 -2
- 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-BKH-qNPt.js → activity-store-DYwR1u3f.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DY6IWy0_.js → agent-avatar-dicebear-CsRBprL-.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-tnAtQOAZ.js → agent-avatar-display-DqFYHXCS.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BLQ2N_dY.js → agent-defaults-settings-panel-DOAJrMLe.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-Bfsm4GOs.js → agent-plugin-dialog-vqlN3ORH.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-CDNiLv0W.js → agents-BgHlOVRV.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DGZsm8U4.js → agents-admin-api-CKscfdvA.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BhipC15e.js → api-CHM2c_Ah.js} +1 -1
- package/dist/gateway/static/root/assets/{api-Bbj5k-7e.js → api-DPNeNCmR.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-CCZ-LmVT.js → app-link-DImAfVs5.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fwhXHKxt.js → app-management-settings-panel-Bhz6bj1C.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BHkl-vFO.js → appearance-settings-BX32aogA.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DtCWwdsK.js → apps-page-0Yo3jBsQ.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-B9xaxa7V.js → archive-plugin-Bha8obMe.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-BHMjSwcy.js → automation-api-mn8ihWJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BgAjEoNV.js → automation-result-state-COzakzak.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-D3Eon5C0.js → automation-run-list-BhtaMpTb.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-DJRg72t-.js → automation-task-card-BY_k6iWp.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DdAzXb7s.js → automations-page-CgQDpSpK.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-D0nNat6N.js → automations-workspace-CWEDraTP.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-CgsjdprR.js → binary-plugins-DUbrJFLU.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-r6vj6dZO.js → block-editor-DW--pXAc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-APCGT8Yr.js → browser-settings-page-CDh6nxs9.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-0gYkjdax.js → capabilities-DKbXv8Ck.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-BgBwcqvY.js → capabilities-kG175Q-7.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-B1x3TwdV.js → capabilities-page-D1wQ2sPI.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BW5jQz5R.js +8 -0
- package/dist/gateway/static/root/assets/{channels-8Y08v4Q2.js → channels-BzZp42yO.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BRQDNNI5.js → chat-agents-api-UOdNWZ0_.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-qMGhfeQZ.js → chat-chart-block-NSy-B0NS.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-page-CSTyfO9c.js → chat-page-BjYumhaI.js} +20 -20
- package/dist/gateway/static/root/assets/{chat-terminal-dock-0PJ9dURQ.js → chat-terminal-dock-CAaHWS7F.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-C4U_-rDo.js → command-palette-api-Dkn9bbYd.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-B9Q40ptH.js → composer-model-config-control-BrK8-SNz.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-ByuA8h5Z.js → composer-notifications-B-kL3qAA.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-zr1JDn3p.js → composer-payload-handoff-DBE1mvOS.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-D2F1quZR.js → computer-settings-page-C9KdEecx.js} +1 -1
- package/dist/gateway/static/root/assets/connected-providers-grid-D_8v6Qex.js +1 -0
- package/dist/gateway/static/root/assets/{connection-usage-guide-DkDsHm_l.js → connection-usage-guide-CiVpcbds.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-1AcvESmp.js → connector-service-page-B919cKSm.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-C1OML7OO.js → connectors-api-CgsSm-Av.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-CMIY0Zj_.js → connectors-page-CEpfDCLA.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-D1eFhoMI.js → date-picker-dx284jQI.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-CqplKVk6.js → date-time-picker-Dj-bhLNP.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-UmrjWSq-.js → desktop-pet-Cn1TfGz4.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-narrative-B7I1II0Z.js → desktop-pet-narrative-JqMsz4rn.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DRRDJMu6.js → desktop-pet-settings-CsmrvoxU.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-CtKJMK52.js → dev-view-store-BOxbj1ie.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-C4aSCbqo.js → device-pairing-wizard-CAqFIFRC.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D9U9yfnb.js → directory-picker-path-field-BxEw5OrT.js} +1 -1
- package/dist/gateway/static/root/assets/{discussion-annotation-sync-D-eGt1_L.js → discussion-annotation-sync-CyntTwIa.js} +1 -1
- package/dist/gateway/static/root/assets/extension-authoritative-grants-C0ReZguU.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BTLcC8-r.js → extension-debug-page-Cd3HMUbi.js} +1 -1
- package/dist/gateway/static/root/assets/extension-iframe-host-DiIqM2JO.js +1 -0
- package/dist/gateway/static/root/assets/{extension-marketplace-api-DLRCNlej.js → extension-marketplace-api-CK5CMKTs.js} +1 -1
- package/dist/gateway/static/root/assets/extension-message-router-Dn8JzOdR.js +8 -0
- package/dist/gateway/static/root/assets/{extension-page-CdpI-Plq.js → extension-page-CLZtAtqm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-DUDaMvQg.js → extension-provider-CbVokTvd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-biWCnMGr.js → extension-settings-page-BM79cwUy.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-CnBRiQo8.js → file-preview-surface-z7_HV0WN.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-BV5fpBSK.js → gateway-config-swr-OGhON-s6.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-CIqLQXlm.js → gateway-realtime-B9u4uSXW.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-xB7Bq4Zs.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-DBkfCzT5.js → gateway-restart-DKAweWmg.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DTzXUm9f.js → gateway-settings-Dc7qUbG-.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-B49N_Ngm.js → gateway-startup-retry-BaaoKBoB.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-DVpxe45P.js → global-defaults-api-BIr3ApRj.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-DvaxBrjG.js → home-page-i_PIrDCU.js} +2 -2
- package/dist/gateway/static/root/assets/{image-generation-api-CAKYslID.js → image-generation-api-C7D2IetZ.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-C2KmQJ2H.js → imports-page-BjEdZJxZ.js} +1 -1
- package/dist/gateway/static/root/assets/{index-BpzvsoS1.js → index-DBlVVXOA.js} +5 -5
- package/dist/gateway/static/root/assets/index-DpkEeFEQ.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-CmNvZt8M.js → install-connector-dialog-BsiyYQhx.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-syG2KRr2.js → keyboard-shortcuts-settings-CIthQ1lp.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-DGA4EHGm.js → local-app-workbench-page-CSCIHvZV.js} +1 -1
- package/dist/gateway/static/root/assets/local-apps-DeqzkJiF.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-I0O2ybpp.js → local-apps-page-EntiM0tz.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-DsPDloiq.js → local-session-drafts-XurtjR58.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-D3c8DIm-.js → locale-store-cg9cm2EL.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-u9FTZaTh.js → logs-page-rmS9VSem.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-uxRxRX-6.js → management-api-B6jVuJ6W.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-BCbDfM7f.js → management-settings-DdI9gs51.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-ohhExTMC.js → markdown-view-D1zBWkfB.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-382BGqQC.js → mcp-conversation-setup-page-Bn49Ph1n.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-B5wtLz3Z.js → media-plugins-Cd6hAGDp.js} +1 -1
- package/dist/gateway/static/root/assets/messages-eQ2CYlpG.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-CoKcq0AZ.js → model-selector-CL6WT-jw.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-CtooMAQW.js → models-hub-cache-s0FMNhq9.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-DiGQtSD0.js → note-detail-panel-C6s0WlNL.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-DfK2KSgu.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-Cvet94d8.js → notes-api-CR75RHd0.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DwlmKweX.js → notes-page-CR7dNVDi.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-BHp5dVNh.js → oauth-api-CvPnQTlH.js} +1 -1
- package/dist/gateway/static/root/assets/oauth-provider-connect-Dk1NeeqD.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-BwsK2uDe.js → page-context-capture-button-BPtX67hZ.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-ieK9IN3R.js → page-context-draft-Ckb8baxj.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-DU4NnGap.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BZSC0BLP.js → personal-avatar-CZSnrSfc.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-CbiD8Wn7.js → personal-page-C89kLOIL.js} +1 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-DJRDcK2c.js +1 -0
- package/dist/gateway/static/root/assets/{personal-settings-panel-_cxSzWsN.js → personal-settings-panel-C6p25Noq.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-C2OWtG2B.js → phone-dependencies-card-DKkFFpqi.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-CqmafRhr.js → phone-model-connection-CRRHq4PQ.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-BwYQtl_5.js → phone-model-picker-CN_I0-46.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-CPteZZWu.js → phone-settings-page-CkdSOA7D.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-ReUEjG9m.js → phone-workspace-store-CC61pIuJ.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-BlNVtbEU.js → plugin-details-dialog-Bqz4jT53.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BbA-g7Zq.js → preference-select-fields-DHeNbAvn.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-DcPY76PG.js → product-automation-feedback-BN2HTA9T.js} +1 -1
- package/dist/gateway/static/root/assets/{product-delivery-2Ks17_OH.js → product-delivery-BFfqdKLe.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BBJ7glAm.js → product-open-page-B-j4gpLD.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-UTOSc_ii.js → product-preview-content-EqrTk7kU.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-Q1RZqeMo.js → product-preview-modal-aurFBFq4.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-BlrtsEZK.js → project-detail-page-sHcdluTm.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-B35f5MkG.js → project-understanding-HNK9lFVy.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CBH-sHOU.js → projects-page-CugSyKl5.js} +1 -1
- package/dist/gateway/static/root/assets/providers-api-DUntOOqr.js +1 -0
- package/dist/gateway/static/root/assets/{recording-upload-P1WcsdEY.js → recording-upload-DIwP541B.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DnVlwJ6M.js → registry-api-BTd_OgbD.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CVEj3p0J.js → remote-access-hub-f5mIfsBF.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-B_S1dFze.js → resource-unavailable-DtQ2rfu_.js} +1 -1
- package/dist/gateway/static/root/assets/{route-preload-DGmrxJSb.js → route-preload-DrfQJkmW.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-970sp5zI.js → runtime-tools-api-C1iI8EPo.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-au6vZ0sL.js → runtime-tools-settings-panel-0tdI1z0g.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-XeRFtJ-Z.js → service-recommendation-list-DSIe-NRe.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-CuT7EPI0.js → session-api-CQlEq0MB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-CyZHiuWY.js → session-manager-C7RfUfqI.js} +1 -1
- package/dist/gateway/static/root/assets/{sessions-page-BIxDwAIX.js → sessions-page-DdS8U0RV.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DnfH22f_.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-nbkGHQ_4.js → settings-advanced-section-C6dPu5i1.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-EQHfksdV.js → settings-mode-store-BSiiowQa.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-D6RNHRHq.js → settings-page-C4CYw21O.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-19GJ_a45.js → settings-page-header-BSMu5Zq3.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-B2WCzSel.js → settings-page-layout-B_vMffB1.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-C5i7y_pM.js → setup-interaction-page-DKXfFdNt.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cwp8YKdT.js → setup-status-panel-BbAZ9w77.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-DDsVTMZ-.js → share-link-dialog-ztX1WPXG.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-C1S_gWGf.js → share-preview-page-Ds2Ydfg6.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-CepTFl1f.js → shares-api-CSZqeNL4.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-Cv-tdcAN.js → shares-settings-CX3TNAmI.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CsT-iHnl.js → skill-api-CGzAQ-MX.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-CMJTjvSo.js → skill-list-api-DfUsku-x.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-S6B7P9ur.js → skill-reload-api-Y9qSMnBd.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-BKcsJtYx.js → skills-page-DnMN50Ot.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DhHPM5qU.js → system-settings-panel-DWNkQmme.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BHH2_Z9_.js → task-detail-page-DBnkT1Nj.js} +1 -1
- package/dist/gateway/static/root/assets/{task-input-card-D_2rNF31.js → task-input-card-lCMSy6YY.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-CcUWpqvC.js → terminal-panel-store-D8eZPvql.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-D9pquJiM.js → theme-store-GZQ3pTgy.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-CjNrKILr.js → tracing-settings-page-DM3-7Hlw.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-GtLO40pc.js → tunnel-api-DOGAIXRR.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BhB5wAbq.js → understanding-activity-store-CuPfe0eQ.js} +1 -1
- package/dist/gateway/static/root/assets/understanding-refresh-store-CIpGYSl0.js +1 -0
- package/dist/gateway/static/root/assets/{usage-page-CZa_a6_7.js → usage-page-BA9Yrvqu.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-BtOp6W9H.js → use-autosave-CO0IPCVg.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BTQZx8Nj.js → use-composer-attachments-CLIrD0mm.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-B7nscYS4.js → use-file-preview-expanded-dhNMHf5b.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-Cj7WGOfv.js → use-personal-profile-CVqDWBDS.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-BS1rygyV.js → use-realtime-voice-DDVVlX1R.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-DYosm4Gz.js → use-workspace-tree-CZej8mhf.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-Bbi2MpIS.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-8voN8dQG.js → voice-api-key-field-DpwUDAvu.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CrZd2aqw.js → voice-config-api-GIuXoHXw.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-DcFp_fy4.js → voice-input-shortcut-events-Cc30ZcFy.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-AckvhNnP.js → voice-settings-DA3m5MT0.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-DAIk5csp.js → work-discovery-overlay-yGUkk1NV.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-CJeixeWQ.js → work-discovery-page-RN6iuY-0.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-BW76VaD5.js → working-directory-picker-modal-CeXl9w6z.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-Cu2gzmVn.js → workspace-api-B1Uirhxf.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-Nos5ebMv.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-DyqI793w.js → workspace-file-preview-dialog-D0h2yJ3v.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-DTYkApy8.js → workspace-open-location-menu-DWGNOIE2.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Rytp_NWV.js → xopc-cloud-account-card-x-XT4bKF.js} +1 -1
- package/dist/gateway/static/root/index.html +91 -91
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/extension-capabilities.js +69 -4
- package/dist/packages/gateway-contract/src/local-app-delegation.js +4 -1
- package/dist/src/agent/agent-manager.js +8 -3
- 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 +48 -4
- package/dist/src/agent/child-agent-factory.js +24 -1
- package/dist/src/agent/commands/command-registry.d.ts +10 -0
- package/dist/src/agent/commands/command-registry.js +37 -16
- package/dist/src/agent/commands/command-transport.d.ts +19 -0
- package/dist/src/agent/commands/command-transport.js +92 -0
- 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/project-context.js +1 -1
- 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 +16 -5
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-turn.js +120 -14
- package/dist/src/agent/embedded/runs.d.ts +2 -0
- package/dist/src/agent/embedded/runs.js +8 -1
- package/dist/src/agent/embedded/session-runner.js +2 -2
- 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 +4 -4
- package/dist/src/agent/inbound/attachment-pipeline.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/agent-orchestrator.js +1 -1
- package/dist/src/agent/orchestration/child-run-monitor.d.ts +35 -0
- package/dist/src/agent/orchestration/child-run-monitor.js +104 -0
- package/dist/src/agent/orchestration/child-run-resume.d.ts +3 -0
- package/dist/src/agent/orchestration/child-run-resume.js +67 -0
- package/dist/src/agent/sandbox/native-command.d.ts +15 -0
- package/dist/src/agent/sandbox/native-command.js +65 -0
- package/dist/src/agent/service/btw-query.d.ts +1 -0
- package/dist/src/agent/service/btw-query.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +2 -2
- package/dist/src/agent/service/process-direct-streaming.js +3 -3
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +8 -5
- package/dist/src/agent/session/interaction-policy.d.ts +21 -0
- package/dist/src/agent/session/interaction-policy.js +58 -0
- package/dist/src/agent/session/session-inspector.js +3 -2
- 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/create-share-tool.js +1 -1
- package/dist/src/agent/tools/exec-command.js +5 -0
- package/dist/src/agent/tools/factory.js +23 -1
- package/dist/src/agent/tools/index.js +1 -1
- package/dist/src/agent/tools/knowledge-memory-tool.js +7 -1
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/managed-job-tool.js +16 -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/personal-read-tool.js +2 -2
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/read.js +1 -1
- package/dist/src/agent/tools/send-media.js +1 -1
- 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/agent/tools/write.js +1 -1
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- 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 +6 -2
- package/dist/src/automations/capabilities/read.js +58 -8
- package/dist/src/automations/capabilities/write.js +54 -1
- package/dist/src/automations/configuration-conversation.js +1 -1
- package/dist/src/automations/delivery/delivery-router.js +3 -1
- package/dist/src/automations/run-changes.d.ts +2 -0
- package/dist/src/automations/run-changes.js +18 -0
- package/dist/src/automations/service/automation-service.d.ts +2 -9
- package/dist/src/automations/service/automation-service.js +3 -2
- package/dist/src/automations/storage/automation-run-repository.d.ts +5 -0
- package/dist/src/automations/storage/automation-run-repository.js +15 -1
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.d.ts +1 -0
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.d.ts +2 -0
- package/dist/src/capabilities/runtime/product.js +27 -7
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -1
- package/dist/src/chat-commands/types.d.ts +2 -0
- package/dist/src/cli/commands/agents.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/commands/tui-runner.d.ts +1 -1
- package/dist/src/cli/commands/tui-runner.js +1 -0
- package/dist/src/cli/commands/tui.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/config/schema.d.ts +7 -1
- package/dist/src/config/schema.js +6 -0
- 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/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +6 -0
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +108 -11
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/imports.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +2 -2
- package/dist/src/gateway/hono/routes/local-app-capabilities.js +12 -2
- package/dist/src/gateway/hono/routes/local-app-run-streams.d.ts +4 -0
- package/dist/src/gateway/hono/routes/local-app-run-streams.js +105 -0
- 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/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +4 -4
- package/dist/src/gateway/hono/routes/tui.js +308 -0
- package/dist/src/gateway/hono/routes/user-model.js +47 -7
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/security/gateway-scopes.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +7 -1
- package/dist/src/gateway/service/sessions-api.d.ts +1 -1
- package/dist/src/gateway/service/sessions-api.js +3 -3
- package/dist/src/gateway/service.js +4 -4
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +2 -2
- package/dist/src/imports/importService.js +1 -1
- package/dist/src/infra/execution-authority.d.ts +12 -0
- package/dist/src/infra/execution-authority.js +27 -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 +754 -0
- package/dist/src/local-apps/automation-proposals.js +185 -0
- package/dist/src/local-apps/capabilities/automation-policy.d.ts +7 -0
- package/dist/src/local-apps/capabilities/automation-policy.js +46 -0
- package/dist/src/local-apps/capabilities/contracts.js +23 -0
- package/dist/src/local-apps/capabilities/delegate.js +24 -7
- package/dist/src/local-apps/capabilities/projections.d.ts +588 -0
- package/dist/src/local-apps/capabilities/projections.js +135 -2
- package/dist/src/local-apps/capabilities/resource-policy.js +76 -0
- package/dist/src/local-apps/capabilities/runtime.js +2 -1
- package/dist/src/local-apps/execution-authority.d.ts +13 -0
- package/dist/src/local-apps/execution-authority.js +104 -0
- package/dist/src/local-apps/p1-services.d.ts +189 -0
- package/dist/src/local-apps/p1-services.js +620 -0
- package/dist/src/local-apps/preview-sessions.d.ts +1 -1
- package/dist/src/local-apps/preview-sessions.js +2 -2
- package/dist/src/local-apps/preview-worker.js +11 -2
- package/dist/src/local-apps/service.d.ts +81 -1
- package/dist/src/local-apps/service.js +19 -2
- package/dist/src/local-apps/store.js +1 -1
- package/dist/src/memory-learning/work-capture.js +3 -1
- package/dist/src/notes/agent-context.js +1 -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/prompts.js +7 -1
- package/dist/src/personal-agent/request-service.js +1 -1
- package/dist/src/personal-agent/service.js +1 -1
- package/dist/src/personal-agent/task-cancel.js +1 -1
- package/dist/src/platform/contracts.d.ts +3 -3
- package/dist/src/projects/capabilities/read.js +43 -2
- package/dist/src/projects/capabilities/write.js +25 -0
- package/dist/src/projects/project-store.js +12 -1
- package/dist/src/projects/types.d.ts +1 -0
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/review/review-git.js +14 -1
- package/dist/src/runtime-tools/archive.js +1 -1
- package/dist/src/session/history-recall-policy.d.ts +6 -0
- package/dist/src/session/history-recall-policy.js +48 -0
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/resource-scope.js +2 -2
- package/dist/src/tasks/capabilities/management.js +3 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +12 -3
- package/dist/src/tasks/index.js +1 -1
- package/dist/src/tui/backend-services.d.ts +14 -0
- package/dist/src/tui/backend-services.js +67 -0
- package/dist/src/tui/backends/embedded-backend.d.ts +48 -4
- package/dist/src/tui/backends/embedded-backend.js +249 -43
- package/dist/src/tui/backends/gateway-realtime-backend.d.ts +46 -2
- package/dist/src/tui/backends/gateway-realtime-backend.js +205 -62
- package/dist/src/tui/components/chat-log.d.ts +1 -0
- package/dist/src/tui/components/chat-log.js +11 -5
- package/dist/src/tui/components/scoped-models-selector.js +1 -1
- package/dist/src/tui/components/session-selector.js +1 -1
- package/dist/src/tui/components/text-viewer.d.ts +32 -0
- package/dist/src/tui/components/text-viewer.js +132 -0
- package/dist/src/tui/components/tui-bottom-bar.js +3 -0
- package/dist/src/tui/extension-host/autocomplete.js +9 -1
- package/dist/src/tui/extension-host/runtime.d.ts +1 -0
- package/dist/src/tui/extension-host/runtime.js +1 -0
- package/dist/src/tui/tui-backend.d.ts +36 -3
- package/dist/src/tui/tui-capabilities.d.ts +15 -0
- package/dist/src/tui/tui-capabilities.js +46 -0
- package/dist/src/tui/tui-capability-controls.d.ts +9 -0
- package/dist/src/tui/tui-capability-controls.js +250 -0
- package/dist/src/tui/tui-clarification.d.ts +15 -0
- package/dist/src/tui/tui-clarification.js +91 -0
- package/dist/src/tui/tui-command-formatters.d.ts +0 -4
- package/dist/src/tui/tui-command-formatters.js +3 -43
- package/dist/src/tui/tui-commands.d.ts +4 -4
- package/dist/src/tui/tui-commands.js +219 -127
- package/dist/src/tui/tui-control-commands.d.ts +12 -0
- package/dist/src/tui/tui-control-commands.js +127 -0
- package/dist/src/tui/tui-image-files.d.ts +2 -0
- package/dist/src/tui/tui-image-files.js +47 -0
- package/dist/src/tui/tui-local-shell.d.ts +6 -0
- package/dist/src/tui/tui-local-shell.js +36 -2
- package/dist/src/tui/tui-management.d.ts +114 -0
- package/dist/src/tui/tui-management.js +233 -0
- package/dist/src/tui/tui-picker-overlay.d.ts +1 -6
- package/dist/src/tui/tui-picker-overlay.js +1 -62
- package/dist/src/tui/tui-session-actions.d.ts +1 -0
- package/dist/src/tui/tui-session-actions.js +97 -29
- package/dist/src/tui/tui-settings.js +1 -1
- package/dist/src/tui/tui-side-chat.d.ts +10 -0
- package/dist/src/tui/tui-side-chat.js +56 -0
- package/dist/src/tui/tui-terminal.d.ts +3 -0
- package/dist/src/tui/tui-terminal.js +52 -0
- package/dist/src/tui/tui-types.d.ts +4 -1
- package/dist/src/tui/tui.js +422 -211
- package/dist/src/tui/xopc-tui-keybindings.d.ts +29 -9
- package/dist/src/tui/xopc-tui-keybindings.js +27 -7
- package/dist/src/usage/recorder.js +2 -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/voice/realtime/persona-context.js +1 -1
- package/dist/src/work-discovery/service.js +1 -1
- package/package.json +2 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CZ78ckHR.js +0 -8
- package/dist/gateway/static/root/assets/connected-providers-grid-CgULhOBZ.js +0 -1
- package/dist/gateway/static/root/assets/extension-authoritative-grants-8ONVOjPW.js +0 -1
- package/dist/gateway/static/root/assets/extension-iframe-host-D0-OvFV2.js +0 -1
- package/dist/gateway/static/root/assets/extension-message-router-DboLTCVp.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B6T1Xzag.js +0 -1
- package/dist/gateway/static/root/assets/index-B49yIcMR.css +0 -1
- package/dist/gateway/static/root/assets/local-apps-CB-MZAaL.js +0 -1
- package/dist/gateway/static/root/assets/messages-DPLud9GK.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-Ds4M9fJJ.js +0 -1
- package/dist/gateway/static/root/assets/oauth-provider-connect-cvxtmf3C.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-Xe8CP_4a.js +0 -1
- package/dist/gateway/static/root/assets/personal-profile-settings-KvdNnaNv.js +0 -1
- package/dist/gateway/static/root/assets/providers-api-BSmKlQ8K.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cy7xeKmH.js +0 -1
- package/dist/gateway/static/root/assets/tool-friendly-title-YQmN1S2k.js +0 -2
- package/dist/gateway/static/root/assets/understanding-refresh-store-BxtpXRfV.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-DmmJODQ4.js +0 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-pVOYuH7u.js +0 -1
|
@@ -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 { executeAtomicOperation } from "../../capabilities/runtime/atomic-operations.js";
|
|
7
|
+
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
8
|
+
import { learningRoleSql, learningTranscriptMessage } from "../../memory-learning/transcript-source.js";
|
|
9
|
+
import { inferMemorySensitivity } from "../memory/sensitivity.js";
|
|
10
|
+
import { canUseKnowledge, knowledgeContentSources } from "../../knowledge-memory/usage-policy.js";
|
|
11
|
+
import { deleteKnowledgeItem, getKnowledgeItem, reviewKnowledgeItem, setKnowledgeScope, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
12
|
+
import "../../knowledge-memory/index.js";
|
|
13
|
+
import { isUnquotedOwnerEvidence } from "../../memory-learning/owner-directive.js";
|
|
14
|
+
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../user-model/repository.js";
|
|
15
|
+
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
16
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
17
|
+
import { getSessionInteractionPolicy } from "../session/interaction-policy.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 };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { CapabilityDispatcher } from "../../capabilities/runtime/dispatcher.js";
|
|
1
2
|
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
2
3
|
import { getEmbeddedExecutionSession } from "../embedded/execution-context.js";
|
|
3
4
|
import { LOCAL_READ_MAX_CHARS } from "./local-read-budget.js";
|
|
4
|
-
import { CapabilityDispatcher } from "../../capabilities/runtime/dispatcher.js";
|
|
5
5
|
import { registerNoteReadCapabilities } from "../../notes/capabilities/read.js";
|
|
6
|
-
import { registerProjectReadCapabilities } from "../../projects/capabilities/read.js";
|
|
7
6
|
import { registerAutomationReadCapabilities } from "../../automations/capabilities/read.js";
|
|
7
|
+
import { registerProjectReadCapabilities } from "../../projects/capabilities/read.js";
|
|
8
8
|
import { Type } from "@sinclair/typebox";
|
|
9
9
|
//#region src/agent/tools/personal-read-tool.ts
|
|
10
10
|
const schema = Type.Object({
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { turnOutcomeKindFromFileName, turnOutcomeMimeTypeFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
3
4
|
import { fileResourceId, fileSpaceId } from "../../files/file-service.js";
|
|
4
5
|
import { evaluateFilePolicy } from "../sandbox/exec-policy.js";
|
|
5
6
|
import { readWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
6
|
-
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
7
7
|
import { persistToolMedia } from "./tool-media.js";
|
|
8
8
|
import { basename, isAbsolute, relative, sep } from "node:path";
|
|
9
9
|
import { Type } from "@sinclair/typebox";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
1
2
|
import { checkedFilePath, readWorkspaceFileAsync } from "../sandbox/fileAccess.js";
|
|
2
3
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
3
4
|
import { dataScheduler } from "../data-acquisition/scheduler.js";
|
|
4
5
|
import { formatSize, truncateHead } from "./truncate.js";
|
|
5
|
-
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
6
6
|
import { stat } from "fs/promises";
|
|
7
7
|
import { Type } from "@sinclair/typebox";
|
|
8
8
|
//#region src/agent/tools/read.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { turnOutcomeKindFromFileName } from "../../../packages/gateway-contract/src/turn-outcome.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
3
|
import { MEDIA_MAX_BYTES } from "../../media/store.js";
|
|
4
|
+
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
4
5
|
import { readWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
5
6
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
6
|
-
import { resolvePathUnderWorkspace } from "./tool-paths.js";
|
|
7
7
|
import { persistToolMedia } from "./tool-media.js";
|
|
8
8
|
import { basename } from "node:path";
|
|
9
9
|
import { Type } from "@sinclair/typebox";
|
|
@@ -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,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
3
4
|
import { fileResourceId, fileSpaceId } from "../../files/file-service.js";
|
|
4
5
|
import { writeWorkspaceFile } from "../sandbox/fileAccess.js";
|
|
5
6
|
import { checkFileSafety } from "../prompt/safety.js";
|
|
6
|
-
import { isBareProfileMarkdownFileName, resolvePathUnderWorkspace, resolveProfileMarkdownPathIfBareName } from "./tool-paths.js";
|
|
7
7
|
import { basename, relative, sep } from "path";
|
|
8
8
|
import { realpath } from "fs/promises";
|
|
9
9
|
import { Type } from "@sinclair/typebox";
|
|
@@ -11,27 +11,27 @@ import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
|
11
11
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
12
12
|
import "../../storage/sqlite/index.js";
|
|
13
13
|
import "../../activity/index.js";
|
|
14
|
+
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
15
|
+
import "../../capabilities/runtime/dispatcher.js";
|
|
14
16
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
15
17
|
import { hasUnlocalizedTaskText, resolveTaskLocale } from "../../tasks/task-language.js";
|
|
16
18
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
17
19
|
import { TaskOriginRepository } from "../../tasks/task-origin-repository.js";
|
|
18
20
|
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
19
21
|
import { TaskCollaborationRepository } from "../../tasks/task-collaboration-repository.js";
|
|
20
|
-
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
21
22
|
import { getAutomationSetup } from "../../automations/configuration-conversation.js";
|
|
22
23
|
import { getEmbeddedExecutionRunId } from "../embedded/execution-context.js";
|
|
23
|
-
import "../../capabilities/runtime/dispatcher.js";
|
|
24
24
|
import { AutomationMcpSourceInput, prepareAutomationMcpSource } from "../../automations/mcp-source.js";
|
|
25
|
-
import {
|
|
25
|
+
import { AutomationCreateCapabilityInputSchema, AutomationUpdatePatchSchema } from "../../automations/capabilities/write.js";
|
|
26
26
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
27
|
-
import { TaskDeletionService } from "../../tasks/task-deletion-service.js";
|
|
28
|
-
import { TaskDeleteOutputSchema } from "../../tasks/capabilities/management.js";
|
|
29
27
|
import "../../projects/index.js";
|
|
30
28
|
import { parseTaskHandoffReferences } from "../../tasks/task-handoff.js";
|
|
31
29
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
32
|
-
import { AutomationCreateCapabilityInputSchema, AutomationUpdatePatchSchema } from "../../automations/capabilities/write.js";
|
|
33
30
|
import { resolveResponseLanguageForSession } from "../prompt/response-language.js";
|
|
34
31
|
import { TaskMutationOutputSchema } from "../../tasks/capabilities/write.js";
|
|
32
|
+
import { TaskDeletionService } from "../../tasks/task-deletion-service.js";
|
|
33
|
+
import { TaskDeleteOutputSchema } from "../../tasks/capabilities/management.js";
|
|
34
|
+
import { localAppCapabilities } from "../../local-apps/capabilities/runtime.js";
|
|
35
35
|
import { createProductDispatcher } from "../../capabilities/runtime/product.js";
|
|
36
36
|
import { getDelegationScope } from "../orchestration/delegation-scope.js";
|
|
37
37
|
import { defineTaskContract } from "../../tasks/task-contract-definition.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AgentEntrySchema, AgentProfileSchema, EffectiveAgentConfigSchema } from "../agent-config/schema.js";
|
|
2
2
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
3
|
import { init_agent_config } from "../agent-config/index.js";
|
|
4
|
-
import { AgentCatalogRepository, init_repository } from "./repository.js";
|
|
5
|
-
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
6
4
|
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
7
5
|
import { defineAtomicCapability, defineReadCapability } from "../capabilities/runtime/dispatcher.js";
|
|
6
|
+
import { AgentCatalogRepository, init_repository } from "./repository.js";
|
|
7
|
+
import { init_agent_scope, resolveAgentWorkspaceDir } from "../agent/agent-scope.js";
|
|
8
8
|
import { AgentCatalogService } from "./service.js";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
//#region src/agent-catalog/capabilities.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
3
|
-
import { DEFAULT_AGENT_ID, init_id, normalizeAgentId } from "./id.js";
|
|
4
3
|
import { AgentDefaultsSchema, AgentEntrySchema, DEFAULT_AGENT_MODEL_REF, DEFAULT_SKILL_POLICY } from "../agent-config/schema.js";
|
|
5
4
|
import { init_agent_config } from "../agent-config/index.js";
|
|
5
|
+
import { DEFAULT_AGENT_ID, init_id, normalizeAgentId } from "./id.js";
|
|
6
6
|
import { BindingsSchema, init_binding_schema } from "../routing/binding-schema.js";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
//#region src/agent-catalog/repository.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AutomationCancelOutputSchema, AutomationDeleteOutputSchema, AutomationMutationOutputSchema, AutomationReadAllOutputSchema, AutomationReadOutputSchema, AutomationRunMutationOutputSchema, ProductReadContracts } from "../../../packages/gateway-contract/src/capabilities.js";
|
|
2
2
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
3
|
-
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
4
3
|
import { CapabilityError } from "../../capabilities/runtime/errors.js";
|
|
5
|
-
import { getAutomationSetup, openAutomationConfiguration } from "../configuration-conversation.js";
|
|
6
4
|
import "../../capabilities/runtime/dispatcher.js";
|
|
5
|
+
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
6
|
+
import { getAutomationSetup, openAutomationConfiguration } from "../configuration-conversation.js";
|
|
7
7
|
import { capabilityHttpContext, capabilityHttpError } from "../../capabilities/adapters/http.js";
|
|
8
8
|
import { createAutomationDispatcher } from "./dispatcher.js";
|
|
9
9
|
import { randomUUID } from "node:crypto";
|