@koreanhole/opencodex 3.2.30 → 3.2.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koreanhole/opencodex",
3
- "version": "3.2.30",
3
+ "version": "3.2.31",
4
4
  "description": "Full opencodex runtime with Cline 2.2.0+ JSON and Gemini CLI headless provider adapters",
5
5
  "type": "module",
6
6
  "main": "./bin/package-main.mjs",
@@ -23,7 +23,16 @@ const WRAPPED = Symbol.for("opencodex.gemini.stripEmptyTools.request");
23
23
 
24
24
  function hasToolType(entry) {
25
25
  if (!entry || typeof entry !== "object" || Array.isArray(entry)) return false;
26
- return TOOL_TYPE_KEYS.some(key => entry[key] !== null && entry[key] !== undefined);
26
+ return TOOL_TYPE_KEYS.some(key => isInitializedMember(key, entry[key]));
27
+ }
28
+
29
+ // A member counts only with the shape its key declares: a non-empty list for
30
+ // function declarations, any non-array object for the message spellings.
31
+ function isInitializedMember(key, value) {
32
+ if (key === "functionDeclarations" || key === "function_declarations") {
33
+ return Array.isArray(value) && value.length > 0;
34
+ }
35
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
27
36
  }
28
37
 
29
38
  function isEmptyObject(value) {