zanii-connect 0.1.1 → 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.
- package/README.md +7 -2
- package/dist/index.d.ts +10 -0
- package/dist/index.js +18 -0
- 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
|
|
|
@@ -65,7 +69,8 @@ Mirrors the Python SDK (`sdk/python`), camelCased — covers the full API:
|
|
|
65
69
|
- **Execution**: `execute`, `executeAsync`, `job`, `waitForJob` · approvals (`approvals`, `approve`)
|
|
66
70
|
- **Browser sandbox**: `createBrowserSession`, `browserSession`, `browserRun`, `browserRunAsync`
|
|
67
71
|
- **Secrets / automation**: `secrets`, `setSecret`, `deleteSecret`, triggers, webhook subscriptions
|
|
68
|
-
- **Observability**: `executions
|
|
72
|
+
- **Observability**: `executions` (each row carries `receipt_hash` + `proof_url`), `audit`, `auditExportCsv`, `health`
|
|
73
|
+
- **Proof-of-action**: `receiptsBundle` (offline-verifiable audit bundle), `complianceReport` (json/markdown)
|
|
69
74
|
|
|
70
75
|
## License
|
|
71
76
|
|
package/dist/index.d.ts
CHANGED
|
@@ -158,4 +158,14 @@ export declare class ZaniiClient {
|
|
|
158
158
|
}): Promise<any>;
|
|
159
159
|
/** Full audit log as CSV text. */
|
|
160
160
|
auditExportCsv(): Promise<string>;
|
|
161
|
+
/**
|
|
162
|
+
* The platform's audit bundle from the transparency log + this org's receipt
|
|
163
|
+
* hashes. Verify offline with @zanii/core verifyAuditBundle.
|
|
164
|
+
*/
|
|
165
|
+
receiptsBundle(): Promise<any>;
|
|
166
|
+
/**
|
|
167
|
+
* Auditor-ready report over the cryptographically verified audit bundle.
|
|
168
|
+
* format "markdown" returns text; "json" returns the structured report.
|
|
169
|
+
*/
|
|
170
|
+
complianceReport(format?: "json" | "markdown"): Promise<any>;
|
|
161
171
|
}
|
package/dist/index.js
CHANGED
|
@@ -386,4 +386,22 @@ export class ZaniiClient {
|
|
|
386
386
|
auditExportCsv() {
|
|
387
387
|
return this.req("GET", "/audit/export", { raw: true });
|
|
388
388
|
}
|
|
389
|
+
// -- proof-of-action (Zanii transparency ledger) ---------------------------
|
|
390
|
+
/**
|
|
391
|
+
* The platform's audit bundle from the transparency log + this org's receipt
|
|
392
|
+
* hashes. Verify offline with @zanii/core verifyAuditBundle.
|
|
393
|
+
*/
|
|
394
|
+
receiptsBundle() {
|
|
395
|
+
return this.req("GET", "/org/receipts/bundle");
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Auditor-ready report over the cryptographically verified audit bundle.
|
|
399
|
+
* format "markdown" returns text; "json" returns the structured report.
|
|
400
|
+
*/
|
|
401
|
+
complianceReport(format = "json") {
|
|
402
|
+
return this.req("GET", "/org/compliance-report", {
|
|
403
|
+
params: { format },
|
|
404
|
+
raw: format === "markdown",
|
|
405
|
+
});
|
|
406
|
+
}
|
|
389
407
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zanii-connect",
|
|
3
|
-
"version": "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": [
|
|
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": {
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
34
|
+
},
|
|
29
35
|
"scripts": {
|
|
30
36
|
"build": "tsc",
|
|
31
37
|
"prepublishOnly": "tsc"
|