vigthoria-cli 1.13.18 → 1.13.22

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 (185) hide show
  1. package/completions/_vigthoria +49 -0
  2. package/completions/vigthoria.bash +6 -0
  3. package/completions/vigthoria.fish +41 -0
  4. package/dist/commands/auth.d.ts +1 -0
  5. package/dist/commands/auth.js +84 -135
  6. package/dist/commands/background.d.ts +0 -2
  7. package/dist/commands/background.js +26 -34
  8. package/dist/commands/bridge.js +45 -41
  9. package/dist/commands/cancel.d.ts +1 -0
  10. package/dist/commands/cancel.js +22 -16
  11. package/dist/commands/chat.d.ts +5 -42
  12. package/dist/commands/chat.js +462 -1122
  13. package/dist/commands/coding-registration.d.ts +4 -0
  14. package/dist/commands/coding-registration.js +24 -0
  15. package/dist/commands/config.js +32 -42
  16. package/dist/commands/conversation-registration.d.ts +4 -0
  17. package/dist/commands/conversation-registration.js +122 -0
  18. package/dist/commands/deploy.d.ts +8 -2
  19. package/dist/commands/deploy.js +92 -90
  20. package/dist/commands/device.d.ts +1 -2
  21. package/dist/commands/device.js +37 -21
  22. package/dist/commands/doctor-registration.d.ts +4 -0
  23. package/dist/commands/doctor-registration.js +200 -0
  24. package/dist/commands/edit.js +22 -33
  25. package/dist/commands/explain.js +7 -10
  26. package/dist/commands/fork.d.ts +1 -2
  27. package/dist/commands/fork.js +72 -22
  28. package/dist/commands/game.d.ts +1 -1
  29. package/dist/commands/game.js +17 -6
  30. package/dist/commands/generate.js +7 -9
  31. package/dist/commands/history.js +11 -7
  32. package/dist/commands/hub.d.ts +2 -2
  33. package/dist/commands/hub.js +34 -35
  34. package/dist/commands/legion.d.ts +0 -1
  35. package/dist/commands/legion.js +62 -79
  36. package/dist/commands/music.d.ts +1 -2
  37. package/dist/commands/music.js +62 -27
  38. package/dist/commands/platform-registration.d.ts +4 -0
  39. package/dist/commands/platform-registration.js +45 -0
  40. package/dist/commands/preview.d.ts +0 -1
  41. package/dist/commands/preview.js +82 -35
  42. package/dist/commands/product-run-registration.d.ts +4 -0
  43. package/dist/commands/product-run-registration.js +490 -0
  44. package/dist/commands/replay.d.ts +1 -2
  45. package/dist/commands/replay.js +15 -11
  46. package/dist/commands/repo.d.ts +14 -7
  47. package/dist/commands/repo.js +245 -196
  48. package/dist/commands/review.js +9 -12
  49. package/dist/commands/security.d.ts +1 -2
  50. package/dist/commands/security.js +12 -6
  51. package/dist/commands/update-registration.d.ts +3 -0
  52. package/dist/commands/update-registration.js +338 -0
  53. package/dist/commands/v4-registration.d.ts +4 -0
  54. package/dist/commands/v4-registration.js +24 -0
  55. package/dist/commands/v4.d.ts +1 -1
  56. package/dist/commands/v4.js +46 -8
  57. package/dist/commands/wallet.d.ts +1 -3
  58. package/dist/commands/wallet.js +18 -45
  59. package/dist/commands/workflow.d.ts +2 -0
  60. package/dist/commands/workflow.js +52 -39
  61. package/dist/index.js +122 -1498
  62. package/dist/utils/agent-stream-state.d.ts +27 -0
  63. package/dist/utils/agent-stream-state.js +93 -0
  64. package/dist/utils/agentRoute.d.ts +2 -1
  65. package/dist/utils/agentRoute.js +22 -9
  66. package/dist/utils/agentRunOutcome.d.ts +16 -0
  67. package/dist/utils/agentRunOutcome.js +37 -2
  68. package/dist/utils/api-client-factory.d.ts +8 -0
  69. package/dist/utils/api-client-factory.js +8 -0
  70. package/dist/utils/api.d.ts +45 -269
  71. package/dist/utils/api.js +664 -3210
  72. package/dist/utils/auth-session.d.ts +41 -0
  73. package/dist/utils/auth-session.js +224 -0
  74. package/dist/utils/brain-hub-client.d.ts +0 -4
  75. package/dist/utils/brain-hub-client.js +6 -3
  76. package/dist/utils/bridge-client.js +2 -0
  77. package/dist/utils/capability-health-service.d.ts +48 -0
  78. package/dist/utils/capability-health-service.js +64 -0
  79. package/dist/utils/chat-prompt-policy.d.ts +18 -0
  80. package/dist/utils/chat-prompt-policy.js +61 -0
  81. package/dist/utils/chat-tool-call-parser.d.ts +11 -0
  82. package/dist/utils/chat-tool-call-parser.js +71 -0
  83. package/dist/utils/cli-state.d.ts +22 -4
  84. package/dist/utils/cli-state.js +105 -47
  85. package/dist/utils/code-operations-service.d.ts +104 -0
  86. package/dist/utils/code-operations-service.js +837 -0
  87. package/dist/utils/codebase-indexer.d.ts +1 -0
  88. package/dist/utils/codebase-indexer.js +28 -8
  89. package/dist/utils/command-contract.d.ts +61 -0
  90. package/dist/utils/command-contract.js +149 -0
  91. package/dist/utils/command-policy.d.ts +10 -0
  92. package/dist/utils/command-policy.js +54 -0
  93. package/dist/utils/config.d.ts +13 -5
  94. package/dist/utils/config.js +227 -99
  95. package/dist/utils/context-ranker.js +11 -2
  96. package/dist/utils/context-state.d.ts +39 -0
  97. package/dist/utils/context-state.js +52 -0
  98. package/dist/utils/deckEvents.d.ts +0 -5
  99. package/dist/utils/deckEvents.js +3 -2
  100. package/dist/utils/desktop-bridge-client.js +2 -0
  101. package/dist/utils/direct-output-policy.d.ts +3 -0
  102. package/dist/utils/direct-output-policy.js +76 -0
  103. package/dist/utils/durable-json.d.ts +57 -0
  104. package/dist/utils/durable-json.js +319 -0
  105. package/dist/utils/fastAgentRouter.d.ts +6 -7
  106. package/dist/utils/fastAgentRouter.js +21 -30
  107. package/dist/utils/files.js +21 -13
  108. package/dist/utils/frontend-preview-service.d.ts +76 -0
  109. package/dist/utils/frontend-preview-service.js +482 -0
  110. package/dist/utils/goaEvents.d.ts +0 -4
  111. package/dist/utils/goaEvents.js +5 -2
  112. package/dist/utils/logger.d.ts +2 -1
  113. package/dist/utils/logger.js +27 -20
  114. package/dist/utils/mcp-context-client.d.ts +24 -0
  115. package/dist/utils/mcp-context-client.js +58 -0
  116. package/dist/utils/model-governance.d.ts +18 -0
  117. package/dist/utils/model-governance.js +75 -0
  118. package/dist/utils/model-transport-service.d.ts +44 -0
  119. package/dist/utils/model-transport-service.js +111 -0
  120. package/dist/utils/mutation-journal.d.ts +42 -0
  121. package/dist/utils/mutation-journal.js +387 -0
  122. package/dist/utils/network-policy.d.ts +24 -0
  123. package/dist/utils/network-policy.js +202 -0
  124. package/dist/utils/operator-client.d.ts +45 -0
  125. package/dist/utils/operator-client.js +159 -0
  126. package/dist/utils/post-write-validator.js +7 -9
  127. package/dist/utils/preview-screenshot-adapter.d.ts +13 -0
  128. package/dist/utils/preview-screenshot-adapter.js +36 -0
  129. package/dist/utils/process-policy.d.ts +23 -0
  130. package/dist/utils/process-policy.js +284 -0
  131. package/dist/utils/project-memory.d.ts +13 -3
  132. package/dist/utils/project-memory.js +70 -17
  133. package/dist/utils/prompt-workspace-resolver.d.ts +14 -0
  134. package/dist/utils/prompt-workspace-resolver.js +64 -0
  135. package/dist/utils/release-install.d.ts +11 -0
  136. package/dist/utils/release-install.js +155 -0
  137. package/dist/utils/release-policy.d.ts +64 -0
  138. package/dist/utils/release-policy.js +293 -0
  139. package/dist/utils/requestIntent.js +22 -3
  140. package/dist/utils/runtime-capability.d.ts +8 -0
  141. package/dist/utils/runtime-capability.js +16 -0
  142. package/dist/utils/secret-policy.d.ts +20 -0
  143. package/dist/utils/secret-policy.js +160 -0
  144. package/dist/utils/session.d.ts +34 -2
  145. package/dist/utils/session.js +354 -110
  146. package/dist/utils/tool-approval-service.d.ts +17 -0
  147. package/dist/utils/tool-approval-service.js +78 -0
  148. package/dist/utils/tool-capability-providers.d.ts +57 -0
  149. package/dist/utils/tool-capability-providers.js +57 -0
  150. package/dist/utils/tools.d.ts +2 -23
  151. package/dist/utils/tools.js +216 -508
  152. package/dist/utils/update-policy.d.ts +18 -0
  153. package/dist/utils/update-policy.js +137 -0
  154. package/dist/utils/v3-agent-client.d.ts +40 -0
  155. package/dist/utils/v3-agent-client.js +165 -0
  156. package/dist/utils/v3-workspace-service.d.ts +28 -0
  157. package/dist/utils/v3-workspace-service.js +279 -0
  158. package/dist/utils/vigflow-client.d.ts +95 -0
  159. package/dist/utils/vigflow-client.js +105 -0
  160. package/dist/utils/workspace-boundary.d.ts +45 -0
  161. package/dist/utils/workspace-boundary.js +377 -0
  162. package/dist/utils/workspace-brain-service.d.ts +2 -0
  163. package/dist/utils/workspace-brain-service.js +11 -1
  164. package/dist/utils/workspace-cache.js +37 -15
  165. package/dist/utils/workspace-stream.js +35 -10
  166. package/install.ps1 +86 -143
  167. package/install.sh +76 -81
  168. package/package.json +44 -9
  169. package/release-policy.json +43 -0
  170. package/scripts/release/LOCAL_MACHINE_USER_VERIFICATION.md +1 -1
  171. package/scripts/release/generate-completions.mjs +24 -0
  172. package/scripts/release/install-release.mjs +10 -0
  173. package/scripts/release/publish-cli-release.mjs +116 -0
  174. package/scripts/release/publish-cli-release.sh +2 -70
  175. package/scripts/release/resolve-release-manifest.mjs +26 -0
  176. package/scripts/release/test-balanced-model-live.sh +42 -0
  177. package/scripts/release/validate-live-service-gates.sh +90 -0
  178. package/scripts/release/validate-no-go-gates.sh +135 -172
  179. package/scripts/release/verify-runtime-consistency.mjs +4 -1
  180. package/dist/commands/index.d.ts +0 -12
  181. package/dist/commands/index.js +0 -194
  182. package/dist/commands/update.d.ts +0 -9
  183. package/dist/commands/update.js +0 -301
  184. package/dist/utils/templateInstantPath.d.ts +0 -18
  185. package/dist/utils/templateInstantPath.js +0 -228
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ import type { Config } from '../utils/config.js';
3
+ import type { Logger } from '../utils/logger.js';
4
+ export declare function registerCodingCommands(program: Command, config: Config, logger: Logger): void;
@@ -0,0 +1,24 @@
1
+ import { EditCommand } from './edit.js';
2
+ import { ExplainCommand } from './explain.js';
3
+ import { GenerateCommand } from './generate.js';
4
+ import { ReviewCommand } from './review.js';
5
+ export function registerCodingCommands(program, config, logger) {
6
+ program.command('edit <file>').alias('e').description('Edit a file with AI assistance')
7
+ .option('-i, --instruction <text>', 'Editing instruction').option('-m, --model <model>', 'Select AI model', 'code')
8
+ .option('--apply', 'Automatically apply changes without confirmation', false)
9
+ .action(async (file, options) => new EditCommand(config, logger).run(file, options));
10
+ program.command('generate <description>').alias('g').description('Generate code from description')
11
+ .option('-l, --language <lang>', 'Target language (auto-detected from description, or specify: javascript, typescript, python, html, etc.)')
12
+ .option('-o, --output <file>', 'Output file path').option('-m, --model <model>', 'Select AI model', 'code')
13
+ .option('-p, --pro', 'Senior Developer Mode: plan, generate, quality check (recommended)', false)
14
+ .action(async (description, options) => new GenerateCommand(config, logger).run(description, options));
15
+ program.command('explain <file>').alias('x').description('Explain code in a file')
16
+ .option('-l, --lines <range>', 'Line range (e.g., 1-50)').option('-d, --detail <level>', 'Detail level (brief, normal, detailed)', 'normal')
17
+ .action(async (file, options) => new ExplainCommand(config, logger).run(file, options));
18
+ program.command('fix <file>').alias('f').description('Fix issues in a file')
19
+ .option('-t, --type <type>', 'Fix type (bugs, style, security, performance)', 'bugs').option('--apply', 'Automatically apply fixes', false)
20
+ .action(async (file, options) => new EditCommand(config, logger).fix(file, options));
21
+ program.command('review <file>').alias('r').description('Review code quality')
22
+ .option('-f, --format <format>', 'Output format (text, json, markdown)', 'text')
23
+ .action(async (file, options) => new ReviewCommand(config, logger).run(file, options));
24
+ }
@@ -6,7 +6,9 @@ import inquirer from 'inquirer';
6
6
  import * as fs from 'fs';
7
7
  import * as path from 'path';
8
8
  import { normalizePersonaMode } from '../utils/persona.js';
9
+ import { assertTrustedEndpoint, assertTrustedWebSocketEndpoint } from '../utils/network-policy.js';
9
10
  import { CH } from '../utils/logger.js';
11
+ import { CliCommandError } from '../utils/command-contract.js';
10
12
  export class ConfigCommand {
11
13
  config;
12
14
  logger;
@@ -40,7 +42,7 @@ export class ConfigCommand {
40
42
  console.log();
41
43
  const cwd = process.cwd();
42
44
  const configFile = path.join(cwd, '.vigthoria.json');
43
- const allowedModels = new Set(['code', 'code-35b', 'code-9b', 'balanced', 'balanced-4b']);
45
+ const allowedModels = new Set(['architect', 'code', 'assistant', 'code-35b', 'code-9b', 'balanced', 'balanced-4b']);
44
46
  const hasOverrides = Boolean(options.model ||
45
47
  options.ignorePatterns !== undefined ||
46
48
  options.autoApplyFixes !== undefined ||
@@ -49,8 +51,9 @@ export class ConfigCommand {
49
51
  if (fs.existsSync(configFile)) {
50
52
  if (nonInteractive) {
51
53
  if (!options.yes) {
52
- this.logger.error('.vigthoria.json already exists. Re-run with --yes to overwrite in non-interactive mode.');
53
- return;
54
+ throw new CliCommandError('.vigthoria.json already exists. Re-run with --yes to overwrite in non-interactive mode.', {
55
+ code: 'PROJECT_ALREADY_INITIALIZED', category: 'usage',
56
+ });
54
57
  }
55
58
  }
56
59
  else {
@@ -71,17 +74,17 @@ export class ConfigCommand {
71
74
  let settings;
72
75
  if (nonInteractive) {
73
76
  const profileDefaults = {
74
- safe: { defaultModel: 'balanced', autoApplyFixes: false },
77
+ safe: { defaultModel: 'assistant', autoApplyFixes: false },
75
78
  balanced: { defaultModel: 'code', autoApplyFixes: false },
76
- fast: { defaultModel: 'code-9b', autoApplyFixes: true },
79
+ fast: { defaultModel: 'assistant', autoApplyFixes: true },
77
80
  };
78
81
  const profile = options.profile && profileDefaults[options.profile] ? options.profile : 'balanced';
79
82
  const defaults = profileDefaults[profile];
80
83
  const model = options.model || defaults.defaultModel;
81
84
  if (!allowedModels.has(model)) {
82
- this.logger.error(`Invalid --model: ${model}`);
83
- this.logger.info('Allowed values: code, code-35b, code-9b, balanced, balanced-4b');
84
- return;
85
+ throw new CliCommandError(`Invalid --model: ${model}. Allowed values: architect, code, assistant, code-35b, code-9b, balanced, balanced-4b.`, {
86
+ code: 'INVALID_MODEL', category: 'usage',
87
+ });
85
88
  }
86
89
  settings = {
87
90
  defaultModel: model,
@@ -98,12 +101,9 @@ export class ConfigCommand {
98
101
  message: 'Default AI model:',
99
102
  choices: [
100
103
  { name: '═══ Code Models ═══', disabled: true },
101
- { name: 'Vigthoria v3 Code 35B - Flagship coding model', value: 'code' },
102
- { name: 'Vigthoria v3 Code 35B - Explicit 35B selection', value: 'code-35b' },
103
- { name: 'Vigthoria v3 Code 9B - Fast coding specialist', value: 'code-9b' },
104
- { name: '═══ General Models ═══', disabled: true },
105
- { name: 'Vigthoria Master 7.6B - Balanced general model', value: 'balanced' },
106
- { name: 'Vigthoria v3 Balanced 4B - Efficient general purpose', value: 'balanced-4b' },
104
+ { name: 'Vigthoria v4 Creative 27B - Architect and planning', value: 'architect' },
105
+ { name: 'Vigthoria v4 Code 27B - Production executor', value: 'code' },
106
+ { name: 'Vigthoria v4 Assistant 9B - Fast FIM and diagnostics', value: 'assistant' },
107
107
  ],
108
108
  default: 'code',
109
109
  },
@@ -152,8 +152,9 @@ export class ConfigCommand {
152
152
  const [key, ...valueParts] = keyValue.split('=');
153
153
  const value = valueParts.join('=');
154
154
  if (!key || value === undefined) {
155
- this.logger.error('Invalid format. Use: vigthoria config --set key=value');
156
- return;
155
+ throw new CliCommandError('Invalid format. Use: vigthoria config --set key=value', {
156
+ code: 'INVALID_CONFIG_ASSIGNMENT', category: 'usage',
157
+ });
157
158
  }
158
159
  const configMap = {
159
160
  'model': (v) => this.config.set('preferences', { ...this.config.get('preferences'), defaultModel: v }),
@@ -161,10 +162,10 @@ export class ConfigCommand {
161
162
  'autoApply': (v) => this.config.set('preferences', { ...this.config.get('preferences'), autoApplyFixes: v === 'true' }),
162
163
  'showDiffs': (v) => this.config.set('preferences', { ...this.config.get('preferences'), showDiffs: v === 'true' }),
163
164
  'maxTokens': (v) => this.config.set('preferences', { ...this.config.get('preferences'), maxTokens: parseInt(v, 10) }),
164
- 'apiUrl': (v) => this.config.set('apiUrl', v),
165
- 'modelsApiUrl': (v) => this.config.set('modelsApiUrl', v),
166
- 'wsUrl': (v) => this.config.set('wsUrl', v),
167
- 'selfHostedModelsApiUrl': (v) => this.config.set('selfHostedModelsApiUrl', v === 'null' || v === 'off' ? null : v),
165
+ 'apiUrl': (v) => this.config.set('apiUrl', assertTrustedEndpoint(v, { audience: 'coder' }).toString().replace(/\/$/, '')),
166
+ 'modelsApiUrl': (v) => this.config.set('modelsApiUrl', assertTrustedEndpoint(v, { audience: 'models' }).toString().replace(/\/$/, '')),
167
+ 'wsUrl': (v) => this.config.set('wsUrl', assertTrustedWebSocketEndpoint(v, 'coder').toString().replace(/\/$/, '')),
168
+ 'selfHostedModelsApiUrl': (v) => this.config.set('selfHostedModelsApiUrl', v === 'null' || v === 'off' ? null : assertTrustedEndpoint(v, { audience: 'models' }).toString().replace(/\/$/, '')),
168
169
  'persona': (v) => {
169
170
  const mode = normalizePersonaMode(v);
170
171
  if (!mode)
@@ -177,8 +178,9 @@ export class ConfigCommand {
177
178
  this.logger.success(`Set ${key} = ${this.formatConfigValueForDisplay(key, value)}`);
178
179
  }
179
180
  else {
180
- this.logger.error(`Unknown config key: ${key}`);
181
- console.log(chalk.gray('Available keys: model, theme, autoApply, showDiffs, maxTokens, persona, apiUrl, modelsApiUrl, wsUrl, selfHostedModelsApiUrl'));
181
+ throw new CliCommandError(`Unknown config key: ${key}. Available keys: model, theme, autoApply, showDiffs, maxTokens, persona, apiUrl, modelsApiUrl, wsUrl, selfHostedModelsApiUrl.`, {
182
+ code: 'UNKNOWN_CONFIG_KEY', category: 'usage',
183
+ });
182
184
  }
183
185
  }
184
186
  formatConfigValueForDisplay(key, value) {
@@ -227,7 +229,7 @@ export class ConfigCommand {
227
229
  console.log(flatConfig[key]);
228
230
  }
229
231
  else {
230
- this.logger.error(`Unknown config key: ${key}`);
232
+ throw new CliCommandError(`Unknown config key: ${key}`, { code: 'UNKNOWN_CONFIG_KEY', category: 'usage' });
231
233
  }
232
234
  }
233
235
  listConfig() {
@@ -265,21 +267,10 @@ export class ConfigCommand {
265
267
  },
266
268
  ]);
267
269
  if (confirm) {
268
- // Save auth before reset
269
- const authToken = this.config.get('authToken');
270
- const refreshToken = this.config.get('refreshToken');
271
- const userId = this.config.get('userId');
272
- const email = this.config.get('email');
273
- const subscription = this.config.get('subscription');
274
- this.config.reset();
275
- // Restore auth
276
- if (authToken) {
277
- this.config.set('authToken', authToken);
278
- this.config.set('refreshToken', refreshToken);
279
- this.config.set('userId', userId);
280
- this.config.set('email', email);
281
- this.config.set('subscription', subscription);
282
- }
270
+ // Reset preferences and endpoints in one durable transaction while
271
+ // preserving the complete credential bundle. Separate reset/set writes
272
+ // can leave a partially restored login after interruption.
273
+ this.config.resetPreservingAuth();
283
274
  this.logger.success('Configuration reset to defaults');
284
275
  }
285
276
  }
@@ -294,10 +285,9 @@ export class ConfigCommand {
294
285
  name: 'defaultModel',
295
286
  message: 'Default AI model:',
296
287
  choices: [
297
- { name: 'Vigthoria v3 Code 35B', value: 'code' },
298
- { name: 'Vigthoria v3 Code 9B', value: 'code-9b' },
299
- { name: 'Vigthoria Master 7.6B', value: 'balanced' },
300
- { name: 'Vigthoria v3 Balanced 4B', value: 'balanced-4b' },
288
+ { name: 'Vigthoria v4 Creative 27B — Architect', value: 'architect' },
289
+ { name: 'Vigthoria v4 Code 27B — Executor', value: 'code' },
290
+ { name: 'Vigthoria v4 Assistant 9B — FIM and diagnostics', value: 'assistant' },
301
291
  ],
302
292
  default: current.preferences.defaultModel,
303
293
  },
@@ -0,0 +1,4 @@
1
+ import type { Command } from 'commander';
2
+ import type { Config } from '../utils/config.js';
3
+ import type { Logger } from '../utils/logger.js';
4
+ export declare function registerConversationCommands(program: Command, config: Config, logger: Logger): void;
@@ -0,0 +1,122 @@
1
+ import { ChatCommand } from './chat.js';
2
+ function projectWasProvided(project) {
3
+ return typeof project === 'string' && project.trim().length > 0;
4
+ }
5
+ export function registerConversationCommands(program, config, logger) {
6
+ program
7
+ .command('chat')
8
+ .alias('c')
9
+ .description('Start interactive chat with Vigthoria AI')
10
+ .option('-m, --model <model>', 'Select AI model (agent, code, code-35b, code-9b, balanced, balanced-4b, cloud, ultra)')
11
+ .option('-p, --project <path>', 'Set project context path')
12
+ .option('--new-project [name]', 'Create or use a managed local workspace folder when no --project path is given')
13
+ .option('-a, --agent', 'Enable agentic mode (default: true for best quality)', true)
14
+ .option('--no-agent', 'Disable agentic mode (simple chat only)')
15
+ .option('-r, --resume', 'Resume last session for this project', false)
16
+ .option('--prompt <text>', 'Run a single prompt directly and exit')
17
+ .option('-w, --workflow <selector>', 'Route prompts through a named or explicit VigFlow workflow target')
18
+ .option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
19
+ .option('--auto-approve', 'Auto-approve agent actions (dangerous!)', false)
20
+ .option('--bridge <url>', 'Connect to Vigthoria Commando Bridge for remote admin observability')
21
+ .action(async (options) => {
22
+ await new ChatCommand(config, logger, program).run({
23
+ model: options.model,
24
+ project: options.project,
25
+ projectProvided: projectWasProvided(options.project),
26
+ newProject: options.newProject,
27
+ agent: options.agent,
28
+ workflow: options.workflow,
29
+ json: options.json,
30
+ autoApprove: options.autoApprove,
31
+ resume: options.resume,
32
+ prompt: options.prompt,
33
+ bridge: options.bridge,
34
+ });
35
+ });
36
+ program
37
+ .command('chat-resume')
38
+ .description('Resume the latest chat session for the current or specified project')
39
+ .option('-m, --model <model>', 'Select AI model (agent, code, code-35b, code-9b, balanced, balanced-4b, cloud, ultra)')
40
+ .option('-p, --project <path>', 'Set project context path')
41
+ .option('--new-project [name]', 'Create or use a managed local workspace folder when no --project path is given')
42
+ .option('-a, --agent', 'Enable agentic mode (default: true for best quality)', true)
43
+ .option('--no-agent', 'Disable agentic mode (simple chat only)')
44
+ .option('--prompt <text>', 'Run a single prompt directly and exit after resuming context')
45
+ .option('-w, --workflow <selector>', 'Route prompts through a named or explicit VigFlow workflow target')
46
+ .option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
47
+ .option('--auto-approve', 'Auto-approve agent actions (dangerous!)', false)
48
+ .option('--bridge <url>', 'Connect to Vigthoria Commando Bridge for remote admin observability')
49
+ .action(async (options) => {
50
+ await new ChatCommand(config, logger, program).run({
51
+ model: options.model,
52
+ project: options.project,
53
+ projectProvided: projectWasProvided(options.project),
54
+ newProject: options.newProject,
55
+ agent: options.agent,
56
+ workflow: options.workflow,
57
+ json: options.json,
58
+ autoApprove: options.autoApprove,
59
+ resume: true,
60
+ prompt: options.prompt,
61
+ bridge: options.bridge,
62
+ });
63
+ });
64
+ program
65
+ .command('agent')
66
+ .alias('a')
67
+ .description('Start agentic mode - AI can read/write files, run commands')
68
+ .option('-m, --model <model>', 'Select AI model (agent, code, cloud, ultra)')
69
+ .option('-p, --project <path>', 'Set project context path')
70
+ .option('--new-project [name]', 'Create or use a managed local workspace folder when no --project path is given')
71
+ .option('--prompt <text>', 'Run a single agent prompt directly and exit')
72
+ .option('-w, --workflow <selector>', 'Run the prompt through a named or explicit VigFlow workflow target')
73
+ .option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
74
+ .option('--retry', 'Retry failed tasks from the last agent run in this workspace session', false)
75
+ .option('--continue', 'Continue unfinished tasks from the last agent run in this workspace session', false)
76
+ .option('--auto-approve', 'Auto-approve all actions (dangerous!)', false)
77
+ .option('--bridge <url>', 'Connect to Vigthoria Commando Bridge for remote admin observability')
78
+ .action(async (options) => {
79
+ await new ChatCommand(config, logger, program).run({
80
+ model: options.model,
81
+ project: options.project,
82
+ projectProvided: projectWasProvided(options.project),
83
+ newProject: options.newProject,
84
+ agent: true,
85
+ operator: false,
86
+ workflow: options.workflow,
87
+ json: options.json,
88
+ autoApprove: options.autoApprove,
89
+ prompt: options.prompt,
90
+ bridge: options.bridge,
91
+ retry: options.retry,
92
+ continue: options.continue,
93
+ });
94
+ });
95
+ program
96
+ .command('operator')
97
+ .alias('op')
98
+ .description('Start BMAD operator mode for infrastructure and system workflows')
99
+ .option('-m, --model <model>', 'Select operator model (code, agent, cloud)')
100
+ .option('-p, --project <path>', 'Set project context path')
101
+ .option('--new-project [name]', 'Create or use a managed local workspace folder when no --project path is given')
102
+ .option('--prompt <text>', 'Run a single operator prompt directly and exit')
103
+ .option('-w, --workflow <selector>', 'Run the prompt through a named or explicit VigFlow workflow target')
104
+ .option('--save-plan', 'Save the completed BMAD plan into VigFlow for rerun and audit', false)
105
+ .option('--json', 'Emit machine-readable JSON output for direct prompt runs', false)
106
+ .option('--bridge <url>', 'Connect to Vigthoria Commando Bridge for remote admin observability')
107
+ .action(async (options) => {
108
+ await new ChatCommand(config, logger, program).run({
109
+ model: options.model,
110
+ project: options.project,
111
+ projectProvided: projectWasProvided(options.project),
112
+ newProject: options.newProject,
113
+ agent: false,
114
+ operator: true,
115
+ workflow: options.workflow,
116
+ savePlan: options.savePlan,
117
+ json: options.json,
118
+ prompt: options.prompt,
119
+ bridge: options.bridge,
120
+ });
121
+ });
122
+ }
@@ -21,12 +21,18 @@ interface DeployOptions {
21
21
  }
22
22
  export declare class DeployCommand {
23
23
  private config;
24
- private logger;
25
24
  private apiBase;
26
- constructor(config: Config, logger: Logger);
25
+ constructor(config: Config, _logger: Logger);
27
26
  private getAuthHeaders;
28
27
  private isAuthenticated;
29
28
  private requireAuth;
29
+ /**
30
+ * Deployment is a Coder-server operation. A client-local absolute path is
31
+ * neither portable nor a valid remote workspace binding, so resolve the
32
+ * validated local project to an existing server-owned project identifier
33
+ * before starting a deployment mutation.
34
+ */
35
+ private resolveServerProject;
30
36
  /**
31
37
  * Interactive deploy wizard
32
38
  */