@waniwani/kit 0.1.6 → 0.1.8
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/README.md +67 -35
- package/dist/cli/codegen.js +1105 -0
- package/dist/cli/codegen.js.map +1 -0
- package/{cli/env.mjs → dist/cli/env.js} +5 -6
- package/dist/cli/env.js.map +1 -0
- package/{cli/framework.mjs → dist/cli/framework.js} +112 -115
- package/dist/cli/framework.js.map +1 -0
- package/dist/cli/index.js +378 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.js +642 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/log.js +156 -0
- package/dist/cli/log.js.map +1 -0
- package/dist/cli/manifest.js +57 -0
- package/dist/cli/manifest.js.map +1 -0
- package/{cli/peers.mjs → dist/cli/peers.js} +77 -88
- package/dist/cli/peers.js.map +1 -0
- package/dist/cli/scan.js +100 -0
- package/dist/cli/scan.js.map +1 -0
- package/dist/cli/template.js +173 -0
- package/dist/cli/template.js.map +1 -0
- package/dist/cli/types.js +14 -0
- package/dist/cli/types.js.map +1 -0
- package/dist/cli/validate.js +328 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/cli/vercel.js +103 -0
- package/dist/cli/vercel.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +0 -1
- package/dist/server.js.map +1 -1
- package/dist/web.d.ts +8 -7
- package/dist/web.d.ts.map +1 -1
- package/dist/web.js +7 -6
- package/dist/web.js.map +1 -1
- package/package.json +13 -9
- package/src/server.ts +7 -9
- package/src/web.tsx +12 -13
- package/cli/codegen.mjs +0 -1267
- package/cli/index.mjs +0 -409
- package/cli/init.mjs +0 -575
- package/cli/log.mjs +0 -178
- package/cli/scan.mjs +0 -112
- package/cli/template.mjs +0 -190
- package/cli/validate.mjs +0 -391
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ await server.connect(new StreamableHTTPServerTransport(/* … */));
|
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Around that file you also own a `tsconfig.json`, a bundler config for any widget
|
|
57
|
-
UI, a `Dockerfile` and
|
|
57
|
+
UI, a `Dockerfile` and the deploy config each host wants.
|
|
58
58
|
|
|
59
59
|
With the kit, you write the part that answers the question and nothing around
|
|
60
60
|
it:
|
|
@@ -234,7 +234,7 @@ npm run dev
|
|
|
234
234
|
`dev` watches the folder, mirrors changes into `.waniwani/`, and leaves nodemon
|
|
235
235
|
and Vite HMR to do the rest. An edit to `tools/check-eligibility.ts` reaches the
|
|
236
236
|
MCP endpoint in about a second. Point a client at `/mcp`, or run
|
|
237
|
-
[scripts/probe.
|
|
237
|
+
[scripts/probe.ts](https://github.com/WaniWani-AI/kit/blob/main/scripts/probe.ts) against it to exercise the server without
|
|
238
238
|
a chat client.
|
|
239
239
|
|
|
240
240
|
## The folder convention
|
|
@@ -492,7 +492,7 @@ flowchart LR
|
|
|
492
492
|
end
|
|
493
493
|
|
|
494
494
|
subgraph tpl["WaniWani-AI/mcp-distribution-template (public, separate repo)"]
|
|
495
|
-
raw["vite.config.ts · package.json · tsconfig.json<br/>src/index.css (Tailwind)
|
|
495
|
+
raw["vite.config.ts · package.json · tsconfig.json<br/>src/index.css (Tailwind)<br/>alpic.json · Dockerfile"]
|
|
496
496
|
end
|
|
497
497
|
|
|
498
498
|
subgraph cli["@waniwani/kit (what we own)"]
|
|
@@ -506,7 +506,7 @@ flowchart LR
|
|
|
506
506
|
server["src/server.ts · src/waniwani.ts"]
|
|
507
507
|
views["src/views/*.tsx"]
|
|
508
508
|
appsrc["src/app/ (your source, copied)"]
|
|
509
|
-
deployfiles["
|
|
509
|
+
deployfiles["Dockerfile · alpic.json"]
|
|
510
510
|
end
|
|
511
511
|
|
|
512
512
|
app --> scan --> check --> gen --> out
|
|
@@ -525,52 +525,81 @@ flowchart LR
|
|
|
525
525
|
4. **run** hands the result to Skybridge's `dev`, `build` or `start`, with the
|
|
526
526
|
output rewritten in WaniWani's voice.
|
|
527
527
|
|
|
528
|
-
`.waniwani/` is disposable and safe to delete.
|
|
529
|
-
project carrying a `vercel.json`, which is what lets `vercel deploy` inside it
|
|
530
|
-
work with no special support.
|
|
528
|
+
`.waniwani/` is disposable and safe to delete.
|
|
531
529
|
|
|
532
530
|
### Deploying is a git push
|
|
533
531
|
|
|
534
|
-
`waniwani
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
532
|
+
`waniwani init` asks where the app deploys, because the answer decides the one
|
|
533
|
+
config file the repo carries:
|
|
534
|
+
|
|
535
|
+
```
|
|
536
|
+
Where will this deploy?
|
|
537
|
+
1 Vercel — git push, or `vercel deploy --prebuilt`
|
|
538
|
+
2 Alpic — alpic.json comes from the build
|
|
539
|
+
3 Docker or self-hosted — Dockerfile comes from the build
|
|
540
|
+
4 Not yet — nothing written, add it later
|
|
541
|
+
```
|
|
542
|
+
|
|
543
|
+
Only Vercel leaves anything behind, and it is four lines:
|
|
538
544
|
|
|
539
545
|
```json
|
|
540
|
-
// vercel.json
|
|
546
|
+
// vercel.json
|
|
541
547
|
{
|
|
542
|
-
"
|
|
543
|
-
"
|
|
544
|
-
"routes": [{ "src": "/api(/.*)?", "dest": "/mcp" }]
|
|
548
|
+
"$schema": "https://openapi.vercel.sh/vercel.json",
|
|
549
|
+
"framework": null
|
|
545
550
|
}
|
|
546
551
|
```
|
|
547
552
|
|
|
548
|
-
|
|
553
|
+
`framework: null` selects the `Other` preset. That one key is the only thing a
|
|
554
|
+
repo cannot say any other way: the preset is a project setting Vercel resolves
|
|
555
|
+
*before* the build command runs, so a project whose dashboard says `Next.js` or
|
|
556
|
+
`Express` fails on the preset and never reaches the build. `Other` is what runs
|
|
557
|
+
the `build` script and adopts what the build produced.
|
|
558
|
+
|
|
559
|
+
```
|
|
560
|
+
Error: No Next.js version detected.
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
Nothing else belongs in that file. `waniwani build` writes a Build Output tree
|
|
564
|
+
inside `.waniwani/` — the bundled function, the static assets, the routing config
|
|
565
|
+
— and the build's last step moves it to `.vercel/output` at the app root, the one
|
|
566
|
+
path where Vercel adopts one. A `buildCommand` would restate the `build` script
|
|
567
|
+
that already runs, and a `routes` table would duplicate routing the build writes.
|
|
568
|
+
Both go stale against a kit that moved on; `framework: null` is a fact about the
|
|
569
|
+
project, so it never changes.
|
|
549
570
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
571
|
+
```bash
|
|
572
|
+
git push # a git-connected project builds and serves it
|
|
573
|
+
vercel deploy --prebuilt # or upload the tree a local build produced
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
A prebuilt deploy skips the preset question entirely, since it uploads the tree
|
|
577
|
+
and asks Vercel to build nothing.
|
|
578
|
+
|
|
579
|
+
One thing the kit decides on the app's behalf, in that tree's own routing table:
|
|
553
580
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
581
|
+
```json
|
|
582
|
+
{ "src": "/api(/.*)?", "dest": "/mcp" }
|
|
583
|
+
```
|
|
557
584
|
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
Vercel made are never routed to. Deleting the directory during the build is not
|
|
563
|
-
an alternative, since the file list is read before the build command runs:
|
|
585
|
+
Vercel reserves a root `api/` directory. It compiles every file under one into a
|
|
586
|
+
serverless function of its own, and an endpoint module is not a Vercel handler —
|
|
587
|
+
`defineEndpoint({ ... })` is an object. The reservation cannot be waived, since
|
|
588
|
+
the file list is read before the build command runs:
|
|
564
589
|
|
|
565
590
|
```
|
|
566
591
|
Error: File not found: /vercel/path0/api/cal/book.ts
|
|
567
592
|
```
|
|
568
593
|
|
|
569
|
-
|
|
594
|
+
So the route goes in ahead of the tree's `filesystem` handler, which is the
|
|
595
|
+
phase those functions sit in. `/api/*` reaches the server the kit built, and the
|
|
596
|
+
ones Vercel made are never routed to. They still cost build time, two dead
|
|
597
|
+
functions per app.
|
|
570
598
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
599
|
+
An app carrying a `vercel.json` from an earlier kit has to lose everything in it
|
|
600
|
+
but `framework`. Its build command stages the tree by hand, from a path the build
|
|
601
|
+
no longer writes to, so it deletes what the build just placed. `waniwani check`
|
|
602
|
+
names the keys that fight the build.
|
|
574
603
|
|
|
575
604
|
Environment variables live on the platform for both, since `.env` is read from
|
|
576
605
|
disk and a hosted build has no such file. A project that sets its variables for
|
|
@@ -666,7 +695,7 @@ oney/
|
|
|
666
695
|
├── src/_runtime/ the runtime, vendored as source
|
|
667
696
|
├── src/{server,waniwani}.ts entry and registration
|
|
668
697
|
├── src/views/<widget>.tsx view entries
|
|
669
|
-
├── vite.config.ts
|
|
698
|
+
├── vite.config.ts alpic.json vercel.json bundling and deploy
|
|
670
699
|
├── Dockerfile .dockerignore container deploy
|
|
671
700
|
└── tsconfig.json package.json
|
|
672
701
|
```
|
|
@@ -704,8 +733,11 @@ What an ejected repo gives up is the generator, and with it:
|
|
|
704
733
|
collides.
|
|
705
734
|
- **`waniwani init` scaffolds one shape of app**, a tool with the widget that
|
|
706
735
|
displays it. A flow is not among the files it writes.
|
|
707
|
-
- **Deploying is manual.**
|
|
708
|
-
|
|
736
|
+
- **Deploying is manual.** A build leaves a tree `vercel deploy --prebuilt`
|
|
737
|
+
uploads as it is, and a git push builds it on the platform, but no command
|
|
738
|
+
wraps either.
|
|
739
|
+
- **`init` asks where an app deploys, and nothing else does.** A transfer, or an
|
|
740
|
+
app that answered `Not yet`, writes its own `vercel.json`.
|
|
709
741
|
- **`useWidget` does not track yet.** Emitting `widget_render` and click events
|
|
710
742
|
through `useWaniwani` automatically is the next step.
|
|
711
743
|
|