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/crew.mjs CHANGED
@@ -2055,6 +2055,22 @@ var init_crew_adapter = __esm({
2055
2055
  }
2056
2056
  }
2057
2057
  async writeFile(params) {
2058
+ const isAbsolute = params.file_path.startsWith("/");
2059
+ if (isAbsolute) {
2060
+ try {
2061
+ const { mkdir: mkdir26, writeFile: writeFile26 } = await import("node:fs/promises");
2062
+ const { dirname: dirname9 } = await import("node:path");
2063
+ const dir = dirname9(params.file_path);
2064
+ await mkdir26(dir, { recursive: true });
2065
+ await writeFile26(params.file_path, params.content, "utf8");
2066
+ return {
2067
+ success: true,
2068
+ output: `Wrote ${params.file_path} (${params.content.length} bytes)`
2069
+ };
2070
+ } catch (err) {
2071
+ return { success: false, error: `Write failed: ${err.message}` };
2072
+ }
2073
+ }
2058
2074
  const fullPath = resolve3(this.config.getWorkspaceRoot(), params.file_path);
2059
2075
  const wsRoot = resolve3(this.config.getWorkspaceRoot());
2060
2076
  if (!fullPath.startsWith(wsRoot + "/") && fullPath !== wsRoot) {
@@ -4224,7 +4240,11 @@ async function runAgenticWorker(task, sandbox, options = {}) {
4224
4240
  );
4225
4241
  return {
4226
4242
  success: result2.success ?? false,
4227
- output: result2.finalResponse ?? result2.history?.map((h) => String(h.result)).join("\n") ?? "",
4243
+ output: result2.finalResponse ?? result2.history?.map((h) => {
4244
+ if (!h.result) return "";
4245
+ if (typeof h.result === "string") return h.result;
4246
+ return h.result.output || h.result.error || JSON.stringify(h.result);
4247
+ }).filter(Boolean).join("\n") ?? "",
4228
4248
  cost: totalCost,
4229
4249
  turns: result2.turns,
4230
4250
  toolsUsed: Array.from(toolsUsed),