@mozaik-ai/core 3.6.2 → 3.6.3
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/README.md +0 -54
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,60 +35,6 @@ flowchart LR
|
|
|
35
35
|
Env -->|onContextItem| Observer
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
The environment itself is intentionally minimal — it owns the subscriber list and the delivery loop, nothing more:
|
|
39
|
-
|
|
40
|
-
```16:31:src/domain/agentic-environment/agentic-environment.ts
|
|
41
|
-
deliverContextItem(source: Participant, item: ContextItem): void {
|
|
42
|
-
for (const subscriber of this.subscribers) {
|
|
43
|
-
subscriber.onContextItem(source, item)
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async start() {
|
|
48
|
-
this.isActive = true
|
|
49
|
-
while (this.isActive) {
|
|
50
|
-
await new Promise((resolve) => setTimeout(resolve, 100))
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
stop() {
|
|
55
|
-
this.isActive = false
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
A `Participant` is anything that can subscribe and receive items. The only required method is `onContextItem`:
|
|
60
|
-
|
|
61
|
-
```4:29:src/domain/agentic-environment/participant.ts
|
|
62
|
-
export abstract class Participant {
|
|
63
|
-
|
|
64
|
-
private environments: AgenticEnvironment[] = []
|
|
65
|
-
|
|
66
|
-
join(environment: AgenticEnvironment) {
|
|
67
|
-
if (this.isJoinedTo(environment)) {
|
|
68
|
-
return
|
|
69
|
-
}
|
|
70
|
-
environment.subscribe(this)
|
|
71
|
-
this.environments.push(environment)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
leave(environment: AgenticEnvironment) {
|
|
75
|
-
if (!this.isJoinedTo(environment)) {
|
|
76
|
-
return
|
|
77
|
-
}
|
|
78
|
-
environment.unsubscribe(this)
|
|
79
|
-
this.environments = this.environments.filter((e) => e !== environment)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
protected isJoinedTo(environment: AgenticEnvironment): boolean {
|
|
83
|
-
return this.environments.includes(environment)
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
abstract onContextItem(source: Participant, item: ContextItem): Promise<void>
|
|
87
|
-
}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Notice what's *not* there: no FSM, no hook bus, no per-participant queues, no orchestrator. Everything else in the framework is a participant or a generator that participants pull from.
|
|
91
|
-
|
|
92
38
|
---
|
|
93
39
|
|
|
94
40
|
## Non-blocking participants
|