orquesta-agent 0.2.239 → 0.2.241
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/executor.d.ts +58 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +191 -64
- package/dist/executor.js.map +1 -1
- package/dist/index.js +100 -8
- package/dist/index.js.map +1 -1
- package/dist/local-server.d.ts +1 -1
- package/dist/local-server.d.ts.map +1 -1
- package/dist/local-server.js +7 -4
- package/dist/local-server.js.map +1 -1
- package/dist/supabase.d.ts +12 -0
- package/dist/supabase.d.ts.map +1 -1
- package/dist/supabase.js.map +1 -1
- package/dist/ui/public/welcome.js +8 -0
- package/package.json +2 -2
package/dist/executor.d.ts
CHANGED
|
@@ -35,6 +35,16 @@ export interface ExecuteOptions {
|
|
|
35
35
|
* also prevents the orquesta retry from recursing again.
|
|
36
36
|
*/
|
|
37
37
|
_forceCli?: 'orquesta' | 'claude';
|
|
38
|
+
/**
|
|
39
|
+
* Set when this prompt is one item of an assisted QA run. Suppresses every
|
|
40
|
+
* deploy instruction in the settings header; the caller (index.ts) also
|
|
41
|
+
* commits the branch and reports the diff back afterwards.
|
|
42
|
+
*/
|
|
43
|
+
assisted?: {
|
|
44
|
+
runId: string;
|
|
45
|
+
itemId: string;
|
|
46
|
+
branch: string;
|
|
47
|
+
};
|
|
38
48
|
}
|
|
39
49
|
export interface AuthConfig {
|
|
40
50
|
anthropicApiKey?: string;
|
|
@@ -72,6 +82,22 @@ export declare function setCliEndpoint(endpoint: string): void;
|
|
|
72
82
|
export declare function getCliEndpoint(): string;
|
|
73
83
|
export declare function setBrowserEnabled(enabled: boolean): void;
|
|
74
84
|
export declare function getBrowserEnabled(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Is orquesta-cli usable, and which copy of it should we run?
|
|
87
|
+
*
|
|
88
|
+
* The agent bundles orquesta-cli as a dependency so a no-Node / standalone
|
|
89
|
+
* install always has a CLI. That copy used to win unconditionally — it was
|
|
90
|
+
* probed first and its bin dir was prepended to PATH, and every spawn uses the
|
|
91
|
+
* bare name `orquesta`. So a user who updated their own global CLI kept getting
|
|
92
|
+
* the version pinned in orquesta-agent's package.json: the Interactive Session
|
|
93
|
+
* reported v0.2.138 on a machine running v0.2.140, and re-running the update
|
|
94
|
+
* flow could never change it, because the update flow bumps the AGENT and the
|
|
95
|
+
* agent's pin came along with it. QA-77.
|
|
96
|
+
*
|
|
97
|
+
* Now every candidate is probed and the NEWEST one wins. The bundled copy stays
|
|
98
|
+
* the floor (it is still found when nothing else is installed), it just no
|
|
99
|
+
* longer shadows a newer install.
|
|
100
|
+
*/
|
|
75
101
|
export declare function isOrquestaCliAvailable(): boolean;
|
|
76
102
|
export declare function resolveClaudeBinary(): string | null;
|
|
77
103
|
export declare function isClaudeCliAvailable(): boolean;
|
|
@@ -96,7 +122,38 @@ export declare function checkClaudeAuth(): {
|
|
|
96
122
|
};
|
|
97
123
|
export declare function gitClone(repoUrl: string, targetDir: string, githubToken?: string): Promise<void>;
|
|
98
124
|
export declare function gitPull(targetDir: string): Promise<void>;
|
|
99
|
-
|
|
125
|
+
/**
|
|
126
|
+
* Commit everything in `targetDir` and push the CURRENT branch.
|
|
127
|
+
*
|
|
128
|
+
* Two things here are load-bearing and were wrong while this function had no
|
|
129
|
+
* callers:
|
|
130
|
+
*
|
|
131
|
+
* - The message goes through `execFileSync` argv, never a shell string. The
|
|
132
|
+
* old `git commit -m "${message}"` broke on any message containing a double
|
|
133
|
+
* quote and executed on a backtick — and the messages are now built from
|
|
134
|
+
* QA-supplied item titles, i.e. untrusted text.
|
|
135
|
+
* - The push names its remote and branch explicitly. A bare `git push` obeys
|
|
136
|
+
* `push.default`, which on a fresh assisted branch with no upstream fails
|
|
137
|
+
* outright; `-u origin <branch>` both creates the branch remotely and sets
|
|
138
|
+
* the upstream for later pushes.
|
|
139
|
+
*
|
|
140
|
+
* Returns the commit sha it created, or null when there was nothing to commit.
|
|
141
|
+
* Never throws — the caller reports what happened either way.
|
|
142
|
+
*/
|
|
143
|
+
export declare function gitCommitAndPush(targetDir: string, message: string, opts?: {
|
|
144
|
+
push?: boolean;
|
|
145
|
+
}): Promise<{
|
|
146
|
+
sha: string | null;
|
|
147
|
+
pushed: boolean;
|
|
148
|
+
}>;
|
|
149
|
+
/**
|
|
150
|
+
* `git diff --numstat` between `baseRef` and the working tree's last commit.
|
|
151
|
+
*
|
|
152
|
+
* Raw text, sent verbatim to the server: the agent never decides whether a diff
|
|
153
|
+
* is too big. Capped so a generated-file explosion cannot become a multi-MB
|
|
154
|
+
* request body.
|
|
155
|
+
*/
|
|
156
|
+
export declare function gitNumstatSince(targetDir: string, baseRef: string): string;
|
|
100
157
|
export declare function getActivePromptId(): string | null;
|
|
101
158
|
/**
|
|
102
159
|
* Current git branch of `cwd` (the branch a prompt runs on / an interactive
|
package/dist/executor.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../src/executor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAkItD,OAAO,EAAgG,KAAK,WAAW,EAAE,MAAM,cAAc,CAAA;AAgP7I,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAOhF;AAGD,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAE/D;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,YAAY,CAAA;AAOlD,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,SAAS,CAAC,EAAE,OAAO,CA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,EAAE,WAAW,EAAE,CAAA;CAAE,CAetN;AAsBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAoBzD"}
|
package/dist/executor.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawn, execSync } from 'child_process';
|
|
1
|
+
import { spawn, execSync, execFileSync } from 'child_process';
|
|
2
2
|
// PTY binding for interactive sessions. We use @homebridge/node-pty-prebuilt-multiarch
|
|
3
3
|
// (a maintained fork that ships N-API prebuilds for linux-x64/arm64, darwin-x64/arm64,
|
|
4
4
|
// win32-x64) so customers never need a build toolchain on their VM. The try/catch
|
|
@@ -357,9 +357,19 @@ export function setProjectSettings(settings) {
|
|
|
357
357
|
logger.debug(`Settings: autoDeploy=${settings.autoDeploy}, autoMigrate=${settings.autoMigrate}`);
|
|
358
358
|
}
|
|
359
359
|
// Generate settings header for Claude prompt
|
|
360
|
-
|
|
360
|
+
//
|
|
361
|
+
// `assisted` suppresses every deploy instruction: an assisted run's whole point
|
|
362
|
+
// is that a human reads the diff before it ships, and a deploy fired from
|
|
363
|
+
// inside the run would ship exactly the change the review exists to hold back.
|
|
364
|
+
// The server refuses the deploy call as well (assistedDeployBlock) — this half
|
|
365
|
+
// only stops the agent from trying, because an old agent build on a customer
|
|
366
|
+
// machine will keep emitting the curl for months.
|
|
367
|
+
function generateSettingsHeader(opts = {}) {
|
|
361
368
|
const lines = ['## Active Orquesta Settings\n'];
|
|
362
|
-
if (
|
|
369
|
+
if (opts.assisted) {
|
|
370
|
+
lines.push(`- **Assisted run: deployment is DISABLED for this task.** Do NOT deploy, do NOT call the Orquesta Deploy API, and do NOT push to the main branch. Your changes stay on the QA branch and a reviewer decides whether they ship.`);
|
|
371
|
+
}
|
|
372
|
+
else if (projectSettings.autoDeploy && projectSettings.projectId) {
|
|
363
373
|
lines.push(`- **Auto-Deploy: ENABLED**
|
|
364
374
|
|
|
365
375
|
⚠️ CRITICAL DEPLOYMENT RULES:
|
|
@@ -710,66 +720,118 @@ const CLI_DETECTION_TTL_MS = 5 * 60 * 1000;
|
|
|
710
720
|
let orquestaCliCache = null;
|
|
711
721
|
let claudeCliCache = null;
|
|
712
722
|
let kimiCliCache = null;
|
|
723
|
+
/**
|
|
724
|
+
* Version of an orquesta-cli binary, or null when it does not run.
|
|
725
|
+
* '' means it runs but printed nothing we can parse as a version.
|
|
726
|
+
*/
|
|
727
|
+
function probeOrquestaVersion(bin) {
|
|
728
|
+
try {
|
|
729
|
+
const out = execSync(`${bin} --version`, { stdio: 'pipe', timeout: 15000, encoding: 'utf-8' });
|
|
730
|
+
return (out.match(/\d+\.\d+\.\d+/) || [''])[0];
|
|
731
|
+
}
|
|
732
|
+
catch {
|
|
733
|
+
return null;
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
function compareSemver(a, b) {
|
|
737
|
+
const pa = a.split('.').map(n => parseInt(n, 10) || 0);
|
|
738
|
+
const pb = b.split('.').map(n => parseInt(n, 10) || 0);
|
|
739
|
+
for (let i = 0; i < 3; i++) {
|
|
740
|
+
if ((pa[i] || 0) !== (pb[i] || 0))
|
|
741
|
+
return (pa[i] || 0) - (pb[i] || 0);
|
|
742
|
+
}
|
|
743
|
+
return 0;
|
|
744
|
+
}
|
|
745
|
+
// The bin dir this module prepended to PATH on the last detection, so a later
|
|
746
|
+
// re-detection can drop it instead of stacking (and instead of letting a stale
|
|
747
|
+
// winner keep shadowing the one we just chose).
|
|
748
|
+
let injectedCliBinDir = null;
|
|
749
|
+
function prependToPath(binDir) {
|
|
750
|
+
if (injectedCliBinDir && injectedCliBinDir !== binDir) {
|
|
751
|
+
const parts = (process.env.PATH || '').split(path.delimiter).filter(p => p !== injectedCliBinDir);
|
|
752
|
+
process.env.PATH = parts.join(path.delimiter);
|
|
753
|
+
injectedCliBinDir = null;
|
|
754
|
+
}
|
|
755
|
+
const parts = (process.env.PATH || '').split(path.delimiter);
|
|
756
|
+
if (parts[0] !== binDir) {
|
|
757
|
+
// path.delimiter, not ':' — a hardcoded colon builds an unusable PATH on
|
|
758
|
+
// Windows, where the agent has to work too.
|
|
759
|
+
process.env.PATH = [binDir, ...parts.filter(p => p !== binDir)].join(path.delimiter);
|
|
760
|
+
}
|
|
761
|
+
injectedCliBinDir = binDir;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Is orquesta-cli usable, and which copy of it should we run?
|
|
765
|
+
*
|
|
766
|
+
* The agent bundles orquesta-cli as a dependency so a no-Node / standalone
|
|
767
|
+
* install always has a CLI. That copy used to win unconditionally — it was
|
|
768
|
+
* probed first and its bin dir was prepended to PATH, and every spawn uses the
|
|
769
|
+
* bare name `orquesta`. So a user who updated their own global CLI kept getting
|
|
770
|
+
* the version pinned in orquesta-agent's package.json: the Interactive Session
|
|
771
|
+
* reported v0.2.138 on a machine running v0.2.140, and re-running the update
|
|
772
|
+
* flow could never change it, because the update flow bumps the AGENT and the
|
|
773
|
+
* agent's pin came along with it. QA-77.
|
|
774
|
+
*
|
|
775
|
+
* Now every candidate is probed and the NEWEST one wins. The bundled copy stays
|
|
776
|
+
* the floor (it is still found when nothing else is installed), it just no
|
|
777
|
+
* longer shadows a newer install.
|
|
778
|
+
*/
|
|
713
779
|
export function isOrquestaCliAvailable() {
|
|
714
780
|
const now = Date.now();
|
|
715
781
|
if (orquestaCliCache && now - orquestaCliCache.at < CLI_DETECTION_TTL_MS) {
|
|
716
782
|
return orquestaCliCache.available;
|
|
717
783
|
}
|
|
718
|
-
|
|
719
|
-
// First: check bundled CLI (orquesta-cli installed as dependency)
|
|
784
|
+
const home = process.env.HOME || process.env.USERPROFILE || '/root';
|
|
720
785
|
const bundledBin = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', '..', 'node_modules', '.bin', 'orquesta');
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
orquestaCliCache = { available, at: now };
|
|
731
|
-
return available;
|
|
732
|
-
}
|
|
786
|
+
const candidates = [];
|
|
787
|
+
if (fs.existsSync(bundledBin))
|
|
788
|
+
candidates.push(bundledBin);
|
|
789
|
+
// Whatever `orquesta` resolves to right now — but only after dropping any bin
|
|
790
|
+
// dir a previous detection injected, or we would just re-measure our own pick.
|
|
791
|
+
if (injectedCliBinDir) {
|
|
792
|
+
process.env.PATH = (process.env.PATH || '')
|
|
793
|
+
.split(path.delimiter).filter(p => p !== injectedCliBinDir).join(path.delimiter);
|
|
794
|
+
injectedCliBinDir = null;
|
|
733
795
|
}
|
|
734
|
-
catch { /* bundled not working */ }
|
|
735
|
-
// Second: check PATH
|
|
736
796
|
try {
|
|
737
|
-
execSync('
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
}
|
|
768
|
-
catch { }
|
|
797
|
+
const prefix = execSync('npm prefix -g', { stdio: 'pipe', timeout: 5000, encoding: 'utf-8' }).trim();
|
|
798
|
+
if (prefix)
|
|
799
|
+
candidates.push(path.join(prefix, 'bin', 'orquesta'));
|
|
800
|
+
}
|
|
801
|
+
catch { /* npm may not be installed at all (standalone binary machines) */ }
|
|
802
|
+
candidates.push(`${home}/.npm-global/bin/orquesta`, `${home}/.nvm/versions/node/${process.version}/bin/orquesta`, '/usr/local/bin/orquesta', '/usr/bin/orquesta',
|
|
803
|
+
// getorquesta.com/install drops the standalone cli here when /usr/local/bin
|
|
804
|
+
// isn't writable and there's no sudo (no-Node install on a non-root box).
|
|
805
|
+
`${home}/.local/bin/orquesta`);
|
|
806
|
+
let best = null;
|
|
807
|
+
const seen = new Set();
|
|
808
|
+
for (const bin of candidates) {
|
|
809
|
+
if (seen.has(bin))
|
|
810
|
+
continue;
|
|
811
|
+
seen.add(bin);
|
|
812
|
+
if (bin !== bundledBin && !fs.existsSync(bin))
|
|
813
|
+
continue;
|
|
814
|
+
const version = probeOrquestaVersion(bin);
|
|
815
|
+
if (version === null)
|
|
816
|
+
continue;
|
|
817
|
+
if (!best || compareSemver(version, best.version) > 0)
|
|
818
|
+
best = { bin, version };
|
|
819
|
+
}
|
|
820
|
+
// Nothing on the candidate list ran — fall back to a bare PATH lookup, which
|
|
821
|
+
// covers layouts we don't enumerate (Windows shims, custom prefixes).
|
|
822
|
+
if (!best) {
|
|
823
|
+
const version = probeOrquestaVersion('orquesta');
|
|
824
|
+
if (version !== null) {
|
|
825
|
+
orquestaCliCache = { available: true, at: now };
|
|
826
|
+
return true;
|
|
769
827
|
}
|
|
828
|
+
orquestaCliCache = { available: false, at: now };
|
|
829
|
+
return false;
|
|
770
830
|
}
|
|
771
|
-
|
|
772
|
-
|
|
831
|
+
prependToPath(path.dirname(best.bin));
|
|
832
|
+
logger.debug(`orquesta-cli: using ${best.bin}${best.version ? ` (v${best.version})` : ''}`);
|
|
833
|
+
orquestaCliCache = { available: true, at: now };
|
|
834
|
+
return true;
|
|
773
835
|
}
|
|
774
836
|
// Resolve a claude binary that ACTUALLY runs — not one that merely exists on
|
|
775
837
|
// PATH. The claude-code npm package's `bin/claude` launcher can be broken: a
|
|
@@ -1120,27 +1182,92 @@ export async function gitPull(targetDir) {
|
|
|
1120
1182
|
logger.warn(`Git pull failed (continuing without it): ${error}`);
|
|
1121
1183
|
}
|
|
1122
1184
|
}
|
|
1123
|
-
|
|
1185
|
+
/**
|
|
1186
|
+
* Commit everything in `targetDir` and push the CURRENT branch.
|
|
1187
|
+
*
|
|
1188
|
+
* Two things here are load-bearing and were wrong while this function had no
|
|
1189
|
+
* callers:
|
|
1190
|
+
*
|
|
1191
|
+
* - The message goes through `execFileSync` argv, never a shell string. The
|
|
1192
|
+
* old `git commit -m "${message}"` broke on any message containing a double
|
|
1193
|
+
* quote and executed on a backtick — and the messages are now built from
|
|
1194
|
+
* QA-supplied item titles, i.e. untrusted text.
|
|
1195
|
+
* - The push names its remote and branch explicitly. A bare `git push` obeys
|
|
1196
|
+
* `push.default`, which on a fresh assisted branch with no upstream fails
|
|
1197
|
+
* outright; `-u origin <branch>` both creates the branch remotely and sets
|
|
1198
|
+
* the upstream for later pushes.
|
|
1199
|
+
*
|
|
1200
|
+
* Returns the commit sha it created, or null when there was nothing to commit.
|
|
1201
|
+
* Never throws — the caller reports what happened either way.
|
|
1202
|
+
*/
|
|
1203
|
+
export async function gitCommitAndPush(targetDir, message, opts = {}) {
|
|
1124
1204
|
try {
|
|
1125
1205
|
// Check if there are changes
|
|
1126
1206
|
const status = execSync('git status --porcelain', { cwd: targetDir, timeout: 30_000 }).toString();
|
|
1127
1207
|
if (!status.trim()) {
|
|
1128
1208
|
logger.info('No changes to commit');
|
|
1129
|
-
return;
|
|
1209
|
+
return { sha: null, pushed: false };
|
|
1130
1210
|
}
|
|
1131
1211
|
logger.info('Committing changes...');
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
execSync('git
|
|
1212
|
+
execFileSync('git', ['add', '-A'], { cwd: targetDir, stdio: 'pipe', timeout: 30_000 });
|
|
1213
|
+
execFileSync('git', ['commit', '-m', message], { cwd: targetDir, stdio: 'pipe', timeout: 30_000 });
|
|
1214
|
+
const sha = execSync('git rev-parse HEAD', {
|
|
1135
1215
|
cwd: targetDir,
|
|
1136
|
-
|
|
1137
|
-
timeout:
|
|
1138
|
-
|
|
1139
|
-
});
|
|
1140
|
-
|
|
1216
|
+
encoding: 'utf-8',
|
|
1217
|
+
timeout: 10_000,
|
|
1218
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
1219
|
+
}).trim();
|
|
1220
|
+
let pushed = false;
|
|
1221
|
+
if (opts.push !== false) {
|
|
1222
|
+
const branch = getCurrentGitBranch(targetDir);
|
|
1223
|
+
if (!branch) {
|
|
1224
|
+
logger.warn('Detached HEAD — committed but not pushed');
|
|
1225
|
+
}
|
|
1226
|
+
else {
|
|
1227
|
+
try {
|
|
1228
|
+
execFileSync('git', ['push', '-u', 'origin', branch], {
|
|
1229
|
+
cwd: targetDir,
|
|
1230
|
+
stdio: 'pipe',
|
|
1231
|
+
timeout: GIT_NET_TIMEOUT_MS,
|
|
1232
|
+
env: GIT_NONINTERACTIVE_ENV,
|
|
1233
|
+
});
|
|
1234
|
+
pushed = true;
|
|
1235
|
+
logger.success(`Changes pushed to origin/${branch}`);
|
|
1236
|
+
}
|
|
1237
|
+
catch (pushError) {
|
|
1238
|
+
// A commit that exists locally is still a reviewable result — the
|
|
1239
|
+
// reviewer just reads the diff stat instead of the remote branch.
|
|
1240
|
+
logger.warn(`Git push failed (commit kept locally): ${pushError}`);
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
return { sha, pushed };
|
|
1141
1245
|
}
|
|
1142
1246
|
catch (error) {
|
|
1143
1247
|
logger.warn(`Git commit/push failed: ${error}`);
|
|
1248
|
+
return { sha: null, pushed: false };
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* `git diff --numstat` between `baseRef` and the working tree's last commit.
|
|
1253
|
+
*
|
|
1254
|
+
* Raw text, sent verbatim to the server: the agent never decides whether a diff
|
|
1255
|
+
* is too big. Capped so a generated-file explosion cannot become a multi-MB
|
|
1256
|
+
* request body.
|
|
1257
|
+
*/
|
|
1258
|
+
export function gitNumstatSince(targetDir, baseRef) {
|
|
1259
|
+
try {
|
|
1260
|
+
const out = execFileSync('git', ['diff', '--numstat', `${baseRef}...HEAD`], {
|
|
1261
|
+
cwd: targetDir,
|
|
1262
|
+
encoding: 'utf-8',
|
|
1263
|
+
timeout: 30_000,
|
|
1264
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
1265
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
1266
|
+
});
|
|
1267
|
+
return out.slice(0, 180_000);
|
|
1268
|
+
}
|
|
1269
|
+
catch {
|
|
1270
|
+
return '';
|
|
1144
1271
|
}
|
|
1145
1272
|
}
|
|
1146
1273
|
// ============================================
|
|
@@ -1997,7 +2124,7 @@ export async function execute(options) {
|
|
|
1997
2124
|
}
|
|
1998
2125
|
// Build full prompt with settings, agent instructions, and attachments
|
|
1999
2126
|
let fullContent = content + attachmentContext;
|
|
2000
|
-
const settingsHeader = generateSettingsHeader();
|
|
2127
|
+
const settingsHeader = generateSettingsHeader({ assisted: !!options.assisted });
|
|
2001
2128
|
const browserBlock = globalBrowserEnabled ? BROWSER_TOOLS_PROMPT_BLOCK : '';
|
|
2002
2129
|
const coordinationBlock = await fetchCoordinationContextBlock();
|
|
2003
2130
|
const capabilitiesBlock = `${ORQUESTA_CAPABILITIES_PROMPT_BLOCK}${coordinationBlock}`;
|