orquesta-cli 0.2.82 → 0.2.84
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 +14 -2
- package/dist/core/embeddings-context.js +23 -2
- package/dist/core/ignore-filter.js +13 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -32,6 +32,15 @@ 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
|
+
}
|
|
35
44
|
async function resolveHookToken(explicitToken) {
|
|
36
45
|
await configManager.initialize();
|
|
37
46
|
const saved = configManager.getOrquestaConfig();
|
|
@@ -78,7 +87,7 @@ program
|
|
|
78
87
|
.version(packageJson.version)
|
|
79
88
|
.helpOption('-h, --help', 'Show help');
|
|
80
89
|
program
|
|
81
|
-
.option('-p, --print
|
|
90
|
+
.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
91
|
.option('--dangerously-skip-permissions', 'Skip all permission prompts (auto-approve)')
|
|
83
92
|
.option('--append-system-prompt <prompt>', 'Append text to the system prompt (parity with claude CLI; used by orquesta-agent sessions)')
|
|
84
93
|
.option('--verbose', 'Enable verbose logging')
|
|
@@ -246,10 +255,13 @@ program
|
|
|
246
255
|
return;
|
|
247
256
|
}
|
|
248
257
|
if (options.print) {
|
|
258
|
+
const prompt = typeof options.print === 'string'
|
|
259
|
+
? options.print
|
|
260
|
+
: await readPromptFromStdin();
|
|
249
261
|
const { EvalRunner } = await import('./eval/eval-runner.js');
|
|
250
262
|
const runner = new EvalRunner();
|
|
251
263
|
await runner.run({
|
|
252
|
-
prompt
|
|
264
|
+
prompt,
|
|
253
265
|
working_dir: process.cwd(),
|
|
254
266
|
});
|
|
255
267
|
return;
|
|
@@ -6,9 +6,26 @@ const SOURCE_EXTENSIONS = new Set([
|
|
|
6
6
|
'.py', '.rs', '.go', '.java', '.rb', '.vue', '.svelte',
|
|
7
7
|
]);
|
|
8
8
|
const SYMBOL_RE = /(?:function|class|interface|type|enum|const|let|var|export\s+(?:default\s+)?(?:function|class|const|let|async\s+function))\s+(\w+)/g;
|
|
9
|
+
const MAX_FILES = 2000;
|
|
10
|
+
const PROJECT_MARKERS = [
|
|
11
|
+
'.git', 'package.json', 'tsconfig.json', 'pyproject.toml', 'requirements.txt',
|
|
12
|
+
'go.mod', 'Cargo.toml', 'pom.xml', 'build.gradle', 'Gemfile', 'composer.json',
|
|
13
|
+
'.orquestaignore',
|
|
14
|
+
];
|
|
15
|
+
function isProjectRoot(dir) {
|
|
16
|
+
return PROJECT_MARKERS.some(m => {
|
|
17
|
+
try {
|
|
18
|
+
fs.accessSync(path.join(dir, m));
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
9
26
|
let indexCache = null;
|
|
10
27
|
function scanDir(dir, entries, depth = 0) {
|
|
11
|
-
if (depth > 6)
|
|
28
|
+
if (depth > 6 || entries.size >= MAX_FILES)
|
|
12
29
|
return;
|
|
13
30
|
let items;
|
|
14
31
|
try {
|
|
@@ -18,6 +35,8 @@ function scanDir(dir, entries, depth = 0) {
|
|
|
18
35
|
return;
|
|
19
36
|
}
|
|
20
37
|
for (const item of items) {
|
|
38
|
+
if (entries.size >= MAX_FILES)
|
|
39
|
+
return;
|
|
21
40
|
const full = path.join(dir, item);
|
|
22
41
|
const rel = path.relative(process.cwd(), full);
|
|
23
42
|
if (shouldIgnore(rel))
|
|
@@ -56,7 +75,9 @@ function scanDir(dir, entries, depth = 0) {
|
|
|
56
75
|
function getIndex() {
|
|
57
76
|
if (!indexCache) {
|
|
58
77
|
indexCache = new Map();
|
|
59
|
-
|
|
78
|
+
if (isProjectRoot(process.cwd())) {
|
|
79
|
+
scanDir(process.cwd(), indexCache);
|
|
80
|
+
}
|
|
60
81
|
}
|
|
61
82
|
return indexCache;
|
|
62
83
|
}
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import * as fs from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import { minimatch } from 'minimatch';
|
|
4
|
+
const ALWAYS_IGNORE = new Set([
|
|
5
|
+
'node_modules', '.git', '.svn', '.hg',
|
|
6
|
+
'.cache', '.npm', '.nvm', '.yarn', '.pnpm-store',
|
|
7
|
+
'dist', 'build', 'out', '.next', '.nuxt', '.svelte-kit',
|
|
8
|
+
'vendor', 'target', '.gradle', '.m2',
|
|
9
|
+
'__pycache__', '.venv', 'venv', '.tox', '.mypy_cache', '.pytest_cache',
|
|
10
|
+
'coverage', '.turbo', '.parcel-cache', '.vite',
|
|
11
|
+
'.idea', '.vscode', '.DS_Store',
|
|
12
|
+
]);
|
|
4
13
|
let patterns = null;
|
|
5
14
|
function loadPatterns() {
|
|
6
15
|
if (patterns !== null)
|
|
@@ -33,6 +42,10 @@ export function getIgnorePatterns() {
|
|
|
33
42
|
export function shouldIgnore(filePath) {
|
|
34
43
|
const pats = loadPatterns();
|
|
35
44
|
const rel = path.relative(process.cwd(), path.resolve(filePath)).replace(/\\/g, '/');
|
|
45
|
+
for (const segment of rel.split('/')) {
|
|
46
|
+
if (ALWAYS_IGNORE.has(segment))
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
36
49
|
for (const pat of pats) {
|
|
37
50
|
if (minimatch(rel, pat, { dot: true }) || minimatch(rel, `${pat}/**`, { dot: true })) {
|
|
38
51
|
return true;
|