crewswarm-cli 0.1.0 → 0.2.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/engine.mjs CHANGED
@@ -813,6 +813,22 @@ var init_crew_adapter = __esm({
813
813
  }
814
814
  }
815
815
  async writeFile(params) {
816
+ const isAbsolute = params.file_path.startsWith("/");
817
+ if (isAbsolute) {
818
+ try {
819
+ const { mkdir: mkdir4, writeFile: writeFile4 } = await import("node:fs/promises");
820
+ const { dirname: dirname4 } = await import("node:path");
821
+ const dir = dirname4(params.file_path);
822
+ await mkdir4(dir, { recursive: true });
823
+ await writeFile4(params.file_path, params.content, "utf8");
824
+ return {
825
+ success: true,
826
+ output: `Wrote ${params.file_path} (${params.content.length} bytes)`
827
+ };
828
+ } catch (err) {
829
+ return { success: false, error: `Write failed: ${err.message}` };
830
+ }
831
+ }
816
832
  const fullPath = resolve2(this.config.getWorkspaceRoot(), params.file_path);
817
833
  const wsRoot = resolve2(this.config.getWorkspaceRoot());
818
834
  if (!fullPath.startsWith(wsRoot + "/") && fullPath !== wsRoot) {
@@ -2982,7 +2998,11 @@ async function runAgenticWorker(task, sandbox, options = {}) {
2982
2998
  );
2983
2999
  return {
2984
3000
  success: result.success ?? false,
2985
- output: result.finalResponse ?? result.history?.map((h) => String(h.result)).join("\n") ?? "",
3001
+ output: result.finalResponse ?? result.history?.map((h) => {
3002
+ if (!h.result) return "";
3003
+ if (typeof h.result === "string") return h.result;
3004
+ return h.result.output || h.result.error || JSON.stringify(h.result);
3005
+ }).filter(Boolean).join("\n") ?? "",
2986
3006
  cost: totalCost,
2987
3007
  turns: result.turns,
2988
3008
  toolsUsed: Array.from(toolsUsed),