@atbash/sdk 0.16.0-dev.0 → 0.16.2-dev.0

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.
@@ -721,7 +721,18 @@ declare class AtbashAPIError extends Error {
721
721
  readonly status: number;
722
722
  /** Raw response body text (may be empty). */
723
723
  readonly body: string;
724
- constructor(status: number, body: string, statusText?: string, endpoint?: string);
724
+ /**
725
+ * Request path this status came from, e.g. `/api/v1/judge` — absent when the
726
+ * request never reached a response (transport failures carry status 0).
727
+ *
728
+ * A status alone does not say what failed. Several routes answer one call, and
729
+ * more than one of them can 404: a caller reading only `404` cannot tell "this
730
+ * agent is not registered" from "the chain-routing lookup did not resolve", and
731
+ * has to guess from the body's prose — which a 404 raised before any handler
732
+ * ran does not carry. The path is the fact that settles it.
733
+ */
734
+ readonly path?: string;
735
+ constructor(status: number, body: string, statusText?: string, endpoint?: string, path?: string);
725
736
  }
726
737
  declare class SignatureVerificationError extends Error {
727
738
  constructor(message: string);
package/dist/browser.mjs CHANGED
@@ -44409,11 +44409,23 @@ var AtbashAPIError = class extends Error {
44409
44409
  status;
44410
44410
  /** Raw response body text (may be empty). */
44411
44411
  body;
44412
- constructor(status, body, statusText = "", endpoint = DEFAULT_ENDPOINT) {
44413
- super(enrich(status, body, statusText, endpoint));
44412
+ /**
44413
+ * Request path this status came from, e.g. `/api/v1/judge` — absent when the
44414
+ * request never reached a response (transport failures carry status 0).
44415
+ *
44416
+ * A status alone does not say what failed. Several routes answer one call, and
44417
+ * more than one of them can 404: a caller reading only `404` cannot tell "this
44418
+ * agent is not registered" from "the chain-routing lookup did not resolve", and
44419
+ * has to guess from the body's prose — which a 404 raised before any handler
44420
+ * ran does not carry. The path is the fact that settles it.
44421
+ */
44422
+ path;
44423
+ constructor(status, body, statusText = "", endpoint = DEFAULT_ENDPOINT, path4) {
44424
+ super(enrich(status, body, statusText, endpoint, path4));
44414
44425
  this.name = "AtbashAPIError";
44415
44426
  this.status = status;
44416
44427
  this.body = body;
44428
+ this.path = path4;
44417
44429
  }
44418
44430
  };
44419
44431
  var SignatureVerificationError = class extends Error {
@@ -44422,9 +44434,9 @@ var SignatureVerificationError = class extends Error {
44422
44434
  this.name = "SignatureVerificationError";
44423
44435
  }
44424
44436
  };
44425
- function enrich(status, body, statusText, endpoint) {
44437
+ function enrich(status, body, statusText, endpoint, path4) {
44426
44438
  const dashboard = endpoint.replace(/\/+$/, "") || DEFAULT_ENDPOINT;
44427
- let msg = `API error ${status}: ${body || statusText}`;
44439
+ let msg = `API error ${status}${path4 ? ` from ${path4}` : ""}: ${body || statusText}`;
44428
44440
  const lowered = body.toLowerCase();
44429
44441
  if (lowered.includes("agent not registered")) {
44430
44442
  msg += `
@@ -44769,7 +44781,7 @@ var Atbash = class _Atbash {
44769
44781
  this.failClosed = options.failClosed !== false;
44770
44782
  this.debug = options.debug === true;
44771
44783
  this.logger = options.logger ?? {};
44772
- this.http = new HttpClient(this.endpoint, options.timeoutMs ?? 6e4);
44784
+ this.http = new HttpClient(this.endpoint, options.timeoutMs ?? 12e4);
44773
44785
  this.logEnvironmentOnce();
44774
44786
  if (this.endpoint !== DEFAULT_ENDPOINT) {
44775
44787
  this.logger.warn?.("[atbash] running on non-default judge endpoint", {
@@ -45668,7 +45680,8 @@ var Atbash = class _Atbash {
45668
45680
  resp.status,
45669
45681
  await safeText(resp),
45670
45682
  resp.statusText,
45671
- this.endpoint
45683
+ this.endpoint,
45684
+ requestPath(resp.url)
45672
45685
  );
45673
45686
  }
45674
45687
  /**
@@ -45810,6 +45823,14 @@ function parseJson(bytes) {
45810
45823
  const parsed = tryParseJson(bytes.toString("utf-8"));
45811
45824
  return parsed === void 0 ? {} : parsed;
45812
45825
  }
45826
+ function requestPath(url) {
45827
+ if (!url) return void 0;
45828
+ try {
45829
+ return new URL(url).pathname || void 0;
45830
+ } catch {
45831
+ return void 0;
45832
+ }
45833
+ }
45813
45834
  async function safeText(resp) {
45814
45835
  try {
45815
45836
  return await resp.text();
package/dist/index.d.mts CHANGED
@@ -721,7 +721,18 @@ declare class AtbashAPIError extends Error {
721
721
  readonly status: number;
722
722
  /** Raw response body text (may be empty). */
723
723
  readonly body: string;
724
- constructor(status: number, body: string, statusText?: string, endpoint?: string);
724
+ /**
725
+ * Request path this status came from, e.g. `/api/v1/judge` — absent when the
726
+ * request never reached a response (transport failures carry status 0).
727
+ *
728
+ * A status alone does not say what failed. Several routes answer one call, and
729
+ * more than one of them can 404: a caller reading only `404` cannot tell "this
730
+ * agent is not registered" from "the chain-routing lookup did not resolve", and
731
+ * has to guess from the body's prose — which a 404 raised before any handler
732
+ * ran does not carry. The path is the fact that settles it.
733
+ */
734
+ readonly path?: string;
735
+ constructor(status: number, body: string, statusText?: string, endpoint?: string, path?: string);
725
736
  }
726
737
  declare class SignatureVerificationError extends Error {
727
738
  constructor(message: string);
package/dist/index.d.ts CHANGED
@@ -721,7 +721,18 @@ declare class AtbashAPIError extends Error {
721
721
  readonly status: number;
722
722
  /** Raw response body text (may be empty). */
723
723
  readonly body: string;
724
- constructor(status: number, body: string, statusText?: string, endpoint?: string);
724
+ /**
725
+ * Request path this status came from, e.g. `/api/v1/judge` — absent when the
726
+ * request never reached a response (transport failures carry status 0).
727
+ *
728
+ * A status alone does not say what failed. Several routes answer one call, and
729
+ * more than one of them can 404: a caller reading only `404` cannot tell "this
730
+ * agent is not registered" from "the chain-routing lookup did not resolve", and
731
+ * has to guess from the body's prose — which a 404 raised before any handler
732
+ * ran does not carry. The path is the fact that settles it.
733
+ */
734
+ readonly path?: string;
735
+ constructor(status: number, body: string, statusText?: string, endpoint?: string, path?: string);
725
736
  }
726
737
  declare class SignatureVerificationError extends Error {
727
738
  constructor(message: string);
package/dist/index.js CHANGED
@@ -3073,11 +3073,23 @@ var AtbashAPIError = class extends Error {
3073
3073
  status;
3074
3074
  /** Raw response body text (may be empty). */
3075
3075
  body;
3076
- constructor(status, body, statusText = "", endpoint = DEFAULT_ENDPOINT) {
3077
- super(enrich(status, body, statusText, endpoint));
3076
+ /**
3077
+ * Request path this status came from, e.g. `/api/v1/judge` — absent when the
3078
+ * request never reached a response (transport failures carry status 0).
3079
+ *
3080
+ * A status alone does not say what failed. Several routes answer one call, and
3081
+ * more than one of them can 404: a caller reading only `404` cannot tell "this
3082
+ * agent is not registered" from "the chain-routing lookup did not resolve", and
3083
+ * has to guess from the body's prose — which a 404 raised before any handler
3084
+ * ran does not carry. The path is the fact that settles it.
3085
+ */
3086
+ path;
3087
+ constructor(status, body, statusText = "", endpoint = DEFAULT_ENDPOINT, path7) {
3088
+ super(enrich(status, body, statusText, endpoint, path7));
3078
3089
  this.name = "AtbashAPIError";
3079
3090
  this.status = status;
3080
3091
  this.body = body;
3092
+ this.path = path7;
3081
3093
  }
3082
3094
  };
3083
3095
  var SignatureVerificationError = class extends Error {
@@ -3086,9 +3098,9 @@ var SignatureVerificationError = class extends Error {
3086
3098
  this.name = "SignatureVerificationError";
3087
3099
  }
3088
3100
  };
3089
- function enrich(status, body, statusText, endpoint) {
3101
+ function enrich(status, body, statusText, endpoint, path7) {
3090
3102
  const dashboard = endpoint.replace(/\/+$/, "") || DEFAULT_ENDPOINT;
3091
- let msg = `API error ${status}: ${body || statusText}`;
3103
+ let msg = `API error ${status}${path7 ? ` from ${path7}` : ""}: ${body || statusText}`;
3092
3104
  const lowered = body.toLowerCase();
3093
3105
  if (lowered.includes("agent not registered")) {
3094
3106
  msg += `
@@ -3601,7 +3613,7 @@ var Atbash = class _Atbash {
3601
3613
  this.failClosed = options.failClosed !== false;
3602
3614
  this.debug = options.debug === true;
3603
3615
  this.logger = options.logger ?? {};
3604
- this.http = new HttpClient(this.endpoint, options.timeoutMs ?? 6e4);
3616
+ this.http = new HttpClient(this.endpoint, options.timeoutMs ?? 12e4);
3605
3617
  this.logEnvironmentOnce();
3606
3618
  if (this.endpoint !== DEFAULT_ENDPOINT) {
3607
3619
  this.logger.warn?.("[atbash] running on non-default judge endpoint", {
@@ -4500,7 +4512,8 @@ var Atbash = class _Atbash {
4500
4512
  resp.status,
4501
4513
  await safeText(resp),
4502
4514
  resp.statusText,
4503
- this.endpoint
4515
+ this.endpoint,
4516
+ requestPath(resp.url)
4504
4517
  );
4505
4518
  }
4506
4519
  /**
@@ -4642,6 +4655,14 @@ function parseJson(bytes) {
4642
4655
  const parsed = tryParseJson(bytes.toString("utf-8"));
4643
4656
  return parsed === void 0 ? {} : parsed;
4644
4657
  }
4658
+ function requestPath(url) {
4659
+ if (!url) return void 0;
4660
+ try {
4661
+ return new URL(url).pathname || void 0;
4662
+ } catch {
4663
+ return void 0;
4664
+ }
4665
+ }
4645
4666
  async function safeText(resp) {
4646
4667
  try {
4647
4668
  return await resp.text();
package/dist/index.mjs CHANGED
@@ -2977,11 +2977,23 @@ var AtbashAPIError = class extends Error {
2977
2977
  status;
2978
2978
  /** Raw response body text (may be empty). */
2979
2979
  body;
2980
- constructor(status, body, statusText = "", endpoint = DEFAULT_ENDPOINT) {
2981
- super(enrich(status, body, statusText, endpoint));
2980
+ /**
2981
+ * Request path this status came from, e.g. `/api/v1/judge` — absent when the
2982
+ * request never reached a response (transport failures carry status 0).
2983
+ *
2984
+ * A status alone does not say what failed. Several routes answer one call, and
2985
+ * more than one of them can 404: a caller reading only `404` cannot tell "this
2986
+ * agent is not registered" from "the chain-routing lookup did not resolve", and
2987
+ * has to guess from the body's prose — which a 404 raised before any handler
2988
+ * ran does not carry. The path is the fact that settles it.
2989
+ */
2990
+ path;
2991
+ constructor(status, body, statusText = "", endpoint = DEFAULT_ENDPOINT, path7) {
2992
+ super(enrich(status, body, statusText, endpoint, path7));
2982
2993
  this.name = "AtbashAPIError";
2983
2994
  this.status = status;
2984
2995
  this.body = body;
2996
+ this.path = path7;
2985
2997
  }
2986
2998
  };
2987
2999
  var SignatureVerificationError = class extends Error {
@@ -2990,9 +3002,9 @@ var SignatureVerificationError = class extends Error {
2990
3002
  this.name = "SignatureVerificationError";
2991
3003
  }
2992
3004
  };
2993
- function enrich(status, body, statusText, endpoint) {
3005
+ function enrich(status, body, statusText, endpoint, path7) {
2994
3006
  const dashboard = endpoint.replace(/\/+$/, "") || DEFAULT_ENDPOINT;
2995
- let msg = `API error ${status}: ${body || statusText}`;
3007
+ let msg = `API error ${status}${path7 ? ` from ${path7}` : ""}: ${body || statusText}`;
2996
3008
  const lowered = body.toLowerCase();
2997
3009
  if (lowered.includes("agent not registered")) {
2998
3010
  msg += `
@@ -3514,7 +3526,7 @@ var Atbash = class _Atbash {
3514
3526
  this.failClosed = options.failClosed !== false;
3515
3527
  this.debug = options.debug === true;
3516
3528
  this.logger = options.logger ?? {};
3517
- this.http = new HttpClient(this.endpoint, options.timeoutMs ?? 6e4);
3529
+ this.http = new HttpClient(this.endpoint, options.timeoutMs ?? 12e4);
3518
3530
  this.logEnvironmentOnce();
3519
3531
  if (this.endpoint !== DEFAULT_ENDPOINT) {
3520
3532
  this.logger.warn?.("[atbash] running on non-default judge endpoint", {
@@ -4413,7 +4425,8 @@ var Atbash = class _Atbash {
4413
4425
  resp.status,
4414
4426
  await safeText(resp),
4415
4427
  resp.statusText,
4416
- this.endpoint
4428
+ this.endpoint,
4429
+ requestPath(resp.url)
4417
4430
  );
4418
4431
  }
4419
4432
  /**
@@ -4555,6 +4568,14 @@ function parseJson(bytes) {
4555
4568
  const parsed = tryParseJson(bytes.toString("utf-8"));
4556
4569
  return parsed === void 0 ? {} : parsed;
4557
4570
  }
4571
+ function requestPath(url) {
4572
+ if (!url) return void 0;
4573
+ try {
4574
+ return new URL(url).pathname || void 0;
4575
+ } catch {
4576
+ return void 0;
4577
+ }
4578
+ }
4558
4579
  async function safeText(resp) {
4559
4580
  try {
4560
4581
  return await resp.text();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atbash/sdk",
3
- "version": "0.16.0-dev.0",
3
+ "version": "0.16.2-dev.0",
4
4
  "description": "TypeScript SDK for Atbash — the safety layer that evaluates AI agent actions against operator-defined policies before execution.",
5
5
  "keywords": [
6
6
  "atbash",
@@ -89,10 +89,10 @@
89
89
  "typescript-eslint": "^8.62.1"
90
90
  },
91
91
  "optionalDependencies": {
92
- "@atbash/sdk-linux-x64-gnu": "0.16.0-dev.0",
93
- "@atbash/sdk-linux-arm64-gnu": "0.16.0-dev.0",
94
- "@atbash/sdk-linux-x64-musl": "0.16.0-dev.0",
95
- "@atbash/sdk-darwin-arm64": "0.16.0-dev.0",
96
- "@atbash/sdk-win32-x64-msvc": "0.16.0-dev.0"
92
+ "@atbash/sdk-linux-x64-gnu": "0.16.2-dev.0",
93
+ "@atbash/sdk-linux-arm64-gnu": "0.16.2-dev.0",
94
+ "@atbash/sdk-linux-x64-musl": "0.16.2-dev.0",
95
+ "@atbash/sdk-darwin-arm64": "0.16.2-dev.0",
96
+ "@atbash/sdk-win32-x64-msvc": "0.16.2-dev.0"
97
97
  }
98
98
  }