gdharness 1.3.16 → 1.3.17

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/build/cli.js CHANGED
@@ -17517,7 +17517,7 @@ var init_tool_definitions = __esm(() => {
17517
17517
  type: ["boolean", "array"],
17518
17518
  items: { type: "string" },
17519
17519
  ops: ["call"],
17520
- description: `call: read the object the call answered with in the same answer, under result_properties: true for every variable its script declares, or a list of names, each a colon path walked from that object the way property paths are ("dead_allowed", "terms:0:name"). For a list or a dictionary the call answered with, they are read off each object in it: result_properties is then a list, or a dictionary under the same keys, with null for an element that is no object. A name that is not there is listed under result_properties_missing with why, led by the element's index or key for a list or dictionary, and a result with no object in it answers properties_note instead. Without it an object comes back as its class, its script_class or script, and id, which is the object's instance id (get_instance_id()) and never a property of its own named id: read that one through properties.`
17520
+ description: `call: read the object the call answered with in the same answer, under result_properties: true for every variable its script declares, or a list of names, each a colon path walked from that object the way property paths are ("dead_allowed", "terms:0:name"). For a list or a dictionary the call answered with, they are read off each object in it: result_properties is then a list, or a dictionary in the shape result gives it (under the same keys when every key is text, otherwise as entries, each a key and what was read), with null for an element that is no object. A name that is not there is listed under result_properties_missing with why, led by the element's index or key for a list or dictionary, a key that is not text shown as result shows it, and a result with no object in it answers properties_note instead. Without it an object comes back as its class, its script_class or script, and id, which is the object's instance id (get_instance_id()) and never a property of its own named id: read that one through properties.`
17521
17521
  },
17522
17522
  timeoutMs: {
17523
17523
  type: "integer",
@@ -711,10 +711,23 @@ func _read_off_result(result: Variant, asked: Variant) -> Dictionary:
711
711
  return _read_off_many(read_each, list, "Array", missing)
712
712
  if result is Dictionary:
713
713
  var map: Dictionary = result
714
+ # In the shape result gives the dictionary: keyed by text only when every key is text, since
715
+ # a key 7 and a key "7" are one key once both are text, and one of them was lost.
716
+ var texts: bool = map.keys().all(
717
+ func(key: Variant) -> bool: return key is String or key is StringName
718
+ )
714
719
  var read_by_key: Dictionary = {}
720
+ var entries: Array = []
715
721
  for key: Variant in map:
716
- read_by_key[str(key)] = _read_off_element(map[key], "[%s]" % str(key), asked, missing)
717
- return _read_off_many(read_by_key, map.values(), "Dictionary", missing)
722
+ var shown: Variant = _values.serialize(key)
723
+ var named: String = "[%s]" % (str(key) if texts else JSON.stringify(shown, "", false))
724
+ var got: Variant = _read_off_element(map[key], named, asked, missing)
725
+ if texts:
726
+ read_by_key[str(key)] = got
727
+ else:
728
+ entries.append([shown, got])
729
+ var shaped: Variant = read_by_key if texts else {"_type": "Dictionary", "entries": entries}
730
+ return _read_off_many(shaped, map.values(), "Dictionary", missing)
718
731
  if result is Object and not is_instance_valid(result):
719
732
  return {
720
733
  "properties_note": "the call answered an object that has since been freed, so nothing was read"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdharness",
3
- "version": "1.3.16",
3
+ "version": "1.3.17",
4
4
  "mcpName": "io.github.Aureliolo/gdharness",
5
5
  "description": "A harness for driving a Godot 4 project from an agent: editor addons, a runtime bridge into the running game, an MCP server in front of them, and a CLI that installs and diagnoses the Godot side.",
6
6
  "type": "module",