orquesta-agent 0.2.238 → 0.2.240
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 +42 -1
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +120 -18
- package/dist/executor.js.map +1 -1
- package/dist/fs-browse.d.ts +35 -0
- package/dist/fs-browse.d.ts.map +1 -0
- package/dist/fs-browse.js +106 -0
- package/dist/fs-browse.js.map +1 -0
- package/dist/index.js +90 -7
- package/dist/index.js.map +1 -1
- package/dist/supabase.d.ts +31 -1
- package/dist/supabase.d.ts.map +1 -1
- package/dist/supabase.js +10 -2
- package/dist/supabase.js.map +1 -1
- package/dist/ui/server.d.ts.map +1 -1
- package/dist/ui/server.js +112 -43
- package/dist/ui/server.js.map +1 -1
- package/dist/ws-client.d.ts +14 -2
- package/dist/ws-client.d.ts.map +1 -1
- package/dist/ws-client.js +42 -4
- package/dist/ws-client.js.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -96,7 +106,38 @@ export declare function checkClaudeAuth(): {
|
|
|
96
106
|
};
|
|
97
107
|
export declare function gitClone(repoUrl: string, targetDir: string, githubToken?: string): Promise<void>;
|
|
98
108
|
export declare function gitPull(targetDir: string): Promise<void>;
|
|
99
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Commit everything in `targetDir` and push the CURRENT branch.
|
|
111
|
+
*
|
|
112
|
+
* Two things here are load-bearing and were wrong while this function had no
|
|
113
|
+
* callers:
|
|
114
|
+
*
|
|
115
|
+
* - The message goes through `execFileSync` argv, never a shell string. The
|
|
116
|
+
* old `git commit -m "${message}"` broke on any message containing a double
|
|
117
|
+
* quote and executed on a backtick — and the messages are now built from
|
|
118
|
+
* QA-supplied item titles, i.e. untrusted text.
|
|
119
|
+
* - The push names its remote and branch explicitly. A bare `git push` obeys
|
|
120
|
+
* `push.default`, which on a fresh assisted branch with no upstream fails
|
|
121
|
+
* outright; `-u origin <branch>` both creates the branch remotely and sets
|
|
122
|
+
* the upstream for later pushes.
|
|
123
|
+
*
|
|
124
|
+
* Returns the commit sha it created, or null when there was nothing to commit.
|
|
125
|
+
* Never throws — the caller reports what happened either way.
|
|
126
|
+
*/
|
|
127
|
+
export declare function gitCommitAndPush(targetDir: string, message: string, opts?: {
|
|
128
|
+
push?: boolean;
|
|
129
|
+
}): Promise<{
|
|
130
|
+
sha: string | null;
|
|
131
|
+
pushed: boolean;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* `git diff --numstat` between `baseRef` and the working tree's last commit.
|
|
135
|
+
*
|
|
136
|
+
* Raw text, sent verbatim to the server: the agent never decides whether a diff
|
|
137
|
+
* is too big. Capped so a generated-file explosion cannot become a multi-MB
|
|
138
|
+
* request body.
|
|
139
|
+
*/
|
|
140
|
+
export declare function gitNumstatSince(targetDir: string, baseRef: string): string;
|
|
100
141
|
export declare function getActivePromptId(): string | null;
|
|
101
142
|
/**
|
|
102
143
|
* 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,E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AI,CAAA;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAA;CACpD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,WAAW,EAAE,CAe9C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;IAAC,QAAQ,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:
|
|
@@ -1120,27 +1130,92 @@ export async function gitPull(targetDir) {
|
|
|
1120
1130
|
logger.warn(`Git pull failed (continuing without it): ${error}`);
|
|
1121
1131
|
}
|
|
1122
1132
|
}
|
|
1123
|
-
|
|
1133
|
+
/**
|
|
1134
|
+
* Commit everything in `targetDir` and push the CURRENT branch.
|
|
1135
|
+
*
|
|
1136
|
+
* Two things here are load-bearing and were wrong while this function had no
|
|
1137
|
+
* callers:
|
|
1138
|
+
*
|
|
1139
|
+
* - The message goes through `execFileSync` argv, never a shell string. The
|
|
1140
|
+
* old `git commit -m "${message}"` broke on any message containing a double
|
|
1141
|
+
* quote and executed on a backtick — and the messages are now built from
|
|
1142
|
+
* QA-supplied item titles, i.e. untrusted text.
|
|
1143
|
+
* - The push names its remote and branch explicitly. A bare `git push` obeys
|
|
1144
|
+
* `push.default`, which on a fresh assisted branch with no upstream fails
|
|
1145
|
+
* outright; `-u origin <branch>` both creates the branch remotely and sets
|
|
1146
|
+
* the upstream for later pushes.
|
|
1147
|
+
*
|
|
1148
|
+
* Returns the commit sha it created, or null when there was nothing to commit.
|
|
1149
|
+
* Never throws — the caller reports what happened either way.
|
|
1150
|
+
*/
|
|
1151
|
+
export async function gitCommitAndPush(targetDir, message, opts = {}) {
|
|
1124
1152
|
try {
|
|
1125
1153
|
// Check if there are changes
|
|
1126
1154
|
const status = execSync('git status --porcelain', { cwd: targetDir, timeout: 30_000 }).toString();
|
|
1127
1155
|
if (!status.trim()) {
|
|
1128
1156
|
logger.info('No changes to commit');
|
|
1129
|
-
return;
|
|
1157
|
+
return { sha: null, pushed: false };
|
|
1130
1158
|
}
|
|
1131
1159
|
logger.info('Committing changes...');
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
execSync('git
|
|
1160
|
+
execFileSync('git', ['add', '-A'], { cwd: targetDir, stdio: 'pipe', timeout: 30_000 });
|
|
1161
|
+
execFileSync('git', ['commit', '-m', message], { cwd: targetDir, stdio: 'pipe', timeout: 30_000 });
|
|
1162
|
+
const sha = execSync('git rev-parse HEAD', {
|
|
1135
1163
|
cwd: targetDir,
|
|
1136
|
-
|
|
1137
|
-
timeout:
|
|
1138
|
-
|
|
1139
|
-
});
|
|
1140
|
-
|
|
1164
|
+
encoding: 'utf-8',
|
|
1165
|
+
timeout: 10_000,
|
|
1166
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
1167
|
+
}).trim();
|
|
1168
|
+
let pushed = false;
|
|
1169
|
+
if (opts.push !== false) {
|
|
1170
|
+
const branch = getCurrentGitBranch(targetDir);
|
|
1171
|
+
if (!branch) {
|
|
1172
|
+
logger.warn('Detached HEAD — committed but not pushed');
|
|
1173
|
+
}
|
|
1174
|
+
else {
|
|
1175
|
+
try {
|
|
1176
|
+
execFileSync('git', ['push', '-u', 'origin', branch], {
|
|
1177
|
+
cwd: targetDir,
|
|
1178
|
+
stdio: 'pipe',
|
|
1179
|
+
timeout: GIT_NET_TIMEOUT_MS,
|
|
1180
|
+
env: GIT_NONINTERACTIVE_ENV,
|
|
1181
|
+
});
|
|
1182
|
+
pushed = true;
|
|
1183
|
+
logger.success(`Changes pushed to origin/${branch}`);
|
|
1184
|
+
}
|
|
1185
|
+
catch (pushError) {
|
|
1186
|
+
// A commit that exists locally is still a reviewable result — the
|
|
1187
|
+
// reviewer just reads the diff stat instead of the remote branch.
|
|
1188
|
+
logger.warn(`Git push failed (commit kept locally): ${pushError}`);
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
return { sha, pushed };
|
|
1141
1193
|
}
|
|
1142
1194
|
catch (error) {
|
|
1143
1195
|
logger.warn(`Git commit/push failed: ${error}`);
|
|
1196
|
+
return { sha: null, pushed: false };
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* `git diff --numstat` between `baseRef` and the working tree's last commit.
|
|
1201
|
+
*
|
|
1202
|
+
* Raw text, sent verbatim to the server: the agent never decides whether a diff
|
|
1203
|
+
* is too big. Capped so a generated-file explosion cannot become a multi-MB
|
|
1204
|
+
* request body.
|
|
1205
|
+
*/
|
|
1206
|
+
export function gitNumstatSince(targetDir, baseRef) {
|
|
1207
|
+
try {
|
|
1208
|
+
const out = execFileSync('git', ['diff', '--numstat', `${baseRef}...HEAD`], {
|
|
1209
|
+
cwd: targetDir,
|
|
1210
|
+
encoding: 'utf-8',
|
|
1211
|
+
timeout: 30_000,
|
|
1212
|
+
stdio: ['pipe', 'pipe', 'ignore'],
|
|
1213
|
+
maxBuffer: 8 * 1024 * 1024,
|
|
1214
|
+
});
|
|
1215
|
+
return out.slice(0, 180_000);
|
|
1216
|
+
}
|
|
1217
|
+
catch {
|
|
1218
|
+
return '';
|
|
1144
1219
|
}
|
|
1145
1220
|
}
|
|
1146
1221
|
// ============================================
|
|
@@ -1598,6 +1673,20 @@ function detectQAInstructions(text, commandId) {
|
|
|
1598
1673
|
const buf = (qaBufferMap.get(commandId) || '') + text;
|
|
1599
1674
|
qaBufferMap.set(commandId, buf.length > 20000 ? buf.slice(-15000) : buf);
|
|
1600
1675
|
const currentBuf = qaBufferMap.get(commandId);
|
|
1676
|
+
/*
|
|
1677
|
+
* Last-resort unescape for a block that reached us still JSON-encoded (a CLI
|
|
1678
|
+
* whose output format we do not parse, or a tool that echoes a JSON payload).
|
|
1679
|
+
* Only when the whole capture is a single line carrying literal \n escapes —
|
|
1680
|
+
* a genuine multi-line QA block is left exactly as written, so a step that
|
|
1681
|
+
* legitimately mentions \n in a regex or a code span is not rewritten.
|
|
1682
|
+
*/
|
|
1683
|
+
const unescapeIfEncoded = (value) => !value.includes('\n') && /\\n/.test(value)
|
|
1684
|
+
? value
|
|
1685
|
+
.replace(/\\r\\n|\\n/g, '\n')
|
|
1686
|
+
.replace(/\\t/g, '\t')
|
|
1687
|
+
.replace(/\\"/g, '"')
|
|
1688
|
+
.replace(/\\\\/g, '\\')
|
|
1689
|
+
: value;
|
|
1601
1690
|
// Look for QA Instructions header (## or ###)
|
|
1602
1691
|
const qaMatch = currentBuf.match(/##\s*QA\s+Instructions\s*([\s\S]*?)(?=\n##[^#]|$)/i);
|
|
1603
1692
|
if (!qaMatch || qaDetectedMap.get(commandId))
|
|
@@ -1606,7 +1695,7 @@ function detectQAInstructions(text, commandId) {
|
|
|
1606
1695
|
// to end-of-buffer and swallows whatever the CLI prints next (observed: the
|
|
1607
1696
|
// whole appended system prompt — Orquesta Capabilities, browser tools —
|
|
1608
1697
|
// persisted as "QA instructions" in the DB). Real QA blocks are short.
|
|
1609
|
-
const qaContent = qaMatch[1].length > 4000 ? qaMatch[1].slice(0, 4000) : qaMatch[1];
|
|
1698
|
+
const qaContent = unescapeIfEncoded(qaMatch[1].length > 4000 ? qaMatch[1].slice(0, 4000) : qaMatch[1]);
|
|
1610
1699
|
// Ignore the TEMPLATE echo: if the CLI echoes the QA-instructions prompt
|
|
1611
1700
|
// template itself ("[Brief description of the feature/change]" etc.), the
|
|
1612
1701
|
// placeholders are still in brackets — that's not a real QA report.
|
|
@@ -1616,7 +1705,11 @@ function detectQAInstructions(text, commandId) {
|
|
|
1616
1705
|
// Matches: **Feature**: or **Feature:** or ### Feature or **Summary**: etc
|
|
1617
1706
|
// Note: Claude sometimes puts colon inside bold (**Feature:**) or outside (**Feature**:)
|
|
1618
1707
|
const featureMatch = qaContent.match(/(?:\*\*(?:Feature|Description|Summary)(?::\*\*|\*\*:)|###?\s*(?:Feature|Description|Summary):?\s*\n?)\s*(.+?)(?:\n|$)/i);
|
|
1619
|
-
|
|
1708
|
+
// Clamp it: the feature is a card heading in the dashboard, so whatever the
|
|
1709
|
+
// regex captures has to stay heading-sized even if the output was shaped in
|
|
1710
|
+
// some way these patterns did not anticipate. QA-70.
|
|
1711
|
+
const rawFeature = featureMatch ? featureMatch[1].trim() : 'Feature verification';
|
|
1712
|
+
const feature = rawFeature.length > 160 ? rawFeature.slice(0, 157).trimEnd() + '…' : rawFeature;
|
|
1620
1713
|
// Extract steps to test (accept multiple formats)
|
|
1621
1714
|
// Matches: "**Steps to Test**:", "**Steps to verify:**", "### Test Steps", "### Steps", etc
|
|
1622
1715
|
const stepsMatch = qaContent.match(/(?:\*\*(?:Steps\s+to\s+(?:Test|[Vv]erify)|Verification\s+Steps|Testing\s+Steps|Test\s+Steps|Steps)(?::\*\*|\*\*:)|###?\s*(?:Steps\s+to\s+(?:Test|[Vv]erify)|Verification\s+Steps|Testing\s+Steps|Test\s+Steps|Steps):?\s*\n?)\s*([\s\S]*?)(?=\*\*Expected|###?\s*Expected|###?\s*Rollback|\*\*Test\s+URL|\*\*Production\s+URL|$)/i);
|
|
@@ -1979,7 +2072,7 @@ export async function execute(options) {
|
|
|
1979
2072
|
}
|
|
1980
2073
|
// Build full prompt with settings, agent instructions, and attachments
|
|
1981
2074
|
let fullContent = content + attachmentContext;
|
|
1982
|
-
const settingsHeader = generateSettingsHeader();
|
|
2075
|
+
const settingsHeader = generateSettingsHeader({ assisted: !!options.assisted });
|
|
1983
2076
|
const browserBlock = globalBrowserEnabled ? BROWSER_TOOLS_PROMPT_BLOCK : '';
|
|
1984
2077
|
const coordinationBlock = await fetchCoordinationContextBlock();
|
|
1985
2078
|
const capabilitiesBlock = `${ORQUESTA_CAPABILITIES_PROMPT_BLOCK}${coordinationBlock}`;
|
|
@@ -2642,8 +2735,17 @@ ${userRequestBody}`;
|
|
|
2642
2735
|
logger.warn(`Failed to persist requirement: ${err}`);
|
|
2643
2736
|
});
|
|
2644
2737
|
}
|
|
2645
|
-
// Detect QA instructions
|
|
2646
|
-
|
|
2738
|
+
// Detect QA instructions.
|
|
2739
|
+
//
|
|
2740
|
+
// On the PARSED output, not the raw chunk. With --output-format
|
|
2741
|
+
// stream-json every assistant message arrives as one JSON line, so the
|
|
2742
|
+
// newlines inside it are the two characters \n and the markdown
|
|
2743
|
+
// structure the patterns below look for does not exist yet: the
|
|
2744
|
+
// "**Feature**:" capture, terminated by a newline, ran to the end of the
|
|
2745
|
+
// line and stored the entire escaped message as the feature name — the
|
|
2746
|
+
// wall of text QA saw in the panel. `parsed` is the same text the user
|
|
2747
|
+
// reads in the output pane, with real line breaks. QA-70.
|
|
2748
|
+
const qaInstructions = detectQAInstructions(outputToSend, commandId);
|
|
2647
2749
|
if (qaInstructions) {
|
|
2648
2750
|
logger.success(`QA Instructions detected: ${qaInstructions.feature}`);
|
|
2649
2751
|
// Send via realtime channel
|