@evomap/evolver-adapter-public 2.0.47 → 2.0.48
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/hubCapability.js +15 -1
- package/package.json +2 -2
package/dist/hubCapability.js
CHANGED
|
@@ -587,6 +587,10 @@ export class PublicHubCapability {
|
|
|
587
587
|
const body = await this.http.call('POST', `/a2a/assets/${encodeURIComponent(assetId)}/reuse-result`, {
|
|
588
588
|
asset_id: assetId,
|
|
589
589
|
outcome: report.outcome,
|
|
590
|
+
// The Hub reads the idempotency key from the BODY only (never from a request header).
|
|
591
|
+
// A caller-supplied key makes a network retry record once; without it the Hub keeps
|
|
592
|
+
// its legacy per-report semantics.
|
|
593
|
+
...(report.idempotencyKey ? { idempotency_key: report.idempotencyKey } : {}),
|
|
590
594
|
...(report.taskId ? { task_id: report.taskId } : {}),
|
|
591
595
|
...(report.traceId ? { trace_id: report.traceId } : {}),
|
|
592
596
|
...(timeSavedSeconds.value !== undefined ? { time_saved_seconds: timeSavedSeconds.value } : {}),
|
|
@@ -752,7 +756,9 @@ export class PublicHubCapability {
|
|
|
752
756
|
if (isHubDryRunEnabled()) {
|
|
753
757
|
return dryRunRecipeSearchReceipt('search_recipe', request);
|
|
754
758
|
}
|
|
755
|
-
const body =
|
|
759
|
+
const body = request.context
|
|
760
|
+
? await this.http.call('POST', '/a2a/recipe/search', { ...recipeSearchQuery(request), context: request.context })
|
|
761
|
+
: await this.http.call('GET', '/a2a/recipe/search', undefined, recipeSearchQuery(request));
|
|
756
762
|
return recipeSearchReceiptFromBody(body);
|
|
757
763
|
}
|
|
758
764
|
async listRecipes(request = {}) {
|
|
@@ -1063,13 +1069,21 @@ function recipeSearchReceiptFromBody(body) {
|
|
|
1063
1069
|
?? booleanField(payload, 'hasMore')
|
|
1064
1070
|
?? booleanField(body, 'has_more')
|
|
1065
1071
|
?? booleanField(body, 'hasMore');
|
|
1072
|
+
const contextFit = contextFitOf(body['context_fit']);
|
|
1066
1073
|
return {
|
|
1067
1074
|
recipes,
|
|
1068
1075
|
...(nextCursor ? { nextCursor } : {}),
|
|
1069
1076
|
...(hasMore !== undefined ? { hasMore } : {}),
|
|
1077
|
+
...(contextFit ? { contextFit } : {}),
|
|
1070
1078
|
raw: body,
|
|
1071
1079
|
};
|
|
1072
1080
|
}
|
|
1081
|
+
function contextFitOf(value) {
|
|
1082
|
+
const record = asRecord(value);
|
|
1083
|
+
const judged = record?.['judged'];
|
|
1084
|
+
const kept = record?.['kept'];
|
|
1085
|
+
return typeof judged === 'number' && typeof kept === 'number' ? { judged, kept } : undefined;
|
|
1086
|
+
}
|
|
1073
1087
|
function dryRunRecipeSearchReceipt(action, request) {
|
|
1074
1088
|
return {
|
|
1075
1089
|
recipes: [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evomap/evolver-adapter-public",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.48",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@evomap/atp-sdk": "^0.1.0",
|
|
20
|
-
"@evomap/evolver-core": "2.0.
|
|
20
|
+
"@evomap/evolver-core": "2.0.48",
|
|
21
21
|
"undici": "^6.29.1"
|
|
22
22
|
},
|
|
23
23
|
"optionalDependencies": {
|