vigthoria-cli 1.11.47 → 1.12.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.
- package/dist/commands/chat.js +14 -1
- package/dist/commands/index.js +6 -0
- package/dist/commands/v4.d.ts +24 -0
- package/dist/commands/v4.js +84 -0
- package/dist/index.js +32 -0
- package/package.json +1 -1
package/dist/commands/chat.js
CHANGED
|
@@ -3913,7 +3913,20 @@ export class ChatCommand {
|
|
|
3913
3913
|
}
|
|
3914
3914
|
if (trimmed.startsWith('/model ')) {
|
|
3915
3915
|
this.currentModel = trimmed.slice(7).trim() || this.currentModel;
|
|
3916
|
-
this
|
|
3916
|
+
// BUGFIX: previously this unconditionally set modelExplicitlySelected = true,
|
|
3917
|
+
// which permanently locked resolveAgentExecutionPolicy() into its
|
|
3918
|
+
// 'explicit-model-selection' branch for the rest of the session -- even for
|
|
3919
|
+
// light chat aliases like 'balanced'/'fast'. Since 'balanced' resolves
|
|
3920
|
+
// server-side to vigthoria-fast-9b, every subsequent /retry, /continue, or
|
|
3921
|
+
// agent/operator task silently executed on the 9b model instead of the
|
|
3922
|
+
// expected 35b executor, causing repeated "0 tool calls" task failures.
|
|
3923
|
+
// Reuse the same hard-explicit rule applied at CLI startup so agent-mode
|
|
3924
|
+
// aliases don't lock out the dispatcher's auto-upgrade-to-agent-model logic.
|
|
3925
|
+
this.modelExplicitlySelected = this.isHardExplicitAgentModelSelection({
|
|
3926
|
+
model: this.currentModel,
|
|
3927
|
+
agent: this.agentMode,
|
|
3928
|
+
operator: this.operatorMode,
|
|
3929
|
+
});
|
|
3917
3930
|
console.log(chalk.yellow(`Model changed to: ${this.currentModel}`));
|
|
3918
3931
|
if (this.currentSession) {
|
|
3919
3932
|
this.currentSession.model = this.currentModel;
|
package/dist/commands/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import { ReplayCommand } from './replay.js';
|
|
|
17
17
|
import { RepoCommand } from './repo.js';
|
|
18
18
|
import { ReviewCommand } from './review.js';
|
|
19
19
|
import { WorkflowCommand } from './workflow.js';
|
|
20
|
+
import { V4Command } from './v4.js';
|
|
20
21
|
function isRegisterableCommand(value) {
|
|
21
22
|
return Boolean(value && typeof value === 'object');
|
|
22
23
|
}
|
|
@@ -114,6 +115,11 @@ const commandRegistry = [
|
|
|
114
115
|
name: 'bridge',
|
|
115
116
|
handler: createClassRegistrar(BridgeCommand),
|
|
116
117
|
},
|
|
118
|
+
{
|
|
119
|
+
name: 'v4',
|
|
120
|
+
aliases: ['v4-agent'],
|
|
121
|
+
handler: createClassRegistrar(V4Command),
|
|
122
|
+
},
|
|
117
123
|
{
|
|
118
124
|
name: 'workflow',
|
|
119
125
|
handler: createClassRegistrar(WorkflowCommand),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { Config } from '../utils/config.js';
|
|
3
|
+
import { Logger } from '../utils/logger.js';
|
|
4
|
+
type V4Options = {
|
|
5
|
+
provider?: 'cloud' | 'v3_local' | 'byok';
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
baseUrl?: string;
|
|
8
|
+
model?: string;
|
|
9
|
+
transport?: 'auto' | 'ws' | 'sse';
|
|
10
|
+
harnessStreamUrl?: string;
|
|
11
|
+
harnessControlUrl?: string;
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
nonInteractive?: boolean;
|
|
14
|
+
python?: string;
|
|
15
|
+
v4Path?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class V4Command {
|
|
18
|
+
private readonly _config;
|
|
19
|
+
private readonly logger;
|
|
20
|
+
constructor(_config: Config, logger: Logger);
|
|
21
|
+
register(program: Command): void;
|
|
22
|
+
run(options: V4Options): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import chalk from 'chalk';
|
|
5
|
+
export class V4Command {
|
|
6
|
+
_config;
|
|
7
|
+
logger;
|
|
8
|
+
constructor(_config, logger) {
|
|
9
|
+
this._config = _config;
|
|
10
|
+
this.logger = logger;
|
|
11
|
+
}
|
|
12
|
+
register(program) {
|
|
13
|
+
program
|
|
14
|
+
.command('v4')
|
|
15
|
+
.alias('v4-agent')
|
|
16
|
+
.description('Launch Vigthoria V4 Operating Agent (DeerFlow 2.0 harness)')
|
|
17
|
+
.option('--provider <provider>', 'Provider: cloud | v3_local | byok')
|
|
18
|
+
.option('--api-key <key>', 'BYOK API key for non-interactive mode')
|
|
19
|
+
.option('--base-url <url>', 'Provider base URL override')
|
|
20
|
+
.option('--model <name>', 'Provider model override')
|
|
21
|
+
.option('--transport <mode>', 'Bridge transport: auto | ws | sse', 'auto')
|
|
22
|
+
.option('--harness-stream-url <url>', 'Override harness stream URL')
|
|
23
|
+
.option('--harness-control-url <url>', 'Override harness control URL')
|
|
24
|
+
.option('--session-id <id>', 'Explicit V4 session id')
|
|
25
|
+
.option('--non-interactive', 'Disable interactive menu and use CLI options', false)
|
|
26
|
+
.option('--python <bin>', 'Python binary to use', process.env.VIGTHORIA_V4_PYTHON || 'python3')
|
|
27
|
+
.option('--v4-path <path>', 'V4 agent root path', process.env.VIGTHORIA_V4_AGENT_DIR || '/var/www/V4-Operating-Agent')
|
|
28
|
+
.action(async (options) => {
|
|
29
|
+
await this.run(options);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
async run(options) {
|
|
33
|
+
const v4Path = path.resolve(String(options.v4Path || '/var/www/V4-Operating-Agent'));
|
|
34
|
+
const pythonBin = String(options.python || 'python3');
|
|
35
|
+
const mainScript = path.join(v4Path, 'main_agent.py');
|
|
36
|
+
if (!fs.existsSync(mainScript)) {
|
|
37
|
+
throw new Error(`V4 launcher not found: ${mainScript}`);
|
|
38
|
+
}
|
|
39
|
+
const args = [mainScript];
|
|
40
|
+
if (options.nonInteractive) {
|
|
41
|
+
args.push('--non-interactive');
|
|
42
|
+
}
|
|
43
|
+
if (options.provider) {
|
|
44
|
+
args.push('--provider', String(options.provider));
|
|
45
|
+
}
|
|
46
|
+
if (options.apiKey) {
|
|
47
|
+
args.push('--api-key', String(options.apiKey));
|
|
48
|
+
}
|
|
49
|
+
if (options.baseUrl) {
|
|
50
|
+
args.push('--base-url', String(options.baseUrl));
|
|
51
|
+
}
|
|
52
|
+
if (options.model) {
|
|
53
|
+
args.push('--model', String(options.model));
|
|
54
|
+
}
|
|
55
|
+
if (options.transport) {
|
|
56
|
+
args.push('--transport', String(options.transport));
|
|
57
|
+
}
|
|
58
|
+
if (options.harnessStreamUrl) {
|
|
59
|
+
args.push('--harness-stream-url', String(options.harnessStreamUrl));
|
|
60
|
+
}
|
|
61
|
+
if (options.harnessControlUrl) {
|
|
62
|
+
args.push('--harness-control-url', String(options.harnessControlUrl));
|
|
63
|
+
}
|
|
64
|
+
if (options.sessionId) {
|
|
65
|
+
args.push('--session-id', String(options.sessionId));
|
|
66
|
+
}
|
|
67
|
+
this.logger.info(chalk.cyan(`Launching V4 Operating Agent from ${v4Path}`));
|
|
68
|
+
const child = spawn(pythonBin, args, {
|
|
69
|
+
cwd: v4Path,
|
|
70
|
+
stdio: 'inherit',
|
|
71
|
+
env: {
|
|
72
|
+
...process.env,
|
|
73
|
+
PYTHONUNBUFFERED: '1',
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
const exitCode = await new Promise((resolve, reject) => {
|
|
77
|
+
child.on('error', reject);
|
|
78
|
+
child.on('close', (code) => resolve(code ?? 1));
|
|
79
|
+
});
|
|
80
|
+
if (exitCode !== 0) {
|
|
81
|
+
throw new Error(`V4 agent exited with status ${exitCode}`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import { ForkCommand } from './commands/fork.js';
|
|
|
38
38
|
import { CancelCommand } from './commands/cancel.js';
|
|
39
39
|
import { BackgroundCommand } from './commands/background.js';
|
|
40
40
|
import { SecurityCommand } from './commands/security.js';
|
|
41
|
+
import { V4Command } from './commands/v4.js';
|
|
41
42
|
import { Config } from './utils/config.js';
|
|
42
43
|
import { Logger, CH } from './utils/logger.js';
|
|
43
44
|
import chalk from 'chalk';
|
|
@@ -739,6 +740,37 @@ export async function main(args) {
|
|
|
739
740
|
bridge: options.bridge,
|
|
740
741
|
});
|
|
741
742
|
});
|
|
743
|
+
program
|
|
744
|
+
.command('v4')
|
|
745
|
+
.alias('v4-agent')
|
|
746
|
+
.description('Launch Vigthoria V4 Operating Agent (DeerFlow 2.0 harness)')
|
|
747
|
+
.option('--provider <provider>', 'Provider: cloud | v3_local | byok')
|
|
748
|
+
.option('--api-key <key>', 'BYOK API key for non-interactive mode')
|
|
749
|
+
.option('--base-url <url>', 'Provider base URL override')
|
|
750
|
+
.option('--model <name>', 'Provider model override')
|
|
751
|
+
.option('--transport <mode>', 'Bridge transport: auto | ws | sse', 'auto')
|
|
752
|
+
.option('--harness-stream-url <url>', 'Override harness stream URL')
|
|
753
|
+
.option('--harness-control-url <url>', 'Override harness control URL')
|
|
754
|
+
.option('--session-id <id>', 'Explicit V4 session id')
|
|
755
|
+
.option('--non-interactive', 'Disable interactive menu and use CLI options', false)
|
|
756
|
+
.option('--python <bin>', 'Python binary to use', process.env.VIGTHORIA_V4_PYTHON || 'python3')
|
|
757
|
+
.option('--v4-path <path>', 'V4 agent root path', process.env.VIGTHORIA_V4_AGENT_DIR || '/var/www/V4-Operating-Agent')
|
|
758
|
+
.action(async (options) => {
|
|
759
|
+
const v4 = new V4Command(config, logger);
|
|
760
|
+
await v4.run({
|
|
761
|
+
provider: options.provider,
|
|
762
|
+
apiKey: options.apiKey,
|
|
763
|
+
baseUrl: options.baseUrl,
|
|
764
|
+
model: options.model,
|
|
765
|
+
transport: options.transport,
|
|
766
|
+
harnessStreamUrl: options.harnessStreamUrl,
|
|
767
|
+
harnessControlUrl: options.harnessControlUrl,
|
|
768
|
+
sessionId: options.sessionId,
|
|
769
|
+
nonInteractive: options.nonInteractive,
|
|
770
|
+
python: options.python,
|
|
771
|
+
v4Path: options.v4Path,
|
|
772
|
+
});
|
|
773
|
+
});
|
|
742
774
|
program
|
|
743
775
|
.command('bridge')
|
|
744
776
|
.description('Inspect local DevTools Bridge availability for browser debugging tasks')
|