vigthoria-cli 1.6.46 → 1.6.48

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.
@@ -678,7 +678,9 @@ class ChatCommand {
678
678
  return false;
679
679
  }
680
680
  async handleDirectPrompt(prompt) {
681
- if (!this.jsonOutput) {
681
+ // Suppress all setup banners in direct-prompt mode so only the final
682
+ // answer reaches stdout. Interactive (REPL) mode still shows them.
683
+ if (!this.jsonOutput && !this.directPromptMode) {
682
684
  console.log(chalk_1.default.cyan('Running single prompt in direct mode.'));
683
685
  console.log(chalk_1.default.gray(`Model: ${this.currentModel}`));
684
686
  console.log(chalk_1.default.gray(`Project: ${this.currentProjectPath}`));
@@ -1303,12 +1305,12 @@ class ChatCommand {
1303
1305
  tool: 'read_file',
1304
1306
  args: { path: targetFile },
1305
1307
  };
1306
- if (!this.jsonOutput) {
1308
+ if (!this.jsonOutput && !this.directPromptMode) {
1307
1309
  console.log(chalk_1.default.cyan(`⚙ Executing: ${readCall.tool}`));
1308
1310
  }
1309
1311
  const readResult = await this.tools.execute(readCall);
1310
1312
  const readSummary = this.formatToolResult(readCall, readResult);
1311
- if (!this.jsonOutput) {
1313
+ if (!this.jsonOutput && !this.directPromptMode) {
1312
1314
  console.log(readResult.success ? chalk_1.default.gray(readSummary) : chalk_1.default.red(readSummary));
1313
1315
  }
1314
1316
  this.messages.push({ role: 'system', content: readSummary });
@@ -1351,12 +1353,12 @@ class ChatCommand {
1351
1353
  content: rewrittenContent,
1352
1354
  },
1353
1355
  };
1354
- if (!this.jsonOutput) {
1356
+ if (!this.jsonOutput && !this.directPromptMode) {
1355
1357
  console.log(chalk_1.default.cyan(`⚙ Executing: ${writeCall.tool}`));
1356
1358
  }
1357
1359
  const writeResult = await this.tools.execute(writeCall);
1358
1360
  const writeSummary = this.formatToolResult(writeCall, writeResult);
1359
- if (!this.jsonOutput) {
1361
+ if (!this.jsonOutput && !this.directPromptMode) {
1360
1362
  console.log(writeResult.success ? chalk_1.default.gray(writeSummary) : chalk_1.default.red(writeSummary));
1361
1363
  }
1362
1364
  this.messages.push({ role: 'system', content: writeSummary });
@@ -1503,14 +1505,18 @@ class ChatCommand {
1503
1505
  }, null, 2));
1504
1506
  }
1505
1507
  else if (response.content) {
1506
- console.log(chalk_1.default.gray(`Agent routing: ${routingPolicy.cloudSelected ? 'Vigthoria Cloud' : 'V3 Agent'} via model ${routingPolicy.selectedModel}`));
1508
+ if (!this.directPromptMode) {
1509
+ console.log(chalk_1.default.gray(`Agent routing: ${routingPolicy.cloudSelected ? 'Vigthoria Cloud' : 'V3 Agent'} via model ${routingPolicy.selectedModel}`));
1510
+ }
1507
1511
  console.log(response.content);
1508
1512
  }
1509
1513
  else {
1510
- console.log(chalk_1.default.gray(`Agent routing: ${routingPolicy.cloudSelected ? 'Vigthoria Cloud' : 'V3 Agent'} via model ${routingPolicy.selectedModel}`));
1514
+ if (!this.directPromptMode) {
1515
+ console.log(chalk_1.default.gray(`Agent routing: ${routingPolicy.cloudSelected ? 'Vigthoria Cloud' : 'V3 Agent'} via model ${routingPolicy.selectedModel}`));
1516
+ }
1511
1517
  console.log('V3 agent workflow completed.');
1512
1518
  }
1513
- if (!this.jsonOutput && previewGate?.required) {
1519
+ if (!this.jsonOutput && !this.directPromptMode && previewGate?.required) {
1514
1520
  if (previewGate.passed) {
1515
1521
  console.log(chalk_1.default.gray(`Template Service preview gate: passed via ${previewGate.backendUrl || 'unknown backend'}`));
1516
1522
  }
@@ -2324,8 +2330,11 @@ class ChatCommand {
2324
2330
  if (!this.tools) {
2325
2331
  throw new Error('Agent tools are not initialized.');
2326
2332
  }
2333
+ // In direct-prompt mode (--prompt), suppress verbose tool output so
2334
+ // only the final answer prints. In interactive mode, show full detail.
2335
+ const verbose = !this.jsonOutput && !this.directPromptMode;
2327
2336
  for (const call of toolCalls) {
2328
- if (!this.jsonOutput) {
2337
+ if (verbose) {
2329
2338
  console.log(chalk_1.default.cyan(`⚙ Executing: ${call.tool}`));
2330
2339
  }
2331
2340
  (0, bridge_client_js_1.getBridgeClient)()?.emitToolCall({ tool: call.tool, args: call.args });
@@ -2333,7 +2342,7 @@ class ChatCommand {
2333
2342
  // Phase 2: If a search tool failed (search_failed), retry with alternate approach
2334
2343
  const searchStatus = result.metadata?.searchStatus;
2335
2344
  if (call.tool === 'grep' && searchStatus === 'search_failed') {
2336
- if (!this.jsonOutput) {
2345
+ if (verbose) {
2337
2346
  console.log(chalk_1.default.yellow(`⚠ Search backend failed, retrying with alternate method...`));
2338
2347
  }
2339
2348
  // Force Node-native fallback by re-executing with a note
@@ -2346,7 +2355,7 @@ class ChatCommand {
2346
2355
  }
2347
2356
  }
2348
2357
  const summary = this.formatToolResult(call, result);
2349
- if (!this.jsonOutput) {
2358
+ if (verbose) {
2350
2359
  console.log(result.success ? chalk_1.default.gray(summary) : chalk_1.default.red(summary));
2351
2360
  }
2352
2361
  this.messages.push({ role: 'system', content: summary });
package/dist/index.js CHANGED
@@ -155,6 +155,7 @@ async function main() {
155
155
  const invokedBinaryName = getInvokedBinaryName();
156
156
  const firstArg = process.argv[2];
157
157
  const jsonOutputRequested = process.argv.includes('--json');
158
+ const directPromptRequested = process.argv.includes('--prompt') || process.argv.includes('-P');
158
159
  if (invokedBinaryName === 'vigthoria-chat') {
159
160
  const knownCommands = new Set([
160
161
  'chat', 'chat-resume', 'agent', 'edit', 'generate', 'explain', 'fix', 'review',
@@ -172,7 +173,7 @@ async function main() {
172
173
  // Calculate padding for centering
173
174
  const titlePad = Math.floor((boxWidth - 4 - titleText.length) / 2);
174
175
  const versionPad = Math.floor((boxWidth - 4 - versionText.length) / 2);
175
- if (process.env.VIGTHORIA_NO_BANNER !== '1' && !jsonOutputRequested) {
176
+ if (process.env.VIGTHORIA_NO_BANNER !== '1' && !jsonOutputRequested && !directPromptRequested) {
176
177
  console.log(chalk_1.default.cyan(logger_js_1.CH.dTl + logger_js_1.CH.dH.repeat(boxWidth) + logger_js_1.CH.dTr));
177
178
  console.log(chalk_1.default.cyan(logger_js_1.CH.dV + ' '.repeat(boxWidth) + logger_js_1.CH.dV));
178
179
  console.log(chalk_1.default.cyan(logger_js_1.CH.dV) + ' '.repeat(titlePad) + chalk_1.default.bold.white('VIGTHORIA CLI') + chalk_1.default.cyan(' - AI-Powered Coding Assistant') + ' '.repeat(boxWidth - titlePad - titleText.length) + chalk_1.default.cyan(logger_js_1.CH.dV));
@@ -182,7 +183,7 @@ async function main() {
182
183
  console.log();
183
184
  }
184
185
  // Check for updates in background (don't wait)
185
- if (process.env.VIGTHORIA_NO_UPDATE_CHECK !== '1' && !jsonOutputRequested) {
186
+ if (process.env.VIGTHORIA_NO_UPDATE_CHECK !== '1' && !jsonOutputRequested && !directPromptRequested) {
186
187
  checkForUpdatesQuietly();
187
188
  }
188
189
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigthoria-cli",
3
- "version": "1.6.46",
3
+ "version": "1.6.48",
4
4
  "description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
5
5
  "main": "dist/index.js",
6
6
  "files": [