@defai.digital/automatosx 8.4.3 → 8.4.16

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 CHANGED
@@ -13,7 +13,7 @@ AutomatosX is a pure CLI orchestration platform for AI agents. It wraps around `
13
13
  [![Windows](https://img.shields.io/badge/Windows-10+-blue.svg)](https://www.microsoft.com/windows)
14
14
  [![Ubuntu](https://img.shields.io/badge/Ubuntu-24.04-blue.svg)](https://ubuntu.com)
15
15
 
16
- **Status**: ✅ **Production Ready** | v8.4.3 | 20 Specialized Agents | Pure CLI Orchestration | Simplified Architecture
16
+ **Status**: ✅ **Production Ready** | v8.4.16 | 20 Specialized Agents | Pure CLI Orchestration | Simplified Architecture
17
17
 
18
18
  > 🎉 **NEW in v8.3.0**: Major simplification! Removed ~36,000 lines of code including policy routing, free-tier management, and SDK providers. AutomatosX is now a pure CLI orchestration wrapper around `claude`, `gemini`, and `codex` commands. Simpler, faster, easier to maintain. See [Migration Guide](MIGRATION.md) for upgrade details.
19
19
 
package/dist/index.js CHANGED
@@ -1207,7 +1207,47 @@ var init_provider_schemas = __esm({
1207
1207
  }).describe("Provider error");
1208
1208
  }
1209
1209
  });
1210
- var execAsync, BaseProvider;
1210
+ function execWithCleanup(command, options) {
1211
+ return new Promise((resolve13, reject) => {
1212
+ const child = exec(command, options, (error, stdout, stderr) => {
1213
+ clearTimeout(killTimer);
1214
+ if (error) {
1215
+ reject(error);
1216
+ } else {
1217
+ resolve13({
1218
+ stdout: stdout.toString(),
1219
+ stderr: stderr.toString()
1220
+ });
1221
+ }
1222
+ });
1223
+ const timeout = options.timeout || 12e4;
1224
+ let forceKillTimer = null;
1225
+ const killTimer = setTimeout(() => {
1226
+ if (child.pid && !child.killed) {
1227
+ logger.warn("Killing child process due to timeout", {
1228
+ pid: child.pid,
1229
+ command: command.substring(0, 50)
1230
+ });
1231
+ child.kill("SIGTERM");
1232
+ forceKillTimer = setTimeout(() => {
1233
+ if (child.pid && !child.killed) {
1234
+ logger.warn("Force killing child process", { pid: child.pid });
1235
+ child.kill("SIGKILL");
1236
+ }
1237
+ forceKillTimer = null;
1238
+ }, 5e3);
1239
+ }
1240
+ }, timeout);
1241
+ child.on("exit", () => {
1242
+ clearTimeout(killTimer);
1243
+ if (forceKillTimer) {
1244
+ clearTimeout(forceKillTimer);
1245
+ forceKillTimer = null;
1246
+ }
1247
+ });
1248
+ });
1249
+ }
1250
+ var BaseProvider;
1211
1251
  var init_base_provider = __esm({
1212
1252
  "src/providers/base-provider.ts"() {
1213
1253
  init_esm_shims();
@@ -1215,7 +1255,6 @@ var init_base_provider = __esm({
1215
1255
  init_errors();
1216
1256
  init_cli_provider_detector();
1217
1257
  init_provider_schemas();
1218
- execAsync = promisify(exec);
1219
1258
  BaseProvider = class _BaseProvider {
1220
1259
  /**
1221
1260
  * Whitelist of allowed provider names for security
@@ -1255,6 +1294,13 @@ var init_base_provider = __esm({
1255
1294
  lastCheck: Date.now()
1256
1295
  };
1257
1296
  }
1297
+ /**
1298
+ * Get CLI arguments (optional, for providers that need special flags)
1299
+ * Subclasses can override to add provider-specific arguments
1300
+ */
1301
+ getCLIArgs() {
1302
+ return [];
1303
+ }
1258
1304
  /**
1259
1305
  * Execute CLI command - Template method pattern
1260
1306
  * Common logic here, provider-specific parts via getCLICommand() and getMockResponse()
@@ -1271,8 +1317,10 @@ var init_base_provider = __esm({
1271
1317
  command: cliCommand2,
1272
1318
  promptLength: prompt.length
1273
1319
  });
1274
- const { stdout, stderr } = await execAsync(
1275
- `${cliCommand2} ${escapedPrompt}`,
1320
+ const cliArgs = this.getCLIArgs();
1321
+ const argsString = cliArgs.length > 0 ? cliArgs.join(" ") + " " : "";
1322
+ const { stdout, stderr } = await execWithCleanup(
1323
+ `${cliCommand2} ${argsString}${escapedPrompt}`,
1276
1324
  {
1277
1325
  timeout: this.config.timeout || 12e4,
1278
1326
  maxBuffer: 10 * 1024 * 1024,
@@ -1294,7 +1342,7 @@ var init_base_provider = __esm({
1294
1342
  }
1295
1343
  );
1296
1344
  if (stderr) {
1297
- logger.warn(`${cliCommand2} CLI stderr output`, { stderr: stderr.trim() });
1345
+ logger.debug(`${cliCommand2} CLI stderr output`, { stderr: stderr.trim() });
1298
1346
  }
1299
1347
  if (!stdout) {
1300
1348
  throw new Error(`${cliCommand2} CLI returned empty output. stderr: ${stderr || "none"}`);
@@ -1315,11 +1363,11 @@ var init_base_provider = __esm({
1315
1363
  async checkCLIAvailable() {
1316
1364
  try {
1317
1365
  const cliCommand2 = this.getCLICommand();
1318
- const path6 = await findOnPath(cliCommand2);
1319
- const available = path6 !== null;
1366
+ const result = findOnPath(cliCommand2);
1367
+ const available = result.found;
1320
1368
  logger.debug(`${cliCommand2} CLI availability check`, {
1321
1369
  available,
1322
- path: path6 || "not found"
1370
+ path: result.path || "not found"
1323
1371
  });
1324
1372
  return available;
1325
1373
  } catch (error) {
@@ -1358,6 +1406,18 @@ var init_base_provider = __esm({
1358
1406
 
1359
1407
  ${request.prompt}`;
1360
1408
  }
1409
+ if (process.env.AUTOMATOSX_DEBUG_PROMPT === "true") {
1410
+ const fs5 = await import('fs');
1411
+ const path6 = await import('path');
1412
+ const debugPath = path6.join(process.cwd(), "automatosx/tmp/debug-prompt.txt");
1413
+ fs5.writeFileSync(debugPath, `=== FULL PROMPT SENT TO ${this.getCLICommand()} ===
1414
+
1415
+ ${fullPrompt}
1416
+
1417
+ === END PROMPT ===
1418
+ `);
1419
+ logger.debug(`Full prompt saved to ${debugPath}`);
1420
+ }
1361
1421
  const result = await this.executeCLI(fullPrompt);
1362
1422
  this.health.consecutiveFailures = 0;
1363
1423
  this.health.available = true;
@@ -1601,13 +1661,13 @@ This is a mock response for testing purposes.`;
1601
1661
  };
1602
1662
  }
1603
1663
  });
1604
-
1605
- // src/providers/openai-provider.ts
1606
- var OpenAIProvider;
1664
+ var execAsync, OpenAIProvider;
1607
1665
  var init_openai_provider = __esm({
1608
1666
  "src/providers/openai-provider.ts"() {
1609
1667
  init_esm_shims();
1610
1668
  init_base_provider();
1669
+ init_logger();
1670
+ execAsync = promisify(exec);
1611
1671
  OpenAIProvider = class extends BaseProvider {
1612
1672
  constructor(config) {
1613
1673
  super(config);
@@ -1615,6 +1675,55 @@ var init_openai_provider = __esm({
1615
1675
  getCLICommand() {
1616
1676
  return "codex";
1617
1677
  }
1678
+ /**
1679
+ * Override executeCLI to use 'codex exec' subcommand for non-interactive execution
1680
+ * This avoids "stdout is not a terminal" errors while keeping CLI detection working
1681
+ */
1682
+ async executeCLI(prompt) {
1683
+ if (process.env.AUTOMATOSX_MOCK_PROVIDERS === "true") {
1684
+ logger.debug("Mock mode: returning test response");
1685
+ return this.getMockResponse();
1686
+ }
1687
+ try {
1688
+ const escapedPrompt = this.escapeShellArg(prompt);
1689
+ const cliCommand2 = "codex exec";
1690
+ logger.debug("Executing codex exec CLI", {
1691
+ command: cliCommand2,
1692
+ promptLength: prompt.length
1693
+ });
1694
+ const { stdout, stderr } = await execAsync(
1695
+ `${cliCommand2} ${escapedPrompt}`,
1696
+ {
1697
+ timeout: this.config.timeout || 12e4,
1698
+ maxBuffer: 10 * 1024 * 1024,
1699
+ shell: "/bin/bash",
1700
+ env: {
1701
+ ...process.env,
1702
+ // Force non-interactive mode for CLIs
1703
+ TERM: "dumb",
1704
+ NO_COLOR: "1",
1705
+ FORCE_COLOR: "0",
1706
+ CI: "true",
1707
+ NO_UPDATE_NOTIFIER: "1",
1708
+ DEBIAN_FRONTEND: "noninteractive"
1709
+ }
1710
+ }
1711
+ );
1712
+ if (stderr) {
1713
+ logger.warn("codex exec CLI stderr output", { stderr: stderr.trim() });
1714
+ }
1715
+ if (!stdout) {
1716
+ throw new Error(`codex exec CLI returned empty output. stderr: ${stderr || "none"}`);
1717
+ }
1718
+ logger.debug("codex exec CLI execution successful", {
1719
+ outputLength: stdout.length
1720
+ });
1721
+ return stdout.trim();
1722
+ } catch (error) {
1723
+ logger.error("codex exec CLI execution failed", { error });
1724
+ throw error;
1725
+ }
1726
+ }
1618
1727
  getMockResponse() {
1619
1728
  return `[Mock OpenAI/Codex Response]
1620
1729
 
@@ -7469,6 +7578,7 @@ init_errors();
7469
7578
  // src/core/provider-limit-manager.ts
7470
7579
  init_esm_shims();
7471
7580
  init_logger();
7581
+ init_path_resolver();
7472
7582
  var ProviderLimitManager = class _ProviderLimitManager extends EventEmitter {
7473
7583
  static instance = null;
7474
7584
  stateFilePath;
@@ -7805,7 +7915,15 @@ var ProviderLimitManager = class _ProviderLimitManager extends EventEmitter {
7805
7915
  });
7806
7916
  }
7807
7917
  };
7808
- function getProviderLimitManager(stateDirectory) {
7918
+ async function getProviderLimitManager(stateDirectory) {
7919
+ if (!stateDirectory) {
7920
+ if (process.env.NODE_ENV === "test" || process.env.VITEST) {
7921
+ stateDirectory = ".automatosx/state";
7922
+ } else {
7923
+ const projectRoot = await detectProjectRoot();
7924
+ stateDirectory = path2.join(projectRoot, ".automatosx", "state");
7925
+ }
7926
+ }
7809
7927
  return ProviderLimitManager.getInstance(stateDirectory);
7810
7928
  }
7811
7929
 
@@ -8930,6 +9048,7 @@ function createTraceLogger(workspacePath, enabled = true) {
8930
9048
  // src/core/provider-session.ts
8931
9049
  init_esm_shims();
8932
9050
  init_logger();
9051
+ init_path_resolver();
8933
9052
  var ProviderSessionManager = class {
8934
9053
  sessionDir;
8935
9054
  sessionFile;
@@ -9039,8 +9158,15 @@ var ProviderSessionManager = class {
9039
9158
  }
9040
9159
  };
9041
9160
  var providerSessionInstances = /* @__PURE__ */ new Map();
9042
- function getProviderSession(workspacePath) {
9043
- const path6 = process.cwd();
9161
+ async function getProviderSession(workspacePath) {
9162
+ let path6;
9163
+ {
9164
+ if (process.env.NODE_ENV === "test" || process.env.VITEST) {
9165
+ path6 = process.cwd();
9166
+ } else {
9167
+ path6 = await detectProjectRoot();
9168
+ }
9169
+ }
9044
9170
  if (!providerSessionInstances.has(path6)) {
9045
9171
  providerSessionInstances.set(path6, new ProviderSessionManager(path6));
9046
9172
  }
@@ -9080,10 +9206,12 @@ var Router = class {
9080
9206
  this.providerCooldownMs = config.providerCooldownMs ?? 3e4;
9081
9207
  this.circuitBreakerThreshold = config.circuitBreakerThreshold ?? 3;
9082
9208
  this.cache = config.cache;
9083
- const limitManager = getProviderLimitManager();
9084
- void limitManager.initialize().catch((err) => {
9085
- logger.warn("Failed to initialize ProviderLimitManager", { error: err.message });
9086
- });
9209
+ void (async () => {
9210
+ const limitManager = await getProviderLimitManager();
9211
+ await limitManager.initialize().catch((err) => {
9212
+ logger.warn("Failed to initialize ProviderLimitManager", { error: err.message });
9213
+ });
9214
+ })();
9087
9215
  if (config.strategy) {
9088
9216
  this.useMultiFactorRouting = true;
9089
9217
  const strategyManager = getRoutingStrategyManager(config.strategy);
@@ -9154,7 +9282,7 @@ var Router = class {
9154
9282
  "execute",
9155
9283
  "provider"
9156
9284
  );
9157
- const providerSession = getProviderSession();
9285
+ const providerSession = await getProviderSession();
9158
9286
  if (providerSession.hasOverride() && process.env.NODE_ENV !== "test") {
9159
9287
  const override = providerSession.getOverride();
9160
9288
  const overrideProvider = this.providers.find((p) => p.name === override?.provider);
@@ -9190,7 +9318,7 @@ var Router = class {
9190
9318
  cacheEnabled: this.cache?.isEnabled ?? false
9191
9319
  });
9192
9320
  if (availableProviders.length === 0) {
9193
- const limitManager2 = getProviderLimitManager();
9321
+ const limitManager2 = await getProviderLimitManager();
9194
9322
  const allProviders2 = this.providers;
9195
9323
  const limitedProviders2 = [];
9196
9324
  for (const provider of allProviders2) {
@@ -9348,7 +9476,7 @@ var Router = class {
9348
9476
  const isRateLimitError = error instanceof ProviderError && error.code === "E1303" /* PROVIDER_RATE_LIMIT */;
9349
9477
  if (isRateLimitError) {
9350
9478
  const providerError = error;
9351
- const limitManager2 = getProviderLimitManager();
9479
+ const limitManager2 = await getProviderLimitManager();
9352
9480
  const resetAtMs = providerError.context?.resetAtMs;
9353
9481
  const limitWindow = providerError.context?.limitWindow;
9354
9482
  if (typeof resetAtMs === "number" && typeof limitWindow === "string") {
@@ -9426,13 +9554,13 @@ var Router = class {
9426
9554
  if (!this.fallbackEnabled) {
9427
9555
  throw lastError;
9428
9556
  }
9429
- if (attemptNumber < availableProviders.length) {
9557
+ if (attemptNumber < providersToTry.length) {
9430
9558
  const reason = isRateLimitError ? "usage limit hit" : "error";
9431
9559
  logger.info("\u{1F504} Router: fallback triggered", {
9432
9560
  reason,
9433
9561
  failedProvider: provider.name,
9434
- nextProvider: availableProviders[attemptNumber]?.name,
9435
- remainingProviders: availableProviders.length - attemptNumber
9562
+ nextProvider: providersToTry[attemptNumber]?.name,
9563
+ remainingProviders: providersToTry.length - attemptNumber
9436
9564
  });
9437
9565
  }
9438
9566
  continue;
@@ -9448,7 +9576,7 @@ var Router = class {
9448
9576
  providers: providersToTry.map((p) => p.name)
9449
9577
  });
9450
9578
  }
9451
- const limitManager = getProviderLimitManager();
9579
+ const limitManager = await getProviderLimitManager();
9452
9580
  const allProviders = this.providers;
9453
9581
  const limitedProviders = [];
9454
9582
  for (const provider of allProviders) {
@@ -9484,7 +9612,7 @@ var Router = class {
9484
9612
  */
9485
9613
  async getAvailableProviders() {
9486
9614
  const now = Date.now();
9487
- const limitManager = getProviderLimitManager();
9615
+ const limitManager = await getProviderLimitManager();
9488
9616
  const checks = this.providers.map(async (provider) => {
9489
9617
  try {
9490
9618
  const limitCheck = limitManager.isProviderLimited(provider.name, now);
@@ -9558,7 +9686,7 @@ var Router = class {
9558
9686
  const checkStartTime = Date.now();
9559
9687
  this.healthCheckMetrics.checksPerformed++;
9560
9688
  try {
9561
- const limitManager = getProviderLimitManager();
9689
+ const limitManager = await getProviderLimitManager();
9562
9690
  const restoredProviders = await limitManager.refreshExpired();
9563
9691
  if (restoredProviders.length > 0) {
9564
9692
  logger.info("\u2705 Router: provider limits auto-restored", {
@@ -10571,6 +10699,10 @@ var MemoryManager = class _MemoryManager {
10571
10699
  const shouldVacuum = deleted >= this.vacuumConfig.minDeletionsForVacuum && timeSinceLastVacuum >= this.vacuumConfig.minIntervalMs;
10572
10700
  if (shouldVacuum) {
10573
10701
  setImmediate(() => {
10702
+ if (!this.initialized) {
10703
+ logger.debug("Skipping VACUUM - database already closed");
10704
+ return;
10705
+ }
10574
10706
  try {
10575
10707
  this.db.prepare("VACUUM").run();
10576
10708
  this.lastVacuumTime = Date.now();
@@ -10833,10 +10965,17 @@ var MemoryManager = class _MemoryManager {
10833
10965
  const errors = [];
10834
10966
  const existingHashes = /* @__PURE__ */ new Set();
10835
10967
  if (skipDuplicates) {
10836
- const existing = this.db.prepare("SELECT content FROM memory_entries").all();
10837
- existing.forEach((row) => {
10838
- existingHashes.add(this.hashContent(row.content));
10839
- });
10968
+ const BATCH_SIZE = 1e3;
10969
+ let offset = 0;
10970
+ let hasMore = true;
10971
+ while (hasMore) {
10972
+ const batch = this.db.prepare("SELECT content FROM memory_entries LIMIT ? OFFSET ?").all(BATCH_SIZE, offset);
10973
+ batch.forEach((row) => {
10974
+ existingHashes.add(this.hashContent(row.content));
10975
+ });
10976
+ hasMore = batch.length === BATCH_SIZE;
10977
+ offset += BATCH_SIZE;
10978
+ }
10840
10979
  }
10841
10980
  for (let i = 0; i < importData.entries.length; i += batchSize) {
10842
10981
  const batch = importData.entries.slice(i, i + batchSize);
@@ -11182,7 +11321,7 @@ var SessionManager = class _SessionManager {
11182
11321
  *
11183
11322
  * @param config - Configuration options
11184
11323
  * @param config.persistencePath - Optional path to JSON file for persistence
11185
- * @param config.maxSessions - Maximum sessions to keep in memory (default: 100)
11324
+ * @param config.maxSessions - Maximum sessions to keep in memory (default: 100, min: 1)
11186
11325
  *
11187
11326
  * @example
11188
11327
  * ```typescript
@@ -11204,7 +11343,15 @@ var SessionManager = class _SessionManager {
11204
11343
  */
11205
11344
  constructor(config) {
11206
11345
  this.persistencePath = config?.persistencePath;
11207
- this.MAX_SESSIONS = config?.maxSessions ?? 100;
11346
+ const requestedMax = config?.maxSessions ?? 100;
11347
+ if (requestedMax < 1) {
11348
+ throw new SessionError(
11349
+ `maxSessions must be at least 1, got ${requestedMax}`,
11350
+ void 0,
11351
+ "invalid_configuration"
11352
+ );
11353
+ }
11354
+ this.MAX_SESSIONS = requestedMax;
11208
11355
  }
11209
11356
  /**
11210
11357
  * Initialize session manager (load from persistence if configured)
@@ -11634,7 +11781,7 @@ var SessionManager = class _SessionManager {
11634
11781
  if (priorityDiff !== 0) return priorityDiff;
11635
11782
  return a.updatedAt.getTime() - b.updatedAt.getTime();
11636
11783
  });
11637
- const toRemoveCount = sessions.length - this.MAX_SESSIONS;
11784
+ const toRemoveCount = Math.max(1, sessions.length - this.MAX_SESSIONS);
11638
11785
  const toRemove = sessions.slice(0, toRemoveCount);
11639
11786
  toRemove.forEach((session) => {
11640
11787
  this.activeSessions.delete(session.id);
@@ -11747,8 +11894,9 @@ var SessionManager = class _SessionManager {
11747
11894
  * Flush pending save operation (wait for completion)
11748
11895
  *
11749
11896
  * Forces immediate save if there's a pending debounced save.
11897
+ * This should be called before process exit to ensure all changes are persisted.
11750
11898
  *
11751
- * @private
11899
+ * @public
11752
11900
  */
11753
11901
  async flushSave() {
11754
11902
  if (this.saveTimeout) {
@@ -12248,17 +12396,24 @@ var WorkspaceManager = class _WorkspaceManager {
12248
12396
  /**
12249
12397
  * Get workspace statistics
12250
12398
  *
12399
+ * @param options - Options for getting stats
12400
+ * @param options.readOnly - If true, don't create directories (Bug #v8.4.12)
12251
12401
  * @returns Workspace statistics
12252
12402
  *
12253
12403
  * @example
12254
12404
  * ```typescript
12255
12405
  * const stats = await workspaceManager.getStats();
12256
12406
  * console.log(`PRD files: ${stats.prdFiles}, Tmp files: ${stats.tmpFiles}`);
12407
+ *
12408
+ * // Read-only mode (for status checks)
12409
+ * const stats = await workspaceManager.getStats({ readOnly: true });
12257
12410
  * ```
12258
12411
  */
12259
- async getStats() {
12412
+ async getStats(options) {
12260
12413
  try {
12261
- await this.ensureDirectories();
12414
+ if (!options?.readOnly) {
12415
+ await this.ensureDirectories();
12416
+ }
12262
12417
  const prdFiles = await this.listFiles(this.prdDir);
12263
12418
  const tmpFiles = await this.listFiles(this.tmpDir);
12264
12419
  let prdSize = 0;
@@ -21880,8 +22035,51 @@ init_esm_shims();
21880
22035
  // src/cli/utils/session-utils.ts
21881
22036
  init_esm_shims();
21882
22037
  init_path_resolver();
22038
+ init_logger();
22039
+ var activeSessionManagers = /* @__PURE__ */ new Set();
22040
+ var exitHandlerInstalled = false;
22041
+ function installExitHandler() {
22042
+ if (exitHandlerInstalled) {
22043
+ return;
22044
+ }
22045
+ const flushAllSessions = async () => {
22046
+ if (activeSessionManagers.size === 0) {
22047
+ return;
22048
+ }
22049
+ logger.debug("Flushing session managers before exit", {
22050
+ count: activeSessionManagers.size
22051
+ });
22052
+ await Promise.all(
22053
+ Array.from(activeSessionManagers).map(async (manager) => {
22054
+ try {
22055
+ await manager.flushSave();
22056
+ } catch (error) {
22057
+ logger.error("Failed to flush session manager on exit", {
22058
+ error: error.message
22059
+ });
22060
+ }
22061
+ })
22062
+ );
22063
+ };
22064
+ process.on("beforeExit", () => {
22065
+ void flushAllSessions();
22066
+ });
22067
+ process.on("exit", () => {
22068
+ });
22069
+ process.on("SIGINT", async () => {
22070
+ await flushAllSessions();
22071
+ process.exit(130);
22072
+ });
22073
+ process.on("SIGTERM", async () => {
22074
+ await flushAllSessions();
22075
+ process.exit(143);
22076
+ });
22077
+ exitHandlerInstalled = true;
22078
+ logger.debug("Session manager exit handler installed");
22079
+ }
21883
22080
  async function createSessionManager() {
21884
22081
  try {
22082
+ installExitHandler();
21885
22083
  const projectDir = await new PathResolver({
21886
22084
  projectDir: process.cwd(),
21887
22085
  workingDir: process.cwd(),
@@ -21891,6 +22089,7 @@ async function createSessionManager() {
21891
22089
  persistencePath: join(projectDir, ".automatosx", "sessions", "sessions.json")
21892
22090
  });
21893
22091
  await sessionManager.initialize();
22092
+ activeSessionManagers.add(sessionManager);
21894
22093
  return sessionManager;
21895
22094
  } catch (error) {
21896
22095
  const err = error;
@@ -22133,6 +22332,13 @@ var GrokProvider = class extends BaseProvider {
22133
22332
  getCLICommand() {
22134
22333
  return this.config.command || "grok";
22135
22334
  }
22335
+ /**
22336
+ * Get CLI arguments for headless mode
22337
+ * Grok CLI requires -p flag for non-interactive mode
22338
+ */
22339
+ getCLIArgs() {
22340
+ return ["-p"];
22341
+ }
22136
22342
  /**
22137
22343
  * Get mock response for testing
22138
22344
  * Returns a realistic Grok-style response
@@ -22263,11 +22469,59 @@ var statusCommand3 = {
22263
22469
  );
22264
22470
  const availableProvidersCount = providerHealth.filter((p) => p.available).length;
22265
22471
  const workspaceManager = new WorkspaceManager(detectedProjectDir);
22266
- const workspaceStats = await workspaceManager.getStats();
22472
+ const workspaceStats = await workspaceManager.getStats({ readOnly: true });
22267
22473
  const memoryStats = await getMemoryStatistics(memoryDir);
22268
22474
  const agentCount = await countFiles(agentsDir, [".yaml", ".yml"]);
22269
22475
  const abilityCount = await countFiles(abilitiesDir, [".md"]);
22270
22476
  const projectInfo = await getProjectInfo(detectedProjectDir);
22477
+ let limitData = {
22478
+ limits: [],
22479
+ manualOverride: null,
22480
+ envOverrides: []
22481
+ };
22482
+ try {
22483
+ const limitManager = await getProviderLimitManager();
22484
+ await limitManager.initialize();
22485
+ await limitManager.refreshExpired();
22486
+ const limitStates = limitManager.getAllStates();
22487
+ const manualOverride = limitManager.getManualOverride();
22488
+ const now = Date.now();
22489
+ limitData.limits = Array.from(limitStates.entries()).map(([name, state]) => ({
22490
+ provider: name,
22491
+ status: state.status,
22492
+ window: state.window,
22493
+ detectedAtMs: state.detectedAtMs,
22494
+ resetAtMs: state.resetAtMs,
22495
+ remainingMs: Math.max(0, state.resetAtMs - now),
22496
+ reason: state.reason,
22497
+ manualHold: state.manualHold
22498
+ }));
22499
+ if (manualOverride) {
22500
+ limitData.manualOverride = {
22501
+ provider: manualOverride.provider,
22502
+ expiresAtMs: manualOverride.expiresAtMs,
22503
+ remainingMs: manualOverride.expiresAtMs ? Math.max(0, manualOverride.expiresAtMs - now) : void 0
22504
+ };
22505
+ }
22506
+ const envVars = [
22507
+ { name: "CLAUDE_CLI", provider: "claude-code" },
22508
+ { name: "GEMINI_CLI", provider: "gemini-cli" },
22509
+ { name: "CODEX_CLI", provider: "openai" }
22510
+ ];
22511
+ for (const { name, provider } of envVars) {
22512
+ const value = process.env[name];
22513
+ if (value) {
22514
+ limitData.envOverrides.push({
22515
+ name,
22516
+ provider,
22517
+ value,
22518
+ valid: existsSync(value)
22519
+ });
22520
+ }
22521
+ }
22522
+ } catch (error) {
22523
+ logger.warn("Failed to collect provider limit data", { error: error.message });
22524
+ }
22271
22525
  const status = {
22272
22526
  system: {
22273
22527
  version: VERSION,
@@ -22317,6 +22571,8 @@ var statusCommand3 = {
22317
22571
  lastCheck: void 0
22318
22572
  }
22319
22573
  },
22574
+ // Bug #v8.4.12: Include provider limit data in JSON output
22575
+ providerLimits: limitData,
22320
22576
  performance: {
22321
22577
  statusCheckMs: Date.now() - startTime
22322
22578
  }
@@ -22395,8 +22651,9 @@ var statusCommand3 = {
22395
22651
  console.log();
22396
22652
  console.log(chalk5.cyan("Provider Limits:"));
22397
22653
  try {
22398
- const limitManager = getProviderLimitManager();
22654
+ const limitManager = await getProviderLimitManager();
22399
22655
  await limitManager.initialize();
22656
+ await limitManager.refreshExpired();
22400
22657
  const limitStates = limitManager.getAllStates();
22401
22658
  const manualOverride = limitManager.getManualOverride();
22402
22659
  const now = Date.now();
@@ -22405,7 +22662,7 @@ var statusCommand3 = {
22405
22662
  } else {
22406
22663
  if (limitStates.size > 0) {
22407
22664
  for (const [name, state] of limitStates.entries()) {
22408
- const remainingMs = state.resetAtMs - now;
22665
+ const remainingMs = Math.max(0, state.resetAtMs - now);
22409
22666
  const hours = Math.ceil(remainingMs / (1e3 * 60 * 60));
22410
22667
  console.log(chalk5.yellow(` \u26A0\uFE0F ${name}: LIMITED (resets in ${hours}h)`));
22411
22668
  if (argv.verbose) {
@@ -33352,8 +33609,9 @@ var providerLimitsCommand = {
33352
33609
  },
33353
33610
  handler: async (argv) => {
33354
33611
  try {
33355
- const limitManager = getProviderLimitManager();
33612
+ const limitManager = await getProviderLimitManager();
33356
33613
  await limitManager.initialize();
33614
+ await limitManager.refreshExpired();
33357
33615
  const states = limitManager.getAllStates();
33358
33616
  const manualOverride = limitManager.getManualOverride();
33359
33617
  const now = Date.now();
@@ -33365,7 +33623,8 @@ var providerLimitsCommand = {
33365
33623
  window: state.window,
33366
33624
  detectedAtMs: state.detectedAtMs,
33367
33625
  resetAtMs: state.resetAtMs,
33368
- remainingMs: state.resetAtMs - now,
33626
+ // Bug #v8.4.11: Clamp negative remainingMs to 0
33627
+ remainingMs: Math.max(0, state.resetAtMs - now),
33369
33628
  reason: state.reason,
33370
33629
  manualHold: state.manualHold
33371
33630
  })),
@@ -33377,12 +33636,12 @@ var providerLimitsCommand = {
33377
33636
  console.log();
33378
33637
  console.log(chalk5.bold("\u{1F4CA} Provider Limits Status"));
33379
33638
  console.log();
33380
- if (states.size === 0) {
33639
+ if (states.size === 0 && !manualOverride) {
33381
33640
  console.log(chalk5.green(" \u2705 No limits detected. All providers available."));
33382
33641
  } else {
33383
33642
  for (const [name, state] of states.entries()) {
33384
33643
  const resetDate = new Date(state.resetAtMs);
33385
- const remainingMs = state.resetAtMs - now;
33644
+ const remainingMs = Math.max(0, state.resetAtMs - now);
33386
33645
  const remainingStr = formatDuration(remainingMs);
33387
33646
  console.log(chalk5.yellow(` \u26A0\uFE0F ${name}:`));
33388
33647
  console.log(` Status: ${state.status}`);
@@ -41046,7 +41305,7 @@ async function handleList(config, argv) {
41046
41305
  console.log(chalk5.cyan("\n\u{1F4CB} AI Provider List\n"));
41047
41306
  const configuredProviders = Object.keys(config.providers || {});
41048
41307
  const metadataProviders = Object.keys(PROVIDER_METADATA2);
41049
- const limitManager = getProviderLimitManager();
41308
+ const limitManager = await getProviderLimitManager();
41050
41309
  await limitManager.initialize();
41051
41310
  const providers = [];
41052
41311
  for (const providerName of configuredProviders) {
@@ -41272,7 +41531,7 @@ async function handleSwitch(argv) {
41272
41531
  console.error("");
41273
41532
  process.exit(1);
41274
41533
  }
41275
- const providerSession = getProviderSession();
41534
+ const providerSession = await getProviderSession();
41276
41535
  providerSession.setProvider(providerName, {
41277
41536
  reason: "Manual CLI switch"
41278
41537
  });
@@ -41283,7 +41542,7 @@ async function handleSwitch(argv) {
41283
41542
  `));
41284
41543
  }
41285
41544
  async function handleReset() {
41286
- const providerSession = getProviderSession();
41545
+ const providerSession = await getProviderSession();
41287
41546
  if (!providerSession.hasOverride()) {
41288
41547
  console.log(chalk5.yellow("\n\u26A0\uFE0F No provider override active\n"));
41289
41548
  console.log(chalk5.gray("Normal routing is already in effect\n"));
@@ -43605,8 +43864,12 @@ var cliCommand = {
43605
43864
  const locations = [
43606
43865
  // 1. Project-specific .grok directory (current directory)
43607
43866
  join(process.cwd(), ".grok", "settings.json"),
43867
+ join(process.cwd(), ".grok", "user-settings.json"),
43868
+ // Legacy filename
43608
43869
  // 2. User home directory .grok
43609
- join(homedir(), ".grok", "settings.json")
43870
+ join(homedir(), ".grok", "settings.json"),
43871
+ join(homedir(), ".grok", "user-settings.json")
43872
+ // Legacy filename
43610
43873
  ];
43611
43874
  for (const location of locations) {
43612
43875
  if (existsSync(location)) {
@@ -43636,10 +43899,12 @@ var cliCommand = {
43636
43899
  console.log(chalk5.gray(" 4. Run ax cli again\n"));
43637
43900
  process.exit(1);
43638
43901
  }
43902
+ let config;
43903
+ let isPlaceholder = false;
43639
43904
  try {
43640
43905
  const configContent = readFileSync(configPath, "utf-8");
43641
- const config = JSON.parse(configContent);
43642
- const isPlaceholder = config.apiKey && (config.apiKey.includes("YOUR_") || config.apiKey.includes("_KEY_HERE") || config.apiKey === "YOUR_XAI_API_KEY_HERE" || config.apiKey === "YOUR_ZAI_API_KEY_HERE");
43906
+ config = JSON.parse(configContent);
43907
+ isPlaceholder = config.apiKey && (config.apiKey.includes("YOUR_") || config.apiKey.includes("_KEY_HERE") || config.apiKey === "YOUR_XAI_API_KEY_HERE" || config.apiKey === "YOUR_ZAI_API_KEY_HERE");
43643
43908
  if (!config.apiKey || isPlaceholder) {
43644
43909
  if (!process.env.GROK_API_KEY) {
43645
43910
  console.log(chalk5.yellow("\n\u26A0\uFE0F No valid API key found in Grok config"));
@@ -43670,10 +43935,17 @@ var cliCommand = {
43670
43935
  process.exit(1);
43671
43936
  }
43672
43937
  const grokArgs = [];
43938
+ if (config.apiKey && !isPlaceholder) {
43939
+ grokArgs.push("--api-key", config.apiKey);
43940
+ }
43941
+ if (config.baseURL) {
43942
+ grokArgs.push("--base-url", config.baseURL);
43943
+ }
43673
43944
  if (argv.model) {
43674
43945
  grokArgs.push("--model", argv.model);
43946
+ } else if (config.model) {
43947
+ grokArgs.push("--model", config.model);
43675
43948
  }
43676
- grokArgs.push("--config", configPath);
43677
43949
  if (argv.prompt) {
43678
43950
  grokArgs.push(argv.prompt);
43679
43951
  }
@@ -43688,7 +43960,6 @@ var cliCommand = {
43688
43960
  console.log(chalk5.gray("\n Press Ctrl+C to exit\n"));
43689
43961
  const grokProcess = spawn(grokCommand, grokArgs, {
43690
43962
  stdio: "inherit",
43691
- shell: true,
43692
43963
  env: {
43693
43964
  ...process.env,
43694
43965
  GROK_CONFIG_PATH: configPath
@@ -144,4 +144,16 @@ systemPrompt: |
144
144
 
145
145
  You are a SPECIALIST IMPLEMENTER (maxDelegationDepth: 1). Execute aerospace mission analysis directly and consult Bob or Dana when system architecture or statistical sign-off is required.
146
146
 
147
+
148
+
149
+
150
+ **CRITICAL - Non-Interactive Mode Behavior**:
151
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
152
+
153
+ - Execute tasks directly without prompting
154
+ - If you cannot complete a task, explain why and provide workarounds
155
+ - NEVER output messages like "need to know if you want me to proceed"
156
+
157
+ Communication style:
158
+
147
159
  Communication style: Structured, evidence-based, and mission-assurance oriented with explicit risk registers and mitigation paths
@@ -229,4 +229,16 @@ systemPrompt: |
229
229
 
230
230
  You are a TACTICAL COORDINATOR (maxDelegationDepth: 1). You perform architecture analysis, design, and ADR management yourself. You delegate implementation to domain experts when needed, and you tap domain experts for exploratory spikes and feasibility studies. Your goal is to enable teams through clear architectural direction, comprehensive ADR documentation, and proactive governance.
231
231
 
232
+
233
+
234
+
235
+ **CRITICAL - Non-Interactive Mode Behavior**:
236
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
237
+
238
+ - Execute tasks directly without prompting
239
+ - If you cannot complete a task, explain why and provide workarounds
240
+ - NEVER output messages like "need to know if you want me to proceed"
241
+
242
+ Communication style:
243
+
232
244
  Communication style: Strategic clarity with pragmatic trade-off analysis and comprehensive documentation
@@ -157,4 +157,16 @@ systemPrompt: |
157
157
 
158
158
  You are an IMPLEMENTER (maxDelegationDepth: 0). Execute backend tasks yourself. Delegate only when truly cross-domain (frontend, security, devops, quality).
159
159
 
160
+
161
+
162
+
163
+ **CRITICAL - Non-Interactive Mode Behavior**:
164
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
165
+
166
+ - Execute tasks directly without prompting
167
+ - If you cannot complete a task, explain why and provide workarounds
168
+ - NEVER output messages like "need to know if you want me to proceed"
169
+
170
+ Communication style:
171
+
160
172
  Communication style: Technical precision with data-driven decisions and operational rigor
@@ -90,4 +90,16 @@ systemPrompt: |
90
90
 
91
91
  You are a TOP-LEVEL COORDINATOR (maxDelegationDepth: 1). Frame vision and strategy yourself, delegate execution to specialists.
92
92
 
93
+
94
+
95
+
96
+ **CRITICAL - Non-Interactive Mode Behavior**:
97
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
98
+
99
+ - Execute tasks directly without prompting
100
+ - If you cannot complete a task, explain why and provide workarounds
101
+ - NEVER output messages like "need to know if you want me to proceed"
102
+
103
+ Communication style:
104
+
93
105
  Communication style: Inspirational and strategic with customer-driven focus
@@ -160,22 +160,14 @@ systemPrompt: |
160
160
  - **Ad Copy**: Headlines, CTAs, email sequences, landing page copy
161
161
  - **Performance Reports**: KPI dashboards, A/B test analysis, recommendations
162
162
 
163
- ## Your Communication Style:
164
163
 
165
- - **Creative yet data-driven**: Balance artistic vision with measurable outcomes
166
- - **Platform-native**: Understand nuances of each marketing channel
167
- - **Conversion-focused**: Always tie creative to business results
168
- - **Trend-aware**: Stay current with GenAI capabilities and marketing best practices
169
- - **Collaborative**: Seamlessly work with designers, developers, and product teams
170
164
 
171
- ## Brand Safety & Ethics:
172
165
 
173
- - Always flag potential brand guideline conflicts
174
- - Disclose AI-generated content where required by platform
175
- - Verify licensing for music, style references, and assets
176
- - Include diversity and representation in creative
177
- - Avoid misleading claims or false scarcity tactics
166
+ **CRITICAL - Non-Interactive Mode Behavior**:
167
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
178
168
 
179
- ---
169
+ - Execute tasks directly without prompting
170
+ - If you cannot complete a task, explain why and provide workarounds
171
+ - NEVER output messages like "need to know if you want me to proceed"
180
172
 
181
- **Your Mission**: Empower teams to create world-class marketing campaigns powered by GenAI, driving real business growth through compelling stories and optimized strategies.
173
+ Communication style:
@@ -103,4 +103,16 @@ systemPrompt: |
103
103
 
104
104
  Handle architecture and strategy yourself, delegate implementation and coordination to technical teams.
105
105
 
106
+
107
+
108
+
109
+ **CRITICAL - Non-Interactive Mode Behavior**:
110
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
111
+
112
+ - Execute tasks directly without prompting
113
+ - If you cannot complete a task, explain why and provide workarounds
114
+ - NEVER output messages like "need to know if you want me to proceed"
115
+
116
+ Communication style:
117
+
106
118
  Communication style: Strategic technical leadership with team-driven decision making
@@ -185,4 +185,16 @@ systemPrompt: |
185
185
  - Backend: Model deployment, API integration, production systems
186
186
  - Quality: Model validation, A/B test design, statistical rigor
187
187
 
188
+
189
+
190
+
191
+ **CRITICAL - Non-Interactive Mode Behavior**:
192
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
193
+
194
+ - Execute tasks directly without prompting
195
+ - If you cannot complete a task, explain why and provide workarounds
196
+ - NEVER output messages like "need to know if you want me to proceed"
197
+
198
+ Communication style:
199
+
188
200
  Communication style: Analytical and rigorous with data-driven insights
@@ -91,4 +91,16 @@ systemPrompt: |
91
91
 
92
92
  You are an IMPLEMENTER (maxDelegationDepth: 1). Execute data engineering work yourself. Delegate to backend for application integration, security for data governance, quality for testing.
93
93
 
94
+
95
+
96
+
97
+ **CRITICAL - Non-Interactive Mode Behavior**:
98
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
99
+
100
+ - Execute tasks directly without prompting
101
+ - If you cannot complete a task, explain why and provide workarounds
102
+ - NEVER output messages like "need to know if you want me to proceed"
103
+
104
+ Communication style:
105
+
94
106
  Communication style: Systematic and reliability-focused with infrastructure perspective
@@ -100,4 +100,16 @@ systemPrompt: |
100
100
 
101
101
  You are an IMPLEMENTER (maxDelegationDepth: 0). Execute design work yourself. Delegate only when truly cross-domain (frontend, writer, quality).
102
102
 
103
+
104
+
105
+
106
+ **CRITICAL - Non-Interactive Mode Behavior**:
107
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
108
+
109
+ - Execute tasks directly without prompting
110
+ - If you cannot complete a task, explain why and provide workarounds
111
+ - NEVER output messages like "need to know if you want me to proceed"
112
+
113
+ Communication style:
114
+
103
115
  Communication style: Creative and empathetic with user-centric approach
@@ -109,4 +109,16 @@ systemPrompt: |
109
109
 
110
110
  Execute infrastructure work yourself when appropriate, coordinate complex deployments across teams.
111
111
 
112
+
113
+
114
+
115
+ **CRITICAL - Non-Interactive Mode Behavior**:
116
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
117
+
118
+ - Execute tasks directly without prompting
119
+ - If you cannot complete a task, explain why and provide workarounds
120
+ - NEVER output messages like "need to know if you want me to proceed"
121
+
122
+ Communication style:
123
+
112
124
  Communication style: Practical and systematic with reliability focus
@@ -156,4 +156,16 @@ systemPrompt: |
156
156
 
157
157
  You are an IMPLEMENTER (maxDelegationDepth: 0). Execute frontend work yourself. Delegate only when truly cross-domain (backend, design, security, quality, devops).
158
158
 
159
+
160
+
161
+
162
+ **CRITICAL - Non-Interactive Mode Behavior**:
163
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
164
+
165
+ - Execute tasks directly without prompting
166
+ - If you cannot complete a task, explain why and provide workarounds
167
+ - NEVER output messages like "need to know if you want me to proceed"
168
+
169
+ Communication style:
170
+
159
171
  Communication style: Visual and empathetic, user-experience driven
@@ -157,4 +157,16 @@ systemPrompt: |
157
157
  - DevOps specialist: Infrastructure, CI/CD pipelines
158
158
  - Quality specialist: Test architecture, complex testing scenarios
159
159
 
160
+
161
+
162
+
163
+ **CRITICAL - Non-Interactive Mode Behavior**:
164
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
165
+
166
+ - Execute tasks directly without prompting
167
+ - If you cannot complete a task, explain why and provide workarounds
168
+ - NEVER output messages like "need to know if you want me to proceed"
169
+
170
+ Communication style:
171
+
160
172
  Communication style: Pragmatic and integration-focused with end-to-end perspective
@@ -170,4 +170,16 @@ systemPrompt: |
170
170
  - Quality specialist: Mobile testing strategies, device testing
171
171
  - Astrid (aerospace): Telemetry data hand-offs and format coordination
172
172
 
173
+
174
+
175
+
176
+ **CRITICAL - Non-Interactive Mode Behavior**:
177
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
178
+
179
+ - Execute tasks directly without prompting
180
+ - If you cannot complete a task, explain why and provide workarounds
181
+ - NEVER output messages like "need to know if you want me to proceed"
182
+
183
+ Communication style:
184
+
173
185
  Communication style: Mobile-first mindset with platform-native expertise
@@ -88,4 +88,16 @@ systemPrompt: |
88
88
 
89
89
  You are a COORDINATOR (maxDelegationDepth: 1). Handle strategy and planning yourself, delegate execution to specialists (backend, frontend, design, data, quality, writer).
90
90
 
91
+
92
+
93
+
94
+ **CRITICAL - Non-Interactive Mode Behavior**:
95
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
96
+
97
+ - Execute tasks directly without prompting
98
+ - If you cannot complete a task, explain why and provide workarounds
99
+ - NEVER output messages like "need to know if you want me to proceed"
100
+
101
+ Communication style:
102
+
91
103
  Communication style: User-focused and collaborative with outcome-driven decisions
@@ -78,4 +78,16 @@ systemPrompt: |
78
78
 
79
79
  Execute quality work yourself (maxDelegationDepth: 1). Delegate to Stan for code review and standards, delegate to implementation teams (backend, frontend, security) for bug fixes.
80
80
 
81
+
82
+
83
+
84
+ **CRITICAL - Non-Interactive Mode Behavior**:
85
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
86
+
87
+ - Execute tasks directly without prompting
88
+ - If you cannot complete a task, explain why and provide workarounds
89
+ - NEVER output messages like "need to know if you want me to proceed"
90
+
91
+ Communication style:
92
+
81
93
  Communication style: Methodical and detailed with quality-first focus
@@ -152,4 +152,16 @@ systemPrompt: |
152
152
 
153
153
  You are a SPECIALIST IMPLEMENTER (maxDelegationDepth: 1). Execute quantum workloads directly and consult Bob or Dana when architectural or statistical sign-off is required.
154
154
 
155
+
156
+
157
+
158
+ **CRITICAL - Non-Interactive Mode Behavior**:
159
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
160
+
161
+ - Execute tasks directly without prompting
162
+ - If you cannot complete a task, explain why and provide workarounds
163
+ - NEVER output messages like "need to know if you want me to proceed"
164
+
165
+ Communication style:
166
+
155
167
  Communication style: Precise, data-backed, and methodical with clear assumptions and validation evidence
@@ -107,4 +107,16 @@ systemPrompt: |
107
107
 
108
108
  **Deliverables**: Executive summary, literature findings with citations, logical analysis, feasibility/risk matrix, options & recommendations, long‑form report.
109
109
 
110
+
111
+
112
+
113
+ **CRITICAL - Non-Interactive Mode Behavior**:
114
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
115
+
116
+ - Execute tasks directly without prompting
117
+ - If you cannot complete a task, explain why and provide workarounds
118
+ - NEVER output messages like "need to know if you want me to proceed"
119
+
120
+ Communication style:
121
+
110
122
  Communication style: Structured, neutral, and evidence‑driven. Cite sources and call out uncertainties.
@@ -100,4 +100,16 @@ systemPrompt: |
100
100
 
101
101
  You are an IMPLEMENTER (maxDelegationDepth: 0). Execute security assessments yourself. Delegate only when truly cross-domain (backend, frontend, devops, quality for implementation).
102
102
 
103
+
104
+
105
+
106
+ **CRITICAL - Non-Interactive Mode Behavior**:
107
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
108
+
109
+ - Execute tasks directly without prompting
110
+ - If you cannot complete a task, explain why and provide workarounds
111
+ - NEVER output messages like "need to know if you want me to proceed"
112
+
113
+ Communication style:
114
+
103
115
  Communication style: Precise and risk-focused with security-first mindset
@@ -199,4 +199,16 @@ systemPrompt: |
199
199
 
200
200
  You are a TACTICAL IMPLEMENTER (maxDelegationDepth: 1). You perform standards analysis and architectural reviews yourself. Delegate implementation to domain experts (backend, frontend, etc.) when changes are needed. Your goal is to elevate code quality while empowering teams to maintain standards independently.
201
201
 
202
+
203
+
204
+
205
+ **CRITICAL - Non-Interactive Mode Behavior**:
206
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
207
+
208
+ - Execute tasks directly without prompting
209
+ - If you cannot complete a task, explain why and provide workarounds
210
+ - NEVER output messages like "need to know if you want me to proceed"
211
+
212
+ Communication style:
213
+
202
214
  Communication style: Educational and principled with concrete examples and clear rationale
@@ -107,4 +107,16 @@ systemPrompt: |
107
107
 
108
108
  You are an IMPLEMENTER (maxDelegationDepth: 0). Execute writing yourself. Delegate only when truly cross-domain (backend, frontend, design, quality for technical details/review).
109
109
 
110
+
111
+
112
+
113
+ **CRITICAL - Non-Interactive Mode Behavior**:
114
+ When running in non-interactive mode or background mode, proceed automatically without asking for permission or confirmation.
115
+
116
+ - Execute tasks directly without prompting
117
+ - If you cannot complete a task, explain why and provide workarounds
118
+ - NEVER output messages like "need to know if you want me to proceed"
119
+
120
+ Communication style:
121
+
110
122
  Communication style: Clear, structured, and user-friendly
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defai.digital/automatosx",
3
- "version": "8.4.3",
3
+ "version": "8.4.16",
4
4
  "description": "AI Agent Orchestration Platform",
5
5
  "type": "module",
6
6
  "publishConfig": {