@ensocode/server 0.3.11 → 0.3.12
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/LICENSE +679 -19
- package/out/phone/assets/{abnfDiagram-VCTEODGH-DeKO4j9Y.js → abnfDiagram-VCTEODGH-D-9apHOZ.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-DhPgDhMQ.js → architectureDiagram-5GKGNRK7-B7ti5Yuy.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-CHjEV4S2.js → blockDiagram-I7D4REHJ-CMg6PHJB.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-C_w2ZiGg.js → c4Diagram-7LVT6UL2-YtDbC01g.js} +1 -1
- package/out/phone/assets/channel-BQsoblXW.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-DsFB5306.js → chunk-4HAMMTFA-Djg6ctlZ.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-D-GYq_Mf.js → chunk-75Z2AOVW-Be2kq0FP.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-CfnOn1uu.js → chunk-DU6HZSFF-d5JZiOMy.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-DFQr9a2N.js → chunk-F27PBJKO-DHBQ6nrV.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW--AoHkXxN.js → chunk-GMAD6QVW-BatU6uXC.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-CzbFqhoi.js → chunk-GVQU2GXP-CiyvoRIy.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-DT26rqUA.js → chunk-IMKFNOWR-vOQaK90i.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-CvadXD9U.js → chunk-L3NEJ4N5-CPykFzBy.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-DROHZT6z.js → chunk-OSK3NFVY-q4NiGH59.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-BcsvTFQT.js → chunk-P2QGCYS3-DUV9S_qP.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-Bib7YUpn.js → chunk-POPQ4Y6H-CjycswNE.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-CrsdfQvi.js → chunk-PWAF6VOD-Dben6plA.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-BSSsjkbn.js → chunk-SHT3W25Y-D2hK_jmb.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-BorYBfcS.js → chunk-SVP7TREG-DLtgLN89.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-DwWprz_z.js → chunk-TICWLB2K-BeBB0_0w.js} +1 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-rwnxFDXp.js +1 -0
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-rwnxFDXp.js +1 -0
- package/out/phone/assets/{cynefin-OW5HDTMX-UxW1ctBn.js → cynefin-OW5HDTMX-CsDdLZPP.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-3xyjt_Zk.js → cynefinDiagram-5FMLGOSQ-BcaPty-s.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-BA8g5sNo.js → dagre-GXQ25YYZ-o7dqm5ri.js} +1 -1
- package/out/phone/assets/desk-DNf6lCoq.js +2 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-CqaAk0xY.js → diagram-S7CK7UJ4-B5m8q3yP.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-BJs2alr_.js → diagram-UQ7AKVKN-_lP617OW.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-goFBlClH.js → diagram-VSXAHHWV-D16twHR0.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-NC_soOMz.js → diagram-VX7I27RA-BT8YSil1.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-CPBmdhd-.js → diagram-Z3DM3KII-CiSuhrxd.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-e_KXtWp1.js → ebnfDiagram-PWID7BFC-BbCXn4HA.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-BV3oU6Yk.js → erDiagram-RLTQ6QDP-5-xE_bP2.js} +1 -1
- package/out/phone/assets/eventmodeling-NTZA5JFV-BVS2RGt-.js +1 -0
- package/out/phone/assets/flowDiagram-HODETNUW-BSlxj9Uk.js +1 -0
- package/out/phone/assets/{ganttDiagram-EL5Y4UJY-DOtr1Ilh.js → ganttDiagram-EL5Y4UJY-Rqgggqg_.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-D0CbVtzh.js → gitGraph-4MIJSDKK-Drt18ZKK.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-C6wXAX8a.js → gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-BLbppMXJ.js → info-A6RAGUB7-CpPeSHE0.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-DOlhaNYG.js → infoDiagram-27XIBGKW-D3d9S0Y6.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-BtaSUSnr.js → ishikawaDiagram-5VMMS53U-plFMqx62.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-C6DElK_Y.js → journeyDiagram-3NMN7TZE-CX-n-XXx.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-WqCAwlkm.js → kanban-definition-UXKFOSKX-DrdTzKIc.js} +1 -1
- package/out/phone/assets/{line-CvY1fizC.js → line-CqyaArNm.js} +1 -1
- package/out/phone/assets/main-BGlFv7yA.js +1658 -0
- package/out/phone/assets/main-BS1SSCau.css +1 -0
- package/out/phone/assets/{mermaid-parser.core-BNyl33x8.js → mermaid-parser.core-CERMa6fg.js} +3 -3
- package/out/phone/assets/{mermaid.core-BnUF0ZCX.js → mermaid.core-CbGP2wFn.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-CsORTLIm.js → mindmap-definition-YA3MSWOX-BxaIrov6.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-CoxwVVdp.js → packet-AYTQ26CC-DguFQxPm.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-BI2W6aLH.js → pegDiagram-XKGWAZYB-t3td03dz.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-CQD3JNcj.js → pie-WAS4IAKB-DoFu2rhu.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-aLnzVgco.js → pieDiagram-E7YTZNPT-DctHLSL8.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-Cbl0x-Id.js → quadrantDiagram-AXDQQJYC-Br7-ImNr.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-Bu2EN1RM.js → radar-RG4KPBEZ-BDjTOHD8.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-DiiOMWSM.js → railroad-74A4TZTK-v8vsrpxb.js} +1 -1
- package/out/phone/assets/railroad-abnf-HS5TGJTU-CUELjEtC.js +1 -0
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-DdIokM4i.js +1 -0
- package/out/phone/assets/railroad-peg-WCYAUIDC-DYyy0B-_.js +1 -0
- package/out/phone/assets/{railroadDiagram-O6MQD6OU-r5JJp9nP.js → railroadDiagram-O6MQD6OU-DtH4qQrr.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-Bh86zb_w.js → requirementDiagram-BXWQKSXE-BSqejjZP.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CykRlthT.js → sankeyDiagram-P5KCCOFB-DsTWuNtL.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-BPLcD6MF.js → sequenceDiagram-WJ2MYXX4-zLMvPyPC.js} +1 -1
- package/out/phone/assets/{stateDiagram-D77RDMKH-DWXApcUM.js → stateDiagram-D77RDMKH-DrBC05BN.js} +1 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-DT7BlwvF.js +1 -0
- package/out/phone/assets/storage-BeJvYXAx.js +36 -0
- package/out/phone/assets/{swimlanes-42K2YHIH-BVi6IPTq.js → swimlanes-42K2YHIH-B27-qSm5.js} +1 -1
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CWnm4v0A.js +8 -0
- package/out/phone/assets/{timeline-definition-24CTP7MA-xf--BXjO.js → timeline-definition-24CTP7MA-8NDkGf5U.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-DzJs7PRI.js → treeView-Q6P3EWNA-B9BXwCDC.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-AXb7EeRP.js → treemap-WGGIJYW6-B0IqbwdT.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-CXDX5KG5.js → vennDiagram-4TSXK5OY-Dp-aKgNa.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-DrSIz3RL.js → wardley-WFR3VGLG-B7FlADZf.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-DFL8ndUf.js → wardleyDiagram-VM6X3IG4-BVntjQNl.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-CZZX0maW.js → xychartDiagram-S5SC5T6Z-kgVJvkgO.js} +1 -1
- package/out/phone/desk.html +2 -2
- package/out/phone/index.html +3 -3
- package/out/renderer/assets/{abnfDiagram-VCTEODGH-C03tURh9.js → abnfDiagram-VCTEODGH-Bp0r3dKm.js} +1 -1
- package/out/renderer/assets/{arc-B9ePZBoh.js → arc-BD5HnhIt.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-xqG-LPqx.js → architectureDiagram-5GKGNRK7-CgJHjETB.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-BJCB1uWW.js → blockDiagram-I7D4REHJ-5le9vk4G.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-B8YiLE3O.js → c4Diagram-7LVT6UL2-B4DCe-qN.js} +1 -1
- package/out/renderer/assets/channel-D-HltTAP.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-BfCgzuF1.js → chunk-2Q5K7J3B-DIxWfJHE.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-j2RDggaS.js → chunk-5VM5RSS4-D9j4om1l.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-D1w1G98C.js → chunk-F27PBJKO-B_tGbKyc.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-HX7TqjEn.js → chunk-IMKFNOWR-Cfffd1p9.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-Ee_2ucfe.js → chunk-JWPE2WC7-BABZOPGb.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-DuxBT9GV.js → chunk-POPQ4Y6H-D-QyVpSn.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-DFjkSsO8.js → chunk-SVP7TREG-BghyPSd6.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-1B31w-4D.js → chunk-TICWLB2K-CQmthy6z.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-DZ7nGbEc.js → chunk-XXDRQBXY-CDKsbyR7.js} +1 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BCWhgMul.js +1 -0
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BCWhgMul.js +1 -0
- package/out/renderer/assets/{cose-bilkent-JH36ORCC-k2aKhVw_.js → cose-bilkent-JH36ORCC-oajViFnN.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-xPUo1qjT.js → cynefin-OW5HDTMX-DMH1CUmI.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-KbWg9eRv.js → cynefinDiagram-5FMLGOSQ-DVUJf9t0.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-CLBXU3_O.js → cytoscape-fcose-adTZ191M.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-ilq61to2.js → dagre-GXQ25YYZ-BXRWWNje.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-DsRzYvTT.js → diagram-S7CK7UJ4-Dg7f2Dan.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-nE6Ly2i6.js → diagram-UQ7AKVKN-DsLRyZAt.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-B9Crbma_.js → diagram-VSXAHHWV-3_LoodSS.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-Bm5JhnFh.js → diagram-VX7I27RA-DQeZp2Cz.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-ZD7ANoYg.js → diagram-Z3DM3KII-Dwil6g5m.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CT3pW9tk.js → ebnfDiagram-PWID7BFC-DecVNxpu.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-D0ikskdu.js → erDiagram-RLTQ6QDP-D2rmo2nP.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-BOF_JMXY.js → flowDiagram-HODETNUW-_SF2dRBl.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-BCEnP39-.js → ganttDiagram-EL5Y4UJY-BoYWs5Ev.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-WpPHHkc3.js → gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js} +1 -1
- package/out/renderer/assets/globals-BEwCf508.css +1 -0
- package/out/renderer/assets/{globals-DWAN16wT.js → globals-C3zxoqqH.js} +223 -223
- package/out/renderer/assets/index-9vqh4wxi.js +133 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-nRW-sje9.js → infoDiagram-27XIBGKW-CFt6xyuD.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CEfZo_k8.js → ishikawaDiagram-5VMMS53U-CZB8G4dD.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-C5hopb9Y.js → journeyDiagram-3NMN7TZE-CO2VRmpx.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-D9XV2n-x.js → kanban-definition-UXKFOSKX-DIqEnfMM.js} +1 -1
- package/out/renderer/assets/{layout-t2tiRL7x.js → layout-DXRKfO_Y.js} +1 -1
- package/out/renderer/assets/{linear-DJLwPmUz.js → linear-Cdx1AdZJ.js} +1 -1
- package/out/renderer/assets/{mermaid.core-C0XHWibr.js → mermaid.core-DuIO2jsm.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-DD-erShR.js → mindmap-definition-YA3MSWOX-B5lvxG2M.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-DZ0Jk0gq.js → pegDiagram-XKGWAZYB-DCwHp-K3.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-E7wG7xIV.js → pieDiagram-E7YTZNPT-Dq048Wh7.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-iyjmw417.js → quadrantDiagram-AXDQQJYC-DwkFkAi_.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-vCkzrMpv.js → railroadDiagram-O6MQD6OU-2NKvwLP-.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-DJ7nU4ps.js → requirementDiagram-BXWQKSXE-Bp44tNQ0.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-1TKFsYjQ.js → sankeyDiagram-P5KCCOFB-C3TFp1NK.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-C3ajyWo7.js → sequenceDiagram-WJ2MYXX4-BTPoYQeW.js} +1 -1
- package/out/renderer/assets/settings-DlDHkOe2.js +25 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-BKripAfM.js → sizeCapture-INFHLROL-DvNj5TDT.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-DSqc4avN.js → stateDiagram-D77RDMKH-DC8YykNp.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-C2Jeg683.js → swimlanes-42K2YHIH-0yL1nNkg.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-rvOKRLqz.js → timeline-definition-24CTP7MA-Pg-2roGv.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-Cig1eOav.js → vennDiagram-4TSXK5OY-D0af5K4E.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-C8spX5XL.js → wardleyDiagram-VM6X3IG4-CB_nIy_l.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-DHQsGiFY.js → xychartDiagram-S5SC5T6Z-A26Yld8R.js} +1 -1
- package/out/renderer/index.html +3 -3
- package/out/renderer/settings.html +4 -4
- package/out/renderer/web-preload.js +39 -39
- package/out/server/agent.js +276 -506
- package/out/server/chunks/{agent-BbLTL3oo.js → agent-D33nI7fP.js} +176 -195
- package/out/server/chunks/dispatchModel-CsfmL396.js +20 -0
- package/out/server/chunks/gpuBackendInstall-CRzfB150.js +237 -0
- package/out/server/chunks/{loadProvider-ff0h4G9y.js → loadProvider-4Y15KP7W.js} +2 -2
- package/out/server/chunks/{manifest-DjsZzZuh.js → manifest-wlfh-NN5.js} +2 -2
- package/out/server/chunks/{resources-DmaKIeBc.js → resources-DzUshg1j.js} +3 -3
- package/out/server/chunks/{storageScanWorker-BQ1LXUu7.js → storageScanWorker-CX8O_DlF.js} +2 -2
- package/out/server/chunks/{storageScanWorker-Bebego8l.js → storageScanWorker-CuttDIGS.js} +2 -2
- package/out/server/chunks/{workflowPresets-XbQNDJh1.js → workflowPresets-CAA0AY6f.js} +1091 -287
- package/out/server/index.js +2376 -3358
- package/out/server/plugin-host.js +2 -2
- package/package.json +2 -3
- package/out/phone/assets/architecture-7GRP2DOG-C-qor9pl.js +0 -1
- package/out/phone/assets/channel-X_IbcoWa.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-BM8gYXGQ.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-BM8gYXGQ.js +0 -1
- package/out/phone/assets/desk-BNoyCelL.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-BdEBApKV.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-OPg41_ia.js +0 -1
- package/out/phone/assets/main-BU1pbfVw.css +0 -1
- package/out/phone/assets/main-ZLMPRLjZ.js +0 -1658
- package/out/phone/assets/railroad-abnf-HS5TGJTU-BoQXwOPL.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-1G126duh.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-C7pIuHge.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-BMZswIYt.js +0 -1
- package/out/phone/assets/storage-dUWOZ2xo.js +0 -36
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-RYt3eASc.js +0 -8
- package/out/renderer/assets/channel-DwCSANyp.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-BT-9dtRl.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-BT-9dtRl.js +0 -1
- package/out/renderer/assets/globals-DoPyZAQo.css +0 -1
- package/out/renderer/assets/index-DOUivox4.js +0 -133
- package/out/renderer/assets/settings-BmMFkVO5.js +0 -27
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-JOz8ISDT.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-Km8IGI0J.js +0 -8
- package/out/server/chunks/engine-IZbRceya.js +0 -70
- package/out/server/chunks/engineWorker-CQxNRdLD.js +0 -6
- package/out/server/chunks/engineWorker-CrUIcXCt.js +0 -73
- package/out/server/chunks/gpuBackendInstall-COO4pT2M.js +0 -158
- package/out/server/chunks/hanbao-_aDjow_f.js +0 -187
- package/out/server/chunks/speech-CqK6_tIR.js +0 -25
- package/out/server/chunks/wetype-CR0YLhHP.js +0 -677
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as r,b as e,a,S as s}from"./chunk-IMKFNOWR-HX7TqjEn.js";import{_ as i}from"./mermaid.core-C0XHWibr.js";import"./chunk-XXDRQBXY-DZ7nGbEc.js";import"./chunk-POPQ4Y6H-DuxBT9GV.js";import"./chunk-F27PBJKO-D1w1G98C.js";import"./globals-DWAN16wT.js";var u={parser:a,get db(){return new s(2)},renderer:e,styles:r,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{u as diagram};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as r,s as e}from"./flowDiagram-HODETNUW-BOF_JMXY.js";import{_ as a}from"./mermaid.core-C0XHWibr.js";import"./chunk-5VM5RSS4-j2RDggaS.js";import"./chunk-XXDRQBXY-DZ7nGbEc.js";import"./chunk-POPQ4Y6H-DuxBT9GV.js";import"./chunk-F27PBJKO-D1w1G98C.js";import"./channel-DwCSANyp.js";import"./globals-DWAN16wT.js";var o=a(t=>`${e(t)}
|
|
2
|
-
.swimlane.cluster rect {
|
|
3
|
-
stroke: ${t.clusterBorder} !important;
|
|
4
|
-
}
|
|
5
|
-
[data-look="neo"].cluster rect {
|
|
6
|
-
filter: none;
|
|
7
|
-
}
|
|
8
|
-
`,"getStyles"),s=o,n=r({defaultLayout:"swimlane",styles:s});export{n as diagram};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
async function createWorkerEngine(data) {
|
|
2
|
-
const { default: spawn } = await import("./engineWorker-CQxNRdLD.js");
|
|
3
|
-
const worker = spawn({ workerData: data });
|
|
4
|
-
const pending = /* @__PURE__ */ new Map();
|
|
5
|
-
let dead = null;
|
|
6
|
-
let nextId = 1;
|
|
7
|
-
let nextSid = 1;
|
|
8
|
-
const failAll = (error) => {
|
|
9
|
-
dead ??= error;
|
|
10
|
-
for (const waiter of pending.values()) waiter.reject(error);
|
|
11
|
-
pending.clear();
|
|
12
|
-
};
|
|
13
|
-
await new Promise((resolve, reject) => {
|
|
14
|
-
const onReady = (message) => {
|
|
15
|
-
if (message.ready === void 0) return;
|
|
16
|
-
worker.off("message", onReady);
|
|
17
|
-
if (message.ready) resolve();
|
|
18
|
-
else {
|
|
19
|
-
void worker.terminate();
|
|
20
|
-
reject(new Error(message.error ?? "speech engine failed to load"));
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
worker.on("message", onReady);
|
|
24
|
-
worker.once("error", reject);
|
|
25
|
-
worker.once("exit", (code) => reject(new Error(`speech engine exited (${code})`)));
|
|
26
|
-
});
|
|
27
|
-
worker.on("message", (reply) => {
|
|
28
|
-
const waiter = pending.get(reply.id);
|
|
29
|
-
if (!waiter) return;
|
|
30
|
-
pending.delete(reply.id);
|
|
31
|
-
if (reply.ok) waiter.resolve(reply.text);
|
|
32
|
-
else waiter.reject(new Error(reply.error));
|
|
33
|
-
});
|
|
34
|
-
worker.on(
|
|
35
|
-
"error",
|
|
36
|
-
(error) => failAll(error instanceof Error ? error : new Error(String(error)))
|
|
37
|
-
);
|
|
38
|
-
worker.on("exit", (code) => failAll(new Error(`speech engine exited (${code})`)));
|
|
39
|
-
const call = (req) => {
|
|
40
|
-
if (dead) return Promise.reject(dead);
|
|
41
|
-
const id = nextId++;
|
|
42
|
-
return new Promise((resolve, reject) => {
|
|
43
|
-
pending.set(id, { resolve, reject });
|
|
44
|
-
worker.postMessage({ ...req, id });
|
|
45
|
-
});
|
|
46
|
-
};
|
|
47
|
-
return {
|
|
48
|
-
transcribe: (samples) => call({ op: "transcribe", samples }),
|
|
49
|
-
openStream: () => {
|
|
50
|
-
const sid = nextSid++;
|
|
51
|
-
const opened = call({ op: "open", sid });
|
|
52
|
-
return {
|
|
53
|
-
accept: (samples) => opened.then(() => call({ op: "accept", sid, samples })),
|
|
54
|
-
finish: () => opened.then(() => call({ op: "finish", sid })),
|
|
55
|
-
cancel: () => {
|
|
56
|
-
void opened.then(() => call({ op: "cancel", sid })).catch(() => {
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
dispose: () => {
|
|
62
|
-
failAll(new Error("speech engine disposed"));
|
|
63
|
-
void worker.terminate();
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
export {
|
|
68
|
-
createWorkerEngine
|
|
69
|
-
};
|
|
70
|
-
//# sourceMappingURL=engine-IZbRceya.js.map
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
import { workerData, parentPort } from "node:worker_threads";
|
|
3
|
-
import { S as SPEECH_SAMPLE_RATE } from "./speech-CqK6_tIR.js";
|
|
4
|
-
const port = parentPort;
|
|
5
|
-
const init = workerData;
|
|
6
|
-
const TAIL = new Float32Array(SPEECH_SAMPLE_RATE / 2);
|
|
7
|
-
const text = (result) => typeof result.text === "string" ? result.text : "";
|
|
8
|
-
if (port) {
|
|
9
|
-
let offline = null;
|
|
10
|
-
let online = null;
|
|
11
|
-
const streams = /* @__PURE__ */ new Map();
|
|
12
|
-
try {
|
|
13
|
-
const sherpa = createRequire(import.meta.url)(init.wrapperDir);
|
|
14
|
-
if (init.kind === "offline") offline = new sherpa.OfflineRecognizer(init.config);
|
|
15
|
-
else online = new sherpa.OnlineRecognizer(init.config);
|
|
16
|
-
port.postMessage({ ready: true });
|
|
17
|
-
} catch (error) {
|
|
18
|
-
port.postMessage({ ready: false, error: String(error) });
|
|
19
|
-
}
|
|
20
|
-
const drain = (entry) => {
|
|
21
|
-
const rec = online;
|
|
22
|
-
while (rec.isReady(entry.stream)) rec.decode(entry.stream);
|
|
23
|
-
const current = text(rec.getResult(entry.stream));
|
|
24
|
-
if (!rec.isEndpoint(entry.stream)) return entry.segments.join("") + current;
|
|
25
|
-
if (current) entry.segments.push(current);
|
|
26
|
-
rec.reset(entry.stream);
|
|
27
|
-
return entry.segments.join("");
|
|
28
|
-
};
|
|
29
|
-
port.on("message", (req) => {
|
|
30
|
-
try {
|
|
31
|
-
switch (req.op) {
|
|
32
|
-
case "transcribe": {
|
|
33
|
-
const rec = offline;
|
|
34
|
-
const stream = rec.createStream();
|
|
35
|
-
stream.acceptWaveform({ samples: req.samples, sampleRate: SPEECH_SAMPLE_RATE });
|
|
36
|
-
rec.decode(stream);
|
|
37
|
-
port.postMessage({ id: req.id, ok: true, text: text(rec.getResult(stream)) });
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
case "open":
|
|
41
|
-
streams.set(req.sid, { stream: online.createStream(), segments: [] });
|
|
42
|
-
port.postMessage({ id: req.id, ok: true, text: "" });
|
|
43
|
-
return;
|
|
44
|
-
case "accept": {
|
|
45
|
-
const entry = streams.get(req.sid);
|
|
46
|
-
if (!entry) throw new Error("unknown stream");
|
|
47
|
-
entry.stream.acceptWaveform({ samples: req.samples, sampleRate: SPEECH_SAMPLE_RATE });
|
|
48
|
-
port.postMessage({ id: req.id, ok: true, text: drain(entry) });
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
case "finish": {
|
|
52
|
-
const entry = streams.get(req.sid);
|
|
53
|
-
if (!entry) throw new Error("unknown stream");
|
|
54
|
-
streams.delete(req.sid);
|
|
55
|
-
entry.stream.acceptWaveform({ samples: TAIL, sampleRate: SPEECH_SAMPLE_RATE });
|
|
56
|
-
entry.stream.inputFinished?.();
|
|
57
|
-
const rec = online;
|
|
58
|
-
while (rec.isReady(entry.stream)) rec.decode(entry.stream);
|
|
59
|
-
const last = text(rec.getResult(entry.stream));
|
|
60
|
-
port.postMessage({ id: req.id, ok: true, text: entry.segments.join("") + last });
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
case "cancel":
|
|
64
|
-
streams.delete(req.sid);
|
|
65
|
-
port.postMessage({ id: req.id, ok: true, text: "" });
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
} catch (error) {
|
|
69
|
-
port.postMessage({ id: req.id, ok: false, error: String(error) });
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=engineWorker-CrUIcXCt.js.map
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { createRequire, registerHooks } from "node:module";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { pathToFileURL } from "node:url";
|
|
5
|
-
import { s as selectGpuBackendPackage, g as gpuBackendInstallDir, i as isGpuBackendReady, h as hasLlamaAddon, n as npmPackumentUrl, v as verifyIntegrity, e as extractNpmPackageBins } from "../index.js";
|
|
6
|
-
import "node:net";
|
|
7
|
-
import "node:child_process";
|
|
8
|
-
import "node:crypto";
|
|
9
|
-
import "node:events";
|
|
10
|
-
import "node:os";
|
|
11
|
-
import "./agent-BbLTL3oo.js";
|
|
12
|
-
import "yaml";
|
|
13
|
-
import "./workflowPresets-XbQNDJh1.js";
|
|
14
|
-
import "node:fs/promises";
|
|
15
|
-
import "node:zlib";
|
|
16
|
-
import "@earendil-works/pi-ai";
|
|
17
|
-
import "@earendil-works/pi-coding-agent";
|
|
18
|
-
import "node:string_decoder";
|
|
19
|
-
import "node:util";
|
|
20
|
-
import "node:buffer";
|
|
21
|
-
import "node:dns/promises";
|
|
22
|
-
import "@mozilla/readability";
|
|
23
|
-
import "linkedom";
|
|
24
|
-
import "turndown";
|
|
25
|
-
import "undici";
|
|
26
|
-
import "@earendil-works/pi-ai/api/transform-messages";
|
|
27
|
-
import "node:http";
|
|
28
|
-
import "tweetnacl";
|
|
29
|
-
import "./manifest-DjsZzZuh.js";
|
|
30
|
-
import "@earendil-works/pi-mcp/oauth";
|
|
31
|
-
import "node:stream/promises";
|
|
32
|
-
import "better-sqlite3";
|
|
33
|
-
import "sqlite-vec";
|
|
34
|
-
import "@huggingface/tokenizers";
|
|
35
|
-
import "./speech-CqK6_tIR.js";
|
|
36
|
-
import "web-push";
|
|
37
|
-
import "node:stream";
|
|
38
|
-
import "smol-toml";
|
|
39
|
-
import "@modelcontextprotocol/sdk/client/index.js";
|
|
40
|
-
import "@modelcontextprotocol/sdk/client/sse.js";
|
|
41
|
-
import "@modelcontextprotocol/sdk/client/stdio.js";
|
|
42
|
-
import "@modelcontextprotocol/sdk/client/streamableHttp.js";
|
|
43
|
-
import "node:dns";
|
|
44
|
-
import "node:https";
|
|
45
|
-
import "node-pty";
|
|
46
|
-
import "@earendil-works/pi-ai/api/typesafe-system-one";
|
|
47
|
-
import "@earendil-works/pi-ai/providers/typesafe";
|
|
48
|
-
import "./resources-DmaKIeBc.js";
|
|
49
|
-
import "node:readline";
|
|
50
|
-
import "node:readline/promises";
|
|
51
|
-
import "fs";
|
|
52
|
-
import "util";
|
|
53
|
-
import "stream";
|
|
54
|
-
import "zlib";
|
|
55
|
-
import "assert";
|
|
56
|
-
import "buffer";
|
|
57
|
-
import "events";
|
|
58
|
-
import "https";
|
|
59
|
-
import "http";
|
|
60
|
-
import "net";
|
|
61
|
-
import "tls";
|
|
62
|
-
import "crypto";
|
|
63
|
-
import "url";
|
|
64
|
-
const require$1 = createRequire(import.meta.url);
|
|
65
|
-
let hookRegistered = false;
|
|
66
|
-
async function ensureGpuBackend(opts = {}) {
|
|
67
|
-
const platform = opts.platform ?? process.platform;
|
|
68
|
-
const arch = opts.arch ?? process.arch;
|
|
69
|
-
const detect = opts.detectGpus ?? (async () => {
|
|
70
|
-
const mod = await import("node-llama-cpp");
|
|
71
|
-
if (typeof mod.getLlamaGpuTypes !== "function") return [];
|
|
72
|
-
return mod.getLlamaGpuTypes("supported");
|
|
73
|
-
});
|
|
74
|
-
const selected = selectGpuBackendPackage({
|
|
75
|
-
platform,
|
|
76
|
-
arch,
|
|
77
|
-
supportedGpus: await detect()
|
|
78
|
-
});
|
|
79
|
-
if (!selected) return;
|
|
80
|
-
const hasAddon = opts.hasPackagedAddon ?? hasPackagedAddon;
|
|
81
|
-
if (hasAddon(selected.name)) return;
|
|
82
|
-
const root = opts.root ?? await defaultRoot();
|
|
83
|
-
const version = opts.version ?? llamaCppVersion();
|
|
84
|
-
const dest = gpuBackendInstallDir(root, selected.name, version);
|
|
85
|
-
if (!isGpuBackendReady(dest)) {
|
|
86
|
-
try {
|
|
87
|
-
await downloadGpuBackend(selected.name, version, dest, opts);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
const cpu = selectGpuBackendPackage({ platform, arch, supportedGpus: [false] });
|
|
90
|
-
if (!cpu || cpu.name === selected.name) throw error;
|
|
91
|
-
console.warn("[llama] GPU backend download failed, falling back to CPU:", error);
|
|
92
|
-
const cpuDest = gpuBackendInstallDir(root, cpu.name, version);
|
|
93
|
-
if (!isGpuBackendReady(cpuDest)) {
|
|
94
|
-
await downloadGpuBackend(cpu.name, version, cpuDest, opts);
|
|
95
|
-
}
|
|
96
|
-
(opts.resolvePackage ?? registerGpuPackage)(cpu.name, cpuDest);
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
(opts.resolvePackage ?? registerGpuPackage)(selected.name, dest);
|
|
101
|
-
}
|
|
102
|
-
function llamaCppVersion() {
|
|
103
|
-
const entry = require$1.resolve("node-llama-cpp");
|
|
104
|
-
const pkgPath = path.join(path.dirname(entry), "..", "package.json");
|
|
105
|
-
const version = JSON.parse(fs.readFileSync(pkgPath, "utf8")).version;
|
|
106
|
-
if (typeof version !== "string" || !/^\d+\.\d+\.\d+/.test(version)) {
|
|
107
|
-
throw new Error(`node-llama-cpp package.json missing version: ${pkgPath}`);
|
|
108
|
-
}
|
|
109
|
-
return version;
|
|
110
|
-
}
|
|
111
|
-
function hasPackagedAddon(name) {
|
|
112
|
-
try {
|
|
113
|
-
const fromLlama = createRequire(require$1.resolve("node-llama-cpp"));
|
|
114
|
-
const entry = fromLlama.resolve(name);
|
|
115
|
-
return hasLlamaAddon(path.join(path.dirname(entry), "..", "bins"));
|
|
116
|
-
} catch {
|
|
117
|
-
return false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async function defaultRoot() {
|
|
121
|
-
const { app } = await import("../index.js").then((n) => n.p);
|
|
122
|
-
return path.join(app.getPath("userData"), "llama-gpu-backends");
|
|
123
|
-
}
|
|
124
|
-
async function downloadGpuBackend(name, version, dest, opts) {
|
|
125
|
-
const registry = (opts.registry ?? process.env.npm_config_registry ?? "https://registry.npmjs.org").replace(/\/+$/, "");
|
|
126
|
-
const doFetch = opts.fetch ?? fetch;
|
|
127
|
-
const metaRes = await doFetch(`${npmPackumentUrl(registry, name)}/${version}`);
|
|
128
|
-
if (!metaRes.ok) throw new Error(`gpu backend packument HTTP ${metaRes.status}`);
|
|
129
|
-
const meta = await metaRes.json();
|
|
130
|
-
const tarball = meta.dist?.tarball;
|
|
131
|
-
const integrity = meta.dist?.integrity;
|
|
132
|
-
if (!tarball || !integrity) throw new Error("gpu backend packument missing dist");
|
|
133
|
-
console.warn(`[llama] downloading GPU backend ${name}@${version}`);
|
|
134
|
-
const tarRes = await doFetch(tarball);
|
|
135
|
-
if (!tarRes.ok) throw new Error(`gpu backend tarball HTTP ${tarRes.status}`);
|
|
136
|
-
const body = Buffer.from(await tarRes.arrayBuffer());
|
|
137
|
-
verifyIntegrity(body, integrity);
|
|
138
|
-
extractNpmPackageBins(body, dest);
|
|
139
|
-
}
|
|
140
|
-
function registerGpuPackage(name, dest) {
|
|
141
|
-
if (hookRegistered) return;
|
|
142
|
-
const index = path.join(dest, "dist", "index.js");
|
|
143
|
-
if (!fs.existsSync(index)) return;
|
|
144
|
-
const url = pathToFileURL(index).href;
|
|
145
|
-
registerHooks({
|
|
146
|
-
resolve(specifier, context, nextResolve) {
|
|
147
|
-
if (specifier === name) return { url, shortCircuit: true };
|
|
148
|
-
return nextResolve(specifier, context);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
hookRegistered = true;
|
|
152
|
-
}
|
|
153
|
-
export {
|
|
154
|
-
ensureGpuBackend,
|
|
155
|
-
hasPackagedAddon,
|
|
156
|
-
llamaCppVersion
|
|
157
|
-
};
|
|
158
|
-
//# sourceMappingURL=gpuBackendInstall-COO4pT2M.js.map
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
const IDLE_MS = 3 * 6e4;
|
|
2
|
-
const TIMEOUT_MS = 3e4;
|
|
3
|
-
class ExitError extends Error {
|
|
4
|
-
}
|
|
5
|
-
function toPcm16(samples) {
|
|
6
|
-
const pcm = Buffer.alloc(samples.length * 2);
|
|
7
|
-
for (let i = 0; i < samples.length; i++) {
|
|
8
|
-
const s = Math.max(-1, Math.min(1, samples[i]));
|
|
9
|
-
pcm.writeInt16LE(Math.round(s < 0 ? s * 32768 : s * 32767), i * 2);
|
|
10
|
-
}
|
|
11
|
-
return pcm;
|
|
12
|
-
}
|
|
13
|
-
function createHanbaoEngine({
|
|
14
|
-
start,
|
|
15
|
-
idleMs = IDLE_MS,
|
|
16
|
-
timeoutMs = TIMEOUT_MS
|
|
17
|
-
}) {
|
|
18
|
-
let current = null;
|
|
19
|
-
let queue = Promise.resolve();
|
|
20
|
-
let inflight = 0;
|
|
21
|
-
let nextId = 0;
|
|
22
|
-
let idle;
|
|
23
|
-
let disposed = false;
|
|
24
|
-
const launch = () => {
|
|
25
|
-
const proc = start();
|
|
26
|
-
let pending = null;
|
|
27
|
-
let exited = false;
|
|
28
|
-
let buffer = "";
|
|
29
|
-
const detach = () => {
|
|
30
|
-
if (current === child) current = null;
|
|
31
|
-
};
|
|
32
|
-
const gone = (reason) => {
|
|
33
|
-
exited = true;
|
|
34
|
-
detach();
|
|
35
|
-
pending?.reject(new ExitError(`hanbao exited: ${reason}`));
|
|
36
|
-
pending = null;
|
|
37
|
-
};
|
|
38
|
-
proc.stdout.setEncoding("utf8");
|
|
39
|
-
proc.stdout.on("data", (chunk) => {
|
|
40
|
-
buffer += chunk;
|
|
41
|
-
for (let i = buffer.indexOf("\n"); i >= 0; i = buffer.indexOf("\n")) {
|
|
42
|
-
const line = buffer.slice(0, i);
|
|
43
|
-
buffer = buffer.slice(i + 1);
|
|
44
|
-
let reply;
|
|
45
|
-
try {
|
|
46
|
-
reply = JSON.parse(line);
|
|
47
|
-
} catch {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
if (pending && (reply.id === pending.id || reply.id === void 0)) {
|
|
51
|
-
pending.resolve(reply);
|
|
52
|
-
pending = null;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
proc.stdin.on("error", () => {
|
|
57
|
-
});
|
|
58
|
-
proc.on("error", (error) => gone(error.message));
|
|
59
|
-
proc.on("exit", (code, signal) => gone(String(signal ?? code)));
|
|
60
|
-
const child = {
|
|
61
|
-
ask: (message) => new Promise((resolve, reject) => {
|
|
62
|
-
if (exited) return reject(new ExitError("hanbao exited"));
|
|
63
|
-
const id = ++nextId;
|
|
64
|
-
pending = { id, resolve, reject };
|
|
65
|
-
proc.stdin.write(`${JSON.stringify({ ...message, id })}
|
|
66
|
-
`);
|
|
67
|
-
}),
|
|
68
|
-
stop: () => {
|
|
69
|
-
detach();
|
|
70
|
-
proc.stdin.end(`${JSON.stringify({ op: "shutdown" })}
|
|
71
|
-
`);
|
|
72
|
-
setTimeout(() => proc.kill("SIGKILL"), 5e3).unref();
|
|
73
|
-
},
|
|
74
|
-
kill: () => {
|
|
75
|
-
detach();
|
|
76
|
-
proc.kill("SIGKILL");
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
return child;
|
|
80
|
-
};
|
|
81
|
-
const alive = () => {
|
|
82
|
-
current ??= launch();
|
|
83
|
-
return current;
|
|
84
|
-
};
|
|
85
|
-
const once = async (message, child = alive()) => {
|
|
86
|
-
let timer;
|
|
87
|
-
try {
|
|
88
|
-
return await Promise.race([
|
|
89
|
-
child.ask(message),
|
|
90
|
-
new Promise((_, reject) => {
|
|
91
|
-
timer = setTimeout(() => {
|
|
92
|
-
child.kill();
|
|
93
|
-
reject(new Error("hanbao timed out"));
|
|
94
|
-
}, timeoutMs);
|
|
95
|
-
})
|
|
96
|
-
]);
|
|
97
|
-
} finally {
|
|
98
|
-
clearTimeout(timer);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
const text = (reply) => {
|
|
102
|
-
if (reply.ok !== true || typeof reply.text !== "string") {
|
|
103
|
-
throw new Error(`hanbao failed: ${String(reply.error ?? "bad reply")}`);
|
|
104
|
-
}
|
|
105
|
-
return reply.text;
|
|
106
|
-
};
|
|
107
|
-
const run = async (samples) => {
|
|
108
|
-
const message = { op: "asr", b64: toPcm16(samples).toString("base64") };
|
|
109
|
-
try {
|
|
110
|
-
return text(await once(message));
|
|
111
|
-
} catch (error) {
|
|
112
|
-
if (!(error instanceof ExitError) || disposed) throw error;
|
|
113
|
-
return text(await once(message));
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const hold = () => {
|
|
117
|
-
if (disposed) throw new Error("hanbao engine disposed");
|
|
118
|
-
clearTimeout(idle);
|
|
119
|
-
inflight++;
|
|
120
|
-
};
|
|
121
|
-
const release = () => {
|
|
122
|
-
if (--inflight > 0 || !current || disposed) return;
|
|
123
|
-
idle = setTimeout(() => current?.stop(), idleMs);
|
|
124
|
-
idle.unref?.();
|
|
125
|
-
};
|
|
126
|
-
const enqueue = (job) => {
|
|
127
|
-
const task = queue.then(() => {
|
|
128
|
-
if (disposed) throw new Error("hanbao engine disposed");
|
|
129
|
-
return job();
|
|
130
|
-
});
|
|
131
|
-
queue = task.catch(() => {
|
|
132
|
-
});
|
|
133
|
-
return task;
|
|
134
|
-
};
|
|
135
|
-
return {
|
|
136
|
-
transcribe: async (samples) => {
|
|
137
|
-
hold();
|
|
138
|
-
try {
|
|
139
|
-
return await enqueue(() => run(samples));
|
|
140
|
-
} finally {
|
|
141
|
-
release();
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
openStream: () => {
|
|
145
|
-
hold();
|
|
146
|
-
let owner = null;
|
|
147
|
-
let closed = false;
|
|
148
|
-
const close = () => {
|
|
149
|
-
if (closed) return;
|
|
150
|
-
closed = true;
|
|
151
|
-
release();
|
|
152
|
-
};
|
|
153
|
-
const opened = enqueue(async () => {
|
|
154
|
-
const child = alive();
|
|
155
|
-
text(await once({ op: "begin" }, child));
|
|
156
|
-
owner = child;
|
|
157
|
-
});
|
|
158
|
-
opened.catch(close);
|
|
159
|
-
const send = (message) => enqueue(async () => {
|
|
160
|
-
if (!owner || current !== owner) throw new Error("hanbao stream lost");
|
|
161
|
-
return text(await once(message, owner));
|
|
162
|
-
}).catch((error) => {
|
|
163
|
-
close();
|
|
164
|
-
throw error;
|
|
165
|
-
});
|
|
166
|
-
return {
|
|
167
|
-
accept: (samples) => send({ op: "chunk", b64: toPcm16(samples).toString("base64") }),
|
|
168
|
-
finish: () => send({ op: "end" }).finally(close),
|
|
169
|
-
cancel: () => {
|
|
170
|
-
if (closed) return;
|
|
171
|
-
void send({ op: "cancel" }).catch(() => {
|
|
172
|
-
}).finally(close);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
},
|
|
176
|
-
dispose: () => {
|
|
177
|
-
disposed = true;
|
|
178
|
-
clearTimeout(idle);
|
|
179
|
-
current?.stop();
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
export {
|
|
184
|
-
createHanbaoEngine,
|
|
185
|
-
toPcm16
|
|
186
|
-
};
|
|
187
|
-
//# sourceMappingURL=hanbao-_aDjow_f.js.map
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
const SPEECH_SAMPLE_RATE = 16e3;
|
|
2
|
-
const SPEECH_MAX_SECONDS = 300;
|
|
3
|
-
const SPEECH_MODEL_IDS = [
|
|
4
|
-
"x-asr-streaming",
|
|
5
|
-
"x-asr",
|
|
6
|
-
"qwen3-asr",
|
|
7
|
-
"sense-voice",
|
|
8
|
-
"hanbao",
|
|
9
|
-
"gemini-live",
|
|
10
|
-
"wetype"
|
|
11
|
-
];
|
|
12
|
-
const DEFAULT_SPEECH_MODEL_ID = "qwen3-asr";
|
|
13
|
-
function isSpeechModelId(value) {
|
|
14
|
-
return typeof value === "string" && SPEECH_MODEL_IDS.includes(value);
|
|
15
|
-
}
|
|
16
|
-
const SPEECH_SESSION_ID_MAX = 64;
|
|
17
|
-
export {
|
|
18
|
-
DEFAULT_SPEECH_MODEL_ID as D,
|
|
19
|
-
SPEECH_SAMPLE_RATE as S,
|
|
20
|
-
SPEECH_MAX_SECONDS as a,
|
|
21
|
-
SPEECH_MODEL_IDS as b,
|
|
22
|
-
SPEECH_SESSION_ID_MAX as c,
|
|
23
|
-
isSpeechModelId as i
|
|
24
|
-
};
|
|
25
|
-
//# sourceMappingURL=speech-CqK6_tIR.js.map
|