// Force strict mode and setup for ESM
"use strict";
import {
  init_esbuild_shims
} from "./chunk-5O2XNYP6.js";
import {
  __name
} from "./chunk-J2S4EL5Y.js";

// packages/acp-bridge/src/workspacePaths.ts
init_esbuild_shims();
import { realpathSync } from "node:fs";
import * as path from "node:path";
function canonicalizeWorkspace(p) {
  const resolved = path.resolve(p);
  try {
    return realpathSync.native(resolved);
  } catch (err) {
    if (err && typeof err === "object" && err.code === "ENOENT") {
      return resolved;
    }
    throw err;
  }
}
__name(canonicalizeWorkspace, "canonicalizeWorkspace");
function canonicalizeWorkspaces(paths) {
  const out = [];
  const seen = /* @__PURE__ */ new Set();
  for (const p of paths) {
    const canonical = canonicalizeWorkspace(p);
    if (seen.has(canonical)) continue;
    seen.add(canonical);
    out.push(canonical);
  }
  return out;
}
__name(canonicalizeWorkspaces, "canonicalizeWorkspaces");
var MAX_WORKSPACE_PATH_LENGTH = 4096;

export {
  canonicalizeWorkspace,
  canonicalizeWorkspaces,
  MAX_WORKSPACE_PATH_LENGTH
};
/**
 * @license
 * Copyright 2025 Qwen Team
 * SPDX-License-Identifier: Apache-2.0
 */
