@elizaos/core 1.5.4 → 1.5.5

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 (90) hide show
  1. package/README.md +0 -15
  2. package/dist/index.d.ts +4886 -3
  3. package/dist/index.js +5287 -4
  4. package/package.json +21 -39
  5. package/dist/browser/index.browser.js +0 -1109
  6. package/dist/browser/index.browser.js.map +0 -707
  7. package/dist/browser/index.d.ts +0 -3
  8. package/dist/node/index.d.ts +0 -3
  9. package/dist/node/index.node.js +0 -74530
  10. package/dist/node/index.node.js.map +0 -1027
  11. package/src/__tests__/action-chaining-simple.test.ts +0 -203
  12. package/src/__tests__/actions.test.ts +0 -218
  13. package/src/__tests__/buffer.test.ts +0 -337
  14. package/src/__tests__/character-validation.test.ts +0 -309
  15. package/src/__tests__/database.test.ts +0 -750
  16. package/src/__tests__/entities.test.ts +0 -727
  17. package/src/__tests__/env.test.ts +0 -23
  18. package/src/__tests__/environment.test.ts +0 -285
  19. package/src/__tests__/logger-browser-node.test.ts +0 -716
  20. package/src/__tests__/logger.test.ts +0 -403
  21. package/src/__tests__/messages.test.ts +0 -196
  22. package/src/__tests__/mockCharacter.ts +0 -544
  23. package/src/__tests__/parsing.test.ts +0 -58
  24. package/src/__tests__/prompts.test.ts +0 -159
  25. package/src/__tests__/roles.test.ts +0 -331
  26. package/src/__tests__/runtime-embedding.test.ts +0 -343
  27. package/src/__tests__/runtime.test.ts +0 -978
  28. package/src/__tests__/search.test.ts +0 -15
  29. package/src/__tests__/services-by-type.test.ts +0 -204
  30. package/src/__tests__/services.test.ts +0 -136
  31. package/src/__tests__/settings.test.ts +0 -810
  32. package/src/__tests__/utils.test.ts +0 -1105
  33. package/src/__tests__/uuid.test.ts +0 -94
  34. package/src/actions.ts +0 -122
  35. package/src/database.ts +0 -579
  36. package/src/entities.ts +0 -406
  37. package/src/index.browser.ts +0 -48
  38. package/src/index.node.ts +0 -39
  39. package/src/index.ts +0 -50
  40. package/src/logger.ts +0 -527
  41. package/src/prompts.ts +0 -243
  42. package/src/roles.ts +0 -85
  43. package/src/runtime.ts +0 -2514
  44. package/src/schemas/character.ts +0 -149
  45. package/src/search.ts +0 -1543
  46. package/src/sentry/instrument.browser.ts +0 -65
  47. package/src/sentry/instrument.node.ts +0 -57
  48. package/src/sentry/instrument.ts +0 -82
  49. package/src/services.ts +0 -105
  50. package/src/settings.ts +0 -409
  51. package/src/test_resources/constants.ts +0 -12
  52. package/src/test_resources/testSetup.ts +0 -21
  53. package/src/test_resources/types.ts +0 -22
  54. package/src/types/agent.ts +0 -112
  55. package/src/types/browser.ts +0 -145
  56. package/src/types/components.ts +0 -184
  57. package/src/types/database.ts +0 -348
  58. package/src/types/email.ts +0 -162
  59. package/src/types/environment.ts +0 -129
  60. package/src/types/events.ts +0 -249
  61. package/src/types/index.ts +0 -29
  62. package/src/types/knowledge.ts +0 -65
  63. package/src/types/lp.ts +0 -124
  64. package/src/types/memory.ts +0 -228
  65. package/src/types/message.ts +0 -233
  66. package/src/types/messaging.ts +0 -57
  67. package/src/types/model.ts +0 -359
  68. package/src/types/pdf.ts +0 -77
  69. package/src/types/plugin.ts +0 -78
  70. package/src/types/post.ts +0 -271
  71. package/src/types/primitives.ts +0 -97
  72. package/src/types/runtime.ts +0 -190
  73. package/src/types/service.ts +0 -198
  74. package/src/types/settings.ts +0 -30
  75. package/src/types/state.ts +0 -60
  76. package/src/types/task.ts +0 -72
  77. package/src/types/tee.ts +0 -107
  78. package/src/types/testing.ts +0 -30
  79. package/src/types/token.ts +0 -96
  80. package/src/types/transcription.ts +0 -133
  81. package/src/types/video.ts +0 -108
  82. package/src/types/wallet.ts +0 -56
  83. package/src/types/web-search.ts +0 -146
  84. package/src/utils/__tests__/buffer.test.ts +0 -80
  85. package/src/utils/__tests__/environment.test.ts +0 -58
  86. package/src/utils/__tests__/stringToUuid.test.ts +0 -88
  87. package/src/utils/buffer.ts +0 -312
  88. package/src/utils/environment.ts +0 -316
  89. package/src/utils/server-health.ts +0 -117
  90. package/src/utils.ts +0 -1076
@@ -1,117 +0,0 @@
1
- /**
2
- * Server health check utilities for waiting for servers to be ready
3
- */
4
-
5
- export interface ServerHealthOptions {
6
- port: number;
7
- endpoint?: string;
8
- maxWaitTime?: number;
9
- pollInterval?: number;
10
- requestTimeout?: number;
11
- host?: string;
12
- protocol?: 'http' | 'https';
13
- }
14
-
15
- /**
16
- * Wait for server to be ready by polling health endpoint
17
- * @param options - Configuration options for server health check
18
- */
19
- export async function waitForServerReady(options: ServerHealthOptions): Promise<void> {
20
- const {
21
- port,
22
- endpoint = '/api/agents',
23
- maxWaitTime = 30000, // 30 seconds default
24
- pollInterval = 1000, // 1 second
25
- requestTimeout = 2000, // 2 seconds
26
- host = 'localhost',
27
- protocol = 'http',
28
- } = options;
29
-
30
- const url = `${protocol}://${host}:${port}${endpoint}`;
31
- const startTime = Date.now();
32
-
33
- while (Date.now() - startTime < maxWaitTime) {
34
- let controller: AbortController | undefined;
35
- let timeoutId: NodeJS.Timeout | undefined;
36
-
37
- try {
38
- controller = new AbortController();
39
- timeoutId = setTimeout(() => {
40
- if (controller) {
41
- controller.abort();
42
- }
43
- }, requestTimeout);
44
-
45
- const response = await fetch(url, {
46
- signal: controller.signal,
47
- });
48
-
49
- if (timeoutId) {
50
- clearTimeout(timeoutId);
51
- timeoutId = undefined;
52
- }
53
-
54
- if (response.ok) {
55
- // Server is ready, give it one more second to stabilize
56
- await new Promise((resolve) => setTimeout(resolve, 1000));
57
- return;
58
- }
59
- } catch (error) {
60
- // Server not ready yet, continue polling
61
- } finally {
62
- // Ensure cleanup happens even if there's an exception
63
- if (timeoutId) {
64
- clearTimeout(timeoutId);
65
- }
66
- }
67
-
68
- await new Promise((resolve) => setTimeout(resolve, pollInterval));
69
- }
70
-
71
- throw new Error(`Server failed to become ready at ${url} within ${maxWaitTime}ms`);
72
- }
73
-
74
- /**
75
- * Simple ping check for server availability (no stabilization wait)
76
- * @param options - Configuration options for server ping
77
- */
78
- export async function pingServer(options: ServerHealthOptions): Promise<boolean> {
79
- const {
80
- port,
81
- endpoint = '/api/agents',
82
- requestTimeout = 2000,
83
- host = 'localhost',
84
- protocol = 'http',
85
- } = options;
86
-
87
- const url = `${protocol}://${host}:${port}${endpoint}`;
88
- let controller: AbortController | undefined;
89
- let timeoutId: NodeJS.Timeout | undefined;
90
-
91
- try {
92
- controller = new AbortController();
93
- timeoutId = setTimeout(() => {
94
- if (controller) {
95
- controller.abort();
96
- }
97
- }, requestTimeout);
98
-
99
- const response = await fetch(url, {
100
- signal: controller.signal,
101
- });
102
-
103
- if (timeoutId) {
104
- clearTimeout(timeoutId);
105
- timeoutId = undefined;
106
- }
107
-
108
- return response.ok;
109
- } catch (error) {
110
- return false;
111
- } finally {
112
- // Ensure cleanup happens even if there's an exception
113
- if (timeoutId) {
114
- clearTimeout(timeoutId);
115
- }
116
- }
117
- }