@mountaya/elements 0.1.0 → 0.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/CHANGELOG.md +38 -0
- package/README.md +4 -3
- package/THIRD-PARTY-NOTICES.txt +1 -1
- package/dist/agent/index.cjs +1152 -1905
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +1152 -1202
- package/dist/agent/index.d.ts +1152 -1202
- package/dist/agent/index.js +1147 -1903
- package/dist/agent/index.js.map +1 -1
- package/dist/camera/index.cjs +2470 -3435
- package/dist/camera/index.cjs.map +1 -1
- package/dist/camera/index.d.cts +716 -744
- package/dist/camera/index.d.ts +716 -744
- package/dist/camera/index.js +2438 -3323
- package/dist/camera/index.js.map +1 -1
- package/dist/{units-D9mBrusY.d.cts → chunk-5pTPpv4v.d.cts} +38 -41
- package/dist/{units-D9mBrusY.d.ts → chunk-5pTPpv4v.d.ts} +38 -41
- package/dist/{order-BLhsGsH8.d.ts → chunk-6JzFMFHh.d.ts} +15 -28
- package/dist/chunk-6qyuJVvt.d.ts +513 -0
- package/dist/chunk-9fp0lDic.cjs +583 -0
- package/dist/chunk-9fp0lDic.cjs.map +1 -0
- package/dist/{zones-B05QA8fy.d.ts → chunk-A48H1rDg.d.cts} +2 -4
- package/dist/{zones-B05QA8fy.d.cts → chunk-A48H1rDg.d.ts} +2 -4
- package/dist/chunk-B-m1AchR.cjs +57 -0
- package/dist/chunk-B-m1AchR.cjs.map +1 -0
- package/dist/{bundle-xYrrbJTH.d.ts → chunk-B-qFTf04.d.ts} +51 -57
- package/dist/chunk-B0YROiZh.d.cts +1475 -0
- package/dist/chunk-B14wgOvH.d.cts +68 -0
- package/dist/chunk-B19l3j9r.cjs +150 -0
- package/dist/chunk-B19l3j9r.cjs.map +1 -0
- package/dist/chunk-B2PtjVKg.cjs +86 -0
- package/dist/chunk-B2PtjVKg.cjs.map +1 -0
- package/dist/chunk-B56Oyb7W.cjs +70 -0
- package/dist/chunk-B56Oyb7W.cjs.map +1 -0
- package/dist/chunk-B5WGMQwK.cjs +113 -0
- package/dist/chunk-B5WGMQwK.cjs.map +1 -0
- package/dist/{types-nO2joeRk.d.ts → chunk-B98mKrdu.d.cts} +103 -122
- package/dist/{videoOverlay-Dh_D5_Zs.d.ts → chunk-BB0PmqIM.d.cts} +10 -10
- package/dist/chunk-BBikve0Z.cjs +269 -0
- package/dist/chunk-BBikve0Z.cjs.map +1 -0
- package/dist/chunk-BHeXmM0X.js +37 -0
- package/dist/chunk-BHeXmM0X.js.map +1 -0
- package/dist/chunk-BI8WZLpU.cjs +281 -0
- package/dist/chunk-BI8WZLpU.cjs.map +1 -0
- package/dist/chunk-BIEc_SkR.cjs +29 -0
- package/dist/chunk-BIEc_SkR.cjs.map +1 -0
- package/dist/chunk-BJ6L6_W9.cjs +553 -0
- package/dist/chunk-BJ6L6_W9.cjs.map +1 -0
- package/dist/chunk-BJ91UCbB.js +11 -0
- package/dist/chunk-BJ91UCbB.js.map +1 -0
- package/dist/chunk-BJEZWTKj.cjs +166 -0
- package/dist/chunk-BJEZWTKj.cjs.map +1 -0
- package/dist/chunk-BJz54mfg.cjs +10 -0
- package/dist/chunk-BJz54mfg.cjs.map +1 -0
- package/dist/{sections-CVlc2Inr.d.cts → chunk-BNX5LAfN.d.cts} +289 -330
- package/dist/chunk-BP6KgA86.js +35 -0
- package/dist/chunk-BP6KgA86.js.map +1 -0
- package/dist/{segmentRoute-C5UL_5bp.d.ts → chunk-BRnjQq6K.d.cts} +44 -59
- package/dist/chunk-BSiMEwPS.js +46 -0
- package/dist/chunk-BSiMEwPS.js.map +1 -0
- package/dist/chunk-BTPjDw_y.cjs +16 -0
- package/dist/chunk-BTPjDw_y.cjs.map +1 -0
- package/dist/chunk-BTUUABGI.js +17 -0
- package/dist/chunk-BTUUABGI.js.map +1 -0
- package/dist/chunk-BUeL9y7s.cjs +45 -0
- package/dist/chunk-BUeL9y7s.cjs.map +1 -0
- package/dist/chunk-BWMuCNc9.cjs +172 -0
- package/dist/chunk-BWMuCNc9.cjs.map +1 -0
- package/dist/chunk-BWjRfhpF.js +126 -0
- package/dist/chunk-BWjRfhpF.js.map +1 -0
- package/dist/{types-CTQwbSdA.d.cts → chunk-BZ5KyZXI.d.ts} +103 -122
- package/dist/chunk-B_4SVmvh.js +94 -0
- package/dist/chunk-B_4SVmvh.js.map +1 -0
- package/dist/chunk-BcTUuZQ3.js +95 -0
- package/dist/chunk-BcTUuZQ3.js.map +1 -0
- package/dist/chunk-BdkqSsJe.cjs +140 -0
- package/dist/chunk-BdkqSsJe.cjs.map +1 -0
- package/dist/chunk-BfktMVmI.js +70 -0
- package/dist/chunk-BfktMVmI.js.map +1 -0
- package/dist/chunk-BfzQb0EK.cjs +6 -0
- package/dist/chunk-BhWfT-22.d.cts +808 -0
- package/dist/chunk-BjJcqX5J.cjs +60 -0
- package/dist/chunk-BjJcqX5J.cjs.map +1 -0
- package/dist/{geodesy-543qXKtI.d.ts → chunk-Bk0L8g5J.d.cts} +3 -4
- package/dist/{geodesy-543qXKtI.d.cts → chunk-Bk0L8g5J.d.ts} +3 -4
- package/dist/chunk-Bl4_uVa6.cjs +11 -0
- package/dist/chunk-Bl4_uVa6.cjs.map +1 -0
- package/dist/chunk-BlKF4lrp.js +43 -0
- package/dist/chunk-BlKF4lrp.js.map +1 -0
- package/dist/chunk-Bm1FieGR.js +4 -0
- package/dist/chunk-Bm1FieGR.js.map +1 -0
- package/dist/chunk-Bn6ZbxkS.cjs +27 -0
- package/dist/chunk-BpN3hr6a.cjs +541 -0
- package/dist/chunk-BpN3hr6a.cjs.map +1 -0
- package/dist/{order-BZkUwMou.d.cts → chunk-Bq_WHTfd.d.cts} +15 -28
- package/dist/chunk-Bqt4LBBz.cjs +648 -0
- package/dist/chunk-Bqt4LBBz.cjs.map +1 -0
- package/dist/{language-CEWQ5uYw.d.cts → chunk-Bqt97zwf.d.cts} +3 -18
- package/dist/{language-CEWQ5uYw.d.ts → chunk-Bqt97zwf.d.ts} +3 -18
- package/dist/chunk-BsBiN4w6.d.cts +245 -0
- package/dist/chunk-BvTpOUoC.cjs +207 -0
- package/dist/chunk-BvTpOUoC.cjs.map +1 -0
- package/dist/chunk-BwK6Hl3q.cjs +446 -0
- package/dist/chunk-BwK6Hl3q.cjs.map +1 -0
- package/dist/{elevationTiles-pmsb9wnU.d.cts → chunk-BxDQZDXR.d.cts} +26 -27
- package/dist/{elevationTiles-pmsb9wnU.d.ts → chunk-BxDQZDXR.d.ts} +26 -27
- package/dist/chunk-BxUio8kX.js +20 -0
- package/dist/chunk-BxUio8kX.js.map +1 -0
- package/dist/chunk-BxaocpFi.d.cts +1 -0
- package/dist/chunk-Bywi0K1N.js +36 -0
- package/dist/chunk-Bywi0K1N.js.map +1 -0
- package/dist/chunk-C-IlmkDl.js +59 -0
- package/dist/chunk-C-IlmkDl.js.map +1 -0
- package/dist/chunk-C5PtVewq.d.ts +389 -0
- package/dist/chunk-C5dpC7mQ.js +19 -0
- package/dist/chunk-C5dpC7mQ.js.map +1 -0
- package/dist/chunk-C5q1sgSa.js +46 -0
- package/dist/chunk-C5q1sgSa.js.map +1 -0
- package/dist/chunk-C6fU9G5I.cjs +221 -0
- package/dist/chunk-C6fU9G5I.cjs.map +1 -0
- package/dist/chunk-C71dpWUK.js +5 -0
- package/dist/chunk-C71dpWUK.js.map +1 -0
- package/dist/chunk-C82N1gQX.d.ts +1831 -0
- package/dist/chunk-C8HdaHpu.js +118 -0
- package/dist/chunk-C8HdaHpu.js.map +1 -0
- package/dist/chunk-C8ZGryck.js +236 -0
- package/dist/chunk-C8ZGryck.js.map +1 -0
- package/dist/chunk-C95NG0oD.cjs +43 -0
- package/dist/chunk-C95NG0oD.cjs.map +1 -0
- package/dist/chunk-C9aR8DXb.js +9 -0
- package/dist/chunk-C9aR8DXb.js.map +1 -0
- package/dist/{camera-C48Ykaxv.d.ts → chunk-CAUZnoCs.d.ts} +135 -159
- package/dist/chunk-CBXWWuM9.cjs +82 -0
- package/dist/chunk-CBXWWuM9.cjs.map +1 -0
- package/dist/chunk-CC_Kquu7.d.cts +125 -0
- package/dist/chunk-CC_Kquu7.d.ts +125 -0
- package/dist/chunk-CCp85vXg.cjs +60 -0
- package/dist/chunk-CCp85vXg.cjs.map +1 -0
- package/dist/chunk-CEcB1_uK.js +39 -0
- package/dist/chunk-CEcB1_uK.js.map +1 -0
- package/dist/{bundle-Je5zsRFg.d.cts → chunk-CFIo021l.d.cts} +51 -57
- package/dist/chunk-CH_IZoJE.js +33 -0
- package/dist/chunk-CH_IZoJE.js.map +1 -0
- package/dist/chunk-CHrasH_g.cjs +25 -0
- package/dist/chunk-CHrasH_g.cjs.map +1 -0
- package/dist/chunk-CJVoSaAE.cjs +3 -0
- package/dist/chunk-CJp8nGcb.js +96 -0
- package/dist/chunk-CJp8nGcb.js.map +1 -0
- package/dist/chunk-CJwUtkOt.js +112 -0
- package/dist/chunk-CJwUtkOt.js.map +1 -0
- package/dist/chunk-CKhCOVIf.d.cts +751 -0
- package/dist/chunk-CKiVSRYg.js +50 -0
- package/dist/chunk-CKiVSRYg.js.map +1 -0
- package/dist/chunk-CKtd19eD.cjs +59 -0
- package/dist/chunk-CKtd19eD.cjs.map +1 -0
- package/dist/chunk-CL92KE3j.d.ts +3188 -0
- package/dist/chunk-CLqUlkAe.js +54 -0
- package/dist/chunk-CLqUlkAe.js.map +1 -0
- package/dist/chunk-CMG5OV0q.cjs +4741 -0
- package/dist/chunk-CMG5OV0q.cjs.map +1 -0
- package/dist/chunk-CN_TKSgm.js +10 -0
- package/dist/chunk-CN_TKSgm.js.map +1 -0
- package/dist/chunk-CNe6MtqV.cjs +29 -0
- package/dist/chunk-CNe6MtqV.cjs.map +1 -0
- package/dist/chunk-COQkDTC5.js +83 -0
- package/dist/chunk-COQkDTC5.js.map +1 -0
- package/dist/chunk-CPBl6K4M.cjs +168 -0
- package/dist/chunk-CPBl6K4M.cjs.map +1 -0
- package/dist/chunk-CPx0ZYFB.d.ts +3 -0
- package/dist/chunk-CQQhcP_C.d.ts +197 -0
- package/dist/chunk-CTNoajFh.d.cts +389 -0
- package/dist/chunk-CTd-qgJc.cjs +384 -0
- package/dist/chunk-CTd-qgJc.cjs.map +1 -0
- package/dist/chunk-CW80YYtU.cjs +1056 -0
- package/dist/chunk-CW80YYtU.cjs.map +1 -0
- package/dist/{searchLimits-j99-NTXR.d.ts → chunk-CWpqBgkF.d.cts} +2 -2
- package/dist/{searchLimits-j99-NTXR.d.cts → chunk-CWpqBgkF.d.ts} +2 -2
- package/dist/chunk-CXjRArgy.d.ts +3 -0
- package/dist/chunk-CXonfH3-.cjs +14 -0
- package/dist/chunk-CXonfH3-.cjs.map +1 -0
- package/dist/chunk-CYcouGXN.d.ts +825 -0
- package/dist/chunk-CZDAzEBw.cjs +1621 -0
- package/dist/chunk-CZDAzEBw.cjs.map +1 -0
- package/dist/{amenities-B3-qAjxu.d.cts → chunk-C_fQFr70.d.cts} +40 -41
- package/dist/{amenities-B3-qAjxu.d.ts → chunk-C_fQFr70.d.ts} +40 -41
- package/dist/chunk-CbOtHnnB.cjs +359 -0
- package/dist/chunk-CbOtHnnB.cjs.map +1 -0
- package/dist/chunk-CdA6ZMGk.d.cts +825 -0
- package/dist/chunk-Ce1_thm7.js +146 -0
- package/dist/chunk-Ce1_thm7.js.map +1 -0
- package/dist/chunk-CeD8Hw0j.d.cts +3188 -0
- package/dist/{camera-BrFLU1DH.d.cts → chunk-CeiTuMyt.d.cts} +135 -159
- package/dist/chunk-Ch1OLzLi.js +1 -0
- package/dist/chunk-Cizu_j1N.cjs +87 -0
- package/dist/chunk-Cizu_j1N.cjs.map +1 -0
- package/dist/chunk-CjDe9z6A.d.cts +427 -0
- package/dist/chunk-Cl1etdlu.js +63 -0
- package/dist/chunk-Cl1etdlu.js.map +1 -0
- package/dist/chunk-CmoVJDoz.js +4 -0
- package/dist/chunk-CmoVJDoz.js.map +1 -0
- package/dist/chunk-CnLucxjG.cjs +197 -0
- package/dist/chunk-CnLucxjG.cjs.map +1 -0
- package/dist/chunk-CsWjBmdi.cjs +56 -0
- package/dist/chunk-CsWjBmdi.cjs.map +1 -0
- package/dist/chunk-CuseO5MZ.d.cts +3 -0
- package/dist/chunk-CvMHibbA.d.ts +427 -0
- package/dist/chunk-CwDeiN5U.js +870 -0
- package/dist/chunk-CwDeiN5U.js.map +1 -0
- package/dist/chunk-Cwdmx4tG.js +1 -0
- package/dist/{geolocation-DDkQdWMN.d.cts → chunk-D-4MxHTt.d.cts} +33 -34
- package/dist/{geolocation-DDkQdWMN.d.ts → chunk-D-4MxHTt.d.ts} +33 -34
- package/dist/chunk-D0LF-99V.js +1093 -0
- package/dist/chunk-D0LF-99V.js.map +1 -0
- package/dist/chunk-D1fe-0c_.js +367 -0
- package/dist/chunk-D1fe-0c_.js.map +1 -0
- package/dist/chunk-D21fEI6A.d.ts +1926 -0
- package/dist/chunk-D39gAxya.cjs +89 -0
- package/dist/chunk-D39gAxya.cjs.map +1 -0
- package/dist/chunk-D6KdIW5e.cjs +228 -0
- package/dist/chunk-D6KdIW5e.cjs.map +1 -0
- package/dist/chunk-D6qHYbgW.d.cts +36 -0
- package/dist/{videoOverlay-Dh_D5_Zs.d.cts → chunk-D89E-w70.d.ts} +10 -10
- package/dist/chunk-D8bdTysL.js +552 -0
- package/dist/chunk-D8bdTysL.js.map +1 -0
- package/dist/chunk-D96QJT24.cjs +109 -0
- package/dist/chunk-D96QJT24.cjs.map +1 -0
- package/dist/chunk-DAmkQl-i.js +119 -0
- package/dist/chunk-DAmkQl-i.js.map +1 -0
- package/dist/chunk-DEfsb2lc.cjs +10 -0
- package/dist/chunk-DEfsb2lc.cjs.map +1 -0
- package/dist/chunk-DIFjT5-V.d.cts +66 -0
- package/dist/{sections-CmtaduLc.d.ts → chunk-DJpUw8TN.d.ts} +289 -330
- package/dist/chunk-DK6lm2IZ.cjs +11 -0
- package/dist/chunk-DK6lm2IZ.cjs.map +1 -0
- package/dist/chunk-DKqgr31j.cjs +61 -0
- package/dist/chunk-DKqgr31j.cjs.map +1 -0
- package/dist/chunk-DLZ0QYm9.js +37 -0
- package/dist/chunk-DLZ0QYm9.js.map +1 -0
- package/dist/chunk-DLjS0uaC.js +4 -0
- package/dist/chunk-DLjS0uaC.js.map +1 -0
- package/dist/chunk-DMokwmOV.cjs +49 -0
- package/dist/chunk-DMokwmOV.cjs.map +1 -0
- package/dist/chunk-DMvWgBZL.d.cts +1831 -0
- package/dist/chunk-DNfGfIF3.js +31 -0
- package/dist/chunk-DNfGfIF3.js.map +1 -0
- package/dist/chunk-DQbSRe8D.d.ts +245 -0
- package/dist/chunk-DSGkP8_y.js +45 -0
- package/dist/chunk-DSGkP8_y.js.map +1 -0
- package/dist/chunk-DTctvfSd.d.cts +197 -0
- package/dist/chunk-DWe7igyw.cjs +206 -0
- package/dist/chunk-DWe7igyw.cjs.map +1 -0
- package/dist/chunk-DWsMP5JR.d.ts +68 -0
- package/dist/{provider-DM71XnLX.d.cts → chunk-DWsm3HIW.d.cts} +37 -38
- package/dist/{provider-DM71XnLX.d.ts → chunk-DWsm3HIW.d.ts} +37 -38
- package/dist/chunk-DXABHjLa.cjs +3 -0
- package/dist/chunk-D_BeqSbc.cjs +42 -0
- package/dist/chunk-D_BeqSbc.cjs.map +1 -0
- package/dist/chunk-D_svQNdW.d.ts +66 -0
- package/dist/chunk-Dav4xWrp.js +330 -0
- package/dist/chunk-Dav4xWrp.js.map +1 -0
- package/dist/chunk-DbCPhepL.js +293 -0
- package/dist/chunk-DbCPhepL.js.map +1 -0
- package/dist/chunk-DcrTy-y2.cjs +43 -0
- package/dist/chunk-DcrTy-y2.cjs.map +1 -0
- package/dist/chunk-Ddv484ld.js +487 -0
- package/dist/chunk-Ddv484ld.js.map +1 -0
- package/dist/chunk-De0bjnhY.cjs +88 -0
- package/dist/chunk-De0bjnhY.cjs.map +1 -0
- package/dist/chunk-De2FmNPu.cjs +32 -0
- package/dist/chunk-De2FmNPu.cjs.map +1 -0
- package/dist/{segmentRoute-CIo6dR8Y.d.cts → chunk-DeSjQXiI.d.ts} +44 -59
- package/dist/chunk-Den0Ta6C.js +132 -0
- package/dist/chunk-Den0Ta6C.js.map +1 -0
- package/dist/chunk-DiDKEeEa.js +8 -0
- package/dist/chunk-DiDKEeEa.js.map +1 -0
- package/dist/chunk-Dj60k5PU.js +197 -0
- package/dist/chunk-Dj60k5PU.js.map +1 -0
- package/dist/chunk-DjnYQBCN.js +4705 -0
- package/dist/chunk-DjnYQBCN.js.map +1 -0
- package/dist/chunk-Dk9VKvyq.d.ts +1 -0
- package/dist/chunk-Dor1ERI9.cjs +85 -0
- package/dist/chunk-Dor1ERI9.cjs.map +1 -0
- package/dist/chunk-DpMouOoH.js +451 -0
- package/dist/chunk-DpMouOoH.js.map +1 -0
- package/dist/chunk-DposgdNL.cjs +52 -0
- package/dist/chunk-DposgdNL.cjs.map +1 -0
- package/dist/chunk-DqLTG_5Q.d.cts +3 -0
- package/dist/{roadAccess-D_rOE4xW.d.cts → chunk-Dr5MCIpS.d.cts} +5 -28
- package/dist/{roadAccess-D_rOE4xW.d.ts → chunk-Dr5MCIpS.d.ts} +5 -28
- package/dist/chunk-DrudttCC.cjs +4 -0
- package/dist/chunk-DsDYVJQC.js +173 -0
- package/dist/chunk-DsDYVJQC.js.map +1 -0
- package/dist/chunk-Dw8ur6FJ.js +27 -0
- package/dist/chunk-Dw8ur6FJ.js.map +1 -0
- package/dist/chunk-DwG6M_0v.js +64 -0
- package/dist/chunk-DwG6M_0v.js.map +1 -0
- package/dist/chunk-Dy9a5ibO.js +284 -0
- package/dist/chunk-Dy9a5ibO.js.map +1 -0
- package/dist/chunk-DyayZlQJ.js +157 -0
- package/dist/chunk-DyayZlQJ.js.map +1 -0
- package/dist/chunk-DyhJZC2i.js +126 -0
- package/dist/chunk-DyhJZC2i.js.map +1 -0
- package/dist/chunk-F9zBzmmG.cjs +45 -0
- package/dist/chunk-F9zBzmmG.cjs.map +1 -0
- package/dist/chunk-FyCYofv2.js +116 -0
- package/dist/chunk-FyCYofv2.js.map +1 -0
- package/dist/chunk-GHJRjAk2.js +1 -0
- package/dist/chunk-H14isiSf.d.ts +751 -0
- package/dist/chunk-HIJzXoN4.js +7 -0
- package/dist/chunk-HIJzXoN4.js.map +1 -0
- package/dist/chunk-Id_8kRtu.d.ts +36 -0
- package/dist/chunk-KN60yxBQ.js +5 -0
- package/dist/chunk-KN60yxBQ.js.map +1 -0
- package/dist/chunk-NM5yg6bh.cjs +82 -0
- package/dist/chunk-NM5yg6bh.cjs.map +1 -0
- package/dist/chunk-OXr3zJfM.cjs +119 -0
- package/dist/chunk-OXr3zJfM.cjs.map +1 -0
- package/dist/chunk-QGqgNC4z.d.ts +928 -0
- package/dist/chunk-QJBtJrZ0.js +36 -0
- package/dist/chunk-QJBtJrZ0.js.map +1 -0
- package/dist/{routeProfile-BsSUABXv.d.cts → chunk-QKWhxfPv.d.cts} +196 -45
- package/dist/{routeProfile-BKfSfxx6.d.ts → chunk-QKWhxfPv.d.ts} +196 -45
- package/dist/chunk-QXW7b4Ev.d.cts +410 -0
- package/dist/chunk-RHZrxUrM.cjs +39 -0
- package/dist/chunk-RHZrxUrM.cjs.map +1 -0
- package/dist/chunk-RTxe2i66.js +91 -0
- package/dist/chunk-RTxe2i66.js.map +1 -0
- package/dist/chunk-RrKkJb6P.js +16 -0
- package/dist/chunk-RrKkJb6P.js.map +1 -0
- package/dist/chunk-VOJqpcnM.cjs +181 -0
- package/dist/chunk-VOJqpcnM.cjs.map +1 -0
- package/dist/chunk-VljGTrid.js +1 -0
- package/dist/chunk-X3UVwUEK.d.cts +513 -0
- package/dist/chunk-X9K2WChn.cjs +28 -0
- package/dist/chunk-X9K2WChn.cjs.map +1 -0
- package/dist/chunk-YrtOx6oy.js +251 -0
- package/dist/chunk-YrtOx6oy.js.map +1 -0
- package/dist/chunk-bY7ySujI.d.cts +928 -0
- package/dist/chunk-bYf1sBz5.d.cts +11 -0
- package/dist/chunk-bYf1sBz5.d.ts +11 -0
- package/dist/chunk-blfknWoM.d.cts +1926 -0
- package/dist/chunk-blqsohAb.js +113 -0
- package/dist/chunk-blqsohAb.js.map +1 -0
- package/dist/chunk-cDMCjodI.cjs +58 -0
- package/dist/chunk-cDMCjodI.cjs.map +1 -0
- package/dist/chunk-cWjE3qd6.cjs +10 -0
- package/dist/chunk-cWjE3qd6.cjs.map +1 -0
- package/dist/chunk-dfOgV3fu.js +26 -0
- package/dist/chunk-dfOgV3fu.js.map +1 -0
- package/dist/chunk-f9cTwUX1.cjs +125 -0
- package/dist/chunk-f9cTwUX1.cjs.map +1 -0
- package/dist/chunk-fHVYEZs4.cjs +28 -0
- package/dist/chunk-fHVYEZs4.cjs.map +1 -0
- package/dist/chunk-fWRUMgRI.js +22 -0
- package/dist/chunk-fWRUMgRI.js.map +1 -0
- package/dist/{types-BEv8V_8V.d.cts → chunk-fozLXfHY.d.cts} +8 -8
- package/dist/{types-BEv8V_8V.d.ts → chunk-fozLXfHY.d.ts} +8 -8
- package/dist/chunk-gWmB1l3A.cjs +3122 -0
- package/dist/chunk-gWmB1l3A.cjs.map +1 -0
- package/dist/chunk-gbj2R-_w.js +58 -0
- package/dist/chunk-gbj2R-_w.js.map +1 -0
- package/dist/chunk-iIWxsAXd.js +59 -0
- package/dist/chunk-iIWxsAXd.js.map +1 -0
- package/dist/chunk-lItIuOIS.cjs +137 -0
- package/dist/chunk-lItIuOIS.cjs.map +1 -0
- package/dist/chunk-m6Rh4PCe.cjs +798 -0
- package/dist/chunk-m6Rh4PCe.cjs.map +1 -0
- package/dist/chunk-o3IRANDf.cjs +99 -0
- package/dist/chunk-o3IRANDf.cjs.map +1 -0
- package/dist/chunk-obUcg3Sk.d.ts +808 -0
- package/dist/chunk-ohsf-6Rn.js +600 -0
- package/dist/chunk-ohsf-6Rn.js.map +1 -0
- package/dist/chunk-pBleU6Nv.js +3061 -0
- package/dist/chunk-pBleU6Nv.js.map +1 -0
- package/dist/chunk-px4e99cy.js +71 -0
- package/dist/chunk-px4e99cy.js.map +1 -0
- package/dist/chunk-qwYDLeXc.cjs +99 -0
- package/dist/chunk-qwYDLeXc.cjs.map +1 -0
- package/dist/chunk-rF_859Qk.cjs +101 -0
- package/dist/chunk-rF_859Qk.cjs.map +1 -0
- package/dist/chunk-rLJkqJ5j.d.ts +1475 -0
- package/dist/chunk-twQItIRg.cjs +338 -0
- package/dist/chunk-twQItIRg.cjs.map +1 -0
- package/dist/chunk-vnPrMVjY.js +10 -0
- package/dist/chunk-vnPrMVjY.js.map +1 -0
- package/dist/chunk-ws3bVwaS.d.ts +410 -0
- package/dist/chunk-xh3UkuVs.cjs +246 -0
- package/dist/chunk-xh3UkuVs.cjs.map +1 -0
- package/dist/chunk-yMzRr26E.js +153 -0
- package/dist/chunk-yMzRr26E.js.map +1 -0
- package/dist/collab/index.cjs +802 -1254
- package/dist/collab/index.cjs.map +1 -1
- package/dist/collab/index.d.cts +518 -544
- package/dist/collab/index.d.ts +518 -544
- package/dist/collab/index.js +797 -1252
- package/dist/collab/index.js.map +1 -1
- package/dist/data/index.cjs +39 -132
- package/dist/data/index.d.cts +6 -468
- package/dist/data/index.d.ts +6 -468
- package/dist/data/index.js +7 -15
- package/dist/editor/index.cjs +2631 -4424
- package/dist/editor/index.cjs.map +1 -1
- package/dist/editor/index.d.cts +10 -59
- package/dist/editor/index.d.ts +10 -59
- package/dist/editor/index.js +2619 -4403
- package/dist/editor/index.js.map +1 -1
- package/dist/errors/index.cjs +11 -28
- package/dist/errors/index.d.cts +2 -125
- package/dist/errors/index.d.ts +2 -125
- package/dist/errors/index.js +1 -3
- package/dist/geo/index.cjs +68 -232
- package/dist/geo/index.d.cts +6 -821
- package/dist/geo/index.d.ts +6 -821
- package/dist/geo/index.js +11 -15
- package/dist/i18n/fr/index.cjs +329 -334
- package/dist/i18n/fr/index.cjs.map +1 -1
- package/dist/i18n/fr/index.d.cts +3 -10
- package/dist/i18n/fr/index.d.ts +3 -10
- package/dist/i18n/fr/index.js +324 -332
- package/dist/i18n/fr/index.js.map +1 -1
- package/dist/i18n/index.cjs +434 -447
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +152 -111
- package/dist/i18n/index.d.ts +152 -111
- package/dist/i18n/index.js +420 -420
- package/dist/i18n/index.js.map +1 -1
- package/dist/icons/index.cjs +37 -116
- package/dist/icons/index.d.cts +4 -457
- package/dist/icons/index.d.ts +4 -457
- package/dist/icons/index.js +8 -11
- package/dist/index.cjs +515 -1867
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +44 -121
- package/dist/index.d.ts +44 -121
- package/dist/index.js +52 -65
- package/dist/index.js.map +1 -1
- package/dist/layers/index.cjs +83 -318
- package/dist/layers/index.d.cts +3 -1555
- package/dist/layers/index.d.ts +3 -1555
- package/dist/layers/index.js +5 -17
- package/dist/map-client/index.cjs +5 -4
- package/dist/map-client/index.d.cts +6 -1856
- package/dist/map-client/index.d.ts +6 -1856
- package/dist/map-client/index.js +0 -3
- package/dist/maplibre-worker.mjs +4 -4
- package/dist/navigation/index.cjs +584 -671
- package/dist/navigation/index.cjs.map +1 -1
- package/dist/navigation/index.d.cts +191 -272
- package/dist/navigation/index.d.ts +191 -272
- package/dist/navigation/index.js +579 -669
- package/dist/navigation/index.js.map +1 -1
- package/dist/profile/index.cjs +177 -675
- package/dist/profile/index.d.cts +8 -2086
- package/dist/profile/index.d.ts +8 -2086
- package/dist/profile/index.js +10 -18
- package/dist/seams/index.cjs +15 -39
- package/dist/seams/index.d.cts +4 -254
- package/dist/seams/index.d.ts +4 -254
- package/dist/seams/index.js +4 -6
- package/dist/search/index.cjs +39 -147
- package/dist/search/index.d.cts +6 -888
- package/dist/search/index.d.ts +6 -888
- package/dist/search/index.js +3 -14
- package/dist/style/index.cjs +34 -116
- package/dist/style/index.d.cts +5 -538
- package/dist/style/index.d.ts +5 -538
- package/dist/style/index.js +5 -11
- package/dist/testing/index.cjs +432 -617
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +61 -109
- package/dist/testing/index.d.ts +61 -109
- package/dist/testing/index.js +427 -615
- package/dist/testing/index.js.map +1 -1
- package/dist/timezone/index.cjs +1946 -752
- package/dist/timezone/index.cjs.map +1 -1
- package/dist/timezone/index.d.cts +4 -29
- package/dist/timezone/index.d.ts +4 -29
- package/dist/timezone/index.js +1941 -750
- package/dist/timezone/index.js.map +1 -1
- package/dist/units/index.cjs +29 -99
- package/dist/units/index.d.cts +3 -75
- package/dist/units/index.d.ts +3 -75
- package/dist/units/index.js +3 -6
- package/dist/video/index.cjs +1684 -2169
- package/dist/video/index.cjs.map +1 -1
- package/dist/video/index.d.cts +386 -413
- package/dist/video/index.d.ts +386 -413
- package/dist/video/index.js +1678 -2162
- package/dist/video/index.js.map +1 -1
- package/dist/view/index.cjs +6 -42
- package/dist/view/index.d.cts +3 -836
- package/dist/view/index.d.ts +3 -836
- package/dist/view/index.js +1 -34
- package/package.json +12 -12
- package/src/auth/rules/clientHeader.ts +1 -1
- package/src/camera/rules/modes.ts +38 -42
- package/src/camera/rules/routeContent.ts +1 -0
- package/src/collab/index.ts +1 -5
- package/src/compose/engines/mountayaMap.ts +16 -42
- package/src/compose/rules/developmentWarnings.ts +4 -3
- package/src/compose/rules/fitBox.ts +67 -0
- package/src/compose/rules/maplibreWorkerVersion.gen.ts +1 -1
- package/src/compose/rules/maxBounds.ts +5 -5
- package/src/compose/rules/types.ts +4 -11
- package/src/compose/rules/workerUrl.ts +41 -6
- package/src/editing/rules/engine.ts +4 -2
- package/src/editor/engines/viewClient.ts +8 -0
- package/src/editor/rules/contract.ts +1 -6
- package/src/errors/rules/errors.ts +1 -0
- package/src/geo/index.ts +1 -6
- package/src/i18n/index.ts +1 -0
- package/src/i18n/rules/dates.ts +165 -0
- package/src/index.ts +5 -24
- package/src/map-client/rules/mapClient.ts +4 -2
- package/src/profile/rules/scale.ts +1 -5
- package/src/profile/rules/waypointCard.ts +8 -11
- package/src/search/index.ts +3 -18
- package/src/video/index.ts +1 -1
- package/src/video/profileOverlay/rules/contract.ts +1 -3
- package/src/video/rules/videoEncoder.ts +1 -1
- package/dist/accentColor-GNKBD2CW.js +0 -4
- package/dist/accentColor-GNKBD2CW.js.map +0 -1
- package/dist/accentColor-VX2JSMGE.cjs +0 -17
- package/dist/accentColor-VX2JSMGE.cjs.map +0 -1
- package/dist/chunk-23PFRRB6.js +0 -3
- package/dist/chunk-23PFRRB6.js.map +0 -1
- package/dist/chunk-2GI5SAH2.js +0 -71
- package/dist/chunk-2GI5SAH2.js.map +0 -1
- package/dist/chunk-2MQK6A74.js +0 -39
- package/dist/chunk-2MQK6A74.js.map +0 -1
- package/dist/chunk-2RE7R4LD.js +0 -73
- package/dist/chunk-2RE7R4LD.js.map +0 -1
- package/dist/chunk-3JZQKN4O.js +0 -6
- package/dist/chunk-3JZQKN4O.js.map +0 -1
- package/dist/chunk-3NDXVUUI.js +0 -50
- package/dist/chunk-3NDXVUUI.js.map +0 -1
- package/dist/chunk-3R4GFTUM.cjs +0 -59
- package/dist/chunk-3R4GFTUM.cjs.map +0 -1
- package/dist/chunk-3RVUQ6JN.cjs +0 -22
- package/dist/chunk-3RVUQ6JN.cjs.map +0 -1
- package/dist/chunk-4F6BJMJC.cjs +0 -49
- package/dist/chunk-4F6BJMJC.cjs.map +0 -1
- package/dist/chunk-4NWQD4BX.js +0 -132
- package/dist/chunk-4NWQD4BX.js.map +0 -1
- package/dist/chunk-5K2MH3R6.js +0 -10
- package/dist/chunk-5K2MH3R6.js.map +0 -1
- package/dist/chunk-6ACRNQQQ.cjs +0 -8
- package/dist/chunk-6ACRNQQQ.cjs.map +0 -1
- package/dist/chunk-6D26E3IA.js +0 -66
- package/dist/chunk-6D26E3IA.js.map +0 -1
- package/dist/chunk-6ESAW35P.cjs +0 -80
- package/dist/chunk-6ESAW35P.cjs.map +0 -1
- package/dist/chunk-6LIW2A5M.cjs +0 -1176
- package/dist/chunk-6LIW2A5M.cjs.map +0 -1
- package/dist/chunk-6OTTWVCA.js +0 -57
- package/dist/chunk-6OTTWVCA.js.map +0 -1
- package/dist/chunk-6VROJ4UG.js +0 -862
- package/dist/chunk-6VROJ4UG.js.map +0 -1
- package/dist/chunk-6Y7FTGO4.js +0 -23
- package/dist/chunk-6Y7FTGO4.js.map +0 -1
- package/dist/chunk-75I4CG64.js +0 -104
- package/dist/chunk-75I4CG64.js.map +0 -1
- package/dist/chunk-7CUBXHAH.cjs +0 -14
- package/dist/chunk-7CUBXHAH.cjs.map +0 -1
- package/dist/chunk-7GTCURVY.js +0 -52
- package/dist/chunk-7GTCURVY.js.map +0 -1
- package/dist/chunk-7IWOL6AM.cjs +0 -100
- package/dist/chunk-7IWOL6AM.cjs.map +0 -1
- package/dist/chunk-7QN7M667.cjs +0 -151
- package/dist/chunk-7QN7M667.cjs.map +0 -1
- package/dist/chunk-A6KQDKLM.cjs +0 -1197
- package/dist/chunk-A6KQDKLM.cjs.map +0 -1
- package/dist/chunk-A77EA67G.js +0 -354
- package/dist/chunk-A77EA67G.js.map +0 -1
- package/dist/chunk-AFKOABJ4.cjs +0 -7194
- package/dist/chunk-AFKOABJ4.cjs.map +0 -1
- package/dist/chunk-AG6JV5Z2.cjs +0 -183
- package/dist/chunk-AG6JV5Z2.cjs.map +0 -1
- package/dist/chunk-APBK7NMS.js +0 -30
- package/dist/chunk-APBK7NMS.js.map +0 -1
- package/dist/chunk-AWO5YA7A.cjs +0 -33
- package/dist/chunk-AWO5YA7A.cjs.map +0 -1
- package/dist/chunk-AZATU6QW.js +0 -108
- package/dist/chunk-AZATU6QW.js.map +0 -1
- package/dist/chunk-BD2U3WST.cjs +0 -623
- package/dist/chunk-BD2U3WST.cjs.map +0 -1
- package/dist/chunk-BHBEOU6L.cjs +0 -65
- package/dist/chunk-BHBEOU6L.cjs.map +0 -1
- package/dist/chunk-CNOSNYNE.js +0 -8
- package/dist/chunk-CNOSNYNE.js.map +0 -1
- package/dist/chunk-CW3EFR4O.js +0 -12
- package/dist/chunk-CW3EFR4O.js.map +0 -1
- package/dist/chunk-DASVRNBK.js +0 -7187
- package/dist/chunk-DASVRNBK.js.map +0 -1
- package/dist/chunk-DJ6LCKYP.js +0 -42
- package/dist/chunk-DJ6LCKYP.js.map +0 -1
- package/dist/chunk-E5FHQAIO.cjs +0 -45
- package/dist/chunk-E5FHQAIO.cjs.map +0 -1
- package/dist/chunk-EOML5OTY.cjs +0 -360
- package/dist/chunk-EOML5OTY.cjs.map +0 -1
- package/dist/chunk-EP5CASHL.js +0 -613
- package/dist/chunk-EP5CASHL.js.map +0 -1
- package/dist/chunk-EP5OEEVZ.cjs +0 -14
- package/dist/chunk-EP5OEEVZ.cjs.map +0 -1
- package/dist/chunk-EUXI3FGQ.js +0 -150
- package/dist/chunk-EUXI3FGQ.js.map +0 -1
- package/dist/chunk-EWFSHCOS.js +0 -40
- package/dist/chunk-EWFSHCOS.js.map +0 -1
- package/dist/chunk-EX2C5K2T.cjs +0 -25
- package/dist/chunk-EX2C5K2T.cjs.map +0 -1
- package/dist/chunk-FEXWDQIZ.cjs +0 -8
- package/dist/chunk-FEXWDQIZ.cjs.map +0 -1
- package/dist/chunk-FEYBFY7H.cjs +0 -358
- package/dist/chunk-FEYBFY7H.cjs.map +0 -1
- package/dist/chunk-FRGAV6N6.cjs +0 -34
- package/dist/chunk-FRGAV6N6.cjs.map +0 -1
- package/dist/chunk-G5DHP5VF.js +0 -6
- package/dist/chunk-G5DHP5VF.js.map +0 -1
- package/dist/chunk-G5W2UHV2.js +0 -99
- package/dist/chunk-G5W2UHV2.js.map +0 -1
- package/dist/chunk-G7OP7O2C.cjs +0 -39
- package/dist/chunk-G7OP7O2C.cjs.map +0 -1
- package/dist/chunk-GE6CFCAM.cjs +0 -25
- package/dist/chunk-GE6CFCAM.cjs.map +0 -1
- package/dist/chunk-GIFALLHI.cjs +0 -111
- package/dist/chunk-GIFALLHI.cjs.map +0 -1
- package/dist/chunk-GLFET5GM.js +0 -129
- package/dist/chunk-GLFET5GM.js.map +0 -1
- package/dist/chunk-GQ6UFPFM.js +0 -22
- package/dist/chunk-GQ6UFPFM.js.map +0 -1
- package/dist/chunk-GQJWVMXS.js +0 -129
- package/dist/chunk-GQJWVMXS.js.map +0 -1
- package/dist/chunk-GVVJPUKC.js +0 -80
- package/dist/chunk-GVVJPUKC.js.map +0 -1
- package/dist/chunk-GZ2HOCQ2.cjs +0 -134
- package/dist/chunk-GZ2HOCQ2.cjs.map +0 -1
- package/dist/chunk-HCBOHXWP.js +0 -37
- package/dist/chunk-HCBOHXWP.js.map +0 -1
- package/dist/chunk-IBQJDVHF.cjs +0 -281
- package/dist/chunk-IBQJDVHF.cjs.map +0 -1
- package/dist/chunk-ISLB6Y5Q.cjs +0 -106
- package/dist/chunk-ISLB6Y5Q.cjs.map +0 -1
- package/dist/chunk-J55CRR4F.js +0 -105
- package/dist/chunk-J55CRR4F.js.map +0 -1
- package/dist/chunk-JBG6Z6MQ.cjs +0 -28
- package/dist/chunk-JBG6Z6MQ.cjs.map +0 -1
- package/dist/chunk-K3RQOZRU.js +0 -61
- package/dist/chunk-K3RQOZRU.js.map +0 -1
- package/dist/chunk-KDJYS4GB.cjs +0 -703
- package/dist/chunk-KDJYS4GB.cjs.map +0 -1
- package/dist/chunk-KMCAHUZM.cjs +0 -4
- package/dist/chunk-KMCAHUZM.cjs.map +0 -1
- package/dist/chunk-KUCBNPC6.js +0 -87
- package/dist/chunk-KUCBNPC6.js.map +0 -1
- package/dist/chunk-KV6UE5A4.js +0 -50
- package/dist/chunk-KV6UE5A4.js.map +0 -1
- package/dist/chunk-L6TZ2HQR.cjs +0 -18
- package/dist/chunk-L6TZ2HQR.cjs.map +0 -1
- package/dist/chunk-L7QHHGG2.cjs +0 -141
- package/dist/chunk-L7QHHGG2.cjs.map +0 -1
- package/dist/chunk-LHK3Y2AL.js +0 -271
- package/dist/chunk-LHK3Y2AL.js.map +0 -1
- package/dist/chunk-LO5RYRBH.cjs +0 -6317
- package/dist/chunk-LO5RYRBH.cjs.map +0 -1
- package/dist/chunk-LS5SJMUO.cjs +0 -194
- package/dist/chunk-LS5SJMUO.cjs.map +0 -1
- package/dist/chunk-LUGTMZFN.cjs +0 -42
- package/dist/chunk-LUGTMZFN.cjs.map +0 -1
- package/dist/chunk-LVUQU6D5.js +0 -32
- package/dist/chunk-LVUQU6D5.js.map +0 -1
- package/dist/chunk-M2QRC2GZ.js +0 -166
- package/dist/chunk-M2QRC2GZ.js.map +0 -1
- package/dist/chunk-M6QJYQIM.cjs +0 -53
- package/dist/chunk-M6QJYQIM.cjs.map +0 -1
- package/dist/chunk-MGCPH5EO.js +0 -12
- package/dist/chunk-MGCPH5EO.js.map +0 -1
- package/dist/chunk-MLVUWEZR.cjs +0 -474
- package/dist/chunk-MLVUWEZR.cjs.map +0 -1
- package/dist/chunk-MTAMJMZL.cjs +0 -707
- package/dist/chunk-MTAMJMZL.cjs.map +0 -1
- package/dist/chunk-MXL5AT3N.js +0 -48
- package/dist/chunk-MXL5AT3N.js.map +0 -1
- package/dist/chunk-MYEQSESM.cjs +0 -75
- package/dist/chunk-MYEQSESM.cjs.map +0 -1
- package/dist/chunk-N3VPF6ZD.js +0 -427
- package/dist/chunk-N3VPF6ZD.js.map +0 -1
- package/dist/chunk-N6VUAIGI.js +0 -7
- package/dist/chunk-N6VUAIGI.js.map +0 -1
- package/dist/chunk-N6XRLUN6.js +0 -6286
- package/dist/chunk-N6XRLUN6.js.map +0 -1
- package/dist/chunk-NOGDOZIT.cjs +0 -114
- package/dist/chunk-NOGDOZIT.cjs.map +0 -1
- package/dist/chunk-NUWXEISH.cjs +0 -10
- package/dist/chunk-NUWXEISH.cjs.map +0 -1
- package/dist/chunk-NZCZHXYN.cjs +0 -161
- package/dist/chunk-NZCZHXYN.cjs.map +0 -1
- package/dist/chunk-ODROSWQX.cjs +0 -53
- package/dist/chunk-ODROSWQX.cjs.map +0 -1
- package/dist/chunk-OE36AYKG.cjs +0 -82
- package/dist/chunk-OE36AYKG.cjs.map +0 -1
- package/dist/chunk-OLON7MO6.cjs +0 -437
- package/dist/chunk-OLON7MO6.cjs.map +0 -1
- package/dist/chunk-PBUOR2IT.js +0 -277
- package/dist/chunk-PBUOR2IT.js.map +0 -1
- package/dist/chunk-PC2ELXFF.cjs +0 -225
- package/dist/chunk-PC2ELXFF.cjs.map +0 -1
- package/dist/chunk-PCSGXLOC.js +0 -71
- package/dist/chunk-PCSGXLOC.js.map +0 -1
- package/dist/chunk-PFNMP6FQ.js +0 -56
- package/dist/chunk-PFNMP6FQ.js.map +0 -1
- package/dist/chunk-PIWSZTIP.js +0 -690
- package/dist/chunk-PIWSZTIP.js.map +0 -1
- package/dist/chunk-PKWHJ2GI.js +0 -136
- package/dist/chunk-PKWHJ2GI.js.map +0 -1
- package/dist/chunk-PLMVBX2A.cjs +0 -76
- package/dist/chunk-PLMVBX2A.cjs.map +0 -1
- package/dist/chunk-PM3XCD2G.cjs +0 -113
- package/dist/chunk-PM3XCD2G.cjs.map +0 -1
- package/dist/chunk-QAL4GZO7.cjs +0 -143
- package/dist/chunk-QAL4GZO7.cjs.map +0 -1
- package/dist/chunk-QDB2SEA2.js +0 -74
- package/dist/chunk-QDB2SEA2.js.map +0 -1
- package/dist/chunk-QOV7UNUN.js +0 -25
- package/dist/chunk-QOV7UNUN.js.map +0 -1
- package/dist/chunk-QQUWYLSF.cjs +0 -50
- package/dist/chunk-QQUWYLSF.cjs.map +0 -1
- package/dist/chunk-QUMBH3U4.cjs +0 -9
- package/dist/chunk-QUMBH3U4.cjs.map +0 -1
- package/dist/chunk-R4KA7OFQ.js +0 -12
- package/dist/chunk-R4KA7OFQ.js.map +0 -1
- package/dist/chunk-RBSGAZQQ.js +0 -17
- package/dist/chunk-RBSGAZQQ.js.map +0 -1
- package/dist/chunk-RM5YJWZI.js +0 -46
- package/dist/chunk-RM5YJWZI.js.map +0 -1
- package/dist/chunk-ROKNKXA4.cjs +0 -8
- package/dist/chunk-ROKNKXA4.cjs.map +0 -1
- package/dist/chunk-RQG6D546.cjs +0 -75
- package/dist/chunk-RQG6D546.cjs.map +0 -1
- package/dist/chunk-SG4YDD5L.cjs +0 -74
- package/dist/chunk-SG4YDD5L.cjs.map +0 -1
- package/dist/chunk-SNRCA7EO.js +0 -56
- package/dist/chunk-SNRCA7EO.js.map +0 -1
- package/dist/chunk-SO75R4WW.cjs +0 -22
- package/dist/chunk-SO75R4WW.cjs.map +0 -1
- package/dist/chunk-SP34NHFI.js +0 -45
- package/dist/chunk-SP34NHFI.js.map +0 -1
- package/dist/chunk-SSKSSBWJ.cjs +0 -179
- package/dist/chunk-SSKSSBWJ.cjs.map +0 -1
- package/dist/chunk-TB5663C2.js +0 -1108
- package/dist/chunk-TB5663C2.js.map +0 -1
- package/dist/chunk-TGH4NRES.js +0 -220
- package/dist/chunk-TGH4NRES.js.map +0 -1
- package/dist/chunk-TJ6ZPNID.js +0 -189
- package/dist/chunk-TJ6ZPNID.js.map +0 -1
- package/dist/chunk-U45T35N2.cjs +0 -90
- package/dist/chunk-U45T35N2.cjs.map +0 -1
- package/dist/chunk-UKVOPEZ2.js +0 -442
- package/dist/chunk-UKVOPEZ2.js.map +0 -1
- package/dist/chunk-UTB4NROA.cjs +0 -887
- package/dist/chunk-UTB4NROA.cjs.map +0 -1
- package/dist/chunk-UTW33B5V.js +0 -6
- package/dist/chunk-UTW33B5V.js.map +0 -1
- package/dist/chunk-UYUBSD2V.cjs +0 -33
- package/dist/chunk-UYUBSD2V.cjs.map +0 -1
- package/dist/chunk-V3JEP5AG.cjs +0 -59
- package/dist/chunk-V3JEP5AG.cjs.map +0 -1
- package/dist/chunk-VFAGJXHR.js +0 -18
- package/dist/chunk-VFAGJXHR.js.map +0 -1
- package/dist/chunk-VMEE57E5.cjs +0 -58
- package/dist/chunk-VMEE57E5.cjs.map +0 -1
- package/dist/chunk-VQVBEX3Y.cjs +0 -113
- package/dist/chunk-VQVBEX3Y.cjs.map +0 -1
- package/dist/chunk-VZDXX7TT.cjs +0 -64
- package/dist/chunk-VZDXX7TT.cjs.map +0 -1
- package/dist/chunk-WE5ZTI4D.js +0 -346
- package/dist/chunk-WE5ZTI4D.js.map +0 -1
- package/dist/chunk-WEFUVABP.js +0 -19
- package/dist/chunk-WEFUVABP.js.map +0 -1
- package/dist/chunk-WMU4LRKC.js +0 -28
- package/dist/chunk-WMU4LRKC.js.map +0 -1
- package/dist/chunk-WQ24RRHL.cjs +0 -354
- package/dist/chunk-WQ24RRHL.cjs.map +0 -1
- package/dist/chunk-WW4CGS7G.cjs +0 -26
- package/dist/chunk-WW4CGS7G.cjs.map +0 -1
- package/dist/chunk-WXE5WCTM.js +0 -1144
- package/dist/chunk-WXE5WCTM.js.map +0 -1
- package/dist/chunk-X23BGIYA.cjs +0 -37
- package/dist/chunk-X23BGIYA.cjs.map +0 -1
- package/dist/chunk-XEW4FTR2.js +0 -98
- package/dist/chunk-XEW4FTR2.js.map +0 -1
- package/dist/chunk-XIOI4IYW.js +0 -167
- package/dist/chunk-XIOI4IYW.js.map +0 -1
- package/dist/chunk-XLVPJ37V.cjs +0 -44
- package/dist/chunk-XLVPJ37V.cjs.map +0 -1
- package/dist/chunk-XOHAXXZA.cjs +0 -51
- package/dist/chunk-XOHAXXZA.cjs.map +0 -1
- package/dist/chunk-Y4NRIHK6.cjs +0 -313
- package/dist/chunk-Y4NRIHK6.cjs.map +0 -1
- package/dist/chunk-Y4YMMKL3.js +0 -23
- package/dist/chunk-Y4YMMKL3.js.map +0 -1
- package/dist/chunk-YJNYBVE3.cjs +0 -14
- package/dist/chunk-YJNYBVE3.cjs.map +0 -1
- package/dist/chunk-Z762QNQP.cjs +0 -60
- package/dist/chunk-Z762QNQP.cjs.map +0 -1
- package/dist/chunk-ZG5KMBOF.js +0 -669
- package/dist/chunk-ZG5KMBOF.js.map +0 -1
- package/dist/chunk-ZKONQEFA.js +0 -344
- package/dist/chunk-ZKONQEFA.js.map +0 -1
- package/dist/chunk-ZR5X7QMH.js +0 -39
- package/dist/chunk-ZR5X7QMH.js.map +0 -1
- package/dist/chunk-ZW4BJQ26.js +0 -84
- package/dist/chunk-ZW4BJQ26.js.map +0 -1
- package/dist/climbs-BhlWuu0x.d.ts +0 -70
- package/dist/climbs-DgBFwySV.d.cts +0 -70
- package/dist/data/index.cjs.map +0 -1
- package/dist/data/index.js.map +0 -1
- package/dist/errors/index.cjs.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/geo/index.cjs.map +0 -1
- package/dist/geo/index.js.map +0 -1
- package/dist/icons/index.cjs.map +0 -1
- package/dist/icons/index.js.map +0 -1
- package/dist/itinerary-Dp2ZnqgD.d.cts +0 -178
- package/dist/itinerary-Dp2ZnqgD.d.ts +0 -178
- package/dist/layers/index.cjs.map +0 -1
- package/dist/layers/index.js.map +0 -1
- package/dist/map-client/index.cjs.map +0 -1
- package/dist/map-client/index.js.map +0 -1
- package/dist/markerSprite-DGBQF6PO.cjs +0 -49
- package/dist/markerSprite-DGBQF6PO.cjs.map +0 -1
- package/dist/markerSprite-DZLTR6F6.js +0 -8
- package/dist/markerSprite-DZLTR6F6.js.map +0 -1
- package/dist/mountayaMap-C9mxRFib.d.cts +0 -3277
- package/dist/mountayaMap-DgnlQ2fE.d.ts +0 -3277
- package/dist/paint-BgUcj8l7.d.cts +0 -118
- package/dist/paint-Dx_qGNE_.d.ts +0 -118
- package/dist/profile/index.cjs.map +0 -1
- package/dist/profile/index.js.map +0 -1
- package/dist/seams/index.cjs.map +0 -1
- package/dist/seams/index.js.map +0 -1
- package/dist/search/index.cjs.map +0 -1
- package/dist/search/index.js.map +0 -1
- package/dist/searchHighlight-DFE7LVIL.cjs +0 -33
- package/dist/searchHighlight-DFE7LVIL.cjs.map +0 -1
- package/dist/searchHighlight-MHAQZVWG.js +0 -12
- package/dist/searchHighlight-MHAQZVWG.js.map +0 -1
- package/dist/strings-30RSdIat.d.cts +0 -552
- package/dist/strings-DPTIbzT5.d.ts +0 -552
- package/dist/stripeImage-CQUXM2YI.js +0 -14
- package/dist/stripeImage-CQUXM2YI.js.map +0 -1
- package/dist/stripeImage-R43OPA6U.cjs +0 -39
- package/dist/stripeImage-R43OPA6U.cjs.map +0 -1
- package/dist/style/index.cjs.map +0 -1
- package/dist/style/index.js.map +0 -1
- package/dist/types-B034JMjl.d.ts +0 -973
- package/dist/types-B2NDLxQA.d.cts +0 -21
- package/dist/types-B2NDLxQA.d.ts +0 -21
- package/dist/types-C8aX5KMU.d.cts +0 -973
- package/dist/units/index.cjs.map +0 -1
- package/dist/units/index.js.map +0 -1
- package/dist/view/index.cjs.map +0 -1
- package/dist/view/index.js.map +0 -1
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AgentClientToolManifest,
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { AgentClientToolManifest, AgentRunProfile, AgentRunReason, AgentToolErrorCode } from "@mountaya/client";
|
|
2
|
+
import { AgentEvent, AgentTransport } from "@mountaya/client/events";
|
|
4
3
|
/**
|
|
5
4
|
* What the agent loop needs from a tool layer, and nothing more.
|
|
6
5
|
*
|
|
@@ -25,17 +24,17 @@ import { AgentTransport, AgentEvent } from '@mountaya/client/events';
|
|
|
25
24
|
* the API already states.
|
|
26
25
|
*/
|
|
27
26
|
interface ToolManifestEntry {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
capability: string;
|
|
28
|
+
description: string;
|
|
29
|
+
inputSchema: AgentClientToolManifest["parameters"];
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the tool only reads state and changes nothing. Absent means unknown, which every
|
|
33
|
+
* consumer must treat as "may mutate": a run uses it to decide what its transcript may safely
|
|
34
|
+
* drop, and guessing wrong there erases the record of a real change.
|
|
35
|
+
*/
|
|
36
|
+
readOnly?: boolean | undefined;
|
|
37
|
+
requiresConfirmation: boolean;
|
|
39
38
|
}
|
|
40
39
|
/**
|
|
41
40
|
* ToolDispatchResult is the outcome of one dispatched tool call, as the loop reads it.
|
|
@@ -45,13 +44,13 @@ interface ToolManifestEntry {
|
|
|
45
44
|
* `code`. The loop branches on `confirmation-denied` and forwards everything else verbatim.
|
|
46
45
|
*/
|
|
47
46
|
type ToolDispatchResult = {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
data?: unknown;
|
|
48
|
+
ok: true;
|
|
49
|
+
summary: string;
|
|
51
50
|
} | {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
code?: string | undefined;
|
|
52
|
+
error: string;
|
|
53
|
+
ok: false;
|
|
55
54
|
};
|
|
56
55
|
/**
|
|
57
56
|
* ToolDispatcher is the tool layer the loop drives: what is on offer, and how to run one.
|
|
@@ -62,8 +61,8 @@ type ToolDispatchResult = {
|
|
|
62
61
|
* never touches a store, a map or a transport of its own.
|
|
63
62
|
*/
|
|
64
63
|
interface ToolDispatcher<TContext> {
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
manifest(capabilities: ReadonlySet<string>, surface?: ReadonlySet<string>): ToolManifestEntry[];
|
|
65
|
+
dispatchFromModel(context: TContext, name: string, input: unknown): Promise<ToolDispatchResult>;
|
|
67
66
|
}
|
|
68
67
|
/**
|
|
69
68
|
* AgentToolContext is the part of a host's execution context the loop itself reads.
|
|
@@ -74,7 +73,7 @@ interface ToolDispatcher<TContext> {
|
|
|
74
73
|
* the manifest, and what is on offer is a function of what the reader may do.
|
|
75
74
|
*/
|
|
76
75
|
interface AgentToolContext {
|
|
77
|
-
|
|
76
|
+
capabilities: ReadonlySet<string>;
|
|
78
77
|
}
|
|
79
78
|
/**
|
|
80
79
|
* StateDelta is how a host says what its own state did while a tool ran.
|
|
@@ -90,8 +89,8 @@ interface AgentToolContext {
|
|
|
90
89
|
* report rather than an error.
|
|
91
90
|
*/
|
|
92
91
|
interface StateDelta<TContext, TSnapshot = unknown> {
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
capture(context: TContext): TSnapshot;
|
|
93
|
+
diff(before: TSnapshot, after: TSnapshot): Record<string, unknown> | undefined;
|
|
95
94
|
}
|
|
96
95
|
/**
|
|
97
96
|
* RecoveryLookup answers "a call to this tool failed with this code: what should the model try
|
|
@@ -101,45 +100,6 @@ interface StateDelta<TContext, TSnapshot = unknown> {
|
|
|
101
100
|
* failure is reported bare.
|
|
102
101
|
*/
|
|
103
102
|
type RecoveryLookup = (tool: string, code?: string) => string | undefined;
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Driving one co-pilot run from open to settled.
|
|
107
|
-
*
|
|
108
|
-
* The engine owns the stream and nothing else owns any of it: it opens the run's event stream,
|
|
109
|
-
* folds every frame into the conversation, dispatches the client tools that arrive on it,
|
|
110
|
-
* resumes after a drop from the last event id, backs off when an open is unproductive, and
|
|
111
|
-
* tears down exactly what it stood up.
|
|
112
|
-
*
|
|
113
|
-
* **It is not the collaboration session wearing a different name, and the two are deliberately
|
|
114
|
-
* not one engine.** They look alike from a distance (both open a stream, resume it, back off
|
|
115
|
-
* and dispose), and the halves that genuinely ARE shared already are: `@mountaya/client/events`
|
|
116
|
-
* publishes the reader, the frame decoding and the event types, which both sides import rather
|
|
117
|
-
* than restate, and both draw the wait before a reopen through `reconnectDelayMs`
|
|
118
|
-
* (`stream/rules/reconnectSchedule.ts`), full jitter below a ceiling that doubles. What is left is
|
|
119
|
-
* POLICY, and the policies disagree on every number and on the rule behind each one, because one
|
|
120
|
-
* has a person waiting on it and the other does not.
|
|
121
|
-
*
|
|
122
|
-
* Here: a ceiling that doubles to 8 seconds, and six attempts, because someone is sitting in
|
|
123
|
-
* front of the run: it must never spend a minute asleep, and it must stop rather than re-open a
|
|
124
|
-
* stream nothing can revive for as long as the tab is open. A reconnect is judged by whether the
|
|
125
|
-
* open was PRODUCTIVE, since a gateway that says one thing and hangs up delivers a frame every
|
|
126
|
-
* time. A read that fails reopens only when the next open can outlive the failure: a dropped
|
|
127
|
-
* connection, a 429, a 503 or a 504. A run the provider's rate limit already ended is answered
|
|
128
|
-
* 409, which every reopen would meet again, and a 502 is never reopened either. The 503 is the
|
|
129
|
-
* one failure the six attempts do not count: it says the run's events cannot be reached for a
|
|
130
|
-
* moment while the run goes on, so its opens are held to two minutes, which is still a bound.
|
|
131
|
-
*
|
|
132
|
-
* There: a ceiling that doubles from half a second to 15 seconds, and no attempt limit, because a
|
|
133
|
-
* collaboration feed is background and a persistently-unreachable endpoint should keep trying at
|
|
134
|
-
* a steady rate; and a stream that delivered more than the frames every open begins with
|
|
135
|
-
* reconnects with NO delay, so a healthy feed the API cycles between windows resumes promptly.
|
|
136
|
-
*
|
|
137
|
-
* A shared core beyond the draw would have to be parameterised by the ceiling, the growth seed,
|
|
138
|
-
* the attempt limit, the productivity rule and the resume key, which is every line that differs,
|
|
139
|
-
* and would leave behind two configuration objects and one indirection for the few lines of a read
|
|
140
|
-
* loop the two files have in common.
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
103
|
/**
|
|
144
104
|
* ServerToolConfirmation describes a destructive SERVER tool the gateway asks to
|
|
145
105
|
* run: the run identifies it by name alone (a server tool has no client-side
|
|
@@ -148,7 +108,7 @@ type RecoveryLookup = (tool: string, code?: string) => string | undefined;
|
|
|
148
108
|
* is why this stays decoupled from the bus's client-tool ConfirmationRequest.
|
|
149
109
|
*/
|
|
150
110
|
interface ServerToolConfirmation {
|
|
151
|
-
|
|
111
|
+
name: string;
|
|
152
112
|
}
|
|
153
113
|
/**
|
|
154
114
|
* ToolActivityOutcome is how a tool call settled, delivered through
|
|
@@ -161,23 +121,23 @@ interface ServerToolConfirmation {
|
|
|
161
121
|
* the host recorded and one it never saw a call for.
|
|
162
122
|
*/
|
|
163
123
|
interface ToolActivityOutcome {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
124
|
+
error?: string | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* Why an abandoned call was given up on: `timeout` when nothing came back within
|
|
127
|
+
* the await window, `closed` when the run was asked to finish while the call was
|
|
128
|
+
* still outstanding. Absent on any other status, and on a gateway that does not
|
|
129
|
+
* send one.
|
|
130
|
+
*/
|
|
131
|
+
abandonedReason?: "timeout" | "closed" | undefined;
|
|
132
|
+
/**
|
|
133
|
+
* What the run will try about this failure, from the tool's playbook entry.
|
|
134
|
+
* Present only on a failure the playbook has guidance for. The run already sends
|
|
135
|
+
* this to the model; surfacing it to the host too is what stops a silent retry
|
|
136
|
+
* reading as a stall.
|
|
137
|
+
*/
|
|
138
|
+
recovery?: string | undefined;
|
|
139
|
+
status: "abandoned" | "error" | "ok";
|
|
140
|
+
summary?: string | undefined;
|
|
181
141
|
}
|
|
182
142
|
/**
|
|
183
143
|
* AgentObserver is the host's window onto a running session. The engine pushes
|
|
@@ -191,118 +151,118 @@ interface ToolActivityOutcome {
|
|
|
191
151
|
* the tool surface, the state delta) ends the read instead.
|
|
192
152
|
*/
|
|
193
153
|
interface AgentObserver {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
154
|
+
/**
|
|
155
|
+
* onError surfaces an error or budget-exhausted event so the host can show it.
|
|
156
|
+
* `code` is the machine-readable reason every run error carries (e.g.
|
|
157
|
+
* `rate-limited`), or the literal `budget-exhausted` for a budget ceiling, in
|
|
158
|
+
* which case `message` carries the exhausted dimension (`turns` / `cost`) rather
|
|
159
|
+
* than a human string. It is absent only for a fault the engine raises itself,
|
|
160
|
+
* such as a tool result it could not post, whose message is empty. This lets the
|
|
161
|
+
* host map a known code to specific copy (a budget code to per-dimension
|
|
162
|
+
* usage-limit copy) and fall back to a generic message otherwise.
|
|
163
|
+
*
|
|
164
|
+
* It never ends the run. The gateway publishes an `error` or a `budget-exhausted` only
|
|
165
|
+
* as the run ends and always follows it with the terminal `done`, which is what ends the
|
|
166
|
+
* run and reaches {@link onRunEnd}.
|
|
167
|
+
*/
|
|
168
|
+
onError?: ((message: string, code?: string) => void) | undefined;
|
|
169
|
+
/**
|
|
170
|
+
* onRunEnd reports how a run ended, read off its terminal `done` frame: `completed`,
|
|
171
|
+
* `closed`, `failed`, `budget-exhausted`, `rate-limited` or `looping`. It fires at most
|
|
172
|
+
* once per read of a run, which one {@link AgentEngine.start} or {@link AgentEngine.resume}
|
|
173
|
+
* makes, before `onStateChange("ended")`. A resume that reads the `done` of a run already
|
|
174
|
+
* read to its end reports it again: one by an engine that holds no position for the run,
|
|
175
|
+
* which is answered with the run's history, or one given a position before the `done`.
|
|
176
|
+
*
|
|
177
|
+
* Only `done` knows the reason, so a read that ends any other way reports none: a
|
|
178
|
+
* {@link AgentEngine.close} or {@link AgentEngine.dispose}, a start or a resume that
|
|
179
|
+
* replaces the run, and a stream the engine stopped reconnecting to without a `done`.
|
|
180
|
+
* Optional: a host that needs only the `ended`
|
|
181
|
+
* state omits it.
|
|
182
|
+
*/
|
|
183
|
+
onRunEnd?: ((reason: AgentRunReason) => void) | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* onChecksUnmet reports the success criteria a run's retrieved skills promised
|
|
186
|
+
* that the workspace does not back, published by the run right before it settles
|
|
187
|
+
* into awaiting_input. Informational, never terminal: the answer stands and the
|
|
188
|
+
* user decides. The sentences are the authored criteria, written for the user.
|
|
189
|
+
* Optional: a host that does not render the warning omits it.
|
|
190
|
+
*/
|
|
191
|
+
onChecksUnmet?: ((unmet: readonly string[]) => void) | undefined;
|
|
192
|
+
/**
|
|
193
|
+
* onMessage delivers a complete assistant message (the turn's settled text) with
|
|
194
|
+
* the message's zero-based position among the run's assistant messages.
|
|
195
|
+
*
|
|
196
|
+
* The index is the number a rating on this message has to carry back, and it comes
|
|
197
|
+
* from the run because a host cannot work it out. A host counts the replies it is
|
|
198
|
+
* showing, and a reload mid-run leaves it showing none (the URL carries the thread
|
|
199
|
+
* and run ids, not the conversation), so a locally counted index restarts at zero
|
|
200
|
+
* while the run's is already higher, and every rating from then on names an earlier
|
|
201
|
+
* answer than the one that was rated.
|
|
202
|
+
*
|
|
203
|
+
* It is undefined for a message from a gateway that sends no index, in which case
|
|
204
|
+
* the host falls back to its own count for that message alone.
|
|
205
|
+
*/
|
|
206
|
+
onMessage?: ((content: string, messageIndex?: number) => void) | undefined;
|
|
207
|
+
/** onMessageDelta delivers one streamed assistant token as it arrives. */
|
|
208
|
+
onMessageDelta?: ((text: string) => void) | undefined;
|
|
209
|
+
/**
|
|
210
|
+
* onRunId reports the run's id the moment start/resume sets it, so the host can
|
|
211
|
+
* persist it (e.g. into the URL) for a reload to reconnect.
|
|
212
|
+
*/
|
|
213
|
+
onRunId?: ((runId: string) => void) | undefined;
|
|
214
|
+
/** onStateChange reports the session's lifecycle transitions to the host. */
|
|
215
|
+
onStateChange?: ((state: AgentEngineState) => void) | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* onToolActivity surfaces what the run is doing right now so the host can show
|
|
218
|
+
* a live activity line. The session emits the dispatched CLIENT tool's name as
|
|
219
|
+
* it begins, then the tool's result summary (when the bus returns one) as it
|
|
220
|
+
* settles, so the line tracks the action from start to finish. Optional: a host
|
|
221
|
+
* that does not render activity omits it.
|
|
222
|
+
*/
|
|
223
|
+
onToolActivity?: ((summary: string) => void) | undefined;
|
|
224
|
+
/**
|
|
225
|
+
* onToolCall delivers a client tool call's name, its raw unvalidated input, and
|
|
226
|
+
* the call's id the moment the run emits it: the structured twin of
|
|
227
|
+
* {@link onToolActivity}, which carries only the human display string. A host reads
|
|
228
|
+
* this to react to WHAT the tool will touch (deriving the workspace target an edit is
|
|
229
|
+
* about to lock from the input) and to record the call as a durable activity row
|
|
230
|
+
* keyed by its id, which {@link onToolResult} later settles. The display line
|
|
231
|
+
* cannot carry the structured input or the id. Fires before the bus dispatch,
|
|
232
|
+
* alongside onToolActivity. Optional: a host that renders only the activity line
|
|
233
|
+
* omits it.
|
|
234
|
+
*/
|
|
235
|
+
onToolCall?: ((name: string, input: unknown, toolCallId: string) => void) | undefined;
|
|
236
|
+
/**
|
|
237
|
+
* onToolResult reports how a tool call settled, keyed by its call id, so a host
|
|
238
|
+
* that recorded the call through onToolCall can settle that activity row. A CLIENT
|
|
239
|
+
* tool call the engine ran is reported once, from the bus result as the dispatch
|
|
240
|
+
* returns. Every other call is reported from the `tool-result` or `tool-abandoned`
|
|
241
|
+
* event the stream carries for it: a SERVER tool's outcome, a call the run gave up
|
|
242
|
+
* on, and the outcome replayed behind a call the stream marks `settled`. Optional:
|
|
243
|
+
* a host that renders only the activity line omits it.
|
|
244
|
+
*
|
|
245
|
+
* The stream names a call the engine ran a second time: the gateway echoes the
|
|
246
|
+
* answer the engine posted as a `tool-result`, and a `tool-abandoned` can cross an
|
|
247
|
+
* answer that came late. For a call it reported, the engine drops both whole, in the
|
|
248
|
+
* read that ran the call and in every later read of the run, so the bus result is the
|
|
249
|
+
* one report. An echo says less than the bus did: it carries no summary, and it words
|
|
250
|
+
* a confirmation the user declined as an error. A call whose handling threw before the
|
|
251
|
+
* report (the tool layer, or one of the host's seams) has no report of the engine's,
|
|
252
|
+
* so what the stream says about it is delivered. What the stream says of a call while its
|
|
253
|
+
* tool still runs, in a read a {@link AgentEngine.resume} opened beside it, is held until
|
|
254
|
+
* the tool settles: the bus result is then the one report, and the first thing the stream
|
|
255
|
+
* said is delivered only when the handling throws.
|
|
256
|
+
*
|
|
257
|
+
* The id may be one the host never saw a call for, which the host settles by
|
|
258
|
+
* appending an already-settled row: a server tool's, which emits no call event, or
|
|
259
|
+
* a call the stream marks settled, whose `tool-call` frame the engine drops before
|
|
260
|
+
* it reports the outcome replayed behind it. The id may also be one already reported: a failed
|
|
261
|
+
* `tool-result` follows the `tool-abandoned` of a confirmation nobody decided, and
|
|
262
|
+
* a resumed stream replays an outcome. The first report is the one to keep, which
|
|
263
|
+
* is what `settleActivityEntry` does.
|
|
264
|
+
*/
|
|
265
|
+
onToolResult?: ((toolCallId: string, outcome: ToolActivityOutcome) => void) | undefined;
|
|
306
266
|
}
|
|
307
267
|
/**
|
|
308
268
|
* AgentEngineState is the session lifecycle the host renders against: it is
|
|
@@ -326,10 +286,10 @@ type AgentEngineState = "running" | "awaiting_input" | "ended";
|
|
|
326
286
|
* left it, and the gateway replays nothing the host already holds.
|
|
327
287
|
*/
|
|
328
288
|
interface AgentStreamPosition {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
289
|
+
/** The position, as the stream spelled it: what a reopen sends back as `Last-Event-ID`. */
|
|
290
|
+
readonly lastEventId: string;
|
|
291
|
+
/** The run the position belongs to. A position names nothing in another run. */
|
|
292
|
+
readonly runId: string;
|
|
333
293
|
}
|
|
334
294
|
/**
|
|
335
295
|
* AgentEngineConfig wires a session to the tool bus and its execution context, the
|
|
@@ -347,49 +307,49 @@ interface AgentStreamPosition {
|
|
|
347
307
|
* what the model can SEE; the capability gate remains the sole authorization boundary.
|
|
348
308
|
*/
|
|
349
309
|
interface AgentEngineConfig<TContext extends AgentToolContext = AgentToolContext> {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
310
|
+
bus: ToolDispatcher<TContext>;
|
|
311
|
+
confirmServerTool: (confirmation: ServerToolConfirmation) => Promise<boolean>;
|
|
312
|
+
ctx: TContext;
|
|
313
|
+
observer: AgentObserver;
|
|
314
|
+
/**
|
|
315
|
+
* How the host reports what its own state did while a tool ran, and what to try after a
|
|
316
|
+
* failure. Both are OPTIONAL and both are the host's policy rather than the loop's:
|
|
317
|
+
* `@mountaya/studio` passes its store fingerprint and its routing tables, a host wiring their
|
|
318
|
+
* own tools passes neither and a run reports the tool result bare.
|
|
319
|
+
*/
|
|
320
|
+
recoveryFor?: RecoveryLookup | undefined;
|
|
321
|
+
stateDelta?: StateDelta<TContext> | undefined;
|
|
322
|
+
/**
|
|
323
|
+
* Prompt profile the run opens with. Omitted means the full studio co-pilot.
|
|
324
|
+
* It belongs on the session rather than on start() because it is a property of
|
|
325
|
+
* the SURFACE, not of a message: a Video Director session is a director for its
|
|
326
|
+
* whole life.
|
|
327
|
+
*/
|
|
328
|
+
profile?: AgentRunProfile | undefined;
|
|
329
|
+
/**
|
|
330
|
+
* Whether a run names the server tools the model sees, from the selection `toolSurface`
|
|
331
|
+
* answers: the routed set rides a start's `server_tools` and every routing update's.
|
|
332
|
+
*
|
|
333
|
+
* Off by default, and off under a publishable key, the credential a run is started with: a
|
|
334
|
+
* run under a key calls no server tool, and the API refuses a start or an update that names
|
|
335
|
+
* any. The engine then sends no `server_tools` at all, and routes the client tools alone.
|
|
336
|
+
* Turn it on only for a credential the API lets a run's model reach the server tools under:
|
|
337
|
+
* on under a publishable key, the transport `createAgentTransport` builds refuses the start
|
|
338
|
+
* before it is sent, with a `MountayaConfigurationError` naming this option, which the start
|
|
339
|
+
* rejects with.
|
|
340
|
+
*
|
|
341
|
+
* @default false
|
|
342
|
+
*/
|
|
343
|
+
routesServerTools?: boolean | undefined;
|
|
344
|
+
toolSurface?: (() => ReadonlySet<string> | undefined) | undefined;
|
|
345
|
+
/**
|
|
346
|
+
* The run's reader and writer: usually `createAgentTransport` from `@mountaya/client/events`,
|
|
347
|
+
* which gives up an open that never answers and a stream gone silent as connection errors. A
|
|
348
|
+
* transport of your own bounds both waits the same way, since the engine waits as long as
|
|
349
|
+
* `subscribe` says nothing, and reports `onClose("terminal")` only after it has handed over a
|
|
350
|
+
* `done`.
|
|
351
|
+
*/
|
|
352
|
+
transport: AgentTransport;
|
|
393
353
|
}
|
|
394
354
|
/**
|
|
395
355
|
* AgentEngine is a long-lived, multi-turn agent run over a single persistent
|
|
@@ -449,585 +409,584 @@ interface AgentEngineConfig<TContext extends AgentToolContext = AgentToolContext
|
|
|
449
409
|
* void engine.close().finally(() => engine.dispose());
|
|
450
410
|
* ```
|
|
451
411
|
*/
|
|
452
|
-
declare class AgentEngine {
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
412
|
+
export declare class AgentEngine {
|
|
413
|
+
private readonly config;
|
|
414
|
+
private currentRunId;
|
|
415
|
+
private unfinishedRunId;
|
|
416
|
+
private state;
|
|
417
|
+
/**
|
|
418
|
+
* The state the observer was told last. It is {@link state} but from the moment a start
|
|
419
|
+
* readies its run until that start reports: the engine rests for those statements, and the
|
|
420
|
+
* observer is told the state the start leaves it in, never the rest between two turns.
|
|
421
|
+
*/
|
|
422
|
+
private reported;
|
|
423
|
+
private sendHold;
|
|
424
|
+
private sendReporting;
|
|
425
|
+
private lastEventId;
|
|
426
|
+
private streamAbort;
|
|
427
|
+
private unsubscribe;
|
|
428
|
+
private readGeneration;
|
|
429
|
+
private routedNames;
|
|
430
|
+
private routingUpdates;
|
|
431
|
+
private routedUpdate;
|
|
432
|
+
private disposed;
|
|
433
|
+
private pendingStart;
|
|
434
|
+
private readonly handledCalls;
|
|
435
|
+
private handledRunId;
|
|
436
|
+
private readonly dispatchedCalls;
|
|
437
|
+
private readonly runningCalls;
|
|
438
|
+
constructor(config: AgentEngineConfig);
|
|
439
|
+
/**
|
|
440
|
+
* start opens a fresh run with the user's first message, then consumes the
|
|
441
|
+
* run's single event stream to completion. The returned promise settles only
|
|
442
|
+
* when the engine stops reading the run, so the caller fire-and-forgets it and
|
|
443
|
+
* reacts to turns through the observer instead. It resolves on the terminal
|
|
444
|
+
* `done`, on {@link close} or {@link dispose}, when a later start or
|
|
445
|
+
* {@link resume} replaces the run, and when its reconnects stop being productive.
|
|
446
|
+
*
|
|
447
|
+
* It rejects when the start or the stream fails for good: a start whose post is
|
|
448
|
+
* refused, at once for most answers and, for a 429, a 502, a 503, a 504 or a dropped
|
|
449
|
+
* connection, once the transport has repeated it under the start's idempotency key
|
|
450
|
+
* as far as its retry policy goes, a stream open answered with anything but a 429,
|
|
451
|
+
* 503 or 504, a fault in one of the host's own seams, and a stream that is still
|
|
452
|
+
* failing when the reconnect ceiling is reached, whether its connection stays down
|
|
453
|
+
* or every open is answered 429 or 504; that one rejects with the last
|
|
454
|
+
* failure. A stream that fails leaves the state `ended`, reported through
|
|
455
|
+
* `onStateChange("ended")`, before the promise rejects; a start that fails leaves
|
|
456
|
+
* it `awaiting_input`.
|
|
457
|
+
*
|
|
458
|
+
* A stream open answered 503 is not counted against the reconnect ceiling. It says the
|
|
459
|
+
* run's events cannot be reached for a moment while the run goes on, so the engine opens
|
|
460
|
+
* the stream again, after the wait the answer names, for as long as two minutes of such
|
|
461
|
+
* answers with no turn read in between, and then rejects with the last of them.
|
|
462
|
+
*
|
|
463
|
+
* The state is `running` from the call, reported through `onStateChange("running")` before
|
|
464
|
+
* the run has an id, so a host shows the turn as under way from the message. A start that
|
|
465
|
+
* fails reports `awaiting_input` again before its promise rejects. The report is the last
|
|
466
|
+
* step ahead of the post: a start that fails before it, on a fault in the tool surface,
|
|
467
|
+
* never reports `running`.
|
|
468
|
+
*
|
|
469
|
+
* A start that replaces a run reports that one change and no rest ahead of it: `running`
|
|
470
|
+
* from an engine at rest or whose last run ended, and nothing from an engine whose run is
|
|
471
|
+
* under way, which reads `running` through the replacement. Where such a start fails, the
|
|
472
|
+
* one report is `awaiting_input`.
|
|
473
|
+
*
|
|
474
|
+
* One engine reads one run. A start while the engine still reads a run tears that
|
|
475
|
+
* run's stream down and posts a close for it before it opens its own, so none of
|
|
476
|
+
* that run's frames, its resume cursor or its `done` reach the run that replaces
|
|
477
|
+
* it. A start while another start still waits on its run id withdraws that start,
|
|
478
|
+
* as {@link close} does. A start on an engine whose last run ended opens the next
|
|
479
|
+
* run and reads it from its beginning, and posts a close for that last run first when
|
|
480
|
+
* the engine stopped reading it short of its `done` (see {@link close}). A start after
|
|
481
|
+
* {@link dispose} opens nothing and resolves at once.
|
|
482
|
+
*
|
|
483
|
+
* Every start carries an `Idempotency-Key` of its own, drawn once per call where the runtime
|
|
484
|
+
* has a cryptographic random source, and is posted once: the transport repeats a start whose
|
|
485
|
+
* answer was lost under that same key, and the API answers the repeat with the run the key
|
|
486
|
+
* already started, so a lost answer never opens a second run. A start the transport gives up
|
|
487
|
+
* on rejects with the transport's failure, which carries the key. A custom
|
|
488
|
+
* {@link AgentTransport} receives the key as the `idempotencyKey` of the options its `startRun`
|
|
489
|
+
* is handed, and none where the runtime offers no source to draw it from.
|
|
490
|
+
*
|
|
491
|
+
* A {@link close}, a {@link dispose} or a later start or {@link resume} while the start
|
|
492
|
+
* still waits on its run id withdraws it: no stream is opened, no run id and no frame of
|
|
493
|
+
* the run reaches the observer, and the returned promise resolves even when the start
|
|
494
|
+
* itself fails. The run it opens is closed as soon as its id arrives. A withdrawal made from
|
|
495
|
+
* inside a state report of the start itself, or from inside the tool surface it reads (the
|
|
496
|
+
* bus's `manifest`), comes ahead of the post: nothing is posted, no run is opened and no
|
|
497
|
+
* `running` follows the `ended` the withdrawal reported.
|
|
498
|
+
*
|
|
499
|
+
* @param message The user's first message, which opens the run's first turn.
|
|
500
|
+
* @param organizationId The organization that owns the resource the co-pilot is opened on
|
|
501
|
+
* (the itinerary or zone being edited). The run is scoped and access-gated to it, and the
|
|
502
|
+
* API resolves the AI provider credential through it. It is captured per start because it
|
|
503
|
+
* reflects the resource open at the moment the run opens, and the API requires it.
|
|
504
|
+
* @param context The caller's point-in-time studio snapshot, forwarded verbatim to the
|
|
505
|
+
* gateway's create body so the run starts knowing the current UI state. It is captured per
|
|
506
|
+
* start (not held on the session config) because it is a snapshot of the moment the run
|
|
507
|
+
* opens. It stays an opaque `Record<string, unknown>` here because its typed shape is the
|
|
508
|
+
* host's, which this package does not import: the host builds it and passes it through.
|
|
509
|
+
*/
|
|
510
|
+
start(message: string, organizationId: string, context?: Record<string, unknown>): Promise<void>;
|
|
511
|
+
/**
|
|
512
|
+
* resume re-attaches to an already-started run (e.g. after a page reload) and consumes the
|
|
513
|
+
* run's single event stream to completion. It lets a reload reconnect to an
|
|
514
|
+
* in-flight conversation rather than starting over. Its promise settles as the
|
|
515
|
+
* read of a {@link start} does: it resolves when the engine stops reading the run,
|
|
516
|
+
* and rejects when the stream fails for good, the state already `ended`.
|
|
517
|
+
*
|
|
518
|
+
* `lastEventId` is the stream position to read on from: the gateway replays what follows
|
|
519
|
+
* it, then the live feed. Without one the read starts where the engine left the run when
|
|
520
|
+
* `runId` is the run it holds (the one it read last, still open or not), so a host that
|
|
521
|
+
* kept its transcript re-attaches and is handed nothing a second time. That place is after
|
|
522
|
+
* the last frame that reached the engine, the one an observer callback is being handed
|
|
523
|
+
* included: a resume made from inside the callback reads on after that frame. A frame whose
|
|
524
|
+
* handling threw (a seam that answers: the tool layer, the confirm gate, the tool surface or
|
|
525
|
+
* the state delta) is the exception. It is read again, and
|
|
526
|
+
* a call the run already claimed is dropped. For any other run the engine holds no position,
|
|
527
|
+
* and the gateway answers with the run's whole history: that is the read an engine built
|
|
528
|
+
* after a reload makes, and its host starts from an empty transcript. To read the held run
|
|
529
|
+
* from its first event again, resume it on a new engine.
|
|
530
|
+
*
|
|
531
|
+
* Like {@link start}, it reads the run on an engine whose last run ended, opens
|
|
532
|
+
* nothing after {@link dispose}, and replaces what the engine reads when it is
|
|
533
|
+
* called: another run is torn down and closed, and a start still waiting on its run
|
|
534
|
+
* id is withdrawn. A resume of the run the engine is reading tears that read down
|
|
535
|
+
* and reads the run again from `lastEventId`, or from where that read was when none is
|
|
536
|
+
* passed, and posts no close for it.
|
|
537
|
+
*
|
|
538
|
+
* The engine is at rest as the read begins, reported through `onStateChange("awaiting_input")`
|
|
539
|
+
* from an engine that was `running` or `ended`, and the stream says the rest. A call made
|
|
540
|
+
* from inside that report is read before the run is adopted, as one made from a report of a
|
|
541
|
+
* {@link start} is: a {@link dispose} ends the resume with no stream opened and no run to
|
|
542
|
+
* close, and a start or another resume is the one read the engine makes, so this resume
|
|
543
|
+
* resolves at once. A {@link close} made there finds no run held and posts nothing, and the
|
|
544
|
+
* resume reads its run.
|
|
545
|
+
*/
|
|
546
|
+
resume(runId: string, lastEventId?: string): Promise<void>;
|
|
547
|
+
/**
|
|
548
|
+
* streamPosition reads where the engine stands in the run it read last, for a host that
|
|
549
|
+
* replaces the engine and has the next one read the run on.
|
|
550
|
+
*
|
|
551
|
+
* It is the position a {@link resume} of that run on this engine reads on from: after the last
|
|
552
|
+
* frame that reached the engine, or the position a resume was handed while no frame has
|
|
553
|
+
* followed it. It is kept through {@link dispose}, which is when a host reads it.
|
|
554
|
+
*
|
|
555
|
+
* @returns The run and the position, or `null` while the engine has read no run or the run's
|
|
556
|
+
* stream has named no position, which is the whole of a run whose frames carry no id.
|
|
557
|
+
*
|
|
558
|
+
* @example
|
|
559
|
+
* ```ts
|
|
560
|
+
* import type { AgentEngine } from "@mountaya/elements/agent";
|
|
561
|
+
*
|
|
562
|
+
* declare const parked: AgentEngine;
|
|
563
|
+
* declare const next: AgentEngine;
|
|
564
|
+
*
|
|
565
|
+
* const position = parked.streamPosition();
|
|
566
|
+
* parked.dispose();
|
|
567
|
+
* if (position !== null) {
|
|
568
|
+
* next.resume(position.runId, position.lastEventId).catch((error: unknown) => {
|
|
569
|
+
* console.error(error);
|
|
570
|
+
* });
|
|
571
|
+
* }
|
|
572
|
+
* ```
|
|
573
|
+
*/
|
|
574
|
+
streamPosition(): AgentStreamPosition | null;
|
|
575
|
+
/**
|
|
576
|
+
* runId reads the id of the run the engine holds: the one a {@link start} opened, from the
|
|
577
|
+
* moment its post answers, or the one a {@link resume} reads, from the moment it begins. It is
|
|
578
|
+
* kept once the engine stops reading that run, whether the run ended, its stream failed, or the
|
|
579
|
+
* engine was disposed.
|
|
580
|
+
*
|
|
581
|
+
* It is what tells the two failures a start rejects with apart. A start whose post the gateway
|
|
582
|
+
* refused opened no run, and this reads null; a start whose run opened and whose stream was
|
|
583
|
+
* then refused reads that run. The same status says different things on each: a 404 on the post
|
|
584
|
+
* is an organization the reader does not reach, and a 404 on the stream is a run the gateway no
|
|
585
|
+
* longer holds.
|
|
586
|
+
*
|
|
587
|
+
* @returns The run's id, or null while the engine holds none: before its first run, and from
|
|
588
|
+
* the moment a start replaces a run until the post of that start answers, which a start that
|
|
589
|
+
* fails never does.
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* ```ts
|
|
593
|
+
* import type { AgentEngine } from "@mountaya/elements/agent";
|
|
594
|
+
*
|
|
595
|
+
* declare const engine: AgentEngine;
|
|
596
|
+
* declare const report: (failure: unknown, openedRun: string | null) => void;
|
|
597
|
+
*
|
|
598
|
+
* engine.start("Plan a loop", "organization-id").catch((failure: unknown) => {
|
|
599
|
+
* report(failure, engine.runId());
|
|
600
|
+
* });
|
|
601
|
+
* ```
|
|
602
|
+
*/
|
|
603
|
+
runId(): string | null;
|
|
604
|
+
/**
|
|
605
|
+
* send delivers a follow-up user message into the open run. It only posts the
|
|
606
|
+
* input (the persistent consumer opened by start/resume carries this turn's
|
|
607
|
+
* events), so it does NOT open a second stream.
|
|
608
|
+
*
|
|
609
|
+
* A message sent while a {@link start} still waits on its run id is held until the id
|
|
610
|
+
* arrives, then posted into that run, behind the opening of its stream and in the order the
|
|
611
|
+
* messages were sent. A start settles only when its run is over, so a caller has no promise
|
|
612
|
+
* to wait on before the next message. When that start opens no run (it fails, or a
|
|
613
|
+
* {@link close}, a {@link dispose} or a later start or {@link resume} withdraws it), the
|
|
614
|
+
* held message is dropped and the promise resolves: the start's rejection, or the call that
|
|
615
|
+
* withdrew it, already says the conversation did not open, and a second report of one
|
|
616
|
+
* failure is one too many.
|
|
617
|
+
*
|
|
618
|
+
* The state is `running` from the call the engine takes, reported through
|
|
619
|
+
* `onStateChange("running")` when the run was at rest, so the turn's settle is a change the
|
|
620
|
+
* observer hears even when the turn sends no frame of its own. A message the engine refuses
|
|
621
|
+
* changes nothing. When the post fails, the engine reports `awaiting_input` again before the
|
|
622
|
+
* promise rejects, unless another message is still being posted, one of them landed, or the
|
|
623
|
+
* stream has reported a state since: the turn is then the stream's to settle.
|
|
624
|
+
*
|
|
625
|
+
* The report is made ahead of the post, and the message goes into the run it found at the
|
|
626
|
+
* call. A {@link close}, a {@link dispose}, a {@link start} or a {@link resume} of another run
|
|
627
|
+
* made from inside that report takes the run from the message: nothing is posted and the
|
|
628
|
+
* promise resolves, as it does for a message held behind a start that opens no run. A
|
|
629
|
+
* {@link resume} of the same run keeps the message, and its turn is the stream's to settle.
|
|
630
|
+
* A send made from inside that report is posted after the message that reported, so two
|
|
631
|
+
* messages reach the run in the order they were sent.
|
|
632
|
+
*
|
|
633
|
+
* @throws {MountayaElementsError} when no run is being read and none is on its way: on an
|
|
634
|
+
* engine that never opened one, and once the run has ended, been closed or been disposed.
|
|
635
|
+
* A run that ended takes no more messages, and one the engine has stopped reading would
|
|
636
|
+
* answer to nobody, so the refusal is local rather than a request the gateway refuses. It
|
|
637
|
+
* is the package's own error and no stream fault, because it is a misuse of this package,
|
|
638
|
+
* which is what a consumer catching {@link MountayaElementsError} is catching. The next
|
|
639
|
+
* message goes into a run a new {@link start} opens, except on a disposed engine, which
|
|
640
|
+
* opens no more runs: the conversation continues on a new engine.
|
|
641
|
+
*/
|
|
642
|
+
send(message: string): Promise<void>;
|
|
643
|
+
/**
|
|
644
|
+
* reads reports whether `runId` is still the run this engine reads: the engine is neither
|
|
645
|
+
* disposed nor ended, and no start or resume has put another run in its place.
|
|
646
|
+
*/
|
|
647
|
+
private reads;
|
|
648
|
+
/**
|
|
649
|
+
* routedManifest renders the wire manifest for whatever the toolSurface seam
|
|
650
|
+
* currently selects, or the whole permitted set when no router is wired.
|
|
651
|
+
*/
|
|
652
|
+
private routedManifest;
|
|
653
|
+
/**
|
|
654
|
+
* routedServerTools renders the server-tool allowlist for whatever the
|
|
655
|
+
* toolSurface seam currently selects: the routed name set verbatim, sorted so
|
|
656
|
+
* the wire body and the change key are stable across identical selections.
|
|
657
|
+
* The gateway ignores the client-tool names in it, so no registry knowledge
|
|
658
|
+
* is needed here. Undefined when no router is wired: the run then keeps
|
|
659
|
+
* every server tool. Undefined as well unless the session routes server tools
|
|
660
|
+
* ({@link AgentEngineConfig.routesServerTools}): under a publishable key a run
|
|
661
|
+
* calls none, and a list naming any is refused, so none is sent.
|
|
662
|
+
*/
|
|
663
|
+
private routedServerTools;
|
|
664
|
+
/**
|
|
665
|
+
* routeTools re-reads the toolSurface seam and, when it has moved, replaces the
|
|
666
|
+
* tool set the run offers the model from its next turn on. The model then
|
|
667
|
+
* chooses among a coherent handful for the task at hand instead of the whole
|
|
668
|
+
* registry.
|
|
669
|
+
*
|
|
670
|
+
* It narrows only what the model can SEE. Every tool stays registered on the
|
|
671
|
+
* bus and dispatchable by a human click or an internal tool chain, and the
|
|
672
|
+
* capability gate remains the sole authorization boundary, exactly as
|
|
673
|
+
* `agentHidden` behaves.
|
|
674
|
+
*
|
|
675
|
+
* An unchanged selection sends nothing. That is not just a saved request: the
|
|
676
|
+
* tool array is the outermost part of the provider's cached prompt prefix, so a
|
|
677
|
+
* manifest re-sent on every turn would invalidate the cache every turn and cost
|
|
678
|
+
* far more than routing saves. "Unchanged" means changed since the run last
|
|
679
|
+
* ACCEPTED a set, so a selection whose POST failed is retried on the next call
|
|
680
|
+
* rather than treated as delivered.
|
|
681
|
+
*
|
|
682
|
+
* It is a no-op before a run exists, rather than a throw: routing is advisory,
|
|
683
|
+
* and a surface change while the panel is idle should cost nothing, since the
|
|
684
|
+
* next start() sends the current selection as the run's seed anyway.
|
|
685
|
+
*
|
|
686
|
+
* While a {@link start} still waits on its run id, the seed is already on its way, so the
|
|
687
|
+
* call waits for the run as {@link send} does and then routes it with the selection the
|
|
688
|
+
* surface holds by then. A routing update and a message held behind one start are released
|
|
689
|
+
* in the order they were called, neither waiting on the other's answer, so a caller that
|
|
690
|
+
* needs the selection in the run ahead of its message awaits routeTools() before it calls
|
|
691
|
+
* {@link send}. When that start opens no run, nothing is sent.
|
|
692
|
+
*/
|
|
693
|
+
routeTools(): Promise<void>;
|
|
694
|
+
/**
|
|
695
|
+
* close asks the run to finish. It POSTs a close so the gateway finishes the
|
|
696
|
+
* run successfully (a terminal `done` event), AND aborts the open stream so a
|
|
697
|
+
* consumer parked between turns unwinds promptly rather than waiting on the
|
|
698
|
+
* gateway to close the connection. The terminal `done`, when it arrives first,
|
|
699
|
+
* ends the session.
|
|
700
|
+
*
|
|
701
|
+
* It closes a run the engine stopped reading on its own just the same: one it gave
|
|
702
|
+
* up on at the reconnect ceiling, after two minutes of opens answered 503 or on an
|
|
703
|
+
* open refused for good, which the gateway would otherwise hold open until its own
|
|
704
|
+
* timeout. A run is closed at most once, and a run that read its `done` is closed
|
|
705
|
+
* never: a second call, and a call after `done`, post nothing. So does a call after
|
|
706
|
+
* {@link dispose}, which leaves the run it was reading to the host.
|
|
707
|
+
*
|
|
708
|
+
* During a start that still waits on its run id, close withdraws the start and
|
|
709
|
+
* resolves at once, and the start finishes the run it opens (see {@link start}).
|
|
710
|
+
*/
|
|
711
|
+
close(): Promise<void>;
|
|
712
|
+
/**
|
|
713
|
+
* dispose tears the session down without signalling the gateway: it aborts the
|
|
714
|
+
* open stream and marks the run ended, releasing the parked consumer. The host
|
|
715
|
+
* calls it on unmount AFTER close() has POSTed (a closed tab finishes the run),
|
|
716
|
+
* with the abort as the backstop when the consumer would otherwise leak.
|
|
717
|
+
*
|
|
718
|
+
* It is the engine's shutdown latch: {@link start} and {@link resume} open nothing
|
|
719
|
+
* afterwards. What it can still cause is what a start sends to finish the run whose id the
|
|
720
|
+
* host never received, when it was withdrawn or gave up at its ceiling: that run's close,
|
|
721
|
+
* and, when the start's answer was lost, the one last post of the start that names the run
|
|
722
|
+
* (see {@link start}).
|
|
723
|
+
*
|
|
724
|
+
* The run the engine was reading, or stopped reading on its own, is the host's from here:
|
|
725
|
+
* the host holds its id, so it can resume it or close it, and a later {@link close} on
|
|
726
|
+
* this engine posts nothing for it.
|
|
727
|
+
*/
|
|
728
|
+
dispose(): void;
|
|
729
|
+
/**
|
|
730
|
+
* leaveRun stops the engine reading what it reads, before a {@link start} or a
|
|
731
|
+
* {@link resume} reads a run: one engine reads one run. A start still waiting on its run
|
|
732
|
+
* id is withdrawn. A run still being read has its stream torn down, so none of its frames,
|
|
733
|
+
* its resume cursor or its `done` reach the run read next. A close is posted for the run the
|
|
734
|
+
* engine still owes one (see `unfinishedRunId`): the run it was reading, and the run it
|
|
735
|
+
* stopped reading on its own, because in both cases the engine was the one party reading
|
|
736
|
+
* it. `next` names the run about to be read, and that run is spared the close when it is
|
|
737
|
+
* the one owed it: a resume of it reads it again.
|
|
738
|
+
*/
|
|
739
|
+
private leaveRun;
|
|
740
|
+
/**
|
|
741
|
+
* withdrawStart withdraws the start still waiting on its run id, if one is: that start then
|
|
742
|
+
* finishes the run it opens instead of reading it (see {@link start}), and every message
|
|
743
|
+
* and routing update held behind it is dropped (see {@link send}).
|
|
744
|
+
*/
|
|
745
|
+
private withdrawStart;
|
|
746
|
+
/**
|
|
747
|
+
* beginRun readies the engine to read a new run once {@link leaveRun} has stopped it
|
|
748
|
+
* reading the last one. The run id, the resume cursor and the stream handle belong to that
|
|
749
|
+
* run, so all three go, and the state returns to `awaiting_input`: `ended` would stop the
|
|
750
|
+
* read loop before it opened anything.
|
|
751
|
+
*
|
|
752
|
+
* The rest is the engine's own and is reported to nobody here. A {@link resume} reports it,
|
|
753
|
+
* since its run may rest for good. A {@link start} reports `running` next, or the rest once
|
|
754
|
+
* it fails, so a start that replaces a run under way is one turn after another to the
|
|
755
|
+
* observer and no rest between them ({@link reportState}).
|
|
756
|
+
*
|
|
757
|
+
* @returns The generation of the read being readied, which a later start or resume replaces.
|
|
758
|
+
*/
|
|
759
|
+
private beginRun;
|
|
760
|
+
/**
|
|
761
|
+
* adoptRun makes `runId` the run this engine reads, and the run it owes a close until the
|
|
762
|
+
* run's `done` arrives or a close is posted. The memory of handled calls, and of the calls
|
|
763
|
+
* the engine reported among them, belongs to one run, because call ids are the run's own: it
|
|
764
|
+
* is kept when the run is the one already read (a resume of it) and emptied for any other.
|
|
765
|
+
*/
|
|
766
|
+
private adoptRun;
|
|
767
|
+
/**
|
|
768
|
+
* claimCall records a call id as handled and reports whether the frame that names it is
|
|
769
|
+
* the engine's to act on. Two frames are not, and each is dropped whole:
|
|
770
|
+
*
|
|
771
|
+
* - one whose id the run already sighted, a replay of a call the engine ran or answered
|
|
772
|
+
* itself, whose result is already posted;
|
|
773
|
+
* - one the stream marks `settled`, a replay of a call whose outcome the stream already
|
|
774
|
+
* holds. An engine built after a page reload has no memory of the run, so the marker is
|
|
775
|
+
* all that tells it the call was answered.
|
|
776
|
+
*
|
|
777
|
+
* A settled id is recorded like any other, so a later frame that names it without the
|
|
778
|
+
* marker runs nothing either. A replayed frame with no marker and an id never sighted is
|
|
779
|
+
* one the stream holds no outcome for, and is the engine's.
|
|
780
|
+
*/
|
|
781
|
+
private claimCall;
|
|
782
|
+
/**
|
|
783
|
+
* closeQuietly posts a close for a live run the engine leaves behind: one a withdrawn start
|
|
784
|
+
* opened and never read, whose id the host never received, and one a later start or resume
|
|
785
|
+
* replaced. A failed post is dropped: nobody is
|
|
786
|
+
* left to tell, and the gateway completes a run that goes quiet on its own.
|
|
787
|
+
*/
|
|
788
|
+
private closeQuietly;
|
|
789
|
+
/**
|
|
790
|
+
* releaseSubscription stops callback delivery from the open stream, exactly
|
|
791
|
+
* once. It reads the handle out and clears it BEFORE invoking it, so a
|
|
792
|
+
* re-entrant settle (the abort listener firing synchronously inside
|
|
793
|
+
* teardownStream, or a transport calling back into onClose) finds nothing
|
|
794
|
+
* left to release rather than calling the same handle twice.
|
|
795
|
+
*/
|
|
796
|
+
private releaseSubscription;
|
|
797
|
+
/**
|
|
798
|
+
* teardownStream releases the open events stream from both sides: the
|
|
799
|
+
* unsubscribe stops callback delivery (covering the scripted drain, which has
|
|
800
|
+
* no fetch to abort), and the abort closes the live fetch (and trips the resume
|
|
801
|
+
* detection in run()). Idempotent, so close() followed by dispose() is harmless.
|
|
802
|
+
*
|
|
803
|
+
* The unsubscribe runs FIRST because abort() dispatches its listener
|
|
804
|
+
* synchronously: that listener settles the read and clears the handle, so
|
|
805
|
+
* aborting first would leave nothing to unsubscribe and the scripted drain
|
|
806
|
+
* would stay parked for the life of the process.
|
|
807
|
+
*/
|
|
808
|
+
private teardownStream;
|
|
809
|
+
/**
|
|
810
|
+
* run consumes the run's event stream to completion, reconnecting when the
|
|
811
|
+
* stream closes before a terminal event. The gateway may close an SSE
|
|
812
|
+
* connection between turns (e.g. after `awaiting-input`); rather than leave the
|
|
813
|
+
* run silently stuck, run re-opens the stream from the tracked Last-Event-ID so
|
|
814
|
+
* the conversation continues. It returns once a terminal event ends the run, an
|
|
815
|
+
* abort tears the stream down, or the reconnects stop being productive: an open that
|
|
816
|
+
* closes having said nothing or one frame waits on the reconnect schedule, and the
|
|
817
|
+
* attempt ceiling below bounds how many of them in a row the run is given.
|
|
818
|
+
*
|
|
819
|
+
* A read that FAILS is judged by {@link isTransientStreamFault}. A transient one (a
|
|
820
|
+
* dropped connection, a 429, 503 or 504 at open) reopens from the last id on the same
|
|
821
|
+
* schedule and under the same ceiling as a hangup, and when the ceiling is reached on a
|
|
822
|
+
* read that failed, that failure (the drop, or the 429 or 504) is what the caller
|
|
823
|
+
* receives. The client's own reader reports an open that never answers and a stream gone
|
|
824
|
+
* silent as dropped connections, so both reopen. Any other failure ends the read at once and
|
|
825
|
+
* rejects with it. Either way the state is `ended` before the rejection, because the engine
|
|
826
|
+
* has stopped reading the run, and the run is owed a close (see {@link close}).
|
|
827
|
+
*
|
|
828
|
+
* An open answered 503 reopens on that schedule and outside that ceiling: it is left out of
|
|
829
|
+
* the count, neither adding to it nor clearing it, and such opens are bounded by
|
|
830
|
+
* {@link RECONNECT_UNAVAILABLE_MAX_MS} from the first of them, past which the caller receives
|
|
831
|
+
* the 503. A turn that moves starts the count and that time again.
|
|
832
|
+
*
|
|
833
|
+
* A stream that ends with the credential it was opened with, or that the API could not keep
|
|
834
|
+
* delivering (`interrupted`), reopens at once from the last id, and clears the count of
|
|
835
|
+
* fruitless opens: the transport closes either as `reconnect`, and the reopen carries the
|
|
836
|
+
* session token the client holds by then. A 401 on that reopen is a failure like any other
|
|
837
|
+
* refusal, and ends the read.
|
|
838
|
+
*
|
|
839
|
+
* A teardown ends the read wherever it finds it, the backoff between two opens included:
|
|
840
|
+
* a close or a dispose, and a start or a resume that replaced this run (see
|
|
841
|
+
* {@link leaveRun}).
|
|
842
|
+
*/
|
|
843
|
+
private run;
|
|
844
|
+
/**
|
|
845
|
+
* backoff waits out one reconnect delay, drawn by {@link reconnectDelayMs} on the run's
|
|
846
|
+
* {@link reconnectSchedule}: below a ceiling that doubles from AGENT_RECONNECT_BASE_MS to
|
|
847
|
+
* RECONNECT_MAX_MS, so the wait stays inside a person's patience and runs dropped together
|
|
848
|
+
* do not reopen together. Where the failure was a 429 or a 503 that named its wait (`namedMs`),
|
|
849
|
+
* that wait replaces the draw, with up to a second drawn above it and the timer's ceiling over
|
|
850
|
+
* it ({@link retryAfterDelayMs}), as SPEC §2 has `Retry-After` replace the schedule. It settles
|
|
851
|
+
* on whichever comes first, the timer or the stream teardown's abort, and drops both hooks
|
|
852
|
+
* either way: a run that reconnects many times must not accumulate listeners on the signal, nor
|
|
853
|
+
* leave a timer holding the loop after the session is gone.
|
|
854
|
+
*/
|
|
855
|
+
private backoff;
|
|
856
|
+
/**
|
|
857
|
+
* consume opens one read of the run's events stream and settles when it
|
|
858
|
+
* finishes, bridging the transport's AgentStreamHandlers callbacks to a single
|
|
859
|
+
* promise run() can await. It reacts to each decoded frame and records its id as
|
|
860
|
+
* the resume position when the frame arrives, taking it back when the frame's handling
|
|
861
|
+
* throws; the transport has already validated every frame, so it trusts the typed
|
|
862
|
+
* event. Unlike a per-turn drive it does NOT stop on
|
|
863
|
+
* `awaiting-input` (the stream stays open for the next message). It resolves
|
|
864
|
+
* with whether a terminal event ended the run and how many frames the stream
|
|
865
|
+
* delivered, so the caller can decide between reconnecting and settling and
|
|
866
|
+
* tell a productive open from a fruitless one, and with the failure when the
|
|
867
|
+
* read failed. It never rejects, a transport that throws from the open included:
|
|
868
|
+
* whether a failure ends the run is run()'s call.
|
|
869
|
+
* A terminal the SESSION decides (handle returning true on `done`) tears the
|
|
870
|
+
* subscription down here so no further frame is processed after the run is
|
|
871
|
+
* over. A teardown's abort (a close, a dispose, or a start or resume that replaced
|
|
872
|
+
* the run) settles the promise on its own (the transport fires no callback on a
|
|
873
|
+
* deliberate abort), so run() unwinds without waiting on a dead stream.
|
|
874
|
+
*
|
|
875
|
+
* It is one closure on purpose. Every handler reads and writes this read's own settle
|
|
876
|
+
* latch and frame count, and held as fields they would be the next read's to reach.
|
|
877
|
+
*/
|
|
878
|
+
private consume;
|
|
879
|
+
/**
|
|
880
|
+
* handle reacts to one event of the run `runId` names and reports whether the run
|
|
881
|
+
* ended (so consume can stop). An active-turn event (streamed text, a tool call, a
|
|
882
|
+
* confirm request) flips the lifecycle to `running`; a client tool-call is dispatched
|
|
883
|
+
* through the bus and its result posted back; a confirm-required is routed through
|
|
884
|
+
* the host gate and the decision posted back. Both answers go to `runId`, the run that
|
|
885
|
+
* asked, even when a later start or resume replaced it while the tool ran or the host
|
|
886
|
+
* decided. A tool-call or a confirm-required that {@link claimCall} refuses, one the
|
|
887
|
+
* stream marks `settled` or one the run already handled, is dropped whole: it reaches
|
|
888
|
+
* neither the bus, the gate nor the observer, and leaves the lifecycle as it is. An
|
|
889
|
+
* `awaiting-input` event settles the turn to the `awaiting_input` state but
|
|
890
|
+
* keeps the stream open (returns false); only a terminal `done` ends the run (returns
|
|
891
|
+
* true).
|
|
892
|
+
*/
|
|
893
|
+
private handle;
|
|
894
|
+
/**
|
|
895
|
+
* handleToolCall runs one client tool call through the bus, reports it to the observer and
|
|
896
|
+
* posts its result back into the run that asked. It answers false: a tool call never ends
|
|
897
|
+
* the run.
|
|
898
|
+
*
|
|
899
|
+
* The call is running from its claim to its report. What the stream says of it meanwhile is
|
|
900
|
+
* held ({@link holdWhileRunning}), and released when the handling throws before the report:
|
|
901
|
+
* the engine has no report of its own then, and the stream's word settles the host's row.
|
|
902
|
+
*/
|
|
903
|
+
private handleToolCall;
|
|
904
|
+
/**
|
|
905
|
+
* releaseHeldWord takes a call out of the running set and delivers what the stream said of it
|
|
906
|
+
* while it ran, when it said anything. A call the engine reported is out of the set already,
|
|
907
|
+
* and so is every call of a run the engine no longer holds the memory of: both release
|
|
908
|
+
* nothing.
|
|
909
|
+
*/
|
|
910
|
+
private releaseHeldWord;
|
|
911
|
+
/**
|
|
912
|
+
* holdWhileRunning keeps what the stream says of a call the engine is still running, as the
|
|
913
|
+
* report it would have made, and answers whether it did. The first word is the one kept: a
|
|
914
|
+
* failed `tool-result` follows the `tool-abandoned` of a call the run gave up on.
|
|
915
|
+
*/
|
|
916
|
+
private holdWhileRunning;
|
|
917
|
+
/** runToolCall is the handling of a claimed client tool call: see {@link handleToolCall}. */
|
|
918
|
+
private runToolCall;
|
|
919
|
+
/**
|
|
920
|
+
* handleConfirmRequired puts a server tool's confirmation to the host gate and posts the
|
|
921
|
+
* decision back into the run that asked. It answers false: a confirmation never ends the
|
|
922
|
+
* run.
|
|
923
|
+
*/
|
|
924
|
+
private handleConfirmRequired;
|
|
925
|
+
/**
|
|
926
|
+
* handleDone reports how the run ended and ends the read, unless a start or a resume made
|
|
927
|
+
* from the callback has already replaced it. It answers true: `done` is the one terminal.
|
|
928
|
+
*/
|
|
929
|
+
private handleDone;
|
|
930
|
+
/**
|
|
931
|
+
* handleToolResult reports a call's outcome as the stream states it, unless the call is one
|
|
932
|
+
* the engine ran and reported itself. It answers false.
|
|
933
|
+
*/
|
|
934
|
+
private handleToolResult;
|
|
935
|
+
/**
|
|
936
|
+
* handleToolAbandoned reports a call the run gave up on, unless the call is one the engine
|
|
937
|
+
* ran and reported itself. It answers false.
|
|
938
|
+
*/
|
|
939
|
+
private handleToolAbandoned;
|
|
940
|
+
/**
|
|
941
|
+
* setState records the lifecycle transition and notifies the observer only on
|
|
942
|
+
* an actual change, so the host does not re-render on a no-op.
|
|
943
|
+
*
|
|
944
|
+
* Every report, a no-op included, drops the hold the sends being posted have on `running`:
|
|
945
|
+
* whatever speaks here (a frame, a close, a new run) owns the state from then on. A send
|
|
946
|
+
* reports its own `running` through {@link reportState}, which keeps the hold.
|
|
947
|
+
*/
|
|
948
|
+
private setState;
|
|
949
|
+
/**
|
|
950
|
+
* reportState is {@link setState} without the drop of the hold, for the one report that is
|
|
951
|
+
* the hold's own: the `running` of a send.
|
|
952
|
+
*
|
|
953
|
+
* The observer is told a state that differs from the one it was told last, which is the
|
|
954
|
+
* engine's own state but while a start readies its run ({@link beginRun}).
|
|
955
|
+
*/
|
|
956
|
+
private reportState;
|
|
957
|
+
/**
|
|
958
|
+
* tell hands the observer one report. The observer answers nothing the run waits on, so a
|
|
959
|
+
* callback that throws is a defect of the host's own rendering and never the run's: its fault
|
|
960
|
+
* reaches the program through {@link surfaceFault}, and the read goes on.
|
|
961
|
+
*/
|
|
962
|
+
private tell;
|
|
963
|
+
/**
|
|
964
|
+
* postInput sends one input frame back into the run `runId` names, the run that asked
|
|
965
|
+
* for it, and reports a failure as a fault in the conversation instead of throwing.
|
|
966
|
+
*
|
|
967
|
+
* The catch is the point. `start()` ends with `await this.run(runId)`, so the whole
|
|
968
|
+
* consume loop lives inside the start promise, and an unguarded rejection here would
|
|
969
|
+
* leave `handle()` as a fault of the engine's own: the read would end for good, and
|
|
970
|
+
* `start()` would reject into the host's START error path. A network blip on turn
|
|
971
|
+
* twelve would then render "could not start", clear the started guard and drop the run
|
|
972
|
+
* id, so the still-alive gateway run could never be resumed and the model's call would
|
|
973
|
+
* expire as `tool-abandoned` with the user told nothing true about why.
|
|
974
|
+
*
|
|
975
|
+
* Reporting and continuing is the right shape: the run is still open, the stream is
|
|
976
|
+
* still readable, and the gateway abandons the unanswered call on its own timeout so
|
|
977
|
+
* the model can replan. What is lost is one tool result, which is a turn-level fault,
|
|
978
|
+
* not a session-level one. A run a later start or resume replaced has nobody reading
|
|
979
|
+
* it, so a failure to answer it is dropped rather than reported into the run that
|
|
980
|
+
* replaced it. So is a failure to answer a run the engine has stopped reading, after a
|
|
981
|
+
* {@link close} or a {@link dispose}: the host ended that conversation, and an error line
|
|
982
|
+
* under it would report a fault in a run nobody is in.
|
|
983
|
+
*
|
|
984
|
+
* The message is deliberately empty. A fetch rejection carries an English,
|
|
985
|
+
* internal string, and the host resolves an empty message to its own localized
|
|
986
|
+
* generic line, the same rule the run's other self-raised terminals follow.
|
|
987
|
+
*/
|
|
988
|
+
private postInput;
|
|
1029
989
|
}
|
|
1030
|
-
|
|
1031
990
|
/**
|
|
1032
991
|
* AgentBudgetCopy is the per-dimension usage-limit copy resolveAgentError chooses
|
|
1033
992
|
* between when a run ends on a budget ceiling: one line for each exhausted
|
|
@@ -1036,9 +995,9 @@ declare class AgentEngine {
|
|
|
1036
995
|
* and that a new chat continues the work.
|
|
1037
996
|
*/
|
|
1038
997
|
interface AgentBudgetCopy {
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
998
|
+
cost: string;
|
|
999
|
+
generic: string;
|
|
1000
|
+
turns: string;
|
|
1042
1001
|
}
|
|
1043
1002
|
/**
|
|
1044
1003
|
* AgentDraftWarning is the unsaved-work annexe a budget line carries when, and
|
|
@@ -1053,8 +1012,8 @@ interface AgentBudgetCopy {
|
|
|
1053
1012
|
* more honestly than supplying copy that can never be reached.
|
|
1054
1013
|
*/
|
|
1055
1014
|
interface AgentDraftWarning {
|
|
1056
|
-
|
|
1057
|
-
|
|
1015
|
+
note: string;
|
|
1016
|
+
open: boolean;
|
|
1058
1017
|
}
|
|
1059
1018
|
/**
|
|
1060
1019
|
* AgentErrorCopy is the localized copy resolveAgentError chooses between for a
|
|
@@ -1062,18 +1021,18 @@ interface AgentDraftWarning {
|
|
|
1062
1021
|
* resolver stays a pure, i18n-free mapping that is trivial to unit-test.
|
|
1063
1022
|
*/
|
|
1064
1023
|
interface AgentErrorCopy {
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1024
|
+
/**
|
|
1025
|
+
* The line for a run the gateway stopped because the member who started it may not run it in
|
|
1026
|
+
* its organization any more, for either of the two causes the code carries: they hold no write
|
|
1027
|
+
* role there (they left it, or their role reads only), or the organization's agreement does
|
|
1028
|
+
* not include Map Studio. One line answers both, so it names the loss of access and not a cause.
|
|
1029
|
+
*/
|
|
1030
|
+
accessRevoked: string;
|
|
1031
|
+
budget: AgentBudgetCopy;
|
|
1032
|
+
generic: string;
|
|
1033
|
+
looping: string;
|
|
1034
|
+
notConfigured: string;
|
|
1035
|
+
rateLimited: string;
|
|
1077
1036
|
}
|
|
1078
1037
|
/**
|
|
1079
1038
|
* resolveAgentError maps a terminal agent error onto the copy shown as the error
|
|
@@ -1098,15 +1057,14 @@ interface AgentErrorCopy {
|
|
|
1098
1057
|
* omits it.
|
|
1099
1058
|
* @returns The line to show as the error turn.
|
|
1100
1059
|
*/
|
|
1101
|
-
declare const resolveAgentError: (message: string, code: string | undefined, copy: AgentErrorCopy, draft?: AgentDraftWarning) => string;
|
|
1102
|
-
|
|
1060
|
+
export declare const resolveAgentError: (message: string, code: string | undefined, copy: AgentErrorCopy, draft?: AgentDraftWarning) => string;
|
|
1103
1061
|
/**
|
|
1104
1062
|
* MAX_TOOL_INPUT_CHARS bounds the pretty-printed tool input captured on an
|
|
1105
1063
|
* activity row, so a large payload never bloats the transcript store or the
|
|
1106
1064
|
* expanded details block. A run touches many tools; keeping each captured input
|
|
1107
1065
|
* small keeps the whole conversation cheap to hold and render.
|
|
1108
1066
|
*/
|
|
1109
|
-
declare const MAX_TOOL_INPUT_CHARS = 2000;
|
|
1067
|
+
export declare const MAX_TOOL_INPUT_CHARS = 2000;
|
|
1110
1068
|
/**
|
|
1111
1069
|
* boundedInputJson pretty-prints a tool call's raw input for an activity row's
|
|
1112
1070
|
* expandable details, bounded to {@link MAX_TOOL_INPUT_CHARS} with a trailing
|
|
@@ -1121,8 +1079,7 @@ declare const MAX_TOOL_INPUT_CHARS = 2000;
|
|
|
1121
1079
|
* object or a bigint throws, and a bare `undefined`, function or symbol serializes to
|
|
1122
1080
|
* nothing.
|
|
1123
1081
|
*/
|
|
1124
|
-
declare const boundedInputJson: (input: unknown) => string | null;
|
|
1125
|
-
|
|
1082
|
+
export declare const boundedInputJson: (input: unknown) => string | null;
|
|
1126
1083
|
/**
|
|
1127
1084
|
* ConversationState is the reactive core an AI conversation renders against: its
|
|
1128
1085
|
* run id (null until a run opens), the run lifecycle the surface renders against,
|
|
@@ -1132,9 +1089,9 @@ declare const boundedInputJson: (input: unknown) => string | null;
|
|
|
1132
1089
|
* lifecycle and transcript spine and the streaming helpers that grow it.
|
|
1133
1090
|
*/
|
|
1134
1091
|
interface ConversationState<E> {
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1092
|
+
runId: string | null;
|
|
1093
|
+
state: AgentEngineState;
|
|
1094
|
+
transcript: E[];
|
|
1138
1095
|
}
|
|
1139
1096
|
/**
|
|
1140
1097
|
* TranscriptRole tags a transcript entry as the user's message, the assistant's
|
|
@@ -1168,22 +1125,22 @@ type ActivityStatus = "abandoned" | "error" | "ok" | "running";
|
|
|
1168
1125
|
* one id; user and error entries are appended whole.
|
|
1169
1126
|
*/
|
|
1170
1127
|
interface MessageEntry {
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1128
|
+
content: string;
|
|
1129
|
+
id: string;
|
|
1130
|
+
/**
|
|
1131
|
+
* The reply's zero-based position among the run's assistant messages, as the run
|
|
1132
|
+
* itself reported it, so a rating on this turn names the message the API will
|
|
1133
|
+
* see.
|
|
1134
|
+
*
|
|
1135
|
+
* Present on assistant turns the run numbered, absent on every other role and on a
|
|
1136
|
+
* reply from a gateway that sends no index: a reader falls back to counting the
|
|
1137
|
+
* replies it holds for those. That fallback is why the field is worth carrying at
|
|
1138
|
+
* all: counting locally is right until a reload mid-run, which rebuilds no
|
|
1139
|
+
* transcript, so the count restarts at zero while the conversation is already
|
|
1140
|
+
* several answers in.
|
|
1141
|
+
*/
|
|
1142
|
+
messageIndex?: number | undefined;
|
|
1143
|
+
role: "assistant" | "error" | "user";
|
|
1187
1144
|
}
|
|
1188
1145
|
/**
|
|
1189
1146
|
* ActivityEntry is a permanent transcript row for one agent tool action, keyed by
|
|
@@ -1195,28 +1152,28 @@ interface MessageEntry {
|
|
|
1195
1152
|
* `name`/`input` are null.
|
|
1196
1153
|
*/
|
|
1197
1154
|
interface ActivityEntry {
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1155
|
+
/**
|
|
1156
|
+
* Why an abandoned action was given up on. `timeout` means nothing came back
|
|
1157
|
+
* within the run's window, which usually means this browser went away or the tool
|
|
1158
|
+
* hung; `closed` means the run was stopped while the action was still outstanding,
|
|
1159
|
+
* which is the user's own doing and not a fault. Null on every other status.
|
|
1160
|
+
*/
|
|
1161
|
+
abandonedReason: "timeout" | "closed" | null;
|
|
1162
|
+
error: string | null;
|
|
1163
|
+
id: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* What the run will try about this failure, from the tool's playbook entry.
|
|
1166
|
+
* Null when the tool succeeded, or when the playbook has nothing for that
|
|
1167
|
+
* (tool, code) pair. It turns a silent retry into something the user can see the
|
|
1168
|
+
* shape of, which is the difference between the co-pilot looking stuck and
|
|
1169
|
+
* looking like it is working.
|
|
1170
|
+
*/
|
|
1171
|
+
recovery: string | null;
|
|
1172
|
+
input: string | null;
|
|
1173
|
+
label: string | null;
|
|
1174
|
+
name: string | null;
|
|
1175
|
+
role: "activity";
|
|
1176
|
+
status: ActivityStatus;
|
|
1220
1177
|
}
|
|
1221
1178
|
/**
|
|
1222
1179
|
* WarningEntry is an informational transcript row: the run answered, and the
|
|
@@ -1227,9 +1184,9 @@ interface ActivityEntry {
|
|
|
1227
1184
|
* publishes once is a fact about that moment.
|
|
1228
1185
|
*/
|
|
1229
1186
|
interface WarningEntry {
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1187
|
+
id: string;
|
|
1188
|
+
lines: readonly string[];
|
|
1189
|
+
role: "warning";
|
|
1233
1190
|
}
|
|
1234
1191
|
/**
|
|
1235
1192
|
* QuestionOption is one selectable answer on a question card: the label the
|
|
@@ -1243,8 +1200,8 @@ interface WarningEntry {
|
|
|
1243
1200
|
* route instead of only saying its name.
|
|
1244
1201
|
*/
|
|
1245
1202
|
interface QuestionOption {
|
|
1246
|
-
|
|
1247
|
-
|
|
1203
|
+
description: string | null;
|
|
1204
|
+
label: string;
|
|
1248
1205
|
}
|
|
1249
1206
|
/**
|
|
1250
1207
|
* QuestionEntry is a structured question the assistant asked: the question with
|
|
@@ -1256,12 +1213,12 @@ interface QuestionOption {
|
|
|
1256
1213
|
* offers buttons invites a second answer the run is not waiting for.
|
|
1257
1214
|
*/
|
|
1258
1215
|
interface QuestionEntry {
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1216
|
+
id: string;
|
|
1217
|
+
options: readonly QuestionOption[];
|
|
1218
|
+
question: string;
|
|
1219
|
+
role: "question";
|
|
1220
|
+
selected: string | null;
|
|
1221
|
+
settled: boolean;
|
|
1265
1222
|
}
|
|
1266
1223
|
/**
|
|
1267
1224
|
* SuggestionCardCandidate is one generated route option on a suggestions card:
|
|
@@ -1273,11 +1230,11 @@ interface QuestionEntry {
|
|
|
1273
1230
|
* reader's preference.
|
|
1274
1231
|
*/
|
|
1275
1232
|
interface SuggestionCardCandidate {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1233
|
+
ascentMeters: number;
|
|
1234
|
+
color: string;
|
|
1235
|
+
distanceMeters: number;
|
|
1236
|
+
durationSeconds: number;
|
|
1237
|
+
seed: number;
|
|
1281
1238
|
}
|
|
1282
1239
|
/**
|
|
1283
1240
|
* SuggestionsEntry is a generated route-candidate batch rendered as an
|
|
@@ -1291,11 +1248,11 @@ interface SuggestionCardCandidate {
|
|
|
1291
1248
|
* pick nothing is waiting for.
|
|
1292
1249
|
*/
|
|
1293
1250
|
interface SuggestionsEntry {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1251
|
+
candidates: readonly SuggestionCardCandidate[];
|
|
1252
|
+
chosenSeed: number | null;
|
|
1253
|
+
id: string;
|
|
1254
|
+
role: "suggestions";
|
|
1255
|
+
settled: boolean;
|
|
1299
1256
|
}
|
|
1300
1257
|
/**
|
|
1301
1258
|
* TranscriptEntry is one turn in a chat's conversation: a spoken message
|
|
@@ -1315,23 +1272,23 @@ type TranscriptEntry = ActivityEntry | MessageEntry | QuestionEntry | Suggestion
|
|
|
1315
1272
|
* transcript unchanged. A question with no options appends nothing: it would
|
|
1316
1273
|
* render a card the user cannot answer.
|
|
1317
1274
|
*/
|
|
1318
|
-
declare const appendQuestionEntry: <T extends readonly TranscriptEntry[]>(transcript: T, question: {
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1275
|
+
export declare const appendQuestionEntry: <T extends readonly TranscriptEntry[]>(transcript: T, question: {
|
|
1276
|
+
options: readonly QuestionOption[];
|
|
1277
|
+
question: string;
|
|
1278
|
+
toolCallId: string;
|
|
1322
1279
|
}) => T | TranscriptEntry[];
|
|
1323
1280
|
/**
|
|
1324
1281
|
* answerQuestionEntry settles the question card carrying the entry id with the
|
|
1325
1282
|
* label the user picked. A card that already settled is never re-settled: a
|
|
1326
1283
|
* double click races the send, and the first answer is the one that was sent.
|
|
1327
1284
|
*/
|
|
1328
|
-
declare const answerQuestionEntry: (transcript: readonly TranscriptEntry[], entryId: string, label: string) => TranscriptEntry[];
|
|
1285
|
+
export declare const answerQuestionEntry: (transcript: readonly TranscriptEntry[], entryId: string, label: string) => TranscriptEntry[];
|
|
1329
1286
|
/**
|
|
1330
1287
|
* settleOpenQuestionEntries settles every still-open question card with no
|
|
1331
1288
|
* pick. Called when the user answers in their own words: the reply supersedes
|
|
1332
1289
|
* the buttons, so they go inert without any option marked as chosen.
|
|
1333
1290
|
*/
|
|
1334
|
-
declare const settleOpenQuestionEntries: <T extends readonly TranscriptEntry[]>(transcript: T) => T | TranscriptEntry[];
|
|
1291
|
+
export declare const settleOpenQuestionEntries: <T extends readonly TranscriptEntry[]>(transcript: T) => T | TranscriptEntry[];
|
|
1335
1292
|
/**
|
|
1336
1293
|
* appendSuggestionsEntry appends one route-candidate batch as an open card keyed
|
|
1337
1294
|
* off the generating tool call's id. A re-render or a replayed frame can emit
|
|
@@ -1341,29 +1298,29 @@ declare const settleOpenQuestionEntries: <T extends readonly TranscriptEntry[]>(
|
|
|
1341
1298
|
* still-open one (a regenerate replaced those candidates in the live session),
|
|
1342
1299
|
* so prior open suggestions cards settle inert in the same write.
|
|
1343
1300
|
*/
|
|
1344
|
-
declare const appendSuggestionsEntry: <T extends readonly TranscriptEntry[]>(transcript: T, suggestions: {
|
|
1345
|
-
|
|
1346
|
-
|
|
1301
|
+
export declare const appendSuggestionsEntry: <T extends readonly TranscriptEntry[]>(transcript: T, suggestions: {
|
|
1302
|
+
candidates: readonly SuggestionCardCandidate[];
|
|
1303
|
+
entryId: string;
|
|
1347
1304
|
}) => T | TranscriptEntry[];
|
|
1348
1305
|
/**
|
|
1349
1306
|
* chooseSuggestionEntry settles the suggestions card carrying the entry id with
|
|
1350
1307
|
* the seed the user picked. A card that already settled is never re-settled: a
|
|
1351
1308
|
* double click races the staging chain, and the first pick is the one that ran.
|
|
1352
1309
|
*/
|
|
1353
|
-
declare const chooseSuggestionEntry: (transcript: readonly TranscriptEntry[], entryId: string, seed: number) => TranscriptEntry[];
|
|
1310
|
+
export declare const chooseSuggestionEntry: (transcript: readonly TranscriptEntry[], entryId: string, seed: number) => TranscriptEntry[];
|
|
1354
1311
|
/**
|
|
1355
1312
|
* settleOpenSuggestionEntries settles every still-open suggestions card with no
|
|
1356
1313
|
* pick. Called when the user replies in their own words (the reply supersedes
|
|
1357
1314
|
* the rows, and the run may be about to regenerate) and by a fresh batch's append:
|
|
1358
1315
|
* both leave the old card inert without any candidate marked as chosen.
|
|
1359
1316
|
*/
|
|
1360
|
-
declare const settleOpenSuggestionEntries: <T extends readonly TranscriptEntry[]>(transcript: T) => T | TranscriptEntry[];
|
|
1317
|
+
export declare const settleOpenSuggestionEntries: <T extends readonly TranscriptEntry[]>(transcript: T) => T | TranscriptEntry[];
|
|
1361
1318
|
/**
|
|
1362
1319
|
* appendWarningEntry appends one informational warning row. Empty lines append
|
|
1363
1320
|
* nothing: a warning with nothing to say would render an empty orange box, which
|
|
1364
1321
|
* reads as a rendering bug rather than information.
|
|
1365
1322
|
*/
|
|
1366
|
-
declare const appendWarningEntry: <T extends readonly TranscriptEntry[]>(transcript: T, lines: readonly string[]) => T | TranscriptEntry[];
|
|
1323
|
+
export declare const appendWarningEntry: <T extends readonly TranscriptEntry[]>(transcript: T, lines: readonly string[]) => T | TranscriptEntry[];
|
|
1367
1324
|
/**
|
|
1368
1325
|
* appendErrorEntry appends one error row carrying a message already resolved for
|
|
1369
1326
|
* display. Resolving the copy is the caller's job (the same fault reads
|
|
@@ -1374,13 +1331,13 @@ declare const appendWarningEntry: <T extends readonly TranscriptEntry[]>(transcr
|
|
|
1374
1331
|
* would otherwise be hand-rolled at each call site, which is how an entry ends up
|
|
1375
1332
|
* with a subtly different shape depending on where it was built.
|
|
1376
1333
|
*/
|
|
1377
|
-
declare const appendErrorEntry: <E extends {
|
|
1378
|
-
|
|
1379
|
-
|
|
1334
|
+
export declare const appendErrorEntry: <E extends {
|
|
1335
|
+
id: string;
|
|
1336
|
+
role: string;
|
|
1380
1337
|
}>(transcript: readonly E[], message: string) => (E | {
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1338
|
+
content: string;
|
|
1339
|
+
id: string;
|
|
1340
|
+
role: "error";
|
|
1384
1341
|
})[];
|
|
1385
1342
|
/**
|
|
1386
1343
|
* appendUserEntry appends one turn the user spoke. It is the counterpart to
|
|
@@ -1392,13 +1349,13 @@ declare const appendErrorEntry: <E extends {
|
|
|
1392
1349
|
* (the co-pilot settles them, the video director has none), so it stays with the
|
|
1393
1350
|
* caller rather than being buried in an append.
|
|
1394
1351
|
*/
|
|
1395
|
-
declare const appendUserEntry: <E extends {
|
|
1396
|
-
|
|
1397
|
-
|
|
1352
|
+
export declare const appendUserEntry: <E extends {
|
|
1353
|
+
id: string;
|
|
1354
|
+
role: string;
|
|
1398
1355
|
}>(transcript: readonly E[], content: string) => (E | {
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1356
|
+
content: string;
|
|
1357
|
+
id: string;
|
|
1358
|
+
role: "user";
|
|
1402
1359
|
})[];
|
|
1403
1360
|
/**
|
|
1404
1361
|
* PendingConfirmation is a destructive tool a run is waiting on the user to
|
|
@@ -1409,8 +1366,8 @@ declare const appendUserEntry: <E extends {
|
|
|
1409
1366
|
* card shows the title alone).
|
|
1410
1367
|
*/
|
|
1411
1368
|
interface PendingConfirmation {
|
|
1412
|
-
|
|
1413
|
-
|
|
1369
|
+
name: string;
|
|
1370
|
+
summary: string | null;
|
|
1414
1371
|
}
|
|
1415
1372
|
/**
|
|
1416
1373
|
* appendActivityEntry appends one tool action as a permanent running row keyed by
|
|
@@ -1419,10 +1376,10 @@ interface PendingConfirmation {
|
|
|
1419
1376
|
* unchanged rather than a duplicate row. Shared by the co-pilot threads store and
|
|
1420
1377
|
* the director store so both record actions with identical semantics.
|
|
1421
1378
|
*/
|
|
1422
|
-
declare const appendActivityEntry: <T extends readonly TranscriptEntry[]>(transcript: T, activity: {
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1379
|
+
export declare const appendActivityEntry: <T extends readonly TranscriptEntry[]>(transcript: T, activity: {
|
|
1380
|
+
input: string | null;
|
|
1381
|
+
name: string;
|
|
1382
|
+
toolCallId: string;
|
|
1426
1383
|
}) => T | TranscriptEntry[];
|
|
1427
1384
|
/**
|
|
1428
1385
|
* settleActivityEntry settles the running activity row carrying the call id in
|
|
@@ -1436,7 +1393,7 @@ declare const appendActivityEntry: <T extends readonly TranscriptEntry[]>(transc
|
|
|
1436
1393
|
* already-settled row. Shared by both chat stores so the settle semantics never
|
|
1437
1394
|
* drift.
|
|
1438
1395
|
*/
|
|
1439
|
-
declare const settleActivityEntry: <T extends readonly TranscriptEntry[]>(transcript: T, toolCallId: string, outcome: ToolActivityOutcome) => T | TranscriptEntry[];
|
|
1396
|
+
export declare const settleActivityEntry: <T extends readonly TranscriptEntry[]>(transcript: T, toolCallId: string, outcome: ToolActivityOutcome) => T | TranscriptEntry[];
|
|
1440
1397
|
/**
|
|
1441
1398
|
* AssistantTurn is a freshly-minted assistant reply: a stable render key (which
|
|
1442
1399
|
* survives token accumulation, since the running reply is rebuilt as tokens
|
|
@@ -1445,23 +1402,23 @@ declare const settleActivityEntry: <T extends readonly TranscriptEntry[]>(transc
|
|
|
1445
1402
|
* assistant's, so both helpers return it alongside the caller's own entry type.
|
|
1446
1403
|
*/
|
|
1447
1404
|
interface AssistantTurn {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1405
|
+
content: string;
|
|
1406
|
+
id: string;
|
|
1407
|
+
/**
|
|
1408
|
+
* The reply's zero-based position among the run's assistant messages, set from the
|
|
1409
|
+
* settled `message` event. Absent while the turn is still accumulating tokens (the
|
|
1410
|
+
* run numbers a message when it completes one, not per token), and absent for a
|
|
1411
|
+
* reply from a gateway that sends no index.
|
|
1412
|
+
*/
|
|
1413
|
+
messageIndex?: number | undefined;
|
|
1414
|
+
role: "assistant";
|
|
1458
1415
|
}
|
|
1459
1416
|
/**
|
|
1460
1417
|
* mintEntryId mints a stable render key for a new transcript entry, as {@link localId} mints
|
|
1461
1418
|
* one: a version 4 UUID where the runtime draws one, outside a secure context too, and an id
|
|
1462
1419
|
* counted in the page where it has no cryptographic source.
|
|
1463
1420
|
*/
|
|
1464
|
-
declare const mintEntryId: () => string;
|
|
1421
|
+
export declare const mintEntryId: () => string;
|
|
1465
1422
|
/**
|
|
1466
1423
|
* accumulateAssistant appends a streamed delta to the last assistant entry,
|
|
1467
1424
|
* keeping its id so the running turn's render key is stable across tokens, or
|
|
@@ -1479,9 +1436,9 @@ declare const mintEntryId: () => string;
|
|
|
1479
1436
|
* continues itself, e.g. after a response cut at the provider's length ceiling)
|
|
1480
1437
|
* would grow the finished reply with the next one's tokens.
|
|
1481
1438
|
*/
|
|
1482
|
-
declare const accumulateAssistant: <E extends {
|
|
1483
|
-
|
|
1484
|
-
|
|
1439
|
+
export declare const accumulateAssistant: <E extends {
|
|
1440
|
+
id: string;
|
|
1441
|
+
role: string;
|
|
1485
1442
|
}>(transcript: readonly E[], delta: string) => (E | AssistantTurn)[];
|
|
1486
1443
|
/**
|
|
1487
1444
|
* replaceAssistant sets the last assistant turn's full text (a settled `message`
|
|
@@ -1509,11 +1466,10 @@ declare const accumulateAssistant: <E extends {
|
|
|
1509
1466
|
* conversation reads as the assistant's side alone. Restoring both sides needs the
|
|
1510
1467
|
* run's transcript read back from the API rather than reconstructed from its events.
|
|
1511
1468
|
*/
|
|
1512
|
-
declare const replaceAssistant: <E extends {
|
|
1513
|
-
|
|
1514
|
-
|
|
1469
|
+
export declare const replaceAssistant: <E extends {
|
|
1470
|
+
id: string;
|
|
1471
|
+
role: string;
|
|
1515
1472
|
}>(transcript: readonly E[], content: string, messageIndex?: number) => (E | AssistantTurn)[];
|
|
1516
|
-
|
|
1517
1473
|
/**
|
|
1518
1474
|
* ConversationWriter is the narrow store surface a fault writes through: the
|
|
1519
1475
|
* error turn it appends, the run id it drops, and the lifecycle state it parks
|
|
@@ -1523,9 +1479,9 @@ declare const replaceAssistant: <E extends {
|
|
|
1523
1479
|
* caller and never enters this module.
|
|
1524
1480
|
*/
|
|
1525
1481
|
interface ConversationWriter {
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1482
|
+
appendError(message: string): void;
|
|
1483
|
+
setRunId(runId: string | null): void;
|
|
1484
|
+
setSessionState(state: AgentEngineState): void;
|
|
1529
1485
|
}
|
|
1530
1486
|
/**
|
|
1531
1487
|
* ConversationFaultCopy is the already-localized copy a fault surfaces, so this
|
|
@@ -1537,33 +1493,33 @@ interface ConversationWriter {
|
|
|
1537
1493
|
* rateLimited and tooLarge are the refusals of a request the gateway would not take as sent.
|
|
1538
1494
|
*/
|
|
1539
1495
|
interface ConversationFaultCopy {
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1496
|
+
generic: string;
|
|
1497
|
+
missingOrganization: string;
|
|
1498
|
+
/**
|
|
1499
|
+
* What a viewer reads when the run is refused for their role or their membership: a 403, or the
|
|
1500
|
+
* 404 a start answers for an organization the reader does not belong to. A 404 refusing the
|
|
1501
|
+
* stream of a run that opened is a run the gateway no longer holds, and reads `generic`.
|
|
1502
|
+
*/
|
|
1503
|
+
noAccess: string;
|
|
1504
|
+
/** What a viewer reads when the organization has no AI provider configured (409). */
|
|
1505
|
+
notConfigured: string;
|
|
1506
|
+
/**
|
|
1507
|
+
* What a viewer reads when the organization's agreement does not include the product (402):
|
|
1508
|
+
* a fact a retry never changes.
|
|
1509
|
+
*/
|
|
1510
|
+
notEntitled: string;
|
|
1511
|
+
/**
|
|
1512
|
+
* What a viewer reads when the gateway refused a start or a follow-up for its rate (429) after
|
|
1513
|
+
* the client's own waits ran out: a moment later, the same message goes through.
|
|
1514
|
+
*/
|
|
1515
|
+
rateLimited: string;
|
|
1516
|
+
/**
|
|
1517
|
+
* What a viewer reads when the gateway refused a start or a follow-up as too large (413): the
|
|
1518
|
+
* body over its ceiling, or what the run would be handed, the tools the page provides included,
|
|
1519
|
+
* over the payload bound once encoded. The same request meets the same answer, so the line
|
|
1520
|
+
* says what changes it rather than asking for a retry.
|
|
1521
|
+
*/
|
|
1522
|
+
tooLarge: string;
|
|
1567
1523
|
}
|
|
1568
1524
|
/**
|
|
1569
1525
|
* ConversationFaultsConfig is what one conversation's fault handling writes through: the
|
|
@@ -1571,50 +1527,50 @@ interface ConversationFaultCopy {
|
|
|
1571
1527
|
* seams the host answers.
|
|
1572
1528
|
*/
|
|
1573
1529
|
interface ConversationFaultsConfig {
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1530
|
+
copy: ConversationFaultCopy;
|
|
1531
|
+
/**
|
|
1532
|
+
* invalidateAiConfig refreshes the organization's AI-config read after the
|
|
1533
|
+
* gateway reports the credential is gone, so the surface flips to its setup
|
|
1534
|
+
* card instead of offering a conversation that cannot start.
|
|
1535
|
+
*
|
|
1536
|
+
* Optional, because its absence is a defined answer rather than a gap: a host with no
|
|
1537
|
+
* cache of its own has nothing to mark stale, and the config is re-read on the next
|
|
1538
|
+
* natural fetch. The fault still surfaces its message either way: the invalidation
|
|
1539
|
+
* only decides how soon the surface notices the credential is gone. It is called once the
|
|
1540
|
+
* fault is written, and one that throws reaches the program as an uncaught error on a
|
|
1541
|
+
* microtask, so the fault is written whatever it does.
|
|
1542
|
+
*/
|
|
1543
|
+
invalidateAiConfig?(organizationId: string): void;
|
|
1544
|
+
/**
|
|
1545
|
+
* invalidateMemberships marks the viewer's memberships stale after the gateway refused or
|
|
1546
|
+
* ended a run for want of access, so the surface's notice follows the role the viewer holds
|
|
1547
|
+
* now: a start, or the stream of the run it opened, answered 402, 403 or 404, and a follow-up
|
|
1548
|
+
* the gateway answered 404 because its run is closed, which is what becomes of a run whose
|
|
1549
|
+
* member lost access to its organization.
|
|
1550
|
+
*
|
|
1551
|
+
* Optional, for the reason {@link ConversationFaultsConfig.invalidateAiConfig} is: a host with
|
|
1552
|
+
* no cache of its own re-reads the memberships on its next natural fetch, and the fault still
|
|
1553
|
+
* surfaces its message either way. Called as that one is, once the fault is written.
|
|
1554
|
+
*/
|
|
1555
|
+
invalidateMemberships?(): void;
|
|
1556
|
+
/**
|
|
1557
|
+
* onSignInRefused tells the host the API refused the credential the conversation runs on: a
|
|
1558
|
+
* run's start, the stream of a run it opened or reconnected to, or a follow-up was answered 401.
|
|
1559
|
+
* Under the browser's own session that is a sign-in the API no longer accepts, so the host asks
|
|
1560
|
+
* whether the person is still signed in and, when nobody is, sends them to sign in.
|
|
1561
|
+
*
|
|
1562
|
+
* Called once per refusal, as the invalidations are, once the fault is written. A 401 says
|
|
1563
|
+
* nothing of the viewer's access, so the memberships are not read again for it. Optional, for
|
|
1564
|
+
* the reason {@link ConversationFaultsConfig.invalidateAiConfig} is: the fault still surfaces
|
|
1565
|
+
* its message either way.
|
|
1566
|
+
*/
|
|
1567
|
+
onSignInRefused?: (() => void) | undefined;
|
|
1568
|
+
/**
|
|
1569
|
+
* onSettled runs after a fault is written, for a host that mirrors run ids into the URL, as
|
|
1570
|
+
* the co-pilot does.
|
|
1571
|
+
*/
|
|
1572
|
+
onSettled?(): void;
|
|
1573
|
+
writer: ConversationWriter;
|
|
1618
1574
|
}
|
|
1619
1575
|
/**
|
|
1620
1576
|
* ConversationFaults is the ways a conversation fails outside its own event
|
|
@@ -1628,40 +1584,40 @@ interface ConversationFaultsConfig {
|
|
|
1628
1584
|
* may leave behind.
|
|
1629
1585
|
*/
|
|
1630
1586
|
interface ConversationFaults {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1587
|
+
/**
|
|
1588
|
+
* handleStartError maps a rejection of the run's start or of its read onto the surface's copy.
|
|
1589
|
+
*
|
|
1590
|
+
* @param organizationId The organization the run was started in.
|
|
1591
|
+
* @param error What the start rejected with.
|
|
1592
|
+
* @param runId The run the start opened, when it was the run's stream that failed, as
|
|
1593
|
+
* `ConversationHostConfig.onStartError` reports it. A 404 then says the gateway no longer
|
|
1594
|
+
* holds the run (it expired, or its member lost the write role it was started under), and
|
|
1595
|
+
* reads the generic copy rather than the no-access one a refused start reads.
|
|
1596
|
+
*/
|
|
1597
|
+
handleStartError(organizationId: string, error: unknown, runId?: string | undefined): void;
|
|
1598
|
+
missingOrganization(): void;
|
|
1599
|
+
/**
|
|
1600
|
+
* recover surfaces the copy of a follow-up's failure and re-enables input: the too-large or the
|
|
1601
|
+
* rate-limited line for a 413 or a 429, and the generic one otherwise.
|
|
1602
|
+
*
|
|
1603
|
+
* @param runGone Whether the failure says the run is gone, as
|
|
1604
|
+
* `ConversationHostConfig.onSendFault` reports it. The run id is dropped only then, so a
|
|
1605
|
+
* reload resumes a run the conversation kept and never one it has left.
|
|
1606
|
+
* @param error What the follow-up failed with. The memberships are read again only when the
|
|
1607
|
+
* gateway answered it 404, which is what a run closed for want of access answers, and never
|
|
1608
|
+
* for the engine's own refusal of a run it already let go.
|
|
1609
|
+
*/
|
|
1610
|
+
recover(runGone: boolean, error?: unknown): void;
|
|
1611
|
+
/**
|
|
1612
|
+
* resumeFailed settles a conversation whose reconnect to the run it held failed for good, as
|
|
1613
|
+
* `ConversationHost.resume` reports it: the run id is dropped, so a reload reconnects to no run
|
|
1614
|
+
* that is gone, and input is re-enabled. It writes no line: the transcript the reconnect would
|
|
1615
|
+
* have continued stands as it was, and the next message opens a run.
|
|
1616
|
+
*
|
|
1617
|
+
* @param error What the reconnect failed with. A 401 tells the host the API refused its
|
|
1618
|
+
* credential, as a start's does (see {@link ConversationFaultsConfig.onSignInRefused}).
|
|
1619
|
+
*/
|
|
1620
|
+
resumeFailed(error: unknown): void;
|
|
1665
1621
|
}
|
|
1666
1622
|
/**
|
|
1667
1623
|
* createConversationFaults binds the shared fault handling to one conversation's
|
|
@@ -1673,8 +1629,7 @@ interface ConversationFaults {
|
|
|
1673
1629
|
* Dropping the run id keeps a reload from resuming a run the conversation has left: a
|
|
1674
1630
|
* start that failed, or a run a follow-up found gone.
|
|
1675
1631
|
*/
|
|
1676
|
-
declare const createConversationFaults: (config: ConversationFaultsConfig) => ConversationFaults;
|
|
1677
|
-
|
|
1632
|
+
export declare const createConversationFaults: (config: ConversationFaultsConfig) => ConversationFaults;
|
|
1678
1633
|
/**
|
|
1679
1634
|
* ConversationHostConfig wires a host to one conversation's world: how it records
|
|
1680
1635
|
* the user's turn, resolves the run's organization and point-in-time context,
|
|
@@ -1684,58 +1639,58 @@ declare const createConversationFaults: (config: ConversationFaultsConfig) => Co
|
|
|
1684
1639
|
* them: the host itself knows only the start/send/resume lifecycle.
|
|
1685
1640
|
*/
|
|
1686
1641
|
interface ConversationHostConfig {
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1642
|
+
/** appendUserMessage records the user's outgoing turn before the run is touched. */
|
|
1643
|
+
appendUserMessage(message: string): void;
|
|
1644
|
+
/**
|
|
1645
|
+
* buildContext resolves the point-in-time snapshot the run opens with, or
|
|
1646
|
+
* undefined for a contextless start. It must not reject (a snapshot failure
|
|
1647
|
+
* resolves undefined), so only a start rejection routes to onStartError.
|
|
1648
|
+
*/
|
|
1649
|
+
buildContext(): Promise<Record<string, unknown> | undefined>;
|
|
1650
|
+
/** buildSession builds a fresh session wired to the surface's observer. */
|
|
1651
|
+
buildSession(): AgentEngine;
|
|
1652
|
+
/** onMissingOrganization surfaces that there is no resource to scope a run to. */
|
|
1653
|
+
onMissingOrganization(): void;
|
|
1654
|
+
/**
|
|
1655
|
+
* onSendFault reports a follow-up message that did not reach its run.
|
|
1656
|
+
*
|
|
1657
|
+
* @param error What the send rejected with.
|
|
1658
|
+
* @param runGone Whether the failure says the run is gone: the engine refused the message
|
|
1659
|
+
* (the run ended, or the engine was disposed) or the gateway answered 404. The host then
|
|
1660
|
+
* clears its guard and the next message opens a new run. Otherwise the run is kept, and
|
|
1661
|
+
* the next message is posted into it.
|
|
1662
|
+
*/
|
|
1663
|
+
onSendFault(error: unknown, runGone: boolean): void;
|
|
1664
|
+
/**
|
|
1665
|
+
* onStartError maps a rejection of the run's start or of its read onto the surface's copy.
|
|
1666
|
+
*
|
|
1667
|
+
* @param organizationId The organization the run was started in.
|
|
1668
|
+
* @param error What the start rejected with.
|
|
1669
|
+
* @param runId The run the start opened, when its post answered and its stream then failed for
|
|
1670
|
+
* good. Absent when the start opened no run: the gateway refused it, or it never reached the
|
|
1671
|
+
* gateway. A status means something else on each: a 404 refusing the start is an
|
|
1672
|
+
* organization the reader does not reach, and a 404 refusing the stream of an opened run is
|
|
1673
|
+
* a run the gateway no longer holds.
|
|
1674
|
+
*/
|
|
1675
|
+
onStartError(organizationId: string, error: unknown, runId?: string | undefined): void;
|
|
1676
|
+
/**
|
|
1677
|
+
* routeForMessage lets the surface pick the tool set this turn should offer
|
|
1678
|
+
* before the message reaches the run. It is called for every message, first
|
|
1679
|
+
* one included, so the run OPENS on the routed set rather than being narrowed
|
|
1680
|
+
* only from the second turn on. Optional: a surface with no router omits it and
|
|
1681
|
+
* the session offers every permitted tool.
|
|
1682
|
+
*/
|
|
1683
|
+
routeForMessage?(message: string): void;
|
|
1684
|
+
/**
|
|
1685
|
+
* routeForState lets the surface re-pick the tool set from LIVE state, with no
|
|
1686
|
+
* new message. It is what makes a surface the run itself unlocks reachable: a
|
|
1687
|
+
* router keyed only on the user's words cannot know that the run just opened a
|
|
1688
|
+
* suggest session, so without this the tools it unlocked stay invisible until
|
|
1689
|
+
* the user happens to type again. Optional, exactly as routeForMessage.
|
|
1690
|
+
*/
|
|
1691
|
+
routeForState?(): void;
|
|
1692
|
+
/** resolveOrganizationId reads the org that owns the resource the run acts on. */
|
|
1693
|
+
resolveOrganizationId(): string | null | undefined;
|
|
1739
1694
|
}
|
|
1740
1695
|
/**
|
|
1741
1696
|
* ConversationHost is one AI conversation's session lifecycle: it opens a run on
|
|
@@ -1751,55 +1706,55 @@ interface ConversationHostConfig {
|
|
|
1751
1706
|
* alone recovers the conversation.
|
|
1752
1707
|
*/
|
|
1753
1708
|
interface ConversationHost {
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1709
|
+
/**
|
|
1710
|
+
* dispose aborts the session's open stream and parked consumer; idempotent.
|
|
1711
|
+
*
|
|
1712
|
+
* It asks the gateway nothing, so the run goes on there, and the host keeps where the session
|
|
1713
|
+
* stood in it: a {@link ConversationHost.resume} of that run is read on from that position by
|
|
1714
|
+
* the session it builds, and hands the conversation nothing a second time.
|
|
1715
|
+
*/
|
|
1716
|
+
dispose(): void;
|
|
1717
|
+
/** finish asks the run to close (POST close), then disposes the session. */
|
|
1718
|
+
finish(): void;
|
|
1719
|
+
/**
|
|
1720
|
+
* reroute re-reads the router from live state and carries the resulting tool
|
|
1721
|
+
* set into the open run. A no-op when no run is open, and free when the
|
|
1722
|
+
* selection has not moved: the session drops an unchanged manifest itself.
|
|
1723
|
+
*/
|
|
1724
|
+
reroute(): void;
|
|
1725
|
+
/**
|
|
1726
|
+
* restart ends the conversation's run and eagerly swaps in a fresh session: it asks the run to
|
|
1727
|
+
* close (POST close), as {@link ConversationHost.finish} does, then disposes the live session
|
|
1728
|
+
* and builds the next one. The close covers a run the session gave up reading and still owes
|
|
1729
|
+
* one, so a stopped run spends no more of the gateway's model budget.
|
|
1730
|
+
*/
|
|
1731
|
+
restart(): void;
|
|
1732
|
+
/**
|
|
1733
|
+
* resume builds the session so its observer is wired the moment the conversation
|
|
1734
|
+
* mounts, and reconnects a persisted run exactly once. A null run id primes the
|
|
1735
|
+
* session without reconnecting; a resume fault clears the guard then calls
|
|
1736
|
+
* onFault with what the reconnect failed with, and a resumed run that ends clears the
|
|
1737
|
+
* guard without calling it. A resume that a later start or a restart replaced does
|
|
1738
|
+
* neither.
|
|
1739
|
+
*
|
|
1740
|
+
* The run is read on from where the session a {@link ConversationHost.dispose} tore down
|
|
1741
|
+
* stood in it, when that session read this run and its stream named a position. With no such
|
|
1742
|
+
* position (a host built after a reload, another run, a run that a finish or a restart
|
|
1743
|
+
* closed) the gateway answers with the run's history from its first event.
|
|
1744
|
+
*/
|
|
1745
|
+
resume(runId: string | null | undefined, onFault: (error: unknown) => void): void;
|
|
1746
|
+
/**
|
|
1747
|
+
* submit opens a run on the first message, and on the first message after a run ended,
|
|
1748
|
+
* or sends the follow-up into the open run.
|
|
1749
|
+
*
|
|
1750
|
+
* A follow-up submitted before that run has its id (while its context is captured, or while
|
|
1751
|
+
* its start is still being posted) is held and delivered once the run opens, the routed
|
|
1752
|
+
* tool set ahead of it. When the start fails, the held follow-up is dropped and
|
|
1753
|
+
* `onStartError` is the one report: `onSendFault` is for a message that failed on its way
|
|
1754
|
+
* into a run that was open. A follow-up that fails keeps the run unless the failure says the
|
|
1755
|
+
* run is gone (see {@link ConversationHostConfig.onSendFault}).
|
|
1756
|
+
*/
|
|
1757
|
+
submit(message: string): void;
|
|
1803
1758
|
}
|
|
1804
1759
|
/**
|
|
1805
1760
|
* createConversationHost builds the session lifecycle for one AI conversation over
|
|
@@ -1813,8 +1768,7 @@ interface ConversationHost {
|
|
|
1813
1768
|
* position a teardown parked), and a split would pass that state between modules for no
|
|
1814
1769
|
* reader's benefit.
|
|
1815
1770
|
*/
|
|
1816
|
-
declare const createConversationHost: (config: ConversationHostConfig) => ConversationHost;
|
|
1817
|
-
|
|
1771
|
+
export declare const createConversationHost: (config: ConversationHostConfig) => ConversationHost;
|
|
1818
1772
|
/**
|
|
1819
1773
|
* toWireErrorCode narrows a bus failure code to the vocabulary the wire carries.
|
|
1820
1774
|
*
|
|
@@ -1836,8 +1790,7 @@ declare const createConversationHost: (config: ConversationHostConfig) => Conver
|
|
|
1836
1790
|
* @returns The code when the wire carries it, `internal` for any other code, and undefined for
|
|
1837
1791
|
* none.
|
|
1838
1792
|
*/
|
|
1839
|
-
declare const toWireErrorCode: (code: string | undefined) => AgentToolErrorCode | undefined;
|
|
1840
|
-
|
|
1793
|
+
export declare const toWireErrorCode: (code: string | undefined) => AgentToolErrorCode | undefined;
|
|
1841
1794
|
/**
|
|
1842
1795
|
* AgentScriptedTransport is an {@link AgentTransport} that reaches no server, with the two
|
|
1843
1796
|
* controls a test or an offline demo drives a run's stream by. It is what
|
|
@@ -1881,18 +1834,18 @@ declare const toWireErrorCode: (code: string | undefined) => AgentToolErrorCode
|
|
|
1881
1834
|
* ```
|
|
1882
1835
|
*/
|
|
1883
1836
|
interface AgentScriptedTransport extends AgentTransport {
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1837
|
+
/**
|
|
1838
|
+
* endRun pushes the terminal `done`, with the reason `completed`, into the run's stream. Every
|
|
1839
|
+
* read of the run ends on it with `onClose("terminal")`. A run that was never started is
|
|
1840
|
+
* ignored.
|
|
1841
|
+
*/
|
|
1842
|
+
endRun: (runId: string) => void;
|
|
1843
|
+
/**
|
|
1844
|
+
* pushEvents appends events to the run's stream, in order, as they would arrive off the wire.
|
|
1845
|
+
* A subscriber waiting on the stream receives them at once, and one that subscribes later
|
|
1846
|
+
* receives them in the replay. A run that was never started is ignored.
|
|
1847
|
+
*/
|
|
1848
|
+
pushEvents: (runId: string, events: readonly AgentEvent[]) => void;
|
|
1896
1849
|
}
|
|
1897
1850
|
/**
|
|
1898
1851
|
* createAgentScriptedTransport is the transport that reaches no server: each run owns a single
|
|
@@ -1914,15 +1867,14 @@ interface AgentScriptedTransport extends AgentTransport {
|
|
|
1914
1867
|
* @param resolve Answers the events of the turn a user message opens, the start's message
|
|
1915
1868
|
* included.
|
|
1916
1869
|
*/
|
|
1917
|
-
declare const createAgentScriptedTransport: (resolve: (message: string) => AgentEvent[]) => AgentScriptedTransport;
|
|
1918
|
-
|
|
1870
|
+
export declare const createAgentScriptedTransport: (resolve: (message: string) => AgentEvent[]) => AgentScriptedTransport;
|
|
1919
1871
|
/**
|
|
1920
1872
|
* STICK_TO_BOTTOM_THRESHOLD_PX is the slack, in pixels, within which a scroll
|
|
1921
1873
|
* viewport still counts as sitting at its bottom. A few pixels absorb sub-pixel
|
|
1922
1874
|
* layout rounding and the gap between a new row mounting and its height settling,
|
|
1923
1875
|
* so a reader parked on the latest turn is never misread as having scrolled up.
|
|
1924
1876
|
*/
|
|
1925
|
-
declare const STICK_TO_BOTTOM_THRESHOLD_PX = 24;
|
|
1877
|
+
export declare const STICK_TO_BOTTOM_THRESHOLD_PX = 24;
|
|
1926
1878
|
/**
|
|
1927
1879
|
* ScrollViewportGeometry is the three measurements of a scroll viewport that
|
|
1928
1880
|
* {@link isPinnedToBottom} reads: how tall the viewport is, how tall its content is,
|
|
@@ -1933,9 +1885,9 @@ declare const STICK_TO_BOTTOM_THRESHOLD_PX = 24;
|
|
|
1933
1885
|
* supplies the numbers from whatever it scrolls. A DOM element passes as it is.
|
|
1934
1886
|
*/
|
|
1935
1887
|
interface ScrollViewportGeometry {
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1888
|
+
readonly clientHeight: number;
|
|
1889
|
+
readonly scrollHeight: number;
|
|
1890
|
+
readonly scrollTop: number;
|
|
1939
1891
|
}
|
|
1940
1892
|
/**
|
|
1941
1893
|
* isPinnedToBottom reports whether a scroll viewport is at (or within
|
|
@@ -1948,8 +1900,7 @@ interface ScrollViewportGeometry {
|
|
|
1948
1900
|
* at its bottom.
|
|
1949
1901
|
* @default threshold {@link STICK_TO_BOTTOM_THRESHOLD_PX}
|
|
1950
1902
|
*/
|
|
1951
|
-
declare const isPinnedToBottom: (viewport: ScrollViewportGeometry, threshold?: number) => boolean;
|
|
1952
|
-
|
|
1903
|
+
export declare const isPinnedToBottom: (viewport: ScrollViewportGeometry, threshold?: number) => boolean;
|
|
1953
1904
|
/**
|
|
1954
1905
|
* MAX_TOOL_RESULT_DATA_BYTES caps the structured payload one client tool result
|
|
1955
1906
|
* puts into the run's transcript. The transcript is replayed in full on every
|
|
@@ -1957,7 +1908,7 @@ declare const isPinnedToBottom: (viewport: ScrollViewportGeometry, threshold?: n
|
|
|
1957
1908
|
* each one; the gateway applies its own, larger cap to the whole result envelope
|
|
1958
1909
|
* behind this.
|
|
1959
1910
|
*/
|
|
1960
|
-
declare const MAX_TOOL_RESULT_DATA_BYTES = 4096;
|
|
1911
|
+
export declare const MAX_TOOL_RESULT_DATA_BYTES = 4096;
|
|
1961
1912
|
/**
|
|
1962
1913
|
* ToolResultPayload is the envelope a client tool's result rides in on a `tool-result` input:
|
|
1963
1914
|
* the human summary the model reads, the data it acted on, and the truncation report when that
|
|
@@ -1969,17 +1920,17 @@ declare const MAX_TOOL_RESULT_DATA_BYTES = 4096;
|
|
|
1969
1920
|
* prompt is written against it.
|
|
1970
1921
|
*/
|
|
1971
1922
|
type ToolResultPayload = {
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1923
|
+
data?: unknown;
|
|
1924
|
+
/** How many items of a truncated collection were sent. */
|
|
1925
|
+
returned?: number | undefined;
|
|
1926
|
+
/** The host's state delta the call produced, when the run asked for one. */
|
|
1927
|
+
state?: Record<string, unknown> | undefined;
|
|
1928
|
+
summary?: string | undefined;
|
|
1929
|
+
/** How many items the collection held before truncation. */
|
|
1930
|
+
total?: number | undefined;
|
|
1931
|
+
truncated?: boolean | undefined;
|
|
1932
|
+
/** Which field of a record was the one truncated, when it was a record rather than an array. */
|
|
1933
|
+
truncatedField?: string | undefined;
|
|
1983
1934
|
};
|
|
1984
1935
|
/**
|
|
1985
1936
|
* buildToolResultPayload assembles the result a client tool posts back, trimming
|
|
@@ -2010,7 +1961,6 @@ type ToolResultPayload = {
|
|
|
2010
1961
|
* an object, an array, or absent. It is passed in rather than derived here because
|
|
2011
1962
|
* only the caller holds the before and after readings.
|
|
2012
1963
|
*/
|
|
2013
|
-
declare const buildToolResultPayload: (summary: string, data: unknown, state?: Record<string, unknown>) => ToolResultPayload;
|
|
2014
|
-
|
|
2015
|
-
export { AgentEngine, MAX_TOOL_INPUT_CHARS, MAX_TOOL_RESULT_DATA_BYTES, STICK_TO_BOTTOM_THRESHOLD_PX, accumulateAssistant, answerQuestionEntry, appendActivityEntry, appendErrorEntry, appendQuestionEntry, appendSuggestionsEntry, appendUserEntry, appendWarningEntry, boundedInputJson, buildToolResultPayload, chooseSuggestionEntry, createAgentScriptedTransport, createConversationFaults, createConversationHost, isPinnedToBottom, mintEntryId, replaceAssistant, resolveAgentError, settleActivityEntry, settleOpenQuestionEntries, settleOpenSuggestionEntries, toWireErrorCode };
|
|
1964
|
+
export declare const buildToolResultPayload: (summary: string, data: unknown, state?: Record<string, unknown>) => ToolResultPayload;
|
|
2016
1965
|
export type { ActivityEntry, ActivityStatus, AgentBudgetCopy, AgentDraftWarning, AgentEngineConfig, AgentEngineState, AgentErrorCopy, AgentObserver, AgentScriptedTransport, AgentStreamPosition, AgentToolContext, AssistantTurn, ConversationFaultCopy, ConversationFaults, ConversationFaultsConfig, ConversationHost, ConversationHostConfig, ConversationState, ConversationWriter, MessageEntry, PendingConfirmation, QuestionEntry, QuestionOption, RecoveryLookup, ScrollViewportGeometry, ServerToolConfirmation, StateDelta, SuggestionCardCandidate, SuggestionsEntry, ToolActivityOutcome, ToolDispatchResult, ToolDispatcher, ToolManifestEntry, ToolResultPayload, TranscriptEntry, TranscriptRole, WarningEntry };
|
|
1966
|
+
//# sourceMappingURL=index.d.ts.map
|