@prosdevlab/dev-agent 0.10.2 → 0.10.3

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
@@ -49367,6 +49367,8 @@ var require_antfly = __commonJS({
49367
49367
  exports2.hasModel = hasModel;
49368
49368
  exports2.hasModelDocker = hasModelDocker;
49369
49369
  var node_child_process_1 = require("child_process");
49370
+ var node_os_1 = require("os");
49371
+ var node_path_1 = require("path");
49370
49372
  var logger_js_1 = require_logger();
49371
49373
  var DEFAULT_ANTFLY_URL = process.env.ANTFLY_URL ?? "http://localhost:18080/api/v1";
49372
49374
  var CONTAINER_NAME = "dev-agent-antfly";
@@ -49374,6 +49376,8 @@ var require_antfly = __commonJS({
49374
49376
  var DOCKER_PORT = 18080;
49375
49377
  var STARTUP_TIMEOUT_MS = 3e4;
49376
49378
  var POLL_INTERVAL_MS = 500;
49379
+ var ANTFLY_DATA_DIR = process.env.ANTFLY_DATA_DIR ?? (0, node_path_1.join)((0, node_os_1.homedir)(), ".antfly");
49380
+ var TERMITE_MODELS_DIR = (0, node_path_1.join)(ANTFLY_DATA_DIR, "models");
49377
49381
  async function ensureAntfly(options) {
49378
49382
  const url2 = getAntflyUrl();
49379
49383
  if (await isServerReady(url2)) {
@@ -49384,6 +49388,8 @@ var require_antfly = __commonJS({
49384
49388
  logger_js_1.logger.info("Starting Antfly server...");
49385
49389
  const child = (0, node_child_process_1.spawn)("antfly", [
49386
49390
  "swarm",
49391
+ "--data-dir",
49392
+ ANTFLY_DATA_DIR,
49387
49393
  "--metadata-api",
49388
49394
  "http://0.0.0.0:18080",
49389
49395
  "--store-api",
@@ -49505,19 +49511,20 @@ var require_antfly = __commonJS({
49505
49511
  }
49506
49512
  }
49507
49513
  function pullModel(model) {
49508
- (0, node_child_process_1.execSync)(`antfly termite pull ${model}`, { stdio: "inherit" });
49514
+ (0, node_child_process_1.execSync)(`antfly termite pull --models-dir ${TERMITE_MODELS_DIR} ${model}`, {
49515
+ stdio: "inherit"
49516
+ });
49509
49517
  }
49510
49518
  function pullModelDocker(model) {
49511
49519
  (0, node_child_process_1.execSync)(`docker exec ${CONTAINER_NAME} /antfly termite pull ${model}`, { stdio: "inherit" });
49512
49520
  }
49513
49521
  function hasModel(model) {
49514
49522
  try {
49515
- const output = (0, node_child_process_1.execSync)("antfly termite list", {
49523
+ const output = (0, node_child_process_1.execSync)(`antfly termite list --models-dir ${TERMITE_MODELS_DIR}`, {
49516
49524
  encoding: "utf-8",
49517
49525
  stdio: ["pipe", "pipe", "pipe"]
49518
49526
  });
49519
- const shortName = model.split("/").pop() ?? model;
49520
- return output.includes(shortName);
49527
+ return modelPresentInOutput(model, output);
49521
49528
  } catch {
49522
49529
  return false;
49523
49530
  }
@@ -49528,12 +49535,18 @@ var require_antfly = __commonJS({
49528
49535
  encoding: "utf-8",
49529
49536
  stdio: ["pipe", "pipe", "pipe"]
49530
49537
  });
49531
- const shortName = model.split("/").pop() ?? model;
49532
- return output.includes(shortName);
49538
+ return modelPresentInOutput(model, output);
49533
49539
  } catch {
49534
49540
  return false;
49535
49541
  }
49536
49542
  }
49543
+ function modelPresentInOutput(model, output) {
49544
+ if (output.includes(model))
49545
+ return true;
49546
+ const shortName = model.split("/").pop() ?? model;
49547
+ const escaped = shortName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
49548
+ return new RegExp(`(?<![\\w/-])${escaped}(?![\\w/-])`).test(output);
49549
+ }
49537
49550
  }
49538
49551
  });
49539
49552
 
@@ -69742,7 +69755,7 @@ var reset_js_1 = require_reset();
69742
69755
  var search_js_1 = require_search();
69743
69756
  var setup_js_1 = require_setup();
69744
69757
  var storage_js_1 = require_storage();
69745
- var VERSION = true ? "0.10.2" : "0.0.0-dev";
69758
+ var VERSION = true ? "0.10.3" : "0.0.0-dev";
69746
69759
  var program = new commander_1.Command();
69747
69760
  program.name("dev").description(chalk_1.default.cyan("\u{1F916} Dev-Agent - Multi-agent code intelligence platform")).version(VERSION);
69748
69761
  program.addCommand(index_js_1.indexCommand);