@themoltnet/pi-extension 0.35.1 → 0.35.2

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -3
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3037,6 +3037,21 @@ function unwrapRequired(result, message, code) {
3037
3037
  return result.data;
3038
3038
  }
3039
3039
  //#endregion
3040
+ //#region ../sdk/src/namespaces/query.ts
3041
+ /**
3042
+ * Remove `undefined`-valued keys from a query object before it is serialized.
3043
+ *
3044
+ * Returns `undefined` when no defined keys remain, so an all-`undefined` query
3045
+ * (`{ agentId: undefined }`) and an omitted query (`undefined`) serialize
3046
+ * identically — both send no query params — instead of the former collapsing to
3047
+ * an empty `{}` that still reaches the client.
3048
+ */
3049
+ function stripUndefinedQuery(query) {
3050
+ if (!query) return;
3051
+ const entries = Object.entries(query).filter(([, value]) => value !== void 0);
3052
+ return entries.length ? Object.fromEntries(entries) : void 0;
3053
+ }
3054
+ //#endregion
3040
3055
  //#region ../sdk/src/namespaces/team-headers.ts
3041
3056
  /**
3042
3057
  * Build the team header from an optional option, or `undefined` when no team
@@ -3063,7 +3078,7 @@ function createAgentKeysNamespace(context) {
3063
3078
  client,
3064
3079
  auth,
3065
3080
  headers: requiredTeamHeaders(options),
3066
- query
3081
+ query: stripUndefinedQuery(query)
3067
3082
  }));
3068
3083
  },
3069
3084
  async create(body, options) {
@@ -5433,12 +5448,11 @@ function createRuntimeSlotsNamespace(context) {
5433
5448
  }
5434
5449
  },
5435
5450
  async list(query, options) {
5436
- const filteredQuery = Object.fromEntries(Object.entries(query).filter(([, value]) => value !== void 0));
5437
5451
  return unwrapResult(await listRuntimeSlots({
5438
5452
  auth,
5439
5453
  client,
5440
5454
  headers: requiredTeamHeaders(options),
5441
- query: filteredQuery
5455
+ query: stripUndefinedQuery(query)
5442
5456
  })).items;
5443
5457
  }
5444
5458
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/pi-extension",
3
- "version": "0.35.1",
3
+ "version": "0.35.2",
4
4
  "type": "module",
5
5
  "description": "MoltNet pi extension — sandboxed tool execution in Gondolin VMs with MoltNet identity and persistent memory",
6
6
  "keywords": [
@@ -36,8 +36,8 @@
36
36
  "@earendil-works/gondolin": "^0.9.1",
37
37
  "@opentelemetry/api": "^1.9.0",
38
38
  "typebox": "^1.2.8",
39
- "@themoltnet/agent-runtime": "0.36.1",
40
- "@themoltnet/sdk": "0.122.0"
39
+ "@themoltnet/agent-runtime": "0.36.2",
40
+ "@themoltnet/sdk": "0.123.0"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@earendil-works/pi-coding-agent": ">=0.74.0",