@rizom/brain 0.2.0-alpha.146 → 0.2.0-alpha.147

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/plugins.d.ts CHANGED
@@ -124,6 +124,23 @@ declare const AgentResponseSchema: z.ZodType<AgentResponse, AgentResponse>;
124
124
  type MessageRole = "user" | "assistant";
125
125
  declare const messageRoleSchema: z.ZodType<MessageRole, MessageRole>;
126
126
 
127
+ /**
128
+ * Query response schemas used throughout the system
129
+ */
130
+ interface DefaultQuerySource {
131
+ id: string;
132
+ type: string;
133
+ excerpt?: string | undefined;
134
+ relevance?: number | undefined;
135
+ }
136
+ interface DefaultQueryResponse {
137
+ message: string;
138
+ summary?: string | undefined;
139
+ topics?: string[] | undefined;
140
+ sources?: DefaultQuerySource[] | undefined;
141
+ metadata?: Record<string, unknown> | undefined;
142
+ }
143
+
127
144
  /**
128
145
  * Options for entity mutation operations (create, update, upsert)
129
146
  */
@@ -757,6 +774,16 @@ declare const entityCountSchema: z.ZodObject<{
757
774
  entityType: z.ZodString;
758
775
  count: z.ZodNumber;
759
776
  }>;
777
+ /**
778
+ * Content generation configuration - unified config object
779
+ */
780
+ interface ContentGenerationConfig {
781
+ prompt: string;
782
+ templateName: string;
783
+ conversationHistory?: string;
784
+ data?: Record<string, unknown>;
785
+ interfacePermissionGrant?: UserPermissionLevel;
786
+ }
760
787
 
761
788
  declare const DaemonHealthSchema: z.ZodObject<{
762
789
  status: z.ZodEnum<{
@@ -908,6 +935,33 @@ interface MessageContext {
908
935
  threadId?: string;
909
936
  }
910
937
 
938
+ type AIGenerationSchema<T> = ZodType<T>;
939
+ type AspectRatio = "1:1" | "16:9" | "9:16" | "4:3" | "3:4";
940
+ interface ImageGenerationOptions {
941
+ aspectRatio?: AspectRatio;
942
+ }
943
+ interface ImageGenerationResult {
944
+ base64: string;
945
+ dataUrl: string;
946
+ }
947
+ /**
948
+ * AI namespace for entity plugins — includes generation capabilities
949
+ */
950
+ interface IEntityAINamespace {
951
+ /** Query the AI with optional context */
952
+ query: (prompt: string, context?: Record<string, unknown>) => Promise<DefaultQueryResponse>;
953
+ /** Generate content using AI with template */
954
+ generate: <T = unknown>(config: ContentGenerationConfig) => Promise<T>;
955
+ /** Generate a structured object using AI with a schema parser */
956
+ generateObject: <T>(prompt: string, schema: AIGenerationSchema<T>) => Promise<{
957
+ object: T;
958
+ }>;
959
+ /** Generate an image using AI (requires AI_API_KEY) */
960
+ generateImage: (prompt: string, options?: ImageGenerationOptions) => Promise<ImageGenerationResult>;
961
+ /** Check if image generation is available */
962
+ canGenerateImages: () => boolean;
963
+ }
964
+
911
965
  type PluginConfig = Record<string, unknown>;
912
966
  type PluginConfigInput<T extends {
913
967
  _input: unknown;
@@ -1200,6 +1254,7 @@ interface ServicePluginContext extends BasePluginContext {
1200
1254
  readonly templates: IServiceTemplatesNamespace;
1201
1255
  readonly views: IViewsNamespace;
1202
1256
  readonly prompts: IPromptsNamespace;
1257
+ readonly ai: IEntityAINamespace;
1203
1258
  registerInstructions(instructions: string): void;
1204
1259
  }
1205
1260
  interface EntityPluginContext extends BasePluginContext {