"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var skyRampExport_exports = {};
__export(skyRampExport_exports, {
  buildJsonlContent: () => buildJsonlContent,
  trackedActionToJsonl: () => trackedActionToJsonl,
  writeSkyrampZip: () => writeSkyrampZip
});
module.exports = __toCommonJS(skyRampExport_exports);
var import_crypto = __toESM(require("crypto"));
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_zipBundle = require("playwright-core/lib/zipBundle");
var import_utils = require("playwright-core/lib/utils");
const DEFAULT_PAGE_ALIAS = "page";
const DEFAULT_FRAME_PATH = [];
function modifiersArrayToMask(modifiers) {
  if (!modifiers || modifiers.length === 0)
    return 0;
  let mask = 0;
  for (const mod of modifiers) {
    if (mod === "Alt") mask |= 1;
    else if (mod === "Control") mask |= 2;
    else if (mod === "Meta") mask |= 4;
    else if (mod === "Shift") mask |= 8;
    else if (mod === "ControlOrMeta") mask |= 6;
  }
  return mask;
}
function jsonlHeader(browserName, harPath) {
  return JSON.stringify({
    browserName,
    launchOptions: { headless: false },
    contextOptions: {
      ignoreHTTPSErrors: true,
      recordHar: { path: harPath, mode: "minimal" },
      serviceWorkers: "block"
    },
    generateAutoExpect: false
  });
}
function extractLocatorFromCode(code) {
  const extensionFrameMatch = code.match(
    /await\s+page\.frames\(\)\.find\(\s*f\s*=>\s*f\.url\(\)\.includes\(\s*(['"])([^'"]+)\1\s*\)\s*\)!?\.(.*?)\.(click|dblclick|fill|pressSequentially|check|uncheck|selectOption|hover|dragTo)\s*\(/s
  );
  if (extensionFrameMatch) {
    return {
      locatorExpr: extensionFrameMatch[3].trim(),
      framePath: [],
      frameUrlMatch: extensionFrameMatch[2]
    };
  }
  const contentFrameMatch = code.match(/await\s+page\.locator\((['"])(iframe[^\n]*?)\1\)(?:\.contentFrame\(\))+\.(.*?)\.(click|dblclick|fill|pressSequentially|check|uncheck|selectOption|hover|dragTo)\s*\(/s);
  if (contentFrameMatch) {
    return { locatorExpr: contentFrameMatch[3].trim(), framePath: [contentFrameMatch[2]] };
  }
  const chainedIframeMatch = code.match(/await\s+page\.locator\((['"])(iframe[^\n]*?)\1\)\.(get\w+\(.*?)\.(click|dblclick|fill|pressSequentially|check|uncheck|selectOption|hover|dragTo)\s*\(/s);
  if (chainedIframeMatch) {
    return { locatorExpr: chainedIframeMatch[3].trim(), framePath: [chainedIframeMatch[2]] };
  }
  const match = code.match(/await\s+page\.(.*?)\.(click|dblclick|fill|pressSequentially|check|uncheck|selectOption|hover|dragTo)\s*\(/s);
  if (!match)
    return void 0;
  return { locatorExpr: match[1].trim(), framePath: [] };
}
function locatorToJsonl(locatorExpr) {
  const chainParts = locatorExpr.split(/\)\.(?=get)/);
  if (chainParts.length > 1) {
    const parts = chainParts.map((p, i) => i < chainParts.length - 1 ? p + ")" : p);
    const parsed = parts.map((p) => parseSingleLocator(p));
    if (parsed.some((p) => !p))
      return void 0;
    const selector = parsed.map((p) => p.selector).join(" >> ");
    const locator = { ...parsed[0].locator };
    let current = locator;
    for (let i = 1; i < parsed.length; i++) {
      current.next = { ...parsed[i].locator };
      current = current.next;
    }
    return { selector, locator };
  }
  return parseSingleLocator(locatorExpr);
}
function parseSingleLocator(expr) {
  const roleMatch = expr.match(/^getByRole\(\s*'([^']+)'(?:\s*,\s*\{([^}]*)\})?\s*\)/);
  if (roleMatch) {
    const role = roleMatch[1];
    const opts = roleMatch[2] || "";
    const nameMatch = opts.match(/name:\s*(?:'([^']*)'|"([^"]*)")/);
    const exactMatch = opts.match(/exact:\s*(true|false)/);
    const name = nameMatch ? nameMatch[1] ?? nameMatch[2] : void 0;
    const exact = exactMatch ? exactMatch[1] === "true" : false;
    const selector = name ? `internal:role=${role}[name="${name}"${exact ? "" : "i"}]` : `internal:role=${role}`;
    return {
      selector,
      locator: { kind: "role", body: role, options: { attrs: [], exact, ...name !== void 0 ? { name } : {} } }
    };
  }
  const textMatch = expr.match(/^getByText\(\s*(?:'([^']*)'|"([^"]*)")\s*(?:,\s*\{([^}]*)\})?\s*\)/);
  if (textMatch) {
    const text = textMatch[1] ?? textMatch[2];
    const opts = textMatch[3] || "";
    const exactMatch = opts.match(/exact:\s*(true|false)/);
    const exact = exactMatch ? exactMatch[1] === "true" : false;
    return {
      selector: `internal:text="${text}"${exact ? "s" : "i"}`,
      locator: { kind: "text", body: text, options: { exact } }
    };
  }
  const labelMatch = expr.match(/^getByLabel\(\s*(?:'([^']*)'|"([^"]*)")\s*(?:,\s*\{([^}]*)\})?\s*\)/);
  if (labelMatch) {
    const label = labelMatch[1] ?? labelMatch[2];
    const opts = labelMatch[3] || "";
    const exactMatch = opts.match(/exact:\s*(true|false)/);
    const exact = exactMatch ? exactMatch[1] === "true" : false;
    return {
      selector: `internal:label="${label}"${exact ? "s" : "i"}`,
      locator: { kind: "label", body: label, options: { exact } }
    };
  }
  const placeholderMatch = expr.match(/^getByPlaceholder\(\s*(?:'([^']*)'|"([^"]*)")\s*(?:,\s*\{([^}]*)\})?\s*\)/);
  if (placeholderMatch) {
    const placeholder = placeholderMatch[1] ?? placeholderMatch[2];
    return {
      selector: `internal:attr=[placeholder="${placeholder}"i]`,
      locator: { kind: "placeholder", body: placeholder, options: {} }
    };
  }
  const testIdMatch = expr.match(/^getByTestId\(\s*(?:'([^']*)'|"([^"]*)")\s*\)/);
  if (testIdMatch) {
    const testId = testIdMatch[1] ?? testIdMatch[2];
    return {
      selector: `internal:testid=[data-testid="${testId}"s]`,
      locator: { kind: "test-id", body: testId, options: {} }
    };
  }
  const cssMatch = expr.match(/^locator\(\s*(?:'([^']*)'|"([^"]*)")\s*\)/);
  if (cssMatch) {
    const css = cssMatch[1] ?? cssMatch[2];
    return {
      selector: css,
      locator: { kind: "css", body: css, options: {} }
    };
  }
  const altMatch = expr.match(/^getByAltText\(\s*(?:'([^']*)'|"([^"]*)")\s*\)/);
  if (altMatch) {
    const alt = altMatch[1] ?? altMatch[2];
    return {
      selector: `internal:attr=[alt="${alt}"i]`,
      locator: { kind: "alt", body: alt, options: {} }
    };
  }
  const titleMatch = expr.match(/^getByTitle\(\s*(?:'([^']*)'|"([^"]*)")\s*\)/);
  if (titleMatch) {
    const title = titleMatch[1] ?? titleMatch[2];
    return {
      selector: `internal:attr=[title="${title}"i]`,
      locator: { kind: "title", body: title, options: {} }
    };
  }
  return void 0;
}
function extractFillText(code) {
  const match = code.match(/\.(fill|pressSequentially)\('((?:[^'\\]|\\.)*)'\)/);
  if (!match)
    return "";
  return match[2].replace(/\\'/g, "'").replace(/\\\\/g, "\\");
}
function extractSelectOptions(code) {
  const match = code.match(/\.selectOption\('((?:[^'\\]|\\.)*)'\)/);
  if (match)
    return [match[1]];
  return [];
}
function trackedActionToJsonl(action, pageGuid, timestamp) {
  const { toolName, args, code } = action;
  const pageAlias = action.pageAlias ?? DEFAULT_PAGE_ALIAS;
  const signals = action.popupAlias ? [{ name: "popup", popupAlias: action.popupAlias }] : [];
  const base = {
    signals,
    timestamp: String(timestamp),
    pageGuid,
    pageAlias,
    framePath: action.framePath ?? DEFAULT_FRAME_PATH
  };
  if (toolName === "browser_navigate")
    return JSON.stringify({ name: "navigate", url: args.url, ...base });
  if (toolName === "browser_navigate_back")
    return null;
  if (toolName === "browser_wait_for") {
    const text = args.text;
    const textGone = args.textGone;
    const time = args.time;
    if (text)
      return JSON.stringify({ name: "waitForSelector", selector: `text=${text}`, ...base });
    if (textGone)
      return JSON.stringify({ name: "waitForSelector", selector: `text=${textGone}`, state: "hidden", ...base });
    if (typeof time === "number")
      return JSON.stringify({ name: "waitForTimeout", duration: time * 1e3, ...base });
    return null;
  }
  if (toolName === "browser_press_key")
    return JSON.stringify({ name: "press", key: args.key, selector: "", ...base });
  if (!code)
    return null;
  const extracted = extractLocatorFromCode(code);
  if (!extracted)
    return null;
  const { locatorExpr, framePath: codeFramePath, frameUrlMatch } = extracted;
  if (codeFramePath.length > 0)
    base.framePath = codeFramePath;
  if (frameUrlMatch)
    base.frameUrlMatch = frameUrlMatch;
  const parsed = locatorToJsonl(locatorExpr);
  if (!parsed)
    return null;
  const { selector, locator: locatorObj } = parsed;
  if (toolName === "browser_click") {
    const isDouble = code.includes(".dblclick(");
    const modifiers = modifiersArrayToMask(args.modifiers);
    return JSON.stringify({
      name: "click",
      selector,
      button: args.button ?? "left",
      modifiers,
      clickCount: isDouble ? 2 : 1,
      locator: locatorObj,
      ...base
    });
  }
  if (toolName === "browser_hover")
    return JSON.stringify({ name: "hover", selector, locator: locatorObj, ...base });
  if (toolName === "browser_type" || toolName === "browser_press_sequentially") {
    const text = args.text ?? extractFillText(code);
    const name = toolName === "browser_press_sequentially" || args.slowly ? "pressSequentially" : "fill";
    return JSON.stringify({ name, selector, text, locator: locatorObj, ...base });
  }
  if (toolName === "browser_fill_form") {
    return null;
  }
  if (toolName === "browser_set_checked") {
    return JSON.stringify({
      name: args.checked ? "check" : "uncheck",
      selector,
      locator: locatorObj,
      ...base
    });
  }
  if (toolName === "browser_select_option") {
    const options = args.values ?? extractSelectOptions(code);
    return JSON.stringify({ name: "select", selector, options, locator: locatorObj, ...base });
  }
  if (toolName === "browser_drag") {
    const dragMatch = code.match(/await\s+page\.(.*?)\.dragTo\(page\.(.*?)\);?$/s);
    if (!dragMatch)
      return null;
    const sourceExpr = dragMatch[1].trim();
    const targetExpr = dragMatch[2].trim();
    const sourceInfo = locatorToJsonl(sourceExpr);
    const targetInfo = locatorToJsonl(targetExpr);
    if (!sourceInfo || !targetInfo)
      return null;
    return JSON.stringify({
      name: "dragAndDrop",
      source: sourceInfo.selector,
      target: targetInfo.selector,
      locator: sourceInfo.locator,
      targetLocator: targetInfo.locator,
      ...base
    });
  }
  return null;
}
function assertActionToJsonl(action, pageGuid, timestamp) {
  const { args, code } = action;
  const assertType = args.type;
  const base = {
    signals: [],
    timestamp: String(timestamp),
    pageGuid,
    pageAlias: DEFAULT_PAGE_ALIAS,
    framePath: DEFAULT_FRAME_PATH
  };
  const parts = code.split(":");
  const selectorPart = parts[1] || "";
  let selector = "";
  let expected = "";
  let substring = true;
  if (assertType === "visible") {
    selector = parts.slice(1).join(":");
  } else if (assertType === "text") {
    substring = parts[parts.length - 1] === "true";
    expected = parts[parts.length - 2] || "";
    selector = parts.slice(1, parts.length - 2).join(":");
  } else if (assertType === "value") {
    expected = parts[parts.length - 1] || "";
    selector = parts.slice(1, parts.length - 1).join(":");
  }
  const locator = selectorToLocator(selector);
  switch (assertType) {
    case "text":
      return JSON.stringify({ name: "assertText", selector, text: expected, substring, locator, ...base });
    case "visible":
      return JSON.stringify({ name: "assertVisible", selector, locator, ...base });
    case "value":
      return JSON.stringify({ name: "assertValue", selector, value: expected, locator, ...base });
    default:
      return null;
  }
}
function selectorToLocator(selector) {
  const testidMatch = selector.match(/internal:testid=\[data-testid="([^"]+)"/);
  if (testidMatch)
    return { kind: "test-id", body: testidMatch[1], options: {} };
  const roleMatch = selector.match(/internal:role=(\w+)\[name="([^"]+)"([is])?\]/);
  if (roleMatch)
    return { kind: "role", body: roleMatch[1], options: { attrs: [], exact: roleMatch[3] === "s", name: roleMatch[2] } };
  const roleOnlyMatch = selector.match(/internal:role=(\w+)$/);
  if (roleOnlyMatch)
    return { kind: "role", body: roleOnlyMatch[1], options: { attrs: [] } };
  const textMatch = selector.match(/internal:text="([^"]+)"([is])?/);
  if (textMatch)
    return { kind: "text", body: textMatch[1], options: { exact: textMatch[2] === "s" } };
  return {};
}
function fillFormToJsonl(action, pageGuid, baseTimestamp) {
  const { args } = action;
  if (!args.fields)
    return [];
  return args.fields.map((field, i) => {
    const locatorExpr = `getByLabel('${field.name}')`;
    const parsed = locatorToJsonl(locatorExpr);
    const selector = parsed?.selector || field.ref;
    const locatorObj = parsed?.locator;
    return JSON.stringify({
      name: field.type === "checkbox" || field.type === "radio" ? field.value === "true" ? "check" : "uncheck" : "fill",
      selector: selector || field.ref,
      text: field.value,
      ...locatorObj ? { locator: locatorObj } : {},
      signals: [],
      timestamp: String(baseTimestamp + i),
      pageGuid,
      pageAlias: DEFAULT_PAGE_ALIAS,
      framePath: DEFAULT_FRAME_PATH
    });
  });
}
function removeRedundantClicks(actions) {
  return actions.filter((action, i) => {
    if (action.toolName !== "browser_click")
      return true;
    const next = actions[i + 1];
    if (!next || !["browser_type", "browser_fill"].includes(next.toolName))
      return true;
    const clickRef = action.args?.ref;
    const fillRef = next.args?.ref;
    if (!clickRef || !fillRef || clickRef !== fillRef)
      return true;
    if (next.args?.slowly || next.code.includes(".pressSequentially("))
      return true;
    return false;
  });
}
function deduplicateRetries(actions) {
  const result = [];
  let lastNavIdx = -1;
  for (const action of actions) {
    if (action.toolName !== "browser_navigate") {
      result.push(action);
      continue;
    }
    const url = action.args.url;
    if (lastNavIdx >= 0 && result[lastNavIdx].args.url === url) {
      result.length = lastNavIdx;
      lastNavIdx = -1;
      for (let k = result.length - 1; k >= 0; k--) {
        if (result[k].toolName === "browser_navigate") {
          lastNavIdx = k;
          break;
        }
      }
    }
    result.push(action);
    lastNavIdx = result.length - 1;
  }
  return result;
}
function normalizePrimaryPageAlias(actions) {
  const DEFAULT = DEFAULT_PAGE_ALIAS;
  const counts = /* @__PURE__ */ new Map();
  for (const a of actions) {
    const alias = a.pageAlias ?? DEFAULT;
    counts.set(alias, (counts.get(alias) ?? 0) + 1);
  }
  if ((counts.get(DEFAULT) ?? 0) > 0)
    return;
  const candidates = [...counts.keys()].filter((a) => /^page\d+$/.test(a));
  if (candidates.length !== 1)
    return;
  const from = candidates[0];
  for (const a of actions) {
    if (a.pageAlias === from)
      a.pageAlias = DEFAULT;
    if (a.popupAlias === from)
      a.popupAlias = DEFAULT;
  }
}
function buildJsonlContent(actions, browserName, harPath) {
  normalizePrimaryPageAlias(actions);
  const deduplicated = removeRedundantClicks(deduplicateRetries(actions));
  const startTime = deduplicated[0]?.timestamp ?? Date.now();
  const pageGuids = /* @__PURE__ */ new Map();
  const getPageGuid = (alias) => {
    if (!pageGuids.has(alias))
      pageGuids.set(alias, `page@${import_crypto.default.randomBytes(16).toString("hex")}`);
    return pageGuids.get(alias);
  };
  const mainGuid = getPageGuid(DEFAULT_PAGE_ALIAS);
  const lines = [
    jsonlHeader(browserName, harPath),
    JSON.stringify({ name: "openPage", url: "about:blank", signals: [], timestamp: String(startTime - 1e3), pageGuid: mainGuid, pageAlias: DEFAULT_PAGE_ALIAS, framePath: DEFAULT_FRAME_PATH })
  ];
  let actionCount = 0;
  const skipped = [];
  const openedAliases = /* @__PURE__ */ new Set([DEFAULT_PAGE_ALIAS]);
  let hadPopupFills = false;
  for (const action of deduplicated) {
    const alias = action.pageAlias ?? DEFAULT_PAGE_ALIAS;
    const pageGuid = getPageGuid(alias);
    if (action.popupAlias && !openedAliases.has(action.popupAlias)) {
      const popupGuid = getPageGuid(action.popupAlias);
      lines.push(JSON.stringify({ name: "openPage", url: "about:blank", signals: [], timestamp: String(action.timestamp), pageGuid: popupGuid, pageAlias: action.popupAlias, framePath: DEFAULT_FRAME_PATH }));
      openedAliases.add(action.popupAlias);
    }
    if (alias !== DEFAULT_PAGE_ALIAS && !openedAliases.has(alias)) {
      for (let i = lines.length - 1; i >= 0; i--) {
        try {
          const obj = JSON.parse(lines[i]);
          if (obj.name === "openPage" || obj.name === "closePage")
            continue;
          if (!obj.pageAlias)
            continue;
          if (obj.pageAlias !== alias) {
            obj.signals = [...obj.signals || [], { name: "popup", popupAlias: alias }];
            lines[i] = JSON.stringify(obj);
            break;
          }
        } catch {
          break;
        }
      }
      const popupGuid = getPageGuid(alias);
      lines.push(JSON.stringify({ name: "openPage", url: "about:blank", signals: [], timestamp: String(action.timestamp), pageGuid: popupGuid, pageAlias: alias, framePath: DEFAULT_FRAME_PATH }));
      openedAliases.add(alias);
    }
    if ((action.toolName === "browser_type" || action.toolName === "browser_fill") && alias !== DEFAULT_PAGE_ALIAS)
      hadPopupFills = true;
    if (action.toolName === "browser_fill_form") {
      const formLines = fillFormToJsonl(action, pageGuid, action.timestamp);
      lines.push(...formLines);
      actionCount += formLines.length;
      continue;
    }
    if (action.toolName === "browser_assert") {
      const assertLine = assertActionToJsonl(action, pageGuid, action.timestamp);
      if (assertLine) {
        lines.push(assertLine);
        actionCount++;
      }
      continue;
    }
    if ((action.toolName === "browser_type" || action.toolName === "browser_press_sequentially") && action.args.submit) {
      const fillLine = trackedActionToJsonl(action, pageGuid, action.timestamp);
      if (fillLine) {
        lines.push(fillLine);
        actionCount++;
      }
      const parsed = extractLocatorFromCode(action.code);
      if (parsed) {
        const { locatorExpr, framePath, frameUrlMatch } = parsed;
        const locatorInfo = locatorToJsonl(locatorExpr);
        if (locatorInfo) {
          const { selector, locator: locatorObj } = locatorInfo;
          const pressLine = JSON.stringify({
            name: "press",
            selector,
            key: "Enter",
            locator: locatorObj,
            signals: [],
            timestamp: String(action.timestamp + 100),
            pageGuid,
            pageAlias: alias,
            framePath,
            ...frameUrlMatch ? { frameUrlMatch } : {}
          });
          lines.push(pressLine);
          actionCount++;
        }
      }
      continue;
    }
    if (action.toolName === "browser_navigate" && alias === DEFAULT_PAGE_ALIAS && hadPopupFills) {
      lines.push(JSON.stringify({ name: "waitForTimeout", duration: 3e4, signals: [], timestamp: String(action.timestamp - 1), pageGuid, pageAlias: alias, framePath: DEFAULT_FRAME_PATH }));
      actionCount++;
      hadPopupFills = false;
    }
    const line = trackedActionToJsonl(action, pageGuid, action.timestamp);
    if (line) {
      lines.push(line);
      actionCount++;
    } else {
      skipped.push(action.toolName);
    }
  }
  lines.push(JSON.stringify({ name: "closePage", signals: [], timestamp: String(Date.now()), pageGuid: mainGuid, pageAlias: DEFAULT_PAGE_ALIAS, framePath: DEFAULT_FRAME_PATH }));
  return { jsonl: lines.join("\n") + "\n", actionCount, skipped };
}
const CROSS_PAGE_URL_BLOCKLIST = [
  "/app_init",
  "notes.services.box.com"
];
function filterHarEntries(harContent) {
  try {
    const har = JSON.parse(harContent);
    const entries = har?.log?.entries ?? [];
    har.log.entries = entries.filter((entry) => {
      const url = entry?.request?.url ?? "";
      if (CROSS_PAGE_URL_BLOCKLIST.some((pattern) => url.includes(pattern)))
        return false;
      const text = entry?.response?.content?.text;
      if (!text || text.trim() === "")
        return false;
      try {
        JSON.parse(text);
        return true;
      } catch {
        return false;
      }
    });
    return JSON.stringify(har);
  } catch {
    return harContent;
  }
}
async function writeSkyrampZip(outputZipPath, jsonlContent, harPath) {
  const zipFile = new import_zipBundle.yazl.ZipFile();
  const done = new import_utils.ManualPromise();
  zipFile.on("error", (e) => done.reject(e));
  zipFile.addBuffer(Buffer.from(jsonlContent, "utf-8"), "skyramp_playwright.txt");
  if (await import_fs.default.promises.stat(harPath).then(() => true).catch(() => false)) {
    const rawHar = await import_fs.default.promises.readFile(harPath, "utf-8");
    zipFile.addBuffer(Buffer.from(filterHarEntries(rawHar), "utf-8"), "skyramp_network.har");
  } else {
    zipFile.addBuffer(Buffer.from('{"log":{"version":"1.2","creator":{"name":"Playwright","version":"1.0"},"entries":[]}}', "utf-8"), "skyramp_network.har");
  }
  zipFile.end();
  await import_fs.default.promises.mkdir(import_path.default.dirname(outputZipPath), { recursive: true });
  zipFile.outputStream.pipe(import_fs.default.createWriteStream(outputZipPath)).on("close", () => done.resolve()).on("error", (e) => done.reject(e));
  await done;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  buildJsonlContent,
  trackedActionToJsonl,
  writeSkyrampZip
});
