@mozaik-ai/core 4.2.0-beta.5 → 4.2.0-beta.7
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 +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -97,7 +97,7 @@ declare function defineRuntime<TSharedState extends SharedState>(): {
|
|
|
97
97
|
resolveRuntime: () => RuntimeService<TSharedState>;
|
|
98
98
|
createParticipant: (name: string, capabilities: readonly string[], handlers: SituationHandler[]) => Promise<Participant>;
|
|
99
99
|
createSpace: (name: string) => Promise<Space>;
|
|
100
|
-
join: (spaceId: string,
|
|
100
|
+
join: (spaceId: string, participant: Participant) => Promise<void>;
|
|
101
101
|
leave: (spaceId: string, participantId: string) => Promise<void>;
|
|
102
102
|
sendMessage: (spaceId: string, participantId: string, message: string) => Promise<void>;
|
|
103
103
|
sendMessageTool: FunctionTool;
|
|
@@ -453,4 +453,4 @@ declare function defineAgentModule(config: AgentModuleConfig): {
|
|
|
453
453
|
runLoop: (loopId: string) => Promise<Loop>;
|
|
454
454
|
};
|
|
455
455
|
|
|
456
|
-
export { Agent, type AgentModuleConfig, type AgentRepository, type GenerativeModel, type InferenceRunner, type InferenceRunnerConfig, type LoopRepository, Participant, type SharedState, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, SpaceEvent, type Tool, type ToolUseRunner, defineAgentModule, defineRuntime };
|
|
456
|
+
export { Agent, type AgentModuleConfig, type AgentRepository, type GenerativeModel, type InferenceRunner, type InferenceRunnerConfig, type LoopRepository, type ModelMessageItem, Participant, type SharedState, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, SpaceEvent, type Tool, type ToolUseRequest, type ToolUseResult, type ToolUseRunner, defineAgentModule, defineRuntime };
|
package/dist/index.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ declare function defineRuntime<TSharedState extends SharedState>(): {
|
|
|
97
97
|
resolveRuntime: () => RuntimeService<TSharedState>;
|
|
98
98
|
createParticipant: (name: string, capabilities: readonly string[], handlers: SituationHandler[]) => Promise<Participant>;
|
|
99
99
|
createSpace: (name: string) => Promise<Space>;
|
|
100
|
-
join: (spaceId: string,
|
|
100
|
+
join: (spaceId: string, participant: Participant) => Promise<void>;
|
|
101
101
|
leave: (spaceId: string, participantId: string) => Promise<void>;
|
|
102
102
|
sendMessage: (spaceId: string, participantId: string, message: string) => Promise<void>;
|
|
103
103
|
sendMessageTool: FunctionTool;
|
|
@@ -453,4 +453,4 @@ declare function defineAgentModule(config: AgentModuleConfig): {
|
|
|
453
453
|
runLoop: (loopId: string) => Promise<Loop>;
|
|
454
454
|
};
|
|
455
455
|
|
|
456
|
-
export { Agent, type AgentModuleConfig, type AgentRepository, type GenerativeModel, type InferenceRunner, type InferenceRunnerConfig, type LoopRepository, Participant, type SharedState, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, SpaceEvent, type Tool, type ToolUseRunner, defineAgentModule, defineRuntime };
|
|
456
|
+
export { Agent, type AgentModuleConfig, type AgentRepository, type GenerativeModel, type InferenceRunner, type InferenceRunnerConfig, type LoopRepository, type ModelMessageItem, Participant, type SharedState, type SituationContext, type SituationHandler, type SituationProcessor, SituationSpecification, SpaceEvent, type Tool, type ToolUseRequest, type ToolUseResult, type ToolUseRunner, defineAgentModule, defineRuntime };
|
package/dist/index.js
CHANGED
|
@@ -118,20 +118,20 @@ var CreateParticipantUseCase = class {
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
// src/application/use-cases/participant-
|
|
122
|
-
var
|
|
121
|
+
// src/application/use-cases/participant-join.ts
|
|
122
|
+
var ParticipantJoinUseCase = class {
|
|
123
123
|
constructor(spaceRepository, eventPublisher) {
|
|
124
124
|
this.spaceRepository = spaceRepository;
|
|
125
125
|
this.eventPublisher = eventPublisher;
|
|
126
126
|
}
|
|
127
|
-
async execute(spaceId,
|
|
127
|
+
async execute(spaceId, participant) {
|
|
128
128
|
const space = await this.spaceRepository.findById(spaceId);
|
|
129
129
|
if (!space) {
|
|
130
130
|
throw new Error("Space not found");
|
|
131
131
|
}
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
throw new Error("Participant
|
|
132
|
+
const existingParticipant = space.getParticipant(participant.getId());
|
|
133
|
+
if (existingParticipant) {
|
|
134
|
+
throw new Error("Participant already joined");
|
|
135
135
|
}
|
|
136
136
|
const event = space.addParticipant(participant);
|
|
137
137
|
if (event) {
|
|
@@ -170,8 +170,8 @@ var EventPublisher = class {
|
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
172
|
|
|
173
|
-
// src/application/use-cases/participant-
|
|
174
|
-
var
|
|
173
|
+
// src/application/use-cases/participant-leave.ts
|
|
174
|
+
var ParticipantLeaveUseCase = class {
|
|
175
175
|
constructor(spaceRepository, eventPublisher) {
|
|
176
176
|
this.spaceRepository = spaceRepository;
|
|
177
177
|
this.eventPublisher = eventPublisher;
|
|
@@ -322,11 +322,11 @@ function defineRuntime() {
|
|
|
322
322
|
const createSpace = async (name) => {
|
|
323
323
|
return await createSpaceUseCase.execute(name);
|
|
324
324
|
};
|
|
325
|
-
const participantJoinedUseCase = new
|
|
326
|
-
const join = async (spaceId,
|
|
327
|
-
return await participantJoinedUseCase.execute(spaceId,
|
|
325
|
+
const participantJoinedUseCase = new ParticipantJoinUseCase(spaceRepository, eventPublisher);
|
|
326
|
+
const join = async (spaceId, participant) => {
|
|
327
|
+
return await participantJoinedUseCase.execute(spaceId, participant);
|
|
328
328
|
};
|
|
329
|
-
const participantLeftUseCase = new
|
|
329
|
+
const participantLeftUseCase = new ParticipantLeaveUseCase(spaceRepository, eventPublisher);
|
|
330
330
|
const leave = async (spaceId, participantId) => {
|
|
331
331
|
return await participantLeftUseCase.execute(spaceId, participantId);
|
|
332
332
|
};
|