@vistagenic/vista 0.2.16 → 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.
- package/bin/vista.js +184 -177
- package/dist/ai/agent.d.ts +37 -0
- package/dist/ai/agent.js +385 -0
- package/dist/ai/embeddings.d.ts +11 -0
- package/dist/ai/embeddings.js +71 -0
- package/dist/ai/index.d.ts +10 -0
- package/dist/ai/index.js +26 -0
- package/dist/ai/memory.d.ts +16 -0
- package/dist/ai/memory.js +39 -0
- package/dist/ai/observability.d.ts +21 -0
- package/dist/ai/observability.js +69 -0
- package/dist/ai/providers/anthropic.d.ts +2 -0
- package/dist/ai/providers/anthropic.js +190 -0
- package/dist/ai/providers/base.d.ts +7 -0
- package/dist/ai/providers/base.js +85 -0
- package/dist/ai/providers/gemini.d.ts +2 -0
- package/dist/ai/providers/gemini.js +194 -0
- package/dist/ai/providers/index.d.ts +5 -0
- package/dist/ai/providers/index.js +21 -0
- package/dist/ai/providers/mock.d.ts +8 -0
- package/dist/ai/providers/mock.js +77 -0
- package/dist/ai/providers/openai.d.ts +2 -0
- package/dist/ai/providers/openai.js +211 -0
- package/dist/ai/rag.d.ts +35 -0
- package/dist/ai/rag.js +110 -0
- package/dist/ai/react/index.d.ts +1 -0
- package/dist/ai/react/index.js +17 -0
- package/dist/ai/react/react-server.d.ts +1 -0
- package/dist/ai/react/react-server.js +17 -0
- package/dist/ai/react/use-agent.d.ts +23 -0
- package/dist/ai/react/use-agent.js +138 -0
- package/dist/ai/stream.d.ts +24 -0
- package/dist/ai/stream.js +109 -0
- package/dist/ai/tool.d.ts +11 -0
- package/dist/ai/tool.js +47 -0
- package/dist/ai/types.d.ts +117 -0
- package/dist/ai/types.js +5 -0
- package/dist/auth/core.d.ts +140 -0
- package/dist/auth/core.js +165 -0
- package/dist/auth/index.d.ts +20 -8
- package/dist/auth/index.js +369 -16
- package/dist/auth/react-server.d.ts +1 -0
- package/dist/auth/react-server.js +10 -0
- package/dist/auth/react.d.ts +18 -0
- package/dist/auth/react.js +71 -0
- package/dist/bin/build-rsc.js +602 -604
- package/dist/bin/build.js +389 -388
- package/dist/bin/deploy-output.d.ts +2 -7
- package/dist/bin/deploy-output.js +3 -76
- package/dist/bin/deploy.d.ts +7 -0
- package/dist/bin/deploy.js +102 -0
- package/dist/bin/dev-error-overlay-snippet.js +552 -552
- package/dist/bin/devtools-indicator-snippet.js +387 -387
- package/dist/bin/generate.js +510 -248
- package/dist/build/manifest.d.ts +169 -139
- package/dist/build/manifest.js +423 -367
- package/dist/build/rsc/client-manifest.d.ts +62 -52
- package/dist/build/rsc/client-manifest.js +295 -193
- package/dist/build/rsc/client-reference-plugin.d.ts +37 -37
- package/dist/build/rsc/client-reference-plugin.js +160 -160
- package/dist/build/rsc/native-scanner.d.ts +135 -123
- package/dist/build/rsc/native-scanner.js +203 -170
- package/dist/build/rsc/react-client-reference-manifest.d.ts +28 -22
- package/dist/build/rsc/react-client-reference-manifest.js +240 -219
- package/dist/build/rsc/rsc-renderer.d.ts +99 -99
- package/dist/build/rsc/rsc-renderer.js +263 -263
- package/dist/build/rsc/server-component-loader.d.ts +19 -19
- package/dist/build/rsc/server-component-loader.js +91 -91
- package/dist/build/rsc/server-manifest.d.ts +17 -0
- package/dist/build/rsc/server-manifest.js +20 -0
- package/dist/build/standalone.js +337 -334
- package/dist/build/webpack/plugins/vista-flight-plugin.js +5 -5
- package/dist/client/dynamic.react-server.d.ts +2 -0
- package/dist/client/dynamic.react-server.js +23 -0
- package/dist/client/link.react-server.d.ts +2 -0
- package/dist/client/link.react-server.js +11 -0
- package/dist/client/navigation.react-server.d.ts +1 -0
- package/dist/client/navigation.react-server.js +17 -0
- package/dist/client/router.react-server.d.ts +1 -0
- package/dist/client/router.react-server.js +17 -0
- package/dist/client/rsc-router.react-server.d.ts +1 -0
- package/dist/client/rsc-router.react-server.js +17 -0
- package/dist/client/script.react-server.d.ts +2 -0
- package/dist/client/script.react-server.js +23 -0
- package/dist/components/client-island.d.ts +34 -34
- package/dist/components/client-island.js +75 -75
- package/dist/config.d.ts +17 -0
- package/dist/config.js +60 -1
- package/dist/deploy/adapters/cloudflare.d.ts +2 -0
- package/dist/deploy/adapters/cloudflare.js +124 -0
- package/dist/deploy/adapters/docker.d.ts +2 -0
- package/dist/deploy/adapters/docker.js +112 -0
- package/dist/deploy/adapters/index.d.ts +15 -0
- package/dist/deploy/adapters/index.js +24 -0
- package/dist/deploy/adapters/netlify.d.ts +2 -0
- package/dist/deploy/adapters/netlify.js +115 -0
- package/dist/deploy/adapters/render.d.ts +2 -0
- package/dist/deploy/adapters/render.js +95 -0
- package/dist/deploy/adapters/vercel.d.ts +7 -0
- package/dist/deploy/adapters/vercel.js +164 -0
- package/dist/deploy/cli-runner.d.ts +8 -0
- package/dist/deploy/cli-runner.js +58 -0
- package/dist/deploy/detect.d.ts +6 -0
- package/dist/deploy/detect.js +77 -0
- package/dist/deploy/index.d.ts +24 -0
- package/dist/deploy/index.js +112 -0
- package/dist/deploy/preflight.d.ts +8 -0
- package/dist/deploy/preflight.js +80 -0
- package/dist/deploy/types.d.ts +48 -0
- package/dist/deploy/types.js +2 -0
- package/dist/deploy/utils.d.ts +18 -0
- package/dist/deploy/utils.js +70 -0
- package/dist/dev-error.js +667 -667
- package/dist/index.d.ts +23 -21
- package/dist/index.js +61 -57
- package/dist/server/cookie-parse.d.ts +4 -0
- package/dist/server/cookie-parse.js +14 -0
- package/dist/server/engine.js +6 -19
- package/dist/server/index.d.ts +109 -102
- package/dist/server/index.js +315 -286
- package/dist/server/middleware-runner.d.ts +125 -57
- package/dist/server/middleware-runner.js +615 -218
- package/dist/server/middleware-security.d.ts +36 -0
- package/dist/server/middleware-security.js +183 -0
- package/dist/server/module-compile-hook.js +695 -662
- package/dist/server/route-handler-registry.d.ts +65 -0
- package/dist/server/route-handler-registry.js +195 -0
- package/dist/server/route-patterns.d.ts +67 -0
- package/dist/server/route-patterns.js +186 -0
- package/dist/server/rsc-engine.js +73 -80
- package/dist/server/rsc-module-system.d.ts +33 -33
- package/dist/server/rsc-module-system.js +87 -87
- package/dist/server/rsc-upstream.js +892 -888
- package/dist/server/static-generator.js +10 -10
- package/dist/server/typed-api-runtime.d.ts +18 -0
- package/dist/server/typed-api-runtime.js +635 -507
- package/dist/server/vista-import-map.js +134 -123
- package/dist/stack/index.d.ts +34 -32
- package/dist/stack/index.js +49 -45
- package/dist/stack/server/caller.d.ts +13 -0
- package/dist/stack/server/caller.js +42 -0
- package/dist/stack/server/executor.d.ts +40 -36
- package/dist/stack/server/executor.js +222 -174
- package/dist/stack/server/index.d.ts +11 -10
- package/dist/stack/server/index.js +24 -23
- package/dist/stack/server/procedure.d.ts +20 -18
- package/dist/stack/server/procedure.js +66 -58
- package/dist/stack/server/types.d.ts +113 -100
- package/dist/theme/react-server.d.ts +10 -0
- package/dist/theme/react-server.js +16 -0
- package/package.json +178 -153
- 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
|
-
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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 } =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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 } =
|
|
170
|
-
|
|
171
|
-
|
|
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
|
|
223
|
-
|
|
224
|
-
|
|
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('
|
|
251
|
-
console.log('
|
|
252
|
-
console.log('
|
|
253
|
-
console.log(' vista dev
|
|
254
|
-
console.log(' vista
|
|
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;
|