@almadar/std 3.9.0 → 3.11.0
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/behaviors/behaviors-registry.json +15946 -0
- package/dist/behaviors/exports-reader.d.ts +4 -31
- package/dist/behaviors/exports-reader.js +21267 -40
- package/dist/behaviors/exports-reader.js.map +1 -1
- package/dist/behaviors/functions/index.js.map +1 -1
- package/dist/behaviors/index.d.ts +1 -0
- package/dist/behaviors/index.js +1043 -513
- package/dist/behaviors/index.js.map +1 -1
- package/dist/behaviors/query.d.ts +82 -0
- package/dist/behaviors/query.js +21396 -0
- package/dist/behaviors/query.js.map +1 -0
- package/dist/behaviors/types.d.ts +7 -14
- package/dist/behaviors/types.js.map +1 -1
- package/dist/behaviors-registry.json +15946 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1368 -512
- package/dist/index.js.map +1 -1
- package/dist/modules/agent.d.ts +21 -0
- package/dist/modules/agent.js +322 -0
- package/dist/modules/agent.js.map +1 -0
- package/dist/modules/array.d.ts +1 -1
- package/dist/modules/async.d.ts +1 -1
- package/dist/modules/contract.d.ts +1 -1
- package/dist/modules/data.d.ts +1 -1
- package/dist/modules/format.d.ts +1 -1
- package/dist/modules/graph.d.ts +1 -1
- package/dist/modules/index.d.ts +2 -1
- package/dist/modules/index.js +320 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/math.d.ts +1 -1
- package/dist/modules/nn.d.ts +1 -1
- package/dist/modules/object.d.ts +1 -1
- package/dist/modules/os.d.ts +1 -1
- package/dist/modules/prob.d.ts +1 -1
- package/dist/modules/str.d.ts +1 -1
- package/dist/modules/tensor.d.ts +1 -1
- package/dist/modules/time.d.ts +1 -1
- package/dist/modules/train.d.ts +1 -1
- package/dist/modules/validate.d.ts +1 -1
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +321 -2
- package/dist/registry.js.map +1 -1
- package/dist/{types-DOeGXRCm.d.ts → types-BjP5nVQd.d.ts} +3 -3
- package/package.json +2 -2
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Behavior Registry Query Helpers
|
|
3
|
+
*
|
|
4
|
+
* Programmatic access to behaviors-registry.json for filtering,
|
|
5
|
+
* searching, and summarizing behaviors. Used by @almadar/skills
|
|
6
|
+
* to compose agent prompts dynamically.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
interface RegistryEntry {
|
|
11
|
+
name: string;
|
|
12
|
+
level: 'atom' | 'molecule' | 'organism';
|
|
13
|
+
family: string;
|
|
14
|
+
layer: string;
|
|
15
|
+
description: string;
|
|
16
|
+
statePattern: string;
|
|
17
|
+
complexity: {
|
|
18
|
+
states: number;
|
|
19
|
+
events: number;
|
|
20
|
+
transitions: number;
|
|
21
|
+
};
|
|
22
|
+
defaultEntity: {
|
|
23
|
+
name: string;
|
|
24
|
+
persistence: string;
|
|
25
|
+
fields: Array<{
|
|
26
|
+
name: string;
|
|
27
|
+
type: string;
|
|
28
|
+
default?: string;
|
|
29
|
+
}>;
|
|
30
|
+
};
|
|
31
|
+
defaultLabels: {
|
|
32
|
+
title: string;
|
|
33
|
+
entitySingular: string;
|
|
34
|
+
entityPlural: string;
|
|
35
|
+
};
|
|
36
|
+
composableWith: string[];
|
|
37
|
+
connectableEvents: string[];
|
|
38
|
+
eventPayloads: Record<string, Array<{
|
|
39
|
+
name: string;
|
|
40
|
+
type: string;
|
|
41
|
+
required: boolean;
|
|
42
|
+
}>>;
|
|
43
|
+
}
|
|
44
|
+
interface BehaviorSummary {
|
|
45
|
+
name: string;
|
|
46
|
+
level: string;
|
|
47
|
+
description: string;
|
|
48
|
+
states: string[];
|
|
49
|
+
events: string[];
|
|
50
|
+
slots: string[];
|
|
51
|
+
patterns: string[];
|
|
52
|
+
complexity: {
|
|
53
|
+
states: number;
|
|
54
|
+
events: number;
|
|
55
|
+
transitions: number;
|
|
56
|
+
};
|
|
57
|
+
composableWith: string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Read and cache the behavior registry.
|
|
61
|
+
* Async to support bundled environments where fs may not be available.
|
|
62
|
+
*/
|
|
63
|
+
declare function getBehaviorRegistry(): Promise<Record<string, RegistryEntry>>;
|
|
64
|
+
/**
|
|
65
|
+
* Filter behaviors by domain. Matches against layer (primary) and family (fallback).
|
|
66
|
+
*/
|
|
67
|
+
declare function getBehaviorsByDomain(domain: string): Promise<RegistryEntry[]>;
|
|
68
|
+
/**
|
|
69
|
+
* Filter behaviors by connectable operations (events).
|
|
70
|
+
* Returns behaviors sorted by match count (most matching ops first).
|
|
71
|
+
*/
|
|
72
|
+
declare function getBehaviorsByOperations(ops: string[]): Promise<RegistryEntry[]>;
|
|
73
|
+
/**
|
|
74
|
+
* Fuzzy search across name, description, family, layer, and entity name.
|
|
75
|
+
*/
|
|
76
|
+
declare function searchBehaviors(query: string): Promise<RegistryEntry[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Get a compact summary of a behavior including slots and patterns from the .orb file.
|
|
79
|
+
*/
|
|
80
|
+
declare function getBehaviorSummary(name: string): Promise<BehaviorSummary | null>;
|
|
81
|
+
|
|
82
|
+
export { type BehaviorSummary, type RegistryEntry, getBehaviorRegistry, getBehaviorSummary, getBehaviorsByDomain, getBehaviorsByOperations, searchBehaviors };
|