@cascade-fyi/sati-sdk 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/index.cjs +105 -64
- package/dist/index.d.cts +89 -55
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +89 -55
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +104 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,32 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.9.0] - 2026-02-12
|
|
9
|
+
|
|
10
|
+
### Breaking Changes
|
|
11
|
+
|
|
12
|
+
- **`MAX_SINGLE_SIGNATURE_CONTENT_SIZE` replaced** with two mode-specific constants:
|
|
13
|
+
- `MAX_COUNTERPARTY_SIGNED_CONTENT_SIZE` (100 bytes) - CounterpartySigned mode has SIWS content duplication
|
|
14
|
+
- `MAX_AGENT_OWNER_SIGNED_CONTENT_SIZE` (240 bytes) - AgentOwnerSigned mode has no SIWS duplication
|
|
15
|
+
- `getMaxContentSize()` and `validateContentSize()` now return correct per-mode limits
|
|
16
|
+
|
|
17
|
+
### Fixed
|
|
18
|
+
|
|
19
|
+
- **`getAgentOwner` returns stale/empty data after registration or transfer** - added retry with exponential backoff to handle SPL token index lag on RPC node pools
|
|
20
|
+
|
|
21
|
+
## [0.8.0] - 2026-02-12
|
|
22
|
+
|
|
23
|
+
### Breaking Changes
|
|
24
|
+
|
|
25
|
+
- **Feedback content fields renamed for ERC-8004 alignment**: `score` -> `value`, `tags` -> `tag1`/`tag2`, added `valueDecimals`
|
|
26
|
+
- `GiveFeedbackParams`: `score?` -> `value?`, `tags?` -> `tag1?`/`tag2?`, added `valueDecimals?`
|
|
27
|
+
- `ParsedFeedback`: `score?` -> `value?`, `tags` -> `tag1?`/`tag2?`, added `valueDecimals?`
|
|
28
|
+
- `FeedbackSearchOptions`: `minScore`/`maxScore` -> `minValue`/`maxValue`, `tags?` -> `tag1?`/`tag2?`
|
|
29
|
+
- `ReputationSummary`: `averageScore` -> `averageValue`
|
|
30
|
+
- `FeedbackContent`: `score?` -> `value?`, `tags?` -> `tag1?`/`tag2?`, added `valueDecimals?`
|
|
31
|
+
- **`getReputationSummary` signature changed**: `(agentMint, tags?)` -> `(agentMint, tag1?, tag2?)`
|
|
32
|
+
- **Registration file fields renamed**: `endpoints` -> `services`, `x402support` -> `x402Support`
|
|
33
|
+
|
|
8
34
|
## [0.7.0] - 2026-02-12
|
|
9
35
|
|
|
10
36
|
### Added
|
|
@@ -144,6 +170,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
144
170
|
- Compressed attestation storage via Light Protocol
|
|
145
171
|
- Basic querying via Photon RPC
|
|
146
172
|
|
|
173
|
+
[0.9.0]: https://github.com/cascade-protocol/sati/compare/@cascade-fyi/sati-sdk@0.8.0...@cascade-fyi/sati-sdk@0.9.0
|
|
174
|
+
[0.8.0]: https://github.com/cascade-protocol/sati/compare/@cascade-fyi/sati-sdk@0.7.0...@cascade-fyi/sati-sdk@0.8.0
|
|
147
175
|
[0.7.0]: https://github.com/cascade-protocol/sati/compare/@cascade-fyi/sati-sdk@0.6.0...@cascade-fyi/sati-sdk@0.7.0
|
|
148
176
|
[0.6.0]: https://github.com/cascade-protocol/sati/compare/@cascade-fyi/sati-sdk@0.5.0...@cascade-fyi/sati-sdk@0.6.0
|
|
149
177
|
[0.5.0]: https://github.com/cascade-protocol/sati/compare/@cascade-fyi/sati-sdk@0.4.2...@cascade-fyi/sati-sdk@0.5.0
|
package/dist/index.cjs
CHANGED
|
@@ -2872,13 +2872,24 @@ const MAX_CONTENT_SIZE = 512;
|
|
|
2872
2872
|
*/
|
|
2873
2873
|
const MAX_DUAL_SIGNATURE_CONTENT_SIZE = 70;
|
|
2874
2874
|
/**
|
|
2875
|
-
* Maximum content size for
|
|
2875
|
+
* Maximum content size for CounterpartySigned mode attestations.
|
|
2876
2876
|
*
|
|
2877
|
-
*
|
|
2878
|
-
*
|
|
2877
|
+
* CounterpartySigned has a SIWS message containing the content, so content
|
|
2878
|
+
* appears TWICE in the transaction (data blob + SIWS Details field).
|
|
2879
|
+
* This is similar to DualSignature but with one fewer signature (no agent sig),
|
|
2880
|
+
* giving slightly more headroom.
|
|
2881
|
+
*
|
|
2882
|
+
* Use ContentType.IPFS or ContentType.Arweave for larger content.
|
|
2883
|
+
*/
|
|
2884
|
+
const MAX_COUNTERPARTY_SIGNED_CONTENT_SIZE = 100;
|
|
2885
|
+
/**
|
|
2886
|
+
* Maximum content size for AgentOwnerSigned mode attestations.
|
|
2887
|
+
*
|
|
2888
|
+
* AgentOwnerSigned has more headroom because:
|
|
2889
|
+
* 1. Content appears only once (no SIWS message - agent signs interaction_hash)
|
|
2879
2890
|
* 2. No counterparty signature verification overhead
|
|
2880
2891
|
*/
|
|
2881
|
-
const
|
|
2892
|
+
const MAX_AGENT_OWNER_SIGNED_CONTENT_SIZE = 240;
|
|
2882
2893
|
/**
|
|
2883
2894
|
* Minimum universal base layout size.
|
|
2884
2895
|
* All schemas share: layout_version(1) + task_ref(32) + agent_mint(32) + counterparty(32) +
|
|
@@ -2937,17 +2948,17 @@ let DataType = /* @__PURE__ */ function(DataType$1) {
|
|
|
2937
2948
|
/**
|
|
2938
2949
|
* Feedback outcome values (ERC-8004 compatible)
|
|
2939
2950
|
*
|
|
2940
|
-
*
|
|
2941
|
-
* - Negative(0)
|
|
2942
|
-
* - Neutral(1)
|
|
2943
|
-
* - Positive(2)
|
|
2951
|
+
* Maps to ERC-8004 outcome semantics:
|
|
2952
|
+
* - Negative(0) - unfavorable interaction
|
|
2953
|
+
* - Neutral(1) - default / no strong signal
|
|
2954
|
+
* - Positive(2) - favorable interaction
|
|
2944
2955
|
*/
|
|
2945
2956
|
let Outcome = /* @__PURE__ */ function(Outcome$1) {
|
|
2946
|
-
/** Negative feedback
|
|
2957
|
+
/** Negative feedback */
|
|
2947
2958
|
Outcome$1[Outcome$1["Negative"] = 0] = "Negative";
|
|
2948
|
-
/** Neutral feedback (
|
|
2959
|
+
/** Neutral feedback (default) */
|
|
2949
2960
|
Outcome$1[Outcome$1["Neutral"] = 1] = "Neutral";
|
|
2950
|
-
/** Positive feedback
|
|
2961
|
+
/** Positive feedback */
|
|
2951
2962
|
Outcome$1[Outcome$1["Positive"] = 2] = "Positive";
|
|
2952
2963
|
return Outcome$1;
|
|
2953
2964
|
}({});
|
|
@@ -3316,7 +3327,11 @@ function validateBaseLayout(data) {
|
|
|
3316
3327
|
* ```
|
|
3317
3328
|
*/
|
|
3318
3329
|
function getMaxContentSize(signatureMode) {
|
|
3319
|
-
|
|
3330
|
+
switch (signatureMode) {
|
|
3331
|
+
case SignatureMode.DualSignature: return MAX_DUAL_SIGNATURE_CONTENT_SIZE;
|
|
3332
|
+
case SignatureMode.CounterpartySigned: return MAX_COUNTERPARTY_SIGNED_CONTENT_SIZE;
|
|
3333
|
+
case SignatureMode.AgentOwnerSigned: return MAX_AGENT_OWNER_SIGNED_CONTENT_SIZE;
|
|
3334
|
+
}
|
|
3320
3335
|
}
|
|
3321
3336
|
/**
|
|
3322
3337
|
* Validate content size for a given signature mode.
|
|
@@ -3350,7 +3365,11 @@ function validateContentSize(content, signatureMode, options = {}) {
|
|
|
3350
3365
|
actualSize
|
|
3351
3366
|
};
|
|
3352
3367
|
if (!valid) {
|
|
3353
|
-
result.error = `Content too large for ${
|
|
3368
|
+
result.error = `Content too large for ${{
|
|
3369
|
+
[SignatureMode.DualSignature]: "DualSignature",
|
|
3370
|
+
[SignatureMode.CounterpartySigned]: "CounterpartySigned",
|
|
3371
|
+
[SignatureMode.AgentOwnerSigned]: "AgentOwnerSigned"
|
|
3372
|
+
}[signatureMode] ?? "Unknown"} mode: ${actualSize} bytes exceeds maximum ${maxSize} bytes. Use ContentType.IPFS or ContentType.Arweave for larger content.`;
|
|
3354
3373
|
if (throwOnError) throw new Error(result.error);
|
|
3355
3374
|
}
|
|
3356
3375
|
return result;
|
|
@@ -4323,7 +4342,7 @@ function bytesToHex(bytes) {
|
|
|
4323
4342
|
* outcome: Outcome.Positive,
|
|
4324
4343
|
* dataHash: dataHash,
|
|
4325
4344
|
* contentType: ContentType.JSON,
|
|
4326
|
-
* content: new TextEncoder().encode('{"
|
|
4345
|
+
* content: new TextEncoder().encode('{"value": 95, "valueDecimals": 0, "tag1": "quality"}'),
|
|
4327
4346
|
* });
|
|
4328
4347
|
*
|
|
4329
4348
|
* // Build counterparty message
|
|
@@ -4842,11 +4861,11 @@ const RegistrationFileSchema = zod.object({
|
|
|
4842
4861
|
image: zod.url(),
|
|
4843
4862
|
properties: PropertiesSchema,
|
|
4844
4863
|
external_url: zod.url().optional(),
|
|
4845
|
-
|
|
4864
|
+
services: zod.array(EndpointSchema).optional(),
|
|
4846
4865
|
registrations: zod.array(RegistrationEntrySchema).optional(),
|
|
4847
4866
|
supportedTrust: zod.array(TrustMechanismSchema).optional(),
|
|
4848
4867
|
active: zod.boolean().optional().default(true),
|
|
4849
|
-
|
|
4868
|
+
x402Support: zod.boolean().optional()
|
|
4850
4869
|
});
|
|
4851
4870
|
const MIME_TYPES = {
|
|
4852
4871
|
png: "image/png",
|
|
@@ -4889,11 +4908,11 @@ function buildRegistrationFile(params) {
|
|
|
4889
4908
|
category: "image"
|
|
4890
4909
|
},
|
|
4891
4910
|
...params.externalUrl && { external_url: params.externalUrl },
|
|
4892
|
-
...params.
|
|
4911
|
+
...params.services?.length && { services: params.services },
|
|
4893
4912
|
...params.registrations?.length && { registrations: params.registrations },
|
|
4894
4913
|
...params.supportedTrust?.length && { supportedTrust: params.supportedTrust },
|
|
4895
4914
|
active: params.active ?? true,
|
|
4896
|
-
...params.
|
|
4915
|
+
...params.x402Support !== void 0 && { x402Support: params.x402Support }
|
|
4897
4916
|
};
|
|
4898
4917
|
return RegistrationFileSchema.parse(file);
|
|
4899
4918
|
}
|
|
@@ -5029,7 +5048,7 @@ var SatiAgentBuilder = class {
|
|
|
5029
5048
|
name,
|
|
5030
5049
|
description,
|
|
5031
5050
|
image,
|
|
5032
|
-
|
|
5051
|
+
services: [],
|
|
5033
5052
|
active: true
|
|
5034
5053
|
};
|
|
5035
5054
|
}
|
|
@@ -5043,9 +5062,9 @@ var SatiAgentBuilder = class {
|
|
|
5043
5062
|
}
|
|
5044
5063
|
/** Set a generic endpoint. */
|
|
5045
5064
|
setEndpoint(endpoint) {
|
|
5046
|
-
if (!this._params.
|
|
5047
|
-
this._params.
|
|
5048
|
-
this._params.
|
|
5065
|
+
if (!this._params.services) this._params.services = [];
|
|
5066
|
+
this._params.services = this._params.services.filter((ep) => ep.name !== endpoint.name);
|
|
5067
|
+
this._params.services.push(endpoint);
|
|
5049
5068
|
return this;
|
|
5050
5069
|
}
|
|
5051
5070
|
/**
|
|
@@ -5082,7 +5101,7 @@ var SatiAgentBuilder = class {
|
|
|
5082
5101
|
}
|
|
5083
5102
|
/** Remove an endpoint by name. */
|
|
5084
5103
|
removeEndpoint(name) {
|
|
5085
|
-
if (this._params.
|
|
5104
|
+
if (this._params.services) this._params.services = this._params.services.filter((ep) => ep.name !== name);
|
|
5086
5105
|
return this;
|
|
5087
5106
|
}
|
|
5088
5107
|
/** Set agent active status. */
|
|
@@ -5092,7 +5111,7 @@ var SatiAgentBuilder = class {
|
|
|
5092
5111
|
}
|
|
5093
5112
|
/** Set x402 payment support. */
|
|
5094
5113
|
setX402Support(x402) {
|
|
5095
|
-
this._params.
|
|
5114
|
+
this._params.x402Support = x402;
|
|
5096
5115
|
return this;
|
|
5097
5116
|
}
|
|
5098
5117
|
/** Set supported trust mechanisms. */
|
|
@@ -5503,14 +5522,21 @@ var Sati = class {
|
|
|
5503
5522
|
return { signature: (0, __solana_kit.getSignatureFromTransaction)(signedTx).toString() };
|
|
5504
5523
|
}
|
|
5505
5524
|
/**
|
|
5506
|
-
* Get current owner of an agent
|
|
5525
|
+
* Get current owner of an agent.
|
|
5526
|
+
*
|
|
5527
|
+
* Uses `getTokenLargestAccounts` which relies on an SPL token index.
|
|
5528
|
+
* This index can lag behind transaction confirmation on RPC node pools,
|
|
5529
|
+
* so we retry with backoff for recently created or transferred tokens.
|
|
5507
5530
|
*/
|
|
5508
5531
|
async getAgentOwner(mint) {
|
|
5509
|
-
const
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5532
|
+
const maxRetries = 3;
|
|
5533
|
+
const baseDelay = 500;
|
|
5534
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
5535
|
+
const holderAccount = (await this.rpc.getTokenLargestAccounts(mint, { commitment: "confirmed" }).send()).value?.find((acc) => BigInt(acc.amount) > 0n);
|
|
5536
|
+
if (holderAccount) return (await (0, __solana_program_token_2022.fetchToken)(this.rpc, (0, __solana_kit.address)(holderAccount.address))).data.owner;
|
|
5537
|
+
if (attempt < maxRetries) await new Promise((resolve) => setTimeout(resolve, baseDelay * 2 ** attempt));
|
|
5538
|
+
}
|
|
5539
|
+
throw new Error(`No token accounts found for mint ${mint}`);
|
|
5514
5540
|
}
|
|
5515
5541
|
/**
|
|
5516
5542
|
* Get registry statistics
|
|
@@ -6447,8 +6473,9 @@ var Sati = class {
|
|
|
6447
6473
|
* const result = await sati.giveFeedback({
|
|
6448
6474
|
* payer: myKeypair,
|
|
6449
6475
|
* agentMint: address("Agent..."),
|
|
6450
|
-
*
|
|
6451
|
-
*
|
|
6476
|
+
* value: 87,
|
|
6477
|
+
* valueDecimals: 0,
|
|
6478
|
+
* tag1: "starred",
|
|
6452
6479
|
* message: "Great response time",
|
|
6453
6480
|
* });
|
|
6454
6481
|
* ```
|
|
@@ -6456,10 +6483,13 @@ var Sati = class {
|
|
|
6456
6483
|
async giveFeedback(params) {
|
|
6457
6484
|
const schema = this._requireFeedbackPublicSchema();
|
|
6458
6485
|
const payer = params.payer;
|
|
6459
|
-
if (params.
|
|
6486
|
+
if (params.value !== void 0 && !Number.isFinite(params.value)) throw new Error(`Feedback value must be a finite number, got: ${params.value}`);
|
|
6487
|
+
if (params.valueDecimals !== void 0 && (params.valueDecimals < 0 || params.valueDecimals > 18)) throw new Error(`valueDecimals must be 0-18, got: ${params.valueDecimals}`);
|
|
6460
6488
|
const contentObj = {};
|
|
6461
|
-
if (params.
|
|
6462
|
-
if (params.
|
|
6489
|
+
if (params.value !== void 0) contentObj.value = params.value;
|
|
6490
|
+
if (params.valueDecimals !== void 0) contentObj.valueDecimals = params.valueDecimals;
|
|
6491
|
+
if (params.tag1) contentObj.tag1 = params.tag1;
|
|
6492
|
+
if (params.tag2) contentObj.tag2 = params.tag2;
|
|
6463
6493
|
if (params.endpoint) contentObj.endpoint = params.endpoint;
|
|
6464
6494
|
if (params.message) contentObj.m = params.message;
|
|
6465
6495
|
const content = Object.keys(contentObj).length > 0 ? new TextEncoder().encode(JSON.stringify(contentObj)) : new Uint8Array(0);
|
|
@@ -6510,10 +6540,13 @@ var Sati = class {
|
|
|
6510
6540
|
*/
|
|
6511
6541
|
async prepareFeedback(params) {
|
|
6512
6542
|
const schema = this._requireFeedbackPublicSchema();
|
|
6513
|
-
if (params.
|
|
6543
|
+
if (params.value !== void 0 && !Number.isFinite(params.value)) throw new Error(`Feedback value must be a finite number, got: ${params.value}`);
|
|
6544
|
+
if (params.valueDecimals !== void 0 && (params.valueDecimals < 0 || params.valueDecimals > 18)) throw new Error(`valueDecimals must be 0-18, got: ${params.valueDecimals}`);
|
|
6514
6545
|
const contentObj = {};
|
|
6515
|
-
if (params.
|
|
6516
|
-
if (params.
|
|
6546
|
+
if (params.value !== void 0) contentObj.value = params.value;
|
|
6547
|
+
if (params.valueDecimals !== void 0) contentObj.valueDecimals = params.valueDecimals;
|
|
6548
|
+
if (params.tag1) contentObj.tag1 = params.tag1;
|
|
6549
|
+
if (params.tag2) contentObj.tag2 = params.tag2;
|
|
6517
6550
|
if (params.endpoint) contentObj.endpoint = params.endpoint;
|
|
6518
6551
|
if (params.message) contentObj.m = params.message;
|
|
6519
6552
|
const content = Object.keys(contentObj).length > 0 ? new TextEncoder().encode(JSON.stringify(contentObj)) : new Uint8Array(0);
|
|
@@ -6544,8 +6577,10 @@ var Sati = class {
|
|
|
6544
6577
|
sasSchema: schema,
|
|
6545
6578
|
lookupTable: this._deployedConfig?.lookupTable,
|
|
6546
6579
|
meta: {
|
|
6547
|
-
|
|
6548
|
-
|
|
6580
|
+
value: params.value,
|
|
6581
|
+
valueDecimals: params.valueDecimals,
|
|
6582
|
+
tag1: params.tag1,
|
|
6583
|
+
tag2: params.tag2,
|
|
6549
6584
|
message: params.message,
|
|
6550
6585
|
endpoint: params.endpoint
|
|
6551
6586
|
}
|
|
@@ -6611,8 +6646,8 @@ var Sati = class {
|
|
|
6611
6646
|
* ```typescript
|
|
6612
6647
|
* const feedbacks = await sati.searchFeedback({
|
|
6613
6648
|
* agentMint: address("Agent..."),
|
|
6614
|
-
*
|
|
6615
|
-
*
|
|
6649
|
+
* tag1: "starred",
|
|
6650
|
+
* minValue: 70,
|
|
6616
6651
|
* });
|
|
6617
6652
|
* ```
|
|
6618
6653
|
*/
|
|
@@ -6631,15 +6666,16 @@ var Sati = class {
|
|
|
6631
6666
|
const feedbacks = [];
|
|
6632
6667
|
for (const item of result.items) {
|
|
6633
6668
|
const rawContent = this._parseContentJson(item.data.content, item.data.contentType);
|
|
6634
|
-
const
|
|
6635
|
-
const
|
|
6669
|
+
const value = rawContent?.value;
|
|
6670
|
+
const valueDecimals = rawContent?.valueDecimals;
|
|
6671
|
+
const tag1 = rawContent?.tag1;
|
|
6672
|
+
const tag2 = rawContent?.tag2;
|
|
6636
6673
|
const message = rawContent?.m;
|
|
6637
6674
|
const endpoint = rawContent?.endpoint;
|
|
6638
|
-
if (options?.
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
if (options?.
|
|
6642
|
-
if (options?.maxScore !== void 0 && (score === void 0 || score > options.maxScore)) continue;
|
|
6675
|
+
if (options?.tag1 !== void 0 && tag1 !== options.tag1) continue;
|
|
6676
|
+
if (options?.tag2 !== void 0 && tag2 !== options.tag2) continue;
|
|
6677
|
+
if (options?.minValue !== void 0 && (value === void 0 || value < options.minValue)) continue;
|
|
6678
|
+
if (options?.maxValue !== void 0 && (value === void 0 || value > options.maxValue)) continue;
|
|
6643
6679
|
const slotDiff = Number(BigInt(currentSlot) - item.raw.slotCreated);
|
|
6644
6680
|
const createdAt = nowSec - Math.floor(slotDiff * .4);
|
|
6645
6681
|
const [compressedAddress] = (0, __solana_kit.getAddressDecoder)().read(item.address, 0);
|
|
@@ -6648,8 +6684,10 @@ var Sati = class {
|
|
|
6648
6684
|
agentMint: item.data.agentMint,
|
|
6649
6685
|
counterparty: item.data.counterparty,
|
|
6650
6686
|
outcome: item.data.outcome,
|
|
6651
|
-
|
|
6652
|
-
|
|
6687
|
+
value,
|
|
6688
|
+
valueDecimals,
|
|
6689
|
+
tag1,
|
|
6690
|
+
tag2,
|
|
6653
6691
|
message,
|
|
6654
6692
|
endpoint,
|
|
6655
6693
|
createdAt
|
|
@@ -6675,15 +6713,15 @@ var Sati = class {
|
|
|
6675
6713
|
/**
|
|
6676
6714
|
* Get reputation summary for an agent.
|
|
6677
6715
|
*
|
|
6678
|
-
* Aggregates feedback
|
|
6716
|
+
* Aggregates feedback values, optionally filtered by tag1 and/or tag2.
|
|
6679
6717
|
*
|
|
6680
6718
|
* @example
|
|
6681
6719
|
* ```typescript
|
|
6682
6720
|
* const summary = await sati.getReputationSummary(address("Agent..."));
|
|
6683
|
-
* console.log(`${summary.count} reviews, avg ${summary.
|
|
6721
|
+
* console.log(`${summary.count} reviews, avg ${summary.averageValue}`);
|
|
6684
6722
|
* ```
|
|
6685
6723
|
*/
|
|
6686
|
-
async getReputationSummary(agentMint,
|
|
6724
|
+
async getReputationSummary(agentMint, tag1, tag2) {
|
|
6687
6725
|
const schema = this._deployedConfig?.schemas.feedbackPublic ?? this._deployedConfig?.schemas.feedback;
|
|
6688
6726
|
if (!schema) throw new Error(`No feedback schema deployed for network "${this.network}"`);
|
|
6689
6727
|
const cacheKey = FeedbackCache.cacheKey(schema, agentMint);
|
|
@@ -6695,23 +6733,25 @@ var Sati = class {
|
|
|
6695
6733
|
if (!cached) this._feedbackCache.set(cacheKey, result);
|
|
6696
6734
|
if (result.items.length === 0) return {
|
|
6697
6735
|
count: 0,
|
|
6698
|
-
|
|
6736
|
+
averageValue: 0
|
|
6699
6737
|
};
|
|
6700
6738
|
let sum = 0;
|
|
6701
6739
|
let count = 0;
|
|
6702
6740
|
for (const item of result.items) {
|
|
6703
6741
|
const rawContent = this._parseContentJson(item.data.content, item.data.contentType);
|
|
6704
|
-
const
|
|
6705
|
-
const
|
|
6706
|
-
|
|
6707
|
-
if (
|
|
6708
|
-
|
|
6742
|
+
const value = rawContent?.value;
|
|
6743
|
+
const itemTag1 = rawContent?.tag1;
|
|
6744
|
+
const itemTag2 = rawContent?.tag2;
|
|
6745
|
+
if (tag1 !== void 0 && itemTag1 !== tag1) continue;
|
|
6746
|
+
if (tag2 !== void 0 && itemTag2 !== tag2) continue;
|
|
6747
|
+
if (value !== void 0) {
|
|
6748
|
+
sum += value;
|
|
6709
6749
|
count++;
|
|
6710
6750
|
}
|
|
6711
6751
|
}
|
|
6712
6752
|
return {
|
|
6713
6753
|
count,
|
|
6714
|
-
|
|
6754
|
+
averageValue: count > 0 ? sum / count : 0
|
|
6715
6755
|
};
|
|
6716
6756
|
}
|
|
6717
6757
|
/**
|
|
@@ -6777,10 +6817,10 @@ var Sati = class {
|
|
|
6777
6817
|
for (let i = 0; i < agents.length; i++) {
|
|
6778
6818
|
const identity = agents[i];
|
|
6779
6819
|
const regFile = regFiles[i];
|
|
6780
|
-
const
|
|
6820
|
+
const services = regFile?.services ?? [];
|
|
6781
6821
|
if (options?.active !== void 0 && (regFile?.active ?? true) !== options.active) continue;
|
|
6782
6822
|
if (options?.endpointTypes?.length) {
|
|
6783
|
-
if (!options.endpointTypes.every((type) =>
|
|
6823
|
+
if (!options.endpointTypes.every((type) => services.some((e) => e.name.toUpperCase() === type.toUpperCase()))) continue;
|
|
6784
6824
|
}
|
|
6785
6825
|
filtered.push({
|
|
6786
6826
|
identity,
|
|
@@ -7030,10 +7070,11 @@ exports.FeedbackCache = FeedbackCache;
|
|
|
7030
7070
|
exports.INITIALIZE_DISCRIMINATOR = INITIALIZE_DISCRIMINATOR;
|
|
7031
7071
|
exports.LIGHT_ERROR_CODES = LIGHT_ERROR_CODES;
|
|
7032
7072
|
exports.LINK_EVM_ADDRESS_DISCRIMINATOR = LINK_EVM_ADDRESS_DISCRIMINATOR;
|
|
7073
|
+
exports.MAX_AGENT_OWNER_SIGNED_CONTENT_SIZE = MAX_AGENT_OWNER_SIGNED_CONTENT_SIZE;
|
|
7033
7074
|
exports.MAX_CONTENT_SIZE = MAX_CONTENT_SIZE;
|
|
7075
|
+
exports.MAX_COUNTERPARTY_SIGNED_CONTENT_SIZE = MAX_COUNTERPARTY_SIGNED_CONTENT_SIZE;
|
|
7034
7076
|
exports.MAX_DUAL_SIGNATURE_CONTENT_SIZE = MAX_DUAL_SIGNATURE_CONTENT_SIZE;
|
|
7035
7077
|
exports.MAX_PLAINTEXT_SIZE = MAX_PLAINTEXT_SIZE;
|
|
7036
|
-
exports.MAX_SINGLE_SIGNATURE_CONTENT_SIZE = MAX_SINGLE_SIGNATURE_CONTENT_SIZE;
|
|
7037
7078
|
exports.MIN_BASE_LAYOUT_SIZE = MIN_BASE_LAYOUT_SIZE;
|
|
7038
7079
|
exports.MIN_ENCRYPTED_SIZE = MIN_ENCRYPTED_SIZE;
|
|
7039
7080
|
exports.NONCE_SIZE = NONCE_SIZE;
|