@integrity-labs/xero-broker 0.1.8 → 0.1.9

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 +20 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -21166,18 +21166,33 @@ var XeroBrokerClient = class {
21166
21166
  }
21167
21167
  });
21168
21168
  }
21169
- pollDecision(args) {
21169
+ // CS-1962: a GET has no body, so `requireTeamOrAgent` can only resolve the
21170
+ // agent from an `agent_id` QUERY param. Without it the middleware falls
21171
+ // through to the team path and 400s with "missing X-Team-Slug", so neither
21172
+ // poll nor await could ever return a decision (the POSTs worked because
21173
+ // they carry agent_id in the body). Same fix as cloud-broker's ENG-4739.
21174
+ agentQuery() {
21175
+ if (!this.agentId) {
21176
+ throw makeBrokerError(400, "XeroBrokerClient decision polling requires agentId");
21177
+ }
21178
+ return { agent_id: this.agentId };
21179
+ }
21180
+ async pollDecision(args) {
21170
21181
  return this.request(
21171
21182
  "GET",
21172
- `/xero-broker/requests/${encodeURIComponent(args.request_id)}`
21183
+ `/xero-broker/requests/${encodeURIComponent(args.request_id)}`,
21184
+ { query: this.agentQuery() }
21173
21185
  );
21174
21186
  }
21175
- awaitDecision(args) {
21187
+ async awaitDecision(args) {
21176
21188
  return this.request(
21177
21189
  "GET",
21178
21190
  `/xero-broker/requests/${encodeURIComponent(args.request_id)}/await`,
21179
21191
  {
21180
- query: args.max_wait_seconds != null ? { max_wait_seconds: String(args.max_wait_seconds) } : void 0
21192
+ query: {
21193
+ ...this.agentQuery(),
21194
+ ...args.max_wait_seconds != null ? { max_wait_seconds: String(args.max_wait_seconds) } : {}
21195
+ }
21181
21196
  }
21182
21197
  );
21183
21198
  }
@@ -21255,7 +21270,7 @@ var awaitDecisionSchema = external_exports.object({
21255
21270
  // package.json
21256
21271
  var package_default = {
21257
21272
  name: "@integrity-labs/xero-broker",
21258
- version: "0.1.8",
21273
+ version: "0.1.9",
21259
21274
  description: "Xero Broker \u2014 MCP server that routes money- and ledger-touching Xero writes through approval-core (HITL). Sibling to cloud-broker / channel-broker; the only write path for an agent once the vendor xero-mcp-server's write tools are stripped. ENG-4922.",
21260
21275
  type: "module",
21261
21276
  bin: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@integrity-labs/xero-broker",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Xero Broker — MCP server that routes money- and ledger-touching Xero writes through approval-core (HITL). Sibling to cloud-broker / channel-broker; the only write path for an agent once the vendor xero-mcp-server's write tools are stripped. ENG-4922.",
5
5
  "type": "module",
6
6
  "bin": {