veryfront 0.0.12 → 0.0.13
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/dist/ai/index.js +301 -167
- package/dist/ai/index.js.map +3 -3
- package/dist/cli.js +398 -191
- package/dist/components.js +21 -1
- package/dist/components.js.map +2 -2
- package/dist/config.js +30 -1
- package/dist/config.js.map +2 -2
- package/dist/data.js +1 -1
- package/dist/data.js.map +1 -1
- package/dist/index.js +21 -5
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/ai/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/ai/providers/openai.ts
|
|
2
|
-
import { z } from "zod";
|
|
2
|
+
import { z as z2 } from "zod";
|
|
3
3
|
|
|
4
4
|
// src/core/errors/veryfront-error.ts
|
|
5
5
|
function createError(error) {
|
|
@@ -135,6 +135,23 @@ var agentLogger = createLogger("AGENT");
|
|
|
135
135
|
var logger = createLogger("VERYFRONT");
|
|
136
136
|
|
|
137
137
|
// src/ai/providers/base.ts
|
|
138
|
+
import { z } from "zod";
|
|
139
|
+
var OpenAIStreamChunkSchema = z.object({
|
|
140
|
+
choices: z.array(z.object({
|
|
141
|
+
delta: z.object({
|
|
142
|
+
content: z.string().optional().nullable(),
|
|
143
|
+
tool_calls: z.array(z.object({
|
|
144
|
+
index: z.number().optional(),
|
|
145
|
+
id: z.string().optional(),
|
|
146
|
+
function: z.object({
|
|
147
|
+
name: z.string().optional(),
|
|
148
|
+
arguments: z.string().optional()
|
|
149
|
+
}).optional()
|
|
150
|
+
})).optional()
|
|
151
|
+
}),
|
|
152
|
+
finish_reason: z.string().nullable()
|
|
153
|
+
})).min(1)
|
|
154
|
+
});
|
|
138
155
|
var BaseProvider = class {
|
|
139
156
|
constructor(config) {
|
|
140
157
|
this.config = config;
|
|
@@ -238,8 +255,12 @@ var BaseProvider = class {
|
|
|
238
255
|
continue;
|
|
239
256
|
}
|
|
240
257
|
try {
|
|
241
|
-
const
|
|
242
|
-
const
|
|
258
|
+
const raw = JSON.parse(data);
|
|
259
|
+
const result = OpenAIStreamChunkSchema.safeParse(raw);
|
|
260
|
+
if (!result.success) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const choice = result.data.choices[0];
|
|
243
264
|
if (!choice)
|
|
244
265
|
continue;
|
|
245
266
|
const delta = choice.delta;
|
|
@@ -324,25 +345,25 @@ var BaseProvider = class {
|
|
|
324
345
|
};
|
|
325
346
|
|
|
326
347
|
// src/ai/providers/openai.ts
|
|
327
|
-
var OpenAIToolCallSchema =
|
|
328
|
-
id:
|
|
329
|
-
function:
|
|
330
|
-
name:
|
|
331
|
-
arguments:
|
|
348
|
+
var OpenAIToolCallSchema = z2.object({
|
|
349
|
+
id: z2.string(),
|
|
350
|
+
function: z2.object({
|
|
351
|
+
name: z2.string(),
|
|
352
|
+
arguments: z2.string()
|
|
332
353
|
})
|
|
333
354
|
});
|
|
334
|
-
var OpenAIResponseSchema =
|
|
335
|
-
choices:
|
|
336
|
-
message:
|
|
337
|
-
content:
|
|
338
|
-
tool_calls:
|
|
355
|
+
var OpenAIResponseSchema = z2.object({
|
|
356
|
+
choices: z2.array(z2.object({
|
|
357
|
+
message: z2.object({
|
|
358
|
+
content: z2.string().nullable().optional(),
|
|
359
|
+
tool_calls: z2.array(OpenAIToolCallSchema).optional()
|
|
339
360
|
}),
|
|
340
|
-
finish_reason:
|
|
361
|
+
finish_reason: z2.string()
|
|
341
362
|
})).min(1),
|
|
342
|
-
usage:
|
|
343
|
-
prompt_tokens:
|
|
344
|
-
completion_tokens:
|
|
345
|
-
total_tokens:
|
|
363
|
+
usage: z2.object({
|
|
364
|
+
prompt_tokens: z2.number().optional(),
|
|
365
|
+
completion_tokens: z2.number().optional(),
|
|
366
|
+
total_tokens: z2.number().optional()
|
|
346
367
|
}).optional()
|
|
347
368
|
});
|
|
348
369
|
var OpenAIProvider = class extends BaseProvider {
|
|
@@ -727,26 +748,26 @@ var AnthropicProvider = class extends BaseProvider {
|
|
|
727
748
|
};
|
|
728
749
|
|
|
729
750
|
// src/ai/providers/google.ts
|
|
730
|
-
import { z as
|
|
731
|
-
var GoogleToolCallSchema =
|
|
732
|
-
id:
|
|
733
|
-
function:
|
|
734
|
-
name:
|
|
735
|
-
arguments:
|
|
751
|
+
import { z as z3 } from "zod";
|
|
752
|
+
var GoogleToolCallSchema = z3.object({
|
|
753
|
+
id: z3.string(),
|
|
754
|
+
function: z3.object({
|
|
755
|
+
name: z3.string(),
|
|
756
|
+
arguments: z3.union([z3.string(), z3.record(z3.unknown())])
|
|
736
757
|
})
|
|
737
758
|
});
|
|
738
|
-
var GoogleResponseSchema =
|
|
739
|
-
choices:
|
|
740
|
-
message:
|
|
741
|
-
content:
|
|
742
|
-
tool_calls:
|
|
759
|
+
var GoogleResponseSchema = z3.object({
|
|
760
|
+
choices: z3.array(z3.object({
|
|
761
|
+
message: z3.object({
|
|
762
|
+
content: z3.string().nullable().optional(),
|
|
763
|
+
tool_calls: z3.array(GoogleToolCallSchema).optional()
|
|
743
764
|
}),
|
|
744
|
-
finish_reason:
|
|
765
|
+
finish_reason: z3.string()
|
|
745
766
|
})).min(1),
|
|
746
|
-
usage:
|
|
747
|
-
prompt_tokens:
|
|
748
|
-
completion_tokens:
|
|
749
|
-
total_tokens:
|
|
767
|
+
usage: z3.object({
|
|
768
|
+
prompt_tokens: z3.number().optional(),
|
|
769
|
+
completion_tokens: z3.number().optional(),
|
|
770
|
+
total_tokens: z3.number().optional()
|
|
750
771
|
}).optional()
|
|
751
772
|
});
|
|
752
773
|
var GoogleProvider = class extends BaseProvider {
|
|
@@ -1688,7 +1709,7 @@ var BYTES_PER_MB = 1024 * 1024;
|
|
|
1688
1709
|
// deno.json
|
|
1689
1710
|
var deno_default = {
|
|
1690
1711
|
name: "veryfront",
|
|
1691
|
-
version: "0.0.
|
|
1712
|
+
version: "0.0.13",
|
|
1692
1713
|
nodeModulesDir: "auto",
|
|
1693
1714
|
workspace: [
|
|
1694
1715
|
"./examples/async-worker-redis",
|
|
@@ -2280,6 +2301,45 @@ async function withSpan(name, fn, options = {}) {
|
|
|
2280
2301
|
}
|
|
2281
2302
|
|
|
2282
2303
|
// src/ai/agent/runtime.ts
|
|
2304
|
+
import { z as z4 } from "zod";
|
|
2305
|
+
var AgentStreamEventSchema = z4.discriminatedUnion("type", [
|
|
2306
|
+
z4.object({
|
|
2307
|
+
type: z4.literal("content"),
|
|
2308
|
+
content: z4.string()
|
|
2309
|
+
}),
|
|
2310
|
+
z4.object({
|
|
2311
|
+
type: z4.literal("tool_call_start"),
|
|
2312
|
+
toolCall: z4.object({
|
|
2313
|
+
id: z4.string(),
|
|
2314
|
+
name: z4.string()
|
|
2315
|
+
})
|
|
2316
|
+
}),
|
|
2317
|
+
z4.object({
|
|
2318
|
+
type: z4.literal("tool_call_delta"),
|
|
2319
|
+
id: z4.string(),
|
|
2320
|
+
arguments: z4.string()
|
|
2321
|
+
}),
|
|
2322
|
+
z4.object({
|
|
2323
|
+
type: z4.literal("tool_call_complete"),
|
|
2324
|
+
toolCall: z4.object({
|
|
2325
|
+
id: z4.string(),
|
|
2326
|
+
name: z4.string(),
|
|
2327
|
+
arguments: z4.string()
|
|
2328
|
+
})
|
|
2329
|
+
}),
|
|
2330
|
+
z4.object({
|
|
2331
|
+
type: z4.literal("finish"),
|
|
2332
|
+
finishReason: z4.string().nullable()
|
|
2333
|
+
}),
|
|
2334
|
+
z4.object({
|
|
2335
|
+
type: z4.literal("usage"),
|
|
2336
|
+
usage: z4.object({
|
|
2337
|
+
promptTokens: z4.number().optional(),
|
|
2338
|
+
completionTokens: z4.number().optional(),
|
|
2339
|
+
totalTokens: z4.number().optional()
|
|
2340
|
+
})
|
|
2341
|
+
})
|
|
2342
|
+
]);
|
|
2283
2343
|
var DEFAULT_MAX_TOKENS = 4096;
|
|
2284
2344
|
var DEFAULT_TEMPERATURE = 0.7;
|
|
2285
2345
|
var AgentRuntime = class {
|
|
@@ -2561,6 +2621,42 @@ var AgentRuntime = class {
|
|
|
2561
2621
|
let accumulatedText = "";
|
|
2562
2622
|
let finishReason = null;
|
|
2563
2623
|
const streamToolCalls = /* @__PURE__ */ new Map();
|
|
2624
|
+
const parseStreamToolArgs = (rawArgs) => {
|
|
2625
|
+
try {
|
|
2626
|
+
const parsed = typeof rawArgs === "string" ? JSON.parse(rawArgs) : rawArgs;
|
|
2627
|
+
if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
|
|
2628
|
+
return { args: parsed };
|
|
2629
|
+
}
|
|
2630
|
+
return { args: {}, error: "Tool call arguments must be a JSON object" };
|
|
2631
|
+
} catch (error) {
|
|
2632
|
+
return {
|
|
2633
|
+
args: {},
|
|
2634
|
+
error: error instanceof Error ? error.message : String(error)
|
|
2635
|
+
};
|
|
2636
|
+
}
|
|
2637
|
+
};
|
|
2638
|
+
const recordToolError = async (toolCall, errorStr) => {
|
|
2639
|
+
toolCall.status = "error";
|
|
2640
|
+
toolCall.error = errorStr;
|
|
2641
|
+
toolCalls.push(toolCall);
|
|
2642
|
+
const errorData = JSON.stringify({
|
|
2643
|
+
type: "error",
|
|
2644
|
+
error: errorStr
|
|
2645
|
+
});
|
|
2646
|
+
controller.enqueue(encoder.encode(`data: ${errorData}
|
|
2647
|
+
|
|
2648
|
+
`));
|
|
2649
|
+
const errorMessage = {
|
|
2650
|
+
id: `tool_error_${toolCall.id}`,
|
|
2651
|
+
role: "tool",
|
|
2652
|
+
content: `Error: ${errorStr}`,
|
|
2653
|
+
toolCallId: toolCall.id,
|
|
2654
|
+
toolCall,
|
|
2655
|
+
timestamp: Date.now()
|
|
2656
|
+
};
|
|
2657
|
+
currentMessages.push(errorMessage);
|
|
2658
|
+
await this.memory.add(errorMessage);
|
|
2659
|
+
};
|
|
2564
2660
|
const handleEvent = (event) => {
|
|
2565
2661
|
switch (event.type) {
|
|
2566
2662
|
case "content": {
|
|
@@ -2624,17 +2720,26 @@ var AgentRuntime = class {
|
|
|
2624
2720
|
const lines = segments.filter((line) => line.trim());
|
|
2625
2721
|
for (const line of lines) {
|
|
2626
2722
|
try {
|
|
2627
|
-
const
|
|
2628
|
-
|
|
2629
|
-
|
|
2723
|
+
const rawEvent = JSON.parse(line);
|
|
2724
|
+
const parseResult = AgentStreamEventSchema.safeParse(rawEvent);
|
|
2725
|
+
if (parseResult.success) {
|
|
2726
|
+
handleEvent(parseResult.data);
|
|
2727
|
+
} else {
|
|
2728
|
+
serverLogger.warn("[AGENT] Invalid stream event received:", parseResult.error);
|
|
2729
|
+
}
|
|
2730
|
+
} catch (e) {
|
|
2731
|
+
serverLogger.warn("[AGENT] Failed to parse stream line:", e);
|
|
2630
2732
|
continue;
|
|
2631
2733
|
}
|
|
2632
2734
|
}
|
|
2633
2735
|
}
|
|
2634
2736
|
if (partial.trim()) {
|
|
2635
2737
|
try {
|
|
2636
|
-
const
|
|
2637
|
-
|
|
2738
|
+
const rawEvent = JSON.parse(partial);
|
|
2739
|
+
const parseResult = AgentStreamEventSchema.safeParse(rawEvent);
|
|
2740
|
+
if (parseResult.success) {
|
|
2741
|
+
handleEvent(parseResult.data);
|
|
2742
|
+
}
|
|
2638
2743
|
} catch {
|
|
2639
2744
|
}
|
|
2640
2745
|
}
|
|
@@ -2645,23 +2750,41 @@ var AgentRuntime = class {
|
|
|
2645
2750
|
timestamp: Date.now()
|
|
2646
2751
|
};
|
|
2647
2752
|
if (streamToolCalls.size > 0) {
|
|
2648
|
-
assistantMessage.toolCalls = Array.from(streamToolCalls.values()).map((tc) =>
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2753
|
+
assistantMessage.toolCalls = Array.from(streamToolCalls.values()).map((tc) => {
|
|
2754
|
+
const { args, error } = parseStreamToolArgs(tc.arguments);
|
|
2755
|
+
if (error) {
|
|
2756
|
+
serverLogger.warn("[AGENT] Failed to parse streamed tool arguments", {
|
|
2757
|
+
toolCallId: tc.id,
|
|
2758
|
+
error
|
|
2759
|
+
});
|
|
2760
|
+
}
|
|
2761
|
+
return {
|
|
2762
|
+
id: tc.id,
|
|
2763
|
+
name: tc.name,
|
|
2764
|
+
arguments: args
|
|
2765
|
+
};
|
|
2766
|
+
});
|
|
2653
2767
|
}
|
|
2654
2768
|
currentMessages.push(assistantMessage);
|
|
2655
2769
|
await this.memory.add(assistantMessage);
|
|
2656
2770
|
if (finishReason === "tool_calls" && streamToolCalls.size > 0) {
|
|
2657
2771
|
this.status = "tool_execution";
|
|
2658
2772
|
for (const tc of streamToolCalls.values()) {
|
|
2773
|
+
const { args, error: argError } = parseStreamToolArgs(tc.arguments);
|
|
2659
2774
|
const toolCall = {
|
|
2660
2775
|
id: tc.id,
|
|
2661
2776
|
name: tc.name,
|
|
2662
|
-
args
|
|
2777
|
+
args,
|
|
2663
2778
|
status: "pending"
|
|
2664
2779
|
};
|
|
2780
|
+
if (argError) {
|
|
2781
|
+
serverLogger.warn("[AGENT] Invalid streamed tool arguments", {
|
|
2782
|
+
toolCallId: tc.id,
|
|
2783
|
+
error: argError
|
|
2784
|
+
});
|
|
2785
|
+
await recordToolError(toolCall, `Invalid tool arguments: ${argError}`);
|
|
2786
|
+
continue;
|
|
2787
|
+
}
|
|
2665
2788
|
try {
|
|
2666
2789
|
toolCall.status = "executing";
|
|
2667
2790
|
const startTime = Date.now();
|
|
@@ -2708,26 +2831,8 @@ var AgentRuntime = class {
|
|
|
2708
2831
|
currentMessages.push(toolResultMessage);
|
|
2709
2832
|
await this.memory.add(toolResultMessage);
|
|
2710
2833
|
} catch (error) {
|
|
2711
|
-
|
|
2712
|
-
toolCall
|
|
2713
|
-
toolCalls.push(toolCall);
|
|
2714
|
-
const errorData = JSON.stringify({
|
|
2715
|
-
type: "error",
|
|
2716
|
-
error: toolCall.error
|
|
2717
|
-
});
|
|
2718
|
-
controller.enqueue(encoder.encode(`data: ${errorData}
|
|
2719
|
-
|
|
2720
|
-
`));
|
|
2721
|
-
const errorMessage = {
|
|
2722
|
-
id: `tool_error_${tc.id}`,
|
|
2723
|
-
role: "tool",
|
|
2724
|
-
content: `Error: ${toolCall.error}`,
|
|
2725
|
-
toolCallId: tc.id,
|
|
2726
|
-
toolCall,
|
|
2727
|
-
timestamp: Date.now()
|
|
2728
|
-
};
|
|
2729
|
-
currentMessages.push(errorMessage);
|
|
2730
|
-
await this.memory.add(errorMessage);
|
|
2834
|
+
const errorStr = error instanceof Error ? error.message : String(error);
|
|
2835
|
+
await recordToolError(toolCall, errorStr);
|
|
2731
2836
|
}
|
|
2732
2837
|
}
|
|
2733
2838
|
this.status = "thinking";
|
|
@@ -3178,13 +3283,13 @@ function generateAgentId() {
|
|
|
3178
3283
|
}
|
|
3179
3284
|
|
|
3180
3285
|
// src/ai/agent/composition.ts
|
|
3181
|
-
import { z as
|
|
3286
|
+
import { z as z5 } from "zod";
|
|
3182
3287
|
function agentAsTool(agent2, description) {
|
|
3183
3288
|
return {
|
|
3184
3289
|
id: `agent_${agent2.id}`,
|
|
3185
3290
|
description,
|
|
3186
|
-
inputSchema:
|
|
3187
|
-
input:
|
|
3291
|
+
inputSchema: z5.object({
|
|
3292
|
+
input: z5.string().describe("Input for the agent")
|
|
3188
3293
|
}),
|
|
3189
3294
|
async execute({ input }) {
|
|
3190
3295
|
const response = await agent2.generate({ input });
|
|
@@ -3264,125 +3369,138 @@ function getAgentsAsTools(descriptions) {
|
|
|
3264
3369
|
}
|
|
3265
3370
|
|
|
3266
3371
|
// src/core/config/schema.ts
|
|
3267
|
-
import { z as
|
|
3268
|
-
var corsSchema =
|
|
3269
|
-
var veryfrontConfigSchema =
|
|
3270
|
-
title:
|
|
3271
|
-
description:
|
|
3272
|
-
experimental:
|
|
3273
|
-
esmLayouts:
|
|
3274
|
-
precompileMDX:
|
|
3372
|
+
import { z as z6 } from "zod";
|
|
3373
|
+
var corsSchema = z6.union([z6.boolean(), z6.object({ origin: z6.string().optional() }).strict()]);
|
|
3374
|
+
var veryfrontConfigSchema = z6.object({
|
|
3375
|
+
title: z6.string().optional(),
|
|
3376
|
+
description: z6.string().optional(),
|
|
3377
|
+
experimental: z6.object({
|
|
3378
|
+
esmLayouts: z6.boolean().optional(),
|
|
3379
|
+
precompileMDX: z6.boolean().optional()
|
|
3275
3380
|
}).partial().optional(),
|
|
3276
|
-
router:
|
|
3277
|
-
defaultLayout:
|
|
3278
|
-
theme:
|
|
3279
|
-
build:
|
|
3280
|
-
outDir:
|
|
3281
|
-
trailingSlash:
|
|
3282
|
-
esbuild:
|
|
3283
|
-
wasmURL:
|
|
3284
|
-
worker:
|
|
3381
|
+
router: z6.enum(["app", "pages"]).optional(),
|
|
3382
|
+
defaultLayout: z6.string().optional(),
|
|
3383
|
+
theme: z6.object({ colors: z6.record(z6.string()).optional() }).partial().optional(),
|
|
3384
|
+
build: z6.object({
|
|
3385
|
+
outDir: z6.string().optional(),
|
|
3386
|
+
trailingSlash: z6.boolean().optional(),
|
|
3387
|
+
esbuild: z6.object({
|
|
3388
|
+
wasmURL: z6.string().url().optional(),
|
|
3389
|
+
worker: z6.boolean().optional()
|
|
3285
3390
|
}).partial().optional()
|
|
3286
3391
|
}).partial().optional(),
|
|
3287
|
-
cache:
|
|
3288
|
-
dir:
|
|
3289
|
-
bundleManifest:
|
|
3290
|
-
type:
|
|
3291
|
-
redisUrl:
|
|
3292
|
-
keyPrefix:
|
|
3293
|
-
ttl:
|
|
3294
|
-
enabled:
|
|
3392
|
+
cache: z6.object({
|
|
3393
|
+
dir: z6.string().optional(),
|
|
3394
|
+
bundleManifest: z6.object({
|
|
3395
|
+
type: z6.enum(["redis", "kv", "memory"]).optional(),
|
|
3396
|
+
redisUrl: z6.string().optional(),
|
|
3397
|
+
keyPrefix: z6.string().optional(),
|
|
3398
|
+
ttl: z6.number().int().positive().optional(),
|
|
3399
|
+
enabled: z6.boolean().optional()
|
|
3295
3400
|
}).partial().optional()
|
|
3296
3401
|
}).partial().optional(),
|
|
3297
|
-
dev:
|
|
3298
|
-
port:
|
|
3299
|
-
host:
|
|
3300
|
-
open:
|
|
3301
|
-
hmr:
|
|
3302
|
-
components:
|
|
3402
|
+
dev: z6.object({
|
|
3403
|
+
port: z6.number().int().positive().optional(),
|
|
3404
|
+
host: z6.string().optional(),
|
|
3405
|
+
open: z6.boolean().optional(),
|
|
3406
|
+
hmr: z6.boolean().optional(),
|
|
3407
|
+
components: z6.array(z6.string()).optional()
|
|
3303
3408
|
}).partial().optional(),
|
|
3304
|
-
resolve:
|
|
3305
|
-
importMap:
|
|
3306
|
-
imports:
|
|
3307
|
-
scopes:
|
|
3409
|
+
resolve: z6.object({
|
|
3410
|
+
importMap: z6.object({
|
|
3411
|
+
imports: z6.record(z6.string()).optional(),
|
|
3412
|
+
scopes: z6.record(z6.record(z6.string())).optional()
|
|
3308
3413
|
}).partial().optional()
|
|
3309
3414
|
}).partial().optional(),
|
|
3310
|
-
security:
|
|
3311
|
-
csp:
|
|
3312
|
-
remoteHosts:
|
|
3415
|
+
security: z6.object({
|
|
3416
|
+
csp: z6.record(z6.array(z6.string())).optional(),
|
|
3417
|
+
remoteHosts: z6.array(z6.string().url()).optional(),
|
|
3313
3418
|
cors: corsSchema.optional(),
|
|
3314
|
-
coop:
|
|
3315
|
-
corp:
|
|
3316
|
-
coep:
|
|
3419
|
+
coop: z6.enum(["same-origin", "same-origin-allow-popups", "unsafe-none"]).optional(),
|
|
3420
|
+
corp: z6.enum(["same-origin", "same-site", "cross-origin"]).optional(),
|
|
3421
|
+
coep: z6.enum(["require-corp", "unsafe-none"]).optional()
|
|
3317
3422
|
}).partial().optional(),
|
|
3318
|
-
middleware:
|
|
3319
|
-
custom:
|
|
3423
|
+
middleware: z6.object({
|
|
3424
|
+
custom: z6.array(z6.function()).optional()
|
|
3320
3425
|
}).partial().optional(),
|
|
3321
|
-
theming:
|
|
3322
|
-
brandName:
|
|
3323
|
-
logoHtml:
|
|
3426
|
+
theming: z6.object({
|
|
3427
|
+
brandName: z6.string().optional(),
|
|
3428
|
+
logoHtml: z6.string().optional()
|
|
3324
3429
|
}).partial().optional(),
|
|
3325
|
-
assetPipeline:
|
|
3326
|
-
images:
|
|
3327
|
-
enabled:
|
|
3328
|
-
formats:
|
|
3329
|
-
sizes:
|
|
3330
|
-
quality:
|
|
3331
|
-
inputDir:
|
|
3332
|
-
outputDir:
|
|
3333
|
-
preserveOriginal:
|
|
3430
|
+
assetPipeline: z6.object({
|
|
3431
|
+
images: z6.object({
|
|
3432
|
+
enabled: z6.boolean().optional(),
|
|
3433
|
+
formats: z6.array(z6.enum(["webp", "avif", "jpeg", "png"])).optional(),
|
|
3434
|
+
sizes: z6.array(z6.number().int().positive()).optional(),
|
|
3435
|
+
quality: z6.number().int().min(1).max(100).optional(),
|
|
3436
|
+
inputDir: z6.string().optional(),
|
|
3437
|
+
outputDir: z6.string().optional(),
|
|
3438
|
+
preserveOriginal: z6.boolean().optional()
|
|
3334
3439
|
}).partial().optional(),
|
|
3335
|
-
css:
|
|
3336
|
-
enabled:
|
|
3337
|
-
minify:
|
|
3338
|
-
autoprefixer:
|
|
3339
|
-
purge:
|
|
3340
|
-
criticalCSS:
|
|
3341
|
-
inputDir:
|
|
3342
|
-
outputDir:
|
|
3343
|
-
browsers:
|
|
3344
|
-
purgeContent:
|
|
3345
|
-
sourceMap:
|
|
3440
|
+
css: z6.object({
|
|
3441
|
+
enabled: z6.boolean().optional(),
|
|
3442
|
+
minify: z6.boolean().optional(),
|
|
3443
|
+
autoprefixer: z6.boolean().optional(),
|
|
3444
|
+
purge: z6.boolean().optional(),
|
|
3445
|
+
criticalCSS: z6.boolean().optional(),
|
|
3446
|
+
inputDir: z6.string().optional(),
|
|
3447
|
+
outputDir: z6.string().optional(),
|
|
3448
|
+
browsers: z6.array(z6.string()).optional(),
|
|
3449
|
+
purgeContent: z6.array(z6.string()).optional(),
|
|
3450
|
+
sourceMap: z6.boolean().optional()
|
|
3346
3451
|
}).partial().optional()
|
|
3347
3452
|
}).partial().optional(),
|
|
3348
|
-
observability:
|
|
3349
|
-
tracing:
|
|
3350
|
-
enabled:
|
|
3351
|
-
exporter:
|
|
3352
|
-
endpoint:
|
|
3353
|
-
serviceName:
|
|
3354
|
-
sampleRate:
|
|
3453
|
+
observability: z6.object({
|
|
3454
|
+
tracing: z6.object({
|
|
3455
|
+
enabled: z6.boolean().optional(),
|
|
3456
|
+
exporter: z6.enum(["jaeger", "zipkin", "otlp", "console"]).optional(),
|
|
3457
|
+
endpoint: z6.string().optional(),
|
|
3458
|
+
serviceName: z6.string().optional(),
|
|
3459
|
+
sampleRate: z6.number().min(0).max(1).optional()
|
|
3355
3460
|
}).partial().optional(),
|
|
3356
|
-
metrics:
|
|
3357
|
-
enabled:
|
|
3358
|
-
exporter:
|
|
3359
|
-
endpoint:
|
|
3360
|
-
prefix:
|
|
3361
|
-
collectInterval:
|
|
3461
|
+
metrics: z6.object({
|
|
3462
|
+
enabled: z6.boolean().optional(),
|
|
3463
|
+
exporter: z6.enum(["prometheus", "otlp", "console"]).optional(),
|
|
3464
|
+
endpoint: z6.string().optional(),
|
|
3465
|
+
prefix: z6.string().optional(),
|
|
3466
|
+
collectInterval: z6.number().int().positive().optional()
|
|
3362
3467
|
}).partial().optional()
|
|
3363
3468
|
}).partial().optional(),
|
|
3364
|
-
fs:
|
|
3365
|
-
type:
|
|
3366
|
-
local:
|
|
3367
|
-
baseDir:
|
|
3469
|
+
fs: z6.object({
|
|
3470
|
+
type: z6.enum(["local", "veryfront-api", "memory"]).optional(),
|
|
3471
|
+
local: z6.object({
|
|
3472
|
+
baseDir: z6.string().optional()
|
|
3368
3473
|
}).partial().optional(),
|
|
3369
|
-
veryfront:
|
|
3370
|
-
apiBaseUrl:
|
|
3371
|
-
apiToken:
|
|
3372
|
-
projectSlug:
|
|
3373
|
-
cache:
|
|
3374
|
-
enabled:
|
|
3375
|
-
ttl:
|
|
3376
|
-
maxSize:
|
|
3474
|
+
veryfront: z6.object({
|
|
3475
|
+
apiBaseUrl: z6.string().url(),
|
|
3476
|
+
apiToken: z6.string(),
|
|
3477
|
+
projectSlug: z6.string(),
|
|
3478
|
+
cache: z6.object({
|
|
3479
|
+
enabled: z6.boolean().optional(),
|
|
3480
|
+
ttl: z6.number().int().positive().optional(),
|
|
3481
|
+
maxSize: z6.number().int().positive().optional()
|
|
3377
3482
|
}).partial().optional(),
|
|
3378
|
-
retry:
|
|
3379
|
-
maxRetries:
|
|
3380
|
-
initialDelay:
|
|
3381
|
-
maxDelay:
|
|
3483
|
+
retry: z6.object({
|
|
3484
|
+
maxRetries: z6.number().int().min(0).optional(),
|
|
3485
|
+
initialDelay: z6.number().int().positive().optional(),
|
|
3486
|
+
maxDelay: z6.number().int().positive().optional()
|
|
3382
3487
|
}).partial().optional()
|
|
3383
3488
|
}).partial().optional(),
|
|
3384
|
-
memory:
|
|
3385
|
-
files:
|
|
3489
|
+
memory: z6.object({
|
|
3490
|
+
files: z6.record(z6.union([z6.string(), z6.instanceof(Uint8Array)])).optional()
|
|
3491
|
+
}).partial().optional()
|
|
3492
|
+
}).partial().optional(),
|
|
3493
|
+
client: z6.object({
|
|
3494
|
+
moduleResolution: z6.enum(["cdn", "self-hosted", "bundled"]).optional(),
|
|
3495
|
+
cdn: z6.object({
|
|
3496
|
+
provider: z6.enum(["esm.sh", "unpkg", "jsdelivr"]).optional(),
|
|
3497
|
+
versions: z6.union([
|
|
3498
|
+
z6.literal("auto"),
|
|
3499
|
+
z6.object({
|
|
3500
|
+
react: z6.string().optional(),
|
|
3501
|
+
veryfront: z6.string().optional()
|
|
3502
|
+
})
|
|
3503
|
+
]).optional()
|
|
3386
3504
|
}).partial().optional()
|
|
3387
3505
|
}).partial().optional()
|
|
3388
3506
|
}).partial();
|
|
@@ -3428,7 +3546,8 @@ function findUnknownTopLevelKeys(input) {
|
|
|
3428
3546
|
"theming",
|
|
3429
3547
|
"assetPipeline",
|
|
3430
3548
|
"observability",
|
|
3431
|
-
"fs"
|
|
3549
|
+
"fs",
|
|
3550
|
+
"client"
|
|
3432
3551
|
]);
|
|
3433
3552
|
return Object.keys(input).filter((k) => !known.has(k));
|
|
3434
3553
|
}
|
|
@@ -3477,6 +3596,13 @@ var DEFAULT_CONFIG2 = {
|
|
|
3477
3596
|
},
|
|
3478
3597
|
resolve: {
|
|
3479
3598
|
importMap: getDefaultImportMapForConfig()
|
|
3599
|
+
},
|
|
3600
|
+
client: {
|
|
3601
|
+
moduleResolution: "cdn",
|
|
3602
|
+
cdn: {
|
|
3603
|
+
provider: "esm.sh",
|
|
3604
|
+
versions: "auto"
|
|
3605
|
+
}
|
|
3480
3606
|
}
|
|
3481
3607
|
};
|
|
3482
3608
|
var configCacheByProject = /* @__PURE__ */ new Map();
|
|
@@ -3529,6 +3655,14 @@ function mergeConfigs(userConfig) {
|
|
|
3529
3655
|
resolve: {
|
|
3530
3656
|
...DEFAULT_CONFIG2.resolve,
|
|
3531
3657
|
...userConfig.resolve
|
|
3658
|
+
},
|
|
3659
|
+
client: {
|
|
3660
|
+
...DEFAULT_CONFIG2.client,
|
|
3661
|
+
...userConfig.client,
|
|
3662
|
+
cdn: {
|
|
3663
|
+
...DEFAULT_CONFIG2.client?.cdn,
|
|
3664
|
+
...userConfig.client?.cdn
|
|
3665
|
+
}
|
|
3532
3666
|
}
|
|
3533
3667
|
};
|
|
3534
3668
|
if (merged.resolve) {
|