@mozaik-ai/core 4.2.0-beta.8 → 4.2.0-beta.9

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.mjs CHANGED
@@ -364,28 +364,40 @@ var NotSituationSpecification = class extends SituationSpecification {
364
364
  };
365
365
 
366
366
  // src/domain/agent/agent.ts
367
- var Agent = class _Agent extends Participant {
368
- constructor(manifest, tools, memory, handlers) {
369
- super(manifest, handlers);
370
- this.memory = memory;
371
- this.tools = tools;
367
+ var Agent = class _Agent {
368
+ constructor(id, name, instruction, tools, memory) {
369
+ this._id = id;
370
+ this._name = name;
371
+ this._instruction = instruction;
372
+ this._memory = memory;
373
+ this._tools = tools;
374
+ }
375
+ get id() {
376
+ return this._id;
372
377
  }
373
- getTools() {
374
- return this.tools;
378
+ get name() {
379
+ return this._name;
375
380
  }
376
- getMemory() {
377
- return this.memory;
381
+ get instruction() {
382
+ return this._instruction;
383
+ }
384
+ get tools() {
385
+ return this._tools;
386
+ }
387
+ get memory() {
388
+ return this._memory;
378
389
  }
379
390
  static create({
380
- manifest,
391
+ name,
392
+ instruction,
381
393
  tools,
382
- memory,
383
- handlers
394
+ memory
384
395
  }) {
385
- return new _Agent(manifest, tools, memory, handlers);
396
+ const id = UuidGenerator.create();
397
+ return new _Agent(id, name, instruction, tools, memory);
386
398
  }
387
399
  static rehydrate(record) {
388
- return new _Agent(record.manifest, record.tools, record.memory, record.handlers);
400
+ return new _Agent(record.id, record.name, record.instruction, record.tools, record.memory);
389
401
  }
390
402
  };
391
403
 
@@ -395,14 +407,11 @@ var CreateAgentUseCase = class {
395
407
  this.agentRepository = agentRepository;
396
408
  this.memoryFactory = memoryFactory;
397
409
  }
398
- async execute(name, instruction, tools, handlers) {
399
- const id = UuidGenerator.create();
400
- const manifest = { id, name, role: "agent" };
410
+ async execute(name, instruction, tools) {
401
411
  const memory = this.memoryFactory.create();
402
- const agentRecord = { id, manifest, tools, memory, handlers };
403
- const agent = Agent.create(agentRecord);
412
+ const agent = Agent.create({ name, instruction, tools, memory });
404
413
  await this.agentRepository.save(agent);
405
- return agentRecord;
414
+ return agent;
406
415
  }
407
416
  };
408
417
 
@@ -2540,7 +2549,7 @@ function defineAgentModule(config) {
2540
2549
  const createAgentUseCase = new CreateAgentUseCase(agentRepository, memoryFactory);
2541
2550
  const createLoopUseCase = new CreateAgentLoopUseCase(agentLoopRepository);
2542
2551
  async function createAgent(config2) {
2543
- return await createAgentUseCase.execute(config2.name, config2.instruction, config2.tools, config2.handlers);
2552
+ return await createAgentUseCase.execute(config2.name, config2.instruction, config2.tools);
2544
2553
  }
2545
2554
  async function createLoop(params) {
2546
2555
  return await createLoopUseCase.execute(params);