@bowmark/web 1.24.1 → 1.24.2

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/dist/session.js CHANGED
@@ -48,6 +48,26 @@ function libraryProxy(dispatch) {
48
48
  };
49
49
  return node([]);
50
50
  }
51
+ /** `get_library` is real, and it is not here.
52
+ *
53
+ * It is an MCP tool and `GET /v1/library?query=`, never an export of this
54
+ * package — so `bowmark.get_library({ query })` raises the bad-path error above
55
+ * and, until 2026-09-19, said nothing about where the thing actually lives. A
56
+ * newcomer who hit it read an 88,000-line generated `.d.ts` by hand instead.
57
+ *
58
+ * A LOCAL COPY on purpose: this package has zero runtime dependencies,
59
+ * deliberately and permanently, so it cannot import `OTHER_CHANNEL` from
60
+ * `@bowmark/runtime`. `tests/unit/other-channel-hint.test.ts` holds the three
61
+ * copies (here, the Python client, the runtime) to the same names.
62
+ * `agents/richard/problems/newcomer-get-library-shown-as-callable-in-own-code.md`. */
63
+ const OTHER_CHANNEL = new Set(["get_library", "getLibrary"]);
64
+ function otherChannelSuffix(first) {
65
+ if (first === undefined || !OTHER_CHANNEL.has(first))
66
+ return "";
67
+ return (" — `get_library` is a DISCOVERY channel, not something this package exports: it is an MCP " +
68
+ "tool your agent calls directly, and `GET /v1/library?query=…` over HTTP with your " +
69
+ "`BOWMARK_API_KEY`. Read the library BEFORE you write the call, then call what you came for.");
70
+ }
51
71
  /** One dispatch: validate the path, refuse a non-wire argument, then send it. */
52
72
  function dispatchThrough(send) {
53
73
  // `async`, so EVERY refusal is a rejected promise rather than a synchronous
@@ -61,7 +81,8 @@ function dispatchThrough(send) {
61
81
  // real call is `<unit>.<fn>` or `providers.<id>.<fn>`. Saying so here costs a
62
82
  // round trip nothing and names the shape.
63
83
  if (path.length < 2) {
64
- throw new BowmarkError(`${label} is not a callable path. Call a function on a unit — bowmark.music.search(…) or bowmark.providers.gymshark.search(…).`, { code: "bad_path", path: label });
84
+ throw new BowmarkError(`${label} is not a callable path. Call a function on a unit — bowmark.music.search(…) or bowmark.providers.gymshark.search(…).` +
85
+ otherChannelSuffix(path[0]), { code: "bad_path", path: label });
65
86
  }
66
87
  // BEFORE the request, deliberately. A guard that ran server-side would report
67
88
  // a mangled value as a capability failure, after it had been metered.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bowmark/web",
3
- "version": "1.24.1",
3
+ "version": "1.24.2",
4
4
  "type": "module",
5
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",