agent-worker 0.8.0 → 0.9.0
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/{backends-rQZxF7Fl.mjs → backends-BOAkfYyL.mjs} +41 -12
- package/dist/{backends-CoOMoMcP.mjs → backends-e6gCxRZ9.mjs} +1 -1
- package/dist/cli/index.mjs +9 -9
- package/dist/index.d.mts +9 -3
- package/dist/index.mjs +2 -2
- package/dist/{skills-ks27oet6.mjs → skills-xNmQZf8e.mjs} +1 -1
- package/dist/{workflow-B_y98Ood.mjs → workflow-CoZnnJ3O.mjs} +13 -4
- package/package.json +1 -1
|
@@ -345,8 +345,12 @@ async function execWithIdleTimeout(options) {
|
|
|
345
345
|
subprocess.stdout?.on("data", (chunk) => {
|
|
346
346
|
const text = chunk.toString();
|
|
347
347
|
stdout += text;
|
|
348
|
-
if (onStdout) onStdout(text);
|
|
349
348
|
resetTimer();
|
|
349
|
+
if (onStdout) try {
|
|
350
|
+
onStdout(text);
|
|
351
|
+
} catch (err) {
|
|
352
|
+
console.error("onStdout callback error:", err);
|
|
353
|
+
}
|
|
350
354
|
});
|
|
351
355
|
subprocess.stderr?.on("data", (chunk) => {
|
|
352
356
|
stderr += chunk.toString();
|
|
@@ -393,8 +397,12 @@ function execWithIdleTimeoutAbortable(options) {
|
|
|
393
397
|
subprocess.stdout?.on("data", (chunk) => {
|
|
394
398
|
const text = chunk.toString();
|
|
395
399
|
stdout += text;
|
|
396
|
-
if (onStdout) onStdout(text);
|
|
397
400
|
resetTimer();
|
|
401
|
+
if (onStdout) try {
|
|
402
|
+
onStdout(text);
|
|
403
|
+
} catch (err) {
|
|
404
|
+
console.error("onStdout callback error:", err);
|
|
405
|
+
}
|
|
398
406
|
});
|
|
399
407
|
subprocess.stderr?.on("data", (chunk) => {
|
|
400
408
|
stderr += chunk.toString();
|
|
@@ -481,6 +489,9 @@ function formatEvent(event, backendName) {
|
|
|
481
489
|
if (details.length > 0) parts.push(`(${details.join(", ")})`);
|
|
482
490
|
return parts.join(" ");
|
|
483
491
|
}
|
|
492
|
+
case "user_message": return `User: ${event.text.length > 80 ? event.text.slice(0, 80) + "..." : event.text}`;
|
|
493
|
+
case "assistant_message": return `Assistant: ${event.text.length > 80 ? event.text.slice(0, 80) + "..." : event.text}`;
|
|
494
|
+
case "skip": return null;
|
|
484
495
|
case "unknown": {
|
|
485
496
|
const preview = JSON.stringify(event.raw).slice(0, 100);
|
|
486
497
|
return `[DEBUG] ${backendName} unknown event type="${event.type}": ${preview}...`;
|
|
@@ -502,6 +513,14 @@ const claudeAdapter = (raw) => {
|
|
|
502
513
|
model: event.model,
|
|
503
514
|
sessionId: event.session_id
|
|
504
515
|
};
|
|
516
|
+
if (event.type === "user") {
|
|
517
|
+
const textContent = event.message.content.find((c) => c.type === "text");
|
|
518
|
+
if (textContent && "text" in textContent) return {
|
|
519
|
+
kind: "user_message",
|
|
520
|
+
text: textContent.text
|
|
521
|
+
};
|
|
522
|
+
return { kind: "skip" };
|
|
523
|
+
}
|
|
505
524
|
if (event.type === "assistant") {
|
|
506
525
|
const toolCalls = event.message.content.filter((c) => c.type === "tool_use");
|
|
507
526
|
if (toolCalls.length > 0) {
|
|
@@ -512,7 +531,7 @@ const claudeAdapter = (raw) => {
|
|
|
512
531
|
args: formatToolInput(tc.input)
|
|
513
532
|
};
|
|
514
533
|
}
|
|
515
|
-
return
|
|
534
|
+
return { kind: "skip" };
|
|
516
535
|
}
|
|
517
536
|
if (event.type === "result") return {
|
|
518
537
|
kind: "completed",
|
|
@@ -560,6 +579,14 @@ const cursorAdapter = (raw) => {
|
|
|
560
579
|
model: event.model,
|
|
561
580
|
sessionId: event.session_id
|
|
562
581
|
};
|
|
582
|
+
if (event.type === "user") return {
|
|
583
|
+
kind: "user_message",
|
|
584
|
+
text: event.message.content.map((c) => c.text).join("\n")
|
|
585
|
+
};
|
|
586
|
+
if (event.type === "assistant") return {
|
|
587
|
+
kind: "assistant_message",
|
|
588
|
+
text: event.message.content.map((c) => c.text).join("\n")
|
|
589
|
+
};
|
|
563
590
|
if (event.type === "tool_call") {
|
|
564
591
|
if (event.subtype === "started" && event.tool_call) {
|
|
565
592
|
if (event.tool_call.shellToolCall) return {
|
|
@@ -573,7 +600,7 @@ const cursorAdapter = (raw) => {
|
|
|
573
600
|
callId: event.call_id
|
|
574
601
|
};
|
|
575
602
|
}
|
|
576
|
-
return
|
|
603
|
+
return { kind: "skip" };
|
|
577
604
|
}
|
|
578
605
|
if (event.type === "result") return {
|
|
579
606
|
kind: "completed",
|
|
@@ -602,7 +629,7 @@ const codexAdapter = (raw) => {
|
|
|
602
629
|
name: event.item.name,
|
|
603
630
|
args: event.item.arguments
|
|
604
631
|
};
|
|
605
|
-
return
|
|
632
|
+
return { kind: "skip" };
|
|
606
633
|
}
|
|
607
634
|
if (event.type === "turn.completed") return {
|
|
608
635
|
kind: "completed",
|
|
@@ -632,13 +659,14 @@ function extractCodexResult(stdout) {
|
|
|
632
659
|
* Create a line-buffered stream parser.
|
|
633
660
|
*
|
|
634
661
|
* Accumulates stdout chunks, parses each line through the given adapter,
|
|
635
|
-
* and emits formatted progress messages via
|
|
662
|
+
* and emits formatted progress messages via appropriate callback.
|
|
636
663
|
*
|
|
637
|
-
* @param debugLog - Callback for
|
|
664
|
+
* @param debugLog - Callback for debug messages (kind="debug", only in --debug mode)
|
|
638
665
|
* @param backendName - Display name (e.g., "Cursor", "Claude", "Codex")
|
|
639
666
|
* @param adapter - Format-specific adapter to convert raw JSON → StreamEvent
|
|
667
|
+
* @param messageLog - Optional callback for agent output messages (tool calls, assistant messages) (kind="stream", visible in normal mode). If not provided, uses debugLog.
|
|
640
668
|
*/
|
|
641
|
-
function createStreamParser(debugLog, backendName, adapter) {
|
|
669
|
+
function createStreamParser(debugLog, backendName, adapter, messageLog) {
|
|
642
670
|
let lineBuf = "";
|
|
643
671
|
return (chunk) => {
|
|
644
672
|
lineBuf += chunk;
|
|
@@ -656,7 +684,7 @@ function createStreamParser(debugLog, backendName, adapter) {
|
|
|
656
684
|
};
|
|
657
685
|
if (event) {
|
|
658
686
|
const progress = formatEvent(event, backendName);
|
|
659
|
-
if (progress) debugLog(progress);
|
|
687
|
+
if (progress) ((event.kind === "tool_call" || event.kind === "tool_call_started" || event.kind === "user_message" || event.kind === "assistant_message") && messageLog ? messageLog : debugLog)(progress);
|
|
660
688
|
}
|
|
661
689
|
} catch {}
|
|
662
690
|
}
|
|
@@ -720,7 +748,7 @@ var ClaudeCodeBackend = class {
|
|
|
720
748
|
args,
|
|
721
749
|
cwd,
|
|
722
750
|
timeout,
|
|
723
|
-
onStdout: outputFormat === "stream-json" && debugLog ? createStreamParser(debugLog, "Claude", claudeAdapter) : void 0
|
|
751
|
+
onStdout: outputFormat === "stream-json" && debugLog ? createStreamParser(debugLog, "Claude", claudeAdapter, this.options.messageLog) : void 0
|
|
724
752
|
});
|
|
725
753
|
this.currentAbort = abort;
|
|
726
754
|
const { stdout } = await promise;
|
|
@@ -844,7 +872,7 @@ var CodexBackend = class {
|
|
|
844
872
|
args,
|
|
845
873
|
cwd,
|
|
846
874
|
timeout,
|
|
847
|
-
onStdout: debugLog ? createStreamParser(debugLog, "Codex", codexAdapter) : void 0
|
|
875
|
+
onStdout: debugLog ? createStreamParser(debugLog, "Codex", codexAdapter, this.options.messageLog) : void 0
|
|
848
876
|
});
|
|
849
877
|
return extractCodexResult(stdout);
|
|
850
878
|
} catch (error) {
|
|
@@ -925,6 +953,7 @@ var CursorBackend = class {
|
|
|
925
953
|
const { command, args } = await this.buildCommand(message);
|
|
926
954
|
const cwd = this.options.workspace || this.options.cwd;
|
|
927
955
|
const debugLog = this.options.debugLog;
|
|
956
|
+
const messageLog = this.options.messageLog;
|
|
928
957
|
const timeout = this.options.timeout ?? DEFAULT_IDLE_TIMEOUT;
|
|
929
958
|
try {
|
|
930
959
|
const { stdout } = await execWithIdleTimeout({
|
|
@@ -932,7 +961,7 @@ var CursorBackend = class {
|
|
|
932
961
|
args,
|
|
933
962
|
cwd,
|
|
934
963
|
timeout,
|
|
935
|
-
onStdout: debugLog ? createStreamParser(debugLog, "Cursor", cursorAdapter) : void 0
|
|
964
|
+
onStdout: debugLog ? createStreamParser(debugLog, "Cursor", cursorAdapter, messageLog) : void 0
|
|
936
965
|
});
|
|
937
966
|
return extractClaudeResult(stdout);
|
|
938
967
|
} catch (error) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { C as SDK_MODEL_ALIASES, S as CURSOR_MODEL_MAP, _ as execWithIdleTimeout, a as createMockBackend, b as CLAUDE_MODEL_MAP, c as CodexBackend, d as codexAdapter, f as createStreamParser, g as IdleTimeoutError, h as formatEvent, i as MockAIBackend, l as ClaudeCodeBackend, m as extractCodexResult, n as createBackend, o as SdkBackend, p as extractClaudeResult, r as listBackends, s as CursorBackend, t as checkBackends, u as claudeAdapter, v as DEFAULT_IDLE_TIMEOUT, w as getModelForBackend, x as CODEX_MODEL_MAP, y as BACKEND_DEFAULT_MODELS } from "./backends-
|
|
1
|
+
import { C as SDK_MODEL_ALIASES, S as CURSOR_MODEL_MAP, _ as execWithIdleTimeout, a as createMockBackend, b as CLAUDE_MODEL_MAP, c as CodexBackend, d as codexAdapter, f as createStreamParser, g as IdleTimeoutError, h as formatEvent, i as MockAIBackend, l as ClaudeCodeBackend, m as extractCodexResult, n as createBackend, o as SdkBackend, p as extractClaudeResult, r as listBackends, s as CursorBackend, t as checkBackends, u as claudeAdapter, v as DEFAULT_IDLE_TIMEOUT, w as getModelForBackend, x as CODEX_MODEL_MAP, y as BACKEND_DEFAULT_MODELS } from "./backends-BOAkfYyL.mjs";
|
|
2
2
|
|
|
3
3
|
export { listBackends };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { A as getDefaultModel, E as FRONTIER_MODELS, n as createBackend } from "../backends-
|
|
3
|
-
import { a as createSkillsTool, c as createFeedbackTool, l as AgentSession, o as SkillsProvider, s as FEEDBACK_PROMPT, t as SkillImporter } from "../skills-
|
|
2
|
+
import { A as getDefaultModel, E as FRONTIER_MODELS, n as createBackend } from "../backends-BOAkfYyL.mjs";
|
|
3
|
+
import { a as createSkillsTool, c as createFeedbackTool, l as AgentSession, o as SkillsProvider, s as FEEDBACK_PROMPT, t as SkillImporter } from "../skills-xNmQZf8e.mjs";
|
|
4
4
|
import { jsonSchema, tool } from "ai";
|
|
5
5
|
import { existsSync, mkdirSync, readFileSync, readdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
6
6
|
import { dirname, isAbsolute, join, relative } from "node:path";
|
|
@@ -673,7 +673,7 @@ var ContextProviderImpl = class {
|
|
|
673
673
|
if (options?.agent) {
|
|
674
674
|
const agent = options.agent;
|
|
675
675
|
entries = entries.filter((e) => {
|
|
676
|
-
if (e.kind === "log" || e.kind === "debug") return false;
|
|
676
|
+
if (e.kind === "log" || e.kind === "debug" || e.kind === "stream") return false;
|
|
677
677
|
if (e.to) return e.to === agent || e.from === agent;
|
|
678
678
|
return true;
|
|
679
679
|
});
|
|
@@ -719,7 +719,7 @@ var ContextProviderImpl = class {
|
|
|
719
719
|
let seenIdx = -1;
|
|
720
720
|
if (lastSeenId) seenIdx = entries.findIndex((e) => e.id === lastSeenId);
|
|
721
721
|
return entries.filter((e) => {
|
|
722
|
-
if (e.kind === "log" || e.kind === "debug") return false;
|
|
722
|
+
if (e.kind === "log" || e.kind === "debug" || e.kind === "stream") return false;
|
|
723
723
|
if (e.from === agent) return false;
|
|
724
724
|
return e.mentions.includes(agent) || e.to === agent;
|
|
725
725
|
}).map((entry) => {
|
|
@@ -2157,7 +2157,7 @@ Examples:
|
|
|
2157
2157
|
|
|
2158
2158
|
Note: Workflow name is inferred from YAML 'name' field or filename
|
|
2159
2159
|
`).action(async (file, options) => {
|
|
2160
|
-
const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-
|
|
2160
|
+
const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-CoZnnJ3O.mjs");
|
|
2161
2161
|
const tag = options.tag || DEFAULT_TAG;
|
|
2162
2162
|
const parsedWorkflow = await parseWorkflowFile(file, { tag });
|
|
2163
2163
|
const workflowName = parsedWorkflow.name;
|
|
@@ -2168,7 +2168,7 @@ Note: Workflow name is inferred from YAML 'name' field or filename
|
|
|
2168
2168
|
isCleaningUp = true;
|
|
2169
2169
|
console.log("\nInterrupted, cleaning up...");
|
|
2170
2170
|
if (controllers) {
|
|
2171
|
-
const { shutdownControllers } = await import("../workflow-
|
|
2171
|
+
const { shutdownControllers } = await import("../workflow-CoZnnJ3O.mjs");
|
|
2172
2172
|
const { createSilentLogger } = await import("../logger-C3ekEOzi.mjs");
|
|
2173
2173
|
await shutdownControllers(controllers, createSilentLogger());
|
|
2174
2174
|
}
|
|
@@ -2238,7 +2238,7 @@ Examples:
|
|
|
2238
2238
|
|
|
2239
2239
|
Note: Workflow name is inferred from YAML 'name' field or filename
|
|
2240
2240
|
`).action(async (file, options) => {
|
|
2241
|
-
const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-
|
|
2241
|
+
const { parseWorkflowFile, runWorkflowWithControllers } = await import("../workflow-CoZnnJ3O.mjs");
|
|
2242
2242
|
const tag = options.tag || DEFAULT_TAG;
|
|
2243
2243
|
const parsedWorkflow = await parseWorkflowFile(file, { tag });
|
|
2244
2244
|
const workflowName = parsedWorkflow.name;
|
|
@@ -2433,7 +2433,7 @@ function registerInfoCommands(program) {
|
|
|
2433
2433
|
console.log(`\nDefault: ${defaultModel} (when no model specified)`);
|
|
2434
2434
|
});
|
|
2435
2435
|
program.command("backends").description("Check available backends (SDK, CLI tools)").action(async () => {
|
|
2436
|
-
const { listBackends } = await import("../backends-
|
|
2436
|
+
const { listBackends } = await import("../backends-e6gCxRZ9.mjs");
|
|
2437
2437
|
const backends = await listBackends();
|
|
2438
2438
|
console.log("Backend Status:\n");
|
|
2439
2439
|
for (const backend of backends) {
|
|
@@ -2581,7 +2581,7 @@ Note: Requires agent to be created with --feedback flag
|
|
|
2581
2581
|
|
|
2582
2582
|
//#endregion
|
|
2583
2583
|
//#region package.json
|
|
2584
|
-
var version = "0.
|
|
2584
|
+
var version = "0.9.0";
|
|
2585
2585
|
|
|
2586
2586
|
//#endregion
|
|
2587
2587
|
//#region src/cli/index.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -473,8 +473,10 @@ interface ClaudeCodeOptions {
|
|
|
473
473
|
timeout?: number;
|
|
474
474
|
/** MCP config file path (for workflow context) */
|
|
475
475
|
mcpConfigPath?: string;
|
|
476
|
-
/** Debug log function (for
|
|
476
|
+
/** Debug log function (for tool calls and debug info) */
|
|
477
477
|
debugLog?: (message: string) => void;
|
|
478
|
+
/** Message log function (for agent messages - user/assistant) */
|
|
479
|
+
messageLog?: (message: string) => void;
|
|
478
480
|
}
|
|
479
481
|
declare class ClaudeCodeBackend implements Backend {
|
|
480
482
|
readonly type: "claude";
|
|
@@ -520,8 +522,10 @@ interface CodexOptions {
|
|
|
520
522
|
resume?: string;
|
|
521
523
|
/** Idle timeout in milliseconds — kills process if no output for this duration */
|
|
522
524
|
timeout?: number;
|
|
523
|
-
/** Debug log function (for
|
|
525
|
+
/** Debug log function (for tool calls and debug info) */
|
|
524
526
|
debugLog?: (message: string) => void;
|
|
527
|
+
/** Message log function (for agent messages - user/assistant) */
|
|
528
|
+
messageLog?: (message: string) => void;
|
|
525
529
|
}
|
|
526
530
|
declare class CodexBackend implements Backend {
|
|
527
531
|
readonly type: "codex";
|
|
@@ -556,8 +560,10 @@ interface CursorOptions {
|
|
|
556
560
|
workspace?: string;
|
|
557
561
|
/** Idle timeout in milliseconds — kills process if no output for this duration */
|
|
558
562
|
timeout?: number;
|
|
559
|
-
/** Debug log function (for
|
|
563
|
+
/** Debug log function (for tool calls and debug info) */
|
|
560
564
|
debugLog?: (message: string) => void;
|
|
565
|
+
/** Message log function (for agent messages - user/assistant) */
|
|
566
|
+
messageLog?: (message: string) => void;
|
|
561
567
|
}
|
|
562
568
|
declare class CursorBackend implements Backend {
|
|
563
569
|
readonly type: "cursor";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as SUPPORTED_PROVIDERS, E as FRONTIER_MODELS, O as createModel, a as createMockBackend, c as CodexBackend, i as MockAIBackend, k as createModelAsync, l as ClaudeCodeBackend, n as createBackend, o as SdkBackend, r as listBackends, s as CursorBackend, t as checkBackends } from "./backends-
|
|
2
|
-
import { a as createSkillsTool, c as createFeedbackTool, i as parseImportSpec, l as AgentSession, n as buildGitUrl, o as SkillsProvider, r as getSpecDisplayName, s as FEEDBACK_PROMPT, t as SkillImporter } from "./skills-
|
|
1
|
+
import { D as SUPPORTED_PROVIDERS, E as FRONTIER_MODELS, O as createModel, a as createMockBackend, c as CodexBackend, i as MockAIBackend, k as createModelAsync, l as ClaudeCodeBackend, n as createBackend, o as SdkBackend, r as listBackends, s as CursorBackend, t as checkBackends } from "./backends-BOAkfYyL.mjs";
|
|
2
|
+
import { a as createSkillsTool, c as createFeedbackTool, i as parseImportSpec, l as AgentSession, n as buildGitUrl, o as SkillsProvider, r as getSpecDisplayName, s as FEEDBACK_PROMPT, t as SkillImporter } from "./skills-xNmQZf8e.mjs";
|
|
3
3
|
import { jsonSchema, tool } from "ai";
|
|
4
4
|
import { createBashTool } from "bash-tool";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as createModelAsync } from "./backends-
|
|
1
|
+
import { k as createModelAsync } from "./backends-BOAkfYyL.mjs";
|
|
2
2
|
import { ToolLoopAgent, jsonSchema, stepCountIs, tool } from "ai";
|
|
3
3
|
import { existsSync, readFileSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import { join, normalize } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as parseModel, a as createMockBackend, k as createModelAsync, n as createBackend } from "./backends-
|
|
1
|
+
import { T as parseModel, a as createMockBackend, k as createModelAsync, n as createBackend } from "./backends-BOAkfYyL.mjs";
|
|
2
2
|
import { c as CONTEXT_DEFAULTS, i as resolveContextDir, n as createFileContextProvider, t as FileContextProvider } from "./cli/index.mjs";
|
|
3
3
|
import { a as createMemoryContextProvider, t as createContextMCPServer } from "./mcp-server-BQCQxv2v.mjs";
|
|
4
4
|
import { createChannelLogger, createSilentLogger } from "./logger-C3ekEOzi.mjs";
|
|
@@ -1025,10 +1025,11 @@ async function runAgent(backend, ctx, log, infoLog) {
|
|
|
1025
1025
|
}
|
|
1026
1026
|
const prompt = buildAgentPrompt(ctx);
|
|
1027
1027
|
info(`Prompt (${prompt.length} chars) → ${backend.type} backend`);
|
|
1028
|
-
await backend.send(prompt, { system: ctx.agent.resolvedSystemPrompt });
|
|
1028
|
+
const response = await backend.send(prompt, { system: ctx.agent.resolvedSystemPrompt });
|
|
1029
1029
|
return {
|
|
1030
1030
|
success: true,
|
|
1031
|
-
duration: Date.now() - startTime
|
|
1031
|
+
duration: Date.now() - startTime,
|
|
1032
|
+
content: response.content
|
|
1032
1033
|
};
|
|
1033
1034
|
} catch (error) {
|
|
1034
1035
|
return {
|
|
@@ -1067,6 +1068,7 @@ function getBackendByType(backendType, options) {
|
|
|
1067
1068
|
const backendOptions = {};
|
|
1068
1069
|
if (options?.timeout) backendOptions.timeout = options.timeout;
|
|
1069
1070
|
if (options?.debugLog) backendOptions.debugLog = options.debugLog;
|
|
1071
|
+
if (options?.messageLog) backendOptions.messageLog = options.messageLog;
|
|
1070
1072
|
return createBackend({
|
|
1071
1073
|
type: backendType,
|
|
1072
1074
|
model: options?.model,
|
|
@@ -1575,14 +1577,21 @@ async function runWorkflowWithControllers(config) {
|
|
|
1575
1577
|
const backendDebugLog = (msg) => {
|
|
1576
1578
|
agentLogger.debug(msg);
|
|
1577
1579
|
};
|
|
1580
|
+
const backendMessageLog = (msg) => {
|
|
1581
|
+
runtime.contextProvider.appendChannel(agentName, msg, { kind: "stream" }).catch(() => {});
|
|
1582
|
+
};
|
|
1578
1583
|
let backend;
|
|
1579
1584
|
if (createBackend) backend = createBackend(agentName, agentDef);
|
|
1580
1585
|
else if (agentDef.backend) backend = getBackendByType(agentDef.backend, {
|
|
1581
1586
|
model: agentDef.model,
|
|
1582
1587
|
debugLog: backendDebugLog,
|
|
1588
|
+
messageLog: backendMessageLog,
|
|
1583
1589
|
timeout: agentDef.timeout
|
|
1584
1590
|
});
|
|
1585
|
-
else if (agentDef.model) backend = getBackendForModel(agentDef.model, {
|
|
1591
|
+
else if (agentDef.model) backend = getBackendForModel(agentDef.model, {
|
|
1592
|
+
debugLog: backendDebugLog,
|
|
1593
|
+
messageLog: backendMessageLog
|
|
1594
|
+
});
|
|
1586
1595
|
else throw new Error(`Agent "${agentName}" requires either a backend or model field`);
|
|
1587
1596
|
logger.debug(`Using backend: ${backend.type} for ${agentName}`);
|
|
1588
1597
|
const workspaceDir = join(runtime.contextDir, "workspaces", agentName);
|