@trucore/atf 1.0.0 → 1.0.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 +5 -5
- package/dist/index.js +13 -13
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -43,7 +43,7 @@ npx @trucore/atf@1.0.0 health --base-url http://localhost:3000
|
|
|
43
43
|
**Output shape:**
|
|
44
44
|
|
|
45
45
|
```json
|
|
46
|
-
{ "ok": true, "
|
|
46
|
+
{ "ok": true, "base_url": "https://api.trucore.xyz", "latency_ms": 42, "response": { "status": "ok" } }
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
### `simulate`
|
|
@@ -59,7 +59,7 @@ npx @trucore/atf@1.0.0 simulate --json '{"chain_id":1,"value_eth":"0.5"}' --base
|
|
|
59
59
|
**Output shape:**
|
|
60
60
|
|
|
61
61
|
```json
|
|
62
|
-
{ "ok": true, "
|
|
62
|
+
{ "ok": true, "base_url": "https://api.trucore.xyz", "preset": "swap_small", "verified": true, "response": { "decision": "allowed", "reasons": [], "receipt_hash": "a1b2...64hex", "content_hash": "c3d4...64hex" } }
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
### `approve`
|
|
@@ -74,7 +74,7 @@ npx @trucore/atf@1.0.0 approve --intent abc123 --token mytoken --pretty
|
|
|
74
74
|
**Output shape:**
|
|
75
75
|
|
|
76
76
|
```json
|
|
77
|
-
{ "ok": true, "
|
|
77
|
+
{ "ok": true, "base_url": "https://api.trucore.xyz", "intent": "abc123", "response": { "intent_id": "abc123", "status": "approved" } }
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
### `version`
|
|
@@ -89,7 +89,7 @@ npx @trucore/atf@1.0.0 version --pretty
|
|
|
89
89
|
**Output shape:**
|
|
90
90
|
|
|
91
91
|
```json
|
|
92
|
-
{ "ok": true, "cli_version": "1.0.
|
|
92
|
+
{ "ok": true, "cli_version": "1.0.1", "node_version": "v22.0.0", "platform": "linux", "arch": "x64", "default_base_url": "https://api.trucore.xyz", "build_commit": "abc1234", "build_date": "2025-01-01T00:00:00Z" }
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
## Global Options
|
|
@@ -137,7 +137,7 @@ All commands return a JSON envelope with `"ok": true/false`.
|
|
|
137
137
|
```json
|
|
138
138
|
{
|
|
139
139
|
"ok": true,
|
|
140
|
-
"
|
|
140
|
+
"base_url": "https://api.trucore.xyz",
|
|
141
141
|
"preset": "swap_small",
|
|
142
142
|
"verified": true,
|
|
143
143
|
"response": {
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
// @trucore/atf v1.0.
|
|
5
|
-
// Built: 2026-02-27T22:
|
|
4
|
+
// @trucore/atf v1.0.1 — Agent Transaction Firewall CLI
|
|
5
|
+
// Built: 2026-02-27T22:36:52.254Z
|
|
6
6
|
// Commit: 809c30e
|
|
7
7
|
|
|
8
8
|
// ---- src/constants.mjs ----
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* by build.mjs during the bundling step.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const VERSION = "1.0.
|
|
16
|
+
const VERSION = "1.0.1";
|
|
17
17
|
const DEFAULT_BASE_URL = "https://api.trucore.xyz";
|
|
18
18
|
const BUILD_COMMIT = "809c30e";
|
|
19
|
-
const BUILD_DATE = "2026-02-27T22:
|
|
19
|
+
const BUILD_DATE = "2026-02-27T22:36:52.254Z";
|
|
20
20
|
const SIMULATE_PATHS = ["/api/simulate", "/v1/simulate"];
|
|
21
21
|
|
|
22
22
|
// ---- src/redact.mjs ----
|
|
@@ -373,7 +373,7 @@ function formatErrorPretty(errEnvelope) {
|
|
|
373
373
|
if (e.details) {
|
|
374
374
|
if (e.details.hint) lines.push(`${c.dim} Hint: ${e.details.hint}${c.reset}`);
|
|
375
375
|
if (e.details.status) lines.push(`${c.dim} HTTP status: ${e.details.status}${c.reset}`);
|
|
376
|
-
if (e.details.
|
|
376
|
+
if (e.details.request_id) lines.push(`${c.dim} Request ID: ${e.details.request_id}${c.reset}`);
|
|
377
377
|
}
|
|
378
378
|
lines.push("");
|
|
379
379
|
return lines.join("\n");
|
|
@@ -399,10 +399,10 @@ function exitWithError(code, message, hint, format, extra) {
|
|
|
399
399
|
const details = {};
|
|
400
400
|
if (hint) details.hint = hint;
|
|
401
401
|
if (extra && extra.status) details.status = extra.status;
|
|
402
|
-
if (extra && extra.requestId) details.
|
|
402
|
+
if (extra && extra.requestId) details.request_id = extra.requestId;
|
|
403
403
|
if (extra && extra.path) details.path = extra.path;
|
|
404
404
|
if (extra && extra.attempted_paths) details.attempted_paths = extra.attempted_paths;
|
|
405
|
-
if (extra && extra.baseUrl) details.
|
|
405
|
+
if (extra && extra.baseUrl) details.base_url = extra.baseUrl;
|
|
406
406
|
const err = makeError(code, message, Object.keys(details).length > 0 ? details : undefined);
|
|
407
407
|
if (format === "pretty") {
|
|
408
408
|
process.stderr.write(formatErrorPretty(err));
|
|
@@ -417,7 +417,7 @@ function exitWithError(code, message, hint, format, extra) {
|
|
|
417
417
|
* health.mjs — health command implementation
|
|
418
418
|
*
|
|
419
419
|
* GET {base}/health — check API availability and measure latency.
|
|
420
|
-
* Output: { ok:true,
|
|
420
|
+
* Output: { ok:true, base_url, latency_ms, response:<healthJson> }
|
|
421
421
|
*/
|
|
422
422
|
|
|
423
423
|
async function runHealth(args) {
|
|
@@ -451,7 +451,7 @@ async function runHealth(args) {
|
|
|
451
451
|
|
|
452
452
|
const result = {
|
|
453
453
|
ok: true,
|
|
454
|
-
baseUrl,
|
|
454
|
+
base_url: baseUrl,
|
|
455
455
|
latency_ms: latencyMs,
|
|
456
456
|
response: response.data || {},
|
|
457
457
|
};
|
|
@@ -477,7 +477,7 @@ async function runHealth(args) {
|
|
|
477
477
|
*
|
|
478
478
|
* POST {base}/v1/intents/approve with Bearer token.
|
|
479
479
|
* Approves a pending intent returned from a previous simulation.
|
|
480
|
-
* Output: { ok:true,
|
|
480
|
+
* Output: { ok:true, base_url, intent, response:<approveJson> }
|
|
481
481
|
*/
|
|
482
482
|
|
|
483
483
|
async function runApprove(args) {
|
|
@@ -544,7 +544,7 @@ async function runApprove(args) {
|
|
|
544
544
|
}
|
|
545
545
|
|
|
546
546
|
const data = response.data || {};
|
|
547
|
-
const result = { ok: true, baseUrl, intent, response: data };
|
|
547
|
+
const result = { ok: true, base_url: baseUrl, intent, response: data };
|
|
548
548
|
if (args.verbose && args._deprecatedIntentId) {
|
|
549
549
|
result.warnings = ["--intent-id is deprecated; use --intent"];
|
|
550
550
|
}
|
|
@@ -609,7 +609,7 @@ async function runVersion(args) {
|
|
|
609
609
|
/**
|
|
610
610
|
* simulate.mjs — simulate command implementation
|
|
611
611
|
*
|
|
612
|
-
* Output: { ok:true,
|
|
612
|
+
* Output: { ok:true, base_url, preset?, verified?:boolean, response:<simulateJson> }
|
|
613
613
|
*/
|
|
614
614
|
|
|
615
615
|
async function runSimulate(args) {
|
|
@@ -820,7 +820,7 @@ async function runSimulate(args) {
|
|
|
820
820
|
}
|
|
821
821
|
|
|
822
822
|
// Build result envelope
|
|
823
|
-
const result = { ok: true, baseUrl };
|
|
823
|
+
const result = { ok: true, base_url: baseUrl };
|
|
824
824
|
result.preset = presetName || null;
|
|
825
825
|
result.verified = verify ? (verified === true) : null;
|
|
826
826
|
result.response = data;
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trucore/atf",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Agent Transaction Firewall CLI — simulate, verify, and audit on-chain transactions trustlessly.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/trucore-ai/agent-transaction-firewall.git",
|
|
8
|
+
"url": "git+https://github.com/trucore-ai/agent-transaction-firewall.git",
|
|
9
9
|
"directory": "packages/atf-cli"
|
|
10
10
|
},
|
|
11
11
|
"homepage": "https://github.com/trucore-ai/agent-transaction-firewall/tree/main/packages/atf-cli#readme",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"trustless"
|
|
25
25
|
],
|
|
26
26
|
"bin": {
|
|
27
|
-
"atf": "
|
|
27
|
+
"atf": "dist/index.js"
|
|
28
28
|
},
|
|
29
29
|
"main": "./dist/index.js",
|
|
30
30
|
"files": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"scripts": {
|
|
42
42
|
"build": "node build.mjs",
|
|
43
|
-
"test": "node --test tests/",
|
|
43
|
+
"test": "node --test tests/test_*.mjs",
|
|
44
44
|
"prepublishOnly": "npm run build && npm run test"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {}
|