@defai.digital/automatosx 11.2.6 → 11.2.7
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/README.md +1 -1
- package/dist/index.js +289 -312
- package/dist/mcp/index.js +75 -72
- package/examples/providers/README.md +58 -169
- package/package.json +1 -1
- package/CHANGELOG.md +0 -41
- package/CODE_OF_CONDUCT.md +0 -133
- package/CONTRIBUTING.md +0 -427
- package/FAQ.md +0 -895
- package/TROUBLESHOOTING.md +0 -972
- package/templates/providers/README.md +0 -117
- /package/examples/{claude → providers/claude}/CLAUDE_INTEGRATION.md +0 -0
- /package/examples/{claude → providers/claude}/mcp/automatosx.json +0 -0
- /package/examples/{codex → providers/codex}/CODEX_INTEGRATION.md +0 -0
- /package/examples/{codex → providers/codex}/README.md +0 -0
- /package/examples/{codex → providers/codex}/usage-examples.ts +0 -0
- /package/examples/{gemini → providers/gemini}/GEMINI_INTEGRATION.md +0 -0
- /package/examples/{gemini → providers/gemini}/README.md +0 -0
- /package/examples/{integrations → providers}/openai-codex-example.ts +0 -0
- /package/{templates → examples}/specs/enterprise.yaml.mustache +0 -0
- /package/{templates → examples}/specs/government.yaml.mustache +0 -0
- /package/{templates → examples}/specs/minimal.yaml.mustache +0 -0
- /package/examples/{templates → workflows}/analyst.yaml +0 -0
- /package/examples/{templates → workflows}/assistant.yaml +0 -0
- /package/examples/{templates → workflows}/basic-agent.yaml +0 -0
- /package/examples/{templates → workflows}/code-reviewer.yaml +0 -0
- /package/examples/{templates → workflows}/debugger.yaml +0 -0
- /package/examples/{templates → workflows}/designer.yaml +0 -0
- /package/examples/{templates → workflows}/developer.yaml +0 -0
- /package/examples/{templates → workflows}/fullstack-developer.yaml +0 -0
- /package/examples/{templates → workflows}/qa-specialist.yaml +0 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as path4 from 'path';
|
|
3
|
-
import path4__default, { dirname, join, isAbsolute, basename, resolve, extname as extname$1,
|
|
3
|
+
import path4__default, { dirname, join, isAbsolute, basename, resolve, extname as extname$1, relative, sep, normalize, parse as parse$1, delimiter } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import * as fs4 from 'fs/promises';
|
|
6
6
|
import { mkdir, appendFile, access as access$1, readFile, stat, rm, readdir, copyFile, writeFile, rename, unlink, constants as constants$1, realpath as realpath$1 } from 'fs/promises';
|
|
@@ -57,12 +57,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
57
57
|
return to;
|
|
58
58
|
};
|
|
59
59
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
60
|
-
var getFilename, getDirname, __dirname$1;
|
|
61
60
|
var init_esm_shims = __esm({
|
|
62
61
|
"node_modules/tsup/assets/esm_shims.js"() {
|
|
63
|
-
getFilename = () => fileURLToPath(import.meta.url);
|
|
64
|
-
getDirname = () => path4__default.dirname(getFilename());
|
|
65
|
-
__dirname$1 = /* @__PURE__ */ getDirname();
|
|
66
62
|
}
|
|
67
63
|
});
|
|
68
64
|
function sanitizeObject(obj, maxDepth = 5, currentDepth = 0) {
|
|
@@ -99,7 +95,7 @@ function setLogLevel(level) {
|
|
|
99
95
|
}
|
|
100
96
|
var LOG_LEVELS, COLORS, SENSITIVE_KEYS, SimpleLogger, logger;
|
|
101
97
|
var init_logger = __esm({
|
|
102
|
-
"src/
|
|
98
|
+
"src/shared/logging/logger.ts"() {
|
|
103
99
|
init_esm_shims();
|
|
104
100
|
LOG_LEVELS = {
|
|
105
101
|
trace: 0,
|
|
@@ -271,7 +267,7 @@ ${JSON.stringify(entry.context, null, 2)}`;
|
|
|
271
267
|
}
|
|
272
268
|
});
|
|
273
269
|
|
|
274
|
-
// src/
|
|
270
|
+
// src/shared/process/process-manager.ts
|
|
275
271
|
var process_manager_exports = {};
|
|
276
272
|
__export(process_manager_exports, {
|
|
277
273
|
installExitHandlers: () => installExitHandlers,
|
|
@@ -321,7 +317,7 @@ function installExitHandlers() {
|
|
|
321
317
|
}
|
|
322
318
|
var ProcessManager, processManager, exitHandlersInstalled, exitInProgress;
|
|
323
319
|
var init_process_manager = __esm({
|
|
324
|
-
"src/
|
|
320
|
+
"src/shared/process/process-manager.ts"() {
|
|
325
321
|
init_esm_shims();
|
|
326
322
|
init_logger();
|
|
327
323
|
ProcessManager = class {
|
|
@@ -485,8 +481,8 @@ var init_process_manager = __esm({
|
|
|
485
481
|
}
|
|
486
482
|
});
|
|
487
483
|
var DEFAULT_OPTIONS, DatabaseFactory;
|
|
488
|
-
var
|
|
489
|
-
"src/
|
|
484
|
+
var init_factory = __esm({
|
|
485
|
+
"src/core/database/factory.ts"() {
|
|
490
486
|
init_esm_shims();
|
|
491
487
|
init_logger();
|
|
492
488
|
DEFAULT_OPTIONS = {
|
|
@@ -682,12 +678,12 @@ function extname(filePath) {
|
|
|
682
678
|
return path4__default.extname(filePath);
|
|
683
679
|
}
|
|
684
680
|
var init_path_utils = __esm({
|
|
685
|
-
"src/
|
|
681
|
+
"src/shared/validation/path-utils.ts"() {
|
|
686
682
|
init_esm_shims();
|
|
687
683
|
}
|
|
688
684
|
});
|
|
689
685
|
|
|
690
|
-
// src/
|
|
686
|
+
// src/shared/errors/errors.ts
|
|
691
687
|
function toBaseError(error) {
|
|
692
688
|
if (error instanceof BaseError) {
|
|
693
689
|
return error;
|
|
@@ -708,7 +704,7 @@ function toBaseError(error) {
|
|
|
708
704
|
}
|
|
709
705
|
var BaseError, ConfigError, ProviderError;
|
|
710
706
|
var init_errors = __esm({
|
|
711
|
-
"src/
|
|
707
|
+
"src/shared/errors/errors.ts"() {
|
|
712
708
|
init_esm_shims();
|
|
713
709
|
BaseError = class extends Error {
|
|
714
710
|
code;
|
|
@@ -1012,7 +1008,7 @@ var init_path = __esm({
|
|
|
1012
1008
|
}
|
|
1013
1009
|
});
|
|
1014
1010
|
|
|
1015
|
-
// src/
|
|
1011
|
+
// src/shared/validation/path-resolver.ts
|
|
1016
1012
|
var path_resolver_exports = {};
|
|
1017
1013
|
__export(path_resolver_exports, {
|
|
1018
1014
|
PathResolver: () => PathResolver,
|
|
@@ -1062,7 +1058,7 @@ async function detectProjectRoot(startDir = process.cwd()) {
|
|
|
1062
1058
|
}
|
|
1063
1059
|
var PathResolver;
|
|
1064
1060
|
var init_path_resolver = __esm({
|
|
1065
|
-
"src/
|
|
1061
|
+
"src/shared/validation/path-resolver.ts"() {
|
|
1066
1062
|
init_esm_shims();
|
|
1067
1063
|
init_path_utils();
|
|
1068
1064
|
init_path();
|
|
@@ -1228,7 +1224,7 @@ var init_workspace_indexer = __esm({
|
|
|
1228
1224
|
"src/core/workspace-indexer.ts"() {
|
|
1229
1225
|
init_esm_shims();
|
|
1230
1226
|
init_logger();
|
|
1231
|
-
|
|
1227
|
+
init_factory();
|
|
1232
1228
|
DEFAULT_IGNORE_PATTERNS = [
|
|
1233
1229
|
"node_modules/**",
|
|
1234
1230
|
".git/**",
|
|
@@ -1749,10 +1745,10 @@ var init_workspace_indexer = __esm({
|
|
|
1749
1745
|
}
|
|
1750
1746
|
});
|
|
1751
1747
|
|
|
1752
|
-
// src/
|
|
1748
|
+
// src/shared/logging/verbosity-manager.ts
|
|
1753
1749
|
var VerbosityManager;
|
|
1754
1750
|
var init_verbosity_manager = __esm({
|
|
1755
|
-
"src/
|
|
1751
|
+
"src/shared/logging/verbosity-manager.ts"() {
|
|
1756
1752
|
init_esm_shims();
|
|
1757
1753
|
VerbosityManager = class _VerbosityManager {
|
|
1758
1754
|
static instance = null;
|
|
@@ -2072,7 +2068,7 @@ var init_provider_schemas = __esm({
|
|
|
2072
2068
|
});
|
|
2073
2069
|
var StreamingProgressParser;
|
|
2074
2070
|
var init_streaming_progress_parser = __esm({
|
|
2075
|
-
"src/
|
|
2071
|
+
"src/shared/process/streaming-progress-parser.ts"() {
|
|
2076
2072
|
init_esm_shims();
|
|
2077
2073
|
StreamingProgressParser = class {
|
|
2078
2074
|
spinner = null;
|
|
@@ -7627,7 +7623,7 @@ var init_ax_cli_provider = __esm({
|
|
|
7627
7623
|
init_esm_shims();
|
|
7628
7624
|
init_logger();
|
|
7629
7625
|
|
|
7630
|
-
// src/
|
|
7626
|
+
// src/shared/profiling/performance.ts
|
|
7631
7627
|
init_esm_shims();
|
|
7632
7628
|
var PerformanceTracker = class {
|
|
7633
7629
|
marks = /* @__PURE__ */ new Map();
|
|
@@ -7722,14 +7718,14 @@ var globalTracker = new PerformanceTracker(
|
|
|
7722
7718
|
process.env.AX_PROFILE === "true"
|
|
7723
7719
|
);
|
|
7724
7720
|
|
|
7725
|
-
// src/
|
|
7721
|
+
// src/shared/helpers/version.ts
|
|
7726
7722
|
init_esm_shims();
|
|
7727
7723
|
var __dirname2 = dirname(fileURLToPath(import.meta.url));
|
|
7728
7724
|
function getVersion() {
|
|
7729
7725
|
try {
|
|
7730
7726
|
const possiblePaths = [
|
|
7731
|
-
join(__dirname2, "
|
|
7732
|
-
// From src/
|
|
7727
|
+
join(__dirname2, "../../../package.json"),
|
|
7728
|
+
// From src/shared/helpers
|
|
7733
7729
|
join(__dirname2, "../package.json")
|
|
7734
7730
|
// From dist
|
|
7735
7731
|
];
|
|
@@ -7756,10 +7752,10 @@ init_process_manager();
|
|
|
7756
7752
|
// src/cli/commands/cache.ts
|
|
7757
7753
|
init_esm_shims();
|
|
7758
7754
|
|
|
7759
|
-
// src/core/response-cache.ts
|
|
7755
|
+
// src/core/cache/response-cache.ts
|
|
7760
7756
|
init_esm_shims();
|
|
7761
7757
|
init_logger();
|
|
7762
|
-
|
|
7758
|
+
init_factory();
|
|
7763
7759
|
var LRUCache = class {
|
|
7764
7760
|
cache;
|
|
7765
7761
|
maxSize;
|
|
@@ -8138,7 +8134,7 @@ var ResponseCache = class {
|
|
|
8138
8134
|
}
|
|
8139
8135
|
};
|
|
8140
8136
|
|
|
8141
|
-
// src/core/config.ts
|
|
8137
|
+
// src/core/config/loader.ts
|
|
8142
8138
|
init_esm_shims();
|
|
8143
8139
|
init_path_utils();
|
|
8144
8140
|
|
|
@@ -8514,11 +8510,11 @@ var DEFAULT_CONFIG = {
|
|
|
8514
8510
|
}
|
|
8515
8511
|
};
|
|
8516
8512
|
|
|
8517
|
-
// src/core/config.ts
|
|
8513
|
+
// src/core/config/loader.ts
|
|
8518
8514
|
init_errors();
|
|
8519
8515
|
init_logger();
|
|
8520
8516
|
|
|
8521
|
-
// src/
|
|
8517
|
+
// src/shared/helpers/deep-merge.ts
|
|
8522
8518
|
init_esm_shims();
|
|
8523
8519
|
function deepMerge(defaults, user) {
|
|
8524
8520
|
if (user === null || user === void 0) {
|
|
@@ -8658,7 +8654,7 @@ function isNonNegativeInteger(value) {
|
|
|
8658
8654
|
return typeof value === "number" && Number.isInteger(value) && value >= 0;
|
|
8659
8655
|
}
|
|
8660
8656
|
|
|
8661
|
-
// src/core/cache.ts
|
|
8657
|
+
// src/core/cache/cache.ts
|
|
8662
8658
|
init_esm_shims();
|
|
8663
8659
|
init_logger();
|
|
8664
8660
|
var TTLCache = class {
|
|
@@ -8943,7 +8939,7 @@ var TTLCache = class {
|
|
|
8943
8939
|
}
|
|
8944
8940
|
};
|
|
8945
8941
|
|
|
8946
|
-
// src/
|
|
8942
|
+
// src/shared/helpers/resource-calculator.ts
|
|
8947
8943
|
init_esm_shims();
|
|
8948
8944
|
function getSystemResources() {
|
|
8949
8945
|
const totalMemory = os2.totalmem();
|
|
@@ -8985,13 +8981,13 @@ function calculateMaxConcurrentAgents(staticLimit) {
|
|
|
8985
8981
|
};
|
|
8986
8982
|
}
|
|
8987
8983
|
|
|
8988
|
-
// src/config
|
|
8984
|
+
// src/core/config/generated.ts
|
|
8989
8985
|
init_esm_shims();
|
|
8990
8986
|
var PRECOMPILED_CONFIG = {
|
|
8991
8987
|
"providers": {
|
|
8992
8988
|
"claude-code": {
|
|
8993
8989
|
"enabled": true,
|
|
8994
|
-
"priority":
|
|
8990
|
+
"priority": 1,
|
|
8995
8991
|
"timeout": 27e5,
|
|
8996
8992
|
"command": "claude",
|
|
8997
8993
|
"healthCheck": {
|
|
@@ -9051,7 +9047,7 @@ var PRECOMPILED_CONFIG = {
|
|
|
9051
9047
|
},
|
|
9052
9048
|
"openai": {
|
|
9053
9049
|
"enabled": true,
|
|
9054
|
-
"priority":
|
|
9050
|
+
"priority": 3,
|
|
9055
9051
|
"timeout": 27e5,
|
|
9056
9052
|
"command": "codex",
|
|
9057
9053
|
"healthCheck": {
|
|
@@ -9289,10 +9285,10 @@ var PRECOMPILED_CONFIG = {
|
|
|
9289
9285
|
"enableFreeTierPrioritization": true,
|
|
9290
9286
|
"enableWorkloadAwareRouting": true
|
|
9291
9287
|
},
|
|
9292
|
-
"version": "11.2.
|
|
9288
|
+
"version": "11.2.7"
|
|
9293
9289
|
};
|
|
9294
9290
|
|
|
9295
|
-
// src/core/config
|
|
9291
|
+
// src/core/config/schemas.ts
|
|
9296
9292
|
init_esm_shims();
|
|
9297
9293
|
z.enum([
|
|
9298
9294
|
"claude",
|
|
@@ -9593,7 +9589,7 @@ function safeValidateConfig(config) {
|
|
|
9593
9589
|
}
|
|
9594
9590
|
automatosXConfigSchema.partial().passthrough();
|
|
9595
9591
|
|
|
9596
|
-
// src/core/config.ts
|
|
9592
|
+
// src/core/config/loader.ts
|
|
9597
9593
|
var configCache = new TTLCache({
|
|
9598
9594
|
ttl: 6e4,
|
|
9599
9595
|
// 60 seconds
|
|
@@ -9627,7 +9623,7 @@ async function loadConfigUncached(projectDir) {
|
|
|
9627
9623
|
logger.warn("\u26A0\uFE0F DEPRECATED: automatosx.config.{yaml,json} is deprecated.");
|
|
9628
9624
|
logger.warn(" Please rename to ax.config.{yaml,json} for future compatibility.");
|
|
9629
9625
|
logger.warn(" Migration: mv automatosx.config.json ax.config.json");
|
|
9630
|
-
logger.warn(" Support will be removed in
|
|
9626
|
+
logger.warn(" Support will be removed in a future version.");
|
|
9631
9627
|
}
|
|
9632
9628
|
return await loadConfigFile(configPath);
|
|
9633
9629
|
}
|
|
@@ -10169,7 +10165,7 @@ async function saveConfigFile(path7, config) {
|
|
|
10169
10165
|
}
|
|
10170
10166
|
}
|
|
10171
10167
|
|
|
10172
|
-
// src/
|
|
10168
|
+
// src/shared/logging/message-formatter.ts
|
|
10173
10169
|
init_esm_shims();
|
|
10174
10170
|
function formatSuccess(message, options = {}) {
|
|
10175
10171
|
const { colors = true, icon = true } = options;
|
|
@@ -10441,7 +10437,7 @@ var cacheCommand = {
|
|
|
10441
10437
|
init_esm_shims();
|
|
10442
10438
|
init_logger();
|
|
10443
10439
|
|
|
10444
|
-
// src/
|
|
10440
|
+
// src/shared/errors/error-formatter.ts
|
|
10445
10441
|
init_esm_shims();
|
|
10446
10442
|
init_errors();
|
|
10447
10443
|
function formatError(error, options = {}) {
|
|
@@ -10495,7 +10491,7 @@ function printError(error, options = {}) {
|
|
|
10495
10491
|
console.error(formatted);
|
|
10496
10492
|
}
|
|
10497
10493
|
|
|
10498
|
-
// src/
|
|
10494
|
+
// src/core/config/validator.ts
|
|
10499
10495
|
init_esm_shims();
|
|
10500
10496
|
function validateConfig2(config) {
|
|
10501
10497
|
const errors = [];
|
|
@@ -11000,7 +10996,7 @@ async function validateConfigFile(config, verbose) {
|
|
|
11000
10996
|
async function resetConfig(path7, verbose) {
|
|
11001
10997
|
const { createRequire } = await import('module');
|
|
11002
10998
|
const require2 = createRequire(import.meta.url);
|
|
11003
|
-
let version = "
|
|
10999
|
+
let version = "11.2.6";
|
|
11004
11000
|
try {
|
|
11005
11001
|
const packageJson = require2("../../../package.json");
|
|
11006
11002
|
version = packageJson.version;
|
|
@@ -11147,7 +11143,7 @@ function setNestedValue(obj, path7, value) {
|
|
|
11147
11143
|
init_esm_shims();
|
|
11148
11144
|
init_logger();
|
|
11149
11145
|
|
|
11150
|
-
// src/
|
|
11146
|
+
// src/shared/helpers/prompt-helper.ts
|
|
11151
11147
|
init_esm_shims();
|
|
11152
11148
|
var PromptHelper = class {
|
|
11153
11149
|
rl = null;
|
|
@@ -11267,6 +11263,29 @@ Your choice${defaultSuffix}: `,
|
|
|
11267
11263
|
}
|
|
11268
11264
|
};
|
|
11269
11265
|
|
|
11266
|
+
// src/shared/helpers/package-root.ts
|
|
11267
|
+
init_esm_shims();
|
|
11268
|
+
var cachedPackageRoot = null;
|
|
11269
|
+
function getPackageRoot(startDir) {
|
|
11270
|
+
if (cachedPackageRoot && true) {
|
|
11271
|
+
return cachedPackageRoot;
|
|
11272
|
+
}
|
|
11273
|
+
const __filename3 = fileURLToPath(import.meta.url);
|
|
11274
|
+
const __dirname4 = dirname(__filename3);
|
|
11275
|
+
let current = __dirname4;
|
|
11276
|
+
const root = "/";
|
|
11277
|
+
while (current !== root) {
|
|
11278
|
+
if (existsSync(join(current, "package.json"))) {
|
|
11279
|
+
{
|
|
11280
|
+
cachedPackageRoot = current;
|
|
11281
|
+
}
|
|
11282
|
+
return current;
|
|
11283
|
+
}
|
|
11284
|
+
current = dirname(current);
|
|
11285
|
+
}
|
|
11286
|
+
return __dirname4;
|
|
11287
|
+
}
|
|
11288
|
+
|
|
11270
11289
|
// src/integrations/claude-code/setup-helper.ts
|
|
11271
11290
|
init_esm_shims();
|
|
11272
11291
|
init_logger();
|
|
@@ -11832,7 +11851,7 @@ var AgentNotFoundError = class extends Error {
|
|
|
11832
11851
|
// src/agents/profile-loader.ts
|
|
11833
11852
|
init_logger();
|
|
11834
11853
|
|
|
11835
|
-
// src/
|
|
11854
|
+
// src/shared/profiling/performance-markers.ts
|
|
11836
11855
|
init_esm_shims();
|
|
11837
11856
|
init_logger();
|
|
11838
11857
|
var PERFORMANCE_THRESHOLDS = {
|
|
@@ -12134,16 +12153,6 @@ function safeValidateAgentProfile(profile) {
|
|
|
12134
12153
|
agentProfileSchema.partial();
|
|
12135
12154
|
|
|
12136
12155
|
// src/agents/profile-loader.ts
|
|
12137
|
-
var __filename2 = fileURLToPath(import.meta.url);
|
|
12138
|
-
var __dirname3 = dirname(__filename2);
|
|
12139
|
-
function getPackageRoot() {
|
|
12140
|
-
const currentDir = __dirname3;
|
|
12141
|
-
if (currentDir.includes(`${sep}dist`) || currentDir.includes("/dist")) {
|
|
12142
|
-
return join(currentDir, "..");
|
|
12143
|
-
} else {
|
|
12144
|
-
return join(currentDir, "../..");
|
|
12145
|
-
}
|
|
12146
|
-
}
|
|
12147
12156
|
var ProfileLoader = class {
|
|
12148
12157
|
profilesDir;
|
|
12149
12158
|
fallbackProfilesDir;
|
|
@@ -13191,19 +13200,6 @@ var ProviderDetector = class _ProviderDetector {
|
|
|
13191
13200
|
};
|
|
13192
13201
|
|
|
13193
13202
|
// src/cli/commands/setup.ts
|
|
13194
|
-
var __filename3 = fileURLToPath(import.meta.url);
|
|
13195
|
-
var __dirname4 = dirname(__filename3);
|
|
13196
|
-
function getPackageRoot2() {
|
|
13197
|
-
let current = __dirname4;
|
|
13198
|
-
const root = "/";
|
|
13199
|
-
while (current !== root) {
|
|
13200
|
-
if (existsSync(join(current, "package.json"))) {
|
|
13201
|
-
return current;
|
|
13202
|
-
}
|
|
13203
|
-
current = dirname(current);
|
|
13204
|
-
}
|
|
13205
|
-
throw new Error("Could not find package root (no package.json found)");
|
|
13206
|
-
}
|
|
13207
13203
|
var setupCommand = {
|
|
13208
13204
|
command: "setup [path]",
|
|
13209
13205
|
describe: "Set up AutomatosX in current or specified directory",
|
|
@@ -13233,8 +13229,8 @@ var setupCommand = {
|
|
|
13233
13229
|
const projectDir = resolve(argv.path || ".");
|
|
13234
13230
|
const automatosxDir = join(projectDir, ".automatosx");
|
|
13235
13231
|
const configPath = join(projectDir, "ax.config.json");
|
|
13236
|
-
const packageRoot =
|
|
13237
|
-
let version = "
|
|
13232
|
+
const packageRoot = getPackageRoot();
|
|
13233
|
+
let version = "11.2.6";
|
|
13238
13234
|
try {
|
|
13239
13235
|
const packageJson = JSON.parse(
|
|
13240
13236
|
await import('fs/promises').then((fs7) => fs7.readFile(join(packageRoot, "package.json"), "utf-8"))
|
|
@@ -13599,7 +13595,7 @@ async function validateEnvironment(packageRoot) {
|
|
|
13599
13595
|
const requiredDirs = [
|
|
13600
13596
|
"examples/agents",
|
|
13601
13597
|
"examples/abilities",
|
|
13602
|
-
"examples/
|
|
13598
|
+
"examples/workflows",
|
|
13603
13599
|
"examples/teams"
|
|
13604
13600
|
];
|
|
13605
13601
|
const errors = [];
|
|
@@ -13677,7 +13673,7 @@ async function copyExampleAbilities(baseDir, packageRoot) {
|
|
|
13677
13673
|
}
|
|
13678
13674
|
async function copyExampleTemplates(baseDir, packageRoot) {
|
|
13679
13675
|
return copyExampleFiles(baseDir, packageRoot, {
|
|
13680
|
-
exampleDir: "
|
|
13676
|
+
exampleDir: "workflows",
|
|
13681
13677
|
targetDir: "templates",
|
|
13682
13678
|
extension: ".yaml",
|
|
13683
13679
|
resourceName: "template"
|
|
@@ -13859,7 +13855,7 @@ async function createDefaultConfig(configPath, force, version) {
|
|
|
13859
13855
|
await writeFile(configPath, content, "utf-8");
|
|
13860
13856
|
}
|
|
13861
13857
|
async function setupClaudeIntegration(projectDir, packageRoot) {
|
|
13862
|
-
const examplesBaseDir = join(packageRoot, "examples/claude");
|
|
13858
|
+
const examplesBaseDir = join(packageRoot, "examples/providers/claude");
|
|
13863
13859
|
const claudeDir = join(projectDir, ".claude");
|
|
13864
13860
|
const mcpDir = join(claudeDir, "mcp");
|
|
13865
13861
|
await mkdir(mcpDir, { recursive: true });
|
|
@@ -16360,7 +16356,7 @@ var MCP_PROTOCOL_VERSION = "2024-11-05";
|
|
|
16360
16356
|
// src/mcp/server.ts
|
|
16361
16357
|
init_logger();
|
|
16362
16358
|
|
|
16363
|
-
// src/core/router.ts
|
|
16359
|
+
// src/core/router/router.ts
|
|
16364
16360
|
init_esm_shims();
|
|
16365
16361
|
init_logger();
|
|
16366
16362
|
init_errors();
|
|
@@ -16717,7 +16713,7 @@ async function getProviderLimitManager(stateDirectory) {
|
|
|
16717
16713
|
return ProviderLimitManager.getInstance(stateDirectory);
|
|
16718
16714
|
}
|
|
16719
16715
|
|
|
16720
|
-
// src/core/routing-strategy.ts
|
|
16716
|
+
// src/core/router/routing-strategy.ts
|
|
16721
16717
|
init_esm_shims();
|
|
16722
16718
|
|
|
16723
16719
|
// src/types/routing.ts
|
|
@@ -16794,7 +16790,7 @@ var ROUTING_STRATEGIES = {
|
|
|
16794
16790
|
init_esm_shims();
|
|
16795
16791
|
init_logger();
|
|
16796
16792
|
|
|
16797
|
-
// src/
|
|
16793
|
+
// src/shared/helpers/statistics.ts
|
|
16798
16794
|
init_esm_shims();
|
|
16799
16795
|
function getPercentileIndex(length, percentile) {
|
|
16800
16796
|
if (length === 0) {
|
|
@@ -17240,7 +17236,7 @@ function getProviderMetricsTracker() {
|
|
|
17240
17236
|
return globalMetricsTracker;
|
|
17241
17237
|
}
|
|
17242
17238
|
|
|
17243
|
-
// src/core/routing-strategy.ts
|
|
17239
|
+
// src/core/router/routing-strategy.ts
|
|
17244
17240
|
init_logger();
|
|
17245
17241
|
var RoutingStrategyManager = class extends EventEmitter {
|
|
17246
17242
|
strategy;
|
|
@@ -17523,7 +17519,7 @@ function getRoutingStrategyManager(config) {
|
|
|
17523
17519
|
return globalRoutingStrategy;
|
|
17524
17520
|
}
|
|
17525
17521
|
|
|
17526
|
-
// src/core/circuit-breaker.ts
|
|
17522
|
+
// src/core/router/circuit-breaker.ts
|
|
17527
17523
|
init_esm_shims();
|
|
17528
17524
|
init_logger();
|
|
17529
17525
|
var DEFAULT_CONFIG2 = {
|
|
@@ -17686,7 +17682,7 @@ var CircuitBreaker = class {
|
|
|
17686
17682
|
}
|
|
17687
17683
|
};
|
|
17688
17684
|
|
|
17689
|
-
// src/core/router
|
|
17685
|
+
// src/core/router/trace-logger.ts
|
|
17690
17686
|
init_esm_shims();
|
|
17691
17687
|
init_logger();
|
|
17692
17688
|
var RouterTraceLogger = class {
|
|
@@ -18059,7 +18055,7 @@ async function getProviderSession(workspacePath) {
|
|
|
18059
18055
|
return providerSessionInstances.get(path7);
|
|
18060
18056
|
}
|
|
18061
18057
|
|
|
18062
|
-
// src/core/router.ts
|
|
18058
|
+
// src/core/router/router.ts
|
|
18063
18059
|
var Router = class {
|
|
18064
18060
|
providers;
|
|
18065
18061
|
fallbackEnabled;
|
|
@@ -18869,10 +18865,10 @@ Run 'ax doctor' to diagnose provider setup.` : "";
|
|
|
18869
18865
|
}
|
|
18870
18866
|
};
|
|
18871
18867
|
|
|
18872
|
-
// src/core/lazy-
|
|
18868
|
+
// src/core/memory/lazy-manager.ts
|
|
18873
18869
|
init_esm_shims();
|
|
18874
18870
|
|
|
18875
|
-
// src/core/memory
|
|
18871
|
+
// src/core/memory/manager.ts
|
|
18876
18872
|
init_esm_shims();
|
|
18877
18873
|
|
|
18878
18874
|
// src/types/memory.ts
|
|
@@ -18886,12 +18882,12 @@ var MemoryError = class extends Error {
|
|
|
18886
18882
|
}
|
|
18887
18883
|
};
|
|
18888
18884
|
|
|
18889
|
-
// src/core/memory
|
|
18885
|
+
// src/core/memory/manager.ts
|
|
18890
18886
|
init_logger();
|
|
18891
18887
|
init_path_utils();
|
|
18892
|
-
|
|
18888
|
+
init_factory();
|
|
18893
18889
|
|
|
18894
|
-
// src/core/memory
|
|
18890
|
+
// src/core/memory/schemas.ts
|
|
18895
18891
|
init_esm_shims();
|
|
18896
18892
|
var MemoryMetadataSchema = z.object({
|
|
18897
18893
|
type: z.string().min(1).max(100),
|
|
@@ -19167,7 +19163,7 @@ var MemoryCleanupStrategies = class {
|
|
|
19167
19163
|
}
|
|
19168
19164
|
};
|
|
19169
19165
|
|
|
19170
|
-
// src/core/memory
|
|
19166
|
+
// src/core/memory/manager.ts
|
|
19171
19167
|
var MemoryManager = class _MemoryManager {
|
|
19172
19168
|
// v5.6.18: Performance optimization - Static regex for FTS5 query sanitization
|
|
19173
19169
|
// Moving these to class-level constants reduces 90% sanitization time
|
|
@@ -20427,7 +20423,7 @@ var MemoryManager = class _MemoryManager {
|
|
|
20427
20423
|
}
|
|
20428
20424
|
};
|
|
20429
20425
|
|
|
20430
|
-
// src/core/lazy-
|
|
20426
|
+
// src/core/memory/lazy-manager.ts
|
|
20431
20427
|
init_logger();
|
|
20432
20428
|
var LazyMemoryManager = class {
|
|
20433
20429
|
manager;
|
|
@@ -20633,7 +20629,7 @@ var LazyMemoryManager = class {
|
|
|
20633
20629
|
}
|
|
20634
20630
|
};
|
|
20635
20631
|
|
|
20636
|
-
// src/core/session
|
|
20632
|
+
// src/core/session/manager.ts
|
|
20637
20633
|
init_esm_shims();
|
|
20638
20634
|
|
|
20639
20635
|
// src/types/orchestration.ts
|
|
@@ -20656,11 +20652,11 @@ var SessionError = class extends Error {
|
|
|
20656
20652
|
}
|
|
20657
20653
|
};
|
|
20658
20654
|
|
|
20659
|
-
// src/core/session
|
|
20655
|
+
// src/core/session/manager.ts
|
|
20660
20656
|
init_logger();
|
|
20661
20657
|
init_path_utils();
|
|
20662
20658
|
|
|
20663
|
-
// src/core/session
|
|
20659
|
+
// src/core/session/schemas.ts
|
|
20664
20660
|
init_esm_shims();
|
|
20665
20661
|
var SessionTaskInfoSchema = z.object({
|
|
20666
20662
|
id: z.string().min(1).max(200),
|
|
@@ -20703,7 +20699,7 @@ z.object({
|
|
|
20703
20699
|
offset: z.number().int().nonnegative().optional()
|
|
20704
20700
|
}).strict();
|
|
20705
20701
|
|
|
20706
|
-
// src/core/session
|
|
20702
|
+
// src/core/session/manager.ts
|
|
20707
20703
|
var SessionManager = class _SessionManager {
|
|
20708
20704
|
/** Active sessions (in-memory, keyed by session ID) */
|
|
20709
20705
|
activeSessions = /* @__PURE__ */ new Map();
|
|
@@ -22732,23 +22728,13 @@ var ContextManager = class {
|
|
|
22732
22728
|
// src/agents/abilities-manager.ts
|
|
22733
22729
|
init_esm_shims();
|
|
22734
22730
|
init_logger();
|
|
22735
|
-
var __filename4 = fileURLToPath(import.meta.url);
|
|
22736
|
-
var __dirname5 = dirname(__filename4);
|
|
22737
|
-
function getPackageRoot3() {
|
|
22738
|
-
const currentDir = __dirname5;
|
|
22739
|
-
if (currentDir.includes(`${sep}dist`) || currentDir.includes("/dist")) {
|
|
22740
|
-
return join(currentDir, "..");
|
|
22741
|
-
} else {
|
|
22742
|
-
return join(currentDir, "../..");
|
|
22743
|
-
}
|
|
22744
|
-
}
|
|
22745
22731
|
var AbilitiesManager = class {
|
|
22746
22732
|
abilitiesDir;
|
|
22747
22733
|
fallbackAbilitiesDir;
|
|
22748
22734
|
cache;
|
|
22749
22735
|
constructor(abilitiesDir, fallbackAbilitiesDir) {
|
|
22750
22736
|
this.abilitiesDir = abilitiesDir;
|
|
22751
|
-
this.fallbackAbilitiesDir = fallbackAbilitiesDir || join(
|
|
22737
|
+
this.fallbackAbilitiesDir = fallbackAbilitiesDir || join(getPackageRoot(), "examples/abilities");
|
|
22752
22738
|
this.cache = new TTLCache({
|
|
22753
22739
|
maxEntries: 50,
|
|
22754
22740
|
ttl: 6e5,
|
|
@@ -22864,7 +22850,7 @@ ${content}`);
|
|
|
22864
22850
|
// src/mcp/server.ts
|
|
22865
22851
|
init_path_resolver();
|
|
22866
22852
|
|
|
22867
|
-
// src/core/
|
|
22853
|
+
// src/core/session/context-store.ts
|
|
22868
22854
|
init_esm_shims();
|
|
22869
22855
|
init_logger();
|
|
22870
22856
|
var VALID_ID_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
@@ -23687,7 +23673,7 @@ var TimeoutManager = class {
|
|
|
23687
23673
|
}
|
|
23688
23674
|
};
|
|
23689
23675
|
|
|
23690
|
-
// src/
|
|
23676
|
+
// src/shared/validation/timeout-validator.ts
|
|
23691
23677
|
init_esm_shims();
|
|
23692
23678
|
init_errors();
|
|
23693
23679
|
var MIN_WARNING_THRESHOLD2 = 0.5;
|
|
@@ -31055,15 +31041,6 @@ var KNOWN_MCP_SERVERS = {
|
|
|
31055
31041
|
description: "Persistent memory storage",
|
|
31056
31042
|
tags: ["memory", "storage", "persistence"]
|
|
31057
31043
|
},
|
|
31058
|
-
brave: {
|
|
31059
|
-
command: "npx",
|
|
31060
|
-
args: ["-y", "@modelcontextprotocol/server-brave-search"],
|
|
31061
|
-
description: "Brave Search API integration",
|
|
31062
|
-
tags: ["search", "web", "brave"],
|
|
31063
|
-
env: {
|
|
31064
|
-
// BRAVE_API_KEY should be provided by user
|
|
31065
|
-
}
|
|
31066
|
-
},
|
|
31067
31044
|
puppeteer: {
|
|
31068
31045
|
command: "npx",
|
|
31069
31046
|
args: ["-y", "@modelcontextprotocol/server-puppeteer"],
|
|
@@ -31108,14 +31085,14 @@ var statusCommand2 = {
|
|
|
31108
31085
|
return yargs2.option("provider", {
|
|
31109
31086
|
alias: "p",
|
|
31110
31087
|
type: "string",
|
|
31111
|
-
description: "Filter by provider (claude, gemini, codex
|
|
31112
|
-
choices: ["claude", "gemini", "codex"
|
|
31088
|
+
description: "Filter by provider (claude, gemini, codex)",
|
|
31089
|
+
choices: ["claude", "gemini", "codex"]
|
|
31113
31090
|
}).option("json", {
|
|
31114
31091
|
alias: "j",
|
|
31115
31092
|
type: "boolean",
|
|
31116
31093
|
description: "Output as JSON",
|
|
31117
31094
|
default: false
|
|
31118
|
-
}).example("$0 mcp status", "Show all MCP servers").example("$0 mcp status --provider
|
|
31095
|
+
}).example("$0 mcp status", "Show all MCP servers").example("$0 mcp status --provider gemini", "Show Gemini MCP servers only").example("$0 mcp status --json", "Output as JSON");
|
|
31119
31096
|
},
|
|
31120
31097
|
handler: async (argv) => {
|
|
31121
31098
|
try {
|
|
@@ -31137,7 +31114,7 @@ var statusCommand2 = {
|
|
|
31137
31114
|
if (allStatuses.length === 0) {
|
|
31138
31115
|
console.log(chalk5.yellow("No MCP servers running"));
|
|
31139
31116
|
console.log(chalk5.gray("\nTo enable MCP servers, configure them in your provider YAML files."));
|
|
31140
|
-
console.log(chalk5.gray("See: examples/providers/
|
|
31117
|
+
console.log(chalk5.gray("See: examples/providers/ for MCP configuration templates\n"));
|
|
31141
31118
|
return;
|
|
31142
31119
|
}
|
|
31143
31120
|
const table = new Table({
|
|
@@ -31185,7 +31162,7 @@ var healthCommand = {
|
|
|
31185
31162
|
alias: "p",
|
|
31186
31163
|
type: "string",
|
|
31187
31164
|
description: "Filter by provider",
|
|
31188
|
-
choices: ["claude", "gemini", "codex"
|
|
31165
|
+
choices: ["claude", "gemini", "codex"]
|
|
31189
31166
|
}).option("json", {
|
|
31190
31167
|
alias: "j",
|
|
31191
31168
|
type: "boolean",
|
|
@@ -31264,13 +31241,13 @@ var toolsCommand = {
|
|
|
31264
31241
|
alias: "p",
|
|
31265
31242
|
type: "string",
|
|
31266
31243
|
description: "Filter by provider",
|
|
31267
|
-
choices: ["claude", "gemini", "codex"
|
|
31244
|
+
choices: ["claude", "gemini", "codex"]
|
|
31268
31245
|
}).option("json", {
|
|
31269
31246
|
alias: "j",
|
|
31270
31247
|
type: "boolean",
|
|
31271
31248
|
description: "Output as JSON",
|
|
31272
31249
|
default: false
|
|
31273
|
-
}).example("$0 mcp tools", "List all available tools").example("$0 mcp tools --provider
|
|
31250
|
+
}).example("$0 mcp tools", "List all available tools").example("$0 mcp tools --provider gemini", "List Gemini tools only");
|
|
31274
31251
|
},
|
|
31275
31252
|
handler: async (argv) => {
|
|
31276
31253
|
try {
|
|
@@ -31406,7 +31383,7 @@ function checkIfInstalled(packageName) {
|
|
|
31406
31383
|
// src/cli/commands/memory.ts
|
|
31407
31384
|
init_esm_shims();
|
|
31408
31385
|
|
|
31409
|
-
// src/
|
|
31386
|
+
// src/shared/logging/progress.ts
|
|
31410
31387
|
init_esm_shims();
|
|
31411
31388
|
var ProgressIndicator = class {
|
|
31412
31389
|
spinner = null;
|
|
@@ -32305,7 +32282,7 @@ var AgentSelector = class {
|
|
|
32305
32282
|
// src/core/stage-execution-controller.ts
|
|
32306
32283
|
init_esm_shims();
|
|
32307
32284
|
|
|
32308
|
-
// src/core/checkpoint
|
|
32285
|
+
// src/core/session/checkpoint.ts
|
|
32309
32286
|
init_esm_shims();
|
|
32310
32287
|
var CURRENT_SCHEMA_VERSION = "1.0.0";
|
|
32311
32288
|
var CheckpointValidationError = class extends Error {
|
|
@@ -34355,7 +34332,7 @@ init_gemini_provider();
|
|
|
34355
34332
|
init_openai_provider_factory();
|
|
34356
34333
|
init_logger();
|
|
34357
34334
|
|
|
34358
|
-
// src/
|
|
34335
|
+
// src/shared/helpers/agent-status-writer.ts
|
|
34359
34336
|
init_esm_shims();
|
|
34360
34337
|
init_logger();
|
|
34361
34338
|
async function writeAgentStatus(status, projectDir = process.cwd()) {
|
|
@@ -36142,7 +36119,7 @@ var IterateStatusRenderer = class {
|
|
|
36142
36119
|
// src/cli/commands/run.ts
|
|
36143
36120
|
init_verbosity_manager();
|
|
36144
36121
|
|
|
36145
|
-
// src/
|
|
36122
|
+
// src/shared/logging/output-formatter.ts
|
|
36146
36123
|
init_esm_shims();
|
|
36147
36124
|
function formatOutput(result, format, verbose = false) {
|
|
36148
36125
|
switch (format) {
|
|
@@ -36888,12 +36865,12 @@ Result: ${result.stages.map((s) => s.output).join("\n\n")}`;
|
|
|
36888
36865
|
let iterateHooks;
|
|
36889
36866
|
if (argv.iterate || argv.autoContinue) {
|
|
36890
36867
|
if (argv.iterateMaxCost !== void 0) {
|
|
36891
|
-
console.log(chalk5.yellow("\n\u26A0\uFE0F Warning: --iterate-max-cost is deprecated and will be removed in
|
|
36868
|
+
console.log(chalk5.yellow("\n\u26A0\uFE0F Warning: --iterate-max-cost is deprecated and will be removed in a future version"));
|
|
36892
36869
|
console.log(chalk5.yellow(" Reason: Provider pricing changes frequently, making cost estimates unreliable\n"));
|
|
36893
36870
|
console.log(chalk5.cyan(" Please use --iterate-max-tokens instead:"));
|
|
36894
36871
|
console.log(chalk5.cyan(` ax run ${resolvedAgentName} "${actualTask}" --iterate --iterate-max-tokens 1000000
|
|
36895
36872
|
`));
|
|
36896
|
-
console.log(chalk5.gray(" Learn more: https://
|
|
36873
|
+
console.log(chalk5.gray(" Learn more: https://github.com/defai-digital/automatosx/blob/main/docs/migration/cost-to-tokens.md\n"));
|
|
36897
36874
|
}
|
|
36898
36875
|
const maxTokens = argv.iterateMaxTokens || 1e6;
|
|
36899
36876
|
const maxTokensPerIteration = argv.iterateMaxTokensPerIteration || 1e5;
|
|
@@ -38005,7 +37982,7 @@ var updateCommand = {
|
|
|
38005
37982
|
describe: "Skip confirmation prompt",
|
|
38006
37983
|
type: "boolean",
|
|
38007
37984
|
default: false
|
|
38008
|
-
}).example("
|
|
37985
|
+
}).example("$0 update", "Check and install latest version").example("$0 update --check", "Only check for updates").example("$0 update --yes", "Update without confirmation");
|
|
38009
37986
|
},
|
|
38010
37987
|
handler: async (argv) => {
|
|
38011
37988
|
console.log(chalk5.blue.bold("\n\u{1F504} AutomatosX Update Checker\n"));
|
|
@@ -38072,11 +38049,11 @@ async function getCurrentVersion() {
|
|
|
38072
38049
|
return result.dependencies["@defai.digital/automatosx"]?.version || "unknown";
|
|
38073
38050
|
} catch (error) {
|
|
38074
38051
|
const { readFile: readFile24 } = await import('fs/promises');
|
|
38075
|
-
const { dirname:
|
|
38076
|
-
const { fileURLToPath:
|
|
38077
|
-
const
|
|
38078
|
-
const
|
|
38079
|
-
const pkgPath =
|
|
38052
|
+
const { dirname: dirname14, join: join49 } = await import('path');
|
|
38053
|
+
const { fileURLToPath: fileURLToPath5 } = await import('url');
|
|
38054
|
+
const __filename3 = fileURLToPath5(import.meta.url);
|
|
38055
|
+
const __dirname4 = dirname14(__filename3);
|
|
38056
|
+
const pkgPath = join49(__dirname4, "../../../package.json");
|
|
38080
38057
|
const content = await readFile24(pkgPath, "utf-8");
|
|
38081
38058
|
const pkg = JSON.parse(content);
|
|
38082
38059
|
return pkg.version;
|
|
@@ -38274,7 +38251,11 @@ init_esm_shims();
|
|
|
38274
38251
|
|
|
38275
38252
|
// src/cli/commands/agent/templates.ts
|
|
38276
38253
|
init_esm_shims();
|
|
38277
|
-
|
|
38254
|
+
|
|
38255
|
+
// src/cli/commands/agent/helpers.ts
|
|
38256
|
+
init_esm_shims();
|
|
38257
|
+
init_logger();
|
|
38258
|
+
var BUILTIN_TEMPLATE_METADATA = {
|
|
38278
38259
|
"basic-agent": {
|
|
38279
38260
|
name: "basic-agent",
|
|
38280
38261
|
team: "core",
|
|
@@ -38301,6 +38282,161 @@ var TEMPLATE_DESCRIPTIONS = {
|
|
|
38301
38282
|
description: "QA specialist (test planning, automation, quality)"
|
|
38302
38283
|
}
|
|
38303
38284
|
};
|
|
38285
|
+
async function listAvailableTemplates(baseDir) {
|
|
38286
|
+
const templates = [];
|
|
38287
|
+
const projectDir = process.cwd();
|
|
38288
|
+
const projectTemplatesDir = join(projectDir, ".automatosx", "templates");
|
|
38289
|
+
if (existsSync(projectTemplatesDir)) {
|
|
38290
|
+
try {
|
|
38291
|
+
const files = await readdir(projectTemplatesDir);
|
|
38292
|
+
for (const file of files) {
|
|
38293
|
+
if (extname$1(file) === ".yaml" || extname$1(file) === ".yml") {
|
|
38294
|
+
const name = file.replace(/\.(yaml|yml)$/, "");
|
|
38295
|
+
templates.push({
|
|
38296
|
+
name,
|
|
38297
|
+
path: join(projectTemplatesDir, file),
|
|
38298
|
+
description: "Custom template"
|
|
38299
|
+
});
|
|
38300
|
+
}
|
|
38301
|
+
}
|
|
38302
|
+
} catch (error) {
|
|
38303
|
+
logger.debug("Failed to read project templates", { error });
|
|
38304
|
+
}
|
|
38305
|
+
}
|
|
38306
|
+
const packageRoot = getPackageRoot();
|
|
38307
|
+
const builtinTemplatesDir = join(packageRoot, "examples/workflows");
|
|
38308
|
+
if (existsSync(builtinTemplatesDir)) {
|
|
38309
|
+
try {
|
|
38310
|
+
const files = await readdir(builtinTemplatesDir);
|
|
38311
|
+
for (const file of files) {
|
|
38312
|
+
if (extname$1(file) === ".yaml" || extname$1(file) === ".yml") {
|
|
38313
|
+
const name = file.replace(/\.(yaml|yml)$/, "");
|
|
38314
|
+
if (templates.find((t) => t.name === name)) {
|
|
38315
|
+
continue;
|
|
38316
|
+
}
|
|
38317
|
+
const metadata = BUILTIN_TEMPLATE_METADATA[name];
|
|
38318
|
+
templates.push({
|
|
38319
|
+
name,
|
|
38320
|
+
path: join(builtinTemplatesDir, file),
|
|
38321
|
+
description: metadata?.description || "Built-in template",
|
|
38322
|
+
team: metadata?.team
|
|
38323
|
+
});
|
|
38324
|
+
}
|
|
38325
|
+
}
|
|
38326
|
+
} catch (error) {
|
|
38327
|
+
logger.debug("Failed to read built-in templates", { error });
|
|
38328
|
+
}
|
|
38329
|
+
}
|
|
38330
|
+
return templates.sort((a, b) => a.name.localeCompare(b.name));
|
|
38331
|
+
}
|
|
38332
|
+
async function listAvailableTeams(baseDir) {
|
|
38333
|
+
const projectDir = process.cwd();
|
|
38334
|
+
const teamsDir = join(projectDir, ".automatosx", "teams");
|
|
38335
|
+
const teamManager = new TeamManager(teamsDir);
|
|
38336
|
+
try {
|
|
38337
|
+
const teamNames = await teamManager.listTeams();
|
|
38338
|
+
const teams = [];
|
|
38339
|
+
for (const name of teamNames) {
|
|
38340
|
+
try {
|
|
38341
|
+
const teamConfig = await teamManager.loadTeam(name);
|
|
38342
|
+
teams.push({
|
|
38343
|
+
name: teamConfig.name,
|
|
38344
|
+
displayName: teamConfig.displayName || teamConfig.name,
|
|
38345
|
+
description: teamConfig.description
|
|
38346
|
+
});
|
|
38347
|
+
} catch (error) {
|
|
38348
|
+
teams.push({
|
|
38349
|
+
name,
|
|
38350
|
+
displayName: name,
|
|
38351
|
+
description: void 0
|
|
38352
|
+
});
|
|
38353
|
+
}
|
|
38354
|
+
}
|
|
38355
|
+
return teams.sort((a, b) => a.name.localeCompare(b.name));
|
|
38356
|
+
} catch (error) {
|
|
38357
|
+
logger.warn("Failed to list teams, using defaults", { error });
|
|
38358
|
+
return [
|
|
38359
|
+
{ name: "core", displayName: "Core Team", description: "Quality assurance, core functions" },
|
|
38360
|
+
{ name: "engineering", displayName: "Engineering Team", description: "Software development" },
|
|
38361
|
+
{ name: "business", displayName: "Business Team", description: "Business analysis, product" },
|
|
38362
|
+
{ name: "design", displayName: "Design Team", description: "UI/UX design" }
|
|
38363
|
+
];
|
|
38364
|
+
}
|
|
38365
|
+
}
|
|
38366
|
+
function isValidAgentName(name) {
|
|
38367
|
+
if (!name || typeof name !== "string") {
|
|
38368
|
+
return { valid: false, error: "Agent name is required" };
|
|
38369
|
+
}
|
|
38370
|
+
if (name.length < 2) {
|
|
38371
|
+
return { valid: false, error: "Agent name must be at least 2 characters" };
|
|
38372
|
+
}
|
|
38373
|
+
if (name.length > 50) {
|
|
38374
|
+
return { valid: false, error: "Agent name must be at most 50 characters" };
|
|
38375
|
+
}
|
|
38376
|
+
if (!/^[a-z]/.test(name)) {
|
|
38377
|
+
return { valid: false, error: "Agent name must start with a lowercase letter" };
|
|
38378
|
+
}
|
|
38379
|
+
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
38380
|
+
return {
|
|
38381
|
+
valid: false,
|
|
38382
|
+
error: "Agent name must contain only lowercase letters, numbers, and hyphens"
|
|
38383
|
+
};
|
|
38384
|
+
}
|
|
38385
|
+
if (/--/.test(name)) {
|
|
38386
|
+
return { valid: false, error: "Agent name cannot contain consecutive hyphens" };
|
|
38387
|
+
}
|
|
38388
|
+
if (name.endsWith("-")) {
|
|
38389
|
+
return { valid: false, error: "Agent name cannot end with a hyphen" };
|
|
38390
|
+
}
|
|
38391
|
+
return { valid: true };
|
|
38392
|
+
}
|
|
38393
|
+
async function checkDisplayNameConflict(displayName, excludeAgentName, baseDir) {
|
|
38394
|
+
if (!displayName) {
|
|
38395
|
+
return void 0;
|
|
38396
|
+
}
|
|
38397
|
+
const projectDir = process.cwd();
|
|
38398
|
+
const agentsDir = join(projectDir, ".automatosx", "agents");
|
|
38399
|
+
const profileLoader = new ProfileLoader(agentsDir);
|
|
38400
|
+
try {
|
|
38401
|
+
const allProfiles = await profileLoader.listProfiles();
|
|
38402
|
+
for (const profileName of allProfiles) {
|
|
38403
|
+
if (excludeAgentName && profileName === excludeAgentName) ;
|
|
38404
|
+
try {
|
|
38405
|
+
const profile = await profileLoader.loadProfile(profileName);
|
|
38406
|
+
if (profile.displayName?.toLowerCase() === displayName.toLowerCase()) {
|
|
38407
|
+
return profileName;
|
|
38408
|
+
}
|
|
38409
|
+
} catch (error) {
|
|
38410
|
+
logger.debug("Failed to load profile for displayName check", {
|
|
38411
|
+
profile: profileName,
|
|
38412
|
+
error
|
|
38413
|
+
});
|
|
38414
|
+
}
|
|
38415
|
+
}
|
|
38416
|
+
return void 0;
|
|
38417
|
+
} catch (error) {
|
|
38418
|
+
logger.warn("Failed to check displayName conflicts", { error });
|
|
38419
|
+
return void 0;
|
|
38420
|
+
}
|
|
38421
|
+
}
|
|
38422
|
+
function suggestValidAgentName(input) {
|
|
38423
|
+
let suggestion = input.toLowerCase();
|
|
38424
|
+
suggestion = suggestion.replace(/[^a-z0-9-]/g, "-");
|
|
38425
|
+
suggestion = suggestion.replace(/-+/g, "-");
|
|
38426
|
+
suggestion = suggestion.replace(/^-+|-+$/g, "");
|
|
38427
|
+
if (suggestion.length < 2) {
|
|
38428
|
+
return "agent";
|
|
38429
|
+
}
|
|
38430
|
+
if (!/^[a-z]/.test(suggestion)) {
|
|
38431
|
+
suggestion = "agent-" + suggestion;
|
|
38432
|
+
}
|
|
38433
|
+
if (suggestion.length > 50) {
|
|
38434
|
+
suggestion = suggestion.substring(0, 50).replace(/-+$/, "");
|
|
38435
|
+
}
|
|
38436
|
+
return suggestion;
|
|
38437
|
+
}
|
|
38438
|
+
|
|
38439
|
+
// src/cli/commands/agent/templates.ts
|
|
38304
38440
|
var templatesCommand = {
|
|
38305
38441
|
command: "templates",
|
|
38306
38442
|
describe: "List available agent templates",
|
|
@@ -38309,7 +38445,8 @@ var templatesCommand = {
|
|
|
38309
38445
|
console.log(chalk5.blue.bold("\n\u{1F4CB} Available Agent Templates\n"));
|
|
38310
38446
|
const projectTemplatesDir = join(process.cwd(), ".automatosx", "templates");
|
|
38311
38447
|
const hasProjectTemplates = existsSync(projectTemplatesDir);
|
|
38312
|
-
const
|
|
38448
|
+
const packageRoot = getPackageRoot();
|
|
38449
|
+
const defaultTemplatesDir = join(packageRoot, "examples/workflows");
|
|
38313
38450
|
const hasDefaultTemplates = existsSync(defaultTemplatesDir);
|
|
38314
38451
|
if (!hasProjectTemplates && !hasDefaultTemplates) {
|
|
38315
38452
|
console.log(chalk5.yellow("\u26A0 No templates found."));
|
|
@@ -38333,7 +38470,7 @@ var templatesCommand = {
|
|
|
38333
38470
|
design: []
|
|
38334
38471
|
};
|
|
38335
38472
|
templates.forEach((template) => {
|
|
38336
|
-
const info =
|
|
38473
|
+
const info = BUILTIN_TEMPLATE_METADATA[template] || {
|
|
38337
38474
|
name: template,
|
|
38338
38475
|
team: "core",
|
|
38339
38476
|
description: "Custom template"
|
|
@@ -38499,169 +38636,6 @@ var TemplateEngine = class _TemplateEngine {
|
|
|
38499
38636
|
}
|
|
38500
38637
|
};
|
|
38501
38638
|
|
|
38502
|
-
// src/cli/commands/agent/helpers.ts
|
|
38503
|
-
init_esm_shims();
|
|
38504
|
-
init_logger();
|
|
38505
|
-
var __filename5 = fileURLToPath(import.meta.url);
|
|
38506
|
-
var __dirname6 = dirname(__filename5);
|
|
38507
|
-
async function listAvailableTemplates(baseDir) {
|
|
38508
|
-
const templates = [];
|
|
38509
|
-
const projectDir = process.cwd();
|
|
38510
|
-
const projectTemplatesDir = join(projectDir, ".automatosx", "templates");
|
|
38511
|
-
if (existsSync(projectTemplatesDir)) {
|
|
38512
|
-
try {
|
|
38513
|
-
const files = await readdir(projectTemplatesDir);
|
|
38514
|
-
for (const file of files) {
|
|
38515
|
-
if (extname$1(file) === ".yaml" || extname$1(file) === ".yml") {
|
|
38516
|
-
const name = file.replace(/\.(yaml|yml)$/, "");
|
|
38517
|
-
templates.push({
|
|
38518
|
-
name,
|
|
38519
|
-
path: join(projectTemplatesDir, file),
|
|
38520
|
-
description: "Custom template"
|
|
38521
|
-
});
|
|
38522
|
-
}
|
|
38523
|
-
}
|
|
38524
|
-
} catch (error) {
|
|
38525
|
-
logger.debug("Failed to read project templates", { error });
|
|
38526
|
-
}
|
|
38527
|
-
}
|
|
38528
|
-
const builtinTemplatesDir = join(__dirname6, "../../../../examples/templates");
|
|
38529
|
-
if (existsSync(builtinTemplatesDir)) {
|
|
38530
|
-
try {
|
|
38531
|
-
const files = await readdir(builtinTemplatesDir);
|
|
38532
|
-
for (const file of files) {
|
|
38533
|
-
if (extname$1(file) === ".yaml" || extname$1(file) === ".yml") {
|
|
38534
|
-
const name = file.replace(/\.(yaml|yml)$/, "");
|
|
38535
|
-
if (templates.find((t) => t.name === name)) {
|
|
38536
|
-
continue;
|
|
38537
|
-
}
|
|
38538
|
-
const descriptions = {
|
|
38539
|
-
"basic-agent": "Basic agent (core team)",
|
|
38540
|
-
"developer": "Software developer (engineering)",
|
|
38541
|
-
"analyst": "Business analyst (business)",
|
|
38542
|
-
"designer": "UI/UX designer (design)",
|
|
38543
|
-
"qa-specialist": "QA specialist (core)"
|
|
38544
|
-
};
|
|
38545
|
-
templates.push({
|
|
38546
|
-
name,
|
|
38547
|
-
path: join(builtinTemplatesDir, file),
|
|
38548
|
-
description: descriptions[name] || "Built-in template"
|
|
38549
|
-
});
|
|
38550
|
-
}
|
|
38551
|
-
}
|
|
38552
|
-
} catch (error) {
|
|
38553
|
-
logger.debug("Failed to read built-in templates", { error });
|
|
38554
|
-
}
|
|
38555
|
-
}
|
|
38556
|
-
return templates.sort((a, b) => a.name.localeCompare(b.name));
|
|
38557
|
-
}
|
|
38558
|
-
async function listAvailableTeams(baseDir) {
|
|
38559
|
-
const projectDir = process.cwd();
|
|
38560
|
-
const teamsDir = join(projectDir, ".automatosx", "teams");
|
|
38561
|
-
const teamManager = new TeamManager(teamsDir);
|
|
38562
|
-
try {
|
|
38563
|
-
const teamNames = await teamManager.listTeams();
|
|
38564
|
-
const teams = [];
|
|
38565
|
-
for (const name of teamNames) {
|
|
38566
|
-
try {
|
|
38567
|
-
const teamConfig = await teamManager.loadTeam(name);
|
|
38568
|
-
teams.push({
|
|
38569
|
-
name: teamConfig.name,
|
|
38570
|
-
displayName: teamConfig.displayName || teamConfig.name,
|
|
38571
|
-
description: teamConfig.description
|
|
38572
|
-
});
|
|
38573
|
-
} catch (error) {
|
|
38574
|
-
teams.push({
|
|
38575
|
-
name,
|
|
38576
|
-
displayName: name,
|
|
38577
|
-
description: void 0
|
|
38578
|
-
});
|
|
38579
|
-
}
|
|
38580
|
-
}
|
|
38581
|
-
return teams.sort((a, b) => a.name.localeCompare(b.name));
|
|
38582
|
-
} catch (error) {
|
|
38583
|
-
logger.warn("Failed to list teams, using defaults", { error });
|
|
38584
|
-
return [
|
|
38585
|
-
{ name: "core", displayName: "Core Team", description: "Quality assurance, core functions" },
|
|
38586
|
-
{ name: "engineering", displayName: "Engineering Team", description: "Software development" },
|
|
38587
|
-
{ name: "business", displayName: "Business Team", description: "Business analysis, product" },
|
|
38588
|
-
{ name: "design", displayName: "Design Team", description: "UI/UX design" }
|
|
38589
|
-
];
|
|
38590
|
-
}
|
|
38591
|
-
}
|
|
38592
|
-
function isValidAgentName(name) {
|
|
38593
|
-
if (!name || typeof name !== "string") {
|
|
38594
|
-
return { valid: false, error: "Agent name is required" };
|
|
38595
|
-
}
|
|
38596
|
-
if (name.length < 2) {
|
|
38597
|
-
return { valid: false, error: "Agent name must be at least 2 characters" };
|
|
38598
|
-
}
|
|
38599
|
-
if (name.length > 50) {
|
|
38600
|
-
return { valid: false, error: "Agent name must be at most 50 characters" };
|
|
38601
|
-
}
|
|
38602
|
-
if (!/^[a-z]/.test(name)) {
|
|
38603
|
-
return { valid: false, error: "Agent name must start with a lowercase letter" };
|
|
38604
|
-
}
|
|
38605
|
-
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
38606
|
-
return {
|
|
38607
|
-
valid: false,
|
|
38608
|
-
error: "Agent name must contain only lowercase letters, numbers, and hyphens"
|
|
38609
|
-
};
|
|
38610
|
-
}
|
|
38611
|
-
if (/--/.test(name)) {
|
|
38612
|
-
return { valid: false, error: "Agent name cannot contain consecutive hyphens" };
|
|
38613
|
-
}
|
|
38614
|
-
if (name.endsWith("-")) {
|
|
38615
|
-
return { valid: false, error: "Agent name cannot end with a hyphen" };
|
|
38616
|
-
}
|
|
38617
|
-
return { valid: true };
|
|
38618
|
-
}
|
|
38619
|
-
async function checkDisplayNameConflict(displayName, excludeAgentName, baseDir) {
|
|
38620
|
-
if (!displayName) {
|
|
38621
|
-
return void 0;
|
|
38622
|
-
}
|
|
38623
|
-
const projectDir = process.cwd();
|
|
38624
|
-
const agentsDir = join(projectDir, ".automatosx", "agents");
|
|
38625
|
-
const profileLoader = new ProfileLoader(agentsDir);
|
|
38626
|
-
try {
|
|
38627
|
-
const allProfiles = await profileLoader.listProfiles();
|
|
38628
|
-
for (const profileName of allProfiles) {
|
|
38629
|
-
if (excludeAgentName && profileName === excludeAgentName) ;
|
|
38630
|
-
try {
|
|
38631
|
-
const profile = await profileLoader.loadProfile(profileName);
|
|
38632
|
-
if (profile.displayName?.toLowerCase() === displayName.toLowerCase()) {
|
|
38633
|
-
return profileName;
|
|
38634
|
-
}
|
|
38635
|
-
} catch (error) {
|
|
38636
|
-
logger.debug("Failed to load profile for displayName check", {
|
|
38637
|
-
profile: profileName,
|
|
38638
|
-
error
|
|
38639
|
-
});
|
|
38640
|
-
}
|
|
38641
|
-
}
|
|
38642
|
-
return void 0;
|
|
38643
|
-
} catch (error) {
|
|
38644
|
-
logger.warn("Failed to check displayName conflicts", { error });
|
|
38645
|
-
return void 0;
|
|
38646
|
-
}
|
|
38647
|
-
}
|
|
38648
|
-
function suggestValidAgentName(input) {
|
|
38649
|
-
let suggestion = input.toLowerCase();
|
|
38650
|
-
suggestion = suggestion.replace(/[^a-z0-9-]/g, "-");
|
|
38651
|
-
suggestion = suggestion.replace(/-+/g, "-");
|
|
38652
|
-
suggestion = suggestion.replace(/^-+|-+$/g, "");
|
|
38653
|
-
if (suggestion.length < 2) {
|
|
38654
|
-
return "agent";
|
|
38655
|
-
}
|
|
38656
|
-
if (!/^[a-z]/.test(suggestion)) {
|
|
38657
|
-
suggestion = "agent-" + suggestion;
|
|
38658
|
-
}
|
|
38659
|
-
if (suggestion.length > 50) {
|
|
38660
|
-
suggestion = suggestion.substring(0, 50).replace(/-+$/, "");
|
|
38661
|
-
}
|
|
38662
|
-
return suggestion;
|
|
38663
|
-
}
|
|
38664
|
-
|
|
38665
38639
|
// src/cli/commands/agent/create.ts
|
|
38666
38640
|
var createCommand2 = {
|
|
38667
38641
|
command: "create <agent>",
|
|
@@ -38808,7 +38782,8 @@ async function findTemplate(name) {
|
|
|
38808
38782
|
if (existsSync(projectTemplate)) {
|
|
38809
38783
|
return projectTemplate;
|
|
38810
38784
|
}
|
|
38811
|
-
const
|
|
38785
|
+
const packageRoot = getPackageRoot();
|
|
38786
|
+
const defaultTemplate = join(packageRoot, "examples/workflows", `${name}.yaml`);
|
|
38812
38787
|
if (existsSync(defaultTemplate)) {
|
|
38813
38788
|
return defaultTemplate;
|
|
38814
38789
|
}
|
|
@@ -42082,14 +42057,14 @@ init_esm_shims();
|
|
|
42082
42057
|
// src/core/spec/SpecSchemaValidator.ts
|
|
42083
42058
|
init_esm_shims();
|
|
42084
42059
|
init_logger();
|
|
42085
|
-
var
|
|
42086
|
-
var
|
|
42060
|
+
var __filename2 = fileURLToPath(import.meta.url);
|
|
42061
|
+
var __dirname3 = dirname(__filename2);
|
|
42087
42062
|
var SpecSchemaValidator = class {
|
|
42088
42063
|
ajv;
|
|
42089
42064
|
validateFn = null;
|
|
42090
42065
|
schemaPath;
|
|
42091
42066
|
constructor(schemaPath) {
|
|
42092
|
-
this.schemaPath = schemaPath || join(
|
|
42067
|
+
this.schemaPath = schemaPath || join(__dirname3, "../../../schema/spec-schema.json");
|
|
42093
42068
|
this.ajv = new Ajv({
|
|
42094
42069
|
allErrors: true,
|
|
42095
42070
|
// Collect all errors, not just first
|
|
@@ -45110,8 +45085,8 @@ async function handleReset() {
|
|
|
45110
45085
|
}
|
|
45111
45086
|
async function handleTrace(workspacePath, argv) {
|
|
45112
45087
|
const { existsSync: existsSync25, readFileSync: readFileSync8, watchFile } = await import('fs');
|
|
45113
|
-
const { join:
|
|
45114
|
-
const traceFile =
|
|
45088
|
+
const { join: join49 } = await import('path');
|
|
45089
|
+
const traceFile = join49(workspacePath, ".automatosx/logs/router.trace.jsonl");
|
|
45115
45090
|
if (!existsSync25(traceFile)) {
|
|
45116
45091
|
console.log(chalk5.yellow("\n\u26A0\uFE0F No trace log found\n"));
|
|
45117
45092
|
console.log(chalk5.gray(`Expected location: ${traceFile}
|
|
@@ -46189,15 +46164,17 @@ async function checkDiskSpace(workingDir, verbose) {
|
|
|
46189
46164
|
timeout: 1e4
|
|
46190
46165
|
});
|
|
46191
46166
|
const sizeKB = parseInt(duOutput.trim(), 10);
|
|
46192
|
-
|
|
46193
|
-
|
|
46194
|
-
|
|
46195
|
-
|
|
46196
|
-
|
|
46197
|
-
|
|
46198
|
-
|
|
46199
|
-
|
|
46200
|
-
|
|
46167
|
+
if (!isNaN(sizeKB)) {
|
|
46168
|
+
const sizeMB = (sizeKB / 1024).toFixed(2);
|
|
46169
|
+
results.push({
|
|
46170
|
+
name: ".automatosx Size",
|
|
46171
|
+
category: "Disk",
|
|
46172
|
+
passed: true,
|
|
46173
|
+
message: sizeKB > 1024 ? `${sizeMB} MB` : `${sizeKB} KB`,
|
|
46174
|
+
details: verbose ? `Includes: memory, sessions, logs, agents` : void 0
|
|
46175
|
+
});
|
|
46176
|
+
displayCheck(results[results.length - 1]);
|
|
46177
|
+
}
|
|
46201
46178
|
} catch {
|
|
46202
46179
|
}
|
|
46203
46180
|
}
|
|
@@ -46618,7 +46595,7 @@ init_esm_shims();
|
|
|
46618
46595
|
// src/core/telemetry/TelemetryCollector.ts
|
|
46619
46596
|
init_esm_shims();
|
|
46620
46597
|
init_logger();
|
|
46621
|
-
|
|
46598
|
+
init_factory();
|
|
46622
46599
|
var DEFAULT_OPTIONS3 = {
|
|
46623
46600
|
enabled: false,
|
|
46624
46601
|
// Opt-in by default (privacy-first)
|