@mozaik-ai/core 4.2.0-beta.16 → 4.2.0-beta.18
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/index.d.mts +31 -29
- package/dist/index.d.ts +31 -29
- package/dist/index.js +9 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -28,9 +28,13 @@ var MessageSentEvent = class extends SpaceEvent {
|
|
|
28
28
|
|
|
29
29
|
// src/domain/space/participant.ts
|
|
30
30
|
var Participant = class {
|
|
31
|
-
constructor(manifest, handlers) {
|
|
31
|
+
constructor(manifest, handlers, self) {
|
|
32
32
|
this.manifest = manifest;
|
|
33
33
|
this.handlers = handlers;
|
|
34
|
+
this._self = self;
|
|
35
|
+
}
|
|
36
|
+
get self() {
|
|
37
|
+
return this._self;
|
|
34
38
|
}
|
|
35
39
|
getManifest() {
|
|
36
40
|
return this.manifest;
|
|
@@ -65,14 +69,14 @@ var UuidGenerator = class {
|
|
|
65
69
|
|
|
66
70
|
// src/application/use-cases/create-participant.ts
|
|
67
71
|
var CreateParticipantUseCase = class {
|
|
68
|
-
async execute(name, capabilities, handlers) {
|
|
72
|
+
async execute(name, capabilities, handlers, self) {
|
|
69
73
|
const manifest = {
|
|
70
74
|
id: UuidGenerator.create(),
|
|
71
75
|
name,
|
|
72
76
|
capabilities,
|
|
73
77
|
role: "external"
|
|
74
78
|
};
|
|
75
|
-
const participant = new Participant(manifest, handlers);
|
|
79
|
+
const participant = new Participant(manifest, handlers, self);
|
|
76
80
|
return participant;
|
|
77
81
|
}
|
|
78
82
|
};
|
|
@@ -269,8 +273,8 @@ function defineRuntime() {
|
|
|
269
273
|
return runtime;
|
|
270
274
|
}
|
|
271
275
|
const createParticipantUseCase = new CreateParticipantUseCase();
|
|
272
|
-
const createParticipant = async (name, capabilities, handlers) => {
|
|
273
|
-
return await createParticipantUseCase.execute(name, capabilities, handlers);
|
|
276
|
+
const createParticipant = async (name, capabilities, handlers, self) => {
|
|
277
|
+
return await createParticipantUseCase.execute(name, capabilities, handlers, self);
|
|
274
278
|
};
|
|
275
279
|
const spaceRepository = new InMemorySpaceRepository();
|
|
276
280
|
const eventPublisher = new EventPublisher();
|