@rizom/brain 0.2.0-alpha.45 → 0.2.0-alpha.47

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.
@@ -0,0 +1,50 @@
1
+ /** Public root library export for brain definitions and plugin API compatibility. */
2
+
3
+ import type { Plugin } from "./plugins";
4
+
5
+ export const PLUGIN_API_VERSION: string;
6
+
7
+ export type BrainEnvironment = Record<string, string | undefined>;
8
+ export type PluginConfig = Record<string, unknown>;
9
+ export type CapabilityConfig =
10
+ | PluginConfig
11
+ | ((env: BrainEnvironment) => PluginConfig)
12
+ | undefined;
13
+ export type PluginFactory = (config: PluginConfig) => Plugin | Plugin[];
14
+ export type CapabilityEntry = [
15
+ id: string,
16
+ factory: PluginFactory,
17
+ config: CapabilityConfig,
18
+ ];
19
+ export type InterfaceConstructor = new (config: PluginConfig) => Plugin;
20
+ export type InterfaceEntry = [
21
+ id: string,
22
+ constructor: InterfaceConstructor,
23
+ envMapper: (env: BrainEnvironment) => PluginConfig | null,
24
+ ];
25
+ export type PresetName = "core" | "default" | "full";
26
+ export type BrainMode = "eval";
27
+
28
+ export interface BrainIdentity {
29
+ characterName: string;
30
+ role: string;
31
+ purpose: string;
32
+ values: string[];
33
+ }
34
+ export interface BrainDefinition {
35
+ name: string;
36
+ version: string;
37
+ model?: string;
38
+ identity?: BrainIdentity;
39
+ site?: unknown;
40
+ theme?: string;
41
+ capabilities: CapabilityEntry[];
42
+ interfaces: InterfaceEntry[];
43
+ presets?: Partial<Record<PresetName, string[]>>;
44
+ defaultPreset?: PresetName;
45
+ permissions?: unknown;
46
+ deployment?: unknown;
47
+ evalDisable?: string[];
48
+ extra?: Record<string, unknown>;
49
+ }
50
+ export function defineBrain(definition: BrainDefinition): BrainDefinition;