@growthub/schemas
Version:
Zod schemas and TypeScript types for the Growthub Marketing OS
1,205 lines (1,202 loc) • 145 kB
TypeScript
import { z } from 'zod';
/**
* @growthub/schemas - Agent Compiler Schemas
*
* Pure Zod schemas for the agent compiler system including validation,
* orchestration, and decomposition. These schemas are stateless and contain
* no business logic - perfect for OSS.
*/
declare const CompilerContextSchema: z.ZodObject<{
userId: z.ZodString;
threadId: z.ZodString;
runId: z.ZodString;
jwtToken: z.ZodString;
timestamp: z.ZodString;
brandKitId: z.ZodOptional<z.ZodString>;
agentType: z.ZodOptional<z.ZodEnum<["CONTENT_GENERATION_AGENT", "TEXT_ANALYSIS_AGENT", "IMAGE_ANALYSIS_AGENT", "SOCIAL_MEDIA_AGENT", "EMAIL_MARKETING_AGENT", "SEO_OPTIMIZATION_AGENT", "BRAND_ANALYSIS_AGENT", "COMPETITOR_ANALYSIS_AGENT"]>>;
}, "strip", z.ZodTypeAny, {
userId: string;
threadId: string;
runId: string;
timestamp: string;
jwtToken: string;
agentType?: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT" | undefined;
brandKitId?: string | undefined;
}, {
userId: string;
threadId: string;
runId: string;
timestamp: string;
jwtToken: string;
agentType?: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT" | undefined;
brandKitId?: string | undefined;
}>;
type CompilerContext = z.infer<typeof CompilerContextSchema>;
declare const ValidationResultSchema: z.ZodObject<{
success: z.ZodBoolean;
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
errors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
success: boolean;
metadata?: Record<string, unknown> | undefined;
data?: Record<string, unknown> | undefined;
errors?: string[] | undefined;
}, {
success: boolean;
metadata?: Record<string, unknown> | undefined;
data?: Record<string, unknown> | undefined;
errors?: string[] | undefined;
}>;
declare const PreInitPayloadSchema: z.ZodObject<{
userId: z.ZodString;
threadId: z.ZodString;
runId: z.ZodString;
prompt: z.ZodString;
agentType: z.ZodEnum<["CONTENT_GENERATION_AGENT", "TEXT_ANALYSIS_AGENT", "IMAGE_ANALYSIS_AGENT", "SOCIAL_MEDIA_AGENT", "EMAIL_MARKETING_AGENT", "SEO_OPTIMIZATION_AGENT", "BRAND_ANALYSIS_AGENT", "COMPETITOR_ANALYSIS_AGENT"]>;
creativeCount: z.ZodNumber;
brandKitId: z.ZodOptional<z.ZodString>;
referenceImages: z.ZodOptional<z.ZodArray<z.ZodObject<{
url: z.ZodString;
description: z.ZodOptional<z.ZodString>;
weight: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
url: string;
weight: number;
description?: string | undefined;
}, {
url: string;
description?: string | undefined;
weight?: number | undefined;
}>, "many">>;
settings: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
userId: string;
threadId: string;
runId: string;
agentType: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT";
prompt: string;
creativeCount: number;
brandKitId?: string | undefined;
referenceImages?: {
url: string;
weight: number;
description?: string | undefined;
}[] | undefined;
settings?: Record<string, unknown> | undefined;
}, {
userId: string;
threadId: string;
runId: string;
agentType: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT";
prompt: string;
creativeCount: number;
brandKitId?: string | undefined;
referenceImages?: {
url: string;
description?: string | undefined;
weight?: number | undefined;
}[] | undefined;
settings?: Record<string, unknown> | undefined;
}>;
type ValidationResult = z.infer<typeof ValidationResultSchema>;
type PreInitPayload = z.infer<typeof PreInitPayloadSchema>;
declare const OrchestrationEventSchema: z.ZodObject<{
id: z.ZodString;
type: z.ZodEnum<["decomposition", "execution", "completion"]>;
userId: z.ZodString;
threadId: z.ZodString;
runId: z.ZodString;
agentType: z.ZodEnum<["CONTENT_GENERATION_AGENT", "TEXT_ANALYSIS_AGENT", "IMAGE_ANALYSIS_AGENT", "SOCIAL_MEDIA_AGENT", "EMAIL_MARKETING_AGENT", "SEO_OPTIMIZATION_AGENT", "BRAND_ANALYSIS_AGENT", "COMPETITOR_ANALYSIS_AGENT"]>;
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
metadata: z.ZodOptional<z.ZodObject<{
kvLock: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
brandContext: z.ZodOptional<z.ZodObject<{
brand_kit: z.ZodOptional<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
colors: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
fonts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
logo_url: z.ZodOptional<z.ZodString>;
guidelines: z.ZodOptional<z.ZodString>;
industry: z.ZodOptional<z.ZodString>;
brand_voice: z.ZodOptional<z.ZodEnum<["professional", "casual", "friendly", "authoritative", "playful", "luxurious"]>>;
target_audience: z.ZodOptional<z.ZodString>;
created_at: z.ZodOptional<z.ZodString>;
updated_at: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
}, {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
}>>;
selected_assets: z.ZodOptional<z.ZodArray<z.ZodObject<{
id: z.ZodOptional<z.ZodString>;
brand_kit_id: z.ZodString;
asset_type: z.ZodEnum<["logo", "product_photo", "lifestyle_image", "icon", "banner", "pattern", "texture"]>;
name: z.ZodString;
description: z.ZodOptional<z.ZodString>;
url: z.ZodString;
file_size: z.ZodOptional<z.ZodNumber>;
dimensions: z.ZodOptional<z.ZodObject<{
width: z.ZodNumber;
height: z.ZodNumber;
}, "strip", z.ZodTypeAny, {
width: number;
height: number;
}, {
width: number;
height: number;
}>>;
format: z.ZodEnum<["png", "jpg", "jpeg", "svg", "webp", "gif"]>;
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
is_primary: z.ZodDefault<z.ZodBoolean>;
created_at: z.ZodOptional<z.ZodString>;
updated_at: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
is_primary: boolean;
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
}, {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
is_primary?: boolean | undefined;
}>, "many">>;
brand_guidelines: z.ZodOptional<z.ZodString>;
style_preferences: z.ZodOptional<z.ZodObject<{
tone: z.ZodOptional<z.ZodString>;
style: z.ZodOptional<z.ZodString>;
mood: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
}, {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
}>>;
reference_images: z.ZodOptional<z.ZodArray<z.ZodObject<{
url: z.ZodString;
description: z.ZodOptional<z.ZodString>;
weight: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
url: string;
weight: number;
description?: string | undefined;
}, {
url: string;
description?: string | undefined;
weight?: number | undefined;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
brand_kit?: {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
} | undefined;
selected_assets?: {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
is_primary: boolean;
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
}[] | undefined;
brand_guidelines?: string | undefined;
style_preferences?: {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
} | undefined;
reference_images?: {
url: string;
weight: number;
description?: string | undefined;
}[] | undefined;
}, {
brand_kit?: {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
} | undefined;
selected_assets?: {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
is_primary?: boolean | undefined;
}[] | undefined;
brand_guidelines?: string | undefined;
style_preferences?: {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
} | undefined;
reference_images?: {
url: string;
description?: string | undefined;
weight?: number | undefined;
}[] | undefined;
}>>;
executionPlan: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
brandContext?: {
brand_kit?: {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
} | undefined;
selected_assets?: {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
is_primary: boolean;
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
}[] | undefined;
brand_guidelines?: string | undefined;
style_preferences?: {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
} | undefined;
reference_images?: {
url: string;
weight: number;
description?: string | undefined;
}[] | undefined;
} | undefined;
kvLock?: Record<string, unknown> | undefined;
executionPlan?: Record<string, unknown> | undefined;
}, {
brandContext?: {
brand_kit?: {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
} | undefined;
selected_assets?: {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
is_primary?: boolean | undefined;
}[] | undefined;
brand_guidelines?: string | undefined;
style_preferences?: {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
} | undefined;
reference_images?: {
url: string;
description?: string | undefined;
weight?: number | undefined;
}[] | undefined;
} | undefined;
kvLock?: Record<string, unknown> | undefined;
executionPlan?: Record<string, unknown> | undefined;
}>>;
timestamp: z.ZodString;
priority: z.ZodDefault<z.ZodEnum<["low", "normal", "high"]>>;
}, "strip", z.ZodTypeAny, {
id: string;
type: "completion" | "decomposition" | "execution";
userId: string;
threadId: string;
runId: string;
agentType: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT";
timestamp: string;
payload: Record<string, unknown>;
priority: "low" | "normal" | "high";
metadata?: {
brandContext?: {
brand_kit?: {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
} | undefined;
selected_assets?: {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
is_primary: boolean;
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
}[] | undefined;
brand_guidelines?: string | undefined;
style_preferences?: {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
} | undefined;
reference_images?: {
url: string;
weight: number;
description?: string | undefined;
}[] | undefined;
} | undefined;
kvLock?: Record<string, unknown> | undefined;
executionPlan?: Record<string, unknown> | undefined;
} | undefined;
}, {
id: string;
type: "completion" | "decomposition" | "execution";
userId: string;
threadId: string;
runId: string;
agentType: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT";
timestamp: string;
payload: Record<string, unknown>;
metadata?: {
brandContext?: {
brand_kit?: {
name: string;
id?: string | undefined;
description?: string | undefined;
colors?: string[] | undefined;
fonts?: string[] | undefined;
logo_url?: string | undefined;
guidelines?: string | undefined;
industry?: string | undefined;
brand_voice?: "professional" | "casual" | "friendly" | "authoritative" | "playful" | "luxurious" | undefined;
target_audience?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
} | undefined;
selected_assets?: {
name: string;
brand_kit_id: string;
asset_type: "logo" | "product_photo" | "lifestyle_image" | "icon" | "banner" | "pattern" | "texture";
url: string;
format: "png" | "jpg" | "jpeg" | "svg" | "webp" | "gif";
id?: string | undefined;
description?: string | undefined;
created_at?: string | undefined;
updated_at?: string | undefined;
file_size?: number | undefined;
dimensions?: {
width: number;
height: number;
} | undefined;
tags?: string[] | undefined;
is_primary?: boolean | undefined;
}[] | undefined;
brand_guidelines?: string | undefined;
style_preferences?: {
tone?: string | undefined;
style?: string | undefined;
mood?: string | undefined;
} | undefined;
reference_images?: {
url: string;
description?: string | undefined;
weight?: number | undefined;
}[] | undefined;
} | undefined;
kvLock?: Record<string, unknown> | undefined;
executionPlan?: Record<string, unknown> | undefined;
} | undefined;
priority?: "low" | "normal" | "high" | undefined;
}>;
declare const OrchestrationDecisionSchema: z.ZodObject<{
shouldDecompose: z.ZodBoolean;
executionPath: z.ZodEnum<["direct", "decomposed", "hybrid"]>;
estimatedComplexity: z.ZodNumber;
resourceRequirements: z.ZodArray<z.ZodString, "many">;
parallelizable: z.ZodBoolean;
dependencies: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
shouldDecompose: boolean;
executionPath: "direct" | "decomposed" | "hybrid";
estimatedComplexity: number;
resourceRequirements: string[];
parallelizable: boolean;
dependencies?: string[] | undefined;
}, {
shouldDecompose: boolean;
executionPath: "direct" | "decomposed" | "hybrid";
estimatedComplexity: number;
resourceRequirements: string[];
parallelizable: boolean;
dependencies?: string[] | undefined;
}>;
type OrchestrationEvent = z.infer<typeof OrchestrationEventSchema>;
type OrchestrationDecision = z.infer<typeof OrchestrationDecisionSchema>;
declare const DecompositionStepSchema: z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
type: z.ZodEnum<["analysis", "generation", "validation", "completion"]>;
description: z.ZodString;
dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
estimatedDuration: z.ZodNumber;
priority: z.ZodDefault<z.ZodNumber>;
parallelizable: z.ZodDefault<z.ZodBoolean>;
resources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
description: string;
type: "validation" | "analysis" | "completion" | "generation";
priority: number;
parallelizable: boolean;
dependencies: string[];
estimatedDuration: number;
resources: string[];
metadata?: Record<string, unknown> | undefined;
}, {
id: string;
name: string;
description: string;
type: "validation" | "analysis" | "completion" | "generation";
estimatedDuration: number;
metadata?: Record<string, unknown> | undefined;
priority?: number | undefined;
parallelizable?: boolean | undefined;
dependencies?: string[] | undefined;
resources?: string[] | undefined;
}>;
declare const DecompositionPlanSchema: z.ZodObject<{
id: z.ZodString;
agentType: z.ZodEnum<["CONTENT_GENERATION_AGENT", "TEXT_ANALYSIS_AGENT", "IMAGE_ANALYSIS_AGENT", "SOCIAL_MEDIA_AGENT", "EMAIL_MARKETING_AGENT", "SEO_OPTIMIZATION_AGENT", "BRAND_ANALYSIS_AGENT", "COMPETITOR_ANALYSIS_AGENT"]>;
steps: z.ZodArray<z.ZodObject<{
id: z.ZodString;
name: z.ZodString;
type: z.ZodEnum<["analysis", "generation", "validation", "completion"]>;
description: z.ZodString;
dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
estimatedDuration: z.ZodNumber;
priority: z.ZodDefault<z.ZodNumber>;
parallelizable: z.ZodDefault<z.ZodBoolean>;
resources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
id: string;
name: string;
description: string;
type: "validation" | "analysis" | "completion" | "generation";
priority: number;
parallelizable: boolean;
dependencies: string[];
estimatedDuration: number;
resources: string[];
metadata?: Record<string, unknown> | undefined;
}, {
id: string;
name: string;
description: string;
type: "validation" | "analysis" | "completion" | "generation";
estimatedDuration: number;
metadata?: Record<string, unknown> | undefined;
priority?: number | undefined;
parallelizable?: boolean | undefined;
dependencies?: string[] | undefined;
resources?: string[] | undefined;
}>, "many">;
context: z.ZodObject<{
brandKit: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
assets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
sequencing: z.ZodEnum<["parallel", "sequential"]>;
userPrompt: z.ZodString;
referenceImages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
sequencing: "parallel" | "sequential";
userPrompt: string;
assets?: string[] | undefined;
referenceImages?: string[] | undefined;
brandKit?: Record<string, unknown> | undefined;
}, {
sequencing: "parallel" | "sequential";
userPrompt: string;
assets?: string[] | undefined;
referenceImages?: string[] | undefined;
brandKit?: Record<string, unknown> | undefined;
}>;
metadata: z.ZodObject<{
totalSteps: z.ZodNumber;
estimatedDuration: z.ZodNumber;
complexity: z.ZodNumber;
resourceRequirements: z.ZodArray<z.ZodString, "many">;
}, "strip", z.ZodTypeAny, {
totalSteps: number;
resourceRequirements: string[];
estimatedDuration: number;
complexity: number;
}, {
totalSteps: number;
resourceRequirements: string[];
estimatedDuration: number;
complexity: number;
}>;
createdAt: z.ZodString;
}, "strip", z.ZodTypeAny, {
id: string;
agentType: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT";
metadata: {
totalSteps: number;
resourceRequirements: string[];
estimatedDuration: number;
complexity: number;
};
steps: {
id: string;
name: string;
description: string;
type: "validation" | "analysis" | "completion" | "generation";
priority: number;
parallelizable: boolean;
dependencies: string[];
estimatedDuration: number;
resources: string[];
metadata?: Record<string, unknown> | undefined;
}[];
context: {
sequencing: "parallel" | "sequential";
userPrompt: string;
assets?: string[] | undefined;
referenceImages?: string[] | undefined;
brandKit?: Record<string, unknown> | undefined;
};
createdAt: string;
}, {
id: string;
agentType: "CONTENT_GENERATION_AGENT" | "TEXT_ANALYSIS_AGENT" | "IMAGE_ANALYSIS_AGENT" | "SOCIAL_MEDIA_AGENT" | "EMAIL_MARKETING_AGENT" | "SEO_OPTIMIZATION_AGENT" | "BRAND_ANALYSIS_AGENT" | "COMPETITOR_ANALYSIS_AGENT";
metadata: {
totalSteps: number;
resourceRequirements: string[];
estimatedDuration: number;
complexity: number;
};
steps: {
id: string;
name: string;
description: string;
type: "validation" | "analysis" | "completion" | "generation";
estimatedDuration: number;
metadata?: Record<string, unknown> | undefined;
priority?: number | undefined;
parallelizable?: boolean | undefined;
dependencies?: string[] | undefined;
resources?: string[] | undefined;
}[];
context: {
sequencing: "parallel" | "sequential";
userPrompt: string;
assets?: string[] | undefined;
referenceImages?: string[] | undefined;
brandKit?: Record<string, unknown> | undefined;
};
createdAt: string;
}>;
type DecompositionStep = z.infer<typeof DecompositionStepSchema>;
type DecompositionPlan = z.infer<typeof DecompositionPlanSchema>;
declare const StatusMetadataSchema: z.ZodObject<{
executionStats: z.ZodOptional<z.ZodObject<{
totalTasks: z.ZodNumber;
completedTasks: z.ZodNumber;
failedTasks: z.ZodNumber;
averageExecutionTime: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}>>;
resourceUsage: z.ZodOptional<z.ZodObject<{
memoryUsage: z.ZodOptional<z.ZodNumber>;
cpuUsage: z.ZodOptional<z.ZodNumber>;
networkCalls: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}>>;
lastUpdate: z.ZodString;
debugInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}>;
declare const CompilerThreadExecutionStatusSchema: z.ZodObject<{
threadId: z.ZodString;
userId: z.ZodString;
status: z.ZodEnum<["idle", "running", "completed", "failed", "cancelled"]>;
executionPhase: z.ZodOptional<z.ZodEnum<["init", "decomposition", "execution", "completion"]>>;
currentStep: z.ZodOptional<z.ZodString>;
totalSteps: z.ZodOptional<z.ZodNumber>;
completedSteps: z.ZodOptional<z.ZodNumber>;
progress: z.ZodOptional<z.ZodNumber>;
runningMessages: z.ZodOptional<z.ZodNumber>;
shouldEnableRealtime: z.ZodBoolean;
shouldSwitchToHistorical: z.ZodBoolean;
metadata: z.ZodOptional<z.ZodObject<{
executionStats: z.ZodOptional<z.ZodObject<{
totalTasks: z.ZodNumber;
completedTasks: z.ZodNumber;
failedTasks: z.ZodNumber;
averageExecutionTime: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}>>;
resourceUsage: z.ZodOptional<z.ZodObject<{
memoryUsage: z.ZodOptional<z.ZodNumber>;
cpuUsage: z.ZodOptional<z.ZodNumber>;
networkCalls: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}>>;
lastUpdate: z.ZodString;
debugInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}>>;
startedAt: z.ZodOptional<z.ZodString>;
completedAt: z.ZodOptional<z.ZodString>;
error: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
status: "running" | "completed" | "failed" | "idle" | "cancelled";
userId: string;
threadId: string;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
completedSteps?: number | undefined;
totalSteps?: number | undefined;
currentStep?: string | undefined;
progress?: number | undefined;
metadata?: {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
} | undefined;
startedAt?: string | undefined;
completedAt?: string | undefined;
error?: string | undefined;
executionPhase?: "completion" | "decomposition" | "execution" | "init" | undefined;
runningMessages?: number | undefined;
}, {
status: "running" | "completed" | "failed" | "idle" | "cancelled";
userId: string;
threadId: string;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
completedSteps?: number | undefined;
totalSteps?: number | undefined;
currentStep?: string | undefined;
progress?: number | undefined;
metadata?: {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
} | undefined;
startedAt?: string | undefined;
completedAt?: string | undefined;
error?: string | undefined;
executionPhase?: "completion" | "decomposition" | "execution" | "init" | undefined;
runningMessages?: number | undefined;
}>;
declare const ThreadAnalysisResultSchema: z.ZodObject<{
executionStatus: z.ZodObject<{
threadId: z.ZodString;
userId: z.ZodString;
status: z.ZodEnum<["idle", "running", "completed", "failed", "cancelled"]>;
executionPhase: z.ZodOptional<z.ZodEnum<["init", "decomposition", "execution", "completion"]>>;
currentStep: z.ZodOptional<z.ZodString>;
totalSteps: z.ZodOptional<z.ZodNumber>;
completedSteps: z.ZodOptional<z.ZodNumber>;
progress: z.ZodOptional<z.ZodNumber>;
runningMessages: z.ZodOptional<z.ZodNumber>;
shouldEnableRealtime: z.ZodBoolean;
shouldSwitchToHistorical: z.ZodBoolean;
metadata: z.ZodOptional<z.ZodObject<{
executionStats: z.ZodOptional<z.ZodObject<{
totalTasks: z.ZodNumber;
completedTasks: z.ZodNumber;
failedTasks: z.ZodNumber;
averageExecutionTime: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}>>;
resourceUsage: z.ZodOptional<z.ZodObject<{
memoryUsage: z.ZodOptional<z.ZodNumber>;
cpuUsage: z.ZodOptional<z.ZodNumber>;
networkCalls: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}>>;
lastUpdate: z.ZodString;
debugInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}>>;
startedAt: z.ZodOptional<z.ZodString>;
completedAt: z.ZodOptional<z.ZodString>;
error: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
status: "running" | "completed" | "failed" | "idle" | "cancelled";
userId: string;
threadId: string;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
completedSteps?: number | undefined;
totalSteps?: number | undefined;
currentStep?: string | undefined;
progress?: number | undefined;
metadata?: {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
} | undefined;
startedAt?: string | undefined;
completedAt?: string | undefined;
error?: string | undefined;
executionPhase?: "completion" | "decomposition" | "execution" | "init" | undefined;
runningMessages?: number | undefined;
}, {
status: "running" | "completed" | "failed" | "idle" | "cancelled";
userId: string;
threadId: string;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
completedSteps?: number | undefined;
totalSteps?: number | undefined;
currentStep?: string | undefined;
progress?: number | undefined;
metadata?: {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
} | undefined;
startedAt?: string | undefined;
completedAt?: string | undefined;
error?: string | undefined;
executionPhase?: "completion" | "decomposition" | "execution" | "init" | undefined;
runningMessages?: number | undefined;
}>;
runningMessages: z.ZodNumber;
shouldEnableRealtime: z.ZodBoolean;
shouldSwitchToHistorical: z.ZodBoolean;
metadata: z.ZodOptional<z.ZodObject<{
executionStats: z.ZodOptional<z.ZodObject<{
totalTasks: z.ZodNumber;
completedTasks: z.ZodNumber;
failedTasks: z.ZodNumber;
averageExecutionTime: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}, {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
}>>;
resourceUsage: z.ZodOptional<z.ZodObject<{
memoryUsage: z.ZodOptional<z.ZodNumber>;
cpuUsage: z.ZodOptional<z.ZodNumber>;
networkCalls: z.ZodOptional<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}, {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
}>>;
lastUpdate: z.ZodString;
debugInfo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
}, "strip", z.ZodTypeAny, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}, {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
runningMessages: number;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
executionStatus: {
status: "running" | "completed" | "failed" | "idle" | "cancelled";
userId: string;
threadId: string;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
completedSteps?: number | undefined;
totalSteps?: number | undefined;
currentStep?: string | undefined;
progress?: number | undefined;
metadata?: {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
} | undefined;
startedAt?: string | undefined;
completedAt?: string | undefined;
error?: string | undefined;
executionPhase?: "completion" | "decomposition" | "execution" | "init" | undefined;
runningMessages?: number | undefined;
};
metadata?: {
lastUpdate: string;
executionStats?: {
totalTasks: number;
completedTasks: number;
failedTasks: number;
averageExecutionTime?: number | undefined;
} | undefined;
resourceUsage?: {
memoryUsage?: number | undefined;
cpuUsage?: number | undefined;
networkCalls?: number | undefined;
} | undefined;
debugInfo?: Record<string, unknown> | undefined;
} | undefined;
}, {
runningMessages: number;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
executionStatus: {
status: "running" | "completed" | "failed" | "idle" | "cancelled";
userId: string;
threadId: string;
shouldEnableRealtime: boolean;
shouldSwitchToHistorical: boolean;
completedSteps?: number | undefined;
totalSteps?: number | undefined;
currentStep?: string | undefined;