@waniwani/kit 0.1.7 → 0.1.9

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.
package/dist/cli/init.js CHANGED
@@ -14,12 +14,22 @@
14
14
  * ./<name>/, the offered default (the current
15
15
  * folder's name) scaffolds in place
16
16
  *
17
+ * In a terminal it asks three questions — the name, whether the widget comes
18
+ * with the tool, and where the app deploys — and every flag below answers one of
19
+ * them ahead of time, so a question is asked only where nothing has answered it.
20
+ * Piped, on CI, or under `--yes`, nothing is asked and the defaults stand.
21
+ *
17
22
  * --name <name> the MCP server name, default the directory name
23
+ * --host <host> where it deploys: vercel, alpic, container, none
18
24
  * --minimal config and one tool, no widget
19
25
  * --yes take every default, ask nothing
20
26
  * --no-install skip the dependency install
21
27
  * --force overwrite app files that are already there
22
28
  *
29
+ * What it copies lives in `templates/starter/`, as files rather than as strings
30
+ * in this module, so the repo's own type-checker and formatter run over the
31
+ * scaffold.
32
+ *
23
33
  * Running it inside a repo that already has files is expected and supported.
24
34
  * A `package.json` is merged rather than replaced, a `.gitignore` gains the
25
35
  * lines it lacks, and a `README.md` or `.env.example` that exists is left
@@ -29,15 +39,44 @@
29
39
  import { spawn } from "node:child_process";
30
40
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
31
41
  import { basename, dirname, join, relative } from "node:path";
32
- import { createInterface } from "node:readline/promises";
33
- import { bold, dim, green, red, yellow } from "./log.js";
34
- import { PACKAGE_VERSION } from "./manifest.js";
35
- import { installable } from "./peers.js";
36
- /** A directory name as an MCP server name: `My App` becomes `my-app`. */
42
+ import { bold, dim, green, yellow } from "./log.js";
43
+ import { PACKAGE_ROOT, PACKAGE_VERSION } from "./manifest.js";
44
+ import { installable, preferred } from "./peers.js";
45
+ import { askOne, askText, canAsk, close, fail, open } from "./prompt.js";
46
+ import { latestVersion } from "./registry.js";
47
+ /**
48
+ * The letters NFD leaves whole, because their Latin shape is not a base letter
49
+ * with a mark on it. Without these, `Straße` reaches the ASCII filter as `stra`
50
+ * and comes out `stra` — a name for a different product.
51
+ */
52
+ const SPELLED_OUT = {
53
+ ß: "ss",
54
+ æ: "ae",
55
+ œ: "oe",
56
+ ø: "o",
57
+ đ: "d",
58
+ ð: "d",
59
+ ł: "l",
60
+ þ: "th",
61
+ };
62
+ /**
63
+ * A directory name as an MCP server name: `My App` becomes `my-app`.
64
+ *
65
+ * NFD splits an accented letter into a base letter and a combining mark, so
66
+ * dropping the marks turns `Café` into `cafe` rather than into `caf`, which is
67
+ * what dropping the composed character would give. What survives is a name npm
68
+ * and a filesystem both accept, and the answer as typed is kept as the title.
69
+ */
37
70
  function slugify(input) {
38
- const slug = input
39
- .trim()
40
- .toLowerCase()
71
+ // Spelled out character by character rather than through a class of the same
72
+ // letters, so the table above is the only place they are written down. A class
73
+ // is where `đ` quietly becomes a `d` that maps to nothing.
74
+ const spelled = [...input.trim().toLowerCase()]
75
+ .map((letter) => SPELLED_OUT[letter] ?? letter)
76
+ .join("");
77
+ const slug = spelled
78
+ .normalize("NFD")
79
+ .replace(/\p{Diacritic}/gu, "")
41
80
  .replace(/[^a-z0-9]+/g, "-")
42
81
  .replace(/^-+|-+$/g, "");
43
82
  return slug || "my-app";
@@ -62,21 +101,25 @@ function cleanTitle(input) {
62
101
  * What a new app depends on.
63
102
  *
64
103
  * Every version is read off this package's own manifest: `@waniwani/kit` at the
65
- * version of the CLI doing the scaffolding, and the four peers at the floors
66
- * this package declares, capped by `installable` so a floor does not install
67
- * the next major on the day it lands. A scaffold that wrote its own numbers
68
- * here would be the one file in the folder that can be wrong the day it is
69
- * created.
104
+ * version of the CLI doing the scaffolding, and the peers at the floors this
105
+ * package declares, capped by `installable` so a floor does not install the
106
+ * next major on the day it lands. A scaffold that wrote its own numbers here
107
+ * would be the one file in the folder that can be wrong the day it is created.
70
108
  *
71
- * `@waniwani/sdk` is written out even though a required peer is auto-installed
72
- * without it, because the app imports it directly — `flows/*.ts` calls
73
- * `createFlow` — and a package you import belongs in your own manifest rather
74
- * than arriving because something else asked for it.
109
+ * `@waniwani/sdk` is the exception, and `sdk` is where it comes from. The floor
110
+ * this package declares is frozen at release, so reading the SDK version off it
111
+ * scaffolds whatever was current when the kit shipped rather than what npm
112
+ * serves — see `preferred` in `./peers.ts`, which is what the caller resolves
113
+ * this through.
114
+ *
115
+ * It is written out at all, rather than left to arrive as a required peer,
116
+ * because the app imports it directly — `flows/*.ts` calls `createFlow` — and a
117
+ * package you import belongs in your own manifest.
75
118
  */
76
- function dependencies() {
119
+ function dependencies(sdk) {
77
120
  return {
78
121
  "@waniwani/kit": `^${PACKAGE_VERSION}`,
79
- "@waniwani/sdk": installable("@waniwani/sdk"),
122
+ "@waniwani/sdk": sdk,
80
123
  react: installable("react"),
81
124
  "react-dom": installable("react-dom"),
82
125
  zod: installable("zod"),
@@ -84,12 +127,52 @@ function dependencies() {
84
127
  }
85
128
  // ------------------------------------------------------------ scaffold content
86
129
  /**
87
- * The tool name and the widget name the scaffold uses. They appear in five
88
- * files, including inside prose the model reads, so they are named once.
130
+ * The tool name and the widget name the scaffold uses. They are the filenames
131
+ * under `templates/starter/`, and the filename is the name in this framework,
132
+ * so renaming one here means renaming the file. `starter()` throws if the two
133
+ * ever disagree.
89
134
  */
90
135
  const TOOL = "search-products";
91
136
  const WIDGET = "product-list";
92
- function packageJson(app) {
137
+ /** Named once: it is looked up in the registry and written into the manifest. */
138
+ const SDK = "@waniwani/sdk";
139
+ /**
140
+ * The starter app, on disk.
141
+ *
142
+ * Real files, the way create-next-app ships `templates/app/ts/` and create-vite
143
+ * ships `template-react-ts/`: copied byte for byte, type-checked by
144
+ * `tsconfig.templates.json` against the kit this workspace builds, and formatted
145
+ * by the same biome config as the rest of the repo.
146
+ *
147
+ * The alternative is TypeScript inside a template literal in this module, which
148
+ * costs it every check the repo runs: `tsc` cannot see the JSX, biome cannot
149
+ * format it, and a change to `defineTool` or `useWidget` breaks the scaffold
150
+ * with nothing going red until somebody runs `waniwani init` by hand. Escaping
151
+ * is the visible half of that — a `\s` in the tool's regex has to be written
152
+ * `\\s`, and every backtick and `${` in the widget carries a backslash that is
153
+ * in no file anyone reads.
154
+ *
155
+ * Nothing here is interpolated, which is what makes that possible. The three
156
+ * files that do carry the app's own name — `package.json`, `waniwani.config.ts`
157
+ * and the README — are still written by this module, because they are data
158
+ * rather than sample code. create-next-app draws the same line, and its
159
+ * template folders carry no `package.json` at all.
160
+ *
161
+ * Two names differ on disk from what lands in the app. npm strips a `.gitignore`
162
+ * out of a published tarball, so the file is `gitignore` here and both CLIs
163
+ * above do the same (`gitignore` for Next, `_gitignore` for Vite); `.env.example`
164
+ * follows it for consistency rather than necessity.
165
+ */
166
+ const STARTER = join(PACKAGE_ROOT, "templates", "starter");
167
+ function starter(file) {
168
+ const source = join(STARTER, file);
169
+ if (!existsSync(source)) {
170
+ throw new Error(`the starter template is missing ${file} — looked in ${STARTER}. ` +
171
+ "An installed copy carries it through the `templates` entry in this package's `files`.");
172
+ }
173
+ return readFileSync(source, "utf-8");
174
+ }
175
+ function packageJson(app, sdk) {
93
176
  return `${JSON.stringify({
94
177
  name: app.name,
95
178
  private: true,
@@ -100,7 +183,7 @@ function packageJson(app) {
100
183
  build: "waniwani build",
101
184
  start: "waniwani start",
102
185
  },
103
- dependencies: dependencies(),
186
+ dependencies: dependencies(sdk),
104
187
  }, null, 2)}\n`;
105
188
  }
106
189
  function appConfig(app) {
@@ -113,166 +196,6 @@ export default defineApp({
113
196
  });
114
197
  `;
115
198
  }
116
- function tool() {
117
- return `import { defineTool } from "@waniwani/kit";
118
- import { z } from "zod";
119
-
120
- /**
121
- * The filename is the tool name, so this file is \`${TOOL}\`. Rename the
122
- * file and the tool renames with it.
123
- *
124
- * Swap CATALOGUE for whatever answers the question for real: a fetch, a
125
- * database, an internal API. \`run\` may be async.
126
- */
127
- const CATALOGUE = [
128
- { id: "aeron", name: "Aeron chair", price: 1290, blurb: "Mesh task chair, twelve-year warranty." },
129
- { id: "sayl", name: "Sayl chair", price: 545, blurb: "Suspension back, the light one." },
130
- { id: "nevi", name: "Nevi sit-stand desk", price: 890, blurb: "Electric, 70 to 120 cm." },
131
- { id: "ollin", name: "Ollin monitor arm", price: 235, blurb: "Single arm, holds up to 9 kg." },
132
- ];
133
-
134
- export default defineTool({
135
- // Shown to humans in connector UIs.
136
- title: "Search the catalogue",
137
- // The only thing the model reads before deciding to call this, so it says
138
- // when to call it and what not to do instead.
139
- description:
140
- "Find products matching what the shopper asked for. Call this before naming any product or quoting any price, and never answer either from memory. Pass the shopper's own words as the query.",
141
- // Zod shapes, written as plain objects instead of z.object({ ... }).
142
- input: {
143
- query: z.string().describe("What the shopper asked for, in their words, e.g. 'a chair under 600'."),
144
- },
145
- output: {
146
- products: z.array(
147
- z.object({
148
- id: z.string(),
149
- name: z.string(),
150
- price: z.number().describe("Price in euros."),
151
- blurb: z.string(),
152
- }),
153
- ),
154
- },
155
- // Becomes MCP annotations. This tool reads and does nothing else.
156
- hints: { readOnly: true },
157
- run: ({ query }) => {
158
- const terms = query.toLowerCase().split(/\\s+/).filter(Boolean);
159
- const matched = CATALOGUE.filter((product) =>
160
- terms.some((term) => \`\${product.name} \${product.blurb}\`.toLowerCase().includes(term)),
161
- );
162
- // The whole catalogue when nothing matched, so an early conversation has
163
- // something on screen while you are still wiring this up.
164
- return { products: matched.length > 0 ? matched : CATALOGUE };
165
- },
166
- });
167
- `;
168
- }
169
- function widgetContract() {
170
- return `import { defineWidget } from "@waniwani/kit";
171
- import { z } from "zod";
172
-
173
- const product = z.object({
174
- id: z.string(),
175
- name: z.string(),
176
- price: z.number().describe("Price in euros."),
177
- blurb: z.string().describe("One line about the product."),
178
- });
179
-
180
- /**
181
- * The folder name is the tool name, so this widget is \`${WIDGET}\`.
182
- *
183
- * \`data\` is one schema doing three jobs: the tool's input, its structured
184
- * output, and the props \`useWidget()\` hands ui.tsx. Server and UI cannot drift.
185
- *
186
- * This file is imported by the server and by the browser bundle, so it stays
187
- * free of React and CSS. The component sits next to it in ui.tsx.
188
- */
189
- export default defineWidget({
190
- title: "Product list",
191
- description:
192
- "Show the product cards. Call this once ${TOOL} has returned products, passing them through unmodified. Frame it in one short sentence before calling, e.g. \\"Here's what fits.\\" The widget renders every name and price itself, so do NOT list them in text.",
193
- data: {
194
- query: z.string().describe("What the shopper asked for. Shown as the heading."),
195
- products: z.array(product).describe("Products returned by ${TOOL}, unmodified."),
196
- },
197
- hints: { readOnly: true },
198
- // Text handed to the model alongside the rendered widget. Use it to say what
199
- // the model should not repeat, and what it should wait for.
200
- llmText: (data) =>
201
- \`The product list is on screen with \${data.products.length} products. It renders every name and price itself, so do NOT repeat them in text.
202
-
203
- Wait for the shopper to pick one, then answer about that product.\`,
204
- });
205
- `;
206
- }
207
- function widgetUi() {
208
- return `import { useLayout, useSendFollowUpMessage, useWidget } from "@waniwani/kit/web";
209
- import widget from "./widget.js";
210
-
211
- const euros = (value: number) =>
212
- new Intl.NumberFormat("en-IE", { style: "currency", currency: "EUR" }).format(value);
213
-
214
- export default function ProductList() {
215
- // Typed off the widget's own \`data\` schema. No generated helpers, no server
216
- // type import.
217
- const { data } = useWidget(widget);
218
- const sendFollowUp = useSendFollowUpMessage();
219
-
220
- // The host hands the colour scheme to the view instead of to the browser, so
221
- // \`prefers-color-scheme\` is the wrong signal and Tailwind's \`dark:\` variant is
222
- // wired to a \`dark\` class (see the template's src/index.css). Every widget puts
223
- // that class on its own root: a view is its own bundle in its own iframe, so
224
- // there is no shared ancestor to hang it off.
225
- const { theme } = useLayout();
226
- const root = theme === "dark" ? "dark" : "";
227
-
228
- // \`data\` arrives as soon as the host has the tool input, which on most hosts is
229
- // before the server has responded. Render optimistically.
230
- if (!data) {
231
- return <div className={\`\${root} font-sans text-sm text-slate-500\`}>Loading…</div>;
232
- }
233
-
234
- return (
235
- <div className={\`\${root} font-sans text-slate-900 dark:text-slate-100\`}>
236
- <h1 className="mb-3 text-lg font-semibold tracking-tight">{data.query}</h1>
237
-
238
- <div className="grid grid-cols-[repeat(auto-fit,minmax(180px,1fr))] gap-2.5">
239
- {data.products.map((product) => (
240
- <button
241
- type="button"
242
- key={product.id}
243
- // A click becomes a message from the shopper, which is what moves
244
- // the conversation on.
245
- onClick={() => sendFollowUp(\`Tell me more about the \${product.name}.\`)}
246
- className="flex cursor-pointer flex-col items-start gap-1 rounded-2xl border-[1.5px] border-slate-200 bg-white p-3.5 text-left transition duration-150 hover:-translate-y-px hover:border-slate-400 hover:shadow-lg hover:shadow-slate-900/10 dark:border-slate-700 dark:bg-slate-900 dark:hover:border-slate-500"
247
- // What the model reads in place of the pixels.
248
- data-llm={\`\${product.name}, \${euros(product.price)}: \${product.blurb}\`}
249
- >
250
- <span className="text-[22px] font-bold tracking-tight">{euros(product.price)}</span>
251
- <span className="font-semibold">{product.name}</span>
252
- <span className="text-[13px] text-slate-500 dark:text-slate-400">{product.blurb}</span>
253
- </button>
254
- ))}
255
- </div>
256
- </div>
257
- );
258
- }
259
- `;
260
- }
261
- function envExample() {
262
- return `# Optional. Without it the app still runs: flows use MemoryKvStore and
263
- # withWaniwani degrades to a no-op. With it, flow state is hosted and tracking
264
- # reaches app.waniwani.ai.
265
- WANIWANI_API_KEY=
266
- WANIWANI_PUBLIC_KEY=
267
- `;
268
- }
269
- function gitignore() {
270
- return `node_modules/
271
- .waniwani/
272
- .env
273
- .env.local
274
- `;
275
- }
276
199
  function readme(app) {
277
200
  return `# ${app.title}
278
201
 
@@ -301,28 +224,89 @@ and it stays out of git.
301
224
  `;
302
225
  }
303
226
  /**
304
- * The files a new app gets.
227
+ * The deploy targets `init` offers.
228
+ *
229
+ * Only Vercel needs a file in the app repo, and only for one reason: the
230
+ * framework preset is a project setting that Vercel resolves before the build
231
+ * command runs, so nothing the build emits can correct a project whose preset
232
+ * says Next.js or Express. `framework: null` selects `Other`, which is the
233
+ * preset that runs the `build` script and adopts the Build Output tree the kit
234
+ * leaves at `.vercel/output`.
305
235
  *
306
- * `whenPresent` decides what happens to one that is already on disk:
307
- * `undefined` is a collision that stops the command, `merge` folds the
308
- * scaffold's contribution into what is there, and `keep` leaves it untouched.
236
+ * Nothing else belongs in that file. A `buildCommand` would restate the `build`
237
+ * script, and a `routes` table would duplicate the routing config the build
238
+ * writes — both would then go stale against a kit that moved on. This one key is
239
+ * a fact about the project rather than about the build, so it never changes.
240
+ *
241
+ * Alpic and a container image both read their config from the generated project,
242
+ * which the build regenerates, so neither leaves anything tracked behind.
309
243
  */
310
- function scaffold(app, { minimal }) {
244
+ const HOSTS = [
245
+ {
246
+ id: "vercel",
247
+ label: "Vercel",
248
+ note: "git push, or `vercel deploy --prebuilt`",
249
+ deploy: ["git push", "vercel deploy --prebuilt # or upload a local build"],
250
+ },
251
+ {
252
+ id: "container",
253
+ label: "Docker",
254
+ note: "Dockerfile comes from the build",
255
+ deploy: ["waniwani build", "docker build .waniwani"],
256
+ },
257
+ {
258
+ id: "alpic",
259
+ label: "Alpic",
260
+ note: "alpic.json comes from the build",
261
+ deploy: ["waniwani build", "cd .waniwani && alpic deploy"],
262
+ },
263
+ {
264
+ id: "none",
265
+ label: "I don't know yet",
266
+ note: "nothing written, add it later",
267
+ deploy: [],
268
+ },
269
+ ];
270
+ export function hostById(id) {
271
+ return HOSTS.find((host) => host.id === id) ?? HOSTS[0];
272
+ }
273
+ /**
274
+ * What a git-connected Vercel project needs from the repo, and nothing more.
275
+ * See HOSTS for why this is one key.
276
+ */
277
+ function vercelJson() {
278
+ return `${JSON.stringify({
279
+ $schema: "https://openapi.vercel.sh/vercel.json",
280
+ framework: null,
281
+ }, null, 2)}\n`;
282
+ }
283
+ function scaffold(app, { minimal, host, sdk }) {
311
284
  const files = [
312
285
  {
313
286
  path: "package.json",
314
- contents: packageJson(app),
287
+ contents: packageJson(app, sdk),
315
288
  whenPresent: "merge",
316
289
  merge: mergePackageJson,
317
290
  },
318
- { path: ".gitignore", contents: gitignore(), whenPresent: "merge", merge: mergeGitignore },
319
- { path: ".env.example", contents: envExample(), whenPresent: "keep" },
291
+ {
292
+ path: ".gitignore",
293
+ contents: starter("gitignore"),
294
+ whenPresent: "merge",
295
+ merge: mergeGitignore,
296
+ },
297
+ { path: ".env.example", contents: starter("env.example"), whenPresent: "keep" },
320
298
  { path: "README.md", contents: readme(app), whenPresent: "keep" },
321
299
  { path: "waniwani.config.ts", contents: appConfig(app) },
322
- { path: `tools/${TOOL}.ts`, contents: tool() },
300
+ { path: `tools/${TOOL}.ts`, contents: starter(`tools/${TOOL}.ts`) },
323
301
  ];
324
302
  if (!minimal) {
325
- files.push({ path: `widgets/${WIDGET}/widget.ts`, contents: widgetContract() }, { path: `widgets/${WIDGET}/ui.tsx`, contents: widgetUi() });
303
+ files.push({ path: `widgets/${WIDGET}/widget.ts`, contents: starter(`widgets/${WIDGET}/widget.ts`) }, { path: `widgets/${WIDGET}/ui.tsx`, contents: starter(`widgets/${WIDGET}/ui.tsx`) });
304
+ }
305
+ // A repo that already answers Vercel its own way keeps that answer: the file
306
+ // may carry a region, a cron, or a `maxDuration` this has no business
307
+ // replacing. `waniwani check` reads it and names the keys that fight the build.
308
+ if (host === "vercel") {
309
+ files.push({ path: "vercel.json", contents: vercelJson(), whenPresent: "keep" });
326
310
  }
327
311
  return files;
328
312
  }
@@ -388,17 +372,17 @@ function write(file, contents) {
388
372
  mkdirSync(dirname(file), { recursive: true });
389
373
  writeFileSync(file, contents);
390
374
  }
391
- /** One question, with the default in parentheses and Enter taking it. */
392
- async function ask(question, fallback) {
393
- const rl = createInterface({ input: process.stdin, output: process.stdout });
394
- try {
395
- const answer = await rl.question(`${question} ${dim(`(${fallback})`)} `);
396
- return answer.trim() || fallback;
397
- }
398
- finally {
399
- rl.close();
400
- }
401
- }
375
+ /**
376
+ * The two shapes `init` scaffolds.
377
+ *
378
+ * The pair is the default because the tool-to-widget hand-off is what nobody
379
+ * guesses from the type signatures, so the folder that demonstrates it is worth
380
+ * more than an empty one. `--minimal` is the same answer given ahead of time.
381
+ */
382
+ const CONTENTS = [
383
+ { value: "pair", label: "A tool and a widget", hint: "the hand-off between them, wired up" },
384
+ { value: "tool", label: "Just a tool", hint: "a config and one tool, nothing on screen" },
385
+ ];
402
386
  /**
403
387
  * The package manager that invoked this command, which npm, pnpm, yarn and bun
404
388
  * all announce in `npm_config_user_agent`. Nothing to detect from lockfiles: a
@@ -439,12 +423,26 @@ function install(root, manager) {
439
423
  * @returns a process exit code
440
424
  */
441
425
  export async function init(appRoot, flags, { targeted = true } = {}) {
442
- const interactive = process.stdin.isTTY && !flags.yes && !flags.name;
426
+ // One question per unanswered decision, and none at all where there is nobody
427
+ // to answer. A flag counts as answered, which is what keeps `--name x --host
428
+ // vercel` from stopping on a prompt it has nothing left to ask.
429
+ const asking = canAsk() && !flags.yes;
443
430
  const suggested = slugify(basename(appRoot));
444
- // One question, and both fields come out of the answer: `Acme Shop` gives the
445
- // server the name `acme-shop` and keeps `Acme Shop` as the title. An answer
446
- // that is already a slug gets a title with a capital on the front.
447
- const answer = flags.name ?? (interactive ? await ask("App name", suggested) : suggested);
431
+ // Started here and awaited below, so the registry round trip happens behind
432
+ // the questions rather than in front of the first file write. It resolves to
433
+ // null on a slow or absent network and `preferred` falls back to the declared
434
+ // floor, so nothing about this scaffold depends on npm being reachable.
435
+ const publishedSdk = latestVersion(SDK);
436
+ if (asking) {
437
+ open(bold("A new MCP app"));
438
+ }
439
+ // Both fields come out of the one answer: `Acme Shop` gives the server the
440
+ // name `acme-shop` and keeps `Acme Shop` as the title. An answer that is
441
+ // already a slug gets a title with a capital on the front.
442
+ const named = asking && flags.name === undefined;
443
+ const answer = named
444
+ ? await askText("App name", suggested, (value) => value && !/[a-z0-9]/i.test(value) ? "a letter or a number, somewhere" : undefined)
445
+ : (flags.name ?? suggested);
448
446
  const name = slugify(answer);
449
447
  const typed = cleanTitle(answer);
450
448
  const app = { name, title: typed && typed !== name ? typed : titleize(name) };
@@ -453,13 +451,32 @@ export async function init(appRoot, flags, { targeted = true } = {}) {
453
451
  // create-next-app's one question reads. Taking the offered default leaves
454
452
  // everything where it is, since that default is the current folder's own name,
455
453
  // and `waniwani init .` names the current folder outright.
456
- const root = !targeted && interactive && name !== suggested ? join(appRoot, name) : appRoot;
457
- const files = scaffold(app, { minimal: Boolean(flags.minimal) });
454
+ const root = !targeted && named && name !== suggested ? join(appRoot, name) : appRoot;
455
+ // The widget is what `--minimal` drops, so the flag and the question are the
456
+ // same decision reached two ways.
457
+ const minimal = flags.minimal !== undefined
458
+ ? Boolean(flags.minimal)
459
+ : asking
460
+ ? (await askOne("What should it come with?", CONTENTS)) === "tool"
461
+ : false;
462
+ // Asked rather than assumed, because the answer decides whether the repo
463
+ // carries a deploy file at all, and because seeing the four options is how
464
+ // someone learns the app is not tied to one host.
465
+ const host = typeof flags.host === "string"
466
+ ? hostById(flags.host).id
467
+ : asking
468
+ ? await askOne("Where will this deploy?", HOSTS.map((option) => ({
469
+ value: option.id,
470
+ label: option.label,
471
+ hint: option.note,
472
+ })))
473
+ : hostById(undefined).id;
474
+ const files = scaffold(app, { minimal, host, sdk: preferred(SDK, await publishedSdk) });
458
475
  // Nothing is written until every collision is known, so a refusal leaves the
459
476
  // directory exactly as it was.
460
477
  const clashes = files.filter((file) => !file.whenPresent && existsSync(join(root, file.path)));
461
478
  if (clashes.length > 0 && !flags.force) {
462
- console.error(`\n${red("✗")} ${bold("already an app folder here")}\n`);
479
+ fail(bold("already an app folder here"));
463
480
  for (const file of clashes) {
464
481
  console.error(` ${file.path}`);
465
482
  }
@@ -492,7 +509,7 @@ export async function init(appRoot, flags, { targeted = true } = {}) {
492
509
  write(target, file.contents);
493
510
  actions.push([yellow("~"), file.path, "overwritten"]);
494
511
  }
495
- console.log(`\n${green("✓")} ${bold(app.name)} ${dim(`→ ${root}`)}\n`);
512
+ close(`${bold(app.name)} ${dim(`→ ${root}`)}`);
496
513
  for (const [marker, path, note] of actions) {
497
514
  console.log(` ${marker} ${path}${note ? ` ${dim(note)}` : ""}`);
498
515
  }
@@ -525,10 +542,21 @@ export async function init(appRoot, flags, { targeted = true } = {}) {
525
542
  console.log(` ${ours ? `${manager} run dev` : `${RUNNERS[manager]} waniwani dev`}`);
526
543
  console.log(`\n${bold("Then")}`);
527
544
  console.log(` ${dim("·")} edit ${bold(`tools/${TOOL}.ts`)} to answer with your own data`);
528
- if (!flags.minimal) {
545
+ if (!minimal) {
529
546
  console.log(` ${dim("·")} edit ${bold(`widgets/${WIDGET}/ui.tsx`)} for how it looks on screen`);
530
547
  }
531
548
  console.log(` ${dim("·")} add ${bold("flows/<name>.ts")} for a multi-step conversation`);
549
+ const target = hostById(host);
550
+ if (target.deploy.length > 0) {
551
+ console.log(`\n${bold(`Deploying to ${target.label}`)}`);
552
+ for (const line of target.deploy) {
553
+ console.log(` ${line}`);
554
+ }
555
+ }
556
+ else {
557
+ console.log(`\n${bold("Deploying")}`);
558
+ console.log(` ${dim("·")} rerun with ${bold("--host vercel")} for the one file Vercel needs`);
559
+ }
532
560
  return 0;
533
561
  }
534
562
  //# sourceMappingURL=init.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../cli/init.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AA2BzC,yEAAyE;AACzE,SAAS,OAAO,CAAC,KAA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