@trucore/atf 1.5.0 → 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/dist/index.js +120 -11
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
// @trucore/atf v1.5.
|
|
5
|
-
// Built: 2026-04-
|
|
6
|
-
// Commit:
|
|
4
|
+
// @trucore/atf v1.5.1 — Agent Transaction Firewall CLI
|
|
5
|
+
// Built: 2026-04-05T01:48:06.696Z
|
|
6
|
+
// Commit: bfa266c
|
|
7
7
|
|
|
8
8
|
// ---- src/constants.mjs ----
|
|
9
9
|
/**
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* by build.mjs during the bundling step.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
const VERSION = "1.5.
|
|
16
|
+
const VERSION = "1.5.1";
|
|
17
17
|
const DEFAULT_BASE_URL = "https://api.trucore.xyz";
|
|
18
|
-
const BUILD_COMMIT = "
|
|
19
|
-
const BUILD_DATE = "2026-04-
|
|
18
|
+
const BUILD_COMMIT = "bfa266c";
|
|
19
|
+
const BUILD_DATE = "2026-04-05T01:48:06.696Z";
|
|
20
20
|
const SIMULATE_PATHS = ["/api/simulate", "/v1/simulate"];
|
|
21
21
|
|
|
22
22
|
// ---- src/redact.mjs ----
|
|
@@ -1071,9 +1071,16 @@ async function runProfileCreate(args) {
|
|
|
1071
1071
|
if (config.profiles[name]) {
|
|
1072
1072
|
exitWithError(ERROR_CODES.USER_ERROR, `Profile "${name}" already exists.`, null, args.format);
|
|
1073
1073
|
}
|
|
1074
|
-
|
|
1074
|
+
const profile = { ...PROFILE_DEFAULTS, tx: { ...PROFILE_DEFAULTS.tx } };
|
|
1075
|
+
// --network flag sets solana_cluster (e.g. --network devnet)
|
|
1076
|
+
if (args.network) {
|
|
1077
|
+
profile.solana_cluster = args.network;
|
|
1078
|
+
}
|
|
1079
|
+
config.profiles[name] = profile;
|
|
1075
1080
|
saveGlobalConfig(config);
|
|
1076
|
-
|
|
1081
|
+
const result = { ok: true, created: name };
|
|
1082
|
+
if (args.network) result.solana_cluster = args.network;
|
|
1083
|
+
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
1077
1084
|
}
|
|
1078
1085
|
|
|
1079
1086
|
async function runProfileDelete(args) {
|
|
@@ -1209,6 +1216,72 @@ async function runProfileWizard(args) {
|
|
|
1209
1216
|
}
|
|
1210
1217
|
}
|
|
1211
1218
|
|
|
1219
|
+
/**
|
|
1220
|
+
* runBurnerCommand — top-level "atf burner" handler.
|
|
1221
|
+
*
|
|
1222
|
+
* Subcommands:
|
|
1223
|
+
* enable Set the active profile's solana_cluster to devnet (burner mode).
|
|
1224
|
+
*
|
|
1225
|
+
* Standalone (no subcommand):
|
|
1226
|
+
* atf burner --network devnet Same as enable — sets cluster and confirms.
|
|
1227
|
+
*
|
|
1228
|
+
* This bridges the documented site quickstart (atf burner enable,
|
|
1229
|
+
* atf burner --network devnet) to the underlying profile/config system.
|
|
1230
|
+
*/
|
|
1231
|
+
async function runBurnerCommand(args) {
|
|
1232
|
+
const format = args.format;
|
|
1233
|
+
const sub = args.subCommand;
|
|
1234
|
+
const network = args.network || "devnet";
|
|
1235
|
+
|
|
1236
|
+
if (network !== "devnet") {
|
|
1237
|
+
exitWithError(
|
|
1238
|
+
ERROR_CODES.USER_ERROR,
|
|
1239
|
+
`Burner mode only supports devnet. Got: ${network}`,
|
|
1240
|
+
"Usage: atf burner enable OR atf burner --network devnet",
|
|
1241
|
+
format,
|
|
1242
|
+
);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
if (sub && sub !== "enable") {
|
|
1246
|
+
exitWithError(
|
|
1247
|
+
ERROR_CODES.USER_ERROR,
|
|
1248
|
+
`Unknown burner subcommand: ${sub}`,
|
|
1249
|
+
"Available: enable\nUsage: atf burner enable OR atf burner --network devnet",
|
|
1250
|
+
format,
|
|
1251
|
+
);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
// Load or initialize global config
|
|
1255
|
+
const config = loadGlobalConfig();
|
|
1256
|
+
const profileName = args.profileFlag || config.current_profile || "default";
|
|
1257
|
+
|
|
1258
|
+
if (!config.profiles[profileName]) {
|
|
1259
|
+
// Auto-create the profile if it doesn't exist yet
|
|
1260
|
+
config.profiles[profileName] = { ...PROFILE_DEFAULTS, tx: { ...PROFILE_DEFAULTS.tx } };
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
config.profiles[profileName].solana_cluster = "devnet";
|
|
1264
|
+
saveGlobalConfig(config);
|
|
1265
|
+
|
|
1266
|
+
const result = {
|
|
1267
|
+
ok: true,
|
|
1268
|
+
burner_enabled: true,
|
|
1269
|
+
profile: profileName,
|
|
1270
|
+
solana_cluster: "devnet",
|
|
1271
|
+
message: `Burner mode enabled on profile "${profileName}" (cluster: devnet).`,
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
if (format === "pretty") {
|
|
1275
|
+
const noColor = args.noColor || !!process.env.NO_COLOR;
|
|
1276
|
+
const c = noColor
|
|
1277
|
+
? { reset: "", bold: "", green: "", dim: "" }
|
|
1278
|
+
: { reset: "\x1b[0m", bold: "\x1b[1m", green: "\x1b[32m", dim: "\x1b[2m" };
|
|
1279
|
+
process.stdout.write(`\n${c.green}🔥${c.reset} ${result.message}\n\n`);
|
|
1280
|
+
} else {
|
|
1281
|
+
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1212
1285
|
// ---- src/secret_store.mjs ----
|
|
1213
1286
|
/**
|
|
1214
1287
|
* secret_store.mjs — file-based secret store with permission hardening
|
|
@@ -18525,10 +18598,13 @@ CONFIG & PROFILES
|
|
|
18525
18598
|
config get Get a profile config key
|
|
18526
18599
|
config list Show effective merged config (secrets redacted)
|
|
18527
18600
|
profile use Switch active profile
|
|
18601
|
+
profile select Alias for profile use
|
|
18528
18602
|
profile list List all profiles
|
|
18529
|
-
profile create Create a new profile
|
|
18603
|
+
profile create Create a new profile (supports --network devnet|mainnet)
|
|
18530
18604
|
profile delete Delete a profile
|
|
18531
18605
|
profile wizard Interactive guided profile setup
|
|
18606
|
+
burner enable Enable devnet burner mode on the active profile
|
|
18607
|
+
burner [--network] Standalone burner setup (devnet ephemeral wallet)
|
|
18532
18608
|
secret set Store a secret (e.g. Helius API key)
|
|
18533
18609
|
secret list List stored secret references (no values)
|
|
18534
18610
|
secret unset Remove a stored secret
|
|
@@ -18838,14 +18914,20 @@ Usage:
|
|
|
18838
18914
|
|
|
18839
18915
|
Subcommands:
|
|
18840
18916
|
use Switch active profile
|
|
18917
|
+
select Alias for use
|
|
18841
18918
|
list List all profiles
|
|
18842
18919
|
create Create a new profile
|
|
18843
18920
|
delete Delete a profile
|
|
18844
18921
|
wizard Interactive guided profile setup
|
|
18845
18922
|
|
|
18923
|
+
Options:
|
|
18924
|
+
--network <name> Set solana_cluster on create (devnet or mainnet)
|
|
18925
|
+
|
|
18846
18926
|
Examples:
|
|
18847
18927
|
atf profile create devnet
|
|
18928
|
+
atf profile create devnet-burner --network devnet
|
|
18848
18929
|
atf profile use devnet
|
|
18930
|
+
atf profile select devnet
|
|
18849
18931
|
atf profile list
|
|
18850
18932
|
atf profile wizard
|
|
18851
18933
|
`,
|
|
@@ -18864,6 +18946,25 @@ Examples:
|
|
|
18864
18946
|
atf secret set HELIUS_API_KEY
|
|
18865
18947
|
atf secret list
|
|
18866
18948
|
atf secret unset HELIUS_API_KEY
|
|
18949
|
+
`,
|
|
18950
|
+
burner: `
|
|
18951
|
+
ATF BURNER — Devnet Burner Mode
|
|
18952
|
+
|
|
18953
|
+
Manage ephemeral devnet wallet for safe testing.
|
|
18954
|
+
Sets the active profile to devnet cluster and generates a throwaway keypair.
|
|
18955
|
+
|
|
18956
|
+
Usage:
|
|
18957
|
+
atf burner [subcommand] [options]
|
|
18958
|
+
|
|
18959
|
+
Subcommands:
|
|
18960
|
+
enable Enable burner mode on the active profile (set cluster to devnet)
|
|
18961
|
+
|
|
18962
|
+
Options:
|
|
18963
|
+
--network <name> Target network (default: devnet). Only devnet is supported.
|
|
18964
|
+
|
|
18965
|
+
Examples:
|
|
18966
|
+
atf burner enable
|
|
18967
|
+
atf burner --network devnet
|
|
18867
18968
|
`,
|
|
18868
18969
|
bot: `
|
|
18869
18970
|
ATF BOT — Bot / Agent Commands
|
|
@@ -19351,6 +19452,7 @@ function parseArgs(argv) {
|
|
|
19351
19452
|
confirm: false,
|
|
19352
19453
|
confirmTimeoutMs: 60_000,
|
|
19353
19454
|
// burner / devnet flags
|
|
19455
|
+
network: null,
|
|
19354
19456
|
burner: false,
|
|
19355
19457
|
devnet: false,
|
|
19356
19458
|
faucet: false,
|
|
@@ -19412,7 +19514,7 @@ function parseArgs(argv) {
|
|
|
19412
19514
|
const raw = argv.slice(2);
|
|
19413
19515
|
let i = 0;
|
|
19414
19516
|
// Commands that accept subcommands
|
|
19415
|
-
const MULTI_COMMANDS = new Set(["config", "profile", "secret", "rpc", "tx", "receipts", "completion", "policy", "fixtures", "lint", "plan", "bot", "perps", "report", "demo", "verify"]);
|
|
19517
|
+
const MULTI_COMMANDS = new Set(["config", "profile", "secret", "rpc", "tx", "receipts", "completion", "policy", "fixtures", "lint", "plan", "bot", "perps", "report", "demo", "verify", "burner"]);
|
|
19416
19518
|
|
|
19417
19519
|
while (i < raw.length) {
|
|
19418
19520
|
const arg = raw[i];
|
|
@@ -19501,6 +19603,9 @@ function parseArgs(argv) {
|
|
|
19501
19603
|
} else if (arg === "--burner") {
|
|
19502
19604
|
args.burner = true;
|
|
19503
19605
|
i++;
|
|
19606
|
+
} else if (arg === "--network") {
|
|
19607
|
+
args.network = raw[++i] || null;
|
|
19608
|
+
i++;
|
|
19504
19609
|
} else if (arg === "--devnet") {
|
|
19505
19610
|
args.devnet = true;
|
|
19506
19611
|
i++;
|
|
@@ -19725,6 +19830,7 @@ async function main() {
|
|
|
19725
19830
|
case "profile":
|
|
19726
19831
|
switch (args.subCommand) {
|
|
19727
19832
|
case "use":
|
|
19833
|
+
case "select":
|
|
19728
19834
|
await runProfileUse(args);
|
|
19729
19835
|
break;
|
|
19730
19836
|
case "list":
|
|
@@ -19740,7 +19846,7 @@ async function main() {
|
|
|
19740
19846
|
await runProfileWizard(args);
|
|
19741
19847
|
break;
|
|
19742
19848
|
default:
|
|
19743
|
-
exitWithError(ERROR_CODES.USER_ERROR, `Unknown profile subcommand: ${args.subCommand || "(none)"}`, "Available: use, list, create, delete, wizard", args.format);
|
|
19849
|
+
exitWithError(ERROR_CODES.USER_ERROR, `Unknown profile subcommand: ${args.subCommand || "(none)"}`, "Available: use, select, list, create, delete, wizard", args.format);
|
|
19744
19850
|
}
|
|
19745
19851
|
break;
|
|
19746
19852
|
case "secret":
|
|
@@ -19916,6 +20022,9 @@ async function main() {
|
|
|
19916
20022
|
case "bootstrap":
|
|
19917
20023
|
await runBootstrap(args);
|
|
19918
20024
|
break;
|
|
20025
|
+
case "burner":
|
|
20026
|
+
await runBurnerCommand(args);
|
|
20027
|
+
break;
|
|
19919
20028
|
case "report":
|
|
19920
20029
|
switch (args.subCommand) {
|
|
19921
20030
|
case "savings":
|