@xopcai/xopc 0.0.465 → 0.0.467
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/dingtalk/src/index.d.ts +8 -0
- package/dist/extensions/dingtalk/src/index.js +159 -0
- package/dist/extensions/dingtalk/xopc.extension.json +131 -0
- package/dist/extensions/discord/src/gateway.d.ts +13 -0
- package/dist/extensions/discord/src/gateway.js +186 -0
- package/dist/extensions/discord/src/index.d.ts +8 -0
- package/dist/extensions/discord/src/index.js +184 -0
- package/dist/extensions/discord/xopc.extension.json +113 -0
- package/dist/extensions/feishu/src/adapters/gateway-setup.js +33 -26
- package/dist/extensions/slack/src/index.d.ts +8 -0
- package/dist/extensions/slack/src/index.js +169 -0
- package/dist/extensions/slack/src/manifest.d.ts +33 -0
- package/dist/extensions/slack/src/manifest.js +32 -0
- package/dist/extensions/slack/xopc.extension.json +124 -0
- package/dist/extensions/telegram/src/adapters/gateway-setup.js +4 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/wecom/src/index.d.ts +8 -0
- package/dist/extensions/wecom/src/index.js +188 -0
- package/dist/extensions/wecom/xopc.extension.json +131 -0
- package/dist/gateway/static/root/assets/{activity-store-B9heFbtJ.js → activity-store-CdEua6PR.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-nzhB7Xjk.js → agent-avatar-dicebear-l8GQ4I9J.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-display-DBzgoHMD.js → agent-avatar-display-BO1bqKlR.js} +2 -2
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BJrNV93g.js → agent-defaults-settings-panel-Dj_H2kDD.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DLbTHALG.js → agent-plugin-dialog-BQA2brAU.js} +1 -1
- package/dist/gateway/static/root/assets/agents-C5C5l13A.js +77 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-CqQbYIiY.js → agents-admin-api-DZ1lLnrj.js} +1 -1
- package/dist/gateway/static/root/assets/{api-BGodd--L.js → api-DDWYNF7I.js} +1 -1
- package/dist/gateway/static/root/assets/{api-8tNOT72p.js → api-DVXcGKP-.js} +1 -1
- package/dist/gateway/static/root/assets/{app-link-DImAfVs5.js → app-link-BkEO3eBe.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-Q7apF7KE.js → app-management-settings-panel-B5-7E03Z.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-ClVZeUmo.js → appearance-settings-E_BcjEDM.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-BsJJwpKj.js → apps-page-BjB_mjXu.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-Bl_M0WJp.js → archive-plugin-MvSiDvxK.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-api-BOnIc_vw.js → automation-api-24NjW7qG.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-result-state-BwDSJs05.js → automation-result-state-C94Q3OEL.js} +1 -1
- package/dist/gateway/static/root/assets/{automation-run-list-CqlIq4BG.js → automation-run-list-BShRirWV.js} +1 -1
- package/dist/gateway/static/root/assets/automation-task-card-Bgq5Plux.js +2 -0
- package/dist/gateway/static/root/assets/{automations-page-Bimqx5Pc.js → automations-page-3WGWLdiW.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CH9gYqIK.js +9 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DDNKe1Io.js → binary-plugins-MFVtTdvy.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BQ3amsRP.js → block-editor-DAWXPErA.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-CHf1_RVl.js → browser-settings-page-DI2PYAPC.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-C5oWMC-Z.js → capabilities-CFWTer_v.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-Cj8vl1ZY.js → capabilities-Dyw8xW90.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-C2RB9fzC.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BjaLTd6i.js +8 -0
- package/dist/gateway/static/root/assets/{capability-navigation-QtHJxxW2.js → capability-navigation-CZbCI5C2.js} +1 -1
- package/dist/gateway/static/root/assets/channels-DiDfjON8.js +1 -0
- package/dist/gateway/static/root/assets/{chat-agents-api-C3JChTsh.js → chat-agents-api-BksS0CNy.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-chart-block-DrtmYOIo.js → chat-chart-block-aZIklMNN.js} +1 -1
- package/dist/gateway/static/root/assets/chat-page-BtMkdtxJ.js +71 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-B0D220I-.js → chat-terminal-dock-B4HoRIzf.js} +1 -1
- package/dist/gateway/static/root/assets/{command-palette-api-CkJ6_Yf3.js → command-palette-api-VhBEUFmw.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-handoff-params-GKGdXjMZ.js → composer-handoff-params-DBpzHuNo.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-model-config-control-DQCOWHzJ.js → composer-model-config-control-BhRAbdPW.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-notifications-D__OU_xx.js → composer-notifications-nT-U6jcc.js} +1 -1
- package/dist/gateway/static/root/assets/{composer-payload-handoff-BBTbJ1bO.js → composer-payload-handoff-xEFHDnLo.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-DGRUCkOt.js → computer-settings-page-DXlH96m6.js} +1 -1
- package/dist/gateway/static/root/assets/{connected-providers-grid-BoDipD2g.js → connected-providers-grid-D8vBFsbY.js} +1 -1
- package/dist/gateway/static/root/assets/{connection-usage-guide-B1VUqibv.js → connection-usage-guide-C8jPm7QO.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-bwQ1PekA.js → connector-service-page-B42yWHxS.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-api-BvYGL65q.js → connectors-api-so2a7xrD.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-BX6Jt6w5.js → connectors-page-yhOZIiUZ.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-ClRDaNBJ.js → date-picker-UEh3JM7r.js} +1 -1
- package/dist/gateway/static/root/assets/{date-time-picker-CA6H47M6.js → date-time-picker-Dci0LfAU.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-Bi8Hgf-x.js → desktop-pet-BAU_GuBe.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-CQ6qE8lf.js → desktop-pet-settings-CYE2eTTf.js} +1 -1
- package/dist/gateway/static/root/assets/{dev-view-store-UCqQeWa2.js → dev-view-store-C7v4CIlF.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-gC-XZxt2.js → device-pairing-wizard-7NDkYmiZ.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-Y8snl5Xl.js → directory-picker-path-field-DmRZY8kg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-authoritative-grants-D2abOXTl.js → extension-authoritative-grants-DIeg1mg8.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-OOlRCInL.js → extension-debug-page-D8TAJgZ_.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-iframe-host-D_WXBf6a.js → extension-iframe-host-CjfRKtQ4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-marketplace-api-Bmtm6-L1.js → extension-marketplace-api-V1oFBxVi.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-message-router-xqjjSxcp.js → extension-message-router-DZahH1Hd.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-bpQnyNz-.js → extension-page-DMuHBIHa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-l7SvHEK1.js → extension-provider-lqJ1zIkA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BvUtZGLT.js → extension-settings-page-D5IfKVff.js} +1 -1
- package/dist/gateway/static/root/assets/{file-preview-surface-B-r2ZnCV.js → file-preview-surface-B7B9qXm9.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-DOwezeL2.js → gateway-config-swr-Dk3FtNv1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-Br7dErHY.js → gateway-realtime-DMvo4pAc.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-CJf-qaHZ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-restart-B3Xro3qd.js → gateway-restart-C2h5R1eP.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-DCnP-HPj.js → gateway-settings-DGPaikv5.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-vteSIhYI.js → gateway-startup-retry-yZn7ShiP.js} +1 -1
- package/dist/gateway/static/root/assets/{global-defaults-api-Bpje9rVk.js → global-defaults-api-gsAa0Kj9.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-CNEgNWEQ.js → home-page-BBTtXpDD.js} +3 -3
- package/dist/gateway/static/root/assets/{image-generation-api-BvpAa3Lj.js → image-generation-api-DPn1SBMH.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-Dx5T5pqw.js → imports-page-Cc48Uq20.js} +1 -1
- package/dist/gateway/static/root/assets/index-BJj-uZNl.js +11 -0
- package/dist/gateway/static/root/assets/index-DiWUK4sJ.css +1 -0
- package/dist/gateway/static/root/assets/{install-connector-dialog-Cb4ufypG.js → install-connector-dialog-QkJMw_uW.js} +1 -1
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BEuXrnv0.js → keyboard-shortcuts-settings-BZXqXuI4.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CPFIbEbv.js → local-app-workbench-page-wekatwet.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-DxHcRSxc.js → local-apps-page-D-bRvlZY.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-Cmc-GCVa.js → local-session-drafts-CZ19DRRK.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-tI9VX7dp.js → locale-store-DIBIYLnI.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-BcibwftP.js → logs-page-CukseY3k.js} +1 -1
- package/dist/gateway/static/root/assets/{management-api-C9tFjLcE.js → management-api-EG5duPec.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-DbnAlXoB.js → management-settings-B7RWHrwo.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-CSpQhSka.js → markdown-view-C30KvTaE.js} +1 -1
- package/dist/gateway/static/root/assets/{mcp-conversation-setup-page-DedbjJbF.js → mcp-conversation-setup-page-BZ1PDTYY.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-BYnP_orq.js → media-plugins-CW5UoTx6.js} +1 -1
- package/dist/gateway/static/root/assets/messages-BDBGlBKh.js +3 -0
- package/dist/gateway/static/root/assets/{model-selector-B4oTiJI6.js → model-selector-COGICRIG.js} +1 -1
- package/dist/gateway/static/root/assets/{models-hub-cache-DpEClnsE.js → models-hub-cache-aRYHi2dh.js} +1 -1
- package/dist/gateway/static/root/assets/new-chat-navigation-DXYDldT_.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-D8asMfBm.js → note-detail-panel-D5BtgBxy.js} +3 -3
- package/dist/gateway/static/root/assets/note-image-lightbox-CxXu_Tkh.js +1 -0
- package/dist/gateway/static/root/assets/{notes-api-pVC1amyp.js → notes-api-BXevQivV.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-CG1_6PLz.js → notes-page-DyM-3O_9.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-api-BsVPwufr.js → oauth-api-enDU_32p.js} +1 -1
- package/dist/gateway/static/root/assets/{oauth-provider-connect-Bu20kmPq.js → oauth-provider-connect-C2pfvPOI.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-CDsnNXjS.js → page-context-capture-button-BaSooYGv.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-draft-D6tu8c_9.js → page-context-draft-4-3RtO0q.js} +1 -1
- package/dist/gateway/static/root/assets/page-header-store-C2ydtnXa.js +1 -0
- package/dist/gateway/static/root/assets/{personal-avatar-BboNc6e2.js → personal-avatar-BPQpvC34.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-BB4Sv68K.js +1 -0
- package/dist/gateway/static/root/assets/{personal-profile-settings-Cd4QyseL.js → personal-profile-settings-DwMdjQ6H.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-settings-panel-CtBY_Uk1.js → personal-settings-panel-DiNpP_g3.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-dependencies-card-BgH1LluB.js → phone-dependencies-card-DUT-qRLZ.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-connection-DkdKU5Kv.js → phone-model-connection-pvOciDNo.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-model-picker-0g1z4RPL.js → phone-model-picker-CD97E6C5.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-settings-page-DlIUajBY.js → phone-settings-page-BUZ1dh7s.js} +1 -1
- package/dist/gateway/static/root/assets/{phone-workspace-store-DW2sZtkh.js → phone-workspace-store-BwilERgv.js} +1 -1
- package/dist/gateway/static/root/assets/{plugin-details-dialog-9KUkZk_t.js → plugin-details-dialog-C_uOVmJv.js} +1 -1
- package/dist/gateway/static/root/assets/{preference-select-fields-DH5QZhIc.js → preference-select-fields-BSUgcO7-.js} +1 -1
- package/dist/gateway/static/root/assets/{product-automation-feedback-a1thJ0M9.js → product-automation-feedback-BlwtlUY7.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-CnvCn9L-.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-DCzQh7tr.js → product-open-page-Dy6D5exJ.js} +1 -1
- package/dist/gateway/static/root/assets/{product-preview-content-C5TLcagj.js → product-preview-content-DEUPAilo.js} +1 -1
- package/dist/gateway/static/root/assets/product-preview-modal-C4TV9RUd.js +2 -0
- package/dist/gateway/static/root/assets/project-detail-page-BG2nDt98.js +7 -0
- package/dist/gateway/static/root/assets/{project-understanding-CoPBvlqf.js → project-understanding-lOJ5Tz2V.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-k1v8Fry8.js → projects-page-B3aGdPHy.js} +1 -1
- package/dist/gateway/static/root/assets/{providers-api-BSJZyO8n.js → providers-api-C26HgxZY.js} +1 -1
- package/dist/gateway/static/root/assets/{recording-upload-CExCePtr.js → recording-upload-BJkXktA-.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-CqcJj60w.js → registry-api-pQ0eInzG.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BLFkNl1y.js → remote-access-hub-CjWrYzjf.js} +1 -1
- package/dist/gateway/static/root/assets/{resource-unavailable-B_BXTQa7.js → resource-unavailable-Y9WRHOnz.js} +1 -1
- package/dist/gateway/static/root/assets/{right-workspace-store-OceFhUjM.js → right-workspace-store-DHHyicqQ.js} +1 -1
- package/dist/gateway/static/root/assets/route-preload-BYqg1BYz.js +2 -0
- package/dist/gateway/static/root/assets/{routine-panel-BsE9o9uu.js → routine-panel-Coh2B0j7.js} +2 -2
- package/dist/gateway/static/root/assets/{runtime-tools-api-aAZChVm4.js → runtime-tools-api-BoJQ3u5o.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Bn9HTrK5.js → runtime-tools-settings-panel-DB7cfLrX.js} +1 -1
- package/dist/gateway/static/root/assets/schema-form-DXHzZPMr.js +1 -0
- package/dist/gateway/static/root/assets/send-1f1Ntw6E.js +1 -0
- package/dist/gateway/static/root/assets/{service-recommendation-list-BNIVRGDf.js → service-recommendation-list-_rFmwIwY.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-DdW7Wix2.js → session-api-a6wb0_Gf.js} +1 -1
- package/dist/gateway/static/root/assets/{session-channel-icon-DUJbB-Km.js → session-channel-icon-COynhpeK.js} +1 -1
- package/dist/gateway/static/root/assets/{session-identity-label-DjhlQ6LU.js → session-identity-label-DCIZvqbN.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-D5g6LOU-.js +25 -0
- package/dist/gateway/static/root/assets/{sessions-page-CfhKeUkZ.js → sessions-page-dEupc-3A.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-DjyibJZ1.js +1 -0
- package/dist/gateway/static/root/assets/{settings-advanced-section-BOoJfJuB.js → settings-advanced-section-CnGJr2xp.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-mode-store-BMh_BQ9a.js → settings-mode-store-DWRhupcY.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-M6XwzIyu.js → settings-page-D9A2DdJ_.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-header-Bfu4cuQd.js → settings-page-header-wL2jvs-y.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BnZa1qHH.js → settings-page-layout-BkUQVmyY.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-interaction-page-CVlrVNrm.js → setup-interaction-page-D238tuw-.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-FFyDODEx.js → setup-status-panel-DXvYjIu3.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-Cv-eDEw_.js → share-link-dialog-DFDJyl3N.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-BctH6eFs.js → share-preview-page-CyCv69rh.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-cLTEcQLE.js → shares-api-CfFiW03g.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DcetAN8K.js → shares-settings-B85XIDFv.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-CgEZJoy9.js → skill-api-CWRhFSkA.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-list-api-BWVr2PL5.js → skill-list-api-CmPp2czp.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-BLhHNvaK.js → skill-reload-api-BGsSq3dj.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DIjcAvA0.js → skills-page-DqD0FPeH.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-C7LAPaN_.js → system-settings-panel-aw9C86I8.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DgsLOz6h.js +3 -0
- package/dist/gateway/static/root/assets/{task-result-evidence-BsBn3n_l.js → task-result-evidence-C-zIBpzi.js} +1 -1
- package/dist/gateway/static/root/assets/{terminal-panel-store-DJbLuUku.js → terminal-panel-store-CgPqgrm7.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-QGcjV6pN.js → theme-store-DxF7S6I2.js} +1 -1
- package/dist/gateway/static/root/assets/{tracing-settings-page-BKCiPwYL.js → tracing-settings-page-Dvlunx28.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-S7J5Lpzt.js → tunnel-api-CIte6n0U.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-activity-store-BNVhtJkn.js → understanding-activity-store-C2RHmRo8.js} +1 -1
- package/dist/gateway/static/root/assets/{understanding-refresh-store-CM6bUcaJ.js → understanding-refresh-store-CPeQIXS_.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-D-AqzjIx.js → usage-page-DPUjEj39.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-CqZbhhCc.js → use-autosave-xX2KrbXw.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BfLhIb2_.js → use-composer-attachments-C9GpCJQR.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-DufxDues.js → use-file-preview-expanded-Daf-LmiF.js} +3 -3
- package/dist/gateway/static/root/assets/{use-personal-profile-RnjxZnLa.js → use-personal-profile-BJgaheR4.js} +1 -1
- package/dist/gateway/static/root/assets/{use-realtime-voice-w3aHR2dr.js → use-realtime-voice-RQW5KnIN.js} +1 -1
- package/dist/gateway/static/root/assets/{use-workspace-tree-2Ck-ql5c.js → use-workspace-tree-B6QFV5gR.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-CBcGMhrR.js → user-model-page-hKnsTcMk.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-C4rhpgco.js → voice-api-key-field-BeEF7Thh.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-7AHN-ns6.js → voice-config-api-vbBoKnqd.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-input-shortcut-events-BbRrj833.js → voice-input-shortcut-events-CKn6X3qL.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-settings-wamtp0lg.js → voice-settings-BUrk4mwV.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-fVofN7aP.js → work-discovery-overlay-Ddvqu02U.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-page-DcQG5GWy.js → work-discovery-page-BdBpri6P.js} +1 -1
- package/dist/gateway/static/root/assets/{working-directory-picker-modal-D8Stwszr.js → working-directory-picker-modal-DStgfCzQ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-api-D3iuTdNK.js → workspace-api-CscTRODe.js} +2 -2
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-CyPjTDSx.js +1 -0
- package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-BXbL5Y1h.js → workspace-file-preview-dialog-JSGIA79T.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-open-location-menu-1gFO_BdL.js → workspace-open-location-menu-CBHFZ2iQ.js} +1 -1
- package/dist/gateway/static/root/assets/{workspace-preview-store-adwmi4nx.js → workspace-preview-store-DNLnuHlf.js} +1 -1
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-DhGh4rm7.js → xopc-cloud-account-card-Cm0Saa8B.js} +1 -1
- package/dist/gateway/static/root/index.html +97 -96
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/music-generation.js +6 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +2 -0
- package/dist/packages/gateway-contract/src/video-generation.js +75 -0
- package/dist/src/agent/embedded/runs.d.ts +1 -0
- package/dist/src/agent/embedded/runs.js +5 -2
- package/dist/src/agent/inbound/attachment-pipeline.d.ts +2 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +21 -11
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +2 -0
- package/dist/src/agent/inbound/turn-dispatcher.js +31 -13
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -0
- package/dist/src/agent/prompt/sections/tooling.js +4 -0
- package/dist/src/agent/prompt/service-prompt-builder.js +1 -1
- 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/toolExposure.js +2 -0
- package/dist/src/agent/tools/video-draft-tool.d.ts +12 -0
- package/dist/src/agent/tools/video-draft-tool.js +75 -0
- package/dist/src/agent/tools/xopc-use-tool.js +12 -1
- package/dist/src/channels/bundled-channel-extensions.d.ts +1 -0
- package/dist/src/channels/bundled-channel-extensions.js +15 -0
- package/dist/src/channels/enterprise/config-surface.d.ts +1 -0
- package/dist/src/channels/enterprise/config-surface.js +19 -0
- package/dist/src/channels/enterprise/plugin.d.ts +39 -0
- package/dist/src/channels/enterprise/plugin.js +219 -0
- package/dist/src/channels/enterprise/setup.d.ts +34 -0
- package/dist/src/channels/enterprise/setup.js +262 -0
- package/dist/src/channels/enterprise/socket.d.ts +12 -0
- package/dist/src/channels/enterprise/socket.js +107 -0
- package/dist/src/channels/lifecycle-supervisor.js +11 -1
- package/dist/src/channels/plugin-types.d.ts +9 -0
- package/dist/src/channels/plugins/types.adapters.d.ts +12 -0
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/extensions/activation-planner.js +8 -2
- package/dist/src/extensions/bundled-extension-activation.js +9 -0
- package/dist/src/gateway/hono/app.js +6 -2
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +2 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +2 -1
- package/dist/src/gateway/hono/routes/channels.js +2 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +16 -0
- package/dist/src/gateway/hono/routes/media.js +1 -20
- package/dist/src/gateway/hono/routes/music-generation.d.ts +3 -0
- package/dist/src/gateway/hono/routes/music-generation.js +59 -0
- package/dist/src/gateway/hono/routes/video-generation.d.ts +3 -0
- package/dist/src/gateway/hono/routes/video-generation.js +191 -0
- package/dist/src/gateway/security/gateway-scopes.js +2 -0
- package/dist/src/gateway/service/session-input-coordinator.d.ts +2 -0
- package/dist/src/gateway/service/session-input-coordinator.js +11 -3
- package/dist/src/gateway/service.d.ts +2 -0
- package/dist/src/gateway/service.js +11 -4
- package/dist/src/home-intelligence/host.js +5 -5
- 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/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 +31 -0
- package/dist/src/music-generation/provider.js +4 -0
- package/dist/src/music-generation/providers.d.ts +26 -0
- package/dist/src/music-generation/providers.js +56 -0
- package/dist/src/music-generation/repository.d.ts +50 -0
- package/dist/src/music-generation/repository.js +104 -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/worker.d.ts +8 -0
- package/dist/src/music-generation/worker.js +115 -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 +2 -0
- package/dist/src/session/client-history.d.ts +1 -0
- package/dist/src/session/client-history.js +5 -6
- package/dist/src/session/store.js +10 -0
- package/dist/src/storage/sqlite/schema.d.ts +2 -2
- package/dist/src/storage/sqlite/schema.js +7 -7
- package/dist/src/storage/sqlite/schema.sql +62 -0
- package/dist/src/storage/sqlite/session-input-repository.js +5 -2
- package/dist/src/storage/sqlite/transcript-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/transcript-repository.js +20 -1
- package/dist/src/storage/sqlite/upgrades/275_video_generation.sql +28 -0
- package/dist/src/storage/sqlite/upgrades/276_video_provider_selection.sql +11 -0
- package/dist/src/storage/sqlite/upgrades/277_music_generation.sql +30 -0
- package/dist/src/video-generation/artifact.d.ts +5 -0
- package/dist/src/video-generation/artifact.js +91 -0
- package/dist/src/video-generation/drafts.d.ts +17 -0
- package/dist/src/video-generation/drafts.js +89 -0
- package/dist/src/video-generation/provider-types.d.ts +21 -0
- package/dist/src/video-generation/provider-types.js +14 -0
- package/dist/src/video-generation/providers.d.ts +15 -0
- package/dist/src/video-generation/providers.js +72 -0
- package/dist/src/video-generation/repository.d.ts +58 -0
- package/dist/src/video-generation/repository.js +91 -0
- package/dist/src/video-generation/seedance.d.ts +4 -0
- package/dist/src/video-generation/seedance.js +72 -0
- package/dist/src/video-generation/settings.d.ts +5 -0
- package/dist/src/video-generation/settings.js +25 -0
- package/dist/src/video-generation/wan.d.ts +9 -0
- package/dist/src/video-generation/wan.js +59 -0
- package/dist/src/video-generation/worker.d.ts +8 -0
- package/dist/src/video-generation/worker.js +98 -0
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-C2xG8f56.js +0 -77
- package/dist/gateway/static/root/assets/arrow-up-right-T72JbQ1Q.js +0 -1
- package/dist/gateway/static/root/assets/automation-task-card-D3WXVKRs.js +0 -2
- package/dist/gateway/static/root/assets/automations-workspace-2SOvmw-f.js +0 -9
- package/dist/gateway/static/root/assets/capabilities-page-U_hQx5ou.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-k5CcwhXN.js +0 -8
- package/dist/gateway/static/root/assets/channels-BUzno8Pi.js +0 -1
- package/dist/gateway/static/root/assets/chat-page-qnsMsF_s.js +0 -71
- package/dist/gateway/static/root/assets/gateway-realtime-store-OaEqjNTb.js +0 -1
- package/dist/gateway/static/root/assets/index-Cdo4_zon.js +0 -11
- package/dist/gateway/static/root/assets/index-DYTktubl.css +0 -1
- package/dist/gateway/static/root/assets/messages-e5MhDONm.js +0 -3
- package/dist/gateway/static/root/assets/new-chat-navigation-B6NPQ4h4.js +0 -1
- package/dist/gateway/static/root/assets/note-image-lightbox-DcDw5kp4.js +0 -1
- package/dist/gateway/static/root/assets/page-header-store-DeaRqZgV.js +0 -1
- package/dist/gateway/static/root/assets/personal-page-gMRmLCWG.js +0 -1
- package/dist/gateway/static/root/assets/product-delivery-BFfqdKLe.js +0 -1
- package/dist/gateway/static/root/assets/product-preview-modal-D9f-7kcI.js +0 -2
- package/dist/gateway/static/root/assets/project-detail-page-C4Z2HTRZ.js +0 -7
- package/dist/gateway/static/root/assets/route-preload-ClsAFFQc.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-BxBDgLrg.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-XgtApqIh.js +0 -25
- package/dist/gateway/static/root/assets/settings-advanced-gate-BBG8dTIY.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DmNEMg-l.js +0 -3
- package/dist/gateway/static/root/assets/workspace-editor-agent-store-C-J7vr2o.js +0 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { MusicRequestRejected } from "./provider.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/music-generation/mureka.ts
|
|
4
|
+
const task = z.object({ id: z.string().min(1).max(200) });
|
|
5
|
+
const status = z.object({
|
|
6
|
+
status: z.string(),
|
|
7
|
+
choices: z.array(z.object({
|
|
8
|
+
url: z.string().optional(),
|
|
9
|
+
duration: z.unknown().optional()
|
|
10
|
+
})).optional()
|
|
11
|
+
});
|
|
12
|
+
async function request(apiOrigin, key, path, input) {
|
|
13
|
+
const response = await fetch(new URL(path, apiOrigin), {
|
|
14
|
+
method: input ? "POST" : "GET",
|
|
15
|
+
headers: {
|
|
16
|
+
Authorization: `Bearer ${key}`,
|
|
17
|
+
...input ? { "Content-Type": "application/json" } : {}
|
|
18
|
+
},
|
|
19
|
+
body: input ? JSON.stringify(input) : void 0,
|
|
20
|
+
redirect: "error",
|
|
21
|
+
signal: AbortSignal.timeout(25e3)
|
|
22
|
+
});
|
|
23
|
+
if (!response.ok) {
|
|
24
|
+
await response.body?.cancel().catch(() => void 0);
|
|
25
|
+
const message = `Mureka returned HTTP ${response.status}.`;
|
|
26
|
+
if (input && [
|
|
27
|
+
400,
|
|
28
|
+
401,
|
|
29
|
+
402,
|
|
30
|
+
403,
|
|
31
|
+
404,
|
|
32
|
+
422,
|
|
33
|
+
429
|
|
34
|
+
].includes(response.status)) throw new MusicRequestRejected(message);
|
|
35
|
+
throw new Error(message);
|
|
36
|
+
}
|
|
37
|
+
return response.json();
|
|
38
|
+
}
|
|
39
|
+
function createMurekaProvider(id, apiOrigin) {
|
|
40
|
+
return {
|
|
41
|
+
id,
|
|
42
|
+
name: "Mureka",
|
|
43
|
+
models: { "mureka-9.5": {
|
|
44
|
+
modes: ["song", "instrumental"],
|
|
45
|
+
maxPromptCharacters: 1024,
|
|
46
|
+
maxLyricsCharacters: 5e3
|
|
47
|
+
} },
|
|
48
|
+
environmentKey: () => {
|
|
49
|
+
return (id === "mureka-cn" ? process.env.MUREKA_CN_API_KEY : process.env.MUREKA_GLOBAL_API_KEY)?.trim() || process.env.MUREKA_API_KEY?.trim() || void 0;
|
|
50
|
+
},
|
|
51
|
+
allowsAudioHost: (host) => host === "cdn.mureka.cn" || host === "cdn.mureka.ai" || (process.env.XOPC_MUREKA_AUDIO_HOSTS ?? "").split(",").some((value) => value.trim().toLowerCase() === host),
|
|
52
|
+
async submit(key, model, { mode, prompt, lyrics }) {
|
|
53
|
+
const result = await request(apiOrigin, key, `/v1/${mode === "song" ? "song" : "instrumental"}/generate`, {
|
|
54
|
+
model,
|
|
55
|
+
n: 1,
|
|
56
|
+
prompt,
|
|
57
|
+
...mode === "song" ? { lyrics } : {}
|
|
58
|
+
});
|
|
59
|
+
return task.parse(result).id;
|
|
60
|
+
},
|
|
61
|
+
async query(key, mode, taskId) {
|
|
62
|
+
const kind = mode === "song" ? "song" : "instrumental";
|
|
63
|
+
const result = status.parse(await request(apiOrigin, key, `/v1/${kind}/query/${encodeURIComponent(taskId)}`));
|
|
64
|
+
switch (result.status) {
|
|
65
|
+
case "preparing":
|
|
66
|
+
case "queued": return { state: "submitted" };
|
|
67
|
+
case "running":
|
|
68
|
+
case "streaming": return { state: "running" };
|
|
69
|
+
case "failed":
|
|
70
|
+
case "timeouted":
|
|
71
|
+
case "cancelled": return {
|
|
72
|
+
state: "failed",
|
|
73
|
+
reason: `Mureka task ended with status ${result.status}.`
|
|
74
|
+
};
|
|
75
|
+
case "succeeded": {
|
|
76
|
+
const choice = result.choices?.[0];
|
|
77
|
+
if (choice?.url) {
|
|
78
|
+
const duration = choice.duration;
|
|
79
|
+
const durationMs = typeof duration === "number" && Number.isSafeInteger(duration) && duration > 0 ? duration : null;
|
|
80
|
+
return {
|
|
81
|
+
state: "completed",
|
|
82
|
+
url: choice.url,
|
|
83
|
+
durationMs
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
throw new Error("Mureka returned an incomplete or unrecognized music task status.");
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
const murekaProvider = createMurekaProvider("mureka-cn", "https://api.mureka.cn");
|
|
94
|
+
const murekaGlobalProvider = createMurekaProvider("mureka-global", "https://api.mureka.ai");
|
|
95
|
+
//#endregion
|
|
96
|
+
export { murekaGlobalProvider, murekaProvider };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { MusicMode } from '@xopcai/gateway-contract';
|
|
2
|
+
export interface MusicInput {
|
|
3
|
+
mode: MusicMode;
|
|
4
|
+
prompt: string;
|
|
5
|
+
lyrics: string | null;
|
|
6
|
+
}
|
|
7
|
+
export type MusicProviderStatus = {
|
|
8
|
+
state: 'submitted' | 'running';
|
|
9
|
+
} | {
|
|
10
|
+
state: 'completed';
|
|
11
|
+
url: string;
|
|
12
|
+
durationMs: number | null;
|
|
13
|
+
} | {
|
|
14
|
+
state: 'failed';
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
export interface MusicProvider {
|
|
18
|
+
id: string;
|
|
19
|
+
name: string;
|
|
20
|
+
models: Readonly<Record<string, {
|
|
21
|
+
modes: readonly MusicMode[];
|
|
22
|
+
maxPromptCharacters: number;
|
|
23
|
+
maxLyricsCharacters: number;
|
|
24
|
+
}>>;
|
|
25
|
+
environmentKey(): string | undefined;
|
|
26
|
+
submit(key: string, model: string, input: MusicInput): Promise<string>;
|
|
27
|
+
query(key: string, mode: MusicMode, taskId: string): Promise<MusicProviderStatus>;
|
|
28
|
+
allowsAudioHost(host: string): boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare class MusicRequestRejected extends Error {
|
|
31
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MusicModelSettings } from '@xopcai/gateway-contract';
|
|
2
|
+
import type { MusicProvider } from './provider.js';
|
|
3
|
+
export declare const DEFAULT_MUSIC_MODEL = "mureka-cn/mureka-9.5";
|
|
4
|
+
export declare function resolveMusicModel(ref: string): {
|
|
5
|
+
provider: MusicProvider;
|
|
6
|
+
model: string;
|
|
7
|
+
capabilities: {
|
|
8
|
+
modes: readonly import("@xopcai/gateway-contract").MusicMode[];
|
|
9
|
+
maxPromptCharacters: number;
|
|
10
|
+
maxLyricsCharacters: number;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export declare function hasMusicProvider(id: string): boolean;
|
|
14
|
+
export declare function resolveMusicKey(provider: MusicProvider): Promise<string | undefined>;
|
|
15
|
+
export declare function configuredMusicModel(): Promise<{
|
|
16
|
+
ref: string;
|
|
17
|
+
defaults: import("@xopcai/gateway-contract").MusicGenerationDefaults;
|
|
18
|
+
provider: MusicProvider;
|
|
19
|
+
model: string;
|
|
20
|
+
capabilities: {
|
|
21
|
+
modes: readonly import("@xopcai/gateway-contract").MusicMode[];
|
|
22
|
+
maxPromptCharacters: number;
|
|
23
|
+
maxLyricsCharacters: number;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
export declare function readMusicModelSettings(): Promise<MusicModelSettings>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { murekaGlobalProvider, murekaProvider } from "./mureka.js";
|
|
2
|
+
import { getMusicDefaults, musicCredentials, storedMusicModel } from "./settings.js";
|
|
3
|
+
//#region src/music-generation/providers.ts
|
|
4
|
+
const providers = new Map([murekaProvider, murekaGlobalProvider].map((provider) => [provider.id, provider]));
|
|
5
|
+
const DEFAULT_MUSIC_MODEL = "mureka-cn/mureka-9.5";
|
|
6
|
+
function resolveMusicModel(ref) {
|
|
7
|
+
const [providerId, model, extra] = ref.split("/");
|
|
8
|
+
const provider = providers.get(providerId);
|
|
9
|
+
if (!model || extra !== void 0 || !provider || !Object.hasOwn(provider.models, model)) return void 0;
|
|
10
|
+
return {
|
|
11
|
+
provider,
|
|
12
|
+
model,
|
|
13
|
+
capabilities: provider.models[model]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
function selectedMusicModel() {
|
|
17
|
+
const ref = storedMusicModel() ?? process.env.XOPC_MUSIC_MODEL?.trim();
|
|
18
|
+
return ref && resolveMusicModel(ref) ? ref : DEFAULT_MUSIC_MODEL;
|
|
19
|
+
}
|
|
20
|
+
function hasMusicProvider(id) {
|
|
21
|
+
return providers.has(id);
|
|
22
|
+
}
|
|
23
|
+
async function resolveMusicKey(provider) {
|
|
24
|
+
return await musicCredentials().revealGatewayStoredApiKey(provider.id) ?? provider.environmentKey();
|
|
25
|
+
}
|
|
26
|
+
async function configuredMusicModel() {
|
|
27
|
+
const ref = selectedMusicModel();
|
|
28
|
+
const route = resolveMusicModel(ref);
|
|
29
|
+
if (!route || !await resolveMusicKey(route.provider)) return void 0;
|
|
30
|
+
return {
|
|
31
|
+
...route,
|
|
32
|
+
ref,
|
|
33
|
+
defaults: getMusicDefaults(ref, route.capabilities.modes)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
async function readMusicModelSettings() {
|
|
37
|
+
const models = [...providers.values()].flatMap((provider) => Object.entries(provider.models).map(([name, definition]) => ({
|
|
38
|
+
ref: `${provider.id}/${name}`,
|
|
39
|
+
name,
|
|
40
|
+
providerId: provider.id,
|
|
41
|
+
modes: definition.modes
|
|
42
|
+
})));
|
|
43
|
+
const credentials = Object.fromEntries(await Promise.all([...providers.values()].map(async (provider) => {
|
|
44
|
+
const saved = await musicCredentials().revealGatewayStoredApiKey(provider.id);
|
|
45
|
+
return [provider.id, saved ? "saved" : provider.environmentKey() ? "environment" : "missing"];
|
|
46
|
+
})));
|
|
47
|
+
const modelRef = selectedMusicModel();
|
|
48
|
+
return {
|
|
49
|
+
modelRef,
|
|
50
|
+
models,
|
|
51
|
+
credentials,
|
|
52
|
+
defaults: getMusicDefaults(modelRef, models.find((model) => model.ref === modelRef)?.modes ?? [])
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
//#endregion
|
|
56
|
+
export { DEFAULT_MUSIC_MODEL, configuredMusicModel, hasMusicProvider, readMusicModelSettings, resolveMusicKey, resolveMusicModel };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { MusicGenerationJob, MusicJobState, MusicMode } from '@xopcai/gateway-contract';
|
|
2
|
+
export interface MusicJobRow {
|
|
3
|
+
id: string;
|
|
4
|
+
conversation_id: string;
|
|
5
|
+
transcript_id: string;
|
|
6
|
+
work_id: string;
|
|
7
|
+
parent_id: string | null;
|
|
8
|
+
version_number: number;
|
|
9
|
+
model_ref: string;
|
|
10
|
+
request_hash: string;
|
|
11
|
+
title: string;
|
|
12
|
+
mode: MusicMode;
|
|
13
|
+
prompt: string;
|
|
14
|
+
lyrics: string | null;
|
|
15
|
+
state: MusicJobState;
|
|
16
|
+
provider_task_id: string | null;
|
|
17
|
+
duration_ms: number | null;
|
|
18
|
+
error: string | null;
|
|
19
|
+
created_at: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function publicMusicJob(row: MusicJobRow): MusicGenerationJob;
|
|
22
|
+
export declare function listMusicJobs(conversationId: string, transcriptId: string): MusicGenerationJob[];
|
|
23
|
+
export declare function listMusicJobIds(conversationId: string): string[];
|
|
24
|
+
export declare function getMusicJob(conversationId: string, id: string): MusicJobRow | undefined;
|
|
25
|
+
type MusicRequest = {
|
|
26
|
+
parentId?: string;
|
|
27
|
+
title?: string;
|
|
28
|
+
mode?: MusicMode;
|
|
29
|
+
prompt?: string;
|
|
30
|
+
lyrics?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare function enqueueMusicJob(conversationId: string, transcriptId: string, toolCallId: string, request: MusicRequest, signal?: AbortSignal): Promise<{
|
|
33
|
+
error: string;
|
|
34
|
+
job?: undefined;
|
|
35
|
+
} | {
|
|
36
|
+
job: MusicGenerationJob;
|
|
37
|
+
error?: undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export declare function claimMusicJob(): {
|
|
40
|
+
row: MusicJobRow;
|
|
41
|
+
token: `${string}-${string}-${string}-${string}-${string}`;
|
|
42
|
+
};
|
|
43
|
+
export declare function updateMusicJob(id: string, token: string, state: MusicJobState, options?: {
|
|
44
|
+
taskId?: string;
|
|
45
|
+
durationMs?: number | null;
|
|
46
|
+
error?: string;
|
|
47
|
+
delayMs?: number;
|
|
48
|
+
keepLease?: boolean;
|
|
49
|
+
}): boolean;
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { configuredMusicModel } from "./providers.js";
|
|
3
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
4
|
+
//#region src/music-generation/repository.ts
|
|
5
|
+
init_transaction();
|
|
6
|
+
function publicMusicJob(row) {
|
|
7
|
+
return {
|
|
8
|
+
id: row.id,
|
|
9
|
+
workId: row.work_id,
|
|
10
|
+
parentId: row.parent_id,
|
|
11
|
+
versionNumber: row.version_number,
|
|
12
|
+
modelRef: row.model_ref,
|
|
13
|
+
title: row.title,
|
|
14
|
+
mode: row.mode,
|
|
15
|
+
prompt: row.prompt,
|
|
16
|
+
lyrics: row.lyrics,
|
|
17
|
+
state: row.state,
|
|
18
|
+
durationMs: row.duration_ms,
|
|
19
|
+
error: row.error,
|
|
20
|
+
createdAt: row.created_at
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function listMusicJobs(conversationId, transcriptId) {
|
|
24
|
+
return getSqliteDatabase().prepare(`SELECT * FROM music_generation_jobs WHERE conversation_id = ?
|
|
25
|
+
AND transcript_id = ? ORDER BY created_at DESC, rowid DESC LIMIT 100`).all(conversationId, transcriptId).map(publicMusicJob);
|
|
26
|
+
}
|
|
27
|
+
function listMusicJobIds(conversationId) {
|
|
28
|
+
return getSqliteDatabase().prepare("SELECT id FROM music_generation_jobs WHERE conversation_id = ?").all(conversationId).map((row) => String(row.id));
|
|
29
|
+
}
|
|
30
|
+
function getMusicJob(conversationId, id) {
|
|
31
|
+
return getSqliteDatabase().prepare("SELECT * FROM music_generation_jobs WHERE conversation_id = ? AND id = ?").get(conversationId, id);
|
|
32
|
+
}
|
|
33
|
+
async function enqueueMusicJob(conversationId, transcriptId, toolCallId, request, signal) {
|
|
34
|
+
const id = createHash("sha256").update(JSON.stringify([
|
|
35
|
+
conversationId,
|
|
36
|
+
transcriptId,
|
|
37
|
+
toolCallId
|
|
38
|
+
])).digest("hex");
|
|
39
|
+
const hash = createHash("sha256").update(JSON.stringify([
|
|
40
|
+
request.parentId,
|
|
41
|
+
request.title,
|
|
42
|
+
request.mode,
|
|
43
|
+
request.prompt,
|
|
44
|
+
request.lyrics
|
|
45
|
+
])).digest("hex");
|
|
46
|
+
const route = await configuredMusicModel();
|
|
47
|
+
signal?.throwIfAborted();
|
|
48
|
+
return runSqliteWriteTransaction((db) => {
|
|
49
|
+
if (db.prepare("SELECT active_transcript_id FROM sessions WHERE conversation_id = ?").get(conversationId)?.active_transcript_id !== transcriptId) return { error: "The chat was reset. Ask the user to send the request again." };
|
|
50
|
+
const previous = getMusicJob(conversationId, id);
|
|
51
|
+
if (previous) return previous.request_hash === hash ? { job: publicMusicJob(previous) } : { error: "This request has already been submitted with different input." };
|
|
52
|
+
const parent = request.parentId ? getMusicJob(conversationId, request.parentId) : void 0;
|
|
53
|
+
if (request.parentId && (parent?.transcript_id !== transcriptId || parent.state !== "completed")) return { error: "Select a completed version from the current chat." };
|
|
54
|
+
if (!route) return { error: "Music generation is unavailable. Configure the Gateway music model and its API key." };
|
|
55
|
+
const mode = request.mode ?? (request.lyrics ? "song" : parent?.mode ?? route.defaults.mode);
|
|
56
|
+
const title = (request.title ?? parent?.title)?.trim();
|
|
57
|
+
const prompt = (request.prompt ?? parent?.prompt)?.trim();
|
|
58
|
+
const lyrics = mode === "song" ? request.lyrics ?? parent?.lyrics ?? null : null;
|
|
59
|
+
if (mode === "song" && !lyrics?.trim()) return { error: "Song generation requires lyrics. Provide complete lyrics, or use instrumental mode." };
|
|
60
|
+
if (!route.capabilities.modes.includes(mode) || !title || !prompt || title.length > 100 || Array.from(prompt).length > route.capabilities.maxPromptCharacters || lyrics !== null && Array.from(lyrics).length > route.capabilities.maxLyricsCharacters || mode === "instrumental" && request.lyrics !== void 0) return { error: "Invalid music input. Check the selected mode, description and lyrics limits before submitting." };
|
|
61
|
+
const now = Date.now();
|
|
62
|
+
const active = db.prepare(`SELECT count(*) AS count FROM music_generation_jobs
|
|
63
|
+
WHERE state IN ('queued', 'submitting', 'submitted', 'running', 'saving')`).get();
|
|
64
|
+
if (Number(active?.count) >= 3) return { error: "The music queue is full. Wait for an active request to finish." };
|
|
65
|
+
const day = Math.floor(now / 864e5);
|
|
66
|
+
const configuredLimit = process.env.XOPC_MUSIC_DAILY_LIMIT?.trim();
|
|
67
|
+
const limit = configuredLimit ? Number(configuredLimit) : 20;
|
|
68
|
+
if (!Number.isSafeInteger(limit) || limit < 0) return { error: "Invalid Gateway music daily limit." };
|
|
69
|
+
if (Number(db.prepare("SELECT count AS used FROM music_generation_daily_usage WHERE day = ?").get(day)?.used ?? 0) >= limit) return { error: "The Gateway has reached its daily music generation limit." };
|
|
70
|
+
db.prepare(`INSERT INTO music_generation_daily_usage (day, count) VALUES (?, 1)
|
|
71
|
+
ON CONFLICT(day) DO UPDATE SET count = count + 1`).run(day);
|
|
72
|
+
const workId = parent?.work_id ?? id;
|
|
73
|
+
const version = Number(db.prepare("SELECT MAX(version_number) AS version FROM music_generation_jobs WHERE work_id = ?").get(workId)?.version ?? 0) + 1;
|
|
74
|
+
db.prepare(`INSERT INTO music_generation_jobs (id, conversation_id, transcript_id, work_id, parent_id, version_number, model_ref,
|
|
75
|
+
request_hash, title, mode, prompt, lyrics, state, next_attempt_at, created_at)
|
|
76
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 'queued', ?, ?)`).run(id, conversationId, transcriptId, workId, parent?.id ?? null, version, route.ref, hash, title, mode, prompt, lyrics, now, now);
|
|
77
|
+
return { job: publicMusicJob(getMusicJob(conversationId, id)) };
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function claimMusicJob() {
|
|
81
|
+
return runSqliteWriteTransaction((db) => {
|
|
82
|
+
const now = Date.now();
|
|
83
|
+
db.prepare(`UPDATE music_generation_jobs SET state = 'submission_unknown', lease_token = NULL, lease_until = NULL
|
|
84
|
+
WHERE state = 'submitting' AND lease_until <= ?`).run(now);
|
|
85
|
+
const row = db.prepare(`SELECT * FROM music_generation_jobs WHERE state IN ('queued', 'submitted', 'running', 'saving')
|
|
86
|
+
AND next_attempt_at <= ? AND (lease_until IS NULL OR lease_until <= ?) ORDER BY next_attempt_at, rowid LIMIT 1`).get(now, now);
|
|
87
|
+
if (!row) return void 0;
|
|
88
|
+
const token = randomUUID();
|
|
89
|
+
db.prepare("UPDATE music_generation_jobs SET lease_token = ?, lease_until = ? WHERE id = ?").run(token, now + 12e4, row.id);
|
|
90
|
+
return {
|
|
91
|
+
row,
|
|
92
|
+
token
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function updateMusicJob(id, token, state, options = {}) {
|
|
97
|
+
const now = Date.now();
|
|
98
|
+
return getSqliteDatabase().prepare(`UPDATE music_generation_jobs SET state = ?, error = ?,
|
|
99
|
+
provider_task_id = COALESCE(?, provider_task_id), duration_ms = COALESCE(?, duration_ms), next_attempt_at = ?,
|
|
100
|
+
lease_token = CASE WHEN ? THEN lease_token END, lease_until = CASE WHEN ? THEN lease_until END
|
|
101
|
+
WHERE id = ? AND lease_token = ? AND lease_until > ?`).run(state, options.error ?? null, options.taskId ?? null, options.durationMs ?? null, now + (options.delayMs ?? 0), Number(options.keepLease ?? false), Number(options.keepLease ?? false), id, token, now).changes === 1;
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { claimMusicJob, enqueueMusicJob, getMusicJob, listMusicJobIds, listMusicJobs, publicMusicJob, updateMusicJob };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { MusicGenerationDefaults, MusicMode } from '@xopcai/gateway-contract';
|
|
2
|
+
import { CredentialResolver } from '../auth/credentials.js';
|
|
3
|
+
export declare function storedMusicModel(): string | undefined;
|
|
4
|
+
export declare function saveMusicModel(modelRef: string): void;
|
|
5
|
+
export declare function getMusicDefaults(modelRef: string, modes: readonly MusicMode[]): MusicGenerationDefaults;
|
|
6
|
+
export declare function saveMusicDefaults(modelRef: string, settings: MusicGenerationDefaults): void;
|
|
7
|
+
export declare function musicCredentials(): CredentialResolver;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
2
|
+
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
3
|
+
//#region src/music-generation/settings.ts
|
|
4
|
+
init_credentials();
|
|
5
|
+
const settings = new DurableState("music-generation");
|
|
6
|
+
const defaults = new DurableState("music-generation-defaults");
|
|
7
|
+
function storedMusicModel() {
|
|
8
|
+
return settings.get("model");
|
|
9
|
+
}
|
|
10
|
+
function saveMusicModel(modelRef) {
|
|
11
|
+
settings.set("model", modelRef);
|
|
12
|
+
}
|
|
13
|
+
function getMusicDefaults(modelRef, modes) {
|
|
14
|
+
const saved = defaults.get(modelRef);
|
|
15
|
+
return { mode: saved && modes.includes(saved.mode) ? saved.mode : modes[0] ?? "song" };
|
|
16
|
+
}
|
|
17
|
+
function saveMusicDefaults(modelRef, settings) {
|
|
18
|
+
defaults.set(modelRef, settings);
|
|
19
|
+
}
|
|
20
|
+
function musicCredentials() {
|
|
21
|
+
return new CredentialResolver();
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { getMusicDefaults, musicCredentials, saveMusicDefaults, saveMusicModel, storedMusicModel };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { MusicRequestRejected } from "./provider.js";
|
|
4
|
+
import { resolveMusicKey, resolveMusicModel } from "./providers.js";
|
|
5
|
+
import { claimMusicJob, getMusicJob, updateMusicJob } from "./repository.js";
|
|
6
|
+
import { deleteMusicArtifact, musicArtifactExists, saveMusicArtifact } from "./artifact.js";
|
|
7
|
+
//#region src/music-generation/worker.ts
|
|
8
|
+
init_logger();
|
|
9
|
+
const log = createLogger("MusicGeneration");
|
|
10
|
+
const pollMs = 8e3;
|
|
11
|
+
const retryMs = 2e4;
|
|
12
|
+
const lifetimeMs = 720 * 6e4;
|
|
13
|
+
var MusicGenerationWorker = class {
|
|
14
|
+
timer;
|
|
15
|
+
work;
|
|
16
|
+
start() {
|
|
17
|
+
if (this.timer) return;
|
|
18
|
+
this.timer = setInterval(() => this.tick(), 1e3);
|
|
19
|
+
this.timer.unref();
|
|
20
|
+
this.tick();
|
|
21
|
+
}
|
|
22
|
+
async stop() {
|
|
23
|
+
clearInterval(this.timer);
|
|
24
|
+
this.timer = void 0;
|
|
25
|
+
await this.work;
|
|
26
|
+
}
|
|
27
|
+
tick() {
|
|
28
|
+
if (this.work) return;
|
|
29
|
+
this.work = this.runNext().catch((err) => log.error({ err }, "Music worker iteration failed")).finally(() => {
|
|
30
|
+
this.work = void 0;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
async runNext() {
|
|
34
|
+
const claimed = claimMusicJob();
|
|
35
|
+
if (!claimed) return;
|
|
36
|
+
const { row, token } = claimed;
|
|
37
|
+
const { id, mode } = row;
|
|
38
|
+
if (row.state === "saving" && await musicArtifactExists(id)) {
|
|
39
|
+
updateMusicJob(id, token, "completed");
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (Date.now() - row.created_at >= lifetimeMs) {
|
|
43
|
+
updateMusicJob(id, token, "failed", { error: "The music task or its download is no longer available." });
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const route = resolveMusicModel(row.model_ref);
|
|
47
|
+
const key = route && await resolveMusicKey(route.provider);
|
|
48
|
+
if (!route || !key) {
|
|
49
|
+
updateMusicJob(id, token, row.state, {
|
|
50
|
+
delayMs: retryMs,
|
|
51
|
+
error: "Restore the original music model credentials to resume."
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const { provider, model } = route;
|
|
56
|
+
if (row.state === "queued") {
|
|
57
|
+
if (!updateMusicJob(id, token, "submitting", { keepLease: true })) return;
|
|
58
|
+
try {
|
|
59
|
+
updateMusicJob(id, token, "submitted", {
|
|
60
|
+
taskId: await provider.submit(key, model, {
|
|
61
|
+
mode,
|
|
62
|
+
prompt: row.prompt,
|
|
63
|
+
lyrics: row.lyrics
|
|
64
|
+
}),
|
|
65
|
+
delayMs: pollMs
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
if (err instanceof MusicRequestRejected) {
|
|
69
|
+
updateMusicJob(id, token, "failed", { error: err.message });
|
|
70
|
+
log.warn({
|
|
71
|
+
jobId: id,
|
|
72
|
+
modelRef: row.model_ref
|
|
73
|
+
}, err.message);
|
|
74
|
+
} else {
|
|
75
|
+
updateMusicJob(id, token, "submission_unknown", { error: "The provider may have accepted this request." });
|
|
76
|
+
log.warn({
|
|
77
|
+
jobId: id,
|
|
78
|
+
modelRef: row.model_ref
|
|
79
|
+
}, "Music submission could not be confirmed");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let saving = row.state === "saving";
|
|
85
|
+
try {
|
|
86
|
+
if (!row.provider_task_id) throw new Error("Missing remote music task ID.");
|
|
87
|
+
const result = await provider.query(key, mode, row.provider_task_id);
|
|
88
|
+
switch (result.state) {
|
|
89
|
+
case "submitted":
|
|
90
|
+
case "running":
|
|
91
|
+
updateMusicJob(id, token, result.state, { delayMs: pollMs });
|
|
92
|
+
return;
|
|
93
|
+
case "failed":
|
|
94
|
+
updateMusicJob(id, token, "failed", { error: result.reason });
|
|
95
|
+
return;
|
|
96
|
+
case "completed":
|
|
97
|
+
if (!updateMusicJob(id, token, "saving", {
|
|
98
|
+
durationMs: result.durationMs,
|
|
99
|
+
keepLease: true
|
|
100
|
+
})) return;
|
|
101
|
+
saving = true;
|
|
102
|
+
await saveMusicArtifact(id, provider, result.url, () => updateMusicJob(id, token, "saving", { keepLease: true }));
|
|
103
|
+
if (await musicArtifactExists(id)) updateMusicJob(id, token, "completed");
|
|
104
|
+
if (!getMusicJob(row.conversation_id, id)) await deleteMusicArtifact(id);
|
|
105
|
+
}
|
|
106
|
+
} catch {
|
|
107
|
+
updateMusicJob(id, token, saving ? "saving" : row.state, {
|
|
108
|
+
delayMs: retryMs,
|
|
109
|
+
error: saving ? "Audio download failed. Retrying the same result." : "Status check failed. Retrying."
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
export { MusicGenerationWorker };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const PERSONAL_MAIN_TOOL_IDS: readonly ["personal_task", "personal_attention", "personal_capability", "personal_request", "session_recall", "read_media", "read_file", "session_search", "personal_read", "personal_result", "user_context_read", "knowledge_read", "personal_memory"];
|
|
1
|
+
export declare const PERSONAL_MAIN_TOOL_IDS: readonly ["personal_task", "personal_attention", "personal_capability", "personal_request", "session_recall", "read_media", "read_file", "session_search", "personal_read", "personal_result", "user_context_read", "knowledge_read", "personal_memory", "video_draft", "music_generation"];
|
|
2
2
|
export declare const PERSONAL_TOOL_DESCRIPTIONS: Readonly<Record<string, string>>;
|
|
3
3
|
export declare const PERSONAL_READ_TOOL_ALIASES: Readonly<Record<string, string>>;
|
|
@@ -12,7 +12,9 @@ const PERSONAL_MAIN_TOOL_IDS = [
|
|
|
12
12
|
"personal_result",
|
|
13
13
|
"user_context_read",
|
|
14
14
|
"knowledge_read",
|
|
15
|
-
"personal_memory"
|
|
15
|
+
"personal_memory",
|
|
16
|
+
"video_draft",
|
|
17
|
+
"music_generation"
|
|
16
18
|
];
|
|
17
19
|
const PERSONAL_TOOL_DESCRIPTIONS = {
|
|
18
20
|
session_recall: "Find exact facts in this conversation, including compacted history. Cannot access other chats.",
|
|
@@ -100,6 +100,8 @@ function projectPersonalInstructions(instructions, toolNames) {
|
|
|
100
100
|
if (group.requires.every((tool) => tools.has(tool))) continue;
|
|
101
101
|
for (const rule of group.rules) projected = omitInstructionBlock(projected, rule);
|
|
102
102
|
}
|
|
103
|
+
if (tools.has("music_generation")) projected += "\nUse music_generation for song or instrumental requests. Explicit requests can enqueue directly. If the user asks to review lyrics first, present them in chat and wait for their request to generate.";
|
|
104
|
+
if (tools.has("video_draft")) projected += "\nFor video generation in this chat, use video_draft directly to prepare or revise the draft and let the user confirm it in chat.";
|
|
103
105
|
return projected;
|
|
104
106
|
}
|
|
105
107
|
const PERSONAL_MEMORY_RULE = "A self-description or preference without a request to persist it is handled by background learning; adapt to it in the current reply, do not call personal_memory or claim it has already been saved. For an explicit request to remember, correct, forget, or limit saved memory, use personal_memory directly instead of delegating or promising background learning. Quote the current owner request in userEvidence. User identity/preferences use target=user; project facts, decisions and lessons use target=knowledge. Before changing an existing item read its id and version using the matching read tool. Resolve scope from what the user asks: global, current agent, workspace, project or session. Never broaden a local request. Missing current project is an error, not permission to fall back globally. Only say saved after status=saved with usable=true; pending means saved for review but not in use. A receipt records a past commit; available/usable describe current state on retries. Forgotten means future automatic recall stops, while originals and already running prompts may retain content. Keep acknowledgements short, name the actual scope, and offer correction only when useful. Memory cannot authorize external actions.";
|
|
@@ -24,6 +24,7 @@ export interface ClientHistoryMessage {
|
|
|
24
24
|
metadata?: {
|
|
25
25
|
/** Stable client-generated id used to reconcile optimistic sends exactly. */
|
|
26
26
|
clientMessageId?: string;
|
|
27
|
+
steered?: true;
|
|
27
28
|
sourceContexts?: Array<{
|
|
28
29
|
refId?: string;
|
|
29
30
|
kind: 'result' | 'note' | 'task' | 'file' | 'session' | 'browser_tab' | 'browser_page' | 'mcp_resource';
|
|
@@ -35,11 +35,7 @@ function sourceContextDisplayMetadata(metadata) {
|
|
|
35
35
|
const clientMessageId = typeof record.clientMessageId === "string" && record.clientMessageId.trim() ? record.clientMessageId : void 0;
|
|
36
36
|
const rows = record.sourceContexts;
|
|
37
37
|
const userTurnDocument = isUserTurnDocument(record.userTurnDocument) ? record.userTurnDocument : void 0;
|
|
38
|
-
|
|
39
|
-
...clientMessageId ? { clientMessageId } : {},
|
|
40
|
-
...userTurnDocument ? { userTurnDocument } : {}
|
|
41
|
-
} : void 0;
|
|
42
|
-
const sourceContexts = rows.flatMap((value) => {
|
|
38
|
+
const sourceContexts = (Array.isArray(rows) ? rows : []).flatMap((value) => {
|
|
43
39
|
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
44
40
|
const row = value;
|
|
45
41
|
if (row.kind !== "note" && row.kind !== "task" && row.kind !== "file" && row.kind !== "session" && row.kind !== "browser_tab" && row.kind !== "result" && row.kind !== "browser_page" && row.kind !== "mcp_resource" || typeof row.sourceId !== "string" || typeof row.version !== "string" || typeof row.title !== "string") return [];
|
|
@@ -58,7 +54,10 @@ function sourceContextDisplayMetadata(metadata) {
|
|
|
58
54
|
}];
|
|
59
55
|
});
|
|
60
56
|
return clientMessageId || sourceContexts.length || userTurnDocument ? {
|
|
61
|
-
...clientMessageId ? {
|
|
57
|
+
...clientMessageId ? {
|
|
58
|
+
clientMessageId,
|
|
59
|
+
...record.steered === true ? { steered: true } : {}
|
|
60
|
+
} : {},
|
|
62
61
|
...sourceContexts.length ? { sourceContexts } : {},
|
|
63
62
|
...userTurnDocument ? { userTurnDocument } : {}
|
|
64
63
|
} : void 0;
|
|
@@ -20,9 +20,14 @@ import { ACCEPTANCE_REPAIR_READ_TOOLS, canResumeAfterModelFailure } from "../age
|
|
|
20
20
|
import { transcriptRowsToClientHistory } from "./client-history.js";
|
|
21
21
|
import { SessionCompactor } from "../agent/memory/compaction.js";
|
|
22
22
|
import { resolveCompactionPolicy } from "../agent/memory/compaction-policy.js";
|
|
23
|
+
import { listMusicJobIds } from "../music-generation/repository.js";
|
|
24
|
+
import { listVideoJobIds } from "../video-generation/repository.js";
|
|
25
|
+
import { deleteVideoDraft } from "../video-generation/drafts.js";
|
|
23
26
|
import { IdleCompactionScheduler } from "../agent/memory/idle-compaction-scheduler.js";
|
|
24
27
|
import { readPostCompactionContext } from "../agent/reply/post-compaction-context.js";
|
|
25
28
|
import { promoteCompactionLedger } from "../agent/memory/compaction-promotion.js";
|
|
29
|
+
import { deleteMusicArtifact } from "../music-generation/artifact.js";
|
|
30
|
+
import { deleteVideoArtifact } from "../video-generation/artifact.js";
|
|
26
31
|
import { SlidingWindow } from "../agent/memory/window.js";
|
|
27
32
|
import { isAppendOnlyLlmTranscriptMessage } from "./transcript-stats.js";
|
|
28
33
|
import { compactHistory } from "./compact-history.js";
|
|
@@ -336,6 +341,7 @@ var SessionStore = class {
|
|
|
336
341
|
requireXopcDatabase();
|
|
337
342
|
const task = resetSessionRecord(key, this.resolveWorkspaceCwd(key));
|
|
338
343
|
if (task) {
|
|
344
|
+
deleteVideoDraft(key);
|
|
339
345
|
this.clearCompactionCheckpoint(key);
|
|
340
346
|
log.info({
|
|
341
347
|
key,
|
|
@@ -349,8 +355,12 @@ var SessionStore = class {
|
|
|
349
355
|
this.idleCompaction.interrupt(key);
|
|
350
356
|
return this.runStoreMutation(async () => {
|
|
351
357
|
requireXopcDatabase();
|
|
358
|
+
const videoJobs = listVideoJobIds(key);
|
|
359
|
+
const musicJobs = listMusicJobIds(key);
|
|
352
360
|
const ok = deleteSessionRecord(key);
|
|
353
361
|
if (ok) {
|
|
362
|
+
deleteVideoDraft(key);
|
|
363
|
+
await Promise.allSettled([...videoJobs.map(deleteVideoArtifact), ...musicJobs.map(deleteMusicArtifact)]);
|
|
354
364
|
this.clearCompactionCheckpoint(key);
|
|
355
365
|
log.info({ key }, "Session deleted");
|
|
356
366
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatabaseSync } from 'node:sqlite';
|
|
2
2
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, readSchemaVersionForTest, readSchemaVersion, setSchemaVersion, ensureSchemaMetaTable } from './schema-version.js';
|
|
3
|
-
export declare const XOPC_DB_SCHEMA_VERSION =
|
|
4
|
-
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION =
|
|
3
|
+
export declare const XOPC_DB_SCHEMA_VERSION = 277;
|
|
4
|
+
export declare const XOPC_DB_BASELINE_SCHEMA_VERSION = 277;
|
|
5
5
|
export { XOPC_DB_MINIMUM_SCHEMA_VERSION } from './schema-upgrade.js';
|
|
6
6
|
/** Initialize fresh databases directly; upgrade supported installed databases transactionally. */
|
|
7
7
|
export declare function ensureXopcDatabaseSchema(db: DatabaseSync): void;
|