orquesta-cli 0.2.83 → 0.2.85
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/cli.js +45 -2
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32,6 +32,45 @@ import { shouldShowOnboarding, runOnboarding } from './core/onboarding.js';
|
|
|
32
32
|
const require = createRequire(import.meta.url);
|
|
33
33
|
const packageJson = require('../package.json');
|
|
34
34
|
const program = new Command();
|
|
35
|
+
async function readPromptFromStdin() {
|
|
36
|
+
if (process.stdin.isTTY)
|
|
37
|
+
return '';
|
|
38
|
+
const chunks = [];
|
|
39
|
+
for await (const chunk of process.stdin) {
|
|
40
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
41
|
+
}
|
|
42
|
+
return Buffer.concat(chunks).toString('utf-8').trim();
|
|
43
|
+
}
|
|
44
|
+
async function ensureBatutaFromEnv() {
|
|
45
|
+
const token = process.env['ORQUESTA_TOKEN'];
|
|
46
|
+
if (!token)
|
|
47
|
+
return;
|
|
48
|
+
const apiUrl = (process.env['ORQUESTA_API_URL'] || 'https://getorquesta.com').replace(/\/+$/, '');
|
|
49
|
+
if (configManager.getAllEndpoints().some((e) => e.id === 'batuta-proxy')) {
|
|
50
|
+
await configManager.removeEndpoint('batuta-proxy');
|
|
51
|
+
}
|
|
52
|
+
await configManager.addEndpoint({
|
|
53
|
+
id: 'batuta-proxy',
|
|
54
|
+
name: 'Batuta',
|
|
55
|
+
baseUrl: `${apiUrl}/api/v1`,
|
|
56
|
+
apiKey: token,
|
|
57
|
+
provider: 'batuta',
|
|
58
|
+
models: [{
|
|
59
|
+
id: 'batuta-auto',
|
|
60
|
+
name: 'Batuta Auto (smart routing)',
|
|
61
|
+
maxTokens: 200000,
|
|
62
|
+
enabled: true,
|
|
63
|
+
healthStatus: 'healthy',
|
|
64
|
+
lastHealthCheck: new Date(),
|
|
65
|
+
}],
|
|
66
|
+
createdAt: new Date(),
|
|
67
|
+
updatedAt: new Date(),
|
|
68
|
+
});
|
|
69
|
+
if (!configManager.getCurrentEndpoint()) {
|
|
70
|
+
await configManager.setCurrentEndpoint('batuta-proxy');
|
|
71
|
+
await configManager.setCurrentModel('batuta-auto');
|
|
72
|
+
}
|
|
73
|
+
}
|
|
35
74
|
async function resolveHookToken(explicitToken) {
|
|
36
75
|
await configManager.initialize();
|
|
37
76
|
const saved = configManager.getOrquestaConfig();
|
|
@@ -78,7 +117,7 @@ program
|
|
|
78
117
|
.version(packageJson.version)
|
|
79
118
|
.helpOption('-h, --help', 'Show help');
|
|
80
119
|
program
|
|
81
|
-
.option('-p, --print
|
|
120
|
+
.option('-p, --print [prompt]', 'Execute a prompt and exit (non-interactive mode). Omit the value to read the prompt from stdin — orquesta-agent uses this on Windows to dodge the cmd.exe command-line length limit.')
|
|
82
121
|
.option('--dangerously-skip-permissions', 'Skip all permission prompts (auto-approve)')
|
|
83
122
|
.option('--append-system-prompt <prompt>', 'Append text to the system prompt (parity with claude CLI; used by orquesta-agent sessions)')
|
|
84
123
|
.option('--verbose', 'Enable verbose logging')
|
|
@@ -120,6 +159,7 @@ program
|
|
|
120
159
|
return;
|
|
121
160
|
}
|
|
122
161
|
await configManager.initialize();
|
|
162
|
+
await ensureBatutaFromEnv();
|
|
123
163
|
if (shouldShowOnboarding()) {
|
|
124
164
|
await runOnboarding();
|
|
125
165
|
}
|
|
@@ -246,10 +286,13 @@ program
|
|
|
246
286
|
return;
|
|
247
287
|
}
|
|
248
288
|
if (options.print) {
|
|
289
|
+
const prompt = typeof options.print === 'string'
|
|
290
|
+
? options.print
|
|
291
|
+
: await readPromptFromStdin();
|
|
249
292
|
const { EvalRunner } = await import('./eval/eval-runner.js');
|
|
250
293
|
const runner = new EvalRunner();
|
|
251
294
|
await runner.run({
|
|
252
|
-
prompt
|
|
295
|
+
prompt,
|
|
253
296
|
working_dir: process.cwd(),
|
|
254
297
|
});
|
|
255
298
|
return;
|