vigthoria-cli 1.11.3 → 1.11.4

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.
@@ -149,6 +149,8 @@ export declare class ChatCommand {
149
149
  private runOperatorDirectAnswer;
150
150
  private runSimplePrompt;
151
151
  private runAgentTurn;
152
+ private buildLocalLoopLiveOutcome;
153
+ private persistLocalLoopOutcome;
152
154
  private runLocalAgentLoop;
153
155
  private primeBypassedTargetFileContext;
154
156
  private tryDirectSingleFileFlow;
@@ -1940,6 +1940,42 @@ export class ChatCommand {
1940
1940
  }
1941
1941
  await this.runLocalAgentLoop(prompt);
1942
1942
  }
1943
+ buildLocalLoopLiveOutcome(prompt) {
1944
+ const liveOutcome = createLiveOutcome();
1945
+ liveOutcome.requiresWorkspaceChanges = this.taskRequiresWorkspaceChanges(prompt);
1946
+ liveOutcome.analysisToolsUsed = this.agentToolEvidence.discovery;
1947
+ liveOutcome.changedFileCount = this.agentToolEvidence.mutation;
1948
+ liveOutcome.workspaceHasOutput = this.agentToolEvidence.mutation > 0;
1949
+ if (this.agentToolEvidence.searchFailed > 0 && this.agentToolEvidence.discovery === 0) {
1950
+ liveOutcome.executorFailed = true;
1951
+ liveOutcome.executorError = 'Search tools failed before gathering workspace evidence';
1952
+ }
1953
+ return liveOutcome;
1954
+ }
1955
+ persistLocalLoopOutcome(prompt, evaluation, liveOutcome) {
1956
+ this.lastAgentRunOutcome = {
1957
+ prompt,
1958
+ taskId: null,
1959
+ contextId: null,
1960
+ tasksSucceeded: liveOutcome.tasksSucceeded,
1961
+ tasksTotal: liveOutcome.tasksTotal,
1962
+ failedTaskIds: [...liveOutcome.failedTaskIds],
1963
+ unfinishedTaskIds: [],
1964
+ qualityScore: null,
1965
+ qualityMissing: [],
1966
+ qualityBlockers: evaluation.executorSucceeded ? [] : [evaluation.statusHeadline],
1967
+ hasOutput: liveOutcome.workspaceHasOutput,
1968
+ selfHealStatus: 'skipped',
1969
+ selfHealTool: null,
1970
+ plannerError: null,
1971
+ executorError: liveOutcome.executorError,
1972
+ clientToolErrors: [],
1973
+ transportErrors: [],
1974
+ workspacePath: this.currentProjectPath || null,
1975
+ workspaceSyncIssue: null,
1976
+ finishedAt: Date.now(),
1977
+ };
1978
+ }
1943
1979
  async runLocalAgentLoop(prompt) {
1944
1980
  if (!this.tools) {
1945
1981
  throw new Error('Agent tools are not initialized.');
@@ -1975,14 +2011,26 @@ export class ChatCommand {
1975
2011
  const evidenceSummary = this.synthesizeEvidenceFromHistory();
1976
2012
  if (evidenceSummary) {
1977
2013
  const fallbackContent = this.sanitizeDirectModeOutput(evidenceSummary);
2014
+ const liveOutcome = this.buildLocalLoopLiveOutcome(prompt);
2015
+ const evaluation = evaluateExecutorSuccess(liveOutcome);
2016
+ this.persistLocalLoopOutcome(prompt, evaluation, liveOutcome);
1978
2017
  if (this.jsonOutput) {
2018
+ process.exitCode = evaluation.executorSucceeded ? 0 : 1;
1979
2019
  console.log(JSON.stringify({
1980
- success: true,
2020
+ success: evaluation.executorSucceeded,
1981
2021
  mode: 'agent',
1982
2022
  model: this.currentModel,
1983
- partial: true,
2023
+ partial: !evaluation.executorSucceeded,
1984
2024
  content: fallbackContent,
1985
- metadata: { executionPath: 'local-agent-loop', recovered: true },
2025
+ statusHeadline: evaluation.statusHeadline,
2026
+ metadata: {
2027
+ executionPath: 'local-agent-loop',
2028
+ recovered: true,
2029
+ outcomeTruth: {
2030
+ executorSucceeded: evaluation.executorSucceeded,
2031
+ uiTheme: evaluation.uiTheme,
2032
+ },
2033
+ },
1986
2034
  }, null, 2));
1987
2035
  }
1988
2036
  else {
@@ -2078,15 +2126,26 @@ export class ChatCommand {
2078
2126
  continue;
2079
2127
  }
2080
2128
  const finalContent = this.resolveDirectModeCompletion(prompt, visibleText);
2129
+ const liveOutcome = this.buildLocalLoopLiveOutcome(prompt);
2130
+ const evaluation = evaluateExecutorSuccess(liveOutcome);
2131
+ this.persistLocalLoopOutcome(prompt, evaluation, liveOutcome);
2081
2132
  if (this.jsonOutput) {
2133
+ process.exitCode = evaluation.executorSucceeded ? 0 : 1;
2082
2134
  console.log(JSON.stringify({
2083
- success: true,
2135
+ success: evaluation.executorSucceeded,
2084
2136
  mode: 'agent',
2085
2137
  model: this.currentModel,
2086
- partial: false,
2138
+ partial: !evaluation.executorSucceeded,
2087
2139
  content: finalContent,
2140
+ statusHeadline: evaluation.statusHeadline,
2088
2141
  metadata: {
2089
2142
  executionPath: 'local-agent-loop',
2143
+ outcomeTruth: {
2144
+ executorSucceeded: evaluation.executorSucceeded,
2145
+ uiTheme: evaluation.uiTheme,
2146
+ analysisToolsUsed: liveOutcome.analysisToolsUsed,
2147
+ changedFileCount: liveOutcome.changedFileCount,
2148
+ },
2090
2149
  },
2091
2150
  }, null, 2));
2092
2151
  }
@@ -2131,6 +2190,13 @@ export class ChatCommand {
2131
2190
  return;
2132
2191
  }
2133
2192
  }
2193
+ const liveOutcome = this.buildLocalLoopLiveOutcome(prompt);
2194
+ const exhaustedEval = evaluateExecutorSuccess({
2195
+ ...liveOutcome,
2196
+ executorFailed: true,
2197
+ executorError: 'Agent exhausted the maximum local tool loop turns before reaching a clean completion.',
2198
+ });
2199
+ this.persistLocalLoopOutcome(prompt, exhaustedEval, liveOutcome);
2134
2200
  if (this.jsonOutput) {
2135
2201
  process.exitCode = 1;
2136
2202
  console.log(JSON.stringify({
@@ -2140,8 +2206,13 @@ export class ChatCommand {
2140
2206
  partial: true,
2141
2207
  content: 'Task complete.',
2142
2208
  error: 'Agent exhausted the maximum local tool loop turns before reaching a clean completion.',
2209
+ statusHeadline: exhaustedEval.statusHeadline,
2143
2210
  metadata: {
2144
2211
  executionPath: 'local-agent-loop',
2212
+ outcomeTruth: {
2213
+ executorSucceeded: false,
2214
+ uiTheme: exhaustedEval.uiTheme,
2215
+ },
2145
2216
  },
2146
2217
  }, null, 2));
2147
2218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigthoria-cli",
3
- "version": "1.11.3",
3
+ "version": "1.11.4",
4
4
  "description": "Vigthoria Coder CLI - AI-powered terminal coding assistant",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",