orquesta-agent 0.2.233 → 0.2.235
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 +1 -0
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +73 -3
- package/dist/executor.js.map +1 -1
- package/dist/index.js +52 -19
- package/dist/index.js.map +1 -1
- package/dist/supabase.d.ts +2 -0
- package/dist/supabase.d.ts.map +1 -1
- package/dist/supabase.js +6 -0
- package/dist/supabase.js.map +1 -1
- package/package.json +1 -1
package/dist/executor.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export declare function getActivePromptId(): string | null;
|
|
|
96
96
|
* Cheap and best-effort — never throws into the caller.
|
|
97
97
|
*/
|
|
98
98
|
export declare function getCurrentGitBranch(cwd: string): string | null;
|
|
99
|
+
export declare function compactFileEditArgs(args: unknown): string | null;
|
|
99
100
|
export declare function execute(options: ExecuteOptions): Promise<void>;
|
|
100
101
|
export declare function handleSupervisionResponse(commandId: string, action: string, content?: string): boolean;
|
|
101
102
|
export declare function cancel(id: string): boolean;
|
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;
|
|
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;AA+O7I,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAOhF;AAGD,wBAAgB,sBAAsB,IAA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AAE,CAAA;CAAE,CAe3M;AAsBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAoBzD"}
|
package/dist/executor.js
CHANGED
|
@@ -126,7 +126,7 @@ import { parseCoordSpec, runCoordination } from './coordination.js';
|
|
|
126
126
|
import { parseSudosudoInstallSpec, runSudosudoInstall } from './sudosudo.js';
|
|
127
127
|
import { sendOutput, sendComplete, sendError, sendSupervisionRequest, sendExecutionResumed, updatePromptStatus, persistOutputLogs, clearOutputBuffer, sendRequirement, persistRequirement, sendQAInstructions, persistQAInstructions, sendPlanItemsGenerated, sendSessionOutput, sendSessionStarted, sendSessionEnded, sendSessionError, sendSessionLog, reportAgentError } from './supabase.js';
|
|
128
128
|
import { startTranscriptTail } from './claude-transcript.js';
|
|
129
|
-
import { createThinkingLog, createToolCallLog, createToolResultLog, createOutputLog, createErrorLog, createSystemLog, } from './types/agent-logs.js';
|
|
129
|
+
import { createThinkingLog, createToolCallLog, createToolResultLog, createOutputLog, createErrorLog, createSystemLog, createProgressLog, } from './types/agent-logs.js';
|
|
130
130
|
/**
|
|
131
131
|
* Build args for the `script` PTY wrapper, accounting for BSD vs util-linux differences.
|
|
132
132
|
* - util-linux (Linux): `script -q -c "<cmd>" /dev/null`
|
|
@@ -313,9 +313,25 @@ let anthropicApiKey = null;
|
|
|
313
313
|
let claudeCredentialsPath = null;
|
|
314
314
|
// Injected credentials from Orquesta (env vars to inject)
|
|
315
315
|
let injectedCredentials = {};
|
|
316
|
+
// Name of the manifest var that tells the spawned CLI which env vars WE put
|
|
317
|
+
// there. orquesta-cli filters its shell tools' env down to a whitelist so an
|
|
318
|
+
// LLM-run command can't read secrets that merely happen to live on the host
|
|
319
|
+
// machine; that whitelist was also eating every credential we deliberately
|
|
320
|
+
// injected (ORQUESTA_EMBED_TOKEN, ORQUESTA_TOKEN, GITHUB_TOKEN, the project's
|
|
321
|
+
// own env vars…), so `echo $ORQUESTA_EMBED_TOKEN` came back empty and the
|
|
322
|
+
// documented `curl -H "Authorization: Bearer $ORQUESTA_TOKEN"` recipes in our
|
|
323
|
+
// system prompt silently returned nothing. Declaring the keys here re-grants
|
|
324
|
+
// exactly those — and nothing else. (Claude Code is unaffected: its Bash tool
|
|
325
|
+
// inherits the full env, which is why this only ever broke on orquesta-cli.)
|
|
326
|
+
const INJECTED_ENV_MANIFEST = 'ORQUESTA_INJECTED_ENV';
|
|
316
327
|
// Set injected credentials (called on startup after fetching from API)
|
|
317
328
|
export function setInjectedCredentials(credentials) {
|
|
318
|
-
|
|
329
|
+
// Never list the manifest inside itself (setInjectedCredentials is re-called
|
|
330
|
+
// on every credential refresh, and a caller may hand back a prior result).
|
|
331
|
+
const keys = Object.keys(credentials).filter(k => k !== INJECTED_ENV_MANIFEST);
|
|
332
|
+
injectedCredentials = keys.length > 0
|
|
333
|
+
? { ...credentials, [INJECTED_ENV_MANIFEST]: keys.join(',') }
|
|
334
|
+
: credentials;
|
|
319
335
|
}
|
|
320
336
|
// Get injected credentials
|
|
321
337
|
export function getInjectedCredentials() {
|
|
@@ -1746,6 +1762,36 @@ export function getCurrentGitBranch(cwd) {
|
|
|
1746
1762
|
return null;
|
|
1747
1763
|
}
|
|
1748
1764
|
}
|
|
1765
|
+
// Args for a file-editing tool, trimmed so the live stream can show WHAT
|
|
1766
|
+
// changed without carrying a whole file through the socket. Returns null for
|
|
1767
|
+
// anything that isn't a file edit — those args stay dropped when oversized.
|
|
1768
|
+
const EDIT_SIDE_CAP = 800;
|
|
1769
|
+
export function compactFileEditArgs(args) {
|
|
1770
|
+
if (!args || typeof args !== 'object')
|
|
1771
|
+
return null;
|
|
1772
|
+
const a = args;
|
|
1773
|
+
const path = a.file_path ?? a.filePath ?? a.path;
|
|
1774
|
+
if (typeof path !== 'string' || !path)
|
|
1775
|
+
return null;
|
|
1776
|
+
const trim = (v) => {
|
|
1777
|
+
if (typeof v !== 'string')
|
|
1778
|
+
return undefined;
|
|
1779
|
+
return v.length > EDIT_SIDE_CAP ? v.slice(0, EDIT_SIDE_CAP) + '\n…[truncated]' : v;
|
|
1780
|
+
};
|
|
1781
|
+
const out = { file_path: path };
|
|
1782
|
+
const oldStr = trim(a.old_string ?? a.oldString);
|
|
1783
|
+
const newStr = trim(a.new_string ?? a.newString ?? a.content);
|
|
1784
|
+
if (oldStr !== undefined)
|
|
1785
|
+
out.old_string = oldStr;
|
|
1786
|
+
if (newStr !== undefined)
|
|
1787
|
+
out.new_string = newStr;
|
|
1788
|
+
if (typeof a.reason === 'string')
|
|
1789
|
+
out.reason = a.reason.slice(0, 200);
|
|
1790
|
+
// A bare path (read/list) carries no diff — not worth a payload.
|
|
1791
|
+
if (oldStr === undefined && newStr === undefined)
|
|
1792
|
+
return null;
|
|
1793
|
+
return JSON.stringify(out, null, 2);
|
|
1794
|
+
}
|
|
1749
1795
|
export async function execute(options) {
|
|
1750
1796
|
const { commandId, promptId, content, workingDirectory, channel, permissionMode, attachments } = options;
|
|
1751
1797
|
const startTime = Date.now();
|
|
@@ -1950,6 +1996,12 @@ ${userRequestBody}`;
|
|
|
1950
1996
|
// Which branch this prompt runs on — captured up front so it's persisted even
|
|
1951
1997
|
// if the run fails, and broadcast live below once sendSpecialEvent exists.
|
|
1952
1998
|
const currentBranch = getCurrentGitBranch(cwd);
|
|
1999
|
+
// Last commit this run produced. Detected from the CLI's own output further
|
|
2000
|
+
// down; it used to be broadcast live and then dropped on the floor, so a run
|
|
2001
|
+
// that committed AND pushed still left prompts.git_commit_sha NULL and the UI
|
|
2002
|
+
// had no way to link the change it just shipped.
|
|
2003
|
+
let detectedCommitSha = null;
|
|
2004
|
+
let detectedCommitUrl = null;
|
|
1953
2005
|
logger.info(`CLI Selection: ${cliCommand} (${reason})`);
|
|
1954
2006
|
logger.info(`Spawning: ${cliBinary} -p "${fullContent.slice(0, 50)}..." in ${cwd}${currentBranch ? ` on branch ${currentBranch}` : ''}`);
|
|
1955
2007
|
// Hoist the static block into the CLI system prompt (claude/orquesta support
|
|
@@ -2114,6 +2166,13 @@ ${userRequestBody}`;
|
|
|
2114
2166
|
else if (action === 'failed') {
|
|
2115
2167
|
output += `\n❌ Failed: ${title}\n`;
|
|
2116
2168
|
}
|
|
2169
|
+
// Persist the transition too. These used to be marker text ONLY, so a
|
|
2170
|
+
// replayed run had zero progress rows and rendered as a different run
|
|
2171
|
+
// than the one the user watched live (no plan, no checklist). `phase`
|
|
2172
|
+
// carries the action so a reader can rebuild the checklist state.
|
|
2173
|
+
if (action && title) {
|
|
2174
|
+
logs.push(createProgressLog(String(title), undefined, action === 'failed' ? 'error' : 'info', promptId, undefined, undefined, String(action)));
|
|
2175
|
+
}
|
|
2117
2176
|
}
|
|
2118
2177
|
else if (json.event === 'tool_call') {
|
|
2119
2178
|
const { tool, args } = json.data;
|
|
@@ -2122,6 +2181,15 @@ ${userRequestBody}`;
|
|
|
2122
2181
|
if (argsStr.length < 500) {
|
|
2123
2182
|
output += `${argsStr}\n`;
|
|
2124
2183
|
}
|
|
2184
|
+
else {
|
|
2185
|
+
// A file edit is the one thing the user actually wants to SEE, and
|
|
2186
|
+
// its args are almost always over the cap (old+new string), so the
|
|
2187
|
+
// live stream showed nothing while the DB row had the whole diff.
|
|
2188
|
+
// Emit a trimmed edit payload instead of dropping it entirely.
|
|
2189
|
+
const compact = compactFileEditArgs(args);
|
|
2190
|
+
if (compact)
|
|
2191
|
+
output += `${compact}\n`;
|
|
2192
|
+
}
|
|
2125
2193
|
logs.push(createToolCallLog(tool, args, 'info', promptId));
|
|
2126
2194
|
currentToolName = tool;
|
|
2127
2195
|
}
|
|
@@ -2432,6 +2500,8 @@ ${userRequestBody}`;
|
|
|
2432
2500
|
catch {
|
|
2433
2501
|
// Ignore errors getting git remote
|
|
2434
2502
|
}
|
|
2503
|
+
detectedCommitSha = commitMatch[1];
|
|
2504
|
+
detectedCommitUrl = commitUrl;
|
|
2435
2505
|
sendSpecialEvent('git_commit', {
|
|
2436
2506
|
commitSha: commitMatch[1],
|
|
2437
2507
|
message: commitMatch[2] || '',
|
|
@@ -2620,7 +2690,7 @@ ${userRequestBody}`;
|
|
|
2620
2690
|
modelForDb = (globalCliEndpoint === 'batuta' || !globalCliEndpoint) ? 'batuta-auto' : globalCliEndpoint;
|
|
2621
2691
|
else if (cliCommand === 'claude')
|
|
2622
2692
|
modelForDb = process.env.ANTHROPIC_MODEL || undefined;
|
|
2623
|
-
updatePromptStatus(promptId, status, summary || undefined, Object.keys(usage).length > 0 ? usage : undefined, finalResult, { cliType: cliTypeForDb, model: modelForDb, gitBranch: currentBranch || undefined }).catch(err => {
|
|
2693
|
+
updatePromptStatus(promptId, status, summary || undefined, Object.keys(usage).length > 0 ? usage : undefined, finalResult, { cliType: cliTypeForDb, model: modelForDb, gitBranch: currentBranch || undefined, gitCommitSha: detectedCommitSha || undefined, gitCommitUrl: detectedCommitUrl || undefined }).catch(err => {
|
|
2624
2694
|
logger.error(`Failed to update prompt status: ${err}`);
|
|
2625
2695
|
});
|
|
2626
2696
|
// Auto-publish any documents/assets the run generated so the operator
|