veryfront 0.1.868 → 0.1.870
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/esm/cli/commands/demo/steps.js +1 -1
- package/esm/cli/commands/dev/command.d.ts.map +1 -1
- package/esm/cli/commands/dev/command.js +6 -1
- package/esm/cli/commands/start/command.d.ts +12 -0
- package/esm/cli/commands/start/command.d.ts.map +1 -1
- package/esm/cli/commands/start/command.js +32 -6
- package/esm/cli/shared/runtime-auth.d.ts +12 -0
- package/esm/cli/shared/runtime-auth.d.ts.map +1 -0
- package/esm/cli/shared/runtime-auth.js +34 -0
- package/esm/deno.js +1 -1
- package/esm/src/agent/ag-ui/handler.d.ts.map +1 -1
- package/esm/src/agent/ag-ui/handler.js +17 -5
- package/esm/src/agent/composition/composition.d.ts.map +1 -1
- package/esm/src/agent/composition/composition.js +41 -6
- package/esm/src/agent/react/index.d.ts +1 -1
- package/esm/src/agent/react/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts +1 -1
- package/esm/src/agent/react/use-chat/index.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/types.d.ts +2 -10
- package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.d.ts +3 -4
- package/esm/src/agent/react/use-chat/use-chat.d.ts.map +1 -1
- package/esm/src/agent/react/use-chat/use-chat.js +16 -107
- package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
- package/esm/src/agent/runtime/chat-stream-handler.js +20 -3
- package/esm/src/agent/runtime/index.d.ts.map +1 -1
- package/esm/src/agent/runtime/index.js +15 -17
- package/esm/src/agent/runtime/model-resolution.d.ts +2 -2
- package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
- package/esm/src/agent/runtime/model-resolution.js +59 -13
- package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-result-continuation.js +17 -0
- package/esm/src/agent/types.d.ts +2 -2
- package/esm/src/chat/index.d.ts +2 -2
- package/esm/src/chat/index.d.ts.map +1 -1
- package/esm/src/chat/index.js +1 -1
- package/esm/src/embedding/upload-handler.d.ts +2 -1
- package/esm/src/embedding/upload-handler.d.ts.map +1 -1
- package/esm/src/embedding/upload-handler.js +2 -1
- package/esm/src/html/styles-builder/plugin-loader.d.ts.map +1 -1
- package/esm/src/html/styles-builder/plugin-loader.js +2 -12
- package/esm/src/integrations/feature-flags.d.ts.map +1 -1
- package/esm/src/integrations/feature-flags.js +2 -10
- package/esm/src/platform/compat/dns.d.ts +6 -0
- package/esm/src/platform/compat/dns.d.ts.map +1 -0
- package/esm/src/platform/compat/dns.js +34 -0
- package/esm/src/platform/compat/opaque-dependency-versions.d.ts +1 -1
- package/esm/src/platform/compat/opaque-dependency-versions.js +1 -1
- package/esm/src/platform/index.d.ts +1 -0
- package/esm/src/platform/index.d.ts.map +1 -1
- package/esm/src/platform/index.js +2 -0
- package/esm/src/provider/index.d.ts +1 -1
- package/esm/src/provider/index.d.ts.map +1 -1
- package/esm/src/provider/index.js +1 -1
- package/esm/src/provider/local/env.d.ts +3 -0
- package/esm/src/provider/local/env.d.ts.map +1 -1
- package/esm/src/provider/local/env.js +31 -0
- package/esm/src/provider/local/local-engine.d.ts +38 -5
- package/esm/src/provider/local/local-engine.d.ts.map +1 -1
- package/esm/src/provider/local/local-engine.js +191 -19
- package/esm/src/provider/local/model-catalog.d.ts +8 -4
- package/esm/src/provider/local/model-catalog.d.ts.map +1 -1
- package/esm/src/provider/local/model-catalog.js +36 -41
- package/esm/src/provider/local/model-runtime-adapter.js +5 -5
- package/esm/src/provider/model-registry.d.ts +2 -12
- package/esm/src/provider/model-registry.d.ts.map +1 -1
- package/esm/src/provider/model-registry.js +4 -92
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts +2 -3
- package/esm/src/react/components/chat/chat/components/inference-badge.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/components/inference-badge.js +3 -31
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts +1 -2
- package/esm/src/react/components/chat/chat/composition/chat-message-list.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/composition/chat-message-list.js +5 -11
- package/esm/src/react/components/chat/chat/index.d.ts +2 -4
- package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat/index.js +4 -6
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts +0 -1
- package/esm/src/react/components/chat/chat-with-sidebar.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat-with-sidebar.js +0 -1
- package/esm/src/react/components/chat/chat.d.ts +1 -1
- package/esm/src/react/components/chat/chat.d.ts.map +1 -1
- package/esm/src/react/components/chat/chat.js +1 -1
- package/esm/src/security/sandbox/worker-egress-guard.d.ts +1 -1
- package/esm/src/security/sandbox/worker-egress-guard.d.ts.map +1 -1
- package/esm/src/security/sandbox/worker-egress-guard.js +4 -17
- package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
- package/esm/src/server/handlers/dev/framework-candidates.generated.js +3 -54
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/esm/src/workflow/worker/dynamic-run-entrypoint.d.ts +3 -2
- package/esm/src/workflow/worker/dynamic-run-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/run-entrypoint.d.ts +6 -4
- package/esm/src/workflow/worker/run-entrypoint.d.ts.map +1 -1
- package/esm/src/workflow/worker/run-entrypoint.js +3 -2
- package/package.json +2 -2
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts +0 -18
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/browser-engine.js +0 -62
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts +0 -44
- package/esm/src/agent/react/use-chat/browser-inference/types.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/types.js +0 -4
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts +0 -30
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/worker-client.js +0 -66
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts +0 -8
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.d.ts.map +0 -1
- package/esm/src/agent/react/use-chat/browser-inference/worker-script.js +0 -97
- package/esm/src/react/components/chat/chat/components/upgrade-cta.d.ts +0 -9
- package/esm/src/react/components/chat/chat/components/upgrade-cta.d.ts.map +0 -1
- package/esm/src/react/components/chat/chat/components/upgrade-cta.js +0 -35
|
@@ -3,7 +3,7 @@ export const DEMO_STEPS = [
|
|
|
3
3
|
id: "intro",
|
|
4
4
|
title: "Welcome to Veryfront",
|
|
5
5
|
description: [
|
|
6
|
-
"Veryfront is a
|
|
6
|
+
"Veryfront is a React framework with AI-native capabilities.",
|
|
7
7
|
"This demo will walk you through creating, running, and deploying your first app.",
|
|
8
8
|
],
|
|
9
9
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/dev/command.ts"],"names":[],"mappings":"AA4BA,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACrB,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,2DAA2D;IAC3D,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAwSzE"}
|
|
@@ -13,6 +13,7 @@ import { validateProviderConfig } from "../../../src/discovery/index.js";
|
|
|
13
13
|
import { yellow } from "../../ui/index.js";
|
|
14
14
|
import { exitProcess, registerTerminationSignals } from "../../utils/index.js";
|
|
15
15
|
import { banner, brand, dim, error as errorColor, success } from "../../ui/index.js";
|
|
16
|
+
import { applyRuntimeAuthContext } from "../../shared/runtime-auth.js";
|
|
16
17
|
import { createKeyboardHandler } from "../../ui/keyboard.js";
|
|
17
18
|
import { openBrowser } from "../../auth/browser.js";
|
|
18
19
|
import { createMCPServer } from "../../mcp/server.js";
|
|
@@ -48,7 +49,11 @@ export function devCommand(options) {
|
|
|
48
49
|
const enableHMR = config?.dev?.hmr !== false && hmr;
|
|
49
50
|
const env = getEnvironmentConfig();
|
|
50
51
|
const isProxyMode = config?.fs?.veryfront?.proxyMode === true;
|
|
51
|
-
const
|
|
52
|
+
const runtimeAuth = await applyRuntimeAuthContext({
|
|
53
|
+
projectDir,
|
|
54
|
+
projectSlug: config?.fs?.veryfront?.projectSlug ?? env.projectSlug,
|
|
55
|
+
});
|
|
56
|
+
const projectSlug = runtimeAuth.projectSlug;
|
|
52
57
|
// Validate provider config and print warnings (framework returns plain text, CLI adds colors)
|
|
53
58
|
const aiValidation = validateProviderConfig(config);
|
|
54
59
|
if (aiValidation.warnings.length > 0) {
|
|
@@ -3,5 +3,17 @@ export interface StartOptions {
|
|
|
3
3
|
projectPath: string | null;
|
|
4
4
|
headless: boolean;
|
|
5
5
|
}
|
|
6
|
+
interface DiscoveredProjects {
|
|
7
|
+
projects: Map<string, string>;
|
|
8
|
+
examples: Map<string, string>;
|
|
9
|
+
defaultProject: string | null;
|
|
10
|
+
}
|
|
11
|
+
export interface StartProjectSelection {
|
|
12
|
+
projectDir: string;
|
|
13
|
+
projectSlug: string | undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare function shouldSkipProjectDirectory(name: string): boolean;
|
|
16
|
+
export declare function selectStartProject(discovered: DiscoveredProjects, fallbackDir: string): StartProjectSelection;
|
|
6
17
|
export declare function startCommand(options: StartOptions): Promise<void>;
|
|
18
|
+
export {};
|
|
7
19
|
//# sourceMappingURL=command.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/start/command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/start/command.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAOD,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;CACjC;AAMD,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEhE;AAoED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,kBAAkB,EAC9B,WAAW,EAAE,MAAM,GAClB,qBAAqB,CAgBvB;AAiCD,wBAAsB,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAkIvE"}
|
|
@@ -6,10 +6,14 @@ import { exitProcess, registerTerminationSignals } from "../../utils/index.js";
|
|
|
6
6
|
import { generateDefaultProjectId } from "../../utils/project.js";
|
|
7
7
|
import { clearAllLocalCaches } from "../../../src/transforms/mdx/esm-module-loader/cache/index.js";
|
|
8
8
|
import { startCliDevServer, startCliProxyModeServer } from "../../shared/server-startup.js";
|
|
9
|
+
import { applyRuntimeAuthContext } from "../../shared/runtime-auth.js";
|
|
9
10
|
const logger = cliLogger.component("global");
|
|
10
11
|
function getProjectSlug(path) {
|
|
11
12
|
return path.replace(/\/+$/, "").split("/").pop() ?? "";
|
|
12
13
|
}
|
|
14
|
+
export function shouldSkipProjectDirectory(name) {
|
|
15
|
+
return name.startsWith(".") || name.startsWith("_");
|
|
16
|
+
}
|
|
13
17
|
async function isVeryFrontProject(projectPath) {
|
|
14
18
|
const fs = createFileSystem();
|
|
15
19
|
const markers = ["app", "pages", "components"];
|
|
@@ -25,7 +29,7 @@ async function findProjectsInDirs(baseDirs) {
|
|
|
25
29
|
continue;
|
|
26
30
|
try {
|
|
27
31
|
for await (const entry of fs.readDir(absoluteBase)) {
|
|
28
|
-
if (!entry.isDirectory || entry.name
|
|
32
|
+
if (!entry.isDirectory || shouldSkipProjectDirectory(entry.name))
|
|
29
33
|
continue;
|
|
30
34
|
const projectPath = join(absoluteBase, entry.name);
|
|
31
35
|
if (!(await isVeryFrontProject(projectPath)))
|
|
@@ -64,6 +68,24 @@ async function discoverProjects(explicitPath) {
|
|
|
64
68
|
}
|
|
65
69
|
return { projects, examples, defaultProject };
|
|
66
70
|
}
|
|
71
|
+
function firstBySlug(map) {
|
|
72
|
+
return [...map.entries()].sort(([a], [b]) => a.localeCompare(b))[0];
|
|
73
|
+
}
|
|
74
|
+
export function selectStartProject(discovered, fallbackDir) {
|
|
75
|
+
if (discovered.defaultProject) {
|
|
76
|
+
const projectDir = discovered.projects.get(discovered.defaultProject) ??
|
|
77
|
+
discovered.examples.get(discovered.defaultProject);
|
|
78
|
+
if (projectDir) {
|
|
79
|
+
return { projectDir, projectSlug: discovered.defaultProject };
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const fallbackProject = firstBySlug(discovered.projects) ?? firstBySlug(discovered.examples);
|
|
83
|
+
if (fallbackProject) {
|
|
84
|
+
const [projectSlug, projectDir] = fallbackProject;
|
|
85
|
+
return { projectDir, projectSlug };
|
|
86
|
+
}
|
|
87
|
+
return { projectDir: fallbackDir, projectSlug: undefined };
|
|
88
|
+
}
|
|
67
89
|
async function trySetupProxy(localProjects) {
|
|
68
90
|
try {
|
|
69
91
|
// Proxy is only available in local dev, not in the npm package
|
|
@@ -139,14 +161,18 @@ export async function startCommand(options) {
|
|
|
139
161
|
if (!headless) {
|
|
140
162
|
await showStartup(["Loading configuration", "Discovering projects", "Starting server"]);
|
|
141
163
|
}
|
|
164
|
+
let server;
|
|
165
|
+
const selectedProject = selectStartProject(discovered, cwd());
|
|
166
|
+
const projectDir = selectedProject.projectDir;
|
|
167
|
+
const runtimeAuth = await applyRuntimeAuthContext({
|
|
168
|
+
projectDir,
|
|
169
|
+
projectSlug: selectedProject.projectSlug,
|
|
170
|
+
});
|
|
171
|
+
const fallbackProjectSlug = runtimeAuth.projectSlug;
|
|
142
172
|
const allProjects = new Map([...discovered.projects, ...discovered.examples]);
|
|
143
173
|
const proxy = await trySetupProxy(allProjects);
|
|
144
174
|
const shutdownController = new AbortController();
|
|
145
175
|
const useProxy = typeof proxy.interceptor === "function";
|
|
146
|
-
let server;
|
|
147
|
-
const projectDir = discovered.defaultProject
|
|
148
|
-
? discovered.projects.get(discovered.defaultProject) ?? cwd()
|
|
149
|
-
: cwd();
|
|
150
176
|
if (useProxy) {
|
|
151
177
|
const defaultProjectId = generateDefaultProjectId(cwd());
|
|
152
178
|
const requestInterceptor = proxy.interceptor;
|
|
@@ -160,7 +186,7 @@ export async function startCommand(options) {
|
|
|
160
186
|
requestInterceptor,
|
|
161
187
|
defaultProjectSlug: defaultProjectId,
|
|
162
188
|
defaultProjectId,
|
|
163
|
-
fallbackProjectSlug
|
|
189
|
+
fallbackProjectSlug,
|
|
164
190
|
});
|
|
165
191
|
}
|
|
166
192
|
else {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RuntimeAuthOptions {
|
|
2
|
+
projectDir: string;
|
|
3
|
+
projectSlug?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RuntimeAuthContext {
|
|
6
|
+
apiToken?: string;
|
|
7
|
+
projectSlug?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function inferRuntimeProjectSlug(projectDir: string): string | undefined;
|
|
10
|
+
export declare function resolveRuntimeAuthContext(options: RuntimeAuthOptions): Promise<RuntimeAuthContext>;
|
|
11
|
+
export declare function applyRuntimeAuthContext(options: RuntimeAuthOptions): Promise<RuntimeAuthContext>;
|
|
12
|
+
//# sourceMappingURL=runtime-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-auth.d.ts","sourceRoot":"","sources":["../../../src/cli/shared/runtime-auth.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAOD,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAI9E;AAED,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAa7B;AAED,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAc7B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { getEnv, setEnv } from "../../src/platform/index.js";
|
|
2
|
+
import { basename } from "../../src/platform/compat/path/index.js";
|
|
3
|
+
import { readToken } from "../auth/token-store.js";
|
|
4
|
+
function normalizeEnvValue(value) {
|
|
5
|
+
const normalized = value?.trim();
|
|
6
|
+
return normalized ? normalized : undefined;
|
|
7
|
+
}
|
|
8
|
+
export function inferRuntimeProjectSlug(projectDir) {
|
|
9
|
+
const dirName = basename(projectDir).replace(/^@[^/]+[/\\]/, "");
|
|
10
|
+
const slug = dirName.replace(/[^a-z0-9-]/gi, "-").toLowerCase();
|
|
11
|
+
return slug || undefined;
|
|
12
|
+
}
|
|
13
|
+
export async function resolveRuntimeAuthContext(options) {
|
|
14
|
+
const envToken = normalizeEnvValue(getEnv("VERYFRONT_API_TOKEN"));
|
|
15
|
+
const storedToken = envToken ? undefined : normalizeEnvValue(await readToken() ?? undefined);
|
|
16
|
+
const apiToken = envToken ?? storedToken;
|
|
17
|
+
const envProjectSlug = normalizeEnvValue(getEnv("VERYFRONT_PROJECT_SLUG"));
|
|
18
|
+
const projectSlug = envProjectSlug ?? normalizeEnvValue(options.projectSlug) ??
|
|
19
|
+
inferRuntimeProjectSlug(options.projectDir);
|
|
20
|
+
return {
|
|
21
|
+
...(apiToken ? { apiToken } : {}),
|
|
22
|
+
...(projectSlug ? { projectSlug } : {}),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export async function applyRuntimeAuthContext(options) {
|
|
26
|
+
const context = await resolveRuntimeAuthContext(options);
|
|
27
|
+
if (context.apiToken && !normalizeEnvValue(getEnv("VERYFRONT_API_TOKEN"))) {
|
|
28
|
+
setEnv("VERYFRONT_API_TOKEN", context.apiToken);
|
|
29
|
+
}
|
|
30
|
+
if (context.apiToken && context.projectSlug && !normalizeEnvValue(getEnv("VERYFRONT_PROJECT_SLUG"))) {
|
|
31
|
+
setEnv("VERYFRONT_PROJECT_SLUG", context.projectSlug);
|
|
32
|
+
}
|
|
33
|
+
return context;
|
|
34
|
+
}
|
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/ag-ui/handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,M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,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@ import * as dntShim from "../../../_dnt.shims.js";
|
|
|
2
2
|
import { isResponseLike } from "../service/response-like.js";
|
|
3
3
|
import { getAgent } from "../composition/index.js";
|
|
4
4
|
import { fromError } from "../../errors/veryfront-error.js";
|
|
5
|
-
import { DEFAULT_LOCAL_MODEL } from "../../provider/local/model-catalog.js";
|
|
6
5
|
import { AgentRuntime, RunAlreadyExistsError, } from "../runtime/index.js";
|
|
7
6
|
import { createStreamTransformState, finalizeRunEvents, formatAgUiEvent, mapRuntimeEventToAgUi, } from "../../internal-agents/ag-ui-sse.js";
|
|
8
7
|
import { streamDataStreamEvents } from "../streaming/data-stream.js";
|
|
@@ -17,6 +16,20 @@ const AG_UI_HEADERS = {
|
|
|
17
16
|
"Cache-Control": "no-cache",
|
|
18
17
|
Connection: "keep-alive",
|
|
19
18
|
};
|
|
19
|
+
function isModelCredentialError(error) {
|
|
20
|
+
if (!error)
|
|
21
|
+
return false;
|
|
22
|
+
if (error.type === "no_ai_available")
|
|
23
|
+
return true;
|
|
24
|
+
if (error.type !== "config")
|
|
25
|
+
return false;
|
|
26
|
+
const message = error.message.toLowerCase();
|
|
27
|
+
return ((message.includes("not set") || message.includes("missing credentials")) &&
|
|
28
|
+
(message.includes("api_key") ||
|
|
29
|
+
message.includes("api token") ||
|
|
30
|
+
message.includes("veryfront_api_token") ||
|
|
31
|
+
message.includes("credentials")));
|
|
32
|
+
}
|
|
20
33
|
function generateRunId() {
|
|
21
34
|
return `run_${dntShim.crypto.randomUUID().replaceAll("-", "")}`;
|
|
22
35
|
}
|
|
@@ -304,11 +317,10 @@ export function createAgUiHandler(agentIdOrConfig, options) {
|
|
|
304
317
|
}, { status: 400 });
|
|
305
318
|
}
|
|
306
319
|
const vfError = fromError(error);
|
|
307
|
-
if (vfError
|
|
320
|
+
if (isModelCredentialError(vfError)) {
|
|
308
321
|
return Response.json({
|
|
309
|
-
code: "NO_AI_AVAILABLE",
|
|
310
|
-
|
|
311
|
-
model: DEFAULT_LOCAL_MODEL,
|
|
322
|
+
code: vfError?.type === "no_ai_available" ? "NO_AI_AVAILABLE" : "NO_MODEL_CREDENTIALS",
|
|
323
|
+
error: "No model credentials configured. Run veryfront login or set VERYFRONT_API_TOKEN, OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY.",
|
|
312
324
|
}, { status: 503 });
|
|
313
325
|
}
|
|
314
326
|
return Response.json({ error: "Internal server error" }, { status: 500 });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composition.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/composition/composition.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAiB,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAuBhF,wBAAgB,WAAW,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CA2BnE;AAED,6CAA6C;AAC7C,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACzD,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACzE;AAED,sCAAsC;AACtC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,YAAY,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,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tB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC1C;AAED,qCAAqC;AACrC,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC,CAAC;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,uBAAuB;AACvB,wBAAgB,cAAc,CAC5B,MAAM,EAAE,cAAc,GACrB;IAAE,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;CAAE,CAsDrD;AAID,cAAM,kBAAmB,SAAQ,oBAAoB,CAAC,KAAK,CAAC;CAAG;AAG/D,eAAO,MAAM,aAAa,oBAAuC,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAe9B,uBAAuB;AACvB,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAU5D;AAED,oBAAoB;AACpB,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAOtD;AAED,4BAA4B;AAC5B,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAOzC;AA+BD,8BAA8B;AAC9B,wBAAgB,gBAAgB,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAU5F"}
|
|
@@ -95,27 +95,52 @@ class AgentRegistryClass extends ScopedRegistryFacade {
|
|
|
95
95
|
// Singleton instance - maintains same interface but now project-scoped internally
|
|
96
96
|
export const agentRegistry = new AgentRegistryClass(agentManager);
|
|
97
97
|
export { AgentRegistryClass };
|
|
98
|
+
const GET_AGENT_BRIDGE_KEY = "__vfGetAgent";
|
|
99
|
+
const REGISTER_AGENT_BRIDGE_KEY = "__vfRegisterAgent";
|
|
100
|
+
const GET_ALL_AGENT_IDS_BRIDGE_KEY = "__vfGetAllAgentIds";
|
|
101
|
+
function getExistingGlobalAgentBridge(key, localValue) {
|
|
102
|
+
const descriptor = Object.getOwnPropertyDescriptor(dntShim.dntGlobalThis, key);
|
|
103
|
+
if (!descriptor)
|
|
104
|
+
return undefined;
|
|
105
|
+
if (typeof descriptor.value !== "function") {
|
|
106
|
+
throw new TypeError(`Global agent bridge ${key} already exists and is not callable.`);
|
|
107
|
+
}
|
|
108
|
+
return descriptor.value === localValue ? undefined : descriptor.value;
|
|
109
|
+
}
|
|
98
110
|
/** Registers agent. */
|
|
99
111
|
export function registerAgent(id, agent) {
|
|
112
|
+
const register = getExistingGlobalAgentBridge(REGISTER_AGENT_BRIDGE_KEY, registerAgent);
|
|
113
|
+
if (register) {
|
|
114
|
+
register(id, agent);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
100
117
|
agentRegistry.register(id, agent);
|
|
101
118
|
}
|
|
102
119
|
/** Return agent. */
|
|
103
120
|
export function getAgent(id) {
|
|
121
|
+
const get = getExistingGlobalAgentBridge(GET_AGENT_BRIDGE_KEY, getAgent);
|
|
122
|
+
if (get)
|
|
123
|
+
return get(id);
|
|
104
124
|
return agentRegistry.get(id);
|
|
105
125
|
}
|
|
106
126
|
/** Return all agent IDs. */
|
|
107
127
|
export function getAllAgentIds() {
|
|
128
|
+
const getAllIds = getExistingGlobalAgentBridge(GET_ALL_AGENT_IDS_BRIDGE_KEY, getAllAgentIds);
|
|
129
|
+
if (getAllIds)
|
|
130
|
+
return getAllIds();
|
|
108
131
|
return agentRegistry.getAllIds();
|
|
109
132
|
}
|
|
110
133
|
// Register on globalThis so compiled-binary runtime shim can delegate to the
|
|
111
134
|
// real registry. External temp-file modules can't import from the embedded
|
|
112
135
|
// binary FS, so they use globalThis bridges instead.
|
|
113
136
|
// Use Object.defineProperty to prevent accidental overwriting or enumeration.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
137
|
+
function defineGlobalAgentBridge(key, value) {
|
|
138
|
+
const descriptor = Object.getOwnPropertyDescriptor(dntShim.dntGlobalThis, key);
|
|
139
|
+
if (descriptor) {
|
|
140
|
+
if (typeof descriptor.value === "function")
|
|
141
|
+
return;
|
|
142
|
+
throw new TypeError(`Global agent bridge ${key} already exists and is not callable.`);
|
|
143
|
+
}
|
|
119
144
|
Object.defineProperty(dntShim.dntGlobalThis, key, {
|
|
120
145
|
value,
|
|
121
146
|
writable: false,
|
|
@@ -123,10 +148,20 @@ for (const [key, value] of Object.entries({
|
|
|
123
148
|
configurable: false,
|
|
124
149
|
});
|
|
125
150
|
}
|
|
151
|
+
for (const [key, value] of Object.entries({
|
|
152
|
+
[GET_AGENT_BRIDGE_KEY]: getAgent,
|
|
153
|
+
[REGISTER_AGENT_BRIDGE_KEY]: registerAgent,
|
|
154
|
+
[GET_ALL_AGENT_IDS_BRIDGE_KEY]: getAllAgentIds,
|
|
155
|
+
})) {
|
|
156
|
+
defineGlobalAgentBridge(key, value);
|
|
157
|
+
}
|
|
126
158
|
/** Return agents as tools. */
|
|
127
159
|
export function getAgentsAsTools(descriptions) {
|
|
128
160
|
const tools = {};
|
|
129
|
-
for (const
|
|
161
|
+
for (const id of getAllAgentIds()) {
|
|
162
|
+
const agent = getAgent(id);
|
|
163
|
+
if (!agent)
|
|
164
|
+
continue;
|
|
130
165
|
tools[id] = agentAsTool(agent, descriptions?.[id] ?? `Call ${id} agent`);
|
|
131
166
|
}
|
|
132
167
|
return tools;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @module agent/react
|
|
5
5
|
*/
|
|
6
6
|
export { useChat } from "./use-chat/index.js";
|
|
7
|
-
export type { BranchInfo,
|
|
7
|
+
export type { BranchInfo, ChatDynamicToolPart, ChatFinishReason, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatStreamEvent, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, InferenceMode, OnToolCallArg, ToolOutput, UseChatOptions, UseChatResult, } from "./use-chat/index.js";
|
|
8
8
|
export { useAgent } from "./use-agent.js";
|
|
9
9
|
export type { UseAgentOptions, UseAgentResult } from "./use-agent.js";
|
|
10
10
|
export { useCompletion } from "./use-completion.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEtE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAElF,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Build any interface you want.
|
|
6
6
|
*/
|
|
7
7
|
export { useChat } from "./use-chat.js";
|
|
8
|
-
export type { BranchInfo,
|
|
8
|
+
export type { BranchInfo, ChatDynamicToolPart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, InferenceMode, OnToolCallArg, ToolOutput, UseChatOptions, UseChatResult, } from "./types.js";
|
|
9
9
|
export type { ChatFinishReason, ChatStreamEvent, } from "./stream-protocol.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EACV,UAAU,EACV,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,YAAY,EACV,UAAU,EACV,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,aAAa,EACb,aAAa,EACb,UAAU,EACV,cAAc,EACd,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,gBAAgB,EAChB,eAAe,GAChB,MAAM,sBAAsB,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ChatDataPart, ChatDynamicToolPart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState } from "../../../chat/protocol.js";
|
|
2
|
-
/** Where inference is happening */
|
|
3
|
-
export type InferenceMode = "cloud" | "server-local"
|
|
4
|
-
/** Browser-side model loading and inference status */
|
|
5
|
-
export type BrowserInferenceStatus = "idle" | "loading-runtime" | "downloading-model" | "ready" | "generating" | "error";
|
|
2
|
+
/** Where inference is happening. */
|
|
3
|
+
export type InferenceMode = "cloud" | "server-local";
|
|
6
4
|
export type { ChatDataPart, ChatDynamicToolPart, ChatMessage, ChatMessagePart, ChatReasoningPart, ChatStepPart, ChatTextPart, ChatToolPart, ChatToolResultPart, ChatToolState, };
|
|
7
5
|
type ToolOutputState = "output-available" | "output-error";
|
|
8
6
|
/** Output from tool. */
|
|
@@ -34,10 +32,6 @@ export interface UseChatOptions {
|
|
|
34
32
|
credentials?: RequestCredentials;
|
|
35
33
|
/** Override model at runtime (e.g. "openai/gpt-4o", "Anthropic/claude-sonnet-4-5-20250929") */
|
|
36
34
|
model?: string;
|
|
37
|
-
/** System prompt for browser-side inference (server uses agent config) */
|
|
38
|
-
systemPrompt?: string;
|
|
39
|
-
/** Enable/disable browser fallback when server can't provide a runtime. Default: true */
|
|
40
|
-
browserFallback?: boolean;
|
|
41
35
|
onResponse?: (response: Response) => void;
|
|
42
36
|
onFinish?: (message: ChatMessage) => void;
|
|
43
37
|
onError?: (error: Error) => void;
|
|
@@ -60,8 +54,6 @@ export interface UseChatResult {
|
|
|
60
54
|
activeModel: string | undefined;
|
|
61
55
|
/** Where inference is currently happening */
|
|
62
56
|
inferenceMode: InferenceMode;
|
|
63
|
-
/** Browser-side model loading/inference status (null when not using browser fallback) */
|
|
64
|
-
browserStatus: BrowserInferenceStatus | null;
|
|
65
57
|
setInput: (input: string) => void;
|
|
66
58
|
/** Change the model for subsequent requests */
|
|
67
59
|
setModel: (model: string | undefined) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACd,MAAM,2BAA2B,CAAC;AAEnC,oCAAoC;AACpC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,cAAc,CAAC;AAErD,YAAY,EACV,YAAY,EACZ,mBAAmB,EACnB,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,aAAa,GACd,CAAC;AAEF,KAAK,eAAe,GAAG,kBAAkB,GAAG,cAAc,CAAC;AAE3D,wBAAwB;AACxB,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gDAAgD;AAChD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,OAAO,CAAC;QACf,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,CAAC;CACH;AAED,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC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ero UI.
|
|
5
5
|
* Consumes AG-UI SSE by default.
|
|
6
6
|
*
|
|
7
|
-
* Supports
|
|
8
|
-
* - cloud:
|
|
9
|
-
* - server-local:
|
|
10
|
-
* - browser: Server can't run ONNX (compiled binary), falls back to browser Worker
|
|
7
|
+
* Supports two inference modes:
|
|
8
|
+
* - cloud: server-side provider inference
|
|
9
|
+
* - server-local: explicit local model on the server
|
|
11
10
|
*/
|
|
12
11
|
import { handleAgUiStreamingResponse } from "./streaming/index.js";
|
|
13
12
|
import type { ChatMessage, UseChatOptions, UseChatResult } from "./types.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-chat.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/use-chat.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"use-chat.d.ts","sourceRoot":"","sources":["../../../../../src/src/agent/react/use-chat/use-chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAEV,WAAW,EAGX,cAAc,EACd,aAAa,EACd,MAAM,YAAY,CAAC;AAGpB,KAAK,oBAAoB,GAAG,OAAO,2BAA2B,CAAC;AAE/D,wDAAwD;AACxD,UAAU,MAAM;IACd,QAAQ,EAAE,WAAW,EAAE,CAAC;CACzB;AAED,sEAAsE;AACtE,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAEnF;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACxC,MAAM,GAAG,SAAS,CAGpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,WAAW,EAAE,EACvB,SAAS,EAAE,MAAM,EACjB,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GACxC,MAAM,CAIR;AAED,wBAAgB,2BAA2B,CACzC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC,GACrC,oBAAoB,CAGtB;AAOD,wBAAgB,OAAO,CAAC,OAAO,GAAE,cAAmB,GAAG,aAAa,CAmZnE"}
|