@withone/cli 1.13.8 → 1.13.9

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.
@@ -451,6 +451,11 @@ function createSandboxedRequire() {
451
451
  return cache[clean];
452
452
  };
453
453
  }
454
+ function stripCodeFences(text) {
455
+ const trimmed = text.trim();
456
+ const match = trimmed.match(/^```(?:\w*)\s*\n([\s\S]*?)\n\s*```\s*$/);
457
+ return match ? match[1].trim() : trimmed;
458
+ }
454
459
  async function executeActionStep(step, context, api, permissions, allowedActionIds) {
455
460
  const action = step.action;
456
461
  const platform = resolveValue(action.platform, context);
@@ -607,7 +612,7 @@ function executeFileReadStep(step, context) {
607
612
  const filePath = resolveValue(config.path, context);
608
613
  const resolvedPath = path.resolve(filePath);
609
614
  const content = fs.readFileSync(resolvedPath, "utf-8");
610
- const output = config.parseJson ? JSON.parse(content) : content;
615
+ const output = config.parseJson ? JSON.parse(stripCodeFences(content)) : content;
611
616
  return { status: "success", output, response: output };
612
617
  }
613
618
  function executeFileWriteStep(step, context) {
@@ -662,7 +667,7 @@ async function executeSubflowStep(step, context, api, permissions, allowedAction
662
667
  if (flowStack.includes(resolvedKey)) {
663
668
  throw new Error(`Circular flow detected: ${[...flowStack, resolvedKey].join(" \u2192 ")}`);
664
669
  }
665
- const { loadFlow: loadFlow2 } = await import("./flow-runner-5ZBACWKL.js");
670
+ const { loadFlow: loadFlow2 } = await import("./flow-runner-Y6GBCOM7.js");
666
671
  const subFlow = loadFlow2(resolvedKey);
667
672
  const subContext = await executeFlow(
668
673
  subFlow,
@@ -743,7 +748,7 @@ async function executeBashStep(step, context, options) {
743
748
  env,
744
749
  maxBuffer: 10 * 1024 * 1024
745
750
  });
746
- const output = config.parseJson ? JSON.parse(stdout) : stdout.trim();
751
+ const output = config.parseJson ? JSON.parse(stripCodeFences(stdout)) : stdout.trim();
747
752
  return {
748
753
  status: "success",
749
754
  output,
@@ -4,7 +4,7 @@ import {
4
4
  loadFlow,
5
5
  resolveFlowPath,
6
6
  saveFlow
7
- } from "./chunk-T54OTDAW.js";
7
+ } from "./chunk-GEQRZGKM.js";
8
8
  export {
9
9
  FlowRunner,
10
10
  listFlows,
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  loadFlow,
12
12
  resolveFlowPath,
13
13
  saveFlow
14
- } from "./chunk-T54OTDAW.js";
14
+ } from "./chunk-GEQRZGKM.js";
15
15
 
16
16
  // src/index.ts
17
17
  import { createRequire as createRequire2 } from "module";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withone/cli",
3
- "version": "1.13.8",
3
+ "version": "1.13.9",
4
4
  "description": "CLI for managing One",
5
5
  "type": "module",
6
6
  "files": [