@hashgraphonline/standards-sdk 0.1.190 → 0.1.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/hcs-25/adapters/ans-trust-discovery.d.ts +22 -0
- package/dist/browser/hcs-25/adapters/ans-trust-discovery.d.ts.map +1 -0
- package/dist/browser/hcs-25/adapters/index.d.ts +1 -0
- package/dist/browser/hcs-25/adapters/index.d.ts.map +1 -1
- package/dist/browser/hcs-25/collectors/ans-trust-discovery.d.ts +32 -0
- package/dist/browser/hcs-25/collectors/ans-trust-discovery.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/catalog.d.ts +9 -2
- package/dist/browser/hcs-25/collectors/catalog.d.ts.map +1 -1
- package/dist/browser/hcs-25/collectors/index.d.ts +1 -0
- package/dist/browser/hcs-25/collectors/index.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/ans-trust-discovery.d.ts +50 -0
- package/dist/browser/hcs-25/signals/ans-trust-discovery.d.ts.map +1 -0
- package/dist/browser/hcs-25/signals/index.d.ts +1 -0
- package/dist/browser/hcs-25/signals/index.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/ans-trust-discovery.d.ts +22 -0
- package/dist/browser-root/hcs-25/adapters/ans-trust-discovery.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/adapters/index.d.ts +1 -0
- package/dist/browser-root/hcs-25/adapters/index.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/collectors/ans-trust-discovery.d.ts +32 -0
- package/dist/browser-root/hcs-25/collectors/ans-trust-discovery.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/catalog.d.ts +9 -2
- package/dist/browser-root/hcs-25/collectors/catalog.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/collectors/index.d.ts +1 -0
- package/dist/browser-root/hcs-25/collectors/index.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/ans-trust-discovery.d.ts +50 -0
- package/dist/browser-root/hcs-25/signals/ans-trust-discovery.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/signals/index.d.ts +1 -0
- package/dist/browser-root/hcs-25/signals/index.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/ans-trust-discovery.d.ts +22 -0
- package/dist/cjs/hcs-25/adapters/ans-trust-discovery.d.ts.map +1 -0
- package/dist/cjs/hcs-25/adapters/index.d.ts +1 -0
- package/dist/cjs/hcs-25/adapters/index.d.ts.map +1 -1
- package/dist/cjs/hcs-25/collectors/ans-trust-discovery.d.ts +32 -0
- package/dist/cjs/hcs-25/collectors/ans-trust-discovery.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/catalog.d.ts +9 -2
- package/dist/cjs/hcs-25/collectors/catalog.d.ts.map +1 -1
- package/dist/cjs/hcs-25/collectors/index.d.ts +1 -0
- package/dist/cjs/hcs-25/collectors/index.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/ans-trust-discovery.d.ts +50 -0
- package/dist/cjs/hcs-25/signals/ans-trust-discovery.d.ts.map +1 -0
- package/dist/cjs/hcs-25/signals/index.d.ts +1 -0
- package/dist/cjs/hcs-25/signals/index.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +1 -1
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/hcs-25/adapters/ans-trust-discovery.d.ts +22 -0
- package/dist/es/hcs-25/adapters/ans-trust-discovery.d.ts.map +1 -0
- package/dist/es/hcs-25/adapters/index.d.ts +1 -0
- package/dist/es/hcs-25/adapters/index.d.ts.map +1 -1
- package/dist/es/hcs-25/collectors/ans-trust-discovery.d.ts +32 -0
- package/dist/es/hcs-25/collectors/ans-trust-discovery.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/catalog.d.ts +9 -2
- package/dist/es/hcs-25/collectors/catalog.d.ts.map +1 -1
- package/dist/es/hcs-25/collectors/index.d.ts +1 -0
- package/dist/es/hcs-25/collectors/index.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/ans-trust-discovery.d.ts +50 -0
- package/dist/es/hcs-25/signals/ans-trust-discovery.d.ts.map +1 -0
- package/dist/es/hcs-25/signals/index.d.ts +1 -0
- package/dist/es/hcs-25/signals/index.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +78 -71
- package/dist/es/standards-sdk.es.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +2 -2
- package/dist/es/standards-sdk.es103.js +2 -2
- package/dist/es/standards-sdk.es104.js +1 -1
- package/dist/es/standards-sdk.es106.js +1 -1
- package/dist/es/standards-sdk.es108.js +2 -2
- package/dist/es/standards-sdk.es11.js +1 -1
- package/dist/es/standards-sdk.es110.js +1 -1
- package/dist/es/standards-sdk.es111.js +2 -2
- package/dist/es/standards-sdk.es115.js +3 -3
- package/dist/es/standards-sdk.es116.js +4 -4
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es120.js +22 -4
- package/dist/es/standards-sdk.es120.js.map +1 -1
- package/dist/es/standards-sdk.es121.js +15 -12
- package/dist/es/standards-sdk.es121.js.map +1 -1
- package/dist/es/standards-sdk.es123.js +6 -5
- package/dist/es/standards-sdk.es123.js.map +1 -1
- package/dist/es/standards-sdk.es124.js +6 -5
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es127.js +6 -5
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es128.js +110 -136
- package/dist/es/standards-sdk.es128.js.map +1 -1
- package/dist/es/standards-sdk.es129.js +133 -141
- package/dist/es/standards-sdk.es129.js.map +1 -1
- package/dist/es/standards-sdk.es13.js +1 -1
- package/dist/es/standards-sdk.es130.js +135 -345
- package/dist/es/standards-sdk.es130.js.map +1 -1
- package/dist/es/standards-sdk.es131.js +332 -344
- package/dist/es/standards-sdk.es131.js.map +1 -1
- package/dist/es/standards-sdk.es132.js +338 -178
- package/dist/es/standards-sdk.es132.js.map +1 -1
- package/dist/es/standards-sdk.es133.js +200 -196
- package/dist/es/standards-sdk.es133.js.map +1 -1
- package/dist/es/standards-sdk.es134.js +216 -364
- package/dist/es/standards-sdk.es134.js.map +1 -1
- package/dist/es/standards-sdk.es135.js +358 -100
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es136.js +91 -220
- package/dist/es/standards-sdk.es136.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +173 -1250
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +1295 -98
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +109 -246
- package/dist/es/standards-sdk.es139.js.map +1 -1
- package/dist/es/standards-sdk.es14.js +1 -1
- package/dist/es/standards-sdk.es140.js +263 -97
- package/dist/es/standards-sdk.es140.js.map +1 -1
- package/dist/es/standards-sdk.es141.js +107 -248
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +246 -472
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +458 -85
- package/dist/es/standards-sdk.es143.js.map +1 -1
- package/dist/es/standards-sdk.es144.js +96 -151
- package/dist/es/standards-sdk.es144.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +155 -29
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es146.js +26 -4
- package/dist/es/standards-sdk.es146.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +10 -180
- package/dist/es/standards-sdk.es147.js.map +1 -1
- package/dist/es/standards-sdk.es148.js +179 -26
- package/dist/es/standards-sdk.es148.js.map +1 -1
- package/dist/es/standards-sdk.es149.js +27 -20
- package/dist/es/standards-sdk.es149.js.map +1 -1
- package/dist/es/standards-sdk.es15.js +1 -1
- package/dist/es/standards-sdk.es150.js +18 -156
- package/dist/es/standards-sdk.es150.js.map +1 -1
- package/dist/es/standards-sdk.es151.js +148 -190
- package/dist/es/standards-sdk.es151.js.map +1 -1
- package/dist/es/standards-sdk.es152.js +159 -747
- package/dist/es/standards-sdk.es152.js.map +1 -1
- package/dist/es/standards-sdk.es153.js +786 -9
- package/dist/es/standards-sdk.es153.js.map +1 -1
- package/dist/es/standards-sdk.es154.js +13 -567
- package/dist/es/standards-sdk.es154.js.map +1 -1
- package/dist/es/standards-sdk.es155.js +541 -600
- package/dist/es/standards-sdk.es155.js.map +1 -1
- package/dist/es/standards-sdk.es156.js +625 -12
- package/dist/es/standards-sdk.es156.js.map +1 -1
- package/dist/es/standards-sdk.es157.js +13 -2
- package/dist/es/standards-sdk.es157.js.map +1 -1
- package/dist/es/standards-sdk.es158.js +2 -87
- package/dist/es/standards-sdk.es158.js.map +1 -1
- package/dist/es/standards-sdk.es159.js +84 -37
- package/dist/es/standards-sdk.es159.js.map +1 -1
- package/dist/es/standards-sdk.es16.js +6 -6
- package/dist/es/standards-sdk.es160.js +40 -2
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +2 -235
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es162.js +204 -1109
- package/dist/es/standards-sdk.es162.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +1059 -225
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +303 -419
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +418 -351
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +347 -1114
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +1094 -180
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +153 -1512
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +1457 -1056
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +1163 -14
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +15 -449
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +440 -248
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +259 -4
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +4 -81
- package/dist/es/standards-sdk.es174.js.map +1 -1
- package/dist/es/standards-sdk.es175.js +71 -77
- package/dist/es/standards-sdk.es175.js.map +1 -1
- package/dist/es/standards-sdk.es176.js +80 -53
- package/dist/es/standards-sdk.es176.js.map +1 -1
- package/dist/es/standards-sdk.es177.js +59 -2546
- package/dist/es/standards-sdk.es177.js.map +1 -1
- package/dist/es/standards-sdk.es178.js +2547 -159
- package/dist/es/standards-sdk.es178.js.map +1 -1
- package/dist/es/standards-sdk.es179.js +159 -7
- package/dist/es/standards-sdk.es179.js.map +1 -1
- package/dist/es/standards-sdk.es18.js +13 -13
- package/dist/es/standards-sdk.es180.js +7 -86
- package/dist/es/standards-sdk.es180.js.map +1 -1
- package/dist/es/standards-sdk.es181.js +65 -44
- package/dist/es/standards-sdk.es181.js.map +1 -1
- package/dist/es/standards-sdk.es182.js +57 -188
- package/dist/es/standards-sdk.es182.js.map +1 -1
- package/dist/es/standards-sdk.es183.js +27 -26
- package/dist/es/standards-sdk.es183.js.map +1 -1
- package/dist/es/standards-sdk.es184.js +191 -53
- package/dist/es/standards-sdk.es184.js.map +1 -1
- package/dist/es/standards-sdk.es185.js +21 -109
- package/dist/es/standards-sdk.es185.js.map +1 -1
- package/dist/es/standards-sdk.es186.js +49 -47
- package/dist/es/standards-sdk.es186.js.map +1 -1
- package/dist/es/standards-sdk.es187.js +89 -205
- package/dist/es/standards-sdk.es187.js.map +1 -1
- package/dist/es/standards-sdk.es188.js +35 -58
- package/dist/es/standards-sdk.es188.js.map +1 -1
- package/dist/es/standards-sdk.es189.js +48 -39
- package/dist/es/standards-sdk.es189.js.map +1 -1
- package/dist/es/standards-sdk.es19.js +10 -10
- package/dist/es/standards-sdk.es190.js +218 -48
- package/dist/es/standards-sdk.es190.js.map +1 -1
- package/dist/es/standards-sdk.es191.js +66 -42
- package/dist/es/standards-sdk.es191.js.map +1 -1
- package/dist/es/standards-sdk.es192.js +33 -105
- package/dist/es/standards-sdk.es192.js.map +1 -1
- package/dist/es/standards-sdk.es193.js +49 -43
- package/dist/es/standards-sdk.es193.js.map +1 -1
- package/dist/es/standards-sdk.es194.js +33 -42
- package/dist/es/standards-sdk.es194.js.map +1 -1
- package/dist/es/standards-sdk.es195.js +123 -72
- package/dist/es/standards-sdk.es195.js.map +1 -1
- package/dist/es/standards-sdk.es196.js +58 -75
- package/dist/es/standards-sdk.es196.js.map +1 -1
- package/dist/es/standards-sdk.es197.js +60 -44
- package/dist/es/standards-sdk.es197.js.map +1 -1
- package/dist/es/standards-sdk.es198.js +72 -36
- package/dist/es/standards-sdk.es198.js.map +1 -1
- package/dist/es/standards-sdk.es199.js +75 -30
- package/dist/es/standards-sdk.es199.js.map +1 -1
- package/dist/es/standards-sdk.es2.js +2 -2
- package/dist/es/standards-sdk.es20.js +1 -1
- package/dist/es/standards-sdk.es200.js +44 -34
- package/dist/es/standards-sdk.es200.js.map +1 -1
- package/dist/es/standards-sdk.es201.js +36 -48
- package/dist/es/standards-sdk.es201.js.map +1 -1
- package/dist/es/standards-sdk.es202.js +30 -138
- package/dist/es/standards-sdk.es202.js.map +1 -1
- package/dist/es/standards-sdk.es203.js +34 -42
- package/dist/es/standards-sdk.es203.js.map +1 -1
- package/dist/es/standards-sdk.es204.js +48 -12482
- package/dist/es/standards-sdk.es204.js.map +1 -1
- package/dist/es/standards-sdk.es205.js +134 -13
- package/dist/es/standards-sdk.es205.js.map +1 -1
- package/dist/es/standards-sdk.es206.js +36 -50
- package/dist/es/standards-sdk.es206.js.map +1 -1
- package/dist/es/standards-sdk.es207.js +12449 -78
- package/dist/es/standards-sdk.es207.js.map +1 -1
- package/dist/es/standards-sdk.es208.js +15 -79
- package/dist/es/standards-sdk.es208.js.map +1 -1
- package/dist/es/standards-sdk.es209.js +48 -192
- package/dist/es/standards-sdk.es209.js.map +1 -1
- package/dist/es/standards-sdk.es21.js +1 -1
- package/dist/es/standards-sdk.es210.js +90 -651
- package/dist/es/standards-sdk.es210.js.map +1 -1
- package/dist/es/standards-sdk.es211.js +71 -63
- package/dist/es/standards-sdk.es211.js.map +1 -1
- package/dist/es/standards-sdk.es212.js +188 -160
- package/dist/es/standards-sdk.es212.js.map +1 -1
- package/dist/es/standards-sdk.es213.js +65 -314
- package/dist/es/standards-sdk.es213.js.map +1 -1
- package/dist/es/standards-sdk.es214.js +661 -335
- package/dist/es/standards-sdk.es214.js.map +1 -1
- package/dist/es/standards-sdk.es215.js +129 -410
- package/dist/es/standards-sdk.es215.js.map +1 -1
- package/dist/es/standards-sdk.es216.js +200 -209
- package/dist/es/standards-sdk.es216.js.map +1 -1
- package/dist/es/standards-sdk.es217.js +334 -64
- package/dist/es/standards-sdk.es217.js.map +1 -1
- package/dist/es/standards-sdk.es218.js +438 -124
- package/dist/es/standards-sdk.es218.js.map +1 -1
- package/dist/es/standards-sdk.es219.js +310 -496
- package/dist/es/standards-sdk.es219.js.map +1 -1
- package/dist/es/standards-sdk.es22.js +1 -1
- package/dist/es/standards-sdk.es220.js +60 -243
- package/dist/es/standards-sdk.es220.js.map +1 -1
- package/dist/es/standards-sdk.es221.js +118 -175
- package/dist/es/standards-sdk.es221.js.map +1 -1
- package/dist/es/standards-sdk.es222.js +465 -67
- package/dist/es/standards-sdk.es222.js.map +1 -1
- package/dist/es/standards-sdk.es223.js +250 -143
- package/dist/es/standards-sdk.es223.js.map +1 -1
- package/dist/es/standards-sdk.es224.js +172 -160
- package/dist/es/standards-sdk.es224.js.map +1 -1
- package/dist/es/standards-sdk.es225.js +65 -630
- package/dist/es/standards-sdk.es225.js.map +1 -1
- package/dist/es/standards-sdk.es226.js +128 -161
- package/dist/es/standards-sdk.es226.js.map +1 -1
- package/dist/es/standards-sdk.es227.js +144 -195
- package/dist/es/standards-sdk.es227.js.map +1 -1
- package/dist/es/standards-sdk.es228.js +668 -223
- package/dist/es/standards-sdk.es228.js.map +1 -1
- package/dist/es/standards-sdk.es229.js +188 -0
- package/dist/es/standards-sdk.es229.js.map +1 -0
- package/dist/es/standards-sdk.es23.js +1 -1
- package/dist/es/standards-sdk.es230.js +238 -0
- package/dist/es/standards-sdk.es230.js.map +1 -0
- package/dist/es/standards-sdk.es231.js +242 -0
- package/dist/es/standards-sdk.es231.js.map +1 -0
- package/dist/es/standards-sdk.es24.js +1 -1
- package/dist/es/standards-sdk.es25.js +1 -1
- package/dist/es/standards-sdk.es26.js +1 -1
- package/dist/es/standards-sdk.es27.js +13 -13
- package/dist/es/standards-sdk.es30.js +2 -2
- package/dist/es/standards-sdk.es31.js +4 -4
- package/dist/es/standards-sdk.es32.js +1 -1
- package/dist/es/standards-sdk.es35.js +7 -7
- package/dist/es/standards-sdk.es36.js +4 -4
- package/dist/es/standards-sdk.es37.js +2 -2
- package/dist/es/standards-sdk.es38.js +2 -2
- package/dist/es/standards-sdk.es39.js +1 -1
- package/dist/es/standards-sdk.es4.js +2 -2
- package/dist/es/standards-sdk.es40.js +1 -1
- package/dist/es/standards-sdk.es41.js +2 -2
- package/dist/es/standards-sdk.es46.js +1 -1
- package/dist/es/standards-sdk.es5.js +2 -2
- package/dist/es/standards-sdk.es51.js +1 -1
- package/dist/es/standards-sdk.es53.js +1 -1
- package/dist/es/standards-sdk.es56.js +2 -2
- package/dist/es/standards-sdk.es59.js +1 -1
- package/dist/es/standards-sdk.es6.js +2 -2
- package/dist/es/standards-sdk.es60.js +1 -1
- package/dist/es/standards-sdk.es62.js +1 -1
- package/dist/es/standards-sdk.es63.js +2 -2
- package/dist/es/standards-sdk.es64.js +1 -1
- package/dist/es/standards-sdk.es65.js +1 -1
- package/dist/es/standards-sdk.es66.js +1 -1
- package/dist/es/standards-sdk.es67.js +8 -8
- package/dist/es/standards-sdk.es69.js +1 -1
- package/dist/es/standards-sdk.es7.js +1 -1
- package/dist/es/standards-sdk.es71.js +2 -2
- package/dist/es/standards-sdk.es72.js +3 -3
- package/dist/es/standards-sdk.es75.js +5 -5
- package/dist/es/standards-sdk.es76.js +3 -3
- package/dist/es/standards-sdk.es77.js +2 -2
- package/dist/es/standards-sdk.es78.js +1 -1
- package/dist/es/standards-sdk.es81.js +2 -2
- package/dist/es/standards-sdk.es83.js +2 -2
- package/dist/es/standards-sdk.es84.js +5 -5
- package/dist/es/standards-sdk.es85.js +1 -1
- package/dist/es/standards-sdk.es88.js +1 -1
- package/dist/es/standards-sdk.es89.js +2 -2
- package/dist/es/standards-sdk.es9.js +2 -2
- package/dist/es/standards-sdk.es90.js +4 -4
- package/dist/es/standards-sdk.es94.js +3 -3
- package/dist/es/standards-sdk.es96.js +2 -2
- package/dist/es/standards-sdk.es98.js +1 -1
- package/dist/es/standards-sdk.es99.js +3 -3
- package/package.json +1 -1
|
@@ -1,262 +1,454 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { RegistryBrokerParseError } from "./standards-sdk.es171.js";
|
|
3
|
+
const agentNetworkProviderSchema = z.enum([
|
|
4
|
+
"openclaw",
|
|
5
|
+
"grok",
|
|
6
|
+
"dot",
|
|
7
|
+
"muse",
|
|
8
|
+
"api",
|
|
9
|
+
"other"
|
|
10
|
+
]);
|
|
11
|
+
const agentConnectionStateSchema = z.enum([
|
|
12
|
+
"unavailable",
|
|
13
|
+
"pending_pairing",
|
|
14
|
+
"interactive_verified",
|
|
15
|
+
"polling_verified",
|
|
16
|
+
"push_verified",
|
|
17
|
+
"needs_reconnect",
|
|
18
|
+
"paused",
|
|
19
|
+
"degraded"
|
|
20
|
+
]);
|
|
21
|
+
const agentRegistrationStateSchema = z.enum([
|
|
22
|
+
"unregistered",
|
|
23
|
+
"quote_issued",
|
|
24
|
+
"pending",
|
|
25
|
+
"registered",
|
|
26
|
+
"failed"
|
|
27
|
+
]);
|
|
28
|
+
const agentRegistrationResultStateSchema = z.enum([
|
|
29
|
+
"registered",
|
|
30
|
+
"pending",
|
|
31
|
+
"linked",
|
|
32
|
+
"unregistered"
|
|
33
|
+
]);
|
|
34
|
+
const agentReceiveModeSchema = z.enum(["none", "poll", "push"]);
|
|
35
|
+
const agentRequestStateSchema = z.enum([
|
|
36
|
+
"accepted",
|
|
37
|
+
"awaiting_consent",
|
|
38
|
+
"queued",
|
|
39
|
+
"processing",
|
|
40
|
+
"completed",
|
|
41
|
+
"rejected",
|
|
42
|
+
"failed",
|
|
43
|
+
"expired",
|
|
44
|
+
"canceled"
|
|
45
|
+
]);
|
|
46
|
+
const agentDeliveryStateSchema = z.enum([
|
|
47
|
+
"pending",
|
|
48
|
+
"notifying",
|
|
49
|
+
"provider_accepted",
|
|
50
|
+
"acknowledged",
|
|
51
|
+
"retry_scheduled",
|
|
52
|
+
"permanently_failed"
|
|
53
|
+
]);
|
|
54
|
+
const agentMessageKindSchema = z.enum(["request", "response", "event"]);
|
|
55
|
+
const isoDate = z.string();
|
|
56
|
+
const agentRuntimeViewSchema = z.object({
|
|
57
|
+
runtimeId: z.string().uuid(),
|
|
58
|
+
uaid: z.string().nullable(),
|
|
59
|
+
ownerType: z.string(),
|
|
60
|
+
ownerId: z.string(),
|
|
61
|
+
declaredProvider: agentNetworkProviderSchema,
|
|
62
|
+
connectionState: agentConnectionStateSchema,
|
|
63
|
+
registrationState: agentRegistrationStateSchema,
|
|
64
|
+
registrationAttemptId: z.string().nullable(),
|
|
65
|
+
receiveMode: agentReceiveModeSchema,
|
|
66
|
+
gatewayUrl: z.string().nullable(),
|
|
67
|
+
paused: z.boolean(),
|
|
68
|
+
allowedPeerUaids: z.array(z.string()).nullable(),
|
|
69
|
+
capabilities: z.array(z.string()),
|
|
70
|
+
lastActivityAt: isoDate.nullable(),
|
|
71
|
+
createdAt: isoDate
|
|
72
|
+
});
|
|
73
|
+
const agentRuntimeQuoteSchema = z.object({
|
|
74
|
+
quoteId: z.string(),
|
|
75
|
+
expiresAt: isoDate,
|
|
76
|
+
registrationFeeCredits: z.number().nullable(),
|
|
77
|
+
gatewayUrl: z.string()
|
|
78
|
+
});
|
|
79
|
+
const agentPairingStartSchema = z.object({
|
|
80
|
+
grantId: z.string().uuid(),
|
|
81
|
+
pairingCode: z.string(),
|
|
82
|
+
expiresAt: isoDate
|
|
83
|
+
});
|
|
84
|
+
const agentPairingCompleteSchema = z.object({
|
|
85
|
+
grantId: z.string().uuid(),
|
|
86
|
+
runtimeId: z.string().uuid(),
|
|
87
|
+
token: z.string(),
|
|
88
|
+
scopes: z.array(z.string())
|
|
89
|
+
});
|
|
90
|
+
const agentMessageViewSchema = z.object({
|
|
91
|
+
messageId: z.string().uuid(),
|
|
92
|
+
conversationId: z.string().uuid(),
|
|
93
|
+
schemaVersion: z.literal("hol-agent-message/1"),
|
|
94
|
+
kind: agentMessageKindSchema,
|
|
95
|
+
senderUaid: z.string(),
|
|
96
|
+
recipientUaid: z.string(),
|
|
97
|
+
inReplyTo: z.string().uuid().nullable(),
|
|
98
|
+
content: z.object({ type: z.literal("text"), text: z.string() }),
|
|
99
|
+
requestState: agentRequestStateSchema,
|
|
100
|
+
createdAt: isoDate,
|
|
101
|
+
expiresAt: isoDate,
|
|
102
|
+
traceId: z.string()
|
|
103
|
+
});
|
|
104
|
+
const agentMessageAcceptedSchema = z.object({
|
|
105
|
+
messageId: z.string().uuid(),
|
|
106
|
+
conversationId: z.string().uuid(),
|
|
107
|
+
requestState: agentRequestStateSchema,
|
|
108
|
+
createdAt: isoDate,
|
|
109
|
+
expiresAt: isoDate,
|
|
110
|
+
deduplicated: z.boolean()
|
|
111
|
+
});
|
|
112
|
+
const agentLeaseViewSchema = z.object({
|
|
113
|
+
leaseId: z.string().uuid(),
|
|
114
|
+
messageId: z.string().uuid(),
|
|
115
|
+
fencingToken: z.number().int(),
|
|
116
|
+
expiresAt: isoDate
|
|
117
|
+
});
|
|
118
|
+
const agentClaimedMessageSchema = z.object({
|
|
119
|
+
message: agentMessageViewSchema,
|
|
120
|
+
lease: agentLeaseViewSchema
|
|
121
|
+
});
|
|
122
|
+
const agentInboxItemSchema = z.object({
|
|
123
|
+
messageId: z.string().uuid(),
|
|
124
|
+
conversationId: z.string().uuid(),
|
|
125
|
+
kind: agentMessageKindSchema,
|
|
126
|
+
senderUaid: z.string(),
|
|
127
|
+
content: z.object({ type: z.literal("text"), text: z.string() }),
|
|
128
|
+
requestState: agentRequestStateSchema,
|
|
129
|
+
deliveryState: agentDeliveryStateSchema,
|
|
130
|
+
acknowledged: z.boolean(),
|
|
131
|
+
leaseId: z.string().uuid().nullable(),
|
|
132
|
+
fencingToken: z.number().int().nullable(),
|
|
133
|
+
createdAt: isoDate,
|
|
134
|
+
expiresAt: isoDate
|
|
135
|
+
});
|
|
136
|
+
const agentInboxListSchema = z.object({
|
|
137
|
+
items: z.array(agentInboxItemSchema),
|
|
138
|
+
nextCursor: z.string().nullable()
|
|
139
|
+
});
|
|
140
|
+
const agentConversationViewSchema = z.object({
|
|
141
|
+
conversationId: z.string().uuid(),
|
|
142
|
+
state: z.enum(["active", "canceled", "expired"]),
|
|
143
|
+
participants: z.array(z.object({ uaid: z.string() })),
|
|
144
|
+
messages: z.array(agentMessageViewSchema),
|
|
145
|
+
nextCursor: z.string().nullable()
|
|
146
|
+
});
|
|
147
|
+
const agentReplyResultSchema = z.object({
|
|
148
|
+
request: agentMessageViewSchema,
|
|
149
|
+
response: agentMessageViewSchema
|
|
150
|
+
});
|
|
151
|
+
const agentRuntimeRegistrationResultSchema = z.object({
|
|
152
|
+
runtime: agentRuntimeViewSchema,
|
|
153
|
+
registration: agentRegistrationResultStateSchema
|
|
154
|
+
});
|
|
155
|
+
const agentProbeResultSchema = z.object({
|
|
156
|
+
nonce: z.string(),
|
|
157
|
+
issuedAt: isoDate
|
|
158
|
+
});
|
|
159
|
+
const agentSubscriptionEventTypeSchema = z.enum([
|
|
160
|
+
"notify_request",
|
|
161
|
+
"notify_event",
|
|
162
|
+
"notify_response"
|
|
163
|
+
]);
|
|
164
|
+
const agentSubscriptionViewSchema = z.object({
|
|
165
|
+
subscriptionId: z.string().uuid(),
|
|
166
|
+
runtimeId: z.string().uuid(),
|
|
167
|
+
eventType: agentSubscriptionEventTypeSchema,
|
|
168
|
+
callbackUrl: z.string().nullable(),
|
|
169
|
+
state: z.string(),
|
|
170
|
+
expiresAt: isoDate.nullable(),
|
|
171
|
+
createdAt: isoDate
|
|
172
|
+
});
|
|
173
|
+
const agentSubscriptionListSchema = z.object({
|
|
174
|
+
subscriptions: z.array(agentSubscriptionViewSchema)
|
|
175
|
+
});
|
|
176
|
+
const agentSubscriptionCreatedSchema = z.object({
|
|
177
|
+
subscription: agentSubscriptionViewSchema
|
|
178
|
+
});
|
|
179
|
+
const sleep = (ms, signal) => new Promise((resolve, reject) => {
|
|
180
|
+
const t = setTimeout(resolve, ms);
|
|
181
|
+
signal?.addEventListener(
|
|
182
|
+
"abort",
|
|
183
|
+
() => {
|
|
184
|
+
clearTimeout(t);
|
|
185
|
+
reject(new Error("waitForReply aborted"));
|
|
186
|
+
},
|
|
187
|
+
{ once: true }
|
|
15
188
|
);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return tinybars / 1e8;
|
|
27
|
-
}
|
|
28
|
-
function resolveCreditsToPurchase(shortfallCredits) {
|
|
29
|
-
if (!Number.isFinite(shortfallCredits) || shortfallCredits <= 0) {
|
|
30
|
-
return 0;
|
|
31
|
-
}
|
|
32
|
-
return Math.max(
|
|
33
|
-
Math.ceil(shortfallCredits),
|
|
34
|
-
MINIMUM_REGISTRATION_AUTO_TOP_UP_CREDITS
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
async function ensureCreditsForRegistration(client, payload, autoTopUp) {
|
|
38
|
-
const details = autoTopUp ?? null;
|
|
39
|
-
if (!details) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (!details.accountId || !details.accountId.trim()) {
|
|
43
|
-
throw new Error("autoTopUp.accountId is required");
|
|
44
|
-
}
|
|
45
|
-
if (!details.privateKey || !details.privateKey.trim()) {
|
|
46
|
-
throw new Error("autoTopUp.privateKey is required");
|
|
47
|
-
}
|
|
48
|
-
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
49
|
-
const quote = await getRegistrationQuote(client, payload);
|
|
50
|
-
const shortfall = quote.shortfallCredits ?? 0;
|
|
51
|
-
if (shortfall <= 0) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
const creditsToPurchase = resolveCreditsToPurchase(shortfall);
|
|
55
|
-
if (creditsToPurchase <= 0) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
const creditsPerHbar = quote.creditsPerHbar ?? null;
|
|
59
|
-
if (!creditsPerHbar || creditsPerHbar <= 0) {
|
|
60
|
-
throw new Error("Unable to determine credits per HBAR for auto top-up");
|
|
189
|
+
});
|
|
190
|
+
const bearerHeaders = (token) => ({
|
|
191
|
+
authorization: `Bearer ${token}`
|
|
192
|
+
});
|
|
193
|
+
const encodePath = (value) => encodeURIComponent(value);
|
|
194
|
+
const qs = (params) => {
|
|
195
|
+
const query = new URLSearchParams();
|
|
196
|
+
for (const [k, v] of Object.entries(params)) {
|
|
197
|
+
if (v !== void 0) {
|
|
198
|
+
query.set(k, String(v));
|
|
61
199
|
}
|
|
62
|
-
const hbarAmount = calculateHbarAmount(creditsToPurchase, creditsPerHbar);
|
|
63
|
-
await purchaseCreditsWithHbar(client, {
|
|
64
|
-
accountId: details.accountId.trim(),
|
|
65
|
-
privateKey: details.privateKey.trim(),
|
|
66
|
-
hbarAmount,
|
|
67
|
-
memo: details.memo ?? "Registry Broker auto top-up",
|
|
68
|
-
metadata: {
|
|
69
|
-
shortfallCredits: shortfall,
|
|
70
|
-
requiredCredits: quote.requiredCredits,
|
|
71
|
-
purchasedCredits: creditsToPurchase
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
200
|
}
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
201
|
+
const s = query.toString();
|
|
202
|
+
return s ? `?${s}` : "";
|
|
203
|
+
};
|
|
204
|
+
function createAgentNetworkApi(client) {
|
|
205
|
+
const json = async (path, schema, init) => {
|
|
206
|
+
const raw = await client.requestJson(`${path}`, {
|
|
207
|
+
method: init.method ?? "GET",
|
|
208
|
+
body: init.body,
|
|
209
|
+
headers: init.token ? bearerHeaders(init.token) : void 0
|
|
210
|
+
});
|
|
211
|
+
const parsed = schema.safeParse(raw);
|
|
212
|
+
if (!parsed.success) {
|
|
213
|
+
throw new RegistryBrokerParseError(
|
|
214
|
+
"Unexpected agent-network response shape",
|
|
215
|
+
JSON.stringify(raw).slice(0, 500)
|
|
216
|
+
);
|
|
85
217
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
218
|
+
return parsed.data;
|
|
219
|
+
};
|
|
220
|
+
const bot204 = async (path, token, body) => {
|
|
221
|
+
const response = await client.request(`${path}`, {
|
|
222
|
+
method: "POST",
|
|
223
|
+
body,
|
|
224
|
+
headers: bearerHeaders(token)
|
|
225
|
+
});
|
|
226
|
+
return response.status === 204 ? null : response.json();
|
|
227
|
+
};
|
|
228
|
+
return {
|
|
229
|
+
quoteRuntime: () => json("/agent-runtimes/quote", agentRuntimeQuoteSchema, {
|
|
230
|
+
method: "POST"
|
|
231
|
+
}),
|
|
232
|
+
registerRuntime: (input) => json("/agent-runtimes/register", agentRuntimeRegistrationResultSchema, {
|
|
233
|
+
method: "POST",
|
|
234
|
+
body: input
|
|
235
|
+
}),
|
|
236
|
+
listRuntimes: async () => {
|
|
237
|
+
const raw = await client.requestJson("/agent-runtimes", {});
|
|
238
|
+
const parsed = z.object({ runtimes: z.array(agentRuntimeViewSchema) }).safeParse(raw);
|
|
239
|
+
if (!parsed.success) {
|
|
240
|
+
throw new RegistryBrokerParseError(
|
|
241
|
+
"Unexpected runtime list shape",
|
|
242
|
+
JSON.stringify(raw).slice(0, 500)
|
|
243
|
+
);
|
|
109
244
|
}
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
{
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
"
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
245
|
+
return parsed.data.runtimes;
|
|
246
|
+
},
|
|
247
|
+
updateRuntimePolicy: (runtimeId, input) => json(
|
|
248
|
+
`/agent-runtimes/${encodePath(runtimeId)}`,
|
|
249
|
+
agentRuntimeViewSchema,
|
|
250
|
+
{ method: "PATCH", body: input }
|
|
251
|
+
),
|
|
252
|
+
probeRuntime: async (runtimeId) => await json(
|
|
253
|
+
`/agent-runtimes/${encodePath(runtimeId)}/probe`,
|
|
254
|
+
agentProbeResultSchema,
|
|
255
|
+
{ method: "POST" }
|
|
256
|
+
),
|
|
257
|
+
startAgentConnection: (runtimeId) => json("/agent-connections", agentPairingStartSchema, {
|
|
258
|
+
method: "POST",
|
|
259
|
+
body: { runtimeId }
|
|
260
|
+
}),
|
|
261
|
+
completeAgentPairing: (pairingCode) => json("/agent-connections/pair", agentPairingCompleteSchema, {
|
|
262
|
+
method: "POST",
|
|
263
|
+
body: { pairingCode }
|
|
264
|
+
}),
|
|
265
|
+
revokeAgentConnection: async (grantId) => {
|
|
266
|
+
await client.request(`/agent-connections/${encodePath(grantId)}`, {
|
|
267
|
+
method: "DELETE"
|
|
268
|
+
});
|
|
269
|
+
},
|
|
270
|
+
listRuntimeInbox: (runtimeId, query) => json(
|
|
271
|
+
`/agent-runtimes/${encodePath(runtimeId)}/inbox${qs({
|
|
272
|
+
cursor: query?.cursor,
|
|
273
|
+
limit: query?.limit,
|
|
274
|
+
includeAcknowledged: query?.includeAcknowledged
|
|
275
|
+
})}`,
|
|
276
|
+
agentInboxListSchema,
|
|
277
|
+
{}
|
|
278
|
+
),
|
|
279
|
+
getRuntimeConversation: (runtimeId, conversationId, query) => json(
|
|
280
|
+
`/agent-runtimes/${encodePath(runtimeId)}/conversations/${encodePath(
|
|
281
|
+
conversationId
|
|
282
|
+
)}${qs({ cursor: query?.cursor, limit: query?.limit })}`,
|
|
283
|
+
agentConversationViewSchema,
|
|
284
|
+
{}
|
|
285
|
+
),
|
|
286
|
+
createAgentSubscription: async (runtimeId, input) => (await json(
|
|
287
|
+
`/agent-runtimes/${encodePath(runtimeId)}/subscriptions`,
|
|
288
|
+
agentSubscriptionCreatedSchema,
|
|
289
|
+
{ method: "POST", body: input }
|
|
290
|
+
)).subscription,
|
|
291
|
+
listAgentSubscriptions: async (runtimeId) => (await json(
|
|
292
|
+
`/agent-runtimes/${encodePath(runtimeId)}/subscriptions`,
|
|
293
|
+
agentSubscriptionListSchema,
|
|
294
|
+
{}
|
|
295
|
+
)).subscriptions,
|
|
296
|
+
revokeAgentSubscription: async (runtimeId, subscriptionId) => {
|
|
297
|
+
await client.request(
|
|
298
|
+
`/agent-runtimes/${encodePath(runtimeId)}/subscriptions/${encodePath(
|
|
299
|
+
subscriptionId
|
|
300
|
+
)}`,
|
|
301
|
+
{ method: "DELETE" }
|
|
302
|
+
);
|
|
303
|
+
},
|
|
304
|
+
agentMe: async (token) => {
|
|
305
|
+
const raw = await client.requestJson(
|
|
306
|
+
"/agent-runtimes/me",
|
|
307
|
+
{ headers: bearerHeaders(token) }
|
|
308
|
+
);
|
|
309
|
+
const parsed = z.object({ runtime: agentRuntimeViewSchema }).safeParse(raw);
|
|
310
|
+
if (!parsed.success) {
|
|
311
|
+
throw new RegistryBrokerParseError(
|
|
312
|
+
"Unexpected agent-runtimes/me shape",
|
|
313
|
+
JSON.stringify(raw).slice(0, 500)
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
return parsed.data.runtime;
|
|
317
|
+
},
|
|
318
|
+
sendAgentMessage: (token, input) => json("/agent-messages", agentMessageAcceptedSchema, {
|
|
319
|
+
method: "POST",
|
|
320
|
+
body: input,
|
|
321
|
+
token
|
|
322
|
+
}),
|
|
323
|
+
getAgentMessage: (token, messageId) => json(
|
|
324
|
+
`/agent-messages/${encodePath(messageId)}`,
|
|
325
|
+
agentMessageViewSchema,
|
|
326
|
+
{ token }
|
|
327
|
+
),
|
|
328
|
+
getAgentConversation: (token, conversationId, query) => json(
|
|
329
|
+
`/agent-conversations/${encodePath(conversationId)}${qs({
|
|
330
|
+
cursor: query?.cursor,
|
|
331
|
+
limit: query?.limit
|
|
332
|
+
})}`,
|
|
333
|
+
agentConversationViewSchema,
|
|
334
|
+
{ token }
|
|
335
|
+
),
|
|
336
|
+
listAgentInbox: (token, query) => json(
|
|
337
|
+
`/agent-inbox${qs({
|
|
338
|
+
cursor: query?.cursor,
|
|
339
|
+
limit: query?.limit,
|
|
340
|
+
includeAcknowledged: query?.includeAcknowledged
|
|
341
|
+
})}`,
|
|
342
|
+
agentInboxListSchema,
|
|
343
|
+
{ token }
|
|
344
|
+
),
|
|
345
|
+
claimAgentMessage: async (token) => {
|
|
346
|
+
const raw = await bot204("/agent-inbox/leases", token, {});
|
|
347
|
+
if (raw === null) {
|
|
348
|
+
return null;
|
|
186
349
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
350
|
+
const parsed = agentClaimedMessageSchema.safeParse(raw);
|
|
351
|
+
if (!parsed.success) {
|
|
352
|
+
throw new RegistryBrokerParseError(
|
|
353
|
+
"Unexpected claim response shape",
|
|
354
|
+
JSON.stringify(raw).slice(0, 500)
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
return parsed.data;
|
|
358
|
+
},
|
|
359
|
+
acknowledgeAgentMessage: (token, messageId, lease) => json(
|
|
360
|
+
`/agent-inbox/${encodePath(messageId)}/ack`,
|
|
361
|
+
agentMessageViewSchema,
|
|
362
|
+
{ method: "POST", body: lease, token }
|
|
363
|
+
),
|
|
364
|
+
renewAgentMessageLease: (token, messageId, input) => json(
|
|
365
|
+
`/agent-inbox/${encodePath(messageId)}/lease/renew`,
|
|
366
|
+
agentLeaseViewSchema,
|
|
367
|
+
{ method: "POST", body: input, token }
|
|
368
|
+
),
|
|
369
|
+
replyToAgentMessage: (token, messageId, input) => json(
|
|
370
|
+
`/agent-messages/${encodePath(messageId)}/reply`,
|
|
371
|
+
agentReplyResultSchema,
|
|
372
|
+
{ method: "POST", body: input, token }
|
|
373
|
+
),
|
|
374
|
+
rejectAgentMessage: (token, messageId, input) => json(
|
|
375
|
+
`/agent-messages/${encodePath(messageId)}/reject`,
|
|
376
|
+
agentMessageViewSchema,
|
|
377
|
+
{ method: "POST", body: input, token }
|
|
378
|
+
),
|
|
379
|
+
cancelAgentConversation: async (token, conversationId) => {
|
|
380
|
+
const raw = await client.requestJson(
|
|
381
|
+
`/agent-conversations/${encodePath(conversationId)}/cancel`,
|
|
382
|
+
{ method: "POST", body: {}, headers: bearerHeaders(token) }
|
|
383
|
+
);
|
|
384
|
+
const parsed = z.object({
|
|
385
|
+
conversationId: z.string().uuid(),
|
|
386
|
+
canceledMessages: z.number()
|
|
387
|
+
}).safeParse(raw);
|
|
388
|
+
if (!parsed.success) {
|
|
389
|
+
throw new RegistryBrokerParseError(
|
|
390
|
+
"Unexpected cancel response shape",
|
|
391
|
+
JSON.stringify(raw).slice(0, 500)
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
return parsed.data;
|
|
395
|
+
},
|
|
396
|
+
waitForAgentReply: async (token, messageId, options) => {
|
|
397
|
+
const timeoutMs = options?.timeoutMs ?? 6e4;
|
|
398
|
+
const interval = Math.max(250, options?.pollIntervalMs ?? 2e3);
|
|
399
|
+
const deadline = Date.now() + timeoutMs;
|
|
400
|
+
while (Date.now() < deadline) {
|
|
401
|
+
const message = await json(
|
|
402
|
+
`/agent-messages/${encodePath(messageId)}`,
|
|
403
|
+
agentMessageViewSchema,
|
|
404
|
+
{ token }
|
|
405
|
+
);
|
|
406
|
+
if (message.requestState === "completed") {
|
|
407
|
+
const conversation = await json(
|
|
408
|
+
`/agent-conversations/${encodePath(message.conversationId)}`,
|
|
409
|
+
agentConversationViewSchema,
|
|
410
|
+
{ token }
|
|
196
411
|
);
|
|
412
|
+
return conversation.messages.find(
|
|
413
|
+
(m) => m.inReplyTo === messageId && m.kind === "response"
|
|
414
|
+
) ?? null;
|
|
415
|
+
}
|
|
416
|
+
if (message.requestState === "rejected" || message.requestState === "failed" || message.requestState === "expired" || message.requestState === "canceled") {
|
|
417
|
+
return null;
|
|
197
418
|
}
|
|
198
|
-
|
|
419
|
+
await sleep(Math.min(interval, deadline - Date.now()), options?.signal);
|
|
199
420
|
}
|
|
421
|
+
return null;
|
|
200
422
|
}
|
|
201
|
-
|
|
202
|
-
throw new Error(
|
|
203
|
-
`Registration progress polling timed out after ${timeoutMs}ms`
|
|
204
|
-
);
|
|
205
|
-
}
|
|
206
|
-
await client.delay(interval, signal);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
async function validateUaid(client, uaid) {
|
|
210
|
-
const raw = await client.requestJson(
|
|
211
|
-
`/uaids/validate/${encodeURIComponent(uaid)}`,
|
|
212
|
-
{
|
|
213
|
-
method: "GET"
|
|
214
|
-
}
|
|
215
|
-
);
|
|
216
|
-
return client.parseWithSchema(
|
|
217
|
-
raw,
|
|
218
|
-
uaidValidationResponseSchema,
|
|
219
|
-
"UAID validation response"
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
async function getUaidConnectionStatus(client, uaid) {
|
|
223
|
-
const raw = await client.requestJson(
|
|
224
|
-
`/uaids/connections/${encodeURIComponent(uaid)}/status`,
|
|
225
|
-
{
|
|
226
|
-
method: "GET"
|
|
227
|
-
}
|
|
228
|
-
);
|
|
229
|
-
return client.parseWithSchema(
|
|
230
|
-
raw,
|
|
231
|
-
uaidConnectionStatusSchema,
|
|
232
|
-
"UAID connection status"
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
async function closeUaidConnection(client, uaid) {
|
|
236
|
-
await client.request(`/uaids/connections/${encodeURIComponent(uaid)}`, {
|
|
237
|
-
method: "DELETE"
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
async function dashboardStats(client) {
|
|
241
|
-
const raw = await client.requestJson("/dashboard/stats", {
|
|
242
|
-
method: "GET"
|
|
243
|
-
});
|
|
244
|
-
return client.parseWithSchema(
|
|
245
|
-
raw,
|
|
246
|
-
dashboardStatsResponseSchema,
|
|
247
|
-
"dashboard stats response"
|
|
248
|
-
);
|
|
423
|
+
};
|
|
249
424
|
}
|
|
250
425
|
export {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
426
|
+
agentClaimedMessageSchema,
|
|
427
|
+
agentConnectionStateSchema,
|
|
428
|
+
agentConversationViewSchema,
|
|
429
|
+
agentDeliveryStateSchema,
|
|
430
|
+
agentInboxItemSchema,
|
|
431
|
+
agentInboxListSchema,
|
|
432
|
+
agentLeaseViewSchema,
|
|
433
|
+
agentMessageAcceptedSchema,
|
|
434
|
+
agentMessageKindSchema,
|
|
435
|
+
agentMessageViewSchema,
|
|
436
|
+
agentNetworkProviderSchema,
|
|
437
|
+
agentPairingCompleteSchema,
|
|
438
|
+
agentPairingStartSchema,
|
|
439
|
+
agentProbeResultSchema,
|
|
440
|
+
agentReceiveModeSchema,
|
|
441
|
+
agentRegistrationResultStateSchema,
|
|
442
|
+
agentRegistrationStateSchema,
|
|
443
|
+
agentReplyResultSchema,
|
|
444
|
+
agentRequestStateSchema,
|
|
445
|
+
agentRuntimeQuoteSchema,
|
|
446
|
+
agentRuntimeRegistrationResultSchema,
|
|
447
|
+
agentRuntimeViewSchema,
|
|
448
|
+
agentSubscriptionCreatedSchema,
|
|
449
|
+
agentSubscriptionEventTypeSchema,
|
|
450
|
+
agentSubscriptionListSchema,
|
|
451
|
+
agentSubscriptionViewSchema,
|
|
452
|
+
createAgentNetworkApi
|
|
261
453
|
};
|
|
262
454
|
//# sourceMappingURL=standards-sdk.es172.js.map
|