@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
|
@@ -96,6 +96,8 @@ export declare class TurnDispatcher {
|
|
|
96
96
|
attachments?: DirectAttachment[];
|
|
97
97
|
sourceContexts?: AgentSourceContext[];
|
|
98
98
|
voiceAgentInstruction?: boolean;
|
|
99
|
+
clientMessageId?: string;
|
|
100
|
+
onHandled?: () => void;
|
|
99
101
|
}): Promise<boolean>;
|
|
100
102
|
private buildStreamingDeps;
|
|
101
103
|
private buildOneShotDeps;
|
|
@@ -89,18 +89,23 @@ var TurnDispatcher = class {
|
|
|
89
89
|
if (options?.attachments?.length || options?.sourceContexts?.length) {
|
|
90
90
|
const c = this.cfg;
|
|
91
91
|
const modelRef = c.modelManager.getModelForSession(conversationId);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
92
|
+
const transcriptMessage = {
|
|
93
|
+
...await buildDirectUserMessageContent({
|
|
94
|
+
content: trimmed,
|
|
95
|
+
attachments: await c.prepareInboundAttachments(conversationId, options.attachments),
|
|
96
|
+
conversationId,
|
|
97
|
+
config: c.requireConfig(),
|
|
98
|
+
agentManager: c.agentManager,
|
|
99
|
+
modelManager: c.modelManager
|
|
100
|
+
}),
|
|
101
|
+
metadata: {
|
|
102
|
+
...options.clientMessageId ? {
|
|
103
|
+
clientMessageId: options.clientMessageId,
|
|
104
|
+
steered: true
|
|
105
|
+
} : {},
|
|
106
|
+
...options.sourceContexts?.length ? { sourceContexts: options.sourceContexts.map(summarizeSourceContext) } : {}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
104
109
|
const hydrated = await hydrateUserTurnForLlm({
|
|
105
110
|
message: transcriptMessage,
|
|
106
111
|
modelRef
|
|
@@ -108,9 +113,22 @@ var TurnDispatcher = class {
|
|
|
108
113
|
const contextImages = resolveImageHandlingStrategy(modelRef) === "native" ? options.sourceContexts?.flatMap((context) => context.images ?? []) ?? [] : [];
|
|
109
114
|
return await queueEmbeddedSteer(conversationId, hydrated.text, expectedRunId, {
|
|
110
115
|
images: [...hydrated.images, ...contextImages],
|
|
111
|
-
transcriptMessage
|
|
116
|
+
transcriptMessage,
|
|
117
|
+
onHandled: options.onHandled
|
|
112
118
|
});
|
|
113
119
|
}
|
|
120
|
+
if (options?.clientMessageId) return await queueEmbeddedSteer(conversationId, trimmed, expectedRunId, {
|
|
121
|
+
transcriptMessage: {
|
|
122
|
+
role: "user",
|
|
123
|
+
content: trimmed,
|
|
124
|
+
timestamp: Date.now(),
|
|
125
|
+
metadata: {
|
|
126
|
+
clientMessageId: options.clientMessageId,
|
|
127
|
+
steered: true
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
onHandled: options.onHandled
|
|
131
|
+
});
|
|
114
132
|
return await queueEmbeddedSteer(conversationId, trimmed, expectedRunId);
|
|
115
133
|
} catch (err) {
|
|
116
134
|
this.log.warn({
|
|
@@ -83,6 +83,7 @@ var OutboundCoordinator = class {
|
|
|
83
83
|
accountId: msg.metadata?.accountId,
|
|
84
84
|
threadId: msg.metadata?.threadId,
|
|
85
85
|
inboundMessageId: msg.metadata?.messageId,
|
|
86
|
+
...typeof msg.metadata?.channelReplyId === "string" ? { channelReplyId: msg.metadata.channelReplyId } : {},
|
|
86
87
|
transcribedVoice: sessionContext.metadata?.transcribedVoice,
|
|
87
88
|
sessionWebhook: msg.metadata?.sessionWebhook,
|
|
88
89
|
conversationId: msg.metadata?.conversationId
|
|
@@ -38,6 +38,8 @@ const CORE_TOOL_ORDER = [
|
|
|
38
38
|
"text_to_speech",
|
|
39
39
|
"image",
|
|
40
40
|
"image_generate",
|
|
41
|
+
"video_draft",
|
|
42
|
+
"music_generation",
|
|
41
43
|
"create_share"
|
|
42
44
|
];
|
|
43
45
|
const CORE_TOOL_SUMMARIES = {
|
|
@@ -79,6 +81,8 @@ const CORE_TOOL_SUMMARIES = {
|
|
|
79
81
|
text_to_speech: "Send a standalone voice message",
|
|
80
82
|
image: "Analyze an image with the configured vision model",
|
|
81
83
|
image_generate: "Generate images with the configured image model",
|
|
84
|
+
music_generation: "Create songs or instrumental music and inspect existing jobs in the current chat",
|
|
85
|
+
video_draft: "Prepare or revise a text-to-video or image-to-video draft for confirmation in the current chat",
|
|
82
86
|
create_share: "Create a shareable link for workspace files"
|
|
83
87
|
};
|
|
84
88
|
function buildToolingSection(params) {
|
|
@@ -56,7 +56,7 @@ var SystemPromptBuilder = class {
|
|
|
56
56
|
extraSystemPrompt: [
|
|
57
57
|
options.extraSystemPrompt,
|
|
58
58
|
getConversationalConfigurationGuide(reg),
|
|
59
|
-
agentSetup ? "
|
|
59
|
+
agentSetup ? "This conversation is for creating a new expert. Treat the user’s description of responsibilities and expected deliverables as requirements. Ask about missing details when needed, and give the expert a short profile description of its responsibilities. Follow Response Language for every question and reply. A language requested for the new Agent configures that Agent only. Keep the current conversation language unless the user asks to switch it." : void 0,
|
|
60
60
|
interactionPrompt
|
|
61
61
|
].filter(Boolean).join("\n\n"),
|
|
62
62
|
activeProjectContext: options.activeProjectContext,
|
|
@@ -82,6 +82,8 @@ import { withTaskEvidenceIdentity } from "./task-evidence.js";
|
|
|
82
82
|
import { withPersonalPerformance } from "./personal-performance.js";
|
|
83
83
|
import { createPersonalRequestTools } from "./personal-request-tool.js";
|
|
84
84
|
import { createPersonalRequestConnectionTool, createPersonalRequestResultTool } from "./personal-request-result-tool.js";
|
|
85
|
+
import { createMusicGenerationTool } from "./music-generation-tool.js";
|
|
86
|
+
import { createVideoDraftTool } from "./video-draft-tool.js";
|
|
85
87
|
import { RemoteDeviceBrowserDriver } from "../../browser/remote/device-driver.js";
|
|
86
88
|
import { RemoteDeviceBrowserRuntime } from "../../browser/remote/device-runtime.js";
|
|
87
89
|
import { remoteBrowserEndpoint } from "../../browser/remote/device-target.js";
|
|
@@ -415,7 +417,18 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
415
417
|
getMemoryManager: getMemMgr,
|
|
416
418
|
canAccessMemory: () => currentAccess().knowledge
|
|
417
419
|
});
|
|
418
|
-
const
|
|
420
|
+
const webMediaConversation = () => {
|
|
421
|
+
const id = currentConversationId();
|
|
422
|
+
const current = this.deps.getCurrentContext();
|
|
423
|
+
if (!id || current && (current.conversationId !== id || current.channel !== "webchat")) return void 0;
|
|
424
|
+
const session = isXopcDatabaseOpen() ? getSessionMetadata(id) : null;
|
|
425
|
+
return session?.sourceChannel === "webchat" && session.sessionType === "chat" && !session.customData?.automationSetup ? id : void 0;
|
|
426
|
+
};
|
|
427
|
+
const optionalTools = [
|
|
428
|
+
imageTool,
|
|
429
|
+
imageGenerateTool,
|
|
430
|
+
...webMediaConversation() ? [createVideoDraftTool(webMediaConversation), createMusicGenerationTool(webMediaConversation)] : []
|
|
431
|
+
].filter((t) => t != null);
|
|
419
432
|
const readTool = createReadFileTool(workspace, {
|
|
420
433
|
profileMarkdownRoot: options?.profileMarkdownRoot,
|
|
421
434
|
...personalToolsConfigured ? {
|
|
@@ -0,0 +1,11 @@
|
|
|
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<"generate">, import("@sinclair/typebox").TLiteral<"inspect">]>;
|
|
4
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
5
|
+
mode: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"song">, import("@sinclair/typebox").TLiteral<"instrumental">]>>;
|
|
6
|
+
prompt: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
lyrics: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
parentId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function createMusicGenerationTool(getConversationId: () => string | undefined): AgentTool<typeof schema>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { getCurrentTranscriptId, init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
2
|
+
import { configuredMusicModel } from "../../music-generation/providers.js";
|
|
3
|
+
import { enqueueMusicJob, getMusicJob, listMusicJobs, publicMusicJob } from "../../music-generation/repository.js";
|
|
4
|
+
import { Type } from "@sinclair/typebox";
|
|
5
|
+
//#region src/agent/tools/music-generation-tool.ts
|
|
6
|
+
init_session_repository();
|
|
7
|
+
const schema = Type.Object({
|
|
8
|
+
action: Type.Union([Type.Literal("generate"), Type.Literal("inspect")]),
|
|
9
|
+
title: Type.Optional(Type.String({
|
|
10
|
+
minLength: 1,
|
|
11
|
+
maxLength: 100
|
|
12
|
+
})),
|
|
13
|
+
mode: Type.Optional(Type.Union([Type.Literal("song"), Type.Literal("instrumental")])),
|
|
14
|
+
prompt: Type.Optional(Type.String({
|
|
15
|
+
minLength: 1,
|
|
16
|
+
maxLength: 5e3
|
|
17
|
+
})),
|
|
18
|
+
lyrics: Type.Optional(Type.String({
|
|
19
|
+
minLength: 1,
|
|
20
|
+
maxLength: 12e3
|
|
21
|
+
})),
|
|
22
|
+
parentId: Type.Optional(Type.String({ pattern: "^[0-9a-f]{64}$" }))
|
|
23
|
+
}, { additionalProperties: false });
|
|
24
|
+
function createMusicGenerationTool(getConversationId) {
|
|
25
|
+
return {
|
|
26
|
+
name: "music_generation",
|
|
27
|
+
label: "Create music",
|
|
28
|
+
description: "Generate a song or instrumental as an asynchronous paid request in this chat, or inspect existing requests. Generate only when the user explicitly asks to create audio or confirms their earlier lyrics or brief. For a new song provide a title, song mode, a style prompt, and complete lyrics. Keep user-supplied lyrics verbatim. If the user has no preference, inspect the configured default mode before preparing the request. For an instrumental omit lyrics. If the user asks to review lyrics first, show them in chat and wait for their request to generate. For revisions, inspect completed versions, pass the exact parentId and only fields the user wants changed. Ask which version if ambiguous. The tool enqueues one work per call. Do not repeat generation to check progress or after an unconfirmed submission. Use inspect for status, or inspect with parentId to read the exact prior input, and tell the user to play the result from the chat card when ready.",
|
|
29
|
+
parameters: schema,
|
|
30
|
+
async execute(toolCallId, { action, ...request }, signal) {
|
|
31
|
+
signal?.throwIfAborted();
|
|
32
|
+
const conversationId = getConversationId();
|
|
33
|
+
if (!conversationId) throw new Error("Music generation is available in Web chat.");
|
|
34
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
35
|
+
if (!transcriptId) throw new Error("The current chat is unavailable.");
|
|
36
|
+
if (action === "inspect") {
|
|
37
|
+
const route = await configuredMusicModel();
|
|
38
|
+
const selected = request.parentId ? getMusicJob(conversationId, request.parentId) : void 0;
|
|
39
|
+
const result = request.parentId ? { job: selected?.transcript_id === transcriptId ? publicMusicJob(selected) : null } : {
|
|
40
|
+
configured: Boolean(route),
|
|
41
|
+
capabilities: route?.capabilities,
|
|
42
|
+
defaults: route?.defaults,
|
|
43
|
+
jobs: listMusicJobs(conversationId, transcriptId).slice(0, 12).map(({ lyrics, prompt, ...job }) => job)
|
|
44
|
+
};
|
|
45
|
+
return {
|
|
46
|
+
content: [{
|
|
47
|
+
type: "text",
|
|
48
|
+
text: JSON.stringify(result)
|
|
49
|
+
}],
|
|
50
|
+
details: result
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const result = await enqueueMusicJob(conversationId, transcriptId, toolCallId, request, signal);
|
|
54
|
+
const receipt = result.job ? {
|
|
55
|
+
id: result.job.id,
|
|
56
|
+
workId: result.job.workId,
|
|
57
|
+
state: result.job.state
|
|
58
|
+
} : result;
|
|
59
|
+
return {
|
|
60
|
+
content: [{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: JSON.stringify(receipt)
|
|
63
|
+
}],
|
|
64
|
+
details: receipt
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
//#endregion
|
|
70
|
+
export { createMusicGenerationTool };
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
duration: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TInteger>;
|
|
6
|
+
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">]>>;
|
|
7
|
+
resolution: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"480P">, import("@sinclair/typebox").TLiteral<"720P">, import("@sinclair/typebox").TLiteral<"1080P">]>>;
|
|
8
|
+
image: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"current">, import("@sinclair/typebox").TLiteral<"none">]>>;
|
|
9
|
+
imageUri: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function createVideoDraftTool(getConversationId: () => string | undefined): AgentTool<typeof schema>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
duration: Type.Optional(Type.Integer()),
|
|
17
|
+
ratio: Type.Optional(Type.Union([
|
|
18
|
+
Type.Literal("16:9"),
|
|
19
|
+
Type.Literal("9:16"),
|
|
20
|
+
Type.Literal("adaptive")
|
|
21
|
+
])),
|
|
22
|
+
resolution: Type.Optional(Type.Union([
|
|
23
|
+
Type.Literal("480P"),
|
|
24
|
+
Type.Literal("720P"),
|
|
25
|
+
Type.Literal("1080P")
|
|
26
|
+
])),
|
|
27
|
+
image: Type.Optional(Type.Union([Type.Literal("current"), Type.Literal("none")])),
|
|
28
|
+
imageUri: Type.Optional(Type.String({ maxLength: 512 }))
|
|
29
|
+
});
|
|
30
|
+
function createVideoDraftTool(getConversationId) {
|
|
31
|
+
return {
|
|
32
|
+
name: "video_draft",
|
|
33
|
+
label: "Prepare video draft",
|
|
34
|
+
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. The draft appears as a card. Tell the user to click Generate or reply “confirm video generation” / “就按这个生成” to submit the reviewed draft. This tool cannot start generation.",
|
|
35
|
+
parameters: schema,
|
|
36
|
+
async execute(_id, args) {
|
|
37
|
+
if (!Value.Check(schema, args)) throw new Error("Invalid video draft parameters.");
|
|
38
|
+
const conversationId = getConversationId();
|
|
39
|
+
if (!conversationId) throw new Error("Video drafts are available in Web chat.");
|
|
40
|
+
if (args.action === "inspect") {
|
|
41
|
+
const transcriptId = getCurrentTranscriptId(conversationId);
|
|
42
|
+
const draft = transcriptId ? getVideoDraft(conversationId, transcriptId) : void 0;
|
|
43
|
+
const { recent } = videoDraftImages(conversationId);
|
|
44
|
+
return {
|
|
45
|
+
content: [{
|
|
46
|
+
type: "text",
|
|
47
|
+
text: JSON.stringify({
|
|
48
|
+
draft,
|
|
49
|
+
submitted: Boolean(draft && getVideoJob(conversationId, draft.id)),
|
|
50
|
+
images: recent.slice(0, 12).map(({ uri, name }) => ({
|
|
51
|
+
uri,
|
|
52
|
+
name
|
|
53
|
+
}))
|
|
54
|
+
})
|
|
55
|
+
}],
|
|
56
|
+
details: {}
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
const { action, ...input } = args;
|
|
60
|
+
const draft = prepareVideoDraft(conversationId, {
|
|
61
|
+
action,
|
|
62
|
+
...input
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
content: [{
|
|
66
|
+
type: "text",
|
|
67
|
+
text: JSON.stringify(draft)
|
|
68
|
+
}],
|
|
69
|
+
details: {}
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
export { createVideoDraftTool };
|
|
@@ -240,7 +240,18 @@ function deliveryForXopcResult(mode, command, result, dryRun) {
|
|
|
240
240
|
}
|
|
241
241
|
let source;
|
|
242
242
|
let primary;
|
|
243
|
-
if (mode === "
|
|
243
|
+
if (mode === "agent" && command === "create" && resultRecord.ok === true) {
|
|
244
|
+
source = record(resultRecord.agent);
|
|
245
|
+
const id = deliveryText(source?.id);
|
|
246
|
+
const profile = record(source?.profile);
|
|
247
|
+
if (id) primary = {
|
|
248
|
+
kind: "agent",
|
|
249
|
+
id,
|
|
250
|
+
title: deliveryText(profile?.name) ?? id,
|
|
251
|
+
summary: deliverySummary(profile?.description),
|
|
252
|
+
capabilities: ["open", "edit"]
|
|
253
|
+
};
|
|
254
|
+
} else if (mode === "project") {
|
|
244
255
|
const match = record(resultRecord.match);
|
|
245
256
|
source = record(resultRecord.project) ?? record(match?.project) ?? match;
|
|
246
257
|
const id = deliveryText(source?.id);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isBundledChannelExtension(extensionId: string): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/channels/bundled-channel-extensions.ts
|
|
2
|
+
const bundledChannelExtensionIds = new Set([
|
|
3
|
+
"telegram",
|
|
4
|
+
"feishu-tools",
|
|
5
|
+
"weixin",
|
|
6
|
+
"dingtalk",
|
|
7
|
+
"wecom",
|
|
8
|
+
"slack",
|
|
9
|
+
"discord"
|
|
10
|
+
]);
|
|
11
|
+
function isBundledChannelExtension(extensionId) {
|
|
12
|
+
return bundledChannelExtensionIds.has(extensionId);
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { isBundledChannelExtension };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function redactEnterpriseChannelSecret(channel: string, value: unknown): unknown;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/channels/enterprise/config-surface.ts
|
|
2
|
+
const credentialFields = {
|
|
3
|
+
dingtalk: ["clientSecret"],
|
|
4
|
+
wecom: ["secret"],
|
|
5
|
+
slack: [
|
|
6
|
+
"botToken",
|
|
7
|
+
"appToken",
|
|
8
|
+
"credentialIdentity"
|
|
9
|
+
],
|
|
10
|
+
discord: ["botToken", "credentialIdentity"]
|
|
11
|
+
};
|
|
12
|
+
function redactEnterpriseChannelSecret(channel, value) {
|
|
13
|
+
if (!Object.hasOwn(credentialFields, channel) || !value || typeof value !== "object" || Array.isArray(value)) return value;
|
|
14
|
+
const sanitized = { ...value };
|
|
15
|
+
for (const field of credentialFields[channel]) delete sanitized[field];
|
|
16
|
+
return sanitized;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { redactEnterpriseChannelSecret };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type WebSocket from 'ws';
|
|
2
|
+
import type { ChannelPlugin } from '../plugin-types.js';
|
|
3
|
+
import { type ChannelSetupLink, type EnterpriseCredentials, type EnterpriseRegistration } from './setup.js';
|
|
4
|
+
export type EnterpriseMessage = {
|
|
5
|
+
senderId: string;
|
|
6
|
+
groupId?: string;
|
|
7
|
+
directChatId?: string;
|
|
8
|
+
threadId?: string;
|
|
9
|
+
messageId: string;
|
|
10
|
+
text: string;
|
|
11
|
+
replyId?: string;
|
|
12
|
+
reply?: (text: string) => Promise<unknown>;
|
|
13
|
+
};
|
|
14
|
+
export type EnterpriseTransport = {
|
|
15
|
+
run: (signal: AbortSignal, online: (socket?: WebSocket) => void, onFailure: (message?: string) => void) => Promise<void>;
|
|
16
|
+
send: (target: string, group: boolean, text: string, replyId?: string) => Promise<string>;
|
|
17
|
+
};
|
|
18
|
+
export declare function createEnterpriseChannel(options: {
|
|
19
|
+
id: 'dingtalk' | 'wecom' | 'slack' | 'discord';
|
|
20
|
+
label: string;
|
|
21
|
+
order: number;
|
|
22
|
+
credentialFields: readonly [string, string?];
|
|
23
|
+
credentialLabels: readonly [string, string?];
|
|
24
|
+
begin?: (signal: AbortSignal) => Promise<EnterpriseRegistration>;
|
|
25
|
+
credentialIdIsSecret?: boolean;
|
|
26
|
+
threads?: boolean;
|
|
27
|
+
sendWhileDisconnected?: boolean;
|
|
28
|
+
setupLink?: ChannelSetupLink;
|
|
29
|
+
setupTemplate?: {
|
|
30
|
+
content: string;
|
|
31
|
+
url: string;
|
|
32
|
+
instructions: {
|
|
33
|
+
zh: string;
|
|
34
|
+
en: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
verify: (credentials: EnterpriseCredentials) => Promise<void | string>;
|
|
38
|
+
transport: (credentials: EnterpriseCredentials, receive: (message: EnterpriseMessage) => Promise<void>) => EnterpriseTransport;
|
|
39
|
+
}): ChannelPlugin;
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { resolveStandardAllowFromPath, resolveStandardPairingPath } from "../pairing/paths.js";
|
|
2
|
+
import { readAllowFromIdsSync } from "../pairing/allow-from-file.js";
|
|
3
|
+
import { evaluateAccess } from "../security.js";
|
|
4
|
+
import { redactEnterpriseChannelSecret } from "./config-surface.js";
|
|
5
|
+
import { record, string } from "./socket.js";
|
|
6
|
+
import { createEnterpriseSetup } from "./setup.js";
|
|
7
|
+
import { createHash } from "node:crypto";
|
|
8
|
+
import { isDeepStrictEqual } from "node:util";
|
|
9
|
+
//#region src/channels/enterprise/plugin.ts
|
|
10
|
+
const accountId = "default";
|
|
11
|
+
function createEnterpriseChannel(options) {
|
|
12
|
+
const { id, label, credentialFields: [idField, secretField] } = options;
|
|
13
|
+
let cfg;
|
|
14
|
+
let bus;
|
|
15
|
+
let host;
|
|
16
|
+
let runtime;
|
|
17
|
+
let online = false;
|
|
18
|
+
const section = (config) => record(config.channels?.[id]);
|
|
19
|
+
const credentialsFor = (config) => ({
|
|
20
|
+
id: string(section(config)[idField]),
|
|
21
|
+
secret: secretField ? string(section(config)[secretField]) : "",
|
|
22
|
+
identity: options.credentialIdIsSecret ? string(section(config).credentialIdentity) || void 0 : void 0
|
|
23
|
+
});
|
|
24
|
+
const configured = (credentials) => Boolean(credentials.id && (!secretField || credentials.secret));
|
|
25
|
+
const pairingKey = (credentials) => `${accountId}-${createHash("sha256").update(credentials.identity ?? credentials.id).digest("hex").slice(0, 24)}`;
|
|
26
|
+
const stop = async () => {
|
|
27
|
+
const previous = runtime;
|
|
28
|
+
runtime = void 0;
|
|
29
|
+
online = false;
|
|
30
|
+
previous?.controller.abort();
|
|
31
|
+
await previous?.task;
|
|
32
|
+
};
|
|
33
|
+
const plugin = {
|
|
34
|
+
id,
|
|
35
|
+
meta: {
|
|
36
|
+
id,
|
|
37
|
+
label,
|
|
38
|
+
selectionLabel: label,
|
|
39
|
+
docsPath: `/channels/${id}`,
|
|
40
|
+
blurb: `${label} bot messaging`,
|
|
41
|
+
order: options.order
|
|
42
|
+
},
|
|
43
|
+
capabilities: {
|
|
44
|
+
chatTypes: ["direct", "group"],
|
|
45
|
+
reactions: false,
|
|
46
|
+
threads: options.threads === true,
|
|
47
|
+
media: false,
|
|
48
|
+
nativeCommands: false,
|
|
49
|
+
blockStreaming: false
|
|
50
|
+
},
|
|
51
|
+
reload: { configPrefixes: [`channels.${id}`] },
|
|
52
|
+
config: {
|
|
53
|
+
listAccountIds: (config) => configured(credentialsFor(config)) ? [accountId] : [],
|
|
54
|
+
resolveAccount: (config) => ({
|
|
55
|
+
accountId,
|
|
56
|
+
enabled: section(config).enabled === true,
|
|
57
|
+
configured: configured(credentialsFor(config))
|
|
58
|
+
}),
|
|
59
|
+
isEnabled: (account) => account.enabled,
|
|
60
|
+
isConfigured: (account) => account.configured,
|
|
61
|
+
defaultAccountId: () => accountId,
|
|
62
|
+
describeAccount: (account) => ({
|
|
63
|
+
...account,
|
|
64
|
+
channelId: id,
|
|
65
|
+
status: online ? "connected" : "disconnected"
|
|
66
|
+
})
|
|
67
|
+
},
|
|
68
|
+
configSurface: { buildConfigSurface(config) {
|
|
69
|
+
return redactEnterpriseChannelSecret(id, section(config));
|
|
70
|
+
} },
|
|
71
|
+
runtimeActions: createEnterpriseSetup({
|
|
72
|
+
channel: id,
|
|
73
|
+
credentialFields: options.credentialFields,
|
|
74
|
+
credentialLabels: options.credentialLabels,
|
|
75
|
+
begin: options.begin,
|
|
76
|
+
credentialIdIsSecret: options.credentialIdIsSecret,
|
|
77
|
+
setupTemplate: options.setupTemplate,
|
|
78
|
+
setupLink: options.setupLink,
|
|
79
|
+
verify: options.verify
|
|
80
|
+
}),
|
|
81
|
+
async init(init) {
|
|
82
|
+
if (!init.host) throw new Error("Channel host services are unavailable");
|
|
83
|
+
host = init.host;
|
|
84
|
+
cfg = init.config;
|
|
85
|
+
bus = init.bus;
|
|
86
|
+
host.registerPairingChannelResolver(id, { resolvePaths: () => {
|
|
87
|
+
const key = pairingKey(credentialsFor(cfg));
|
|
88
|
+
return {
|
|
89
|
+
pairingPath: resolveStandardPairingPath(id, key),
|
|
90
|
+
allowPath: resolveStandardAllowFromPath(id, key)
|
|
91
|
+
};
|
|
92
|
+
} });
|
|
93
|
+
},
|
|
94
|
+
async start(startOptions) {
|
|
95
|
+
if (runtime || startOptions?.accountId && startOptions.accountId !== accountId) return;
|
|
96
|
+
const credentials = credentialsFor(cfg);
|
|
97
|
+
if (section(cfg).enabled !== true || !configured(credentials)) return;
|
|
98
|
+
const scope = JSON.stringify([accountId, options.credentialIdIsSecret ? pairingKey(credentials) : credentials.id]);
|
|
99
|
+
const controller = new AbortController();
|
|
100
|
+
let restored = false;
|
|
101
|
+
function restoreInbox() {
|
|
102
|
+
if (restored) return;
|
|
103
|
+
bus.restoreDurableInbound(id, scope);
|
|
104
|
+
restored = true;
|
|
105
|
+
}
|
|
106
|
+
const transport = options.transport(credentials, async (message) => {
|
|
107
|
+
if (controller.signal.aborted) return;
|
|
108
|
+
restoreInbox();
|
|
109
|
+
const channel = section(cfg);
|
|
110
|
+
const isGroup = Boolean(message.groupId);
|
|
111
|
+
const recipient = message.groupId || message.directChatId || message.senderId;
|
|
112
|
+
const chatId = `${isGroup ? "group" : "user"}:${recipient}`;
|
|
113
|
+
const dmPolicy = channel.dmPolicy ?? "pairing";
|
|
114
|
+
const groupPolicy = channel.groupPolicy ?? "allowlist";
|
|
115
|
+
const key = pairingKey(credentials);
|
|
116
|
+
const allowFrom = Array.isArray(channel.allowFrom) ? channel.allowFrom : [];
|
|
117
|
+
const paired = dmPolicy === "pairing" ? readAllowFromIdsSync(resolveStandardAllowFromPath(id, key)) : [];
|
|
118
|
+
const result = evaluateAccess({
|
|
119
|
+
context: {
|
|
120
|
+
channel: id,
|
|
121
|
+
accountId,
|
|
122
|
+
chatId,
|
|
123
|
+
senderId: message.senderId,
|
|
124
|
+
isGroup,
|
|
125
|
+
isDm: !isGroup,
|
|
126
|
+
threadId: message.threadId
|
|
127
|
+
},
|
|
128
|
+
dmPolicy,
|
|
129
|
+
groupPolicy,
|
|
130
|
+
allowFrom: [...allowFrom, ...paired],
|
|
131
|
+
groupAllowFrom: Array.isArray(channel.groupAllowFrom) ? channel.groupAllowFrom : []
|
|
132
|
+
});
|
|
133
|
+
if (!result.allowed) {
|
|
134
|
+
if (result.reason === "pairing-required") await host.issuePairingChallenge({
|
|
135
|
+
channel: id,
|
|
136
|
+
accountId,
|
|
137
|
+
senderId: message.senderId,
|
|
138
|
+
senderIdLine: `Sender ID: ${message.senderId}`,
|
|
139
|
+
pairingFilePath: resolveStandardPairingPath(id, key),
|
|
140
|
+
sendPairingReply: async (text) => {
|
|
141
|
+
await (message.reply ? message.reply(text) : transport.send(recipient, false, text));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
const routingConfig = options.threads && !cfg.session?.dmScope ? { session: {
|
|
147
|
+
...cfg.session,
|
|
148
|
+
dmScope: "per-account-channel-peer"
|
|
149
|
+
} } : cfg;
|
|
150
|
+
const { conversationId } = host.resolveRoute({
|
|
151
|
+
config: routingConfig,
|
|
152
|
+
channel: id,
|
|
153
|
+
accountId,
|
|
154
|
+
peerKind: isGroup ? "group" : "direct",
|
|
155
|
+
peerId: chatId,
|
|
156
|
+
threadId: message.threadId
|
|
157
|
+
});
|
|
158
|
+
await bus.publishInbound({
|
|
159
|
+
channel: id,
|
|
160
|
+
sender_id: message.senderId,
|
|
161
|
+
chat_id: chatId,
|
|
162
|
+
content: message.text,
|
|
163
|
+
metadata: {
|
|
164
|
+
conversationId,
|
|
165
|
+
accountId,
|
|
166
|
+
messageId: message.messageId,
|
|
167
|
+
isGroup,
|
|
168
|
+
...message.threadId ? { threadId: message.threadId } : {},
|
|
169
|
+
...message.replyId ? { channelReplyId: message.replyId } : {}
|
|
170
|
+
}
|
|
171
|
+
}, {
|
|
172
|
+
scope,
|
|
173
|
+
id: message.messageId
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
if (!options.credentialIdIsSecret) restoreInbox();
|
|
177
|
+
runtime = {
|
|
178
|
+
controller,
|
|
179
|
+
transport,
|
|
180
|
+
task: transport.run(controller.signal, (socket) => {
|
|
181
|
+
if (runtime?.controller === controller) {
|
|
182
|
+
if (socket) restoreInbox();
|
|
183
|
+
online = Boolean(socket);
|
|
184
|
+
}
|
|
185
|
+
}, (message) => host.warn(message ?? "Channel connection failed; retrying")).catch(() => host.warn("Channel transport stopped unexpectedly"))
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
stop,
|
|
189
|
+
channelIsRunning: () => online,
|
|
190
|
+
async onConfigUpdated(config) {
|
|
191
|
+
const changed = section(cfg).enabled !== section(config).enabled || !isDeepStrictEqual(credentialsFor(cfg), credentialsFor(config));
|
|
192
|
+
cfg = config;
|
|
193
|
+
if (!changed) return;
|
|
194
|
+
await stop();
|
|
195
|
+
await plugin.start();
|
|
196
|
+
},
|
|
197
|
+
outbound: {
|
|
198
|
+
deliveryMode: "direct",
|
|
199
|
+
textChunkLimit: 1800,
|
|
200
|
+
async sendText({ to, text, accountId: targetAccount, mediaUrl, threadId, replyToId, outboundMetadata }) {
|
|
201
|
+
const separator = to.indexOf(":");
|
|
202
|
+
const kind = to.slice(0, separator);
|
|
203
|
+
const target = to.slice(separator + 1);
|
|
204
|
+
if (!runtime || !online && !options.sendWhileDisconnected || targetAccount && targetAccount !== accountId) throw new Error(`${label} is disconnected`);
|
|
205
|
+
if (!target || kind !== "user" && kind !== "group") throw new Error(`Invalid ${label} target`);
|
|
206
|
+
if (mediaUrl) throw new Error(`${label} only supports text delivery`);
|
|
207
|
+
const reply = string(outboundMetadata?.channelReplyId) || (options.threads ? string(threadId) : "") || replyToId || void 0;
|
|
208
|
+
return {
|
|
209
|
+
success: true,
|
|
210
|
+
messageId: await runtime.transport.send(target, kind === "group", text, reply),
|
|
211
|
+
chatId: to
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
return plugin;
|
|
217
|
+
}
|
|
218
|
+
//#endregion
|
|
219
|
+
export { createEnterpriseChannel };
|