@gakim-digital/dexter-bridge 0.5.17 → 0.5.20
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/package.json +1 -1
- package/src/agent.js +0 -1
- package/src/cli.js +35 -8
- package/src/providers/claudeAgentSdk.js +0 -1
package/package.json
CHANGED
package/src/agent.js
CHANGED
|
@@ -269,7 +269,6 @@ function argsWithClaudeIsolation(args, definition) {
|
|
|
269
269
|
const isolated = argsWithoutVariadicFlag(args, '--tools');
|
|
270
270
|
isolated.push('--tools', '');
|
|
271
271
|
if (!argsIncludeFlag(isolated, '--disable-slash-commands')) isolated.push('--disable-slash-commands');
|
|
272
|
-
if (!argsIncludeFlag(isolated, '--safe-mode')) isolated.push('--safe-mode');
|
|
273
272
|
if (!argsIncludeFlag(isolated, '--strict-mcp-config')) isolated.push('--strict-mcp-config');
|
|
274
273
|
if (!argsIncludeFlag(isolated, '--no-chrome')) isolated.push('--no-chrome');
|
|
275
274
|
return isolated;
|
package/src/cli.js
CHANGED
|
@@ -107,6 +107,27 @@ function pollBackoffMs(failureCount, baseMs = 1000, maxMs = 30000) {
|
|
|
107
107
|
return Math.min(maximum, base * (2 ** Math.min(10, failures - 1)));
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
async function executeClaimedRun({
|
|
111
|
+
run,
|
|
112
|
+
execute = executeRun,
|
|
113
|
+
executeOptions,
|
|
114
|
+
once = false,
|
|
115
|
+
logger,
|
|
116
|
+
}) {
|
|
117
|
+
try {
|
|
118
|
+
await execute(run, executeOptions);
|
|
119
|
+
return true;
|
|
120
|
+
} catch (error) {
|
|
121
|
+
logger?.error?.('run_execution_failed', {
|
|
122
|
+
runId: run?.runId || null,
|
|
123
|
+
error: errorMeta(error),
|
|
124
|
+
});
|
|
125
|
+
if (once) throw error;
|
|
126
|
+
console.error(`Dexter run ${run?.runId || 'unknown'} failed; continuing to poll.`);
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
110
131
|
function wait(delayMs) {
|
|
111
132
|
return new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
112
133
|
}
|
|
@@ -340,14 +361,19 @@ async function startCommand({ apiBaseUrl, config, flags, configDir }) {
|
|
|
340
361
|
if (poll.run) {
|
|
341
362
|
console.log(`Claimed run ${poll.run.runId}.`);
|
|
342
363
|
const runAgent = normalizeAgentName(poll.run?.companion?.agent || agent);
|
|
343
|
-
await
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
364
|
+
await executeClaimedRun({
|
|
365
|
+
run: poll.run,
|
|
366
|
+
once,
|
|
367
|
+
logger: pollLogger,
|
|
368
|
+
executeOptions: {
|
|
369
|
+
apiBaseUrl,
|
|
370
|
+
deviceToken,
|
|
371
|
+
agent: runAgent,
|
|
372
|
+
selectedModel: model,
|
|
373
|
+
providerAdapter: providerAdapterForAgent(runAgent),
|
|
374
|
+
env: bridgeEnv,
|
|
375
|
+
maxSteps: flags['max-steps'],
|
|
376
|
+
},
|
|
351
377
|
});
|
|
352
378
|
if (once) return;
|
|
353
379
|
continue;
|
|
@@ -424,6 +450,7 @@ export async function runCli(argv) {
|
|
|
424
450
|
export const __private__ = {
|
|
425
451
|
agentEnvironment,
|
|
426
452
|
clearInvalidPairing,
|
|
453
|
+
executeClaimedRun,
|
|
427
454
|
isInvalidPairingError,
|
|
428
455
|
parseArgv,
|
|
429
456
|
pollBackoffMs,
|