crewswarm-cli 0.1.0 → 0.2.1

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),
@@ -16867,7 +16887,9 @@ async function startRepl(options) {
16867
16887
  let selectedMode = options.initialMode || repoConfig?.repl?.mode || "manual";
16868
16888
  if (!options.initialMode && !repoConfig?.repl?.mode && process.stdin.isTTY) {
16869
16889
  try {
16870
- const modeAnswer = await (await getInquirer()).prompt([
16890
+ console.log("");
16891
+ const inquirer = await getInquirer();
16892
+ const modeAnswer = await inquirer.prompt([
16871
16893
  {
16872
16894
  type: "list",
16873
16895
  name: "mode",
@@ -16894,7 +16916,8 @@ async function startRepl(options) {
16894
16916
  }
16895
16917
  ]);
16896
16918
  selectedMode = modeAnswer.mode;
16897
- } catch {
16919
+ } catch (err) {
16920
+ console.error("[repl] Mode picker failed, using manual:", err.message);
16898
16921
  selectedMode = "manual";
16899
16922
  }
16900
16923
  }
@@ -16903,7 +16926,8 @@ async function startRepl(options) {
16903
16926
  let selectedInterfaceMode = options.initialInterfaceMode || (envInterfaceMode === "connected" ? "connected" : envInterfaceMode === "standalone" ? "standalone" : repoDefaultInterface);
16904
16927
  if (options.promptInterfaceMode && process.stdin.isTTY) {
16905
16928
  try {
16906
- const ifaceAnswer = await (await getInquirer()).prompt([
16929
+ const inquirer2 = await getInquirer();
16930
+ const ifaceAnswer = await inquirer2.prompt([
16907
16931
  {
16908
16932
  type: "list",
16909
16933
  name: "interfaceMode",