atcn-sdk 1.4.1 → 1.5.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 +21 -9
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,32 +1,44 @@
|
|
|
1
1
|
# atcn-sdk
|
|
2
2
|
|
|
3
|
-
ATCN for TypeScript.
|
|
3
|
+
[ATCN](https://github.com/fadnisnikhil/atcn) for TypeScript and JavaScript. ATCN keeps one cost record per AI agent job (what was handed out, what each provider says happened, what was charged, and what doesn't add up) and signs it as a closure that anyone can verify offline. It only records: it never blocks, holds or releases money.
|
|
4
|
+
|
|
5
|
+
This package re-exports [`@atcn/sdk`](https://www.npmjs.com/package/@atcn/sdk), so `import ... from "atcn-sdk"` and `import ... from "@atcn/sdk"` give you the same API.
|
|
4
6
|
|
|
5
7
|
```bash
|
|
6
8
|
npm install atcn-sdk
|
|
7
9
|
```
|
|
8
10
|
|
|
11
|
+
## Verify a closure someone sent you
|
|
12
|
+
|
|
9
13
|
```ts
|
|
14
|
+
import { readFileSync } from "node:fs";
|
|
10
15
|
import { verifySubledgerDocument } from "atcn-sdk";
|
|
11
16
|
|
|
17
|
+
const closure = JSON.parse(readFileSync("task-closure.json", "utf8"));
|
|
18
|
+
const trustedKeys = JSON.parse(readFileSync("keys.json", "utf8")).items;
|
|
19
|
+
|
|
12
20
|
const report = verifySubledgerDocument(closure, { trustedKeys });
|
|
13
21
|
console.log(report.valid ? "VALID" : report.checks.filter((c) => !c.ok));
|
|
14
22
|
```
|
|
15
23
|
|
|
16
|
-
|
|
24
|
+
No closure yet? `npx @atcn/local-runner demo` makes one on your machine, with no account, and prints where it saved the files.
|
|
25
|
+
|
|
26
|
+
The API clients need an ATCN API at `baseUrl`. The hosted API is not open for signup yet. Everything else works offline. See [`@atcn/sdk`](https://www.npmjs.com/package/@atcn/sdk) for everything the SDK includes.
|
|
17
27
|
|
|
18
28
|
## All ATCN packages
|
|
19
29
|
|
|
20
30
|
| Package | What it is |
|
|
21
31
|
| --- | --- |
|
|
22
|
-
| [`@atcn/sdk`](https://www.npmjs.com/package/@atcn/sdk) | TypeScript SDK:
|
|
23
|
-
| [`@atcn/
|
|
32
|
+
| [`@atcn/sdk`](https://www.npmjs.com/package/@atcn/sdk) | TypeScript SDK: record tasks and charges, sign events, verify closures, receipts and closure packages |
|
|
33
|
+
| [`@atcn/mcp-server`](https://www.npmjs.com/package/@atcn/mcp-server) | `atcn-mcp`: lets agents in Claude, Cursor and other MCP hosts record jobs and costs and verify closures |
|
|
24
34
|
| [`@atcn/local-runner`](https://www.npmjs.com/package/@atcn/local-runner) | `atcn-local`: runs a job end to end on your machine (`npx @atcn/local-runner demo`) |
|
|
25
|
-
| [`@atcn/
|
|
26
|
-
| [`@atcn/
|
|
27
|
-
| [`@atcn/
|
|
28
|
-
| [`@atcn/
|
|
35
|
+
| [`@atcn/verify-cli`](https://www.npmjs.com/package/@atcn/verify-cli) | `atcn-verify`: offline verifier for closures, receipts, closure packages and clearing verdicts |
|
|
36
|
+
| [`@atcn/adapter-a2a`](https://www.npmjs.com/package/@atcn/adapter-a2a) | Records paid A2A tasks: signed task events, billing references, estimates, signed outcomes, sub-task lineage |
|
|
37
|
+
| [`@atcn/subledger`](https://www.npmjs.com/package/@atcn/subledger) | The task record: charge matching, exceptions, totals, signed receipts and closures |
|
|
38
|
+
| [`@atcn/core`](https://www.npmjs.com/package/@atcn/core) | Obligations: policy decisions, the balanced journal, closure packages and clearing verdicts |
|
|
39
|
+
| [`@atcn/verifiers`](https://www.npmjs.com/package/@atcn/verifiers) | Checks for submitted evidence (JUnit tests, ESLint, patch digest, attestations, agent traces) |
|
|
40
|
+
| [`@atcn/schema`](https://www.npmjs.com/package/@atcn/schema) | Data formats, canonical JSON (RFC 8785), Ed25519 signing, JSON Schemas and test vectors |
|
|
29
41
|
| [`@atcn/usage`](https://www.npmjs.com/package/@atcn/usage) | Opt-in usage reporting, off by default |
|
|
30
|
-
| [`atcn` (PyPI)](https://pypi.org/project/atcn/) | Python SDK:
|
|
42
|
+
| [`atcn` (PyPI)](https://pypi.org/project/atcn/) | Python SDK: the same signing and offline verification, plus API clients and A2A helpers |
|
|
31
43
|
|
|
32
44
|
Source, docs and examples: [github.com/fadnisnikhil/atcn](https://github.com/fadnisnikhil/atcn). Apache-2.0.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atcn-sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "ATCN for TypeScript
|
|
3
|
+
"version": "1.5.1",
|
|
4
|
+
"description": "ATCN for TypeScript (re-exports @atcn/sdk): record what AI agent jobs cost and verify signed closures, receipts and closure packages offline",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -40,6 +40,6 @@
|
|
|
40
40
|
"build": "tsc -p tsconfig.build.json"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@atcn/sdk": "1.
|
|
43
|
+
"@atcn/sdk": "1.5.1"
|
|
44
44
|
}
|
|
45
45
|
}
|