@waniwani/kit 0.1.6-beta.0 → 0.1.7
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 +39 -39
- 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/{cli/init.mjs → dist/cli/init.js} +228 -276
- 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/dist/cli/peers.js +159 -0
- 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 +14 -14
- package/src/server.ts +7 -9
- package/src/web.tsx +12 -13
- package/cli/codegen.mjs +0 -1215
- package/cli/index.mjs +0 -409
- package/cli/log.mjs +0 -178
- package/cli/scan.mjs +0 -112
- package/cli/template.mjs +0 -190
- package/cli/validate.mjs +0 -327
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,51 @@ 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
|
-
### Deploying is a git push
|
|
530
|
+
### Deploying is a git push, with no deploy config
|
|
533
531
|
|
|
534
|
-
`waniwani build` writes a Vercel Build Output tree
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
532
|
+
`waniwani build` writes a Vercel Build Output tree: the bundled function, the
|
|
533
|
+
static assets, the routing config. The framework emits it inside `.waniwani/`,
|
|
534
|
+
and the build's last step moves it to `.vercel/output` at the app root, which is
|
|
535
|
+
the one path where Vercel adopts a Build Output tree. Nothing else is needed to
|
|
536
|
+
deploy, and an app repo carries no `vercel.json`:
|
|
538
537
|
|
|
539
|
-
```
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
"framework": null,
|
|
543
|
-
"buildCommand": "waniwani build && rm -rf .vercel/output && cp -R .waniwani/.vercel/output .vercel/output",
|
|
544
|
-
"routes": [{ "src": "/api(/.*)?", "dest": "/mcp" }]
|
|
545
|
-
}
|
|
538
|
+
```bash
|
|
539
|
+
git push # a git-connected project builds and serves it
|
|
540
|
+
vercel deploy --prebuilt # or upload the tree a local build produced
|
|
546
541
|
```
|
|
547
542
|
|
|
548
|
-
|
|
543
|
+
Zero config works because every question Vercel would ask has an answer already
|
|
544
|
+
in the repo. The framework preset resolves to `Other`, since an app folder holds
|
|
545
|
+
no framework dependency to detect. The `Other` preset's build command is the
|
|
546
|
+
`build` script from `package.json`, which is `waniwani build`. And the output is
|
|
547
|
+
adopted as built rather than served as static files, because the tree is where
|
|
548
|
+
Vercel looks for one.
|
|
549
549
|
|
|
550
|
-
|
|
551
|
-
repo does not have, which is what produces `No Next.js version detected` on a
|
|
552
|
-
repo holding no framework at all.
|
|
550
|
+
One thing the kit decides on the app's behalf, in that tree's own routing table:
|
|
553
551
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
552
|
+
```json
|
|
553
|
+
{ "src": "/api(/.*)?", "dest": "/mcp" }
|
|
554
|
+
```
|
|
557
555
|
|
|
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:
|
|
556
|
+
Vercel reserves a root `api/` directory. It compiles every file under one into a
|
|
557
|
+
serverless function of its own, and an endpoint module is not a Vercel handler —
|
|
558
|
+
`defineEndpoint({ ... })` is an object. The reservation cannot be waived, since
|
|
559
|
+
the file list is read before the build command runs:
|
|
564
560
|
|
|
565
561
|
```
|
|
566
562
|
Error: File not found: /vercel/path0/api/cal/book.ts
|
|
567
563
|
```
|
|
568
564
|
|
|
569
|
-
|
|
565
|
+
So the route goes in ahead of the tree's `filesystem` handler, which is the
|
|
566
|
+
phase those functions sit in. `/api/*` reaches the server the kit built, and the
|
|
567
|
+
ones Vercel made are never routed to. They still cost build time, two dead
|
|
568
|
+
functions per app.
|
|
570
569
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
570
|
+
An app that carries a `vercel.json` from an earlier kit has to delete it. Its
|
|
571
|
+
build command stages the tree by hand, from a path the build no longer writes to,
|
|
572
|
+
so it deletes what the build just placed. `waniwani check` says so by name.
|
|
574
573
|
|
|
575
574
|
Environment variables live on the platform for both, since `.env` is read from
|
|
576
575
|
disk and a hosted build has no such file. A project that sets its variables for
|
|
@@ -666,7 +665,7 @@ oney/
|
|
|
666
665
|
├── src/_runtime/ the runtime, vendored as source
|
|
667
666
|
├── src/{server,waniwani}.ts entry and registration
|
|
668
667
|
├── src/views/<widget>.tsx view entries
|
|
669
|
-
├── vite.config.ts
|
|
668
|
+
├── vite.config.ts alpic.json vercel.json bundling and deploy
|
|
670
669
|
├── Dockerfile .dockerignore container deploy
|
|
671
670
|
└── tsconfig.json package.json
|
|
672
671
|
```
|
|
@@ -704,8 +703,9 @@ What an ejected repo gives up is the generator, and with it:
|
|
|
704
703
|
collides.
|
|
705
704
|
- **`waniwani init` scaffolds one shape of app**, a tool with the widget that
|
|
706
705
|
displays it. A flow is not among the files it writes.
|
|
707
|
-
- **Deploying is manual.**
|
|
708
|
-
|
|
706
|
+
- **Deploying is manual.** A build leaves a tree `vercel deploy --prebuilt`
|
|
707
|
+
uploads as it is, and a git push builds it on the platform, but no command
|
|
708
|
+
wraps either.
|
|
709
709
|
- **`useWidget` does not track yet.** Emitting `widget_render` and click events
|
|
710
710
|
through `useWaniwani` automatically is the next step.
|
|
711
711
|
|