import { d as defineEventHandler, u as useKubbAgentContext, a as serializePluginOptions } from '../../nitro/nitro.mjs';
import { readFileSync } from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { v as version } from '../../_/package.mjs';
import 'node:http';
import 'node:https';
import 'node:events';
import 'node:buffer';
import 'node:crypto';
import 'node:perf_hooks';
import 'fs-extra';
import 'js-runtime';
import 'node:module';
import '@kubb/react-fabric';
import '@kubb/react-fabric/parsers';
import '@kubb/react-fabric/plugins';
import 'node:os';
import 'node:url';
import 'semver';
import 'natural-orderby';
import 'execa';
import 'string-argv';
import 'jiti';
import 'node:async_hooks';

const info_get = defineEventHandler(async () => {
  var _a;
  const { config } = useKubbAgentContext();
  let specContent;
  if (config && "path" in config.input) {
    const specPath = path.resolve(process.cwd(), config.root, config.input.path);
    try {
      specContent = readFileSync(specPath, "utf-8");
    } catch {
    }
  }
  return {
    version,
    configPath: process.env.KUBB_CONFIG || "",
    spec: specContent,
    config: {
      name: config.name,
      root: config.root,
      input: {
        path: "path" in config.input ? config.input.path : void 0
      },
      output: {
        path: config.output.path,
        write: config.output.write,
        extension: config.output.extension,
        barrelType: config.output.barrelType
      },
      plugins: (_a = config.plugins) == null ? void 0 : _a.map((plugin) => ({
        name: `@kubb/${plugin.name}`,
        options: serializePluginOptions(plugin.options)
      }))
    }
  };
});

export { info_get as default };
//# sourceMappingURL=info.get.mjs.map
