@clawtrail/init 1.2.0 → 1.2.2
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 +3 -35
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -11,7 +11,6 @@ import os from "os";
|
|
|
11
11
|
import { fileURLToPath } from "url";
|
|
12
12
|
import fetch from "node-fetch";
|
|
13
13
|
import JSON5 from "json5";
|
|
14
|
-
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts";
|
|
15
14
|
var __filename = fileURLToPath(import.meta.url);
|
|
16
15
|
var __dirname = path.dirname(__filename);
|
|
17
16
|
var SKILL_FILES = {
|
|
@@ -133,7 +132,7 @@ async function detectOpenClaw() {
|
|
|
133
132
|
return false;
|
|
134
133
|
}
|
|
135
134
|
}
|
|
136
|
-
async function configureOpenClaw(apiKey, staging
|
|
135
|
+
async function configureOpenClaw(apiKey, staging) {
|
|
137
136
|
const openClawDir = path.join(os.homedir(), ".openclaw");
|
|
138
137
|
const configPath = path.join(openClawDir, "openclaw.json");
|
|
139
138
|
const apiUrl = staging ? "https://sapi.clawtrail.ai/ct" : "https://api.clawtrail.ai/ct";
|
|
@@ -150,8 +149,7 @@ async function configureOpenClaw(apiKey, staging, privateKey) {
|
|
|
150
149
|
enabled: true,
|
|
151
150
|
config: {
|
|
152
151
|
apiKey,
|
|
153
|
-
apiUrl
|
|
154
|
-
...privateKey && { walletPrivateKey: privateKey }
|
|
152
|
+
apiUrl
|
|
155
153
|
}
|
|
156
154
|
};
|
|
157
155
|
await fs.writeFile(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
@@ -205,35 +203,6 @@ async function main() {
|
|
|
205
203
|
}
|
|
206
204
|
]);
|
|
207
205
|
if (shouldRegister) {
|
|
208
|
-
const { walletChoice } = await inquirer.prompt([{
|
|
209
|
-
type: "list",
|
|
210
|
-
name: "walletChoice",
|
|
211
|
-
message: "Ethereum wallet for DKG identity:",
|
|
212
|
-
choices: [
|
|
213
|
-
{ name: "Enter my existing wallet address", value: "existing" },
|
|
214
|
-
{ name: "Generate a new wallet for me", value: "generate" }
|
|
215
|
-
],
|
|
216
|
-
default: "existing"
|
|
217
|
-
}]);
|
|
218
|
-
let walletAddress;
|
|
219
|
-
let generatedPrivateKey = null;
|
|
220
|
-
if (walletChoice === "generate") {
|
|
221
|
-
const walletSpinner = ora("Generating Ethereum wallet...").start();
|
|
222
|
-
const privateKey = generatePrivateKey();
|
|
223
|
-
const account = privateKeyToAccount(privateKey);
|
|
224
|
-
walletAddress = account.address;
|
|
225
|
-
generatedPrivateKey = privateKey;
|
|
226
|
-
walletSpinner.succeed(chalk.green(`\u2713 Generated wallet: ${chalk.cyan(walletAddress)}`));
|
|
227
|
-
console.log(chalk.yellow(" \u26A0 Private key will be saved to ~/.openclaw/openclaw.json\n"));
|
|
228
|
-
} else {
|
|
229
|
-
const { wallet } = await inquirer.prompt([{
|
|
230
|
-
type: "input",
|
|
231
|
-
name: "wallet",
|
|
232
|
-
message: "Wallet address (0x...):",
|
|
233
|
-
validate: (input) => input.startsWith("0x") && input.length === 42 ? true : "Valid Ethereum address required"
|
|
234
|
-
}]);
|
|
235
|
-
walletAddress = wallet;
|
|
236
|
-
}
|
|
237
206
|
const answers = await inquirer.prompt([
|
|
238
207
|
{
|
|
239
208
|
type: "input",
|
|
@@ -276,7 +245,6 @@ async function main() {
|
|
|
276
245
|
{
|
|
277
246
|
name: answers.name,
|
|
278
247
|
description: answers.description,
|
|
279
|
-
wallet: walletAddress,
|
|
280
248
|
bio: answers.bio || void 0,
|
|
281
249
|
agentType: answers.agentType,
|
|
282
250
|
framework: answers.framework || void 0,
|
|
@@ -311,7 +279,7 @@ async function main() {
|
|
|
311
279
|
]);
|
|
312
280
|
if (configureOC) {
|
|
313
281
|
try {
|
|
314
|
-
await configureOpenClaw(apiKey, staging
|
|
282
|
+
await configureOpenClaw(apiKey, staging);
|
|
315
283
|
await copyToOpenClawSkills(targetDir);
|
|
316
284
|
} catch (ocErr) {
|
|
317
285
|
console.log(chalk.yellow(`\u26A0 OpenClaw config failed: ${ocErr.message}`));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clawtrail/init",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2",
|
|
4
4
|
"description": "CLI installer for ClawTrail AI agent skill files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"chalk": "^5.3.0",
|
|
28
28
|
"ora": "^8.0.1",
|
|
29
29
|
"node-fetch": "^3.3.2",
|
|
30
|
-
"json5": "^2.2.3"
|
|
31
|
-
"viem": "^2.0.0"
|
|
30
|
+
"json5": "^2.2.3"
|
|
32
31
|
},
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@types/inquirer": "^9.0.7",
|