@vistagenic/vista 0.3.0 → 0.3.3
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 +79 -109
- package/dist/ai/embeddings.d.ts +11 -11
- package/dist/ai/embeddings.js +71 -71
- package/dist/ai/index.d.ts +10 -10
- package/dist/ai/index.js +26 -26
- package/dist/ai/providers/base.js +85 -85
- package/dist/ai/react/react-server.d.ts +1 -1
- package/dist/ai/react/react-server.js +17 -17
- package/dist/ai/react/use-agent.js +138 -138
- package/dist/auth/core.d.ts +140 -140
- package/dist/auth/core.js +165 -165
- package/dist/auth/index.d.ts +20 -20
- package/dist/auth/index.js +369 -369
- package/dist/auth/react-server.d.ts +1 -1
- package/dist/auth/react-server.js +10 -10
- package/dist/auth/react.d.ts +18 -18
- package/dist/auth/react.js +71 -71
- package/dist/bin/build-rsc-flashpack.js +6 -0
- package/dist/bin/build-rsc.js +537 -492
- package/dist/bin/build.js +355 -353
- package/dist/bin/dev-error-overlay-snippet.js +379 -153
- package/dist/bin/generate.js +513 -510
- package/dist/bin/webpack.config.js +4 -3
- package/dist/build/manifest.d.ts +169 -169
- package/dist/build/manifest.js +423 -423
- package/dist/build/rsc/client-manifest.d.ts +62 -62
- package/dist/build/rsc/client-manifest.js +295 -295
- package/dist/build/rsc/compiler.js +5 -4
- package/dist/build/rsc/native-scanner.d.ts +135 -135
- package/dist/build/rsc/native-scanner.js +203 -203
- package/dist/build/rsc/react-client-reference-manifest.d.ts +28 -28
- package/dist/build/rsc/react-client-reference-manifest.js +240 -240
- package/dist/build/standalone.js +260 -254
- package/dist/client/dynamic.react-server.d.ts +2 -2
- package/dist/client/dynamic.react-server.js +23 -23
- package/dist/client/link.react-server.d.ts +2 -2
- package/dist/client/link.react-server.js +11 -11
- package/dist/client/navigation.react-server.d.ts +1 -1
- package/dist/client/navigation.react-server.js +17 -17
- package/dist/client/router.react-server.d.ts +1 -1
- package/dist/client/router.react-server.js +17 -17
- package/dist/client/rsc-router.react-server.d.ts +1 -1
- package/dist/client/rsc-router.react-server.js +17 -17
- package/dist/client/script.react-server.d.ts +2 -2
- package/dist/client/script.react-server.js +23 -23
- package/dist/config.d.ts +1 -1
- package/dist/config.js +1 -7
- package/dist/deploy/adapters/cloudflare.js +43 -19
- package/dist/deploy/adapters/docker.d.ts +1 -0
- package/dist/deploy/adapters/docker.js +5 -4
- package/dist/deploy/adapters/netlify.js +62 -17
- package/dist/deploy/adapters/vercel.js +80 -50
- package/dist/deploy/preflight.js +4 -3
- package/dist/deploy/runtime-pack.d.ts +11 -0
- package/dist/deploy/runtime-pack.js +300 -0
- package/dist/deploy/utils.d.ts +1 -1
- package/dist/deploy/utils.js +31 -2
- package/dist/dev-error.d.ts +14 -0
- package/dist/dev-error.js +1394 -336
- package/dist/flashpack/command.js +1 -0
- package/dist/flashpack/runtime.js +2 -1
- package/dist/index.d.ts +23 -23
- package/dist/index.js +61 -61
- package/dist/server/app-dir.d.ts +22 -0
- package/dist/server/app-dir.js +77 -0
- package/dist/server/cookie-parse.d.ts +4 -4
- package/dist/server/cookie-parse.js +14 -14
- package/dist/server/engine.js +6 -12
- package/dist/server/image-optimizer.js +2 -1
- package/dist/server/index.d.ts +109 -109
- package/dist/server/index.js +315 -315
- package/dist/server/middleware-runner.d.ts +125 -125
- package/dist/server/middleware-runner.js +607 -615
- package/dist/server/middleware-security.d.ts +36 -36
- package/dist/server/middleware-security.js +183 -183
- package/dist/server/module-compile-hook.js +695 -695
- package/dist/server/root-resolver.js +6 -5
- package/dist/server/rsc-engine-flashpack.d.ts +3 -1
- package/dist/server/rsc-engine-flashpack.js +12 -1
- package/dist/server/rsc-engine.d.ts +6 -1
- package/dist/server/rsc-engine.js +203 -229
- package/dist/server/rsc-upstream.js +893 -892
- package/dist/server/static-generator.js +4 -3
- package/dist/server/structure-validator.js +2 -1
- package/dist/server/structure-watch.js +2 -0
- package/dist/server/typed-api-runtime.js +639 -635
- package/dist/server/vista-import-map.js +134 -134
- package/dist/stack/index.d.ts +34 -34
- package/dist/stack/index.js +49 -49
- package/dist/stack/server/caller.d.ts +13 -13
- package/dist/stack/server/caller.js +42 -42
- package/dist/stack/server/executor.d.ts +40 -40
- package/dist/stack/server/executor.js +222 -222
- package/dist/stack/server/index.d.ts +11 -11
- package/dist/stack/server/index.js +24 -24
- package/dist/stack/server/procedure.d.ts +20 -20
- package/dist/stack/server/procedure.js +66 -66
- package/dist/stack/server/types.d.ts +113 -113
- package/dist/theme/react-server.d.ts +10 -10
- package/dist/theme/react-server.js +16 -16
- package/package.json +178 -178
|
@@ -1 +1 @@
|
|
|
1
|
-
export { SessionProvider, useSession, signIn, signOut, AuthProvider, useAuth } from './react';
|
|
1
|
+
export { SessionProvider, useSession, signIn, signOut, AuthProvider, useAuth } from './react';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useAuth = exports.AuthProvider = exports.signOut = exports.signIn = exports.useSession = exports.SessionProvider = void 0;
|
|
4
|
-
var react_1 = require("./react");
|
|
5
|
-
Object.defineProperty(exports, "SessionProvider", { enumerable: true, get: function () { return react_1.SessionProvider; } });
|
|
6
|
-
Object.defineProperty(exports, "useSession", { enumerable: true, get: function () { return react_1.useSession; } });
|
|
7
|
-
Object.defineProperty(exports, "signIn", { enumerable: true, get: function () { return react_1.signIn; } });
|
|
8
|
-
Object.defineProperty(exports, "signOut", { enumerable: true, get: function () { return react_1.signOut; } });
|
|
9
|
-
Object.defineProperty(exports, "AuthProvider", { enumerable: true, get: function () { return react_1.AuthProvider; } });
|
|
10
|
-
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return react_1.useAuth; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAuth = exports.AuthProvider = exports.signOut = exports.signIn = exports.useSession = exports.SessionProvider = void 0;
|
|
4
|
+
var react_1 = require("./react");
|
|
5
|
+
Object.defineProperty(exports, "SessionProvider", { enumerable: true, get: function () { return react_1.SessionProvider; } });
|
|
6
|
+
Object.defineProperty(exports, "useSession", { enumerable: true, get: function () { return react_1.useSession; } });
|
|
7
|
+
Object.defineProperty(exports, "signIn", { enumerable: true, get: function () { return react_1.signIn; } });
|
|
8
|
+
Object.defineProperty(exports, "signOut", { enumerable: true, get: function () { return react_1.signOut; } });
|
|
9
|
+
Object.defineProperty(exports, "AuthProvider", { enumerable: true, get: function () { return react_1.AuthProvider; } });
|
|
10
|
+
Object.defineProperty(exports, "useAuth", { enumerable: true, get: function () { return react_1.useAuth; } });
|
package/dist/auth/react.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { AuthSession } from './core';
|
|
3
|
-
interface SessionContextValue {
|
|
4
|
-
data: AuthSession | null;
|
|
5
|
-
status: 'loading' | 'authenticated' | 'unauthenticated';
|
|
6
|
-
update: () => Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
export declare function SessionProvider({ children, basePath, }: {
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
basePath?: string;
|
|
11
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export declare function useSession(): SessionContextValue;
|
|
13
|
-
export declare function signIn(provider?: string, options?: Record<string, string>, basePath?: string): Promise<void>;
|
|
14
|
-
export declare function signOut(basePath?: string): void;
|
|
15
|
-
/** Back-compat aliases for the old demo AuthProvider. */
|
|
16
|
-
export declare const AuthProvider: typeof SessionProvider;
|
|
17
|
-
export declare const useAuth: typeof useSession;
|
|
18
|
-
export {};
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { AuthSession } from './core';
|
|
3
|
+
interface SessionContextValue {
|
|
4
|
+
data: AuthSession | null;
|
|
5
|
+
status: 'loading' | 'authenticated' | 'unauthenticated';
|
|
6
|
+
update: () => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare function SessionProvider({ children, basePath, }: {
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
basePath?: string;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function useSession(): SessionContextValue;
|
|
13
|
+
export declare function signIn(provider?: string, options?: Record<string, string>, basePath?: string): Promise<void>;
|
|
14
|
+
export declare function signOut(basePath?: string): void;
|
|
15
|
+
/** Back-compat aliases for the old demo AuthProvider. */
|
|
16
|
+
export declare const AuthProvider: typeof SessionProvider;
|
|
17
|
+
export declare const useAuth: typeof useSession;
|
|
18
|
+
export {};
|
package/dist/auth/react.js
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.useAuth = exports.AuthProvider = void 0;
|
|
5
|
-
exports.SessionProvider = SessionProvider;
|
|
6
|
-
exports.useSession = useSession;
|
|
7
|
-
exports.signIn = signIn;
|
|
8
|
-
exports.signOut = signOut;
|
|
9
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
|
-
const react_1 = require("react");
|
|
11
|
-
const SessionContext = (0, react_1.createContext)(null);
|
|
12
|
-
function SessionProvider({ children, basePath = '/api/auth', }) {
|
|
13
|
-
const [data, setData] = (0, react_1.useState)(null);
|
|
14
|
-
const [status, setStatus] = (0, react_1.useState)('loading');
|
|
15
|
-
const update = async () => {
|
|
16
|
-
const response = await fetch(`${basePath}/session`);
|
|
17
|
-
const json = await response.json();
|
|
18
|
-
if (json?.user) {
|
|
19
|
-
setData({ user: json.user, expires: json.expires || '' });
|
|
20
|
-
setStatus('authenticated');
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
setData(null);
|
|
24
|
-
setStatus('unauthenticated');
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
(0, react_1.useEffect)(() => {
|
|
28
|
-
void update();
|
|
29
|
-
}, [basePath]);
|
|
30
|
-
return (0, jsx_runtime_1.jsx)(SessionContext.Provider, { value: { data, status, update }, children: children });
|
|
31
|
-
}
|
|
32
|
-
function useSession() {
|
|
33
|
-
const context = (0, react_1.useContext)(SessionContext);
|
|
34
|
-
if (!context) {
|
|
35
|
-
throw new Error('useSession must be used within a SessionProvider');
|
|
36
|
-
}
|
|
37
|
-
return context;
|
|
38
|
-
}
|
|
39
|
-
async function signIn(provider, options = {}, basePath = '/api/auth') {
|
|
40
|
-
if (provider === 'credentials') {
|
|
41
|
-
const csrfResponse = await fetch(`${basePath}/csrf`, { credentials: 'same-origin' });
|
|
42
|
-
const csrfJson = (await csrfResponse.json());
|
|
43
|
-
const form = document.createElement('form');
|
|
44
|
-
form.method = 'POST';
|
|
45
|
-
form.action = `${basePath}/signin/credentials`;
|
|
46
|
-
form.style.display = 'none';
|
|
47
|
-
const fields = {
|
|
48
|
-
...options,
|
|
49
|
-
csrfToken: csrfJson.csrfToken || '',
|
|
50
|
-
};
|
|
51
|
-
for (const [name, value] of Object.entries(fields)) {
|
|
52
|
-
const input = document.createElement('input');
|
|
53
|
-
input.type = 'hidden';
|
|
54
|
-
input.name = name;
|
|
55
|
-
input.value = value;
|
|
56
|
-
form.appendChild(input);
|
|
57
|
-
}
|
|
58
|
-
document.body.appendChild(form);
|
|
59
|
-
form.submit();
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const params = new URLSearchParams(options);
|
|
63
|
-
const target = provider ? `${basePath}/signin/${provider}?${params}` : `${basePath}/signin?${params}`;
|
|
64
|
-
window.location.assign(target);
|
|
65
|
-
}
|
|
66
|
-
function signOut(basePath = '/api/auth') {
|
|
67
|
-
window.location.assign(`${basePath}/signout`);
|
|
68
|
-
}
|
|
69
|
-
/** Back-compat aliases for the old demo AuthProvider. */
|
|
70
|
-
exports.AuthProvider = SessionProvider;
|
|
71
|
-
exports.useAuth = useSession;
|
|
1
|
+
'use client';
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useAuth = exports.AuthProvider = void 0;
|
|
5
|
+
exports.SessionProvider = SessionProvider;
|
|
6
|
+
exports.useSession = useSession;
|
|
7
|
+
exports.signIn = signIn;
|
|
8
|
+
exports.signOut = signOut;
|
|
9
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const SessionContext = (0, react_1.createContext)(null);
|
|
12
|
+
function SessionProvider({ children, basePath = '/api/auth', }) {
|
|
13
|
+
const [data, setData] = (0, react_1.useState)(null);
|
|
14
|
+
const [status, setStatus] = (0, react_1.useState)('loading');
|
|
15
|
+
const update = async () => {
|
|
16
|
+
const response = await fetch(`${basePath}/session`);
|
|
17
|
+
const json = await response.json();
|
|
18
|
+
if (json?.user) {
|
|
19
|
+
setData({ user: json.user, expires: json.expires || '' });
|
|
20
|
+
setStatus('authenticated');
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
setData(null);
|
|
24
|
+
setStatus('unauthenticated');
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
28
|
+
void update();
|
|
29
|
+
}, [basePath]);
|
|
30
|
+
return (0, jsx_runtime_1.jsx)(SessionContext.Provider, { value: { data, status, update }, children: children });
|
|
31
|
+
}
|
|
32
|
+
function useSession() {
|
|
33
|
+
const context = (0, react_1.useContext)(SessionContext);
|
|
34
|
+
if (!context) {
|
|
35
|
+
throw new Error('useSession must be used within a SessionProvider');
|
|
36
|
+
}
|
|
37
|
+
return context;
|
|
38
|
+
}
|
|
39
|
+
async function signIn(provider, options = {}, basePath = '/api/auth') {
|
|
40
|
+
if (provider === 'credentials') {
|
|
41
|
+
const csrfResponse = await fetch(`${basePath}/csrf`, { credentials: 'same-origin' });
|
|
42
|
+
const csrfJson = (await csrfResponse.json());
|
|
43
|
+
const form = document.createElement('form');
|
|
44
|
+
form.method = 'POST';
|
|
45
|
+
form.action = `${basePath}/signin/credentials`;
|
|
46
|
+
form.style.display = 'none';
|
|
47
|
+
const fields = {
|
|
48
|
+
...options,
|
|
49
|
+
csrfToken: csrfJson.csrfToken || '',
|
|
50
|
+
};
|
|
51
|
+
for (const [name, value] of Object.entries(fields)) {
|
|
52
|
+
const input = document.createElement('input');
|
|
53
|
+
input.type = 'hidden';
|
|
54
|
+
input.name = name;
|
|
55
|
+
input.value = value;
|
|
56
|
+
form.appendChild(input);
|
|
57
|
+
}
|
|
58
|
+
document.body.appendChild(form);
|
|
59
|
+
form.submit();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const params = new URLSearchParams(options);
|
|
63
|
+
const target = provider ? `${basePath}/signin/${provider}?${params}` : `${basePath}/signin?${params}`;
|
|
64
|
+
window.location.assign(target);
|
|
65
|
+
}
|
|
66
|
+
function signOut(basePath = '/api/auth') {
|
|
67
|
+
window.location.assign(`${basePath}/signout`);
|
|
68
|
+
}
|
|
69
|
+
/** Back-compat aliases for the old demo AuthProvider. */
|
|
70
|
+
exports.AuthProvider = SessionProvider;
|
|
71
|
+
exports.useAuth = useSession;
|
|
@@ -20,6 +20,12 @@ async function buildRSCFlashpack(watch = false) {
|
|
|
20
20
|
mode,
|
|
21
21
|
allowFallback: !strict,
|
|
22
22
|
});
|
|
23
|
+
if (!prepared.rustPipelineUsed) {
|
|
24
|
+
if (strict) {
|
|
25
|
+
throw new Error('[flashpack] Rust pipeline did not run during build. Refusing silent non-Rust Flight prep (set VISTA_FLASHPACK_STRICT=false for explicit fallback).');
|
|
26
|
+
}
|
|
27
|
+
console.warn('[flashpack] WARNING: Rust pipeline skipped during build — webpack will still emit Flight/SSR manifests (explicit fallback, not renderToString).');
|
|
28
|
+
}
|
|
23
29
|
if (process.env.VISTA_DEBUG) {
|
|
24
30
|
console.log(`[flashpack] runtime prepared (rust=${prepared.rustPipelineUsed ? 'on' : 'fallback'}) at ${prepared.flashDir}`);
|
|
25
31
|
}
|