import {
  createProject
} from "./chunk-B6UV3JVI.js";
import "./chunk-CAY57CKF.js";
import "./chunk-KOO5733S.js";

// src/tools/create-project.ts
async function handleCreateProject(params) {
  if (!params.teamId && !params.newTeamName) {
    return "Error: You must provide either `teamId` (to add to an existing team) or `newTeamName` (to create a new team for this project).";
  }
  const result = await createProject({
    name: params.name,
    language: params.language,
    framework: params.framework,
    teamId: params.teamId,
    newTeamName: params.newTeamName
  });
  if (!result.serviceApiKey) {
    throw new Error(
      "API did not return a service API key. The project was created but the key is missing \u2014 check the LangWatch UI."
    );
  }
  const lines = [];
  lines.push(`Project created successfully!
`);
  lines.push(`**Name**: ${result.name}`);
  lines.push(`**ID**: ${result.id}`);
  lines.push(`**Slug**: ${result.slug}`);
  lines.push(`**Language**: ${result.language}`);
  lines.push(`**Framework**: ${result.framework}`);
  lines.push("");
  lines.push(`**Service API Key**: \`${result.serviceApiKey}\``);
  lines.push(`**Service API Key ID**: ${result.serviceApiKeyId}`);
  lines.push("");
  lines.push(
    "> \u26A0\uFE0F Save the service API key now \u2014 it will not be shown again. Use it as `LANGWATCH_API_KEY` to authenticate project-scoped operations."
  );
  return lines.join("\n");
}
export {
  handleCreateProject
};
//# sourceMappingURL=create-project-BF7LMZH5.js.map