@swarm-tips/client 0.2.3 → 0.2.4

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/SBOM.spdx.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "spdxVersion": "SPDX-2.3",
3
3
  "dataLicense": "CC0-1.0",
4
4
  "SPDXID": "SPDXRef-DOCUMENT",
5
- "name": "@swarm-tips/client-0.2.3",
6
- "documentNamespace": "https://swarm.tips/sbom/client/0.2.3",
5
+ "name": "@swarm-tips/client-0.2.4",
6
+ "documentNamespace": "https://swarm.tips/sbom/client/0.2.4",
7
7
  "creationInfo": {
8
- "created": "2026-09-09T05:14:05.500Z",
8
+ "created": "2026-09-09T05:55:37.047Z",
9
9
  "creators": [
10
10
  "Tool: sdk/client/scripts/generate-sbom.mjs",
11
11
  "Organization: Swarm Tips"
@@ -15,8 +15,8 @@
15
15
  {
16
16
  "name": "@swarm-tips/client",
17
17
  "SPDXID": "SPDXRef-Package",
18
- "versionInfo": "0.2.3",
19
- "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.2.3",
18
+ "versionInfo": "0.2.4",
19
+ "downloadLocation": "https://www.npmjs.com/package/@swarm-tips/client/v/0.2.4",
20
20
  "filesAnalyzed": false,
21
21
  "licenseConcluded": "MIT",
22
22
  "licenseDeclared": "MIT"
package/dist/http.js CHANGED
@@ -27,9 +27,14 @@ export class HttpClient {
27
27
  const operation = `${init.method ?? "GET"} ${path}`;
28
28
  const token = init.token ?? this.getToken?.();
29
29
  const headers = {
30
- "Content-Type": "application/json",
31
30
  ...init.headers,
32
31
  };
32
+ // A Content-Type header on a bodyless GET turns an otherwise simple
33
+ // cross-origin read into a CORS preflight. Public browser reads should not
34
+ // require OPTIONS for a body that does not exist.
35
+ if (init.body !== undefined && !headers["Content-Type"]) {
36
+ headers["Content-Type"] = "application/json";
37
+ }
33
38
  if (token)
34
39
  headers.Authorization = `Bearer ${token}`;
35
40
  let response;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** The unified client package version. Functional APIs live in typed subpaths. */
2
- export declare const CLIENT_VERSION: "0.2.3";
2
+ export declare const CLIENT_VERSION: "0.2.4";
3
3
  export declare const CLIENT_MANIFEST_SCHEMA: "swarm.client-manifest/v1";
4
4
  export { SwarmClientError } from "./errors.js";
5
5
  export type { SwarmClientErrorCode, SwarmClientErrorOptions } from "./errors.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  /** The unified client package version. Functional APIs live in typed subpaths. */
2
- export const CLIENT_VERSION = "0.2.3";
2
+ export const CLIENT_VERSION = "0.2.4";
3
3
  export const CLIENT_MANIFEST_SCHEMA = "swarm.client-manifest/v1";
4
4
  export { SwarmClientError } from "./errors.js";
@@ -49,7 +49,7 @@ export class SwarmClient {
49
49
  async toolCount() {
50
50
  const headers = { "Content-Type": "application/json", Accept: "application/json, text/event-stream" };
51
51
  try {
52
- const init = await this.fetchImpl(`${this.baseUrl}/mcp`, { method: "POST", headers, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "swarm-client", version: "0.2.3" } } }) });
52
+ const init = await this.fetchImpl(`${this.baseUrl}/mcp`, { method: "POST", headers, body: JSON.stringify({ jsonrpc: "2.0", id: 1, method: "initialize", params: { protocolVersion: "2025-03-26", capabilities: {}, clientInfo: { name: "swarm-client", version: "0.2.4" } } }) });
53
53
  if (!init.ok)
54
54
  return null;
55
55
  const session = init.headers.get("mcp-session-id");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swarm-tips/client",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Typed browser and Node.js clients for Swarm Tips, Shillbot, and Coordination Game",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",