closeclaw 3.0.10 → 3.0.11
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/cli.cjs +71 -2
- package/dist/cli.jsc +0 -0
- package/dist/index.jsc +0 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -7953,7 +7953,7 @@ function saveLicenseKey(key) {
|
|
|
7953
7953
|
}
|
|
7954
7954
|
async function commandOnboard() {
|
|
7955
7955
|
const version = readPkgVersion();
|
|
7956
|
-
const TOTAL_STEPS =
|
|
7956
|
+
const TOTAL_STEPS = 8;
|
|
7957
7957
|
console.log("");
|
|
7958
7958
|
console.log(` ${c.cyan}${c.bold}\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557${c.reset}`);
|
|
7959
7959
|
console.log(` ${c.cyan}${c.bold}\u2551 CloseClaw \u2014 Setup Wizard \u2551${c.reset}`);
|
|
@@ -8113,7 +8113,68 @@ async function commandOnboard() {
|
|
|
8113
8113
|
result(SKIP, "OpenClaw not installed (AI features will be disabled)");
|
|
8114
8114
|
result(INFO, `Install: ${c.dim}npm install -g openclaw && openclaw onboard${c.reset}`);
|
|
8115
8115
|
}
|
|
8116
|
-
step(7, TOTAL_STEPS, "
|
|
8116
|
+
step(7, TOTAL_STEPS, "GitHub Integration (optional)");
|
|
8117
|
+
const configPath = (0, import_node_path6.join)(CONFIG_DIR, "config.json");
|
|
8118
|
+
let config = {};
|
|
8119
|
+
try {
|
|
8120
|
+
config = JSON.parse((0, import_node_fs7.readFileSync)(configPath, "utf-8"));
|
|
8121
|
+
} catch {
|
|
8122
|
+
}
|
|
8123
|
+
if (config.github?.appId) {
|
|
8124
|
+
result(PASS, `GitHub App configured (ID: ${config.github.appId})`);
|
|
8125
|
+
if (config.github.webhookSecret) result(PASS, "Webhook secret set");
|
|
8126
|
+
if (config.github.installationId) result(INFO, `Installation: ${config.github.installationId}`);
|
|
8127
|
+
} else {
|
|
8128
|
+
const setupGithub = await ask(` Set up GitHub App integration? ${c.dim}(y/N)${c.reset} `);
|
|
8129
|
+
if (setupGithub.toLowerCase() === "y" || setupGithub.toLowerCase() === "yes") {
|
|
8130
|
+
console.log("");
|
|
8131
|
+
console.log(` ${c.dim}Create a GitHub App at: https://github.com/settings/apps${c.reset}`);
|
|
8132
|
+
console.log(` ${c.dim}Permissions needed: Contents (R/W), Pull requests (R/W), Checks (R), Deployments (R)${c.reset}`);
|
|
8133
|
+
console.log(` ${c.dim}Webhook URL: https://yourdomain.com/api/github/webhook${c.reset}`);
|
|
8134
|
+
console.log("");
|
|
8135
|
+
const appId = await ask(` GitHub App ID: `);
|
|
8136
|
+
if (appId) {
|
|
8137
|
+
config.github = config.github || {};
|
|
8138
|
+
config.github.appId = appId;
|
|
8139
|
+
const installationId = await ask(` Installation ID: `);
|
|
8140
|
+
if (installationId) config.github.installationId = installationId;
|
|
8141
|
+
const { randomBytes: randomBytes2 } = await import("crypto");
|
|
8142
|
+
const secret = randomBytes2(32).toString("hex");
|
|
8143
|
+
config.github.webhookSecret = secret;
|
|
8144
|
+
result(PASS, `Webhook secret generated: ${c.dim}${secret.substring(0, 16)}...${c.reset}`);
|
|
8145
|
+
result(INFO, `${c.yellow}Copy this secret to your GitHub App's webhook settings${c.reset}`);
|
|
8146
|
+
console.log("");
|
|
8147
|
+
console.log(` ${c.dim}Download your GitHub App private key (.pem file)${c.reset}`);
|
|
8148
|
+
const keyPath = await ask(` Path to private key file (.pem): `);
|
|
8149
|
+
if (keyPath) {
|
|
8150
|
+
const resolved = keyPath.replace(/^~/, HOME).trim();
|
|
8151
|
+
if ((0, import_node_fs7.existsSync)(resolved)) {
|
|
8152
|
+
const destPath = (0, import_node_path6.join)(DATA_DIR, "github-app.pem");
|
|
8153
|
+
const keyContent = (0, import_node_fs7.readFileSync)(resolved);
|
|
8154
|
+
(0, import_node_fs7.writeFileSync)(destPath, keyContent, { mode: 384 });
|
|
8155
|
+
config.github.privateKeyPath = destPath;
|
|
8156
|
+
result(PASS, `Private key saved to ${c.dim}${destPath}${c.reset}`);
|
|
8157
|
+
} else {
|
|
8158
|
+
result(FAIL, `File not found: ${resolved}`);
|
|
8159
|
+
result(INFO, "You can set this later in ~/.closeclaw/config.json");
|
|
8160
|
+
}
|
|
8161
|
+
}
|
|
8162
|
+
(0, import_node_fs7.mkdirSync)(CONFIG_DIR, { recursive: true });
|
|
8163
|
+
(0, import_node_fs7.writeFileSync)(configPath, JSON.stringify(config, null, 2));
|
|
8164
|
+
result(PASS, "GitHub configuration saved");
|
|
8165
|
+
process.env.GITHUB_APP_ID = config.github.appId;
|
|
8166
|
+
process.env.GITHUB_WEBHOOK_SECRET = config.github.webhookSecret;
|
|
8167
|
+
if (config.github.privateKeyPath) process.env.GITHUB_PRIVATE_KEY_PATH = config.github.privateKeyPath;
|
|
8168
|
+
if (config.github.installationId) process.env.GITHUB_INSTALLATION_ID = config.github.installationId;
|
|
8169
|
+
} else {
|
|
8170
|
+
result(SKIP, "Skipped \u2014 you can set this up later in ~/.closeclaw/config.json");
|
|
8171
|
+
}
|
|
8172
|
+
} else {
|
|
8173
|
+
result(SKIP, "Skipped \u2014 GitHub features disabled");
|
|
8174
|
+
result(INFO, `Enable later: ${c.dim}closeclaw onboard${c.reset} or edit ${c.dim}~/.closeclaw/config.json${c.reset}`);
|
|
8175
|
+
}
|
|
8176
|
+
}
|
|
8177
|
+
step(8, TOTAL_STEPS, "Ready!");
|
|
8117
8178
|
console.log("");
|
|
8118
8179
|
console.log(` ${c.green}${c.bold}Setup complete.${c.reset} Start the server with:`);
|
|
8119
8180
|
console.log("");
|
|
@@ -8156,6 +8217,14 @@ async function commandStart(args) {
|
|
|
8156
8217
|
if (licenseKey) process.env.PLATFORM_LICENSE_KEY = licenseKey;
|
|
8157
8218
|
process.env.PLATFORM_DATA_DIR = dataDir;
|
|
8158
8219
|
if (domain) process.env.PLATFORM_DOMAIN = domain;
|
|
8220
|
+
try {
|
|
8221
|
+
const cfg = JSON.parse((0, import_node_fs7.readFileSync)((0, import_node_path6.join)(CONFIG_DIR, "config.json"), "utf-8"));
|
|
8222
|
+
if (cfg.github?.appId) process.env.GITHUB_APP_ID = process.env.GITHUB_APP_ID || cfg.github.appId;
|
|
8223
|
+
if (cfg.github?.privateKeyPath) process.env.GITHUB_PRIVATE_KEY_PATH = process.env.GITHUB_PRIVATE_KEY_PATH || cfg.github.privateKeyPath;
|
|
8224
|
+
if (cfg.github?.webhookSecret) process.env.GITHUB_WEBHOOK_SECRET = process.env.GITHUB_WEBHOOK_SECRET || cfg.github.webhookSecret;
|
|
8225
|
+
if (cfg.github?.installationId) process.env.GITHUB_INSTALLATION_ID = process.env.GITHUB_INSTALLATION_ID || cfg.github.installationId;
|
|
8226
|
+
} catch {
|
|
8227
|
+
}
|
|
8159
8228
|
if (!(0, import_node_fs7.existsSync)(dataDir) || !(0, import_node_fs7.existsSync)((0, import_node_path6.join)(dataDir, "jwt.secret"))) {
|
|
8160
8229
|
console.log(`
|
|
8161
8230
|
${c.yellow}Not onboarded yet.${c.reset} Run ${c.cyan}closeclaw onboard${c.reset} first.
|
package/dist/cli.jsc
CHANGED
|
Binary file
|
package/dist/index.jsc
CHANGED
|
Binary file
|