@vistagenic/vista 0.2.15 → 0.3.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 (152) hide show
  1. package/bin/vista.js +184 -177
  2. package/dist/ai/agent.d.ts +37 -0
  3. package/dist/ai/agent.js +385 -0
  4. package/dist/ai/embeddings.d.ts +11 -0
  5. package/dist/ai/embeddings.js +71 -0
  6. package/dist/ai/index.d.ts +10 -0
  7. package/dist/ai/index.js +26 -0
  8. package/dist/ai/memory.d.ts +16 -0
  9. package/dist/ai/memory.js +39 -0
  10. package/dist/ai/observability.d.ts +21 -0
  11. package/dist/ai/observability.js +69 -0
  12. package/dist/ai/providers/anthropic.d.ts +2 -0
  13. package/dist/ai/providers/anthropic.js +190 -0
  14. package/dist/ai/providers/base.d.ts +7 -0
  15. package/dist/ai/providers/base.js +85 -0
  16. package/dist/ai/providers/gemini.d.ts +2 -0
  17. package/dist/ai/providers/gemini.js +194 -0
  18. package/dist/ai/providers/index.d.ts +5 -0
  19. package/dist/ai/providers/index.js +21 -0
  20. package/dist/ai/providers/mock.d.ts +8 -0
  21. package/dist/ai/providers/mock.js +77 -0
  22. package/dist/ai/providers/openai.d.ts +2 -0
  23. package/dist/ai/providers/openai.js +211 -0
  24. package/dist/ai/rag.d.ts +35 -0
  25. package/dist/ai/rag.js +110 -0
  26. package/dist/ai/react/index.d.ts +1 -0
  27. package/dist/ai/react/index.js +17 -0
  28. package/dist/ai/react/react-server.d.ts +1 -0
  29. package/dist/ai/react/react-server.js +17 -0
  30. package/dist/ai/react/use-agent.d.ts +23 -0
  31. package/dist/ai/react/use-agent.js +138 -0
  32. package/dist/ai/stream.d.ts +24 -0
  33. package/dist/ai/stream.js +109 -0
  34. package/dist/ai/tool.d.ts +11 -0
  35. package/dist/ai/tool.js +47 -0
  36. package/dist/ai/types.d.ts +117 -0
  37. package/dist/ai/types.js +5 -0
  38. package/dist/auth/core.d.ts +140 -0
  39. package/dist/auth/core.js +165 -0
  40. package/dist/auth/index.d.ts +20 -8
  41. package/dist/auth/index.js +369 -16
  42. package/dist/auth/react-server.d.ts +1 -0
  43. package/dist/auth/react-server.js +10 -0
  44. package/dist/auth/react.d.ts +18 -0
  45. package/dist/auth/react.js +71 -0
  46. package/dist/bin/build-rsc.js +602 -605
  47. package/dist/bin/build.js +389 -388
  48. package/dist/bin/deploy-output.d.ts +2 -7
  49. package/dist/bin/deploy-output.js +3 -76
  50. package/dist/bin/deploy.d.ts +7 -0
  51. package/dist/bin/deploy.js +102 -0
  52. package/dist/bin/dev-error-overlay-snippet.js +552 -552
  53. package/dist/bin/devtools-indicator-snippet.js +387 -387
  54. package/dist/bin/generate.js +510 -248
  55. package/dist/build/manifest.d.ts +169 -139
  56. package/dist/build/manifest.js +423 -367
  57. package/dist/build/rsc/client-manifest.d.ts +62 -52
  58. package/dist/build/rsc/client-manifest.js +295 -193
  59. package/dist/build/rsc/client-reference-plugin.d.ts +37 -37
  60. package/dist/build/rsc/client-reference-plugin.js +160 -160
  61. package/dist/build/rsc/native-scanner.d.ts +135 -123
  62. package/dist/build/rsc/native-scanner.js +203 -170
  63. package/dist/build/rsc/react-client-reference-manifest.d.ts +28 -22
  64. package/dist/build/rsc/react-client-reference-manifest.js +240 -219
  65. package/dist/build/rsc/rsc-renderer.d.ts +99 -99
  66. package/dist/build/rsc/rsc-renderer.js +263 -263
  67. package/dist/build/rsc/server-component-loader.d.ts +19 -19
  68. package/dist/build/rsc/server-component-loader.js +91 -91
  69. package/dist/build/rsc/server-manifest.d.ts +17 -0
  70. package/dist/build/rsc/server-manifest.js +20 -0
  71. package/dist/build/standalone.js +337 -334
  72. package/dist/build/webpack/plugins/vista-flight-plugin.js +5 -5
  73. package/dist/client/dynamic.react-server.d.ts +2 -0
  74. package/dist/client/dynamic.react-server.js +23 -0
  75. package/dist/client/link.react-server.d.ts +2 -0
  76. package/dist/client/link.react-server.js +11 -0
  77. package/dist/client/navigation.react-server.d.ts +1 -0
  78. package/dist/client/navigation.react-server.js +17 -0
  79. package/dist/client/router.react-server.d.ts +1 -0
  80. package/dist/client/router.react-server.js +17 -0
  81. package/dist/client/rsc-router.react-server.d.ts +1 -0
  82. package/dist/client/rsc-router.react-server.js +17 -0
  83. package/dist/client/script.react-server.d.ts +2 -0
  84. package/dist/client/script.react-server.js +23 -0
  85. package/dist/components/client-island.d.ts +34 -34
  86. package/dist/components/client-island.js +75 -75
  87. package/dist/config.d.ts +17 -0
  88. package/dist/config.js +60 -1
  89. package/dist/deploy/adapters/cloudflare.d.ts +2 -0
  90. package/dist/deploy/adapters/cloudflare.js +124 -0
  91. package/dist/deploy/adapters/docker.d.ts +2 -0
  92. package/dist/deploy/adapters/docker.js +112 -0
  93. package/dist/deploy/adapters/index.d.ts +15 -0
  94. package/dist/deploy/adapters/index.js +24 -0
  95. package/dist/deploy/adapters/netlify.d.ts +2 -0
  96. package/dist/deploy/adapters/netlify.js +115 -0
  97. package/dist/deploy/adapters/render.d.ts +2 -0
  98. package/dist/deploy/adapters/render.js +95 -0
  99. package/dist/deploy/adapters/vercel.d.ts +7 -0
  100. package/dist/deploy/adapters/vercel.js +164 -0
  101. package/dist/deploy/cli-runner.d.ts +8 -0
  102. package/dist/deploy/cli-runner.js +58 -0
  103. package/dist/deploy/detect.d.ts +6 -0
  104. package/dist/deploy/detect.js +77 -0
  105. package/dist/deploy/index.d.ts +24 -0
  106. package/dist/deploy/index.js +112 -0
  107. package/dist/deploy/preflight.d.ts +8 -0
  108. package/dist/deploy/preflight.js +80 -0
  109. package/dist/deploy/types.d.ts +48 -0
  110. package/dist/deploy/types.js +2 -0
  111. package/dist/deploy/utils.d.ts +18 -0
  112. package/dist/deploy/utils.js +70 -0
  113. package/dist/dev-error.js +667 -667
  114. package/dist/index.d.ts +23 -21
  115. package/dist/index.js +61 -57
  116. package/dist/server/cookie-parse.d.ts +4 -0
  117. package/dist/server/cookie-parse.js +14 -0
  118. package/dist/server/engine.js +6 -19
  119. package/dist/server/index.d.ts +109 -102
  120. package/dist/server/index.js +315 -286
  121. package/dist/server/middleware-runner.d.ts +125 -57
  122. package/dist/server/middleware-runner.js +615 -218
  123. package/dist/server/middleware-security.d.ts +36 -0
  124. package/dist/server/middleware-security.js +183 -0
  125. package/dist/server/module-compile-hook.js +695 -662
  126. package/dist/server/route-handler-registry.d.ts +65 -0
  127. package/dist/server/route-handler-registry.js +195 -0
  128. package/dist/server/route-patterns.d.ts +67 -0
  129. package/dist/server/route-patterns.js +186 -0
  130. package/dist/server/rsc-engine.js +73 -80
  131. package/dist/server/rsc-module-system.d.ts +33 -33
  132. package/dist/server/rsc-module-system.js +87 -87
  133. package/dist/server/rsc-upstream.js +892 -888
  134. package/dist/server/static-generator.js +10 -10
  135. package/dist/server/typed-api-runtime.d.ts +18 -0
  136. package/dist/server/typed-api-runtime.js +635 -507
  137. package/dist/server/vista-import-map.js +134 -123
  138. package/dist/stack/index.d.ts +34 -32
  139. package/dist/stack/index.js +49 -45
  140. package/dist/stack/server/caller.d.ts +13 -0
  141. package/dist/stack/server/caller.js +42 -0
  142. package/dist/stack/server/executor.d.ts +40 -36
  143. package/dist/stack/server/executor.js +222 -174
  144. package/dist/stack/server/index.d.ts +11 -10
  145. package/dist/stack/server/index.js +24 -23
  146. package/dist/stack/server/procedure.d.ts +20 -18
  147. package/dist/stack/server/procedure.js +66 -58
  148. package/dist/stack/server/types.d.ts +113 -100
  149. package/dist/theme/react-server.d.ts +10 -0
  150. package/dist/theme/react-server.js +16 -0
  151. package/package.json +178 -153
  152. package/LICENSE +0 -21
package/bin/vista.js CHANGED
@@ -1,37 +1,37 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- const command = process.argv[2];
7
- const flags = process.argv.slice(3);
8
-
9
- function getFlagValue(flag) {
10
- const index = flags.indexOf(flag);
11
- if (index !== -1) {
12
- const next = flags[index + 1];
13
- if (next && !next.startsWith('-')) return next;
14
- }
15
-
16
- const inline = flags.find((value) => value.startsWith(`${flag}=`));
17
- if (inline) return inline.slice(flag.length + 1);
18
- return undefined;
19
- }
20
-
21
- function normalizeEngineVariant(raw) {
22
- const value = String(raw || '')
23
- .trim()
24
- .toLowerCase();
25
-
26
- if (!value) return null;
27
- if (value === 'default' || value === 'webpack') return 'default';
28
- if (value === 'flashpack') return 'flashpack';
29
- return null;
30
- }
31
-
32
- function forceRuntimeEnv(mode) {
33
- if (mode === 'development') {
34
- process.env.NODE_ENV = 'development';
1
+ #!/usr/bin/env node
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+
6
+ const command = process.argv[2];
7
+ const flags = process.argv.slice(3);
8
+
9
+ function getFlagValue(flag) {
10
+ const index = flags.indexOf(flag);
11
+ if (index !== -1) {
12
+ const next = flags[index + 1];
13
+ if (next && !next.startsWith('-')) return next;
14
+ }
15
+
16
+ const inline = flags.find((value) => value.startsWith(`${flag}=`));
17
+ if (inline) return inline.slice(flag.length + 1);
18
+ return undefined;
19
+ }
20
+
21
+ function normalizeEngineVariant(raw) {
22
+ const value = String(raw || '')
23
+ .trim()
24
+ .toLowerCase();
25
+
26
+ if (!value) return null;
27
+ if (value === 'default' || value === 'webpack') return 'default';
28
+ if (value === 'flashpack') return 'flashpack';
29
+ return null;
30
+ }
31
+
32
+ function forceRuntimeEnv(mode) {
33
+ if (mode === 'development') {
34
+ process.env.NODE_ENV = 'development';
35
35
  return;
36
36
  }
37
37
  process.env.NODE_ENV = 'production';
@@ -45,84 +45,93 @@ if (command === 'g' || command === 'generate') {
45
45
  return;
46
46
  }
47
47
 
48
- const useLegacy = flags.includes('--legacy') || process.env.VISTA_LEGACY === 'true';
49
- const useRSC = !useLegacy;
50
- const explicitFlashpack = flags.includes('--flashpack');
51
- const explicitDefaultEngine = flags.includes('--default-engine') || flags.includes('--webpack');
52
- const explicitEngineFlag = getFlagValue('--engine');
53
- const explicitEngineVariant = normalizeEngineVariant(explicitEngineFlag);
54
-
55
- if (explicitEngineFlag && !explicitEngineVariant) {
56
- console.error(
57
- `Unsupported engine "${explicitEngineFlag}". Use "default" or "flashpack" (legacy alias: webpack).`
58
- );
59
- process.exit(1);
60
- }
61
-
62
- if (
63
- (explicitFlashpack && explicitDefaultEngine) ||
64
- (explicitEngineVariant && (explicitFlashpack || explicitDefaultEngine))
65
- ) {
66
- console.error('Use only one engine selector: --engine, --flashpack, or --default-engine/--webpack.');
67
- process.exit(1);
68
- }
69
-
70
- const envEngineVariant = normalizeEngineVariant(
71
- process.env.VISTA_ENGINE_VARIANT ||
72
- process.env.VISTA_ENGINE ||
73
- (process.env.VISTA_FLASHPACK === 'true' ? 'flashpack' : '')
74
- );
75
-
76
- let configEngineVariant = null;
77
- try {
78
- const { loadConfig } = require('../dist/config');
79
- const projectConfig = loadConfig(process.cwd());
80
- const fromConfig =
81
- typeof projectConfig?.engine === 'string'
82
- ? projectConfig.engine
83
- : projectConfig?.engine && typeof projectConfig.engine === 'object'
84
- ? projectConfig.engine.variant
85
- : '';
86
- configEngineVariant = normalizeEngineVariant(fromConfig);
87
- } catch {
88
- // Best effort only; keep CLI resilient if config loading fails.
89
- }
90
-
91
- const forcedByFlag = explicitEngineVariant || (explicitFlashpack ? 'flashpack' : null) || (explicitDefaultEngine ? 'default' : null);
92
- const engineVariant = forcedByFlag || envEngineVariant || configEngineVariant || 'default';
93
- process.env.VISTA_ENGINE = engineVariant;
94
- process.env.VISTA_ENGINE_VARIANT = engineVariant;
95
- process.env.VISTA_FLASHPACK = engineVariant === 'flashpack' ? 'true' : 'false';
48
+ if (command === 'deploy') {
49
+ const { runDeployCommand } = require('../dist/bin/deploy');
50
+ runDeployCommand(flags)
51
+ .then((code) => {
52
+ if (code !== 0) process.exit(code);
53
+ })
54
+ .catch((err) => {
55
+ console.error('Deploy failed:', err);
56
+ process.exit(1);
57
+ });
58
+ return;
59
+ }
60
+
61
+ const useLegacy = flags.includes('--legacy') || process.env.VISTA_LEGACY === 'true';
62
+ const useRSC = !useLegacy;
63
+ const explicitFlashpack = flags.includes('--flashpack');
64
+ const explicitDefaultEngine = flags.includes('--default-engine') || flags.includes('--webpack');
65
+ const explicitEngineFlag = getFlagValue('--engine');
66
+ const explicitEngineVariant = normalizeEngineVariant(explicitEngineFlag);
67
+
68
+ if (explicitEngineFlag && !explicitEngineVariant) {
69
+ console.error(
70
+ `Unsupported engine "${explicitEngineFlag}". Use "default" or "flashpack" (legacy alias: webpack).`
71
+ );
72
+ process.exit(1);
73
+ }
74
+
75
+ if (
76
+ (explicitFlashpack && explicitDefaultEngine) ||
77
+ (explicitEngineVariant && (explicitFlashpack || explicitDefaultEngine))
78
+ ) {
79
+ console.error('Use only one engine selector: --engine, --flashpack, or --default-engine/--webpack.');
80
+ process.exit(1);
81
+ }
82
+
83
+ const envEngineVariant = normalizeEngineVariant(
84
+ process.env.VISTA_ENGINE_VARIANT ||
85
+ process.env.VISTA_ENGINE ||
86
+ (process.env.VISTA_FLASHPACK === 'true' ? 'flashpack' : '')
87
+ );
88
+
89
+ let configEngineVariant = null;
90
+ try {
91
+ const { loadConfig } = require('../dist/config');
92
+ const projectConfig = loadConfig(process.cwd());
93
+ const fromConfig =
94
+ typeof projectConfig?.engine === 'string'
95
+ ? projectConfig.engine
96
+ : projectConfig?.engine && typeof projectConfig.engine === 'object'
97
+ ? projectConfig.engine.variant
98
+ : '';
99
+ configEngineVariant = normalizeEngineVariant(fromConfig);
100
+ } catch {
101
+ // Best effort only; keep CLI resilient if config loading fails.
102
+ }
103
+
104
+ const forcedByFlag = explicitEngineVariant || (explicitFlashpack ? 'flashpack' : null) || (explicitDefaultEngine ? 'default' : null);
105
+ const engineVariant = forcedByFlag || envEngineVariant || configEngineVariant || 'default';
106
+ process.env.VISTA_ENGINE = engineVariant;
107
+ process.env.VISTA_ENGINE_VARIANT = engineVariant;
108
+ process.env.VISTA_FLASHPACK = engineVariant === 'flashpack' ? 'true' : 'false';
96
109
 
97
110
  // Mark startup time for "Ready in Xms" display
98
111
  const { markStartTime } = require('../dist/server/logger');
99
112
  markStartTime();
100
113
 
101
- if (command === 'dev') {
102
- forceRuntimeEnv('development');
103
- if (useRSC) {
104
- console.log(`[vista] Engine: ${process.env.VISTA_ENGINE}`);
105
- const useFlashpack = process.env.VISTA_ENGINE === 'flashpack';
106
- if (useFlashpack) {
107
- const { runFlashpackEngineCommand } = require('../dist/flashpack/command');
108
- runFlashpackEngineCommand('dev', {
109
- cwd: process.cwd(),
110
- port: process.env.PORT || 3003,
111
- }).catch((err) => {
112
- console.error('Flashpack dev failed:', err);
113
- process.exit(1);
114
- });
115
- return;
116
- }
117
- const { buildRSC } = useFlashpack
118
- ? require('../dist/bin/build-rsc-flashpack')
119
- : require('../dist/bin/build-rsc');
120
- const { startRSCServer } = useFlashpack
121
- ? require('../dist/server/rsc-engine-flashpack')
122
- : require('../dist/server/rsc-engine');
123
-
124
- buildRSC(true)
125
- .then(({ clientCompiler }) => {
114
+ if (command === 'dev') {
115
+ forceRuntimeEnv('development');
116
+ if (useRSC) {
117
+ console.log(`[vista] Engine: ${process.env.VISTA_ENGINE}`);
118
+ const useFlashpack = process.env.VISTA_ENGINE === 'flashpack';
119
+ if (useFlashpack) {
120
+ const { runFlashpackEngineCommand } = require('../dist/flashpack/command');
121
+ runFlashpackEngineCommand('dev', {
122
+ cwd: process.cwd(),
123
+ port: process.env.PORT || 3003,
124
+ }).catch((err) => {
125
+ console.error('Flashpack dev failed:', err);
126
+ process.exit(1);
127
+ });
128
+ return;
129
+ }
130
+ const { buildRSC } = require('../dist/bin/build-rsc');
131
+ const { startRSCServer } = require('../dist/server/rsc-engine');
132
+
133
+ buildRSC(true)
134
+ .then(({ clientCompiler }) => {
126
135
  startRSCServer({
127
136
  port: process.env.PORT || 3003,
128
137
  compiler: clientCompiler,
@@ -146,31 +155,29 @@ if (command === 'dev') {
146
155
  process.exit(1);
147
156
  });
148
157
  }
149
- } else if (command === 'build') {
150
- forceRuntimeEnv('production');
151
- if (useRSC) {
152
- console.log(`[vista] Engine: ${process.env.VISTA_ENGINE}`);
153
- const useFlashpack = process.env.VISTA_ENGINE === 'flashpack';
154
- if (useFlashpack) {
155
- const { runFlashpackEngineCommand } = require('../dist/flashpack/command');
156
- runFlashpackEngineCommand('build', {
157
- cwd: process.cwd(),
158
- })
159
- .then(() => {
160
- console.log('');
161
- console.log('Production build complete!');
162
- })
163
- .catch((err) => {
164
- console.error('Flashpack build failed:', err);
165
- process.exit(1);
166
- });
167
- return;
168
- }
169
- const { buildRSC } = useFlashpack
170
- ? require('../dist/bin/build-rsc-flashpack')
171
- : require('../dist/bin/build-rsc');
172
-
173
- buildRSC(false)
158
+ } else if (command === 'build') {
159
+ forceRuntimeEnv('production');
160
+ if (useRSC) {
161
+ console.log(`[vista] Engine: ${process.env.VISTA_ENGINE}`);
162
+ const useFlashpack = process.env.VISTA_ENGINE === 'flashpack';
163
+ if (useFlashpack) {
164
+ const { runFlashpackEngineCommand } = require('../dist/flashpack/command');
165
+ runFlashpackEngineCommand('build', {
166
+ cwd: process.cwd(),
167
+ })
168
+ .then(() => {
169
+ console.log('');
170
+ console.log('Production build complete!');
171
+ })
172
+ .catch((err) => {
173
+ console.error('Flashpack build failed:', err);
174
+ process.exit(1);
175
+ });
176
+ return;
177
+ }
178
+ const { buildRSC } = require('../dist/bin/build-rsc');
179
+
180
+ buildRSC(false)
174
181
  .then(() => {
175
182
  console.log('');
176
183
  console.log('Production build complete!');
@@ -192,39 +199,36 @@ if (command === 'dev') {
192
199
  process.exit(1);
193
200
  });
194
201
  }
195
- } else if (command === 'start') {
196
- forceRuntimeEnv('production');
197
- if (useRSC) {
198
- console.log(`[vista] Engine: ${process.env.VISTA_ENGINE}`);
199
- if (process.env.VISTA_ENGINE === 'flashpack') {
200
- const { runFlashpackEngineCommand } = require('../dist/flashpack/command');
201
- runFlashpackEngineCommand('start', {
202
- cwd: process.cwd(),
203
- port: process.env.PORT || 3003,
204
- }).catch((err) => {
205
- console.error('Flashpack start failed:', err);
206
- process.exit(1);
207
- });
208
- return;
209
- }
210
- const standaloneServerPath = path.join(process.cwd(), '.vista', 'standalone', 'server.js');
211
- if (fs.existsSync(standaloneServerPath)) {
212
- const standalone = require(standaloneServerPath);
213
- const startStandaloneServer =
214
- standalone.startStandaloneServer || standalone.default || standalone;
215
- startStandaloneServer({
216
- port: process.env.PORT || 3003,
217
- engine: process.env.VISTA_ENGINE,
218
- });
219
- return;
220
- }
221
-
222
- const useFlashpack = process.env.VISTA_ENGINE === 'flashpack';
223
- const { startRSCServer } = useFlashpack
224
- ? require('../dist/server/rsc-engine-flashpack')
225
- : require('../dist/server/rsc-engine');
226
- startRSCServer({ port: process.env.PORT || 3003 });
227
- } else {
202
+ } else if (command === 'start') {
203
+ forceRuntimeEnv('production');
204
+ if (useRSC) {
205
+ console.log(`[vista] Engine: ${process.env.VISTA_ENGINE}`);
206
+ if (process.env.VISTA_ENGINE === 'flashpack') {
207
+ const { runFlashpackEngineCommand } = require('../dist/flashpack/command');
208
+ runFlashpackEngineCommand('start', {
209
+ cwd: process.cwd(),
210
+ port: process.env.PORT || 3003,
211
+ }).catch((err) => {
212
+ console.error('Flashpack start failed:', err);
213
+ process.exit(1);
214
+ });
215
+ return;
216
+ }
217
+ const standaloneServerPath = path.join(process.cwd(), '.vista', 'standalone', 'server.js');
218
+ if (fs.existsSync(standaloneServerPath)) {
219
+ const standalone = require(standaloneServerPath);
220
+ const startStandaloneServer =
221
+ standalone.startStandaloneServer || standalone.default || standalone;
222
+ startStandaloneServer({
223
+ port: process.env.PORT || 3003,
224
+ engine: process.env.VISTA_ENGINE,
225
+ });
226
+ return;
227
+ }
228
+
229
+ const { startRSCServer } = require('../dist/server/rsc-engine');
230
+ startRSCServer({ port: process.env.PORT || 3003 });
231
+ } else {
228
232
  const { startServer } = require('../dist/server/engine');
229
233
  startServer(process.env.PORT || 3003);
230
234
  }
@@ -238,20 +242,23 @@ if (command === 'dev') {
238
242
  console.log(' dev Start development server with HMR');
239
243
  console.log(' build Create production build');
240
244
  console.log(' start Start production server');
245
+ console.log(' deploy Build and deploy to a hosting platform');
241
246
  console.log(' g Generate typed API scaffolds (api-init, router, procedure)');
242
247
  console.log('');
243
- console.log('Options:');
244
- console.log(' --legacy Use traditional SSR mode (instead of RSC)');
245
- console.log(' --engine <default|flashpack> Select engine variant');
246
- console.log(' --flashpack Use Rust-first Flashpack engine path');
247
- console.log(' --default-engine Force default engine path');
248
- console.log(' --webpack Alias of --default-engine');
249
- console.log('');
250
- console.log('Examples:');
251
- console.log(' vista dev # Start dev server (RSC mode)');
252
- console.log(' vista dev --legacy # Start dev server with legacy SSR');
253
- console.log(' vista dev --flashpack # Start dev server with Flashpack mode');
254
- console.log(' vista build # Production build with RSC');
248
+ console.log('Options:');
249
+ console.log(' --legacy Use traditional SSR mode (instead of RSC)');
250
+ console.log(' --engine <default|flashpack> Select engine variant');
251
+ console.log(' --flashpack Use Rust-first Flashpack engine path');
252
+ console.log(' --default-engine Force default engine path');
253
+ console.log(' --webpack Alias of --default-engine');
254
+ console.log(' deploy --target <platform> Deploy to render, vercel, cloudflare, netlify, or docker');
255
+ console.log(' deploy --dry-run Validate and emit deploy artifacts only');
256
+ console.log('');
257
+ console.log('Examples:');
258
+ console.log(' vista dev # Start dev server (RSC mode)');
259
+ console.log(' vista dev --legacy # Start dev server with legacy SSR');
260
+ console.log(' vista dev --flashpack # Start dev server with Flashpack mode');
261
+ console.log(' vista build # Production build with RSC');
255
262
  console.log(' vista g api-init # Generate typed API starter files');
256
263
  console.log('');
257
264
  }
@@ -0,0 +1,37 @@
1
+ import { AgentStream } from './stream';
2
+ import type { AgentConfig, AgentExecutionResult, Message, ToolDefinition } from './types';
3
+ export interface AgentRunOptions {
4
+ prompt?: string;
5
+ messages?: Message[];
6
+ sessionId?: string;
7
+ abortSignal?: AbortSignal;
8
+ }
9
+ export declare class Agent {
10
+ readonly name: string;
11
+ private model;
12
+ private config;
13
+ private toolsMap;
14
+ private memory?;
15
+ constructor(config: AgentConfig);
16
+ private resolveSystemPrompt;
17
+ private normalizeInput;
18
+ /**
19
+ * Run the agent through a multi-step reasoning and tool-execution loop.
20
+ */
21
+ run(input: string | Message[] | AgentRunOptions): Promise<AgentExecutionResult>;
22
+ /**
23
+ * Stream the agent's response, yielding real-time text deltas and tool events.
24
+ */
25
+ stream(input: string | Message[] | AgentRunOptions): AgentStream;
26
+ /**
27
+ * Composes this agent as a callable Tool for another agent (multi-agent hierarchy).
28
+ */
29
+ asTool(options?: {
30
+ name?: string;
31
+ description?: string;
32
+ }): ToolDefinition;
33
+ }
34
+ /**
35
+ * Creates a Vista AI Agent instance.
36
+ */
37
+ export declare function agent(config: AgentConfig): Agent;