@agentvault/agentvault 0.19.63 → 0.19.65

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.js CHANGED
@@ -5,16 +5,10 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
9
- get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
10
- }) : x2)(function(x2) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x2 + '" is not supported');
13
- });
14
8
  var __esm = (fn, res) => function __init() {
15
9
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
10
  };
17
- var __commonJS = (cb, mod4) => function __require2() {
11
+ var __commonJS = (cb, mod4) => function __require() {
18
12
  return mod4 || (0, cb[__getOwnPropNames(cb)[0]])((mod4 = { exports: {} }).exports, mod4), mod4.exports;
19
13
  };
20
14
  var __export = (target, all) => {
@@ -67515,25 +67509,6 @@ ${messageText}`;
67515
67509
  }
67516
67510
  });
67517
67511
 
67518
- // src/_cp.ts
67519
- function load() {
67520
- if (!_cp) _cp = __require(`node:${_mod}`);
67521
- return _cp;
67522
- }
67523
- function execSync(command, options) {
67524
- return load().execSync(command, options);
67525
- }
67526
- function spawnSync(command, args2, options) {
67527
- return load().spawnSync(command, args2, options);
67528
- }
67529
- var _mod, _cp;
67530
- var init_cp = __esm({
67531
- "src/_cp.ts"() {
67532
- "use strict";
67533
- _mod = ["child", "process"].join("_");
67534
- }
67535
- });
67536
-
67537
67512
  // src/types.ts
67538
67513
  var init_types = __esm({
67539
67514
  "src/types.ts"() {
@@ -88296,6 +88271,7 @@ __export(doctor_exports, {
88296
88271
  runDoctorCommand: () => runDoctorCommand,
88297
88272
  validatePlist: () => validatePlist
88298
88273
  });
88274
+ import { execSync } from "node:child_process";
88299
88275
  import { existsSync, readFileSync as readFileSync2, writeFileSync, chmodSync } from "node:fs";
88300
88276
  import { join as join5 } from "node:path";
88301
88277
  import { createInterface } from "node:readline";
@@ -88651,7 +88627,6 @@ var PLIST_FILENAME, WRAPPER_SCRIPT_NAME;
88651
88627
  var init_doctor = __esm({
88652
88628
  async "src/doctor.ts"() {
88653
88629
  "use strict";
88654
- init_cp();
88655
88630
  await init_create_agent();
88656
88631
  PLIST_FILENAME = "ai.openclaw.gateway.plist";
88657
88632
  WRAPPER_SCRIPT_NAME = "start-gateway.sh";
@@ -88667,6 +88642,7 @@ __export(create_agent_exports, {
88667
88642
  readOpenClawConfig: () => readOpenClawConfig,
88668
88643
  runCreateCommand: () => runCreateCommand
88669
88644
  });
88645
+ import { execSync as execSync2 } from "node:child_process";
88670
88646
  import { existsSync as existsSync2, mkdirSync, readFileSync as readFileSync3, writeFileSync as writeFileSync2, copyFileSync } from "node:fs";
88671
88647
  import { join as join6 } from "node:path";
88672
88648
  function openclawHome() {
@@ -88773,9 +88749,12 @@ async function runCreateCommand(options) {
88773
88749
  ].join(":");
88774
88750
  const env = { ...process.env, PATH: `${extraPaths}:${process.env.PATH ?? ""}` };
88775
88751
  try {
88776
- execSync("openclaw --version", { stdio: "pipe", env });
88777
- } catch {
88778
- console.error(" Error: 'openclaw' not found in PATH. Is OpenClaw installed?");
88752
+ const result = execSync2("openclaw --version", { stdio: "pipe", env });
88753
+ console.log(` OpenClaw found: ${result?.toString().trim()}`);
88754
+ } catch (err) {
88755
+ console.error(` Error: 'openclaw' not found in PATH. Is OpenClaw installed?`);
88756
+ console.error(` Debug \u2014 PATH includes: ${env.PATH?.split(":").filter((p2) => p2.includes("local")).join(", ")}`);
88757
+ console.error(` Debug \u2014 error: ${err?.message?.slice(0, 200)}`);
88779
88758
  process.exit(1);
88780
88759
  }
88781
88760
  if (!existsSync2(configPath)) {
@@ -88801,7 +88780,7 @@ async function runCreateCommand(options) {
88801
88780
  }
88802
88781
  console.log(" Step 3/7 \u2014 Creating agent with OpenClaw...");
88803
88782
  try {
88804
- execSync(`openclaw agents add -- ${name2}`, { stdio: "pipe", env });
88783
+ execSync2(`openclaw agents add -- ${name2}`, { stdio: "pipe", env });
88805
88784
  console.log(` Agent '${name2}' created.
88806
88785
  `);
88807
88786
  } catch {
@@ -88955,7 +88934,6 @@ async function runCreateCommand(options) {
88955
88934
  var init_create_agent = __esm({
88956
88935
  async "src/create-agent.ts"() {
88957
88936
  "use strict";
88958
- init_cp();
88959
88937
  await init_setup();
88960
88938
  }
88961
88939
  });
@@ -88967,6 +88945,7 @@ __export(setup_exports, {
88967
88945
  installPlugin: () => installPlugin,
88968
88946
  runSetupCommand: () => runSetupCommand
88969
88947
  });
88948
+ import { execSync as execSync3, spawnSync } from "node:child_process";
88970
88949
  import * as readline from "node:readline";
88971
88950
  import { resolve } from "node:path";
88972
88951
  async function runSetupCommand(options) {
@@ -89130,7 +89109,7 @@ async function runSetupCommand(options) {
89130
89109
  let configPatched = false;
89131
89110
  for (const cmd of patchCommands) {
89132
89111
  try {
89133
- execSync(cmd, { stdio: "pipe", env });
89112
+ execSync3(cmd, { stdio: "pipe", env });
89134
89113
  configPatched = true;
89135
89114
  } catch {
89136
89115
  configPatched = false;
@@ -89236,7 +89215,7 @@ async function runSetupCommand(options) {
89236
89215
  }
89237
89216
  function installPlugin(env) {
89238
89217
  try {
89239
- const info = execSync("openclaw plugins info agentvault", {
89218
+ const info = execSync3("openclaw plugins info agentvault", {
89240
89219
  stdio: "pipe",
89241
89220
  env
89242
89221
  });
@@ -89246,7 +89225,7 @@ function installPlugin(env) {
89246
89225
  if (installedVersion && installedVersion !== VERSION) {
89247
89226
  console.log(` Updating plugin ${installedVersion} \u2192 ${VERSION}...`);
89248
89227
  try {
89249
- execSync("openclaw plugins update agentvault", { stdio: "pipe", env });
89228
+ execSync3("openclaw plugins update agentvault", { stdio: "pipe", env });
89250
89229
  console.log(" Plugin updated.");
89251
89230
  } catch {
89252
89231
  console.log(` \u26A0\uFE0F Update failed \u2014 v${installedVersion} will be used.`);
@@ -89258,7 +89237,7 @@ function installPlugin(env) {
89258
89237
  } catch {
89259
89238
  }
89260
89239
  try {
89261
- execSync("openclaw plugins install @agentvault/agentvault", {
89240
+ execSync3("openclaw plugins install @agentvault/agentvault", {
89262
89241
  stdio: "pipe",
89263
89242
  env
89264
89243
  });
@@ -89271,7 +89250,7 @@ function installPlugin(env) {
89271
89250
  }
89272
89251
  function configurePm2(env) {
89273
89252
  try {
89274
- execSync("pm2 --version", { stdio: "pipe", env });
89253
+ execSync3("pm2 --version", { stdio: "pipe", env });
89275
89254
  } catch {
89276
89255
  console.log(`
89277
89256
  \u2139\uFE0F pm2 not found. For best reliability, install pm2:
@@ -89285,7 +89264,7 @@ function configurePm2(env) {
89285
89264
  return false;
89286
89265
  }
89287
89266
  try {
89288
- const info = execSync("pm2 describe openclaw-gateway", { stdio: "pipe", env });
89267
+ const info = execSync3("pm2 describe openclaw-gateway", { stdio: "pipe", env });
89289
89268
  const infoStr = info.toString();
89290
89269
  if (infoStr.includes("online") || infoStr.includes("stopped")) {
89291
89270
  console.log(" pm2 process 'openclaw-gateway' already exists.");
@@ -89296,20 +89275,20 @@ function configurePm2(env) {
89296
89275
  const isMac = process.platform === "darwin";
89297
89276
  const startCmd = isMac ? "caffeinate -i openclaw gateway start" : "openclaw gateway start";
89298
89277
  try {
89299
- execSync(`pm2 start "${startCmd}" --name openclaw-gateway`, { stdio: "pipe", env });
89278
+ execSync3(`pm2 start "${startCmd}" --name openclaw-gateway`, { stdio: "pipe", env });
89300
89279
  console.log(" \u2705 Gateway registered with pm2.");
89301
89280
  } catch (err) {
89302
89281
  console.log(` \u26A0\uFE0F Failed to register with pm2: ${err}`);
89303
89282
  return false;
89304
89283
  }
89305
89284
  try {
89306
- execSync("pm2 startup", { stdio: "pipe", env });
89285
+ execSync3("pm2 startup", { stdio: "pipe", env });
89307
89286
  console.log(" \u2705 pm2 startup configured (auto-start on boot).");
89308
89287
  } catch {
89309
89288
  console.log(" \u26A0\uFE0F pm2 startup failed \u2014 you may need to run 'pm2 startup' manually with sudo.");
89310
89289
  }
89311
89290
  try {
89312
- execSync("pm2 save", { stdio: "pipe", env });
89291
+ execSync3("pm2 save", { stdio: "pipe", env });
89313
89292
  console.log(" \u2705 pm2 process list saved.");
89314
89293
  } catch {
89315
89294
  console.log(" \u26A0\uFE0F pm2 save failed.");
@@ -89369,7 +89348,6 @@ function ask2(question) {
89369
89348
  var init_setup = __esm({
89370
89349
  async "src/setup.ts"() {
89371
89350
  "use strict";
89372
- init_cp();
89373
89351
  await init_channel();
89374
89352
  await init_index();
89375
89353
  await init_state();