crewly 1.0.11 → 1.1.0

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.
Files changed (110) hide show
  1. package/config/constants.ts +6 -0
  2. package/config/roles/orchestrator/self-evolution.md +72 -0
  3. package/config/skills/orchestrator/read-session-logs/execute.sh +14 -0
  4. package/config/skills/orchestrator/read-session-logs/instructions.md +33 -0
  5. package/config/skills/orchestrator/read-session-logs/skill.json +20 -0
  6. package/config/skills/orchestrator/read-system-logs/execute.sh +18 -0
  7. package/config/skills/orchestrator/read-system-logs/instructions.md +30 -0
  8. package/config/skills/orchestrator/read-system-logs/skill.json +20 -0
  9. package/config/skills/orchestrator/reply-slack/execute.sh +12 -0
  10. package/config/skills/orchestrator/reply-slack/instructions.md +16 -1
  11. package/config/skills/orchestrator/report-bug/execute.sh +49 -0
  12. package/config/skills/orchestrator/report-bug/instructions.md +30 -0
  13. package/config/skills/orchestrator/report-bug/skill.json +20 -0
  14. package/dist/backend/backend/src/constants.d.ts +24 -1
  15. package/dist/backend/backend/src/constants.d.ts.map +1 -1
  16. package/dist/backend/backend/src/constants.js +25 -2
  17. package/dist/backend/backend/src/constants.js.map +1 -1
  18. package/dist/backend/backend/src/controllers/monitoring/terminal.controller.d.ts +14 -0
  19. package/dist/backend/backend/src/controllers/monitoring/terminal.controller.d.ts.map +1 -1
  20. package/dist/backend/backend/src/controllers/monitoring/terminal.controller.js +74 -0
  21. package/dist/backend/backend/src/controllers/monitoring/terminal.controller.js.map +1 -1
  22. package/dist/backend/backend/src/controllers/orchestrator/orchestrator.controller.d.ts.map +1 -1
  23. package/dist/backend/backend/src/controllers/orchestrator/orchestrator.controller.js +20 -34
  24. package/dist/backend/backend/src/controllers/orchestrator/orchestrator.controller.js.map +1 -1
  25. package/dist/backend/backend/src/index.d.ts.map +1 -1
  26. package/dist/backend/backend/src/index.js +16 -1
  27. package/dist/backend/backend/src/index.js.map +1 -1
  28. package/dist/backend/backend/src/routes/modules/terminal.routes.d.ts.map +1 -1
  29. package/dist/backend/backend/src/routes/modules/terminal.routes.js +2 -0
  30. package/dist/backend/backend/src/routes/modules/terminal.routes.js.map +1 -1
  31. package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts +24 -2
  32. package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
  33. package/dist/backend/backend/src/services/agent/agent-registration.service.js +191 -89
  34. package/dist/backend/backend/src/services/agent/agent-registration.service.js.map +1 -1
  35. package/dist/backend/backend/src/services/agent/codex-runtime.service.d.ts +5 -1
  36. package/dist/backend/backend/src/services/agent/codex-runtime.service.d.ts.map +1 -1
  37. package/dist/backend/backend/src/services/agent/codex-runtime.service.js +10 -17
  38. package/dist/backend/backend/src/services/agent/codex-runtime.service.js.map +1 -1
  39. package/dist/backend/backend/src/services/agent/context-window-monitor.service.d.ts +16 -0
  40. package/dist/backend/backend/src/services/agent/context-window-monitor.service.d.ts.map +1 -1
  41. package/dist/backend/backend/src/services/agent/context-window-monitor.service.js +111 -10
  42. package/dist/backend/backend/src/services/agent/context-window-monitor.service.js.map +1 -1
  43. package/dist/backend/backend/src/services/agent/gemini-runtime.service.d.ts +33 -2
  44. package/dist/backend/backend/src/services/agent/gemini-runtime.service.d.ts.map +1 -1
  45. package/dist/backend/backend/src/services/agent/gemini-runtime.service.js +388 -20
  46. package/dist/backend/backend/src/services/agent/gemini-runtime.service.js.map +1 -1
  47. package/dist/backend/backend/src/services/agent/runtime-agent.service.abstract.d.ts +1 -1
  48. package/dist/backend/backend/src/services/agent/runtime-agent.service.abstract.d.ts.map +1 -1
  49. package/dist/backend/backend/src/services/agent/runtime-agent.service.abstract.js +1 -1
  50. package/dist/backend/backend/src/services/agent/runtime-agent.service.abstract.js.map +1 -1
  51. package/dist/backend/backend/src/services/agent/runtime-exit-monitor.service.d.ts +17 -2
  52. package/dist/backend/backend/src/services/agent/runtime-exit-monitor.service.d.ts.map +1 -1
  53. package/dist/backend/backend/src/services/agent/runtime-exit-monitor.service.js +105 -12
  54. package/dist/backend/backend/src/services/agent/runtime-exit-monitor.service.js.map +1 -1
  55. package/dist/backend/backend/src/services/core/config.service.d.ts.map +1 -1
  56. package/dist/backend/backend/src/services/core/config.service.js +3 -2
  57. package/dist/backend/backend/src/services/core/config.service.js.map +1 -1
  58. package/dist/backend/backend/src/services/messaging/message-queue.service.d.ts.map +1 -1
  59. package/dist/backend/backend/src/services/messaging/message-queue.service.js +17 -0
  60. package/dist/backend/backend/src/services/messaging/message-queue.service.js.map +1 -1
  61. package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.d.ts +5 -0
  62. package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.d.ts.map +1 -1
  63. package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.js +42 -2
  64. package/dist/backend/backend/src/services/orchestrator/orchestrator-restart.service.js.map +1 -1
  65. package/dist/backend/backend/src/services/session/pty/pty-session-backend.d.ts +39 -0
  66. package/dist/backend/backend/src/services/session/pty/pty-session-backend.d.ts.map +1 -1
  67. package/dist/backend/backend/src/services/session/pty/pty-session-backend.js +121 -1
  68. package/dist/backend/backend/src/services/session/pty/pty-session-backend.js.map +1 -1
  69. package/dist/backend/backend/src/services/settings/settings.service.d.ts.map +1 -1
  70. package/dist/backend/backend/src/services/settings/settings.service.js +6 -0
  71. package/dist/backend/backend/src/services/settings/settings.service.js.map +1 -1
  72. package/dist/backend/backend/src/services/workflow/message-scheduler.service.d.ts.map +1 -1
  73. package/dist/backend/backend/src/services/workflow/message-scheduler.service.js +8 -1
  74. package/dist/backend/backend/src/services/workflow/message-scheduler.service.js.map +1 -1
  75. package/dist/backend/backend/src/services/workflow/scheduler.service.d.ts +1 -0
  76. package/dist/backend/backend/src/services/workflow/scheduler.service.d.ts.map +1 -1
  77. package/dist/backend/backend/src/services/workflow/scheduler.service.js +28 -1
  78. package/dist/backend/backend/src/services/workflow/scheduler.service.js.map +1 -1
  79. package/dist/backend/backend/src/types/settings.types.d.ts +4 -0
  80. package/dist/backend/backend/src/types/settings.types.d.ts.map +1 -1
  81. package/dist/backend/backend/src/types/settings.types.js +9 -1
  82. package/dist/backend/backend/src/types/settings.types.js.map +1 -1
  83. package/dist/backend/config/constants.d.ts +6 -0
  84. package/dist/backend/config/constants.d.ts.map +1 -1
  85. package/dist/backend/config/constants.js +6 -0
  86. package/dist/backend/config/constants.js.map +1 -1
  87. package/dist/backend/config/index.d.ts +3 -0
  88. package/dist/backend/config/index.d.ts.map +1 -1
  89. package/dist/cli/backend/src/constants.d.ts +24 -1
  90. package/dist/cli/backend/src/constants.d.ts.map +1 -1
  91. package/dist/cli/backend/src/constants.js +25 -2
  92. package/dist/cli/backend/src/constants.js.map +1 -1
  93. package/dist/cli/backend/src/services/core/config.service.d.ts.map +1 -1
  94. package/dist/cli/backend/src/services/core/config.service.js +3 -2
  95. package/dist/cli/backend/src/services/core/config.service.js.map +1 -1
  96. package/dist/cli/backend/src/types/settings.types.d.ts +4 -0
  97. package/dist/cli/backend/src/types/settings.types.d.ts.map +1 -1
  98. package/dist/cli/backend/src/types/settings.types.js +9 -1
  99. package/dist/cli/backend/src/types/settings.types.js.map +1 -1
  100. package/dist/cli/cli/src/index.js +1 -0
  101. package/dist/cli/cli/src/index.js.map +1 -1
  102. package/dist/cli/config/constants.d.ts +6 -0
  103. package/dist/cli/config/constants.d.ts.map +1 -1
  104. package/dist/cli/config/constants.js +6 -0
  105. package/dist/cli/config/constants.js.map +1 -1
  106. package/dist/cli/config/index.d.ts +3 -0
  107. package/dist/cli/config/index.d.ts.map +1 -1
  108. package/frontend/dist/assets/{index-0a245b0d.js → index-45eeea99.js} +2 -2
  109. package/frontend/dist/index.html +1 -1
  110. package/package.json +1 -1
@@ -12,6 +12,92 @@ export class GeminiRuntimeService extends RuntimeAgentService {
12
12
  constructor(sessionHelper, projectRoot) {
13
13
  super(sessionHelper, projectRoot);
14
14
  }
15
+ /**
16
+ * Gemini CLI can show an interactive trust gate on first launch:
17
+ * "Do you trust this folder?".
18
+ * Auto-accept the default "Trust folder" option so startup does not stall.
19
+ */
20
+ async waitForRuntimeReady(sessionName, timeout, checkInterval = 2000) {
21
+ const startTime = Date.now();
22
+ let trustPromptAttempts = 0;
23
+ this.logger.info('Waiting for runtime to be ready', {
24
+ sessionName,
25
+ runtimeType: this.getRuntimeType(),
26
+ timeout,
27
+ checkInterval,
28
+ });
29
+ while (Date.now() - startTime < timeout) {
30
+ try {
31
+ const output = this.sessionHelper.capturePane(sessionName);
32
+ if (this.isGeminiTrustPrompt(output)) {
33
+ trustPromptAttempts++;
34
+ this.logger.info('Gemini trust prompt detected during startup, auto-confirming', {
35
+ sessionName,
36
+ attempt: trustPromptAttempts,
37
+ });
38
+ // Always use Enter to accept the currently selected default option.
39
+ // Typing "1" can leak into the normal input box after Gemini restarts.
40
+ await this.sessionHelper.sendEnter(sessionName);
41
+ await delay(1000);
42
+ continue;
43
+ }
44
+ const readyPatterns = this.getRuntimeReadyPatterns();
45
+ const hasReadySignal = readyPatterns.some((pattern) => output.includes(pattern));
46
+ if (hasReadySignal) {
47
+ const detectedPattern = readyPatterns.find((p) => output.includes(p));
48
+ this.logger.info('Runtime ready pattern detected', {
49
+ sessionName,
50
+ runtimeType: this.getRuntimeType(),
51
+ detectedPattern,
52
+ totalElapsed: Date.now() - startTime,
53
+ });
54
+ return true;
55
+ }
56
+ const errorPatterns = this.getRuntimeErrorPatterns();
57
+ const hasError = errorPatterns.some((pattern) => output.includes(pattern));
58
+ if (hasError) {
59
+ const detectedError = errorPatterns.find((p) => output.includes(p));
60
+ this.logger.error('Runtime error pattern detected during startup', {
61
+ sessionName,
62
+ runtimeType: this.getRuntimeType(),
63
+ detectedError,
64
+ totalElapsed: Date.now() - startTime,
65
+ });
66
+ return false;
67
+ }
68
+ }
69
+ catch (error) {
70
+ this.logger.warn('Error while checking runtime ready signal', {
71
+ sessionName,
72
+ runtimeType: this.getRuntimeType(),
73
+ error: String(error),
74
+ });
75
+ }
76
+ await delay(checkInterval);
77
+ }
78
+ try {
79
+ const lastOutput = this.sessionHelper.capturePane(sessionName);
80
+ const lastLines = lastOutput.split('\n').slice(-10).join('\n');
81
+ this.logger.warn('Timeout waiting for runtime ready signal', {
82
+ sessionName,
83
+ runtimeType: this.getRuntimeType(),
84
+ timeout,
85
+ checkInterval,
86
+ totalElapsed: Date.now() - startTime,
87
+ lastTerminalLines: lastLines,
88
+ });
89
+ }
90
+ catch {
91
+ this.logger.warn('Timeout waiting for runtime ready signal', {
92
+ sessionName,
93
+ runtimeType: this.getRuntimeType(),
94
+ timeout,
95
+ checkInterval,
96
+ totalElapsed: Date.now() - startTime,
97
+ });
98
+ }
99
+ return false;
100
+ }
15
101
  getRuntimeType() {
16
102
  return RUNTIME_TYPES.GEMINI_CLI;
17
103
  }
@@ -55,6 +141,10 @@ export class GeminiRuntimeService extends RuntimeAgentService {
55
141
  'context left)',
56
142
  ];
57
143
  }
144
+ isGeminiTrustPrompt(output) {
145
+ return /Do you trust this folder\?/i.test(output)
146
+ && /Trust folder/i.test(output);
147
+ }
58
148
  /**
59
149
  * Gemini CLI specific exit patterns for runtime exit detection.
60
150
  *
@@ -97,7 +187,7 @@ export class GeminiRuntimeService extends RuntimeAgentService {
97
187
  * @param targetProjectPath - Optional target project path for MCP config.
98
188
  * Falls back to this.projectRoot if not provided.
99
189
  */
100
- async postInitialize(sessionName, targetProjectPath) {
190
+ async postInitialize(sessionName, targetProjectPath, additionalAllowlistPaths) {
101
191
  const effectiveProjectPath = targetProjectPath || this.projectRoot;
102
192
  const crewlyHome = path.join(os.homedir(), CREWLY_CONSTANTS.PATHS.CREWLY_HOME);
103
193
  this.logger.info('Gemini CLI post-init: adding paths to directory allowlist', {
@@ -105,6 +195,7 @@ export class GeminiRuntimeService extends RuntimeAgentService {
105
195
  crewlyHome,
106
196
  projectRoot: this.projectRoot,
107
197
  targetProjectPath: effectiveProjectPath,
198
+ additionalPaths: additionalAllowlistPaths?.length ?? 0,
108
199
  });
109
200
  // Ensure MCP servers (e.g., playwright) are configured before the agent starts.
110
201
  // This is done before the allowlist step because it's a filesystem operation
@@ -112,18 +203,29 @@ export class GeminiRuntimeService extends RuntimeAgentService {
112
203
  await this.ensureGeminiMcpConfig(effectiveProjectPath);
113
204
  // Ensure GOOGLE_GENAI_API_KEY is in the project .env file
114
205
  await this.ensureGeminiEnvFile(effectiveProjectPath);
206
+ // Ensure required paths are trusted by Gemini CLI before /directory add.
207
+ // Include the system temp directory so agents can read temp files
208
+ // (e.g. screenshots saved to /tmp by skills like rednote-reader).
209
+ const tempDir = os.tmpdir();
210
+ const pathsToAdd = [crewlyHome, this.projectRoot, tempDir];
211
+ if (effectiveProjectPath !== this.projectRoot) {
212
+ pathsToAdd.push(effectiveProjectPath);
213
+ }
214
+ // Merge additional paths (e.g. orchestrator's existing project paths)
215
+ // so ALL /directory add commands run before the registration prompt.
216
+ if (additionalAllowlistPaths?.length) {
217
+ for (const p of additionalAllowlistPaths) {
218
+ if (!pathsToAdd.includes(p)) {
219
+ pathsToAdd.push(p);
220
+ }
221
+ }
222
+ }
223
+ await this.ensureGeminiTrustedFolders(pathsToAdd);
115
224
  // Wait for Gemini CLI's async auto-update check to complete before
116
225
  // sending commands. The auto-update notification (e.g., "Automatic
117
226
  // update failed") appears shortly after startup and can interfere
118
227
  // with slash command processing if we send /directory add too early.
119
228
  await delay(3000);
120
- // Add ~/.crewly, the Crewly project root, and the target project to the allowlist.
121
- // The target project path may differ from projectRoot when the agent works on a
122
- // separate project (e.g., business_os vs crewly).
123
- const pathsToAdd = [crewlyHome, this.projectRoot];
124
- if (effectiveProjectPath !== this.projectRoot) {
125
- pathsToAdd.push(effectiveProjectPath);
126
- }
127
229
  const result = await this.addMultipleProjectsToAllowlist(sessionName, pathsToAdd);
128
230
  if (!result.success) {
129
231
  this.logger.warn('Failed to add paths to Gemini CLI allowlist (non-fatal)', {
@@ -131,6 +233,10 @@ export class GeminiRuntimeService extends RuntimeAgentService {
131
233
  results: result.results,
132
234
  });
133
235
  }
236
+ // Do not return to caller until Gemini is back at a clean prompt.
237
+ // Otherwise the immediate "Read the file ..." instruction can race with
238
+ // an in-flight slash command and get concatenated in the input box.
239
+ await this.waitForSlashQueueToDrain(sessionName);
134
240
  }
135
241
  /**
136
242
  * Ensure Gemini CLI MCP server configuration exists in the project directory.
@@ -220,6 +326,54 @@ export class GeminiRuntimeService extends RuntimeAgentService {
220
326
  });
221
327
  }
222
328
  }
329
+ /**
330
+ * Ensure Gemini trusted folders contain the required paths.
331
+ * Gemini blocks `/directory add` for paths that are not pre-trusted.
332
+ */
333
+ async ensureGeminiTrustedFolders(paths) {
334
+ const trustedFoldersPath = path.join(os.homedir(), '.gemini', 'trustedFolders.json');
335
+ const normalizedPaths = [...new Set(paths.map((p) => path.resolve(p)))];
336
+ try {
337
+ let trustedFolders = {};
338
+ try {
339
+ const raw = await fsPromises.readFile(trustedFoldersPath, 'utf8');
340
+ const parsed = JSON.parse(raw);
341
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
342
+ trustedFolders = parsed;
343
+ }
344
+ }
345
+ catch (readError) {
346
+ // Missing file is expected on first run; malformed content is reset.
347
+ if (readError?.code !== 'ENOENT') {
348
+ this.logger.warn('Failed to read Gemini trusted folders, resetting file', {
349
+ trustedFoldersPath,
350
+ error: readError instanceof Error ? readError.message : String(readError),
351
+ });
352
+ }
353
+ }
354
+ let changed = false;
355
+ for (const folderPath of normalizedPaths) {
356
+ if (trustedFolders[folderPath] !== 'TRUST_FOLDER') {
357
+ trustedFolders[folderPath] = 'TRUST_FOLDER';
358
+ changed = true;
359
+ }
360
+ }
361
+ if (!changed)
362
+ return;
363
+ await fsPromises.mkdir(path.dirname(trustedFoldersPath), { recursive: true });
364
+ await fsPromises.writeFile(trustedFoldersPath, `${JSON.stringify(trustedFolders, null, 2)}\n`, 'utf8');
365
+ this.logger.info('Gemini trusted folders updated', {
366
+ trustedFoldersPath,
367
+ addedCount: normalizedPaths.length,
368
+ });
369
+ }
370
+ catch (error) {
371
+ this.logger.warn('Failed to update Gemini trusted folders (non-fatal)', {
372
+ trustedFoldersPath,
373
+ error: error instanceof Error ? error.message : String(error),
374
+ });
375
+ }
376
+ }
223
377
  /**
224
378
  * Check if Gemini CLI is installed and configured
225
379
  */
@@ -283,6 +437,18 @@ export class GeminiRuntimeService extends RuntimeAgentService {
283
437
  // The "/directory add" success message appears in the upper messages
284
438
  // area via addItem(), so 20 lines only captures the unchanging bottom.
285
439
  const beforeOutput = this.sessionHelper.capturePane(sessionName, 100);
440
+ const alreadyAllowlistedBeforeSend = this.isPathAlreadyAllowlisted(beforeOutput, projectPath);
441
+ if (alreadyAllowlistedBeforeSend) {
442
+ this.logger.info('Project already in Gemini CLI workspace, skipping /directory add', {
443
+ sessionName,
444
+ projectPath,
445
+ attempt,
446
+ });
447
+ return {
448
+ success: true,
449
+ message: `Project path ${projectPath} is already in Gemini CLI workspace`,
450
+ };
451
+ }
286
452
  // Send the directory add command
287
453
  // Add a trailing space as sometimes Gemini CLI needs it to delimit the path properly
288
454
  const addCommand = `/directory add ${projectPath} `;
@@ -292,14 +458,65 @@ export class GeminiRuntimeService extends RuntimeAgentService {
292
458
  // Verify: check if output changed (slash commands produce confirmation)
293
459
  const afterOutput = this.sessionHelper.capturePane(sessionName, 100);
294
460
  const outputChanged = beforeOutput !== afterOutput;
295
- const hasConfirmation = /added|directory|✓|success/i.test(afterOutput);
296
- if (outputChanged || hasConfirmation) {
461
+ // Do not treat the literal "/directory add ..." input text as confirmation.
462
+ // "directory" alone is too broad and causes false positives when the
463
+ // command is still stuck in the prompt.
464
+ const hasConfirmation = /added|✓|success/i.test(afterOutput);
465
+ const alreadyAllowlistedAfterSend = this.isPathAlreadyAllowlisted(afterOutput, projectPath);
466
+ const slashQueueBlocked = /slash commands cannot be queued/i.test(afterOutput);
467
+ const stuckAtPrompt = this.isTextLikelyStuckAtPrompt(afterOutput, addCommand);
468
+ // Gemini CLI can drop Enter while still accepting typed text, which causes
469
+ // subsequent commands to concatenate in the same input box. If we detect
470
+ // that the command text is still at the prompt, press Enter again before
471
+ // retrying so we do not append the next command to the same line.
472
+ if (stuckAtPrompt) {
473
+ this.logger.warn('Directory add command appears stuck at prompt, re-pressing Enter', {
474
+ sessionName,
475
+ projectPath,
476
+ attempt,
477
+ });
478
+ await this.sessionHelper.sendEnter(sessionName);
479
+ await delay(500);
480
+ await this.sessionHelper.sendEnter(sessionName);
481
+ await delay(1500);
482
+ const recoveredOutput = this.sessionHelper.capturePane(sessionName, 100);
483
+ const recoveredHasConfirmation = /added|✓|success/i.test(recoveredOutput);
484
+ const recoveredAlreadyAllowlisted = this.isPathAlreadyAllowlisted(recoveredOutput, projectPath);
485
+ const stillStuck = this.isTextLikelyStuckAtPrompt(recoveredOutput, addCommand);
486
+ if (recoveredHasConfirmation || recoveredAlreadyAllowlisted || !stillStuck) {
487
+ this.logger.info('Project added to Gemini CLI allowlist after Enter recovery', {
488
+ sessionName,
489
+ projectPath,
490
+ attempt,
491
+ recoveredHasConfirmation,
492
+ recoveredAlreadyAllowlisted,
493
+ });
494
+ return {
495
+ success: true,
496
+ message: `Project path ${projectPath} added to Gemini CLI allowlist`,
497
+ };
498
+ }
499
+ }
500
+ // Gemini can report queue contention when commands are fired too quickly.
501
+ // Treat this as a hard retry signal and do not mark success.
502
+ if (slashQueueBlocked) {
503
+ this.logger.warn('Gemini CLI slash command queue is busy, retrying /directory add', {
504
+ sessionName,
505
+ projectPath,
506
+ attempt,
507
+ });
508
+ await delay(2000);
509
+ continue;
510
+ }
511
+ // Only accept explicit confirmation signals. Generic output changes
512
+ // are too noisy in Gemini's TUI and can produce false positives.
513
+ if ((hasConfirmation || alreadyAllowlistedAfterSend) && !stuckAtPrompt) {
297
514
  this.logger.info('Project added to Gemini CLI allowlist (verified)', {
298
515
  sessionName,
299
516
  projectPath,
300
517
  attempt,
301
- outputChanged,
302
518
  hasConfirmation,
519
+ alreadyAllowlistedAfterSend,
303
520
  });
304
521
  return {
305
522
  success: true,
@@ -335,19 +552,74 @@ export class GeminiRuntimeService extends RuntimeAgentService {
335
552
  message: `Failed to add project path to allowlist after ${maxAttempts} attempts`,
336
553
  };
337
554
  }
555
+ /**
556
+ * Heuristic to detect text that is still sitting in Gemini's input box.
557
+ * This indicates the message was typed but Enter was not processed.
558
+ */
559
+ isTextLikelyStuckAtPrompt(terminalOutput, message) {
560
+ if (!terminalOutput || !message)
561
+ return false;
562
+ const snippet = message.replace(/\s+/g, ' ').trim();
563
+ if (!snippet)
564
+ return false;
565
+ const bottomText = terminalOutput
566
+ .split('\n')
567
+ .slice(-15)
568
+ .join(' ')
569
+ .replace(/\s+/g, ' ')
570
+ .trim();
571
+ return bottomText.includes(snippet);
572
+ }
573
+ /**
574
+ * Detect whether Gemini CLI output indicates a path is already allowlisted.
575
+ */
576
+ isPathAlreadyAllowlisted(terminalOutput, projectPath) {
577
+ if (!terminalOutput || !projectPath)
578
+ return false;
579
+ const normalizedOutput = terminalOutput.replace(/\s+/g, ' ');
580
+ const normalizedPath = projectPath.replace(/\s+/g, ' ');
581
+ const hasAlreadyMarker = /already in (the )?workspace|already added|already allowed/i.test(normalizedOutput);
582
+ return hasAlreadyMarker && normalizedOutput.includes(normalizedPath);
583
+ }
338
584
  /**
339
585
  * Add multiple project paths to Gemini CLI allowlist
340
- * Efficiently adds all paths in sequence
586
+ * Attempts a single batched slash command first, then falls back to
587
+ * per-path commands for resiliency.
341
588
  */
342
589
  async addMultipleProjectsToAllowlist(sessionName, projectPaths) {
590
+ const uniqueProjectPaths = [...new Set(projectPaths)];
343
591
  const results = [];
344
592
  let successCount = 0;
345
593
  this.logger.info('Adding multiple projects to Gemini CLI allowlist', {
346
594
  sessionName,
347
- projectCount: projectPaths.length,
348
- projectPaths,
595
+ projectCount: uniqueProjectPaths.length,
596
+ projectPaths: uniqueProjectPaths,
349
597
  });
350
- for (const projectPath of projectPaths) {
598
+ // Fast path: Gemini CLI supports `/directory add path1,path2,...`.
599
+ // Use this first to avoid queueing many slash commands back-to-back.
600
+ if (uniqueProjectPaths.length > 1) {
601
+ const batchResult = await this.addProjectsToAllowlistBatch(sessionName, uniqueProjectPaths);
602
+ if (batchResult.success) {
603
+ for (const projectPath of uniqueProjectPaths) {
604
+ results.push({ path: projectPath, success: true });
605
+ }
606
+ successCount = uniqueProjectPaths.length;
607
+ this.logger.info('Completed adding multiple projects via batch command', {
608
+ sessionName,
609
+ totalProjects: uniqueProjectPaths.length,
610
+ });
611
+ return {
612
+ success: true,
613
+ message: `Added ${successCount}/${uniqueProjectPaths.length} projects to Gemini CLI allowlist`,
614
+ results,
615
+ };
616
+ }
617
+ this.logger.warn('Batch /directory add failed, falling back to per-path commands', {
618
+ sessionName,
619
+ reason: batchResult.message,
620
+ });
621
+ }
622
+ for (const projectPath of uniqueProjectPaths) {
351
623
  try {
352
624
  const result = await this.addProjectToAllowlist(sessionName, projectPath);
353
625
  if (result.success) {
@@ -370,15 +642,15 @@ export class GeminiRuntimeService extends RuntimeAgentService {
370
642
  error: errorMessage,
371
643
  });
372
644
  }
373
- // Small delay between commands
374
- await delay(500);
645
+ // Keep spacing between slash commands to reduce queue contention in Gemini CLI.
646
+ await delay(1500);
375
647
  }
376
- const message = `Added ${successCount}/${projectPaths.length} projects to Gemini CLI allowlist`;
648
+ const message = `Added ${successCount}/${uniqueProjectPaths.length} projects to Gemini CLI allowlist`;
377
649
  this.logger.info('Completed adding multiple projects to Gemini CLI allowlist', {
378
650
  sessionName,
379
- totalProjects: projectPaths.length,
651
+ totalProjects: uniqueProjectPaths.length,
380
652
  successCount,
381
- failureCount: projectPaths.length - successCount,
653
+ failureCount: uniqueProjectPaths.length - successCount,
382
654
  });
383
655
  return {
384
656
  success: successCount > 0,
@@ -386,5 +658,101 @@ export class GeminiRuntimeService extends RuntimeAgentService {
386
658
  results,
387
659
  };
388
660
  }
661
+ /**
662
+ * Send a single batched `/directory add` command with comma-separated paths.
663
+ */
664
+ async addProjectsToAllowlistBatch(sessionName, projectPaths) {
665
+ const maxAttempts = 2;
666
+ const commandPayload = projectPaths.join(',');
667
+ const batchCommand = `/directory add ${commandPayload} `;
668
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
669
+ try {
670
+ await this.sessionHelper.sendEnter(sessionName);
671
+ await delay(1000);
672
+ const beforeOutput = this.sessionHelper.capturePane(sessionName, 120);
673
+ const allAlreadyPresent = projectPaths.every((p) => this.isPathAlreadyAllowlisted(beforeOutput, p));
674
+ if (allAlreadyPresent) {
675
+ return {
676
+ success: true,
677
+ message: 'All paths are already in Gemini CLI workspace',
678
+ };
679
+ }
680
+ await this.sessionHelper.sendMessage(sessionName, batchCommand);
681
+ await delay(2500);
682
+ const afterOutput = this.sessionHelper.capturePane(sessionName, 120);
683
+ const hasQueueWarning = /slash commands cannot be queued/i.test(afterOutput);
684
+ const stuckAtPrompt = this.isTextLikelyStuckAtPrompt(afterOutput, batchCommand);
685
+ const hasConfirmation = /added|✓|success/i.test(afterOutput);
686
+ const allPresentAfter = projectPaths.every((p) => this.isPathAlreadyAllowlisted(afterOutput, p));
687
+ if (hasQueueWarning) {
688
+ await delay(2000);
689
+ continue;
690
+ }
691
+ if (stuckAtPrompt) {
692
+ await this.sessionHelper.sendEnter(sessionName);
693
+ await delay(500);
694
+ await this.sessionHelper.sendEnter(sessionName);
695
+ await delay(1500);
696
+ const recoveredOutput = this.sessionHelper.capturePane(sessionName, 120);
697
+ const recoveredConfirmation = /added|✓|success/i.test(recoveredOutput);
698
+ const recoveredAllPresent = projectPaths.every((p) => this.isPathAlreadyAllowlisted(recoveredOutput, p));
699
+ const stillStuck = this.isTextLikelyStuckAtPrompt(recoveredOutput, batchCommand);
700
+ if ((recoveredConfirmation || recoveredAllPresent) && !stillStuck) {
701
+ return { success: true, message: 'Batch directory add command succeeded' };
702
+ }
703
+ }
704
+ if ((hasConfirmation || allPresentAfter) && !stuckAtPrompt) {
705
+ return { success: true, message: 'Batch directory add command succeeded' };
706
+ }
707
+ }
708
+ catch (error) {
709
+ if (attempt === maxAttempts) {
710
+ return {
711
+ success: false,
712
+ message: error instanceof Error ? error.message : String(error),
713
+ };
714
+ }
715
+ }
716
+ }
717
+ return {
718
+ success: false,
719
+ message: 'Batch directory add command not confirmed',
720
+ };
721
+ }
722
+ /**
723
+ * Wait until Gemini's slash-command queue is idle and the prompt is ready
724
+ * for normal text input.
725
+ */
726
+ async waitForSlashQueueToDrain(sessionName) {
727
+ const maxChecks = 8;
728
+ for (let check = 1; check <= maxChecks; check++) {
729
+ const output = this.sessionHelper.capturePane(sessionName, 120);
730
+ const hasQueueWarning = /slash commands cannot be queued/i.test(output);
731
+ const hasReadyPrompt = this.getRuntimeReadyPatterns().some((pattern) => output.includes(pattern));
732
+ const addCommandStuck = this.isTextLikelyStuckAtPrompt(output, '/directory add');
733
+ if (hasReadyPrompt && !hasQueueWarning && !addCommandStuck) {
734
+ this.logger.debug('Gemini slash command queue appears idle', {
735
+ sessionName,
736
+ check,
737
+ });
738
+ return;
739
+ }
740
+ // If command text still sits in the input box, submit/clear it so the
741
+ // next non-slash instruction is not appended to the same line.
742
+ if (addCommandStuck || hasQueueWarning) {
743
+ this.logger.debug('Gemini slash queue not idle yet, nudging prompt with Enter', {
744
+ sessionName,
745
+ check,
746
+ hasQueueWarning,
747
+ addCommandStuck,
748
+ });
749
+ await this.sessionHelper.sendEnter(sessionName);
750
+ }
751
+ await delay(1000);
752
+ }
753
+ this.logger.warn('Timed out waiting for Gemini slash queue to drain (continuing anyway)', {
754
+ sessionName,
755
+ });
756
+ }
389
757
  }
390
758
  //# sourceMappingURL=gemini-runtime.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gemini-runtime.service.js","sourceRoot":"","sources":["../../../../../../backend/src/services/agent/gemini-runtime.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EA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M,CAAC,KAAK,CAAC,CAAC;gBAC5E,OAAO,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,KAAK;oBACd,KAAK,EAAE,YAAY;iBACnB,CAAC,CAAC;YACJ,CAAC;YAED,+BAA+B;YAC/B,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;QAED,MAAM,OAAO,GAAG,SAAS,YAAY,IAAI,YAAY,CAAC,MAAM,mCAAmC,CAAC;QAEhG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4DAA4D,EAAE;YAC9E,WAAW;YACX,aAAa,EAAE,YAAY,CAAC,MAAM;YAClC,YAAY;YACZ,YAAY,EAAE,YAAY,CAAC,MAAM,GAAG,YAAY;SAChD,CAAC,CAAC;QAEH,OAAO;YACN,OAAO,EAAE,YAAY,GAAG,CAAC;YACzB,OAAO;YACP,OAAO;SACP,CAAC;IACH,CAAC;CACD"}
1
+ {"version":3,"file":"gemini-runtime.service.js","sourceRoot":"","sources":["../../../../../../backend/src/services/agent/gemini-runtime.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,IAAI,CAAC;AAC5C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,uBAAuB,EAAoB,MAAM,oBAAoB,CAAC;AAChH,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAEnD;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IAC5D,YAAY,aAAmC,EAAE,WAAmB;QACnE,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,mBAAmB,CACxB,WAAmB,EACnB,OAA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ACtE,+DAA+D;YAC/D,IAAI,eAAe,IAAI,eAAe,EAAE,CAAC;gBACxC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4DAA4D,EAAE;oBAC/E,WAAW;oBACX,KAAK;oBACL,eAAe;oBACf,eAAe;iBACf,CAAC,CAAC;gBACH,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACjD,CAAC;YAED,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uEAAuE,EAAE;YACzF,WAAW;SACX,CAAC,CAAC;IACJ,CAAC;CACD"}
@@ -70,7 +70,7 @@ export declare abstract class RuntimeAgentService {
70
70
  * @param targetProjectPath - Optional target project path for the agent (where MCP configs should be written).
71
71
  * Falls back to this.projectRoot if not provided.
72
72
  */
73
- postInitialize(sessionName: string, targetProjectPath?: string): Promise<void>;
73
+ postInitialize(sessionName: string, targetProjectPath?: string, additionalAllowlistPaths?: string[]): Promise<void>;
74
74
  /**
75
75
  * Clear cached detection results for a session
76
76
  */
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-agent.service.abstract.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/agent/runtime-agent.service.abstract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,8BAAsB,mBAAmB;IACxC,SAAS,CAAC,MAAM,EAAE,eAAe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E,MAAM,GAAG,IAAI;IAU9C;;OAEG;IACH,uBAAuB,IAAI,aAAa,GAAG,IAAI;IAM/C;;;;;;;;;;;;;;;;OAgBG;cACa,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwE3F;;OAEG;YACW,uBAAuB;IA4BrC;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;IAgB3C;;OAEG;cACa,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAYrE;;OAEG;cACa,0BAA0B,CACzC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;CA0BhB"}
1
+ {"version":3,"file":"runtime-agent.service.abstract.d.ts","sourceRoot":"","sources":["../../../../../../backend/src/services/agent/runtime-agent.service.abstract.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,8BAAsB,mBAAmB;IACxC,SAAS,CAAC,MAAM,EAAE,eAAe,CAAC;IAClC,SAAS,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAC9C,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAQ;IAGrD,OAAO,CAAC,mBAAmB,CAAm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WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwE3F;;OAEG;YACW,uBAAuB;IA4BrC;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;IAgB3C;;OAEG;cACa,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAYrE;;OAEG;cACa,0BAA0B,CACzC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAAE,EAClB,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC;CA0BhB"}
@@ -284,7 +284,7 @@ export class RuntimeAgentService {
284
284
  * @param targetProjectPath - Optional target project path for the agent (where MCP configs should be written).
285
285
  * Falls back to this.projectRoot if not provided.
286
286
  */
287
- async postInitialize(sessionName, targetProjectPath) {
287
+ async postInitialize(sessionName, targetProjectPath, additionalAllowlistPaths) {
288
288
  // No-op by default — override in concrete classes
289
289
  this.logger.debug('postInitialize (no-op)', { sessionName, runtimeType: this.getRuntimeType() });
290
290
  }