@agentfield/sdk 0.1.85-rc.6 → 0.1.85-rc.8
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/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -572,15 +572,15 @@ var init_opencode = __esm({
|
|
|
572
572
|
this.bin = binPath;
|
|
573
573
|
}
|
|
574
574
|
async execute(prompt, options) {
|
|
575
|
-
const cmd = [this.bin];
|
|
575
|
+
const cmd = [this.bin, "run"];
|
|
576
576
|
if (options.cwd && typeof options.cwd === "string") {
|
|
577
|
-
cmd.push("
|
|
577
|
+
cmd.push("--dir", options.cwd);
|
|
578
578
|
} else if (options.project_dir && typeof options.project_dir === "string") {
|
|
579
|
-
cmd.push("
|
|
579
|
+
cmd.push("--dir", options.project_dir);
|
|
580
580
|
}
|
|
581
581
|
const env = { ...options.env };
|
|
582
582
|
if (options.model) {
|
|
583
|
-
|
|
583
|
+
cmd.push("-m", String(options.model));
|
|
584
584
|
}
|
|
585
585
|
let effectivePrompt = prompt;
|
|
586
586
|
if (options.system_prompt && typeof options.system_prompt === "string" && options.system_prompt.trim()) {
|
|
@@ -592,7 +592,7 @@ ${options.system_prompt.trim()}
|
|
|
592
592
|
USER REQUEST:
|
|
593
593
|
${prompt}`;
|
|
594
594
|
}
|
|
595
|
-
cmd.push(
|
|
595
|
+
cmd.push(effectivePrompt);
|
|
596
596
|
const startApi = Date.now();
|
|
597
597
|
try {
|
|
598
598
|
const { stdout, stderr, exitCode } = await runCli(cmd, { env });
|