next-anteater 0.2.21 → 0.2.23

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.
@@ -1 +1 @@
1
- {"version":3,"file":"anteater-bar.d.ts","sourceRoot":"","sources":["../../src/components/anteater-bar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAC;AAkL9D,wBAAgB,WAAW,CAAC,EAC1B,WAA6B,EAC7B,IAAa,EACb,WAAoC,EACpC,MAAM,GACP,EAAE,gBAAgB,2CAuOlB"}
1
+ {"version":3,"file":"anteater-bar.d.ts","sourceRoot":"","sources":["../../src/components/anteater-bar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAe,MAAM,UAAU,CAAC;AAkL9D,wBAAgB,WAAW,CAAC,EAC1B,WAA6B,EAC7B,IAAa,EACb,WAAoC,EACpC,MAAM,GACP,EAAE,gBAAgB,2CAsOlB"}
@@ -111,19 +111,18 @@ export function AnteaterBar({ apiEndpoint = "/api/anteater", mode = "prod", plac
111
111
  const handleSubmit = async (e) => {
112
112
  if (e)
113
113
  e.preventDefault();
114
- if (!prompt.trim() || submitting)
114
+ const text = prompt.trim();
115
+ if (!text || submitting)
115
116
  return;
116
- const result = await submit({
117
- prompt: prompt.trim(),
117
+ setPrompt("");
118
+ await submit({
119
+ prompt: text,
118
120
  mode,
119
121
  branch,
120
122
  context: {
121
123
  pathname: typeof window !== "undefined" ? window.location.pathname : undefined,
122
124
  },
123
125
  });
124
- if (result) {
125
- setPrompt("");
126
- }
127
126
  };
128
127
  const handleButtonClick = () => {
129
128
  if (!isExpanded) {
@@ -1 +1 @@
1
- {"version":3,"file":"anteater-bar.js","sourceRoot":"","sources":["../../src/components/anteater-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;A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Q;wCACxB,SAAS,EAAE,OAAO;4CAChB,CAAC,CAAC,qEAAqE;4CACvE,CAAC,CAAC,+BAA+B;wCACnC,UAAU,EAAE,eAAe;qCAC5B,EACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;wCAClB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,aAAa,CAAC;wCAChD,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO;4CACvC,CAAC,CAAC,oEAAoE;4CACtE,CAAC,CAAC,+BAA+B,CAAC;oCACtC,CAAC,EACD,YAAY,EAAE,CAAC,CAAC,EAAE,EAAE;wCAClB,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC;wCAC7C,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO;4CACvC,CAAC,CAAC,qEAAqE;4CACvE,CAAC,CAAC,+BAA+B,CAAC;oCACtC,CAAC,YAEA,OAAO,CAAC,CAAC,CAAC,CACT,KAAC,QAAQ,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,MAAM,GAAG,CACpC,CAAC,CAAC,CAAC,CACF,KAAC,YAAY,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,MAAM,GAAG,CACxC,GACM,IACL,IACF,GACF,IACL,CACJ,CAAC;AACJ,CAAC"}
package/lib/scaffold.mjs CHANGED
@@ -682,7 +682,7 @@ export function generateClaudeSettings({ model, permissionsMode }) {
682
682
  /**
683
683
  * Generate the GitHub Actions workflow.
684
684
  */
685
- export function generateWorkflow({ allowedGlobs, blockedGlobs, productionBranch, model, packageManager = "npm" }) {
685
+ export function generateWorkflow({ allowedGlobs, blockedGlobs, productionBranch, model, packageManager = "npm", permissionsMode = "sandboxed" }) {
686
686
  const allowed = allowedGlobs.join(", ");
687
687
  const blocked = blockedGlobs.join(", ");
688
688
 
@@ -761,7 +761,8 @@ jobs:
761
761
 
762
762
  IMPORTANT: Always verify your changes compile by running the build command.
763
763
  anthropic_api_key: \${{ secrets.ANTHROPIC_API_KEY }}
764
- claude_args: "--allowedTools Edit,Read,Write,Bash,Glob,Grep --max-turns 25"
764
+ claude_args: "${permissionsMode === "unrestricted" ? "--max-turns 50" : "--allowedTools Edit,Read,Write,Bash,Glob,Grep --max-turns 50"}"
765
+ show_full_output: true
765
766
 
766
767
  - name: Check for changes
767
768
  id: changes
package/lib/setup.mjs CHANGED
@@ -1,330 +1,416 @@
1
- /**
2
- * anteater setup — Interactive CLI to install and configure Anteater.
3
- *
4
- * Core logic extracted from bin/setup-anteater.mjs so it can be
5
- * imported by tests without hitting the shebang line.
6
- */
7
-
8
- import { execSync } from "node:child_process";
9
- import {
10
- bold, dim, green, red, yellow, cyan,
11
- ok, fail, warn, info, heading, blank,
12
- ask, confirm, select, spinner, closeRL,
13
- } from "./ui.mjs";
14
- import { detectProject } from "./detect.mjs";
15
- import { scaffoldFiles } from "./scaffold.mjs";
16
- import {
17
- validateAnthropicKey, validateGitHubToken, setGitHubSecret, setVercelEnv,
18
- writeEnvLocal, hasCommand,
19
- } from "./secrets.mjs";
20
-
21
- const cwd = process.cwd();
22
-
23
- export async function main() {
24
- console.log();
25
- console.log(` ${bold("\u{1F41C} Anteater Setup")}`);
26
- console.log(` ${"\u2500".repeat(17)}`);
27
- blank();
28
-
29
- // ─── Agent piping guide ────────────────────────────────────
30
- if (!process.stdin.isTTY) {
31
- console.log(` ${bold("Piped input detected — Agent Guide")}`);
32
- console.log(` ${"─".repeat(40)}`);
33
- console.log(` Prompts (one per line, in order):`);
34
- console.log(` 1. Anthropic API key`);
35
- console.log(` 2. GitHub PAT (ghp_... or github_pat_...)`);
36
- console.log(` 3. Use default paths? (Y/n)`);
37
- console.log(` 4. Model (1=Sonnet 2=Opus 3=Opus1M 4=Haiku)`);
38
- console.log(` 5. Permissions (1=Sandboxed 2=Unrestricted)`);
39
- console.log(` 6. Confirm unrestricted? (y/N) — only if 5=2`);
40
- console.log();
41
- console.log(` If paths=n, 2 extra prompts after #3:`);
42
- console.log(` 3a. Allowed globs (comma-separated)`);
43
- console.log(` 3b. Blocked globs (comma-separated)`);
44
- console.log(` ${"─".repeat(40)}`);
45
- blank();
46
- }
47
-
48
- // ─── Security notice ───────────────────────────────────────
49
- warn("SECURITY: Anteater lets users modify your app's code via AI.");
50
- info("Only expose it to trusted users in a sandboxed environment.");
51
- info("Users can make destructive changes and potentially access sensitive data.");
52
- info(`Learn more: ${cyan("https://github.com/scottgriffinm/anteater#security-warning")}`);
53
- blank();
54
-
55
- // ─── Preflight checks ──────────────────────────────────────
56
- heading("Preflight");
57
-
58
- if (!hasCommand("gh")) {
59
- fail("GitHub CLI (gh) is required. Install it: https://cli.github.com");
60
- process.exit(1);
61
- }
62
- ok("GitHub CLI installed");
63
-
64
- if (!hasCommand("vercel")) {
65
- fail("Vercel CLI is required. Install it: npm i -g vercel");
66
- process.exit(1);
67
- }
68
- ok("Vercel CLI installed");
69
-
70
- // ─── Detect project ─────────────────────────────────────────
71
- const project = await detectProject(cwd);
72
-
73
- if (!project.isNextJs) {
74
- fail("No Next.js project found. Run this from your Next.js project root.");
75
- process.exit(1);
76
- }
77
- ok(`Next.js ${project.nextVersion ?? ""} ${project.isAppRouter ? "(App Router)" : "(Pages Router)"}`);
78
-
79
- if (!project.hasGit || !project.gitRemote) {
80
- fail("No GitHub remote found. Run: git remote add origin <url>");
81
- process.exit(1);
82
- }
83
- ok(`Repo: ${project.gitRemote}`);
84
- ok(`Branch: ${project.defaultBranch || "main"}`);
85
- ok(`Package manager: ${project.packageManager}`);
86
- blank();
87
-
88
- // ─── Step 1: Anthropic API key ──────────────────────────────
89
- heading("Step 1 of 4 \u2014 AI Provider");
90
- info(`Get a key at ${cyan("https://console.anthropic.com/keys")}`);
91
- blank();
92
-
93
- let anthropicKey;
94
- while (true) {
95
- anthropicKey = await ask("Anthropic API key:", { mask: true });
96
- if (!anthropicKey) { warn("Required."); continue; }
97
- const valid = await spinner("Validating", () => validateAnthropicKey(anthropicKey));
98
- if (valid) break;
99
- fail("Invalid key. Check that it starts with sk-ant- and try again.");
100
- }
101
- blank();
102
-
103
- // ─── Step 2: GitHub PAT ─────────────────────────────────────
104
- heading("Step 2 of 4 \u2014 GitHub Access");
105
-
106
- info("Anteater needs a long-lived Personal Access Token (PAT) for the deployed API route.");
107
- blank();
108
- info(`${bold("Create a Fine-grained token:")} ${cyan("https://github.com/settings/tokens?type=beta")}`);
109
- info(` 1. Click ${bold("Generate new token")}`);
110
- info(` 2. Select ${bold("Only select repositories")} \u2192 pick your repo`);
111
- info(` 3. Set permissions: ${bold("Contents")}, ${bold("Pull requests")}, ${bold("Actions")} \u2192 Read and write`);
112
- info(` 4. Generate and copy the token`);
113
- blank();
114
- const githubToken = await ask("Paste your GitHub PAT (ghp_... or github_pat_...):");
115
- if (!githubToken) {
116
- fail("A GitHub PAT is required.");
117
- process.exit(1);
118
- }
119
-
120
- const check = await spinner("Checking permissions", () =>
121
- validateGitHubToken(githubToken, project.gitRemote)
122
- );
123
-
124
- if (!check.ok && check.missing.length > 0 && !check.missing.includes("unknown")) {
125
- fail("Token is missing required scopes: " + check.missing.join(", "));
126
- info(`Create a new Fine-grained PAT at ${cyan("https://github.com/settings/tokens?type=beta")}`);
127
- info(`Set permissions: ${bold("Contents")}, ${bold("Pull requests")}, ${bold("Actions")} \u2192 Read and write`);
128
- process.exit(1);
129
- } else if (check.ok) {
130
- ok("Token has required permissions");
131
- }
132
- blank();
133
-
134
- // ─── Step 3: Configure paths ────────────────────────────────
135
- heading("Step 3 of 4 \u2014 Editable Paths");
136
-
137
- const defaultAllowed = [];
138
- const defaultBlocked = ["lib/auth/**", "lib/billing/**", ".env*"];
139
-
140
- if (project.isAppRouter) {
141
- defaultAllowed.push("app/**", "components/**", "styles/**");
142
- defaultBlocked.push("app/api/**");
143
- } else {
144
- defaultAllowed.push("pages/**", "components/**", "styles/**");
145
- defaultBlocked.push("pages/api/**");
146
- }
147
-
148
- console.log(` ${green("Allowed:")} ${defaultAllowed.join(", ")}`);
149
- console.log(` ${red("Blocked:")} ${defaultBlocked.join(", ")}`);
150
- blank();
151
-
152
- const useDefaults = await confirm("Use these defaults?");
153
- let allowedGlobs = defaultAllowed;
154
- let blockedGlobs = defaultBlocked;
155
-
156
- if (!useDefaults) {
157
- const customAllowed = await ask("Allowed globs (comma-separated):");
158
- const customBlocked = await ask("Blocked globs (comma-separated):");
159
- if (customAllowed) allowedGlobs = customAllowed.split(",").map((s) => s.trim());
160
- if (customBlocked) blockedGlobs = customBlocked.split(",").map((s) => s.trim());
161
- }
162
- blank();
163
-
164
- // ─── Step 4: Agent configuration ─────────────────────────────
165
- heading("Step 4 of 4 \u2014 Agent Configuration");
166
-
167
- const model = await select("Select AI model:", [
168
- { label: "Sonnet (recommended)", hint: "fast, cost-effective, great for most changes", value: "sonnet" },
169
- { label: "Opus", hint: "most capable, higher cost", value: "opus" },
170
- { label: "Opus 1M", hint: "Opus with extended context (1M tokens)", value: "opus[1m]" },
171
- { label: "Haiku", hint: "fastest, lowest cost, best for simple changes", value: "haiku" },
172
- ]);
173
- ok(`Model: ${model}`);
174
- blank();
175
-
176
- let permissionsMode = await select("Select agent permissions mode:", [
177
- { label: "Sandboxed (recommended)", hint: "full local access, no internet or external services", value: "sandboxed" },
178
- { label: "Unrestricted", hint: "full access including web, GitHub CLI, Vercel, and all MCP tools", value: "unrestricted" },
179
- ]);
180
-
181
- if (permissionsMode === "unrestricted") {
182
- blank();
183
- warn("Unrestricted mode grants the AI agent full access to:");
184
- info(" - Internet (web fetches, searches, curl)");
185
- info(" - GitHub CLI (push, PR creation, issue management)");
186
- info(" - Vercel CLI (deployments, env vars)");
187
- info(" - All MCP tools (browser automation, etc.)");
188
- info(" - File deletion and system commands");
189
- blank();
190
- warn("The agent will run with bypassPermissions \u2014 no confirmation prompts.");
191
- warn("Only use this if you trust the prompts your users will submit.");
192
- blank();
193
- const confirmed = await confirm("Confirm unrestricted mode?", false);
194
- if (!confirmed) {
195
- permissionsMode = "sandboxed";
196
- ok("Falling back to Sandboxed mode");
197
- } else {
198
- ok("Unrestricted mode confirmed");
199
- }
200
- } else {
201
- ok("Sandboxed mode \u2014 agent cannot access internet or external services");
202
- }
203
- blank();
204
-
205
- // ─── Install & scaffold ─────────────────────────────────────
206
- heading("Installing");
207
-
208
- const installCmd = {
209
- pnpm: "pnpm add next-anteater",
210
- yarn: "yarn add next-anteater",
211
- npm: "npm install next-anteater",
212
- }[project.packageManager];
213
-
214
- await spinner("Installing next-anteater", () => {
215
- execSync(installCmd, { cwd, stdio: "ignore" });
216
- });
217
-
218
- const productionBranch = project.defaultBranch || "main";
219
- const scaffolded = await spinner("Creating files", () =>
220
- scaffoldFiles(cwd, {
221
- repo: project.gitRemote,
222
- allowedGlobs,
223
- blockedGlobs,
224
- autoMerge: true,
225
- productionBranch,
226
- isTypeScript: project.isTypeScript,
227
- isAppRouter: project.isAppRouter,
228
- layoutFile: project.layoutFile,
229
- model,
230
- permissionsMode,
231
- packageManager: project.packageManager,
232
- })
233
- );
234
-
235
- for (const f of scaffolded) ok(`Created ${f}`);
236
-
237
- // ─── Set secrets ────────────────────────────────────────────
238
- heading("Configuring secrets");
239
-
240
- // GitHub Actions secret
241
- try {
242
- await spinner("Setting ANTHROPIC_API_KEY in GitHub secrets", () => {
243
- setGitHubSecret(project.gitRemote, "ANTHROPIC_API_KEY", anthropicKey);
244
- });
245
- } catch (err) {
246
- warn(`Could not set secret: ${err.message}`);
247
- info("Set manually: gh secret set ANTHROPIC_API_KEY --repo " + project.gitRemote);
248
- }
249
-
250
- // .env.local for local dev (only GITHUB_TOKEN needed)
251
- await spinner("Writing .env.local", () =>
252
- writeEnvLocal(cwd, { GITHUB_TOKEN: githubToken })
253
- );
254
-
255
- // Vercel: only GITHUB_TOKEN needed (repo auto-detected, deploy detection automatic)
256
- await spinner("Setting GITHUB_TOKEN in Vercel", () => {
257
- setVercelEnv("GITHUB_TOKEN", githubToken);
258
- });
259
-
260
- // ─── Push workflow ──────────────────────────────────────────
261
- if (scaffolded.some((f) => f.includes("anteater.yml"))) {
262
- await spinner("Pushing workflow to GitHub", () => {
263
- execSync(`git add .github/workflows/anteater.yml`, { cwd, stdio: "ignore" });
264
- execSync(`git commit -m "chore: add Anteater workflow"`, { cwd, stdio: "ignore" });
265
- execSync(`git push origin ${productionBranch}`, { cwd, stdio: "ignore" });
266
- });
267
-
268
- // Verify
269
- const activated = await spinner("Verifying workflow", async () => {
270
- await new Promise((r) => setTimeout(r, 2000));
271
- try {
272
- const res = await fetch(
273
- `https://api.github.com/repos/${project.gitRemote}/actions/workflows`,
274
- { headers: { Authorization: `Bearer ${githubToken}`, Accept: "application/vnd.github+json" } }
275
- );
276
- const data = await res.json();
277
- return data.workflows?.some((w) => w.path === ".github/workflows/anteater.yml" && w.state === "active");
278
- } catch { return false; }
279
- });
280
-
281
- if (activated) ok("Workflow active");
282
- else warn(`Check: ${cyan(`https://github.com/${project.gitRemote}/actions`)}`);
283
- }
284
-
285
- // ─── Test ───────────────────────────────────────────────────
286
- const dispatchOk = await spinner("Running test dispatch", async () => {
287
- try {
288
- const res = await fetch(
289
- `https://api.github.com/repos/${project.gitRemote}/actions/workflows/anteater.yml/dispatches`,
290
- {
291
- method: "POST",
292
- headers: {
293
- Authorization: `Bearer ${githubToken}`,
294
- Accept: "application/vnd.github+json",
295
- "X-GitHub-Api-Version": "2022-11-28",
296
- },
297
- body: JSON.stringify({
298
- ref: productionBranch,
299
- inputs: {
300
- requestId: "setup-test",
301
- prompt: "setup verification \u2014 no changes expected",
302
- mode: "prod",
303
- branch: "anteater/setup-test",
304
- baseBranch: productionBranch,
305
- autoMerge: "false",
306
- },
307
- }),
308
- }
309
- );
310
- return res.status === 204;
311
- } catch { return false; }
312
- });
313
-
314
- if (dispatchOk) ok("Pipeline is working");
315
- else warn("Test dispatch failed \u2014 check GitHub Actions");
316
-
317
- // ─── Done! ──────────────────────────────────────────────────
318
- closeRL();
319
- blank();
320
- console.log(` ${bold(green("\u{1F41C} Anteater is ready."))}`);
321
- blank();
322
- info(`Deploy your app and look for the "${green("Edit this page")}" button.`);
323
- info("Users can modify your app by typing changes in the Anteater bar.");
324
- blank();
325
- warn("Reminder: only expose Anteater to trusted users.");
326
- info("Users with access to the prompt bar can make arbitrary code changes.");
327
- info("Use a sandboxed environment without real credentials or production data.");
328
- info(`Protect the prompt bar behind your own auth layer \u2014 Anteater does ${bold("not")} provide auth.`);
329
- blank();
330
- }
1
+ /**
2
+ * anteater setup — Interactive CLI to install and configure Anteater.
3
+ *
4
+ * Supports CLI flags for non-interactive use:
5
+ * --anthropic-key <key> Anthropic API key
6
+ * --github-pat <pat> GitHub Personal Access Token
7
+ * --model <name> sonnet | opus | opus-1m | haiku
8
+ * --permissions <mode> sandboxed | unrestricted
9
+ * --yes / -y Accept all defaults and confirmations
10
+ */
11
+
12
+ import { execSync } from "node:child_process";
13
+ import {
14
+ bold, dim, green, red, yellow, cyan,
15
+ ok, fail, warn, info, heading, blank,
16
+ ask, confirm, select, spinner, closeRL,
17
+ } from "./ui.mjs";
18
+ import { detectProject } from "./detect.mjs";
19
+ import { scaffoldFiles } from "./scaffold.mjs";
20
+ import {
21
+ validateAnthropicKey, validateGitHubToken, setGitHubSecret, setVercelEnv,
22
+ writeEnvLocal, hasCommand,
23
+ } from "./secrets.mjs";
24
+
25
+ const cwd = process.cwd();
26
+
27
+ const MODEL_MAP = {
28
+ sonnet: "sonnet",
29
+ opus: "opus",
30
+ "opus-1m": "opus[1m]",
31
+ haiku: "haiku",
32
+ };
33
+
34
+ function parseFlags() {
35
+ const args = process.argv.slice(2);
36
+ const flags = {};
37
+
38
+ for (let i = 0; i < args.length; i++) {
39
+ switch (args[i]) {
40
+ case "--anthropic-key":
41
+ flags.anthropicKey = args[++i];
42
+ break;
43
+ case "--github-pat":
44
+ flags.githubPat = args[++i];
45
+ break;
46
+ case "--model":
47
+ flags.model = MODEL_MAP[args[++i]];
48
+ break;
49
+ case "--permissions":
50
+ flags.permissions = args[++i]; // "sandboxed" or "unrestricted"
51
+ break;
52
+ case "--yes":
53
+ case "-y":
54
+ flags.yes = true;
55
+ break;
56
+ }
57
+ }
58
+
59
+ return flags;
60
+ }
61
+
62
+ export async function main() {
63
+ const flags = parseFlags();
64
+
65
+ console.log();
66
+ console.log(` ${bold("\u{1F41C} Anteater Setup")}`);
67
+ console.log(` ${"\u2500".repeat(17)}`);
68
+ blank();
69
+
70
+ // ─── Non-interactive hint ──────────────────────────────────
71
+ if (!process.stdin.isTTY && !flags.anthropicKey) {
72
+ console.log(` ${bold("Tip: use CLI flags for non-interactive setup:")}`);
73
+ console.log(` ${"─".repeat(52)}`);
74
+ console.log(` npx next-anteater setup \\`);
75
+ console.log(` --anthropic-key <key> \\`);
76
+ console.log(` --github-pat <pat> \\`);
77
+ console.log(` --model sonnet \\`);
78
+ console.log(` --permissions unrestricted \\`);
79
+ console.log(` --yes`);
80
+ console.log();
81
+ console.log(` Models: sonnet, opus, opus-1m, haiku`);
82
+ console.log(` Permissions: sandboxed, unrestricted`);
83
+ console.log(` ${"─".repeat(52)}`);
84
+ blank();
85
+ }
86
+
87
+ // ─── Security notice ───────────────────────────────────────
88
+ warn("SECURITY: Anteater lets users modify your app's code via AI.");
89
+ info("Only expose it to trusted users in a sandboxed environment.");
90
+ info("Users can make destructive changes and potentially access sensitive data.");
91
+ info(`Learn more: ${cyan("https://github.com/scottgriffinm/anteater#security-warning")}`);
92
+ blank();
93
+
94
+ // ─── Preflight checks ──────────────────────────────────────
95
+ heading("Preflight");
96
+
97
+ if (!hasCommand("gh")) {
98
+ fail("GitHub CLI (gh) is required. Install it: https://cli.github.com");
99
+ process.exit(1);
100
+ }
101
+ ok("GitHub CLI installed");
102
+
103
+ if (!hasCommand("vercel")) {
104
+ fail("Vercel CLI is required. Install it: npm i -g vercel");
105
+ process.exit(1);
106
+ }
107
+ ok("Vercel CLI installed");
108
+
109
+ // ─── Detect project ─────────────────────────────────────────
110
+ const project = await detectProject(cwd);
111
+
112
+ if (!project.isNextJs) {
113
+ fail("No Next.js project found. Run this from your Next.js project root.");
114
+ process.exit(1);
115
+ }
116
+ ok(`Next.js ${project.nextVersion ?? ""} ${project.isAppRouter ? "(App Router)" : "(Pages Router)"}`);
117
+
118
+ if (!project.hasGit || !project.gitRemote) {
119
+ fail("No GitHub remote found. Run: git remote add origin <url>");
120
+ process.exit(1);
121
+ }
122
+ ok(`Repo: ${project.gitRemote}`);
123
+ ok(`Branch: ${project.defaultBranch || "main"}`);
124
+ ok(`Package manager: ${project.packageManager}`);
125
+ blank();
126
+
127
+ // ─── Step 1: Anthropic API key ──────────────────────────────
128
+ heading("Step 1 of 4 \u2014 AI Provider");
129
+
130
+ let anthropicKey;
131
+ if (flags.anthropicKey) {
132
+ anthropicKey = flags.anthropicKey;
133
+ const valid = await spinner("Validating", () => validateAnthropicKey(anthropicKey));
134
+ if (!valid) {
135
+ fail("Invalid --anthropic-key. Check that it starts with sk-ant-.");
136
+ process.exit(1);
137
+ }
138
+ } else {
139
+ info(`Get a key at ${cyan("https://console.anthropic.com/keys")}`);
140
+ blank();
141
+ while (true) {
142
+ anthropicKey = await ask("Anthropic API key:", { mask: true });
143
+ if (!anthropicKey) { warn("Required."); continue; }
144
+ const valid = await spinner("Validating", () => validateAnthropicKey(anthropicKey));
145
+ if (valid) break;
146
+ fail("Invalid key. Check that it starts with sk-ant- and try again.");
147
+ }
148
+ }
149
+ blank();
150
+
151
+ // ─── Step 2: GitHub PAT ─────────────────────────────────────
152
+ heading("Step 2 of 4 \u2014 GitHub Access");
153
+
154
+ let githubToken;
155
+ if (flags.githubPat) {
156
+ githubToken = flags.githubPat;
157
+ } else {
158
+ info("Anteater needs a long-lived Personal Access Token (PAT) for the deployed API route.");
159
+ blank();
160
+ info(`${bold("Create a Fine-grained token:")} ${cyan("https://github.com/settings/tokens?type=beta")}`);
161
+ info(` 1. Click ${bold("Generate new token")}`);
162
+ info(` 2. Select ${bold("Only select repositories")} \u2192 pick your repo`);
163
+ info(` 3. Set permissions: ${bold("Contents")}, ${bold("Pull requests")}, ${bold("Actions")} \u2192 Read and write`);
164
+ info(` 4. Generate and copy the token`);
165
+ blank();
166
+ githubToken = await ask("Paste your GitHub PAT (ghp_... or github_pat_...):");
167
+ if (!githubToken) {
168
+ fail("A GitHub PAT is required.");
169
+ process.exit(1);
170
+ }
171
+ }
172
+
173
+ const check = await spinner("Checking permissions", () =>
174
+ validateGitHubToken(githubToken, project.gitRemote)
175
+ );
176
+
177
+ if (!check.ok && check.missing.length > 0 && !check.missing.includes("unknown")) {
178
+ fail("Token is missing required scopes: " + check.missing.join(", "));
179
+ info(`Create a new Fine-grained PAT at ${cyan("https://github.com/settings/tokens?type=beta")}`);
180
+ info(`Set permissions: ${bold("Contents")}, ${bold("Pull requests")}, ${bold("Actions")} \u2192 Read and write`);
181
+ process.exit(1);
182
+ } else if (check.ok) {
183
+ ok("Token has required permissions");
184
+ }
185
+ blank();
186
+
187
+ // ─── Step 3: Configure paths ────────────────────────────────
188
+ heading("Step 3 of 4 \u2014 Editable Paths");
189
+
190
+ const defaultAllowed = [];
191
+ const defaultBlocked = ["lib/auth/**", "lib/billing/**", ".env*"];
192
+
193
+ if (project.isAppRouter) {
194
+ defaultAllowed.push("app/**", "components/**", "styles/**");
195
+ defaultBlocked.push("app/api/**");
196
+ } else {
197
+ defaultAllowed.push("pages/**", "components/**", "styles/**");
198
+ defaultBlocked.push("pages/api/**");
199
+ }
200
+
201
+ console.log(` ${green("Allowed:")} ${defaultAllowed.join(", ")}`);
202
+ console.log(` ${red("Blocked:")} ${defaultBlocked.join(", ")}`);
203
+ blank();
204
+
205
+ let allowedGlobs = defaultAllowed;
206
+ let blockedGlobs = defaultBlocked;
207
+
208
+ if (flags.yes) {
209
+ ok("Using default paths (--yes)");
210
+ } else {
211
+ const useDefaults = await confirm("Use these defaults?");
212
+ if (!useDefaults) {
213
+ const customAllowed = await ask("Allowed globs (comma-separated):");
214
+ const customBlocked = await ask("Blocked globs (comma-separated):");
215
+ if (customAllowed) allowedGlobs = customAllowed.split(",").map((s) => s.trim());
216
+ if (customBlocked) blockedGlobs = customBlocked.split(",").map((s) => s.trim());
217
+ }
218
+ }
219
+ blank();
220
+
221
+ // ─── Step 4: Agent configuration ─────────────────────────────
222
+ heading("Step 4 of 4 \u2014 Agent Configuration");
223
+
224
+ let model;
225
+ if (flags.model) {
226
+ model = flags.model;
227
+ ok(`Model: ${model} (--model)`);
228
+ } else {
229
+ model = await select("Select AI model:", [
230
+ { label: "Sonnet (recommended)", hint: "fast, cost-effective, great for most changes", value: "sonnet" },
231
+ { label: "Opus", hint: "most capable, higher cost", value: "opus" },
232
+ { label: "Opus 1M", hint: "Opus with extended context (1M tokens)", value: "opus[1m]" },
233
+ { label: "Haiku", hint: "fastest, lowest cost, best for simple changes", value: "haiku" },
234
+ ]);
235
+ ok(`Model: ${model}`);
236
+ }
237
+ blank();
238
+
239
+ let permissionsMode;
240
+ if (flags.permissions) {
241
+ permissionsMode = flags.permissions;
242
+ if (permissionsMode === "unrestricted" && !flags.yes) {
243
+ warn("Unrestricted mode grants the AI agent full access to:");
244
+ info(" - Internet (web fetches, searches, curl)");
245
+ info(" - GitHub CLI (push, PR creation, issue management)");
246
+ info(" - Vercel CLI (deployments, env vars)");
247
+ info(" - All MCP tools (browser automation, etc.)");
248
+ info(" - File deletion and system commands");
249
+ blank();
250
+ const confirmed = await confirm("Confirm unrestricted mode?", false);
251
+ if (!confirmed) {
252
+ permissionsMode = "sandboxed";
253
+ ok("Falling back to Sandboxed mode");
254
+ } else {
255
+ ok("Unrestricted mode confirmed");
256
+ }
257
+ } else {
258
+ ok(`Permissions: ${permissionsMode} (--permissions)`);
259
+ }
260
+ } else {
261
+ permissionsMode = await select("Select agent permissions mode:", [
262
+ { label: "Sandboxed (recommended)", hint: "full local access, no internet or external services", value: "sandboxed" },
263
+ { label: "Unrestricted", hint: "full access including web, GitHub CLI, Vercel, and all MCP tools", value: "unrestricted" },
264
+ ]);
265
+
266
+ if (permissionsMode === "unrestricted") {
267
+ blank();
268
+ warn("Unrestricted mode grants the AI agent full access to:");
269
+ info(" - Internet (web fetches, searches, curl)");
270
+ info(" - GitHub CLI (push, PR creation, issue management)");
271
+ info(" - Vercel CLI (deployments, env vars)");
272
+ info(" - All MCP tools (browser automation, etc.)");
273
+ info(" - File deletion and system commands");
274
+ blank();
275
+ warn("The agent will run with bypassPermissions \u2014 no confirmation prompts.");
276
+ warn("Only use this if you trust the prompts your users will submit.");
277
+ blank();
278
+ const confirmed = flags.yes || await confirm("Confirm unrestricted mode?", false);
279
+ if (!confirmed) {
280
+ permissionsMode = "sandboxed";
281
+ ok("Falling back to Sandboxed mode");
282
+ } else {
283
+ ok("Unrestricted mode confirmed");
284
+ }
285
+ } else {
286
+ ok("Sandboxed mode \u2014 agent cannot access internet or external services");
287
+ }
288
+ }
289
+ blank();
290
+
291
+ // ─── Install & scaffold ─────────────────────────────────────
292
+ heading("Installing");
293
+
294
+ const installCmd = {
295
+ pnpm: "pnpm add next-anteater",
296
+ yarn: "yarn add next-anteater",
297
+ npm: "npm install next-anteater",
298
+ }[project.packageManager];
299
+
300
+ await spinner("Installing next-anteater", () => {
301
+ execSync(installCmd, { cwd, stdio: "ignore" });
302
+ });
303
+
304
+ const productionBranch = project.defaultBranch || "main";
305
+ const scaffolded = await spinner("Creating files", () =>
306
+ scaffoldFiles(cwd, {
307
+ repo: project.gitRemote,
308
+ allowedGlobs,
309
+ blockedGlobs,
310
+ autoMerge: true,
311
+ productionBranch,
312
+ isTypeScript: project.isTypeScript,
313
+ isAppRouter: project.isAppRouter,
314
+ layoutFile: project.layoutFile,
315
+ model,
316
+ permissionsMode,
317
+ packageManager: project.packageManager,
318
+ })
319
+ );
320
+
321
+ for (const f of scaffolded) ok(`Created ${f}`);
322
+
323
+ // ─── Set secrets ────────────────────────────────────────────
324
+ heading("Configuring secrets");
325
+
326
+ // GitHub Actions secret
327
+ try {
328
+ await spinner("Setting ANTHROPIC_API_KEY in GitHub secrets", () => {
329
+ setGitHubSecret(project.gitRemote, "ANTHROPIC_API_KEY", anthropicKey);
330
+ });
331
+ } catch (err) {
332
+ warn(`Could not set secret: ${err.message}`);
333
+ info("Set manually: gh secret set ANTHROPIC_API_KEY --repo " + project.gitRemote);
334
+ }
335
+
336
+ // .env.local for local dev (only GITHUB_TOKEN needed)
337
+ await spinner("Writing .env.local", () =>
338
+ writeEnvLocal(cwd, { GITHUB_TOKEN: githubToken })
339
+ );
340
+
341
+ // Vercel: only GITHUB_TOKEN needed (repo auto-detected, deploy detection automatic)
342
+ await spinner("Setting GITHUB_TOKEN in Vercel", () => {
343
+ setVercelEnv("GITHUB_TOKEN", githubToken);
344
+ });
345
+
346
+ // ─── Push workflow ──────────────────────────────────────────
347
+ if (scaffolded.some((f) => f.includes("anteater.yml"))) {
348
+ await spinner("Pushing workflow to GitHub", () => {
349
+ execSync(`git add .github/workflows/anteater.yml`, { cwd, stdio: "ignore" });
350
+ execSync(`git commit -m "chore: add Anteater workflow"`, { cwd, stdio: "ignore" });
351
+ execSync(`git push origin ${productionBranch}`, { cwd, stdio: "ignore" });
352
+ });
353
+
354
+ // Verify
355
+ const activated = await spinner("Verifying workflow", async () => {
356
+ await new Promise((r) => setTimeout(r, 2000));
357
+ try {
358
+ const res = await fetch(
359
+ `https://api.github.com/repos/${project.gitRemote}/actions/workflows`,
360
+ { headers: { Authorization: `Bearer ${githubToken}`, Accept: "application/vnd.github+json" } }
361
+ );
362
+ const data = await res.json();
363
+ return data.workflows?.some((w) => w.path === ".github/workflows/anteater.yml" && w.state === "active");
364
+ } catch { return false; }
365
+ });
366
+
367
+ if (activated) ok("Workflow active");
368
+ else warn(`Check: ${cyan(`https://github.com/${project.gitRemote}/actions`)}`);
369
+ }
370
+
371
+ // ─── Test ───────────────────────────────────────────────────
372
+ const dispatchOk = await spinner("Running test dispatch", async () => {
373
+ try {
374
+ const res = await fetch(
375
+ `https://api.github.com/repos/${project.gitRemote}/actions/workflows/anteater.yml/dispatches`,
376
+ {
377
+ method: "POST",
378
+ headers: {
379
+ Authorization: `Bearer ${githubToken}`,
380
+ Accept: "application/vnd.github+json",
381
+ "X-GitHub-Api-Version": "2022-11-28",
382
+ },
383
+ body: JSON.stringify({
384
+ ref: productionBranch,
385
+ inputs: {
386
+ requestId: "setup-test",
387
+ prompt: "setup verification \u2014 no changes expected",
388
+ mode: "prod",
389
+ branch: "anteater/setup-test",
390
+ baseBranch: productionBranch,
391
+ autoMerge: "false",
392
+ },
393
+ }),
394
+ }
395
+ );
396
+ return res.status === 204;
397
+ } catch { return false; }
398
+ });
399
+
400
+ if (dispatchOk) ok("Pipeline is working");
401
+ else warn("Test dispatch failed \u2014 check GitHub Actions");
402
+
403
+ // ─── Done! ──────────────────────────────────────────────────
404
+ closeRL();
405
+ blank();
406
+ console.log(` ${bold(green("\u{1F41C} Anteater is ready."))}`);
407
+ blank();
408
+ info(`Deploy your app and look for the "${green("Edit this page")}" button.`);
409
+ info("Users can modify your app by typing changes in the Anteater bar.");
410
+ blank();
411
+ warn("Reminder: only expose Anteater to trusted users.");
412
+ info("Users with access to the prompt bar can make arbitrary code changes.");
413
+ info("Use a sandboxed environment without real credentials or production data.");
414
+ info(`Protect the prompt bar behind your own auth layer \u2014 Anteater does ${bold("not")} provide auth.`);
415
+ blank();
416
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-anteater",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "AI-powered live editing for your Next.js app",
5
5
  "bin": {
6
6
  "anteater": "bin/setup-anteater.mjs",
@@ -209,20 +209,19 @@ export function AnteaterBar({
209
209
 
210
210
  const handleSubmit = async (e?: React.FormEvent) => {
211
211
  if (e) e.preventDefault();
212
- if (!prompt.trim() || submitting) return;
212
+ const text = prompt.trim();
213
+ if (!text || submitting) return;
213
214
 
214
- const result = await submit({
215
- prompt: prompt.trim(),
215
+ setPrompt("");
216
+
217
+ await submit({
218
+ prompt: text,
216
219
  mode,
217
220
  branch,
218
221
  context: {
219
222
  pathname: typeof window !== "undefined" ? window.location.pathname : undefined,
220
223
  },
221
224
  });
222
-
223
- if (result) {
224
- setPrompt("");
225
- }
226
225
  };
227
226
 
228
227
  const handleButtonClick = () => {