@maximem/synap-js-sdk 0.6.7 → 0.6.8

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/index.d.cts CHANGED
@@ -2144,7 +2144,7 @@ declare class SynapClient {
2144
2144
  * build when the two disagree, which is the only thing that makes a manual
2145
2145
  * publish safe.
2146
2146
  */
2147
- declare const SDK_VERSION = "0.6.7";
2147
+ declare const SDK_VERSION = "0.6.8";
2148
2148
 
2149
2149
  /**
2150
2150
  * `response_shape: "ranked"`: one list in the order the server ranked it.
package/dist/index.d.ts CHANGED
@@ -2144,7 +2144,7 @@ declare class SynapClient {
2144
2144
  * build when the two disagree, which is the only thing that makes a manual
2145
2145
  * publish safe.
2146
2146
  */
2147
- declare const SDK_VERSION = "0.6.7";
2147
+ declare const SDK_VERSION = "0.6.8";
2148
2148
 
2149
2149
  /**
2150
2150
  * `response_shape: "ranked"`: one list in the order the server ranked it.
package/dist/index.js CHANGED
@@ -2835,7 +2835,7 @@ function createInstanceNamespace(credentials, cache, onTurn, fetchOrAgentModel,
2835
2835
  }
2836
2836
 
2837
2837
  // src/version.ts
2838
- var SDK_VERSION = "0.6.7";
2838
+ var SDK_VERSION = "0.6.8";
2839
2839
 
2840
2840
  // src/registry.ts
2841
2841
  var instances = /* @__PURE__ */ new Map();
@@ -4023,10 +4023,16 @@ function scopeLookupParams(scope, params) {
4023
4023
  return { searchQuery, entityId: null, customerId: null, clientId, scopeRung, maxResultsPerQuery };
4024
4024
  }
4025
4025
  }
4026
+ function wireMetadata(item) {
4027
+ const md = item["metadata"];
4028
+ const out = md !== null && typeof md === "object" && !Array.isArray(md) ? { ...md } : {};
4029
+ if (!out["scope"] && item["scope"]) out["scope"] = item["scope"];
4030
+ return out;
4031
+ }
4026
4032
  function buildAnticipationResponse(hit) {
4027
4033
  const response = {};
4028
4034
  for (const [type, items] of Object.entries(hit.itemsByType)) {
4029
- response[type] = items;
4035
+ response[type] = items.map((item) => ({ ...item, metadata: wireMetadata(item) }));
4030
4036
  }
4031
4037
  response.metadata = {
4032
4038
  source: "anticipation",