@ensocode/server 0.3.10 → 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-DEIRKSmB.js → abnfDiagram-VCTEODGH-D-9apHOZ.js} +1 -1
- package/out/phone/assets/architecture-7GRP2DOG-ihVIDRRt.js +1 -0
- package/out/phone/assets/{architectureDiagram-5GKGNRK7-CFZiReTQ.js → architectureDiagram-5GKGNRK7-B7ti5Yuy.js} +1 -1
- package/out/phone/assets/{blockDiagram-I7D4REHJ-CIBal5Ke.js → blockDiagram-I7D4REHJ-CMg6PHJB.js} +1 -1
- package/out/phone/assets/{c4Diagram-7LVT6UL2-Ce7SCOHL.js → c4Diagram-7LVT6UL2-YtDbC01g.js} +1 -1
- package/out/phone/assets/channel-BQsoblXW.js +1 -0
- package/out/phone/assets/{chunk-4HAMMTFA-COlQ1_VX.js → chunk-4HAMMTFA-Djg6ctlZ.js} +1 -1
- package/out/phone/assets/{chunk-75Z2AOVW-L2CSsdYQ.js → chunk-75Z2AOVW-Be2kq0FP.js} +1 -1
- package/out/phone/assets/{chunk-DU6HZSFF-juQC0nTX.js → chunk-DU6HZSFF-d5JZiOMy.js} +1 -1
- package/out/phone/assets/{chunk-F27PBJKO-CUQNf9_G.js → chunk-F27PBJKO-DHBQ6nrV.js} +1 -1
- package/out/phone/assets/{chunk-GMAD6QVW-BzsNlUWy.js → chunk-GMAD6QVW-BatU6uXC.js} +1 -1
- package/out/phone/assets/{chunk-GVQU2GXP-a7Sg14KC.js → chunk-GVQU2GXP-CiyvoRIy.js} +1 -1
- package/out/phone/assets/{chunk-IMKFNOWR-B86isBFr.js → chunk-IMKFNOWR-vOQaK90i.js} +1 -1
- package/out/phone/assets/{chunk-L3NEJ4N5-D9GQEj7C.js → chunk-L3NEJ4N5-CPykFzBy.js} +1 -1
- package/out/phone/assets/{chunk-OSK3NFVY-ZHLE_p8D.js → chunk-OSK3NFVY-q4NiGH59.js} +1 -1
- package/out/phone/assets/{chunk-P2QGCYS3-CIqiw4vs.js → chunk-P2QGCYS3-DUV9S_qP.js} +1 -1
- package/out/phone/assets/{chunk-POPQ4Y6H-pTX0vZo7.js → chunk-POPQ4Y6H-CjycswNE.js} +1 -1
- package/out/phone/assets/{chunk-PWAF6VOD-BXK9ou77.js → chunk-PWAF6VOD-Dben6plA.js} +1 -1
- package/out/phone/assets/{chunk-SHT3W25Y-BLZNPdt8.js → chunk-SHT3W25Y-D2hK_jmb.js} +1 -1
- package/out/phone/assets/{chunk-SVP7TREG-wR8iPcjt.js → chunk-SVP7TREG-DLtgLN89.js} +1 -1
- package/out/phone/assets/{chunk-TICWLB2K-CueyYenv.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-LV70kdIp.js → cynefin-OW5HDTMX-CsDdLZPP.js} +1 -1
- package/out/phone/assets/{cynefinDiagram-5FMLGOSQ-jSFJ3Ff1.js → cynefinDiagram-5FMLGOSQ-BcaPty-s.js} +1 -1
- package/out/phone/assets/{dagre-GXQ25YYZ-DnmK3Igj.js → dagre-GXQ25YYZ-o7dqm5ri.js} +1 -1
- package/out/phone/assets/desk-DNf6lCoq.js +2 -0
- package/out/phone/assets/{diagram-S7CK7UJ4-KdmyjPOb.js → diagram-S7CK7UJ4-B5m8q3yP.js} +1 -1
- package/out/phone/assets/{diagram-UQ7AKVKN-D1D-C9ty.js → diagram-UQ7AKVKN-_lP617OW.js} +1 -1
- package/out/phone/assets/{diagram-VSXAHHWV-CO_oZjy2.js → diagram-VSXAHHWV-D16twHR0.js} +1 -1
- package/out/phone/assets/{diagram-VX7I27RA-VLBWCwXT.js → diagram-VX7I27RA-BT8YSil1.js} +1 -1
- package/out/phone/assets/{diagram-Z3DM3KII-wXmAYt0S.js → diagram-Z3DM3KII-CiSuhrxd.js} +1 -1
- package/out/phone/assets/{ebnfDiagram-PWID7BFC-COmreC4F.js → ebnfDiagram-PWID7BFC-BbCXn4HA.js} +1 -1
- package/out/phone/assets/{erDiagram-RLTQ6QDP-YD40E3kV.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-CC0eW0wn.js → ganttDiagram-EL5Y4UJY-Rqgggqg_.js} +1 -1
- package/out/phone/assets/{gitGraph-4MIJSDKK-BpKZk8Hu.js → gitGraph-4MIJSDKK-Drt18ZKK.js} +1 -1
- package/out/phone/assets/{gitGraphDiagram-WWUBYQGX-BCK9rLLJ.js → gitGraphDiagram-WWUBYQGX-BQ5y4d2H.js} +1 -1
- package/out/phone/assets/{info-A6RAGUB7-BKUEMrSk.js → info-A6RAGUB7-CpPeSHE0.js} +1 -1
- package/out/phone/assets/{infoDiagram-27XIBGKW-6kVlxml9.js → infoDiagram-27XIBGKW-D3d9S0Y6.js} +1 -1
- package/out/phone/assets/{ishikawaDiagram-5VMMS53U-36KijlM2.js → ishikawaDiagram-5VMMS53U-plFMqx62.js} +1 -1
- package/out/phone/assets/{journeyDiagram-3NMN7TZE-B3r6-igU.js → journeyDiagram-3NMN7TZE-CX-n-XXx.js} +1 -1
- package/out/phone/assets/{kanban-definition-UXKFOSKX-DDJMJ3eD.js → kanban-definition-UXKFOSKX-DrdTzKIc.js} +1 -1
- package/out/phone/assets/{line-CRvTNHUs.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-vpmsl7OW.js → mermaid-parser.core-CERMa6fg.js} +3 -3
- package/out/phone/assets/{mermaid.core-P6wqHn79.js → mermaid.core-CbGP2wFn.js} +4 -4
- package/out/phone/assets/{mindmap-definition-YA3MSWOX-C1Qj4NCg.js → mindmap-definition-YA3MSWOX-BxaIrov6.js} +1 -1
- package/out/phone/assets/{packet-AYTQ26CC-dPa_bCkN.js → packet-AYTQ26CC-DguFQxPm.js} +1 -1
- package/out/phone/assets/{pegDiagram-XKGWAZYB-DP29zlwD.js → pegDiagram-XKGWAZYB-t3td03dz.js} +1 -1
- package/out/phone/assets/{pie-WAS4IAKB-B7gaGnZC.js → pie-WAS4IAKB-DoFu2rhu.js} +1 -1
- package/out/phone/assets/{pieDiagram-E7YTZNPT-BIv_DaLU.js → pieDiagram-E7YTZNPT-DctHLSL8.js} +1 -1
- package/out/phone/assets/{quadrantDiagram-AXDQQJYC-BRD0SxVe.js → quadrantDiagram-AXDQQJYC-Br7-ImNr.js} +1 -1
- package/out/phone/assets/{radar-RG4KPBEZ-DSXX0eGO.js → radar-RG4KPBEZ-BDjTOHD8.js} +1 -1
- package/out/phone/assets/{railroad-74A4TZTK-CyBIlVYV.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-DqLjIO9E.js → railroadDiagram-O6MQD6OU-DtH4qQrr.js} +1 -1
- package/out/phone/assets/{requirementDiagram-BXWQKSXE-DXMysPAW.js → requirementDiagram-BXWQKSXE-BSqejjZP.js} +1 -1
- package/out/phone/assets/{sankeyDiagram-P5KCCOFB-CvbRufzx.js → sankeyDiagram-P5KCCOFB-DsTWuNtL.js} +1 -1
- package/out/phone/assets/{sequenceDiagram-WJ2MYXX4-CFMJYkK9.js → sequenceDiagram-WJ2MYXX4-zLMvPyPC.js} +1 -1
- package/out/phone/assets/{stateDiagram-D77RDMKH-C--GDYGR.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-C_L9ypxQ.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-BEk-ED-p.js → timeline-definition-24CTP7MA-8NDkGf5U.js} +1 -1
- package/out/phone/assets/{treeView-Q6P3EWNA-rolWZTr4.js → treeView-Q6P3EWNA-B9BXwCDC.js} +1 -1
- package/out/phone/assets/{treemap-WGGIJYW6-CPWEaY39.js → treemap-WGGIJYW6-B0IqbwdT.js} +1 -1
- package/out/phone/assets/{vennDiagram-4TSXK5OY-CqImR0EN.js → vennDiagram-4TSXK5OY-Dp-aKgNa.js} +1 -1
- package/out/phone/assets/{wardley-WFR3VGLG-CvTGA92O.js → wardley-WFR3VGLG-B7FlADZf.js} +1 -1
- package/out/phone/assets/{wardleyDiagram-VM6X3IG4-D9eDqbbx.js → wardleyDiagram-VM6X3IG4-BVntjQNl.js} +1 -1
- package/out/phone/assets/{xychartDiagram-S5SC5T6Z-DSenC7kX.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-D81xzDT1.js → abnfDiagram-VCTEODGH-Bp0r3dKm.js} +1 -1
- package/out/renderer/assets/{arc-ByHjKist.js → arc-BD5HnhIt.js} +1 -1
- package/out/renderer/assets/{architectureDiagram-5GKGNRK7-Bw7RgtuP.js → architectureDiagram-5GKGNRK7-CgJHjETB.js} +1 -1
- package/out/renderer/assets/{blockDiagram-I7D4REHJ-nNM7I115.js → blockDiagram-I7D4REHJ-5le9vk4G.js} +1 -1
- package/out/renderer/assets/{c4Diagram-7LVT6UL2-xixXJMhC.js → c4Diagram-7LVT6UL2-B4DCe-qN.js} +1 -1
- package/out/renderer/assets/channel-D-HltTAP.js +1 -0
- package/out/renderer/assets/{chunk-2Q5K7J3B-C0KzftkI.js → chunk-2Q5K7J3B-DIxWfJHE.js} +1 -1
- package/out/renderer/assets/{chunk-5VM5RSS4-CuqKTpNC.js → chunk-5VM5RSS4-D9j4om1l.js} +1 -1
- package/out/renderer/assets/{chunk-F27PBJKO-DyZs2_AC.js → chunk-F27PBJKO-B_tGbKyc.js} +1 -1
- package/out/renderer/assets/{chunk-IMKFNOWR-C7ktAo0J.js → chunk-IMKFNOWR-Cfffd1p9.js} +1 -1
- package/out/renderer/assets/{chunk-JWPE2WC7-CZpmOwpA.js → chunk-JWPE2WC7-BABZOPGb.js} +1 -1
- package/out/renderer/assets/{chunk-POPQ4Y6H-CVFNZRTi.js → chunk-POPQ4Y6H-D-QyVpSn.js} +1 -1
- package/out/renderer/assets/{chunk-SVP7TREG-DhMMCFNi.js → chunk-SVP7TREG-BghyPSd6.js} +1 -1
- package/out/renderer/assets/{chunk-TICWLB2K-BsceTDhj.js → chunk-TICWLB2K-CQmthy6z.js} +1 -1
- package/out/renderer/assets/{chunk-XXDRQBXY-C_grf3wS.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-wUQVmxx_.js → cose-bilkent-JH36ORCC-oajViFnN.js} +1 -1
- package/out/renderer/assets/{cynefin-OW5HDTMX-BR546Wt2.js → cynefin-OW5HDTMX-DMH1CUmI.js} +1 -1
- package/out/renderer/assets/{cynefinDiagram-5FMLGOSQ-Dp2jJhbH.js → cynefinDiagram-5FMLGOSQ-DVUJf9t0.js} +1 -1
- package/out/renderer/assets/{cytoscape-fcose-BJkAlKB8.js → cytoscape-fcose-adTZ191M.js} +1 -1
- package/out/renderer/assets/{dagre-GXQ25YYZ-XKFl5kxK.js → dagre-GXQ25YYZ-BXRWWNje.js} +1 -1
- package/out/renderer/assets/{diagram-S7CK7UJ4-BBFt2zKx.js → diagram-S7CK7UJ4-Dg7f2Dan.js} +1 -1
- package/out/renderer/assets/{diagram-UQ7AKVKN-DA2CgkM2.js → diagram-UQ7AKVKN-DsLRyZAt.js} +1 -1
- package/out/renderer/assets/{diagram-VSXAHHWV-BL96nDcT.js → diagram-VSXAHHWV-3_LoodSS.js} +1 -1
- package/out/renderer/assets/{diagram-VX7I27RA-BYbjhI9j.js → diagram-VX7I27RA-DQeZp2Cz.js} +1 -1
- package/out/renderer/assets/{diagram-Z3DM3KII-BShKaR0Y.js → diagram-Z3DM3KII-Dwil6g5m.js} +1 -1
- package/out/renderer/assets/{ebnfDiagram-PWID7BFC-CxCXjhNE.js → ebnfDiagram-PWID7BFC-DecVNxpu.js} +1 -1
- package/out/renderer/assets/{erDiagram-RLTQ6QDP-D6a85aJz.js → erDiagram-RLTQ6QDP-D2rmo2nP.js} +1 -1
- package/out/renderer/assets/{flowDiagram-HODETNUW-D7vxYWv_.js → flowDiagram-HODETNUW-_SF2dRBl.js} +1 -1
- package/out/renderer/assets/{ganttDiagram-EL5Y4UJY-D4bniC42.js → ganttDiagram-EL5Y4UJY-BoYWs5Ev.js} +1 -1
- package/out/renderer/assets/{gitGraphDiagram-WWUBYQGX-DREOVv8G.js → gitGraphDiagram-WWUBYQGX-BqRbZ3V0.js} +1 -1
- package/out/renderer/assets/globals-BEwCf508.css +1 -0
- package/out/renderer/assets/globals-C3zxoqqH.js +2603 -0
- package/out/renderer/assets/index-9vqh4wxi.js +133 -0
- package/out/renderer/assets/{infoDiagram-27XIBGKW-iQi9WT0H.js → infoDiagram-27XIBGKW-CFt6xyuD.js} +1 -1
- package/out/renderer/assets/{ishikawaDiagram-5VMMS53U-CqPXH73H.js → ishikawaDiagram-5VMMS53U-CZB8G4dD.js} +1 -1
- package/out/renderer/assets/{journeyDiagram-3NMN7TZE-DjEyHtge.js → journeyDiagram-3NMN7TZE-CO2VRmpx.js} +1 -1
- package/out/renderer/assets/{kanban-definition-UXKFOSKX-D-bxhvRO.js → kanban-definition-UXKFOSKX-DIqEnfMM.js} +1 -1
- package/out/renderer/assets/{layout-O4Dt9JSp.js → layout-DXRKfO_Y.js} +1 -1
- package/out/renderer/assets/{linear-B3fSR3zo.js → linear-Cdx1AdZJ.js} +1 -1
- package/out/renderer/assets/{mermaid.core-DKfKek0K.js → mermaid.core-DuIO2jsm.js} +5 -5
- package/out/renderer/assets/{mindmap-definition-YA3MSWOX-CgWelgTn.js → mindmap-definition-YA3MSWOX-B5lvxG2M.js} +1 -1
- package/out/renderer/assets/{pegDiagram-XKGWAZYB-6YROVnYK.js → pegDiagram-XKGWAZYB-DCwHp-K3.js} +1 -1
- package/out/renderer/assets/{pieDiagram-E7YTZNPT-BboI-zql.js → pieDiagram-E7YTZNPT-Dq048Wh7.js} +1 -1
- package/out/renderer/assets/{quadrantDiagram-AXDQQJYC-Ckl9-8_q.js → quadrantDiagram-AXDQQJYC-DwkFkAi_.js} +1 -1
- package/out/renderer/assets/{railroadDiagram-O6MQD6OU-CBmldUiO.js → railroadDiagram-O6MQD6OU-2NKvwLP-.js} +1 -1
- package/out/renderer/assets/{requirementDiagram-BXWQKSXE-BhCPsXeE.js → requirementDiagram-BXWQKSXE-Bp44tNQ0.js} +1 -1
- package/out/renderer/assets/{sankeyDiagram-P5KCCOFB-KCriZNRW.js → sankeyDiagram-P5KCCOFB-C3TFp1NK.js} +1 -1
- package/out/renderer/assets/{sequenceDiagram-WJ2MYXX4-BZRpmnqw.js → sequenceDiagram-WJ2MYXX4-BTPoYQeW.js} +1 -1
- package/out/renderer/assets/settings-DlDHkOe2.js +25 -0
- package/out/renderer/assets/{sizeCapture-INFHLROL-BHJ5WHSf.js → sizeCapture-INFHLROL-DvNj5TDT.js} +1 -1
- package/out/renderer/assets/{stateDiagram-D77RDMKH-DxHudD45.js → stateDiagram-D77RDMKH-DC8YykNp.js} +1 -1
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-B4rCEEYH.js +1 -0
- package/out/renderer/assets/{swimlanes-42K2YHIH-D2ZZdZPU.js → swimlanes-42K2YHIH-0yL1nNkg.js} +1 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-zQqW8MJ5.js +8 -0
- package/out/renderer/assets/{timeline-definition-24CTP7MA-D4FtI5C_.js → timeline-definition-24CTP7MA-Pg-2roGv.js} +1 -1
- package/out/renderer/assets/{vennDiagram-4TSXK5OY-BVq6hKjH.js → vennDiagram-4TSXK5OY-D0af5K4E.js} +1 -1
- package/out/renderer/assets/{wardleyDiagram-VM6X3IG4-39qPSeSF.js → wardleyDiagram-VM6X3IG4-CB_nIy_l.js} +1 -1
- package/out/renderer/assets/{xychartDiagram-S5SC5T6Z-IjWUG31x.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 +36 -36
- 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-BOW5-6B-.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-BtFDIu9c.js → workflowPresets-CAA0AY6f.js} +1091 -287
- package/out/server/index.js +2405 -3362
- package/out/server/plugin-host.js +2 -2
- package/package.json +2 -3
- package/out/phone/assets/architecture-7GRP2DOG-BQkxfRkk.js +0 -1
- package/out/phone/assets/channel-DGPU3seL.js +0 -1
- package/out/phone/assets/classDiagram-ZZMXUADV-DgtztyWS.js +0 -1
- package/out/phone/assets/classDiagram-v2-VYDZK3BY-DgtztyWS.js +0 -1
- package/out/phone/assets/desk-BLXfa62y.js +0 -2
- package/out/phone/assets/eventmodeling-NTZA5JFV-DdkbB0R7.js +0 -1
- package/out/phone/assets/flowDiagram-HODETNUW-B86UG3OY.js +0 -1
- package/out/phone/assets/main-BU1pbfVw.css +0 -1
- package/out/phone/assets/main-C650ZDk2.js +0 -1658
- package/out/phone/assets/railroad-abnf-HS5TGJTU-Ea30PClf.js +0 -1
- package/out/phone/assets/railroad-ebnf-LZEXJU2U-BAOLVW4i.js +0 -1
- package/out/phone/assets/railroad-peg-WCYAUIDC-DiLa9rTe.js +0 -1
- package/out/phone/assets/stateDiagram-v2-MP3YSRHH-C87lzpXA.js +0 -1
- package/out/phone/assets/storage-dUWOZ2xo.js +0 -36
- package/out/phone/assets/swimlanesDiagram-VR7AAH4N-CPaJpMYE.js +0 -8
- package/out/renderer/assets/channel-C9jBFK-_.js +0 -1
- package/out/renderer/assets/classDiagram-ZZMXUADV-B_o-oRUo.js +0 -1
- package/out/renderer/assets/classDiagram-v2-VYDZK3BY-B_o-oRUo.js +0 -1
- package/out/renderer/assets/globals-1URrQWJU.js +0 -2603
- package/out/renderer/assets/globals-DoPyZAQo.css +0 -1
- package/out/renderer/assets/index-8xDwl1RO.js +0 -133
- package/out/renderer/assets/settings-DbHps6fb.js +0 -27
- package/out/renderer/assets/stateDiagram-v2-MP3YSRHH-C0JE59RO.js +0 -1
- package/out/renderer/assets/swimlanesDiagram-VR7AAH4N-DJJObg42.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-DdJZ_JTr.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-C7ktAo0J.js";import{_ as i}from"./mermaid.core-DKfKek0K.js";import"./chunk-XXDRQBXY-C_grf3wS.js";import"./chunk-POPQ4Y6H-CVFNZRTi.js";import"./chunk-F27PBJKO-DyZs2_AC.js";import"./globals-1URrQWJU.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-D7vxYWv_.js";import{_ as a}from"./mermaid.core-DKfKek0K.js";import"./chunk-5VM5RSS4-CuqKTpNC.js";import"./chunk-XXDRQBXY-C_grf3wS.js";import"./chunk-POPQ4Y6H-CVFNZRTi.js";import"./chunk-F27PBJKO-DyZs2_AC.js";import"./channel-C9jBFK-_.js";import"./globals-1URrQWJU.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-BtFDIu9c.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-DdJZ_JTr.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
|