Skip to content
60 changes: 0 additions & 60 deletions src/agent/ai-defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,3 @@ export const STREAMING_DEFAULTS = {
maxBufferSize: 1_024 * 1_024, // 1 MB
chunkSize: 16_384,
} as const;

export const MEMORY_DEFAULTS = {
bufferSize: 10,
summaryThreshold: 20,
redisTtl: 86_400, // 24 hours
redisKeyPrefix: "veryfront:agent:memory:",
} as const;

export const RATE_LIMIT_DEFAULTS = {
requestsPerMinute: 60,
tokensPerMinute: 100_000,
windowMs: 60_000,
} as const;

export const COST_TRACKING_DEFAULTS = {
dailyBudget: 100,
monthlyBudget: 1_000,
warningThreshold: 0.8,
} as const;

export const RETRY_DEFAULTS = {
maxAttempts: 3,
initialDelayMs: 1_000,
maxDelayMs: 30_000,
backoffMultiplier: 2,
} as const;

export const WORKFLOW_DEFAULTS = {
timeoutMs: 300_000, // 5 minutes
maxParallel: 10,
checkpointIntervalMs: 5_000,
approvalTimeoutMs: 86_400_000, // 24 hours
} as const;

export const PROVIDER_DEFAULTS = {
models: {
openai: "gpt-4o",
anthropic: "claude-sonnet-4-20250514",
google: "gemini-1.5-pro",
},
requestTimeoutMs: 120_000, // 2 minutes
} as const;

export const SECURITY_DEFAULTS = {
maxInputLength: 100_000,
maxOutputLength: 100_000,
redactPii: false,
} as const;

export const AI_DEFAULTS = {
agent: AGENT_DEFAULTS,
streaming: STREAMING_DEFAULTS,
memory: MEMORY_DEFAULTS,
rateLimit: RATE_LIMIT_DEFAULTS,
costTracking: COST_TRACKING_DEFAULTS,
retry: RETRY_DEFAULTS,
workflow: WORKFLOW_DEFAULTS,
provider: PROVIDER_DEFAULTS,
security: SECURITY_DEFAULTS,
} as const;
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const DEFAULT_BROWSER_MAX_TOKENS = 512;
/** Default temperature for browser-side inference */
const DEFAULT_BROWSER_TEMPERATURE = 0.7;

export interface BrowserInferenceCallbacks {
interface BrowserInferenceCallbacks {
onUpdate: (parts: UIMessagePart[], messageId: string) => void;
onMessage: (message: UIMessage) => void;
onStatusChange: (status: BrowserInferenceStatus) => void;
Expand Down
12 changes: 6 additions & 6 deletions src/agent/react/use-chat/browser-inference/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Worker ↔ main thread message protocol for browser-side inference.
*/

export interface WorkerGenerateRequest {
interface WorkerGenerateRequest {
type: "generate";
id: string;
messages: Array<{ role: string; content: string }>;
Expand All @@ -15,30 +15,30 @@ export interface WorkerGenerateRequest {

export type WorkerRequest = WorkerGenerateRequest;

export interface WorkerStatusResponse {
interface WorkerStatusResponse {
type: "status";
status: "loading-runtime" | "downloading-model" | "ready" | "generating";
}

export interface WorkerDownloadProgressResponse {
interface WorkerDownloadProgressResponse {
type: "download-progress";
progress: number; // 0–100
file?: string;
}

export interface WorkerTokenResponse {
interface WorkerTokenResponse {
type: "token";
id: string;
token: string;
}

export interface WorkerDoneResponse {
interface WorkerDoneResponse {
type: "done";
id: string;
text: string;
}

export interface WorkerErrorResponse {
interface WorkerErrorResponse {
type: "error";
id: string;
error: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type { WorkerRequest, WorkerResponse } from "./types.ts";
import { WORKER_SCRIPT } from "./worker-script.ts";

export interface GenerateCallbacks {
interface GenerateCallbacks {
onStatus?: (status: "loading-runtime" | "downloading-model" | "ready" | "generating") => void;
onDownloadProgress?: (progress: number, file?: string) => void;
onToken?: (token: string) => void;
Expand Down
4 changes: 2 additions & 2 deletions src/agent/react/use-chat/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export type StreamState = "streaming" | "done";
type StreamState = "streaming" | "done";

/** Where inference is happening */
export type InferenceMode = "cloud" | "server-local" | "browser";
Expand Down Expand Up @@ -80,7 +80,7 @@ export interface UIMessage {
createdAt?: Date | string;
}

export type ToolOutputState = "output-available" | "output-error";
type ToolOutputState = "output-available" | "output-error";

export interface ToolOutput {
tool: string;
Expand Down
12 changes: 6 additions & 6 deletions src/build/asset-pipeline/image-optimizer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ export interface SharpMetadata {
hasAlpha?: boolean;
}

export type SharpResizeFit = "cover" | "contain" | "fill" | "inside" | "outside";
type SharpResizeFit = "cover" | "contain" | "fill" | "inside" | "outside";

export interface SharpResizeOptions {
interface SharpResizeOptions {
fit?: SharpResizeFit;
withoutEnlargement?: boolean;
}

export interface SharpWebpOptions {
interface SharpWebpOptions {
quality?: number;
}

export interface SharpAvifOptions {
interface SharpAvifOptions {
quality?: number;
}

export interface SharpJpegOptions {
interface SharpJpegOptions {
quality?: number;
progressive?: boolean;
}

export interface SharpPngOptions {
interface SharpPngOptions {
compressionLevel?: number;
adaptiveFiltering?: boolean;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
/** Default assumed image width when metadata has no width */
const DEFAULT_IMAGE_WIDTH = 1_920;

export function generateVariant(
function generateVariant(
sharp: SharpConstructor,
image: SharpInstance,
relPath: string,
Expand Down
2 changes: 1 addition & 1 deletion src/build/bundler/code-splitter/entry-points.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import type { SplitOptions } from "./types.ts";

export interface EntryPointsResult {
interface EntryPointsResult {
entryPoints: Record<string, string>;
routeMap: Map<string, string>;
}
Expand Down
2 changes: 1 addition & 1 deletion src/build/compiler/mdx-compiler/directory-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function compileAllMDX(options: CompileOptions): Promise<Map<string
return results;
}

export async function compileMDXDirectory(
async function compileMDXDirectory(
dir: string,
options: CompileOptions,
results: Map<string, CompileResult>,
Expand Down
2 changes: 1 addition & 1 deletion src/build/compiler/mdx-compiler/frontmatter-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { createError, toError } from "#veryfront/errors/veryfront-error.ts";
import { bundlerLogger as logger } from "#veryfront/utils";
import type { MDXFrontmatter } from "./types.ts";

export interface ParsedContent {
interface ParsedContent {
frontmatter: MDXFrontmatter;
content: string;
}
Expand Down
2 changes: 1 addition & 1 deletion src/build/compiler/mdx-compiler/mdx-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { CompileOptions } from "./types.ts";

type MDXPluggable = NonNullable<MDXCompileOptions["remarkPlugins"]>[number];

export interface ProcessedMDX {
interface ProcessedMDX {
code: string;
imports: string[];
}
Expand Down
2 changes: 1 addition & 1 deletion src/build/compiler/mdx-compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export interface CompileResult {
imports: string[];
}

export type UnifiedPlugin = unknown | [unknown, ...unknown[]];
type UnifiedPlugin = unknown | [unknown, ...unknown[]];
export type PluginList = UnifiedPlugin[];
2 changes: 1 addition & 1 deletion src/build/compiler/mdx-to-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export interface MDXFrontmatter {
[key: string]: unknown;
}

export interface CompileToJSOptions {
interface CompileToJSOptions {
projectDir: string;
mode: "development" | "production";
components?: string[];
Expand Down
2 changes: 1 addition & 1 deletion src/build/embedded/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { runtime } from "#veryfront/platform/adapters/detect.ts";
import type { EmbeddedBundleManifest } from "../renderer/types/bundler-types.ts";
import { createFileSystem } from "#veryfront/platform/compat/fs.ts";

export interface BuildEmbeddedOptions {
interface BuildEmbeddedOptions {
projectDir: string;
outDir: string;
runtime: "deno" | "node" | "bun";
Expand Down
7 changes: 0 additions & 7 deletions src/build/production-build/build/build-cleanup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ export async function cleanupCaches(): Promise<void> {
} catch (_) {
/* expected: transform cache module may not be available */
}

try {
const { destroyVendorCache } = await import("../../../build/vendor-cache.ts");
destroyVendorCache();
} catch (_) {
/* expected: vendor cache module may not be available */
}
}

export async function performCleanup(renderer: VeryfrontRenderer): Promise<void> {
Expand Down
10 changes: 5 additions & 5 deletions src/build/utils/file-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ export type ImageFormat = "jpeg" | "jpg" | "png" | "webp" | "avif" | "gif" | "sv
/**
* Supported script formats
*/
export type ScriptFormat = "js" | "jsx" | "ts" | "tsx" | "mjs" | "cjs";
type ScriptFormat = "js" | "jsx" | "ts" | "tsx" | "mjs" | "cjs";

/**
* Supported style formats
*/
export type StyleFormat = "css" | "scss" | "sass" | "less";
type StyleFormat = "css" | "scss" | "sass" | "less";

/**
* Supported document formats
*/
export type DocumentFormat = "md" | "mdx";
type DocumentFormat = "md" | "mdx";

/**
* All supported file extensions
Expand All @@ -38,7 +38,7 @@ export const FILE_EXTENSIONS = {
/**
* esbuild loader types mapping
*/
export const ESBUILD_LOADERS = {
const ESBUILD_LOADERS = {
".js": "js",
".jsx": "jsx",
".ts": "ts",
Expand Down Expand Up @@ -126,7 +126,7 @@ export function getEsbuildLoader(filePath: string): string {
/**
* Get file type category
*/
export type FileCategory = "image" | "script" | "style" | "document" | "other";
type FileCategory = "image" | "script" | "style" | "document" | "other";

export function getFileCategory(filePath: string): FileCategory {
if (isImageFile(filePath)) return "image";
Expand Down
Loading
Loading