@bountyagents/bountyagents-task 2026.3.118 → 2026.3.120
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 +28 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55895,6 +55895,12 @@ function registerWorkerTools(api3) {
|
|
|
55895
55895
|
// index.ts
|
|
55896
55896
|
import * as fs2 from "fs";
|
|
55897
55897
|
import * as readline from "readline";
|
|
55898
|
+
var cli = {
|
|
55899
|
+
red: (s) => `\x1B[31m${s}\x1B[0m`,
|
|
55900
|
+
green: (s) => `\x1B[32m${s}\x1B[0m`,
|
|
55901
|
+
dim: (s) => `\x1B[2m${s}\x1B[0m`,
|
|
55902
|
+
dot: (color) => color === "red" ? cli.red("●") : cli.green("●")
|
|
55903
|
+
};
|
|
55898
55904
|
function question(prompt) {
|
|
55899
55905
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
|
|
55900
55906
|
return new Promise((resolve) => {
|
|
@@ -55922,30 +55928,34 @@ function register(api3) {
|
|
|
55922
55928
|
if (action === "status") {
|
|
55923
55929
|
const address = getWalletAddress();
|
|
55924
55930
|
if (!address) {
|
|
55925
|
-
console.log("
|
|
55931
|
+
console.log(` ${cli.dot("red")} ${cli.red("Wallet not initialized")}`);
|
|
55932
|
+
console.log(cli.dim(" Run openclaw upclaw init to initialize"));
|
|
55926
55933
|
return;
|
|
55927
55934
|
}
|
|
55928
|
-
console.log("
|
|
55929
|
-
console.log("
|
|
55935
|
+
console.log(` ${cli.dot("green")} ${cli.green("Wallet initialized")}`);
|
|
55936
|
+
console.log(cli.dim(" Address: ") + address);
|
|
55930
55937
|
return;
|
|
55931
55938
|
}
|
|
55932
55939
|
if (action === "init") {
|
|
55933
55940
|
try {
|
|
55934
55941
|
if (fs2.existsSync(KEY_PATH)) {
|
|
55935
|
-
console.log(`
|
|
55942
|
+
console.log(` ${cli.dot("red")} ${cli.red("Key already exists")}`);
|
|
55943
|
+
console.log(cli.dim(` ${KEY_PATH}`));
|
|
55944
|
+
console.log(cli.dim(" Run openclaw upclaw reset first to use a different key."));
|
|
55936
55945
|
return;
|
|
55937
55946
|
}
|
|
55938
55947
|
console.log("");
|
|
55939
|
-
console.log(" 1) Generate a new random private key");
|
|
55940
|
-
console.log(" 2) Enter an existing private key to store");
|
|
55948
|
+
console.log(cli.dim(" 1) Generate a new random private key"));
|
|
55949
|
+
console.log(cli.dim(" 2) Enter an existing private key to store"));
|
|
55941
55950
|
console.log("");
|
|
55942
55951
|
const choice = await question("Choose 1 or 2: ");
|
|
55943
55952
|
if (choice === "1") {
|
|
55944
55953
|
const pk = generatePrivateKey();
|
|
55945
55954
|
fs2.writeFileSync(KEY_PATH, pk, "utf-8");
|
|
55946
55955
|
const address = privateKeyToAccount(pk).address;
|
|
55947
|
-
console.log(`
|
|
55948
|
-
console.log(
|
|
55956
|
+
console.log(` ${cli.dot("green")} ${cli.green("New key generated and saved")}`);
|
|
55957
|
+
console.log(cli.dim(` Path: ${KEY_PATH}`));
|
|
55958
|
+
console.log(cli.dim(` Address: ${address}`));
|
|
55949
55959
|
return;
|
|
55950
55960
|
}
|
|
55951
55961
|
if (choice === "2") {
|
|
@@ -55954,13 +55964,14 @@ function register(api3) {
|
|
|
55954
55964
|
privateKeyToAccount(key);
|
|
55955
55965
|
fs2.writeFileSync(KEY_PATH, key, "utf-8");
|
|
55956
55966
|
const address = privateKeyToAccount(key).address;
|
|
55957
|
-
console.log(`
|
|
55958
|
-
console.log(
|
|
55967
|
+
console.log(` ${cli.dot("green")} ${cli.green("Existing key stored")}`);
|
|
55968
|
+
console.log(cli.dim(` Path: ${KEY_PATH}`));
|
|
55969
|
+
console.log(cli.dim(` Address: ${address}`));
|
|
55959
55970
|
return;
|
|
55960
55971
|
}
|
|
55961
|
-
console.
|
|
55972
|
+
console.log(` ${cli.dot("red")} ${cli.red("Invalid choice. Enter 1 or 2.")}`);
|
|
55962
55973
|
} catch (error48) {
|
|
55963
|
-
console.
|
|
55974
|
+
console.log(` ${cli.dot("red")} ${cli.red("Failed to initialize key: " + error48.message)}`);
|
|
55964
55975
|
return;
|
|
55965
55976
|
}
|
|
55966
55977
|
}
|
|
@@ -55968,11 +55979,14 @@ function register(api3) {
|
|
|
55968
55979
|
try {
|
|
55969
55980
|
if (fs2.existsSync(KEY_PATH)) {
|
|
55970
55981
|
fs2.unlinkSync(KEY_PATH);
|
|
55971
|
-
console.log(`
|
|
55982
|
+
console.log(` ${cli.dot("green")} ${cli.green("Key removed")}`);
|
|
55983
|
+
console.log(cli.dim(` Deleted ${KEY_PATH}`));
|
|
55972
55984
|
return;
|
|
55973
55985
|
}
|
|
55986
|
+
console.log(` ${cli.dot("red")} ${cli.red("No key file found")}`);
|
|
55987
|
+
console.log(cli.dim(` ${KEY_PATH}`));
|
|
55974
55988
|
} catch (error48) {
|
|
55975
|
-
console.
|
|
55989
|
+
console.log(` ${cli.dot("red")} ${cli.red("Failed to reset key: " + error48.message)}`);
|
|
55976
55990
|
return;
|
|
55977
55991
|
}
|
|
55978
55992
|
}
|