@astrofoundry/pi-astro 0.40.12 → 0.40.14

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": "@astrofoundry/pi-astro",
3
- "version": "0.40.12",
3
+ "version": "0.40.14",
4
4
  "description": "Personal pi customizations (extensions, subagents, skills, prompts, themes) for the pi coding agent.",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -48,7 +48,7 @@ Any write of the Network API under `/v1/sites/<siteId>/`: networks, Wi-Fi broadc
48
48
 
49
49
  Procedure for every write:
50
50
 
51
- 1. Read the current object (or, for a create, an existing object of the same kind) with `get` and copy its structure. When the site has none of that kind yet, use exactly the fields the task gives; never invent a field name. A PUT sends the complete object without `id` and `metadata`.
51
+ 1. Read the current object (or, for a create, an existing object of the same kind) with `get` and copy its structure. When the site has none of that kind yet, use exactly the fields the task gives; never invent a field name. A PUT sends the complete object; every write body leaves out the read-only fields `id`, `metadata`, `default`, and `index`, which UniFi rejects with 400 `Unknown request body property`.
52
52
  2. For a firewall policy, read `firewall-zones` for the zone ids; names follow `<what> - from <source>` (the `from Cortex` family on 37: source zone plus source IP filter, destination zone plus IP and port filter, TCP, IPv4, return traffic allowed, logging off).
53
53
  3. Write, then read the object back and report its id, name, and the fields that changed.
54
54
 
@@ -262,8 +262,9 @@ function printAnswer(answer: Answer, source: string): number {
262
262
  } catch {
263
263
  /* non-JSON body stays text */
264
264
  }
265
+ // The gate shows only stderr for a failed call, so the error carries UniFi's own message.
266
+ if (answer.status < 200 || answer.status >= 300) throw new ServiceError(`${source} answered ${answer.status}: ${answer.body.slice(0, 2000)}`);
265
267
  printJson(parsed);
266
- if (answer.status < 200 || answer.status >= 300) throw new ServiceError(`${source} answered ${answer.status}`);
267
268
  return 0;
268
269
  }
269
270