@defai.digital/automatosx 5.3.7 → 5.4.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 CHANGED
@@ -1,4 +1,24 @@
1
1
  #!/usr/bin/env node
2
+ import path2, { dirname, join, resolve, extname, basename, isAbsolute, sep, relative, delimiter } from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { mkdir, appendFile, stat, access, readdir, copyFile, writeFile, rm, readFile, unlink, rename } from 'fs/promises';
5
+ import { existsSync, readFileSync, writeFileSync, constants, mkdirSync, promises } from 'fs';
6
+ import { findUp } from 'find-up';
7
+ import { exec, spawnSync } from 'child_process';
8
+ import yargs from 'yargs';
9
+ import { hideBin } from 'yargs/helpers';
10
+ import chalk3 from 'chalk';
11
+ import { load, dump } from 'js-yaml';
12
+ import Database from 'better-sqlite3';
13
+ import * as sqliteVec from 'sqlite-vec';
14
+ import { randomUUID, createHash } from 'crypto';
15
+ import { EventEmitter } from 'events';
16
+ import ora from 'ora';
17
+ import Table from 'cli-table3';
18
+ import * as readline from 'readline';
19
+ import os from 'os';
20
+ import { promisify } from 'util';
21
+
2
22
  var __defProp = Object.defineProperty;
3
23
  var __getOwnPropNames = Object.getOwnPropertyNames;
4
24
  var __esm = (fn, res) => function __init() {
@@ -8,24 +28,14 @@ var __export = (target, all) => {
8
28
  for (var name in all)
9
29
  __defProp(target, name, { get: all[name], enumerable: true });
10
30
  };
11
-
12
- // node_modules/tsup/assets/esm_shims.js
13
- import path from "path";
14
- import { fileURLToPath } from "url";
15
31
  var getFilename, getDirname, __dirname;
16
32
  var init_esm_shims = __esm({
17
33
  "node_modules/tsup/assets/esm_shims.js"() {
18
- "use strict";
19
34
  getFilename = () => fileURLToPath(import.meta.url);
20
- getDirname = () => path.dirname(getFilename());
35
+ getDirname = () => path2.dirname(getFilename());
21
36
  __dirname = /* @__PURE__ */ getDirname();
22
37
  }
23
38
  });
24
-
25
- // src/utils/logger.ts
26
- import { appendFile, mkdir } from "fs/promises";
27
- import { existsSync } from "fs";
28
- import { dirname } from "path";
29
39
  function sanitizeObject(obj, maxDepth = 5, currentDepth = 0) {
30
40
  if (currentDepth > maxDepth) {
31
41
  return "[Max Depth Reached]";
@@ -61,7 +71,6 @@ function setLogLevel(level) {
61
71
  var LOG_LEVELS, COLORS, SENSITIVE_KEYS, SimpleLogger, logger;
62
72
  var init_logger = __esm({
63
73
  "src/utils/logger.ts"() {
64
- "use strict";
65
74
  init_esm_shims();
66
75
  LOG_LEVELS = {
67
76
  debug: 0,
@@ -228,7 +237,6 @@ ${JSON.stringify(entry.context, null, 2)}`;
228
237
  var TTLCache, ProviderResponseCache;
229
238
  var init_cache = __esm({
230
239
  "src/core/cache.ts"() {
231
- "use strict";
232
240
  init_esm_shims();
233
241
  init_logger();
234
242
  TTLCache = class {
@@ -586,7 +594,6 @@ var init_cache = __esm({
586
594
  var PathError;
587
595
  var init_path = __esm({
588
596
  "src/types/path.ts"() {
589
- "use strict";
590
597
  init_esm_shims();
591
598
  PathError = class extends Error {
592
599
  constructor(message, context) {
@@ -604,8 +611,6 @@ __export(path_resolver_exports, {
604
611
  PathResolver: () => PathResolver,
605
612
  detectProjectRoot: () => detectProjectRoot
606
613
  });
607
- import { resolve as resolve4, dirname as dirname3, relative, isAbsolute, sep } from "path";
608
- import { findUp } from "find-up";
609
614
  function isWindowsPath(path3) {
610
615
  return /^[a-zA-Z]:[/\\]/.test(path3);
611
616
  }
@@ -615,13 +620,13 @@ async function detectProjectRoot(startDir = process.cwd()) {
615
620
  type: "directory"
616
621
  });
617
622
  if (gitDir) {
618
- return dirname3(gitDir);
623
+ return dirname(gitDir);
619
624
  }
620
625
  const pkgJson = await findUp("package.json", {
621
626
  cwd: startDir
622
627
  });
623
628
  if (pkgJson) {
624
- return dirname3(pkgJson);
629
+ return dirname(pkgJson);
625
630
  }
626
631
  const markers = [
627
632
  "pyproject.toml",
@@ -640,7 +645,7 @@ async function detectProjectRoot(startDir = process.cwd()) {
640
645
  for (const marker of markers) {
641
646
  const found = await findUp(marker, { cwd: startDir });
642
647
  if (found) {
643
- return dirname3(found);
648
+ return dirname(found);
644
649
  }
645
650
  }
646
651
  return startDir;
@@ -648,7 +653,6 @@ async function detectProjectRoot(startDir = process.cwd()) {
648
653
  var PathResolver;
649
654
  var init_path_resolver = __esm({
650
655
  "src/core/path-resolver.ts"() {
651
- "use strict";
652
656
  init_esm_shims();
653
657
  init_path();
654
658
  PathResolver = class {
@@ -675,11 +679,11 @@ var init_path_resolver = __esm({
675
679
  );
676
680
  }
677
681
  if (isAbsolute(userPath)) {
678
- const normalized = resolve4(userPath);
682
+ const normalized = resolve(userPath);
679
683
  this.validateInProject(normalized);
680
684
  return normalized;
681
685
  }
682
- const resolved = resolve4(this.config.workingDir, userPath);
686
+ const resolved = resolve(this.config.workingDir, userPath);
683
687
  this.validateInProject(resolved);
684
688
  return resolved;
685
689
  }
@@ -687,7 +691,7 @@ var init_path_resolver = __esm({
687
691
  * Resolve paths relative to project root
688
692
  */
689
693
  resolveProjectPath(relativePath) {
690
- const resolved = resolve4(this.config.projectDir, relativePath);
694
+ const resolved = resolve(this.config.projectDir, relativePath);
691
695
  this.validateInProject(resolved);
692
696
  return resolved;
693
697
  }
@@ -695,7 +699,7 @@ var init_path_resolver = __esm({
695
699
  * Resolve paths relative to working directory
696
700
  */
697
701
  resolveWorkingPath(relativePath) {
698
- const resolved = resolve4(this.config.workingDir, relativePath);
702
+ const resolved = resolve(this.config.workingDir, relativePath);
699
703
  this.validateInProject(resolved);
700
704
  return resolved;
701
705
  }
@@ -705,14 +709,14 @@ var init_path_resolver = __esm({
705
709
  * - Full read/write access
706
710
  */
707
711
  resolveWorkspacePath(agentPath) {
708
- return resolve4(this.config.agentWorkspace, agentPath);
712
+ return resolve(this.config.agentWorkspace, agentPath);
709
713
  }
710
714
  /**
711
715
  * Validate path is within allowed base directory
712
716
  */
713
717
  validatePath(path3, baseDir) {
714
- const normalized = resolve4(path3);
715
- const base = resolve4(baseDir);
718
+ const normalized = resolve(path3);
719
+ const base = resolve(baseDir);
716
720
  const pathWithSep = normalized + sep;
717
721
  const baseWithSep = base + sep;
718
722
  return pathWithSep.startsWith(baseWithSep) || normalized === base;
@@ -728,7 +732,7 @@ var init_path_resolver = __esm({
728
732
  * Check which boundary a path belongs to
729
733
  */
730
734
  checkBoundaries(path3) {
731
- const normalized = resolve4(path3);
735
+ const normalized = resolve(path3);
732
736
  if (this.validatePath(normalized, this.config.agentWorkspace)) {
733
737
  return "agent_workspace";
734
738
  }
@@ -747,27 +751,27 @@ var init_path_resolver = __esm({
747
751
  * Get relative path from project root
748
752
  */
749
753
  getRelativeToProject(path3) {
750
- const normalized = resolve4(path3);
754
+ const normalized = resolve(path3);
751
755
  return relative(this.config.projectDir, normalized);
752
756
  }
753
757
  /**
754
758
  * Get relative path from working directory
755
759
  */
756
760
  getRelativeToWorking(path3) {
757
- const normalized = resolve4(path3);
761
+ const normalized = resolve(path3);
758
762
  return relative(this.config.workingDir, normalized);
759
763
  }
760
764
  /**
761
765
  * Get agents directory path
762
766
  */
763
767
  getAgentsDirectory() {
764
- return resolve4(this.config.projectDir, ".automatosx", "agents");
768
+ return resolve(this.config.projectDir, ".automatosx", "agents");
765
769
  }
766
770
  /**
767
771
  * Get abilities directory path
768
772
  */
769
773
  getAbilitiesDirectory() {
770
- return resolve4(this.config.projectDir, ".automatosx", "abilities");
774
+ return resolve(this.config.projectDir, ".automatosx", "abilities");
771
775
  }
772
776
  /**
773
777
  * Validate path is within project boundaries
@@ -801,11 +805,6 @@ var init_path_resolver = __esm({
801
805
  };
802
806
  }
803
807
  });
804
-
805
- // src/core/cli-provider-detector.ts
806
- import { existsSync as existsSync5 } from "fs";
807
- import { delimiter } from "path";
808
- import { spawn, spawnSync } from "child_process";
809
808
  function findOnPath(cmdBase) {
810
809
  const isWindows = process.platform === "win32";
811
810
  if (isWindows) {
@@ -835,13 +834,13 @@ function findOnPathWindows(cmdBase) {
835
834
  for (const dir of pathEntries) {
836
835
  for (const ext of pathext) {
837
836
  const fullPath = `${dir}\\${cmdBase}${ext}`;
838
- if (existsSync5(fullPath)) {
837
+ if (existsSync(fullPath)) {
839
838
  logger.debug("Found via PATH \xD7 PATHEXT", { cmdBase, path: fullPath });
840
839
  return { found: true, path: fullPath };
841
840
  }
842
841
  }
843
842
  const pathWithoutExt = `${dir}\\${cmdBase}`;
844
- if (existsSync5(pathWithoutExt)) {
843
+ if (existsSync(pathWithoutExt)) {
845
844
  logger.debug("Found via PATH (no ext)", { cmdBase, path: pathWithoutExt });
846
845
  return { found: true, path: pathWithoutExt };
847
846
  }
@@ -865,7 +864,6 @@ function findOnPathUnix(cmdBase) {
865
864
  }
866
865
  var init_cli_provider_detector = __esm({
867
866
  "src/core/cli-provider-detector.ts"() {
868
- "use strict";
869
867
  init_esm_shims();
870
868
  init_logger();
871
869
  }
@@ -938,18 +936,13 @@ Or use mock providers for testing:
938
936
  }
939
937
  var init_environment = __esm({
940
938
  "src/utils/environment.ts"() {
941
- "use strict";
942
939
  init_esm_shims();
943
940
  init_logger();
944
941
  }
945
942
  });
946
-
947
- // src/providers/base-provider.ts
948
- import { existsSync as existsSync6 } from "fs";
949
943
  var BaseProvider;
950
944
  var init_base_provider = __esm({
951
945
  "src/providers/base-provider.ts"() {
952
- "use strict";
953
946
  init_esm_shims();
954
947
  init_logger();
955
948
  init_cache();
@@ -1110,7 +1103,7 @@ var init_base_provider = __esm({
1110
1103
  logger.warn("Home directory shortcut detected (~)", { path: path3 });
1111
1104
  return false;
1112
1105
  }
1113
- return existsSync6(path3);
1106
+ return existsSync(path3);
1114
1107
  } catch (error) {
1115
1108
  logger.debug(`Error checking path existence`, {
1116
1109
  path: path3,
@@ -1170,7 +1163,7 @@ var init_base_provider = __esm({
1170
1163
  */
1171
1164
  async getProviderVersion(command) {
1172
1165
  try {
1173
- const { spawnSync: spawnSync2 } = await import("child_process");
1166
+ const { spawnSync: spawnSync2 } = await import('child_process');
1174
1167
  const result = spawnSync2(command, ["--version"], {
1175
1168
  encoding: "utf8",
1176
1169
  timeout: 5e3,
@@ -1447,7 +1440,6 @@ __export(claude_provider_exports, {
1447
1440
  var ClaudeProvider;
1448
1441
  var init_claude_provider = __esm({
1449
1442
  "src/providers/claude-provider.ts"() {
1450
- "use strict";
1451
1443
  init_esm_shims();
1452
1444
  init_base_provider();
1453
1445
  init_environment();
@@ -1547,7 +1539,7 @@ This is a placeholder response. Set AUTOMATOSX_MOCK_PROVIDERS=false to use real
1547
1539
  * Model selection is delegated to CLI's own defaults
1548
1540
  */
1549
1541
  async executeRealCLI(prompt, request) {
1550
- const { spawn: spawn2 } = await import("child_process");
1542
+ const { spawn: spawn2 } = await import('child_process');
1551
1543
  return new Promise((resolve10, reject) => {
1552
1544
  let stdout = "";
1553
1545
  let stderr = "";
@@ -1751,7 +1743,6 @@ __export(gemini_provider_exports, {
1751
1743
  var GeminiProvider;
1752
1744
  var init_gemini_provider = __esm({
1753
1745
  "src/providers/gemini-provider.ts"() {
1754
- "use strict";
1755
1746
  init_esm_shims();
1756
1747
  init_base_provider();
1757
1748
  GeminiProvider = class extends BaseProvider {
@@ -1852,7 +1843,7 @@ This is a placeholder response. Set AUTOMATOSX_MOCK_PROVIDERS=false to use real
1852
1843
  * Model selection is delegated to CLI's own defaults
1853
1844
  */
1854
1845
  async executeRealCLI(prompt, request) {
1855
- const { spawn: spawn2 } = await import("child_process");
1846
+ const { spawn: spawn2 } = await import('child_process');
1856
1847
  return new Promise((resolve10, reject) => {
1857
1848
  let stdout = "";
1858
1849
  let stderr = "";
@@ -1976,7 +1967,6 @@ __export(openai_provider_exports, {
1976
1967
  var OpenAIProvider;
1977
1968
  var init_openai_provider = __esm({
1978
1969
  "src/providers/openai-provider.ts"() {
1979
- "use strict";
1980
1970
  init_esm_shims();
1981
1971
  init_base_provider();
1982
1972
  OpenAIProvider = class extends BaseProvider {
@@ -2083,7 +2073,7 @@ This is a placeholder response. Set AUTOMATOSX_MOCK_PROVIDERS=false to use real
2083
2073
  * Model and other parameters are passed via -c (config override) or specific flags
2084
2074
  */
2085
2075
  async executeRealCLI(prompt, request) {
2086
- const { spawn: spawn2 } = await import("child_process");
2076
+ const { spawn: spawn2 } = await import('child_process');
2087
2077
  return new Promise((resolve10, reject) => {
2088
2078
  let stdout = "";
2089
2079
  let stderr = "";
@@ -2191,7 +2181,6 @@ This is a placeholder response. Set AUTOMATOSX_MOCK_PROVIDERS=false to use real
2191
2181
  * OpenAI CLI supports --stream flag for real-time token streaming.
2192
2182
  */
2193
2183
  async executeStreaming(request, options) {
2194
- const startTime = Date.now();
2195
2184
  try {
2196
2185
  let fullPrompt = request.prompt;
2197
2186
  if (request.systemPrompt) {
@@ -2248,7 +2237,7 @@ This is a placeholder streaming response.`;
2248
2237
  * Execute real streaming CLI
2249
2238
  */
2250
2239
  async executeStreamingCLI(prompt, request, options) {
2251
- const { spawn: spawn2 } = await import("child_process");
2240
+ const { spawn: spawn2 } = await import('child_process');
2252
2241
  const startTime = Date.now();
2253
2242
  return new Promise((resolve10, reject) => {
2254
2243
  let fullOutput = "";
@@ -2349,9 +2338,6 @@ This is a placeholder streaming response.`;
2349
2338
  // src/cli/index.ts
2350
2339
  init_esm_shims();
2351
2340
  init_logger();
2352
- import yargs from "yargs";
2353
- import { hideBin } from "yargs/helpers";
2354
- import { createRequire as createRequire4 } from "module";
2355
2341
 
2356
2342
  // src/utils/performance.ts
2357
2343
  init_esm_shims();
@@ -2448,12 +2434,36 @@ var globalTracker = new PerformanceTracker(
2448
2434
  process.env.AUTOMATOSX_PROFILE === "true"
2449
2435
  );
2450
2436
 
2437
+ // src/utils/version.ts
2438
+ init_esm_shims();
2439
+ var __dirname2 = dirname(fileURLToPath(import.meta.url));
2440
+ function getVersion() {
2441
+ try {
2442
+ const possiblePaths = [
2443
+ join(__dirname2, "../../package.json"),
2444
+ // From src/utils
2445
+ join(__dirname2, "../package.json")
2446
+ // From dist
2447
+ ];
2448
+ for (const pkgPath of possiblePaths) {
2449
+ try {
2450
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
2451
+ if (pkg.version) {
2452
+ return pkg.version;
2453
+ }
2454
+ } catch {
2455
+ continue;
2456
+ }
2457
+ }
2458
+ throw new Error("package.json not found in any expected location");
2459
+ } catch (error) {
2460
+ console.error("Failed to read version from package.json:", error);
2461
+ return "unknown";
2462
+ }
2463
+ }
2464
+
2451
2465
  // src/cli/commands/config.ts
2452
2466
  init_esm_shims();
2453
- import { access } from "fs/promises";
2454
- import { resolve as resolve2 } from "path";
2455
- import { constants } from "fs";
2456
- import chalk3 from "chalk";
2457
2467
 
2458
2468
  // src/types/config.ts
2459
2469
  init_esm_shims();
@@ -2721,7 +2731,6 @@ init_logger();
2721
2731
 
2722
2732
  // src/utils/error-formatter.ts
2723
2733
  init_esm_shims();
2724
- import chalk from "chalk";
2725
2734
 
2726
2735
  // src/utils/errors.ts
2727
2736
  init_esm_shims();
@@ -2907,37 +2916,37 @@ function formatError(error, options = {}) {
2907
2916
  } = options;
2908
2917
  const baseError = toBaseError(error);
2909
2918
  const lines = [];
2910
- const header = colors ? chalk.red.bold("\n\u274C Error") : "\n\u2717 Error";
2919
+ const header = colors ? chalk3.red.bold("\n\u274C Error") : "\n\u2717 Error";
2911
2920
  lines.push(header);
2912
2921
  if (showCode) {
2913
- const codeText = colors ? chalk.gray(`[${baseError.code}]`) : `[${baseError.code}]`;
2922
+ const codeText = colors ? chalk3.gray(`[${baseError.code}]`) : `[${baseError.code}]`;
2914
2923
  lines.push(codeText);
2915
2924
  }
2916
- const message = colors ? chalk.red(baseError.message) : baseError.message;
2925
+ const message = colors ? chalk3.red(baseError.message) : baseError.message;
2917
2926
  lines.push("\n" + message);
2918
2927
  if (showSuggestions && baseError.suggestions.length > 0) {
2919
2928
  lines.push("");
2920
- const suggestionsHeader = colors ? chalk.cyan("\u{1F4A1} Suggestions:") : "Suggestions:";
2929
+ const suggestionsHeader = colors ? chalk3.cyan("\u{1F4A1} Suggestions:") : "Suggestions:";
2921
2930
  lines.push(suggestionsHeader);
2922
2931
  baseError.suggestions.forEach((suggestion, i) => {
2923
- const bullet = colors ? chalk.gray(` ${i + 1}.`) : ` ${i + 1}.`;
2932
+ const bullet = colors ? chalk3.gray(` ${i + 1}.`) : ` ${i + 1}.`;
2924
2933
  lines.push(`${bullet} ${suggestion}`);
2925
2934
  });
2926
2935
  }
2927
2936
  if (verbose && baseError.context) {
2928
2937
  lines.push("");
2929
- const contextHeader = colors ? chalk.gray("\u{1F4CB} Context:") : "Context:";
2938
+ const contextHeader = colors ? chalk3.gray("\u{1F4CB} Context:") : "Context:";
2930
2939
  lines.push(contextHeader);
2931
2940
  const contextStr = JSON.stringify(baseError.context, null, 2);
2932
- const formatted = colors ? chalk.gray(contextStr.split("\n").map((line) => " " + line).join("\n")) : contextStr.split("\n").map((line) => " " + line).join("\n");
2941
+ const formatted = colors ? chalk3.gray(contextStr.split("\n").map((line) => " " + line).join("\n")) : contextStr.split("\n").map((line) => " " + line).join("\n");
2933
2942
  lines.push(formatted);
2934
2943
  }
2935
2944
  if (verbose && baseError.stack) {
2936
2945
  lines.push("");
2937
- const stackHeader = colors ? chalk.gray("\u{1F50D} Stack Trace:") : "Stack Trace:";
2946
+ const stackHeader = colors ? chalk3.gray("\u{1F50D} Stack Trace:") : "Stack Trace:";
2938
2947
  lines.push(stackHeader);
2939
2948
  const stack = baseError.stack.split("\n").slice(1);
2940
- const formatted = colors ? chalk.gray(stack.map((line) => " " + line).join("\n")) : stack.map((line) => " " + line).join("\n");
2949
+ const formatted = colors ? chalk3.gray(stack.map((line) => " " + line).join("\n")) : stack.map((line) => " " + line).join("\n");
2941
2950
  lines.push(formatted);
2942
2951
  }
2943
2952
  lines.push("");
@@ -2950,29 +2959,28 @@ function printError(error, options = {}) {
2950
2959
 
2951
2960
  // src/utils/message-formatter.ts
2952
2961
  init_esm_shims();
2953
- import chalk2 from "chalk";
2954
2962
  function formatSuccess(message, options = {}) {
2955
2963
  const { colors = true, icon = true } = options;
2956
2964
  const iconStr = icon ? "\u2713 " : "";
2957
- return colors ? chalk2.green(`${iconStr}${message}`) : `${iconStr}${message}`;
2965
+ return colors ? chalk3.green(`${iconStr}${message}`) : `${iconStr}${message}`;
2958
2966
  }
2959
2967
  function formatWarning(message, options = {}) {
2960
2968
  const { colors = true, icon = true } = options;
2961
2969
  const iconStr = icon ? "\u26A0 " : "";
2962
- return colors ? chalk2.yellow(`${iconStr}${message}`) : `${iconStr}${message}`;
2970
+ return colors ? chalk3.yellow(`${iconStr}${message}`) : `${iconStr}${message}`;
2963
2971
  }
2964
2972
  function formatInfo(message, options = {}) {
2965
2973
  const { colors = true, icon = true } = options;
2966
2974
  const iconStr = icon ? "\u2139 " : "";
2967
- return colors ? chalk2.blue(`${iconStr}${message}`) : `${iconStr}${message}`;
2975
+ return colors ? chalk3.blue(`${iconStr}${message}`) : `${iconStr}${message}`;
2968
2976
  }
2969
2977
  function printSuccess(message, options = {}) {
2970
2978
  console.log(formatSuccess(message, options));
2971
2979
  }
2972
2980
  function formatKeyValue(key, value, options = {}) {
2973
2981
  const { colors = true } = options;
2974
- const formattedKey = colors ? chalk2.gray(`${key}:`) : `${key}:`;
2975
- const formattedValue = colors ? chalk2.white(value) : value;
2982
+ const formattedKey = colors ? chalk3.gray(`${key}:`) : `${key}:`;
2983
+ const formattedValue = colors ? chalk3.white(value) : value;
2976
2984
  return `${formattedKey} ${formattedValue}`;
2977
2985
  }
2978
2986
 
@@ -3286,10 +3294,6 @@ function formatValidationErrors(errors) {
3286
3294
 
3287
3295
  // src/core/config.ts
3288
3296
  init_esm_shims();
3289
- import { readFile, writeFile as writeFile2 } from "fs/promises";
3290
- import { resolve, extname } from "path";
3291
- import { existsSync as existsSync2 } from "fs";
3292
- import { load as loadYaml, dump as dumpYaml } from "js-yaml";
3293
3297
  init_logger();
3294
3298
 
3295
3299
  // src/utils/deep-merge.ts
@@ -3461,7 +3465,7 @@ async function loadConfigUncached(projectDir) {
3461
3465
  resolve(projectDir, "automatosx.config.json")
3462
3466
  ];
3463
3467
  for (const configPath of projectConfigs) {
3464
- if (existsSync2(configPath)) {
3468
+ if (existsSync(configPath)) {
3465
3469
  logger.debug("Loading config from path", { path: configPath });
3466
3470
  return await loadConfigFile(configPath);
3467
3471
  }
@@ -3472,7 +3476,7 @@ async function loadConfigUncached(projectDir) {
3472
3476
  resolve(homeDir, ".automatosx", "config.json")
3473
3477
  ];
3474
3478
  for (const configPath of userConfigs) {
3475
- if (existsSync2(configPath)) {
3479
+ if (existsSync(configPath)) {
3476
3480
  logger.debug("Loading config from path", { path: configPath });
3477
3481
  return await loadConfigFile(configPath);
3478
3482
  }
@@ -3493,7 +3497,7 @@ async function loadConfigFile(path3) {
3493
3497
  let userConfig;
3494
3498
  try {
3495
3499
  if (ext === ".yaml" || ext === ".yml") {
3496
- userConfig = loadYaml(content);
3500
+ userConfig = load(content);
3497
3501
  } else {
3498
3502
  userConfig = JSON.parse(content);
3499
3503
  }
@@ -3916,7 +3920,7 @@ async function saveConfigFile(path3, config) {
3916
3920
  const ext = extname(path3).toLowerCase();
3917
3921
  let content;
3918
3922
  if (ext === ".yaml" || ext === ".yml") {
3919
- content = dumpYaml(config, {
3923
+ content = dump(config, {
3920
3924
  indent: 2,
3921
3925
  lineWidth: 120,
3922
3926
  noRefs: true,
@@ -3925,7 +3929,7 @@ async function saveConfigFile(path3, config) {
3925
3929
  } else {
3926
3930
  content = JSON.stringify(config, null, 2);
3927
3931
  }
3928
- await writeFile2(path3, content, "utf-8");
3932
+ await writeFile(path3, content, "utf-8");
3929
3933
  logger.info("Config saved successfully", { path: path3, format: ext });
3930
3934
  } catch (error) {
3931
3935
  if (error instanceof ConfigError) {
@@ -4005,9 +4009,9 @@ var configCommand = {
4005
4009
  } else if (process.env.AUTOMATOSX_CONFIG_PATH) {
4006
4010
  configPath = process.env.AUTOMATOSX_CONFIG_PATH;
4007
4011
  } else {
4008
- const projectConfig = resolve2(process.cwd(), "automatosx.config.json");
4009
- const hiddenConfig = resolve2(process.cwd(), ".automatosx", "config.json");
4010
- const fs4 = await import("fs");
4012
+ const projectConfig = resolve(process.cwd(), "automatosx.config.json");
4013
+ const hiddenConfig = resolve(process.cwd(), ".automatosx", "config.json");
4014
+ const fs4 = await import('fs');
4011
4015
  if (fs4.existsSync(projectConfig)) {
4012
4016
  configPath = projectConfig;
4013
4017
  } else if (fs4.existsSync(hiddenConfig)) {
@@ -4091,11 +4095,11 @@ async function validateConfigFile(config, verbose) {
4091
4095
  console.log();
4092
4096
  }
4093
4097
  async function resetConfig(path3, verbose) {
4094
- const { createRequire: createRequire5 } = await import("module");
4095
- const require4 = createRequire5(import.meta.url);
4098
+ const { createRequire } = await import('module');
4099
+ const require2 = createRequire(import.meta.url);
4096
4100
  let version = "5.2.2";
4097
4101
  try {
4098
- const packageJson = require4("../../package.json");
4102
+ const packageJson = require2("../../package.json");
4099
4103
  version = packageJson.version;
4100
4104
  } catch {
4101
4105
  }
@@ -4237,22 +4241,17 @@ function setNestedValue(obj, path3, value) {
4237
4241
 
4238
4242
  // src/cli/commands/init.ts
4239
4243
  init_esm_shims();
4240
- import { mkdir as mkdir2, writeFile as writeFile3, access as access2, readdir, copyFile, rm, stat } from "fs/promises";
4241
- import { resolve as resolve3, join as join2, dirname as dirname2 } from "path";
4242
- import { fileURLToPath as fileURLToPath2 } from "url";
4243
- import { constants as constants2, existsSync as existsSync3 } from "fs";
4244
- import chalk4 from "chalk";
4245
4244
  init_logger();
4246
- var __filename2 = fileURLToPath2(import.meta.url);
4247
- var __dirname2 = dirname2(__filename2);
4245
+ var __filename2 = fileURLToPath(import.meta.url);
4246
+ var __dirname3 = dirname(__filename2);
4248
4247
  function getPackageRoot() {
4249
- let current = __dirname2;
4248
+ let current = __dirname3;
4250
4249
  const root = "/";
4251
4250
  while (current !== root) {
4252
- if (existsSync3(join2(current, "package.json"))) {
4251
+ if (existsSync(join(current, "package.json"))) {
4253
4252
  return current;
4254
4253
  }
4255
- current = dirname2(current);
4254
+ current = dirname(current);
4256
4255
  }
4257
4256
  throw new Error("Could not find package root (no package.json found)");
4258
4257
  }
@@ -4272,89 +4271,89 @@ var initCommand = {
4272
4271
  });
4273
4272
  },
4274
4273
  handler: async (argv2) => {
4275
- const projectDir = resolve3(argv2.path || ".");
4276
- const automatosxDir = join2(projectDir, ".automatosx");
4277
- const configPath = join2(projectDir, "automatosx.config.json");
4274
+ const projectDir = resolve(argv2.path || ".");
4275
+ const automatosxDir = join(projectDir, ".automatosx");
4276
+ const configPath = join(projectDir, "automatosx.config.json");
4278
4277
  const packageRoot = getPackageRoot();
4279
4278
  let version = "5.1.2";
4280
4279
  try {
4281
4280
  const packageJson = JSON.parse(
4282
- await import("fs/promises").then((fs4) => fs4.readFile(join2(packageRoot, "package.json"), "utf-8"))
4281
+ await import('fs/promises').then((fs4) => fs4.readFile(join(packageRoot, "package.json"), "utf-8"))
4283
4282
  );
4284
4283
  version = packageJson.version;
4285
4284
  } catch {
4286
4285
  }
4287
- console.log(chalk4.blue.bold(`
4286
+ console.log(chalk3.blue.bold(`
4288
4287
  \u{1F916} AutomatosX v${version} - Project Initialization
4289
4288
  `));
4290
4289
  const createdResources = [];
4291
4290
  let shouldRollback = false;
4292
4291
  try {
4293
- console.log(chalk4.cyan("\u{1F50D} Validating environment..."));
4292
+ console.log(chalk3.cyan("\u{1F50D} Validating environment..."));
4294
4293
  await validateEnvironment(packageRoot);
4295
- console.log(chalk4.green(" \u2713 Environment validation passed"));
4294
+ console.log(chalk3.green(" \u2713 Environment validation passed"));
4296
4295
  const exists = await checkExists2(automatosxDir);
4297
4296
  if (exists && !argv2.force) {
4298
- console.log(chalk4.yellow("\u26A0\uFE0F AutomatosX is already initialized in this directory"));
4299
- console.log(chalk4.gray(` ${automatosxDir}`));
4300
- console.log(chalk4.gray("\n Use --force to reinitialize\n"));
4297
+ console.log(chalk3.yellow("\u26A0\uFE0F AutomatosX is already initialized in this directory"));
4298
+ console.log(chalk3.gray(` ${automatosxDir}`));
4299
+ console.log(chalk3.gray("\n Use --force to reinitialize\n"));
4301
4300
  process.exit(1);
4302
4301
  }
4303
4302
  if (exists && argv2.force) {
4304
- console.log(chalk4.yellow("\u26A0\uFE0F Reinitializing (--force flag detected)"));
4303
+ console.log(chalk3.yellow("\u26A0\uFE0F Reinitializing (--force flag detected)"));
4305
4304
  }
4306
- console.log(chalk4.cyan("\u{1F4C1} Creating directory structure..."));
4305
+ console.log(chalk3.cyan("\u{1F4C1} Creating directory structure..."));
4307
4306
  await createDirectoryStructure(automatosxDir);
4308
4307
  createdResources.push(automatosxDir);
4309
- console.log(chalk4.green(" \u2713 Directories created"));
4310
- console.log(chalk4.cyan("\u{1F465} Installing team configurations..."));
4308
+ console.log(chalk3.green(" \u2713 Directories created"));
4309
+ console.log(chalk3.cyan("\u{1F465} Installing team configurations..."));
4311
4310
  const teamCount = await copyExampleTeams(automatosxDir, packageRoot);
4312
- console.log(chalk4.green(` \u2713 ${teamCount} team configurations installed`));
4313
- console.log(chalk4.cyan("\u{1F916} Installing example agents..."));
4311
+ console.log(chalk3.green(` \u2713 ${teamCount} team configurations installed`));
4312
+ console.log(chalk3.cyan("\u{1F916} Installing example agents..."));
4314
4313
  const agentCount = await copyExampleAgents(automatosxDir, packageRoot);
4315
- console.log(chalk4.green(` \u2713 ${agentCount} example agents installed`));
4316
- console.log(chalk4.cyan("\u26A1 Installing example abilities..."));
4314
+ console.log(chalk3.green(` \u2713 ${agentCount} example agents installed`));
4315
+ console.log(chalk3.cyan("\u26A1 Installing example abilities..."));
4317
4316
  const abilityCount = await copyExampleAbilities(automatosxDir, packageRoot);
4318
- console.log(chalk4.green(` \u2713 ${abilityCount} example abilities installed`));
4319
- console.log(chalk4.cyan("\u{1F4CB} Installing agent templates..."));
4317
+ console.log(chalk3.green(` \u2713 ${abilityCount} example abilities installed`));
4318
+ console.log(chalk3.cyan("\u{1F4CB} Installing agent templates..."));
4320
4319
  const templateCount = await copyExampleTemplates(automatosxDir, packageRoot);
4321
- console.log(chalk4.green(` \u2713 ${templateCount} agent templates installed`));
4322
- console.log(chalk4.cyan("\u2699\uFE0F Generating configuration..."));
4320
+ console.log(chalk3.green(` \u2713 ${templateCount} agent templates installed`));
4321
+ console.log(chalk3.cyan("\u2699\uFE0F Generating configuration..."));
4323
4322
  await createDefaultConfig(configPath, argv2.force ?? false, version);
4324
4323
  createdResources.push(configPath);
4325
- console.log(chalk4.green(" \u2713 Configuration created"));
4326
- console.log(chalk4.cyan("\u{1F50C} Setting up Claude Code integration..."));
4324
+ console.log(chalk3.green(" \u2713 Configuration created"));
4325
+ console.log(chalk3.cyan("\u{1F50C} Setting up Claude Code integration..."));
4327
4326
  await setupClaudeIntegration(projectDir, packageRoot);
4328
- createdResources.push(join2(projectDir, ".claude"));
4329
- console.log(chalk4.green(" \u2713 Claude Code integration configured"));
4330
- console.log(chalk4.cyan("\u{1F527} Initializing git repository..."));
4327
+ createdResources.push(join(projectDir, ".claude"));
4328
+ console.log(chalk3.green(" \u2713 Claude Code integration configured"));
4329
+ console.log(chalk3.cyan("\u{1F527} Initializing git repository..."));
4331
4330
  await initializeGitRepository(projectDir);
4332
- console.log(chalk4.green(" \u2713 Git repository initialized"));
4333
- console.log(chalk4.cyan("\u{1F4DD} Updating .gitignore..."));
4331
+ console.log(chalk3.green(" \u2713 Git repository initialized"));
4332
+ console.log(chalk3.cyan("\u{1F4DD} Updating .gitignore..."));
4334
4333
  await updateGitignore(projectDir);
4335
- console.log(chalk4.green(" \u2713 .gitignore updated"));
4336
- console.log(chalk4.green.bold("\n\u2705 AutomatosX initialized successfully!\n"));
4337
- console.log(chalk4.gray("Next steps:"));
4338
- console.log(chalk4.gray(" 1. Review automatosx.config.json"));
4339
- console.log(chalk4.gray(" 2. List agents: automatosx list agents"));
4340
- console.log(chalk4.gray(' 3. Run an agent: automatosx run backend "Hello!"\n'));
4341
- console.log(chalk4.cyan("Available example agents:"));
4342
- console.log(chalk4.gray(" \u2022 backend - Backend engineer"));
4343
- console.log(chalk4.gray(" \u2022 frontend - Frontend engineer"));
4344
- console.log(chalk4.gray(" \u2022 devops - DevOps specialist"));
4345
- console.log(chalk4.gray(" \u2022 security - Security analyst"));
4346
- console.log(chalk4.gray(" \u2022 quality - QA specialist"));
4347
- console.log(chalk4.gray(" \u2022 data - Data scientist"));
4348
- console.log(chalk4.gray(" \u2022 design - Product designer"));
4349
- console.log(chalk4.gray(" \u2022 writer - Technical writer"));
4350
- console.log(chalk4.gray(" \u2022 product - Product manager"));
4351
- console.log(chalk4.gray(" \u2022 ceo - Executive advisor"));
4352
- console.log(chalk4.gray(" \u2022 cto - Technology strategist"));
4353
- console.log(chalk4.gray(" \u2022 researcher - Research analyst\n"));
4354
- console.log(chalk4.cyan("Claude Code Integration:"));
4355
- console.log(chalk4.gray(" \u2022 Use /ax command in Claude Code"));
4356
- console.log(chalk4.gray(' \u2022 Example: /ax assistant "Explain this code"'));
4357
- console.log(chalk4.gray(" \u2022 MCP tools available in .claude/mcp/\n"));
4334
+ console.log(chalk3.green(" \u2713 .gitignore updated"));
4335
+ console.log(chalk3.green.bold("\n\u2705 AutomatosX initialized successfully!\n"));
4336
+ console.log(chalk3.gray("Next steps:"));
4337
+ console.log(chalk3.gray(" 1. Review automatosx.config.json"));
4338
+ console.log(chalk3.gray(" 2. List agents: automatosx list agents"));
4339
+ console.log(chalk3.gray(' 3. Run an agent: automatosx run backend "Hello!"\n'));
4340
+ console.log(chalk3.cyan("Available example agents:"));
4341
+ console.log(chalk3.gray(" \u2022 backend - Backend engineer"));
4342
+ console.log(chalk3.gray(" \u2022 frontend - Frontend engineer"));
4343
+ console.log(chalk3.gray(" \u2022 devops - DevOps specialist"));
4344
+ console.log(chalk3.gray(" \u2022 security - Security analyst"));
4345
+ console.log(chalk3.gray(" \u2022 quality - QA specialist"));
4346
+ console.log(chalk3.gray(" \u2022 data - Data scientist"));
4347
+ console.log(chalk3.gray(" \u2022 design - Product designer"));
4348
+ console.log(chalk3.gray(" \u2022 writer - Technical writer"));
4349
+ console.log(chalk3.gray(" \u2022 product - Product manager"));
4350
+ console.log(chalk3.gray(" \u2022 ceo - Executive advisor"));
4351
+ console.log(chalk3.gray(" \u2022 cto - Technology strategist"));
4352
+ console.log(chalk3.gray(" \u2022 researcher - Research analyst\n"));
4353
+ console.log(chalk3.cyan("Claude Code Integration:"));
4354
+ console.log(chalk3.gray(" \u2022 Use /ax command in Claude Code"));
4355
+ console.log(chalk3.gray(' \u2022 Example: /ax assistant "Explain this code"'));
4356
+ console.log(chalk3.gray(" \u2022 MCP tools available in .claude/mcp/\n"));
4358
4357
  logger.info("AutomatosX initialized", {
4359
4358
  projectDir,
4360
4359
  automatosxDir,
@@ -4363,9 +4362,9 @@ var initCommand = {
4363
4362
  } catch (error) {
4364
4363
  shouldRollback = true;
4365
4364
  if (createdResources.length > 0 && !argv2.force) {
4366
- console.log(chalk4.yellow("\n\u26A0\uFE0F Initialization failed. Rolling back changes..."));
4365
+ console.log(chalk3.yellow("\n\u26A0\uFE0F Initialization failed. Rolling back changes..."));
4367
4366
  await rollbackCreatedResources(createdResources);
4368
- console.log(chalk4.green(" \u2713 Rollback completed"));
4367
+ console.log(chalk3.green(" \u2713 Rollback completed"));
4369
4368
  }
4370
4369
  printError(error, {
4371
4370
  verbose: false,
@@ -4383,7 +4382,7 @@ var initCommand = {
4383
4382
  };
4384
4383
  async function checkExists2(path3) {
4385
4384
  try {
4386
- await access2(path3, constants2.F_OK);
4385
+ await access(path3, constants.F_OK);
4387
4386
  return true;
4388
4387
  } catch {
4389
4388
  return false;
@@ -4392,21 +4391,21 @@ async function checkExists2(path3) {
4392
4391
  async function createDirectoryStructure(baseDir) {
4393
4392
  const dirs = [
4394
4393
  baseDir,
4395
- join2(baseDir, "agents"),
4396
- join2(baseDir, "teams"),
4397
- join2(baseDir, "abilities"),
4398
- join2(baseDir, "templates"),
4394
+ join(baseDir, "agents"),
4395
+ join(baseDir, "teams"),
4396
+ join(baseDir, "abilities"),
4397
+ join(baseDir, "templates"),
4399
4398
  // v5.0: Agent templates
4400
- join2(baseDir, "memory"),
4401
- join2(baseDir, "memory/exports"),
4399
+ join(baseDir, "memory"),
4400
+ join(baseDir, "memory/exports"),
4402
4401
  // v5.1: MCP memory export directory
4403
- join2(baseDir, "sessions"),
4402
+ join(baseDir, "sessions"),
4404
4403
  // v5.1: Session persistence
4405
4404
  // v5.2: Removed 'workspaces' - automatosx/PRD and automatosx/tmp created on-demand
4406
- join2(baseDir, "logs")
4405
+ join(baseDir, "logs")
4407
4406
  ];
4408
4407
  for (const dir of dirs) {
4409
- await mkdir2(dir, { recursive: true });
4408
+ await mkdir(dir, { recursive: true });
4410
4409
  }
4411
4410
  }
4412
4411
  async function validateEnvironment(packageRoot) {
@@ -4418,7 +4417,7 @@ async function validateEnvironment(packageRoot) {
4418
4417
  ];
4419
4418
  const errors = [];
4420
4419
  for (const dir of requiredDirs) {
4421
- const fullPath = join2(packageRoot, dir);
4420
+ const fullPath = join(packageRoot, dir);
4422
4421
  try {
4423
4422
  await stat(fullPath);
4424
4423
  } catch {
@@ -4450,13 +4449,13 @@ async function rollbackCreatedResources(resources) {
4450
4449
  }
4451
4450
  }
4452
4451
  async function copyExampleTeams(baseDir, packageRoot) {
4453
- const examplesDir = join2(packageRoot, "examples/teams");
4454
- const targetDir = join2(baseDir, "teams");
4452
+ const examplesDir = join(packageRoot, "examples/teams");
4453
+ const targetDir = join(baseDir, "teams");
4455
4454
  const files = await readdir(examplesDir);
4456
4455
  let count = 0;
4457
4456
  for (const file of files) {
4458
4457
  if (file.endsWith(".yaml")) {
4459
- await copyFile(join2(examplesDir, file), join2(targetDir, file));
4458
+ await copyFile(join(examplesDir, file), join(targetDir, file));
4460
4459
  count++;
4461
4460
  }
4462
4461
  }
@@ -4466,13 +4465,13 @@ async function copyExampleTeams(baseDir, packageRoot) {
4466
4465
  return count;
4467
4466
  }
4468
4467
  async function copyExampleAgents(baseDir, packageRoot) {
4469
- const examplesDir = join2(packageRoot, "examples/agents");
4470
- const targetDir = join2(baseDir, "agents");
4468
+ const examplesDir = join(packageRoot, "examples/agents");
4469
+ const targetDir = join(baseDir, "agents");
4471
4470
  const files = await readdir(examplesDir);
4472
4471
  let count = 0;
4473
4472
  for (const file of files) {
4474
4473
  if (file.endsWith(".yaml")) {
4475
- await copyFile(join2(examplesDir, file), join2(targetDir, file));
4474
+ await copyFile(join(examplesDir, file), join(targetDir, file));
4476
4475
  count++;
4477
4476
  }
4478
4477
  }
@@ -4482,13 +4481,13 @@ async function copyExampleAgents(baseDir, packageRoot) {
4482
4481
  return count;
4483
4482
  }
4484
4483
  async function copyExampleAbilities(baseDir, packageRoot) {
4485
- const examplesDir = join2(packageRoot, "examples/abilities");
4486
- const targetDir = join2(baseDir, "abilities");
4484
+ const examplesDir = join(packageRoot, "examples/abilities");
4485
+ const targetDir = join(baseDir, "abilities");
4487
4486
  const files = await readdir(examplesDir);
4488
4487
  let count = 0;
4489
4488
  for (const file of files) {
4490
4489
  if (file.endsWith(".md")) {
4491
- await copyFile(join2(examplesDir, file), join2(targetDir, file));
4490
+ await copyFile(join(examplesDir, file), join(targetDir, file));
4492
4491
  count++;
4493
4492
  }
4494
4493
  }
@@ -4498,13 +4497,13 @@ async function copyExampleAbilities(baseDir, packageRoot) {
4498
4497
  return count;
4499
4498
  }
4500
4499
  async function copyExampleTemplates(baseDir, packageRoot) {
4501
- const examplesDir = join2(packageRoot, "examples/templates");
4502
- const targetDir = join2(baseDir, "templates");
4500
+ const examplesDir = join(packageRoot, "examples/templates");
4501
+ const targetDir = join(baseDir, "templates");
4503
4502
  const files = await readdir(examplesDir);
4504
4503
  let count = 0;
4505
4504
  for (const file of files) {
4506
4505
  if (file.endsWith(".yaml")) {
4507
- await copyFile(join2(examplesDir, file), join2(targetDir, file));
4506
+ await copyFile(join(examplesDir, file), join(targetDir, file));
4508
4507
  count++;
4509
4508
  }
4510
4509
  }
@@ -4526,39 +4525,39 @@ async function createDefaultConfig(configPath, force, version) {
4526
4525
  version
4527
4526
  };
4528
4527
  const content = JSON.stringify(config, null, 2);
4529
- await writeFile3(configPath, content, "utf-8");
4528
+ await writeFile(configPath, content, "utf-8");
4530
4529
  }
4531
4530
  async function setupClaudeIntegration(projectDir, packageRoot) {
4532
- const examplesBaseDir = join2(packageRoot, "examples/claude");
4533
- const claudeDir = join2(projectDir, ".claude");
4534
- const commandsDir = join2(claudeDir, "commands");
4535
- const mcpDir = join2(claudeDir, "mcp");
4536
- await mkdir2(commandsDir, { recursive: true });
4537
- await mkdir2(mcpDir, { recursive: true });
4538
- const commandsSourceDir = join2(examplesBaseDir, "commands");
4531
+ const examplesBaseDir = join(packageRoot, "examples/claude");
4532
+ const claudeDir = join(projectDir, ".claude");
4533
+ const commandsDir = join(claudeDir, "commands");
4534
+ const mcpDir = join(claudeDir, "mcp");
4535
+ await mkdir(commandsDir, { recursive: true });
4536
+ await mkdir(mcpDir, { recursive: true });
4537
+ const commandsSourceDir = join(examplesBaseDir, "commands");
4539
4538
  const commandFiles = await readdir(commandsSourceDir);
4540
4539
  for (const file of commandFiles) {
4541
4540
  if (file.endsWith(".md")) {
4542
- await copyFile(join2(commandsSourceDir, file), join2(commandsDir, file));
4541
+ await copyFile(join(commandsSourceDir, file), join(commandsDir, file));
4543
4542
  }
4544
4543
  }
4545
- const mcpSourceDir = join2(examplesBaseDir, "mcp");
4544
+ const mcpSourceDir = join(examplesBaseDir, "mcp");
4546
4545
  const mcpFiles = await readdir(mcpSourceDir);
4547
4546
  for (const file of mcpFiles) {
4548
4547
  if (file.endsWith(".json")) {
4549
- await copyFile(join2(mcpSourceDir, file), join2(mcpDir, file));
4548
+ await copyFile(join(mcpSourceDir, file), join(mcpDir, file));
4550
4549
  }
4551
4550
  }
4552
4551
  }
4553
4552
  async function initializeGitRepository(projectDir) {
4554
- const gitDir = join2(projectDir, ".git");
4553
+ const gitDir = join(projectDir, ".git");
4555
4554
  try {
4556
4555
  const isGitRepo = await checkExists2(gitDir);
4557
4556
  if (isGitRepo) {
4558
4557
  logger.info("Git repository already exists, skipping initialization");
4559
4558
  return;
4560
4559
  }
4561
- const { spawn: spawn2 } = await import("child_process");
4560
+ const { spawn: spawn2 } = await import('child_process');
4562
4561
  await new Promise((resolve10, reject) => {
4563
4562
  const child = spawn2("git", ["init"], {
4564
4563
  cwd: projectDir,
@@ -4583,14 +4582,14 @@ async function initializeGitRepository(projectDir) {
4583
4582
  } catch (error) {
4584
4583
  const errorMessage = error.message;
4585
4584
  if (errorMessage.includes("ENOENT") || errorMessage.includes("spawn git")) {
4586
- console.log(chalk4.yellow(" \u26A0\uFE0F Git is not installed - skipping repository initialization"));
4587
- console.log(chalk4.gray(" Note: Codex CLI requires git. Install git to use Codex provider."));
4585
+ console.log(chalk3.yellow(" \u26A0\uFE0F Git is not installed - skipping repository initialization"));
4586
+ console.log(chalk3.gray(" Note: Codex CLI requires git. Install git to use Codex provider."));
4588
4587
  logger.warn("Git not found, skipping repository initialization", {
4589
4588
  error: errorMessage
4590
4589
  });
4591
4590
  } else {
4592
- console.log(chalk4.yellow(" \u26A0\uFE0F Failed to initialize git repository"));
4593
- console.log(chalk4.gray(` ${errorMessage}`));
4591
+ console.log(chalk3.yellow(" \u26A0\uFE0F Failed to initialize git repository"));
4592
+ console.log(chalk3.gray(` ${errorMessage}`));
4594
4593
  logger.warn("Git initialization failed", {
4595
4594
  error: errorMessage
4596
4595
  });
@@ -4598,7 +4597,7 @@ async function initializeGitRepository(projectDir) {
4598
4597
  }
4599
4598
  }
4600
4599
  async function updateGitignore(projectDir) {
4601
- const gitignorePath = join2(projectDir, ".gitignore");
4600
+ const gitignorePath = join(projectDir, ".gitignore");
4602
4601
  const automatosxEntries = [
4603
4602
  "",
4604
4603
  "# AutomatosX",
@@ -4611,14 +4610,14 @@ async function updateGitignore(projectDir) {
4611
4610
  try {
4612
4611
  const exists = await checkExists2(gitignorePath);
4613
4612
  if (exists) {
4614
- const { readFile: readFile7 } = await import("fs/promises");
4613
+ const { readFile: readFile7 } = await import('fs/promises');
4615
4614
  const content = await readFile7(gitignorePath, "utf-8");
4616
4615
  if (content.includes("# AutomatosX")) {
4617
4616
  return;
4618
4617
  }
4619
- await writeFile3(gitignorePath, content + automatosxEntries, "utf-8");
4618
+ await writeFile(gitignorePath, content + automatosxEntries, "utf-8");
4620
4619
  } else {
4621
- await writeFile3(gitignorePath, automatosxEntries, "utf-8");
4620
+ await writeFile(gitignorePath, automatosxEntries, "utf-8");
4622
4621
  }
4623
4622
  } catch (error) {
4624
4623
  logger.warn("Failed to update .gitignore", { error: error.message });
@@ -4629,9 +4628,6 @@ async function updateGitignore(projectDir) {
4629
4628
  init_esm_shims();
4630
4629
  init_logger();
4631
4630
  init_path_resolver();
4632
- import { readdir as readdir2 } from "fs/promises";
4633
- import { join as join3 } from "path";
4634
- import chalk5 from "chalk";
4635
4631
  var listCommand = {
4636
4632
  command: "list <type>",
4637
4633
  describe: "List available agents, abilities, or providers",
@@ -4649,7 +4645,7 @@ var listCommand = {
4649
4645
  const pathResolver = new PathResolver({
4650
4646
  projectDir,
4651
4647
  workingDir: process.cwd(),
4652
- agentWorkspace: join3(projectDir, ".automatosx", "workspaces")
4648
+ agentWorkspace: join(projectDir, ".automatosx", "workspaces")
4653
4649
  });
4654
4650
  switch (argv2.type) {
4655
4651
  case "agents":
@@ -4663,8 +4659,8 @@ var listCommand = {
4663
4659
  break;
4664
4660
  }
4665
4661
  } catch (error) {
4666
- console.log(chalk5.red.bold("\n\u274C Failed to list " + argv2.type + "\n"));
4667
- console.log(chalk5.red(error.message));
4662
+ console.log(chalk3.red.bold("\n\u274C Failed to list " + argv2.type + "\n"));
4663
+ console.log(chalk3.red(error.message));
4668
4664
  logger.error("List command failed", { type: argv2.type, error: error.message });
4669
4665
  process.exit(1);
4670
4666
  }
@@ -4672,32 +4668,32 @@ var listCommand = {
4672
4668
  };
4673
4669
  async function listAgents(pathResolver) {
4674
4670
  const agentsDir = pathResolver.getAgentsDirectory();
4675
- const { existsSync: existsSync12 } = await import("fs");
4671
+ const { existsSync: existsSync12 } = await import('fs');
4676
4672
  const projectDir = await detectProjectRoot();
4677
- const examplesDir = join3(projectDir, "examples", "agents");
4673
+ const examplesDir = join(projectDir, "examples", "agents");
4678
4674
  try {
4679
4675
  const agentFiles = [];
4680
4676
  if (existsSync12(agentsDir)) {
4681
- const files = await readdir2(agentsDir);
4677
+ const files = await readdir(agentsDir);
4682
4678
  for (const file of files) {
4683
4679
  if (file.endsWith(".yaml") || file.endsWith(".yml")) {
4684
4680
  agentFiles.push({
4685
4681
  file,
4686
- path: join3(agentsDir, file),
4682
+ path: join(agentsDir, file),
4687
4683
  source: ".automatosx"
4688
4684
  });
4689
4685
  }
4690
4686
  }
4691
4687
  }
4692
4688
  if (existsSync12(examplesDir)) {
4693
- const files = await readdir2(examplesDir);
4689
+ const files = await readdir(examplesDir);
4694
4690
  for (const file of files) {
4695
4691
  if (file.endsWith(".yaml") || file.endsWith(".yml")) {
4696
4692
  const alreadyLoaded = agentFiles.some((a) => a.file === file);
4697
4693
  if (!alreadyLoaded) {
4698
4694
  agentFiles.push({
4699
4695
  file,
4700
- path: join3(examplesDir, file),
4696
+ path: join(examplesDir, file),
4701
4697
  source: "examples"
4702
4698
  });
4703
4699
  }
@@ -4705,14 +4701,14 @@ async function listAgents(pathResolver) {
4705
4701
  }
4706
4702
  }
4707
4703
  if (agentFiles.length === 0) {
4708
- console.log(chalk5.yellow("\n\u26A0\uFE0F No agents found\n"));
4709
- console.log(chalk5.gray("Create agents in: " + agentsDir));
4710
- console.log(chalk5.gray("Or run: automatosx init\n"));
4704
+ console.log(chalk3.yellow("\n\u26A0\uFE0F No agents found\n"));
4705
+ console.log(chalk3.gray("Create agents in: " + agentsDir));
4706
+ console.log(chalk3.gray("Or run: automatosx init\n"));
4711
4707
  return;
4712
4708
  }
4713
- console.log(chalk5.blue.bold("\n\u{1F916} Available Agents:\n"));
4714
- const { load: load4 } = await import("js-yaml");
4715
- const { readFile: readFile7 } = await import("fs/promises");
4709
+ console.log(chalk3.blue.bold("\n\u{1F916} Available Agents:\n"));
4710
+ const { load: load4 } = await import('js-yaml');
4711
+ const { readFile: readFile7 } = await import('fs/promises');
4716
4712
  agentFiles.sort((a, b) => a.file.localeCompare(b.file));
4717
4713
  for (const { file, path: agentPath, source } of agentFiles) {
4718
4714
  try {
@@ -4720,23 +4716,23 @@ async function listAgents(pathResolver) {
4720
4716
  const agent = load4(content);
4721
4717
  const name = agent.displayName || agent.name || file.replace(/\.(yaml|yml)$/, "");
4722
4718
  const description = agent.description || "No description";
4723
- console.log(chalk5.cyan(` \u2022 ${name}`) + chalk5.gray(` (${source})`));
4724
- console.log(chalk5.gray(` ${description}`));
4719
+ console.log(chalk3.cyan(` \u2022 ${name}`) + chalk3.gray(` (${source})`));
4720
+ console.log(chalk3.gray(` ${description}`));
4725
4721
  if (agent.abilities && agent.abilities.length > 0) {
4726
- console.log(chalk5.gray(` Abilities: ${agent.abilities.join(", ")}`));
4722
+ console.log(chalk3.gray(` Abilities: ${agent.abilities.join(", ")}`));
4727
4723
  }
4728
4724
  console.log();
4729
4725
  } catch (error) {
4730
- console.log(chalk5.yellow(` \u2022 ${file} (error loading)`) + chalk5.gray(` (${source})`));
4726
+ console.log(chalk3.yellow(` \u2022 ${file} (error loading)`) + chalk3.gray(` (${source})`));
4731
4727
  console.log();
4732
4728
  }
4733
4729
  }
4734
- console.log(chalk5.gray(`Total: ${agentFiles.length} agent(s)
4730
+ console.log(chalk3.gray(`Total: ${agentFiles.length} agent(s)
4735
4731
  `));
4736
4732
  } catch (error) {
4737
4733
  if (error.code === "ENOENT") {
4738
- console.log(chalk5.yellow("\n\u26A0\uFE0F Agents directory not found\n"));
4739
- console.log(chalk5.gray("Run: automatosx init\n"));
4734
+ console.log(chalk3.yellow("\n\u26A0\uFE0F Agents directory not found\n"));
4735
+ console.log(chalk3.gray("Run: automatosx init\n"));
4740
4736
  } else {
4741
4737
  throw error;
4742
4738
  }
@@ -4745,18 +4741,18 @@ async function listAgents(pathResolver) {
4745
4741
  async function listAbilities(pathResolver) {
4746
4742
  const abilitiesDir = pathResolver.getAbilitiesDirectory();
4747
4743
  try {
4748
- const files = await readdir2(abilitiesDir);
4744
+ const files = await readdir(abilitiesDir);
4749
4745
  const abilityFiles = files.filter((f) => f.endsWith(".md"));
4750
4746
  if (abilityFiles.length === 0) {
4751
- console.log(chalk5.yellow("\n\u26A0\uFE0F No abilities found\n"));
4752
- console.log(chalk5.gray("Create abilities in: " + abilitiesDir));
4753
- console.log(chalk5.gray("Or run: automatosx init\n"));
4747
+ console.log(chalk3.yellow("\n\u26A0\uFE0F No abilities found\n"));
4748
+ console.log(chalk3.gray("Create abilities in: " + abilitiesDir));
4749
+ console.log(chalk3.gray("Or run: automatosx init\n"));
4754
4750
  return;
4755
4751
  }
4756
- console.log(chalk5.blue.bold("\n\u26A1 Available Abilities:\n"));
4757
- const { readFile: readFile7 } = await import("fs/promises");
4752
+ console.log(chalk3.blue.bold("\n\u26A1 Available Abilities:\n"));
4753
+ const { readFile: readFile7 } = await import('fs/promises');
4758
4754
  for (const file of abilityFiles.sort()) {
4759
- const abilityPath = join3(abilitiesDir, file);
4755
+ const abilityPath = join(abilitiesDir, file);
4760
4756
  try {
4761
4757
  const content = await readFile7(abilityPath, "utf-8");
4762
4758
  const lines = content.split("\n");
@@ -4765,27 +4761,27 @@ async function listAbilities(pathResolver) {
4765
4761
  const descIndex = lines.indexOf(descLine || "");
4766
4762
  const name = titleLine?.replace("# ", "") || file.replace(".md", "");
4767
4763
  const description = descIndex >= 0 ? lines[descIndex + 1]?.trim() || "No description" : "No description";
4768
- console.log(chalk5.cyan(` \u2022 ${name}`));
4769
- console.log(chalk5.gray(` ${description}`));
4764
+ console.log(chalk3.cyan(` \u2022 ${name}`));
4765
+ console.log(chalk3.gray(` ${description}`));
4770
4766
  console.log();
4771
4767
  } catch (error) {
4772
- console.log(chalk5.yellow(` \u2022 ${file} (error loading)`));
4768
+ console.log(chalk3.yellow(` \u2022 ${file} (error loading)`));
4773
4769
  console.log();
4774
4770
  }
4775
4771
  }
4776
- console.log(chalk5.gray(`Total: ${abilityFiles.length} ability(ies)
4772
+ console.log(chalk3.gray(`Total: ${abilityFiles.length} ability(ies)
4777
4773
  `));
4778
4774
  } catch (error) {
4779
4775
  if (error.code === "ENOENT") {
4780
- console.log(chalk5.yellow("\n\u26A0\uFE0F Abilities directory not found\n"));
4781
- console.log(chalk5.gray("Run: automatosx init\n"));
4776
+ console.log(chalk3.yellow("\n\u26A0\uFE0F Abilities directory not found\n"));
4777
+ console.log(chalk3.gray("Run: automatosx init\n"));
4782
4778
  } else {
4783
4779
  throw error;
4784
4780
  }
4785
4781
  }
4786
4782
  }
4787
4783
  async function listProviders() {
4788
- console.log(chalk5.blue.bold("\n\u{1F50C} Available Providers:\n"));
4784
+ console.log(chalk3.blue.bold("\n\u{1F50C} Available Providers:\n"));
4789
4785
  const providers = [
4790
4786
  {
4791
4787
  name: "claude",
@@ -4807,13 +4803,13 @@ async function listProviders() {
4807
4803
  }
4808
4804
  ];
4809
4805
  for (const provider of providers) {
4810
- console.log(chalk5.cyan(` \u2022 ${provider.name}`));
4811
- console.log(chalk5.gray(` ${provider.description}`));
4812
- console.log(chalk5.gray(` Status: ${provider.status}`));
4813
- console.log(chalk5.gray(` Capabilities: ${provider.capabilities.join(", ")}`));
4806
+ console.log(chalk3.cyan(` \u2022 ${provider.name}`));
4807
+ console.log(chalk3.gray(` ${provider.description}`));
4808
+ console.log(chalk3.gray(` Status: ${provider.status}`));
4809
+ console.log(chalk3.gray(` Capabilities: ${provider.capabilities.join(", ")}`));
4814
4810
  console.log();
4815
4811
  }
4816
- console.log(chalk5.gray(`Total: ${providers.length} provider(s)
4812
+ console.log(chalk3.gray(`Total: ${providers.length} provider(s)
4817
4813
  `));
4818
4814
  }
4819
4815
 
@@ -4822,8 +4818,6 @@ init_esm_shims();
4822
4818
 
4823
4819
  // src/mcp/server.ts
4824
4820
  init_esm_shims();
4825
- import { createRequire as createRequire2 } from "module";
4826
- import { join as join8 } from "path";
4827
4821
 
4828
4822
  // src/mcp/types.ts
4829
4823
  init_esm_shims();
@@ -4991,10 +4985,6 @@ var Router = class {
4991
4985
 
4992
4986
  // src/core/memory-manager.ts
4993
4987
  init_esm_shims();
4994
- import Database from "better-sqlite3";
4995
- import * as sqliteVec from "sqlite-vec";
4996
- import { existsSync as existsSync4, mkdirSync } from "fs";
4997
- import { dirname as dirname4 } from "path";
4998
4988
 
4999
4989
  // src/types/memory.ts
5000
4990
  init_esm_shims();
@@ -5045,8 +5035,8 @@ var MemoryManager = class _MemoryManager {
5045
5035
  retentionDays
5046
5036
  };
5047
5037
  this.validateCleanupConfig();
5048
- const dir = dirname4(this.config.dbPath);
5049
- if (!existsSync4(dir)) {
5038
+ const dir = dirname(this.config.dbPath);
5039
+ if (!existsSync(dir)) {
5050
5040
  mkdirSync(dir, { recursive: true });
5051
5041
  }
5052
5042
  this.db = new Database(this.config.dbPath);
@@ -5804,9 +5794,9 @@ var MemoryManager = class _MemoryManager {
5804
5794
  throw new MemoryError("Memory manager not initialized", "DATABASE_ERROR");
5805
5795
  }
5806
5796
  try {
5807
- const { dirname: dirname10 } = await import("path");
5808
- const { mkdir: mkdir6 } = await import("fs/promises");
5809
- const destDir = dirname10(destPath);
5797
+ const { dirname: dirname11 } = await import('path');
5798
+ const { mkdir: mkdir6 } = await import('fs/promises');
5799
+ const destDir = dirname11(destPath);
5810
5800
  await mkdir6(destDir, { recursive: true });
5811
5801
  await this.db.backup(destPath);
5812
5802
  logger.info("Database backup created", { destPath });
@@ -5823,7 +5813,7 @@ var MemoryManager = class _MemoryManager {
5823
5813
  throw new MemoryError("Memory manager not initialized", "DATABASE_ERROR");
5824
5814
  }
5825
5815
  try {
5826
- if (!existsSync4(srcPath)) {
5816
+ if (!existsSync(srcPath)) {
5827
5817
  throw new MemoryError(
5828
5818
  `Backup file not found: ${srcPath}`,
5829
5819
  "DATABASE_ERROR",
@@ -5863,8 +5853,8 @@ var MemoryManager = class _MemoryManager {
5863
5853
  pretty = false
5864
5854
  } = options || {};
5865
5855
  try {
5866
- const destDir = dirname4(filePath);
5867
- if (!existsSync4(destDir)) {
5856
+ const destDir = dirname(filePath);
5857
+ if (!existsSync(destDir)) {
5868
5858
  mkdirSync(destDir, { recursive: true });
5869
5859
  }
5870
5860
  let query = "SELECT e.* FROM memory_entries e";
@@ -5928,7 +5918,7 @@ var MemoryManager = class _MemoryManager {
5928
5918
  },
5929
5919
  entries
5930
5920
  };
5931
- const { writeFile: writeFile6 } = await import("fs/promises");
5921
+ const { writeFile: writeFile6 } = await import('fs/promises');
5932
5922
  const json = pretty ? JSON.stringify(exportData, null, 2) : JSON.stringify(exportData);
5933
5923
  await writeFile6(filePath, json, "utf-8");
5934
5924
  const sizeBytes = Buffer.byteLength(json, "utf-8");
@@ -5962,14 +5952,14 @@ var MemoryManager = class _MemoryManager {
5962
5952
  clearExisting = false
5963
5953
  } = options || {};
5964
5954
  try {
5965
- if (!existsSync4(filePath)) {
5955
+ if (!existsSync(filePath)) {
5966
5956
  throw new MemoryError(
5967
5957
  `Import file not found: ${filePath}`,
5968
5958
  "DATABASE_ERROR",
5969
5959
  { filePath }
5970
5960
  );
5971
5961
  }
5972
- const { readFile: readFile7 } = await import("fs/promises");
5962
+ const { readFile: readFile7 } = await import('fs/promises');
5973
5963
  const content = await readFile7(filePath, "utf-8");
5974
5964
  const importData = JSON.parse(content);
5975
5965
  const SUPPORTED_VERSIONS = ["1.0", "4.0.0", "4.11.0"];
@@ -6067,9 +6057,6 @@ var MemoryManager = class _MemoryManager {
6067
6057
 
6068
6058
  // src/core/session-manager.ts
6069
6059
  init_esm_shims();
6070
- import { randomUUID } from "crypto";
6071
- import { readFile as readFile2, writeFile as writeFile4, mkdir as mkdir3, rename, copyFile as copyFile2, unlink } from "fs/promises";
6072
- import { dirname as dirname5 } from "path";
6073
6060
 
6074
6061
  // src/types/orchestration.ts
6075
6062
  init_esm_shims();
@@ -6637,7 +6624,7 @@ var SessionManager = class _SessionManager {
6637
6624
  return;
6638
6625
  }
6639
6626
  try {
6640
- await mkdir3(dirname5(this.persistencePath), { recursive: true });
6627
+ await mkdir(dirname(this.persistencePath), { recursive: true });
6641
6628
  const sessionsArray = Array.from(this.activeSessions.values()).map((session) => ({
6642
6629
  id: session.id,
6643
6630
  initiator: session.initiator,
@@ -6651,7 +6638,7 @@ var SessionManager = class _SessionManager {
6651
6638
  const data = JSON.stringify(sessionsArray, null, 2);
6652
6639
  const tempPath = `${this.persistencePath}.tmp`;
6653
6640
  try {
6654
- await writeFile4(tempPath, data, "utf-8");
6641
+ await writeFile(tempPath, data, "utf-8");
6655
6642
  await rename(tempPath, this.persistencePath);
6656
6643
  logger.debug("Sessions saved to persistence", {
6657
6644
  path: this.persistencePath,
@@ -6702,7 +6689,7 @@ var SessionManager = class _SessionManager {
6702
6689
  return;
6703
6690
  }
6704
6691
  try {
6705
- const data = await readFile2(this.persistencePath, "utf-8");
6692
+ const data = await readFile(this.persistencePath, "utf-8");
6706
6693
  const sessionsArray = JSON.parse(data);
6707
6694
  this.activeSessions.clear();
6708
6695
  let skippedCount = 0;
@@ -6751,7 +6738,7 @@ var SessionManager = class _SessionManager {
6751
6738
  }
6752
6739
  try {
6753
6740
  const backupPath = `${this.persistencePath}.corrupted.${Date.now()}`;
6754
- await copyFile2(this.persistencePath, backupPath);
6741
+ await copyFile(this.persistencePath, backupPath);
6755
6742
  logger.error("Corrupted sessions file backed up, starting fresh", {
6756
6743
  path: this.persistencePath,
6757
6744
  backupPath,
@@ -6792,8 +6779,6 @@ var SessionManager = class _SessionManager {
6792
6779
  // src/core/workspace-manager.ts
6793
6780
  init_esm_shims();
6794
6781
  init_logger();
6795
- import { promises as fs } from "fs";
6796
- import path2 from "path";
6797
6782
  var WorkspaceManager = class _WorkspaceManager {
6798
6783
  projectDir;
6799
6784
  prdDir;
@@ -6824,8 +6809,8 @@ var WorkspaceManager = class _WorkspaceManager {
6824
6809
  if (this.directoriesEnsured) {
6825
6810
  return;
6826
6811
  }
6827
- await fs.mkdir(this.prdDir, { recursive: true });
6828
- await fs.mkdir(this.tmpDir, { recursive: true });
6812
+ await promises.mkdir(this.prdDir, { recursive: true });
6813
+ await promises.mkdir(this.tmpDir, { recursive: true });
6829
6814
  this.directoriesEnsured = true;
6830
6815
  logger.debug("Workspace directories ensured", {
6831
6816
  prdDir: this.prdDir,
@@ -6901,8 +6886,8 @@ var WorkspaceManager = class _WorkspaceManager {
6901
6886
  await this.ensureDirectories();
6902
6887
  this.validateFileSize(content);
6903
6888
  const fullPath = this.validatePath(this.prdDir, fileName);
6904
- await fs.mkdir(path2.dirname(fullPath), { recursive: true });
6905
- await fs.writeFile(fullPath, content, "utf-8");
6889
+ await promises.mkdir(path2.dirname(fullPath), { recursive: true });
6890
+ await promises.writeFile(fullPath, content, "utf-8");
6906
6891
  logger.info("PRD document created", { fileName, size: content.length });
6907
6892
  }
6908
6893
  /**
@@ -6928,8 +6913,8 @@ var WorkspaceManager = class _WorkspaceManager {
6928
6913
  await this.ensureDirectories();
6929
6914
  this.validateFileSize(content);
6930
6915
  const fullPath = this.validatePath(this.tmpDir, fileName);
6931
- await fs.mkdir(path2.dirname(fullPath), { recursive: true });
6932
- await fs.writeFile(fullPath, content, "utf-8");
6916
+ await promises.mkdir(path2.dirname(fullPath), { recursive: true });
6917
+ await promises.writeFile(fullPath, content, "utf-8");
6933
6918
  logger.debug("Temporary file created", { fileName, size: content.length });
6934
6919
  }
6935
6920
  /**
@@ -6946,7 +6931,7 @@ var WorkspaceManager = class _WorkspaceManager {
6946
6931
  */
6947
6932
  async readPRD(fileName) {
6948
6933
  const fullPath = this.validatePath(this.prdDir, fileName);
6949
- return await fs.readFile(fullPath, "utf-8");
6934
+ return await promises.readFile(fullPath, "utf-8");
6950
6935
  }
6951
6936
  /**
6952
6937
  * Read temporary file
@@ -6957,7 +6942,7 @@ var WorkspaceManager = class _WorkspaceManager {
6957
6942
  */
6958
6943
  async readTmp(fileName) {
6959
6944
  const fullPath = this.validatePath(this.tmpDir, fileName);
6960
- return await fs.readFile(fullPath, "utf-8");
6945
+ return await promises.readFile(fullPath, "utf-8");
6961
6946
  }
6962
6947
  /**
6963
6948
  * List all PRD documents
@@ -7039,7 +7024,7 @@ var WorkspaceManager = class _WorkspaceManager {
7039
7024
  async cleanupDirectory(dir, olderThanDays) {
7040
7025
  let removed = 0;
7041
7026
  try {
7042
- const entries = await fs.readdir(dir, { withFileTypes: true });
7027
+ const entries = await promises.readdir(dir, { withFileTypes: true });
7043
7028
  for (const entry of entries) {
7044
7029
  const filePath = path2.join(dir, entry.name);
7045
7030
  if (entry.isDirectory()) {
@@ -7048,7 +7033,7 @@ var WorkspaceManager = class _WorkspaceManager {
7048
7033
  }
7049
7034
  if (olderThanDays !== void 0) {
7050
7035
  try {
7051
- const stats = await fs.stat(filePath);
7036
+ const stats = await promises.stat(filePath);
7052
7037
  const ageInDays = (Date.now() - stats.mtimeMs) / (1e3 * 60 * 60 * 24);
7053
7038
  if (ageInDays < olderThanDays) {
7054
7039
  continue;
@@ -7058,7 +7043,7 @@ var WorkspaceManager = class _WorkspaceManager {
7058
7043
  }
7059
7044
  }
7060
7045
  try {
7061
- await fs.unlink(filePath);
7046
+ await promises.unlink(filePath);
7062
7047
  removed++;
7063
7048
  } catch (rmError) {
7064
7049
  logger.warn("Failed to remove temporary file", {
@@ -7098,7 +7083,7 @@ var WorkspaceManager = class _WorkspaceManager {
7098
7083
  let prdSize = 0;
7099
7084
  for (const file of prdFiles) {
7100
7085
  try {
7101
- const stats = await fs.stat(path2.join(this.prdDir, file));
7086
+ const stats = await promises.stat(path2.join(this.prdDir, file));
7102
7087
  prdSize += stats.size;
7103
7088
  } catch {
7104
7089
  }
@@ -7106,7 +7091,7 @@ var WorkspaceManager = class _WorkspaceManager {
7106
7091
  let tmpSize = 0;
7107
7092
  for (const file of tmpFiles) {
7108
7093
  try {
7109
- const stats = await fs.stat(path2.join(this.tmpDir, file));
7094
+ const stats = await promises.stat(path2.join(this.tmpDir, file));
7110
7095
  tmpSize += stats.size;
7111
7096
  } catch {
7112
7097
  }
@@ -7140,7 +7125,7 @@ var WorkspaceManager = class _WorkspaceManager {
7140
7125
  async listFiles(dir) {
7141
7126
  const files = [];
7142
7127
  try {
7143
- const entries = await fs.readdir(dir, { withFileTypes: true });
7128
+ const entries = await promises.readdir(dir, { withFileTypes: true });
7144
7129
  for (const entry of entries) {
7145
7130
  const fullPath = path2.join(dir, entry.name);
7146
7131
  const relativePath = path2.relative(dir, fullPath);
@@ -7175,7 +7160,6 @@ var WorkspaceManager = class _WorkspaceManager {
7175
7160
  // src/agents/context-manager.ts
7176
7161
  init_esm_shims();
7177
7162
  init_logger();
7178
- import { join as join4 } from "path";
7179
7163
  var PROVIDER_ALIASES = {
7180
7164
  "claude": "claude-code",
7181
7165
  "gemini": "gemini-cli",
@@ -7211,7 +7195,7 @@ var ContextManager = class {
7211
7195
  const projectDir = await this.config.pathResolver.detectProjectRoot();
7212
7196
  const workingDir = process.cwd();
7213
7197
  const agentDirName = agent.name.replace(/[^a-zA-Z0-9-]/g, "-").toLowerCase();
7214
- const agentWorkspace = join4(projectDir, ".automatosx", "workspaces", agentDirName);
7198
+ const agentWorkspace = join(projectDir, ".automatosx", "workspaces", agentDirName);
7215
7199
  logger.debug("Agent workspace path defined (not created)", { workspace: agentWorkspace });
7216
7200
  let session;
7217
7201
  if (options?.sessionId) {
@@ -7232,7 +7216,7 @@ var ContextManager = class {
7232
7216
  if (this.config.workspaceManager && this.config.profileLoader) {
7233
7217
  const allAgents = await this.config.profileLoader.listProfiles();
7234
7218
  const availableAgents = allAgents.filter((a) => a !== agent.name);
7235
- const sharedWorkspace = join4(projectDir, "automatosx", "PRD");
7219
+ const sharedWorkspace = join(projectDir, "automatosx", "PRD");
7236
7220
  const maxDelegationDepth = agent.orchestration?.maxDelegationDepth ?? 2;
7237
7221
  orchestration = {
7238
7222
  isDelegationEnabled: true,
@@ -7498,10 +7482,6 @@ var ContextManager = class {
7498
7482
 
7499
7483
  // src/agents/profile-loader.ts
7500
7484
  init_esm_shims();
7501
- import { readFile as readFile3, readdir as readdir3 } from "fs/promises";
7502
- import { join as join5, extname as extname2, basename, dirname as dirname6 } from "path";
7503
- import { fileURLToPath as fileURLToPath3 } from "url";
7504
- import { load as load2 } from "js-yaml";
7505
7485
 
7506
7486
  // src/types/agent.ts
7507
7487
  init_esm_shims();
@@ -7521,14 +7501,14 @@ var AgentNotFoundError = class extends Error {
7521
7501
  // src/agents/profile-loader.ts
7522
7502
  init_logger();
7523
7503
  init_cache();
7524
- var __filename3 = fileURLToPath3(import.meta.url);
7525
- var __dirname3 = dirname6(__filename3);
7504
+ var __filename3 = fileURLToPath(import.meta.url);
7505
+ var __dirname4 = dirname(__filename3);
7526
7506
  function getPackageRoot2() {
7527
- const currentDir = __dirname3;
7507
+ const currentDir = __dirname4;
7528
7508
  if (currentDir.includes("/dist")) {
7529
- return join5(currentDir, "..");
7509
+ return join(currentDir, "..");
7530
7510
  } else {
7531
- return join5(currentDir, "../..");
7511
+ return join(currentDir, "../..");
7532
7512
  }
7533
7513
  }
7534
7514
  var ProfileLoader = class {
@@ -7540,7 +7520,7 @@ var ProfileLoader = class {
7540
7520
  teamManager;
7541
7521
  constructor(profilesDir, fallbackProfilesDir, teamManager) {
7542
7522
  this.profilesDir = profilesDir;
7543
- this.fallbackProfilesDir = fallbackProfilesDir || join5(getPackageRoot2(), "examples/agents");
7523
+ this.fallbackProfilesDir = fallbackProfilesDir || join(getPackageRoot2(), "examples/agents");
7544
7524
  this.cache = new TTLCache({
7545
7525
  maxEntries: 20,
7546
7526
  ttl: 3e5,
@@ -7620,8 +7600,8 @@ var ProfileLoader = class {
7620
7600
  */
7621
7601
  async listProfilesFromDir(dir) {
7622
7602
  try {
7623
- const files = await readdir3(dir);
7624
- return files.filter((file) => extname2(file) === ".yaml" || extname2(file) === ".yml").map((file) => basename(file, extname2(file)));
7603
+ const files = await readdir(dir);
7604
+ return files.filter((file) => extname(file) === ".yaml" || extname(file) === ".yml").map((file) => basename(file, extname(file)));
7625
7605
  } catch (error) {
7626
7606
  if (error.code === "ENOENT") {
7627
7607
  return [];
@@ -7637,11 +7617,11 @@ var ProfileLoader = class {
7637
7617
  const profilePaths = this.getProfilePath(name);
7638
7618
  for (const profilePath of profilePaths) {
7639
7619
  try {
7640
- const content = await readFile3(profilePath, "utf-8");
7620
+ const content = await readFile(profilePath, "utf-8");
7641
7621
  if (content.length > 100 * 1024) {
7642
7622
  continue;
7643
7623
  }
7644
- const data = load2(content);
7624
+ const data = load(content);
7645
7625
  return data.displayName || null;
7646
7626
  } catch (error) {
7647
7627
  if (error.code === "ENOENT") {
@@ -7690,11 +7670,11 @@ var ProfileLoader = class {
7690
7670
  const profilePaths = this.getProfilePath(name);
7691
7671
  for (const profilePath of profilePaths) {
7692
7672
  try {
7693
- const content = await readFile3(profilePath, "utf-8");
7673
+ const content = await readFile(profilePath, "utf-8");
7694
7674
  if (content.length > 100 * 1024) {
7695
7675
  throw new AgentValidationError("Profile file too large (max 100KB)");
7696
7676
  }
7697
- const data = load2(content);
7677
+ const data = load(content);
7698
7678
  const profile = await this.buildProfile(data, name);
7699
7679
  this.cache.set(name, profile);
7700
7680
  logger.info("Profile loaded", { name, path: profilePath });
@@ -7714,8 +7694,8 @@ var ProfileLoader = class {
7714
7694
  async listProfiles() {
7715
7695
  const profileSet = /* @__PURE__ */ new Set();
7716
7696
  try {
7717
- const files = await readdir3(this.profilesDir);
7718
- const profiles = files.filter((file) => extname2(file) === ".yaml" || extname2(file) === ".yml").map((file) => basename(file, extname2(file)));
7697
+ const files = await readdir(this.profilesDir);
7698
+ const profiles = files.filter((file) => extname(file) === ".yaml" || extname(file) === ".yml").map((file) => basename(file, extname(file)));
7719
7699
  profiles.forEach((p) => profileSet.add(p));
7720
7700
  } catch (error) {
7721
7701
  if (error.code !== "ENOENT") {
@@ -7723,8 +7703,8 @@ var ProfileLoader = class {
7723
7703
  }
7724
7704
  }
7725
7705
  try {
7726
- const files = await readdir3(this.fallbackProfilesDir);
7727
- const profiles = files.filter((file) => extname2(file) === ".yaml" || extname2(file) === ".yml").map((file) => basename(file, extname2(file)));
7706
+ const files = await readdir(this.fallbackProfilesDir);
7707
+ const profiles = files.filter((file) => extname(file) === ".yaml" || extname(file) === ".yml").map((file) => basename(file, extname(file)));
7728
7708
  profiles.forEach((p) => profileSet.add(p));
7729
7709
  } catch (error) {
7730
7710
  logger.debug("Fallback profiles directory not found", {
@@ -7786,9 +7766,9 @@ var ProfileLoader = class {
7786
7766
  const profilePaths = this.getProfilePath(profileName);
7787
7767
  for (const profilePath of profilePaths) {
7788
7768
  try {
7789
- const content = await readFile3(profilePath, "utf-8");
7769
+ const content = await readFile(profilePath, "utf-8");
7790
7770
  if (content.length > 100 * 1024) continue;
7791
- const data = load2(content);
7771
+ const data = load(content);
7792
7772
  profile = await this.buildProfile(data, profileName);
7793
7773
  this.cache.set(profileName, profile);
7794
7774
  break;
@@ -7975,8 +7955,8 @@ var ProfileLoader = class {
7975
7955
  throw new AgentValidationError(`Invalid profile name: ${name}. Only alphanumeric characters, dashes, and underscores are allowed.`);
7976
7956
  }
7977
7957
  return [
7978
- join5(this.profilesDir, `${name}.yaml`),
7979
- join5(this.fallbackProfilesDir, `${name}.yaml`)
7958
+ join(this.profilesDir, `${name}.yaml`),
7959
+ join(this.fallbackProfilesDir, `${name}.yaml`)
7980
7960
  ];
7981
7961
  }
7982
7962
  /**
@@ -8085,17 +8065,14 @@ var ProfileLoader = class {
8085
8065
  init_esm_shims();
8086
8066
  init_logger();
8087
8067
  init_cache();
8088
- import { readFile as readFile4, readdir as readdir4 } from "fs/promises";
8089
- import { join as join6, extname as extname3, basename as basename2, dirname as dirname7 } from "path";
8090
- import { fileURLToPath as fileURLToPath4 } from "url";
8091
- var __filename4 = fileURLToPath4(import.meta.url);
8092
- var __dirname4 = dirname7(__filename4);
8068
+ var __filename4 = fileURLToPath(import.meta.url);
8069
+ var __dirname5 = dirname(__filename4);
8093
8070
  function getPackageRoot3() {
8094
- const currentDir = __dirname4;
8071
+ const currentDir = __dirname5;
8095
8072
  if (currentDir.includes("/dist")) {
8096
- return join6(currentDir, "..");
8073
+ return join(currentDir, "..");
8097
8074
  } else {
8098
- return join6(currentDir, "../..");
8075
+ return join(currentDir, "../..");
8099
8076
  }
8100
8077
  }
8101
8078
  var AbilitiesManager = class {
@@ -8104,7 +8081,7 @@ var AbilitiesManager = class {
8104
8081
  cache;
8105
8082
  constructor(abilitiesDir, fallbackAbilitiesDir) {
8106
8083
  this.abilitiesDir = abilitiesDir;
8107
- this.fallbackAbilitiesDir = fallbackAbilitiesDir || join6(getPackageRoot3(), "examples/abilities");
8084
+ this.fallbackAbilitiesDir = fallbackAbilitiesDir || join(getPackageRoot3(), "examples/abilities");
8108
8085
  this.cache = new TTLCache({
8109
8086
  maxEntries: 50,
8110
8087
  ttl: 6e5,
@@ -8130,12 +8107,12 @@ var AbilitiesManager = class {
8130
8107
  return cached;
8131
8108
  }
8132
8109
  const paths = [
8133
- join6(this.abilitiesDir, `${name}.md`),
8134
- join6(this.fallbackAbilitiesDir, `${name}.md`)
8110
+ join(this.abilitiesDir, `${name}.md`),
8111
+ join(this.fallbackAbilitiesDir, `${name}.md`)
8135
8112
  ];
8136
8113
  for (const abilityPath of paths) {
8137
8114
  try {
8138
- const content = await readFile4(abilityPath, "utf-8");
8115
+ const content = await readFile(abilityPath, "utf-8");
8139
8116
  if (content.length > 500 * 1024) {
8140
8117
  throw new Error("Ability file too large (max 500KB)");
8141
8118
  }
@@ -8186,8 +8163,8 @@ ${content}`);
8186
8163
  */
8187
8164
  async listAbilities() {
8188
8165
  try {
8189
- const files = await readdir4(this.abilitiesDir);
8190
- const abilities = files.filter((file) => extname3(file) === ".md").map((file) => basename2(file, extname3(file)));
8166
+ const files = await readdir(this.abilitiesDir);
8167
+ const abilities = files.filter((file) => extname(file) === ".md").map((file) => basename(file, extname(file)));
8191
8168
  return abilities.sort();
8192
8169
  } catch (error) {
8193
8170
  if (error.code === "ENOENT") {
@@ -8206,9 +8183,6 @@ ${content}`);
8206
8183
 
8207
8184
  // src/core/team-manager.ts
8208
8185
  init_esm_shims();
8209
- import { readFile as readFile5, readdir as readdir5 } from "fs/promises";
8210
- import { join as join7, extname as extname4, basename as basename3 } from "path";
8211
- import { load as load3 } from "js-yaml";
8212
8186
 
8213
8187
  // src/types/team.ts
8214
8188
  init_esm_shims();
@@ -8254,9 +8228,9 @@ var TeamManager = class {
8254
8228
  return cached;
8255
8229
  }
8256
8230
  try {
8257
- const teamPath = join7(this.teamsDir, `${teamName}.yaml`);
8258
- const content = await readFile5(teamPath, "utf-8");
8259
- const team = load3(content);
8231
+ const teamPath = join(this.teamsDir, `${teamName}.yaml`);
8232
+ const content = await readFile(teamPath, "utf-8");
8233
+ const team = load(content);
8260
8234
  this.validateTeam(team);
8261
8235
  this.cache.set(teamName, team);
8262
8236
  logger.info("Team loaded", { name: team.name, path: teamPath });
@@ -8274,11 +8248,11 @@ var TeamManager = class {
8274
8248
  async getAllTeams() {
8275
8249
  logger.debug("Loading all teams");
8276
8250
  try {
8277
- const files = await readdir5(this.teamsDir);
8278
- const teamFiles = files.filter((f) => extname4(f) === ".yaml" || extname4(f) === ".yml");
8251
+ const files = await readdir(this.teamsDir);
8252
+ const teamFiles = files.filter((f) => extname(f) === ".yaml" || extname(f) === ".yml");
8279
8253
  const teams = [];
8280
8254
  for (const file of teamFiles) {
8281
- const teamName = basename3(file, extname4(file));
8255
+ const teamName = basename(file, extname(file));
8282
8256
  try {
8283
8257
  const team = await this.loadTeam(teamName);
8284
8258
  teams.push(team);
@@ -8301,8 +8275,8 @@ var TeamManager = class {
8301
8275
  */
8302
8276
  async listTeams() {
8303
8277
  try {
8304
- const files = await readdir5(this.teamsDir);
8305
- return files.filter((f) => extname4(f) === ".yaml" || extname4(f) === ".yml").map((f) => basename3(f, extname4(f)));
8278
+ const files = await readdir(this.teamsDir);
8279
+ return files.filter((f) => extname(f) === ".yaml" || extname(f) === ".yml").map((f) => basename(f, extname(f)));
8306
8280
  } catch (error) {
8307
8281
  if (error.code === "ENOENT") {
8308
8282
  return [];
@@ -8637,7 +8611,6 @@ init_esm_shims();
8637
8611
  // src/core/warning-emitter.ts
8638
8612
  init_esm_shims();
8639
8613
  init_logger();
8640
- import { EventEmitter } from "events";
8641
8614
  var WarningEmitter = class extends EventEmitter {
8642
8615
  constructor() {
8643
8616
  super();
@@ -9004,9 +8977,6 @@ function validateAndBuildTimeoutConfig(executionConfig) {
9004
8977
 
9005
8978
  // src/agents/executor.ts
9006
8979
  init_logger();
9007
- import { randomUUID as randomUUID2 } from "crypto";
9008
- import chalk6 from "chalk";
9009
- import ora from "ora";
9010
8980
  var AgentExecutor = class {
9011
8981
  sessionManager;
9012
8982
  workspaceManager;
@@ -9121,7 +9091,7 @@ var AgentExecutor = class {
9121
9091
  attempt++;
9122
9092
  try {
9123
9093
  if (verbose && attempt > 1) {
9124
- console.log(chalk6.yellow(`
9094
+ console.log(chalk3.yellow(`
9125
9095
  Retry attempt ${attempt}/${maxAttempts}...`));
9126
9096
  }
9127
9097
  return await this.executeInternal(context, options);
@@ -9136,8 +9106,8 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9136
9106
  maxDelay
9137
9107
  );
9138
9108
  if (verbose) {
9139
- console.log(chalk6.yellow(`Retryable error occurred: ${error.message}`));
9140
- console.log(chalk6.gray(`Waiting ${delay}ms before retry...`));
9109
+ console.log(chalk3.yellow(`Retryable error occurred: ${error.message}`));
9110
+ console.log(chalk3.gray(`Waiting ${delay}ms before retry...`));
9141
9111
  }
9142
9112
  await this.sleep(delay);
9143
9113
  }
@@ -9213,7 +9183,7 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9213
9183
  const delegations = await this.delegationParser.parse(response.content, context.agent.name);
9214
9184
  if (delegations.length > 0) {
9215
9185
  if (verbose) {
9216
- console.log(chalk6.cyan(`
9186
+ console.log(chalk3.cyan(`
9217
9187
  \u{1F517} Found ${delegations.length} delegation request(s)`));
9218
9188
  }
9219
9189
  if (spinner) {
@@ -9229,7 +9199,7 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9229
9199
  });
9230
9200
  response.content += delegationSummary;
9231
9201
  if (verbose) {
9232
- console.log(chalk6.green(`\u2705 All delegations completed`));
9202
+ console.log(chalk3.green(`\u2705 All delegations completed`));
9233
9203
  }
9234
9204
  }
9235
9205
  }
@@ -9259,9 +9229,9 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9259
9229
  const { verbose = false } = options;
9260
9230
  for (const { toAgent, task } of delegations) {
9261
9231
  if (verbose) {
9262
- console.log(chalk6.cyan(`
9232
+ console.log(chalk3.cyan(`
9263
9233
  \u{1F4E4} Delegating to ${toAgent}...`));
9264
- console.log(chalk6.gray(` Task: ${task.substring(0, 100)}${task.length > 100 ? "..." : ""}`));
9234
+ console.log(chalk3.gray(` Task: ${task.substring(0, 100)}${task.length > 100 ? "..." : ""}`));
9265
9235
  }
9266
9236
  try {
9267
9237
  const request = {
@@ -9276,7 +9246,7 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9276
9246
  const result = await this.delegateToAgent(request);
9277
9247
  results.push(result);
9278
9248
  if (verbose) {
9279
- console.log(chalk6.green(`\u2705 Delegation to ${toAgent} completed`));
9249
+ console.log(chalk3.green(`\u2705 Delegation to ${toAgent} completed`));
9280
9250
  }
9281
9251
  } catch (error) {
9282
9252
  const err = error;
@@ -9286,10 +9256,10 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9286
9256
  error: err.message
9287
9257
  });
9288
9258
  if (verbose) {
9289
- console.log(chalk6.red(`\u274C Delegation to ${toAgent} failed: ${err.message}`));
9259
+ console.log(chalk3.red(`\u274C Delegation to ${toAgent} failed: ${err.message}`));
9290
9260
  }
9291
9261
  results.push({
9292
- delegationId: randomUUID2(),
9262
+ delegationId: randomUUID(),
9293
9263
  fromAgent: context.agent.name,
9294
9264
  toAgent,
9295
9265
  startTime: /* @__PURE__ */ new Date(),
@@ -9317,12 +9287,12 @@ Retry attempt ${attempt}/${maxAttempts}...`));
9317
9287
  * Display execution information
9318
9288
  */
9319
9289
  displayExecutionInfo(context) {
9320
- console.log(chalk6.gray("Execution Details:"));
9321
- console.log(chalk6.gray(` Agent: ${context.agent.name}`));
9322
- console.log(chalk6.gray(` Provider: ${context.provider.name}`));
9323
- console.log(chalk6.gray(` Model: ${context.agent.model || "default"}`));
9324
- console.log(chalk6.gray(` Abilities: ${context.agent.abilities.length}`));
9325
- console.log(chalk6.gray(` Memory entries: ${context.memory.length}`));
9290
+ console.log(chalk3.gray("Execution Details:"));
9291
+ console.log(chalk3.gray(` Agent: ${context.agent.name}`));
9292
+ console.log(chalk3.gray(` Provider: ${context.provider.name}`));
9293
+ console.log(chalk3.gray(` Model: ${context.agent.model || "default"}`));
9294
+ console.log(chalk3.gray(` Abilities: ${context.agent.abilities.length}`));
9295
+ console.log(chalk3.gray(` Memory entries: ${context.memory.length}`));
9326
9296
  console.log();
9327
9297
  }
9328
9298
  /**
@@ -9489,15 +9459,15 @@ ${context.task}`;
9489
9459
  */
9490
9460
  displayResult(result, options = {}) {
9491
9461
  const { verbose = false } = options;
9492
- console.log(chalk6.cyan("Response:"));
9462
+ console.log(chalk3.cyan("Response:"));
9493
9463
  console.log(result.response.content);
9494
9464
  console.log();
9495
9465
  if (verbose) {
9496
- console.log(chalk6.gray("Execution Metrics:"));
9497
- console.log(chalk6.gray(` Duration: ${result.duration}ms`));
9498
- console.log(chalk6.gray(` Tokens used: ${result.response.tokensUsed.total}`));
9499
- console.log(chalk6.gray(` Prompt: ${result.response.tokensUsed.prompt}`));
9500
- console.log(chalk6.gray(` Completion: ${result.response.tokensUsed.completion}`));
9466
+ console.log(chalk3.gray("Execution Metrics:"));
9467
+ console.log(chalk3.gray(` Duration: ${result.duration}ms`));
9468
+ console.log(chalk3.gray(` Tokens used: ${result.response.tokensUsed.total}`));
9469
+ console.log(chalk3.gray(` Prompt: ${result.response.tokensUsed.prompt}`));
9470
+ console.log(chalk3.gray(` Completion: ${result.response.tokensUsed.completion}`));
9501
9471
  console.log();
9502
9472
  }
9503
9473
  }
@@ -9564,7 +9534,7 @@ ${context.task}`;
9564
9534
  "execution_failed"
9565
9535
  );
9566
9536
  }
9567
- const delegationId = randomUUID2();
9537
+ const delegationId = randomUUID();
9568
9538
  const startTime = /* @__PURE__ */ new Date();
9569
9539
  logger.info("Delegation started", {
9570
9540
  delegationId,
@@ -9671,7 +9641,7 @@ ${context.task}`;
9671
9641
  };
9672
9642
  } catch (error) {
9673
9643
  const endTime = /* @__PURE__ */ new Date();
9674
- const duration = endTime.getTime() - startTime.getTime();
9644
+ endTime.getTime() - startTime.getTime();
9675
9645
  if (error instanceof DelegationError) {
9676
9646
  logger.error("Delegation failed", {
9677
9647
  delegationId,
@@ -9704,7 +9674,6 @@ init_logger();
9704
9674
 
9705
9675
  // src/mcp/utils/validation.ts
9706
9676
  init_esm_shims();
9707
- import { resolve as resolve5, isAbsolute as isAbsolute2, sep as sep2 } from "path";
9708
9677
  var ValidationError = class extends Error {
9709
9678
  constructor(message, code = -32602 /* InvalidParams */, details) {
9710
9679
  super(message);
@@ -9756,7 +9725,7 @@ function validatePathParameter(path3, paramName, projectRoot = process.cwd()) {
9756
9725
  );
9757
9726
  }
9758
9727
  }
9759
- if (isAbsolute2(path3)) {
9728
+ if (isAbsolute(path3)) {
9760
9729
  throw new ValidationError(
9761
9730
  `Invalid ${paramName}: absolute paths are not allowed`,
9762
9731
  -32602 /* InvalidParams */,
@@ -9764,9 +9733,9 @@ function validatePathParameter(path3, paramName, projectRoot = process.cwd()) {
9764
9733
  );
9765
9734
  }
9766
9735
  try {
9767
- const resolvedPath = resolve5(projectRoot, path3);
9768
- const normalizedRoot = resolve5(projectRoot);
9769
- if (!resolvedPath.startsWith(normalizedRoot + sep2) && resolvedPath !== normalizedRoot) {
9736
+ const resolvedPath = resolve(projectRoot, path3);
9737
+ const normalizedRoot = resolve(projectRoot);
9738
+ if (!resolvedPath.startsWith(normalizedRoot + sep) && resolvedPath !== normalizedRoot) {
9770
9739
  throw new ValidationError(
9771
9740
  `Invalid ${paramName}: path escapes project boundary`,
9772
9741
  -32602 /* InvalidParams */,
@@ -9811,7 +9780,7 @@ function validateAgentName(name) {
9811
9780
  { name }
9812
9781
  );
9813
9782
  }
9814
- if (isAbsolute2(name)) {
9783
+ if (isAbsolute(name)) {
9815
9784
  throw new ValidationError(
9816
9785
  "Invalid agent name: absolute paths not allowed",
9817
9786
  -32602 /* InvalidParams */,
@@ -9988,23 +9957,11 @@ function createSearchMemoryHandler(deps) {
9988
9957
  // src/mcp/tools/get-status.ts
9989
9958
  init_esm_shims();
9990
9959
  init_logger();
9991
- import { createRequire } from "module";
9992
9960
  function createGetStatusHandler(deps) {
9993
9961
  return async () => {
9994
9962
  logger.info("[MCP] get_status called");
9995
9963
  try {
9996
- const require4 = createRequire(import.meta.url);
9997
- let version = "unknown";
9998
- try {
9999
- const versionData = require4("../../../version.json");
10000
- version = versionData.version || "unknown";
10001
- } catch {
10002
- try {
10003
- const packageJson = require4("../../../package.json");
10004
- version = packageJson.version || "unknown";
10005
- } catch {
10006
- }
10007
- }
9964
+ const version = getVersion();
10008
9965
  const memoryStats = await deps.memoryManager.getStats();
10009
9966
  const activeSessions = await deps.sessionManager.getActiveSessions();
10010
9967
  const totalSessions = await deps.sessionManager.getTotalSessionCount();
@@ -10299,12 +10256,11 @@ function createMemoryDeleteHandler(deps) {
10299
10256
  // src/mcp/tools/memory-export.ts
10300
10257
  init_esm_shims();
10301
10258
  init_logger();
10302
- import { resolve as resolve6, basename as basename4 } from "path";
10303
10259
  function resolveExportPath(pathResolver, userPath) {
10304
10260
  const exportsDir = pathResolver.resolveProjectPath(".automatosx/memory/exports");
10305
10261
  validatePathParameter(userPath, "export path", exportsDir);
10306
- const filename = basename4(userPath);
10307
- const absolutePath = resolve6(exportsDir, filename);
10262
+ const filename = basename(userPath);
10263
+ const absolutePath = resolve(exportsDir, filename);
10308
10264
  if (!pathResolver.validatePath(absolutePath, exportsDir)) {
10309
10265
  throw new Error("Export path must be within .automatosx/memory/exports directory");
10310
10266
  }
@@ -10337,12 +10293,11 @@ function createMemoryExportHandler(deps) {
10337
10293
  // src/mcp/tools/memory-import.ts
10338
10294
  init_esm_shims();
10339
10295
  init_logger();
10340
- import { resolve as resolve7, basename as basename5 } from "path";
10341
10296
  function resolveImportPath(pathResolver, userPath) {
10342
10297
  const exportsDir = pathResolver.resolveProjectPath(".automatosx/memory/exports");
10343
10298
  validatePathParameter(userPath, "import path", exportsDir);
10344
- const filename = basename5(userPath);
10345
- const absolutePath = resolve7(exportsDir, filename);
10299
+ const filename = basename(userPath);
10300
+ const absolutePath = resolve(exportsDir, filename);
10346
10301
  if (!pathResolver.validatePath(absolutePath, exportsDir)) {
10347
10302
  throw new Error("Import path must be within .automatosx/memory/exports directory");
10348
10303
  }
@@ -10456,18 +10411,7 @@ var McpServer = class {
10456
10411
  if (options.debug) {
10457
10412
  setLogLevel("debug");
10458
10413
  }
10459
- const require4 = createRequire2(import.meta.url);
10460
- this.version = "unknown";
10461
- try {
10462
- const versionData = require4("../../version.json");
10463
- this.version = versionData.version || "unknown";
10464
- } catch {
10465
- try {
10466
- const packageJson = require4("../../package.json");
10467
- this.version = packageJson.version || "unknown";
10468
- } catch {
10469
- }
10470
- }
10414
+ this.version = getVersion();
10471
10415
  logger.info("[MCP Server] Initializing AutomatosX MCP Server", {
10472
10416
  version: this.version
10473
10417
  });
@@ -10480,24 +10424,24 @@ var McpServer = class {
10480
10424
  const projectDir = process.cwd();
10481
10425
  const config = await loadConfig(projectDir);
10482
10426
  const teamManager = new TeamManager(
10483
- join8(projectDir, ".automatosx", "teams")
10427
+ join(projectDir, ".automatosx", "teams")
10484
10428
  );
10485
10429
  this.profileLoader = new ProfileLoader(
10486
- join8(projectDir, ".automatosx", "agents"),
10430
+ join(projectDir, ".automatosx", "agents"),
10487
10431
  void 0,
10488
10432
  // fallbackProfilesDir (uses default)
10489
10433
  teamManager
10490
10434
  );
10491
10435
  const abilitiesManager = new AbilitiesManager(
10492
- join8(projectDir, ".automatosx", "abilities")
10436
+ join(projectDir, ".automatosx", "abilities")
10493
10437
  );
10494
10438
  this.memoryManager = await MemoryManager.create({
10495
- dbPath: join8(projectDir, ".automatosx", "memory", "memory.db")
10439
+ dbPath: join(projectDir, ".automatosx", "memory", "memory.db")
10496
10440
  });
10497
10441
  this.pathResolver = new PathResolver({
10498
10442
  projectDir,
10499
10443
  workingDir: process.cwd(),
10500
- agentWorkspace: join8(projectDir, ".automatosx", "workspaces")
10444
+ agentWorkspace: join(projectDir, ".automatosx", "workspaces")
10501
10445
  });
10502
10446
  const providers = [];
10503
10447
  if (config.providers["claude-code"]?.enabled) {
@@ -10535,7 +10479,7 @@ var McpServer = class {
10535
10479
  fallbackEnabled: true
10536
10480
  });
10537
10481
  this.sessionManager = new SessionManager({
10538
- persistencePath: join8(projectDir, ".automatosx", "sessions", "sessions.json")
10482
+ persistencePath: join(projectDir, ".automatosx", "sessions", "sessions.json")
10539
10483
  });
10540
10484
  await this.sessionManager.initialize();
10541
10485
  this.workspaceManager = new WorkspaceManager(projectDir);
@@ -11247,14 +11191,9 @@ var mcpCommand = {
11247
11191
 
11248
11192
  // src/cli/commands/memory.ts
11249
11193
  init_esm_shims();
11250
- import { resolve as resolve8 } from "path";
11251
- import chalk8 from "chalk";
11252
- import Table from "cli-table3";
11253
11194
 
11254
11195
  // src/utils/progress.ts
11255
11196
  init_esm_shims();
11256
- import ora2 from "ora";
11257
- import chalk7 from "chalk";
11258
11197
  var ProgressIndicator = class {
11259
11198
  spinner = null;
11260
11199
  options;
@@ -11274,7 +11213,7 @@ var ProgressIndicator = class {
11274
11213
  console.log(message);
11275
11214
  return;
11276
11215
  }
11277
- this.spinner = ora2({
11216
+ this.spinner = ora({
11278
11217
  text: message,
11279
11218
  spinner: this.options.spinnerType,
11280
11219
  color: this.options.colors ? "cyan" : void 0
@@ -11298,7 +11237,7 @@ var ProgressIndicator = class {
11298
11237
  this.spinner.succeed(message);
11299
11238
  this.spinner = null;
11300
11239
  } else if (message) {
11301
- const text = this.options.colors ? chalk7.green(`\u2713 ${message}`) : `\u2713 ${message}`;
11240
+ const text = this.options.colors ? chalk3.green(`\u2713 ${message}`) : `\u2713 ${message}`;
11302
11241
  console.log(text);
11303
11242
  }
11304
11243
  }
@@ -11310,7 +11249,7 @@ var ProgressIndicator = class {
11310
11249
  this.spinner.fail(message);
11311
11250
  this.spinner = null;
11312
11251
  } else if (message) {
11313
- const text = this.options.colors ? chalk7.red(`\u2717 ${message}`) : `\u2717 ${message}`;
11252
+ const text = this.options.colors ? chalk3.red(`\u2717 ${message}`) : `\u2717 ${message}`;
11314
11253
  console.log(text);
11315
11254
  }
11316
11255
  }
@@ -11322,7 +11261,7 @@ var ProgressIndicator = class {
11322
11261
  this.spinner.warn(message);
11323
11262
  this.spinner = null;
11324
11263
  } else if (message) {
11325
- const text = this.options.colors ? chalk7.yellow(`\u26A0 ${message}`) : `\u26A0 ${message}`;
11264
+ const text = this.options.colors ? chalk3.yellow(`\u26A0 ${message}`) : `\u26A0 ${message}`;
11326
11265
  console.log(text);
11327
11266
  }
11328
11267
  }
@@ -11334,7 +11273,7 @@ var ProgressIndicator = class {
11334
11273
  this.spinner.info(message);
11335
11274
  this.spinner = null;
11336
11275
  } else if (message) {
11337
- const text = this.options.colors ? chalk7.blue(`\u2139 ${message}`) : `\u2139 ${message}`;
11276
+ const text = this.options.colors ? chalk3.blue(`\u2139 ${message}`) : `\u2139 ${message}`;
11338
11277
  console.log(text);
11339
11278
  }
11340
11279
  }
@@ -11368,7 +11307,7 @@ var DEFAULT_DB_PATH = ".automatosx/memory/memory.db";
11368
11307
  async function getMemoryManager(dbPath) {
11369
11308
  const path3 = dbPath || DEFAULT_DB_PATH;
11370
11309
  return await MemoryManager.create({
11371
- dbPath: resolve8(path3),
11310
+ dbPath: resolve(path3),
11372
11311
  maxEntries: 1e5,
11373
11312
  autoCleanup: false,
11374
11313
  trackAccess: true
@@ -11432,18 +11371,18 @@ var searchCommand = {
11432
11371
  console.log(JSON.stringify(results, null, 2));
11433
11372
  } else {
11434
11373
  if (results.length === 0) {
11435
- console.log(chalk8.yellow("\n\u26A0 No matching entries found."));
11374
+ console.log(chalk3.yellow("\n\u26A0 No matching entries found."));
11436
11375
  } else {
11437
- console.log(chalk8.bold(`
11376
+ console.log(chalk3.bold(`
11438
11377
  \u{1F50D} Found ${results.length} matching entries:
11439
11378
  `));
11440
11379
  const table = new Table({
11441
11380
  head: [
11442
- chalk8.cyan("ID"),
11443
- chalk8.cyan("Similarity"),
11444
- chalk8.cyan("Type"),
11445
- chalk8.cyan("Content"),
11446
- chalk8.cyan("Created")
11381
+ chalk3.cyan("ID"),
11382
+ chalk3.cyan("Similarity"),
11383
+ chalk3.cyan("Type"),
11384
+ chalk3.cyan("Content"),
11385
+ chalk3.cyan("Created")
11447
11386
  ],
11448
11387
  colWidths: [6, 12, 12, 60, 20],
11449
11388
  wordWrap: true
@@ -11451,13 +11390,13 @@ var searchCommand = {
11451
11390
  for (const result of results) {
11452
11391
  const content = result.entry.content.length > 57 ? `${result.entry.content.substring(0, 57)}...` : result.entry.content;
11453
11392
  const similarity = `${(result.similarity * 100).toFixed(1)}%`;
11454
- const similarityColored = result.similarity > 0.8 ? chalk8.green(similarity) : result.similarity > 0.5 ? chalk8.yellow(similarity) : chalk8.red(similarity);
11393
+ const similarityColored = result.similarity > 0.8 ? chalk3.green(similarity) : result.similarity > 0.5 ? chalk3.yellow(similarity) : chalk3.red(similarity);
11455
11394
  table.push([
11456
- chalk8.white(result.entry.id.toString()),
11395
+ chalk3.white(result.entry.id.toString()),
11457
11396
  similarityColored,
11458
- chalk8.magenta(result.entry.metadata.type),
11459
- chalk8.white(content),
11460
- chalk8.gray(new Date(result.entry.createdAt).toLocaleString())
11397
+ chalk3.magenta(result.entry.metadata.type),
11398
+ chalk3.white(content),
11399
+ chalk3.gray(new Date(result.entry.createdAt).toLocaleString())
11461
11400
  ]);
11462
11401
  }
11463
11402
  console.log(table.toString());
@@ -11631,12 +11570,12 @@ var addCommand = {
11631
11570
  const embedding = new Array(1536).fill(0);
11632
11571
  const entry = await manager.add(argv2.content, embedding, metadata);
11633
11572
  printSuccess("\nMemory entry added successfully\n");
11634
- console.log(`${chalk8.bold("ID:")} ${chalk8.white(entry.id)}`);
11635
- console.log(`${chalk8.bold("Type:")} ${chalk8.magenta(entry.metadata.type)}`);
11573
+ console.log(`${chalk3.bold("ID:")} ${chalk3.white(entry.id)}`);
11574
+ console.log(`${chalk3.bold("Type:")} ${chalk3.magenta(entry.metadata.type)}`);
11636
11575
  const content = entry.content.length > 100 ? `${entry.content.substring(0, 100)}...` : entry.content;
11637
- console.log(`${chalk8.bold("Content:")} ${chalk8.white(content)}`);
11576
+ console.log(`${chalk3.bold("Content:")} ${chalk3.white(content)}`);
11638
11577
  if (entry.metadata.tags && entry.metadata.tags.length > 0) {
11639
- console.log(`${chalk8.bold("Tags:")} ${chalk8.yellow(entry.metadata.tags.join(", "))}`);
11578
+ console.log(`${chalk3.bold("Tags:")} ${chalk3.yellow(entry.metadata.tags.join(", "))}`);
11640
11579
  }
11641
11580
  console.log();
11642
11581
  await manager.close();
@@ -11669,28 +11608,28 @@ var deleteCommand = {
11669
11608
  const manager = await getMemoryManager(argv2.db);
11670
11609
  const entry = await manager.get(argv2.id);
11671
11610
  if (!entry) {
11672
- console.error(chalk8.red(`
11611
+ console.error(chalk3.red(`
11673
11612
  \u2717 Entry not found: ${argv2.id}
11674
11613
  `));
11675
11614
  process.exit(1);
11676
11615
  }
11677
- console.log(chalk8.bold("\n\u{1F5D1}\uFE0F Entry to delete:\n"));
11678
- console.log(`${chalk8.bold("ID:")} ${chalk8.white(entry.id)}`);
11679
- console.log(`${chalk8.bold("Type:")} ${chalk8.magenta(entry.metadata.type)}`);
11616
+ console.log(chalk3.bold("\n\u{1F5D1}\uFE0F Entry to delete:\n"));
11617
+ console.log(`${chalk3.bold("ID:")} ${chalk3.white(entry.id)}`);
11618
+ console.log(`${chalk3.bold("Type:")} ${chalk3.magenta(entry.metadata.type)}`);
11680
11619
  const content = entry.content.length > 100 ? `${entry.content.substring(0, 100)}...` : entry.content;
11681
- console.log(`${chalk8.bold("Content:")} ${chalk8.white(content)}`);
11620
+ console.log(`${chalk3.bold("Content:")} ${chalk3.white(content)}`);
11682
11621
  if (!argv2.confirm) {
11683
- const { createInterface: createInterface4 } = await import("readline");
11622
+ const { createInterface: createInterface4 } = await import('readline');
11684
11623
  const rl = createInterface4({
11685
11624
  input: process.stdin,
11686
11625
  output: process.stdout
11687
11626
  });
11688
11627
  const answer = await new Promise((resolve10) => {
11689
- rl.question(chalk8.yellow("\nAre you sure you want to delete this entry? (y/N): "), resolve10);
11628
+ rl.question(chalk3.yellow("\nAre you sure you want to delete this entry? (y/N): "), resolve10);
11690
11629
  });
11691
11630
  rl.close();
11692
11631
  if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
11693
- console.log(chalk8.gray("\nDeletion cancelled.\n"));
11632
+ console.log(chalk3.gray("\nDeletion cancelled.\n"));
11694
11633
  await manager.close();
11695
11634
  return;
11696
11635
  }
@@ -11765,40 +11704,40 @@ var listCommand2 = {
11765
11704
  console.log(JSON.stringify(entries, null, 2));
11766
11705
  } else {
11767
11706
  if (entries.length === 0) {
11768
- console.log(chalk8.yellow("\n\u26A0 No entries found."));
11707
+ console.log(chalk3.yellow("\n\u26A0 No entries found."));
11769
11708
  } else {
11770
- console.log(chalk8.bold(`
11709
+ console.log(chalk3.bold(`
11771
11710
  \u{1F4DA} Found ${entries.length} entries:
11772
11711
  `));
11773
11712
  const table = new Table({
11774
11713
  head: [
11775
- chalk8.cyan("ID"),
11776
- chalk8.cyan("Type"),
11777
- chalk8.cyan("Content"),
11778
- chalk8.cyan("Tags"),
11779
- chalk8.cyan("Created"),
11780
- chalk8.cyan("Accessed")
11714
+ chalk3.cyan("ID"),
11715
+ chalk3.cyan("Type"),
11716
+ chalk3.cyan("Content"),
11717
+ chalk3.cyan("Tags"),
11718
+ chalk3.cyan("Created"),
11719
+ chalk3.cyan("Accessed")
11781
11720
  ],
11782
11721
  colWidths: [6, 12, 50, 20, 20, 10],
11783
11722
  wordWrap: true
11784
11723
  });
11785
11724
  for (const entry of entries) {
11786
11725
  const content = entry.content.length > 47 ? `${entry.content.substring(0, 47)}...` : entry.content;
11787
- const tags = entry.metadata.tags && entry.metadata.tags.length > 0 ? entry.metadata.tags.join(", ") : chalk8.gray("-");
11726
+ const tags = entry.metadata.tags && entry.metadata.tags.length > 0 ? entry.metadata.tags.join(", ") : chalk3.gray("-");
11788
11727
  const created = new Date(entry.createdAt).toLocaleString();
11789
11728
  const accessCount = `${entry.accessCount || 0}x`;
11790
11729
  table.push([
11791
- chalk8.white(entry.id.toString()),
11792
- chalk8.magenta(entry.metadata.type),
11793
- chalk8.white(content),
11794
- chalk8.yellow(tags),
11795
- chalk8.gray(created),
11796
- chalk8.blue(accessCount)
11730
+ chalk3.white(entry.id.toString()),
11731
+ chalk3.magenta(entry.metadata.type),
11732
+ chalk3.white(content),
11733
+ chalk3.yellow(tags),
11734
+ chalk3.gray(created),
11735
+ chalk3.blue(accessCount)
11797
11736
  ]);
11798
11737
  }
11799
11738
  console.log(table.toString());
11800
11739
  if (entries.length === argv2.limit) {
11801
- console.log(chalk8.gray(`
11740
+ console.log(chalk3.gray(`
11802
11741
  \u{1F4A1} Showing ${argv2.limit} entries. Use --offset to see more.
11803
11742
  `));
11804
11743
  }
@@ -11930,8 +11869,6 @@ init_esm_shims();
11930
11869
  // src/agents/stage-executor.ts
11931
11870
  init_esm_shims();
11932
11871
  init_logger();
11933
- import chalk9 from "chalk";
11934
- import ora3 from "ora";
11935
11872
  var StageExecutor = class {
11936
11873
  /**
11937
11874
  * Execute all stages of an agent workflow
@@ -11962,12 +11899,12 @@ var StageExecutor = class {
11962
11899
  continue;
11963
11900
  }
11964
11901
  if (verbose) {
11965
- console.log(chalk9.cyan(`
11902
+ console.log(chalk3.cyan(`
11966
11903
  ${"=".repeat(60)}`));
11967
- console.log(chalk9.cyan(`Stage ${i + 1}/${stages.length}: ${stage.name}`));
11968
- console.log(chalk9.cyan(`${"=".repeat(60)}
11904
+ console.log(chalk3.cyan(`Stage ${i + 1}/${stages.length}: ${stage.name}`));
11905
+ console.log(chalk3.cyan(`${"=".repeat(60)}
11969
11906
  `));
11970
- console.log(chalk9.gray(`Description: ${stage.description}`));
11907
+ console.log(chalk3.gray(`Description: ${stage.description}`));
11971
11908
  console.log();
11972
11909
  }
11973
11910
  try {
@@ -12056,7 +11993,7 @@ ${"=".repeat(60)}`));
12056
11993
  previousOutputs,
12057
11994
  context.agent.stages || []
12058
11995
  );
12059
- const spinner = showProgress ? ora3({
11996
+ const spinner = showProgress ? ora({
12060
11997
  text: `Executing stage: ${stage.name}`,
12061
11998
  spinner: "dots"
12062
11999
  }).start() : null;
@@ -12076,12 +12013,12 @@ ${"=".repeat(60)}`));
12076
12013
  spinner.succeed(`Stage complete: ${stage.name} (${duration}ms)`);
12077
12014
  }
12078
12015
  if (verbose) {
12079
- console.log(chalk9.green("\n\u2713 Stage output:"));
12016
+ console.log(chalk3.green("\n\u2713 Stage output:"));
12080
12017
  console.log(response.content);
12081
12018
  const tokensUsed = response.tokensUsed?.total ?? 0;
12082
- console.log(chalk9.gray(`
12019
+ console.log(chalk3.gray(`
12083
12020
  Tokens used: ${tokensUsed}`));
12084
- console.log(chalk9.gray(`Duration: ${duration}ms`));
12021
+ console.log(chalk3.gray(`Duration: ${duration}ms`));
12085
12022
  }
12086
12023
  return {
12087
12024
  stageName: stage.name,
@@ -12097,7 +12034,7 @@ Tokens used: ${tokensUsed}`));
12097
12034
  spinner.fail(`Stage failed: ${stage.name}`);
12098
12035
  }
12099
12036
  if (verbose) {
12100
- console.error(chalk9.red(`
12037
+ console.error(chalk3.red(`
12101
12038
  \u2717 Stage error: ${error.message}`));
12102
12039
  }
12103
12040
  throw error;
@@ -12250,45 +12187,45 @@ ${result.output}`;
12250
12187
  * Display multi-stage execution result
12251
12188
  */
12252
12189
  displayResult(result, verbose = false) {
12253
- console.log(chalk9.cyan("\n" + "=".repeat(60)));
12254
- console.log(chalk9.cyan("Multi-Stage Execution Summary"));
12255
- console.log(chalk9.cyan("=".repeat(60)));
12190
+ console.log(chalk3.cyan("\n" + "=".repeat(60)));
12191
+ console.log(chalk3.cyan("Multi-Stage Execution Summary"));
12192
+ console.log(chalk3.cyan("=".repeat(60)));
12256
12193
  const successCount = result.stages.filter((s) => s.success).length;
12257
- const statusColor = result.success ? chalk9.green : chalk9.red;
12194
+ const statusColor = result.success ? chalk3.green : chalk3.red;
12258
12195
  const statusIcon = result.success ? "\u2713" : "\u2717";
12259
12196
  console.log(statusColor(`
12260
12197
  ${statusIcon} Status: ${result.success ? "Success" : "Failed"}`));
12261
- console.log(chalk9.gray(`Stages completed: ${successCount}/${result.stages.length}`));
12262
- console.log(chalk9.gray(`Total duration: ${result.totalDuration}ms`));
12263
- console.log(chalk9.gray(`Total tokens: ${result.totalTokens}`));
12198
+ console.log(chalk3.gray(`Stages completed: ${successCount}/${result.stages.length}`));
12199
+ console.log(chalk3.gray(`Total duration: ${result.totalDuration}ms`));
12200
+ console.log(chalk3.gray(`Total tokens: ${result.totalTokens}`));
12264
12201
  if (result.failedStage !== void 0) {
12265
12202
  const failedStageResult = result.stages[result.failedStage];
12266
12203
  if (failedStageResult) {
12267
- console.log(chalk9.red(`Failed at stage ${result.failedStage + 1}: ${failedStageResult.stageName}`));
12204
+ console.log(chalk3.red(`Failed at stage ${result.failedStage + 1}: ${failedStageResult.stageName}`));
12268
12205
  }
12269
12206
  }
12270
12207
  if (verbose) {
12271
- console.log(chalk9.cyan("\n" + "-".repeat(60)));
12272
- console.log(chalk9.cyan("Stage Details"));
12273
- console.log(chalk9.cyan("-".repeat(60)));
12208
+ console.log(chalk3.cyan("\n" + "-".repeat(60)));
12209
+ console.log(chalk3.cyan("Stage Details"));
12210
+ console.log(chalk3.cyan("-".repeat(60)));
12274
12211
  result.stages.forEach((stage, i) => {
12275
12212
  const icon = stage.success ? "\u2713" : "\u2717";
12276
- const color = stage.success ? chalk9.green : chalk9.red;
12213
+ const color = stage.success ? chalk3.green : chalk3.red;
12277
12214
  console.log(color(`
12278
12215
  ${icon} Stage ${i + 1}: ${stage.stageName}`));
12279
- console.log(chalk9.gray(` Duration: ${stage.duration}ms`));
12280
- console.log(chalk9.gray(` Tokens: ${stage.tokensUsed}`));
12216
+ console.log(chalk3.gray(` Duration: ${stage.duration}ms`));
12217
+ console.log(chalk3.gray(` Tokens: ${stage.tokensUsed}`));
12281
12218
  if (stage.model) {
12282
- console.log(chalk9.gray(` Model: ${stage.model}`));
12219
+ console.log(chalk3.gray(` Model: ${stage.model}`));
12283
12220
  }
12284
12221
  if (!stage.success && stage.error) {
12285
- console.log(chalk9.red(` Error: ${stage.error.message}`));
12222
+ console.log(chalk3.red(` Error: ${stage.error.message}`));
12286
12223
  }
12287
12224
  });
12288
12225
  }
12289
- console.log(chalk9.cyan("\n" + "=".repeat(60)));
12290
- console.log(chalk9.cyan("Final Output"));
12291
- console.log(chalk9.cyan("=".repeat(60) + "\n"));
12226
+ console.log(chalk3.cyan("\n" + "=".repeat(60)));
12227
+ console.log(chalk3.cyan("Final Output"));
12228
+ console.log(chalk3.cyan("=".repeat(60) + "\n"));
12292
12229
  console.log(result.finalOutput);
12293
12230
  }
12294
12231
  };
@@ -12296,7 +12233,6 @@ ${icon} Stage ${i + 1}: ${stage.stageName}`));
12296
12233
  // src/agents/advanced-stage-executor.ts
12297
12234
  init_esm_shims();
12298
12235
  init_logger();
12299
- import chalk10 from "chalk";
12300
12236
  var AdvancedStageExecutor = class extends StageExecutor {
12301
12237
  /**
12302
12238
  * Execute stages with advanced features
@@ -12403,11 +12339,11 @@ var AdvancedStageExecutor = class extends StageExecutor {
12403
12339
  levelGroups.push(graph.filter((n) => n.level === level));
12404
12340
  }
12405
12341
  if (verbose) {
12406
- console.log(chalk10.cyan("\n\u{1F4CA} Execution Plan:"));
12342
+ console.log(chalk3.cyan("\n\u{1F4CA} Execution Plan:"));
12407
12343
  for (let level = 0; level <= maxLevel; level++) {
12408
12344
  const nodesAtLevel = levelGroups[level];
12409
12345
  if (!nodesAtLevel) continue;
12410
- console.log(chalk10.gray(` Level ${level}: ${nodesAtLevel.map((n) => n.stage.name).join(", ")}`));
12346
+ console.log(chalk3.gray(` Level ${level}: ${nodesAtLevel.map((n) => n.stage.name).join(", ")}`));
12411
12347
  }
12412
12348
  console.log();
12413
12349
  }
@@ -12420,7 +12356,7 @@ var AdvancedStageExecutor = class extends StageExecutor {
12420
12356
  const nodesAtLevel = levelGroups[level];
12421
12357
  if (!nodesAtLevel || nodesAtLevel.length === 0) continue;
12422
12358
  if (verbose) {
12423
- console.log(chalk10.cyan(`
12359
+ console.log(chalk3.cyan(`
12424
12360
  \u25B6 Executing Level ${level} (${nodesAtLevel.length} stage${nodesAtLevel.length > 1 ? "s" : ""})...
12425
12361
  `));
12426
12362
  }
@@ -12504,7 +12440,7 @@ var AdvancedStageExecutor = class extends StageExecutor {
12504
12440
  const depResult = stageResults.get(dep);
12505
12441
  if (!depResult) {
12506
12442
  if (verbose) {
12507
- console.log(chalk10.red(`\u26A0 Skipping stage "${stage.name}" (dependency "${dep}" not executed)
12443
+ console.log(chalk3.red(`\u26A0 Skipping stage "${stage.name}" (dependency "${dep}" not executed)
12508
12444
  `));
12509
12445
  }
12510
12446
  return {
@@ -12519,7 +12455,7 @@ var AdvancedStageExecutor = class extends StageExecutor {
12519
12455
  }
12520
12456
  if (!depResult.success) {
12521
12457
  if (verbose) {
12522
- console.log(chalk10.yellow(`\u2298 Skipping stage "${stage.name}" (dependency "${dep}" failed)
12458
+ console.log(chalk3.yellow(`\u2298 Skipping stage "${stage.name}" (dependency "${dep}" failed)
12523
12459
  `));
12524
12460
  }
12525
12461
  return {
@@ -12537,7 +12473,7 @@ var AdvancedStageExecutor = class extends StageExecutor {
12537
12473
  const shouldExecute = this.evaluateCondition(stage.condition, stageOutputs, stageResults);
12538
12474
  if (!shouldExecute) {
12539
12475
  if (verbose) {
12540
- console.log(chalk10.yellow(`\u2298 Skipping stage "${stage.name}" (condition not met)
12476
+ console.log(chalk3.yellow(`\u2298 Skipping stage "${stage.name}" (condition not met)
12541
12477
  `));
12542
12478
  }
12543
12479
  return {
@@ -12600,7 +12536,7 @@ var AdvancedStageExecutor = class extends StageExecutor {
12600
12536
  */
12601
12537
  async executeStageInternal(stage, index, context, previousOutputs, options) {
12602
12538
  const allStages = context.agent.stages || [];
12603
- const tempContext = { ...context, agent: { ...context.agent, stages: [stage] } };
12539
+ ({ ...context, agent: { ...context.agent} });
12604
12540
  const prompt = this.buildStagePromptManual(stage, context.task, previousOutputs, allStages);
12605
12541
  const startTime = Date.now();
12606
12542
  const response = await context.provider.execute({
@@ -12709,19 +12645,19 @@ ${output}
12709
12645
  */
12710
12646
  visualizeDependencyGraph(stages) {
12711
12647
  const graph = this.buildDependencyGraph(stages);
12712
- let output = "\n" + chalk10.cyan("\u{1F4CA} Stage Dependency Graph\n\n");
12648
+ let output = "\n" + chalk3.cyan("\u{1F4CA} Stage Dependency Graph\n\n");
12713
12649
  const maxLevel = Math.max(...graph.map((n) => n.level));
12714
12650
  for (let level = 0; level <= maxLevel; level++) {
12715
12651
  const nodesAtLevel = graph.filter((n) => n.level === level);
12716
- output += chalk10.gray(`Level ${level}:
12652
+ output += chalk3.gray(`Level ${level}:
12717
12653
  `);
12718
12654
  for (const node of nodesAtLevel) {
12719
- const parallel = node.stage.parallel ? chalk10.green(" [parallel]") : "";
12720
- const condition = node.stage.condition ? chalk10.yellow(` [if: ${node.stage.condition}]`) : "";
12721
- output += ` ${chalk10.cyan("\u25CB")} ${node.stage.name}${parallel}${condition}
12655
+ const parallel = node.stage.parallel ? chalk3.green(" [parallel]") : "";
12656
+ const condition = node.stage.condition ? chalk3.yellow(` [if: ${node.stage.condition}]`) : "";
12657
+ output += ` ${chalk3.cyan("\u25CB")} ${node.stage.name}${parallel}${condition}
12722
12658
  `;
12723
12659
  if (node.dependencies.length > 0) {
12724
- output += chalk10.gray(` \u21B3 depends on: ${node.dependencies.join(", ")}
12660
+ output += chalk3.gray(` \u21B3 depends on: ${node.dependencies.join(", ")}
12725
12661
  `);
12726
12662
  }
12727
12663
  }
@@ -12733,16 +12669,16 @@ ${output}
12733
12669
  * Generate execution timeline visualization
12734
12670
  */
12735
12671
  visualizeTimeline(timeline) {
12736
- let output = "\n" + chalk10.cyan("\u23F1\uFE0F Execution Timeline\n\n");
12672
+ let output = "\n" + chalk3.cyan("\u23F1\uFE0F Execution Timeline\n\n");
12737
12673
  const maxLevel = Math.max(...timeline.map((t) => t.level));
12738
12674
  const totalDuration = Math.max(...timeline.map((t) => t.endTime)) - Math.min(...timeline.map((t) => t.startTime));
12739
12675
  for (let level = 0; level <= maxLevel; level++) {
12740
12676
  const entriesAtLevel = timeline.filter((t) => t.level === level);
12741
- output += chalk10.gray(`Level ${level}:
12677
+ output += chalk3.gray(`Level ${level}:
12742
12678
  `);
12743
12679
  for (const entry of entriesAtLevel) {
12744
12680
  const bar = "\u2588".repeat(Math.max(1, Math.floor(entry.duration / totalDuration * 40)));
12745
- output += ` ${entry.stageName.padEnd(20)} ${chalk10.green(bar)} ${entry.duration}ms
12681
+ output += ` ${entry.stageName.padEnd(20)} ${chalk3.green(bar)} ${entry.duration}ms
12746
12682
  `;
12747
12683
  }
12748
12684
  output += "\n";
@@ -12753,15 +12689,9 @@ ${output}
12753
12689
 
12754
12690
  // src/core/stage-execution-controller.ts
12755
12691
  init_esm_shims();
12756
- import { randomUUID as randomUUID3 } from "crypto";
12757
- import chalk12 from "chalk";
12758
- import ora5 from "ora";
12759
12692
 
12760
12693
  // src/core/checkpoint-manager.ts
12761
12694
  init_esm_shims();
12762
- import { promises as fs2 } from "fs";
12763
- import { join as join9, resolve as resolve9 } from "path";
12764
- import { createHash } from "crypto";
12765
12695
  var CURRENT_SCHEMA_VERSION = "1.0.0";
12766
12696
  var CheckpointValidationError = class extends Error {
12767
12697
  constructor(message, code) {
@@ -12801,9 +12731,9 @@ var CheckpointManager = class {
12801
12731
  "INVALID_RUN_ID"
12802
12732
  );
12803
12733
  }
12804
- const checkpointPath = join9(this.checkpointDir, runId);
12805
- const resolved = resolve9(checkpointPath);
12806
- const baseResolved = resolve9(this.checkpointDir);
12734
+ const checkpointPath = join(this.checkpointDir, runId);
12735
+ const resolved = resolve(checkpointPath);
12736
+ const baseResolved = resolve(this.checkpointDir);
12807
12737
  if (!resolved.startsWith(baseResolved)) {
12808
12738
  throw new CheckpointValidationError(
12809
12739
  `Security violation: path traversal detected in run ID: ${runId}`,
@@ -12826,29 +12756,29 @@ var CheckpointManager = class {
12826
12756
  */
12827
12757
  async saveCheckpoint(checkpoint) {
12828
12758
  this.validateRunId(checkpoint.runId);
12829
- const runCheckpointDir = join9(this.checkpointDir, checkpoint.runId);
12830
- await fs2.mkdir(runCheckpointDir, { recursive: true });
12759
+ const runCheckpointDir = join(this.checkpointDir, checkpoint.runId);
12760
+ await promises.mkdir(runCheckpointDir, { recursive: true });
12831
12761
  const checkpointWithChecksum = {
12832
12762
  ...checkpoint,
12833
12763
  schemaVersion: CURRENT_SCHEMA_VERSION,
12834
12764
  checksum: this.calculateChecksum(checkpoint),
12835
12765
  updatedAt: (/* @__PURE__ */ new Date()).toISOString()
12836
12766
  };
12837
- const checkpointPath = join9(runCheckpointDir, "checkpoint.json");
12838
- await fs2.writeFile(
12767
+ const checkpointPath = join(runCheckpointDir, "checkpoint.json");
12768
+ await promises.writeFile(
12839
12769
  checkpointPath,
12840
12770
  JSON.stringify(checkpointWithChecksum, null, 2),
12841
12771
  "utf-8"
12842
12772
  );
12843
12773
  const metadata = this.extractMetadata(checkpointWithChecksum);
12844
- const metadataPath = join9(runCheckpointDir, "metadata.json");
12845
- await fs2.writeFile(
12774
+ const metadataPath = join(runCheckpointDir, "metadata.json");
12775
+ await promises.writeFile(
12846
12776
  metadataPath,
12847
12777
  JSON.stringify(metadata, null, 2),
12848
12778
  "utf-8"
12849
12779
  );
12850
- await fs2.mkdir(join9(runCheckpointDir, "artifacts"), { recursive: true });
12851
- await fs2.mkdir(join9(runCheckpointDir, "logs"), { recursive: true });
12780
+ await promises.mkdir(join(runCheckpointDir, "artifacts"), { recursive: true });
12781
+ await promises.mkdir(join(runCheckpointDir, "logs"), { recursive: true });
12852
12782
  return checkpointPath;
12853
12783
  }
12854
12784
  /**
@@ -12860,16 +12790,16 @@ var CheckpointManager = class {
12860
12790
  */
12861
12791
  async loadCheckpoint(runId) {
12862
12792
  this.validateRunId(runId);
12863
- const checkpointPath = join9(this.checkpointDir, runId, "checkpoint.json");
12793
+ const checkpointPath = join(this.checkpointDir, runId, "checkpoint.json");
12864
12794
  try {
12865
- await fs2.access(checkpointPath);
12795
+ await promises.access(checkpointPath);
12866
12796
  } catch {
12867
12797
  throw new CheckpointValidationError(
12868
12798
  `Checkpoint not found: ${runId}`,
12869
12799
  "CHECKPOINT_NOT_FOUND"
12870
12800
  );
12871
12801
  }
12872
- const checkpointJson = await fs2.readFile(checkpointPath, "utf-8");
12802
+ const checkpointJson = await promises.readFile(checkpointPath, "utf-8");
12873
12803
  const checkpoint = JSON.parse(checkpointJson);
12874
12804
  await this.validateCheckpoint(checkpoint);
12875
12805
  const migratedCheckpoint = await this.migrateCheckpoint(checkpoint);
@@ -12941,13 +12871,12 @@ var CheckpointManager = class {
12941
12871
  */
12942
12872
  async migrateCheckpoint(checkpoint) {
12943
12873
  const checkpointVersion = this.parseVersion(checkpoint.schemaVersion);
12944
- const currentVersion = this.parseVersion(CURRENT_SCHEMA_VERSION);
12874
+ this.parseVersion(CURRENT_SCHEMA_VERSION);
12945
12875
  if (checkpoint.schemaVersion === CURRENT_SCHEMA_VERSION) {
12946
12876
  return checkpoint;
12947
12877
  }
12948
12878
  let migrated = { ...checkpoint };
12949
- if (checkpointVersion.major === 1 && checkpointVersion.minor === 0) {
12950
- }
12879
+ if (checkpointVersion.major === 1 && checkpointVersion.minor === 0) ;
12951
12880
  migrated.schemaVersion = CURRENT_SCHEMA_VERSION;
12952
12881
  migrated.checksum = this.calculateChecksum(migrated);
12953
12882
  await this.saveCheckpoint(migrated);
@@ -12960,9 +12889,9 @@ var CheckpointManager = class {
12960
12889
  */
12961
12890
  async deleteCheckpoint(runId) {
12962
12891
  this.validateRunId(runId);
12963
- const runCheckpointDir = join9(this.checkpointDir, runId);
12892
+ const runCheckpointDir = join(this.checkpointDir, runId);
12964
12893
  try {
12965
- await fs2.rm(runCheckpointDir, { recursive: true, force: true });
12894
+ await promises.rm(runCheckpointDir, { recursive: true, force: true });
12966
12895
  } catch (error) {
12967
12896
  if (error.code !== "ENOENT") {
12968
12897
  throw error;
@@ -12976,17 +12905,17 @@ var CheckpointManager = class {
12976
12905
  */
12977
12906
  async listCheckpoints() {
12978
12907
  try {
12979
- await fs2.access(this.checkpointDir);
12908
+ await promises.access(this.checkpointDir);
12980
12909
  } catch {
12981
12910
  return [];
12982
12911
  }
12983
- const entries = await fs2.readdir(this.checkpointDir, { withFileTypes: true });
12912
+ const entries = await promises.readdir(this.checkpointDir, { withFileTypes: true });
12984
12913
  const runDirs = entries.filter((entry) => entry.isDirectory());
12985
12914
  const metadataList = [];
12986
12915
  for (const runDir of runDirs) {
12987
12916
  try {
12988
- const metadataPath = join9(this.checkpointDir, runDir.name, "metadata.json");
12989
- const metadataJson = await fs2.readFile(metadataPath, "utf-8");
12917
+ const metadataPath = join(this.checkpointDir, runDir.name, "metadata.json");
12918
+ const metadataJson = await promises.readFile(metadataPath, "utf-8");
12990
12919
  const metadata = JSON.parse(metadataJson);
12991
12920
  metadataList.push(metadata);
12992
12921
  } catch {
@@ -13027,7 +12956,7 @@ var CheckpointManager = class {
13027
12956
  */
13028
12957
  getCheckpointDir(runId) {
13029
12958
  this.validateRunId(runId);
13030
- return join9(this.checkpointDir, runId);
12959
+ return join(this.checkpointDir, runId);
13031
12960
  }
13032
12961
  /**
13033
12962
  * Check if checkpoint exists for a run
@@ -13037,9 +12966,9 @@ var CheckpointManager = class {
13037
12966
  */
13038
12967
  async checkpointExists(runId) {
13039
12968
  this.validateRunId(runId);
13040
- const checkpointPath = join9(this.checkpointDir, runId, "checkpoint.json");
12969
+ const checkpointPath = join(this.checkpointDir, runId, "checkpoint.json");
13041
12970
  try {
13042
- await fs2.access(checkpointPath);
12971
+ await promises.access(checkpointPath);
13043
12972
  return true;
13044
12973
  } catch {
13045
12974
  return false;
@@ -13115,7 +13044,6 @@ var CheckpointManager = class {
13115
13044
 
13116
13045
  // src/core/prompt-manager.ts
13117
13046
  init_esm_shims();
13118
- import * as readline from "readline";
13119
13047
  var CLIPromptAdapter = class {
13120
13048
  config;
13121
13049
  rl = null;
@@ -13519,8 +13447,6 @@ var ProgressChannel = class {
13519
13447
 
13520
13448
  // src/cli/renderers/progress-renderer.ts
13521
13449
  init_esm_shims();
13522
- import chalk11 from "chalk";
13523
- import ora4 from "ora";
13524
13450
  var ProgressRenderer = class {
13525
13451
  spinner = null;
13526
13452
  currentStage = null;
@@ -13592,8 +13518,8 @@ var ProgressRenderer = class {
13592
13518
  }
13593
13519
  this.currentStage = event.stageName || "Unknown";
13594
13520
  this.currentProgress = 0;
13595
- this.spinner = ora4({
13596
- text: chalk11.cyan(`${this.currentStage} (0%)`),
13521
+ this.spinner = ora({
13522
+ text: chalk3.cyan(`${this.currentStage} (0%)`),
13597
13523
  spinner: "dots"
13598
13524
  }).start();
13599
13525
  }
@@ -13604,7 +13530,7 @@ var ProgressRenderer = class {
13604
13530
  if (!this.spinner) return;
13605
13531
  this.currentProgress = event.progress || 0;
13606
13532
  const progressBar = this.buildProgressBar(this.currentProgress);
13607
- this.spinner.text = chalk11.cyan(
13533
+ this.spinner.text = chalk3.cyan(
13608
13534
  `${this.currentStage} ${progressBar} ${Math.round(this.currentProgress)}%`
13609
13535
  );
13610
13536
  }
@@ -13613,7 +13539,7 @@ var ProgressRenderer = class {
13613
13539
  */
13614
13540
  handleStageComplete(event) {
13615
13541
  if (this.spinner) {
13616
- this.spinner.succeed(chalk11.green(`\u2713 ${event.stageName} completed`));
13542
+ this.spinner.succeed(chalk3.green(`\u2713 ${event.stageName} completed`));
13617
13543
  this.spinner = null;
13618
13544
  }
13619
13545
  }
@@ -13622,7 +13548,7 @@ var ProgressRenderer = class {
13622
13548
  */
13623
13549
  handleStageError(event) {
13624
13550
  if (this.spinner) {
13625
- this.spinner.fail(chalk11.red(`\u2717 ${event.stageName} failed: ${event.message || "Unknown error"}`));
13551
+ this.spinner.fail(chalk3.red(`\u2717 ${event.stageName} failed: ${event.message || "Unknown error"}`));
13626
13552
  this.spinner = null;
13627
13553
  }
13628
13554
  }
@@ -13643,7 +13569,7 @@ var ProgressRenderer = class {
13643
13569
  */
13644
13570
  handleCheckpoint(event) {
13645
13571
  if (this.spinner) {
13646
- this.spinner.info(chalk11.yellow(`\u23F8 Checkpoint: ${event.message || "Waiting for user input"}`));
13572
+ this.spinner.info(chalk3.yellow(`\u23F8 Checkpoint: ${event.message || "Waiting for user input"}`));
13647
13573
  this.spinner = null;
13648
13574
  }
13649
13575
  }
@@ -13723,7 +13649,7 @@ var StageExecutionController = class {
13723
13649
  * @returns Stage execution result
13724
13650
  */
13725
13651
  async execute(agent, task, mode, options = {}) {
13726
- const runId = randomUUID3();
13652
+ const runId = randomUUID();
13727
13653
  this.currentRunId = runId;
13728
13654
  if (!agent.stages || agent.stages.length === 0) {
13729
13655
  throw new Error(
@@ -14012,12 +13938,12 @@ ${action.modifications}`;
14012
13938
  const checkpoint = await this.checkpointManager.loadCheckpoint(runId);
14013
13939
  const agent = await this.profileLoader.loadProfile(checkpoint.agent);
14014
13940
  const executionMode = mode || checkpoint.mode;
14015
- console.log(chalk12.blue(`
13941
+ console.log(chalk3.blue(`
14016
13942
  \u{1F4C2} Resuming run: ${runId}`));
14017
- console.log(chalk12.gray(`Agent: ${checkpoint.agent}`));
14018
- console.log(chalk12.gray(`Task: ${checkpoint.task}`));
13943
+ console.log(chalk3.gray(`Agent: ${checkpoint.agent}`));
13944
+ console.log(chalk3.gray(`Task: ${checkpoint.task}`));
14019
13945
  console.log(
14020
- chalk12.gray(
13946
+ chalk3.gray(
14021
13947
  `Progress: ${checkpoint.lastCompletedStageIndex + 1}/${checkpoint.stages.length} stages completed`
14022
13948
  )
14023
13949
  );
@@ -14334,12 +14260,12 @@ ${action.modifications}`;
14334
14260
  const delay = stageConfig.retryDelay * Math.pow(2, attempt - 1);
14335
14261
  if (!context.mode.interactive) {
14336
14262
  console.log(
14337
- chalk12.yellow(
14263
+ chalk3.yellow(
14338
14264
  `
14339
14265
  \u26A0\uFE0F Retrying stage "${stage.name}" (attempt ${attempt + 1}/${stageConfig.maxRetries + 1})...`
14340
14266
  )
14341
14267
  );
14342
- console.log(chalk12.gray(` Waiting ${delay}ms before retry...`));
14268
+ console.log(chalk3.gray(` Waiting ${delay}ms before retry...`));
14343
14269
  await new Promise((resolve10) => setTimeout(resolve10, delay));
14344
14270
  } else {
14345
14271
  await new Promise((resolve10) => setTimeout(resolve10, delay));
@@ -14463,7 +14389,7 @@ ${action.modifications}`;
14463
14389
  if (context.mode.autoConfirm) {
14464
14390
  return { action: "continue" };
14465
14391
  }
14466
- console.log(chalk12.green(`
14392
+ console.log(chalk3.green(`
14467
14393
  \u2713 Stage "${stage.name}" completed
14468
14394
  `));
14469
14395
  const action = await this.promptManager.promptCheckpointAction(
@@ -14507,7 +14433,7 @@ ${action.modifications}`;
14507
14433
  await this.hooks.onCheckpoint(checkpoint, context);
14508
14434
  }
14509
14435
  if (!context.options.quiet) {
14510
- console.log(chalk12.gray(`\u{1F4BE} Checkpoint saved: ${context.runId}`));
14436
+ console.log(chalk3.gray(`\u{1F4BE} Checkpoint saved: ${context.runId}`));
14511
14437
  }
14512
14438
  return checkpointPath;
14513
14439
  }
@@ -14640,18 +14566,18 @@ ${output}
14640
14566
  * @param task - Task description
14641
14567
  */
14642
14568
  displayPlan(stages, agent, task) {
14643
- console.log(chalk12.blue(`
14569
+ console.log(chalk3.blue(`
14644
14570
  \u{1F4CB} Execution Plan`));
14645
- console.log(chalk12.gray(`Agent: ${agent.displayName || agent.name}`));
14646
- console.log(chalk12.gray(`Task: ${task}`));
14647
- console.log(chalk12.gray(`Total Stages: ${stages.length}
14571
+ console.log(chalk3.gray(`Agent: ${agent.displayName || agent.name}`));
14572
+ console.log(chalk3.gray(`Task: ${task}`));
14573
+ console.log(chalk3.gray(`Total Stages: ${stages.length}
14648
14574
  `));
14649
14575
  stages.forEach((stage, index) => {
14650
- const number = chalk12.cyan(`${index + 1}.`);
14651
- const name = chalk12.white(stage.name);
14652
- const time = stage.estimatedTime ? chalk12.gray(` (${stage.estimatedTime})`) : "";
14576
+ const number = chalk3.cyan(`${index + 1}.`);
14577
+ const name = chalk3.white(stage.name);
14578
+ const time = stage.estimatedTime ? chalk3.gray(` (${stage.estimatedTime})`) : "";
14653
14579
  console.log(`${number} ${name}${time}`);
14654
- console.log(chalk12.gray(` ${stage.description}`));
14580
+ console.log(chalk3.gray(` ${stage.description}`));
14655
14581
  });
14656
14582
  console.log();
14657
14583
  }
@@ -14663,12 +14589,12 @@ ${output}
14663
14589
  * @param total - Total stages
14664
14590
  */
14665
14591
  displayStageStart(stage, current, total) {
14666
- const prefix = chalk12.blue(`[${current}/${total}]`);
14667
- const name = chalk12.white(stage.name);
14592
+ const prefix = chalk3.blue(`[${current}/${total}]`);
14593
+ const name = chalk3.white(stage.name);
14668
14594
  console.log(`
14669
14595
  ${prefix} ${name}`);
14670
14596
  if (!this.progressRenderer) {
14671
- this.spinner = ora5({
14597
+ this.spinner = ora({
14672
14598
  text: stage.description,
14673
14599
  color: "cyan"
14674
14600
  }).start();
@@ -14697,7 +14623,7 @@ ${prefix} ${name}`);
14697
14623
  */
14698
14624
  displaySummary(results, totalDuration, success) {
14699
14625
  console.log(
14700
- chalk12.blue(
14626
+ chalk3.blue(
14701
14627
  `
14702
14628
  ${"=".repeat(60)}
14703
14629
  ${success ? "\u2705 " : "\u274C "}Execution Summary
@@ -14707,17 +14633,17 @@ ${"=".repeat(60)}`
14707
14633
  const completed = results.filter((r) => r.status === "completed").length;
14708
14634
  const skipped = results.filter((r) => r.status === "skipped").length;
14709
14635
  const failed = results.filter((r) => r.status === "error").length;
14710
- console.log(chalk12.white(`Stages Completed: ${completed}/${results.length}`));
14636
+ console.log(chalk3.white(`Stages Completed: ${completed}/${results.length}`));
14711
14637
  if (skipped > 0) {
14712
- console.log(chalk12.yellow(`Stages Skipped: ${skipped}`));
14638
+ console.log(chalk3.yellow(`Stages Skipped: ${skipped}`));
14713
14639
  }
14714
14640
  if (failed > 0) {
14715
- console.log(chalk12.red(`Stages Failed: ${failed}`));
14641
+ console.log(chalk3.red(`Stages Failed: ${failed}`));
14716
14642
  }
14717
14643
  const totalTokens = results.reduce((sum, r) => sum + r.tokensUsed, 0);
14718
- console.log(chalk12.white(`Total Duration: ${(totalDuration / 1e3).toFixed(1)}s`));
14719
- console.log(chalk12.white(`Total Tokens: ${totalTokens}`));
14720
- console.log(chalk12.blue(`${"=".repeat(60)}
14644
+ console.log(chalk3.white(`Total Duration: ${(totalDuration / 1e3).toFixed(1)}s`));
14645
+ console.log(chalk3.white(`Total Tokens: ${totalTokens}`));
14646
+ console.log(chalk3.blue(`${"=".repeat(60)}
14721
14647
  `));
14722
14648
  }
14723
14649
  /**
@@ -14775,14 +14701,9 @@ init_claude_provider();
14775
14701
  init_gemini_provider();
14776
14702
  init_openai_provider();
14777
14703
  init_logger();
14778
- import chalk14 from "chalk";
14779
- import { join as join10 } from "path";
14780
- import { writeFileSync } from "fs";
14781
- import { mkdir as mkdir4 } from "fs/promises";
14782
14704
 
14783
14705
  // src/utils/output-formatter.ts
14784
14706
  init_esm_shims();
14785
- import chalk13 from "chalk";
14786
14707
  function formatOutput(result, format, verbose = false) {
14787
14708
  switch (format) {
14788
14709
  case "json":
@@ -14830,16 +14751,16 @@ function formatAsMarkdown(result, verbose) {
14830
14751
  function formatAsText(result, verbose) {
14831
14752
  const output = [];
14832
14753
  if (!verbose) {
14833
- output.push(chalk13.cyan("\n\u{1F4DD} Result:\n"));
14754
+ output.push(chalk3.cyan("\n\u{1F4DD} Result:\n"));
14834
14755
  output.push(result.response.content);
14835
14756
  output.push("\n");
14836
14757
  }
14837
14758
  if (verbose) {
14838
- output.push(chalk13.gray(`
14759
+ output.push(chalk3.gray(`
14839
14760
  Model: ${result.response.model}`));
14840
- output.push(chalk13.gray(`Latency: ${result.response.latencyMs}ms`));
14761
+ output.push(chalk3.gray(`Latency: ${result.response.latencyMs}ms`));
14841
14762
  if (result.response.tokensUsed) {
14842
- output.push(chalk13.gray(`Tokens: ${result.response.tokensUsed.total || "N/A"}`));
14763
+ output.push(chalk3.gray(`Tokens: ${result.response.tokensUsed.total || "N/A"}`));
14843
14764
  }
14844
14765
  }
14845
14766
  return output.join("\n");
@@ -14928,14 +14849,14 @@ var runCommand = {
14928
14849
  },
14929
14850
  handler: async (argv2) => {
14930
14851
  if (!argv2.agent || typeof argv2.agent !== "string") {
14931
- console.log(chalk14.red.bold("\n\u274C Error: Agent name is required\n"));
14852
+ console.log(chalk3.red.bold("\n\u274C Error: Agent name is required\n"));
14932
14853
  process.exit(1);
14933
14854
  }
14934
14855
  if (!argv2.task || typeof argv2.task !== "string") {
14935
- console.log(chalk14.red.bold("\n\u274C Error: Task is required\n"));
14856
+ console.log(chalk3.red.bold("\n\u274C Error: Task is required\n"));
14936
14857
  process.exit(1);
14937
14858
  }
14938
- console.log(chalk14.blue.bold(`
14859
+ console.log(chalk3.blue.bold(`
14939
14860
  \u{1F916} AutomatosX - Running ${argv2.agent}
14940
14861
  `));
14941
14862
  let memoryManager;
@@ -14947,15 +14868,15 @@ var runCommand = {
14947
14868
  const projectDir = await detectProjectRoot(process.cwd());
14948
14869
  const config = await loadConfig(projectDir);
14949
14870
  if (argv2.verbose) {
14950
- console.log(chalk14.gray(`Project: ${projectDir}`));
14951
- console.log(chalk14.gray(`Working directory: ${process.cwd()}`));
14871
+ console.log(chalk3.gray(`Project: ${projectDir}`));
14872
+ console.log(chalk3.gray(`Working directory: ${process.cwd()}`));
14952
14873
  console.log();
14953
14874
  }
14954
14875
  const teamManager = new TeamManager(
14955
- join10(projectDir, ".automatosx", "teams")
14876
+ join(projectDir, ".automatosx", "teams")
14956
14877
  );
14957
14878
  const profileLoader = new ProfileLoader(
14958
- join10(projectDir, ".automatosx", "agents"),
14879
+ join(projectDir, ".automatosx", "agents"),
14959
14880
  void 0,
14960
14881
  // fallbackProfilesDir (uses default)
14961
14882
  teamManager
@@ -14964,48 +14885,48 @@ var runCommand = {
14964
14885
  resolvedAgentName = await profileLoader.resolveAgentName(argv2.agent);
14965
14886
  if (argv2.verbose) {
14966
14887
  if (resolvedAgentName !== argv2.agent) {
14967
- console.log(chalk14.gray(`Resolved agent: ${argv2.agent} \u2192 ${resolvedAgentName}`));
14888
+ console.log(chalk3.gray(`Resolved agent: ${argv2.agent} \u2192 ${resolvedAgentName}`));
14968
14889
  }
14969
14890
  }
14970
14891
  } catch (error) {
14971
- console.error(chalk14.red.bold(`
14892
+ console.error(chalk3.red.bold(`
14972
14893
  \u274C Agent not found: ${argv2.agent}
14973
14894
  `));
14974
14895
  try {
14975
14896
  const suggestions = await profileLoader.findSimilarAgents(argv2.agent, 3);
14976
14897
  const closeSuggestions = suggestions.filter((s) => s.distance <= 3);
14977
14898
  if (closeSuggestions.length > 0) {
14978
- console.log(chalk14.yellow("\u{1F4A1} Did you mean:\n"));
14899
+ console.log(chalk3.yellow("\u{1F4A1} Did you mean:\n"));
14979
14900
  closeSuggestions.forEach((s, i) => {
14980
14901
  const displayInfo = s.displayName ? `${s.displayName} (${s.name})` : s.name;
14981
14902
  const roleInfo = s.role ? ` - ${s.role}` : "";
14982
- console.log(chalk14.cyan(` ${i + 1}. ${displayInfo}${roleInfo}`));
14903
+ console.log(chalk3.cyan(` ${i + 1}. ${displayInfo}${roleInfo}`));
14983
14904
  });
14984
14905
  console.log();
14985
14906
  } else {
14986
- console.log(chalk14.gray('Run "ax agent list" to see available agents.\n'));
14907
+ console.log(chalk3.gray('Run "ax agent list" to see available agents.\n'));
14987
14908
  }
14988
14909
  } catch {
14989
- console.log(chalk14.gray('Run "ax agent list" to see available agents.\n'));
14910
+ console.log(chalk3.gray('Run "ax agent list" to see available agents.\n'));
14990
14911
  }
14991
14912
  process.exit(1);
14992
14913
  }
14993
14914
  const abilitiesManager = new AbilitiesManager(
14994
- join10(projectDir, ".automatosx", "abilities")
14915
+ join(projectDir, ".automatosx", "abilities")
14995
14916
  );
14996
14917
  try {
14997
14918
  if (argv2.memory || argv2.saveMemory) {
14998
14919
  memoryManager = await MemoryManager.create({
14999
- dbPath: join10(projectDir, ".automatosx", "memory", "memory.db")
14920
+ dbPath: join(projectDir, ".automatosx", "memory", "memory.db")
15000
14921
  });
15001
14922
  if (argv2.verbose) {
15002
- console.log(chalk14.green("\u2713 Memory system initialized (FTS5 full-text search)\n"));
14923
+ console.log(chalk3.green("\u2713 Memory system initialized (FTS5 full-text search)\n"));
15003
14924
  }
15004
14925
  }
15005
14926
  } catch (error) {
15006
14927
  const errMsg = error instanceof Error ? error.message : String(error);
15007
14928
  if (argv2.verbose) {
15008
- console.log(chalk14.yellow(`\u26A0 Memory features disabled: ${errMsg}
14929
+ console.log(chalk3.yellow(`\u26A0 Memory features disabled: ${errMsg}
15009
14930
  `));
15010
14931
  }
15011
14932
  argv2.memory = false;
@@ -15014,7 +14935,7 @@ var runCommand = {
15014
14935
  const pathResolver = new PathResolver({
15015
14936
  projectDir,
15016
14937
  workingDir: process.cwd(),
15017
- agentWorkspace: join10(projectDir, ".automatosx", "workspaces")
14938
+ agentWorkspace: join(projectDir, ".automatosx", "workspaces")
15018
14939
  });
15019
14940
  const providers = [];
15020
14941
  if (config.providers["claude-code"]?.enabled) {
@@ -15051,24 +14972,24 @@ var runCommand = {
15051
14972
  let sessionManager;
15052
14973
  let workspaceManager;
15053
14974
  sessionManager = new SessionManager({
15054
- persistencePath: join10(projectDir, ".automatosx", "sessions", "sessions.json")
14975
+ persistencePath: join(projectDir, ".automatosx", "sessions", "sessions.json")
15055
14976
  });
15056
14977
  await sessionManager.initialize();
15057
14978
  workspaceManager = new WorkspaceManager(projectDir);
15058
14979
  if (argv2.session) {
15059
14980
  const session = await sessionManager.getSession(argv2.session);
15060
14981
  if (!session) {
15061
- console.log(chalk14.red.bold(`
14982
+ console.log(chalk3.red.bold(`
15062
14983
  \u2717 Session not found: ${argv2.session}
15063
14984
  `));
15064
14985
  process.exit(1);
15065
14986
  }
15066
14987
  await sessionManager.addAgent(argv2.session, resolvedAgentName);
15067
14988
  if (argv2.verbose) {
15068
- console.log(chalk14.cyan(`
14989
+ console.log(chalk3.cyan(`
15069
14990
  \u{1F517} Joined session: ${argv2.session}`));
15070
- console.log(chalk14.gray(`Session task: ${session.task}`));
15071
- console.log(chalk14.gray(`Agents in session: ${session.agents.join(", ")}
14991
+ console.log(chalk3.gray(`Session task: ${session.task}`));
14992
+ console.log(chalk3.gray(`Agents in session: ${session.agents.join(", ")}
15072
14993
  `));
15073
14994
  }
15074
14995
  }
@@ -15082,7 +15003,7 @@ var runCommand = {
15082
15003
  workspaceManager
15083
15004
  });
15084
15005
  if (argv2.verbose) {
15085
- console.log(chalk14.gray("Creating execution context..."));
15006
+ console.log(chalk3.gray("Creating execution context..."));
15086
15007
  console.log();
15087
15008
  }
15088
15009
  try {
@@ -15099,32 +15020,32 @@ var runCommand = {
15099
15020
  } catch (error) {
15100
15021
  if (error instanceof AgentNotFoundError) {
15101
15022
  const agentName = resolvedAgentName;
15102
- console.log(chalk14.red.bold(`
15023
+ console.log(chalk3.red.bold(`
15103
15024
  \u274C Agent not found: ${agentName}
15104
15025
  `));
15105
15026
  const suggestions = await profileLoader.findSimilarAgents(agentName, 3);
15106
15027
  if (suggestions.length > 0) {
15107
15028
  const closeSuggestions = suggestions.filter((s) => s.distance <= 3);
15108
15029
  if (closeSuggestions.length > 0) {
15109
- console.log(chalk14.yellow("\u{1F4A1} Did you mean:\n"));
15030
+ console.log(chalk3.yellow("\u{1F4A1} Did you mean:\n"));
15110
15031
  closeSuggestions.forEach((s, i) => {
15111
15032
  const displayInfo = s.displayName ? `${s.displayName} (${s.name})` : s.name;
15112
15033
  const roleInfo = s.role ? ` - ${s.role}` : "";
15113
- console.log(chalk14.cyan(` ${i + 1}. ${displayInfo}${roleInfo}`));
15034
+ console.log(chalk3.cyan(` ${i + 1}. ${displayInfo}${roleInfo}`));
15114
15035
  });
15115
- console.log(chalk14.gray("\nTo use one of these agents:"));
15116
- console.log(chalk14.gray(` automatosx run ${closeSuggestions[0].name} "${argv2.task}"`));
15036
+ console.log(chalk3.gray("\nTo use one of these agents:"));
15037
+ console.log(chalk3.gray(` automatosx run ${closeSuggestions[0].name} "${argv2.task}"`));
15117
15038
  console.log();
15118
15039
  } else {
15119
- console.log(chalk14.yellow("\u{1F4A1} Available agents:\n"));
15040
+ console.log(chalk3.yellow("\u{1F4A1} Available agents:\n"));
15120
15041
  const allAgents = await profileLoader.listProfiles();
15121
15042
  allAgents.slice(0, 10).forEach((name) => {
15122
- console.log(chalk14.cyan(` \u2022 ${name}`));
15043
+ console.log(chalk3.cyan(` \u2022 ${name}`));
15123
15044
  });
15124
15045
  if (allAgents.length > 10) {
15125
- console.log(chalk14.gray(` ... and ${allAgents.length - 10} more`));
15046
+ console.log(chalk3.gray(` ... and ${allAgents.length - 10} more`));
15126
15047
  }
15127
- console.log(chalk14.gray('\nRun "automatosx list agents" to see all agents\n'));
15048
+ console.log(chalk3.gray('\nRun "automatosx list agents" to see all agents\n'));
15128
15049
  }
15129
15050
  }
15130
15051
  process.exit(1);
@@ -15151,12 +15072,12 @@ var runCommand = {
15151
15072
  }
15152
15073
  if (useInteractiveController) {
15153
15074
  if (argv2.verbose) {
15154
- console.log(chalk14.cyan(`
15075
+ console.log(chalk3.cyan(`
15155
15076
  \u{1F4CB} Interactive stage execution (${context.agent.stages.length} stages) [enabled via ${enabledVia}]
15156
15077
  `));
15157
15078
  }
15158
15079
  const stageConfig = config.execution?.stages;
15159
- const checkpointPath = stageConfig?.checkpointPath || join10(projectDir, ".automatosx", "checkpoints");
15080
+ const checkpointPath = stageConfig?.checkpointPath || join(projectDir, ".automatosx", "checkpoints");
15160
15081
  const cleanupAfterDays = stageConfig?.cleanupAfterDays || 7;
15161
15082
  const agentExecutor = new AgentExecutor({
15162
15083
  sessionManager,
@@ -15199,10 +15120,10 @@ var runCommand = {
15199
15120
  executionMode,
15200
15121
  { showPlan: true, verbose: argv2.verbose }
15201
15122
  );
15202
- console.log(chalk14.green("\n\u2705 Execution completed successfully"));
15123
+ console.log(chalk3.green("\n\u2705 Execution completed successfully"));
15203
15124
  if (result.checkpointPath) {
15204
- console.log(chalk14.gray(`Checkpoint saved: ${result.runId}`));
15205
- console.log(chalk14.gray(`Resume with: ax resume ${result.runId}`));
15125
+ console.log(chalk3.gray(`Checkpoint saved: ${result.runId}`));
15126
+ console.log(chalk3.gray(`Resume with: ax resume ${result.runId}`));
15206
15127
  }
15207
15128
  if (argv2.saveMemory && memoryManager) {
15208
15129
  try {
@@ -15221,11 +15142,11 @@ Task: ${argv2.task}
15221
15142
  Result: ${result.stages.map((s) => s.output).join("\n\n")}`;
15222
15143
  await memoryManager.add(content, embedding, metadata);
15223
15144
  if (argv2.verbose) {
15224
- console.log(chalk14.green("\u2713 Conversation saved to memory"));
15145
+ console.log(chalk3.green("\u2713 Conversation saved to memory"));
15225
15146
  }
15226
15147
  } catch (error) {
15227
15148
  if (argv2.verbose) {
15228
- console.log(chalk14.yellow(`\u26A0 Failed to save to memory: ${error.message}`));
15149
+ console.log(chalk3.yellow(`\u26A0 Failed to save to memory: ${error.message}`));
15229
15150
  }
15230
15151
  }
15231
15152
  }
@@ -15234,11 +15155,11 @@ Result: ${result.stages.map((s) => s.output).join("\n\n")}`;
15234
15155
  (s) => s.dependencies && s.dependencies.length > 0 || s.parallel || s.condition
15235
15156
  );
15236
15157
  if (argv2.verbose) {
15237
- console.log(chalk14.cyan(`
15158
+ console.log(chalk3.cyan(`
15238
15159
  \u{1F4CB} Multi-stage execution detected (${context.agent.stages.length} stages)
15239
15160
  `));
15240
15161
  if (hasAdvancedFeatures) {
15241
- console.log(chalk14.cyan("\u2728 Advanced features enabled (dependencies/parallel/conditions)\n"));
15162
+ console.log(chalk3.cyan("\u2728 Advanced features enabled (dependencies/parallel/conditions)\n"));
15242
15163
  }
15243
15164
  }
15244
15165
  let multiStageResult;
@@ -15295,8 +15216,8 @@ Result: ${result.stages.map((s) => s.output).join("\n\n")}`;
15295
15216
  if (argv2.save) {
15296
15217
  try {
15297
15218
  const savePath = argv2.save;
15298
- const saveDir = join10(savePath, "..");
15299
- await mkdir4(saveDir, { recursive: true });
15219
+ const saveDir = join(savePath, "..");
15220
+ await mkdir(saveDir, { recursive: true });
15300
15221
  let outputData;
15301
15222
  if (argv2.format === "json") {
15302
15223
  outputData = JSON.stringify({
@@ -15323,11 +15244,11 @@ Result: ${result.stages.map((s) => s.output).join("\n\n")}`;
15323
15244
  outputData = multiStageResult.finalOutput;
15324
15245
  }
15325
15246
  writeFileSync(savePath, outputData, "utf-8");
15326
- console.log(chalk14.green(`
15247
+ console.log(chalk3.green(`
15327
15248
  \u2705 Result saved to: ${savePath}
15328
15249
  `));
15329
15250
  } catch (error) {
15330
- console.log(chalk14.yellow(`\u26A0 Failed to save result: ${error.message}
15251
+ console.log(chalk3.yellow(`\u26A0 Failed to save result: ${error.message}
15331
15252
  `));
15332
15253
  }
15333
15254
  }
@@ -15348,11 +15269,11 @@ Task: ${argv2.task}
15348
15269
  Result: ${multiStageResult.finalOutput}`;
15349
15270
  await memoryManager.add(content, embedding, metadata);
15350
15271
  if (argv2.verbose) {
15351
- console.log(chalk14.green("\u2713 Conversation saved to memory"));
15272
+ console.log(chalk3.green("\u2713 Conversation saved to memory"));
15352
15273
  }
15353
15274
  } catch (error) {
15354
15275
  if (argv2.verbose) {
15355
- console.log(chalk14.yellow(`\u26A0 Failed to save to memory: ${error.message}`));
15276
+ console.log(chalk3.yellow(`\u26A0 Failed to save to memory: ${error.message}`));
15356
15277
  }
15357
15278
  }
15358
15279
  }
@@ -15394,18 +15315,18 @@ Result: ${multiStageResult.finalOutput}`;
15394
15315
  if (argv2.save) {
15395
15316
  try {
15396
15317
  const savePath = argv2.save;
15397
- const saveDir = join10(savePath, "..");
15398
- await mkdir4(saveDir, { recursive: true });
15318
+ const saveDir = join(savePath, "..");
15319
+ await mkdir(saveDir, { recursive: true });
15399
15320
  const outputData = formatForSave(result, argv2.format || "text", {
15400
15321
  agent: resolvedAgentName,
15401
15322
  task: argv2.task
15402
15323
  });
15403
15324
  writeFileSync(savePath, outputData, "utf-8");
15404
- console.log(chalk14.green(`
15325
+ console.log(chalk3.green(`
15405
15326
  \u2705 Result saved to: ${savePath}
15406
15327
  `));
15407
15328
  } catch (error) {
15408
- console.log(chalk14.yellow(`\u26A0 Failed to save result: ${error.message}
15329
+ console.log(chalk3.yellow(`\u26A0 Failed to save result: ${error.message}
15409
15330
  `));
15410
15331
  }
15411
15332
  }
@@ -15426,11 +15347,11 @@ Task: ${argv2.task}
15426
15347
  Response: ${result.response.content}`;
15427
15348
  await memoryManager.add(content, embedding, metadata);
15428
15349
  if (argv2.verbose) {
15429
- console.log(chalk14.green("\u2713 Conversation saved to memory"));
15350
+ console.log(chalk3.green("\u2713 Conversation saved to memory"));
15430
15351
  }
15431
15352
  } catch (error) {
15432
15353
  if (argv2.verbose) {
15433
- console.log(chalk14.yellow(`\u26A0 Failed to save to memory: ${error.message}`));
15354
+ console.log(chalk3.yellow(`\u26A0 Failed to save to memory: ${error.message}`));
15434
15355
  }
15435
15356
  }
15436
15357
  }
@@ -15443,7 +15364,7 @@ Response: ${result.response.content}`;
15443
15364
  router.destroy();
15444
15365
  }
15445
15366
  await new Promise((resolve10) => setImmediate(resolve10));
15446
- console.log(chalk14.green.bold("\u2705 Complete\n"));
15367
+ console.log(chalk3.green.bold("\u2705 Complete\n"));
15447
15368
  process.exit(0);
15448
15369
  } catch (error) {
15449
15370
  const err = error instanceof Error ? error : new Error(String(error));
@@ -15485,16 +15406,15 @@ init_esm_shims();
15485
15406
  // src/cli/utils/session-utils.ts
15486
15407
  init_esm_shims();
15487
15408
  init_path_resolver();
15488
- import { join as join11 } from "path";
15489
15409
  async function createSessionManager() {
15490
15410
  try {
15491
15411
  const projectDir = await new PathResolver({
15492
15412
  projectDir: process.cwd(),
15493
15413
  workingDir: process.cwd(),
15494
- agentWorkspace: join11(process.cwd(), ".automatosx", "workspaces")
15414
+ agentWorkspace: join(process.cwd(), ".automatosx", "workspaces")
15495
15415
  }).detectProjectRoot();
15496
15416
  const sessionManager = new SessionManager({
15497
- persistencePath: join11(projectDir, ".automatosx", "sessions", "sessions.json")
15417
+ persistencePath: join(projectDir, ".automatosx", "sessions", "sessions.json")
15498
15418
  });
15499
15419
  await sessionManager.initialize();
15500
15420
  return sessionManager;
@@ -15506,10 +15426,6 @@ Make sure you're in an AutomatosX project directory or run 'automatosx init' fir
15506
15426
  );
15507
15427
  }
15508
15428
  }
15509
-
15510
- // src/cli/commands/session.ts
15511
- import chalk15 from "chalk";
15512
- import Table2 from "cli-table3";
15513
15429
  var createCommand = {
15514
15430
  command: "create <task> <initiator>",
15515
15431
  describe: "Create a new multi-agent session",
@@ -15528,17 +15444,17 @@ var createCommand = {
15528
15444
  try {
15529
15445
  const sessionManager = await createSessionManager();
15530
15446
  const session = await sessionManager.createSession(argv2.task, argv2.initiator);
15531
- console.log(chalk15.green.bold("\n\u2713 Session created successfully\n"));
15532
- console.log(chalk15.gray(`Session ID: ${chalk15.white(session.id)}`));
15533
- console.log(chalk15.gray(`Task: ${chalk15.white(session.task)}`));
15534
- console.log(chalk15.gray(`Initiator: ${chalk15.white(session.initiator)}`));
15535
- console.log(chalk15.gray(`Status: ${chalk15.white(session.status)}`));
15536
- console.log(chalk15.gray(`Created: ${chalk15.white(session.createdAt.toISOString())}`));
15447
+ console.log(chalk3.green.bold("\n\u2713 Session created successfully\n"));
15448
+ console.log(chalk3.gray(`Session ID: ${chalk3.white(session.id)}`));
15449
+ console.log(chalk3.gray(`Task: ${chalk3.white(session.task)}`));
15450
+ console.log(chalk3.gray(`Initiator: ${chalk3.white(session.initiator)}`));
15451
+ console.log(chalk3.gray(`Status: ${chalk3.white(session.status)}`));
15452
+ console.log(chalk3.gray(`Created: ${chalk3.white(session.createdAt.toISOString())}`));
15537
15453
  console.log();
15538
15454
  process.exit(0);
15539
15455
  } catch (error) {
15540
- console.error(chalk15.red.bold("\n\u2717 Failed to create session\n"));
15541
- console.error(chalk15.red(error.message));
15456
+ console.error(chalk3.red.bold("\n\u2717 Failed to create session\n"));
15457
+ console.error(chalk3.red(error.message));
15542
15458
  process.exit(1);
15543
15459
  }
15544
15460
  }
@@ -15572,13 +15488,13 @@ var listCommand3 = {
15572
15488
  process.exit(0);
15573
15489
  }
15574
15490
  if (sessions.length === 0) {
15575
- console.log(chalk15.yellow("\nNo sessions found\n"));
15491
+ console.log(chalk3.yellow("\nNo sessions found\n"));
15576
15492
  process.exit(0);
15577
15493
  }
15578
- console.log(chalk15.blue.bold(`
15494
+ console.log(chalk3.blue.bold(`
15579
15495
  \u{1F4CB} Sessions (${sessions.length})
15580
15496
  `));
15581
- const table = new Table2({
15497
+ const table = new Table({
15582
15498
  head: ["ID", "Task", "Initiator", "Agents", "Status", "Created"],
15583
15499
  colWidths: [38, 40, 15, 25, 12, 12]
15584
15500
  });
@@ -15596,8 +15512,8 @@ var listCommand3 = {
15596
15512
  console.log();
15597
15513
  process.exit(0);
15598
15514
  } catch (error) {
15599
- console.error(chalk15.red.bold("\n\u2717 Failed to list sessions\n"));
15600
- console.error(chalk15.red(error.message));
15515
+ console.error(chalk3.red.bold("\n\u2717 Failed to list sessions\n"));
15516
+ console.error(chalk3.red(error.message));
15601
15517
  process.exit(1);
15602
15518
  }
15603
15519
  }
@@ -15621,7 +15537,7 @@ var statusCommand = {
15621
15537
  const sessionManager = await createSessionManager();
15622
15538
  const session = await sessionManager.getSession(argv2.id);
15623
15539
  if (!session) {
15624
- console.log(chalk15.red.bold(`
15540
+ console.log(chalk3.red.bold(`
15625
15541
  \u2717 Session not found: ${argv2.id}
15626
15542
  `));
15627
15543
  process.exit(1);
@@ -15630,26 +15546,26 @@ var statusCommand = {
15630
15546
  console.log(JSON.stringify(session, null, 2));
15631
15547
  process.exit(0);
15632
15548
  }
15633
- console.log(chalk15.blue.bold("\n\u{1F4CA} Session Status\n"));
15634
- console.log(chalk15.gray(`ID: ${chalk15.white(session.id)}`));
15635
- console.log(chalk15.gray(`Task: ${chalk15.white(session.task)}`));
15636
- console.log(chalk15.gray(`Initiator: ${chalk15.white(session.initiator)}`));
15637
- console.log(chalk15.gray(`Status: ${chalk15.white(session.status)}`));
15638
- console.log(chalk15.gray(`Agents: ${chalk15.white(session.agents.join(", "))}`));
15639
- console.log(chalk15.gray(`Created: ${chalk15.white(session.createdAt.toISOString())}`));
15640
- console.log(chalk15.gray(`Updated: ${chalk15.white(session.updatedAt.toISOString())}`));
15549
+ console.log(chalk3.blue.bold("\n\u{1F4CA} Session Status\n"));
15550
+ console.log(chalk3.gray(`ID: ${chalk3.white(session.id)}`));
15551
+ console.log(chalk3.gray(`Task: ${chalk3.white(session.task)}`));
15552
+ console.log(chalk3.gray(`Initiator: ${chalk3.white(session.initiator)}`));
15553
+ console.log(chalk3.gray(`Status: ${chalk3.white(session.status)}`));
15554
+ console.log(chalk3.gray(`Agents: ${chalk3.white(session.agents.join(", "))}`));
15555
+ console.log(chalk3.gray(`Created: ${chalk3.white(session.createdAt.toISOString())}`));
15556
+ console.log(chalk3.gray(`Updated: ${chalk3.white(session.updatedAt.toISOString())}`));
15641
15557
  if (session.metadata && Object.keys(session.metadata).length > 0) {
15642
- console.log(chalk15.gray(`
15558
+ console.log(chalk3.gray(`
15643
15559
  Metadata:`));
15644
15560
  Object.entries(session.metadata).forEach(([key, value]) => {
15645
- console.log(chalk15.gray(` ${key}: ${JSON.stringify(value)}`));
15561
+ console.log(chalk3.gray(` ${key}: ${JSON.stringify(value)}`));
15646
15562
  });
15647
15563
  }
15648
15564
  console.log();
15649
15565
  process.exit(0);
15650
15566
  } catch (error) {
15651
- console.error(chalk15.red.bold("\n\u2717 Failed to get session status\n"));
15652
- console.error(chalk15.red(error.message));
15567
+ console.error(chalk3.red.bold("\n\u2717 Failed to get session status\n"));
15568
+ console.error(chalk3.red(error.message));
15653
15569
  process.exit(1);
15654
15570
  }
15655
15571
  }
@@ -15668,13 +15584,13 @@ var completeCommand = {
15668
15584
  try {
15669
15585
  const sessionManager = await createSessionManager();
15670
15586
  await sessionManager.completeSession(argv2.id);
15671
- console.log(chalk15.green.bold(`
15587
+ console.log(chalk3.green.bold(`
15672
15588
  \u2713 Session marked as completed: ${argv2.id}
15673
15589
  `));
15674
15590
  process.exit(0);
15675
15591
  } catch (error) {
15676
- console.error(chalk15.red.bold("\n\u2717 Failed to complete session\n"));
15677
- console.error(chalk15.red(error.message));
15592
+ console.error(chalk3.red.bold("\n\u2717 Failed to complete session\n"));
15593
+ console.error(chalk3.red(error.message));
15678
15594
  process.exit(1);
15679
15595
  }
15680
15596
  }
@@ -15693,13 +15609,13 @@ var failCommand = {
15693
15609
  try {
15694
15610
  const sessionManager = await createSessionManager();
15695
15611
  await sessionManager.failSession(argv2.id, new Error("Manually marked as failed"));
15696
- console.log(chalk15.yellow.bold(`
15612
+ console.log(chalk3.yellow.bold(`
15697
15613
  \u26A0 Session marked as failed: ${argv2.id}
15698
15614
  `));
15699
15615
  process.exit(0);
15700
15616
  } catch (error) {
15701
- console.error(chalk15.red.bold("\n\u2717 Failed to mark session as failed\n"));
15702
- console.error(chalk15.red(error.message));
15617
+ console.error(chalk3.red.bold("\n\u2717 Failed to mark session as failed\n"));
15618
+ console.error(chalk3.red(error.message));
15703
15619
  process.exit(1);
15704
15620
  }
15705
15621
  }
@@ -15721,35 +15637,7 @@ init_claude_provider();
15721
15637
  init_gemini_provider();
15722
15638
  init_openai_provider();
15723
15639
  init_logger();
15724
- import chalk16 from "chalk";
15725
- import { existsSync as existsSync7 } from "fs";
15726
- import { readdir as readdir6, stat as stat2 } from "fs/promises";
15727
- import { join as join12 } from "path";
15728
- import { createRequire as createRequire3 } from "module";
15729
- import os from "os";
15730
- var require2 = createRequire3(import.meta.url);
15731
- var VERSION = "unknown";
15732
- try {
15733
- const versionData = require2("../version.json");
15734
- VERSION = versionData.version || "unknown";
15735
- } catch (err) {
15736
- try {
15737
- const versionData = require2("../../version.json");
15738
- VERSION = versionData.version || "unknown";
15739
- } catch (err2) {
15740
- try {
15741
- const versionData = require2("../../../version.json");
15742
- VERSION = versionData.version || "unknown";
15743
- } catch (err3) {
15744
- try {
15745
- const packageJson = require2("../../../package.json");
15746
- VERSION = packageJson.version || "unknown";
15747
- } catch (err4) {
15748
- logger.debug("Version file not found, using fallback");
15749
- }
15750
- }
15751
- }
15752
- }
15640
+ var VERSION = getVersion();
15753
15641
  var statusCommand2 = {
15754
15642
  command: "status",
15755
15643
  describe: "Display system status and health",
@@ -15772,15 +15660,15 @@ var statusCommand2 = {
15772
15660
  const pathResolver = new PathResolver({
15773
15661
  projectDir,
15774
15662
  workingDir: process.cwd(),
15775
- agentWorkspace: join12(projectDir, ".automatosx", "workspaces")
15663
+ agentWorkspace: join(projectDir, ".automatosx", "workspaces")
15776
15664
  });
15777
15665
  const detectedProjectDir = await pathResolver.detectProjectRoot();
15778
- const automatosxDir = join12(detectedProjectDir, ".automatosx");
15779
- const agentsDir = join12(automatosxDir, "agents");
15780
- const abilitiesDir = join12(automatosxDir, "abilities");
15781
- const memoryDir = join12(automatosxDir, "memory");
15782
- const prdDir = join12(detectedProjectDir, "automatosx", "PRD");
15783
- const tmpDir = join12(detectedProjectDir, "automatosx", "tmp");
15666
+ const automatosxDir = join(detectedProjectDir, ".automatosx");
15667
+ const agentsDir = join(automatosxDir, "agents");
15668
+ const abilitiesDir = join(automatosxDir, "abilities");
15669
+ const memoryDir = join(automatosxDir, "memory");
15670
+ const prdDir = join(detectedProjectDir, "automatosx", "PRD");
15671
+ const tmpDir = join(detectedProjectDir, "automatosx", "tmp");
15784
15672
  const providers = [];
15785
15673
  if (config.providers["claude-code"]?.enabled) {
15786
15674
  providers.push(new ClaudeProvider({
@@ -15839,26 +15727,26 @@ var statusCommand2 = {
15839
15727
  },
15840
15728
  project: projectInfo,
15841
15729
  configuration: {
15842
- configFile: join12(detectedProjectDir, "automatosx.config.json"),
15843
- configExists: existsSync7(join12(detectedProjectDir, "automatosx.config.json")),
15730
+ configFile: join(detectedProjectDir, "automatosx.config.json"),
15731
+ configExists: existsSync(join(detectedProjectDir, "automatosx.config.json")),
15844
15732
  logLevel: config.logging.level,
15845
15733
  memoryMaxEntries: config.memory.maxEntries,
15846
15734
  memoryRetentionDays: config.memory.cleanupDays
15847
15735
  },
15848
15736
  directories: {
15849
- automatosx: { path: automatosxDir, exists: existsSync7(automatosxDir) },
15850
- agents: { path: agentsDir, exists: existsSync7(agentsDir), count: agentCount },
15851
- abilities: { path: abilitiesDir, exists: existsSync7(abilitiesDir), count: abilityCount },
15852
- memory: { path: memoryDir, exists: existsSync7(memoryDir), ...memoryStats },
15737
+ automatosx: { path: automatosxDir, exists: existsSync(automatosxDir) },
15738
+ agents: { path: agentsDir, exists: existsSync(agentsDir), count: agentCount },
15739
+ abilities: { path: abilitiesDir, exists: existsSync(abilitiesDir), count: abilityCount },
15740
+ memory: { path: memoryDir, exists: existsSync(memoryDir), ...memoryStats },
15853
15741
  prd: {
15854
15742
  path: prdDir,
15855
- exists: existsSync7(prdDir),
15743
+ exists: existsSync(prdDir),
15856
15744
  files: workspaceStats.prdFiles,
15857
15745
  sizeBytes: workspaceStats.prdSizeBytes
15858
15746
  },
15859
15747
  tmp: {
15860
15748
  path: tmpDir,
15861
- exists: existsSync7(tmpDir),
15749
+ exists: existsSync(tmpDir),
15862
15750
  files: workspaceStats.tmpFiles,
15863
15751
  sizeBytes: workspaceStats.tmpSizeBytes
15864
15752
  }
@@ -15876,43 +15764,43 @@ var statusCommand2 = {
15876
15764
  if (argv2.json) {
15877
15765
  console.log(JSON.stringify(status, null, 2));
15878
15766
  } else {
15879
- console.log(chalk16.blue.bold("\n\u{1F4CA} AutomatosX Status\n"));
15880
- console.log(chalk16.cyan("System:"));
15881
- console.log(` Version: ${chalk16.white(status.system.version)}`);
15882
- console.log(` Node: ${chalk16.white(status.system.nodeVersion)}`);
15883
- console.log(` Platform: ${chalk16.white(status.system.platform)}`);
15767
+ console.log(chalk3.blue.bold("\n\u{1F4CA} AutomatosX Status\n"));
15768
+ console.log(chalk3.cyan("System:"));
15769
+ console.log(` Version: ${chalk3.white(status.system.version)}`);
15770
+ console.log(` Node: ${chalk3.white(status.system.nodeVersion)}`);
15771
+ console.log(` Platform: ${chalk3.white(status.system.platform)}`);
15884
15772
  if (argv2.verbose) {
15885
- console.log(` Process Uptime: ${chalk16.white(formatUptime(status.system.uptime))}`);
15773
+ console.log(` Process Uptime: ${chalk3.white(formatUptime(status.system.uptime))}`);
15886
15774
  }
15887
15775
  console.log();
15888
15776
  if (status.project.name || argv2.verbose) {
15889
- console.log(chalk16.cyan("Project:"));
15777
+ console.log(chalk3.cyan("Project:"));
15890
15778
  if (status.project.name) {
15891
- console.log(` Name: ${chalk16.white(status.project.name)}`);
15779
+ console.log(` Name: ${chalk3.white(status.project.name)}`);
15892
15780
  }
15893
15781
  if (status.project.type) {
15894
- console.log(` Type: ${chalk16.white(status.project.type)}`);
15782
+ console.log(` Type: ${chalk3.white(status.project.type)}`);
15895
15783
  }
15896
- console.log(` Directory: ${chalk16.white(status.system.projectDir)}`);
15784
+ console.log(` Directory: ${chalk3.white(status.system.projectDir)}`);
15897
15785
  if (status.system.workingDir !== status.system.projectDir) {
15898
- console.log(` Working Dir: ${chalk16.white(status.system.workingDir)}`);
15786
+ console.log(` Working Dir: ${chalk3.white(status.system.workingDir)}`);
15899
15787
  }
15900
15788
  console.log();
15901
15789
  }
15902
- console.log(chalk16.cyan("Configuration:"));
15903
- const configIcon = status.configuration.configExists ? chalk16.green("\u2713") : chalk16.yellow("\u26A0");
15790
+ console.log(chalk3.cyan("Configuration:"));
15791
+ const configIcon = status.configuration.configExists ? chalk3.green("\u2713") : chalk3.yellow("\u26A0");
15904
15792
  const configText = status.configuration.configExists ? "found" : "using defaults";
15905
15793
  console.log(` ${configIcon} Config: ${configText}`);
15906
15794
  if (argv2.verbose && status.configuration.configExists) {
15907
- console.log(chalk16.gray(` ${status.configuration.configFile}`));
15795
+ console.log(chalk3.gray(` ${status.configuration.configFile}`));
15908
15796
  }
15909
- console.log(` Log Level: ${chalk16.white(status.configuration.logLevel)}`);
15910
- console.log(` Memory Limit: ${chalk16.white(status.configuration.memoryMaxEntries.toLocaleString())} entries`);
15911
- console.log(` Retention: ${chalk16.white(status.configuration.memoryRetentionDays)} days`);
15797
+ console.log(` Log Level: ${chalk3.white(status.configuration.logLevel)}`);
15798
+ console.log(` Memory Limit: ${chalk3.white(status.configuration.memoryMaxEntries.toLocaleString())} entries`);
15799
+ console.log(` Retention: ${chalk3.white(status.configuration.memoryRetentionDays)} days`);
15912
15800
  console.log();
15913
- console.log(chalk16.cyan("Resources:"));
15801
+ console.log(chalk3.cyan("Resources:"));
15914
15802
  for (const [name, dir] of Object.entries(status.directories)) {
15915
- const statusIcon = dir.exists ? chalk16.green("\u2713") : chalk16.red("\u2717");
15803
+ const statusIcon = dir.exists ? chalk3.green("\u2713") : chalk3.red("\u2717");
15916
15804
  let info = "";
15917
15805
  if (name === "agents" && "count" in dir) {
15918
15806
  const agentDir = dir;
@@ -15929,23 +15817,23 @@ var statusCommand2 = {
15929
15817
  }
15930
15818
  console.log(` ${statusIcon} ${name}${info}`);
15931
15819
  if (argv2.verbose) {
15932
- console.log(chalk16.gray(` ${dir.path}`));
15820
+ console.log(chalk3.gray(` ${dir.path}`));
15933
15821
  }
15934
15822
  }
15935
15823
  console.log();
15936
- console.log(chalk16.cyan("Providers:"));
15824
+ console.log(chalk3.cyan("Providers:"));
15937
15825
  for (const provider of status.providers) {
15938
- const statusIcon = provider.available ? chalk16.green("\u2713") : chalk16.red("\u2717");
15939
- const statusText = provider.available ? chalk16.green("available") : chalk16.red("unavailable");
15826
+ const statusIcon = provider.available ? chalk3.green("\u2713") : chalk3.red("\u2717");
15827
+ const statusText = provider.available ? chalk3.green("available") : chalk3.red("unavailable");
15940
15828
  console.log(` ${statusIcon} ${provider.name}: ${statusText} (priority: ${provider.priority})`);
15941
15829
  if (argv2.verbose) {
15942
- console.log(chalk16.gray(` Failures: ${provider.health.consecutiveFailures}`));
15943
- console.log(chalk16.gray(` Latency: ${provider.health.latencyMs}ms`));
15944
- console.log(chalk16.gray(` Error rate: ${(provider.health.errorRate * 100).toFixed(2)}%`));
15830
+ console.log(chalk3.gray(` Failures: ${provider.health.consecutiveFailures}`));
15831
+ console.log(chalk3.gray(` Latency: ${provider.health.latencyMs}ms`));
15832
+ console.log(chalk3.gray(` Error rate: ${(provider.health.errorRate * 100).toFixed(2)}%`));
15945
15833
  }
15946
15834
  }
15947
15835
  console.log();
15948
- console.log(chalk16.cyan("ENV Variable Overrides:"));
15836
+ console.log(chalk3.cyan("ENV Variable Overrides:"));
15949
15837
  const envVars = [
15950
15838
  { name: "CLAUDE_CLI", provider: "claude-code" },
15951
15839
  { name: "GEMINI_CLI", provider: "gemini-cli" },
@@ -15956,44 +15844,44 @@ var statusCommand2 = {
15956
15844
  const value = process.env[name];
15957
15845
  if (value) {
15958
15846
  hasAnyEnvVar = true;
15959
- const exists = existsSync7(value);
15960
- const icon = exists ? chalk16.green("\u2713") : chalk16.yellow("\u26A0");
15961
- const statusMsg = exists ? chalk16.green("valid") : chalk16.yellow("path not found");
15847
+ const exists = existsSync(value);
15848
+ const icon = exists ? chalk3.green("\u2713") : chalk3.yellow("\u26A0");
15849
+ const statusMsg = exists ? chalk3.green("valid") : chalk3.yellow("path not found");
15962
15850
  console.log(` ${icon} ${name}: ${statusMsg}`);
15963
15851
  if (argv2.verbose) {
15964
- console.log(chalk16.gray(` ${value}`));
15852
+ console.log(chalk3.gray(` ${value}`));
15965
15853
  }
15966
15854
  }
15967
15855
  }
15968
15856
  if (!hasAnyEnvVar) {
15969
- console.log(chalk16.gray(" No ENV variables set (using PATH detection)"));
15857
+ console.log(chalk3.gray(" No ENV variables set (using PATH detection)"));
15970
15858
  if (argv2.verbose) {
15971
- console.log(chalk16.gray(" Tip: Set CLAUDE_CLI, GEMINI_CLI, or CODEX_CLI to override detection"));
15859
+ console.log(chalk3.gray(" Tip: Set CLAUDE_CLI, GEMINI_CLI, or CODEX_CLI to override detection"));
15972
15860
  }
15973
15861
  }
15974
15862
  console.log();
15975
- console.log(chalk16.cyan("Router:"));
15976
- console.log(` Total providers: ${chalk16.white(status.router.totalProviders)}`);
15977
- console.log(` Available: ${chalk16.white(status.router.availableProviders)}`);
15978
- console.log(` Fallback: ${chalk16.white(status.router.fallbackEnabled ? "enabled" : "disabled")}`);
15863
+ console.log(chalk3.cyan("Router:"));
15864
+ console.log(` Total providers: ${chalk3.white(status.router.totalProviders)}`);
15865
+ console.log(` Available: ${chalk3.white(status.router.availableProviders)}`);
15866
+ console.log(` Fallback: ${chalk3.white(status.router.fallbackEnabled ? "enabled" : "disabled")}`);
15979
15867
  console.log();
15980
15868
  if (argv2.verbose) {
15981
- console.log(chalk16.cyan("Performance:"));
15982
- console.log(` Status check: ${chalk16.white(status.performance.statusCheckMs)}ms`);
15869
+ console.log(chalk3.cyan("Performance:"));
15870
+ console.log(` Status check: ${chalk3.white(status.performance.statusCheckMs)}ms`);
15983
15871
  console.log();
15984
15872
  }
15985
15873
  const allDirsExist = Object.values(status.directories).every((d) => d.exists);
15986
15874
  const hasAvailableProviders = status.router.availableProviders > 0;
15987
15875
  const isHealthy = allDirsExist && hasAvailableProviders;
15988
15876
  if (isHealthy) {
15989
- console.log(chalk16.green.bold("\u2705 System is healthy\n"));
15877
+ console.log(chalk3.green.bold("\u2705 System is healthy\n"));
15990
15878
  } else {
15991
- console.log(chalk16.yellow.bold("\u26A0\uFE0F System has issues\n"));
15879
+ console.log(chalk3.yellow.bold("\u26A0\uFE0F System has issues\n"));
15992
15880
  if (!allDirsExist) {
15993
- console.log(chalk16.yellow(" Some directories are missing. Run `automatosx init` to initialize."));
15881
+ console.log(chalk3.yellow(" Some directories are missing. Run `automatosx init` to initialize."));
15994
15882
  }
15995
15883
  if (!hasAvailableProviders) {
15996
- console.log(chalk16.yellow(" No providers available. Check provider configuration."));
15884
+ console.log(chalk3.yellow(" No providers available. Check provider configuration."));
15997
15885
  }
15998
15886
  console.log();
15999
15887
  }
@@ -16011,7 +15899,7 @@ var statusCommand2 = {
16011
15899
  }
16012
15900
  };
16013
15901
  async function getMemoryStatistics(memoryDir) {
16014
- if (!existsSync7(memoryDir)) {
15902
+ if (!existsSync(memoryDir)) {
16015
15903
  return { files: 0, sizeBytes: 0 };
16016
15904
  }
16017
15905
  try {
@@ -16029,15 +15917,15 @@ async function getDirectoryStats(dirPath) {
16029
15917
  let totalSize = 0;
16030
15918
  let totalFiles = 0;
16031
15919
  try {
16032
- const entries = await readdir6(dirPath, { withFileTypes: true });
15920
+ const entries = await readdir(dirPath, { withFileTypes: true });
16033
15921
  for (const entry of entries) {
16034
- const fullPath = join12(dirPath, entry.name);
15922
+ const fullPath = join(dirPath, entry.name);
16035
15923
  if (entry.isDirectory()) {
16036
15924
  const subStats = await getDirectoryStats(fullPath);
16037
15925
  totalSize += subStats.size;
16038
15926
  totalFiles += subStats.files;
16039
15927
  } else if (entry.isFile()) {
16040
- const stats = await stat2(fullPath);
15928
+ const stats = await stat(fullPath);
16041
15929
  totalSize += stats.size;
16042
15930
  totalFiles++;
16043
15931
  }
@@ -16047,11 +15935,11 @@ async function getDirectoryStats(dirPath) {
16047
15935
  return { size: totalSize, files: totalFiles };
16048
15936
  }
16049
15937
  async function countFiles(dirPath, extensions) {
16050
- if (!existsSync7(dirPath)) {
15938
+ if (!existsSync(dirPath)) {
16051
15939
  return 0;
16052
15940
  }
16053
15941
  try {
16054
- const files = await readdir6(dirPath);
15942
+ const files = await readdir(dirPath);
16055
15943
  return files.filter((f) => extensions.some((ext) => f.endsWith(ext))).length;
16056
15944
  } catch (error) {
16057
15945
  logger.warn("Failed to count files", { dirPath, error: error.message });
@@ -16059,12 +15947,12 @@ async function countFiles(dirPath, extensions) {
16059
15947
  }
16060
15948
  }
16061
15949
  async function getProjectInfo(projectDir) {
16062
- const packageJsonPath = join12(projectDir, "package.json");
16063
- if (!existsSync7(packageJsonPath)) {
15950
+ const packageJsonPath = join(projectDir, "package.json");
15951
+ if (!existsSync(packageJsonPath)) {
16064
15952
  return {};
16065
15953
  }
16066
15954
  try {
16067
- const { readFile: readFile7 } = await import("fs/promises");
15955
+ const { readFile: readFile7 } = await import('fs/promises');
16068
15956
  const content = await readFile7(packageJsonPath, "utf-8");
16069
15957
  const pkg = JSON.parse(content);
16070
15958
  return {
@@ -16098,9 +15986,6 @@ function formatUptime(seconds) {
16098
15986
  // src/cli/commands/update.ts
16099
15987
  init_esm_shims();
16100
15988
  init_logger();
16101
- import { exec } from "child_process";
16102
- import { promisify } from "util";
16103
- import chalk17 from "chalk";
16104
15989
  var execAsync = promisify(exec);
16105
15990
  var updateCommand = {
16106
15991
  command: "update",
@@ -16118,53 +16003,53 @@ var updateCommand = {
16118
16003
  }).example("automatosx update", "Check and install latest version").example("automatosx update --check", "Only check for updates").example("automatosx update --yes", "Update without confirmation");
16119
16004
  },
16120
16005
  handler: async (argv2) => {
16121
- console.log(chalk17.blue.bold("\n\u{1F504} AutomatosX Update Checker\n"));
16006
+ console.log(chalk3.blue.bold("\n\u{1F504} AutomatosX Update Checker\n"));
16122
16007
  try {
16123
16008
  const currentVersion = await getCurrentVersion();
16124
- console.log(chalk17.gray(`Current version: ${currentVersion}`));
16125
- console.log(chalk17.cyan("Checking for updates..."));
16009
+ console.log(chalk3.gray(`Current version: ${currentVersion}`));
16010
+ console.log(chalk3.cyan("Checking for updates..."));
16126
16011
  const latestVersion = await getLatestVersion();
16127
- console.log(chalk17.gray(`Latest version: ${latestVersion}
16012
+ console.log(chalk3.gray(`Latest version: ${latestVersion}
16128
16013
  `));
16129
16014
  if (currentVersion === latestVersion) {
16130
- console.log(chalk17.green("\u2705 You are already running the latest version!\n"));
16015
+ console.log(chalk3.green("\u2705 You are already running the latest version!\n"));
16131
16016
  return;
16132
16017
  }
16133
16018
  if (isNewer(latestVersion, currentVersion)) {
16134
- console.log(chalk17.yellow(`\u{1F4E6} New version available: ${currentVersion} \u2192 ${latestVersion}
16019
+ console.log(chalk3.yellow(`\u{1F4E6} New version available: ${currentVersion} \u2192 ${latestVersion}
16135
16020
  `));
16136
16021
  await showChangelog(currentVersion, latestVersion);
16137
16022
  if (argv2.check) {
16138
- console.log(chalk17.gray("\nTo install the update, run:"));
16139
- console.log(chalk17.cyan(` npm install -g @defai.digital/automatosx@${latestVersion}
16023
+ console.log(chalk3.gray("\nTo install the update, run:"));
16024
+ console.log(chalk3.cyan(` npm install -g @defai.digital/automatosx@${latestVersion}
16140
16025
  `));
16141
16026
  return;
16142
16027
  }
16143
16028
  if (!argv2.yes) {
16144
- const readline4 = await import("readline");
16029
+ const readline4 = await import('readline');
16145
16030
  const rl = readline4.createInterface({
16146
16031
  input: process.stdin,
16147
16032
  output: process.stdout
16148
16033
  });
16149
16034
  const answer = await new Promise((resolve10) => {
16150
- rl.question(chalk17.yellow("Would you like to update now? (y/N) "), resolve10);
16035
+ rl.question(chalk3.yellow("Would you like to update now? (y/N) "), resolve10);
16151
16036
  });
16152
16037
  rl.close();
16153
16038
  if (answer.toLowerCase() !== "y" && answer.toLowerCase() !== "yes") {
16154
- console.log(chalk17.gray("\nUpdate cancelled.\n"));
16039
+ console.log(chalk3.gray("\nUpdate cancelled.\n"));
16155
16040
  return;
16156
16041
  }
16157
16042
  }
16158
- console.log(chalk17.cyan("\n\u{1F4E5} Installing update...\n"));
16043
+ console.log(chalk3.cyan("\n\u{1F4E5} Installing update...\n"));
16159
16044
  await installUpdate(latestVersion);
16160
- console.log(chalk17.green.bold("\n\u2705 AutomatosX updated successfully!\n"));
16161
- console.log(chalk17.gray("New version:"), chalk17.cyan(latestVersion));
16162
- console.log(chalk17.gray("\nRun"), chalk17.cyan("automatosx --version"), chalk17.gray("to verify.\n"));
16045
+ console.log(chalk3.green.bold("\n\u2705 AutomatosX updated successfully!\n"));
16046
+ console.log(chalk3.gray("New version:"), chalk3.cyan(latestVersion));
16047
+ console.log(chalk3.gray("\nRun"), chalk3.cyan("automatosx --version"), chalk3.gray("to verify.\n"));
16163
16048
  logger.info("AutomatosX updated", { from: currentVersion, to: latestVersion });
16164
16049
  } else {
16165
- console.log(chalk17.yellow(`\u26A0\uFE0F Your version (${currentVersion}) is newer than the published version (${latestVersion})
16050
+ console.log(chalk3.yellow(`\u26A0\uFE0F Your version (${currentVersion}) is newer than the published version (${latestVersion})
16166
16051
  `));
16167
- console.log(chalk17.gray("This might happen if you are running a development version.\n"));
16052
+ console.log(chalk3.gray("This might happen if you are running a development version.\n"));
16168
16053
  }
16169
16054
  } catch (error) {
16170
16055
  printError(error, {
@@ -16184,12 +16069,12 @@ async function getCurrentVersion() {
16184
16069
  const result = JSON.parse(stdout);
16185
16070
  return result.dependencies["@defai.digital/automatosx"]?.version || "unknown";
16186
16071
  } catch (error) {
16187
- const { readFile: readFile7 } = await import("fs/promises");
16188
- const { dirname: dirname10, join: join21 } = await import("path");
16189
- const { fileURLToPath: fileURLToPath6 } = await import("url");
16190
- const __filename6 = fileURLToPath6(import.meta.url);
16191
- const __dirname6 = dirname10(__filename6);
16192
- const pkgPath = join21(__dirname6, "../../../package.json");
16072
+ const { readFile: readFile7 } = await import('fs/promises');
16073
+ const { dirname: dirname11, join: join22 } = await import('path');
16074
+ const { fileURLToPath: fileURLToPath7 } = await import('url');
16075
+ const __filename6 = fileURLToPath7(import.meta.url);
16076
+ const __dirname7 = dirname11(__filename6);
16077
+ const pkgPath = join22(__dirname7, "../../../package.json");
16193
16078
  const content = await readFile7(pkgPath, "utf-8");
16194
16079
  const pkg = JSON.parse(content);
16195
16080
  return pkg.version;
@@ -16209,7 +16094,7 @@ function isNewer(a, b) {
16209
16094
  }
16210
16095
  async function showChangelog(from, to) {
16211
16096
  try {
16212
- console.log(chalk17.cyan("What's new:\n"));
16097
+ console.log(chalk3.cyan("What's new:\n"));
16213
16098
  const { stdout } = await execAsync(
16214
16099
  `curl -s https://api.github.com/repos/defai-digital/automatosx/releases/tags/v${to}`
16215
16100
  );
@@ -16218,13 +16103,13 @@ async function showChangelog(from, to) {
16218
16103
  const lines = release.body.split("\n").slice(0, 10);
16219
16104
  lines.forEach((line) => {
16220
16105
  if (line.startsWith("#")) {
16221
- console.log(chalk17.bold(line));
16106
+ console.log(chalk3.bold(line));
16222
16107
  } else if (line.trim()) {
16223
- console.log(chalk17.gray(line));
16108
+ console.log(chalk3.gray(line));
16224
16109
  }
16225
16110
  });
16226
- console.log(chalk17.gray("\n..."));
16227
- console.log(chalk17.gray(`Full changelog: https://github.com/defai-digital/automatosx/releases/tag/v${to}`));
16111
+ console.log(chalk3.gray("\n..."));
16112
+ console.log(chalk3.gray(`Full changelog: https://github.com/defai-digital/automatosx/releases/tag/v${to}`));
16228
16113
  }
16229
16114
  } catch (error) {
16230
16115
  logger.debug("Could not fetch changelog", { error: error.message });
@@ -16247,7 +16132,6 @@ async function installUpdate(version) {
16247
16132
 
16248
16133
  // src/cli/commands/workspace.ts
16249
16134
  init_esm_shims();
16250
- import chalk18 from "chalk";
16251
16135
  var listCommand4 = {
16252
16136
  command: "list",
16253
16137
  describe: "List workspace files (PRD or tmp)",
@@ -16273,23 +16157,23 @@ var listCommand4 = {
16273
16157
  console.log(JSON.stringify({ type: argv2.type, files }, null, 2));
16274
16158
  process.exit(0);
16275
16159
  }
16276
- console.log(chalk18.blue.bold(`
16160
+ console.log(chalk3.blue.bold(`
16277
16161
  \u{1F4C1} ${argv2.type === "tmp" ? "Temporary" : "PRD"} Files
16278
16162
  `));
16279
16163
  if (files.length === 0) {
16280
- console.log(chalk18.gray(" (No files)\n"));
16164
+ console.log(chalk3.gray(" (No files)\n"));
16281
16165
  } else {
16282
16166
  files.forEach((file) => {
16283
- console.log(chalk18.gray(` - ${file}`));
16167
+ console.log(chalk3.gray(` - ${file}`));
16284
16168
  });
16285
- console.log(chalk18.gray(`
16169
+ console.log(chalk3.gray(`
16286
16170
  Total: ${files.length} file(s)
16287
16171
  `));
16288
16172
  }
16289
16173
  process.exit(0);
16290
16174
  } catch (error) {
16291
- console.error(chalk18.red.bold("\n\u2717 Failed to list workspaces\n"));
16292
- console.error(chalk18.red(error.message));
16175
+ console.error(chalk3.red.bold("\n\u2717 Failed to list workspaces\n"));
16176
+ console.error(chalk3.red(error.message));
16293
16177
  process.exit(1);
16294
16178
  }
16295
16179
  }
@@ -16314,15 +16198,15 @@ var statsCommand2 = {
16314
16198
  console.log(JSON.stringify(stats, null, 2));
16315
16199
  process.exit(0);
16316
16200
  }
16317
- console.log(chalk18.blue.bold("\n\u{1F4CA} Workspace Statistics\n"));
16318
- console.log(chalk18.gray(`PRD files: ${chalk18.white(stats.prdFiles)}`));
16319
- console.log(chalk18.gray(`Temporary files: ${chalk18.white(stats.tmpFiles)}`));
16320
- console.log(chalk18.gray(`Total size: ${chalk18.white((stats.totalSizeBytes / 1024 / 1024).toFixed(2))} MB`));
16201
+ console.log(chalk3.blue.bold("\n\u{1F4CA} Workspace Statistics\n"));
16202
+ console.log(chalk3.gray(`PRD files: ${chalk3.white(stats.prdFiles)}`));
16203
+ console.log(chalk3.gray(`Temporary files: ${chalk3.white(stats.tmpFiles)}`));
16204
+ console.log(chalk3.gray(`Total size: ${chalk3.white((stats.totalSizeBytes / 1024 / 1024).toFixed(2))} MB`));
16321
16205
  console.log();
16322
16206
  process.exit(0);
16323
16207
  } catch (error) {
16324
- console.error(chalk18.red.bold("\n\u2717 Failed to get workspace stats\n"));
16325
- console.error(chalk18.red(error.message));
16208
+ console.error(chalk3.red.bold("\n\u2717 Failed to get workspace stats\n"));
16209
+ console.error(chalk3.red(error.message));
16326
16210
  process.exit(1);
16327
16211
  }
16328
16212
  }
@@ -16347,21 +16231,21 @@ var cleanupCommand = {
16347
16231
  const projectDir = await detectProjectRoot2(process.cwd());
16348
16232
  const workspaceManager = new WorkspaceManager(projectDir);
16349
16233
  if (!argv2.confirm) {
16350
- console.log(chalk18.yellow(`
16234
+ console.log(chalk3.yellow(`
16351
16235
  \u26A0 This will remove temporary files older than ${argv2.olderThan} days`));
16352
- console.log(chalk18.gray("Run with --confirm to proceed\n"));
16236
+ console.log(chalk3.gray("Run with --confirm to proceed\n"));
16353
16237
  process.exit(0);
16354
16238
  }
16355
16239
  const removed = await workspaceManager.cleanupTmp(argv2.olderThan);
16356
- console.log(chalk18.green.bold(`
16240
+ console.log(chalk3.green.bold(`
16357
16241
  \u2713 Cleanup complete
16358
16242
  `));
16359
- console.log(chalk18.gray(`Removed ${removed} temporary file(s)
16243
+ console.log(chalk3.gray(`Removed ${removed} temporary file(s)
16360
16244
  `));
16361
16245
  process.exit(0);
16362
16246
  } catch (error) {
16363
- console.error(chalk18.red.bold("\n\u2717 Failed to cleanup workspaces\n"));
16364
- console.error(chalk18.red(error.message));
16247
+ console.error(chalk3.red.bold("\n\u2717 Failed to cleanup workspaces\n"));
16248
+ console.error(chalk3.red(error.message));
16365
16249
  process.exit(1);
16366
16250
  }
16367
16251
  }
@@ -16381,10 +16265,6 @@ init_esm_shims();
16381
16265
 
16382
16266
  // src/cli/commands/agent/templates.ts
16383
16267
  init_esm_shims();
16384
- import { readdir as readdir7 } from "fs/promises";
16385
- import { join as join13 } from "path";
16386
- import { existsSync as existsSync8 } from "fs";
16387
- import chalk19 from "chalk";
16388
16268
  var TEMPLATE_DESCRIPTIONS = {
16389
16269
  "basic-agent": {
16390
16270
  name: "basic-agent",
@@ -16417,25 +16297,25 @@ var templatesCommand = {
16417
16297
  describe: "List available agent templates",
16418
16298
  handler: async () => {
16419
16299
  try {
16420
- console.log(chalk19.blue.bold("\n\u{1F4CB} Available Agent Templates\n"));
16421
- const projectTemplatesDir = join13(process.cwd(), ".automatosx", "templates");
16422
- const hasProjectTemplates = existsSync8(projectTemplatesDir);
16423
- const defaultTemplatesDir = join13(__dirname, "../examples/templates");
16424
- const hasDefaultTemplates = existsSync8(defaultTemplatesDir);
16300
+ console.log(chalk3.blue.bold("\n\u{1F4CB} Available Agent Templates\n"));
16301
+ const projectTemplatesDir = join(process.cwd(), ".automatosx", "templates");
16302
+ const hasProjectTemplates = existsSync(projectTemplatesDir);
16303
+ const defaultTemplatesDir = join(__dirname, "../examples/templates");
16304
+ const hasDefaultTemplates = existsSync(defaultTemplatesDir);
16425
16305
  if (!hasProjectTemplates && !hasDefaultTemplates) {
16426
- console.log(chalk19.yellow("\u26A0 No templates found."));
16427
- console.log(chalk19.gray('\nRun "ax init" to set up default templates.\n'));
16306
+ console.log(chalk3.yellow("\u26A0 No templates found."));
16307
+ console.log(chalk3.gray('\nRun "ax init" to set up default templates.\n'));
16428
16308
  return;
16429
16309
  }
16430
16310
  const templatesDir = hasProjectTemplates ? projectTemplatesDir : defaultTemplatesDir;
16431
16311
  const templateSource = hasProjectTemplates ? "Project" : "Default";
16432
- const files = await readdir7(templatesDir);
16312
+ const files = await readdir(templatesDir);
16433
16313
  const templates = files.filter((f) => f.endsWith(".yaml")).map((f) => f.replace(".yaml", ""));
16434
16314
  if (templates.length === 0) {
16435
- console.log(chalk19.yellow("\u26A0 No templates found.\n"));
16315
+ console.log(chalk3.yellow("\u26A0 No templates found.\n"));
16436
16316
  return;
16437
16317
  }
16438
- console.log(chalk19.gray(`Source: ${templateSource} (${templatesDir})
16318
+ console.log(chalk3.gray(`Source: ${templateSource} (${templatesDir})
16439
16319
  `));
16440
16320
  const byTeam = {
16441
16321
  core: [],
@@ -16460,17 +16340,17 @@ var templatesCommand = {
16460
16340
  for (const [team, name] of Object.entries(teamNames)) {
16461
16341
  const teamTemplates = byTeam[team];
16462
16342
  if (teamTemplates && teamTemplates.length > 0) {
16463
- console.log(chalk19.cyan.bold(`${name}:`));
16343
+ console.log(chalk3.cyan.bold(`${name}:`));
16464
16344
  teamTemplates.forEach((t) => {
16465
- console.log(chalk19.white(` ${t.name.padEnd(20)} - ${t.description}`));
16345
+ console.log(chalk3.white(` ${t.name.padEnd(20)} - ${t.description}`));
16466
16346
  });
16467
16347
  console.log();
16468
16348
  }
16469
16349
  }
16470
- console.log(chalk19.gray("Usage: ax agent create <name> --template <template-name>\n"));
16350
+ console.log(chalk3.gray("Usage: ax agent create <name> --template <template-name>\n"));
16471
16351
  } catch (error) {
16472
- console.error(chalk19.red.bold("\n\u2717 Error listing templates\n"));
16473
- console.error(chalk19.red(error.message));
16352
+ console.error(chalk3.red.bold("\n\u2717 Error listing templates\n"));
16353
+ console.error(chalk3.red(error.message));
16474
16354
  process.exit(1);
16475
16355
  }
16476
16356
  }
@@ -16478,12 +16358,6 @@ var templatesCommand = {
16478
16358
 
16479
16359
  // src/cli/commands/agent/create.ts
16480
16360
  init_esm_shims();
16481
- import { readFile as readFile6, writeFile as writeFile5, mkdir as mkdir5 } from "fs/promises";
16482
- import { existsSync as existsSync10 } from "fs";
16483
- import { join as join15 } from "path";
16484
- import { load as loadYaml2 } from "js-yaml";
16485
- import chalk20 from "chalk";
16486
- import * as readline2 from "readline";
16487
16361
 
16488
16362
  // src/agents/template-engine.ts
16489
16363
  init_esm_shims();
@@ -16615,29 +16489,24 @@ var TemplateEngine = class _TemplateEngine {
16615
16489
  return variables;
16616
16490
  }
16617
16491
  };
16618
- var templateEngine = new TemplateEngine();
16619
16492
 
16620
16493
  // src/cli/commands/agent/helpers.ts
16621
16494
  init_esm_shims();
16622
- import { readdir as readdir8 } from "fs/promises";
16623
- import { existsSync as existsSync9 } from "fs";
16624
- import { join as join14, extname as extname5, dirname as dirname9 } from "path";
16625
- import { fileURLToPath as fileURLToPath5 } from "url";
16626
16495
  init_logger();
16627
- var __filename5 = fileURLToPath5(import.meta.url);
16628
- var __dirname5 = dirname9(__filename5);
16496
+ var __filename5 = fileURLToPath(import.meta.url);
16497
+ var __dirname6 = dirname(__filename5);
16629
16498
  async function listAvailableTemplates() {
16630
16499
  const templates = [];
16631
- const projectTemplatesDir = join14(process.cwd(), ".automatosx", "templates");
16632
- if (existsSync9(projectTemplatesDir)) {
16500
+ const projectTemplatesDir = join(process.cwd(), ".automatosx", "templates");
16501
+ if (existsSync(projectTemplatesDir)) {
16633
16502
  try {
16634
- const files = await readdir8(projectTemplatesDir);
16503
+ const files = await readdir(projectTemplatesDir);
16635
16504
  for (const file of files) {
16636
- if (extname5(file) === ".yaml" || extname5(file) === ".yml") {
16505
+ if (extname(file) === ".yaml" || extname(file) === ".yml") {
16637
16506
  const name = file.replace(/\.(yaml|yml)$/, "");
16638
16507
  templates.push({
16639
16508
  name,
16640
- path: join14(projectTemplatesDir, file),
16509
+ path: join(projectTemplatesDir, file),
16641
16510
  description: "Custom template"
16642
16511
  });
16643
16512
  }
@@ -16646,12 +16515,12 @@ async function listAvailableTemplates() {
16646
16515
  logger.debug("Failed to read project templates", { error });
16647
16516
  }
16648
16517
  }
16649
- const builtinTemplatesDir = join14(__dirname5, "../../../../examples/templates");
16650
- if (existsSync9(builtinTemplatesDir)) {
16518
+ const builtinTemplatesDir = join(__dirname6, "../../../../examples/templates");
16519
+ if (existsSync(builtinTemplatesDir)) {
16651
16520
  try {
16652
- const files = await readdir8(builtinTemplatesDir);
16521
+ const files = await readdir(builtinTemplatesDir);
16653
16522
  for (const file of files) {
16654
- if (extname5(file) === ".yaml" || extname5(file) === ".yml") {
16523
+ if (extname(file) === ".yaml" || extname(file) === ".yml") {
16655
16524
  const name = file.replace(/\.(yaml|yml)$/, "");
16656
16525
  if (templates.find((t) => t.name === name)) {
16657
16526
  continue;
@@ -16665,7 +16534,7 @@ async function listAvailableTemplates() {
16665
16534
  };
16666
16535
  templates.push({
16667
16536
  name,
16668
- path: join14(builtinTemplatesDir, file),
16537
+ path: join(builtinTemplatesDir, file),
16669
16538
  description: descriptions[name] || "Built-in template"
16670
16539
  });
16671
16540
  }
@@ -16678,7 +16547,7 @@ async function listAvailableTemplates() {
16678
16547
  }
16679
16548
  async function listAvailableTeams() {
16680
16549
  const projectDir = process.cwd();
16681
- const teamsDir = join14(projectDir, ".automatosx", "teams");
16550
+ const teamsDir = join(projectDir, ".automatosx", "teams");
16682
16551
  const teamManager = new TeamManager(teamsDir);
16683
16552
  try {
16684
16553
  const teamNames = await teamManager.listTeams();
@@ -16742,14 +16611,12 @@ async function checkDisplayNameConflict(displayName, excludeAgentName) {
16742
16611
  return void 0;
16743
16612
  }
16744
16613
  const projectDir = process.cwd();
16745
- const agentsDir = join14(projectDir, ".automatosx", "agents");
16614
+ const agentsDir = join(projectDir, ".automatosx", "agents");
16746
16615
  const profileLoader = new ProfileLoader(agentsDir);
16747
16616
  try {
16748
16617
  const allProfiles = await profileLoader.listProfiles();
16749
16618
  for (const profileName of allProfiles) {
16750
- if (excludeAgentName && profileName === excludeAgentName) {
16751
- continue;
16752
- }
16619
+ if (excludeAgentName && profileName === excludeAgentName) ;
16753
16620
  try {
16754
16621
  const profile = await profileLoader.loadProfile(profileName);
16755
16622
  if (profile.displayName?.toLowerCase() === displayName.toLowerCase()) {
@@ -16822,46 +16689,46 @@ var createCommand2 = {
16822
16689
  handler: async (argv2) => {
16823
16690
  try {
16824
16691
  const projectDir = process.cwd();
16825
- const agentsDir = join15(projectDir, ".automatosx", "agents");
16826
- const agentFile = join15(agentsDir, `${argv2.agent}.yaml`);
16692
+ const agentsDir = join(projectDir, ".automatosx", "agents");
16693
+ const agentFile = join(agentsDir, `${argv2.agent}.yaml`);
16827
16694
  const nameValidation = isValidAgentName(argv2.agent);
16828
16695
  if (!nameValidation.valid) {
16829
- console.log(chalk20.red.bold(`
16696
+ console.log(chalk3.red.bold(`
16830
16697
  \u2717 Invalid agent name: ${argv2.agent}
16831
16698
  `));
16832
- console.log(chalk20.red(nameValidation.error));
16699
+ console.log(chalk3.red(nameValidation.error));
16833
16700
  const suggestion = suggestValidAgentName(argv2.agent);
16834
16701
  if (suggestion !== argv2.agent) {
16835
- console.log(chalk20.yellow(`
16702
+ console.log(chalk3.yellow(`
16836
16703
  \u{1F4A1} Suggested name: ${suggestion}`));
16837
16704
  }
16838
- console.log(chalk20.gray("\nAgent names must:"));
16839
- console.log(chalk20.gray(" \u2022 Start with a lowercase letter"));
16840
- console.log(chalk20.gray(" \u2022 Contain only lowercase letters, numbers, and hyphens"));
16841
- console.log(chalk20.gray(" \u2022 Be 2-50 characters long"));
16842
- console.log(chalk20.gray(" \u2022 Not contain consecutive hyphens\n"));
16705
+ console.log(chalk3.gray("\nAgent names must:"));
16706
+ console.log(chalk3.gray(" \u2022 Start with a lowercase letter"));
16707
+ console.log(chalk3.gray(" \u2022 Contain only lowercase letters, numbers, and hyphens"));
16708
+ console.log(chalk3.gray(" \u2022 Be 2-50 characters long"));
16709
+ console.log(chalk3.gray(" \u2022 Not contain consecutive hyphens\n"));
16843
16710
  process.exit(1);
16844
16711
  }
16845
- if (existsSync10(agentFile)) {
16846
- console.log(chalk20.red.bold(`
16712
+ if (existsSync(agentFile)) {
16713
+ console.log(chalk3.red.bold(`
16847
16714
  \u2717 Agent already exists: ${argv2.agent}
16848
16715
  `));
16849
- console.log(chalk20.gray("Use a different name or remove the existing agent first.\n"));
16716
+ console.log(chalk3.gray("Use a different name or remove the existing agent first.\n"));
16850
16717
  process.exit(1);
16851
16718
  }
16852
- await mkdir5(agentsDir, { recursive: true });
16719
+ await mkdir(agentsDir, { recursive: true });
16853
16720
  let templateName = argv2.template;
16854
16721
  if (!templateName) {
16855
16722
  if (argv2.interactive) {
16856
16723
  templateName = await askTemplate();
16857
16724
  } else {
16858
16725
  templateName = "basic-agent";
16859
- console.log(chalk20.gray(`Using default template: ${templateName}`));
16726
+ console.log(chalk3.gray(`Using default template: ${templateName}`));
16860
16727
  }
16861
16728
  }
16862
16729
  const templatePath = await findTemplate(templateName);
16863
- const templateContent = await readFile6(templatePath, "utf-8");
16864
- const templateYaml = loadYaml2(templateContent);
16730
+ const templateContent = await readFile(templatePath, "utf-8");
16731
+ const templateYaml = load(templateContent);
16865
16732
  const variables = {
16866
16733
  AGENT_NAME: argv2.agent,
16867
16734
  DISPLAY_NAME: argv2.displayName || argv2.agent,
@@ -16893,46 +16760,46 @@ var createCommand2 = {
16893
16760
  if (variables.DISPLAY_NAME) {
16894
16761
  const conflict = await checkDisplayNameConflict(variables.DISPLAY_NAME);
16895
16762
  if (conflict) {
16896
- console.log(chalk20.red.bold(`
16763
+ console.log(chalk3.red.bold(`
16897
16764
  \u2717 DisplayName conflict: "${variables.DISPLAY_NAME}" is already used by agent "${conflict}"
16898
16765
  `));
16899
- console.log(chalk20.gray("Please choose a different displayName.\n"));
16766
+ console.log(chalk3.gray("Please choose a different displayName.\n"));
16900
16767
  process.exit(1);
16901
16768
  }
16902
16769
  }
16903
16770
  const engine = new TemplateEngine();
16904
16771
  const rendered = engine.render(templateContent, variables);
16905
- await writeFile5(agentFile, rendered, "utf-8");
16906
- console.log(chalk20.green.bold(`
16772
+ await writeFile(agentFile, rendered, "utf-8");
16773
+ console.log(chalk3.green.bold(`
16907
16774
  \u2713 Agent '${argv2.agent}' created successfully
16908
16775
  `));
16909
- console.log(chalk20.white(`Display Name: ${chalk20.cyan(variables.DISPLAY_NAME)}`));
16910
- console.log(chalk20.white(`Team: ${chalk20.cyan(variables.TEAM || "core")}`));
16911
- console.log(chalk20.white(`Template: ${chalk20.gray(templateName)}`));
16912
- console.log(chalk20.white(`File: ${chalk20.gray(agentFile)}`));
16776
+ console.log(chalk3.white(`Display Name: ${chalk3.cyan(variables.DISPLAY_NAME)}`));
16777
+ console.log(chalk3.white(`Team: ${chalk3.cyan(variables.TEAM || "core")}`));
16778
+ console.log(chalk3.white(`Template: ${chalk3.gray(templateName)}`));
16779
+ console.log(chalk3.white(`File: ${chalk3.gray(agentFile)}`));
16913
16780
  console.log();
16914
- console.log(chalk20.gray("Next steps:"));
16915
- console.log(chalk20.gray(" \u2022 View details: ax agent show " + argv2.agent));
16916
- console.log(chalk20.gray(" \u2022 Run agent: ax run " + argv2.agent + ' "your task"'));
16917
- console.log(chalk20.gray(" \u2022 Edit file: Open " + agentFile + " in your editor"));
16781
+ console.log(chalk3.gray("Next steps:"));
16782
+ console.log(chalk3.gray(" \u2022 View details: ax agent show " + argv2.agent));
16783
+ console.log(chalk3.gray(" \u2022 Run agent: ax run " + argv2.agent + ' "your task"'));
16784
+ console.log(chalk3.gray(" \u2022 Edit file: Open " + agentFile + " in your editor"));
16918
16785
  console.log();
16919
16786
  } catch (error) {
16920
- console.error(chalk20.red.bold("\n\u2717 Error creating agent\n"));
16921
- console.error(chalk20.red(error.message));
16787
+ console.error(chalk3.red.bold("\n\u2717 Error creating agent\n"));
16788
+ console.error(chalk3.red(error.message));
16922
16789
  if (error.stack) {
16923
- console.error(chalk20.gray(error.stack));
16790
+ console.error(chalk3.gray(error.stack));
16924
16791
  }
16925
16792
  process.exit(1);
16926
16793
  }
16927
16794
  }
16928
16795
  };
16929
16796
  async function findTemplate(name) {
16930
- const projectTemplate = join15(process.cwd(), ".automatosx", "templates", `${name}.yaml`);
16931
- if (existsSync10(projectTemplate)) {
16797
+ const projectTemplate = join(process.cwd(), ".automatosx", "templates", `${name}.yaml`);
16798
+ if (existsSync(projectTemplate)) {
16932
16799
  return projectTemplate;
16933
16800
  }
16934
- const defaultTemplate = join15(__dirname, "../examples/templates", `${name}.yaml`);
16935
- if (existsSync10(defaultTemplate)) {
16801
+ const defaultTemplate = join(__dirname, "../examples/templates", `${name}.yaml`);
16802
+ if (existsSync(defaultTemplate)) {
16936
16803
  return defaultTemplate;
16937
16804
  }
16938
16805
  throw new Error(`Template not found: ${name}
@@ -16943,10 +16810,10 @@ async function askTemplate() {
16943
16810
  if (templates.length === 0) {
16944
16811
  throw new Error('No templates available. Please run "ax init" first.');
16945
16812
  }
16946
- console.log(chalk20.blue.bold("\n\u{1F4CB} Available Templates:\n"));
16813
+ console.log(chalk3.blue.bold("\n\u{1F4CB} Available Templates:\n"));
16947
16814
  templates.forEach((template, index2) => {
16948
16815
  const desc = template.description || "Custom template";
16949
- console.log(chalk20.white(` ${index2 + 1}. ${template.name.padEnd(20)} - ${desc}`));
16816
+ console.log(chalk3.white(` ${index2 + 1}. ${template.name.padEnd(20)} - ${desc}`));
16950
16817
  });
16951
16818
  console.log();
16952
16819
  const answer = await ask(`Select template (1-${templates.length})`, "1");
@@ -16961,10 +16828,10 @@ async function askTeam(defaultValue) {
16961
16828
  if (teams.length === 0) {
16962
16829
  throw new Error('No teams available. Please run "ax init" first.');
16963
16830
  }
16964
- console.log(chalk20.blue.bold("\n\u{1F465} Available Teams:\n"));
16831
+ console.log(chalk3.blue.bold("\n\u{1F465} Available Teams:\n"));
16965
16832
  teams.forEach((team, index2) => {
16966
16833
  const desc = team.description || team.displayName;
16967
- console.log(chalk20.white(` ${index2 + 1}. ${team.name.padEnd(12)} - ${desc}`));
16834
+ console.log(chalk3.white(` ${index2 + 1}. ${team.name.padEnd(12)} - ${desc}`));
16968
16835
  });
16969
16836
  console.log();
16970
16837
  const defaultIndex = teams.findIndex((t) => t.name === defaultValue) + 1;
@@ -16981,11 +16848,11 @@ function extractDefault(value) {
16981
16848
  return match?.[1]?.trim();
16982
16849
  }
16983
16850
  function ask(question, defaultValue) {
16984
- const rl = readline2.createInterface({
16851
+ const rl = readline.createInterface({
16985
16852
  input: process.stdin,
16986
16853
  output: process.stdout
16987
16854
  });
16988
- const prompt = defaultValue ? `${question} [${chalk20.gray(defaultValue)}]: ` : `${question}: `;
16855
+ const prompt = defaultValue ? `${question} [${chalk3.gray(defaultValue)}]: ` : `${question}: `;
16989
16856
  return new Promise((resolve10) => {
16990
16857
  rl.question(prompt, (answer) => {
16991
16858
  rl.close();
@@ -16996,8 +16863,6 @@ function ask(question, defaultValue) {
16996
16863
 
16997
16864
  // src/cli/commands/agent/list.ts
16998
16865
  init_esm_shims();
16999
- import { join as join16 } from "path";
17000
- import chalk21 from "chalk";
17001
16866
  var listCommand5 = {
17002
16867
  command: "list",
17003
16868
  describe: "List all agents",
@@ -17011,17 +16876,17 @@ var listCommand5 = {
17011
16876
  handler: async (argv2) => {
17012
16877
  try {
17013
16878
  const projectDir = process.cwd();
17014
- const agentsDir = join16(projectDir, ".automatosx", "agents");
17015
- const teamsDir = join16(projectDir, ".automatosx", "teams");
16879
+ const agentsDir = join(projectDir, ".automatosx", "agents");
16880
+ const teamsDir = join(projectDir, ".automatosx", "teams");
17016
16881
  const teamManager = new TeamManager(teamsDir);
17017
16882
  const profileLoader = new ProfileLoader(agentsDir, void 0, teamManager);
17018
16883
  const agentNames = await profileLoader.listProfiles();
17019
16884
  if (agentNames.length === 0) {
17020
- console.log(chalk21.yellow("\n\u26A0 No agents found.\n"));
17021
- console.log(chalk21.gray('Run "ax agent create" to create your first agent.\n'));
16885
+ console.log(chalk3.yellow("\n\u26A0 No agents found.\n"));
16886
+ console.log(chalk3.gray('Run "ax agent create" to create your first agent.\n'));
17022
16887
  return;
17023
16888
  }
17024
- console.log(chalk21.blue.bold(`
16889
+ console.log(chalk3.blue.bold(`
17025
16890
  \u{1F916} Agents (${agentNames.length} total)
17026
16891
  `));
17027
16892
  const profiles = await Promise.all(
@@ -17062,20 +16927,20 @@ var listCommand5 = {
17062
16927
  for (const team of teamsToShow) {
17063
16928
  const teamAgents = byTeam[team];
17064
16929
  if (teamAgents && teamAgents.length > 0) {
17065
- console.log(chalk21.cyan.bold(`${teamNames[team]} (${teamAgents.length}):`));
16930
+ console.log(chalk3.cyan.bold(`${teamNames[team]} (${teamAgents.length}):`));
17066
16931
  teamAgents.forEach((profile) => {
17067
16932
  if (!profile) return;
17068
16933
  const displayName = profile.displayName ? ` (${profile.displayName})` : "";
17069
- const role = profile.role ? chalk21.gray(` - ${profile.role}`) : "";
17070
- console.log(chalk21.white(` ${profile.name}${displayName}${role}`));
16934
+ const role = profile.role ? chalk3.gray(` - ${profile.role}`) : "";
16935
+ console.log(chalk3.white(` ${profile.name}${displayName}${role}`));
17071
16936
  });
17072
16937
  console.log();
17073
16938
  }
17074
16939
  }
17075
- console.log(chalk21.gray("Usage: ax agent show <name> for details\n"));
16940
+ console.log(chalk3.gray("Usage: ax agent show <name> for details\n"));
17076
16941
  } catch (error) {
17077
- console.error(chalk21.red.bold("\n\u2717 Error listing agents\n"));
17078
- console.error(chalk21.red(error.message));
16942
+ console.error(chalk3.red.bold("\n\u2717 Error listing agents\n"));
16943
+ console.error(chalk3.red(error.message));
17079
16944
  process.exit(1);
17080
16945
  }
17081
16946
  }
@@ -17083,8 +16948,6 @@ var listCommand5 = {
17083
16948
 
17084
16949
  // src/cli/commands/agent/show.ts
17085
16950
  init_esm_shims();
17086
- import { join as join17 } from "path";
17087
- import chalk22 from "chalk";
17088
16951
  var showCommand = {
17089
16952
  command: "show <agent>",
17090
16953
  describe: "Show agent details",
@@ -17098,86 +16961,86 @@ var showCommand = {
17098
16961
  handler: async (argv2) => {
17099
16962
  try {
17100
16963
  const projectDir = process.cwd();
17101
- const agentsDir = join17(projectDir, ".automatosx", "agents");
17102
- const teamsDir = join17(projectDir, ".automatosx", "teams");
16964
+ const agentsDir = join(projectDir, ".automatosx", "agents");
16965
+ const teamsDir = join(projectDir, ".automatosx", "teams");
17103
16966
  const teamManager = new TeamManager(teamsDir);
17104
16967
  const profileLoader = new ProfileLoader(agentsDir, void 0, teamManager);
17105
16968
  const resolvedName = await profileLoader.resolveAgentName(argv2.agent);
17106
16969
  const profile = await profileLoader.loadProfile(resolvedName);
17107
- console.log(chalk22.blue.bold(`
16970
+ console.log(chalk3.blue.bold(`
17108
16971
  \u{1F916} Agent: ${profile.name}
17109
16972
  `));
17110
16973
  if (profile.displayName) {
17111
- console.log(chalk22.white(`Display Name: ${chalk22.cyan(profile.displayName)}`));
16974
+ console.log(chalk3.white(`Display Name: ${chalk3.cyan(profile.displayName)}`));
17112
16975
  }
17113
16976
  if (profile.team) {
17114
- console.log(chalk22.white(`Team: ${chalk22.cyan(profile.team)}`));
16977
+ console.log(chalk3.white(`Team: ${chalk3.cyan(profile.team)}`));
17115
16978
  }
17116
16979
  if (profile.role) {
17117
- console.log(chalk22.white(`Role: ${chalk22.gray(profile.role)}`));
16980
+ console.log(chalk3.white(`Role: ${chalk3.gray(profile.role)}`));
17118
16981
  }
17119
16982
  if (profile.description) {
17120
- console.log(chalk22.white(`Description: ${chalk22.gray(profile.description)}`));
16983
+ console.log(chalk3.white(`Description: ${chalk3.gray(profile.description)}`));
17121
16984
  }
17122
16985
  console.log();
17123
16986
  if (profile.abilities && profile.abilities.length > 0) {
17124
- console.log(chalk22.cyan.bold("Abilities:"));
16987
+ console.log(chalk3.cyan.bold("Abilities:"));
17125
16988
  profile.abilities.forEach((ability) => {
17126
- console.log(chalk22.white(` \u2022 ${ability}`));
16989
+ console.log(chalk3.white(` \u2022 ${ability}`));
17127
16990
  });
17128
16991
  console.log();
17129
16992
  }
17130
- console.log(chalk22.cyan.bold("Configuration:"));
16993
+ console.log(chalk3.cyan.bold("Configuration:"));
17131
16994
  if (profile.provider) {
17132
- console.log(chalk22.white(` Provider: ${profile.provider}`));
16995
+ console.log(chalk3.white(` Provider: ${profile.provider}`));
17133
16996
  }
17134
16997
  if (profile.model) {
17135
- console.log(chalk22.white(` Model: ${profile.model}`));
16998
+ console.log(chalk3.white(` Model: ${profile.model}`));
17136
16999
  }
17137
17000
  if (profile.temperature !== void 0) {
17138
- console.log(chalk22.white(` Temperature: ${profile.temperature}`));
17001
+ console.log(chalk3.white(` Temperature: ${profile.temperature}`));
17139
17002
  }
17140
17003
  if (profile.maxTokens !== void 0) {
17141
- console.log(chalk22.white(` Max Tokens: ${profile.maxTokens}`));
17004
+ console.log(chalk3.white(` Max Tokens: ${profile.maxTokens}`));
17142
17005
  }
17143
17006
  console.log();
17144
17007
  if (profile.orchestration) {
17145
- console.log(chalk22.cyan.bold("Orchestration:"));
17008
+ console.log(chalk3.cyan.bold("Orchestration:"));
17146
17009
  const orch = profile.orchestration;
17147
17010
  if (orch.maxDelegationDepth !== void 0) {
17148
- console.log(chalk22.white(` Max Delegation Depth: ${orch.maxDelegationDepth}`));
17011
+ console.log(chalk3.white(` Max Delegation Depth: ${orch.maxDelegationDepth}`));
17149
17012
  }
17150
17013
  console.log();
17151
17014
  }
17152
- const filePath = join17(agentsDir, `${argv2.agent}.yaml`);
17153
- console.log(chalk22.gray(`File: ${filePath}`));
17015
+ const filePath = join(agentsDir, `${argv2.agent}.yaml`);
17016
+ console.log(chalk3.gray(`File: ${filePath}`));
17154
17017
  console.log();
17155
17018
  } catch (error) {
17156
- console.error(chalk22.red.bold(`
17019
+ console.error(chalk3.red.bold(`
17157
17020
  \u2717 Agent not found: ${argv2.agent}
17158
17021
  `));
17159
- console.error(chalk22.red(error.message));
17022
+ console.error(chalk3.red(error.message));
17160
17023
  try {
17161
17024
  const projectDir = process.cwd();
17162
- const agentsDir = join17(projectDir, ".automatosx", "agents");
17163
- const teamsDir = join17(projectDir, ".automatosx", "teams");
17025
+ const agentsDir = join(projectDir, ".automatosx", "agents");
17026
+ const teamsDir = join(projectDir, ".automatosx", "teams");
17164
17027
  const teamManager = new TeamManager(teamsDir);
17165
17028
  const profileLoader = new ProfileLoader(agentsDir, void 0, teamManager);
17166
17029
  const suggestions = await profileLoader.findSimilarAgents(argv2.agent, 3);
17167
17030
  const closeSuggestions = suggestions.filter((s) => s.distance <= 3);
17168
17031
  if (closeSuggestions.length > 0) {
17169
- console.log(chalk22.yellow("\n\u{1F4A1} Did you mean:\n"));
17032
+ console.log(chalk3.yellow("\n\u{1F4A1} Did you mean:\n"));
17170
17033
  closeSuggestions.forEach((s, i) => {
17171
17034
  const displayInfo = s.displayName ? `${s.displayName} (${s.name})` : s.name;
17172
17035
  const roleInfo = s.role ? ` - ${s.role}` : "";
17173
- console.log(chalk22.cyan(` ${i + 1}. ${displayInfo}${roleInfo}`));
17036
+ console.log(chalk3.cyan(` ${i + 1}. ${displayInfo}${roleInfo}`));
17174
17037
  });
17175
17038
  console.log();
17176
17039
  } else {
17177
- console.log(chalk22.gray('\nRun "ax agent list" to see available agents.\n'));
17040
+ console.log(chalk3.gray('\nRun "ax agent list" to see available agents.\n'));
17178
17041
  }
17179
17042
  } catch {
17180
- console.log(chalk22.gray('\nRun "ax agent list" to see available agents.\n'));
17043
+ console.log(chalk3.gray('\nRun "ax agent list" to see available agents.\n'));
17181
17044
  }
17182
17045
  process.exit(1);
17183
17046
  }
@@ -17186,11 +17049,6 @@ var showCommand = {
17186
17049
 
17187
17050
  // src/cli/commands/agent/remove.ts
17188
17051
  init_esm_shims();
17189
- import { unlink as unlink2 } from "fs/promises";
17190
- import { existsSync as existsSync11 } from "fs";
17191
- import { join as join18 } from "path";
17192
- import chalk23 from "chalk";
17193
- import * as readline3 from "readline";
17194
17052
  var removeCommand = {
17195
17053
  command: "remove <agent>",
17196
17054
  describe: "Remove an agent",
@@ -17209,75 +17067,75 @@ var removeCommand = {
17209
17067
  handler: async (argv2) => {
17210
17068
  try {
17211
17069
  const projectDir = process.cwd();
17212
- const agentsDir = join18(projectDir, ".automatosx", "agents");
17213
- const teamsDir = join18(projectDir, ".automatosx", "teams");
17070
+ const agentsDir = join(projectDir, ".automatosx", "agents");
17071
+ const teamsDir = join(projectDir, ".automatosx", "teams");
17214
17072
  const teamManager = new TeamManager(teamsDir);
17215
17073
  const profileLoader = new ProfileLoader(agentsDir, void 0, teamManager);
17216
17074
  let resolvedName;
17217
17075
  try {
17218
17076
  resolvedName = await profileLoader.resolveAgentName(argv2.agent);
17219
17077
  } catch (error) {
17220
- console.log(chalk23.red.bold(`
17078
+ console.log(chalk3.red.bold(`
17221
17079
  \u2717 Agent not found: ${argv2.agent}
17222
17080
  `));
17223
17081
  try {
17224
17082
  const suggestions = await profileLoader.findSimilarAgents(argv2.agent, 3);
17225
17083
  const closeSuggestions = suggestions.filter((s) => s.distance <= 3);
17226
17084
  if (closeSuggestions.length > 0) {
17227
- console.log(chalk23.yellow("\u{1F4A1} Did you mean:\n"));
17085
+ console.log(chalk3.yellow("\u{1F4A1} Did you mean:\n"));
17228
17086
  closeSuggestions.forEach((s, i) => {
17229
17087
  const displayInfo2 = s.displayName ? `${s.displayName} (${s.name})` : s.name;
17230
17088
  const roleInfo = s.role ? ` - ${s.role}` : "";
17231
- console.log(chalk23.cyan(` ${i + 1}. ${displayInfo2}${roleInfo}`));
17089
+ console.log(chalk3.cyan(` ${i + 1}. ${displayInfo2}${roleInfo}`));
17232
17090
  });
17233
17091
  console.log();
17234
17092
  } else {
17235
- console.log(chalk23.gray('Run "ax agent list" to see available agents.\n'));
17093
+ console.log(chalk3.gray('Run "ax agent list" to see available agents.\n'));
17236
17094
  }
17237
17095
  } catch {
17238
- console.log(chalk23.gray('Run "ax agent list" to see available agents.\n'));
17096
+ console.log(chalk3.gray('Run "ax agent list" to see available agents.\n'));
17239
17097
  }
17240
17098
  process.exit(1);
17241
17099
  }
17242
- const agentFile = join18(agentsDir, `${resolvedName}.yaml`);
17243
- if (!existsSync11(agentFile)) {
17244
- console.log(chalk23.red.bold(`
17100
+ const agentFile = join(agentsDir, `${resolvedName}.yaml`);
17101
+ if (!existsSync(agentFile)) {
17102
+ console.log(chalk3.red.bold(`
17245
17103
  \u2717 Agent file not found: ${resolvedName}
17246
17104
  `));
17247
- console.log(chalk23.gray('Run "ax agent list" to see available agents.\n'));
17105
+ console.log(chalk3.gray('Run "ax agent list" to see available agents.\n'));
17248
17106
  process.exit(1);
17249
17107
  }
17250
17108
  const profile = await profileLoader.loadProfile(resolvedName);
17251
17109
  const displayInfo = profile.displayName ? `${profile.displayName} (${resolvedName})` : resolvedName;
17252
17110
  if (!argv2.confirm) {
17253
17111
  const confirmed = await askConfirmation(
17254
- `Are you sure you want to remove agent '${chalk23.cyan(displayInfo)}'?`
17112
+ `Are you sure you want to remove agent '${chalk3.cyan(displayInfo)}'?`
17255
17113
  );
17256
17114
  if (!confirmed) {
17257
- console.log(chalk23.yellow("\nCancelled.\n"));
17115
+ console.log(chalk3.yellow("\nCancelled.\n"));
17258
17116
  process.exit(0);
17259
17117
  }
17260
17118
  }
17261
- await unlink2(agentFile);
17262
- console.log(chalk23.green.bold(`
17119
+ await unlink(agentFile);
17120
+ console.log(chalk3.green.bold(`
17263
17121
  \u2713 Agent '${displayInfo}' removed successfully
17264
17122
  `));
17265
- console.log(chalk23.gray(`Deleted: ${agentFile}
17123
+ console.log(chalk3.gray(`Deleted: ${agentFile}
17266
17124
  `));
17267
17125
  } catch (error) {
17268
- console.error(chalk23.red.bold("\n\u2717 Error removing agent\n"));
17269
- console.error(chalk23.red(error.message));
17126
+ console.error(chalk3.red.bold("\n\u2717 Error removing agent\n"));
17127
+ console.error(chalk3.red(error.message));
17270
17128
  process.exit(1);
17271
17129
  }
17272
17130
  }
17273
17131
  };
17274
17132
  function askConfirmation(question) {
17275
- const rl = readline3.createInterface({
17133
+ const rl = readline.createInterface({
17276
17134
  input: process.stdin,
17277
17135
  output: process.stdout
17278
17136
  });
17279
17137
  return new Promise((resolve10) => {
17280
- rl.question(chalk23.yellow(`
17138
+ rl.question(chalk3.yellow(`
17281
17139
  ${question} (y/N): `), (answer) => {
17282
17140
  rl.close();
17283
17141
  resolve10(answer.toLowerCase() === "y" || answer.toLowerCase() === "yes");
@@ -17298,8 +17156,6 @@ var agentCommand = {
17298
17156
 
17299
17157
  // src/cli/commands/resume.ts
17300
17158
  init_esm_shims();
17301
- import chalk24 from "chalk";
17302
- import { join as join19 } from "path";
17303
17159
  init_path_resolver();
17304
17160
  init_claude_provider();
17305
17161
  init_gemini_provider();
@@ -17338,11 +17194,11 @@ var resumeCommand = {
17338
17194
  },
17339
17195
  handler: async (argv2) => {
17340
17196
  if (!argv2["run-id"] || typeof argv2["run-id"] !== "string") {
17341
- console.log(chalk24.red.bold("\n\u274C Error: Run ID is required\n"));
17197
+ console.log(chalk3.red.bold("\n\u274C Error: Run ID is required\n"));
17342
17198
  process.exit(1);
17343
17199
  }
17344
17200
  const runId = argv2["run-id"];
17345
- console.log(chalk24.blue.bold(`
17201
+ console.log(chalk3.blue.bold(`
17346
17202
  \u{1F504} AutomatosX - Resuming ${runId.substring(0, 8)}...
17347
17203
  `));
17348
17204
  let memoryManager;
@@ -17352,51 +17208,51 @@ var resumeCommand = {
17352
17208
  const projectDir = await detectProjectRoot(process.cwd());
17353
17209
  const config = await loadConfig(projectDir);
17354
17210
  if (argv2.verbose) {
17355
- console.log(chalk24.gray(`Project: ${projectDir}`));
17356
- console.log(chalk24.gray(`Working directory: ${process.cwd()}`));
17211
+ console.log(chalk3.gray(`Project: ${projectDir}`));
17212
+ console.log(chalk3.gray(`Working directory: ${process.cwd()}`));
17357
17213
  console.log();
17358
17214
  }
17359
17215
  const stageConfig = config.execution?.stages;
17360
- const checkpointPath = stageConfig?.checkpointPath || join19(projectDir, ".automatosx", "checkpoints");
17216
+ const checkpointPath = stageConfig?.checkpointPath || join(projectDir, ".automatosx", "checkpoints");
17361
17217
  const cleanupAfterDays = stageConfig?.cleanupAfterDays || 7;
17362
17218
  const checkpointManager = new CheckpointManager(checkpointPath, cleanupAfterDays);
17363
17219
  const checkpoint = await checkpointManager.loadCheckpoint(runId);
17364
- console.log(chalk24.cyan("\u{1F4C2} Checkpoint Found\n"));
17365
- console.log(chalk24.gray(` Run ID: ${checkpoint.runId}`));
17366
- console.log(chalk24.gray(` Agent: ${checkpoint.agent}`));
17367
- console.log(chalk24.gray(` Task: ${checkpoint.task}`));
17368
- console.log(chalk24.gray(` Progress: ${checkpoint.lastCompletedStageIndex + 1}/${checkpoint.stages.length} stages complete`));
17369
- console.log(chalk24.gray(` Created: ${new Date(checkpoint.createdAt).toLocaleString()}`));
17220
+ console.log(chalk3.cyan("\u{1F4C2} Checkpoint Found\n"));
17221
+ console.log(chalk3.gray(` Run ID: ${checkpoint.runId}`));
17222
+ console.log(chalk3.gray(` Agent: ${checkpoint.agent}`));
17223
+ console.log(chalk3.gray(` Task: ${checkpoint.task}`));
17224
+ console.log(chalk3.gray(` Progress: ${checkpoint.lastCompletedStageIndex + 1}/${checkpoint.stages.length} stages complete`));
17225
+ console.log(chalk3.gray(` Created: ${new Date(checkpoint.createdAt).toLocaleString()}`));
17370
17226
  console.log();
17371
17227
  const teamManager = new TeamManager(
17372
- join19(projectDir, ".automatosx", "teams")
17228
+ join(projectDir, ".automatosx", "teams")
17373
17229
  );
17374
17230
  const profileLoader = new ProfileLoader(
17375
- join19(projectDir, ".automatosx", "agents"),
17231
+ join(projectDir, ".automatosx", "agents"),
17376
17232
  void 0,
17377
17233
  teamManager
17378
17234
  );
17379
17235
  const abilitiesManager = new AbilitiesManager(
17380
- join19(projectDir, ".automatosx", "abilities")
17236
+ join(projectDir, ".automatosx", "abilities")
17381
17237
  );
17382
17238
  try {
17383
17239
  memoryManager = await MemoryManager.create({
17384
- dbPath: join19(projectDir, ".automatosx", "memory", "memory.db")
17240
+ dbPath: join(projectDir, ".automatosx", "memory", "memory.db")
17385
17241
  });
17386
17242
  if (argv2.verbose) {
17387
- console.log(chalk24.green("\u2713 Memory system initialized\n"));
17243
+ console.log(chalk3.green("\u2713 Memory system initialized\n"));
17388
17244
  }
17389
17245
  } catch (error) {
17390
17246
  if (argv2.verbose) {
17391
17247
  const errMsg = error instanceof Error ? error.message : String(error);
17392
- console.log(chalk24.yellow(`\u26A0 Memory features disabled: ${errMsg}
17248
+ console.log(chalk3.yellow(`\u26A0 Memory features disabled: ${errMsg}
17393
17249
  `));
17394
17250
  }
17395
17251
  }
17396
17252
  const pathResolver = new PathResolver({
17397
17253
  projectDir,
17398
17254
  workingDir: process.cwd(),
17399
- agentWorkspace: join19(projectDir, ".automatosx", "workspaces")
17255
+ agentWorkspace: join(projectDir, ".automatosx", "workspaces")
17400
17256
  });
17401
17257
  const providers = [];
17402
17258
  if (config.providers["claude-code"]?.enabled) {
@@ -17431,7 +17287,7 @@ var resumeCommand = {
17431
17287
  fallbackEnabled: true
17432
17288
  });
17433
17289
  const sessionManager = new SessionManager({
17434
- persistencePath: join19(projectDir, ".automatosx", "sessions", "sessions.json")
17290
+ persistencePath: join(projectDir, ".automatosx", "sessions", "sessions.json")
17435
17291
  });
17436
17292
  await sessionManager.initialize();
17437
17293
  const workspaceManager = new WorkspaceManager(projectDir);
@@ -17487,9 +17343,9 @@ var resumeCommand = {
17487
17343
  }
17488
17344
  );
17489
17345
  if (result.success) {
17490
- console.log(chalk24.green("\n\u2705 Execution completed successfully!"));
17346
+ console.log(chalk3.green("\n\u2705 Execution completed successfully!"));
17491
17347
  } else {
17492
- console.error(chalk24.red("\n\u274C Execution failed."));
17348
+ console.error(chalk3.red("\n\u274C Execution failed."));
17493
17349
  if (memoryManager) {
17494
17350
  await memoryManager.close();
17495
17351
  }
@@ -17505,11 +17361,11 @@ var resumeCommand = {
17505
17361
  router.destroy();
17506
17362
  }
17507
17363
  await new Promise((resolve10) => setImmediate(resolve10));
17508
- console.log(chalk24.green.bold("\u2705 Complete\n"));
17364
+ console.log(chalk3.green.bold("\u2705 Complete\n"));
17509
17365
  process.exit(0);
17510
17366
  } catch (error) {
17511
17367
  const err = error instanceof Error ? error : new Error(String(error));
17512
- console.error(chalk24.red.bold(`
17368
+ console.error(chalk3.red.bold(`
17513
17369
  \u274C Failed to resume: ${err.message}
17514
17370
  `));
17515
17371
  logger.error("Resume failed", {
@@ -17536,9 +17392,6 @@ var resumeCommand = {
17536
17392
 
17537
17393
  // src/cli/commands/runs.ts
17538
17394
  init_esm_shims();
17539
- import chalk25 from "chalk";
17540
- import { join as join20 } from "path";
17541
- import { promises as fs3 } from "fs";
17542
17395
  init_path_resolver();
17543
17396
  init_logger();
17544
17397
  var listRunsCommand = {
@@ -17563,7 +17416,7 @@ var listRunsCommand = {
17563
17416
  const projectDir = await detectProjectRoot(process.cwd());
17564
17417
  const config = await loadConfig(projectDir);
17565
17418
  const stageConfig = config.execution?.stages;
17566
- const checkpointPath = stageConfig?.checkpointPath || join20(projectDir, ".automatosx", "checkpoints");
17419
+ const checkpointPath = stageConfig?.checkpointPath || join(projectDir, ".automatosx", "checkpoints");
17567
17420
  const cleanupAfterDays = stageConfig?.cleanupAfterDays || 7;
17568
17421
  const checkpointManager = new CheckpointManager(checkpointPath, cleanupAfterDays);
17569
17422
  let runs = await checkpointManager.listCheckpoints();
@@ -17574,13 +17427,13 @@ var listRunsCommand = {
17574
17427
  runs = runs.filter((r) => r.agent === argv2.agent);
17575
17428
  }
17576
17429
  runs = runs.slice(0, argv2.limit);
17577
- console.log(chalk25.cyan("\n\u{1F4CB} Checkpoint Runs\n"));
17430
+ console.log(chalk3.cyan("\n\u{1F4CB} Checkpoint Runs\n"));
17578
17431
  if (runs.length === 0) {
17579
17432
  console.log(" No checkpoints found.");
17580
17433
  return;
17581
17434
  }
17582
- console.log(chalk25.gray(" Run ID Agent Mode Progress Status Updated"));
17583
- console.log(chalk25.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
17435
+ console.log(chalk3.gray(" Run ID Agent Mode Progress Status Updated"));
17436
+ console.log(chalk3.gray(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"));
17584
17437
  for (const run of runs) {
17585
17438
  const runIdShort = run.runId.substring(0, 8);
17586
17439
  const agentName = run.agent.padEnd(14, " ").substring(0, 14);
@@ -17593,7 +17446,7 @@ var listRunsCommand = {
17593
17446
  console.log();
17594
17447
  } catch (error) {
17595
17448
  const err = error instanceof Error ? error : new Error(String(error));
17596
- console.error(chalk25.red.bold(`
17449
+ console.error(chalk3.red.bold(`
17597
17450
  \u274C Failed to list runs: ${err.message}
17598
17451
  `));
17599
17452
  logger.error("List runs failed", { error: err.message, stack: err.stack });
@@ -17621,7 +17474,7 @@ var showRunCommand = {
17621
17474
  },
17622
17475
  handler: async (argv2) => {
17623
17476
  if (!argv2["run-id"] || typeof argv2["run-id"] !== "string") {
17624
- console.log(chalk25.red.bold("\n\u274C Error: Run ID is required\n"));
17477
+ console.log(chalk3.red.bold("\n\u274C Error: Run ID is required\n"));
17625
17478
  process.exit(1);
17626
17479
  }
17627
17480
  const runId = argv2["run-id"];
@@ -17629,12 +17482,12 @@ var showRunCommand = {
17629
17482
  const projectDir = await detectProjectRoot(process.cwd());
17630
17483
  const config = await loadConfig(projectDir);
17631
17484
  const stageConfig = config.execution?.stages;
17632
- const checkpointPath = stageConfig?.checkpointPath || join20(projectDir, ".automatosx", "checkpoints");
17485
+ const checkpointPath = stageConfig?.checkpointPath || join(projectDir, ".automatosx", "checkpoints");
17633
17486
  const cleanupAfterDays = stageConfig?.cleanupAfterDays || 7;
17634
17487
  const checkpointManager = new CheckpointManager(checkpointPath, cleanupAfterDays);
17635
17488
  const checkpoint = await checkpointManager.loadCheckpoint(runId);
17636
- console.log(chalk25.cyan("\n\u{1F4C2} Checkpoint Details\n"));
17637
- console.log(` Run ID: ${chalk25.bold(checkpoint.runId)}`);
17489
+ console.log(chalk3.cyan("\n\u{1F4C2} Checkpoint Details\n"));
17490
+ console.log(` Run ID: ${chalk3.bold(checkpoint.runId)}`);
17638
17491
  console.log(` Agent: ${checkpoint.agent}`);
17639
17492
  console.log(` Task: ${checkpoint.task}`);
17640
17493
  console.log(` Mode: ${formatMode(checkpoint.mode)}`);
@@ -17642,46 +17495,46 @@ var showRunCommand = {
17642
17495
  console.log(` Created: ${new Date(checkpoint.createdAt).toLocaleString()}`);
17643
17496
  console.log(` Updated: ${new Date(checkpoint.updatedAt).toLocaleString()}`);
17644
17497
  if (argv2.stages && checkpoint.stages.length > 0) {
17645
- console.log(chalk25.cyan("\n\u{1F4CA} Stage Execution History\n"));
17498
+ console.log(chalk3.cyan("\n\u{1F4CA} Stage Execution History\n"));
17646
17499
  for (const stage of checkpoint.stages) {
17647
17500
  const status = formatStageStatus(stage.status);
17648
17501
  const duration = stage.result?.duration ? `${(stage.result.duration / 1e3).toFixed(1)}s` : "-";
17649
- console.log(` ${stage.index + 1}. ${chalk25.bold(stage.name)}`);
17502
+ console.log(` ${stage.index + 1}. ${chalk3.bold(stage.name)}`);
17650
17503
  console.log(` Status: ${status}`);
17651
17504
  console.log(` Duration: ${duration}`);
17652
17505
  console.log(` Retries: ${stage.retries || 0}`);
17653
17506
  if (stage.result?.error) {
17654
- console.log(chalk25.red(` Error: ${stage.result.error.message}`));
17507
+ console.log(chalk3.red(` Error: ${stage.result.error.message}`));
17655
17508
  }
17656
17509
  console.log();
17657
17510
  }
17658
17511
  }
17659
17512
  if (argv2.artifacts) {
17660
- const artifactsPath = join20(
17513
+ const artifactsPath = join(
17661
17514
  checkpointPath,
17662
17515
  runId,
17663
17516
  "artifacts"
17664
17517
  );
17665
17518
  try {
17666
- const artifactFiles = await fs3.readdir(artifactsPath);
17519
+ const artifactFiles = await promises.readdir(artifactsPath);
17667
17520
  if (artifactFiles.length > 0) {
17668
- console.log(chalk25.cyan("\n\u{1F4C1} Artifacts\n"));
17521
+ console.log(chalk3.cyan("\n\u{1F4C1} Artifacts\n"));
17669
17522
  for (const file of artifactFiles) {
17670
- const stats = await fs3.stat(join20(artifactsPath, file));
17523
+ const stats = await promises.stat(join(artifactsPath, file));
17671
17524
  const size = (stats.size / 1024).toFixed(1);
17672
17525
  console.log(` ${file} (${size} KB)`);
17673
17526
  }
17674
17527
  console.log();
17675
17528
  } else {
17676
- console.log(chalk25.gray("\nNo artifacts found.\n"));
17529
+ console.log(chalk3.gray("\nNo artifacts found.\n"));
17677
17530
  }
17678
17531
  } catch (error) {
17679
- console.log(chalk25.gray("\nNo artifacts found.\n"));
17532
+ console.log(chalk3.gray("\nNo artifacts found.\n"));
17680
17533
  }
17681
17534
  }
17682
17535
  } catch (error) {
17683
17536
  const err = error instanceof Error ? error : new Error(String(error));
17684
- console.error(chalk25.red.bold(`
17537
+ console.error(chalk3.red.bold(`
17685
17538
  \u274C Failed to load checkpoint: ${err.message}
17686
17539
  `));
17687
17540
  logger.error("Show run failed", { error: err.message, runId, stack: err.stack });
@@ -17706,7 +17559,7 @@ var deleteRunCommand = {
17706
17559
  },
17707
17560
  handler: async (argv2) => {
17708
17561
  if (!argv2["run-id"] || typeof argv2["run-id"] !== "string") {
17709
- console.log(chalk25.red.bold("\n\u274C Error: Run ID is required\n"));
17562
+ console.log(chalk3.red.bold("\n\u274C Error: Run ID is required\n"));
17710
17563
  process.exit(1);
17711
17564
  }
17712
17565
  const runId = argv2["run-id"];
@@ -17714,23 +17567,23 @@ var deleteRunCommand = {
17714
17567
  const projectDir = await detectProjectRoot(process.cwd());
17715
17568
  const config = await loadConfig(projectDir);
17716
17569
  const stageConfig = config.execution?.stages;
17717
- const checkpointPath = stageConfig?.checkpointPath || join20(projectDir, ".automatosx", "checkpoints");
17570
+ const checkpointPath = stageConfig?.checkpointPath || join(projectDir, ".automatosx", "checkpoints");
17718
17571
  const cleanupAfterDays = stageConfig?.cleanupAfterDays || 7;
17719
17572
  const checkpointManager = new CheckpointManager(checkpointPath, cleanupAfterDays);
17720
17573
  const checkpoint = await checkpointManager.loadCheckpoint(runId);
17721
17574
  if (!argv2.force) {
17722
- console.log(chalk25.yellow("\n\u26A0\uFE0F Warning: This action cannot be undone.\n"));
17575
+ console.log(chalk3.yellow("\n\u26A0\uFE0F Warning: This action cannot be undone.\n"));
17723
17576
  console.log(` Run ID: ${runId}`);
17724
17577
  console.log(` Agent: ${checkpoint.agent}`);
17725
17578
  console.log(` Task: ${checkpoint.task}`);
17726
17579
  console.log();
17727
- const readline4 = await import("readline");
17580
+ const readline4 = await import('readline');
17728
17581
  const rl = readline4.createInterface({
17729
17582
  input: process.stdin,
17730
17583
  output: process.stdout
17731
17584
  });
17732
17585
  const answer = await new Promise((resolve10) => {
17733
- rl.question(chalk25.yellow("Delete this checkpoint? (yes/no): "), resolve10);
17586
+ rl.question(chalk3.yellow("Delete this checkpoint? (yes/no): "), resolve10);
17734
17587
  });
17735
17588
  rl.close();
17736
17589
  if (answer.toLowerCase() !== "yes" && answer.toLowerCase() !== "y") {
@@ -17739,12 +17592,12 @@ var deleteRunCommand = {
17739
17592
  }
17740
17593
  }
17741
17594
  await checkpointManager.deleteCheckpoint(runId);
17742
- console.log(chalk25.green(`
17595
+ console.log(chalk3.green(`
17743
17596
  \u2705 Checkpoint deleted: ${runId}
17744
17597
  `));
17745
17598
  } catch (error) {
17746
17599
  const err = error instanceof Error ? error : new Error(String(error));
17747
- console.error(chalk25.red.bold(`
17600
+ console.error(chalk3.red.bold(`
17748
17601
  \u274C Failed to delete checkpoint: ${err.message}
17749
17602
  `));
17750
17603
  logger.error("Delete run failed", { error: err.message, runId, stack: err.stack });
@@ -17762,23 +17615,23 @@ var runsCommand = {
17762
17615
  }
17763
17616
  };
17764
17617
  function formatMode(mode) {
17765
- if (mode.interactive && mode.streaming) return chalk25.cyan("Hybrid");
17766
- if (mode.interactive) return chalk25.blue("Interactive");
17767
- if (mode.streaming) return chalk25.magenta("Streaming");
17768
- return chalk25.gray("Standard");
17618
+ if (mode.interactive && mode.streaming) return chalk3.cyan("Hybrid");
17619
+ if (mode.interactive) return chalk3.blue("Interactive");
17620
+ if (mode.streaming) return chalk3.magenta("Streaming");
17621
+ return chalk3.gray("Standard");
17769
17622
  }
17770
17623
  function formatStatus(status) {
17771
17624
  switch (status) {
17772
17625
  case "running":
17773
- return chalk25.yellow("Running");
17626
+ return chalk3.yellow("Running");
17774
17627
  case "paused":
17775
- return chalk25.blue("Paused");
17628
+ return chalk3.blue("Paused");
17776
17629
  case "completed":
17777
- return chalk25.green("Completed");
17630
+ return chalk3.green("Completed");
17778
17631
  case "failed":
17779
- return chalk25.red("Failed");
17632
+ return chalk3.red("Failed");
17780
17633
  case "aborted":
17781
- return chalk25.gray("Aborted");
17634
+ return chalk3.gray("Aborted");
17782
17635
  default:
17783
17636
  return status;
17784
17637
  }
@@ -17786,43 +17639,26 @@ function formatStatus(status) {
17786
17639
  function formatStageStatus(status) {
17787
17640
  switch (status) {
17788
17641
  case "queued":
17789
- return chalk25.gray("Queued");
17642
+ return chalk3.gray("Queued");
17790
17643
  case "running":
17791
- return chalk25.yellow("Running");
17644
+ return chalk3.yellow("Running");
17792
17645
  case "checkpoint":
17793
- return chalk25.blue("Checkpoint");
17646
+ return chalk3.blue("Checkpoint");
17794
17647
  case "completed":
17795
- return chalk25.green("Completed");
17648
+ return chalk3.green("Completed");
17796
17649
  case "error":
17797
- return chalk25.red("Error");
17650
+ return chalk3.red("Error");
17798
17651
  case "timeout":
17799
- return chalk25.red("Timeout");
17652
+ return chalk3.red("Timeout");
17800
17653
  case "skipped":
17801
- return chalk25.gray("Skipped");
17654
+ return chalk3.gray("Skipped");
17802
17655
  default:
17803
17656
  return status;
17804
17657
  }
17805
17658
  }
17806
17659
 
17807
17660
  // src/cli/index.ts
17808
- var require3 = createRequire4(import.meta.url);
17809
- var VERSION2 = "unknown";
17810
- try {
17811
- const versionData = require3("../version.json");
17812
- VERSION2 = versionData.version || "unknown";
17813
- } catch (err) {
17814
- try {
17815
- const versionData = require3("../../version.json");
17816
- VERSION2 = versionData.version || "unknown";
17817
- } catch (err2) {
17818
- try {
17819
- const packageJson = require3("../../package.json");
17820
- VERSION2 = packageJson.version || "unknown";
17821
- } catch (err3) {
17822
- logger.debug("Version file not found, using fallback");
17823
- }
17824
- }
17825
- }
17661
+ var VERSION2 = getVersion();
17826
17662
  globalTracker.mark("cli_start");
17827
17663
  globalTracker.mark("yargs_parse_start");
17828
17664
  var argv = await yargs(hideBin(process.argv)).scriptName("automatosx").usage("$0 <command> [options]").usage("\nAI Agent Orchestration Platform").example("$0 init", "Initialize project").example("$0 agent create backend --template developer", "Create agent from template").example("$0 agent list", "List all agents").example('$0 run assistant "Hello"', "Run assistant agent").example('$0 run backend "task" --interactive', "Run with interactive checkpoints").example("$0 resume <run-id>", "Resume from checkpoint").example("$0 runs list", "List checkpoint runs").example('$0 session create "Build API" backend', "Create multi-agent session").example("$0 session list", "List all sessions").example("$0 workspace stats", "Show workspace statistics").example("$0 list agents", "List available agents").example('$0 memory search "topic"', "Search memory").example("$0 config --list", "View configuration").example("$0 mcp", "Start MCP server for Claude Code").example("$0 update", "Update to latest version").option("debug", {
@@ -17881,4 +17717,3 @@ globalTracker.measure("cli_startup", "cli_start", "cli_ready");
17881
17717
  if (globalTracker.isEnabled() && argv.debug) {
17882
17718
  console.error("\n" + globalTracker.generateReport() + "\n");
17883
17719
  }
17884
- //# sourceMappingURL=index.js.map