neon-init 0.14.0 → 0.16.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 (111) hide show
  1. package/dist/cli.js +366 -30
  2. package/dist/cli.js.map +1 -1
  3. package/dist/index.d.ts +15 -3
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +218 -13
  6. package/dist/index.js.map +1 -1
  7. package/dist/interactive.d.ts +12 -0
  8. package/dist/interactive.d.ts.map +1 -0
  9. package/dist/interactive.js +495 -0
  10. package/dist/interactive.js.map +1 -0
  11. package/dist/lib/agents.d.ts +6 -1
  12. package/dist/lib/agents.d.ts.map +1 -1
  13. package/dist/lib/agents.js +62 -1
  14. package/dist/lib/agents.js.map +1 -1
  15. package/dist/lib/auth.d.ts +10 -3
  16. package/dist/lib/auth.d.ts.map +1 -1
  17. package/dist/lib/auth.js +21 -12
  18. package/dist/lib/auth.js.map +1 -1
  19. package/dist/lib/bootstrap.d.ts +30 -0
  20. package/dist/lib/bootstrap.d.ts.map +1 -0
  21. package/dist/lib/bootstrap.js +61 -0
  22. package/dist/lib/bootstrap.js.map +1 -0
  23. package/dist/lib/build-config.d.ts +5 -0
  24. package/dist/lib/build-config.d.ts.map +1 -0
  25. package/dist/lib/build-config.js +6 -0
  26. package/dist/lib/build-config.js.map +1 -0
  27. package/dist/lib/detect-agent.d.ts +22 -0
  28. package/dist/lib/detect-agent.d.ts.map +1 -0
  29. package/dist/lib/detect-agent.js +65 -0
  30. package/dist/lib/detect-agent.js.map +1 -0
  31. package/dist/lib/editors.d.ts.map +1 -1
  32. package/dist/lib/editors.js.map +1 -1
  33. package/dist/lib/extension.d.ts +11 -3
  34. package/dist/lib/extension.d.ts.map +1 -1
  35. package/dist/lib/extension.js +28 -7
  36. package/dist/lib/extension.js.map +1 -1
  37. package/dist/lib/inspect.d.ts +28 -0
  38. package/dist/lib/inspect.d.ts.map +1 -0
  39. package/dist/lib/inspect.js +190 -0
  40. package/dist/lib/inspect.js.map +1 -0
  41. package/dist/lib/install.d.ts +10 -4
  42. package/dist/lib/install.d.ts.map +1 -1
  43. package/dist/lib/install.js +37 -20
  44. package/dist/lib/install.js.map +1 -1
  45. package/dist/lib/neonctl.d.ts +51 -0
  46. package/dist/lib/neonctl.d.ts.map +1 -0
  47. package/dist/lib/neonctl.js +184 -0
  48. package/dist/lib/neonctl.js.map +1 -0
  49. package/dist/lib/phases/auth.d.ts +12 -0
  50. package/dist/lib/phases/auth.d.ts.map +1 -0
  51. package/dist/lib/phases/auth.js +197 -0
  52. package/dist/lib/phases/auth.js.map +1 -0
  53. package/dist/lib/phases/cleanup.d.ts +12 -0
  54. package/dist/lib/phases/cleanup.d.ts.map +1 -0
  55. package/dist/lib/phases/cleanup.js +29 -0
  56. package/dist/lib/phases/cleanup.js.map +1 -0
  57. package/dist/lib/phases/db.d.ts +17 -0
  58. package/dist/lib/phases/db.d.ts.map +1 -0
  59. package/dist/lib/phases/db.js +259 -0
  60. package/dist/lib/phases/db.js.map +1 -0
  61. package/dist/lib/phases/getting-started.d.ts +26 -0
  62. package/dist/lib/phases/getting-started.d.ts.map +1 -0
  63. package/dist/lib/phases/getting-started.js +196 -0
  64. package/dist/lib/phases/getting-started.js.map +1 -0
  65. package/dist/lib/phases/mcp.d.ts +15 -0
  66. package/dist/lib/phases/mcp.d.ts.map +1 -0
  67. package/dist/lib/phases/mcp.js +179 -0
  68. package/dist/lib/phases/mcp.js.map +1 -0
  69. package/dist/lib/phases/migrations.d.ts +14 -0
  70. package/dist/lib/phases/migrations.d.ts.map +1 -0
  71. package/dist/lib/phases/migrations.js +239 -0
  72. package/dist/lib/phases/migrations.js.map +1 -0
  73. package/dist/lib/phases/neon-auth.d.ts +13 -0
  74. package/dist/lib/phases/neon-auth.d.ts.map +1 -0
  75. package/dist/lib/phases/neon-auth.js +118 -0
  76. package/dist/lib/phases/neon-auth.js.map +1 -0
  77. package/dist/lib/phases/setup.d.ts +41 -0
  78. package/dist/lib/phases/setup.d.ts.map +1 -0
  79. package/dist/lib/phases/setup.js +689 -0
  80. package/dist/lib/phases/setup.js.map +1 -0
  81. package/dist/lib/phases/skills.d.ts +14 -0
  82. package/dist/lib/phases/skills.d.ts.map +1 -0
  83. package/dist/lib/phases/skills.js +80 -0
  84. package/dist/lib/phases/skills.js.map +1 -0
  85. package/dist/lib/phases/status.d.ts +10 -0
  86. package/dist/lib/phases/status.d.ts.map +1 -0
  87. package/dist/lib/phases/status.js +65 -0
  88. package/dist/lib/phases/status.js.map +1 -0
  89. package/dist/lib/resolve-context.d.ts +19 -0
  90. package/dist/lib/resolve-context.d.ts.map +1 -0
  91. package/dist/lib/resolve-context.js +112 -0
  92. package/dist/lib/resolve-context.js.map +1 -0
  93. package/dist/lib/route-command.d.ts +8 -0
  94. package/dist/lib/route-command.d.ts.map +1 -0
  95. package/dist/lib/route-command.js +195 -0
  96. package/dist/lib/route-command.js.map +1 -0
  97. package/dist/lib/skills.d.ts +20 -3
  98. package/dist/lib/skills.d.ts.map +1 -1
  99. package/dist/lib/skills.js +116 -12
  100. package/dist/lib/skills.js.map +1 -1
  101. package/dist/lib/types.d.ts +150 -1
  102. package/dist/lib/types.d.ts.map +1 -1
  103. package/dist/lib/vsix.d.ts +15 -0
  104. package/dist/lib/vsix.d.ts.map +1 -0
  105. package/dist/lib/vsix.js +91 -0
  106. package/dist/lib/vsix.js.map +1 -0
  107. package/dist/v2.d.ts +31 -0
  108. package/dist/v2.d.ts.map +1 -0
  109. package/dist/v2.js +147 -0
  110. package/dist/v2.js.map +1 -0
  111. package/package.json +7 -3
@@ -0,0 +1,239 @@
1
+ import { ensureSkillsUpToDate } from "../skills.js";
2
+ //#region src/lib/phases/migrations.ts
3
+ async function handleMigrationsPhase(options) {
4
+ if (options.agent) await ensureSkillsUpToDate(options.agent);
5
+ const agentArgs = options.agent ? [
6
+ "--agent",
7
+ options.agent,
8
+ "--json"
9
+ ] : ["--json"];
10
+ if (options.scaffold) {
11
+ if (options.scaffold === "prisma") return {
12
+ phase: "migrations",
13
+ status: "scaffolding",
14
+ tool: "prisma",
15
+ nextAction: {
16
+ type: "agent_action",
17
+ steps: [
18
+ {
19
+ id: "install_prisma",
20
+ description: "Install Prisma as a dev dependency",
21
+ command: "npm install -D prisma"
22
+ },
23
+ {
24
+ id: "init_prisma",
25
+ description: "Initialize Prisma with PostgreSQL provider",
26
+ command: "npx prisma init --datasource-provider postgresql"
27
+ },
28
+ {
29
+ id: "configure_env",
30
+ description: "Ensure DATABASE_URL in .env points to your Neon database. The prisma init command may have created a placeholder — replace it with the real connection string if needed."
31
+ },
32
+ {
33
+ id: "create_schema",
34
+ description: "Help the user define their initial schema in prisma/schema.prisma based on their application needs."
35
+ },
36
+ {
37
+ id: "run_migration",
38
+ description: "Create and apply the initial migration",
39
+ command: "npx prisma migrate dev --name init"
40
+ }
41
+ ],
42
+ onComplete: {
43
+ type: "complete",
44
+ message: "Prisma is set up with your Neon database. You can now define models in schema.prisma and run migrations with `npx prisma migrate dev`."
45
+ }
46
+ }
47
+ };
48
+ return {
49
+ phase: "migrations",
50
+ status: "scaffolding",
51
+ tool: "drizzle",
52
+ nextAction: {
53
+ type: "agent_action",
54
+ steps: [
55
+ {
56
+ id: "install_drizzle",
57
+ description: "Install Drizzle ORM, drizzle-kit, and the Neon serverless driver",
58
+ command: "npm install drizzle-orm @neondatabase/serverless && npm install -D drizzle-kit"
59
+ },
60
+ {
61
+ id: "create_config",
62
+ description: "Create drizzle.config.ts at the project root. Set the dialect to 'postgresql' and dbCredentials.url to process.env.DATABASE_URL."
63
+ },
64
+ {
65
+ id: "create_schema",
66
+ description: "Create a schema file (e.g. src/db/schema.ts) and help the user define their initial tables using Drizzle's table builder."
67
+ },
68
+ {
69
+ id: "run_migration",
70
+ description: "Generate and apply the initial migration",
71
+ command: "npx drizzle-kit generate && npx drizzle-kit migrate"
72
+ }
73
+ ],
74
+ onComplete: {
75
+ type: "complete",
76
+ message: "Drizzle ORM is set up with your Neon database. Define tables in your schema file and run migrations with `npx drizzle-kit generate && npx drizzle-kit migrate`."
77
+ }
78
+ }
79
+ };
80
+ }
81
+ if (options.apply && options.tool) {
82
+ const applySteps = getMigrationApplySteps(options.tool);
83
+ return {
84
+ phase: "migrations",
85
+ status: "applying",
86
+ tool: options.tool,
87
+ nextAction: {
88
+ type: "agent_action",
89
+ steps: applySteps,
90
+ onComplete: {
91
+ type: "complete",
92
+ message: "Database migrations applied successfully."
93
+ }
94
+ }
95
+ };
96
+ }
97
+ if (options.tool && options.tool !== "none") return {
98
+ phase: "migrations",
99
+ status: "found",
100
+ detected: {
101
+ tool: options.tool,
102
+ migrationDir: options.migrationDir ?? null
103
+ },
104
+ nextAction: {
105
+ type: "ask_user",
106
+ question: `Found ${options.tool} migrations${options.migrationDir ? ` in ${options.migrationDir}` : ""}. Would you like to apply them to your Neon database?`,
107
+ options: [{
108
+ value: "apply",
109
+ label: "Yes, apply migrations"
110
+ }, {
111
+ value: "skip",
112
+ label: "Skip for now"
113
+ }],
114
+ responseMapping: {
115
+ apply: { args: [
116
+ "migrations",
117
+ "--json",
118
+ "--apply",
119
+ "--tool",
120
+ options.tool
121
+ ] },
122
+ skip: { args: [...agentArgs, "--skip-migrations"] }
123
+ }
124
+ }
125
+ };
126
+ if (options.tool === "none") return {
127
+ phase: "migrations",
128
+ status: "none_found",
129
+ nextAction: {
130
+ type: "ask_user",
131
+ question: "No existing database migrations were found. Would you like to set up a migration framework?",
132
+ options: [
133
+ {
134
+ value: "prisma",
135
+ label: "Prisma (recommended for TypeScript)"
136
+ },
137
+ {
138
+ value: "drizzle",
139
+ label: "Drizzle ORM"
140
+ },
141
+ {
142
+ value: "skip",
143
+ label: "Skip - I'll handle migrations myself"
144
+ }
145
+ ],
146
+ context: "A migration framework helps you version-control your database schema changes.",
147
+ responseMapping: {
148
+ prisma: { args: [
149
+ "migrations",
150
+ "--json",
151
+ "--scaffold",
152
+ "prisma"
153
+ ] },
154
+ drizzle: { args: [
155
+ "migrations",
156
+ "--json",
157
+ "--scaffold",
158
+ "drizzle"
159
+ ] },
160
+ skip: { args: [...agentArgs, "--skip-migrations"] }
161
+ }
162
+ }
163
+ };
164
+ return {
165
+ phase: "migrations",
166
+ status: "detection_needed",
167
+ nextAction: {
168
+ type: "agent_check",
169
+ checks: [{
170
+ id: "existing_migrations",
171
+ description: "Check if the project has existing database migrations",
172
+ lookFor: [
173
+ "prisma/migrations/ directory or schema.prisma file",
174
+ "drizzle/ directory or drizzle.config.ts",
175
+ "migrations/ or db/migrations/ directory",
176
+ "knex migration files (knexfile.js/ts)"
177
+ ]
178
+ }],
179
+ reportBack: {
180
+ type: "run_neon_init",
181
+ args: [
182
+ "migrations",
183
+ "--json",
184
+ "--tool",
185
+ "<prisma|drizzle|knex|none>",
186
+ "--migration-dir",
187
+ "<path|none>"
188
+ ]
189
+ }
190
+ }
191
+ };
192
+ }
193
+ function getMigrationApplySteps(tool) {
194
+ switch (tool) {
195
+ case "prisma": return [
196
+ {
197
+ id: "ensure_env",
198
+ description: "Verify DATABASE_URL is set in .env"
199
+ },
200
+ {
201
+ id: "apply",
202
+ description: "Apply migrations to the Neon database",
203
+ command: "npx prisma migrate deploy"
204
+ },
205
+ {
206
+ id: "generate",
207
+ description: "Generate the Prisma client",
208
+ command: "npx prisma generate"
209
+ }
210
+ ];
211
+ case "drizzle": return [{
212
+ id: "ensure_env",
213
+ description: "Verify DATABASE_URL is set in .env"
214
+ }, {
215
+ id: "apply",
216
+ description: "Apply migrations to the Neon database",
217
+ command: "npx drizzle-kit migrate"
218
+ }];
219
+ case "knex": return [{
220
+ id: "ensure_env",
221
+ description: "Verify DATABASE_URL is set in .env"
222
+ }, {
223
+ id: "apply",
224
+ description: "Apply migrations to the Neon database",
225
+ command: "npx knex migrate:latest"
226
+ }];
227
+ default: return [{
228
+ id: "ensure_env",
229
+ description: "Verify DATABASE_URL is set in .env"
230
+ }, {
231
+ id: "apply",
232
+ description: `Apply ${tool} migrations to the Neon database using the appropriate command for your migration tool.`
233
+ }];
234
+ }
235
+ }
236
+ //#endregion
237
+ export { handleMigrationsPhase };
238
+
239
+ //# sourceMappingURL=migrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrations.js","names":[],"sources":["../../../src/lib/phases/migrations.ts"],"sourcesContent":["import { ensureSkillsUpToDate } from \"../skills.js\";\nimport type { PhaseResponse } from \"../types.js\";\n\nexport interface MigrationsPhaseOptions {\n\tagent?: string;\n\ttool?: string;\n\tmigrationDir?: string;\n\tscaffold?: \"prisma\" | \"drizzle\";\n\tapply?: boolean;\n}\n\nexport async function handleMigrationsPhase(\n\toptions: MigrationsPhaseOptions,\n): Promise<PhaseResponse> {\n\t// Ensure skills are up to date (no-op if recently updated)\n\tif (options.agent) {\n\t\tawait ensureSkillsUpToDate(options.agent);\n\t}\n\tconst agentArgs = options.agent\n\t\t? [\"--agent\", options.agent, \"--json\"]\n\t\t: [\"--json\"];\n\n\t// --scaffold: set up a new migration framework\n\tif (options.scaffold) {\n\t\tif (options.scaffold === \"prisma\") {\n\t\t\treturn {\n\t\t\t\tphase: \"migrations\",\n\t\t\t\tstatus: \"scaffolding\",\n\t\t\t\ttool: \"prisma\",\n\t\t\t\tnextAction: {\n\t\t\t\t\ttype: \"agent_action\",\n\t\t\t\t\tsteps: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"install_prisma\",\n\t\t\t\t\t\t\tdescription: \"Install Prisma as a dev dependency\",\n\t\t\t\t\t\t\tcommand: \"npm install -D prisma\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"init_prisma\",\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"Initialize Prisma with PostgreSQL provider\",\n\t\t\t\t\t\t\tcommand:\n\t\t\t\t\t\t\t\t\"npx prisma init --datasource-provider postgresql\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"configure_env\",\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"Ensure DATABASE_URL in .env points to your Neon database. The prisma init command may have created a placeholder — replace it with the real connection string if needed.\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"create_schema\",\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"Help the user define their initial schema in prisma/schema.prisma based on their application needs.\",\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: \"run_migration\",\n\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\"Create and apply the initial migration\",\n\t\t\t\t\t\t\tcommand: \"npx prisma migrate dev --name init\",\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t\tonComplete: {\n\t\t\t\t\t\ttype: \"complete\",\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Prisma is set up with your Neon database. You can now define models in schema.prisma and run migrations with `npx prisma migrate dev`.\",\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t};\n\t\t}\n\n\t\t// drizzle\n\t\treturn {\n\t\t\tphase: \"migrations\",\n\t\t\tstatus: \"scaffolding\",\n\t\t\ttool: \"drizzle\",\n\t\t\tnextAction: {\n\t\t\t\ttype: \"agent_action\",\n\t\t\t\tsteps: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"install_drizzle\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Install Drizzle ORM, drizzle-kit, and the Neon serverless driver\",\n\t\t\t\t\t\tcommand:\n\t\t\t\t\t\t\t\"npm install drizzle-orm @neondatabase/serverless && npm install -D drizzle-kit\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"create_config\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Create drizzle.config.ts at the project root. Set the dialect to 'postgresql' and dbCredentials.url to process.env.DATABASE_URL.\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"create_schema\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Create a schema file (e.g. src/db/schema.ts) and help the user define their initial tables using Drizzle's table builder.\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"run_migration\",\n\t\t\t\t\t\tdescription: \"Generate and apply the initial migration\",\n\t\t\t\t\t\tcommand:\n\t\t\t\t\t\t\t\"npx drizzle-kit generate && npx drizzle-kit migrate\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tonComplete: {\n\t\t\t\t\ttype: \"complete\",\n\t\t\t\t\tmessage:\n\t\t\t\t\t\t\"Drizzle ORM is set up with your Neon database. Define tables in your schema file and run migrations with `npx drizzle-kit generate && npx drizzle-kit migrate`.\",\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// --apply: apply existing migrations\n\tif (options.apply && options.tool) {\n\t\tconst applySteps = getMigrationApplySteps(options.tool);\n\t\treturn {\n\t\t\tphase: \"migrations\",\n\t\t\tstatus: \"applying\",\n\t\t\ttool: options.tool,\n\t\t\tnextAction: {\n\t\t\t\ttype: \"agent_action\",\n\t\t\t\tsteps: applySteps,\n\t\t\t\tonComplete: {\n\t\t\t\t\ttype: \"complete\",\n\t\t\t\t\tmessage: \"Database migrations applied successfully.\",\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// Agent reported detection results via --tool and --migration-dir\n\tif (options.tool && options.tool !== \"none\") {\n\t\treturn {\n\t\t\tphase: \"migrations\",\n\t\t\tstatus: \"found\",\n\t\t\tdetected: {\n\t\t\t\ttool: options.tool,\n\t\t\t\tmigrationDir: options.migrationDir ?? null,\n\t\t\t},\n\t\t\tnextAction: {\n\t\t\t\ttype: \"ask_user\",\n\t\t\t\tquestion: `Found ${options.tool} migrations${options.migrationDir ? ` in ${options.migrationDir}` : \"\"}. Would you like to apply them to your Neon database?`,\n\t\t\t\toptions: [\n\t\t\t\t\t{ value: \"apply\", label: \"Yes, apply migrations\" },\n\t\t\t\t\t{ value: \"skip\", label: \"Skip for now\" },\n\t\t\t\t],\n\t\t\t\tresponseMapping: {\n\t\t\t\t\tapply: {\n\t\t\t\t\t\targs: [\n\t\t\t\t\t\t\t\"migrations\",\n\t\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t\t\"--apply\",\n\t\t\t\t\t\t\t\"--tool\",\n\t\t\t\t\t\t\toptions.tool,\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\tskip: { args: [...agentArgs, \"--skip-migrations\"] },\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\tif (options.tool === \"none\") {\n\t\treturn {\n\t\t\tphase: \"migrations\",\n\t\t\tstatus: \"none_found\",\n\t\t\tnextAction: {\n\t\t\t\ttype: \"ask_user\",\n\t\t\t\tquestion:\n\t\t\t\t\t\"No existing database migrations were found. Would you like to set up a migration framework?\",\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tvalue: \"prisma\",\n\t\t\t\t\t\tlabel: \"Prisma (recommended for TypeScript)\",\n\t\t\t\t\t},\n\t\t\t\t\t{ value: \"drizzle\", label: \"Drizzle ORM\" },\n\t\t\t\t\t{\n\t\t\t\t\t\tvalue: \"skip\",\n\t\t\t\t\t\tlabel: \"Skip - I'll handle migrations myself\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tcontext:\n\t\t\t\t\t\"A migration framework helps you version-control your database schema changes.\",\n\t\t\t\tresponseMapping: {\n\t\t\t\t\tprisma: {\n\t\t\t\t\t\targs: [\"migrations\", \"--json\", \"--scaffold\", \"prisma\"],\n\t\t\t\t\t},\n\t\t\t\t\tdrizzle: {\n\t\t\t\t\t\targs: [\"migrations\", \"--json\", \"--scaffold\", \"drizzle\"],\n\t\t\t\t\t},\n\t\t\t\t\tskip: { args: [...agentArgs, \"--skip-migrations\"] },\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// Default: ask agent to detect migration tooling\n\treturn {\n\t\tphase: \"migrations\",\n\t\tstatus: \"detection_needed\",\n\t\tnextAction: {\n\t\t\ttype: \"agent_check\",\n\t\t\tchecks: [\n\t\t\t\t{\n\t\t\t\t\tid: \"existing_migrations\",\n\t\t\t\t\tdescription:\n\t\t\t\t\t\t\"Check if the project has existing database migrations\",\n\t\t\t\t\tlookFor: [\n\t\t\t\t\t\t\"prisma/migrations/ directory or schema.prisma file\",\n\t\t\t\t\t\t\"drizzle/ directory or drizzle.config.ts\",\n\t\t\t\t\t\t\"migrations/ or db/migrations/ directory\",\n\t\t\t\t\t\t\"knex migration files (knexfile.js/ts)\",\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t\treportBack: {\n\t\t\t\ttype: \"run_neon_init\",\n\t\t\t\targs: [\n\t\t\t\t\t\"migrations\",\n\t\t\t\t\t\"--json\",\n\t\t\t\t\t\"--tool\",\n\t\t\t\t\t\"<prisma|drizzle|knex|none>\",\n\t\t\t\t\t\"--migration-dir\",\n\t\t\t\t\t\"<path|none>\",\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t};\n}\n\nfunction getMigrationApplySteps(tool: string) {\n\tswitch (tool) {\n\t\tcase \"prisma\":\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: \"ensure_env\",\n\t\t\t\t\tdescription: \"Verify DATABASE_URL is set in .env\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"apply\",\n\t\t\t\t\tdescription: \"Apply migrations to the Neon database\",\n\t\t\t\t\tcommand: \"npx prisma migrate deploy\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"generate\",\n\t\t\t\t\tdescription: \"Generate the Prisma client\",\n\t\t\t\t\tcommand: \"npx prisma generate\",\n\t\t\t\t},\n\t\t\t];\n\t\tcase \"drizzle\":\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: \"ensure_env\",\n\t\t\t\t\tdescription: \"Verify DATABASE_URL is set in .env\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"apply\",\n\t\t\t\t\tdescription: \"Apply migrations to the Neon database\",\n\t\t\t\t\tcommand: \"npx drizzle-kit migrate\",\n\t\t\t\t},\n\t\t\t];\n\t\tcase \"knex\":\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: \"ensure_env\",\n\t\t\t\t\tdescription: \"Verify DATABASE_URL is set in .env\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"apply\",\n\t\t\t\t\tdescription: \"Apply migrations to the Neon database\",\n\t\t\t\t\tcommand: \"npx knex migrate:latest\",\n\t\t\t\t},\n\t\t\t];\n\t\tdefault:\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tid: \"ensure_env\",\n\t\t\t\t\tdescription: \"Verify DATABASE_URL is set in .env\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tid: \"apply\",\n\t\t\t\t\tdescription: `Apply ${tool} migrations to the Neon database using the appropriate command for your migration tool.`,\n\t\t\t\t},\n\t\t\t];\n\t}\n}\n"],"mappings":";;AAWA,eAAsB,sBACrB,SACyB;CAEzB,IAAI,QAAQ,OACX,MAAM,qBAAqB,QAAQ,KAAK;CAEzC,MAAM,YAAY,QAAQ,QACvB;EAAC;EAAW,QAAQ;EAAO;CAAQ,IACnC,CAAC,QAAQ;CAGZ,IAAI,QAAQ,UAAU;EACrB,IAAI,QAAQ,aAAa,UACxB,OAAO;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,YAAY;IACX,MAAM;IACN,OAAO;KACN;MACC,IAAI;MACJ,aAAa;MACb,SAAS;KACV;KACA;MACC,IAAI;MACJ,aACC;MACD,SACC;KACF;KACA;MACC,IAAI;MACJ,aACC;KACF;KACA;MACC,IAAI;MACJ,aACC;KACF;KACA;MACC,IAAI;MACJ,aACC;MACD,SAAS;KACV;IACD;IACA,YAAY;KACX,MAAM;KACN,SACC;IACF;GACD;EACD;EAID,OAAO;GACN,OAAO;GACP,QAAQ;GACR,MAAM;GACN,YAAY;IACX,MAAM;IACN,OAAO;KACN;MACC,IAAI;MACJ,aACC;MACD,SACC;KACF;KACA;MACC,IAAI;MACJ,aACC;KACF;KACA;MACC,IAAI;MACJ,aACC;KACF;KACA;MACC,IAAI;MACJ,aAAa;MACb,SACC;KACF;IACD;IACA,YAAY;KACX,MAAM;KACN,SACC;IACF;GACD;EACD;CACD;CAGA,IAAI,QAAQ,SAAS,QAAQ,MAAM;EAClC,MAAM,aAAa,uBAAuB,QAAQ,IAAI;EACtD,OAAO;GACN,OAAO;GACP,QAAQ;GACR,MAAM,QAAQ;GACd,YAAY;IACX,MAAM;IACN,OAAO;IACP,YAAY;KACX,MAAM;KACN,SAAS;IACV;GACD;EACD;CACD;CAGA,IAAI,QAAQ,QAAQ,QAAQ,SAAS,QACpC,OAAO;EACN,OAAO;EACP,QAAQ;EACR,UAAU;GACT,MAAM,QAAQ;GACd,cAAc,QAAQ,gBAAgB;EACvC;EACA,YAAY;GACX,MAAM;GACN,UAAU,SAAS,QAAQ,KAAK,aAAa,QAAQ,eAAe,OAAO,QAAQ,iBAAiB,GAAG;GACvG,SAAS,CACR;IAAE,OAAO;IAAS,OAAO;GAAwB,GACjD;IAAE,OAAO;IAAQ,OAAO;GAAe,CACxC;GACA,iBAAiB;IAChB,OAAO,EACN,MAAM;KACL;KACA;KACA;KACA;KACA,QAAQ;IACT,EACD;IACA,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,mBAAmB,EAAE;GACnD;EACD;CACD;CAGD,IAAI,QAAQ,SAAS,QACpB,OAAO;EACN,OAAO;EACP,QAAQ;EACR,YAAY;GACX,MAAM;GACN,UACC;GACD,SAAS;IACR;KACC,OAAO;KACP,OAAO;IACR;IACA;KAAE,OAAO;KAAW,OAAO;IAAc;IACzC;KACC,OAAO;KACP,OAAO;IACR;GACD;GACA,SACC;GACD,iBAAiB;IAChB,QAAQ,EACP,MAAM;KAAC;KAAc;KAAU;KAAc;IAAQ,EACtD;IACA,SAAS,EACR,MAAM;KAAC;KAAc;KAAU;KAAc;IAAS,EACvD;IACA,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,mBAAmB,EAAE;GACnD;EACD;CACD;CAID,OAAO;EACN,OAAO;EACP,QAAQ;EACR,YAAY;GACX,MAAM;GACN,QAAQ,CACP;IACC,IAAI;IACJ,aACC;IACD,SAAS;KACR;KACA;KACA;KACA;IACD;GACD,CACD;GACA,YAAY;IACX,MAAM;IACN,MAAM;KACL;KACA;KACA;KACA;KACA;KACA;IACD;GACD;EACD;CACD;AACD;AAEA,SAAS,uBAAuB,MAAc;CAC7C,QAAQ,MAAR;EACC,KAAK,UACJ,OAAO;GACN;IACC,IAAI;IACJ,aAAa;GACd;GACA;IACC,IAAI;IACJ,aAAa;IACb,SAAS;GACV;GACA;IACC,IAAI;IACJ,aAAa;IACb,SAAS;GACV;EACD;EACD,KAAK,WACJ,OAAO,CACN;GACC,IAAI;GACJ,aAAa;EACd,GACA;GACC,IAAI;GACJ,aAAa;GACb,SAAS;EACV,CACD;EACD,KAAK,QACJ,OAAO,CACN;GACC,IAAI;GACJ,aAAa;EACd,GACA;GACC,IAAI;GACJ,aAAa;GACb,SAAS;EACV,CACD;EACD,SACC,OAAO,CACN;GACC,IAAI;GACJ,aAAa;EACd,GACA;GACC,IAAI;GACJ,aAAa,SAAS,KAAK;EAC5B,CACD;CACF;AACD"}
@@ -0,0 +1,13 @@
1
+ import { PhaseResponse } from "../types.js";
2
+
3
+ //#region src/lib/phases/neon-auth.d.ts
4
+ interface NeonAuthPhaseOptions {
5
+ agent?: string;
6
+ setup?: boolean;
7
+ info?: boolean;
8
+ projectId?: string;
9
+ }
10
+ declare function handleNeonAuthPhase(options: NeonAuthPhaseOptions): Promise<PhaseResponse>;
11
+ //#endregion
12
+ export { NeonAuthPhaseOptions, handleNeonAuthPhase };
13
+ //# sourceMappingURL=neon-auth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neon-auth.d.ts","names":[],"sources":["../../../src/lib/phases/neon-auth.ts"],"mappings":";;;UAIiB,oBAAA;;EAAA,KAAA,CAAA,EAAA,OAAA;EAOK,IAAA,CAAA,EAAA,OAAA;EAAmB,SAAA,CAAA,EAAA,MAAA;;AAE9B,iBAFW,mBAAA,CAEX,OAAA,EADD,oBACC,CAAA,EAAR,OAAQ,CAAA,aAAA,CAAA"}
@@ -0,0 +1,118 @@
1
+ import { neonctlCmd } from "../neonctl.js";
2
+ import { SKILL_REFERENCE_URLS, ensureSkillsUpToDate } from "../skills.js";
3
+ //#region src/lib/phases/neon-auth.ts
4
+ async function handleNeonAuthPhase(options) {
5
+ if (options.projectId && !/^[\w.:-]+$/.test(options.projectId)) throw new Error(`Invalid project ID: "${options.projectId}". Expected alphanumeric, hyphens, underscores, dots, or colons.`);
6
+ if (options.agent) await ensureSkillsUpToDate(options.agent);
7
+ if (options.info) return {
8
+ phase: "neon_auth",
9
+ status: "info",
10
+ nextAction: {
11
+ type: "ask_user",
12
+ question: "Neon Auth provides drop-in user authentication that integrates with your Neon database. It handles user sign-up, sign-in, and session management. Would you like to set it up?",
13
+ options: [{
14
+ value: "yes",
15
+ label: "Yes, set up Neon Auth"
16
+ }, {
17
+ value: "no",
18
+ label: "No, skip for now"
19
+ }],
20
+ context: `Full documentation: ${SKILL_REFERENCE_URLS.neonAuth}`,
21
+ responseMapping: {
22
+ yes: { args: [
23
+ "neon-auth",
24
+ "--json",
25
+ ...options.agent ? ["--agent", options.agent] : [],
26
+ "--setup",
27
+ ...options.projectId ? ["--project-id", options.projectId] : []
28
+ ] },
29
+ no: { args: [
30
+ "finalize",
31
+ "--json",
32
+ ...options.agent ? ["--agent", options.agent] : []
33
+ ] }
34
+ }
35
+ }
36
+ };
37
+ if (options.setup) return {
38
+ phase: "neon_auth",
39
+ status: "in_progress",
40
+ nextAction: {
41
+ type: "agent_action",
42
+ prerequisite: SKILL_REFERENCE_URLS.neonAuth,
43
+ steps: [
44
+ {
45
+ id: "provision",
46
+ description: `Enable Neon Auth on the project using the neonctl CLI. Run: \`${neonctlCmd()} neon-auth enable --project-id <project-id> --output json\`. You can check current status with: \`${neonctlCmd()} neon-auth status --project-id <project-id> --output json\`.` + (options.projectId ? ` Project ID: ${options.projectId}.` : " Determine the project ID from the .neon file in the project root, or from the DATABASE_URL in .env, or ask the user.")
47
+ },
48
+ {
49
+ id: "install_packages",
50
+ description: "Install required packages per the skill reference. The exact packages depend on the framework (Next.js, React, etc.)."
51
+ },
52
+ {
53
+ id: "create_components",
54
+ description: "Create auth components per the skill reference. Follow the exact patterns and imports specified."
55
+ },
56
+ {
57
+ id: "pull_env",
58
+ description: `Run \`${neonctlCmd()} env pull\` to populate the NEON_AUTH_BASE_URL, NEON_AUTH_JWKS_URL, and other Neon Auth environment variables. This reads the .neon context file and writes the auth URLs to the project's env file.`,
59
+ command: `${neonctlCmd()} env pull`
60
+ }
61
+ ],
62
+ onComplete: {
63
+ type: "run_neon_init",
64
+ args: [
65
+ "finalize",
66
+ "--json",
67
+ ...options.agent ? ["--agent", options.agent] : []
68
+ ]
69
+ }
70
+ }
71
+ };
72
+ return {
73
+ phase: "neon_auth",
74
+ status: "optional",
75
+ nextAction: {
76
+ type: "ask_user",
77
+ question: "Would you like to set up Neon Auth for user authentication in your app?",
78
+ options: [
79
+ {
80
+ value: "yes",
81
+ label: "Yes, set up Neon Auth"
82
+ },
83
+ {
84
+ value: "no",
85
+ label: "No, skip for now"
86
+ },
87
+ {
88
+ value: "info",
89
+ label: "Tell me more about Neon Auth"
90
+ }
91
+ ],
92
+ context: "Neon Auth provides drop-in user authentication that integrates with your Neon database.",
93
+ responseMapping: {
94
+ yes: { args: [
95
+ "neon-auth",
96
+ "--json",
97
+ ...options.agent ? ["--agent", options.agent] : [],
98
+ "--setup"
99
+ ] },
100
+ no: { args: [
101
+ "finalize",
102
+ "--json",
103
+ ...options.agent ? ["--agent", options.agent] : []
104
+ ] },
105
+ info: { args: [
106
+ "neon-auth",
107
+ "--json",
108
+ ...options.agent ? ["--agent", options.agent] : [],
109
+ "--info"
110
+ ] }
111
+ }
112
+ }
113
+ };
114
+ }
115
+ //#endregion
116
+ export { handleNeonAuthPhase };
117
+
118
+ //# sourceMappingURL=neon-auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"neon-auth.js","names":[],"sources":["../../../src/lib/phases/neon-auth.ts"],"sourcesContent":["import { neonctlCmd } from \"../neonctl.js\";\nimport { ensureSkillsUpToDate, SKILL_REFERENCE_URLS } from \"../skills.js\";\nimport type { PhaseResponse } from \"../types.js\";\n\nexport interface NeonAuthPhaseOptions {\n\tagent?: string;\n\tsetup?: boolean;\n\tinfo?: boolean;\n\tprojectId?: string;\n}\n\nexport async function handleNeonAuthPhase(\n\toptions: NeonAuthPhaseOptions,\n): Promise<PhaseResponse> {\n\t// Validate IDs that may be interpolated into instruction strings\n\tif (options.projectId && !/^[\\w.:-]+$/.test(options.projectId)) {\n\t\tthrow new Error(\n\t\t\t`Invalid project ID: \"${options.projectId}\". Expected alphanumeric, hyphens, underscores, dots, or colons.`,\n\t\t);\n\t}\n\n\t// Ensure skills are up to date (no-op if recently updated)\n\tif (options.agent) {\n\t\tawait ensureSkillsUpToDate(options.agent);\n\t}\n\t// --info: return information about Neon Auth\n\tif (options.info) {\n\t\treturn {\n\t\t\tphase: \"neon_auth\",\n\t\t\tstatus: \"info\",\n\t\t\tnextAction: {\n\t\t\t\ttype: \"ask_user\",\n\t\t\t\tquestion:\n\t\t\t\t\t\"Neon Auth provides drop-in user authentication that integrates with your Neon database. It handles user sign-up, sign-in, and session management. Would you like to set it up?\",\n\t\t\t\toptions: [\n\t\t\t\t\t{ value: \"yes\", label: \"Yes, set up Neon Auth\" },\n\t\t\t\t\t{ value: \"no\", label: \"No, skip for now\" },\n\t\t\t\t],\n\t\t\t\tcontext: `Full documentation: ${SKILL_REFERENCE_URLS.neonAuth}`,\n\t\t\t\tresponseMapping: {\n\t\t\t\t\tyes: {\n\t\t\t\t\t\targs: [\n\t\t\t\t\t\t\t\"neon-auth\",\n\t\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t\t...(options.agent\n\t\t\t\t\t\t\t\t? [\"--agent\", options.agent]\n\t\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t\t\"--setup\",\n\t\t\t\t\t\t\t...(options.projectId\n\t\t\t\t\t\t\t\t? [\"--project-id\", options.projectId]\n\t\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t\tno: {\n\t\t\t\t\t\targs: [\n\t\t\t\t\t\t\t\"finalize\",\n\t\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t\t...(options.agent\n\t\t\t\t\t\t\t\t? [\"--agent\", options.agent]\n\t\t\t\t\t\t\t\t: []),\n\t\t\t\t\t\t],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// --setup: guide through Neon Auth configuration\n\tif (options.setup) {\n\t\treturn {\n\t\t\tphase: \"neon_auth\",\n\t\t\tstatus: \"in_progress\",\n\t\t\tnextAction: {\n\t\t\t\ttype: \"agent_action\",\n\t\t\t\tprerequisite: SKILL_REFERENCE_URLS.neonAuth,\n\t\t\t\tsteps: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"provision\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Enable Neon Auth on the project using the neonctl CLI. \" +\n\t\t\t\t\t\t\t`Run: \\`${neonctlCmd()} neon-auth enable --project-id <project-id> --output json\\`. ` +\n\t\t\t\t\t\t\t`You can check current status with: \\`${neonctlCmd()} neon-auth status --project-id <project-id> --output json\\`.` +\n\t\t\t\t\t\t\t(options.projectId\n\t\t\t\t\t\t\t\t? ` Project ID: ${options.projectId}.`\n\t\t\t\t\t\t\t\t: \" Determine the project ID from the .neon file in the project root, or from the DATABASE_URL in .env, or ask the user.\"),\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"install_packages\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Install required packages per the skill reference. The exact packages depend on the framework (Next.js, React, etc.).\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"create_components\",\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Create auth components per the skill reference. Follow the exact patterns and imports specified.\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: \"pull_env\",\n\t\t\t\t\t\tdescription: `Run \\`${neonctlCmd()} env pull\\` to populate the NEON_AUTH_BASE_URL, NEON_AUTH_JWKS_URL, and other Neon Auth environment variables. This reads the .neon context file and writes the auth URLs to the project's env file.`,\n\t\t\t\t\t\tcommand: `${neonctlCmd()} env pull`,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tonComplete: {\n\t\t\t\t\ttype: \"run_neon_init\",\n\t\t\t\t\targs: [\n\t\t\t\t\t\t\"finalize\",\n\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t...(options.agent ? [\"--agent\", options.agent] : []),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t};\n\t}\n\n\t// Default: ask if they want Neon Auth\n\treturn {\n\t\tphase: \"neon_auth\",\n\t\tstatus: \"optional\",\n\t\tnextAction: {\n\t\t\ttype: \"ask_user\",\n\t\t\tquestion:\n\t\t\t\t\"Would you like to set up Neon Auth for user authentication in your app?\",\n\t\t\toptions: [\n\t\t\t\t{ value: \"yes\", label: \"Yes, set up Neon Auth\" },\n\t\t\t\t{ value: \"no\", label: \"No, skip for now\" },\n\t\t\t\t{ value: \"info\", label: \"Tell me more about Neon Auth\" },\n\t\t\t],\n\t\t\tcontext:\n\t\t\t\t\"Neon Auth provides drop-in user authentication that integrates with your Neon database.\",\n\t\t\tresponseMapping: {\n\t\t\t\tyes: {\n\t\t\t\t\targs: [\n\t\t\t\t\t\t\"neon-auth\",\n\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t...(options.agent ? [\"--agent\", options.agent] : []),\n\t\t\t\t\t\t\"--setup\",\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\tno: {\n\t\t\t\t\targs: [\n\t\t\t\t\t\t\"finalize\",\n\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t...(options.agent ? [\"--agent\", options.agent] : []),\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\tinfo: {\n\t\t\t\t\targs: [\n\t\t\t\t\t\t\"neon-auth\",\n\t\t\t\t\t\t\"--json\",\n\t\t\t\t\t\t...(options.agent ? [\"--agent\", options.agent] : []),\n\t\t\t\t\t\t\"--info\",\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t};\n}\n"],"mappings":";;;AAWA,eAAsB,oBACrB,SACyB;CAEzB,IAAI,QAAQ,aAAa,CAAC,aAAa,KAAK,QAAQ,SAAS,GAC5D,MAAM,IAAI,MACT,wBAAwB,QAAQ,UAAU,iEAC3C;CAID,IAAI,QAAQ,OACX,MAAM,qBAAqB,QAAQ,KAAK;CAGzC,IAAI,QAAQ,MACX,OAAO;EACN,OAAO;EACP,QAAQ;EACR,YAAY;GACX,MAAM;GACN,UACC;GACD,SAAS,CACR;IAAE,OAAO;IAAO,OAAO;GAAwB,GAC/C;IAAE,OAAO;IAAM,OAAO;GAAmB,CAC1C;GACA,SAAS,uBAAuB,qBAAqB;GACrD,iBAAiB;IAChB,KAAK,EACJ,MAAM;KACL;KACA;KACA,GAAI,QAAQ,QACT,CAAC,WAAW,QAAQ,KAAK,IACzB,CAAC;KACJ;KACA,GAAI,QAAQ,YACT,CAAC,gBAAgB,QAAQ,SAAS,IAClC,CAAC;IACL,EACD;IACA,IAAI,EACH,MAAM;KACL;KACA;KACA,GAAI,QAAQ,QACT,CAAC,WAAW,QAAQ,KAAK,IACzB,CAAC;IACL,EACD;GACD;EACD;CACD;CAID,IAAI,QAAQ,OACX,OAAO;EACN,OAAO;EACP,QAAQ;EACR,YAAY;GACX,MAAM;GACN,cAAc,qBAAqB;GACnC,OAAO;IACN;KACC,IAAI;KACJ,aACC,iEACU,WAAW,EAAE,oGACiB,WAAW,EAAE,iEACpD,QAAQ,YACN,gBAAgB,QAAQ,UAAU,KAClC;IACL;IACA;KACC,IAAI;KACJ,aACC;IACF;IACA;KACC,IAAI;KACJ,aACC;IACF;IACA;KACC,IAAI;KACJ,aAAa,SAAS,WAAW,EAAE;KACnC,SAAS,GAAG,WAAW,EAAE;IAC1B;GACD;GACA,YAAY;IACX,MAAM;IACN,MAAM;KACL;KACA;KACA,GAAI,QAAQ,QAAQ,CAAC,WAAW,QAAQ,KAAK,IAAI,CAAC;IACnD;GACD;EACD;CACD;CAID,OAAO;EACN,OAAO;EACP,QAAQ;EACR,YAAY;GACX,MAAM;GACN,UACC;GACD,SAAS;IACR;KAAE,OAAO;KAAO,OAAO;IAAwB;IAC/C;KAAE,OAAO;KAAM,OAAO;IAAmB;IACzC;KAAE,OAAO;KAAQ,OAAO;IAA+B;GACxD;GACA,SACC;GACD,iBAAiB;IAChB,KAAK,EACJ,MAAM;KACL;KACA;KACA,GAAI,QAAQ,QAAQ,CAAC,WAAW,QAAQ,KAAK,IAAI,CAAC;KAClD;IACD,EACD;IACA,IAAI,EACH,MAAM;KACL;KACA;KACA,GAAI,QAAQ,QAAQ,CAAC,WAAW,QAAQ,KAAK,IAAI,CAAC;IACnD,EACD;IACA,MAAM,EACL,MAAM;KACL;KACA;KACA,GAAI,QAAQ,QAAQ,CAAC,WAAW,QAAQ,KAAK,IAAI,CAAC;KAClD;IACD,EACD;GACD;EACD;CACD;AACD"}
@@ -0,0 +1,41 @@
1
+ import { PhaseResponse } from "../types.js";
2
+ import { NeonFeature } from "../bootstrap.js";
3
+
4
+ //#region src/lib/phases/setup.d.ts
5
+ interface SetupPhaseOptions {
6
+ agent?: string;
7
+ /** The IDE/editor the user is running in (e.g. "cursor", "vscode") — reported by agent */
8
+ ide?: string;
9
+ /** Whether the directory already contains an application */
10
+ hasApp?: boolean;
11
+ /** Template ID to scaffold (when bootstrapping a new project) */
12
+ template?: string;
13
+ /** Neon features required by the selected template */
14
+ templateRequires?: NeonFeature[];
15
+ /** Neon features selected by the user (brownfield flows) */
16
+ features?: NeonFeature[];
17
+ mcpConfigured?: boolean | null;
18
+ connectionString?: boolean | null;
19
+ connectionParams?: string;
20
+ framework?: string;
21
+ orm?: string;
22
+ migrationTool?: string;
23
+ migrationDir?: string;
24
+ isVscodeIde?: boolean | null;
25
+ mode?: "defaults" | "customize";
26
+ mcpScope?: "global" | "project" | "none";
27
+ skillsScope?: "global" | "project";
28
+ installExtension?: boolean;
29
+ execute?: boolean;
30
+ }
31
+ /**
32
+ * Comprehensive setup phase: inspects repo state, collects user preferences,
33
+ * then batches all installation commands together.
34
+ *
35
+ * With --data JSON, the agent sends inspection results AND user preferences
36
+ * in a single call, so the CLI can go straight to installation.
37
+ */
38
+ declare function handleSetupPhase(options: SetupPhaseOptions): Promise<PhaseResponse>;
39
+ //#endregion
40
+ export { SetupPhaseOptions, handleSetupPhase };
41
+ //# sourceMappingURL=setup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.d.ts","names":[],"sources":["../../../src/lib/phases/setup.ts"],"mappings":";;;;UAsBiB,iBAAA;;EAAA;EAAiB,GAAA,CAAA,EAAA,MAAA;;QAWtB,CAAA,EAAA,OAAA;EAAW;EA0BD,QAAA,CAAA,EAAA,MAAA;EAAgB;kBAC5B,CAAA,EA7BU,WA6BV,EAAA;;UACP,CAAA,EA5BS,WA4BT,EAAA;EAAO,aAAA,CAAA,EAAA,OAAA,GAAA,IAAA;;;;;;;;;;;;;;;;;;;;;iBAFY,gBAAA,UACZ,oBACP,QAAQ"}