@vistagenic/vista 0.3.6 → 0.3.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.
Files changed (68) hide show
  1. package/bin/flashpack-agent-playground.mjs +134 -0
  2. package/bin/flashpack-boot.mjs +506 -0
  3. package/bin/flashpack-ssr-loader.mjs +42 -0
  4. package/bin/flashpack-ssr.mjs +202 -0
  5. package/bin/flashpack-vendor.mjs +97 -0
  6. package/bin/vista.js +56 -42
  7. package/dist/ai/providers/base.js +7 -1
  8. package/dist/bin/build-rsc.js +16 -0
  9. package/dist/bin/build.js +17 -11
  10. package/dist/bin/deploy.js +7 -0
  11. package/dist/bin/dev-client-runtime.d.ts +6 -0
  12. package/dist/bin/dev-client-runtime.js +99 -0
  13. package/dist/bin/dev-error-overlay-snippet.js +79 -21
  14. package/dist/bin/dev-error-overlay-snippet.ts +840 -0
  15. package/dist/bin/devtools-indicator-snippet.js +29 -13
  16. package/dist/bin/file-scanner.js +7 -24
  17. package/dist/bin/generate.js +94 -2
  18. package/dist/bin/webpack.config.js +3 -1
  19. package/dist/build/rsc/compiler.d.ts +14 -0
  20. package/dist/build/rsc/compiler.js +66 -6
  21. package/dist/build/rsc/server-manifest.js +5 -4
  22. package/dist/config.d.ts +5 -0
  23. package/dist/config.js +15 -1
  24. package/dist/deploy/adapters/render.js +2 -2
  25. package/dist/deploy/index.d.ts +1 -0
  26. package/dist/deploy/index.js +3 -0
  27. package/dist/deploy/runtime-pack.js +22 -1
  28. package/dist/deploy/utils.js +16 -6
  29. package/dist/flashpack/command.d.ts +1 -0
  30. package/dist/flashpack/command.js +42 -76
  31. package/dist/flashpack/runtime.d.ts +12 -0
  32. package/dist/flashpack/runtime.js +124 -22
  33. package/dist/metadata/generate.d.ts +1 -0
  34. package/dist/metadata/generate.js +117 -21
  35. package/dist/metadata/index.d.ts +5 -0
  36. package/dist/metadata/index.js +15 -1
  37. package/dist/metadata/json-ld.d.ts +15 -0
  38. package/dist/metadata/json-ld.js +19 -0
  39. package/dist/metadata/merge.d.ts +17 -0
  40. package/dist/metadata/merge.js +161 -0
  41. package/dist/metadata/routes.d.ts +66 -0
  42. package/dist/metadata/routes.js +143 -0
  43. package/dist/metadata/types.d.ts +1 -1
  44. package/dist/metadata/types.js +3 -1
  45. package/dist/og/image-response.d.ts +38 -0
  46. package/dist/og/image-response.js +88 -0
  47. package/dist/og/index.d.ts +2 -0
  48. package/dist/og/index.js +5 -0
  49. package/dist/rust/index.d.ts +13 -0
  50. package/dist/rust/index.js +132 -0
  51. package/dist/server/engine.js +13 -3
  52. package/dist/server/logger.js +2 -1
  53. package/dist/server/project-alias-resolver.d.ts +7 -0
  54. package/dist/server/project-alias-resolver.js +70 -0
  55. package/dist/server/rsc-engine.js +93 -16
  56. package/dist/server/static-generator.js +4 -3
  57. package/dist/server/typed-api-runtime.js +92 -0
  58. package/docs/ai.md +69 -0
  59. package/docs/app.md +30 -0
  60. package/docs/cli.md +29 -0
  61. package/docs/index.md +18 -0
  62. package/docs/rag.md +54 -0
  63. package/native/win32-x64/flashpack-cli.exe +0 -0
  64. package/package.json +196 -178
  65. package/skills/README.md +9 -0
  66. package/skills/vista-agent/SKILL.md +28 -0
  67. package/skills/vista-dev-loop/SKILL.md +25 -0
  68. package/skills/vista-rag/SKILL.md +26 -0
package/package.json CHANGED
@@ -1,178 +1,196 @@
1
- {
2
- "name": "@vistagenic/vista",
3
- "version": "0.3.6",
4
- "description": "The React Framework for Visionaries - Rust-powered SSR with Server Components",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "repository": {
8
- "type": "git",
9
- "url": "git+https://github.com/Mantitup-Org/vista.git",
10
- "directory": "packages/vista"
11
- },
12
- "author": "Vista Team",
13
- "license": "MIT",
14
- "keywords": [
15
- "react",
16
- "framework",
17
- "ssr",
18
- "server-components",
19
- "rsc",
20
- "rust",
21
- "swc",
22
- "vista"
23
- ],
24
- "files": [
25
- "dist",
26
- "bin"
27
- ],
28
- "exports": {
29
- ".": {
30
- "react-server": "./dist/react-server.js",
31
- "types": "./dist/index.d.ts",
32
- "default": "./dist/index.js"
33
- },
34
- "./link": {
35
- "react-server": "./dist/client/link.react-server.js",
36
- "types": "./dist/client/link.d.ts",
37
- "default": "./dist/client/link.js"
38
- },
39
- "./image": {
40
- "react-server": "./dist/image/react-server.js",
41
- "types": "./dist/image/index.d.ts",
42
- "default": "./dist/image/index.js"
43
- },
44
- "./router": {
45
- "react-server": "./dist/client/router.react-server.js",
46
- "types": "./dist/client/router.d.ts",
47
- "default": "./dist/client/router.js"
48
- },
49
- "./navigation": {
50
- "react-server": "./dist/client/navigation.react-server.js",
51
- "types": "./dist/client/navigation.d.ts",
52
- "default": "./dist/client/navigation.js"
53
- },
54
- "./dynamic": {
55
- "react-server": "./dist/client/dynamic.react-server.js",
56
- "types": "./dist/client/dynamic.d.ts",
57
- "default": "./dist/client/dynamic.js"
58
- },
59
- "./script": {
60
- "react-server": "./dist/client/script.react-server.js",
61
- "types": "./dist/client/script.d.ts",
62
- "default": "./dist/client/script.js"
63
- },
64
- "./font": {
65
- "types": "./dist/font/index.d.ts",
66
- "default": "./dist/font/index.js"
67
- },
68
- "./font/google": {
69
- "types": "./dist/font/google.d.ts",
70
- "default": "./dist/font/google.js"
71
- },
72
- "./font/local": {
73
- "types": "./dist/font/local.d.ts",
74
- "default": "./dist/font/local.js"
75
- },
76
- "./theme": {
77
- "react-server": "./dist/theme/react-server.js",
78
- "types": "./dist/theme/index.d.ts",
79
- "default": "./dist/theme/index.js"
80
- },
81
- "./head": {
82
- "react-server": "./dist/client/head.react-server.js",
83
- "types": "./dist/client/head.d.ts",
84
- "default": "./dist/client/head.js"
85
- },
86
- "./config": {
87
- "types": "./dist/config.d.ts",
88
- "default": "./dist/config.js"
89
- },
90
- "./auth": {
91
- "types": "./dist/auth/index.d.ts",
92
- "default": "./dist/auth/index.js"
93
- },
94
- "./auth/react": {
95
- "react-server": "./dist/auth/react-server.js",
96
- "types": "./dist/auth/react.d.ts",
97
- "default": "./dist/auth/react.js"
98
- },
99
- "./ai": {
100
- "types": "./dist/ai/index.d.ts",
101
- "default": "./dist/ai/index.js"
102
- },
103
- "./ai/react": {
104
- "react-server": "./dist/ai/react/react-server.js",
105
- "types": "./dist/ai/react/index.d.ts",
106
- "default": "./dist/ai/react/index.js"
107
- },
108
- "./stack": {
109
- "types": "./dist/stack/index.d.ts",
110
- "default": "./dist/stack/index.js"
111
- },
112
- "./stack/client": {
113
- "types": "./dist/stack/client/index.d.ts",
114
- "default": "./dist/stack/client/index.js"
115
- },
116
- "./client/rsc-router": {
117
- "react-server": "./dist/client/rsc-router.react-server.js",
118
- "types": "./dist/client/rsc-router.d.ts",
119
- "default": "./dist/client/rsc-router.js"
120
- },
121
- "./client/server-actions": {
122
- "types": "./dist/client/server-actions.d.ts",
123
- "default": "./dist/client/server-actions.js"
124
- },
125
- "./server": {
126
- "types": "./dist/server/index.d.ts",
127
- "default": "./dist/server/index.js"
128
- },
129
- "./server/runtime-actions": {
130
- "types": "./dist/server/runtime-actions.d.ts",
131
- "default": "./dist/server/runtime-actions.js"
132
- },
133
- "./cache": {
134
- "types": "./dist/server/cache.d.ts",
135
- "default": "./dist/server/cache.js"
136
- },
137
- "./package.json": "./package.json"
138
- },
139
- "bin": {
140
- "vista": "bin/vista.js"
141
- },
142
- "publishConfig": {
143
- "access": "public"
144
- },
145
- "scripts": {
146
- "build": "tsc"
147
- },
148
- "dependencies": {
149
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
150
- "@swc-node/register": "^1.9.0",
151
- "@swc/core": "^1.4.0",
152
- "chokidar": "^3.6.0",
153
- "css-loader": "^7.1.2",
154
- "esbuild": "^0.24.2",
155
- "express": "^4.21.2",
156
- "mini-css-extract-plugin": "^2.9.4",
157
- "null-loader": "^4.0.1",
158
- "react": "^19.0.0",
159
- "react-dom": "^19.0.0",
160
- "react-refresh": "^0.14.0",
161
- "react-server-dom-webpack": "^19.0.0",
162
- "swc-loader": "^0.2.6",
163
- "ts-node": "^10.9.2",
164
- "webpack": "^5.90.0",
165
- "webpack-dev-middleware": "^7.0.0",
166
- "webpack-hot-middleware": "^2.26.0"
167
- },
168
- "devDependencies": {
169
- "@types/express": "^5.0.0",
170
- "@types/node": "^22.10.2",
171
- "@types/react": "^19.0.1",
172
- "@types/react-dom": "^19.0.2",
173
- "@types/webpack": "^5.28.5",
174
- "@types/webpack-hot-middleware": "^2.25.9",
175
- "typescript": "^5.7.2"
176
- },
177
- "gitHead": "d1b9f715d6365d8e1f553e96b752fbce8d98df7c"
178
- }
1
+ {
2
+ "name": "@vistagenic/vista",
3
+ "version": "0.3.9",
4
+ "description": "The React Framework for Visionaries - Rust-powered SSR with Server Components",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Mantitup-Org/vista.git",
10
+ "directory": "packages/vista"
11
+ },
12
+ "author": "Vista Team",
13
+ "license": "MIT",
14
+ "keywords": [
15
+ "react",
16
+ "framework",
17
+ "ssr",
18
+ "server-components",
19
+ "rsc",
20
+ "rust",
21
+ "swc",
22
+ "vista"
23
+ ],
24
+ "files": [
25
+ "dist",
26
+ "bin",
27
+ "native",
28
+ "docs",
29
+ "skills"
30
+ ],
31
+ "exports": {
32
+ ".": {
33
+ "react-server": "./dist/react-server.js",
34
+ "types": "./dist/index.d.ts",
35
+ "default": "./dist/index.js"
36
+ },
37
+ "./link": {
38
+ "react-server": "./dist/client/link.react-server.js",
39
+ "types": "./dist/client/link.d.ts",
40
+ "default": "./dist/client/link.js"
41
+ },
42
+ "./image": {
43
+ "react-server": "./dist/image/react-server.js",
44
+ "types": "./dist/image/index.d.ts",
45
+ "default": "./dist/image/index.js"
46
+ },
47
+ "./router": {
48
+ "react-server": "./dist/client/router.react-server.js",
49
+ "types": "./dist/client/router.d.ts",
50
+ "default": "./dist/client/router.js"
51
+ },
52
+ "./navigation": {
53
+ "react-server": "./dist/client/navigation.react-server.js",
54
+ "types": "./dist/client/navigation.d.ts",
55
+ "default": "./dist/client/navigation.js"
56
+ },
57
+ "./dynamic": {
58
+ "react-server": "./dist/client/dynamic.react-server.js",
59
+ "types": "./dist/client/dynamic.d.ts",
60
+ "default": "./dist/client/dynamic.js"
61
+ },
62
+ "./script": {
63
+ "react-server": "./dist/client/script.react-server.js",
64
+ "types": "./dist/client/script.d.ts",
65
+ "default": "./dist/client/script.js"
66
+ },
67
+ "./font": {
68
+ "types": "./dist/font/index.d.ts",
69
+ "default": "./dist/font/index.js"
70
+ },
71
+ "./font/google": {
72
+ "types": "./dist/font/google.d.ts",
73
+ "default": "./dist/font/google.js"
74
+ },
75
+ "./font/local": {
76
+ "types": "./dist/font/local.d.ts",
77
+ "default": "./dist/font/local.js"
78
+ },
79
+ "./theme": {
80
+ "react-server": "./dist/theme/react-server.js",
81
+ "types": "./dist/theme/index.d.ts",
82
+ "default": "./dist/theme/index.js"
83
+ },
84
+ "./head": {
85
+ "react-server": "./dist/client/head.react-server.js",
86
+ "types": "./dist/client/head.d.ts",
87
+ "default": "./dist/client/head.js"
88
+ },
89
+ "./config": {
90
+ "types": "./dist/config.d.ts",
91
+ "default": "./dist/config.js"
92
+ },
93
+ "./auth": {
94
+ "types": "./dist/auth/index.d.ts",
95
+ "default": "./dist/auth/index.js"
96
+ },
97
+ "./auth/react": {
98
+ "react-server": "./dist/auth/react-server.js",
99
+ "types": "./dist/auth/react.d.ts",
100
+ "default": "./dist/auth/react.js"
101
+ },
102
+ "./ai": {
103
+ "types": "./dist/ai/index.d.ts",
104
+ "default": "./dist/ai/index.js"
105
+ },
106
+ "./ai/react": {
107
+ "react-server": "./dist/ai/react/react-server.js",
108
+ "types": "./dist/ai/react/index.d.ts",
109
+ "default": "./dist/ai/react/index.js"
110
+ },
111
+ "./stack": {
112
+ "types": "./dist/stack/index.d.ts",
113
+ "default": "./dist/stack/index.js"
114
+ },
115
+ "./stack/client": {
116
+ "types": "./dist/stack/client/index.d.ts",
117
+ "default": "./dist/stack/client/index.js"
118
+ },
119
+ "./client/rsc-router": {
120
+ "react-server": "./dist/client/rsc-router.react-server.js",
121
+ "types": "./dist/client/rsc-router.d.ts",
122
+ "default": "./dist/client/rsc-router.js"
123
+ },
124
+ "./client/server-actions": {
125
+ "types": "./dist/client/server-actions.d.ts",
126
+ "default": "./dist/client/server-actions.js"
127
+ },
128
+ "./server": {
129
+ "types": "./dist/server/index.d.ts",
130
+ "default": "./dist/server/index.js"
131
+ },
132
+ "./server/runtime-actions": {
133
+ "types": "./dist/server/runtime-actions.d.ts",
134
+ "default": "./dist/server/runtime-actions.js"
135
+ },
136
+ "./cache": {
137
+ "types": "./dist/server/cache.d.ts",
138
+ "default": "./dist/server/cache.js"
139
+ },
140
+ "./metadata": {
141
+ "types": "./dist/metadata/index.d.ts",
142
+ "default": "./dist/metadata/index.js"
143
+ },
144
+ "./og": {
145
+ "types": "./dist/og/index.d.ts",
146
+ "default": "./dist/og/index.js"
147
+ },
148
+ "./rust": {
149
+ "types": "./dist/rust/index.d.ts",
150
+ "default": "./dist/rust/index.js"
151
+ },
152
+ "./package.json": "./package.json"
153
+ },
154
+ "bin": {
155
+ "vista": "bin/vista.js"
156
+ },
157
+ "publishConfig": {
158
+ "access": "public"
159
+ },
160
+ "scripts": {
161
+ "build": "tsc",
162
+ "stage:flashpack": "node scripts/stage-flashpack-binary.mjs"
163
+ },
164
+ "dependencies": {
165
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
166
+ "@swc-node/register": "^1.9.0",
167
+ "@swc/core": "^1.4.0",
168
+ "chokidar": "^3.6.0",
169
+ "css-loader": "^7.1.2",
170
+ "esbuild": "^0.24.2",
171
+ "express": "^4.21.2",
172
+ "mini-css-extract-plugin": "^2.9.4",
173
+ "null-loader": "^4.0.1",
174
+ "react": "^19.0.0",
175
+ "react-dom": "^19.0.0",
176
+ "react-refresh": "^0.14.0",
177
+ "react-server-dom-webpack": "^19.0.0",
178
+ "satori": "^0.12.2",
179
+ "@resvg/resvg-wasm": "^2.6.2",
180
+ "swc-loader": "^0.2.6",
181
+ "ts-node": "^10.9.2",
182
+ "webpack": "^5.90.0",
183
+ "webpack-dev-middleware": "^7.0.0",
184
+ "webpack-hot-middleware": "^2.26.0"
185
+ },
186
+ "devDependencies": {
187
+ "@types/express": "^5.0.0",
188
+ "@types/node": "^22.10.2",
189
+ "@types/react": "^19.0.1",
190
+ "@types/react-dom": "^19.0.2",
191
+ "@types/webpack": "^5.28.5",
192
+ "@types/webpack-hot-middleware": "^2.25.9",
193
+ "typescript": "^5.7.2"
194
+ },
195
+ "gitHead": "d1b9f715d6365d8e1f553e96b752fbce8d98df7c"
196
+ }
@@ -0,0 +1,9 @@
1
+ # Vista agent skills
2
+
3
+ These skills ship inside the `vista` package at `skills/`. An app's `AGENTS.md` points agents here. Read the `SKILL.md` that matches the task. Framework lookups stay in `docs/`.
4
+
5
+ | Skill | When |
6
+ | --- | --- |
7
+ | `vista-dev-loop` | After an edit, verify the running `vista dev` server |
8
+ | `vista-agent` | Add an agent, tools, and a streaming chat route |
9
+ | `vista-rag` | Ground an agent with `InMemoryVectorStore` |
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: vista-agent
3
+ description: >
4
+ Add a Vista AI agent, tool, and streaming chat route. Use when the user
5
+ asks for a chat agent, tool calling, `vista g agent`, `useAgent`, or
6
+ `vista/ai`. Do not install a third-party agent SDK.
7
+ ---
8
+
9
+ # Add a Vista agent
10
+
11
+ Read `docs/ai.md` in this package before editing.
12
+
13
+ ## Steps
14
+
15
+ 1. From the app root, run `vista g agent <name>`. The name is kebab-case. This writes:
16
+ - `app/agents/<name>/agent.ts`
17
+ - `app/api/agents/<name>/route.ts`
18
+ - `app/AGENTS.md` when that file is missing
19
+ 2. Edit the generated agent. Keep `import { agent, tool } from 'vista/ai'`. Set `model` to `process.env.VISTA_AI_MODEL` or an explicit `provider:model` string from `docs/ai.md`. Put real tools in `tools`. Leave `memory: true` unless the user asked for a stateless agent.
20
+ 3. Keep the generated `POST` handler. It must call `<name>Agent.stream({ prompt, messages, sessionId })` and `return stream.toDataStreamResponse()`.
21
+ 4. Add a client page with `'use client'` and `useAgent({ api: '/api/agents/<name>' })` from `vista/ai/react`.
22
+ 5. Do not commit API keys. Tell the user which env var the chosen provider needs (`OPENAI_API_KEY`, `GROQ_API_KEY`, `ANTHROPIC_API_KEY`, `GEMINI_API_KEY`, or `NVIDIA_API_KEY`).
23
+ 6. Verify with the `vista-dev-loop` skill: `POST /api/agents/<name>` with a JSON body `{ "prompt": "ping" }` and confirm the terminal shows the request rather than a compile error.
24
+
25
+ ## Do not
26
+
27
+ - Import from `@vistagenic/vista/ai` inside an app. Apps use `vista/ai`.
28
+ - Create `app/page.tsx` or `app/layout.tsx`. Home is `app/index.tsx`. The root layout is `app/root.tsx`.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: vista-dev-loop
3
+ description: >
4
+ Verify a Vista app edit against the running dev server. Use after changing
5
+ pages, layouts, routes, styles, or client state in an app whose scripts are
6
+ `vista dev` / `vista build`. Covers port 3003, `.vista` vs `.flash`, and
7
+ reading the dev terminal before claiming the change works.
8
+ ---
9
+
10
+ # Vista dev loop
11
+
12
+ Run this after each edit that changes what the user sees or what a route returns. Do not claim the UI works from a file read alone.
13
+
14
+ ## Steps
15
+
16
+ 1. Confirm the app scripts are `vista dev`, `vista build`, and `vista start`. Do not rename them when `vista.config.ts` sets `engine.variant` to `flashpack`.
17
+ 2. Start `vista dev` if it is not already running. The default port is `3003`. If the port is taken, stop the existing Vista process and start once. Do not start a second server.
18
+ 3. Request the changed route. For a page, open `http://localhost:3003<path>`. For a route handler, call the HTTP method the file exports.
19
+ 4. Read the dev terminal. A successful page log looks like `GET / 200`. Compile and runtime errors are printed there. Fix the first error and request the route again.
20
+ 5. On the flashpack engine, dev artifacts are under `.flash/` (`dev/modules`, `dev/ssr`, `logs`). Production build artifacts stay under `.vista/`. Do not treat those folders as duplicates.
21
+ 6. When the change is visual or interactive, exercise the control (click, type, submit, navigate), including the empty and error states the edit touches.
22
+
23
+ ## Stop when
24
+
25
+ The changed route returns the expected status, the terminal has no new error for that request, and the interaction you changed behaves correctly.
@@ -0,0 +1,26 @@
1
+ ---
2
+ name: vista-rag
3
+ description: >
4
+ Ground a Vista agent with retrieval. Use when the user asks for RAG,
5
+ document search, embeddings, `InMemoryVectorStore`, `createRetrieverTool`,
6
+ or `embedText`. Keyword search needs no API key. Embeddings are optional.
7
+ ---
8
+
9
+ # Add RAG to a Vista agent
10
+
11
+ Read `docs/rag.md` in this package before editing.
12
+
13
+ ## Steps
14
+
15
+ 1. Run `vista g agent <name>` if the agent does not exist yet. Follow `vista-agent` for the route and the client page.
16
+ 2. Add a module such as `lib/rag.ts` that creates an `InMemoryVectorStore`, calls `addDocuments` (or `addDocument` when storing vectors), and exports a `createRetrieverTool`.
17
+ 3. Start with keyword search: omit `embed`. Use `model: 'mock:echo'` only for a smoke test. For a real answer, set `provider:model` and the matching API key.
18
+ 4. Pass that tool on the agent's `tools` array. The system prompt must tell the model to answer from the retriever results and to say when nothing matches.
19
+ 5. Add embeddings only when the user asks for semantic search. Use `embedText` from `vista/ai` with an OpenAI-compatible embedding model, store `vector` on each document, and pass the same function as `createRetrieverTool`'s `embed`.
20
+ 6. Verify with `vista-dev-loop`. `POST` a question whose answer is in the indexed text and confirm the route responds. Do not claim the model cited a chunk unless the response includes it.
21
+
22
+ ## Imports
23
+
24
+ ```ts
25
+ import { agent, InMemoryVectorStore, createRetrieverTool, embedText } from 'vista/ai';
26
+ ```