@elizaos/autonomous 2.0.0-alpha.13 → 2.0.0-alpha.14

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.
Files changed (118) hide show
  1. package/.turbo/turbo-build.log +12 -26
  2. package/dist/packages/autonomous/src/actions/emote.d.ts.map +1 -1
  3. package/dist/packages/autonomous/src/actions/restart.d.ts.map +1 -1
  4. package/dist/packages/autonomous/src/actions/restart.js +0 -1
  5. package/dist/packages/autonomous/src/actions/send-message.d.ts.map +1 -1
  6. package/dist/packages/autonomous/src/actions/switch-stream-source.d.ts.map +1 -1
  7. package/dist/packages/autonomous/src/api/agent-lifecycle-routes.d.ts.map +1 -1
  8. package/dist/packages/autonomous/src/api/agent-lifecycle-routes.js +1 -1
  9. package/dist/packages/autonomous/src/api/apps-routes.d.ts +1 -1
  10. package/dist/packages/autonomous/src/api/apps-routes.d.ts.map +1 -1
  11. package/dist/packages/autonomous/src/api/character-routes.js +1 -1
  12. package/dist/packages/autonomous/src/api/cloud-billing-routes.d.ts.map +1 -1
  13. package/dist/packages/autonomous/src/api/cloud-compat-routes.d.ts.map +1 -1
  14. package/dist/packages/autonomous/src/api/cloud-status-routes.d.ts +1 -1
  15. package/dist/packages/autonomous/src/api/cloud-status-routes.d.ts.map +1 -1
  16. package/dist/packages/autonomous/src/api/index.d.ts +16 -16
  17. package/dist/packages/autonomous/src/api/index.d.ts.map +1 -1
  18. package/dist/packages/autonomous/src/api/index.js +15 -15
  19. package/dist/packages/autonomous/src/api/knowledge-service-loader.d.ts.map +1 -1
  20. package/dist/packages/autonomous/src/api/memory-routes.d.ts.map +1 -1
  21. package/dist/packages/autonomous/src/api/memory-routes.js +1 -1
  22. package/dist/packages/autonomous/src/api/parse-action-block.d.ts +2 -2
  23. package/dist/packages/autonomous/src/api/parse-action-block.d.ts.map +1 -1
  24. package/dist/packages/autonomous/src/api/provider-switch-config.d.ts +1 -1
  25. package/dist/packages/autonomous/src/api/provider-switch-config.d.ts.map +1 -1
  26. package/dist/packages/autonomous/src/api/sandbox-routes.js +1 -1
  27. package/dist/packages/autonomous/src/api/server.d.ts.map +1 -1
  28. package/dist/packages/autonomous/src/api/server.js +75 -68
  29. package/dist/packages/autonomous/src/api/stream-routes.d.ts +1 -1
  30. package/dist/packages/autonomous/src/api/stream-routes.d.ts.map +1 -1
  31. package/dist/packages/autonomous/src/api/stream-routes.js +3 -2
  32. package/dist/packages/autonomous/src/api/training-routes.d.ts.map +1 -1
  33. package/dist/packages/autonomous/src/api/training-routes.js +1 -1
  34. package/dist/packages/autonomous/src/api/trigger-routes.d.ts.map +1 -1
  35. package/dist/packages/autonomous/src/api/trigger-routes.js +6 -2
  36. package/dist/packages/autonomous/src/api/wallet-evm-balance.d.ts.map +1 -1
  37. package/dist/packages/autonomous/src/api/wallet-evm-balance.js +2 -1
  38. package/dist/packages/autonomous/src/cli/index.d.ts.map +1 -1
  39. package/dist/packages/autonomous/src/config/index.d.ts +1 -1
  40. package/dist/packages/autonomous/src/config/index.d.ts.map +1 -1
  41. package/dist/packages/autonomous/src/config/index.js +1 -1
  42. package/dist/packages/autonomous/src/index.d.ts +1 -1
  43. package/dist/packages/autonomous/src/index.d.ts.map +1 -1
  44. package/dist/packages/autonomous/src/index.js +1 -1
  45. package/dist/packages/autonomous/src/providers/simple-mode.d.ts.map +1 -1
  46. package/dist/packages/autonomous/src/providers/simple-mode.js +0 -1
  47. package/dist/packages/autonomous/src/runtime/eliza.d.ts.map +1 -1
  48. package/dist/packages/autonomous/src/runtime/eliza.js +12 -25
  49. package/dist/packages/autonomous/src/runtime/milady-plugin.d.ts.map +1 -1
  50. package/dist/packages/autonomous/src/server/index.d.ts +2 -2
  51. package/dist/packages/autonomous/src/server/index.d.ts.map +1 -1
  52. package/dist/packages/autonomous/src/server/index.js +1 -1
  53. package/dist/packages/autonomous/src/services/agent-export.d.ts.map +1 -1
  54. package/dist/packages/autonomous/src/services/agent-export.js +53 -43
  55. package/dist/packages/autonomous/src/services/index.d.ts +4 -4
  56. package/dist/packages/autonomous/src/services/index.d.ts.map +1 -1
  57. package/dist/packages/autonomous/src/services/index.js +4 -4
  58. package/dist/packages/autonomous/src/services/whatsapp-pairing.d.ts.map +1 -1
  59. package/dist/packages/autonomous/src/services/whatsapp-pairing.js +1 -1
  60. package/dist/packages/autonomous/src/triggers/runtime.d.ts.map +1 -1
  61. package/dist/packages/autonomous/src/triggers/runtime.js +2 -0
  62. package/package.json +5 -5
  63. package/src/actions/emote.ts +4 -1
  64. package/src/actions/restart.ts +4 -1
  65. package/src/actions/send-message.ts +9 -1
  66. package/src/actions/switch-stream-source.ts +7 -1
  67. package/src/api/agent-lifecycle-routes.ts +1 -10
  68. package/src/api/apps-routes.ts +2 -5
  69. package/src/api/character-routes.ts +1 -1
  70. package/src/api/cloud-billing-routes.ts +3 -1
  71. package/src/api/cloud-compat-routes.ts +3 -1
  72. package/src/api/cloud-status-routes.ts +4 -3
  73. package/src/api/index.ts +29 -33
  74. package/src/api/knowledge-service-loader.ts +9 -3
  75. package/src/api/memory-routes.ts +4 -1
  76. package/src/api/parse-action-block.ts +2 -4
  77. package/src/api/provider-switch-config.ts +1 -1
  78. package/src/api/sandbox-routes.ts +2 -1
  79. package/src/api/server.ts +105 -104
  80. package/src/api/stream-routes.ts +14 -7
  81. package/src/api/training-routes.ts +4 -1
  82. package/src/api/trigger-routes.ts +10 -4
  83. package/src/api/wallet-evm-balance.ts +2 -1
  84. package/src/cli/index.ts +3 -1
  85. package/src/cloud/cloud-manager.test.ts +9 -9
  86. package/src/config/index.ts +1 -1
  87. package/src/index.ts +1 -1
  88. package/src/providers/simple-mode.ts +0 -1
  89. package/src/runtime/cloud-onboarding.ts +5 -3
  90. package/src/runtime/eliza.ts +20 -28
  91. package/src/runtime/milady-plugin.ts +1 -4
  92. package/src/server/index.ts +2 -6
  93. package/src/services/agent-export.ts +44 -33
  94. package/src/services/index.ts +4 -4
  95. package/src/services/whatsapp-pairing.ts +5 -2
  96. package/src/triggers/runtime.ts +17 -3
  97. package/test/api/agent-admin-routes.test.ts +15 -9
  98. package/test/api/agent-lifecycle-routes.test.ts +18 -9
  99. package/test/api/agent-transfer-routes.test.ts +18 -9
  100. package/test/api/apps-routes.test.ts +7 -9
  101. package/test/api/auth-routes.test.ts +7 -7
  102. package/test/api/bug-report-routes.test.ts +5 -5
  103. package/test/api/knowledge-routes.test.ts +4 -4
  104. package/test/api/memory-routes.test.ts +4 -4
  105. package/test/api/models-routes.test.ts +9 -7
  106. package/test/api/nfa-routes.test.ts +6 -6
  107. package/test/api/permissions-routes.test.ts +5 -5
  108. package/test/api/registry-routes.test.ts +6 -6
  109. package/test/api/signal-routes.test.ts +6 -6
  110. package/test/api/subscription-routes.test.ts +4 -4
  111. package/test/api/trigger-routes.test.ts +4 -4
  112. package/test/api/wallet-routes.observability.test.ts +1 -1
  113. package/test/api/wallet-routes.test.ts +1 -1
  114. package/test/diagnostics/integration-observability.test.ts +1 -1
  115. package/test/security/audit-log.test.ts +6 -8
  116. package/test/security/network-policy.test.ts +3 -3
  117. package/test/services/version-compat.test.ts +23 -19
  118. package/tsconfig.json +1 -5
@@ -193,7 +193,8 @@ async function extractAgentData(runtime, options) {
193
193
  const agentId = runtime.agentId;
194
194
  logger.info(`[agent-export] Extracting data for agent ${agentId}`);
195
195
  // 1. Agent record
196
- const agent = await db.getAgent(agentId);
196
+ const agents = await db.getAgentsByIds([agentId]);
197
+ const agent = agents[0];
197
198
  if (!agent) {
198
199
  throw new AgentExportError(`Agent ${agentId} not found in database.`);
199
200
  }
@@ -206,14 +207,14 @@ async function extractAgentData(runtime, options) {
206
207
  for (const world of agentWorlds) {
207
208
  if (!world.id)
208
209
  continue;
209
- const worldRooms = await db.getRoomsByWorld(world.id);
210
+ const worldRooms = await db.getRoomsByWorlds([world.id]);
210
211
  for (const room of worldRooms) {
211
212
  if (room.id)
212
213
  roomMap.set(room.id, room);
213
214
  }
214
215
  }
215
216
  // Also get rooms the agent participates in directly
216
- const participantRoomIds = await db.getRoomsForParticipant(agentId);
217
+ const participantRoomIds = await db.getRoomsForParticipants([agentId]);
217
218
  if (participantRoomIds.length > 0) {
218
219
  const participantRooms = await db.getRoomsByIds(participantRoomIds);
219
220
  if (participantRooms) {
@@ -231,14 +232,19 @@ async function extractAgentData(runtime, options) {
231
232
  for (const room of rooms) {
232
233
  if (!room.id)
233
234
  continue;
234
- const roomEntities = await db.getEntitiesForRoom(room.id, true);
235
+ const entitiesResult = await db.getEntitiesForRooms([room.id], true);
236
+ const roomEntities = entitiesResult[0]?.entities ?? [];
235
237
  for (const entity of roomEntities) {
236
238
  if (entity.id)
237
239
  entityMap.set(entity.id, entity);
238
240
  }
239
- const participantIds = await db.getParticipantsForRoom(room.id);
241
+ const participantsResult = await db.getParticipantsForRooms([room.id]);
242
+ const participantIds = participantsResult[0]?.entityIds ?? [];
240
243
  for (const entityId of participantIds) {
241
- const userState = await db.getParticipantUserState(room.id, entityId);
244
+ const userStates = await db.getParticipantUserStates([
245
+ { roomId: room.id, entityId },
246
+ ]);
247
+ const userState = userStates[0] ?? null;
242
248
  participantRecords.push({
243
249
  entityId,
244
250
  roomId: room.id,
@@ -260,12 +266,12 @@ async function extractAgentData(runtime, options) {
260
266
  for (const entity of entities) {
261
267
  if (!entity.id)
262
268
  continue;
263
- for (const c of await db.getComponents(entity.id))
269
+ for (const c of await db.getComponentsForEntities([entity.id]))
264
270
  addComponent(c);
265
271
  for (const world of agentWorlds) {
266
272
  if (!world.id)
267
273
  continue;
268
- for (const c of await db.getComponents(entity.id, world.id))
274
+ for (const c of await db.getComponentsForEntities([entity.id], world.id))
269
275
  addComponent(c);
270
276
  }
271
277
  }
@@ -293,7 +299,7 @@ async function extractAgentData(runtime, options) {
293
299
  continue;
294
300
  for (const tableName of MEMORY_TABLES) {
295
301
  const worldMemories = await db.getMemoriesByWorldId({
296
- worldId: world.id,
302
+ worldIds: [world.id],
297
303
  count: Number.MAX_SAFE_INTEGER,
298
304
  tableName,
299
305
  });
@@ -307,12 +313,12 @@ async function extractAgentData(runtime, options) {
307
313
  }
308
314
  logger.info(`[agent-export] Found ${allMemories.length} memories`);
309
315
  // 7. Relationships
310
- const relationships = await db.getRelationships({ entityId: agentId });
316
+ const relationships = await db.getRelationships({ entityIds: [agentId] });
311
317
  logger.info(`[agent-export] Found ${relationships.length} relationships`);
312
318
  // 8. Tasks
313
319
  // The Task proto type does not declare agentId, but the DB schema stores
314
320
  // agent_id. Filter using a dynamic property access to handle both shapes.
315
- const allTasks = await db.getTasks({});
321
+ const allTasks = await db.getTasks({ agentIds: [agentId] });
316
322
  const agentTasks = allTasks.filter((t) => taskAgentId(t) === agentId);
317
323
  logger.info(`[agent-export] Found ${agentTasks.length} tasks`);
318
324
  // 9. Logs (optional)
@@ -328,7 +334,7 @@ async function extractAgentData(runtime, options) {
328
334
  if (runtime.character) {
329
335
  // Clone and strip secrets/sensitive fields
330
336
  const { secrets, ...safeChar } = runtime.character;
331
- characterConfig = safeChar;
337
+ characterConfig = Object.fromEntries(Object.entries(safeChar));
332
338
  logger.info(`[agent-export] Captured runtime character config (${Object.keys(safeChar).length} fields)`);
333
339
  }
334
340
  return {
@@ -385,8 +391,8 @@ async function restoreAgentData(runtime, payload) {
385
391
  agentData.enabled = true;
386
392
  agentData.createdAt = Date.now();
387
393
  agentData.updatedAt = Date.now();
388
- const agentCreated = await db.createAgent(agentData);
389
- if (!agentCreated) {
394
+ const agentCreatedIds = await db.createAgents([agentData]);
395
+ if (!agentCreatedIds || agentCreatedIds.length === 0) {
390
396
  throw new AgentExportError("Failed to create agent in database.");
391
397
  }
392
398
  logger.info(`[agent-import] Created agent record${payload.characterConfig ? " (merged with characterConfig)" : ""}`);
@@ -398,7 +404,7 @@ async function restoreAgentData(runtime, payload) {
398
404
  id: remap(world.id ?? ""),
399
405
  agentId: newAgentId,
400
406
  };
401
- await db.createWorld(newWorld);
407
+ await db.createWorlds([newWorld]);
402
408
  worldsImported++;
403
409
  }
404
410
  logger.info(`[agent-import] Imported ${worldsImported} worlds`);
@@ -442,9 +448,11 @@ async function restoreAgentData(runtime, payload) {
442
448
  for (const p of payload.participants) {
443
449
  const newEntityId = remap(p.entityId);
444
450
  const newRoomId = remap(p.roomId);
445
- await db.addParticipantsRoom([newEntityId], newRoomId);
451
+ await db.createRoomParticipants([newEntityId], newRoomId);
446
452
  if (p.userState === "FOLLOWED" || p.userState === "MUTED") {
447
- await db.setParticipantUserState(newRoomId, newEntityId, p.userState);
453
+ await db.updateParticipantUserStates([
454
+ { roomId: newRoomId, entityId: newEntityId, state: p.userState },
455
+ ]);
448
456
  }
449
457
  participantsImported++;
450
458
  }
@@ -463,7 +471,7 @@ async function restoreAgentData(runtime, payload) {
463
471
  ? { sourceEntityId: remap(comp.sourceEntityId) }
464
472
  : {}),
465
473
  };
466
- await db.createComponent(newComp);
474
+ await db.createComponents([newComp]);
467
475
  componentsImported++;
468
476
  }
469
477
  logger.info(`[agent-import] Imported ${componentsImported} components`);
@@ -481,19 +489,19 @@ async function restoreAgentData(runtime, payload) {
481
489
  // Embeddings are excluded — they will be regenerated
482
490
  embedding: undefined,
483
491
  };
484
- await db.createMemory(newMem, tableName);
492
+ await db.createMemories([{ memory: newMem, tableName }]);
485
493
  memoriesImported++;
486
494
  }
487
495
  logger.info(`[agent-import] Imported ${memoriesImported} memories`);
488
496
  // 8. Create relationships
489
497
  let relationshipsImported = 0;
490
498
  for (const rel of payload.relationships) {
491
- await db.createRelationship({
492
- sourceEntityId: remap(rel.sourceEntityId ?? ""),
493
- targetEntityId: remap(rel.targetEntityId ?? ""),
494
- tags: rel.tags,
495
- metadata: rel.metadata,
496
- });
499
+ await db.createRelationships([{
500
+ sourceEntityId: remap(rel.sourceEntityId ?? ""),
501
+ targetEntityId: remap(rel.targetEntityId ?? ""),
502
+ tags: rel.tags,
503
+ metadata: rel.metadata,
504
+ }]);
497
505
  relationshipsImported++;
498
506
  }
499
507
  logger.info(`[agent-import] Imported ${relationshipsImported} relationships`);
@@ -511,23 +519,23 @@ async function restoreAgentData(runtime, payload) {
511
519
  worldId: task.worldId ? remap(task.worldId) : undefined,
512
520
  entityId: task.entityId ? remap(task.entityId) : undefined,
513
521
  };
514
- await db.createTask(newTask);
522
+ await db.createTasks([newTask]);
515
523
  tasksImported++;
516
524
  }
517
525
  logger.info(`[agent-import] Imported ${tasksImported} tasks`);
518
526
  // 10. Create logs
519
527
  let logsImported = 0;
520
528
  for (const logEntry of payload.logs) {
521
- await db.log({
522
- body: logEntry.body,
523
- entityId: logEntry.entityId
524
- ? remap(logEntry.entityId)
525
- : logEntry.entityId,
526
- roomId: logEntry.roomId
527
- ? remap(logEntry.roomId)
528
- : newAgentId,
529
- type: logEntry.type ?? "action",
530
- });
529
+ await db.createLogs([{
530
+ body: logEntry.body,
531
+ entityId: (logEntry.entityId
532
+ ? remap(logEntry.entityId)
533
+ : logEntry.entityId),
534
+ roomId: logEntry.roomId
535
+ ? remap(logEntry.roomId)
536
+ : newAgentId,
537
+ type: logEntry.type ?? "action",
538
+ }]);
531
539
  logsImported++;
532
540
  }
533
541
  logger.info(`[agent-import] Imported ${logsImported} logs`);
@@ -687,16 +695,18 @@ export async function estimateExportSize(runtime) {
687
695
  }
688
696
  const allWorlds = await db.getAllWorlds();
689
697
  const agentWorlds = allWorlds.filter((w) => w.agentId === agentId);
690
- const roomIds = await db.getRoomsForParticipant(agentId);
698
+ const roomIds = await db.getRoomsForParticipants([agentId]);
691
699
  const entityIdSet = new Set();
692
- for (const roomId of roomIds) {
693
- const roomEntities = await db.getEntitiesForRoom(roomId);
694
- for (const e of roomEntities) {
695
- if (e.id)
696
- entityIdSet.add(e.id);
700
+ if (roomIds.length > 0) {
701
+ const entitiesResult = await db.getEntitiesForRooms(roomIds, true);
702
+ for (const result of entitiesResult) {
703
+ for (const e of result.entities) {
704
+ if (e.id)
705
+ entityIdSet.add(e.id);
706
+ }
697
707
  }
698
708
  }
699
- const tasks = await db.getTasks({});
709
+ const tasks = await db.getTasks({ agentIds: [agentId] });
700
710
  const agentTasks = tasks.filter((t) => taskAgentId(t) === agentId);
701
711
  // Rough estimate: ~500 bytes per memory, ~200 bytes per entity, ~300 per room
702
712
  const estimatedBytes = memoriesCount * 500 +
@@ -2,17 +2,17 @@ export * from "./agent-export";
2
2
  export * from "./app-manager";
3
3
  export * from "./browser-capture";
4
4
  export * from "./fallback-training-service";
5
- export * from "./remote-signing-service";
5
+ export * from "./privy-wallets";
6
6
  export * from "./registry-client";
7
+ export * from "./remote-signing-service";
7
8
  export * from "./sandbox-engine";
8
9
  export * from "./sandbox-manager";
9
- export * from "./skill-catalog-client";
10
- export * from "./skill-marketplace";
11
10
  export * from "./self-updater";
12
11
  export * from "./signing-policy";
12
+ export * from "./skill-catalog-client";
13
+ export * from "./skill-marketplace";
13
14
  export * from "./stream-manager";
14
15
  export * from "./tts-stream-bridge";
15
16
  export * from "./update-checker";
16
- export * from "./privy-wallets";
17
17
  export * from "./version-compat";
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC"}
@@ -2,16 +2,16 @@ export * from "./agent-export";
2
2
  export * from "./app-manager";
3
3
  export * from "./browser-capture";
4
4
  export * from "./fallback-training-service";
5
- export * from "./remote-signing-service";
5
+ export * from "./privy-wallets";
6
6
  export * from "./registry-client";
7
+ export * from "./remote-signing-service";
7
8
  export * from "./sandbox-engine";
8
9
  export * from "./sandbox-manager";
9
- export * from "./skill-catalog-client";
10
- export * from "./skill-marketplace";
11
10
  export * from "./self-updater";
12
11
  export * from "./signing-policy";
12
+ export * from "./skill-catalog-client";
13
+ export * from "./skill-marketplace";
13
14
  export * from "./stream-manager";
14
15
  export * from "./tts-stream-bridge";
15
16
  export * from "./update-checker";
16
- export * from "./privy-wallets";
17
17
  export * from "./version-compat";
@@ -1 +1 @@
1
- {"version":3,"file":"whatsapp-pairing.d.ts","sourceRoot":"","sources":["../../../../../src/services/whatsapp-pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,aAAa,GAAG,iBAAiB,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAChD;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAEE;IAChB,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAK;IACrC,OAAO,CAAC,YAAY,CAA8C;gBAEtD,OAAO,EAAE,sBAAsB;IAIrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IA6G5B,IAAI,IAAI,IAAI;IAaZ,SAAS,IAAI,qBAAqB;IAIlC,OAAO,CAAC,SAAS;CAQlB;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,SAAS,SAAY,GACpB,OAAO,CAQT;AAED,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,EACpB,SAAS,SAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CA8Df"}
1
+ {"version":3,"file":"whatsapp-pairing.d.ts","sourceRoot":"","sources":["../../../../../src/services/whatsapp-pairing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAOH,gGAAgG;AAChG,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQrD;AAED,MAAM,MAAM,qBAAqB,GAC7B,MAAM,GACN,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,SAAS,GACT,OAAO,CAAC;AAEZ,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,aAAa,GAAG,iBAAiB,CAAC;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,qBAAqB,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAChD;AAED,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAEE;IAChB,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,OAAO,CAAyB;IACxC,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAK;IACrC,OAAO,CAAC,YAAY,CAA8C;gBAEtD,OAAO,EAAE,sBAAsB;IAIrC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAgH5B,IAAI,IAAI,IAAI;IAaZ,SAAS,IAAI,qBAAqB;IAIlC,OAAO,CAAC,SAAS;CAQlB;AAED,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,MAAM,EACpB,SAAS,SAAY,GACpB,OAAO,CAQT;AAED,wBAAsB,cAAc,CAClC,YAAY,EAAE,MAAM,EACpB,SAAS,SAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CA8Df"}
@@ -31,7 +31,7 @@ export class WhatsAppPairingSession {
31
31
  this.setStatus("initializing");
32
32
  const baileys = await import("@whiskeysockets/baileys");
33
33
  const makeWASocket = baileys.default;
34
- const { useMultiFileAuthState, fetchLatestBaileysVersion, DisconnectReason } = baileys;
34
+ const { useMultiFileAuthState, fetchLatestBaileysVersion, DisconnectReason, } = baileys;
35
35
  const QRCode = (await import("qrcode")).default;
36
36
  const { Boom } = await import("@hapi/boom");
37
37
  fs.mkdirSync(this.options.authDir, { recursive: true });
@@ -1 +1 @@
1
- {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/triggers/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAQ,MAAM,eAAe,CAAC;AAO/D,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,iBAAiB,EAAG,kBAA2B,CAAC;AAC7D,eAAO,MAAM,iBAAiB,yCAA0C,CAAC;AAWzE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAgDD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,GAAG,IAAI,CAOlE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,EAAE,CAG9D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAavE;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAa/D;AAqDD,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAwJjC;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAatE;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,EAAE,CAAC,CAKjB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc,GAAG,IAAI,CA0BtE;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,qBAAqB,CAAC,CAsChC"}
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../../../src/triggers/runtime.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAW,IAAI,EAAQ,MAAM,eAAe,CAAC;AAOxE,OAAO,KAAK,EACV,aAAa,EACb,qBAAqB,EACrB,gBAAgB,EAChB,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,iBAAiB,EAAG,kBAA2B,CAAC;AAC7D,eAAO,MAAM,iBAAiB,yCAA0C,CAAC;AAWzE,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,WAAW,GAAG,QAAQ,CAAC;IAC/B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAC9B;AAgDD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,GAAG,IAAI,CAOlE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,gBAAgB,EAAE,CAG9D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAavE;AAED,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM,CAa/D;AAiED,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAwJjC;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CActE;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,IAAI,EAAE,CAAC,CAMjB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc,GAAG,IAAI,CA0BtE;AAED,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,qBAAqB,CAAC,CAsChC"}
@@ -241,6 +241,7 @@ export function registerTriggerTaskWorker(runtime) {
241
241
  source: options.source === "manual" ? "manual" : "scheduler",
242
242
  force: options.force === true,
243
243
  });
244
+ return {};
244
245
  },
245
246
  });
246
247
  }
@@ -249,6 +250,7 @@ export async function listTriggerTasks(runtime) {
249
250
  return [];
250
251
  return runtime.getTasks({
251
252
  tags: [...TRIGGER_TASK_TAGS],
253
+ agentIds: [runtime.agentId],
252
254
  });
253
255
  }
254
256
  export function taskToTriggerSummary(task) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elizaos/autonomous",
3
- "version": "2.0.0-alpha.13",
3
+ "version": "2.0.0-alpha.14",
4
4
  "description": "Standalone autonomous agent runtime and backend server package for elizaOS.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -213,7 +213,7 @@
213
213
  "./version-resolver": "./src/version-resolver.ts"
214
214
  },
215
215
  "peerDependencies": {
216
- "@elizaos/core": "2.0.0-alpha.13",
216
+ "@elizaos/core": "2.0.0-alpha.14",
217
217
  "@elizaos/signal-native": "*"
218
218
  },
219
219
  "peerDependenciesMeta": {
@@ -241,8 +241,8 @@
241
241
  "@elizaos/plugin-todo": "alpha",
242
242
  "@elizaos/plugin-trajectory-logger": "alpha",
243
243
  "@elizaos/plugin-trust": "alpha",
244
- "@elizaos/prompts": "2.0.0-alpha.13",
245
- "@elizaos/skills": "2.0.0-alpha.13",
244
+ "@elizaos/prompts": "2.0.0-alpha.14",
245
+ "@elizaos/skills": "2.0.0-alpha.14",
246
246
  "@hapi/boom": "^10.0.1",
247
247
  "@mariozechner/pi-ai": "0.52.12",
248
248
  "@noble/curves": "^2.0.1",
@@ -266,5 +266,5 @@
266
266
  "@types/ws": "^8.18.1",
267
267
  "typescript": "^5.9.3"
268
268
  },
269
- "gitHead": "9448dcfc32d38873e1e2596d4ff4eca444fadca0"
269
+ "gitHead": "4eb31c47081d48bec956e6b9751f3c9aee3eb38d"
270
270
  }
@@ -45,7 +45,10 @@ export const emoteAction: Action = {
45
45
 
46
46
  handler: async (_runtime, _message, _state, options) => {
47
47
  try {
48
- const params = (options as HandlerOptions | undefined)?.parameters;
48
+ type EmoteParams = { emote?: string };
49
+ const params = (options as HandlerOptions | undefined)?.parameters as
50
+ | EmoteParams
51
+ | undefined;
49
52
  const emoteId =
50
53
  typeof params?.emote === "string" ? params.emote.trim() : "";
51
54
 
@@ -48,7 +48,10 @@ export const restartAction: Action = {
48
48
 
49
49
  handler: async (runtime, message, _state, options) => {
50
50
  // This action declares parameters, so the runtime provides HandlerOptions.
51
- const params = (options as HandlerOptions | undefined)?.parameters;
51
+ type RestartParams = { reason?: string };
52
+ const params = (options as HandlerOptions | undefined)?.parameters as
53
+ | RestartParams
54
+ | undefined;
52
55
  const reason =
53
56
  typeof params?.reason === "string" ? params.reason : undefined;
54
57
 
@@ -17,7 +17,15 @@ export const sendMessageAction: Action = {
17
17
  validate: async () => true,
18
18
 
19
19
  handler: async (runtime, _message, _state, options) => {
20
- const params = (options as HandlerOptions | undefined)?.parameters;
20
+ type SendMessageParams = {
21
+ targetType?: string;
22
+ source?: string;
23
+ target?: string;
24
+ text?: string;
25
+ };
26
+ const params = (options as HandlerOptions | undefined)?.parameters as
27
+ | SendMessageParams
28
+ | undefined;
21
29
  const targetType =
22
30
  params?.targetType === "user" || params?.targetType === "room"
23
31
  ? params.targetType
@@ -34,7 +34,13 @@ export const switchStreamSourceAction: Action = {
34
34
 
35
35
  handler: async (_runtime, _message, _state, options) => {
36
36
  try {
37
- const params = (options as HandlerOptions | undefined)?.parameters;
37
+ type SwitchStreamSourceParams = {
38
+ sourceType?: string;
39
+ customUrl?: string;
40
+ };
41
+ const params = (options as HandlerOptions | undefined)?.parameters as
42
+ | SwitchStreamSourceParams
43
+ | undefined;
38
44
 
39
45
  // ── Extract parameters ───────────────────────────────────────────
40
46
  const rawSourceType =
@@ -28,16 +28,7 @@ export interface AgentLifecycleRouteContext
28
28
  export async function handleAgentLifecycleRoutes(
29
29
  ctx: AgentLifecycleRouteContext,
30
30
  ): Promise<boolean> {
31
- const {
32
- req,
33
- res,
34
- method,
35
- pathname,
36
- state,
37
- error,
38
- json,
39
- readJsonBody,
40
- } = ctx;
31
+ const { req, res, method, pathname, state, error, json, readJsonBody } = ctx;
41
32
  const runtime = state.runtime as
42
33
  | (AgentRuntime & { enableAutonomy?: boolean })
43
34
  | null;
@@ -1,10 +1,10 @@
1
- import type { RouteHelpers, RouteRequestMeta } from "./route-helpers";
2
1
  import type {
3
2
  InstallProgressLike,
4
3
  PluginManagerLike,
5
4
  RegistryPluginInfo,
6
5
  RegistrySearchResult,
7
6
  } from "../services/plugin-manager-types";
7
+ import type { RouteHelpers, RouteRequestMeta } from "./route-helpers";
8
8
 
9
9
  export interface AppManagerLike {
10
10
  listAvailable: (pluginManager: PluginManagerLike) => Promise<unknown>;
@@ -21,10 +21,7 @@ export interface AppManagerLike {
21
21
  runtime?: unknown | null,
22
22
  ) => Promise<unknown>;
23
23
  stop: (pluginManager: PluginManagerLike, name: string) => Promise<unknown>;
24
- getInfo: (
25
- pluginManager: PluginManagerLike,
26
- name: string,
27
- ) => Promise<unknown>;
24
+ getInfo: (pluginManager: PluginManagerLike, name: string) => Promise<unknown>;
28
25
  }
29
26
 
30
27
  export interface AppsRouteContext
@@ -303,7 +303,7 @@ export async function handleCharacterRoutes(
303
303
  if (!body) return true;
304
304
 
305
305
  const result = validateCharacter(body);
306
- if (!result.success) {
306
+ if (!result.success && "error" in result) {
307
307
  const issues = result.error.issues.map((issue) => ({
308
308
  path: issue.path.join("."),
309
309
  message: issue.message,
@@ -24,7 +24,9 @@ function resolveCloudBaseUrl(config: CloudProxyConfigLike): string {
24
24
  return normalizeCloudSiteUrl(config.cloud?.baseUrl);
25
25
  }
26
26
 
27
- function buildAuthHeaders(config: CloudProxyConfigLike): Record<string, string> {
27
+ function buildAuthHeaders(
28
+ config: CloudProxyConfigLike,
29
+ ): Record<string, string> {
28
30
  const serviceKey = config.cloud?.serviceKey?.trim();
29
31
  const apiKey = config.cloud?.apiKey?.trim();
30
32
 
@@ -24,7 +24,9 @@ export function resolveCloudBaseUrl(config: CloudProxyConfigLike): string {
24
24
  return normalizeCloudSiteUrl(config.cloud?.baseUrl);
25
25
  }
26
26
 
27
- function buildAuthHeaders(config: CloudProxyConfigLike): Record<string, string> {
27
+ function buildAuthHeaders(
28
+ config: CloudProxyConfigLike,
29
+ ): Record<string, string> {
28
30
  const serviceKey = config.cloud?.serviceKey?.trim();
29
31
  const apiKey = config.cloud?.apiKey?.trim();
30
32
 
@@ -1,4 +1,5 @@
1
- import { type AgentRuntime, logger } from "@elizaos/core";
1
+ import type { AgentRuntime, Service } from "@elizaos/core";
2
+ import { logger } from "@elizaos/core";
2
3
  import { resolveCloudApiBaseUrl as resolveCanonicalCloudApiBaseUrl } from "../cloud/base-url";
3
4
  import { validateCloudBaseUrl } from "../cloud/validate-url";
4
5
  import type { RouteHelpers, RouteRequestMeta } from "./route-helpers";
@@ -92,7 +93,7 @@ export async function handleCloudStatusRoutes(
92
93
  const hasApiKey = Boolean(config.cloud?.apiKey?.trim());
93
94
  const effectivelyEnabled = cloudEnabled;
94
95
  const cloudAuth = runtime
95
- ? (runtime.getService("CLOUD_AUTH") as CloudAuthIdentityService | null)
96
+ ? runtime.getService<Service & CloudAuthIdentityService>("CLOUD_AUTH")
96
97
  : null;
97
98
  const authConnected = Boolean(cloudAuth?.isAuthenticated());
98
99
 
@@ -136,7 +137,7 @@ export async function handleCloudStatusRoutes(
136
137
 
137
138
  if (method === "GET" && pathname === "/api/cloud/credits") {
138
139
  const cloudAuth = runtime
139
- ? (runtime.getService("CLOUD_AUTH") as CloudAuthCreditsService | null)
140
+ ? runtime.getService<Service & CloudAuthCreditsService>("CLOUD_AUTH")
140
141
  : null;
141
142
  const configApiKey = config.cloud?.apiKey?.trim();
142
143
 
package/src/api/index.ts CHANGED
@@ -6,21 +6,31 @@ export * from "./apps-routes";
6
6
  export * from "./auth-routes";
7
7
  export * from "./bug-report-routes";
8
8
  export * from "./character-routes";
9
- export * from "./database";
10
- export * from "./diagnostics-routes";
11
- export * from "./drop-service";
12
9
  export * from "./cloud-billing-routes";
13
10
  export * from "./cloud-compat-routes";
11
+ export {
12
+ type CloudRouteState,
13
+ handleCloudRoute,
14
+ } from "./cloud-routes";
15
+ export {
16
+ type CloudStatusRouteContext,
17
+ handleCloudStatusRoutes,
18
+ } from "./cloud-status-routes";
14
19
  export * from "./compat-utils";
15
20
  export * from "./connector-health";
16
21
  export * from "./coordinator-wiring";
17
22
  export * from "./credit-detection";
18
- export * from "./http-helpers";
23
+ export * from "./database";
24
+ export * from "./diagnostics-routes";
25
+ export * from "./drop-service";
19
26
  export * from "./early-logs";
27
+ export * from "./http-helpers";
28
+ export * from "./knowledge-routes";
29
+ export * from "./knowledge-service-loader";
20
30
  export * from "./memory-bounds";
21
- export * from "./models-routes";
22
31
  export * from "./memory-routes";
23
32
  export * from "./merkle-tree";
33
+ export * from "./models-routes";
24
34
  export * from "./nfa-routes";
25
35
  export * from "./nft-verify";
26
36
  export * from "./og-tracker";
@@ -32,39 +42,34 @@ export * from "./registry-routes";
32
42
  export * from "./registry-service";
33
43
  export * from "./route-helpers";
34
44
  export * from "./sandbox-routes";
45
+ export {
46
+ applySignalQrOverride,
47
+ handleSignalRoute,
48
+ type SignalPairingEventLike,
49
+ type SignalPairingSessionLike,
50
+ type SignalRouteDeps,
51
+ type SignalRouteState,
52
+ } from "./signal-routes";
35
53
  export * from "./stream-route-state";
36
54
  export * from "./stream-routes";
55
+ export type { StreamVoiceRouteContext } from "./stream-voice-routes";
56
+ export { handleStreamVoiceRoute } from "./stream-voice-routes";
37
57
  export * from "./streaming-text";
38
- export {
39
- handleStreamVoiceRoute,
40
- } from "./stream-voice-routes";
41
- export type {
42
- StreamVoiceRouteContext,
43
- } from "./stream-voice-routes";
44
58
  export * from "./subscription-routes";
45
59
  export * from "./terminal-run-limits";
46
- export * from "./training-routes";
47
60
  export * from "./training-backend-check";
61
+ export * from "./training-routes";
48
62
  export * from "./training-service-like";
49
- export * from "./trigger-routes";
50
63
  export * from "./trajectory-routes";
51
- export * from "./tx-service";
64
+ export * from "./trigger-routes";
52
65
  export * from "./twitter-verify";
53
- export * from "./zip-utils";
66
+ export * from "./tx-service";
54
67
  export * from "./wallet";
55
68
  export * from "./wallet-dex-prices";
56
69
  export * from "./wallet-evm-balance";
57
70
  export * from "./wallet-routes";
58
71
  export * from "./wallet-rpc";
59
72
  export * from "./wallet-trading-profile";
60
- export {
61
- applySignalQrOverride,
62
- handleSignalRoute,
63
- type SignalPairingEventLike,
64
- type SignalPairingSessionLike,
65
- type SignalRouteDeps,
66
- type SignalRouteState,
67
- } from "./signal-routes";
68
73
  export {
69
74
  applyWhatsAppQrOverride,
70
75
  handleWhatsAppRoute,
@@ -73,13 +78,4 @@ export {
73
78
  type WhatsAppRouteDeps,
74
79
  type WhatsAppRouteState,
75
80
  } from "./whatsapp-routes";
76
- export {
77
- handleCloudRoute,
78
- type CloudRouteState,
79
- } from "./cloud-routes";
80
- export {
81
- handleCloudStatusRoutes,
82
- type CloudStatusRouteContext,
83
- } from "./cloud-status-routes";
84
- export * from "./knowledge-service-loader";
85
- export * from "./knowledge-routes";
81
+ export * from "./zip-utils";
@@ -1,4 +1,10 @@
1
- import type { AgentRuntime, Memory, UUID } from "@elizaos/core";
1
+ import type {
2
+ AgentRuntime,
3
+ Memory,
4
+ Service,
5
+ ServiceTypeName,
6
+ UUID,
7
+ } from "@elizaos/core";
2
8
 
3
9
  export interface KnowledgeServiceLike {
4
10
  addKnowledge(options: {
@@ -70,7 +76,7 @@ export async function getKnowledgeService(
70
76
  return { service: null, reason: "runtime_unavailable" };
71
77
  }
72
78
 
73
- let service = runtime.getService("knowledge") as KnowledgeServiceLike | null;
79
+ let service = runtime.getService<Service & KnowledgeServiceLike>("knowledge");
74
80
  if (service) return { service };
75
81
 
76
82
  try {
@@ -83,7 +89,7 @@ export async function getKnowledgeService(
83
89
  );
84
90
  });
85
91
  await Promise.race([servicePromise, timeout]);
86
- service = runtime.getService("knowledge") as KnowledgeServiceLike | null;
92
+ service = runtime.getService<Service & KnowledgeServiceLike>("knowledge");
87
93
  if (service) return { service };
88
94
  return { service: null, reason: "not_registered" };
89
95
  } catch {