clawup 1.0.9 → 1.0.10
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/bin.js +53 -51
- package/dist/bin.js.map +3 -3
- package/dist/commands/update.js +6 -4
- package/dist/commands/update.js.map +1 -1
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -992,8 +992,8 @@ var require_parseUtil = __commonJS({
|
|
|
992
992
|
var errors_js_1 = require_errors();
|
|
993
993
|
var en_js_1 = __importDefault(require_en());
|
|
994
994
|
var makeIssue = (params) => {
|
|
995
|
-
const { data, path:
|
|
996
|
-
const fullPath = [...
|
|
995
|
+
const { data, path: path9, errorMaps, issueData } = params;
|
|
996
|
+
const fullPath = [...path9, ...issueData.path || []];
|
|
997
997
|
const fullIssue = {
|
|
998
998
|
...issueData,
|
|
999
999
|
path: fullPath
|
|
@@ -1147,11 +1147,11 @@ var require_types2 = __commonJS({
|
|
|
1147
1147
|
var parseUtil_js_1 = require_parseUtil();
|
|
1148
1148
|
var util_js_1 = require_util();
|
|
1149
1149
|
var ParseInputLazyPath = class {
|
|
1150
|
-
constructor(parent, value,
|
|
1150
|
+
constructor(parent, value, path9, key) {
|
|
1151
1151
|
this._cachedPath = [];
|
|
1152
1152
|
this.parent = parent;
|
|
1153
1153
|
this.data = value;
|
|
1154
|
-
this._path =
|
|
1154
|
+
this._path = path9;
|
|
1155
1155
|
this._key = key;
|
|
1156
1156
|
}
|
|
1157
1157
|
get path() {
|
|
@@ -5208,7 +5208,7 @@ function capture(command, args = [], cwd) {
|
|
|
5208
5208
|
}
|
|
5209
5209
|
function stream(command, args = [], cwd) {
|
|
5210
5210
|
const resolved = resolveCommand(command);
|
|
5211
|
-
return new Promise((
|
|
5211
|
+
return new Promise((resolve3) => {
|
|
5212
5212
|
const opts = {
|
|
5213
5213
|
cwd,
|
|
5214
5214
|
stdio: "inherit",
|
|
@@ -5216,10 +5216,10 @@ function stream(command, args = [], cwd) {
|
|
|
5216
5216
|
};
|
|
5217
5217
|
const child = (0, import_child_process2.spawn)(resolved, args, opts);
|
|
5218
5218
|
trackChild(child);
|
|
5219
|
-
child.on("close", (code) =>
|
|
5219
|
+
child.on("close", (code) => resolve3(code ?? 1));
|
|
5220
5220
|
child.on("error", (err) => {
|
|
5221
5221
|
console.warn(`[exec] Child process error: ${err.message}`);
|
|
5222
|
-
|
|
5222
|
+
resolve3(1);
|
|
5223
5223
|
});
|
|
5224
5224
|
});
|
|
5225
5225
|
}
|
|
@@ -5348,8 +5348,8 @@ function isTailscaleInstalled() {
|
|
|
5348
5348
|
if (result.status === 0) return true;
|
|
5349
5349
|
if (process.platform === "darwin") {
|
|
5350
5350
|
try {
|
|
5351
|
-
const
|
|
5352
|
-
return
|
|
5351
|
+
const fs9 = require("fs");
|
|
5352
|
+
return fs9.existsSync("/Applications/Tailscale.app/Contents/MacOS/Tailscale");
|
|
5353
5353
|
} catch {
|
|
5354
5354
|
return false;
|
|
5355
5355
|
}
|
|
@@ -5508,26 +5508,26 @@ function ensureTailscaleFunnel(apiKey) {
|
|
|
5508
5508
|
}
|
|
5509
5509
|
return result;
|
|
5510
5510
|
}
|
|
5511
|
-
function tsApiGet(apiKey,
|
|
5511
|
+
function tsApiGet(apiKey, path9) {
|
|
5512
5512
|
return (0, import_child_process4.execSync)(
|
|
5513
|
-
`curl -sf -H "Authorization: Bearer ${apiKey}" -H "Accept: application/json" "https://api.tailscale.com/api/v2${
|
|
5513
|
+
`curl -sf -H "Authorization: Bearer ${apiKey}" -H "Accept: application/json" "https://api.tailscale.com/api/v2${path9}"`,
|
|
5514
5514
|
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 15e3 }
|
|
5515
5515
|
);
|
|
5516
5516
|
}
|
|
5517
|
-
function tsApiPost(apiKey,
|
|
5518
|
-
const
|
|
5517
|
+
function tsApiPost(apiKey, path9, body) {
|
|
5518
|
+
const fs9 = require("fs");
|
|
5519
5519
|
const os6 = require("os");
|
|
5520
5520
|
const nodePath = require("path");
|
|
5521
5521
|
const tmpFile = nodePath.join(os6.tmpdir(), `ts-api-${Date.now()}.json`);
|
|
5522
5522
|
try {
|
|
5523
|
-
|
|
5523
|
+
fs9.writeFileSync(tmpFile, JSON.stringify(body));
|
|
5524
5524
|
return (0, import_child_process4.execSync)(
|
|
5525
|
-
`curl -sf -X POST -H "Authorization: Bearer ${apiKey}" -H "Content-Type: application/json" -d @${tmpFile} "https://api.tailscale.com/api/v2${
|
|
5525
|
+
`curl -sf -X POST -H "Authorization: Bearer ${apiKey}" -H "Content-Type: application/json" -d @${tmpFile} "https://api.tailscale.com/api/v2${path9}"`,
|
|
5526
5526
|
{ encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"], timeout: 15e3 }
|
|
5527
5527
|
);
|
|
5528
5528
|
} finally {
|
|
5529
5529
|
try {
|
|
5530
|
-
|
|
5530
|
+
fs9.unlinkSync(tmpFile);
|
|
5531
5531
|
} catch {
|
|
5532
5532
|
}
|
|
5533
5533
|
}
|
|
@@ -7022,7 +7022,7 @@ var init_cli_adapter = __esm({
|
|
|
7022
7022
|
}
|
|
7023
7023
|
stream(command, args = [], options) {
|
|
7024
7024
|
const resolved = resolveCommand(command);
|
|
7025
|
-
return new Promise((
|
|
7025
|
+
return new Promise((resolve3) => {
|
|
7026
7026
|
const opts = {
|
|
7027
7027
|
cwd: options?.cwd,
|
|
7028
7028
|
stdio: options?.capture ? "pipe" : "inherit",
|
|
@@ -7030,10 +7030,10 @@ var init_cli_adapter = __esm({
|
|
|
7030
7030
|
};
|
|
7031
7031
|
const child = (0, import_child_process6.spawn)(resolved, args, opts);
|
|
7032
7032
|
trackChild(child);
|
|
7033
|
-
child.on("close", (code) =>
|
|
7033
|
+
child.on("close", (code) => resolve3(code ?? 1));
|
|
7034
7034
|
child.on("error", (err) => {
|
|
7035
7035
|
console.warn(`[exec] Child process error: ${err.message}`);
|
|
7036
|
-
|
|
7036
|
+
resolve3(1);
|
|
7037
7037
|
});
|
|
7038
7038
|
});
|
|
7039
7039
|
}
|
|
@@ -7185,8 +7185,8 @@ var init_deploy2 = __esm({
|
|
|
7185
7185
|
});
|
|
7186
7186
|
|
|
7187
7187
|
// bin.ts
|
|
7188
|
-
var
|
|
7189
|
-
var
|
|
7188
|
+
var fs8 = __toESM(require("fs"));
|
|
7189
|
+
var path8 = __toESM(require("path"));
|
|
7190
7190
|
var import_commander = require("commander");
|
|
7191
7191
|
init_process();
|
|
7192
7192
|
|
|
@@ -8028,12 +8028,14 @@ ${data.length} config(s) found`);
|
|
|
8028
8028
|
var p6 = __toESM(require("@clack/prompts"));
|
|
8029
8029
|
var import_picocolors9 = __toESM(require("picocolors"));
|
|
8030
8030
|
init_exec();
|
|
8031
|
+
var fs5 = __toESM(require("fs"));
|
|
8032
|
+
var path6 = __toESM(require("path"));
|
|
8031
8033
|
async function updateCommand(_opts) {
|
|
8032
8034
|
p6.intro(import_picocolors9.default.bgCyan(import_picocolors9.default.black(" Agent Army \u2014 Update ")));
|
|
8033
8035
|
const s = p6.spinner();
|
|
8034
8036
|
s.start("Checking npm for latest version\u2026");
|
|
8035
8037
|
const { default: https2 } = await import("https");
|
|
8036
|
-
const latest = await new Promise((
|
|
8038
|
+
const latest = await new Promise((resolve3) => {
|
|
8037
8039
|
const req = https2.get(
|
|
8038
8040
|
"https://registry.npmjs.org/clawup/latest",
|
|
8039
8041
|
{ timeout: 5e3 },
|
|
@@ -8042,28 +8044,28 @@ async function updateCommand(_opts) {
|
|
|
8042
8044
|
res.on("data", (chunk) => data += chunk);
|
|
8043
8045
|
res.on("end", () => {
|
|
8044
8046
|
try {
|
|
8045
|
-
|
|
8047
|
+
resolve3(JSON.parse(data).version ?? null);
|
|
8046
8048
|
} catch {
|
|
8047
|
-
|
|
8049
|
+
resolve3(null);
|
|
8048
8050
|
}
|
|
8049
8051
|
});
|
|
8050
8052
|
}
|
|
8051
8053
|
);
|
|
8052
8054
|
req.on("timeout", () => {
|
|
8053
8055
|
req.destroy();
|
|
8054
|
-
|
|
8056
|
+
resolve3(null);
|
|
8055
8057
|
});
|
|
8056
|
-
req.on("error", () =>
|
|
8058
|
+
req.on("error", () => resolve3(null));
|
|
8057
8059
|
});
|
|
8058
8060
|
if (!latest) {
|
|
8059
8061
|
s.stop("Failed to reach npm registry");
|
|
8060
8062
|
p6.log.error("Could not check for updates. Check your internet connection.");
|
|
8061
8063
|
process.exit(1);
|
|
8062
8064
|
}
|
|
8063
|
-
const
|
|
8064
|
-
const
|
|
8065
|
+
const oneUp = path6.resolve(__dirname, "..");
|
|
8066
|
+
const pkgRoot = fs5.existsSync(path6.join(oneUp, "package.json")) ? oneUp : path6.resolve(__dirname, "..", "..");
|
|
8065
8067
|
const pkgJson2 = JSON.parse(
|
|
8066
|
-
|
|
8068
|
+
fs5.readFileSync(path6.join(pkgRoot, "package.json"), "utf-8")
|
|
8067
8069
|
);
|
|
8068
8070
|
const current = pkgJson2.version;
|
|
8069
8071
|
s.stop(`Current: ${import_picocolors9.default.dim(current)} Latest: ${import_picocolors9.default.green(latest)}`);
|
|
@@ -8113,7 +8115,7 @@ async function updateCommand(_opts) {
|
|
|
8113
8115
|
// commands/config.ts
|
|
8114
8116
|
var process2 = __toESM(require("process"));
|
|
8115
8117
|
var import_yaml2 = __toESM(require("yaml"));
|
|
8116
|
-
var
|
|
8118
|
+
var fs6 = __toESM(require("fs"));
|
|
8117
8119
|
init_config();
|
|
8118
8120
|
var import_core11 = __toESM(require_dist());
|
|
8119
8121
|
var import_picocolors10 = __toESM(require("picocolors"));
|
|
@@ -8323,11 +8325,11 @@ async function configMigrateCommand(opts) {
|
|
|
8323
8325
|
process2.exit(1);
|
|
8324
8326
|
}
|
|
8325
8327
|
const pDir = pluginsDir(configName);
|
|
8326
|
-
if (!
|
|
8328
|
+
if (!fs6.existsSync(pDir)) {
|
|
8327
8329
|
console.log(import_picocolors10.default.green("No plugin config files found \u2014 nothing to migrate."));
|
|
8328
8330
|
return;
|
|
8329
8331
|
}
|
|
8330
|
-
const pluginFiles =
|
|
8332
|
+
const pluginFiles = fs6.readdirSync(pDir).filter((f) => f.endsWith(".yaml"));
|
|
8331
8333
|
if (pluginFiles.length === 0) {
|
|
8332
8334
|
console.log(import_picocolors10.default.green("No plugin config files found \u2014 nothing to migrate."));
|
|
8333
8335
|
return;
|
|
@@ -8347,17 +8349,17 @@ async function configMigrateCommand(opts) {
|
|
|
8347
8349
|
}
|
|
8348
8350
|
}
|
|
8349
8351
|
const filePath = `${pDir}/${file}`;
|
|
8350
|
-
|
|
8352
|
+
fs6.unlinkSync(filePath);
|
|
8351
8353
|
console.log(import_picocolors10.default.dim(` Removed ${filePath}`));
|
|
8352
8354
|
}
|
|
8353
8355
|
try {
|
|
8354
|
-
const remaining =
|
|
8356
|
+
const remaining = fs6.readdirSync(pDir);
|
|
8355
8357
|
if (remaining.length === 0) {
|
|
8356
|
-
|
|
8358
|
+
fs6.rmdirSync(pDir);
|
|
8357
8359
|
const stackDir = `${pDir}/..`;
|
|
8358
|
-
const stackRemaining =
|
|
8360
|
+
const stackRemaining = fs6.readdirSync(stackDir);
|
|
8359
8361
|
if (stackRemaining.length === 0) {
|
|
8360
|
-
|
|
8362
|
+
fs6.rmdirSync(stackDir);
|
|
8361
8363
|
}
|
|
8362
8364
|
}
|
|
8363
8365
|
} catch {
|
|
@@ -8493,8 +8495,8 @@ async function webhooksSetupCommand(opts) {
|
|
|
8493
8495
|
|
|
8494
8496
|
// lib/update-check.ts
|
|
8495
8497
|
var https = __toESM(require("https"));
|
|
8496
|
-
var
|
|
8497
|
-
var
|
|
8498
|
+
var fs7 = __toESM(require("fs"));
|
|
8499
|
+
var path7 = __toESM(require("path"));
|
|
8498
8500
|
var os5 = __toESM(require("os"));
|
|
8499
8501
|
var import_picocolors12 = __toESM(require("picocolors"));
|
|
8500
8502
|
var PACKAGE_NAME = "clawup";
|
|
@@ -8502,14 +8504,14 @@ var CACHE_FILE = ".update-check.json";
|
|
|
8502
8504
|
var CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
8503
8505
|
var FETCH_TIMEOUT_MS = 3e3;
|
|
8504
8506
|
function getCacheDir() {
|
|
8505
|
-
return
|
|
8507
|
+
return path7.join(os5.homedir(), ".clawup");
|
|
8506
8508
|
}
|
|
8507
8509
|
function getCachePath() {
|
|
8508
|
-
return
|
|
8510
|
+
return path7.join(getCacheDir(), CACHE_FILE);
|
|
8509
8511
|
}
|
|
8510
8512
|
function loadCache() {
|
|
8511
8513
|
try {
|
|
8512
|
-
const raw =
|
|
8514
|
+
const raw = fs7.readFileSync(getCachePath(), "utf-8");
|
|
8513
8515
|
return JSON.parse(raw);
|
|
8514
8516
|
} catch {
|
|
8515
8517
|
return null;
|
|
@@ -8517,10 +8519,10 @@ function loadCache() {
|
|
|
8517
8519
|
}
|
|
8518
8520
|
function saveCache(cache) {
|
|
8519
8521
|
const dir = getCacheDir();
|
|
8520
|
-
if (!
|
|
8521
|
-
|
|
8522
|
+
if (!fs7.existsSync(dir)) {
|
|
8523
|
+
fs7.mkdirSync(dir, { recursive: true });
|
|
8522
8524
|
}
|
|
8523
|
-
|
|
8525
|
+
fs7.writeFileSync(getCachePath(), JSON.stringify(cache), "utf-8");
|
|
8524
8526
|
}
|
|
8525
8527
|
function compareSemver(a, b) {
|
|
8526
8528
|
const pa = a.split(".").map(Number);
|
|
@@ -8534,7 +8536,7 @@ function compareSemver(a, b) {
|
|
|
8534
8536
|
return 0;
|
|
8535
8537
|
}
|
|
8536
8538
|
function fetchLatestVersion() {
|
|
8537
|
-
return new Promise((
|
|
8539
|
+
return new Promise((resolve3) => {
|
|
8538
8540
|
const req = https.get(
|
|
8539
8541
|
`https://registry.npmjs.org/${PACKAGE_NAME}/latest`,
|
|
8540
8542
|
{ timeout: FETCH_TIMEOUT_MS },
|
|
@@ -8544,18 +8546,18 @@ function fetchLatestVersion() {
|
|
|
8544
8546
|
res.on("end", () => {
|
|
8545
8547
|
try {
|
|
8546
8548
|
const json = JSON.parse(data);
|
|
8547
|
-
|
|
8549
|
+
resolve3(json.version ?? null);
|
|
8548
8550
|
} catch {
|
|
8549
|
-
|
|
8551
|
+
resolve3(null);
|
|
8550
8552
|
}
|
|
8551
8553
|
});
|
|
8552
8554
|
}
|
|
8553
8555
|
);
|
|
8554
8556
|
req.on("timeout", () => {
|
|
8555
8557
|
req.destroy();
|
|
8556
|
-
|
|
8558
|
+
resolve3(null);
|
|
8557
8559
|
});
|
|
8558
|
-
req.on("error", () =>
|
|
8560
|
+
req.on("error", () => resolve3(null));
|
|
8559
8561
|
});
|
|
8560
8562
|
}
|
|
8561
8563
|
async function checkForUpdates(currentVersion) {
|
|
@@ -8591,7 +8593,7 @@ function printUpdateNotice(current, latest) {
|
|
|
8591
8593
|
|
|
8592
8594
|
// bin.ts
|
|
8593
8595
|
setupGracefulShutdown();
|
|
8594
|
-
var pkgJson = JSON.parse(
|
|
8596
|
+
var pkgJson = JSON.parse(fs8.readFileSync(path8.join(__dirname, "..", "package.json"), "utf-8"));
|
|
8595
8597
|
var program = new import_commander.Command();
|
|
8596
8598
|
program.name("clawup").description("Deploy and manage a fleet of OpenClaw AI agents on AWS").version(pkgJson.version);
|
|
8597
8599
|
program.command("init").description("Interactive setup wizard \u2014 configure stack, secrets, and agents").option("--deploy", "Deploy immediately after init").option("-y, --yes", "Skip confirmation prompt (for deploy)").action(async (opts) => {
|