@rizom/brain 0.2.0-alpha.47 → 0.2.0-alpha.48
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/brain.js +800 -800
- package/dist/deploy.d.ts +17 -26
- package/dist/entities.d.ts +509 -142
- package/dist/entities.js +2 -2
- package/dist/entities.js.map +6 -6
- package/dist/index.d.ts +60 -46
- package/dist/index.js +2 -501
- package/dist/index.js.map +4 -579
- package/dist/interfaces.d.ts +908 -112
- package/dist/interfaces.js +145 -145
- package/dist/interfaces.js.map +7 -83
- package/dist/plugins.d.ts +1078 -489
- package/dist/plugins.js +139 -139
- package/dist/plugins.js.map +30 -41
- package/dist/services.d.ts +551 -105
- package/dist/services.js +136 -136
- package/dist/services.js.map +40 -88
- package/dist/site.d.ts +56 -157
- package/dist/site.js +285 -285
- package/dist/site.js.map +47 -35
- package/dist/templates.d.ts +292 -52
- package/dist/themes.d.ts +5 -44
- package/package.json +3 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,50 +1,64 @@
|
|
|
1
|
-
/** Public
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
/** Public brain definition contract for external authors. */
|
|
2
|
+
type BrainEnvironment = Record<string, string | undefined>;
|
|
3
|
+
type PluginConfig = Record<string, unknown>;
|
|
4
|
+
interface Plugin {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly version: string;
|
|
7
|
+
readonly type: "core" | "entity" | "service" | "interface";
|
|
8
|
+
readonly packageName: string;
|
|
9
|
+
readonly description?: string;
|
|
10
|
+
readonly dependencies?: string[];
|
|
11
|
+
ready?(): Promise<void>;
|
|
12
|
+
shutdown?(): Promise<void>;
|
|
13
|
+
requiresDaemonStartup?(): boolean;
|
|
14
|
+
}
|
|
15
|
+
type CapabilityConfig = PluginConfig | ((env: BrainEnvironment) => PluginConfig) | undefined;
|
|
16
|
+
type PluginFactory = (config: PluginConfig) => Plugin | Plugin[];
|
|
17
|
+
type CapabilityEntry = [
|
|
18
|
+
id: string,
|
|
19
|
+
factory: PluginFactory,
|
|
20
|
+
config: CapabilityConfig
|
|
18
21
|
];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
type InterfaceConstructor = new (config: PluginConfig) => Plugin;
|
|
23
|
+
type InterfaceEntry = [
|
|
24
|
+
id: string,
|
|
25
|
+
constructor: InterfaceConstructor,
|
|
26
|
+
envMapper: (env: BrainEnvironment) => PluginConfig | null
|
|
24
27
|
];
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
values: string[];
|
|
28
|
+
type PresetName = "core" | "default" | "full";
|
|
29
|
+
type BrainMode = "eval";
|
|
30
|
+
interface BrainIdentity {
|
|
31
|
+
characterName: string;
|
|
32
|
+
role: string;
|
|
33
|
+
purpose: string;
|
|
34
|
+
values: string[];
|
|
33
35
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
36
|
+
interface BrainDefinition {
|
|
37
|
+
name: string;
|
|
38
|
+
version: string;
|
|
39
|
+
model?: string;
|
|
40
|
+
identity?: BrainIdentity;
|
|
41
|
+
site?: unknown;
|
|
42
|
+
theme?: string;
|
|
43
|
+
capabilities: CapabilityEntry[];
|
|
44
|
+
interfaces: InterfaceEntry[];
|
|
45
|
+
presets?: Partial<Record<PresetName, string[]>>;
|
|
46
|
+
defaultPreset?: PresetName;
|
|
47
|
+
permissions?: unknown;
|
|
48
|
+
deployment?: unknown;
|
|
49
|
+
evalDisable?: string[];
|
|
50
|
+
extra?: Record<string, unknown>;
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
declare function defineBrain(definition: BrainDefinition): BrainDefinition;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Pre-v1 external plugin API marker.
|
|
56
|
+
*
|
|
57
|
+
* During alpha, the external plugin API compatibility marker tracks the
|
|
58
|
+
* published @rizom/brain package version. Once the plugin API is declared
|
|
59
|
+
* stable, this can move to an independent semver contract such as 1.0.0.
|
|
60
|
+
*/
|
|
61
|
+
declare const PLUGIN_API_VERSION: string;
|
|
62
|
+
|
|
63
|
+
export { PLUGIN_API_VERSION, defineBrain };
|
|
64
|
+
export type { BrainDefinition, BrainEnvironment, BrainIdentity, BrainMode, CapabilityConfig, CapabilityEntry, InterfaceConstructor, InterfaceEntry, Plugin, PluginConfig, PluginFactory, PresetName };
|