decocms 2.304.16 → 2.305.0
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/client/assets/{AlertCircle-YdvcZKe8.js → AlertCircle-B65qDYSH.js} +1 -1
- package/dist/client/assets/{ArrowNarrowLeft-spQjUruy.js → ArrowNarrowLeft-fzTyPWny.js} +1 -1
- package/dist/client/assets/{ArrowUpRight-B1ajIZNC.js → ArrowUpRight-BcX-Z0Ku.js} +1 -1
- package/dist/client/assets/{Check-D7cmovlU.js → Check-a0FPGBtH.js} +1 -1
- package/dist/client/assets/{CheckCircle-BQ3_L_yP.js → CheckCircle-B8cGzYri.js} +1 -1
- package/dist/client/assets/{ChevronDown-BfDxcbjR.js → ChevronDown-Z3xhSsnT.js} +1 -1
- package/dist/client/assets/{ChevronRight-BoDMW1uU.js → ChevronRight-xkl8cwkd.js} +1 -1
- package/dist/client/assets/{ChevronUp-CRQBEG-R.js → ChevronUp-Cy7lkJW1.js} +1 -1
- package/dist/client/assets/{Container-B6Z-4M-T.js → Container-cyfm5-Pb.js} +1 -1
- package/dist/client/assets/{DotsVertical-BxlMGXPv.js → DotsVertical-Bx7sSuAL.js} +1 -1
- package/dist/client/assets/{LinkExternal01-Dmf65eFo.js → LinkExternal01-0g6HjjkD.js} +1 -1
- package/dist/client/assets/{Lock01-CHWOYjbh.js → Lock01-BzMXxHmW.js} +1 -1
- package/dist/client/assets/{Palette-96pDg1d-.js → Palette-CwWccG-f.js} +1 -1
- package/dist/client/assets/{Play-ChzLrbkr.js → Play-C-AiMK-Y.js} +1 -1
- package/dist/client/assets/{Plus-Cd4I0_d-.js → Plus-DGrvw6bs.js} +1 -1
- package/dist/client/assets/{RefreshCcw01-BBhbyLOk.js → RefreshCcw01-Biyt7Dy2.js} +1 -1
- package/dist/client/assets/{SearchMd-cj9P259i.js → SearchMd-OHnYTa8U.js} +1 -1
- package/dist/client/assets/{Settings02-Cx39xFqG.js → Settings02-DO2nBrax.js} +1 -1
- package/dist/client/assets/{Shield01-DDhNoo0b.js → Shield01-DQa1zKSX.js} +1 -1
- package/dist/client/assets/{Star01-UQZ7hTDj.js → Star01-BoJYsaDm.js} +1 -1
- package/dist/client/assets/{Sun-Cr3NKiIh.js → Sun-DA-QmugE.js} +1 -1
- package/dist/client/assets/{Tool01-DXbOwd1n.js → Tool01-Cq1N-niG.js} +1 -1
- package/dist/client/assets/{Trash01-DqDMVyTa.js → Trash01-PRSN3sYk.js} +1 -1
- package/dist/client/assets/{User01-C7C_-f57.js → User01-DwPCZdnr.js} +1 -1
- package/dist/client/assets/{Users03-DGRxeg5O.js → Users03-CB3lBGeX.js} +1 -1
- package/dist/client/assets/{X-8IHaEYtM.js → X-dZLz-ulr.js} +1 -1
- package/dist/client/assets/{XCircle-kdEx_GGF.js → XCircle-yJD2sr2j.js} +1 -1
- package/dist/client/assets/{XClose-D8EpU_uy.js → XClose-Ci4dmV-Y.js} +1 -1
- package/dist/client/assets/{Zap-DdUb_mPC.js → Zap-CYJdRXq9.js} +1 -1
- package/dist/client/assets/{ZapSquare-Biix1-55.js → ZapSquare-M3u7o8sc.js} +1 -1
- package/dist/client/assets/{accordion-MNTOVO1w.js → accordion-DtmZjwNB.js} +1 -1
- package/dist/client/assets/{agent-icon-BBG09Kki.js → agent-icon-D_KgWkiu.js} +1 -1
- package/dist/client/assets/{agents-list-Cd2ZNqCV.js → agents-list-yD_xsHNb.js} +1 -1
- package/dist/client/assets/ai-providers-BHQQzoPJ.js +1 -0
- package/dist/client/assets/{alert-dialog-ChbEbjde.js → alert-dialog-Dog8t-xg.js} +1 -1
- package/dist/client/assets/{auth-catchall-CBAL823O.js → auth-catchall-B_yXTiaF.js} +1 -1
- package/dist/client/assets/{automation-list-row-ZDJkdIwJ.js → automation-list-row-BtOPPlS3.js} +1 -1
- package/dist/client/assets/{automations-_nxja9xP.js → automations-CkfQxJNN.js} +1 -1
- package/dist/client/assets/{avatar-97M2j8Mc.js → avatar-BebTr4u1.js} +1 -1
- package/dist/client/assets/{badge-CGsQT5nT.js → badge-BWEc0v7O.js} +1 -1
- package/dist/client/assets/{brand-context-D6w2oIn3.js → brand-context-LmKpYr08.js} +1 -1
- package/dist/client/assets/{card-DfJe5L79.js → card-mlKWkDqb.js} +1 -1
- package/dist/client/assets/{chat-context-Cmy5JYgW.js → chat-context-BmN5ppM9.js} +1 -1
- package/dist/client/assets/{checkbox-C1M4-v1p.js → checkbox-55NGf7aS.js} +1 -1
- package/dist/client/assets/{collection-detail-Bwwayl0Z.js → collection-detail-BaNeXOGS.js} +1 -1
- package/dist/client/assets/{collection-display-button-C5vtHGnK.js → collection-display-button-DnajjLb7.js} +1 -1
- package/dist/client/assets/{collection-search-CzQYdsP4.js → collection-search-Bsl0avLq.js} +1 -1
- package/dist/client/assets/{collection-search-DT89ZZmI.js → collection-search-CjDGYe9v.js} +1 -1
- package/dist/client/assets/{collection-table-wrapper-Bna3sxAQ.js → collection-table-wrapper-D5rnMkP_.js} +1 -1
- package/dist/client/assets/{collection-tabs-ComzcUW9.js → collection-tabs-DgQ6F5X6.js} +1 -1
- package/dist/client/assets/{collections-CTGZthcG.js → collections-DAavnhku.js} +1 -1
- package/dist/client/assets/{command-DjJw7GWb.js → command-CN1iJVAp.js} +1 -1
- package/dist/client/assets/{connection-card-DQlGg9mJ.js → connection-card-D5opGNgQ.js} +1 -1
- package/dist/client/assets/{connection-detail-Z4nXqSbX.js → connection-detail-DWinew7y.js} +1 -1
- package/dist/client/assets/{connection-form-helpers-DiGKAKlz.js → connection-form-helpers-CXHmM_yU.js} +1 -1
- package/dist/client/assets/{connections-DAoFEFST.js → connections-yUVM9Wts.js} +1 -1
- package/dist/client/assets/{constants-XC36TPvL.js → constants-BNhCk86i.js} +1 -1
- package/dist/client/assets/{constants-B9wErdMg.js → constants-Ccnt3rmd.js} +2 -2
- package/dist/client/assets/{dialog-B9n71g4e.js → dialog-_YlOXdcS.js} +1 -1
- package/dist/client/assets/{domain-settings-DAaCjfZg.js → domain-settings-DLCCNpqs.js} +1 -1
- package/dist/client/assets/{drawer-Dy5NJxEk.js → drawer-GKYdquRR.js} +1 -1
- package/dist/client/assets/{dropdown-menu-bofOMeLm.js → dropdown-menu-BXZVht4Z.js} +1 -1
- package/dist/client/assets/{dynamic-plugin-layout-DdC9w75r.js → dynamic-plugin-layout-ieJ5SRhD.js} +1 -1
- package/dist/client/assets/{empty-state-iSyeAylK.js → empty-state-CGCgWL8i.js} +1 -1
- package/dist/client/assets/{empty-state-Bl1VCnIe.js → empty-state-D1x6Uzf-.js} +1 -1
- package/dist/client/assets/{extract-connection-data-BmWiFxHJ.js → extract-connection-data-BTJzhkiq.js} +1 -1
- package/dist/client/assets/{features-BKkpnrxu.js → features-Bmw2Kywv.js} +1 -1
- package/dist/client/assets/{form-DABXYYeF.js → form-D4Q00YSx.js} +1 -1
- package/dist/client/assets/{general-DukQ3tYy.js → general-yzH2a6AI.js} +1 -1
- package/dist/client/assets/{index-BscyP7Up.js → index-7DFELu7_.js} +1 -1
- package/dist/client/assets/{index-BOl2sMex.js → index-BBbwvkmx.js} +1 -1
- package/dist/client/assets/index-C1kdSX8Z.js +182 -0
- package/dist/client/assets/{index-C7yEMUwG.js → index-CHcMm4yb.js} +1 -1
- package/dist/client/assets/index-CLv-BJNN.js +1 -0
- package/dist/client/assets/{index-abagjRmB.js → index-CUuCKerO.js} +1 -1
- package/dist/client/assets/{index-C77ixooi.js → index-Cf-Qb03y.js} +1 -1
- package/dist/client/assets/{index-DTr35K1t.js → index-DgtpEOsQ.js} +1 -1
- package/dist/client/assets/{index-DtIEOBO6.js → index-DsOYCD-H.js} +1 -1
- package/dist/client/assets/{index-iDFI-Ppt.js → index-DsncOedH.js} +1 -1
- package/dist/client/assets/{index-B40-ao-L.js → index-I3M58vcg.js} +1 -1
- package/dist/client/assets/{index-BBoaHd8c.js → index-ILTPQsH4.js} +1 -1
- package/dist/client/assets/{index-CzhKzgtD.js → index-Ux_PrmKm.js} +2 -2
- package/dist/client/assets/{index-CeXie2Ys.js → index-Yaw_OxhP.js} +1 -1
- package/dist/client/assets/index-tLkyDiOo.js +1 -0
- package/dist/client/assets/{index-CA228xnt.js → index-tngOtpnj.js} +1 -1
- package/dist/client/assets/{infiniteQueryObserver-d4mpZ_Ot.js → infiniteQueryObserver-C_u8IqUR.js} +1 -1
- package/dist/client/assets/{input-CNEsKnKX.js → input-B868_ejo.js} +1 -1
- package/dist/client/assets/{integration-icon-CSgHR76X.js → integration-icon-Ov0IbIMU.js} +1 -1
- package/dist/client/assets/{label-9fjD1g94.js → label-Cg-2ys6X.js} +1 -1
- package/dist/client/assets/{layout-DEdN-ZCr.js → layout-DkCp6X2C.js} +1 -1
- package/dist/client/assets/lean-canvas-recruit-modal-BNON-9yt.js +139 -0
- package/dist/client/assets/{login-C6yxrHRy.js → login-E_UoTHOE.js} +1 -1
- package/dist/client/assets/{members-D68Ow5uj.js → members-CC6bIoZk.js} +1 -1
- package/dist/client/assets/{monaco-editor-Dndvvjot.js → monaco-editor-DfIGvq7v.js} +1 -1
- package/dist/client/assets/{monitoring-stats-row-CKay1MEI.js → monitoring-stats-row-Chavd_5e.js} +1 -1
- package/dist/client/assets/{oauth-callback-CaaulaeP.js → oauth-callback-BQObPuY8.js} +1 -1
- package/dist/client/assets/{oauth-callback-ai-provider-ChlN62-d.js → oauth-callback-ai-provider-B_SVXSnf.js} +1 -1
- package/dist/client/assets/{onboarding-Dx3oU4tF.js → onboarding-ChmBqh-q.js} +1 -1
- package/dist/client/assets/{org-layout-UCoBgLht.js → org-layout-BWsgHF7L.js} +1 -1
- package/dist/client/assets/{org-plugin-layout-CqAgklZh.js → org-plugin-layout-D0N77j4g.js} +1 -1
- package/dist/client/assets/{pair-D1mFwARy.js → pair-DlIdkD7u.js} +1 -1
- package/dist/client/assets/{plugin-empty-state-B0cmsL9S.js → plugin-empty-state-B-u16uuv.js} +1 -1
- package/dist/client/assets/{plugin-header-BI8T-ddq.js → plugin-header-Dt0O0h26.js} +1 -1
- package/dist/client/assets/{plugin-layout-B1I7qSQF.js → plugin-layout-DK8gsZYL.js} +1 -1
- package/dist/client/assets/{popover-DJiufSUD.js → popover-B3f914lR.js} +1 -1
- package/dist/client/assets/{profile-CGXuDNln.js → profile-pLHlebiO.js} +1 -1
- package/dist/client/assets/{project-app-view-DP_-ui4r.js → project-app-view-D-yBQWHo.js} +1 -1
- package/dist/client/assets/registry-BcZJCcyc.js +2 -0
- package/dist/client/assets/{registry-layout-DIzJFcIj.js → registry-layout-0cxsWXwz.js} +1 -1
- package/dist/client/assets/{required-auth-layout-sXjdshcq.js → required-auth-layout-DLsc1xkw.js} +1 -1
- package/dist/client/assets/{reset-password-cZPjvgcJ.js → reset-password-BS6m_G36.js} +1 -1
- package/dist/client/assets/{roles-CkThyhxD.js → roles-B_ljw5IA.js} +1 -1
- package/dist/client/assets/{scroll-area-DM7jZQf0.js → scroll-area-_bumfcjA.js} +1 -1
- package/dist/client/assets/{search-input-BfUlR4kV.js → search-input-Bhq8p539.js} +1 -1
- package/dist/client/assets/{select-model-Cy_Vxqx-.js → select-model-D3fobWv8.js} +1 -1
- package/dist/client/assets/{select-WtZOfOpo.js → select-slwRPncS.js} +1 -1
- package/dist/client/assets/settings-layout-DRkmNgVc.js +1 -0
- package/dist/client/assets/{settings-section-R1g2TNeE.js → settings-section-CIXHBPOa.js} +1 -1
- package/dist/client/assets/{shell-layout-I_eJIv1K.js → shell-layout-Drnm9mfO.js} +1 -1
- package/dist/client/assets/{skeleton-DLLoz0n0.js → skeleton-ChUR9knm.js} +1 -1
- package/dist/client/assets/{sso-CzSINRFs.js → sso--URfWQeo.js} +1 -1
- package/dist/client/assets/{store-BCviRvz9.js → store-htVNKvqn.js} +1 -1
- package/dist/client/assets/store-registry-CaCyYvRn.js +2 -0
- package/dist/client/assets/{switch-BH6A3p0g.js → switch-Cf5BCxU5.js} +1 -1
- package/dist/client/assets/{table-qL_Cu6WT.js → table-CBFs2U43.js} +1 -1
- package/dist/client/assets/{tabs-DIK24gms.js → tabs-Ctrs4bAF.js} +1 -1
- package/dist/client/assets/{task-status-Bjp5sDvq.js → task-status-DUVd5pLA.js} +1 -1
- package/dist/client/assets/{textarea-DVl7iYt4.js → textarea-BbtfG9Ru.js} +1 -1
- package/dist/client/assets/{toggle-group-WOk-6cmR.js → toggle-group-DCLBHyZD.js} +1 -1
- package/dist/client/assets/{tools-list-BAADgwcR.js → tools-list-DGhR4Qyt.js} +1 -1
- package/dist/client/assets/{tooltip-DSuAs--v.js → tooltip-BOsmkVZD.js} +1 -1
- package/dist/client/assets/{types-bCWMch03.js → types-BSAKF0wC.js} +1 -1
- package/dist/client/assets/{use-ai-providers-B7R2KmGt.js → use-ai-providers-aNlhpnwf.js} +1 -1
- package/dist/client/assets/{use-collections-DFXlD5a6.js → use-collections-CqB4T92N.js} +1 -1
- package/dist/client/assets/{use-connection-mkdAsO3d.js → use-connection-C_n04i0m.js} +1 -1
- package/dist/client/assets/{use-copy-C4DghPLz.js → use-copy-B8gaSETz.js} +1 -1
- package/dist/client/assets/{use-create-virtual-mcp-ksck6WCZ.js → use-create-virtual-mcp-DvxMGqTu.js} +1 -1
- package/dist/client/assets/{use-debounced-autosave-CLtNf_EP.js → use-debounced-autosave-BAy1X_D8.js} +1 -1
- package/dist/client/assets/{use-decopilot-events-BqnGpCsr.js → use-decopilot-events-BA4osLiM.js} +1 -1
- package/dist/client/assets/{use-delete-connection-CJCTY6PR.js → use-delete-connection-C4xdydWE.js} +1 -1
- package/dist/client/assets/{use-infinite-scroll-DyWtuvVN.js → use-infinite-scroll-CW0QmsIe.js} +1 -1
- package/dist/client/assets/{use-list-state-DJhZm6uG.js → use-list-state-Dm-Ww-Vo.js} +1 -1
- package/dist/client/assets/{use-mcp-tools-CZiN_apo.js → use-mcp-tools-uazou5KQ.js} +1 -1
- package/dist/client/assets/{use-members-XoLKujIR.js → use-members-BM40IfsI.js} +1 -1
- package/dist/client/assets/{use-navigate-to-agent-BJZA0vn3.js → use-navigate-to-agent-kI9r54wH.js} +1 -1
- package/dist/client/assets/{use-org-auth-client-DFDdOgNz.js → use-org-auth-client-DCENSdBc.js} +1 -1
- package/dist/client/assets/{use-org-sso-ntNZ64id.js → use-org-sso-BIqIcUQM.js} +1 -1
- package/dist/client/assets/{use-organization-roles-DvvUCO6J.js → use-organization-roles-DAO7QdGg.js} +1 -1
- package/dist/client/assets/{use-organization-settings-BcP9GxNe.js → use-organization-settings-C-NHhw4n.js} +1 -1
- package/dist/client/assets/{use-registry-connections-C3Shxtge.js → use-registry-connections-B1oBXsUK.js} +1 -1
- package/dist/client/assets/{use-status-sounds-BhmdTf72.js → use-status-sounds-DEn9-reM.js} +1 -1
- package/dist/client/assets/{use-tasks-CFKcirif.js → use-tasks-CJ3vNKME.js} +1 -1
- package/dist/client/assets/{use-view-mode-DPFNPRhw.js → use-view-mode-DTFti-L5.js} +1 -1
- package/dist/client/assets/{use-virtual-mcp-D6IJdvj4.js → use-virtual-mcp-Cd4gN6tQ.js} +1 -1
- package/dist/client/assets/useInfiniteQuery-BMlr4G1E.js +1 -0
- package/dist/client/assets/useSuspenseInfiniteQuery-BNLcV52p.js +1 -0
- package/dist/client/assets/{user-s33U8vUh.js → user-BirTYLn0.js} +1 -1
- package/dist/client/assets/{view-mode-toggle-DTQbwKIC.js → view-mode-toggle-_LNgXbfe.js} +1 -1
- package/dist/client/assets/{workflow-BNc2v09H.js → workflow-CE9nGfJB.js} +1 -1
- package/dist/client/assets/workflow-detail-hgfq2rMH.js +1 -0
- package/dist/client/index.html +1 -1
- package/dist/server/cli.js +24 -25
- package/dist/server/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
- package/dist/server/node_modules/is-fullwidth-code-point/index.js +12 -0
- package/dist/server/node_modules/is-fullwidth-code-point/license +9 -0
- package/dist/server/node_modules/is-fullwidth-code-point/package.json +53 -0
- package/dist/server/node_modules/is-fullwidth-code-point/readme.md +31 -0
- package/dist/server/node_modules/mimic-fn/index.d.ts +54 -0
- package/dist/server/node_modules/mimic-fn/index.js +13 -0
- package/dist/server/node_modules/mimic-fn/license +9 -0
- package/dist/server/node_modules/mimic-fn/package.json +42 -0
- package/dist/server/node_modules/mimic-fn/readme.md +69 -0
- package/dist/server/node_modules/onetime/index.d.ts +64 -0
- package/dist/server/node_modules/onetime/index.js +44 -0
- package/dist/server/node_modules/onetime/license +9 -0
- package/dist/server/node_modules/onetime/package.json +43 -0
- package/dist/server/node_modules/onetime/readme.md +94 -0
- package/dist/server/node_modules/pg-int8/LICENSE +13 -0
- package/dist/server/node_modules/pg-int8/README.md +16 -0
- package/dist/server/node_modules/pg-int8/index.js +100 -0
- package/dist/server/node_modules/pg-int8/package.json +24 -0
- package/dist/server/node_modules/postgres-bytea/index.js +33 -0
- package/dist/server/node_modules/postgres-bytea/license +21 -0
- package/dist/server/node_modules/postgres-bytea/package.json +34 -0
- package/dist/server/node_modules/postgres-bytea/readme.md +34 -0
- package/dist/server/node_modules/postgres-date/index.js +116 -0
- package/dist/server/node_modules/postgres-date/license +21 -0
- package/dist/server/node_modules/postgres-date/package.json +33 -0
- package/dist/server/node_modules/postgres-date/readme.md +49 -0
- package/dist/server/node_modules/postgres-interval/index.d.ts +20 -0
- package/dist/server/node_modules/postgres-interval/index.js +125 -0
- package/dist/server/node_modules/postgres-interval/license +21 -0
- package/dist/server/node_modules/postgres-interval/package.json +36 -0
- package/dist/server/node_modules/postgres-interval/readme.md +48 -0
- package/dist/server/node_modules/split2/LICENSE +13 -0
- package/dist/server/node_modules/split2/README.md +85 -0
- package/dist/server/node_modules/split2/bench.js +27 -0
- package/dist/server/node_modules/split2/index.js +141 -0
- package/dist/server/node_modules/split2/package.json +39 -0
- package/dist/server/node_modules/split2/test.js +409 -0
- package/dist/server/server.js +23 -24
- package/package.json +1 -1
- package/dist/client/assets/ai-providers-BM3nrPzC.js +0 -1
- package/dist/client/assets/index-D3A4ePI7.js +0 -1
- package/dist/client/assets/index-DI9Yp0oo.js +0 -1
- package/dist/client/assets/index-DT7Nf9M6.js +0 -189
- package/dist/client/assets/lean-canvas-recruit-modal-CEK7JzdS.js +0 -116
- package/dist/client/assets/registry-CFvs_APs.js +0 -2
- package/dist/client/assets/settings-layout-CbLLwkfV.js +0 -1
- package/dist/client/assets/store-registry-C9ivXmwu.js +0 -2
- package/dist/client/assets/useInfiniteQuery-nrn6q72G.js +0 -1
- package/dist/client/assets/useSuspenseInfiniteQuery-BQugVIVu.js +0 -1
- package/dist/client/assets/workflow-detail-Dh3EHXZU.js +0 -1
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2014-2021, Matteo Collina <hello@matteocollina.com>
|
|
3
|
+
|
|
4
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
5
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
6
|
+
copyright notice and this permission notice appear in all copies.
|
|
7
|
+
|
|
8
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
9
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
10
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
11
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
12
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
13
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
14
|
+
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
'use strict'
|
|
18
|
+
|
|
19
|
+
const { Transform } = require('stream')
|
|
20
|
+
const { StringDecoder } = require('string_decoder')
|
|
21
|
+
const kLast = Symbol('last')
|
|
22
|
+
const kDecoder = Symbol('decoder')
|
|
23
|
+
|
|
24
|
+
function transform (chunk, enc, cb) {
|
|
25
|
+
let list
|
|
26
|
+
if (this.overflow) { // Line buffer is full. Skip to start of next line.
|
|
27
|
+
const buf = this[kDecoder].write(chunk)
|
|
28
|
+
list = buf.split(this.matcher)
|
|
29
|
+
|
|
30
|
+
if (list.length === 1) return cb() // Line ending not found. Discard entire chunk.
|
|
31
|
+
|
|
32
|
+
// Line ending found. Discard trailing fragment of previous line and reset overflow state.
|
|
33
|
+
list.shift()
|
|
34
|
+
this.overflow = false
|
|
35
|
+
} else {
|
|
36
|
+
this[kLast] += this[kDecoder].write(chunk)
|
|
37
|
+
list = this[kLast].split(this.matcher)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
this[kLast] = list.pop()
|
|
41
|
+
|
|
42
|
+
for (let i = 0; i < list.length; i++) {
|
|
43
|
+
try {
|
|
44
|
+
push(this, this.mapper(list[i]))
|
|
45
|
+
} catch (error) {
|
|
46
|
+
return cb(error)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
this.overflow = this[kLast].length > this.maxLength
|
|
51
|
+
if (this.overflow && !this.skipOverflow) {
|
|
52
|
+
cb(new Error('maximum buffer reached'))
|
|
53
|
+
return
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
cb()
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function flush (cb) {
|
|
60
|
+
// forward any gibberish left in there
|
|
61
|
+
this[kLast] += this[kDecoder].end()
|
|
62
|
+
|
|
63
|
+
if (this[kLast]) {
|
|
64
|
+
try {
|
|
65
|
+
push(this, this.mapper(this[kLast]))
|
|
66
|
+
} catch (error) {
|
|
67
|
+
return cb(error)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
cb()
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function push (self, val) {
|
|
75
|
+
if (val !== undefined) {
|
|
76
|
+
self.push(val)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function noop (incoming) {
|
|
81
|
+
return incoming
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function split (matcher, mapper, options) {
|
|
85
|
+
// Set defaults for any arguments not supplied.
|
|
86
|
+
matcher = matcher || /\r?\n/
|
|
87
|
+
mapper = mapper || noop
|
|
88
|
+
options = options || {}
|
|
89
|
+
|
|
90
|
+
// Test arguments explicitly.
|
|
91
|
+
switch (arguments.length) {
|
|
92
|
+
case 1:
|
|
93
|
+
// If mapper is only argument.
|
|
94
|
+
if (typeof matcher === 'function') {
|
|
95
|
+
mapper = matcher
|
|
96
|
+
matcher = /\r?\n/
|
|
97
|
+
// If options is only argument.
|
|
98
|
+
} else if (typeof matcher === 'object' && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
|
|
99
|
+
options = matcher
|
|
100
|
+
matcher = /\r?\n/
|
|
101
|
+
}
|
|
102
|
+
break
|
|
103
|
+
|
|
104
|
+
case 2:
|
|
105
|
+
// If mapper and options are arguments.
|
|
106
|
+
if (typeof matcher === 'function') {
|
|
107
|
+
options = mapper
|
|
108
|
+
mapper = matcher
|
|
109
|
+
matcher = /\r?\n/
|
|
110
|
+
// If matcher and options are arguments.
|
|
111
|
+
} else if (typeof mapper === 'object') {
|
|
112
|
+
options = mapper
|
|
113
|
+
mapper = noop
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
options = Object.assign({}, options)
|
|
118
|
+
options.autoDestroy = true
|
|
119
|
+
options.transform = transform
|
|
120
|
+
options.flush = flush
|
|
121
|
+
options.readableObjectMode = true
|
|
122
|
+
|
|
123
|
+
const stream = new Transform(options)
|
|
124
|
+
|
|
125
|
+
stream[kLast] = ''
|
|
126
|
+
stream[kDecoder] = new StringDecoder('utf8')
|
|
127
|
+
stream.matcher = matcher
|
|
128
|
+
stream.mapper = mapper
|
|
129
|
+
stream.maxLength = options.maxLength
|
|
130
|
+
stream.skipOverflow = options.skipOverflow || false
|
|
131
|
+
stream.overflow = false
|
|
132
|
+
stream._destroy = function (err, cb) {
|
|
133
|
+
// Weird Node v12 bug that we need to work around
|
|
134
|
+
this._writableState.errorEmitted = false
|
|
135
|
+
cb(err)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return stream
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
module.exports = split
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "split2",
|
|
3
|
+
"version": "4.2.0",
|
|
4
|
+
"description": "split a Text Stream into a Line Stream, using Stream 3",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"lint": "standard --verbose",
|
|
8
|
+
"unit": "nyc --lines 100 --branches 100 --functions 100 --check-coverage --reporter=text tape test.js",
|
|
9
|
+
"coverage": "nyc --reporter=html --reporter=cobertura --reporter=text tape test/test.js",
|
|
10
|
+
"test:report": "npm run lint && npm run unit:report",
|
|
11
|
+
"test": "npm run lint && npm run unit",
|
|
12
|
+
"legacy": "tape test.js"
|
|
13
|
+
},
|
|
14
|
+
"pre-commit": [
|
|
15
|
+
"test"
|
|
16
|
+
],
|
|
17
|
+
"website": "https://github.com/mcollina/split2",
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/mcollina/split2.git"
|
|
21
|
+
},
|
|
22
|
+
"bugs": {
|
|
23
|
+
"url": "http://github.com/mcollina/split2/issues"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">= 10.x"
|
|
27
|
+
},
|
|
28
|
+
"author": "Matteo Collina <hello@matteocollina.com>",
|
|
29
|
+
"license": "ISC",
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"binary-split": "^1.0.3",
|
|
32
|
+
"callback-stream": "^1.1.0",
|
|
33
|
+
"fastbench": "^1.0.0",
|
|
34
|
+
"nyc": "^15.0.1",
|
|
35
|
+
"pre-commit": "^1.1.2",
|
|
36
|
+
"standard": "^17.0.0",
|
|
37
|
+
"tape": "^5.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
const test = require('tape')
|
|
4
|
+
const split = require('./')
|
|
5
|
+
const callback = require('callback-stream')
|
|
6
|
+
const strcb = callback.bind(null, { decodeStrings: false })
|
|
7
|
+
const objcb = callback.bind(null, { objectMode: true })
|
|
8
|
+
|
|
9
|
+
test('split two lines on end', function (t) {
|
|
10
|
+
t.plan(2)
|
|
11
|
+
|
|
12
|
+
const input = split()
|
|
13
|
+
|
|
14
|
+
input.pipe(strcb(function (err, list) {
|
|
15
|
+
t.error(err)
|
|
16
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
17
|
+
}))
|
|
18
|
+
|
|
19
|
+
input.end('hello\nworld')
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
test('split two lines on two writes', function (t) {
|
|
23
|
+
t.plan(2)
|
|
24
|
+
|
|
25
|
+
const input = split()
|
|
26
|
+
|
|
27
|
+
input.pipe(strcb(function (err, list) {
|
|
28
|
+
t.error(err)
|
|
29
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
30
|
+
}))
|
|
31
|
+
|
|
32
|
+
input.write('hello')
|
|
33
|
+
input.write('\nworld')
|
|
34
|
+
input.end()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
test('split four lines on three writes', function (t) {
|
|
38
|
+
t.plan(2)
|
|
39
|
+
|
|
40
|
+
const input = split()
|
|
41
|
+
|
|
42
|
+
input.pipe(strcb(function (err, list) {
|
|
43
|
+
t.error(err)
|
|
44
|
+
t.deepEqual(list, ['hello', 'world', 'bye', 'world'])
|
|
45
|
+
}))
|
|
46
|
+
|
|
47
|
+
input.write('hello\nwor')
|
|
48
|
+
input.write('ld\nbye\nwo')
|
|
49
|
+
input.write('rld')
|
|
50
|
+
input.end()
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
test('accumulate multiple writes', function (t) {
|
|
54
|
+
t.plan(2)
|
|
55
|
+
|
|
56
|
+
const input = split()
|
|
57
|
+
|
|
58
|
+
input.pipe(strcb(function (err, list) {
|
|
59
|
+
t.error(err)
|
|
60
|
+
t.deepEqual(list, ['helloworld'])
|
|
61
|
+
}))
|
|
62
|
+
|
|
63
|
+
input.write('hello')
|
|
64
|
+
input.write('world')
|
|
65
|
+
input.end()
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
test('split using a custom string matcher', function (t) {
|
|
69
|
+
t.plan(2)
|
|
70
|
+
|
|
71
|
+
const input = split('~')
|
|
72
|
+
|
|
73
|
+
input.pipe(strcb(function (err, list) {
|
|
74
|
+
t.error(err)
|
|
75
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
76
|
+
}))
|
|
77
|
+
|
|
78
|
+
input.end('hello~world')
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
test('split using a custom regexp matcher', function (t) {
|
|
82
|
+
t.plan(2)
|
|
83
|
+
|
|
84
|
+
const input = split(/~/)
|
|
85
|
+
|
|
86
|
+
input.pipe(strcb(function (err, list) {
|
|
87
|
+
t.error(err)
|
|
88
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
89
|
+
}))
|
|
90
|
+
|
|
91
|
+
input.end('hello~world')
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
test('support an option argument', function (t) {
|
|
95
|
+
t.plan(2)
|
|
96
|
+
|
|
97
|
+
const input = split({ highWaterMark: 2 })
|
|
98
|
+
|
|
99
|
+
input.pipe(strcb(function (err, list) {
|
|
100
|
+
t.error(err)
|
|
101
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
102
|
+
}))
|
|
103
|
+
|
|
104
|
+
input.end('hello\nworld')
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
test('support a mapper function', function (t) {
|
|
108
|
+
t.plan(2)
|
|
109
|
+
|
|
110
|
+
const a = { a: '42' }
|
|
111
|
+
const b = { b: '24' }
|
|
112
|
+
|
|
113
|
+
const input = split(JSON.parse)
|
|
114
|
+
|
|
115
|
+
input.pipe(objcb(function (err, list) {
|
|
116
|
+
t.error(err)
|
|
117
|
+
t.deepEqual(list, [a, b])
|
|
118
|
+
}))
|
|
119
|
+
|
|
120
|
+
input.write(JSON.stringify(a))
|
|
121
|
+
input.write('\n')
|
|
122
|
+
input.end(JSON.stringify(b))
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
test('split lines windows-style', function (t) {
|
|
126
|
+
t.plan(2)
|
|
127
|
+
|
|
128
|
+
const input = split()
|
|
129
|
+
|
|
130
|
+
input.pipe(strcb(function (err, list) {
|
|
131
|
+
t.error(err)
|
|
132
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
133
|
+
}))
|
|
134
|
+
|
|
135
|
+
input.end('hello\r\nworld')
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
test('splits a buffer', function (t) {
|
|
139
|
+
t.plan(2)
|
|
140
|
+
|
|
141
|
+
const input = split()
|
|
142
|
+
|
|
143
|
+
input.pipe(strcb(function (err, list) {
|
|
144
|
+
t.error(err)
|
|
145
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
146
|
+
}))
|
|
147
|
+
|
|
148
|
+
input.end(Buffer.from('hello\nworld'))
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
test('do not end on undefined', function (t) {
|
|
152
|
+
t.plan(2)
|
|
153
|
+
|
|
154
|
+
const input = split(function (line) { })
|
|
155
|
+
|
|
156
|
+
input.pipe(strcb(function (err, list) {
|
|
157
|
+
t.error(err)
|
|
158
|
+
t.deepEqual(list, [])
|
|
159
|
+
}))
|
|
160
|
+
|
|
161
|
+
input.end(Buffer.from('hello\nworld'))
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
test('has destroy method', function (t) {
|
|
165
|
+
t.plan(1)
|
|
166
|
+
|
|
167
|
+
const input = split(function (line) { })
|
|
168
|
+
|
|
169
|
+
input.on('close', function () {
|
|
170
|
+
t.ok(true, 'close emitted')
|
|
171
|
+
t.end()
|
|
172
|
+
})
|
|
173
|
+
|
|
174
|
+
input.destroy()
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
test('support custom matcher and mapper', function (t) {
|
|
178
|
+
t.plan(4)
|
|
179
|
+
|
|
180
|
+
const a = { a: '42' }
|
|
181
|
+
const b = { b: '24' }
|
|
182
|
+
const input = split('~', JSON.parse)
|
|
183
|
+
|
|
184
|
+
t.equal(input.matcher, '~')
|
|
185
|
+
t.equal(typeof input.mapper, 'function')
|
|
186
|
+
|
|
187
|
+
input.pipe(objcb(function (err, list) {
|
|
188
|
+
t.notOk(err, 'no errors')
|
|
189
|
+
t.deepEqual(list, [a, b])
|
|
190
|
+
}))
|
|
191
|
+
|
|
192
|
+
input.write(JSON.stringify(a))
|
|
193
|
+
input.write('~')
|
|
194
|
+
input.end(JSON.stringify(b))
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
test('support custom matcher and options', function (t) {
|
|
198
|
+
t.plan(6)
|
|
199
|
+
|
|
200
|
+
const input = split('~', { highWaterMark: 1024 })
|
|
201
|
+
|
|
202
|
+
t.equal(input.matcher, '~')
|
|
203
|
+
t.equal(typeof input.mapper, 'function')
|
|
204
|
+
t.equal(input._readableState.highWaterMark, 1024)
|
|
205
|
+
t.equal(input._writableState.highWaterMark, 1024)
|
|
206
|
+
|
|
207
|
+
input.pipe(strcb(function (err, list) {
|
|
208
|
+
t.error(err)
|
|
209
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
210
|
+
}))
|
|
211
|
+
|
|
212
|
+
input.end('hello~world')
|
|
213
|
+
})
|
|
214
|
+
|
|
215
|
+
test('support mapper and options', function (t) {
|
|
216
|
+
t.plan(6)
|
|
217
|
+
|
|
218
|
+
const a = { a: '42' }
|
|
219
|
+
const b = { b: '24' }
|
|
220
|
+
const input = split(JSON.parse, { highWaterMark: 1024 })
|
|
221
|
+
|
|
222
|
+
t.ok(input.matcher instanceof RegExp, 'matcher is RegExp')
|
|
223
|
+
t.equal(typeof input.mapper, 'function')
|
|
224
|
+
t.equal(input._readableState.highWaterMark, 1024)
|
|
225
|
+
t.equal(input._writableState.highWaterMark, 1024)
|
|
226
|
+
|
|
227
|
+
input.pipe(objcb(function (err, list) {
|
|
228
|
+
t.error(err)
|
|
229
|
+
t.deepEqual(list, [a, b])
|
|
230
|
+
}))
|
|
231
|
+
|
|
232
|
+
input.write(JSON.stringify(a))
|
|
233
|
+
input.write('\n')
|
|
234
|
+
input.end(JSON.stringify(b))
|
|
235
|
+
})
|
|
236
|
+
|
|
237
|
+
test('split utf8 chars', function (t) {
|
|
238
|
+
t.plan(2)
|
|
239
|
+
|
|
240
|
+
const input = split()
|
|
241
|
+
|
|
242
|
+
input.pipe(strcb(function (err, list) {
|
|
243
|
+
t.error(err)
|
|
244
|
+
t.deepEqual(list, ['烫烫烫', '锟斤拷'])
|
|
245
|
+
}))
|
|
246
|
+
|
|
247
|
+
const buf = Buffer.from('烫烫烫\r\n锟斤拷', 'utf8')
|
|
248
|
+
for (let i = 0; i < buf.length; ++i) {
|
|
249
|
+
input.write(buf.slice(i, i + 1))
|
|
250
|
+
}
|
|
251
|
+
input.end()
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
test('split utf8 chars 2by2', function (t) {
|
|
255
|
+
t.plan(2)
|
|
256
|
+
|
|
257
|
+
const input = split()
|
|
258
|
+
|
|
259
|
+
input.pipe(strcb(function (err, list) {
|
|
260
|
+
t.error(err)
|
|
261
|
+
t.deepEqual(list, ['烫烫烫', '烫烫烫'])
|
|
262
|
+
}))
|
|
263
|
+
|
|
264
|
+
const str = '烫烫烫\r\n烫烫烫'
|
|
265
|
+
const buf = Buffer.from(str, 'utf8')
|
|
266
|
+
for (let i = 0; i < buf.length; i += 2) {
|
|
267
|
+
input.write(buf.slice(i, i + 2))
|
|
268
|
+
}
|
|
269
|
+
input.end()
|
|
270
|
+
})
|
|
271
|
+
|
|
272
|
+
test('split lines when the \n comes at the end of a chunk', function (t) {
|
|
273
|
+
t.plan(2)
|
|
274
|
+
|
|
275
|
+
const input = split()
|
|
276
|
+
|
|
277
|
+
input.pipe(strcb(function (err, list) {
|
|
278
|
+
t.error(err)
|
|
279
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
280
|
+
}))
|
|
281
|
+
|
|
282
|
+
input.write('hello\n')
|
|
283
|
+
input.end('world')
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
test('truncated utf-8 char', function (t) {
|
|
287
|
+
t.plan(2)
|
|
288
|
+
|
|
289
|
+
const input = split()
|
|
290
|
+
|
|
291
|
+
input.pipe(strcb(function (err, list) {
|
|
292
|
+
t.error(err)
|
|
293
|
+
t.deepEqual(list, ['烫' + Buffer.from('e7', 'hex').toString()])
|
|
294
|
+
}))
|
|
295
|
+
|
|
296
|
+
const str = '烫烫'
|
|
297
|
+
const buf = Buffer.from(str, 'utf8')
|
|
298
|
+
|
|
299
|
+
input.write(buf.slice(0, 3))
|
|
300
|
+
input.end(buf.slice(3, 4))
|
|
301
|
+
})
|
|
302
|
+
|
|
303
|
+
test('maximum buffer limit', function (t) {
|
|
304
|
+
t.plan(1)
|
|
305
|
+
|
|
306
|
+
const input = split({ maxLength: 2 })
|
|
307
|
+
input.on('error', function (err) {
|
|
308
|
+
t.ok(err)
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
input.resume()
|
|
312
|
+
|
|
313
|
+
input.write('hey')
|
|
314
|
+
})
|
|
315
|
+
|
|
316
|
+
test('readable highWaterMark', function (t) {
|
|
317
|
+
const input = split()
|
|
318
|
+
t.equal(input._readableState.highWaterMark, 16)
|
|
319
|
+
t.end()
|
|
320
|
+
})
|
|
321
|
+
|
|
322
|
+
test('maxLength < chunk size', function (t) {
|
|
323
|
+
t.plan(2)
|
|
324
|
+
|
|
325
|
+
const input = split({ maxLength: 2 })
|
|
326
|
+
|
|
327
|
+
input.pipe(strcb(function (err, list) {
|
|
328
|
+
t.error(err)
|
|
329
|
+
t.deepEqual(list, ['a', 'b'])
|
|
330
|
+
}))
|
|
331
|
+
|
|
332
|
+
input.end('a\nb')
|
|
333
|
+
})
|
|
334
|
+
|
|
335
|
+
test('maximum buffer limit w/skip', function (t) {
|
|
336
|
+
t.plan(2)
|
|
337
|
+
|
|
338
|
+
const input = split({ maxLength: 2, skipOverflow: true })
|
|
339
|
+
|
|
340
|
+
input.pipe(strcb(function (err, list) {
|
|
341
|
+
t.error(err)
|
|
342
|
+
t.deepEqual(list, ['a', 'b', 'c'])
|
|
343
|
+
}))
|
|
344
|
+
|
|
345
|
+
input.write('a\n123')
|
|
346
|
+
input.write('456')
|
|
347
|
+
input.write('789\nb\nc')
|
|
348
|
+
input.end()
|
|
349
|
+
})
|
|
350
|
+
|
|
351
|
+
test("don't modify the options object", function (t) {
|
|
352
|
+
t.plan(2)
|
|
353
|
+
|
|
354
|
+
const options = {}
|
|
355
|
+
const input = split(options)
|
|
356
|
+
|
|
357
|
+
input.pipe(strcb(function (err, list) {
|
|
358
|
+
t.error(err)
|
|
359
|
+
t.same(options, {})
|
|
360
|
+
}))
|
|
361
|
+
|
|
362
|
+
input.end()
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
test('mapper throws flush', function (t) {
|
|
366
|
+
t.plan(1)
|
|
367
|
+
const error = new Error()
|
|
368
|
+
const input = split(function () {
|
|
369
|
+
throw error
|
|
370
|
+
})
|
|
371
|
+
|
|
372
|
+
input.on('error', (err, list) => {
|
|
373
|
+
t.same(err, error)
|
|
374
|
+
})
|
|
375
|
+
input.end('hello')
|
|
376
|
+
})
|
|
377
|
+
|
|
378
|
+
test('mapper throws on transform', function (t) {
|
|
379
|
+
t.plan(1)
|
|
380
|
+
|
|
381
|
+
const error = new Error()
|
|
382
|
+
const input = split(function (l) {
|
|
383
|
+
throw error
|
|
384
|
+
})
|
|
385
|
+
|
|
386
|
+
input.on('error', (err) => {
|
|
387
|
+
t.same(err, error)
|
|
388
|
+
})
|
|
389
|
+
input.write('a')
|
|
390
|
+
input.write('\n')
|
|
391
|
+
input.end('b')
|
|
392
|
+
})
|
|
393
|
+
|
|
394
|
+
test('supports Symbol.split', function (t) {
|
|
395
|
+
t.plan(2)
|
|
396
|
+
|
|
397
|
+
const input = split({
|
|
398
|
+
[Symbol.split] (str) {
|
|
399
|
+
return str.split('~')
|
|
400
|
+
}
|
|
401
|
+
})
|
|
402
|
+
|
|
403
|
+
input.pipe(strcb(function (err, list) {
|
|
404
|
+
t.error(err)
|
|
405
|
+
t.deepEqual(list, ['hello', 'world'])
|
|
406
|
+
}))
|
|
407
|
+
|
|
408
|
+
input.end('hello~world')
|
|
409
|
+
})
|
package/dist/server/server.js
CHANGED
|
@@ -1223,6 +1223,18 @@ You are the Agent Manager. You create, configure, and maintain agents (Virtual M
|
|
|
1223
1223
|
a. List all agents with COLLECTION_VIRTUAL_MCP_LIST.
|
|
1224
1224
|
b. For detailed inspection, use COLLECTION_VIRTUAL_MCP_GET on specific agents.
|
|
1225
1225
|
c. Cross-reference with COLLECTION_CONNECTIONS_LIST to identify unused or missing connections.
|
|
1226
|
+
|
|
1227
|
+
4. Improving an agent's instructions:
|
|
1228
|
+
a. Read docs://agents.md for the instruction-writing pattern (XML-style sections, explicit workflows).
|
|
1229
|
+
b. Get the current instructions with COLLECTION_VIRTUAL_MCP_GET on the supplied agent id.
|
|
1230
|
+
c. If the intended purpose, audience, or boundaries are unclear, use user_ask before rewriting.
|
|
1231
|
+
d. Rewrite the instructions with explicit XML-style sections: <role>, <capabilities>, <constraints>, <workflows>.
|
|
1232
|
+
- Make the purpose explicit in <role>.
|
|
1233
|
+
- If a workflow already exists, sharpen it into concrete, ordered, operational steps. If none exists, add one that reflects how the agent should actually operate.
|
|
1234
|
+
- Tighten <constraints> when the current instructions are too open-ended.
|
|
1235
|
+
- Preserve the user's intended domain and responsibilities.
|
|
1236
|
+
e. Save the rewritten instructions with COLLECTION_VIRTUAL_MCP_UPDATE using the smallest change set (only \`metadata.instructions\`).
|
|
1237
|
+
f. Re-read with COLLECTION_VIRTUAL_MCP_GET to verify the stored result.
|
|
1226
1238
|
</workflows>`,H45=`<role>
|
|
1227
1239
|
You are the Automation Manager. You create, configure, and manage automations \u2014 background agents that run on triggers (cron schedules or events).
|
|
1228
1240
|
</role>
|
|
@@ -1263,6 +1275,17 @@ You are the Automation Manager. You create, configure, and manage automations \u
|
|
|
1263
1275
|
a. Get the automation config with AUTOMATION_GET to review its setup.
|
|
1264
1276
|
b. Run it manually with AUTOMATION_RUN.
|
|
1265
1277
|
c. Report the result to the user.
|
|
1278
|
+
|
|
1279
|
+
4. Improving an automation's instructions:
|
|
1280
|
+
a. Read docs://automations.md for the messages/instructions pattern, then docs://agents.md for the XML-style structure.
|
|
1281
|
+
b. Get the current automation with AUTOMATION_GET on the supplied automation id.
|
|
1282
|
+
c. If the intended purpose, trigger context, or expected output is unclear, use user_ask before rewriting.
|
|
1283
|
+
d. Rewrite the messages with explicit XML-style sections: <role>, <capabilities>, <constraints>, <workflows>.
|
|
1284
|
+
- Keep the rewrite aligned with the automation's trigger and expected background-execution behavior.
|
|
1285
|
+
- If a workflow already exists, sharpen it into concrete, ordered, operational steps. If none exists, add one.
|
|
1286
|
+
- Tighten <constraints> when the current messages are too open-ended.
|
|
1287
|
+
e. Save with AUTOMATION_UPDATE using the smallest change set.
|
|
1288
|
+
f. Re-read with AUTOMATION_GET to verify the stored result.
|
|
1266
1289
|
</workflows>`,F45=`<role>
|
|
1267
1290
|
You are the Connection Manager. You create, configure, test, and manage MCP connections in this workspace.
|
|
1268
1291
|
</role>
|
|
@@ -1979,30 +2002,6 @@ Checks:
|
|
|
1979
2002
|
- If changing connections, verify the new set still matches the agent's purpose.
|
|
1980
2003
|
- Call out destructive or high-impact changes before applying them.
|
|
1981
2004
|
- Confirm the final agent definition matches the request.
|
|
1982
|
-
`},{name:"writing-prompts",title:"Improve Instructions",description:"Improve instructions for an agent or automation.",text:`# Writing instructions
|
|
1983
|
-
|
|
1984
|
-
Goal: rewrite or refine instructions for either an agent or an automation so they clearly describe the purpose, constraints, and workflows in a reliable format.
|
|
1985
|
-
|
|
1986
|
-
Read docs://agents.md for the instruction-writing pattern, XML-style structure, and workflow guidance. Read docs://automations.md if you are improving automation behavior rather than agent behavior.
|
|
1987
|
-
|
|
1988
|
-
Recommended tool order:
|
|
1989
|
-
1. Identify whether the target is an agent or an automation.
|
|
1990
|
-
2. For agents, use COLLECTION_VIRTUAL_MCP_LIST or COLLECTION_VIRTUAL_MCP_GET to inspect the current instructions.
|
|
1991
|
-
3. For automations, use AUTOMATION_LIST or AUTOMATION_GET to inspect the current messages/instructions.
|
|
1992
|
-
4. Review the current instructions against docs://agents.md.
|
|
1993
|
-
5. If the intended purpose, audience, or boundaries are unclear, use user_ask before rewriting.
|
|
1994
|
-
6. Rewrite the instructions with explicit XML-style sections such as <role>, <capabilities>, <constraints>, and <workflows>.
|
|
1995
|
-
7. For agents, use COLLECTION_VIRTUAL_MCP_UPDATE to save the improved instructions.
|
|
1996
|
-
8. For automations, use AUTOMATION_UPDATE to save the improved messages/instructions.
|
|
1997
|
-
9. Re-read the updated entity with COLLECTION_VIRTUAL_MCP_GET or AUTOMATION_GET to verify the final stored version.
|
|
1998
|
-
|
|
1999
|
-
Checks:
|
|
2000
|
-
- Make the purpose explicit in a <role> section.
|
|
2001
|
-
- Detect whether the current instructions already contain a workflow. If they do, improve the workflow to be concrete, ordered, and operational. If they do not, add one.
|
|
2002
|
-
- Keep workflows numbered and focused on real execution steps, not vague advice.
|
|
2003
|
-
- Add or tighten constraints when the current instructions are too open-ended.
|
|
2004
|
-
- Preserve the user's intended domain and responsibilities while improving clarity.
|
|
2005
|
-
- If the target is an automation, keep the instructions aligned with the trigger and expected background execution behavior.
|
|
2006
2005
|
`}],GV6=[{name:"agents",uri:"docs://agents.md",description:"Agent naming, instruction writing, and prompt-engineering guidance.",text:`# Agents
|
|
2007
2006
|
|
|
2008
2007
|
## Naming
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as t,j as i}from"./index-CzhKzgtD.js";import{O as m}from"./select-model-Cy_Vxqx-.js";import"./checkbox-C1M4-v1p.js";import"./Check-D7cmovlU.js";import"./input-CNEsKnKX.js";import"./dialog-B9n71g4e.js";import"./X-8IHaEYtM.js";import"./drawer-Dy5NJxEk.js";import"./tooltip-DSuAs--v.js";import"./select-WtZOfOpo.js";import"./ChevronDown-BfDxcbjR.js";import"./ChevronUp-CRQBEG-R.js";import"./skeleton-DLLoz0n0.js";import"./Tool01-DXbOwd1n.js";import"./RefreshCcw01-BBhbyLOk.js";import"./SearchMd-cj9P259i.js";import"./Settings02-Cx39xFqG.js";import"./use-ai-providers-B7R2KmGt.js";import"./constants-B9wErdMg.js";import"./chat-context-Cmy5JYgW.js";import"./use-virtual-mcp-D6IJdvj4.js";import"./use-collections-DFXlD5a6.js";import"./use-decopilot-events-BqnGpCsr.js";import"./create-sse-subscription-CxkOgzKf.js";import"./use-tasks-CFKcirif.js";import"./use-organization-settings-BcP9GxNe.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Zap-DdUb_mPC.js";import"./use-debounced-autosave-CLtNf_EP.js";import"./AlertCircle-YdvcZKe8.js";import"./CheckCircle-BQ3_L_yP.js";import"./Trash01-DqDMVyTa.js";import"./index-BBoaHd8c.js";import"./settings-section-R1g2TNeE.js";import"./card-DfJe5L79.js";import"./ArrowUpRight-B1ajIZNC.js";import"./switch-BH6A3p0g.js";import"./toggle-group-WOk-6cmR.js";import"./avatar-97M2j8Mc.js";import"./User01-C7C_-f57.js";import"./alert-dialog-ChbEbjde.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./unwrap-tool-result-BYXdCQMg.js";function V(){const o=t.c(1);let r;return o[0]===Symbol.for("react.memo_cache_sentinel")?(r=i.jsx(m,{}),o[0]=r):r=o[0],r}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{e as n,j as r,r as d,g as h,O as f,l as u}from"./index-CzhKzgtD.js";import{S as j,a as b,b as S}from"./index-BBoaHd8c.js";import{u as _}from"./tooltip-DSuAs--v.js";import{u as k,T as y,a as T,b as i,S as g}from"./index-DI9Yp0oo.js";import{C as v}from"./chat-context-Cmy5JYgW.js";import"./X-8IHaEYtM.js";import"./agent-icon-BBG09Kki.js";import"./AlertCircle-YdvcZKe8.js";import"./Tool01-DXbOwd1n.js";import"./XClose-D8EpU_uy.js";import"./RefreshCcw01-BBhbyLOk.js";import"./ArrowNarrowLeft-spQjUruy.js";import"./XCircle-kdEx_GGF.js";import"./ArrowUpRight-B1ajIZNC.js";import"./ZapSquare-Biix1-55.js";import"./Users03-DGRxeg5O.js";import"./CheckCircle-BQ3_L_yP.js";import"./Check-D7cmovlU.js";import"./ChevronDown-BfDxcbjR.js";import"./ChevronRight-BoDMW1uU.js";import"./ChevronUp-CRQBEG-R.js";import"./DotsVertical-BxlMGXPv.js";import"./Container-B6Z-4M-T.js";import"./Star01-UQZ7hTDj.js";import"./Palette-96pDg1d-.js";import"./SearchMd-cj9P259i.js";import"./LinkExternal01-Dmf65eFo.js";import"./Lock01-CHWOYjbh.js";import"./Sun-Cr3NKiIh.js";import"./Play-ChzLrbkr.js";import"./Plus-Cd4I0_d-.js";import"./Settings02-Cx39xFqG.js";import"./Shield01-DDhNoo0b.js";import"./Trash01-DqDMVyTa.js";import"./User01-C7C_-f57.js";import"./Zap-DdUb_mPC.js";import"./shell-layout-I_eJIv1K.js";import"./dialog-B9n71g4e.js";import"./required-auth-layout-sXjdshcq.js";import"./use-tasks-CFKcirif.js";import"./use-collections-DFXlD5a6.js";import"./constants-B9wErdMg.js";import"./use-organization-settings-BcP9GxNe.js";import"./use-org-sso-ntNZ64id.js";import"./pair-D1mFwARy.js";import"./index-DTr35K1t.js";import"./use-copy-C4DghPLz.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./content-blocks-o63cs2vh.js";import"./types-bCWMch03.js";import"./integration-icon-CSgHR76X.js";import"./use-virtual-mcp-D6IJdvj4.js";import"./skeleton-DLLoz0n0.js";import"./popover-DJiufSUD.js";import"./drawer-Dy5NJxEk.js";import"./avatar-97M2j8Mc.js";import"./alert-dialog-ChbEbjde.js";import"./form-DABXYYeF.js";import"./label-9fjD1g94.js";import"./input-CNEsKnKX.js";import"./index-C77ixooi.js";import"./use-mcp-tools-CZiN_apo.js";import"./use-ai-providers-B7R2KmGt.js";import"./index-DtIEOBO6.js";import"./switch-BH6A3p0g.js";import"./use-connection-mkdAsO3d.js";import"./lean-canvas-recruit-modal-CEK7JzdS.js";import"./use-navigate-to-agent-BJZA0vn3.js";import"./collection-search-CzQYdsP4.js";import"./checkbox-C1M4-v1p.js";import"./extract-connection-data-BmWiFxHJ.js";import"./constants-XC36TPvL.js";import"./collections-CTGZthcG.js";import"./tabs-DIK24gms.js";import"./dropdown-menu-bofOMeLm.js";import"./select-WtZOfOpo.js";import"./toggle-group-WOk-6cmR.js";import"./select-model-Cy_Vxqx-.js";import"./ai-providers-logos-DD3qZ33J.js";import"./use-debounced-autosave-CLtNf_EP.js";import"./settings-section-R1g2TNeE.js";import"./card-DfJe5L79.js";import"./formatDistanceToNow-Cb2QZZJn.js";import"./unwrap-tool-result-BYXdCQMg.js";import"./index-B40-ao-L.js";import"./question-004-sINsf4GQ.js";import"./connection-slug-eyAPH6o3.js";import"./connection-card-DQlGg9mJ.js";import"./use-registry-connections-C3Shxtge.js";import"./useInfiniteQuery-nrn6q72G.js";import"./infiniteQueryObserver-d4mpZ_Ot.js";import"./collection-tabs-ComzcUW9.js";import"./badge-CGsQT5nT.js";import"./textarea-DVl7iYt4.js";import"./connection-form-helpers-DiGKAKlz.js";import"./use-infinite-scroll-DyWtuvVN.js";import"./useSuspenseInfiniteQuery-BQugVIVu.js";import"./collection-search-DT89ZZmI.js";import"./use-create-virtual-mcp-ksck6WCZ.js";import"./empty-state-Bl1VCnIe.js";import"./use-decopilot-events-BqnGpCsr.js";import"./create-sse-subscription-CxkOgzKf.js";import"./task-status-Bjp5sDvq.js";const N=280;function P(){const t=n.c(2),{tasksOpen:e}=k();if(!e)return null;let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={width:`${N}px`},t[0]=o):o=t[0];let m;return t[1]===Symbol.for("react.memo_cache_sentinel")?(m=r.jsx("aside",{className:"shrink-0 h-full bg-sidebar pb-1",style:o,children:r.jsx("div",{className:"h-full p-0.5 pt-0.25",children:r.jsx("div",{className:"h-full bg-background rounded-[0.75rem] overflow-hidden card-shadow",children:r.jsx(y,{})})})}),t[1]=m):m=t[1],m}function C(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx(d.Suspense,{fallback:null,children:r.jsx(P,{})}),t[0]=e):e=t[0],e}function x(){const t=n.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=r.jsx("div",{className:"flex-1 flex items-center justify-center",children:r.jsx(u,{size:20,className:"animate-spin text-muted-foreground"})}),t[0]=e):e=t[0],e}function gr(){const t=n.c(7),e=_();let o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={strict:!1},t[0]=o):o=t[0];const c=!!h(o).taskId;let s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s={"--sidebar-width-icon":"3.5rem"},t[1]=s):s=t[1];let l;t[2]===Symbol.for("react.memo_cache_sentinel")?(l=r.jsx(g,{}),t[2]=l):l=t[2];let p;t[3]===Symbol.for("react.memo_cache_sentinel")?(p={background:"transparent",containerType:"inline-size"},t[3]=p):p=t[3];let a;return t[4]!==c||t[5]!==e?(a=r.jsx(j,{defaultOpen:!1,children:r.jsx("div",{className:"flex flex-col h-dvh overflow-hidden",children:r.jsxs(b,{className:"flex-1 bg-sidebar",style:s,children:[l,r.jsx(S,{className:"flex flex-col",style:p,children:r.jsx(v,{children:r.jsx(T,{children:e?r.jsx(d.Suspense,{fallback:r.jsx(x,{}),children:r.jsx(f,{})}):r.jsxs(i,{children:[r.jsxs(i.Header,{children:[r.jsxs(i.LeftColumn,{children:[r.jsx(i.Nav,{}),r.jsx(i.TogglesSlot,{})]}),r.jsx(i.CenterSlot,{}),r.jsxs(i.RightColumn,{children:[r.jsx(i.TabsSlot,{}),r.jsx(i.RightSlot,{})]})]}),r.jsxs("div",{className:"flex-1 min-h-0 flex flex-row",children:[c&&r.jsx(C,{}),r.jsx(d.Suspense,{fallback:r.jsx(x,{}),children:r.jsx(f,{})})]})]})})})})]})})}),t[4]=c,t[5]=e,t[6]=a):a=t[6],a}export{gr as default};
|