@xopcai/xopc 0.0.466 → 0.0.468
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-CdEua6PR.js → activity-store-DKP2sWTJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-l8GQ4I9J.js → agent-avatar-dicebear-BR85bT1W.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-BO1bqKlR.js → agent-avatar-display-CIsejg_E.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Dj_H2kDD.js → agent-defaults-settings-panel-CxLUEl0V.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-BQA2brAU.js → agent-plugin-dialog-Cvj04Ckm.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-C5C5l13A.js → agents-CIV2R_El.js} +3 -3
- package/dist/gateway/static/root/assets/{agents-admin-api-DZ1lLnrj.js → agents-admin-api-BL8lN8gP.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DDWYNF7I.js → api-Cl08_xtM.js} +1 -1
- package/dist/gateway/static/root/assets/{api-DVXcGKP-.js → api-V4P8zfkJ.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-B5-7E03Z.js → app-management-settings-panel-CAEry5Vu.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-E_BcjEDM.js → appearance-settings-CphsmJgM.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BjB_mjXu.js → apps-page-CncU5JvR.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-MvSiDvxK.js → archive-plugin-DS6JWBPZ.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-24NjW7qG.js → automation-api-GcRQ9wM4.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-C94Q3OEL.js → automation-result-state-Dcp0JX0w.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-BShRirWV.js → automation-run-list-BLejrWpG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-task-card-Bgq5Plux.js → automation-task-card-sR61FFLn.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-_apIsCPT.js → automations-page-BNzj3R7A.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-WmcQUi9O.js → automations-workspace-BWpA-X_S.js} +2 -2
- package/dist/gateway/static/root/assets/{binary-plugins-C7i5pqkO.js → binary-plugins-BjEE5sVq.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-DAWXPErA.js → block-editor-B4Yqbxab.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-DI2PYAPC.js → browser-settings-page-Dd2eTtvL.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Dyw8xW90.js → capabilities-CBSMm_jo.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-CFWTer_v.js → capabilities-EmBa4Blq.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-C2RB9fzC.js → capabilities-page-BQf7oyqc.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-hlByP8SE.js +8 -0
- package/dist/gateway/static/root/assets/{channels-DiDfjON8.js → channels-oyMymJDx.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-agents-api-BksS0CNy.js → chat-agents-api-Bim8--J9.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-aZIklMNN.js → chat-chart-block-CS-cORJt.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-hcsqrv-7.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B4HoRIzf.js → chat-terminal-dock-D6LH3W5H.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-VhBEUFmw.js → command-palette-api-DPtCt8Je.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-BhRAbdPW.js → composer-model-config-control-BF9PPSiu.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-nT-U6jcc.js → composer-notifications-B0IZsy8x.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-xEFHDnLo.js → composer-payload-handoff-CRCz17sd.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DXlH96m6.js → computer-settings-page-CtfitoMZ.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-D8vBFsbY.js → connected-providers-grid-CxeXJKxg.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-C8jPm7QO.js → connection-usage-guide-CM5qgMcK.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-B42yWHxS.js → connector-service-page-Bsec3-eZ.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-so2a7xrD.js → connectors-api-BUdH4tZQ.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-yhOZIiUZ.js → connectors-page-C0ZCUtxF.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-UEh3JM7r.js → date-picker-DRSq2kDz.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-Dci0LfAU.js → date-time-picker--LGC1D3b.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BAU_GuBe.js → desktop-pet-1oXlQvjH.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CYE2eTTf.js → desktop-pet-settings-GdOjz7W9.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-C7v4CIlF.js → dev-view-store-DnQ2nBtV.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-7NDkYmiZ.js → device-pairing-wizard-diuSsk-H.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-DmRZY8kg.js → directory-picker-path-field-DBe_paLy.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-DIeg1mg8.js → extension-authoritative-grants-CVQ7q0DU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-D8TAJgZ_.js → extension-debug-page-DrpE2lQ3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-CjfRKtQ4.js → extension-iframe-host-hr60GwXQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-V1oFBxVi.js → extension-marketplace-api-baFXdV56.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-DZahH1Hd.js → extension-message-router-aoF3x4-X.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DMuHBIHa.js → extension-page-BfM8zli6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-lqJ1zIkA.js → extension-provider-BcSgVeKW.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-D5IfKVff.js → extension-settings-page-Db5t2Mz0.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-B7B9qXm9.js → file-preview-surface-CeFFZo3a.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-Dk3FtNv1.js → gateway-config-swr-DVXDJNCI.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-DMvo4pAc.js → gateway-realtime-BnwNxbyc.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-BpnGXAhi.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-C2h5R1eP.js → gateway-restart-Bws2Shaz.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DGPaikv5.js → gateway-settings-BU5Cp4Bw.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-yZn7ShiP.js → gateway-startup-retry-2jU7zCyx.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-gsAa0Kj9.js → global-defaults-api-CNyJ0dGb.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-Dgopm60U.js → home-page-DsS2UT08.js} +3 -3
- package/dist/gateway/static/root/assets/{image-generation-api-DPn1SBMH.js → image-generation-api-CiqQSx5j.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Cc48Uq20.js → imports-page-B9JMNXwt.js} +1 -1
- package/dist/gateway/static/root/assets/index-DFa0pZhC.js +11 -0
- package/dist/gateway/static/root/assets/index-DHPaL7Ku.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-QkJMw_uW.js → install-connector-dialog-0_PeJJqO.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BZXqXuI4.js → keyboard-shortcuts-settings-A37hYJtR.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-wekatwet.js → local-app-workbench-page-OSinc6m6.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-D-bRvlZY.js → local-apps-page-yBqRl5Bi.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CZ19DRRK.js → local-session-drafts-CgAuYyKi.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DIBIYLnI.js → locale-store-Cit_aHqC.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-CukseY3k.js → logs-page-BJxQ_Jd5.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-EG5duPec.js → management-api-DG-yZnHK.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-B7RWHrwo.js → management-settings-D9HGIYXx.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-C30KvTaE.js → markdown-view-CiGdWuN3.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-BZ1PDTYY.js → mcp-conversation-setup-page-YvPXchDz.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DlMEwcS8.js → media-plugins-C2lp7UmI.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DQveK9sk.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-COGICRIG.js → model-selector-Cg2kTsE7.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-aRYHi2dh.js → models-hub-cache-CmdULYFt.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-yAPC_cZU.js → note-detail-panel-CVEG1JdF.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-WA8FiHsm.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-BXevQivV.js → notes-api-BQXOYFQ5.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CUMhjKKd.js → notes-page-Cc-c1Yhg.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-enDU_32p.js → oauth-api-Bz_PU9R_.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-C2pfvPOI.js → oauth-provider-connect-BW7zcXfb.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-BaSooYGv.js → page-context-capture-button-Cw58-5P3.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-4-3RtO0q.js → page-context-draft-BjbX5zd7.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-DwFwq_lI.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BPQpvC34.js → personal-avatar-B-Oes3ef.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DWPu-iwK.js +1 -0
- package/dist/gateway/static/root/assets/{personal-profile-settings-DwMdjQ6H.js → personal-profile-settings-CDrzvI35.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-DiNpP_g3.js → personal-settings-panel-CoZ3qWSr.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-DUT-qRLZ.js → phone-dependencies-card-CJ3ovsW1.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-pvOciDNo.js → phone-model-connection-UHVwbC3H.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-CD97E6C5.js → phone-model-picker-CNTcpY1A.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-BUZ1dh7s.js → phone-settings-page-fS2IT-dK.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-BwilERgv.js → phone-workspace-store-CKOW55gy.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-C_uOVmJv.js → plugin-details-dialog-BDoSffLO.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-BSUgcO7-.js → preference-select-fields-BKmzpfHq.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-BlwtlUY7.js → product-automation-feedback-DrBclzH1.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-Dy6D5exJ.js → product-open-page-BMJ2x5m3.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-DEUPAilo.js → product-preview-content-lkkZPvMa.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-modal-C4TV9RUd.js → product-preview-modal-DtUBJGs5.js} +2 -2
- package/dist/gateway/static/root/assets/{project-detail-page-BjOzJyw1.js → project-detail-page-DGFUj6jS.js} +1 -1
- package/dist/gateway/static/root/assets/{project-understanding-lOJ5Tz2V.js → project-understanding-Dv26vu9S.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-B3aGdPHy.js → projects-page-Dua6taaG.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-C26HgxZY.js → providers-api-B6eZLEnh.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-BJkXktA-.js → recording-upload-DXxD6grq.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-pQ0eInzG.js → registry-api-BEnvt9-6.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-CjWrYzjf.js → remote-access-hub-Dy3-oGK1.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-Y9WRHOnz.js → resource-unavailable-fk26VrOL.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-DHHyicqQ.js → right-workspace-store-BzXnZDK5.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-8KCgPcjp.js +2 -0
- package/dist/gateway/static/root/assets/{routine-panel-DSNsdpy8.js → routine-panel-BALhliq6.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-BoJQ3u5o.js → runtime-tools-api-CL6CG-qq.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DB7cfLrX.js → runtime-tools-settings-panel-CdvQRxCR.js} +1 -1
- package/dist/gateway/static/root/assets/{service-recommendation-list-_rFmwIwY.js → service-recommendation-list-CsU74h1b.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-a6wb0_Gf.js → session-api-CkOliupg.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-Cby6Nkib.js +25 -0
- package/dist/gateway/static/root/assets/{sessions-page-dEupc-3A.js → sessions-page-CN9ESZdY.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BYrXsPjK.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-CnGJr2xp.js → settings-advanced-section-Zex2dJo7.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-DWRhupcY.js → settings-mode-store-Dk0bZQgo.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-u-U9D9qT.js → settings-page-ByFNIBfp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-wL2jvs-y.js → settings-page-header-B9Y_eGcH.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BkUQVmyY.js → settings-page-layout-D1MgJ5zP.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-D238tuw-.js → setup-interaction-page-Bsn4Wa4p.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-DXvYjIu3.js → setup-status-panel-CstjOb7g.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-DFDJyl3N.js → share-link-dialog-BxFk4-4u.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BYPdlPIb.js → share-preview-page-9pOnypJv.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-CfFiW03g.js → shares-api-ChBHTPKN.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-B85XIDFv.js → shares-settings-CJdVDQqf.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CWRhFSkA.js → skill-api-TQAyWHGS.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-CmPp2czp.js → skill-list-api-D4eokPXx.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BGsSq3dj.js → skill-reload-api-Bm-8vhsQ.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DqD0FPeH.js → skills-page-CkkHufmv.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-aw9C86I8.js → system-settings-panel-CvL5G2w1.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-BPHt6S1V.js → task-detail-page-BjBkKeIf.js} +1 -1
- package/dist/gateway/static/root/assets/{task-result-evidence-C-zIBpzi.js → task-result-evidence-dtN1sSjU.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-CgPqgrm7.js → terminal-panel-store-B1bAD5Xf.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DxF7S6I2.js → theme-store-C1MxmBg7.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-Dvlunx28.js → tracing-settings-page-CvXDgIJQ.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-CIte6n0U.js → tunnel-api-BkhCBt38.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-C2RHmRo8.js → understanding-activity-store-BYGCmCVb.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CPeQIXS_.js → understanding-refresh-store-DaLVsdYS.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-DPUjEj39.js → usage-page-C-NM6vtY.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-xX2KrbXw.js → use-autosave-CvjQMyY8.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-UhypPQH_.js → use-composer-attachments-BEYkb8cs.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-BvEF3yHL.js → use-file-preview-expanded-CQeo2Ztn.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-BJgaheR4.js → use-personal-profile-CKm5FaTl.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-RQW5KnIN.js → use-realtime-voice-lRHVixh4.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-B6QFV5gR.js → use-workspace-tree-DrWnW1aA.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-hKnsTcMk.js → user-model-page-Bw1_PGdD.js} +1 -1
- package/dist/gateway/static/root/assets/video-generation-D08uZbsu.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-BeEF7Thh.js → voice-api-key-field-M7KB_Gl1.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-vbBoKnqd.js → voice-config-api-BLGbUq3v.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-CKn6X3qL.js → voice-input-shortcut-events-CxH3RDXi.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-BUrk4mwV.js → voice-settings-CssuMBjt.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Ddvqu02U.js → work-discovery-overlay-DcZS4OMj.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-BdBpri6P.js → work-discovery-page-CZF9iWPT.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-DStgfCzQ.js → working-directory-picker-modal-W2QiUVjN.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-CscTRODe.js → workspace-api-BfApIXLw.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-DwpWKogz.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BRQIf4sc.js → workspace-file-preview-dialog-BRhsCs1S.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-CBHFZ2iQ.js → workspace-open-location-menu-Dh0TvTkH.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-DNLnuHlf.js → workspace-preview-store-BrofEVle.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-Cm0Saa8B.js → xopc-cloud-account-card-DGAGXbGI.js} +1 -1
- package/dist/gateway/static/root/index.html +89 -90
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/music-generation.js +9 -0
- package/dist/src/agent/background-review/prompts.js +5 -1
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +1 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +5 -1
- package/dist/src/agent/prompt/sections/tooling.js +4 -0
- package/dist/src/agent/tools/factory.js +14 -1
- package/dist/src/agent/tools/music-generation-tool.d.ts +11 -0
- package/dist/src/agent/tools/music-generation-tool.js +70 -0
- package/dist/src/agent/tools/personal-memory-tool.js +12 -10
- package/dist/src/agent/tools/toolExposure.js +2 -0
- package/dist/src/agent/tools/video-draft-tool.d.ts +13 -0
- package/dist/src/agent/tools/video-draft-tool.js +79 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +9 -1
- package/dist/src/gateway/hono/routes/media.js +1 -20
- package/dist/src/gateway/hono/routes/memory-learning.js +19 -3
- package/dist/src/gateway/hono/routes/models.js +7 -0
- package/dist/src/gateway/hono/routes/music-generation.d.ts +3 -0
- package/dist/src/gateway/hono/routes/music-generation.js +80 -0
- package/dist/src/gateway/hono/routes/video-generation.js +51 -26
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +4 -1
- package/dist/src/media-shared/http/byte-range.d.ts +6 -0
- package/dist/src/media-shared/http/byte-range.js +23 -0
- package/dist/src/memory-learning/work-capture.js +2 -1
- package/dist/src/memory-learning/work-review.d.ts +2 -0
- package/dist/src/memory-learning/work-review.js +25 -2
- package/dist/src/music-generation/artifact.d.ts +5 -0
- package/dist/src/music-generation/artifact.js +105 -0
- package/dist/src/music-generation/mureka.d.ts +3 -0
- package/dist/src/music-generation/mureka.js +96 -0
- package/dist/src/music-generation/provider.d.ts +34 -0
- package/dist/src/music-generation/provider.js +9 -0
- package/dist/src/music-generation/providers.d.ts +28 -0
- package/dist/src/music-generation/providers.js +68 -0
- package/dist/src/music-generation/repository.d.ts +52 -0
- package/dist/src/music-generation/repository.js +106 -0
- package/dist/src/music-generation/settings.d.ts +7 -0
- package/dist/src/music-generation/settings.js +24 -0
- package/dist/src/music-generation/tencent-mps.d.ts +11 -0
- package/dist/src/music-generation/tencent-mps.js +151 -0
- package/dist/src/music-generation/worker.d.ts +8 -0
- package/dist/src/music-generation/worker.js +126 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +3 -1
- package/dist/src/personal-agent/prompts.js +3 -1
- package/dist/src/session/store.js +9 -2
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +32 -0
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +8 -1
- package/dist/src/storage/sqlite/upgrades/277_music_generation.sql +30 -0
- package/dist/src/storage/sqlite/upgrades/278_music_job_error_code.sql +6 -0
- package/dist/src/user-model/action-rule-suggestions.js +4 -3
- package/dist/src/user-model/capture/evidence-policy.d.ts +7 -1
- package/dist/src/user-model/capture/evidence-policy.js +68 -2
- package/dist/src/user-model/capture/executor.js +62 -14
- package/dist/src/video-generation/drafts.d.ts +18 -0
- package/dist/src/video-generation/drafts.js +91 -0
- package/dist/src/video-generation/repository.d.ts +5 -3
- package/dist/src/video-generation/repository.js +22 -7
- package/dist/src/video-generation/worker.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/api-CG-SjNfw.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DuQGhgAl.js +0 -8
- package/dist/gateway/static/root/assets/chat-page-BMZwIVXH.js +0 -71
- package/dist/gateway/static/root/assets/gateway-realtime-store-CJf-qaHZ.js +0 -1
- package/dist/gateway/static/root/assets/index-BE3XMuQI.js +0 -11
- package/dist/gateway/static/root/assets/index-CY5vdQcc.css +0 -1
- package/dist/gateway/static/root/assets/messages-BDBGlBKh.js +0 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-CxXu_Tkh.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-C2ydtnXa.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-POCG1_kK.js +0 -1
- package/dist/gateway/static/root/assets/route-preload-DjYsRhY1.js +0 -2
- package/dist/gateway/static/root/assets/session-manager-D5g6LOU-.js +0 -25
- package/dist/gateway/static/root/assets/settings-advanced-gate-DjyibJZ1.js +0 -1
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CyPjTDSx.js +0 -1
|
@@ -9,6 +9,7 @@ import { inferMemorySensitivity } from "../memory/sensitivity.js";
|
|
|
9
9
|
import { canUseKnowledge, knowledgeContentSources } from "../../knowledge-memory/usage-policy.js";
|
|
10
10
|
import { deleteKnowledgeItem, getKnowledgeItem, reviewKnowledgeItem, setKnowledgeScope, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
11
11
|
import "../../knowledge-memory/index.js";
|
|
12
|
+
import { ownerExcludesGlobalScope, ownerMemoryScope, standingToolScope } from "../../user-model/capture/evidence-policy.js";
|
|
12
13
|
import { isUnquotedOwnerEvidence } from "../../memory-learning/owner-directive.js";
|
|
13
14
|
import { deleteUserAssertion, getAssertionSlot, getUserAssertion, reconcileAssertion, setAssertionStatus, setUserAssertionScope } from "../../user-model/repository.js";
|
|
14
15
|
import { canUseAssertion } from "../../user-model/usage-policy.js";
|
|
@@ -91,7 +92,7 @@ function explicitRequest(text, quote, command) {
|
|
|
91
92
|
const author = text.replace(/```[\s\S]*?```|~~~[\s\S]*?~~~|^\s*>.*$/gmu, "").replace(/“[^”]*”|「[^」]*」|『[^』]*』|"[^"\n]*"/gu, (span) => /记住|保存|纠正|修改|remember|save|correct|scope/iu.test(span) ? "" : span);
|
|
92
93
|
if (!quote.trim() || !author.includes(quote.trim())) return false;
|
|
93
94
|
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 /纠正|修正|改成|改为|修改|更正|不是|仅|只(?:在|用|对)
|
|
95
|
+
return /纠正|修正|改成|改为|修改|更正|不是|仅|只(?:在|用|对)|范围|所有|全局|跨项目|\b(?:correct|change|update|instead|only|scope|global|globally|all|across)\b/iu.test(quote) && !/(?:不要|别|不必)(?:再)?(?:修改|更正|纠正)|(?:don't|do not|never)\s+(?:change|correct|update)/iu.test(author);
|
|
95
96
|
}
|
|
96
97
|
/** Explicit owner mutations use the existing domain transactions and atomic operation receipts. */
|
|
97
98
|
function createPersonalMemoryTool(deps) {
|
|
@@ -99,7 +100,7 @@ function createPersonalMemoryTool(deps) {
|
|
|
99
100
|
name: "personal_memory",
|
|
100
101
|
label: "Manage memory",
|
|
101
102
|
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
|
|
103
|
+
description: "Remember, correct, forget, or change the scope of memory only on an explicit current owner request. Quote that request and its scope qualifiers in userEvidence. User identity, preferences and standing collaboration instructions use target=user. Project facts, decisions and lessons use target=knowledge. A tool instruction for all operations of one type is not an instruction for all projects. 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
104
|
async execute(_callId, raw) {
|
|
104
105
|
const fail = (error) => ({
|
|
105
106
|
content: [{
|
|
@@ -154,13 +155,13 @@ function createPersonalMemoryTool(deps) {
|
|
|
154
155
|
id
|
|
155
156
|
};
|
|
156
157
|
};
|
|
157
|
-
const requestedScope =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
if (
|
|
158
|
+
const requestedScope = ownerMemoryScope(text, input.userEvidence);
|
|
159
|
+
const localScope = requestedScope === "global" ? void 0 : requestedScope;
|
|
160
|
+
if (localScope && input.scope && localScope !== input.scope) return fail("requested_scope_mismatch");
|
|
161
|
+
const toolScope = input.command === "remember" ? standingToolScope(text, input.userEvidence, Boolean(context.projectId)) : void 0;
|
|
162
|
+
if (toolScope && input.target === "knowledge") return fail("collaboration_instruction_requires_preference");
|
|
163
|
+
if (toolScope && input.scope && toolScope !== input.scope || requestedScope === "global" && input.command === "remember" && input.scope && input.scope !== "global") return fail("requested_scope_mismatch");
|
|
164
|
+
if (input.command === "scope" && input.scope === "global" && requestedScope !== "global") return fail("explicit_global_scope_required");
|
|
164
165
|
const digest = createHash("sha256").update(JSON.stringify(input)).digest("hex");
|
|
165
166
|
const receipt = executeAtomicOperation({
|
|
166
167
|
principalId: "local-owner",
|
|
@@ -184,8 +185,9 @@ function createPersonalMemoryTool(deps) {
|
|
|
184
185
|
} : knowledge)) throw new Error("memory_version_conflict_read_again");
|
|
185
186
|
} else if (input.id || input.version) throw new Error("remember_does_not_accept_existing_id");
|
|
186
187
|
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
|
+
const scope = input.command === "scope" ? input.scope ?? requestedScope ? resolveScope(input.scope ?? requestedScope) : void 0 : currentScope ?? resolveScope(input.scope ?? requestedScope ?? toolScope ?? (input.target === "user" && !ownerExcludesGlobalScope(text, input.userEvidence) ? "global" : context.projectId ? "project" : "workspace"));
|
|
188
189
|
if (!scope) throw new Error("scope_required");
|
|
190
|
+
if (scope.type === "global" && ownerExcludesGlobalScope(text, input.userEvidence)) throw new Error("requested_scope_mismatch");
|
|
189
191
|
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
192
|
if (input.command !== "scope" && input.command !== "remember" && input.scope) {
|
|
191
193
|
const suppliedScope = resolveScope(input.scope);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
declare const schema: import("@sinclair/typebox").TObject<{
|
|
3
|
+
action: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"create">, import("@sinclair/typebox").TLiteral<"update">, import("@sinclair/typebox").TLiteral<"revise">, import("@sinclair/typebox").TLiteral<"inspect">]>;
|
|
4
|
+
prompt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
5
|
+
summary: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
+
duration: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
7
|
+
ratio: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"16:9">, import("@sinclair/typebox").TLiteral<"9:16">, import("@sinclair/typebox").TLiteral<"adaptive">]>>;
|
|
8
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"480P">, import("@sinclair/typebox").TLiteral<"720P">, import("@sinclair/typebox").TLiteral<"1080P">]>>;
|
|
9
|
+
image: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"current">, import("@sinclair/typebox").TLiteral<"none">]>>;
|
|
10
|
+
imageUri: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare function createVideoDraftTool(getConversationId: () => string | undefined): AgentTool<typeof schema>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { getCurrentTranscriptId, init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
2
|
+
import { getVideoJob } from "../../video-generation/repository.js";
|
|
3
|
+
import { getVideoDraft, prepareVideoDraft, videoDraftImages } from "../../video-generation/drafts.js";
|
|
4
|
+
import { Type } from "@sinclair/typebox";
|
|
5
|
+
import { Value } from "@sinclair/typebox/value";
|
|
6
|
+
//#region src/agent/tools/video-draft-tool.ts
|
|
7
|
+
init_session_repository();
|
|
8
|
+
const schema = Type.Object({
|
|
9
|
+
action: Type.Union([
|
|
10
|
+
Type.Literal("create"),
|
|
11
|
+
Type.Literal("update"),
|
|
12
|
+
Type.Literal("revise"),
|
|
13
|
+
Type.Literal("inspect")
|
|
14
|
+
]),
|
|
15
|
+
prompt: Type.Optional(Type.String({ maxLength: 1e3 })),
|
|
16
|
+
summary: Type.Optional(Type.String({
|
|
17
|
+
maxLength: 180,
|
|
18
|
+
description: "A short description of the visible scene in the user’s language. Keep it in sync whenever the prompt changes."
|
|
19
|
+
})),
|
|
20
|
+
duration: Type.Optional(Type.Integer()),
|
|
21
|
+
ratio: Type.Optional(Type.Union([
|
|
22
|
+
Type.Literal("16:9"),
|
|
23
|
+
Type.Literal("9:16"),
|
|
24
|
+
Type.Literal("adaptive")
|
|
25
|
+
])),
|
|
26
|
+
resolution: Type.Optional(Type.Union([
|
|
27
|
+
Type.Literal("480P"),
|
|
28
|
+
Type.Literal("720P"),
|
|
29
|
+
Type.Literal("1080P")
|
|
30
|
+
])),
|
|
31
|
+
image: Type.Optional(Type.Union([Type.Literal("current"), Type.Literal("none")])),
|
|
32
|
+
imageUri: Type.Optional(Type.String({ maxLength: 512 }))
|
|
33
|
+
});
|
|
34
|
+
function createVideoDraftTool(getConversationId) {
|
|
35
|
+
return {
|
|
36
|
+
name: "video_draft",
|
|
37
|
+
label: "Prepare video draft",
|
|
38
|
+
description: "Prepare a video when the user asks to generate one in Web chat. Create a draft, update the pending draft, or revise the last submitted video as a new version. For a new draft, a single image in the current user message is used by default. An update or revision keeps its reference image unless the user requests another one; use image=current to switch to a new attachment. Use inspect to list recent images and the previous draft. Ask which image to use when the reference is ambiguous. Use video settings for any unspecified options. Provide a short scene summary alongside the full prompt. The draft appears as a card. When first presenting it, briefly tell the user they can click Confirm generation or reply “confirm video generation” / “就按这个生成”. This tool cannot start generation.",
|
|
39
|
+
parameters: schema,
|
|
40
|
+
async execute(_id, args) {
|
|
41
|
+
if (!Value.Check(schema, args)) throw new Error("Invalid video draft parameters.");
|
|
42
|
+
const conversationId = getConversationId();
|
|
43
|
+
if (!conversationId) throw new Error("Video drafts are available in Web chat.");
|
|
44
|
+
if (args.action === "inspect") {
|
|
45
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
46
|
+
const draft = transcriptId ? getVideoDraft(conversationId, transcriptId) : void 0;
|
|
47
|
+
const { recent } = videoDraftImages(conversationId);
|
|
48
|
+
return {
|
|
49
|
+
content: [{
|
|
50
|
+
type: "text",
|
|
51
|
+
text: JSON.stringify({
|
|
52
|
+
draft,
|
|
53
|
+
submitted: Boolean(draft && getVideoJob(conversationId, draft.id)),
|
|
54
|
+
images: recent.slice(0, 12).map(({ uri, name }) => ({
|
|
55
|
+
uri,
|
|
56
|
+
name
|
|
57
|
+
}))
|
|
58
|
+
})
|
|
59
|
+
}],
|
|
60
|
+
details: {}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
const { action, ...input } = args;
|
|
64
|
+
const draft = prepareVideoDraft(conversationId, {
|
|
65
|
+
action,
|
|
66
|
+
...input
|
|
67
|
+
});
|
|
68
|
+
return {
|
|
69
|
+
content: [{
|
|
70
|
+
type: "text",
|
|
71
|
+
text: JSON.stringify(draft)
|
|
72
|
+
}],
|
|
73
|
+
details: {}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
export { createVideoDraftTool };
|
|
@@ -31,7 +31,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
31
31
|
id: "database-schema",
|
|
32
32
|
label: "Database schema",
|
|
33
33
|
status: "pass",
|
|
34
|
-
message: `SQLite schema v${readSchemaVersion(getSqliteDatabase())} (current release
|
|
34
|
+
message: `SQLite schema v${readSchemaVersion(getSqliteDatabase())} (current release v278).`,
|
|
35
35
|
hints: []
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -184,9 +184,17 @@ const AUTHENTICATED_LAZY_ROUTE_BUNDLES = [
|
|
|
184
184
|
return { register: registerRuntimeToolsRoutes };
|
|
185
185
|
}
|
|
186
186
|
},
|
|
187
|
+
{
|
|
188
|
+
id: "music-generation",
|
|
189
|
+
match: (path) => /^\/api\/music-generation\/settings(?:\/credentials\/[^/]+)?$/.test(path) || /^\/api\/music-generation\/sessions\/[^/]+\/jobs(?:\/[0-9a-f]{64}\/audio)?$/.test(path),
|
|
190
|
+
load: async () => {
|
|
191
|
+
const { registerMusicGenerationRoutes } = await import("./music-generation.js");
|
|
192
|
+
return { register: registerMusicGenerationRoutes };
|
|
193
|
+
}
|
|
194
|
+
},
|
|
187
195
|
{
|
|
188
196
|
id: "video-generation",
|
|
189
|
-
match: (path) => path === "/api/video-generation/settings" || /^\/api\/video-generation\/sessions\/[^/]+\/jobs(?:\/[^/]+\/video)?$/.test(path),
|
|
197
|
+
match: (path) => path === "/api/video-generation/settings" || /^\/api\/video-generation\/sessions\/[^/]+\/jobs(?:\/confirm-draft|\/[^/]+\/video)?$/.test(path),
|
|
190
198
|
load: async () => {
|
|
191
199
|
const { registerVideoGenerationRoutes } = await import("./video-generation.js");
|
|
192
200
|
return { register: registerVideoGenerationRoutes };
|
|
@@ -1,30 +1,11 @@
|
|
|
1
1
|
import { MEDIA_ARTIFACT_MAX_BYTES, mimeTypeFromMediaPath, saveMediaBuffer } from "../../../media/store.js";
|
|
2
2
|
import { readMediaReference } from "../../../media/media-reference.js";
|
|
3
3
|
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../../chat-limits.js";
|
|
4
|
+
import { parseByteRange } from "../../../media-shared/http/byte-range.js";
|
|
4
5
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
5
6
|
import { resolveScopedMediaReference } from "../../media-access.js";
|
|
6
7
|
//#region src/gateway/hono/routes/media.ts
|
|
7
8
|
const log = createGatewayRouteLogger("Media");
|
|
8
|
-
function parseByteRange(header, size) {
|
|
9
|
-
if (!header) return null;
|
|
10
|
-
const match = /^bytes=(\d*)-(\d*)$/i.exec(header.trim());
|
|
11
|
-
if (!match || !match[1] && !match[2] || size <= 0) return "invalid";
|
|
12
|
-
if (!match[1]) {
|
|
13
|
-
const suffixLength = Number(match[2]);
|
|
14
|
-
if (!Number.isSafeInteger(suffixLength) || suffixLength <= 0) return "invalid";
|
|
15
|
-
return {
|
|
16
|
-
start: Math.max(0, size - suffixLength),
|
|
17
|
-
end: size - 1
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
const start = Number(match[1]);
|
|
21
|
-
const requestedEnd = match[2] ? Number(match[2]) : size - 1;
|
|
22
|
-
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(requestedEnd) || start < 0 || start >= size || requestedEnd < start) return "invalid";
|
|
23
|
-
return {
|
|
24
|
-
start,
|
|
25
|
-
end: Math.min(requestedEnd, size - 1)
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
9
|
function registerMediaRoutes(authenticated, deps) {
|
|
29
10
|
authenticated.post("/api/media", deps.strictRateLimitMiddleware, async (c) => {
|
|
30
11
|
const file = (await c.req.formData().catch(() => null))?.get("file");
|
|
@@ -9,6 +9,7 @@ import { canUseKnowledge, knowledgeExclusion } from "../../../knowledge-memory/u
|
|
|
9
9
|
import { getKnowledgeItem } from "../../../knowledge-memory/repository.js";
|
|
10
10
|
import "../../../knowledge-memory/index.js";
|
|
11
11
|
import { resolveEffectiveAgentProfileForSession } from "../../../config/agent-profile.js";
|
|
12
|
+
import { suggestWorkMemoryReview } from "../../../memory-learning/work-review.js";
|
|
12
13
|
//#region src/gateway/hono/routes/memory-learning.ts
|
|
13
14
|
init_transaction();
|
|
14
15
|
init_session_repository();
|
|
@@ -61,14 +62,29 @@ function registerMemoryLearningRoutes(app, deps) {
|
|
|
61
62
|
conversationId: c.req.query("conversationId") ?? item?.sourceConversationId ?? "",
|
|
62
63
|
projectId: c.req.query("projectId") ?? (item?.scope.type === "project" ? item.scope.id : void 0)
|
|
63
64
|
};
|
|
64
|
-
if (!item
|
|
65
|
+
if (!item) return c.json({
|
|
65
66
|
error: "Knowledge evidence not available",
|
|
66
|
-
reason:
|
|
67
|
+
reason: "not_found"
|
|
67
68
|
}, 404);
|
|
69
|
+
const policy = resolveKnowledgeReadPolicy(deps.service.currentConfig.userContext.knowledgeMemory);
|
|
70
|
+
const reviewSuggestion = suggestWorkMemoryReview(item, context, policy);
|
|
71
|
+
if (!canUseKnowledge(item, context, policy)) {
|
|
72
|
+
if (reviewSuggestion) return c.json({
|
|
73
|
+
evidence: [],
|
|
74
|
+
reviewSuggestion
|
|
75
|
+
});
|
|
76
|
+
return c.json({
|
|
77
|
+
error: "Knowledge evidence not available",
|
|
78
|
+
reason: knowledgeExclusion(item, context, policy)
|
|
79
|
+
}, 404);
|
|
80
|
+
}
|
|
68
81
|
const evidence = getSqliteDatabase().prepare(`SELECT e.source_type AS sourceType, e.source_ref AS sourceRef,
|
|
69
82
|
e.observed_at AS observedAt, e.redacted_excerpt AS excerpt FROM knowledge_evidence_links l
|
|
70
83
|
JOIN context_evidence e ON e.evidence_id = l.evidence_id WHERE l.knowledge_id = ?`).all(item.id);
|
|
71
|
-
return c.json({
|
|
84
|
+
return c.json({
|
|
85
|
+
evidence,
|
|
86
|
+
reviewSuggestion
|
|
87
|
+
});
|
|
72
88
|
});
|
|
73
89
|
}
|
|
74
90
|
//#endregion
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import "../../../../packages/gateway-contract/src/music-generation.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
1
3
|
import { resolveModelsJsonPath } from "../../../config/paths.js";
|
|
2
4
|
import { getProviderSetupProfile, init_profiles } from "../../../providers/setup/profiles.js";
|
|
3
5
|
import { init_model_usage, withModelUsageOrigin } from "../../../providers/model-usage.js";
|
|
@@ -29,6 +31,7 @@ import { dismissXopcCloudOnboarding, getXopcCloudOnboardingStatus } from "../../
|
|
|
29
31
|
import { auditModelReferences } from "../../../providers/model-reference-auditor.js";
|
|
30
32
|
import { registerProviderSetupRoutes } from "./provider-setup.js";
|
|
31
33
|
//#region src/gateway/hono/routes/models.ts
|
|
34
|
+
init_src();
|
|
32
35
|
init_model_policy();
|
|
33
36
|
init_model_usage();
|
|
34
37
|
init_profiles();
|
|
@@ -825,6 +828,10 @@ function registerModelsRoutes(authenticated, deps) {
|
|
|
825
828
|
ok: false,
|
|
826
829
|
error: { message: "Manage Boson credentials in voice settings" }
|
|
827
830
|
}, 403);
|
|
831
|
+
if (providerId === "tencent-mps") return c.json({
|
|
832
|
+
ok: false,
|
|
833
|
+
error: { message: "Manage Tencent Cloud MPS credentials in music settings" }
|
|
834
|
+
}, 403);
|
|
828
835
|
const stored = await new CredentialResolver().revealGatewayStoredApiKey(providerId);
|
|
829
836
|
if (stored) return c.json({
|
|
830
837
|
ok: true,
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import "../../../../packages/gateway-contract/src/music-generation.js";
|
|
2
|
+
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
|
+
import { musicCredentials, saveMusicDefaults, saveMusicModel } from "../../../music-generation/settings.js";
|
|
4
|
+
import { parseTencentMpsCredentials, tencentMpsCredentialsSchema } from "../../../music-generation/tencent-mps.js";
|
|
5
|
+
import { configuredMusicModel, hasMusicProvider, readMusicModelSettings, resolveMusicModel } from "../../../music-generation/providers.js";
|
|
6
|
+
import { getMusicJob, listMusicJobs } from "../../../music-generation/repository.js";
|
|
7
|
+
import { readMusicArtifact } from "../../../music-generation/artifact.js";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
//#region src/gateway/hono/routes/music-generation.ts
|
|
10
|
+
init_src();
|
|
11
|
+
function registerMusicGenerationRoutes(app, deps) {
|
|
12
|
+
const settings = "/api/music-generation/settings";
|
|
13
|
+
const path = "/api/music-generation/sessions/:conversationId/jobs";
|
|
14
|
+
app.get(settings, async (c) => c.json(await readMusicModelSettings()));
|
|
15
|
+
app.put(settings, deps.strictRateLimitMiddleware, async (c) => {
|
|
16
|
+
const input = z.object({ modelRef: z.string().max(200) }).safeParse(await c.req.json().catch(() => null));
|
|
17
|
+
if (!input.success || !resolveMusicModel(input.data.modelRef)) return c.json({ error: "Unknown music model" }, 400);
|
|
18
|
+
saveMusicModel(input.data.modelRef);
|
|
19
|
+
return c.json(await readMusicModelSettings());
|
|
20
|
+
});
|
|
21
|
+
app.patch(settings, deps.strictRateLimitMiddleware, async (c) => {
|
|
22
|
+
const input = z.object({
|
|
23
|
+
modelRef: z.string().max(200),
|
|
24
|
+
mode: z.enum(["song", "instrumental"])
|
|
25
|
+
}).safeParse(await c.req.json().catch(() => null));
|
|
26
|
+
if (!input.success) return c.json({ error: "Invalid music defaults" }, 400);
|
|
27
|
+
const { modelRef, mode } = input.data;
|
|
28
|
+
if (!resolveMusicModel(modelRef)?.capabilities.modes.includes(mode)) return c.json({ error: "The selected model does not support this music mode" }, 400);
|
|
29
|
+
saveMusicDefaults(modelRef, { mode });
|
|
30
|
+
return c.json(await readMusicModelSettings());
|
|
31
|
+
});
|
|
32
|
+
app.put(`${settings}/credentials/:providerId`, deps.strictRateLimitMiddleware, async (c) => {
|
|
33
|
+
const providerId = c.req.param("providerId");
|
|
34
|
+
if (!hasMusicProvider(providerId)) return c.json({ error: "Unknown music provider" }, 400);
|
|
35
|
+
const body = await c.req.json().catch(() => null);
|
|
36
|
+
if (providerId === "tencent-mps") {
|
|
37
|
+
const input = tencentMpsCredentialsSchema.safeParse(body);
|
|
38
|
+
if (!input.success) return c.json({ error: "Enter a valid Tencent Cloud SecretId and SecretKey" }, 400);
|
|
39
|
+
await musicCredentials().saveApiKey(providerId, JSON.stringify(input.data));
|
|
40
|
+
} else {
|
|
41
|
+
const input = z.object({ apiKey: z.string().trim().min(1).max(4096).regex(/^[!-~]+$/) }).safeParse(body);
|
|
42
|
+
if (!input.success) return c.json({ error: "Invalid music API key" }, 400);
|
|
43
|
+
await musicCredentials().saveApiKey(providerId, input.data.apiKey);
|
|
44
|
+
}
|
|
45
|
+
return c.json(await readMusicModelSettings());
|
|
46
|
+
});
|
|
47
|
+
app.post(`${settings}/credentials/:providerId`, deps.strictRateLimitMiddleware, async (c) => {
|
|
48
|
+
const providerId = c.req.param("providerId");
|
|
49
|
+
if (providerId !== "tencent-mps") return c.json({ error: "Unknown music provider" }, 404);
|
|
50
|
+
const input = z.object({ field: z.enum(["secretId", "secretKey"]) }).safeParse(await c.req.json().catch(() => null));
|
|
51
|
+
if (!input.success) return c.json({ error: "Unknown credential field" }, 400);
|
|
52
|
+
const stored = parseTencentMpsCredentials(await musicCredentials().revealGatewayStoredApiKey(providerId));
|
|
53
|
+
c.header("Cache-Control", "no-store");
|
|
54
|
+
return c.json({ value: stored?.[input.data.field] ?? null });
|
|
55
|
+
});
|
|
56
|
+
app.delete(`${settings}/credentials/:providerId`, deps.strictRateLimitMiddleware, async (c) => {
|
|
57
|
+
const providerId = c.req.param("providerId");
|
|
58
|
+
if (!hasMusicProvider(providerId)) return c.json({ error: "Unknown music provider" }, 400);
|
|
59
|
+
await musicCredentials().deleteProfile(`${providerId}:default`);
|
|
60
|
+
return c.json(await readMusicModelSettings());
|
|
61
|
+
});
|
|
62
|
+
app.get(path, async (c) => {
|
|
63
|
+
const conversationId = c.req.param("conversationId");
|
|
64
|
+
const session = await deps.service.sessionIndexInstance.getSessionMetadata(conversationId);
|
|
65
|
+
if (!session?.transcriptId || session.sourceChannel !== "webchat" || session.sessionType !== "chat") return c.json({ error: "Conversation not found" }, 404);
|
|
66
|
+
return c.json({
|
|
67
|
+
configured: Boolean(await configuredMusicModel()),
|
|
68
|
+
jobs: listMusicJobs(conversationId, session.transcriptId)
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
app.get(`${path}/:jobId/audio`, async (c) => {
|
|
72
|
+
const conversationId = c.req.param("conversationId");
|
|
73
|
+
const session = await deps.service.sessionIndexInstance.getSessionMetadata(conversationId);
|
|
74
|
+
const job = getMusicJob(conversationId, c.req.param("jobId"));
|
|
75
|
+
if (!session?.transcriptId || job?.transcript_id !== session.transcriptId || job.state !== "completed") return c.json({ error: "Audio not found" }, 404);
|
|
76
|
+
return readMusicArtifact(job.id, c.req.header("Range"), c.req.query("download") === "1");
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { registerMusicGenerationRoutes };
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
+
import { init_transaction, runSqliteWriteTransaction } from "../../../storage/sqlite/transaction.js";
|
|
1
2
|
import { VIDEO_IMAGE_MAX_BYTES, VIDEO_MODELS, VIDEO_MODEL_REFS, VIDEO_RESOLUTIONS, WAN_VIDEO_MODEL_REF, isVideoDurationSupported } from "../../../../packages/gateway-contract/src/video-generation.js";
|
|
2
3
|
import { init_src } from "../../../../packages/gateway-contract/src/index.js";
|
|
3
4
|
import { readMediaReference } from "../../../media/media-reference.js";
|
|
4
|
-
import { readVideoArtifact } from "../../../video-generation/artifact.js";
|
|
5
5
|
import { getVideoDefaults, getVideoModel, setVideoDefaults, setVideoModel } from "../../../video-generation/settings.js";
|
|
6
6
|
import { enqueueVideoJob, getVideoJob, listVideoJobs } from "../../../video-generation/repository.js";
|
|
7
|
+
import { getVideoDraft } from "../../../video-generation/drafts.js";
|
|
8
|
+
import { readVideoArtifact } from "../../../video-generation/artifact.js";
|
|
7
9
|
import { getConfiguredVideoProviders, getVideoProvider } from "../../../video-generation/providers.js";
|
|
8
10
|
import { resolveScopedMediaReference } from "../../media-access.js";
|
|
9
11
|
import { createHash } from "node:crypto";
|
|
10
12
|
import { z } from "zod";
|
|
11
13
|
//#region src/gateway/hono/routes/video-generation.ts
|
|
12
14
|
init_src();
|
|
15
|
+
init_transaction();
|
|
13
16
|
const settingsPath = "/api/video-generation/settings";
|
|
14
17
|
const modelSchema = z.enum(VIDEO_MODEL_REFS);
|
|
15
18
|
const path = "/api/video-generation/sessions/:conversationId/jobs";
|
|
19
|
+
const confirmationSchema = z.object({
|
|
20
|
+
id: z.string().uuid(),
|
|
21
|
+
revision: z.number().int().positive()
|
|
22
|
+
});
|
|
16
23
|
const requestSchema = z.object({
|
|
17
24
|
id: z.string().uuid(),
|
|
18
25
|
modelRef: modelSchema.default(WAN_VIDEO_MODEL_REF),
|
|
@@ -84,32 +91,42 @@ function registerVideoGenerationRoutes(app, deps) {
|
|
|
84
91
|
if (!session?.transcriptId) return c.json({ error: "Conversation not found" }, 404);
|
|
85
92
|
const modelRef = getVideoModel();
|
|
86
93
|
const configured = Boolean(await getVideoProvider(modelRef).resolveKey().catch(() => void 0));
|
|
94
|
+
const jobs = listVideoJobs(conversationId);
|
|
95
|
+
const draft = getVideoDraft(conversationId, session.transcriptId);
|
|
87
96
|
return c.json({
|
|
88
97
|
transcriptId: session.transcriptId,
|
|
89
98
|
modelRef,
|
|
90
99
|
configured,
|
|
91
100
|
defaults: getVideoDefaults(modelRef),
|
|
92
|
-
jobs
|
|
101
|
+
jobs,
|
|
102
|
+
...draft && !jobs.some((job) => job.id === draft.id) ? { draft } : {}
|
|
93
103
|
});
|
|
94
104
|
});
|
|
95
|
-
app.post(path, deps.strictRateLimitMiddleware,
|
|
105
|
+
app.post(path, deps.strictRateLimitMiddleware, (c) => submit(c, false));
|
|
106
|
+
app.post(`${path}/confirm-draft`, deps.strictRateLimitMiddleware, (c) => submit(c, true));
|
|
107
|
+
async function submit(c, confirming) {
|
|
96
108
|
const conversationId = c.req.param("conversationId");
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
+
const transcriptId = (await deps.service.sessionIndexInstance.getSessionMetadata(conversationId))?.transcriptId;
|
|
110
|
+
if (!transcriptId) return c.json({ error: "Conversation not found" }, 404);
|
|
111
|
+
const confirmation = confirming ? confirmationSchema.safeParse(await c.req.json().catch(() => null)) : void 0;
|
|
112
|
+
if (confirmation && !confirmation.success) return c.json({ error: "Invalid draft confirmation" }, 400);
|
|
113
|
+
const draft = confirmation?.success ? getVideoDraft(conversationId, transcriptId) : void 0;
|
|
114
|
+
if (confirmation?.success && (draft?.id !== confirmation.data.id || draft.revision !== confirmation.data.revision)) return c.json({ error: "The video draft changed. Review the current version before generating." }, 409);
|
|
115
|
+
const form = confirming ? null : await c.req.formData().catch(() => null);
|
|
116
|
+
if (!draft && !form) return c.json({ error: "Invalid video request" }, 400);
|
|
117
|
+
const parsed = requestSchema.safeParse(draft ?? {
|
|
118
|
+
id: form?.get("id"),
|
|
119
|
+
modelRef: form?.get("modelRef") ?? void 0,
|
|
120
|
+
transcriptId: form?.get("transcriptId"),
|
|
121
|
+
prompt: form?.get("prompt"),
|
|
122
|
+
duration: form?.get("duration"),
|
|
123
|
+
ratio: form?.get("ratio"),
|
|
124
|
+
resolution: form?.get("resolution"),
|
|
125
|
+
imageUri: form?.get("imageUri")
|
|
109
126
|
});
|
|
110
127
|
if (!parsed.success) return c.json({ error: "Invalid video settings" }, 400);
|
|
111
128
|
const { imageUri, modelRef, ...request } = parsed.data;
|
|
112
|
-
const upload = form
|
|
129
|
+
const upload = form?.get("image") ?? null;
|
|
113
130
|
if (upload !== null && (!(upload instanceof File) || imageUri || !upload.size || upload.size > 5242880)) return c.json({ error: "Provide one PNG, JPEG or WebP image up to 5 MiB" }, 400);
|
|
114
131
|
const model = VIDEO_MODELS[modelRef];
|
|
115
132
|
const hasImage = Boolean(upload || imageUri);
|
|
@@ -142,20 +159,28 @@ function registerVideoGenerationRoutes(app, deps) {
|
|
|
142
159
|
imageName
|
|
143
160
|
}));
|
|
144
161
|
if (bytes) hash.update(bytes);
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
162
|
+
const requestHash = hash.digest("hex");
|
|
163
|
+
const result = runSqliteWriteTransaction(() => {
|
|
164
|
+
if (draft) {
|
|
165
|
+
const latest = getVideoDraft(conversationId, transcriptId);
|
|
166
|
+
if (latest?.id !== draft.id || latest.revision !== draft.revision) return { error: "draft_changed" };
|
|
167
|
+
}
|
|
168
|
+
return enqueueVideoJob(conversationId, {
|
|
169
|
+
...request,
|
|
170
|
+
modelRef,
|
|
171
|
+
imageName
|
|
172
|
+
}, requestHash, bytes && mime ? {
|
|
173
|
+
bytes,
|
|
174
|
+
mime
|
|
175
|
+
} : void 0, draft);
|
|
176
|
+
});
|
|
177
|
+
if (result.error === "draft_changed") return c.json({ error: "The video draft changed. Review the current version before generating." }, 409);
|
|
153
178
|
if (result.error === "budget_exhausted") return c.json({ error: "The Gateway video generation budget for today has been reached." }, 429);
|
|
154
179
|
if (result.error === "queue_full") return c.json({ error: "The video queue is full. Try again after a task completes." }, 429);
|
|
155
180
|
if (result.error === "model_changed") return c.json({ error: "The video model changed. Review the updated model before submitting." }, 409);
|
|
156
|
-
if (result.error) return c.json({ error: "The conversation or video request changed.
|
|
181
|
+
if (result.error) return c.json({ error: "The conversation or video request changed. Review the current request and try again." }, 409);
|
|
157
182
|
return c.json(result.job, 202);
|
|
158
|
-
}
|
|
183
|
+
}
|
|
159
184
|
app.get(`${path}/:jobId/video`, async (c) => {
|
|
160
185
|
const job = getVideoJob(c.req.param("conversationId"), c.req.param("jobId"));
|
|
161
186
|
if (job?.state !== "completed") return c.json({ error: "Video not found" }, 404);
|
|
@@ -222,6 +222,7 @@ export declare class GatewayService {
|
|
|
222
222
|
private loadDeferredExtensions;
|
|
223
223
|
private schedulePostReadySidecars;
|
|
224
224
|
private runPostReadySidecars;
|
|
225
|
+
private readonly musicGenerationWorker;
|
|
225
226
|
private readonly videoGenerationWorker;
|
|
226
227
|
start(): Promise<void>;
|
|
227
228
|
private startRuntime;
|
|
@@ -146,6 +146,7 @@ import { NotificationService } from "../notifications/service.js";
|
|
|
146
146
|
import "../local-apps/index.js";
|
|
147
147
|
import { TaskAllocationDispatcher } from "../tasks/task-allocation-service.js";
|
|
148
148
|
import { TaskResultDeliveryService } from "../tasks/task-result-delivery-service.js";
|
|
149
|
+
import { MusicGenerationWorker } from "../music-generation/worker.js";
|
|
149
150
|
import { VideoGenerationWorker } from "../video-generation/worker.js";
|
|
150
151
|
import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
|
|
151
152
|
import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
|
|
@@ -1347,6 +1348,7 @@ var GatewayService = class {
|
|
|
1347
1348
|
}, `Deferred extension load failed: ${em}`);
|
|
1348
1349
|
}
|
|
1349
1350
|
}
|
|
1351
|
+
musicGenerationWorker = new MusicGenerationWorker();
|
|
1350
1352
|
videoGenerationWorker = new VideoGenerationWorker();
|
|
1351
1353
|
async start() {
|
|
1352
1354
|
try {
|
|
@@ -1590,6 +1592,7 @@ var GatewayService = class {
|
|
|
1590
1592
|
this.discussionLiveWorker.start();
|
|
1591
1593
|
this.discussionSealer.start();
|
|
1592
1594
|
this.videoGenerationWorker.start();
|
|
1595
|
+
this.musicGenerationWorker.start();
|
|
1593
1596
|
this.discussionWorker.start();
|
|
1594
1597
|
this.connectorSupervisor = startConnectorSupervisor({
|
|
1595
1598
|
getConfig: () => this.config,
|
|
@@ -1755,7 +1758,7 @@ var GatewayService = class {
|
|
|
1755
1758
|
this.homeIntelligenceHost = null;
|
|
1756
1759
|
this.realtime.close();
|
|
1757
1760
|
this.voiceRealtime.close();
|
|
1758
|
-
await this.videoGenerationWorker.stop();
|
|
1761
|
+
await Promise.all([this.videoGenerationWorker.stop(), this.musicGenerationWorker.stop()]);
|
|
1759
1762
|
await this.discussionWorker.stop();
|
|
1760
1763
|
await this.discussionSealer.stop();
|
|
1761
1764
|
await this.discussionLiveWorker.stop();
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/media-shared/http/byte-range.ts
|
|
2
|
+
function parseByteRange(header, size) {
|
|
3
|
+
if (!header) return null;
|
|
4
|
+
const match = /^bytes=(\d*)-(\d*)$/i.exec(header.trim());
|
|
5
|
+
if (!match || !match[1] && !match[2] || size <= 0) return "invalid";
|
|
6
|
+
if (!match[1]) {
|
|
7
|
+
const suffixLength = Number(match[2]);
|
|
8
|
+
if (!Number.isSafeInteger(suffixLength) || suffixLength <= 0) return "invalid";
|
|
9
|
+
return {
|
|
10
|
+
start: Math.max(0, size - suffixLength),
|
|
11
|
+
end: size - 1
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const start = Number(match[1]);
|
|
15
|
+
const requestedEnd = match[2] ? Number(match[2]) : size - 1;
|
|
16
|
+
if (!Number.isSafeInteger(start) || !Number.isSafeInteger(requestedEnd) || start < 0 || start >= size || requestedEnd < start) return "invalid";
|
|
17
|
+
return {
|
|
18
|
+
start,
|
|
19
|
+
end: Math.min(requestedEnd, size - 1)
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { parseByteRange };
|
|
@@ -5,7 +5,7 @@ import { inferMemorySensitivity } from "../agent/memory/sensitivity.js";
|
|
|
5
5
|
import { listKnowledgeItems, writeKnowledgeItem } from "../knowledge-memory/repository.js";
|
|
6
6
|
import "../knowledge-memory/index.js";
|
|
7
7
|
import { projectUnadmittedForgottenFields } from "./forgotten-history.js";
|
|
8
|
-
import { isFullyOwnerAuthoredSpan, isOwnerAuthoredSpan } from "../user-model/capture/evidence-policy.js";
|
|
8
|
+
import { isFullyOwnerAuthoredSpan, isOwnerAuthoredSpan, isStandingToolInstruction } from "../user-model/capture/evidence-policy.js";
|
|
9
9
|
import { WorkCandidateSchema } from "./work-candidate.js";
|
|
10
10
|
import { createHash } from "node:crypto";
|
|
11
11
|
//#region src/memory-learning/work-capture.ts
|
|
@@ -39,6 +39,7 @@ function applyWorkCandidates(input) {
|
|
|
39
39
|
if (candidate.evidence.some((claim) => !input.evidence.some((entry) => entry.ref === claim.ref))) return reject("evidence_ref_missing");
|
|
40
40
|
const sources = candidate.evidence.map((claim) => input.evidence.find((entry) => entry.ref === claim.ref && entry.text.normalize("NFKC").includes(claim.quote.normalize("NFKC"))));
|
|
41
41
|
if (sources.some((source) => !source)) return reject("evidence_quote_mismatch");
|
|
42
|
+
if (!input.source && sources.every((source, index) => source?.role === "user" && isStandingToolInstruction(source.text, candidate.evidence[index].quote))) return reject("collaboration_instruction_requires_preference");
|
|
42
43
|
if (!input.source && sources.some((source, index) => source?.role === "user" && (!isOwnerAuthoredSpan(source.text, candidate.evidence[index].quote) || /(?:翻译|润色|改写|引文|引用|\b(?:translate|rewrite|quotation|quoted)\b)/iu.test(source.text) && !isFullyOwnerAuthoredSpan(source.text, candidate.evidence[index].quote)))) return reject("work_quote_not_owned");
|
|
43
44
|
if (candidate.lesson) {
|
|
44
45
|
if (input.source) return reject("lesson_runtime_verification_required");
|
|
@@ -32,6 +32,8 @@ export interface WorkReviewPlan {
|
|
|
32
32
|
}
|
|
33
33
|
/** Cheap event selection; recalled or quoted instructions do not trigger a review. */
|
|
34
34
|
export declare function workReviewTrigger(evidence: CaptureEvidence[]): string;
|
|
35
|
+
/** Management only. Re-read the original before suggesting any scope change. */
|
|
36
|
+
export declare function suggestWorkMemoryReview(item: KnowledgeItem, context: KnowledgeVisibilityContext, policy: KnowledgeReadPolicy): 'collaboration_rule' | 'global_collaboration_rule' | undefined;
|
|
35
37
|
export declare function prepareWorkReview(input: Omit<WorkReviewPlan, 'targets'> & {
|
|
36
38
|
evidence: CaptureEvidence[];
|
|
37
39
|
}): WorkReviewPlan;
|