@hashgraphonline/standards-sdk 0.1.189 → 0.1.190
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/agentverse.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/browser/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/browser/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/browser/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/browser/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/browser/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/browser/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/browser/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/browser/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/browser/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/browser/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/browser/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/http.d.ts +67 -0
- package/dist/browser/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/index.d.ts +21 -0
- package/dist/browser/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/browser/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/browser/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/browser/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/browser/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/browser/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/browser/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/browser/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/types.d.ts +113 -0
- package/dist/browser/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/browser/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/browser/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/browser/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/browser/hcs-25/index.d.ts +1 -0
- package/dist/browser/hcs-25/index.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/browser/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/browser/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/operational.d.ts +15 -12
- package/dist/browser/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/browser/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/browser/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/browser-root/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/browser-root/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/browser-root/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/browser-root/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/browser-root/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/browser-root/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/browser-root/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/browser-root/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/browser-root/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/http.d.ts +67 -0
- package/dist/browser-root/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/index.d.ts +21 -0
- package/dist/browser-root/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/browser-root/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/browser-root/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/browser-root/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/browser-root/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/browser-root/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/browser-root/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/browser-root/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/types.d.ts +113 -0
- package/dist/browser-root/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/browser-root/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/browser-root/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/browser-root/hcs-25/index.d.ts +1 -0
- package/dist/browser-root/hcs-25/index.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/browser-root/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/browser-root/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/operational.d.ts +15 -12
- package/dist/browser-root/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/browser-root/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/browser-root/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/cjs/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/cjs/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/cjs/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/cjs/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/cjs/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/cjs/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/cjs/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/cjs/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/cjs/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/cjs/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/http.d.ts +67 -0
- package/dist/cjs/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/index.d.ts +21 -0
- package/dist/cjs/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/cjs/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/cjs/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/cjs/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/cjs/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/cjs/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/cjs/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/cjs/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/types.d.ts +113 -0
- package/dist/cjs/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/cjs/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/cjs/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/cjs/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/cjs/hcs-25/index.d.ts +1 -0
- package/dist/cjs/hcs-25/index.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/cjs/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/cjs/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/operational.d.ts +15 -12
- package/dist/cjs/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/cjs/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/cjs/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/cjs/standards-sdk.cjs +2 -2
- package/dist/cjs/standards-sdk.cjs.map +1 -1
- package/dist/es/hcs-25/adapters/agentverse.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/availability.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/connectivity.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/ethos.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/model-evals.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/simple-evals.d.ts.map +1 -1
- package/dist/es/hcs-25/adapters/x402.d.ts.map +1 -1
- package/dist/es/hcs-25/collectors/acp.d.ts +42 -0
- package/dist/es/hcs-25/collectors/acp.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/agentverse.d.ts +37 -0
- package/dist/es/hcs-25/collectors/agentverse.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/availability.d.ts +29 -0
- package/dist/es/hcs-25/collectors/availability.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/catalog.d.ts +57 -0
- package/dist/es/hcs-25/collectors/catalog.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/connectivity.d.ts +49 -0
- package/dist/es/hcs-25/collectors/connectivity.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/endpoints.d.ts +9 -0
- package/dist/es/hcs-25/collectors/endpoints.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/erc8004.d.ts +104 -0
- package/dist/es/hcs-25/collectors/erc8004.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/ethos.d.ts +95 -0
- package/dist/es/hcs-25/collectors/ethos.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/freshness.d.ts +36 -0
- package/dist/es/hcs-25/collectors/freshness.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/http.d.ts +67 -0
- package/dist/es/hcs-25/collectors/http.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/index.d.ts +21 -0
- package/dist/es/hcs-25/collectors/index.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/merge.d.ts +11 -0
- package/dist/es/hcs-25/collectors/merge.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/model-evals.d.ts +315 -0
- package/dist/es/hcs-25/collectors/model-evals.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/oss-popularity.d.ts +51 -0
- package/dist/es/hcs-25/collectors/oss-popularity.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/output-verification.d.ts +37 -0
- package/dist/es/hcs-25/collectors/output-verification.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/pipeline.d.ts +19 -0
- package/dist/es/hcs-25/collectors/pipeline.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/runner.d.ts +20 -0
- package/dist/es/hcs-25/collectors/runner.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/simple-evals.d.ts +91 -0
- package/dist/es/hcs-25/collectors/simple-evals.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/types.d.ts +113 -0
- package/dist/es/hcs-25/collectors/types.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/x402-onchain.d.ts +105 -0
- package/dist/es/hcs-25/collectors/x402-onchain.d.ts.map +1 -0
- package/dist/es/hcs-25/collectors/x402.d.ts +48 -0
- package/dist/es/hcs-25/collectors/x402.d.ts.map +1 -0
- package/dist/es/hcs-25/index.d.ts +1 -0
- package/dist/es/hcs-25/index.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/marketplace.d.ts +6 -6
- package/dist/es/hcs-25/signals/marketplace.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/model-evals.d.ts +12 -12
- package/dist/es/hcs-25/signals/model-evals.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/operational.d.ts +15 -12
- package/dist/es/hcs-25/signals/operational.d.ts.map +1 -1
- package/dist/es/hcs-25/signals/simple-evals.d.ts +1 -1
- package/dist/es/hcs-25/signals/simple-evals.d.ts.map +1 -1
- package/dist/es/standards-sdk.es.js +137 -58
- 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 +4 -4
- package/dist/es/standards-sdk.es121.js +11 -11
- package/dist/es/standards-sdk.es122.js +176 -240
- package/dist/es/standards-sdk.es122.js.map +1 -1
- package/dist/es/standards-sdk.es123.js +41 -468
- package/dist/es/standards-sdk.es123.js.map +1 -1
- package/dist/es/standards-sdk.es124.js +28 -103
- package/dist/es/standards-sdk.es124.js.map +1 -1
- package/dist/es/standards-sdk.es125.js +185 -145
- package/dist/es/standards-sdk.es125.js.map +1 -1
- package/dist/es/standards-sdk.es126.js +13 -33
- package/dist/es/standards-sdk.es126.js.map +1 -1
- package/dist/es/standards-sdk.es127.js +44 -10
- package/dist/es/standards-sdk.es127.js.map +1 -1
- package/dist/es/standards-sdk.es128.js +150 -172
- package/dist/es/standards-sdk.es128.js.map +1 -1
- package/dist/es/standards-sdk.es129.js +166 -26
- 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 +375 -18
- package/dist/es/standards-sdk.es130.js.map +1 -1
- package/dist/es/standards-sdk.es131.js +371 -139
- package/dist/es/standards-sdk.es131.js.map +1 -1
- package/dist/es/standards-sdk.es132.js +211 -180
- package/dist/es/standards-sdk.es132.js.map +1 -1
- package/dist/es/standards-sdk.es133.js +210 -770
- package/dist/es/standards-sdk.es133.js.map +1 -1
- package/dist/es/standards-sdk.es134.js +376 -10
- package/dist/es/standards-sdk.es134.js.map +1 -1
- package/dist/es/standards-sdk.es135.js +118 -564
- package/dist/es/standards-sdk.es135.js.map +1 -1
- package/dist/es/standards-sdk.es136.js +233 -608
- package/dist/es/standards-sdk.es136.js.map +1 -1
- package/dist/es/standards-sdk.es137.js +1328 -12
- package/dist/es/standards-sdk.es137.js.map +1 -1
- package/dist/es/standards-sdk.es138.js +133 -2
- package/dist/es/standards-sdk.es138.js.map +1 -1
- package/dist/es/standards-sdk.es139.js +258 -74
- 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 +104 -38
- package/dist/es/standards-sdk.es140.js.map +1 -1
- package/dist/es/standards-sdk.es141.js +252 -2
- package/dist/es/standards-sdk.es141.js.map +1 -1
- package/dist/es/standards-sdk.es142.js +446 -203
- package/dist/es/standards-sdk.es142.js.map +1 -1
- package/dist/es/standards-sdk.es143.js +104 -1139
- package/dist/es/standards-sdk.es143.js.map +1 -1
- package/dist/es/standards-sdk.es144.js +144 -290
- package/dist/es/standards-sdk.es144.js.map +1 -1
- package/dist/es/standards-sdk.es145.js +31 -419
- package/dist/es/standards-sdk.es145.js.map +1 -1
- package/dist/es/standards-sdk.es146.js +10 -353
- package/dist/es/standards-sdk.es146.js.map +1 -1
- package/dist/es/standards-sdk.es147.js +144 -1084
- package/dist/es/standards-sdk.es147.js.map +1 -1
- package/dist/es/standards-sdk.es148.js +25 -204
- package/dist/es/standards-sdk.es148.js.map +1 -1
- package/dist/es/standards-sdk.es149.js +17 -1562
- 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 +128 -1134
- package/dist/es/standards-sdk.es150.js.map +1 -1
- package/dist/es/standards-sdk.es151.js +199 -14
- package/dist/es/standards-sdk.es151.js.map +1 -1
- package/dist/es/standards-sdk.es152.js +773 -434
- package/dist/es/standards-sdk.es152.js.map +1 -1
- package/dist/es/standards-sdk.es153.js +10 -256
- package/dist/es/standards-sdk.es153.js.map +1 -1
- package/dist/es/standards-sdk.es154.js +567 -4
- package/dist/es/standards-sdk.es154.js.map +1 -1
- package/dist/es/standards-sdk.es155.js +619 -74
- package/dist/es/standards-sdk.es155.js.map +1 -1
- package/dist/es/standards-sdk.es156.js +12 -86
- package/dist/es/standards-sdk.es156.js.map +1 -1
- package/dist/es/standards-sdk.es157.js +2 -60
- package/dist/es/standards-sdk.es157.js.map +1 -1
- package/dist/es/standards-sdk.es158.js +87 -2547
- package/dist/es/standards-sdk.es158.js.map +1 -1
- package/dist/es/standards-sdk.es159.js +36 -155
- 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 +2 -7
- package/dist/es/standards-sdk.es160.js.map +1 -1
- package/dist/es/standards-sdk.es161.js +223 -74
- package/dist/es/standards-sdk.es161.js.map +1 -1
- package/dist/es/standards-sdk.es162.js +1122 -47
- package/dist/es/standards-sdk.es162.js.map +1 -1
- package/dist/es/standards-sdk.es163.js +299 -187
- package/dist/es/standards-sdk.es163.js.map +1 -1
- package/dist/es/standards-sdk.es164.js +419 -23
- package/dist/es/standards-sdk.es164.js.map +1 -1
- package/dist/es/standards-sdk.es165.js +352 -55
- package/dist/es/standards-sdk.es165.js.map +1 -1
- package/dist/es/standards-sdk.es166.js +1113 -86
- package/dist/es/standards-sdk.es166.js.map +1 -1
- package/dist/es/standards-sdk.es167.js +200 -41
- package/dist/es/standards-sdk.es167.js.map +1 -1
- package/dist/es/standards-sdk.es168.js +1551 -188
- package/dist/es/standards-sdk.es168.js.map +1 -1
- package/dist/es/standards-sdk.es169.js +1161 -51
- package/dist/es/standards-sdk.es169.js.map +1 -1
- package/dist/es/standards-sdk.es170.js +15 -47
- package/dist/es/standards-sdk.es170.js.map +1 -1
- package/dist/es/standards-sdk.es171.js +445 -50
- package/dist/es/standards-sdk.es171.js.map +1 -1
- package/dist/es/standards-sdk.es172.js +255 -45
- package/dist/es/standards-sdk.es172.js.map +1 -1
- package/dist/es/standards-sdk.es173.js +4 -122
- package/dist/es/standards-sdk.es173.js.map +1 -1
- package/dist/es/standards-sdk.es174.js +77 -50
- package/dist/es/standards-sdk.es174.js.map +1 -1
- package/dist/es/standards-sdk.es175.js +85 -42
- package/dist/es/standards-sdk.es175.js.map +1 -1
- package/dist/es/standards-sdk.es176.js +60 -72
- package/dist/es/standards-sdk.es176.js.map +1 -1
- package/dist/es/standards-sdk.es177.js +2544 -65
- package/dist/es/standards-sdk.es177.js.map +1 -1
- package/dist/es/standards-sdk.es178.js +159 -44
- package/dist/es/standards-sdk.es178.js.map +1 -1
- package/dist/es/standards-sdk.es179.js +7 -36
- 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 +86 -30
- package/dist/es/standards-sdk.es180.js.map +1 -1
- package/dist/es/standards-sdk.es181.js +65 -34
- package/dist/es/standards-sdk.es181.js.map +1 -1
- package/dist/es/standards-sdk.es182.js +196 -48
- package/dist/es/standards-sdk.es182.js.map +1 -1
- package/dist/es/standards-sdk.es183.js +23 -135
- package/dist/es/standards-sdk.es183.js.map +1 -1
- package/dist/es/standards-sdk.es184.js +54 -38
- package/dist/es/standards-sdk.es184.js.map +1 -1
- package/dist/es/standards-sdk.es185.js +102 -12470
- package/dist/es/standards-sdk.es185.js.map +1 -1
- package/dist/es/standards-sdk.es186.js +53 -52
- package/dist/es/standards-sdk.es186.js.map +1 -1
- package/dist/es/standards-sdk.es187.js +223 -103
- package/dist/es/standards-sdk.es187.js.map +1 -1
- package/dist/es/standards-sdk.es188.js +66 -75
- package/dist/es/standards-sdk.es188.js.map +1 -1
- package/dist/es/standards-sdk.es189.js +46 -197
- 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 +58 -668
- package/dist/es/standards-sdk.es190.js.map +1 -1
- package/dist/es/standards-sdk.es191.js +45 -168
- package/dist/es/standards-sdk.es191.js.map +1 -1
- package/dist/es/standards-sdk.es192.js +115 -315
- package/dist/es/standards-sdk.es192.js.map +1 -1
- package/dist/es/standards-sdk.es193.js +51 -340
- package/dist/es/standards-sdk.es193.js.map +1 -1
- package/dist/es/standards-sdk.es194.js +54 -448
- package/dist/es/standards-sdk.es194.js.map +1 -1
- package/dist/es/standards-sdk.es195.js +72 -331
- package/dist/es/standards-sdk.es195.js.map +1 -1
- package/dist/es/standards-sdk.es196.js +75 -76
- package/dist/es/standards-sdk.es196.js.map +1 -1
- package/dist/es/standards-sdk.es197.js +44 -73
- package/dist/es/standards-sdk.es197.js.map +1 -1
- package/dist/es/standards-sdk.es198.js +34 -15
- package/dist/es/standards-sdk.es198.js.map +1 -1
- package/dist/es/standards-sdk.es199.js +30 -139
- 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 +34 -517
- package/dist/es/standards-sdk.es200.js.map +1 -1
- package/dist/es/standards-sdk.es201.js +48 -259
- package/dist/es/standards-sdk.es201.js.map +1 -1
- package/dist/es/standards-sdk.es202.js +127 -185
- package/dist/es/standards-sdk.es202.js.map +1 -1
- package/dist/es/standards-sdk.es203.js +36 -113
- package/dist/es/standards-sdk.es203.js.map +1 -1
- package/dist/es/standards-sdk.es204.js +12464 -134
- package/dist/es/standards-sdk.es204.js.map +1 -1
- package/dist/es/standards-sdk.es205.js +14 -181
- package/dist/es/standards-sdk.es205.js.map +1 -1
- package/dist/es/standards-sdk.es206.js +55 -683
- package/dist/es/standards-sdk.es206.js.map +1 -1
- package/dist/es/standards-sdk.es207.js +93 -167
- package/dist/es/standards-sdk.es207.js.map +1 -1
- package/dist/es/standards-sdk.es208.js +71 -225
- package/dist/es/standards-sdk.es208.js.map +1 -1
- package/dist/es/standards-sdk.es209.js +176 -215
- 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 +675 -0
- package/dist/es/standards-sdk.es210.js.map +1 -0
- package/dist/es/standards-sdk.es211.js +76 -0
- package/dist/es/standards-sdk.es211.js.map +1 -0
- package/dist/es/standards-sdk.es212.js +175 -0
- package/dist/es/standards-sdk.es212.js.map +1 -0
- package/dist/es/standards-sdk.es213.js +325 -0
- package/dist/es/standards-sdk.es213.js.map +1 -0
- package/dist/es/standards-sdk.es214.js +349 -0
- package/dist/es/standards-sdk.es214.js.map +1 -0
- package/dist/es/standards-sdk.es215.js +456 -0
- package/dist/es/standards-sdk.es215.js.map +1 -0
- package/dist/es/standards-sdk.es216.js +334 -0
- package/dist/es/standards-sdk.es216.js.map +1 -0
- package/dist/es/standards-sdk.es217.js +79 -0
- package/dist/es/standards-sdk.es217.js.map +1 -0
- package/dist/es/standards-sdk.es218.js +142 -0
- package/dist/es/standards-sdk.es218.js.map +1 -0
- package/dist/es/standards-sdk.es219.js +520 -0
- package/dist/es/standards-sdk.es219.js.map +1 -0
- package/dist/es/standards-sdk.es22.js +1 -1
- package/dist/es/standards-sdk.es220.js +262 -0
- package/dist/es/standards-sdk.es220.js.map +1 -0
- package/dist/es/standards-sdk.es221.js +199 -0
- package/dist/es/standards-sdk.es221.js.map +1 -0
- package/dist/es/standards-sdk.es222.js +122 -0
- package/dist/es/standards-sdk.es222.js.map +1 -0
- package/dist/es/standards-sdk.es223.js +155 -0
- package/dist/es/standards-sdk.es223.js.map +1 -0
- package/dist/es/standards-sdk.es224.js +187 -0
- package/dist/es/standards-sdk.es224.js.map +1 -0
- package/dist/es/standards-sdk.es225.js +687 -0
- package/dist/es/standards-sdk.es225.js.map +1 -0
- package/dist/es/standards-sdk.es226.js +188 -0
- package/dist/es/standards-sdk.es226.js.map +1 -0
- package/dist/es/standards-sdk.es227.js +238 -0
- package/dist/es/standards-sdk.es227.js.map +1 -0
- package/dist/es/standards-sdk.es228.js +242 -0
- package/dist/es/standards-sdk.es228.js.map +1 -0
- package/dist/es/standards-sdk.es23.js +1 -1
- 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,1169 +1,163 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { ZodError } from "zod";
|
|
4
|
-
import { agentFeedbackResponseSchema, agentFeedbackIndexResponseSchema, agentFeedbackEntriesIndexResponseSchema, agentFeedbackEligibilityResponseSchema, agentFeedbackSubmissionResponseSchema, registerAgentResponseSchema } from "./standards-sdk.es158.js";
|
|
5
|
-
import { fetchHistorySnapshot, attachDecryptedHistory, registerConversationContextForEncryption, resolveDecryptionContext, decryptHistoryEntryFromContext } from "./standards-sdk.es199.js";
|
|
6
|
-
import { createAgentNetworkApi } from "./standards-sdk.es152.js";
|
|
7
|
-
import { createChatApi, createSession, resumeSession, checkChatReadiness, startChat, startConversation, acceptConversation, compactHistory, fetchEncryptionStatus, postEncryptionHandshake, sendMessage, retryMessage, cancelSession, endSession, createPlaintextConversationHandle } from "./standards-sdk.es200.js";
|
|
8
|
-
import { EncryptedChatManager } from "./standards-sdk.es201.js";
|
|
9
|
-
import { generateEncryptionKeyPair, bootstrapEncryptionOptions, createEncryptionApi } from "./standards-sdk.es202.js";
|
|
10
|
-
import { adapters, adaptersDetailed, adapterRegistryCategories, adapterRegistryAdapters, createAdapterRegistryCategory, submitAdapterRegistryAdapter, adapterRegistrySubmissionStatus } from "./standards-sdk.es203.js";
|
|
11
|
-
import { resolveUaid, getRegistrationQuote, updateAgent, getRegistrationProgress, waitForRegistrationCompletion, validateUaid, getUaidConnectionStatus, closeUaidConnection, dashboardStats } from "./standards-sdk.es153.js";
|
|
12
|
-
import { getRegisterStatus, registerOwnedMoltbookAgent, getVerificationStatus, createVerificationChallenge, getVerificationChallenge, verifyVerificationChallenge, getVerificationOwnership, verifySenderOwnership, verifyUaidDnsTxt, getVerificationDnsStatus } from "./standards-sdk.es204.js";
|
|
13
|
-
import { getCreditsBalance, getCreditProviders, createHbarPurchaseIntent, purchaseCreditsWithHbar, getX402Minimums, purchaseCreditsWithX402, buyCreditsWithX402 } from "./standards-sdk.es205.js";
|
|
14
|
-
import { getGuardSession, getGuardEntitlements, getGuardBillingBalance, getGuardFeed, getGuardOverview, getGuardTrustByHash, resolveGuardTrust, getGuardRevocations, fetchGuardAdvisories, fetchGuardPolicy, getGuardInventory, getGuardReceiptHistory, getGuardArtifactTimeline, getGuardInventoryDiff, exportGuardAbom, exportGuardArtifactAbom, exportGuardReceipts, getGuardDevices, getGuardAlertPreferences, updateGuardAlertPreferences, getGuardExceptions, getGuardWatchlist, lookupGuardWatchlist, getGuardPainSignals, getGuardAggregatedPainSignals, getGuardPreInstallVerdict, getGuardPreExecutionVerdict, addGuardWatchlistItem, removeGuardWatchlistItem, addGuardException, requestGuardException, removeGuardException, ingestGuardPainSignals, syncGuardReceipts, syncGuardInventory, submitGuardReceipts, getGuardTeamPolicyPack, updateGuardTeamPolicyPack } from "./standards-sdk.es206.js";
|
|
15
|
-
import { createLedgerChallenge, verifyLedgerChallenge, authenticateWithLedger, authenticateWithLedgerCredentials } from "./standards-sdk.es207.js";
|
|
16
|
-
import { search, delegate, stats, registries, getAdditionalRegistries, popularSearches, listProtocols, detectProtocol, registrySearchByNamespace, vectorSearch, searchStatus, websocketStats, metricsSummary, facets } from "./standards-sdk.es208.js";
|
|
17
|
-
import { skillsConfig, listSkills, getSkillsCatalog, listSkillVersions, listMySkills, getMySkillsList, quoteSkillPublish, quoteSkillPublishPreview, publishSkill, getSkillPublishJob, getSkillOwnership, getRecommendedSkillVersion, setRecommendedSkillVersion, getSkillDeprecations, setSkillDeprecation, getSkillBadge, getSkillStatus, getSkillSecurityBreakdown, getSkillStatusByRepo, getSkillConversionSignalsByRepo, uploadSkillPreviewFromGithubOidc, getSkillPreview, getSkillPreviewByRepo, getSkillPreviewById, getSkillInstall, recordSkillInstallCopy, listSkillTags, listSkillCategories, resolveSkillMarkdown, resolveSkillManifest, getSkillVoteStatus, setSkillVote, requestSkillVerification, getSkillVerificationStatus, createSkillDomainProofChallenge, verifySkillDomainProof } from "./standards-sdk.es190.js";
|
|
18
|
-
import { DEFAULT_BASE_URL, normaliseBaseUrl, normaliseHeaderName, isBrowserRuntime, DEFAULT_USER_AGENT, JSON_CONTENT_TYPE, serialiseAgentRegistrationRequest, MINIMUM_REGISTRATION_AUTO_TOP_UP_CREDITS, createAbortError, isJsonObject, DEFAULT_HISTORY_TOP_UP_HBAR } from "./standards-sdk.es209.js";
|
|
19
|
-
import { RegistryBrokerError, RegistryBrokerParseError } from "./standards-sdk.es151.js";
|
|
20
|
-
import { optionalImportSync } from "./standards-sdk.es187.js";
|
|
21
|
-
class RegistryBrokerClient {
|
|
1
|
+
import { Logger } from "./standards-sdk.es147.js";
|
|
2
|
+
class ProgressReporter {
|
|
22
3
|
constructor(options = {}) {
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
25
|
-
this.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
this.conversationContexts = /* @__PURE__ */ new Map();
|
|
29
|
-
const {
|
|
30
|
-
baseUrl = DEFAULT_BASE_URL,
|
|
31
|
-
fetchImplementation,
|
|
32
|
-
defaultHeaders,
|
|
33
|
-
apiKey,
|
|
34
|
-
accountId,
|
|
35
|
-
ledgerApiKey,
|
|
36
|
-
registrationAutoTopUp,
|
|
37
|
-
historyAutoTopUp,
|
|
38
|
-
encryption
|
|
39
|
-
} = options;
|
|
40
|
-
this.baseUrl = normaliseBaseUrl(baseUrl);
|
|
41
|
-
const resolvedFetch = fetchImplementation ?? (typeof globalThis.fetch === "function" ? globalThis.fetch : null);
|
|
42
|
-
if (!resolvedFetch) {
|
|
43
|
-
throw new Error(
|
|
44
|
-
"A fetch implementation is required for RegistryBrokerClient"
|
|
45
|
-
);
|
|
46
|
-
}
|
|
47
|
-
this.fetchImpl = resolvedFetch;
|
|
48
|
-
this.defaultHeaders = {
|
|
49
|
-
...defaultHeaders ?? {}
|
|
50
|
-
};
|
|
51
|
-
Object.entries(this.defaultHeaders).forEach(([key, value]) => {
|
|
52
|
-
const headerName = normaliseHeaderName(key);
|
|
53
|
-
if (headerName !== key) {
|
|
54
|
-
delete this.defaultHeaders[key];
|
|
55
|
-
this.defaultHeaders[headerName] = value;
|
|
56
|
-
}
|
|
4
|
+
this.module = options.module || "Progress";
|
|
5
|
+
this.callback = options.callback;
|
|
6
|
+
this.logger = options.logger || new Logger({
|
|
7
|
+
level: "info",
|
|
8
|
+
module: "ProgressReporter"
|
|
57
9
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
|
|
10
|
+
this.logProgress = options.logProgress ?? true;
|
|
11
|
+
this.minPercent = options.minPercent ?? 0;
|
|
12
|
+
this.maxPercent = options.maxPercent ?? 100;
|
|
13
|
+
this.lastReportedPercent = -1;
|
|
14
|
+
this.lastReportedTime = 0;
|
|
15
|
+
this.throttleMs = 100;
|
|
16
|
+
}
|
|
17
|
+
static getInstance(options = {}) {
|
|
18
|
+
if (!ProgressReporter.instance) {
|
|
19
|
+
ProgressReporter.instance = new ProgressReporter(options);
|
|
20
|
+
} else {
|
|
21
|
+
if (options.callback) {
|
|
22
|
+
ProgressReporter.instance.setCallback(options.callback);
|
|
71
23
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
this.historyAutoTopUp = historyAutoTopUp;
|
|
75
|
-
this.encryptionOptions = encryption;
|
|
76
|
-
if (this.encryptionOptions) {
|
|
77
|
-
this.encryptionBootstrapPromise = this.initializeEncryptionBootstrap(
|
|
78
|
-
this.encryptionOptions
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
static async initializeAgent(options) {
|
|
83
|
-
const { uaid, ensureEncryptionKey = true, ...clientOptions } = options;
|
|
84
|
-
const client = new RegistryBrokerClient(clientOptions);
|
|
85
|
-
let encryption = null;
|
|
86
|
-
if (ensureEncryptionKey) {
|
|
87
|
-
const ensureOptions = typeof ensureEncryptionKey === "object" ? ensureEncryptionKey : { generateIfMissing: true };
|
|
88
|
-
encryption = await client.encryption.ensureAgentKey({
|
|
89
|
-
uaid,
|
|
90
|
-
...ensureOptions
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return { client, encryption };
|
|
94
|
-
}
|
|
95
|
-
get chat() {
|
|
96
|
-
if (this.chatApi) {
|
|
97
|
-
return this.chatApi;
|
|
98
|
-
}
|
|
99
|
-
const api = createChatApi(this, this.getEncryptedChatManager());
|
|
100
|
-
this.chatApi = api;
|
|
101
|
-
return api;
|
|
102
|
-
}
|
|
103
|
-
/** Owner + bot mailbox surface; see ./agent-network.ts. */
|
|
104
|
-
get agentNetwork() {
|
|
105
|
-
if (!this.agentNetworkApi) {
|
|
106
|
-
this.agentNetworkApi = createAgentNetworkApi(this);
|
|
107
|
-
}
|
|
108
|
-
return this.agentNetworkApi;
|
|
109
|
-
}
|
|
110
|
-
get encryption() {
|
|
111
|
-
if (this.encryptionApi) {
|
|
112
|
-
return this.encryptionApi;
|
|
113
|
-
}
|
|
114
|
-
const api = createEncryptionApi(this);
|
|
115
|
-
this.encryptionApi = api;
|
|
116
|
-
return api;
|
|
117
|
-
}
|
|
118
|
-
setApiKey(apiKey) {
|
|
119
|
-
this.setDefaultHeader("x-api-key", apiKey);
|
|
120
|
-
}
|
|
121
|
-
setLedgerApiKey(apiKey) {
|
|
122
|
-
this.setDefaultHeader("x-api-key", apiKey);
|
|
123
|
-
delete this.defaultHeaders["x-ledger-api-key"];
|
|
124
|
-
}
|
|
125
|
-
setDefaultHeader(name, value) {
|
|
126
|
-
if (!name || name.trim().length === 0) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
const headerName = normaliseHeaderName(name);
|
|
130
|
-
if (!value || value.trim().length === 0) {
|
|
131
|
-
delete this.defaultHeaders[headerName];
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
this.defaultHeaders[headerName] = value.trim();
|
|
135
|
-
}
|
|
136
|
-
getDefaultHeaders() {
|
|
137
|
-
return { ...this.defaultHeaders };
|
|
138
|
-
}
|
|
139
|
-
async encryptionReady() {
|
|
140
|
-
if (!this.encryptionBootstrapPromise) {
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
await this.encryptionBootstrapPromise;
|
|
144
|
-
}
|
|
145
|
-
buildUrl(path) {
|
|
146
|
-
const normalisedPath = path.startsWith("/") ? path : `/${path}`;
|
|
147
|
-
return `${this.baseUrl}${normalisedPath}`;
|
|
148
|
-
}
|
|
149
|
-
buildRequestInit(config) {
|
|
150
|
-
const headers = new Headers();
|
|
151
|
-
Object.entries(this.defaultHeaders).forEach(([key, value]) => {
|
|
152
|
-
headers.set(key, value);
|
|
153
|
-
});
|
|
154
|
-
if (config.headers) {
|
|
155
|
-
Object.entries(config.headers).forEach(([key, value]) => {
|
|
156
|
-
headers.set(key, value);
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
if (!headers.has("accept")) {
|
|
160
|
-
headers.set("accept", "application/json");
|
|
161
|
-
}
|
|
162
|
-
if (!headers.has("user-agent") && !isBrowserRuntime()) {
|
|
163
|
-
headers.set("user-agent", DEFAULT_USER_AGENT);
|
|
164
|
-
}
|
|
165
|
-
const init = {
|
|
166
|
-
method: config.method ?? "GET",
|
|
167
|
-
headers
|
|
168
|
-
};
|
|
169
|
-
if (config.body !== void 0) {
|
|
170
|
-
init.body = JSON.stringify(config.body);
|
|
171
|
-
if (!headers.has("content-type")) {
|
|
172
|
-
headers.set("content-type", "application/json");
|
|
24
|
+
if (options.module) {
|
|
25
|
+
ProgressReporter.instance.setModule(options.module);
|
|
173
26
|
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
async request(path, config) {
|
|
178
|
-
const init = this.buildRequestInit(config);
|
|
179
|
-
const response = await this.fetchImpl(this.buildUrl(path), init);
|
|
180
|
-
if (response.ok) {
|
|
181
|
-
return response;
|
|
182
|
-
}
|
|
183
|
-
const errorBody = await this.extractErrorBody(response);
|
|
184
|
-
throw new RegistryBrokerError("Registry broker request failed", {
|
|
185
|
-
status: response.status,
|
|
186
|
-
statusText: response.statusText,
|
|
187
|
-
body: errorBody
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
async requestAbsolute(url, config) {
|
|
191
|
-
const init = this.buildRequestInit(config);
|
|
192
|
-
const response = await this.fetchImpl(url, init);
|
|
193
|
-
if (response.ok) {
|
|
194
|
-
return response;
|
|
195
|
-
}
|
|
196
|
-
const errorBody = await this.extractErrorBody(response);
|
|
197
|
-
throw new RegistryBrokerError("Registry broker request failed", {
|
|
198
|
-
status: response.status,
|
|
199
|
-
statusText: response.statusText,
|
|
200
|
-
body: errorBody
|
|
201
|
-
});
|
|
202
|
-
}
|
|
203
|
-
async requestJson(path, config) {
|
|
204
|
-
const response = await this.request(path, config);
|
|
205
|
-
const contentType = response.headers?.get("content-type") ?? "";
|
|
206
|
-
if (!JSON_CONTENT_TYPE.test(contentType)) {
|
|
207
|
-
const body = await response.text();
|
|
208
|
-
throw new RegistryBrokerParseError(
|
|
209
|
-
"Expected JSON response from registry broker",
|
|
210
|
-
body
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
return await response.json();
|
|
214
|
-
}
|
|
215
|
-
async requestAbsoluteJson(url, config) {
|
|
216
|
-
const response = await this.requestAbsolute(url, config);
|
|
217
|
-
const contentType = response.headers?.get("content-type") ?? "";
|
|
218
|
-
if (!JSON_CONTENT_TYPE.test(contentType)) {
|
|
219
|
-
const body = await response.text();
|
|
220
|
-
throw new RegistryBrokerParseError(
|
|
221
|
-
"Expected JSON response from registry broker",
|
|
222
|
-
body
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
return await response.json();
|
|
226
|
-
}
|
|
227
|
-
async getAgentFeedback(uaid, options = {}) {
|
|
228
|
-
const normalized = uaid.trim();
|
|
229
|
-
if (!normalized) {
|
|
230
|
-
throw new Error("uaid is required");
|
|
231
|
-
}
|
|
232
|
-
const query = options.includeRevoked === true ? "?includeRevoked=true" : "";
|
|
233
|
-
const raw = await this.requestJson(
|
|
234
|
-
`/agents/${encodeURIComponent(normalized)}/feedback${query}`,
|
|
235
|
-
{ method: "GET" }
|
|
236
|
-
);
|
|
237
|
-
return this.parseWithSchema(
|
|
238
|
-
raw,
|
|
239
|
-
agentFeedbackResponseSchema,
|
|
240
|
-
"agent feedback response"
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
async listAgentFeedbackIndex(options = {}) {
|
|
244
|
-
const params = new URLSearchParams();
|
|
245
|
-
if (typeof options.page === "number" && Number.isFinite(options.page)) {
|
|
246
|
-
params.set("page", String(Math.trunc(options.page)));
|
|
247
|
-
}
|
|
248
|
-
if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
|
|
249
|
-
params.set("limit", String(Math.trunc(options.limit)));
|
|
250
|
-
}
|
|
251
|
-
if (options.registries?.length) {
|
|
252
|
-
params.set("registry", options.registries.join(","));
|
|
253
|
-
}
|
|
254
|
-
const suffix = params.size > 0 ? `?${params.toString()}` : "";
|
|
255
|
-
const raw = await this.requestJson(`/agents/feedback${suffix}`, {
|
|
256
|
-
method: "GET"
|
|
257
|
-
});
|
|
258
|
-
return this.parseWithSchema(
|
|
259
|
-
raw,
|
|
260
|
-
agentFeedbackIndexResponseSchema,
|
|
261
|
-
"agent feedback index response"
|
|
262
|
-
);
|
|
263
|
-
}
|
|
264
|
-
async listAgentFeedbackEntriesIndex(options = {}) {
|
|
265
|
-
const params = new URLSearchParams();
|
|
266
|
-
if (typeof options.page === "number" && Number.isFinite(options.page)) {
|
|
267
|
-
params.set("page", String(Math.trunc(options.page)));
|
|
268
|
-
}
|
|
269
|
-
if (typeof options.limit === "number" && Number.isFinite(options.limit)) {
|
|
270
|
-
params.set("limit", String(Math.trunc(options.limit)));
|
|
271
|
-
}
|
|
272
|
-
if (options.registries?.length) {
|
|
273
|
-
params.set("registry", options.registries.join(","));
|
|
274
|
-
}
|
|
275
|
-
const suffix = params.size > 0 ? `?${params.toString()}` : "";
|
|
276
|
-
const raw = await this.requestJson(
|
|
277
|
-
`/agents/feedback/entries${suffix}`,
|
|
278
|
-
{ method: "GET" }
|
|
279
|
-
);
|
|
280
|
-
return this.parseWithSchema(
|
|
281
|
-
raw,
|
|
282
|
-
agentFeedbackEntriesIndexResponseSchema,
|
|
283
|
-
"agent feedback entries index response"
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
async checkAgentFeedbackEligibility(uaid, payload) {
|
|
287
|
-
const normalized = uaid.trim();
|
|
288
|
-
if (!normalized) {
|
|
289
|
-
throw new Error("uaid is required");
|
|
290
|
-
}
|
|
291
|
-
const raw = await this.requestJson(
|
|
292
|
-
`/agents/${encodeURIComponent(normalized)}/feedback/eligibility`,
|
|
293
|
-
{
|
|
294
|
-
method: "POST",
|
|
295
|
-
body: payload,
|
|
296
|
-
headers: { "content-type": "application/json" }
|
|
27
|
+
if (options.logger) {
|
|
28
|
+
ProgressReporter.instance.setLogger(options.logger);
|
|
297
29
|
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
raw,
|
|
301
|
-
agentFeedbackEligibilityResponseSchema,
|
|
302
|
-
"agent feedback eligibility response"
|
|
303
|
-
);
|
|
304
|
-
}
|
|
305
|
-
async submitAgentFeedback(uaid, payload) {
|
|
306
|
-
const normalized = uaid.trim();
|
|
307
|
-
if (!normalized) {
|
|
308
|
-
throw new Error("uaid is required");
|
|
309
|
-
}
|
|
310
|
-
const raw = await this.requestJson(
|
|
311
|
-
`/agents/${encodeURIComponent(normalized)}/feedback`,
|
|
312
|
-
{
|
|
313
|
-
method: "POST",
|
|
314
|
-
body: payload,
|
|
315
|
-
headers: { "content-type": "application/json" }
|
|
30
|
+
if (options.minPercent !== void 0) {
|
|
31
|
+
ProgressReporter.instance.setMinPercent(options.minPercent);
|
|
316
32
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
raw,
|
|
320
|
-
agentFeedbackSubmissionResponseSchema,
|
|
321
|
-
"agent feedback submission response"
|
|
322
|
-
);
|
|
323
|
-
}
|
|
324
|
-
async search(params = {}) {
|
|
325
|
-
return search(this, params);
|
|
326
|
-
}
|
|
327
|
-
async delegate(request) {
|
|
328
|
-
return delegate(this, request);
|
|
329
|
-
}
|
|
330
|
-
async searchErc8004ByAgentId(params) {
|
|
331
|
-
const chainId = Math.floor(params.chainId);
|
|
332
|
-
if (!Number.isFinite(chainId) || chainId <= 0) {
|
|
333
|
-
throw new Error("chainId must be a positive integer");
|
|
334
|
-
}
|
|
335
|
-
const rawAgentId = typeof params.agentId === "bigint" ? params.agentId.toString() : String(params.agentId);
|
|
336
|
-
const agentId = rawAgentId.trim();
|
|
337
|
-
if (!agentId) {
|
|
338
|
-
throw new Error("agentId is required");
|
|
339
|
-
}
|
|
340
|
-
const nativeId = `${chainId}:${agentId}`;
|
|
341
|
-
return search(this, {
|
|
342
|
-
registries: ["erc-8004"],
|
|
343
|
-
limit: params.limit ?? 1,
|
|
344
|
-
...typeof params.page === "number" ? { page: params.page } : {},
|
|
345
|
-
...typeof params.sortBy === "string" ? { sortBy: params.sortBy } : {},
|
|
346
|
-
...typeof params.sortOrder === "string" ? { sortOrder: params.sortOrder } : {},
|
|
347
|
-
metadata: {
|
|
348
|
-
nativeId: [nativeId],
|
|
349
|
-
networkKey: [`eip155:${chainId}`]
|
|
33
|
+
if (options.maxPercent !== void 0) {
|
|
34
|
+
ProgressReporter.instance.setMaxPercent(options.maxPercent);
|
|
350
35
|
}
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
async stats() {
|
|
354
|
-
return stats(this);
|
|
355
|
-
}
|
|
356
|
-
async registries() {
|
|
357
|
-
return registries(this);
|
|
358
|
-
}
|
|
359
|
-
async getAdditionalRegistries() {
|
|
360
|
-
return getAdditionalRegistries(this);
|
|
361
|
-
}
|
|
362
|
-
async popularSearches() {
|
|
363
|
-
return popularSearches(this);
|
|
364
|
-
}
|
|
365
|
-
async listProtocols() {
|
|
366
|
-
return listProtocols(this);
|
|
367
|
-
}
|
|
368
|
-
async detectProtocol(message) {
|
|
369
|
-
return detectProtocol(this, message);
|
|
370
|
-
}
|
|
371
|
-
async registrySearchByNamespace(registry, query) {
|
|
372
|
-
return registrySearchByNamespace(this, registry, query);
|
|
373
|
-
}
|
|
374
|
-
async vectorSearch(request) {
|
|
375
|
-
return vectorSearch(this, request);
|
|
376
|
-
}
|
|
377
|
-
async searchStatus() {
|
|
378
|
-
return searchStatus(this);
|
|
379
|
-
}
|
|
380
|
-
async websocketStats() {
|
|
381
|
-
return websocketStats(this);
|
|
382
|
-
}
|
|
383
|
-
async metricsSummary() {
|
|
384
|
-
return metricsSummary(this);
|
|
385
|
-
}
|
|
386
|
-
async facets(adapter) {
|
|
387
|
-
return facets(this, adapter);
|
|
388
|
-
}
|
|
389
|
-
async adapters() {
|
|
390
|
-
return adapters(this);
|
|
391
|
-
}
|
|
392
|
-
async skillsConfig() {
|
|
393
|
-
return skillsConfig(this);
|
|
394
|
-
}
|
|
395
|
-
async listSkills(options) {
|
|
396
|
-
return listSkills(this, options);
|
|
397
|
-
}
|
|
398
|
-
async getSkillsCatalog(options) {
|
|
399
|
-
return getSkillsCatalog(this, options);
|
|
400
|
-
}
|
|
401
|
-
async listSkillVersions(params) {
|
|
402
|
-
return listSkillVersions(this, params);
|
|
403
|
-
}
|
|
404
|
-
async listMySkills(params) {
|
|
405
|
-
return listMySkills(this, params);
|
|
406
|
-
}
|
|
407
|
-
async getMySkillsList(params) {
|
|
408
|
-
return getMySkillsList(this, params);
|
|
409
|
-
}
|
|
410
|
-
async quoteSkillPublish(payload) {
|
|
411
|
-
return quoteSkillPublish(this, payload);
|
|
412
|
-
}
|
|
413
|
-
async quoteSkillPublishPreview(payload) {
|
|
414
|
-
return quoteSkillPublishPreview(this, payload);
|
|
415
|
-
}
|
|
416
|
-
async publishSkill(payload) {
|
|
417
|
-
return publishSkill(this, payload);
|
|
418
|
-
}
|
|
419
|
-
async getSkillPublishJob(jobId, params) {
|
|
420
|
-
return getSkillPublishJob(this, jobId, params);
|
|
421
|
-
}
|
|
422
|
-
async getSkillOwnership(params) {
|
|
423
|
-
return getSkillOwnership(this, params);
|
|
424
|
-
}
|
|
425
|
-
async getRecommendedSkillVersion(params) {
|
|
426
|
-
return getRecommendedSkillVersion(this, params);
|
|
427
|
-
}
|
|
428
|
-
async setRecommendedSkillVersion(payload) {
|
|
429
|
-
return setRecommendedSkillVersion(this, payload);
|
|
430
|
-
}
|
|
431
|
-
async getSkillDeprecations(params) {
|
|
432
|
-
return getSkillDeprecations(this, params);
|
|
433
|
-
}
|
|
434
|
-
async setSkillDeprecation(payload) {
|
|
435
|
-
return setSkillDeprecation(this, payload);
|
|
436
|
-
}
|
|
437
|
-
async getSkillBadge(params) {
|
|
438
|
-
return getSkillBadge(this, params);
|
|
439
|
-
}
|
|
440
|
-
async getSkillStatus(params) {
|
|
441
|
-
return getSkillStatus(this, params);
|
|
442
|
-
}
|
|
443
|
-
async getSkillSecurityBreakdown(params) {
|
|
444
|
-
return getSkillSecurityBreakdown(this, params);
|
|
445
|
-
}
|
|
446
|
-
async getSkillStatusByRepo(params) {
|
|
447
|
-
return getSkillStatusByRepo(this, params);
|
|
448
|
-
}
|
|
449
|
-
async getSkillConversionSignalsByRepo(params) {
|
|
450
|
-
return getSkillConversionSignalsByRepo(this, params);
|
|
451
|
-
}
|
|
452
|
-
async uploadSkillPreviewFromGithubOidc(payload) {
|
|
453
|
-
return uploadSkillPreviewFromGithubOidc(this, payload);
|
|
454
|
-
}
|
|
455
|
-
async getSkillPreview(params) {
|
|
456
|
-
return getSkillPreview(this, params);
|
|
457
|
-
}
|
|
458
|
-
async getSkillPreviewByRepo(params) {
|
|
459
|
-
return getSkillPreviewByRepo(this, params);
|
|
460
|
-
}
|
|
461
|
-
async getSkillPreviewById(previewId) {
|
|
462
|
-
return getSkillPreviewById(this, previewId);
|
|
463
|
-
}
|
|
464
|
-
async getSkillInstall(skillRef) {
|
|
465
|
-
return getSkillInstall(this, skillRef);
|
|
466
|
-
}
|
|
467
|
-
async recordSkillInstallCopy(skillRef, payload) {
|
|
468
|
-
return recordSkillInstallCopy(this, skillRef, payload);
|
|
469
|
-
}
|
|
470
|
-
async listSkillTags() {
|
|
471
|
-
return listSkillTags(this);
|
|
472
|
-
}
|
|
473
|
-
async listSkillCategories() {
|
|
474
|
-
return listSkillCategories(this);
|
|
475
|
-
}
|
|
476
|
-
async resolveSkillMarkdown(skillRef) {
|
|
477
|
-
return resolveSkillMarkdown(this, skillRef);
|
|
478
|
-
}
|
|
479
|
-
async resolveSkillManifest(skillRef) {
|
|
480
|
-
return resolveSkillManifest(this, skillRef);
|
|
481
|
-
}
|
|
482
|
-
async getSkillVoteStatus(params) {
|
|
483
|
-
return getSkillVoteStatus(this, params);
|
|
484
|
-
}
|
|
485
|
-
async setSkillVote(payload) {
|
|
486
|
-
return setSkillVote(this, payload);
|
|
487
|
-
}
|
|
488
|
-
async requestSkillVerification(payload) {
|
|
489
|
-
return requestSkillVerification(this, payload);
|
|
490
|
-
}
|
|
491
|
-
async getSkillVerificationStatus(params) {
|
|
492
|
-
return getSkillVerificationStatus(this, params);
|
|
493
|
-
}
|
|
494
|
-
async createSkillDomainProofChallenge(payload) {
|
|
495
|
-
return createSkillDomainProofChallenge(this, payload);
|
|
496
|
-
}
|
|
497
|
-
async verifySkillDomainProof(payload) {
|
|
498
|
-
return verifySkillDomainProof(this, payload);
|
|
499
|
-
}
|
|
500
|
-
async adaptersDetailed() {
|
|
501
|
-
return adaptersDetailed(this);
|
|
502
|
-
}
|
|
503
|
-
async adapterRegistryCategories() {
|
|
504
|
-
return adapterRegistryCategories(this);
|
|
36
|
+
}
|
|
37
|
+
return ProgressReporter.instance;
|
|
505
38
|
}
|
|
506
|
-
|
|
507
|
-
|
|
39
|
+
setCallback(callback) {
|
|
40
|
+
this.callback = callback;
|
|
508
41
|
}
|
|
509
|
-
|
|
510
|
-
|
|
42
|
+
setModule(module) {
|
|
43
|
+
this.module = module;
|
|
511
44
|
}
|
|
512
|
-
|
|
513
|
-
|
|
45
|
+
setLogger(logger) {
|
|
46
|
+
this.logger = logger;
|
|
514
47
|
}
|
|
515
|
-
|
|
516
|
-
|
|
48
|
+
setMinPercent(minPercent) {
|
|
49
|
+
this.minPercent = minPercent;
|
|
517
50
|
}
|
|
518
|
-
|
|
519
|
-
|
|
51
|
+
setMaxPercent(maxPercent) {
|
|
52
|
+
this.maxPercent = maxPercent;
|
|
520
53
|
}
|
|
521
|
-
|
|
522
|
-
const
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
54
|
+
createSubProgress(options) {
|
|
55
|
+
const subReporter = new ProgressReporter({
|
|
56
|
+
module: this.module,
|
|
57
|
+
logger: this.logger,
|
|
58
|
+
logProgress: this.logProgress,
|
|
59
|
+
minPercent: options.minPercent,
|
|
60
|
+
maxPercent: options.maxPercent
|
|
526
61
|
});
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
calculateHbarAmount(creditsToPurchase, creditsPerHbar) {
|
|
534
|
-
if (creditsPerHbar <= 0) {
|
|
535
|
-
throw new Error("creditsPerHbar must be positive");
|
|
536
|
-
}
|
|
537
|
-
if (creditsToPurchase <= 0) {
|
|
538
|
-
throw new Error("creditsToPurchase must be positive");
|
|
539
|
-
}
|
|
540
|
-
const rawHbar = creditsToPurchase / creditsPerHbar;
|
|
541
|
-
const tinybars = Math.ceil(rawHbar * 1e8);
|
|
542
|
-
return tinybars / 1e8;
|
|
543
|
-
}
|
|
544
|
-
resolveCreditsToPurchase(shortfallCredits) {
|
|
545
|
-
if (!Number.isFinite(shortfallCredits) || shortfallCredits <= 0) {
|
|
546
|
-
return 0;
|
|
547
|
-
}
|
|
548
|
-
return Math.max(
|
|
549
|
-
Math.ceil(shortfallCredits),
|
|
550
|
-
MINIMUM_REGISTRATION_AUTO_TOP_UP_CREDITS
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
async ensureCreditsForRegistration(payload, autoTopUp) {
|
|
554
|
-
const details = autoTopUp ?? null;
|
|
555
|
-
if (!details) {
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
558
|
-
if (!details.accountId || !details.accountId.trim()) {
|
|
559
|
-
throw new Error("autoTopUp.accountId is required");
|
|
560
|
-
}
|
|
561
|
-
if (!details.privateKey || !details.privateKey.trim()) {
|
|
562
|
-
throw new Error("autoTopUp.privateKey is required");
|
|
563
|
-
}
|
|
564
|
-
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
565
|
-
const quote = await this.getRegistrationQuote(payload);
|
|
566
|
-
const shortfall = quote.shortfallCredits ?? 0;
|
|
567
|
-
if (shortfall <= 0) {
|
|
568
|
-
return;
|
|
569
|
-
}
|
|
570
|
-
const creditsToPurchase = this.resolveCreditsToPurchase(shortfall);
|
|
571
|
-
if (creditsToPurchase <= 0) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
const creditsPerHbar = quote.creditsPerHbar ?? null;
|
|
575
|
-
if (!creditsPerHbar || creditsPerHbar <= 0) {
|
|
576
|
-
throw new Error("Unable to determine credits per HBAR for auto top-up");
|
|
577
|
-
}
|
|
578
|
-
const hbarAmount = this.calculateHbarAmount(
|
|
579
|
-
creditsToPurchase,
|
|
580
|
-
creditsPerHbar
|
|
62
|
+
const logPrefix = options.logPrefix || "";
|
|
63
|
+
subReporter.setCallback((data) => {
|
|
64
|
+
const scaledPercent = this.scalePercent(
|
|
65
|
+
data.progressPercent,
|
|
66
|
+
options.minPercent,
|
|
67
|
+
options.maxPercent
|
|
581
68
|
);
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
hbarAmount,
|
|
586
|
-
memo: details.memo ?? "Registry Broker auto top-up",
|
|
587
|
-
metadata: {
|
|
588
|
-
shortfallCredits: shortfall,
|
|
589
|
-
requiredCredits: quote.requiredCredits,
|
|
590
|
-
purchasedCredits: creditsToPurchase
|
|
591
|
-
}
|
|
592
|
-
});
|
|
593
|
-
}
|
|
594
|
-
const finalQuote = await this.getRegistrationQuote(payload);
|
|
595
|
-
if ((finalQuote.shortfallCredits ?? 0) > 0) {
|
|
596
|
-
throw new Error("Unable to purchase sufficient credits for registration");
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
async registerAgent(payload, options) {
|
|
600
|
-
const autoTopUp = options?.autoTopUp ?? this.registrationAutoTopUp;
|
|
601
|
-
if (!autoTopUp) {
|
|
602
|
-
return this.performRegisterAgent(payload);
|
|
603
|
-
}
|
|
604
|
-
await this.ensureCreditsForRegistration(payload, autoTopUp);
|
|
605
|
-
let retried = false;
|
|
606
|
-
while (true) {
|
|
607
|
-
try {
|
|
608
|
-
return await this.performRegisterAgent(payload);
|
|
609
|
-
} catch (error) {
|
|
610
|
-
const shortfall = this.extractInsufficientCreditsDetails(error);
|
|
611
|
-
if (shortfall && !retried) {
|
|
612
|
-
await this.ensureCreditsForRegistration(payload, autoTopUp);
|
|
613
|
-
retried = true;
|
|
614
|
-
continue;
|
|
615
|
-
}
|
|
616
|
-
throw error;
|
|
69
|
+
let formattedMessage = data.message;
|
|
70
|
+
if (logPrefix && !formattedMessage.startsWith(logPrefix)) {
|
|
71
|
+
formattedMessage = `${logPrefix}: ${formattedMessage}`;
|
|
617
72
|
}
|
|
73
|
+
this.report({
|
|
74
|
+
stage: data.stage,
|
|
75
|
+
message: formattedMessage,
|
|
76
|
+
progressPercent: scaledPercent,
|
|
77
|
+
details: data.details
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
return subReporter;
|
|
81
|
+
}
|
|
82
|
+
report(data) {
|
|
83
|
+
const rawPercent = data.progressPercent;
|
|
84
|
+
const percent = Math.max(0, Math.min(100, rawPercent));
|
|
85
|
+
const scaledPercent = this.scalePercent(percent, 0, 100);
|
|
86
|
+
const now = Date.now();
|
|
87
|
+
if (scaledPercent === this.lastReportedPercent && now - this.lastReportedTime < this.throttleMs && data.stage !== "completed" && data.stage !== "failed") {
|
|
88
|
+
return;
|
|
618
89
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
return registerOwnedMoltbookAgent(this, uaid, payload);
|
|
631
|
-
}
|
|
632
|
-
async getRegistrationProgress(attemptId) {
|
|
633
|
-
return getRegistrationProgress(this, attemptId);
|
|
634
|
-
}
|
|
635
|
-
async waitForRegistrationCompletion(attemptId, options) {
|
|
636
|
-
return waitForRegistrationCompletion(this, attemptId, options);
|
|
637
|
-
}
|
|
638
|
-
async validateUaid(uaid) {
|
|
639
|
-
return validateUaid(this, uaid);
|
|
640
|
-
}
|
|
641
|
-
async getUaidConnectionStatus(uaid) {
|
|
642
|
-
return getUaidConnectionStatus(this, uaid);
|
|
643
|
-
}
|
|
644
|
-
async closeUaidConnection(uaid) {
|
|
645
|
-
return closeUaidConnection(this, uaid);
|
|
646
|
-
}
|
|
647
|
-
async dashboardStats() {
|
|
648
|
-
return dashboardStats(this);
|
|
649
|
-
}
|
|
650
|
-
async getCreditsBalance(params = {}) {
|
|
651
|
-
return getCreditsBalance(this, params);
|
|
652
|
-
}
|
|
653
|
-
async getCreditProviders() {
|
|
654
|
-
return getCreditProviders(this);
|
|
655
|
-
}
|
|
656
|
-
async getGuardSession() {
|
|
657
|
-
return getGuardSession(this);
|
|
658
|
-
}
|
|
659
|
-
async getGuardEntitlements() {
|
|
660
|
-
return getGuardEntitlements(this);
|
|
661
|
-
}
|
|
662
|
-
async getGuardBillingBalance() {
|
|
663
|
-
return getGuardBillingBalance(this);
|
|
664
|
-
}
|
|
665
|
-
async getGuardFeed(limit) {
|
|
666
|
-
return getGuardFeed(this, limit);
|
|
667
|
-
}
|
|
668
|
-
async getGuardOverview() {
|
|
669
|
-
return getGuardOverview(this);
|
|
670
|
-
}
|
|
671
|
-
async getGuardTrustByHash(sha256) {
|
|
672
|
-
return getGuardTrustByHash(this, sha256);
|
|
673
|
-
}
|
|
674
|
-
async resolveGuardTrust(query) {
|
|
675
|
-
return resolveGuardTrust(this, query);
|
|
676
|
-
}
|
|
677
|
-
async getGuardRevocations() {
|
|
678
|
-
return getGuardRevocations(this);
|
|
679
|
-
}
|
|
680
|
-
async fetchGuardAdvisories() {
|
|
681
|
-
return fetchGuardAdvisories(this);
|
|
682
|
-
}
|
|
683
|
-
async fetchGuardPolicy() {
|
|
684
|
-
return fetchGuardPolicy(this);
|
|
685
|
-
}
|
|
686
|
-
async getGuardInventory() {
|
|
687
|
-
return getGuardInventory(this);
|
|
688
|
-
}
|
|
689
|
-
async getGuardReceiptHistory() {
|
|
690
|
-
return getGuardReceiptHistory(this);
|
|
691
|
-
}
|
|
692
|
-
async getGuardArtifactTimeline(artifactId) {
|
|
693
|
-
return getGuardArtifactTimeline(this, artifactId);
|
|
694
|
-
}
|
|
695
|
-
async getGuardInventoryDiff() {
|
|
696
|
-
return getGuardInventoryDiff(this);
|
|
697
|
-
}
|
|
698
|
-
async exportGuardAbom() {
|
|
699
|
-
return exportGuardAbom(this);
|
|
700
|
-
}
|
|
701
|
-
async exportGuardArtifactAbom(artifactId) {
|
|
702
|
-
return exportGuardArtifactAbom(this, artifactId);
|
|
703
|
-
}
|
|
704
|
-
async exportGuardReceipts() {
|
|
705
|
-
return exportGuardReceipts(this);
|
|
706
|
-
}
|
|
707
|
-
async getGuardDevices() {
|
|
708
|
-
return getGuardDevices(this);
|
|
709
|
-
}
|
|
710
|
-
async getGuardAlertPreferences() {
|
|
711
|
-
return getGuardAlertPreferences(this);
|
|
712
|
-
}
|
|
713
|
-
async updateGuardAlertPreferences(payload) {
|
|
714
|
-
return updateGuardAlertPreferences(this, payload);
|
|
715
|
-
}
|
|
716
|
-
async getGuardExceptions() {
|
|
717
|
-
return getGuardExceptions(this);
|
|
718
|
-
}
|
|
719
|
-
async getGuardWatchlist() {
|
|
720
|
-
return getGuardWatchlist(this);
|
|
721
|
-
}
|
|
722
|
-
async lookupGuardWatchlist(payload) {
|
|
723
|
-
return lookupGuardWatchlist(this, payload);
|
|
724
|
-
}
|
|
725
|
-
async getGuardPainSignals() {
|
|
726
|
-
return getGuardPainSignals(this);
|
|
727
|
-
}
|
|
728
|
-
async getGuardAggregatedPainSignals() {
|
|
729
|
-
return getGuardAggregatedPainSignals(this);
|
|
730
|
-
}
|
|
731
|
-
async getGuardPreInstallVerdict(payload) {
|
|
732
|
-
return getGuardPreInstallVerdict(this, payload);
|
|
733
|
-
}
|
|
734
|
-
async getGuardPreExecutionVerdict(payload) {
|
|
735
|
-
return getGuardPreExecutionVerdict(this, payload);
|
|
736
|
-
}
|
|
737
|
-
async addGuardWatchlistItem(payload) {
|
|
738
|
-
return addGuardWatchlistItem(this, payload);
|
|
739
|
-
}
|
|
740
|
-
async removeGuardWatchlistItem(artifactId) {
|
|
741
|
-
return removeGuardWatchlistItem(this, artifactId);
|
|
742
|
-
}
|
|
743
|
-
async addGuardException(payload) {
|
|
744
|
-
return addGuardException(this, payload);
|
|
745
|
-
}
|
|
746
|
-
async requestGuardException(payload) {
|
|
747
|
-
return requestGuardException(this, payload);
|
|
748
|
-
}
|
|
749
|
-
async removeGuardException(exceptionId) {
|
|
750
|
-
return removeGuardException(this, exceptionId);
|
|
751
|
-
}
|
|
752
|
-
async ingestGuardPainSignals(items) {
|
|
753
|
-
return ingestGuardPainSignals(this, items);
|
|
754
|
-
}
|
|
755
|
-
async syncGuardReceipts(payload) {
|
|
756
|
-
return syncGuardReceipts(this, payload);
|
|
757
|
-
}
|
|
758
|
-
async syncGuardInventory(payload) {
|
|
759
|
-
return syncGuardInventory(this, payload);
|
|
760
|
-
}
|
|
761
|
-
async submitGuardReceipts(payload) {
|
|
762
|
-
return submitGuardReceipts(this, payload);
|
|
763
|
-
}
|
|
764
|
-
async getGuardTeamPolicyPack() {
|
|
765
|
-
return getGuardTeamPolicyPack(this);
|
|
766
|
-
}
|
|
767
|
-
async updateGuardTeamPolicyPack(payload) {
|
|
768
|
-
return updateGuardTeamPolicyPack(this, payload);
|
|
769
|
-
}
|
|
770
|
-
async createHbarPurchaseIntent(payload) {
|
|
771
|
-
return createHbarPurchaseIntent(this, payload);
|
|
772
|
-
}
|
|
773
|
-
async purchaseCreditsWithHbar(params) {
|
|
774
|
-
return purchaseCreditsWithHbar(this, params);
|
|
775
|
-
}
|
|
776
|
-
async getX402Minimums() {
|
|
777
|
-
return getX402Minimums(this);
|
|
778
|
-
}
|
|
779
|
-
async purchaseCreditsWithX402(params) {
|
|
780
|
-
return purchaseCreditsWithX402(this, params);
|
|
781
|
-
}
|
|
782
|
-
async buyCreditsWithX402(params) {
|
|
783
|
-
return buyCreditsWithX402(this, params);
|
|
784
|
-
}
|
|
785
|
-
async generateEncryptionKeyPair(options = {}) {
|
|
786
|
-
return generateEncryptionKeyPair(this, options);
|
|
787
|
-
}
|
|
788
|
-
async createLedgerChallenge(payload) {
|
|
789
|
-
return createLedgerChallenge(this, payload);
|
|
790
|
-
}
|
|
791
|
-
async verifyLedgerChallenge(payload) {
|
|
792
|
-
return verifyLedgerChallenge(this, payload);
|
|
793
|
-
}
|
|
794
|
-
async authenticateWithLedger(options) {
|
|
795
|
-
return authenticateWithLedger(this, options);
|
|
796
|
-
}
|
|
797
|
-
async authenticateWithLedgerCredentials(options) {
|
|
798
|
-
return authenticateWithLedgerCredentials(this, options);
|
|
799
|
-
}
|
|
800
|
-
async getVerificationStatus(uaid) {
|
|
801
|
-
return getVerificationStatus(this, uaid);
|
|
802
|
-
}
|
|
803
|
-
async createVerificationChallenge(uaid) {
|
|
804
|
-
return createVerificationChallenge(this, uaid);
|
|
805
|
-
}
|
|
806
|
-
async getVerificationChallenge(challengeId) {
|
|
807
|
-
return getVerificationChallenge(this, challengeId);
|
|
808
|
-
}
|
|
809
|
-
async verifyVerificationChallenge(params) {
|
|
810
|
-
return verifyVerificationChallenge(this, params);
|
|
811
|
-
}
|
|
812
|
-
async getVerificationOwnership(uaid) {
|
|
813
|
-
return getVerificationOwnership(this, uaid);
|
|
814
|
-
}
|
|
815
|
-
async verifySenderOwnership(uaid) {
|
|
816
|
-
return verifySenderOwnership(this, uaid);
|
|
817
|
-
}
|
|
818
|
-
async verifyUaidDnsTxt(payload) {
|
|
819
|
-
return verifyUaidDnsTxt(this, payload);
|
|
820
|
-
}
|
|
821
|
-
async getVerificationDnsStatus(uaid, query) {
|
|
822
|
-
return getVerificationDnsStatus(this, uaid, query);
|
|
823
|
-
}
|
|
824
|
-
async fetchHistorySnapshot(sessionId, options) {
|
|
825
|
-
return fetchHistorySnapshot(
|
|
826
|
-
this.conversationContexts,
|
|
827
|
-
this,
|
|
828
|
-
sessionId,
|
|
829
|
-
options
|
|
830
|
-
);
|
|
831
|
-
}
|
|
832
|
-
attachDecryptedHistory(sessionId, snapshot, options) {
|
|
833
|
-
return attachDecryptedHistory(
|
|
834
|
-
this.conversationContexts,
|
|
835
|
-
this,
|
|
836
|
-
sessionId,
|
|
837
|
-
snapshot,
|
|
838
|
-
options
|
|
839
|
-
);
|
|
840
|
-
}
|
|
841
|
-
registerConversationContextForEncryption(context) {
|
|
842
|
-
registerConversationContextForEncryption(
|
|
843
|
-
this.conversationContexts,
|
|
844
|
-
context
|
|
845
|
-
);
|
|
846
|
-
}
|
|
847
|
-
resolveDecryptionContext(sessionId, options) {
|
|
848
|
-
return resolveDecryptionContext(
|
|
849
|
-
this.conversationContexts,
|
|
850
|
-
this,
|
|
851
|
-
sessionId,
|
|
852
|
-
options
|
|
853
|
-
);
|
|
854
|
-
}
|
|
855
|
-
decryptHistoryEntryFromContext(_sessionId, entry, context) {
|
|
856
|
-
return decryptHistoryEntryFromContext(this, entry, context);
|
|
857
|
-
}
|
|
858
|
-
async createSession(payload, allowHistoryAutoTopUp = true) {
|
|
859
|
-
return createSession(this, payload, allowHistoryAutoTopUp);
|
|
860
|
-
}
|
|
861
|
-
async resumeSession(sessionId) {
|
|
862
|
-
return resumeSession(this, sessionId);
|
|
863
|
-
}
|
|
864
|
-
async checkChatReadiness(payload) {
|
|
865
|
-
return checkChatReadiness(this, payload);
|
|
866
|
-
}
|
|
867
|
-
async startChat(options) {
|
|
868
|
-
return startChat(this, this.getEncryptedChatManager(), options);
|
|
869
|
-
}
|
|
870
|
-
async startConversation(options) {
|
|
871
|
-
return startConversation(this, this.getEncryptedChatManager(), options);
|
|
872
|
-
}
|
|
873
|
-
async acceptConversation(options) {
|
|
874
|
-
return acceptConversation(
|
|
875
|
-
this,
|
|
876
|
-
this.getEncryptedChatManager(),
|
|
877
|
-
options
|
|
878
|
-
);
|
|
879
|
-
}
|
|
880
|
-
compactHistory(payload) {
|
|
881
|
-
return compactHistory(this, payload);
|
|
882
|
-
}
|
|
883
|
-
fetchEncryptionStatus(sessionId) {
|
|
884
|
-
return fetchEncryptionStatus(this, sessionId);
|
|
885
|
-
}
|
|
886
|
-
postEncryptionHandshake(sessionId, payload) {
|
|
887
|
-
return postEncryptionHandshake(this, sessionId, payload);
|
|
888
|
-
}
|
|
889
|
-
sendMessage(payload) {
|
|
890
|
-
return sendMessage(this, payload);
|
|
891
|
-
}
|
|
892
|
-
retryMessage(messageId, payload) {
|
|
893
|
-
return retryMessage(this, messageId, payload);
|
|
894
|
-
}
|
|
895
|
-
cancelSession(sessionId) {
|
|
896
|
-
return cancelSession(this, sessionId);
|
|
897
|
-
}
|
|
898
|
-
endSession(sessionId) {
|
|
899
|
-
return endSession(this, sessionId);
|
|
900
|
-
}
|
|
901
|
-
createPlaintextConversationHandle(sessionId, summary, defaultAuth, context) {
|
|
902
|
-
return createPlaintextConversationHandle(
|
|
903
|
-
this,
|
|
904
|
-
sessionId,
|
|
905
|
-
summary,
|
|
906
|
-
defaultAuth,
|
|
907
|
-
context
|
|
908
|
-
);
|
|
909
|
-
}
|
|
910
|
-
getEncryptedChatManager() {
|
|
911
|
-
if (this.encryptedChatManager) {
|
|
912
|
-
return this.encryptedChatManager;
|
|
90
|
+
this.lastReportedPercent = scaledPercent;
|
|
91
|
+
this.lastReportedTime = now;
|
|
92
|
+
const progressData = {
|
|
93
|
+
...data,
|
|
94
|
+
progressPercent: scaledPercent
|
|
95
|
+
};
|
|
96
|
+
if (this.logProgress) {
|
|
97
|
+
this.logger.debug(
|
|
98
|
+
`[${this.module}] [${data.stage.toUpperCase()}] ${data.message} (${scaledPercent.toFixed(1)}%)`,
|
|
99
|
+
data.details
|
|
100
|
+
);
|
|
913
101
|
}
|
|
914
|
-
|
|
915
|
-
this.encryptedChatManager = manager;
|
|
916
|
-
return manager;
|
|
917
|
-
}
|
|
918
|
-
async extractErrorBody(response) {
|
|
919
|
-
const contentType = response.headers?.get("content-type") ?? "";
|
|
920
|
-
if (JSON_CONTENT_TYPE.test(contentType)) {
|
|
102
|
+
if (this.callback) {
|
|
921
103
|
try {
|
|
922
|
-
|
|
923
|
-
} catch (
|
|
924
|
-
|
|
104
|
+
this.callback(progressData);
|
|
105
|
+
} catch (err) {
|
|
106
|
+
this.logger.warn(`Error in progress callback: ${err}`);
|
|
925
107
|
}
|
|
926
108
|
}
|
|
927
|
-
try {
|
|
928
|
-
return await response.text();
|
|
929
|
-
} catch (error) {
|
|
930
|
-
return { parseError: String(error) };
|
|
931
|
-
}
|
|
932
109
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
`Failed to parse ${context}`,
|
|
939
|
-
error instanceof ZodError || error instanceof Error ? error : String(error),
|
|
940
|
-
value
|
|
941
|
-
);
|
|
942
|
-
}
|
|
110
|
+
scalePercent(percent, sourceMin, sourceMax) {
|
|
111
|
+
const range = this.maxPercent - this.minPercent;
|
|
112
|
+
const sourceRange = sourceMax - sourceMin;
|
|
113
|
+
const scaleFactor = range / sourceRange;
|
|
114
|
+
return this.minPercent + (percent - sourceMin) * scaleFactor;
|
|
943
115
|
}
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
}
|
|
951
|
-
await new Promise((resolve, reject) => {
|
|
952
|
-
const timer = setTimeout(() => {
|
|
953
|
-
if (signal) {
|
|
954
|
-
signal.removeEventListener("abort", onAbort);
|
|
955
|
-
}
|
|
956
|
-
resolve();
|
|
957
|
-
}, ms);
|
|
958
|
-
const onAbort = () => {
|
|
959
|
-
clearTimeout(timer);
|
|
960
|
-
signal?.removeEventListener("abort", onAbort);
|
|
961
|
-
reject(createAbortError());
|
|
962
|
-
};
|
|
963
|
-
if (signal) {
|
|
964
|
-
if (signal.aborted) {
|
|
965
|
-
clearTimeout(timer);
|
|
966
|
-
reject(createAbortError());
|
|
967
|
-
return;
|
|
968
|
-
}
|
|
969
|
-
signal.addEventListener("abort", onAbort, { once: true });
|
|
970
|
-
}
|
|
116
|
+
preparing(message, percent, details) {
|
|
117
|
+
this.report({
|
|
118
|
+
stage: "preparing",
|
|
119
|
+
message,
|
|
120
|
+
progressPercent: percent,
|
|
121
|
+
details
|
|
971
122
|
});
|
|
972
123
|
}
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
const nodeCrypto = optionalImportSync("node:crypto") ?? optionalImportSync("crypto");
|
|
981
|
-
if (!nodeCrypto) {
|
|
982
|
-
throw new Error(`${feature} requires the Node.js crypto module`);
|
|
983
|
-
}
|
|
984
|
-
return nodeCrypto;
|
|
985
|
-
}
|
|
986
|
-
getSecureRandomBytes(size, feature) {
|
|
987
|
-
const webCrypto = globalThis.crypto;
|
|
988
|
-
if (webCrypto && typeof webCrypto.getRandomValues === "function") {
|
|
989
|
-
const bytes = new Uint8Array(size);
|
|
990
|
-
webCrypto.getRandomValues(bytes);
|
|
991
|
-
return bytes;
|
|
992
|
-
}
|
|
993
|
-
return this.getNodeCrypto(feature).randomBytes(size);
|
|
994
|
-
}
|
|
995
|
-
createEphemeralKeyPair() {
|
|
996
|
-
const privateKeyBytes = this.getSecureRandomBytes(
|
|
997
|
-
32,
|
|
998
|
-
"generateEphemeralKeyPair"
|
|
999
|
-
);
|
|
1000
|
-
const publicKey = secp256k1.getPublicKey(privateKeyBytes, true);
|
|
1001
|
-
return {
|
|
1002
|
-
privateKey: Buffer.from(privateKeyBytes).toString("hex"),
|
|
1003
|
-
publicKey: Buffer.from(publicKey).toString("hex")
|
|
1004
|
-
};
|
|
1005
|
-
}
|
|
1006
|
-
deriveSharedSecret(options) {
|
|
1007
|
-
const { createHash } = this.getNodeCrypto("deriveSharedSecret");
|
|
1008
|
-
const privateKey = this.hexToBuffer(options.privateKey);
|
|
1009
|
-
const peerPublicKey = this.hexToBuffer(options.peerPublicKey);
|
|
1010
|
-
const shared = secp256k1.getSharedSecret(privateKey, peerPublicKey, true);
|
|
1011
|
-
return createHash("sha256").update(Buffer.from(shared)).digest();
|
|
1012
|
-
}
|
|
1013
|
-
buildCipherEnvelope(options) {
|
|
1014
|
-
const { createCipheriv, randomBytes } = this.getNodeCrypto(
|
|
1015
|
-
"encryptCipherEnvelope"
|
|
1016
|
-
);
|
|
1017
|
-
const sharedSecret = this.normalizeSharedSecret(options.sharedSecret);
|
|
1018
|
-
const iv = randomBytes(12);
|
|
1019
|
-
const cipher = createCipheriv("aes-256-gcm", sharedSecret, iv);
|
|
1020
|
-
const aadSource = options.associatedData ?? options.sessionId;
|
|
1021
|
-
const associatedDataEncoded = aadSource ? Buffer.from(aadSource, "utf8").toString("base64") : void 0;
|
|
1022
|
-
if (aadSource) {
|
|
1023
|
-
cipher.setAAD(Buffer.from(aadSource, "utf8"));
|
|
1024
|
-
}
|
|
1025
|
-
const ciphertext = Buffer.concat([
|
|
1026
|
-
cipher.update(Buffer.from(options.plaintext, "utf8")),
|
|
1027
|
-
cipher.final()
|
|
1028
|
-
]);
|
|
1029
|
-
const tag = cipher.getAuthTag();
|
|
1030
|
-
const payload = Buffer.concat([ciphertext, tag]);
|
|
1031
|
-
return {
|
|
1032
|
-
algorithm: "aes-256-gcm",
|
|
1033
|
-
ciphertext: payload.toString("base64"),
|
|
1034
|
-
nonce: iv.toString("base64"),
|
|
1035
|
-
associatedData: associatedDataEncoded,
|
|
1036
|
-
keyLocator: {
|
|
1037
|
-
sessionId: options.sessionId,
|
|
1038
|
-
revision: options.revision ?? 1
|
|
1039
|
-
},
|
|
1040
|
-
recipients: options.recipients.map((recipient) => ({
|
|
1041
|
-
...recipient,
|
|
1042
|
-
encryptedShare: ""
|
|
1043
|
-
}))
|
|
1044
|
-
};
|
|
1045
|
-
}
|
|
1046
|
-
openCipherEnvelope(options) {
|
|
1047
|
-
const { createDecipheriv } = this.getNodeCrypto("decryptCipherEnvelope");
|
|
1048
|
-
const sharedSecret = this.normalizeSharedSecret(options.sharedSecret);
|
|
1049
|
-
const payload = Buffer.from(options.envelope.ciphertext, "base64");
|
|
1050
|
-
const nonce = Buffer.from(options.envelope.nonce, "base64");
|
|
1051
|
-
const ciphertext = payload.slice(0, payload.length - 16);
|
|
1052
|
-
const tag = payload.slice(payload.length - 16);
|
|
1053
|
-
const decipher = createDecipheriv("aes-256-gcm", sharedSecret, nonce);
|
|
1054
|
-
if (options.envelope.associatedData) {
|
|
1055
|
-
decipher.setAAD(Buffer.from(options.envelope.associatedData, "base64"));
|
|
1056
|
-
}
|
|
1057
|
-
decipher.setAuthTag(tag);
|
|
1058
|
-
const plaintext = Buffer.concat([
|
|
1059
|
-
decipher.update(ciphertext),
|
|
1060
|
-
decipher.final()
|
|
1061
|
-
]);
|
|
1062
|
-
return plaintext.toString(options.encoding ?? "utf8");
|
|
1063
|
-
}
|
|
1064
|
-
normalizeSharedSecret(input) {
|
|
1065
|
-
if (Buffer.isBuffer(input)) {
|
|
1066
|
-
return Buffer.from(input);
|
|
1067
|
-
}
|
|
1068
|
-
if (input instanceof Uint8Array) {
|
|
1069
|
-
return Buffer.from(input);
|
|
1070
|
-
}
|
|
1071
|
-
if (typeof input === "string") {
|
|
1072
|
-
return this.bufferFromString(input);
|
|
1073
|
-
}
|
|
1074
|
-
throw new Error("Unsupported shared secret input");
|
|
1075
|
-
}
|
|
1076
|
-
bufferFromString(value) {
|
|
1077
|
-
const trimmed = value.trim();
|
|
1078
|
-
if (!trimmed) {
|
|
1079
|
-
throw new Error("sharedSecret string cannot be empty");
|
|
1080
|
-
}
|
|
1081
|
-
const normalized = trimmed.startsWith("0x") ? trimmed.slice(2) : trimmed;
|
|
1082
|
-
if (/^[0-9a-fA-F]+$/.test(normalized) && normalized.length % 2 === 0) {
|
|
1083
|
-
return Buffer.from(normalized, "hex");
|
|
1084
|
-
}
|
|
1085
|
-
return Buffer.from(trimmed, "base64");
|
|
1086
|
-
}
|
|
1087
|
-
hexToBuffer(value) {
|
|
1088
|
-
const normalized = value.startsWith("0x") ? value.slice(2) : value;
|
|
1089
|
-
if (!/^[0-9a-fA-F]+$/.test(normalized) || normalized.length % 2 !== 0) {
|
|
1090
|
-
throw new Error("Expected hex-encoded value");
|
|
1091
|
-
}
|
|
1092
|
-
return Buffer.from(normalized, "hex");
|
|
1093
|
-
}
|
|
1094
|
-
extractInsufficientCreditsDetails(error) {
|
|
1095
|
-
if (!(error instanceof RegistryBrokerError) || error.status !== 402) {
|
|
1096
|
-
return null;
|
|
1097
|
-
}
|
|
1098
|
-
const body = error.body;
|
|
1099
|
-
if (!body || typeof body !== "object" || Array.isArray(body)) {
|
|
1100
|
-
return null;
|
|
1101
|
-
}
|
|
1102
|
-
const maybeShortfall = body["shortfallCredits"];
|
|
1103
|
-
if (typeof maybeShortfall !== "number" || maybeShortfall <= 0) {
|
|
1104
|
-
return null;
|
|
1105
|
-
}
|
|
1106
|
-
return { shortfallCredits: maybeShortfall };
|
|
1107
|
-
}
|
|
1108
|
-
extractErrorMessage(body) {
|
|
1109
|
-
if (typeof body === "string") {
|
|
1110
|
-
return body;
|
|
1111
|
-
}
|
|
1112
|
-
if (isJsonObject(body) && typeof body.error === "string") {
|
|
1113
|
-
return body.error;
|
|
1114
|
-
}
|
|
1115
|
-
if (isJsonObject(body) && typeof body.message === "string") {
|
|
1116
|
-
return body.message;
|
|
1117
|
-
}
|
|
1118
|
-
return void 0;
|
|
124
|
+
submitting(message, percent, details) {
|
|
125
|
+
this.report({
|
|
126
|
+
stage: "submitting",
|
|
127
|
+
message,
|
|
128
|
+
progressPercent: percent,
|
|
129
|
+
details
|
|
130
|
+
});
|
|
1119
131
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
}
|
|
1127
|
-
if (error.status !== 402) {
|
|
1128
|
-
return false;
|
|
1129
|
-
}
|
|
1130
|
-
const message = this.extractErrorMessage(error.body);
|
|
1131
|
-
if (!message) {
|
|
1132
|
-
return true;
|
|
1133
|
-
}
|
|
1134
|
-
const normalised = message.toLowerCase();
|
|
1135
|
-
return normalised.includes("history") || normalised.includes("chat history");
|
|
132
|
+
confirming(message, percent, details) {
|
|
133
|
+
this.report({
|
|
134
|
+
stage: "confirming",
|
|
135
|
+
message,
|
|
136
|
+
progressPercent: percent,
|
|
137
|
+
details
|
|
138
|
+
});
|
|
1136
139
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
accountId: this.historyAutoTopUp.accountId,
|
|
1144
|
-
privateKey: this.historyAutoTopUp.privateKey,
|
|
1145
|
-
hbarAmount,
|
|
1146
|
-
memo: this.historyAutoTopUp.memo ?? "registry-broker-client:chat-history-topup",
|
|
1147
|
-
metadata: {
|
|
1148
|
-
purpose: "chat-history",
|
|
1149
|
-
reason
|
|
1150
|
-
}
|
|
140
|
+
verifying(message, percent, details) {
|
|
141
|
+
this.report({
|
|
142
|
+
stage: "verifying",
|
|
143
|
+
message,
|
|
144
|
+
progressPercent: percent,
|
|
145
|
+
details
|
|
1151
146
|
});
|
|
1152
147
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
148
|
+
completed(message, details) {
|
|
149
|
+
this.report({ stage: "completed", message, progressPercent: 100, details });
|
|
1155
150
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
151
|
+
failed(message, details) {
|
|
152
|
+
this.report({
|
|
153
|
+
stage: "failed",
|
|
154
|
+
message,
|
|
155
|
+
progressPercent: this.lastReportedPercent,
|
|
156
|
+
details
|
|
157
|
+
});
|
|
1158
158
|
}
|
|
1159
159
|
}
|
|
1160
|
-
const isPendingRegisterAgentResponse = (response) => response.status === "pending";
|
|
1161
|
-
const isPartialRegisterAgentResponse = (response) => response.status === "partial" && response.success === false;
|
|
1162
|
-
const isSuccessRegisterAgentResponse = (response) => response.success === true && response.status !== "pending";
|
|
1163
160
|
export {
|
|
1164
|
-
|
|
1165
|
-
isPartialRegisterAgentResponse,
|
|
1166
|
-
isPendingRegisterAgentResponse,
|
|
1167
|
-
isSuccessRegisterAgentResponse
|
|
161
|
+
ProgressReporter
|
|
1168
162
|
};
|
|
1169
163
|
//# sourceMappingURL=standards-sdk.es150.js.map
|