zanii-connect 0.2.0 → 0.2.1

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/README.md +5 -1
  2. package/package.json +9 -3
package/README.md CHANGED
@@ -25,6 +25,10 @@ const nc = new ZaniiClient({ apiKey: "nsk_..." });
25
25
  const nc = new ZaniiClient();
26
26
  await nc.login("info@zanii.agency", "password");
27
27
 
28
+ // Or with a bearer token you already hold — a vault session JWT, or a Zanii ID
29
+ // access token minted for the vault resource (aud = https://vault.zanii.agency/mcp):
30
+ const nc = new ZaniiClient({ token: "..." });
31
+
28
32
  console.log((await nc.me()).organization.name);
29
33
 
30
34
  // Connect a provider (open the returned URL in a browser to complete OAuth):
@@ -49,7 +53,7 @@ const result = await nc.waitForJob(job.job_id, 300);
49
53
 
50
54
  - **Retries**: 429/502/503/504 are retried up to 3 times with exponential backoff.
51
55
  - **Idempotency**: pass `{ idempotencyKey }` to `execute()` to make retries safe for side-effecting actions.
52
- - **Errors**: non-2xx responses throw `ZaniiError` with `.statusCode` and `.detail`.
56
+ - **Errors**: non-2xx responses throw `ZaniiError` with `.statusCode` and `.detail`. A failed tool call's `.detail` is the provider's real message (e.g. `provider 404: Requested entity was not found.`), never empty.
53
57
  - **MCP**: AI agents that speak MCP don't need this SDK — point them at
54
58
  `POST https://vault.zanii.agency/api/v1/mcp` with an `X-API-Key` header.
55
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zanii-connect",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "TypeScript SDK for Zanii Connect — OAuth connections and tool execution for AI agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,7 +11,11 @@
11
11
  "import": "./dist/index.js"
12
12
  }
13
13
  },
14
- "files": ["dist", "README.md", "LICENSE"],
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "LICENSE"
18
+ ],
15
19
  "keywords": [
16
20
  "zanii",
17
21
  "oauth",
@@ -25,7 +29,9 @@
25
29
  "bugs": {
26
30
  "email": "info@zanii.agency"
27
31
  },
28
- "engines": { "node": ">=18" },
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
29
35
  "scripts": {
30
36
  "build": "tsc",
31
37
  "prepublishOnly": "tsc"