@bowmark/web 1.28.0 → 1.29.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.
@@ -122,11 +122,13 @@ export declare class BowmarkError extends Error {
122
122
  readonly logs: readonly string[];
123
123
  /** The path that failed, as a caller writes it: `bowmark.music.search`. */
124
124
  readonly path?: string;
125
+ readonly cause?: Error;
125
126
  constructor(message: string, init: {
126
127
  code: string;
127
128
  httpStatus?: number;
128
129
  logs?: readonly string[];
129
130
  path?: string;
131
+ cause?: Error;
130
132
  });
131
133
  }
132
134
  /** One call paused for a human login. **The session is still open** and the same
@@ -145,6 +147,7 @@ export declare class BowmarkNeedsUserError extends BowmarkError {
145
147
  path?: string;
146
148
  handoff?: Handoff;
147
149
  needs?: readonly AuthNeed[];
150
+ cause?: Error;
148
151
  });
149
152
  }
150
153
  /** A `ClientOptions` with every default already applied, so nothing downstream has
package/dist/transport.js CHANGED
@@ -24,6 +24,7 @@ export class BowmarkError extends Error {
24
24
  logs;
25
25
  /** The path that failed, as a caller writes it: `bowmark.music.search`. */
26
26
  path;
27
+ cause;
27
28
  constructor(message, init) {
28
29
  super(message);
29
30
  this.name = "BowmarkError";
@@ -31,6 +32,7 @@ export class BowmarkError extends Error {
31
32
  this.httpStatus = init.httpStatus ?? 0;
32
33
  this.logs = init.logs ?? [];
33
34
  this.path = init.path;
35
+ this.cause = init.cause;
34
36
  }
35
37
  }
36
38
  /** One call paused for a human login. **The session is still open** and the same
@@ -117,8 +119,13 @@ async function sendRequest(client, method, path, body, extraHeaders) {
117
119
  catch (err) {
118
120
  // A transport failure is not a capability failure, and conflating the two is
119
121
  // how a caller comes to retry a DNS problem against a site.
120
- throw new BowmarkError(`could not reach ${client.baseUrl}${path}: ${String(err)}`, {
122
+ // Extract the underlying cause if available (e.g., from undici).
123
+ const cause = err instanceof Error ? err : undefined;
124
+ const causeMessage = cause?.cause instanceof Error ? `${cause.cause.message}` : cause?.message || String(err);
125
+ const message = `could not reach ${client.baseUrl}${path}: ${causeMessage}`;
126
+ throw new BowmarkError(message, {
121
127
  code: "network_error",
128
+ cause,
122
129
  });
123
130
  }
124
131
  const text = await response.text();
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@bowmark/web",
3
- "version": "1.28.0",
3
+ "version": "1.29.0",
4
4
  "type": "module",
5
- "description": "The public client for the Bowmark capability library — real TypeScript for the whole bowmark.* surface, with no Bowmark source on the caller's disk. ZERO runtime dependencies, deliberately and permanently.",
5
+ "description": "The public client for the Bowmark capability library: real TypeScript for the whole bowmark.* surface, with no Bowmark source on the caller's disk. ZERO runtime dependencies, deliberately and permanently.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://bowmark.ai",
8
8
  "repository": {
@@ -17,7 +17,9 @@
17
17
  "bowmark",
18
18
  "agent",
19
19
  "capability",
20
- "browser-automation",
20
+ "web-scraping",
21
+ "web-data",
22
+ "ai-agent-tools",
21
23
  "typescript"
22
24
  ],
23
25
  "main": "./dist/index.js",