import { createRequire as _createRequire } from 'node:module';
const require = _createRequire(import.meta.url);
import {
  createBiLogger,
  reportCommandStartEvent
} from "./chunk-VC5Q2AI5.js";
import {
  createEnv,
  wixCliCliError
} from "./chunk-TOBTRYZF.js";
import {
  getUnknownFailureMessage,
  isCliSystemError
} from "./chunk-MTT3QXBC.js";
import {
  init_esm_shims
} from "./chunk-EXLZF52D.js";

// package.json
var package_default = {
  name: "@wix/cli",
  description: "CLI tool for building Wix sites and applications",
  version: "1.1.199",
  bin: {
    wix: "bin/wix.cjs"
  },
  dependencies: {
    "node-gyp": "^8.4.1"
  },
  devDependencies: {
    "@commander-js/extra-typings": "^13.0.0",
    "@types/columnify": "^1.5.4",
    "@types/react": "^18.3.3",
    "@types/semver": "^7.5.8",
    "@vercel/detect-agent": "^1.2.1",
    "@wix/bi-logger-dev-tools-data": "^1.169.0",
    "@wix/cli-astro-commands": "workspace:*",
    "@wix/cli-auth": "workspace:*",
    "@wix/cli-command-contract": "workspace:*",
    "@wix/cli-core-definitions": "workspace:*",
    "@wix/cli-debug-log": "workspace:*",
    "@wix/cli-env": "workspace:*",
    "@wix/cli-error": "workspace:*",
    "@wix/cli-error-reporting": "workspace:*",
    "@wix/cli-fs": "workspace:*",
    "@wix/cli-http-client-react": "workspace:*",
    "@wix/cli-logger": "workspace:*",
    "@wix/cli-panorama": "workspace:*",
    "@wix/cli-site": "workspace:*",
    "@wix/cli-site-live": "workspace:*",
    "@wix/cli-site-old": "workspace:*",
    "@wix/cli-telemetry": "workspace:*",
    "@wix/cli-telemetry-react": "workspace:*",
    "@wix/cli-test-overrides": "workspace:*",
    "@wix/cli-ui-kit": "workspace:*",
    "@wix/cli-user-config": "workspace:*",
    "@wix/cli-version-manager": "workspace:*",
    "@wix/tsup-configs": "workspace:*",
    chalk: "^5.4.1",
    columnify: "^1.6.0",
    commander: "^13.0.0",
    globby: "^14.1.0",
    react: "^18.3.1",
    semver: "^7.6.3",
    variant: "^3.0.0-dev.27",
    zod: "^3.24.2"
  },
  engines: {
    node: ">= 20.11.0"
  },
  files: [
    "bin",
    "build",
    "templates",
    "agents"
  ],
  keywords: [
    "wix",
    "wix-cli"
  ],
  optionalDependencies: {
    fsevents: "^2.3.2"
  },
  perfer: {
    bundleSize: {
      files: [
        {
          glob: "./build/index.js",
          maxSize: "985kb"
        }
      ]
    }
  },
  publishConfig: {
    registry: "https://registry.npmjs.org/",
    access: "public",
    versionBumpStrategy: "manual",
    logLevel: "verbose"
  },
  scripts: {
    build: "run -T tsup",
    "build:watch": "run -T build:watch --filter='@wix/cli'",
    test: "yarn workspace @wix/cli-core-spec run test",
    "test:watch": "yarn workspace @wix/cli-core-spec run test:watch",
    typecheck: "run -T tsc --noEmit"
  },
  type: "module",
  wix: {
    artifact: {
      groupId: "com.wixpress.npm",
      artifactId: "wix-cli"
    },
    validations: {
      postBuild: [
        "typecheck"
      ]
    }
  }
};

// src/bi.ts
init_esm_shims();
var createBiLogger2 = async (cliSessionId, errorReporter, userId, aiAgentName) => {
  const { cliEnvName, cliTrackingId } = createEnv();
  const biLogger = await createBiLogger({
    aiAgentName,
    cliEnvName,
    cliSessionId,
    cliTrackingId,
    userId
  });
  errorReporter.on("errorReported", (error) => {
    void biLogger.report(
      wixCliCliError({
        errorMessage: getUnknownFailureMessage(error),
        errorName: error.name,
        errorType: isCliSystemError(error) ? "SystemError" : "UserError"
      })
    );
  });
  return {
    biLogger
  };
};
var reportCommandStartEvent2 = (biLogger, command) => {
  return reportCommandStartEvent({
    biLogger,
    cliVersion: package_default.version,
    command,
    flow: null
  });
};

export {
  package_default,
  createBiLogger2 as createBiLogger,
  reportCommandStartEvent2 as reportCommandStartEvent
};
//# sourceMappingURL=chunk-54RFHRDU.js.map