@anvia/core 1.1.1 → 1.2.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/README.md +226 -0
- package/dist/agent/agent-stream.js +7 -0
- package/dist/agent/agent-stream.js.map +1 -0
- package/dist/agent/agent-tool.js +24 -0
- package/dist/agent/agent-tool.js.map +1 -0
- package/dist/agent/agent.js +89 -0
- package/dist/agent/agent.js.map +1 -0
- package/dist/agent/errors.js +17 -0
- package/dist/agent/errors.js.map +1 -0
- package/dist/agent/ids.js +7 -0
- package/dist/agent/ids.js.map +1 -0
- package/dist/agent/index.d.ts +127 -9
- package/dist/agent/index.js +103 -21
- package/dist/agent/interactions/index.js +2 -2
- package/dist/agent/interactions.js +22 -0
- package/dist/agent/interactions.js.map +1 -0
- package/dist/agent/lifecycle.js +9 -0
- package/dist/agent/lifecycle.js.map +1 -0
- package/dist/agent/output-schema.js +10 -0
- package/dist/agent/output-schema.js.map +1 -0
- package/dist/agent/resolve-options.js +46 -0
- package/dist/agent/resolve-options.js.map +1 -0
- package/dist/agent/resolved-agent.js +92 -0
- package/dist/agent/resolved-agent.js.map +1 -0
- package/dist/agent/run-types.js +1 -0
- package/dist/agent/run-types.js.map +1 -0
- package/dist/agent/snapshot.js +17 -0
- package/dist/agent/snapshot.js.map +1 -0
- package/dist/agent/team/agent-team.js +98 -0
- package/dist/agent/team/agent-team.js.map +1 -0
- package/dist/agent/team/errors.js +9 -0
- package/dist/agent/team/errors.js.map +1 -0
- package/dist/agent/team/index.js +104 -0
- package/dist/agent/team/index.js.map +1 -0
- package/dist/agent/team/types.js +1 -0
- package/dist/agent/team/types.js.map +1 -0
- package/dist/agent/tool-catalog.js +37 -0
- package/dist/agent/tool-catalog.js.map +1 -0
- package/dist/agent/tool-state.js +11 -0
- package/dist/agent/tool-state.js.map +1 -0
- package/dist/agent/types.js +1 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/agent/vector-context.js +10 -0
- package/dist/agent/vector-context.js.map +1 -0
- package/dist/{agent-DTmzs1Qr.d.ts → agent-C9VhENdj.d.ts} +2 -3
- package/dist/{chunk-2QZJTG2E.js → chunk-23GEYG2X.js} +11 -71
- package/dist/chunk-23GEYG2X.js.map +1 -0
- package/dist/{chunk-I3Q7XSBB.js → chunk-23LRXKQX.js} +6 -4
- package/dist/{chunk-I3Q7XSBB.js.map → chunk-23LRXKQX.js.map} +1 -1
- package/dist/{chunk-YK4WAAS4.js → chunk-2NLINXRF.js} +1 -1
- package/dist/{chunk-SPD4XVR7.js → chunk-2XSMGVBG.js} +1 -1
- package/dist/chunk-3J2CSVPR.js +1 -0
- package/dist/chunk-3J2CSVPR.js.map +1 -0
- package/dist/chunk-3P3YVJ7V.js +1 -0
- package/dist/chunk-3P3YVJ7V.js.map +1 -0
- package/dist/chunk-3TAQXJBC.js +107 -0
- package/dist/chunk-3TAQXJBC.js.map +1 -0
- package/dist/chunk-47NTHIVB.js +76 -0
- package/dist/chunk-47NTHIVB.js.map +1 -0
- package/dist/chunk-4AW2633B.js +9 -0
- package/dist/chunk-4AW2633B.js.map +1 -0
- package/dist/{chunk-3XQGVDU5.js → chunk-4C7AXYOM.js} +1 -1
- package/dist/{chunk-IZNOP6JG.js → chunk-4FIVU53H.js} +1 -1
- package/dist/chunk-4ITAV7YA.js +1 -0
- package/dist/chunk-4ITAV7YA.js.map +1 -0
- package/dist/{chunk-7JLAIN6E.js → chunk-4ONUNWGC.js} +2 -2
- package/dist/chunk-4UUIGAIX.js +1 -0
- package/dist/chunk-4UUIGAIX.js.map +1 -0
- package/dist/chunk-53TPAXYR.js +1 -0
- package/dist/chunk-53TPAXYR.js.map +1 -0
- package/dist/chunk-5AETKC4L.js +107 -0
- package/dist/chunk-5AETKC4L.js.map +1 -0
- package/dist/chunk-5I2NVRHC.js +146 -0
- package/dist/chunk-5I2NVRHC.js.map +1 -0
- package/dist/chunk-5IURMWFN.js +53 -0
- package/dist/chunk-5IURMWFN.js.map +1 -0
- package/dist/chunk-5M6GTA3T.js +1 -0
- package/dist/chunk-5M6GTA3T.js.map +1 -0
- package/dist/chunk-5N5W7CX7.js +18 -0
- package/dist/chunk-5N5W7CX7.js.map +1 -0
- package/dist/chunk-5P2YOQSA.js +355 -0
- package/dist/chunk-5P2YOQSA.js.map +1 -0
- package/dist/chunk-5S7T2URX.js +1 -0
- package/dist/chunk-5S7T2URX.js.map +1 -0
- package/dist/chunk-5V533R7F.js +19 -0
- package/dist/chunk-5V533R7F.js.map +1 -0
- package/dist/chunk-5WLIHNNJ.js +56 -0
- package/dist/chunk-5WLIHNNJ.js.map +1 -0
- package/dist/chunk-6BTJC3ES.js +37 -0
- package/dist/chunk-6BTJC3ES.js.map +1 -0
- package/dist/chunk-6N4ENZO4.js +24 -0
- package/dist/chunk-6N4ENZO4.js.map +1 -0
- package/dist/{chunk-4UQALF5Y.js → chunk-6RQYWZI3.js} +2 -36
- package/dist/chunk-6RQYWZI3.js.map +1 -0
- package/dist/chunk-6TAWRKFK.js +86 -0
- package/dist/chunk-6TAWRKFK.js.map +1 -0
- package/dist/chunk-7F53DOML.js +53 -0
- package/dist/chunk-7F53DOML.js.map +1 -0
- package/dist/chunk-7KAGWJ5M.js +112 -0
- package/dist/chunk-7KAGWJ5M.js.map +1 -0
- package/dist/chunk-7LBPRXZP.js +1 -0
- package/dist/chunk-7LBPRXZP.js.map +1 -0
- package/dist/chunk-A7BXVZXZ.js +25 -0
- package/dist/chunk-A7BXVZXZ.js.map +1 -0
- package/dist/chunk-B47EXUHL.js +67 -0
- package/dist/chunk-B47EXUHL.js.map +1 -0
- package/dist/chunk-B5JQDR33.js +14 -0
- package/dist/chunk-B5JQDR33.js.map +1 -0
- package/dist/chunk-B5YTCKUJ.js +158 -0
- package/dist/chunk-B5YTCKUJ.js.map +1 -0
- package/dist/chunk-BDDC72GF.js +189 -0
- package/dist/chunk-BDDC72GF.js.map +1 -0
- package/dist/chunk-BDKFFFVX.js +342 -0
- package/dist/chunk-BDKFFFVX.js.map +1 -0
- package/dist/{chunk-QGX73TSQ.js → chunk-BONQTXRQ.js} +3 -12
- package/dist/chunk-BONQTXRQ.js.map +1 -0
- package/dist/chunk-BUPC72Y2.js +1007 -0
- package/dist/chunk-BUPC72Y2.js.map +1 -0
- package/dist/chunk-CKKNO4XB.js +70 -0
- package/dist/chunk-CKKNO4XB.js.map +1 -0
- package/dist/chunk-CX7ZVTO5.js +22 -0
- package/dist/chunk-CX7ZVTO5.js.map +1 -0
- package/dist/chunk-DU4WA6LQ.js +1 -0
- package/dist/chunk-DU4WA6LQ.js.map +1 -0
- package/dist/chunk-EJR6VVB3.js +63 -0
- package/dist/chunk-EJR6VVB3.js.map +1 -0
- package/dist/chunk-EKZRAWBP.js +110 -0
- package/dist/chunk-EKZRAWBP.js.map +1 -0
- package/dist/chunk-ENZ2XX27.js +26 -0
- package/dist/chunk-ENZ2XX27.js.map +1 -0
- package/dist/chunk-EOAJBBII.js +1 -0
- package/dist/chunk-EOAJBBII.js.map +1 -0
- package/dist/chunk-ERN7P6Q4.js +1 -0
- package/dist/chunk-ERN7P6Q4.js.map +1 -0
- package/dist/chunk-ESOFEAYK.js +57 -0
- package/dist/chunk-ESOFEAYK.js.map +1 -0
- package/dist/chunk-ETYB5JO6.js +175 -0
- package/dist/chunk-ETYB5JO6.js.map +1 -0
- package/dist/chunk-EZR5AV3J.js +74 -0
- package/dist/chunk-EZR5AV3J.js.map +1 -0
- package/dist/chunk-F2OKLHGB.js +9 -0
- package/dist/chunk-F2OKLHGB.js.map +1 -0
- package/dist/chunk-F3E2RLC7.js +342 -0
- package/dist/chunk-F3E2RLC7.js.map +1 -0
- package/dist/chunk-FAPIZJS2.js +54 -0
- package/dist/chunk-FAPIZJS2.js.map +1 -0
- package/dist/chunk-GDJNOZ47.js +1 -0
- package/dist/chunk-GDJNOZ47.js.map +1 -0
- package/dist/chunk-GDY2Z2SZ.js +83 -0
- package/dist/chunk-GDY2Z2SZ.js.map +1 -0
- package/dist/chunk-GLMYZ6OA.js +20 -0
- package/dist/chunk-GLMYZ6OA.js.map +1 -0
- package/dist/{chunk-XEVOC433.js → chunk-GPVXCY5I.js} +2 -73
- package/dist/chunk-GPVXCY5I.js.map +1 -0
- package/dist/{chunk-KSKST3KP.js → chunk-H3H74RWJ.js} +1 -1
- package/dist/chunk-HAAGSIZH.js +89 -0
- package/dist/chunk-HAAGSIZH.js.map +1 -0
- package/dist/{chunk-K5L7R7XM.js → chunk-HHMLE3TZ.js} +6 -54
- package/dist/chunk-HHMLE3TZ.js.map +1 -0
- package/dist/{chunk-JLJMVRRE.js → chunk-HP34GRQX.js} +10 -83
- package/dist/chunk-HP34GRQX.js.map +1 -0
- package/dist/chunk-HTI343NP.js +1 -0
- package/dist/chunk-HTI343NP.js.map +1 -0
- package/dist/{chunk-T2C3CGDQ.js → chunk-HTI7DZJM.js} +6 -4
- package/dist/{chunk-T2C3CGDQ.js.map → chunk-HTI7DZJM.js.map} +1 -1
- package/dist/chunk-IDNL6IH4.js +294 -0
- package/dist/chunk-IDNL6IH4.js.map +1 -0
- package/dist/chunk-IV6YQTY2.js +47 -0
- package/dist/chunk-IV6YQTY2.js.map +1 -0
- package/dist/chunk-J4SINPUA.js +939 -0
- package/dist/chunk-J4SINPUA.js.map +1 -0
- package/dist/chunk-J6S6MT7O.js +32 -0
- package/dist/chunk-J6S6MT7O.js.map +1 -0
- package/dist/chunk-JB3RFK6K.js +168 -0
- package/dist/chunk-JB3RFK6K.js.map +1 -0
- package/dist/chunk-JBQNCUXA.js +34 -0
- package/dist/chunk-JBQNCUXA.js.map +1 -0
- package/dist/chunk-JMJFK3A4.js +1 -0
- package/dist/chunk-JMJFK3A4.js.map +1 -0
- package/dist/chunk-JMMZICU7.js +74 -0
- package/dist/chunk-JMMZICU7.js.map +1 -0
- package/dist/chunk-JOQ2T3QP.js +663 -0
- package/dist/chunk-JOQ2T3QP.js.map +1 -0
- package/dist/chunk-K4IBS7VB.js +55 -0
- package/dist/chunk-K4IBS7VB.js.map +1 -0
- package/dist/chunk-KBBQSP4M.js +16 -0
- package/dist/chunk-KBBQSP4M.js.map +1 -0
- package/dist/chunk-KFAVEL5F.js +68 -0
- package/dist/chunk-KFAVEL5F.js.map +1 -0
- package/dist/chunk-KITX3HDN.js +17 -0
- package/dist/chunk-KITX3HDN.js.map +1 -0
- package/dist/chunk-KO5NMTAM.js +1 -0
- package/dist/chunk-KO5NMTAM.js.map +1 -0
- package/dist/chunk-KY4VXIN2.js +118 -0
- package/dist/chunk-KY4VXIN2.js.map +1 -0
- package/dist/chunk-KZGSXJKU.js +29 -0
- package/dist/chunk-KZGSXJKU.js.map +1 -0
- package/dist/chunk-LAIATEUB.js +24 -0
- package/dist/chunk-LAIATEUB.js.map +1 -0
- package/dist/{chunk-OJBFDBLG.js → chunk-LBYJPMHC.js} +2 -2
- package/dist/chunk-LKIABZNR.js +49 -0
- package/dist/chunk-LKIABZNR.js.map +1 -0
- package/dist/chunk-LQJ4KHMY.js +23 -0
- package/dist/chunk-LQJ4KHMY.js.map +1 -0
- package/dist/chunk-MEN4AFDZ.js +1 -0
- package/dist/chunk-MEN4AFDZ.js.map +1 -0
- package/dist/chunk-MHOJJYDK.js +93 -0
- package/dist/chunk-MHOJJYDK.js.map +1 -0
- package/dist/chunk-MJCMKZFP.js +30 -0
- package/dist/chunk-MJCMKZFP.js.map +1 -0
- package/dist/chunk-MT3BLVYN.js +31 -0
- package/dist/chunk-MT3BLVYN.js.map +1 -0
- package/dist/chunk-NF6WBPFG.js +37 -0
- package/dist/chunk-NF6WBPFG.js.map +1 -0
- package/dist/chunk-NNEKBZSM.js +66 -0
- package/dist/chunk-NNEKBZSM.js.map +1 -0
- package/dist/chunk-NPJ2T3L5.js +19 -0
- package/dist/chunk-NPJ2T3L5.js.map +1 -0
- package/dist/chunk-NVALGVQG.js +150 -0
- package/dist/chunk-NVALGVQG.js.map +1 -0
- package/dist/chunk-OJF67RNM.js +1 -0
- package/dist/chunk-OJF67RNM.js.map +1 -0
- package/dist/chunk-PHLGGRHC.js +89 -0
- package/dist/chunk-PHLGGRHC.js.map +1 -0
- package/dist/chunk-PIMD4DYG.js +104 -0
- package/dist/chunk-PIMD4DYG.js.map +1 -0
- package/dist/chunk-PJNE75WC.js +1 -0
- package/dist/chunk-PJNE75WC.js.map +1 -0
- package/dist/{chunk-J6LVLV6P.js → chunk-PLDJCCVL.js} +1 -1
- package/dist/{chunk-3RWESPUG.js → chunk-POXHJF3H.js} +6 -51
- package/dist/chunk-POXHJF3H.js.map +1 -0
- package/dist/chunk-PPJ7SYQL.js +81 -0
- package/dist/chunk-PPJ7SYQL.js.map +1 -0
- package/dist/chunk-PT777EQ3.js +48 -0
- package/dist/chunk-PT777EQ3.js.map +1 -0
- package/dist/chunk-PYLPLFJZ.js +318 -0
- package/dist/chunk-PYLPLFJZ.js.map +1 -0
- package/dist/chunk-QEPBHHAP.js +41 -0
- package/dist/chunk-QEPBHHAP.js.map +1 -0
- package/dist/chunk-QHGYCYV6.js +91 -0
- package/dist/chunk-QHGYCYV6.js.map +1 -0
- package/dist/chunk-R6722CIU.js +28 -0
- package/dist/chunk-R6722CIU.js.map +1 -0
- package/dist/chunk-RA4YVN43.js +1 -0
- package/dist/chunk-RA4YVN43.js.map +1 -0
- package/dist/chunk-RT5LUEO3.js +2339 -0
- package/dist/chunk-RT5LUEO3.js.map +1 -0
- package/dist/chunk-RXKUIJ77.js +236 -0
- package/dist/chunk-RXKUIJ77.js.map +1 -0
- package/dist/chunk-SC4SUIEY.js +1 -0
- package/dist/chunk-SC4SUIEY.js.map +1 -0
- package/dist/chunk-SQAAVYJG.js +12 -0
- package/dist/chunk-SQAAVYJG.js.map +1 -0
- package/dist/chunk-SXE4J43E.js +59 -0
- package/dist/chunk-SXE4J43E.js.map +1 -0
- package/dist/{chunk-EFLT7XZD.js → chunk-SYULMZGL.js} +6 -4
- package/dist/{chunk-EFLT7XZD.js.map → chunk-SYULMZGL.js.map} +1 -1
- package/dist/chunk-T4KS577P.js +58 -0
- package/dist/chunk-T4KS577P.js.map +1 -0
- package/dist/chunk-TFIOU6UR.js +78 -0
- package/dist/chunk-TFIOU6UR.js.map +1 -0
- package/dist/chunk-TIZGADU4.js +375 -0
- package/dist/chunk-TIZGADU4.js.map +1 -0
- package/dist/chunk-TP3MCUXS.js +1 -0
- package/dist/chunk-TP3MCUXS.js.map +1 -0
- package/dist/chunk-TSPQD5HW.js +613 -0
- package/dist/chunk-TSPQD5HW.js.map +1 -0
- package/dist/{chunk-JTJU56ZV.js → chunk-UOGM62JL.js} +11 -7
- package/dist/{chunk-JTJU56ZV.js.map → chunk-UOGM62JL.js.map} +1 -1
- package/dist/chunk-USRKPEQN.js +55 -0
- package/dist/chunk-USRKPEQN.js.map +1 -0
- package/dist/chunk-UTAB3XQI.js +667 -0
- package/dist/chunk-UTAB3XQI.js.map +1 -0
- package/dist/chunk-V3FFZWF3.js +182 -0
- package/dist/chunk-V3FFZWF3.js.map +1 -0
- package/dist/chunk-V4OZ7ISA.js +9 -0
- package/dist/chunk-V4OZ7ISA.js.map +1 -0
- package/dist/chunk-VZ5ZZBNX.js +139 -0
- package/dist/chunk-VZ5ZZBNX.js.map +1 -0
- package/dist/{chunk-AHLKV6KP.js → chunk-WN6AVBO4.js} +1 -1
- package/dist/chunk-WXR5CWSC.js +1 -0
- package/dist/chunk-WXR5CWSC.js.map +1 -0
- package/dist/chunk-X6WS3XWL.js +36 -0
- package/dist/chunk-X6WS3XWL.js.map +1 -0
- package/dist/{chunk-Q5BCNYED.js → chunk-XJRNBTIV.js} +7 -4
- package/dist/chunk-XQV3XNVT.js +225 -0
- package/dist/chunk-XQV3XNVT.js.map +1 -0
- package/dist/chunk-XV3DH5GC.js +58 -0
- package/dist/chunk-XV3DH5GC.js.map +1 -0
- package/dist/chunk-YWRXOPHC.js +43 -0
- package/dist/chunk-YWRXOPHC.js.map +1 -0
- package/dist/chunk-YZVFIW5D.js +27 -0
- package/dist/chunk-YZVFIW5D.js.map +1 -0
- package/dist/chunk-ZHC5CD6J.js +33 -0
- package/dist/chunk-ZHC5CD6J.js.map +1 -0
- package/dist/chunk-ZPJFXRQZ.js +23 -0
- package/dist/chunk-ZPJFXRQZ.js.map +1 -0
- package/dist/chunk-ZPXOBQDS.js +57 -0
- package/dist/chunk-ZPXOBQDS.js.map +1 -0
- package/dist/chunk-ZUFS6R7L.js +155 -0
- package/dist/chunk-ZUFS6R7L.js.map +1 -0
- package/dist/chunk-ZXLCTQUX.js +62 -0
- package/dist/chunk-ZXLCTQUX.js.map +1 -0
- package/dist/chunk-ZYXMWEL4.js +59 -0
- package/dist/chunk-ZYXMWEL4.js.map +1 -0
- package/dist/completion/controls.js +11 -0
- package/dist/completion/controls.js.map +1 -0
- package/dist/completion/documents.js +9 -0
- package/dist/completion/documents.js.map +1 -0
- package/dist/completion/generate-completion.js +23 -0
- package/dist/completion/generate-completion.js.map +1 -0
- package/dist/completion/index.js +23 -12
- package/dist/completion/json.js +7 -0
- package/dist/completion/json.js.map +1 -0
- package/dist/completion/message-schema.js +18 -0
- package/dist/completion/message-schema.js.map +1 -0
- package/dist/completion/provider-output-error.js +12 -0
- package/dist/completion/provider-output-error.js.map +1 -0
- package/dist/completion/stream-accumulator.js +10 -0
- package/dist/completion/stream-accumulator.js.map +1 -0
- package/dist/completion/types.js +28 -0
- package/dist/completion/types.js.map +1 -0
- package/dist/documents/chunk-text.js +7 -0
- package/dist/documents/chunk-text.js.map +1 -0
- package/dist/documents/index.js +5 -2
- package/dist/documents/text-document.js +8 -0
- package/dist/documents/text-document.js.map +1 -0
- package/dist/embeddings/distance.js +17 -0
- package/dist/embeddings/distance.js.map +1 -0
- package/dist/embeddings/embed.js +18 -0
- package/dist/embeddings/embed.js.map +1 -0
- package/dist/embeddings/index.js +11 -6
- package/dist/embeddings/types.js +2 -0
- package/dist/embeddings/types.js.map +1 -0
- package/dist/evals/advanced-metrics.js +46 -0
- package/dist/evals/advanced-metrics.js.map +1 -0
- package/dist/evals/agent-target.js +10 -0
- package/dist/evals/agent-target.js.map +1 -0
- package/dist/evals/cli.js +40 -0
- package/dist/evals/cli.js.map +1 -0
- package/dist/evals/execution.js +15 -0
- package/dist/evals/execution.js.map +1 -0
- package/dist/evals/format.js +13 -0
- package/dist/evals/format.js.map +1 -0
- package/dist/evals/index.d.ts +4 -4
- package/dist/evals/index.js +87 -2660
- package/dist/evals/index.js.map +1 -1
- package/dist/evals/judge.js +27 -0
- package/dist/evals/judge.js.map +1 -0
- package/dist/evals/metric.js +7 -0
- package/dist/evals/metric.js.map +1 -0
- package/dist/evals/metrics.js +53 -0
- package/dist/evals/metrics.js.map +1 -0
- package/dist/evals/outcome.js +7 -0
- package/dist/evals/outcome.js.map +1 -0
- package/dist/evals/reporting.js +11 -0
- package/dist/evals/reporting.js.map +1 -0
- package/dist/evals/runner.js +29 -0
- package/dist/evals/runner.js.map +1 -0
- package/dist/evals/selectors.js +18 -0
- package/dist/evals/selectors.js.map +1 -0
- package/dist/evals/suite.js +11 -0
- package/dist/evals/suite.js.map +1 -0
- package/dist/evals/types.js +1 -0
- package/dist/evals/types.js.map +1 -0
- package/dist/extractor/extractor.js +23 -0
- package/dist/extractor/extractor.js.map +1 -0
- package/dist/extractor/index.js +16 -7
- package/dist/guardrails/actions.js +13 -0
- package/dist/guardrails/actions.js.map +1 -0
- package/dist/guardrails/index.d.ts +3 -4
- package/dist/guardrails/index.js +15 -7
- package/dist/guardrails/message.js +9 -0
- package/dist/guardrails/message.js.map +1 -0
- package/dist/guardrails/policy.js +17 -0
- package/dist/guardrails/policy.js.map +1 -0
- package/dist/guardrails/runtime.js +11 -0
- package/dist/guardrails/runtime.js.map +1 -0
- package/dist/guardrails/text.js +9 -0
- package/dist/guardrails/text.js.map +1 -0
- package/dist/guardrails/types.js +1 -0
- package/dist/guardrails/types.js.map +1 -0
- package/dist/hooks/control.js +17 -0
- package/dist/hooks/control.js.map +1 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/types.js +2 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/image-generation/generate-image.js +11 -0
- package/dist/image-generation/generate-image.js.map +1 -0
- package/dist/image-generation/index.js +7 -4
- package/dist/image-generation/types.js +2 -0
- package/dist/image-generation/types.js.map +1 -0
- package/dist/index.d.ts +5 -7
- package/dist/index.js +163 -57
- package/dist/internal/abort.js +13 -0
- package/dist/internal/abort.js.map +1 -0
- package/dist/internal/agent-runtime/agent-run.js +81 -0
- package/dist/internal/agent-runtime/agent-run.js.map +1 -0
- package/dist/internal/agent-runtime/approval-request.js +1 -0
- package/dist/internal/agent-runtime/approval-request.js.map +1 -0
- package/dist/internal/agent-runtime/approval-requirement.js +9 -0
- package/dist/internal/agent-runtime/approval-requirement.js.map +1 -0
- package/dist/internal/agent-runtime/continuation-state.js +26 -0
- package/dist/internal/agent-runtime/continuation-state.js.map +1 -0
- package/dist/internal/agent-runtime/interaction-suspension.js +25 -0
- package/dist/internal/agent-runtime/interaction-suspension.js.map +1 -0
- package/dist/internal/agent-runtime/memory-scope.js +8 -0
- package/dist/internal/agent-runtime/memory-scope.js.map +1 -0
- package/dist/internal/agent-runtime/memory.js +24 -0
- package/dist/internal/agent-runtime/memory.js.map +1 -0
- package/dist/internal/agent-runtime/prepared-tool-call.js +19 -0
- package/dist/internal/agent-runtime/prepared-tool-call.js.map +1 -0
- package/dist/internal/agent-runtime/retrieval.js +35 -0
- package/dist/internal/agent-runtime/retrieval.js.map +1 -0
- package/dist/internal/agent-runtime/run-options.js +9 -0
- package/dist/internal/agent-runtime/run-options.js.map +1 -0
- package/dist/internal/agent-runtime/run-validation.js +9 -0
- package/dist/internal/agent-runtime/run-validation.js.map +1 -0
- package/dist/internal/agent-runtime/stream-events.js +11 -0
- package/dist/internal/agent-runtime/stream-events.js.map +1 -0
- package/dist/internal/agent-runtime/structured-output.js +13 -0
- package/dist/internal/agent-runtime/structured-output.js.map +1 -0
- package/dist/internal/agent-runtime/tool-execution.js +55 -0
- package/dist/internal/agent-runtime/tool-execution.js.map +1 -0
- package/dist/internal/agent.d.ts +5 -5
- package/dist/internal/agent.js +93 -57
- package/dist/internal/agent.js.map +1 -1
- package/dist/internal/async-queue.js +7 -0
- package/dist/internal/async-queue.js.map +1 -0
- package/dist/internal/completion-request.js +11 -0
- package/dist/internal/completion-request.js.map +1 -0
- package/dist/internal/concurrency.js +7 -0
- package/dist/internal/concurrency.js.map +1 -0
- package/dist/internal/json-object.js +8 -0
- package/dist/internal/json-object.js.map +1 -0
- package/dist/internal/rag-text.js +7 -0
- package/dist/internal/rag-text.js.map +1 -0
- package/dist/internal/record.js +7 -0
- package/dist/internal/record.js.map +1 -0
- package/dist/internal/team-runtime/coordination.js +12 -0
- package/dist/internal/team-runtime/coordination.js.map +1 -0
- package/dist/internal/team-runtime/member.js +26 -0
- package/dist/internal/team-runtime/member.js.map +1 -0
- package/dist/internal/team-runtime/policy.js +7 -0
- package/dist/internal/team-runtime/policy.js.map +1 -0
- package/dist/internal/team-runtime/run.js +95 -0
- package/dist/internal/team-runtime/run.js.map +1 -0
- package/dist/internal/team-runtime/stream.js +9 -0
- package/dist/internal/team-runtime/stream.js.map +1 -0
- package/dist/internal/team-runtime/tools.js +17 -0
- package/dist/internal/team-runtime/tools.js.map +1 -0
- package/dist/internal/type-utils.js +1 -0
- package/dist/internal/type-utils.js.map +1 -0
- package/dist/internal/vector-search-options.js +9 -0
- package/dist/internal/vector-search-options.js.map +1 -0
- package/dist/mcp/index.js +3 -1
- package/dist/mcp/tool.js +7 -0
- package/dist/mcp/tool.js.map +1 -0
- package/dist/mcp/types.js +2 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/memory/assert.js +11 -0
- package/dist/memory/assert.js.map +1 -0
- package/dist/memory/compaction.js +26 -0
- package/dist/memory/compaction.js.map +1 -0
- package/dist/memory/errors.js +9 -0
- package/dist/memory/errors.js.map +1 -0
- package/dist/memory/index.js +23 -10
- package/dist/memory/options.js +10 -0
- package/dist/memory/options.js.map +1 -0
- package/dist/memory/scope-key.js +7 -0
- package/dist/memory/scope-key.js.map +1 -0
- package/dist/memory/types.js +2 -0
- package/dist/memory/types.js.map +1 -0
- package/dist/{types-CRda8x7p.d.ts → middleware-CWjnMbiH.d.ts} +64 -5
- package/dist/model-call-options.js +1 -0
- package/dist/model-call-options.js.map +1 -0
- package/dist/model-listing/errors.js +7 -0
- package/dist/model-listing/errors.js.map +1 -0
- package/dist/model-listing/index.js +4 -13
- package/dist/model-listing/index.js.map +1 -1
- package/dist/model-listing/types.js +2 -0
- package/dist/model-listing/types.js.map +1 -0
- package/dist/observability/group.js +30 -0
- package/dist/observability/group.js.map +1 -0
- package/dist/observability/index.d.ts +4 -6
- package/dist/observability/index.js +16 -8
- package/dist/observability/snapshot.js +7 -0
- package/dist/observability/snapshot.js.map +1 -0
- package/dist/observability/types.js +1 -0
- package/dist/observability/types.js.map +1 -0
- package/dist/pipeline/errors.js +9 -0
- package/dist/pipeline/errors.js.map +1 -0
- package/dist/pipeline/graph.js +21 -0
- package/dist/pipeline/graph.js.map +1 -0
- package/dist/pipeline/index.d.ts +4 -6
- package/dist/pipeline/index.js +27 -805
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/observability.js +15 -0
- package/dist/pipeline/observability.js.map +1 -0
- package/dist/pipeline/pipeline.js +30 -0
- package/dist/pipeline/pipeline.js.map +1 -0
- package/dist/pipeline/runtime.js +17 -0
- package/dist/pipeline/runtime.js.map +1 -0
- package/dist/pipeline/types.js +1 -0
- package/dist/pipeline/types.js.map +1 -0
- package/dist/retry.js +20 -0
- package/dist/retry.js.map +1 -0
- package/dist/schema/index.js +1 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/zod-schema.js +7 -0
- package/dist/schema/zod-schema.js.map +1 -0
- package/dist/skills/index.js +41 -12
- package/dist/skills/instructions.js +7 -0
- package/dist/skills/instructions.js.map +1 -0
- package/dist/skills/load.js +39 -0
- package/dist/skills/load.js.map +1 -0
- package/dist/skills/local.js +9 -0
- package/dist/skills/local.js.map +1 -0
- package/dist/skills/tools.js +37 -0
- package/dist/skills/tools.js.map +1 -0
- package/dist/skills/types.js +7 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/speech-generation/generate-speech.js +11 -0
- package/dist/speech-generation/generate-speech.js.map +1 -0
- package/dist/speech-generation/index.js +7 -4
- package/dist/speech-generation/types.js +2 -0
- package/dist/speech-generation/types.js.map +1 -0
- package/dist/streaming/index.js +3 -37
- package/dist/streaming/index.js.map +1 -1
- package/dist/streaming/readable-stream.js +7 -0
- package/dist/streaming/readable-stream.js.map +1 -0
- package/dist/{text-CmjXxakS.d.ts → text-GbW4WYMg.d.ts} +1 -1
- package/dist/tool/create-tool.js +14 -0
- package/dist/tool/create-tool.js.map +1 -0
- package/dist/tool/dynamic-tools.js +35 -0
- package/dist/tool/dynamic-tools.js.map +1 -0
- package/dist/tool/errors.js +11 -0
- package/dist/tool/errors.js.map +1 -0
- package/dist/tool/index.d.ts +3 -2
- package/dist/tool/index.js +41 -15
- package/dist/tool/middleware.js +7 -0
- package/dist/tool/middleware.js.map +1 -0
- package/dist/tool/question-tool.js +17 -0
- package/dist/tool/question-tool.js.map +1 -0
- package/dist/tool/skill-tool-marker.js +9 -0
- package/dist/tool/skill-tool-marker.js.map +1 -0
- package/dist/tool/think-tool.js +15 -0
- package/dist/tool/think-tool.js.map +1 -0
- package/dist/tool/tool.js +17 -0
- package/dist/tool/tool.js.map +1 -0
- package/dist/transcription/index.js +7 -4
- package/dist/transcription/transcribe.js +11 -0
- package/dist/transcription/transcribe.js.map +1 -0
- package/dist/transcription/types.js +2 -0
- package/dist/transcription/types.js.map +1 -0
- package/dist/{types-h0EL6Xn0.d.ts → types-Bqw0AuFl.d.ts} +6 -2
- package/dist/vector-store/filter.js +9 -0
- package/dist/vector-store/filter.js.map +1 -0
- package/dist/vector-store/index.js +31 -11
- package/dist/vector-store/ingest.js +19 -0
- package/dist/vector-store/ingest.js.map +1 -0
- package/dist/vector-store/lsh.js +7 -0
- package/dist/vector-store/lsh.js.map +1 -0
- package/dist/vector-store/retrieve.js +15 -0
- package/dist/vector-store/retrieve.js.map +1 -0
- package/dist/vector-store/types.js +1 -0
- package/dist/vector-store/types.js.map +1 -0
- package/package.json +8 -5
- package/dist/chunk-2QZJTG2E.js.map +0 -1
- package/dist/chunk-3RWESPUG.js.map +0 -1
- package/dist/chunk-4UQALF5Y.js.map +0 -1
- package/dist/chunk-AZB6N7P4.js +0 -320
- package/dist/chunk-AZB6N7P4.js.map +0 -1
- package/dist/chunk-JLJMVRRE.js.map +0 -1
- package/dist/chunk-K5L7R7XM.js.map +0 -1
- package/dist/chunk-OI3LSMJG.js +0 -1545
- package/dist/chunk-OI3LSMJG.js.map +0 -1
- package/dist/chunk-QGX73TSQ.js.map +0 -1
- package/dist/chunk-XC3LVC4K.js +0 -753
- package/dist/chunk-XC3LVC4K.js.map +0 -1
- package/dist/chunk-XEVOC433.js.map +0 -1
- package/dist/chunk-XSV5C4R5.js +0 -400
- package/dist/chunk-XSV5C4R5.js.map +0 -1
- package/dist/chunk-XU54PLSD.js +0 -4786
- package/dist/chunk-XU54PLSD.js.map +0 -1
- package/dist/middleware-mY_lpjDp.d.ts +0 -59
- package/dist/type-utils-CtHVDRn_.d.ts +0 -6
- /package/dist/{chunk-YK4WAAS4.js.map → chunk-2NLINXRF.js.map} +0 -0
- /package/dist/{chunk-SPD4XVR7.js.map → chunk-2XSMGVBG.js.map} +0 -0
- /package/dist/{chunk-3XQGVDU5.js.map → chunk-4C7AXYOM.js.map} +0 -0
- /package/dist/{chunk-IZNOP6JG.js.map → chunk-4FIVU53H.js.map} +0 -0
- /package/dist/{chunk-7JLAIN6E.js.map → chunk-4ONUNWGC.js.map} +0 -0
- /package/dist/{chunk-KSKST3KP.js.map → chunk-H3H74RWJ.js.map} +0 -0
- /package/dist/{chunk-OJBFDBLG.js.map → chunk-LBYJPMHC.js.map} +0 -0
- /package/dist/{chunk-J6LVLV6P.js.map → chunk-PLDJCCVL.js.map} +0 -0
- /package/dist/{chunk-AHLKV6KP.js.map → chunk-WN6AVBO4.js.map} +0 -0
- /package/dist/{chunk-Q5BCNYED.js.map → chunk-XJRNBTIV.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=chunk-SC4SUIEY.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/schema/zod-schema.ts
|
|
2
|
+
import { toJSONSchema } from "zod";
|
|
3
|
+
function toProviderJsonSchema(schema, options = {}) {
|
|
4
|
+
const jsonSchema = toJSONSchema(schema, options);
|
|
5
|
+
const { $schema: _schema, ...providerSchema } = jsonSchema;
|
|
6
|
+
return providerSchema;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
toProviderJsonSchema
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=chunk-SQAAVYJG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schema/zod-schema.ts"],"sourcesContent":["import { toJSONSchema, type z } from \"zod\";\nimport type { JsonObject } from \"../completion/index\";\n\nexport type ZodSchema<T = unknown> = z.ZodType<T>;\n\nexport function toProviderJsonSchema(\n schema: z.ZodType,\n options: { io?: \"input\" | \"output\" } = {},\n): JsonObject {\n const jsonSchema = toJSONSchema(schema, options) as JsonObject;\n const { $schema: _schema, ...providerSchema } = jsonSchema;\n return providerSchema;\n}\n"],"mappings":";AAAA,SAAS,oBAA4B;AAK9B,SAAS,qBACd,QACA,UAAuC,CAAC,GAC5B;AACZ,QAAM,aAAa,aAAa,QAAQ,OAAO;AAC/C,QAAM,EAAE,SAAS,SAAS,GAAG,eAAe,IAAI;AAChD,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// src/internal/agent-runtime/structured-output.ts
|
|
2
|
+
var JSON_FENCE_START = "```json\n";
|
|
3
|
+
var JSON_FENCE_CRLF_START = "```json\r\n";
|
|
4
|
+
var UNLABELED_FENCE_START = "```\n";
|
|
5
|
+
var UNLABELED_FENCE_CRLF_START = "```\r\n";
|
|
6
|
+
var FENCE_END = "\n```";
|
|
7
|
+
var STRUCTURED_OUTPUT_RETRY_PROMPT = "Your previous response was invalid structured output. Return only raw JSON that matches the supplied JSON schema. Do not use Markdown fences or include commentary.";
|
|
8
|
+
var STRUCTURED_OUTPUT_TRUNCATED_RETRY_PROMPT = "Your previous response exceeded the provider output limit. Return substantially shorter raw JSON that matches the supplied JSON schema. Do not use Markdown fences or include commentary.";
|
|
9
|
+
var STRUCTURED_OUTPUT_REPAIR_PREVIEW_MAX_LENGTH = 8192;
|
|
10
|
+
var STRUCTURED_OUTPUT_REPAIR_PREVIEW_MARKER = "\n...[output omitted]...\n";
|
|
11
|
+
function structuredOutputRepairPreview(text) {
|
|
12
|
+
if (text.length <= STRUCTURED_OUTPUT_REPAIR_PREVIEW_MAX_LENGTH) {
|
|
13
|
+
return { text, includedOutputLength: text.length };
|
|
14
|
+
}
|
|
15
|
+
const availableLength = STRUCTURED_OUTPUT_REPAIR_PREVIEW_MAX_LENGTH - STRUCTURED_OUTPUT_REPAIR_PREVIEW_MARKER.length;
|
|
16
|
+
const headLength = Math.ceil(availableLength / 2);
|
|
17
|
+
const tailLength = availableLength - headLength;
|
|
18
|
+
return {
|
|
19
|
+
text: `${text.slice(0, headLength)}${STRUCTURED_OUTPUT_REPAIR_PREVIEW_MARKER}${text.slice(-tailLength)}`,
|
|
20
|
+
includedOutputLength: headLength + tailLength
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function normalizeStructuredOutput(text) {
|
|
24
|
+
const trimmed = text.trim();
|
|
25
|
+
const opening = fenceOpening(trimmed);
|
|
26
|
+
if (opening === void 0 || !trimmed.endsWith(FENCE_END)) {
|
|
27
|
+
return { text: trimmed, format: "raw" };
|
|
28
|
+
}
|
|
29
|
+
const closingStart = trimmed.length - 3;
|
|
30
|
+
const precedingNewline = closingStart - 1;
|
|
31
|
+
const contentEnd = trimmed[precedingNewline - 1] === "\r" ? precedingNewline - 1 : precedingNewline;
|
|
32
|
+
return {
|
|
33
|
+
text: trimmed.slice(opening.length, contentEnd).trim(),
|
|
34
|
+
format: opening.format
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function fenceOpening(text) {
|
|
38
|
+
if (text.startsWith(JSON_FENCE_START)) {
|
|
39
|
+
return { length: JSON_FENCE_START.length, format: "json-fence" };
|
|
40
|
+
}
|
|
41
|
+
if (text.startsWith(JSON_FENCE_CRLF_START)) {
|
|
42
|
+
return { length: JSON_FENCE_CRLF_START.length, format: "json-fence" };
|
|
43
|
+
}
|
|
44
|
+
if (text.startsWith(UNLABELED_FENCE_START)) {
|
|
45
|
+
return { length: UNLABELED_FENCE_START.length, format: "unlabeled-fence" };
|
|
46
|
+
}
|
|
47
|
+
if (text.startsWith(UNLABELED_FENCE_CRLF_START)) {
|
|
48
|
+
return { length: UNLABELED_FENCE_CRLF_START.length, format: "unlabeled-fence" };
|
|
49
|
+
}
|
|
50
|
+
return void 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
STRUCTURED_OUTPUT_RETRY_PROMPT,
|
|
55
|
+
STRUCTURED_OUTPUT_TRUNCATED_RETRY_PROMPT,
|
|
56
|
+
structuredOutputRepairPreview,
|
|
57
|
+
normalizeStructuredOutput
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=chunk-SXE4J43E.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/agent-runtime/structured-output.ts"],"sourcesContent":["import type { AgentStructuredOutputFormat } from \"../../agent/errors\";\n\nconst JSON_FENCE_START = \"```json\\n\";\nconst JSON_FENCE_CRLF_START = \"```json\\r\\n\";\nconst UNLABELED_FENCE_START = \"```\\n\";\nconst UNLABELED_FENCE_CRLF_START = \"```\\r\\n\";\nconst FENCE_END = \"\\n```\";\n\nexport const STRUCTURED_OUTPUT_RETRY_PROMPT =\n \"Your previous response was invalid structured output. Return only raw JSON that matches the supplied JSON schema. Do not use Markdown fences or include commentary.\";\n\nexport const STRUCTURED_OUTPUT_TRUNCATED_RETRY_PROMPT =\n \"Your previous response exceeded the provider output limit. Return substantially shorter raw JSON that matches the supplied JSON schema. Do not use Markdown fences or include commentary.\";\n\nconst STRUCTURED_OUTPUT_REPAIR_PREVIEW_MAX_LENGTH = 8_192;\nconst STRUCTURED_OUTPUT_REPAIR_PREVIEW_MARKER = \"\\n...[output omitted]...\\n\";\n\nexport type StructuredOutputRepairPreview = Readonly<{\n text: string;\n includedOutputLength: number;\n}>;\n\nexport function structuredOutputRepairPreview(text: string): StructuredOutputRepairPreview {\n if (text.length <= STRUCTURED_OUTPUT_REPAIR_PREVIEW_MAX_LENGTH) {\n return { text, includedOutputLength: text.length };\n }\n const availableLength =\n STRUCTURED_OUTPUT_REPAIR_PREVIEW_MAX_LENGTH - STRUCTURED_OUTPUT_REPAIR_PREVIEW_MARKER.length;\n const headLength = Math.ceil(availableLength / 2);\n const tailLength = availableLength - headLength;\n return {\n text: `${text.slice(0, headLength)}${STRUCTURED_OUTPUT_REPAIR_PREVIEW_MARKER}${text.slice(-tailLength)}`,\n includedOutputLength: headLength + tailLength,\n };\n}\n\nexport type NormalizedStructuredOutput = Readonly<{\n text: string;\n format: AgentStructuredOutputFormat;\n}>;\n\nexport function normalizeStructuredOutput(text: string): NormalizedStructuredOutput {\n const trimmed = text.trim();\n const opening = fenceOpening(trimmed);\n if (opening === undefined || !trimmed.endsWith(FENCE_END)) {\n return { text: trimmed, format: \"raw\" };\n }\n\n const closingStart = trimmed.length - 3;\n const precedingNewline = closingStart - 1;\n const contentEnd =\n trimmed[precedingNewline - 1] === \"\\r\" ? precedingNewline - 1 : precedingNewline;\n return {\n text: trimmed.slice(opening.length, contentEnd).trim(),\n format: opening.format,\n };\n}\n\nfunction fenceOpening(\n text: string,\n): Readonly<{ length: number; format: Exclude<AgentStructuredOutputFormat, \"raw\"> }> | undefined {\n if (text.startsWith(JSON_FENCE_START)) {\n return { length: JSON_FENCE_START.length, format: \"json-fence\" };\n }\n if (text.startsWith(JSON_FENCE_CRLF_START)) {\n return { length: JSON_FENCE_CRLF_START.length, format: \"json-fence\" };\n }\n if (text.startsWith(UNLABELED_FENCE_START)) {\n return { length: UNLABELED_FENCE_START.length, format: \"unlabeled-fence\" };\n }\n if (text.startsWith(UNLABELED_FENCE_CRLF_START)) {\n return { length: UNLABELED_FENCE_CRLF_START.length, format: \"unlabeled-fence\" };\n }\n return undefined;\n}\n"],"mappings":";AAEA,IAAM,mBAAmB;AACzB,IAAM,wBAAwB;AAC9B,IAAM,wBAAwB;AAC9B,IAAM,6BAA6B;AACnC,IAAM,YAAY;AAEX,IAAM,iCACX;AAEK,IAAM,2CACX;AAEF,IAAM,8CAA8C;AACpD,IAAM,0CAA0C;AAOzC,SAAS,8BAA8B,MAA6C;AACzF,MAAI,KAAK,UAAU,6CAA6C;AAC9D,WAAO,EAAE,MAAM,sBAAsB,KAAK,OAAO;AAAA,EACnD;AACA,QAAM,kBACJ,8CAA8C,wCAAwC;AACxF,QAAM,aAAa,KAAK,KAAK,kBAAkB,CAAC;AAChD,QAAM,aAAa,kBAAkB;AACrC,SAAO;AAAA,IACL,MAAM,GAAG,KAAK,MAAM,GAAG,UAAU,CAAC,GAAG,uCAAuC,GAAG,KAAK,MAAM,CAAC,UAAU,CAAC;AAAA,IACtG,sBAAsB,aAAa;AAAA,EACrC;AACF;AAOO,SAAS,0BAA0B,MAA0C;AAClF,QAAM,UAAU,KAAK,KAAK;AAC1B,QAAM,UAAU,aAAa,OAAO;AACpC,MAAI,YAAY,UAAa,CAAC,QAAQ,SAAS,SAAS,GAAG;AACzD,WAAO,EAAE,MAAM,SAAS,QAAQ,MAAM;AAAA,EACxC;AAEA,QAAM,eAAe,QAAQ,SAAS;AACtC,QAAM,mBAAmB,eAAe;AACxC,QAAM,aACJ,QAAQ,mBAAmB,CAAC,MAAM,OAAO,mBAAmB,IAAI;AAClE,SAAO;AAAA,IACL,MAAM,QAAQ,MAAM,QAAQ,QAAQ,UAAU,EAAE,KAAK;AAAA,IACrD,QAAQ,QAAQ;AAAA,EAClB;AACF;AAEA,SAAS,aACP,MAC+F;AAC/F,MAAI,KAAK,WAAW,gBAAgB,GAAG;AACrC,WAAO,EAAE,QAAQ,iBAAiB,QAAQ,QAAQ,aAAa;AAAA,EACjE;AACA,MAAI,KAAK,WAAW,qBAAqB,GAAG;AAC1C,WAAO,EAAE,QAAQ,sBAAsB,QAAQ,QAAQ,aAAa;AAAA,EACtE;AACA,MAAI,KAAK,WAAW,qBAAqB,GAAG;AAC1C,WAAO,EAAE,QAAQ,sBAAsB,QAAQ,QAAQ,kBAAkB;AAAA,EAC3E;AACA,MAAI,KAAK,WAAW,0BAA0B,GAAG;AAC/C,WAAO,EAAE,QAAQ,2BAA2B,QAAQ,QAAQ,kBAAkB;AAAA,EAChF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
assertJsonObject
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4ONUNWGC.js";
|
|
4
4
|
import {
|
|
5
5
|
resolveRetryOptions,
|
|
6
|
-
runWithRetries
|
|
6
|
+
runWithRetries
|
|
7
|
+
} from "./chunk-POXHJF3H.js";
|
|
8
|
+
import {
|
|
7
9
|
throwIfAborted
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-USRKPEQN.js";
|
|
9
11
|
|
|
10
12
|
// src/speech-generation/generate-speech.ts
|
|
11
13
|
async function generateSpeech(options) {
|
|
@@ -48,4 +50,4 @@ function assertNonEmptyString(value, name) {
|
|
|
48
50
|
export {
|
|
49
51
|
generateSpeech
|
|
50
52
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-SYULMZGL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/speech-generation/generate-speech.ts"],"sourcesContent":["import type { JsonObject } from \"../completion/types\";\nimport { throwIfAborted } from \"../internal/abort\";\nimport { assertJsonObject } from \"../internal/json-object\";\nimport type { ModelCallOptions } from \"../model-call-options\";\nimport {\n type ResolvedRetryOptions,\n type RetrySetting,\n resolveRetryOptions,\n runWithRetries,\n} from \"../retry\";\nimport type {\n SpeechGenerationModel,\n SpeechGenerationRequest,\n SpeechGenerationResult,\n} from \"./types\";\n\nexport type GenerateSpeechOptions<Model extends SpeechGenerationModel = SpeechGenerationModel> = {\n model: Model;\n text: string;\n voice: string;\n speed?: number | undefined;\n providerOptions?: JsonObject | undefined;\n retries?: RetrySetting | undefined;\n abortSignal?: AbortSignal | undefined;\n};\n\ntype RawResponseOf<Model> =\n Model extends SpeechGenerationModel<infer RawResponse> ? RawResponse : unknown;\n\nexport async function generateSpeech<Model extends SpeechGenerationModel>(\n options: GenerateSpeechOptions<Model>,\n): Promise<SpeechGenerationResult<RawResponseOf<Model>>> {\n assertNonEmptyString(options.text, \"Speech text\");\n assertNonEmptyString(options.voice, \"Speech voice\");\n throwIfAborted(options.abortSignal);\n const speed = options.speed ?? 1;\n if (!Number.isFinite(speed) || speed <= 0) {\n throw new RangeError(\"Speech speed must be a positive finite number.\");\n }\n\n const request: SpeechGenerationRequest = { text: options.text, voice: options.voice, speed };\n if (options.providerOptions !== undefined) {\n assertJsonObject(options.providerOptions, \"providerOptions\");\n request.providerOptions = options.providerOptions;\n }\n return runWithRetries(\n () => {\n throwIfAborted(options.abortSignal);\n return options.model.speechGeneration(\n request,\n modelCallOptions(options.abortSignal),\n ) as Promise<SpeechGenerationResult<RawResponseOf<Model>>>;\n },\n resolveRetries(options.retries),\n { streaming: false, abortSignal: options.abortSignal },\n );\n}\n\nfunction resolveRetries(setting: RetrySetting | undefined): ResolvedRetryOptions | undefined {\n return setting === undefined || setting === false ? undefined : resolveRetryOptions(setting);\n}\n\nfunction modelCallOptions(abortSignal: AbortSignal | undefined): ModelCallOptions | undefined {\n return abortSignal === undefined ? undefined : { abortSignal };\n}\n\nfunction assertNonEmptyString(value: string, name: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`${name} must be a non-empty string.`);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/speech-generation/generate-speech.ts"],"sourcesContent":["import type { JsonObject } from \"../completion/types\";\nimport { throwIfAborted } from \"../internal/abort\";\nimport { assertJsonObject } from \"../internal/json-object\";\nimport type { ModelCallOptions } from \"../model-call-options\";\nimport {\n type ResolvedRetryOptions,\n type RetrySetting,\n resolveRetryOptions,\n runWithRetries,\n} from \"../retry\";\nimport type {\n SpeechGenerationModel,\n SpeechGenerationRequest,\n SpeechGenerationResult,\n} from \"./types\";\n\nexport type GenerateSpeechOptions<Model extends SpeechGenerationModel = SpeechGenerationModel> = {\n model: Model;\n text: string;\n voice: string;\n speed?: number | undefined;\n providerOptions?: JsonObject | undefined;\n retries?: RetrySetting | undefined;\n abortSignal?: AbortSignal | undefined;\n};\n\ntype RawResponseOf<Model> =\n Model extends SpeechGenerationModel<infer RawResponse> ? RawResponse : unknown;\n\nexport async function generateSpeech<Model extends SpeechGenerationModel>(\n options: GenerateSpeechOptions<Model>,\n): Promise<SpeechGenerationResult<RawResponseOf<Model>>> {\n assertNonEmptyString(options.text, \"Speech text\");\n assertNonEmptyString(options.voice, \"Speech voice\");\n throwIfAborted(options.abortSignal);\n const speed = options.speed ?? 1;\n if (!Number.isFinite(speed) || speed <= 0) {\n throw new RangeError(\"Speech speed must be a positive finite number.\");\n }\n\n const request: SpeechGenerationRequest = { text: options.text, voice: options.voice, speed };\n if (options.providerOptions !== undefined) {\n assertJsonObject(options.providerOptions, \"providerOptions\");\n request.providerOptions = options.providerOptions;\n }\n return runWithRetries(\n () => {\n throwIfAborted(options.abortSignal);\n return options.model.speechGeneration(\n request,\n modelCallOptions(options.abortSignal),\n ) as Promise<SpeechGenerationResult<RawResponseOf<Model>>>;\n },\n resolveRetries(options.retries),\n { streaming: false, abortSignal: options.abortSignal },\n );\n}\n\nfunction resolveRetries(setting: RetrySetting | undefined): ResolvedRetryOptions | undefined {\n return setting === undefined || setting === false ? undefined : resolveRetryOptions(setting);\n}\n\nfunction modelCallOptions(abortSignal: AbortSignal | undefined): ModelCallOptions | undefined {\n return abortSignal === undefined ? undefined : { abortSignal };\n}\n\nfunction assertNonEmptyString(value: string, name: string): void {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new TypeError(`${name} must be a non-empty string.`);\n }\n}\n"],"mappings":";;;;;;;;;;;;AA6BA,eAAsB,eACpB,SACuD;AACvD,uBAAqB,QAAQ,MAAM,aAAa;AAChD,uBAAqB,QAAQ,OAAO,cAAc;AAClD,iBAAe,QAAQ,WAAW;AAClC,QAAM,QAAQ,QAAQ,SAAS;AAC/B,MAAI,CAAC,OAAO,SAAS,KAAK,KAAK,SAAS,GAAG;AACzC,UAAM,IAAI,WAAW,gDAAgD;AAAA,EACvE;AAEA,QAAM,UAAmC,EAAE,MAAM,QAAQ,MAAM,OAAO,QAAQ,OAAO,MAAM;AAC3F,MAAI,QAAQ,oBAAoB,QAAW;AACzC,qBAAiB,QAAQ,iBAAiB,iBAAiB;AAC3D,YAAQ,kBAAkB,QAAQ;AAAA,EACpC;AACA,SAAO;AAAA,IACL,MAAM;AACJ,qBAAe,QAAQ,WAAW;AAClC,aAAO,QAAQ,MAAM;AAAA,QACnB;AAAA,QACA,iBAAiB,QAAQ,WAAW;AAAA,MACtC;AAAA,IACF;AAAA,IACA,eAAe,QAAQ,OAAO;AAAA,IAC9B,EAAE,WAAW,OAAO,aAAa,QAAQ,YAAY;AAAA,EACvD;AACF;AAEA,SAAS,eAAe,SAAqE;AAC3F,SAAO,YAAY,UAAa,YAAY,QAAQ,SAAY,oBAAoB,OAAO;AAC7F;AAEA,SAAS,iBAAiB,aAAoE;AAC5F,SAAO,gBAAgB,SAAY,SAAY,EAAE,YAAY;AAC/D;AAEA,SAAS,qBAAqB,OAAe,MAAoB;AAC/D,MAAI,OAAO,UAAU,YAAY,MAAM,KAAK,EAAE,WAAW,GAAG;AAC1D,UAAM,IAAI,UAAU,GAAG,IAAI,8BAA8B;AAAA,EAC3D;AACF;","names":[]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
lifecycleSnapshot
|
|
3
|
+
} from "./chunk-KFAVEL5F.js";
|
|
4
|
+
import {
|
|
5
|
+
parseMessage,
|
|
6
|
+
parseMessages
|
|
7
|
+
} from "./chunk-BONQTXRQ.js";
|
|
8
|
+
|
|
9
|
+
// src/internal/team-runtime/member.ts
|
|
10
|
+
function memberSummary(member) {
|
|
11
|
+
return {
|
|
12
|
+
instanceId: member.instanceId,
|
|
13
|
+
agentId: member.agent.id,
|
|
14
|
+
name: member.name,
|
|
15
|
+
depth: member.depth,
|
|
16
|
+
status: member.status,
|
|
17
|
+
usage: lifecycleSnapshot(member.usage),
|
|
18
|
+
...member.parentInstanceId === void 0 ? {} : { parentInstanceId: member.parentInstanceId },
|
|
19
|
+
...member.outcome === void 0 ? {} : { outcome: lifecycleSnapshot(member.outcome) },
|
|
20
|
+
...member.error === void 0 ? {} : { error: member.error }
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
function steeringMessages(input) {
|
|
24
|
+
if (typeof input !== "object" || input === null || input.prompt === void 0 === (input.messages === void 0)) {
|
|
25
|
+
throw new TypeError("Agent team steering requires exactly one of prompt or messages.");
|
|
26
|
+
}
|
|
27
|
+
const messages = input.prompt === void 0 ? parseMessages(input.messages) : [
|
|
28
|
+
parseMessage(
|
|
29
|
+
typeof input.prompt === "string" ? { role: "user", content: input.prompt } : input.prompt
|
|
30
|
+
)
|
|
31
|
+
];
|
|
32
|
+
if (messages.length === 0 || messages.some((message) => message.role !== "user")) {
|
|
33
|
+
throw new TypeError("Agent team steering requires user messages.");
|
|
34
|
+
}
|
|
35
|
+
return messages;
|
|
36
|
+
}
|
|
37
|
+
function agentMessageInput(message) {
|
|
38
|
+
return {
|
|
39
|
+
id: message.id,
|
|
40
|
+
submitted: false,
|
|
41
|
+
message,
|
|
42
|
+
messages: [
|
|
43
|
+
{
|
|
44
|
+
role: "user",
|
|
45
|
+
content: `Message from another agent (not a user approval):
|
|
46
|
+
${JSON.stringify(message)}`,
|
|
47
|
+
metadata: { anvia: { agentMessage: { ...message } } }
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
memberSummary,
|
|
55
|
+
steeringMessages,
|
|
56
|
+
agentMessageInput
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=chunk-T4KS577P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internal/team-runtime/member.ts"],"sourcesContent":["import type {\n AgentTeamMemberStatus,\n AgentTeamMemberSummary,\n AgentTeamMessage,\n} from \"../../agent/team/types\";\nimport type { AgentOutcome, AgentSteerInput } from \"../../agent/run-types\";\nimport type { Message, UserMessage } from \"../../completion\";\nimport { parseMessage, parseMessages, Usage } from \"../../completion\";\nimport type { AgentRun } from \"../agent-runtime/agent-run\";\nimport type { Agent } from \"../../agent/agent\";\nimport { lifecycleSnapshot } from \"../../agent/lifecycle\";\n\nexport type TeamInput = {\n id: string;\n messages: UserMessage[];\n message?: AgentTeamMessage;\n submitted: boolean;\n};\n\nexport type TeamMember = {\n instanceId: string;\n parentInstanceId?: string;\n depth: number;\n definition: Agent<unknown>;\n name: string;\n agent: Agent<unknown>;\n status: AgentTeamMemberStatus;\n history: Message[];\n inputs: TeamInput[];\n receipts: Map<string, TeamInput>;\n controller: AbortController;\n release?: (() => void) | undefined;\n task?: Promise<void> | undefined;\n activeRun?: AgentRun<unknown> | undefined;\n runId?: string | undefined;\n outcome?: Exclude<AgentOutcome<unknown>, { type: \"interaction\" }>;\n error?: unknown;\n usage: Usage;\n notifications: { from: string; type: \"message\" | \"outcome\"; id: string }[];\n};\n\nexport function memberSummary(member: TeamMember): AgentTeamMemberSummary {\n return {\n instanceId: member.instanceId,\n agentId: member.agent.id,\n name: member.name,\n depth: member.depth,\n status: member.status,\n usage: lifecycleSnapshot(member.usage),\n ...(member.parentInstanceId === undefined ? {} : { parentInstanceId: member.parentInstanceId }),\n ...(member.outcome === undefined ? {} : { outcome: lifecycleSnapshot(member.outcome) }),\n ...(member.error === undefined ? {} : { error: member.error }),\n };\n}\n\nexport function steeringMessages(input: AgentSteerInput): UserMessage[] {\n if (\n typeof input !== \"object\" ||\n input === null ||\n (input.prompt === undefined) === (input.messages === undefined)\n ) {\n throw new TypeError(\"Agent team steering requires exactly one of prompt or messages.\");\n }\n const messages =\n input.prompt === undefined\n ? parseMessages(input.messages)\n : [\n parseMessage(\n typeof input.prompt === \"string\"\n ? { role: \"user\", content: input.prompt }\n : input.prompt,\n ),\n ];\n if (messages.length === 0 || messages.some((message) => message.role !== \"user\")) {\n throw new TypeError(\"Agent team steering requires user messages.\");\n }\n return messages as UserMessage[];\n}\n\nexport function agentMessageInput(message: AgentTeamMessage): TeamInput {\n return {\n id: message.id,\n submitted: false,\n message,\n messages: [\n {\n role: \"user\",\n content: `Message from another agent (not a user approval):\\n${JSON.stringify(message)}`,\n metadata: { anvia: { agentMessage: { ...message } } },\n },\n ],\n };\n}\n"],"mappings":";;;;;;;;;AAyCO,SAAS,cAAc,QAA4C;AACxE,SAAO;AAAA,IACL,YAAY,OAAO;AAAA,IACnB,SAAS,OAAO,MAAM;AAAA,IACtB,MAAM,OAAO;AAAA,IACb,OAAO,OAAO;AAAA,IACd,QAAQ,OAAO;AAAA,IACf,OAAO,kBAAkB,OAAO,KAAK;AAAA,IACrC,GAAI,OAAO,qBAAqB,SAAY,CAAC,IAAI,EAAE,kBAAkB,OAAO,iBAAiB;AAAA,IAC7F,GAAI,OAAO,YAAY,SAAY,CAAC,IAAI,EAAE,SAAS,kBAAkB,OAAO,OAAO,EAAE;AAAA,IACrF,GAAI,OAAO,UAAU,SAAY,CAAC,IAAI,EAAE,OAAO,OAAO,MAAM;AAAA,EAC9D;AACF;AAEO,SAAS,iBAAiB,OAAuC;AACtE,MACE,OAAO,UAAU,YACjB,UAAU,QACT,MAAM,WAAW,YAAgB,MAAM,aAAa,SACrD;AACA,UAAM,IAAI,UAAU,iEAAiE;AAAA,EACvF;AACA,QAAM,WACJ,MAAM,WAAW,SACb,cAAc,MAAM,QAAQ,IAC5B;AAAA,IACE;AAAA,MACE,OAAO,MAAM,WAAW,WACpB,EAAE,MAAM,QAAQ,SAAS,MAAM,OAAO,IACtC,MAAM;AAAA,IACZ;AAAA,EACF;AACN,MAAI,SAAS,WAAW,KAAK,SAAS,KAAK,CAAC,YAAY,QAAQ,SAAS,MAAM,GAAG;AAChF,UAAM,IAAI,UAAU,6CAA6C;AAAA,EACnE;AACA,SAAO;AACT;AAEO,SAAS,kBAAkB,SAAsC;AACtE,SAAO;AAAA,IACL,IAAI,QAAQ;AAAA,IACZ,WAAW;AAAA,IACX;AAAA,IACA,UAAU;AAAA,MACR;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,EAAsD,KAAK,UAAU,OAAO,CAAC;AAAA,QACtF,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,QAAQ,EAAE,EAAE;AAAA,MACtD;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chunkText
|
|
3
|
+
} from "./chunk-GPVXCY5I.js";
|
|
4
|
+
|
|
5
|
+
// src/documents/text-document.ts
|
|
6
|
+
function chunkTextDocuments(options) {
|
|
7
|
+
if (typeof options !== "object" || options === null) {
|
|
8
|
+
throw new TypeError("chunkTextDocuments options must contain a documents array");
|
|
9
|
+
}
|
|
10
|
+
const documents = options.documents;
|
|
11
|
+
if (!Array.isArray(documents)) {
|
|
12
|
+
throw new TypeError("chunkTextDocuments options must contain a documents array");
|
|
13
|
+
}
|
|
14
|
+
const ids = /* @__PURE__ */ new Set();
|
|
15
|
+
const chunks = [];
|
|
16
|
+
for (const document of documents) {
|
|
17
|
+
validateDocument(document, ids);
|
|
18
|
+
chunks.push(...chunkDocument(document, options.chunking));
|
|
19
|
+
}
|
|
20
|
+
return chunks;
|
|
21
|
+
}
|
|
22
|
+
function validateDocument(document, ids) {
|
|
23
|
+
if (typeof document !== "object" || document === null) {
|
|
24
|
+
throw new TypeError("Text documents must be objects");
|
|
25
|
+
}
|
|
26
|
+
if (typeof document.id !== "string" || document.id.length === 0) {
|
|
27
|
+
throw new TypeError("Text document ids must be non-empty strings");
|
|
28
|
+
}
|
|
29
|
+
if (ids.has(document.id)) {
|
|
30
|
+
throw new TypeError(`Duplicate text document id: ${document.id}`);
|
|
31
|
+
}
|
|
32
|
+
if (typeof document.text !== "string" || document.text.length === 0) {
|
|
33
|
+
throw new TypeError(`Text document ${document.id} must contain non-empty text`);
|
|
34
|
+
}
|
|
35
|
+
ids.add(document.id);
|
|
36
|
+
}
|
|
37
|
+
function chunkDocument(document, chunking) {
|
|
38
|
+
if (chunking === void 0 || chunking.strategy === "none") {
|
|
39
|
+
return [createDocumentChunk(document, 0, document.text)];
|
|
40
|
+
}
|
|
41
|
+
const textChunks = chunkDocumentText(document.text, chunking);
|
|
42
|
+
return textChunks.map((chunk) => createDocumentChunk(document, chunk.index, chunk.text));
|
|
43
|
+
}
|
|
44
|
+
function chunkDocumentText(text, chunking) {
|
|
45
|
+
const overlap = chunking.overlap ?? 0;
|
|
46
|
+
if (chunking.strategy === "fixed") {
|
|
47
|
+
return chunkText({
|
|
48
|
+
text,
|
|
49
|
+
strategy: "fixed",
|
|
50
|
+
maxSize: chunking.maxSize,
|
|
51
|
+
overlap
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
return chunkText({
|
|
55
|
+
text,
|
|
56
|
+
strategy: "recursive",
|
|
57
|
+
maxSize: chunking.maxSize,
|
|
58
|
+
overlap,
|
|
59
|
+
separators: chunking.separators
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function createDocumentChunk(document, index, text) {
|
|
63
|
+
const chunk = {
|
|
64
|
+
id: `${document.id}:chunk:${index}`,
|
|
65
|
+
documentId: document.id,
|
|
66
|
+
index,
|
|
67
|
+
text
|
|
68
|
+
};
|
|
69
|
+
if (document.metadata === void 0) {
|
|
70
|
+
return chunk;
|
|
71
|
+
}
|
|
72
|
+
return { ...chunk, metadata: document.metadata };
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export {
|
|
76
|
+
chunkTextDocuments
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=chunk-TFIOU6UR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/documents/text-document.ts"],"sourcesContent":["import { chunkText } from \"./chunk-text\";\n\nexport type TextDocumentMetadata = Record<string, string | number | boolean>;\n\nexport type TextDocument<Metadata = TextDocumentMetadata> = Readonly<{\n id: string;\n text: string;\n metadata?: Metadata | undefined;\n}>;\n\nexport type TextDocumentChunk<Metadata = TextDocumentMetadata> = Readonly<{\n id: string;\n documentId: string;\n index: number;\n text: string;\n metadata?: Metadata | undefined;\n}>;\n\nexport type TextDocumentChunkingOptions =\n | Readonly<{ strategy: \"none\" }>\n | Readonly<{\n strategy: \"fixed\";\n maxSize: number;\n overlap?: number | undefined;\n }>\n | Readonly<{\n strategy: \"recursive\";\n maxSize: number;\n overlap?: number | undefined;\n separators: readonly string[];\n }>;\n\nexport type ChunkTextDocumentsOptions<Metadata = TextDocumentMetadata> = Readonly<{\n documents: readonly TextDocument<Metadata>[];\n chunking?: TextDocumentChunkingOptions | undefined;\n}>;\n\nexport function chunkTextDocuments<Metadata>(\n options: ChunkTextDocumentsOptions<Metadata>,\n): readonly TextDocumentChunk<Metadata>[] {\n if (typeof options !== \"object\" || options === null) {\n throw new TypeError(\"chunkTextDocuments options must contain a documents array\");\n }\n const documents = options.documents;\n if (!Array.isArray(documents)) {\n throw new TypeError(\"chunkTextDocuments options must contain a documents array\");\n }\n\n const ids = new Set<string>();\n const chunks: TextDocumentChunk<Metadata>[] = [];\n for (const document of documents as readonly TextDocument<Metadata>[]) {\n validateDocument(document, ids);\n chunks.push(...chunkDocument(document, options.chunking));\n }\n return chunks;\n}\n\nfunction validateDocument<Metadata>(document: TextDocument<Metadata>, ids: Set<string>): void {\n if (typeof document !== \"object\" || document === null) {\n throw new TypeError(\"Text documents must be objects\");\n }\n if (typeof document.id !== \"string\" || document.id.length === 0) {\n throw new TypeError(\"Text document ids must be non-empty strings\");\n }\n if (ids.has(document.id)) {\n throw new TypeError(`Duplicate text document id: ${document.id}`);\n }\n if (typeof document.text !== \"string\" || document.text.length === 0) {\n throw new TypeError(`Text document ${document.id} must contain non-empty text`);\n }\n ids.add(document.id);\n}\n\nfunction chunkDocument<Metadata>(\n document: TextDocument<Metadata>,\n chunking: TextDocumentChunkingOptions | undefined,\n): readonly TextDocumentChunk<Metadata>[] {\n if (chunking === undefined || chunking.strategy === \"none\") {\n return [createDocumentChunk(document, 0, document.text)];\n }\n\n const textChunks = chunkDocumentText(document.text, chunking);\n return textChunks.map((chunk) => createDocumentChunk(document, chunk.index, chunk.text));\n}\n\nfunction chunkDocumentText(\n text: string,\n chunking: Exclude<TextDocumentChunkingOptions, Readonly<{ strategy: \"none\" }>>,\n) {\n const overlap = chunking.overlap ?? 0;\n if (chunking.strategy === \"fixed\") {\n return chunkText({\n text,\n strategy: \"fixed\",\n maxSize: chunking.maxSize,\n overlap,\n });\n }\n return chunkText({\n text,\n strategy: \"recursive\",\n maxSize: chunking.maxSize,\n overlap,\n separators: chunking.separators,\n });\n}\n\nfunction createDocumentChunk<Metadata>(\n document: TextDocument<Metadata>,\n index: number,\n text: string,\n): TextDocumentChunk<Metadata> {\n const chunk = {\n id: `${document.id}:chunk:${index}`,\n documentId: document.id,\n index,\n text,\n };\n if (document.metadata === undefined) {\n return chunk;\n }\n return { ...chunk, metadata: document.metadata };\n}\n"],"mappings":";;;;;AAqCO,SAAS,mBACd,SACwC;AACxC,MAAI,OAAO,YAAY,YAAY,YAAY,MAAM;AACnD,UAAM,IAAI,UAAU,2DAA2D;AAAA,EACjF;AACA,QAAM,YAAY,QAAQ;AAC1B,MAAI,CAAC,MAAM,QAAQ,SAAS,GAAG;AAC7B,UAAM,IAAI,UAAU,2DAA2D;AAAA,EACjF;AAEA,QAAM,MAAM,oBAAI,IAAY;AAC5B,QAAM,SAAwC,CAAC;AAC/C,aAAW,YAAY,WAAgD;AACrE,qBAAiB,UAAU,GAAG;AAC9B,WAAO,KAAK,GAAG,cAAc,UAAU,QAAQ,QAAQ,CAAC;AAAA,EAC1D;AACA,SAAO;AACT;AAEA,SAAS,iBAA2B,UAAkC,KAAwB;AAC5F,MAAI,OAAO,aAAa,YAAY,aAAa,MAAM;AACrD,UAAM,IAAI,UAAU,gCAAgC;AAAA,EACtD;AACA,MAAI,OAAO,SAAS,OAAO,YAAY,SAAS,GAAG,WAAW,GAAG;AAC/D,UAAM,IAAI,UAAU,6CAA6C;AAAA,EACnE;AACA,MAAI,IAAI,IAAI,SAAS,EAAE,GAAG;AACxB,UAAM,IAAI,UAAU,+BAA+B,SAAS,EAAE,EAAE;AAAA,EAClE;AACA,MAAI,OAAO,SAAS,SAAS,YAAY,SAAS,KAAK,WAAW,GAAG;AACnE,UAAM,IAAI,UAAU,iBAAiB,SAAS,EAAE,8BAA8B;AAAA,EAChF;AACA,MAAI,IAAI,SAAS,EAAE;AACrB;AAEA,SAAS,cACP,UACA,UACwC;AACxC,MAAI,aAAa,UAAa,SAAS,aAAa,QAAQ;AAC1D,WAAO,CAAC,oBAAoB,UAAU,GAAG,SAAS,IAAI,CAAC;AAAA,EACzD;AAEA,QAAM,aAAa,kBAAkB,SAAS,MAAM,QAAQ;AAC5D,SAAO,WAAW,IAAI,CAAC,UAAU,oBAAoB,UAAU,MAAM,OAAO,MAAM,IAAI,CAAC;AACzF;AAEA,SAAS,kBACP,MACA,UACA;AACA,QAAM,UAAU,SAAS,WAAW;AACpC,MAAI,SAAS,aAAa,SAAS;AACjC,WAAO,UAAU;AAAA,MACf;AAAA,MACA,UAAU;AAAA,MACV,SAAS,SAAS;AAAA,MAClB;AAAA,IACF,CAAC;AAAA,EACH;AACA,SAAO,UAAU;AAAA,IACf;AAAA,IACA,UAAU;AAAA,IACV,SAAS,SAAS;AAAA,IAClB;AAAA,IACA,YAAY,SAAS;AAAA,EACvB,CAAC;AACH;AAEA,SAAS,oBACP,UACA,OACA,MAC6B;AAC7B,QAAM,QAAQ;AAAA,IACZ,IAAI,GAAG,SAAS,EAAE,UAAU,KAAK;AAAA,IACjC,YAAY,SAAS;AAAA,IACrB;AAAA,IACA;AAAA,EACF;AACA,MAAI,SAAS,aAAa,QAAW;AACnC,WAAO;AAAA,EACT;AACA,SAAO,EAAE,GAAG,OAAO,UAAU,SAAS,SAAS;AACjD;","names":[]}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import {
|
|
2
|
+
snapshotPipelineObservability,
|
|
3
|
+
startPipelineRunObservers
|
|
4
|
+
} from "./chunk-ETYB5JO6.js";
|
|
5
|
+
import {
|
|
6
|
+
childContext,
|
|
7
|
+
combineAbortSignals,
|
|
8
|
+
pipelineAbortError,
|
|
9
|
+
runNode,
|
|
10
|
+
stageContext
|
|
11
|
+
} from "./chunk-EKZRAWBP.js";
|
|
12
|
+
import {
|
|
13
|
+
PipelineAgentSuspensionError
|
|
14
|
+
} from "./chunk-R6722CIU.js";
|
|
15
|
+
import {
|
|
16
|
+
appendComposedGraph,
|
|
17
|
+
appendParallelBranch,
|
|
18
|
+
appendStageNode,
|
|
19
|
+
cloneGraph,
|
|
20
|
+
initialPipelineState,
|
|
21
|
+
withOutputNode,
|
|
22
|
+
withTerminalPaths
|
|
23
|
+
} from "./chunk-V3FFZWF3.js";
|
|
24
|
+
import {
|
|
25
|
+
extract
|
|
26
|
+
} from "./chunk-UOGM62JL.js";
|
|
27
|
+
import {
|
|
28
|
+
mapWithConcurrency
|
|
29
|
+
} from "./chunk-4FIVU53H.js";
|
|
30
|
+
import {
|
|
31
|
+
throwIfAborted
|
|
32
|
+
} from "./chunk-USRKPEQN.js";
|
|
33
|
+
import {
|
|
34
|
+
AgentRunBlockedError
|
|
35
|
+
} from "./chunk-WN6AVBO4.js";
|
|
36
|
+
|
|
37
|
+
// src/pipeline/pipeline.ts
|
|
38
|
+
import { z } from "zod";
|
|
39
|
+
var internalPipelineOptions = /* @__PURE__ */ Symbol("internal-pipeline-options");
|
|
40
|
+
var Pipeline = class {
|
|
41
|
+
id;
|
|
42
|
+
name;
|
|
43
|
+
description;
|
|
44
|
+
metadata;
|
|
45
|
+
observability;
|
|
46
|
+
executor;
|
|
47
|
+
state;
|
|
48
|
+
constructor(options) {
|
|
49
|
+
if (isInternalPipelineOptions(options)) {
|
|
50
|
+
this.executor = options[internalPipelineOptions].executor;
|
|
51
|
+
this.state = options[internalPipelineOptions].state;
|
|
52
|
+
this.observability = options[internalPipelineOptions].observability;
|
|
53
|
+
} else {
|
|
54
|
+
const id = normalizePipelineId(options.id);
|
|
55
|
+
if (!isZodSchema(options.inputSchema)) {
|
|
56
|
+
throw new TypeError("Pipeline inputSchema must be a Zod schema.");
|
|
57
|
+
}
|
|
58
|
+
const inputSchema = options.inputSchema;
|
|
59
|
+
this.executor = (async (input, context) => {
|
|
60
|
+
throwIfAborted(context.abortSignal);
|
|
61
|
+
return inputSchema.parseAsync(input);
|
|
62
|
+
});
|
|
63
|
+
this.state = initialPipelineState({
|
|
64
|
+
id,
|
|
65
|
+
name: options.name,
|
|
66
|
+
description: options.description,
|
|
67
|
+
metadata: options.metadata
|
|
68
|
+
});
|
|
69
|
+
this.observability = snapshotPipelineObservability(options.observability);
|
|
70
|
+
}
|
|
71
|
+
const graph = this.state.graph;
|
|
72
|
+
this.id = graph.id;
|
|
73
|
+
this.name = graph.name;
|
|
74
|
+
this.description = graph.description;
|
|
75
|
+
this.metadata = graph.metadata;
|
|
76
|
+
}
|
|
77
|
+
step(options) {
|
|
78
|
+
const next = appendStageNode(this.state, "step", options);
|
|
79
|
+
const executor = (async (input, context, pathPrefix) => {
|
|
80
|
+
const value = await this.execute(input, context, pathPrefix);
|
|
81
|
+
const path = [...pathPrefix, next.node.id];
|
|
82
|
+
return await runNode(
|
|
83
|
+
context,
|
|
84
|
+
next.node,
|
|
85
|
+
path,
|
|
86
|
+
value,
|
|
87
|
+
() => options.run(stageContext(value, context))
|
|
88
|
+
);
|
|
89
|
+
});
|
|
90
|
+
return this.derive(executor, next.state);
|
|
91
|
+
}
|
|
92
|
+
compose(options) {
|
|
93
|
+
const boundary = appendStageNode(this.state, "pipeline", options, {
|
|
94
|
+
defaultLabel: options.pipeline.name ?? options.pipeline.id,
|
|
95
|
+
pipelineId: options.pipeline.id
|
|
96
|
+
});
|
|
97
|
+
const state = appendComposedGraph(boundary.state, boundary.node, options.pipeline.graph());
|
|
98
|
+
const executor = (async (input, context, pathPrefix) => {
|
|
99
|
+
const value = await this.execute(input, context, pathPrefix);
|
|
100
|
+
const path = [...pathPrefix, boundary.node.id];
|
|
101
|
+
return await runNode(
|
|
102
|
+
context,
|
|
103
|
+
boundary.node,
|
|
104
|
+
path,
|
|
105
|
+
value,
|
|
106
|
+
() => options.pipeline.execute(value, context, path)
|
|
107
|
+
);
|
|
108
|
+
});
|
|
109
|
+
return this.derive(executor, state);
|
|
110
|
+
}
|
|
111
|
+
parallel(options) {
|
|
112
|
+
const branchEntries = normalizeParallelBranches(options.branches);
|
|
113
|
+
if (branchEntries.length === 0) {
|
|
114
|
+
throw new TypeError("Pipeline parallel branches must not be empty.");
|
|
115
|
+
}
|
|
116
|
+
const parallel = appendStageNode(this.state, "parallel", options, {
|
|
117
|
+
defaultLabel: `${branchEntries.length} parallel branches`
|
|
118
|
+
});
|
|
119
|
+
let nextState = parallel.state;
|
|
120
|
+
const branchNodes = /* @__PURE__ */ new Map();
|
|
121
|
+
const terminalPaths = [];
|
|
122
|
+
for (const [key, branch] of branchEntries) {
|
|
123
|
+
const appended = appendParallelBranch(nextState, parallel.node, key, branch.graph());
|
|
124
|
+
nextState = appended.state;
|
|
125
|
+
branchNodes.set(key, appended.node);
|
|
126
|
+
terminalPaths.push(...appended.terminalPaths);
|
|
127
|
+
}
|
|
128
|
+
nextState = withTerminalPaths(nextState, terminalPaths);
|
|
129
|
+
return this.derive(async (input, context, pathPrefix) => {
|
|
130
|
+
const value = await this.execute(input, context, pathPrefix);
|
|
131
|
+
const parallelPath = [...pathPrefix, parallel.node.id];
|
|
132
|
+
return runNode(context, parallel.node, parallelPath, value, async () => {
|
|
133
|
+
const controller = new AbortController();
|
|
134
|
+
const combined = combineAbortSignals(context.abortSignal, controller.signal);
|
|
135
|
+
const branchContext = childContext(context, combined.signal);
|
|
136
|
+
let firstError;
|
|
137
|
+
const promises = branchEntries.map(async ([key, branch]) => {
|
|
138
|
+
const node = branchNodes.get(key);
|
|
139
|
+
const path = [...parallelPath, node.id];
|
|
140
|
+
try {
|
|
141
|
+
const output = await runNode(
|
|
142
|
+
branchContext,
|
|
143
|
+
node,
|
|
144
|
+
path,
|
|
145
|
+
value,
|
|
146
|
+
() => branch.execute(value, branchContext, path)
|
|
147
|
+
);
|
|
148
|
+
return [key, output];
|
|
149
|
+
} catch (error) {
|
|
150
|
+
if (firstError === void 0) firstError = error;
|
|
151
|
+
if (!controller.signal.aborted) controller.abort(error);
|
|
152
|
+
throw error;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
const settled = await Promise.allSettled(promises);
|
|
156
|
+
combined.dispose();
|
|
157
|
+
if (context.abortSignal?.aborted === true) {
|
|
158
|
+
throw pipelineAbortError(context.abortSignal);
|
|
159
|
+
}
|
|
160
|
+
if (firstError !== void 0) throw firstError;
|
|
161
|
+
return Object.fromEntries(
|
|
162
|
+
settled.map(
|
|
163
|
+
(result) => result.value
|
|
164
|
+
)
|
|
165
|
+
);
|
|
166
|
+
});
|
|
167
|
+
}, nextState);
|
|
168
|
+
}
|
|
169
|
+
agent(options) {
|
|
170
|
+
if (options.suspension !== "reject") {
|
|
171
|
+
throw new TypeError('Pipeline Agent stages require suspension: "reject".');
|
|
172
|
+
}
|
|
173
|
+
const next = appendStageNode(this.state, "agent", options, {
|
|
174
|
+
defaultLabel: options.agent.name ?? options.agent.id,
|
|
175
|
+
agentId: options.agent.id,
|
|
176
|
+
agentName: options.agent.name
|
|
177
|
+
});
|
|
178
|
+
return this.derive(async (input, context, pathPrefix) => {
|
|
179
|
+
const value = await this.execute(input, context, pathPrefix);
|
|
180
|
+
const path = [...pathPrefix, next.node.id];
|
|
181
|
+
return runNode(context, next.node, path, value, async (stageTrace) => {
|
|
182
|
+
const request = await options.request(stageContext(value, context));
|
|
183
|
+
const response = await options.agent.generate({
|
|
184
|
+
...request,
|
|
185
|
+
trace: withPipelineParentTrace(
|
|
186
|
+
request.trace,
|
|
187
|
+
stageTrace,
|
|
188
|
+
options.agent.observability?.primaryTrace
|
|
189
|
+
),
|
|
190
|
+
abortSignal: context.abortSignal
|
|
191
|
+
});
|
|
192
|
+
if (response.type === "interaction") {
|
|
193
|
+
throw new PipelineAgentSuspensionError(response);
|
|
194
|
+
}
|
|
195
|
+
if (response.type === "blocked") {
|
|
196
|
+
throw new AgentRunBlockedError(response);
|
|
197
|
+
}
|
|
198
|
+
return response.output;
|
|
199
|
+
});
|
|
200
|
+
}, next.state);
|
|
201
|
+
}
|
|
202
|
+
extract(options) {
|
|
203
|
+
const next = appendStageNode(this.state, "extractor", options);
|
|
204
|
+
return this.derive(async (input, context, pathPrefix) => {
|
|
205
|
+
const value = await this.execute(input, context, pathPrefix);
|
|
206
|
+
const path = [...pathPrefix, next.node.id];
|
|
207
|
+
return runNode(context, next.node, path, value, async () => {
|
|
208
|
+
const text = await options.text(stageContext(value, context));
|
|
209
|
+
const result = await extract({
|
|
210
|
+
model: options.model,
|
|
211
|
+
text,
|
|
212
|
+
outputSchema: options.outputSchema,
|
|
213
|
+
instructions: options.instructions,
|
|
214
|
+
retries: options.retries,
|
|
215
|
+
temperature: options.temperature,
|
|
216
|
+
maxTokens: options.maxTokens,
|
|
217
|
+
providerOptions: options.providerOptions,
|
|
218
|
+
abortSignal: context.abortSignal
|
|
219
|
+
});
|
|
220
|
+
return result.output;
|
|
221
|
+
});
|
|
222
|
+
}, next.state);
|
|
223
|
+
}
|
|
224
|
+
async run(options) {
|
|
225
|
+
const runId = normalizeRunId(options.runId ?? globalThis.crypto.randomUUID());
|
|
226
|
+
const startedAt = Date.now();
|
|
227
|
+
const observability = await startPipelineRunObservers(
|
|
228
|
+
this.observability?.observers ?? {},
|
|
229
|
+
{
|
|
230
|
+
runId,
|
|
231
|
+
pipelineId: this.id,
|
|
232
|
+
pipelineName: this.name,
|
|
233
|
+
pipelineDescription: this.description,
|
|
234
|
+
pipelineMetadata: this.metadata,
|
|
235
|
+
runMetadata: options.metadata,
|
|
236
|
+
trace: options.trace,
|
|
237
|
+
input: options.input
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
primaryTrace: this.observability?.primaryTrace,
|
|
241
|
+
errorPolicy: this.observability?.errorPolicy ?? "ignore"
|
|
242
|
+
}
|
|
243
|
+
);
|
|
244
|
+
const context = {
|
|
245
|
+
runId,
|
|
246
|
+
pipelineId: this.id,
|
|
247
|
+
runMetadata: options.metadata,
|
|
248
|
+
abortSignal: options.abortSignal,
|
|
249
|
+
observer: options.observer,
|
|
250
|
+
failOnObserverError: options.failOnObserverError === true,
|
|
251
|
+
observability
|
|
252
|
+
};
|
|
253
|
+
try {
|
|
254
|
+
throwIfAborted(context.abortSignal);
|
|
255
|
+
const output = await this.execute(options.input, context, []);
|
|
256
|
+
throwIfAborted(context.abortSignal);
|
|
257
|
+
await observability.end({
|
|
258
|
+
runId,
|
|
259
|
+
pipelineId: this.id,
|
|
260
|
+
output,
|
|
261
|
+
durationMs: Date.now() - startedAt
|
|
262
|
+
});
|
|
263
|
+
return observability.trace === void 0 ? { runId, output } : { runId, output, trace: observability.trace };
|
|
264
|
+
} catch (error) {
|
|
265
|
+
await observability.error({
|
|
266
|
+
runId,
|
|
267
|
+
pipelineId: this.id,
|
|
268
|
+
status: context.abortSignal?.aborted === true ? "cancelled" : "failed",
|
|
269
|
+
error,
|
|
270
|
+
durationMs: Date.now() - startedAt
|
|
271
|
+
});
|
|
272
|
+
throw error;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async runBatch(options) {
|
|
276
|
+
throwIfAborted(options.abortSignal);
|
|
277
|
+
return mapWithConcurrency([...options.inputs], options.concurrency, async (input) => {
|
|
278
|
+
const runId = globalThis.crypto.randomUUID();
|
|
279
|
+
try {
|
|
280
|
+
const result = await this.run({
|
|
281
|
+
input,
|
|
282
|
+
runId,
|
|
283
|
+
metadata: options.metadata,
|
|
284
|
+
trace: options.trace,
|
|
285
|
+
abortSignal: options.abortSignal,
|
|
286
|
+
observer: options.observer,
|
|
287
|
+
failOnObserverError: options.failOnObserverError
|
|
288
|
+
});
|
|
289
|
+
return { status: "completed", ...result };
|
|
290
|
+
} catch (error) {
|
|
291
|
+
if (options.abortSignal?.aborted === true) {
|
|
292
|
+
throw pipelineAbortError(options.abortSignal);
|
|
293
|
+
}
|
|
294
|
+
return { status: "failed", runId, error };
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
graph() {
|
|
299
|
+
return cloneGraph(withOutputNode(this.state));
|
|
300
|
+
}
|
|
301
|
+
derive(executor, state) {
|
|
302
|
+
return createDerivedPipeline(executor, state, this.observability);
|
|
303
|
+
}
|
|
304
|
+
async execute(input, context, pathPrefix) {
|
|
305
|
+
throwIfAborted(context.abortSignal);
|
|
306
|
+
return await this.executor(input, context, pathPrefix);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
function createDerivedPipeline(executor, state, observability) {
|
|
310
|
+
const options = {
|
|
311
|
+
[internalPipelineOptions]: { executor, state, observability }
|
|
312
|
+
};
|
|
313
|
+
return new Pipeline(options);
|
|
314
|
+
}
|
|
315
|
+
function withPipelineParentTrace(trace, parent, agentPrimaryTrace) {
|
|
316
|
+
if (parent?.traceId === void 0) return trace;
|
|
317
|
+
if (parent.observer !== agentPrimaryTrace) return trace;
|
|
318
|
+
if (trace?.traceId !== void 0 && trace.traceId !== parent.traceId) return trace;
|
|
319
|
+
return {
|
|
320
|
+
...trace,
|
|
321
|
+
traceId: parent.traceId,
|
|
322
|
+
...trace?.parentObservationId !== void 0 || parent.observationId === void 0 ? {} : { parentObservationId: parent.observationId }
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function isInternalPipelineOptions(options) {
|
|
326
|
+
return internalPipelineOptions in options;
|
|
327
|
+
}
|
|
328
|
+
function isZodSchema(value) {
|
|
329
|
+
return value instanceof z.ZodType;
|
|
330
|
+
}
|
|
331
|
+
function normalizePipelineId(id) {
|
|
332
|
+
if (typeof id !== "string") {
|
|
333
|
+
throw new TypeError("Pipeline id must be a string.");
|
|
334
|
+
}
|
|
335
|
+
const normalized = id.trim();
|
|
336
|
+
if (normalized.length === 0) {
|
|
337
|
+
throw new TypeError("Pipeline id must be a non-empty string.");
|
|
338
|
+
}
|
|
339
|
+
return normalized;
|
|
340
|
+
}
|
|
341
|
+
function normalizeRunId(runId) {
|
|
342
|
+
if (typeof runId !== "string") {
|
|
343
|
+
throw new TypeError("Pipeline runId must be a string.");
|
|
344
|
+
}
|
|
345
|
+
const normalized = runId.trim();
|
|
346
|
+
if (normalized.length === 0) {
|
|
347
|
+
throw new TypeError("Pipeline runId must be a non-empty string.");
|
|
348
|
+
}
|
|
349
|
+
return normalized;
|
|
350
|
+
}
|
|
351
|
+
function normalizeParallelBranches(branches) {
|
|
352
|
+
const entries = [];
|
|
353
|
+
const ids = /* @__PURE__ */ new Set();
|
|
354
|
+
for (const key of Object.keys(branches)) {
|
|
355
|
+
const pipeline = branches[key];
|
|
356
|
+
const id = key.trim();
|
|
357
|
+
if (id.length === 0) {
|
|
358
|
+
throw new TypeError("Pipeline parallel branch id must be a non-empty string.");
|
|
359
|
+
}
|
|
360
|
+
if (ids.has(id)) {
|
|
361
|
+
throw new TypeError(`Pipeline parallel branch id "${id}" is already registered.`);
|
|
362
|
+
}
|
|
363
|
+
ids.add(id);
|
|
364
|
+
if (id !== key) {
|
|
365
|
+
throw new TypeError("Pipeline parallel branch ids must not contain surrounding whitespace.");
|
|
366
|
+
}
|
|
367
|
+
entries.push([id, pipeline]);
|
|
368
|
+
}
|
|
369
|
+
return entries;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export {
|
|
373
|
+
Pipeline
|
|
374
|
+
};
|
|
375
|
+
//# sourceMappingURL=chunk-TIZGADU4.js.map
|