naro-mcp 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +27 -19
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -15458,18 +15458,6 @@ var DESTRUCTIVE = "\u26A0 DESTRUCTIVE: ";
15458
15458
  function str(value) {
15459
15459
  return typeof value === "string" && value.length > 0 ? value : void 0;
15460
15460
  }
15461
- async function gitConnection(projectId, deps) {
15462
- try {
15463
- const client = await deps.client();
15464
- const project = await client.projects.get(projectId);
15465
- if (project.repositoryFullName)
15466
- return { state: "connected", fullName: project.repositoryFullName };
15467
- const parsed = parseGitHubRemote(project.repositoryUrl);
15468
- return parsed ? { state: "available", fullName: parsed.fullName } : { state: "none" };
15469
- } catch {
15470
- return { state: "none" };
15471
- }
15472
- }
15473
15461
  var TOOLS = [
15474
15462
  {
15475
15463
  name: "whoami",
@@ -15557,7 +15545,7 @@ var TOOLS = [
15557
15545
  },
15558
15546
  {
15559
15547
  name: "deploy",
15560
- description: "Deploys a local project to Naro (create_deployment): registers the deployment, builds the Next.js app locally, uploads the artifact and waits for the live URL. Preview by default; production:true publishes to the main domain. If the user is not logged in and no NARO_TOKEN is set, a browser window opens for GitHub sign-in \u2014 tell the user to approve it. Local .env files are never uploaded. If the result lists missingEnvKeys, set each one with set_environment_variable before relying on the deployment. When gitConnection.state is 'available', ask the user whether their changes should deploy automatically from now on, and call connect_git_repository if they agree \u2014 do not connect without asking.",
15548
+ description: "Deploys a local project to Naro (create_deployment): registers the deployment, builds the Next.js app locally, uploads the artifact and waits for the live URL. Preview by default; production:true publishes to the main domain. If the user is not logged in and no NARO_TOKEN is set, a browser window opens for GitHub sign-in \u2014 tell the user to approve it. Local .env files are never uploaded. If the result lists missingEnvKeys, set each one with set_environment_variable before relying on the deployment. If the result has needsTeam, nothing was deployed: show the listed teams, ask the user which one should own the project, and call deploy again with `team` set \u2014 never pick one yourself. When gitConnection.state is 'available', ask the user whether their changes should deploy automatically from now on, and call connect_git_repository if they agree \u2014 do not connect without asking. When it is 'unreachable', tell the user the Naro GitHub App is not installed on gitConnection.repoOwner for this team and that connecting requires installing it there \u2014 do not call connect_git_repository, it will fail.",
15561
15549
  inputSchema: {
15562
15550
  type: "object",
15563
15551
  properties: {
@@ -15580,18 +15568,34 @@ var TOOLS = [
15580
15568
  branch: {
15581
15569
  type: "string",
15582
15570
  description: "Override the recorded git branch. Usually omit \u2014 the current branch is detected."
15571
+ },
15572
+ team: {
15573
+ type: "string",
15574
+ description: "Slug of the team that owns the project. Required for a directory's first deploy \u2014 ask the user which team and pass their answer; never guess."
15583
15575
  }
15584
15576
  }
15585
15577
  },
15586
15578
  handler: async (args, deps) => {
15587
15579
  const directory = str(args.directory) ?? deps.cwd();
15588
15580
  const link = readProjectLink(directory);
15581
+ const client = await deps.client();
15582
+ const teams = await client.teams.list();
15583
+ const requested = str(args.team) ?? link?.teamSlug;
15584
+ const team = requested ? teams.find((candidate) => candidate.slug === requested) : void 0;
15585
+ if (!team) {
15586
+ return {
15587
+ needsTeam: true,
15588
+ message: requested ? `You are not a member of team "${requested}". Ask the user which of these teams to use.` : "Ask the user which team should own this project, then call deploy again with `team` set.",
15589
+ teams
15590
+ };
15591
+ }
15589
15592
  const logs = [];
15590
15593
  const result = await deps.deploy(
15591
15594
  directory,
15592
15595
  {
15593
15596
  name: str(args.name),
15594
15597
  projectId: link?.projectId,
15598
+ teamSlug: team.slug,
15595
15599
  production: args.production === true,
15596
15600
  rootDirectory: str(args.rootDirectory) ?? null,
15597
15601
  branch: str(args.branch)
@@ -15600,18 +15604,22 @@ var TOOLS = [
15600
15604
  },
15601
15605
  (message) => logs.push(message)
15602
15606
  );
15603
- if (!link) {
15604
- writeProjectLink(directory, { projectId: result.projectId });
15605
- ensureGitignoreHasNaro(directory);
15606
- }
15607
+ writeProjectLink(directory, {
15608
+ projectId: result.projectId,
15609
+ teamSlug: result.teamSlug,
15610
+ projectName: result.projectSlug,
15611
+ ...link?.autoDeployDeclined === true ? { autoDeployDeclined: true } : {}
15612
+ });
15613
+ if (!link) ensureGitignoreHasNaro(directory);
15607
15614
  return {
15608
15615
  deploymentId: result.deploymentId,
15609
15616
  projectId: result.projectId,
15610
15617
  status: result.status,
15611
15618
  url: result.url,
15612
15619
  target: result.production ? "production" : "preview",
15620
+ teamSlug: result.teamSlug,
15613
15621
  missingEnvKeys: result.missingEnvKeys,
15614
- gitConnection: await gitConnection(result.projectId, deps),
15622
+ gitConnection: result.gitConnection,
15615
15623
  logs
15616
15624
  };
15617
15625
  }
@@ -16030,7 +16038,7 @@ function toolErrorJson(error51) {
16030
16038
  // src/server.ts
16031
16039
  function createServer2(deps) {
16032
16040
  const server = new Server(
16033
- { name: "naro", version: "0.4.0" },
16041
+ { name: "naro", version: "0.5.0" },
16034
16042
  { capabilities: { tools: {} } }
16035
16043
  );
16036
16044
  server.setRequestHandler(ListToolsRequestSchema, () => ({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naro-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "naro-mcp": "./dist/index.js"
@@ -15,7 +15,7 @@
15
15
  "dependencies": {
16
16
  "@modelcontextprotocol/sdk": "^1.0.0",
17
17
  "@supabase/supabase-js": "2.112.3",
18
- "naro-cli": "0.4.0"
18
+ "naro-cli": "0.5.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "tsup": "8.5.0",