@elizaos/api-client 1.4.4 → 1.5.0

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 (139) hide show
  1. package/dist/api-client/src/client.d.ts +25 -0
  2. package/dist/api-client/src/client.d.ts.map +1 -0
  3. package/dist/api-client/src/index.d.ts +20 -0
  4. package/dist/api-client/src/index.d.ts.map +1 -0
  5. package/dist/api-client/src/lib/base-client.d.ts +31 -0
  6. package/dist/api-client/src/lib/base-client.d.ts.map +1 -0
  7. package/dist/api-client/src/services/agents.d.ts +107 -0
  8. package/dist/api-client/src/services/agents.d.ts.map +1 -0
  9. package/dist/api-client/src/services/audio.d.ts +48 -0
  10. package/dist/api-client/src/services/audio.d.ts.map +1 -0
  11. package/dist/api-client/src/services/media.d.ts +14 -0
  12. package/dist/api-client/src/services/media.d.ts.map +1 -0
  13. package/dist/api-client/src/services/memory.d.ts +107 -0
  14. package/dist/api-client/src/services/memory.d.ts.map +1 -0
  15. package/dist/api-client/src/services/messaging.d.ts +164 -0
  16. package/dist/api-client/src/services/messaging.d.ts.map +1 -0
  17. package/dist/api-client/src/services/server.d.ts +47 -0
  18. package/dist/api-client/src/services/server.d.ts.map +1 -0
  19. package/dist/api-client/src/services/sessions.d.ts +52 -0
  20. package/dist/api-client/src/services/sessions.d.ts.map +1 -0
  21. package/dist/api-client/src/services/system.d.ts +56 -0
  22. package/dist/api-client/src/services/system.d.ts.map +1 -0
  23. package/dist/api-client/src/types/agents.d.ts +67 -0
  24. package/dist/api-client/src/types/agents.d.ts.map +1 -0
  25. package/dist/api-client/src/types/audio.d.ts +42 -0
  26. package/dist/api-client/src/types/audio.d.ts.map +1 -0
  27. package/dist/api-client/src/types/base.d.ts +30 -0
  28. package/dist/api-client/src/types/base.d.ts.map +1 -0
  29. package/dist/api-client/src/types/media.d.ts +21 -0
  30. package/dist/api-client/src/types/media.d.ts.map +1 -0
  31. package/dist/api-client/src/types/memory.d.ts +43 -0
  32. package/dist/api-client/src/types/memory.d.ts.map +1 -0
  33. package/dist/api-client/src/types/messaging.d.ts +186 -0
  34. package/dist/api-client/src/types/messaging.d.ts.map +1 -0
  35. package/dist/api-client/src/types/server.d.ts +44 -0
  36. package/dist/api-client/src/types/server.d.ts.map +1 -0
  37. package/dist/api-client/src/types/sessions.d.ts +134 -0
  38. package/dist/api-client/src/types/sessions.d.ts.map +1 -0
  39. package/dist/api-client/src/types/system.d.ts +16 -0
  40. package/dist/api-client/src/types/system.d.ts.map +1 -0
  41. package/dist/core/src/actions.d.ts +23 -0
  42. package/dist/core/src/actions.d.ts.map +1 -0
  43. package/dist/core/src/database.d.ts +481 -0
  44. package/dist/core/src/database.d.ts.map +1 -0
  45. package/dist/core/src/entities.d.ts +49 -0
  46. package/dist/core/src/entities.d.ts.map +1 -0
  47. package/dist/core/src/index.d.ts +27 -0
  48. package/dist/core/src/index.d.ts.map +1 -0
  49. package/dist/core/src/logger.d.ts +46 -0
  50. package/dist/core/src/logger.d.ts.map +1 -0
  51. package/dist/core/src/prompts.d.ts +8 -0
  52. package/dist/core/src/prompts.d.ts.map +1 -0
  53. package/dist/core/src/roles.d.ts +30 -0
  54. package/dist/core/src/roles.d.ts.map +1 -0
  55. package/dist/core/src/runtime.d.ts +328 -0
  56. package/dist/core/src/runtime.d.ts.map +1 -0
  57. package/dist/core/src/schemas/character.d.ts +228 -0
  58. package/dist/core/src/schemas/character.d.ts.map +1 -0
  59. package/dist/core/src/search.d.ts +317 -0
  60. package/dist/core/src/search.d.ts.map +1 -0
  61. package/dist/core/src/sentry/instrument.d.ts +12 -0
  62. package/dist/core/src/sentry/instrument.d.ts.map +1 -0
  63. package/dist/core/src/services.d.ts +49 -0
  64. package/dist/core/src/services.d.ts.map +1 -0
  65. package/dist/core/src/settings.d.ts +87 -0
  66. package/dist/core/src/settings.d.ts.map +1 -0
  67. package/dist/core/src/types/agent.d.ts +98 -0
  68. package/dist/core/src/types/agent.d.ts.map +1 -0
  69. package/dist/core/src/types/browser.d.ts +127 -0
  70. package/dist/core/src/types/browser.d.ts.map +1 -0
  71. package/dist/core/src/types/components.d.ts +135 -0
  72. package/dist/core/src/types/components.d.ts.map +1 -0
  73. package/dist/core/src/types/database.d.ts +278 -0
  74. package/dist/core/src/types/database.d.ts.map +1 -0
  75. package/dist/core/src/types/email.d.ts +143 -0
  76. package/dist/core/src/types/email.d.ts.map +1 -0
  77. package/dist/core/src/types/environment.d.ts +109 -0
  78. package/dist/core/src/types/environment.d.ts.map +1 -0
  79. package/dist/core/src/types/events.d.ts +208 -0
  80. package/dist/core/src/types/events.d.ts.map +1 -0
  81. package/dist/core/src/types/index.d.ts +30 -0
  82. package/dist/core/src/types/index.d.ts.map +1 -0
  83. package/dist/core/src/types/knowledge.d.ts +60 -0
  84. package/dist/core/src/types/knowledge.d.ts.map +1 -0
  85. package/dist/core/src/types/lp.d.ts +115 -0
  86. package/dist/core/src/types/lp.d.ts.map +1 -0
  87. package/dist/core/src/types/memory.d.ts +165 -0
  88. package/dist/core/src/types/memory.d.ts.map +1 -0
  89. package/dist/core/src/types/message.d.ts +202 -0
  90. package/dist/core/src/types/message.d.ts.map +1 -0
  91. package/dist/core/src/types/messaging.d.ts +45 -0
  92. package/dist/core/src/types/messaging.d.ts.map +1 -0
  93. package/dist/core/src/types/model.d.ts +319 -0
  94. package/dist/core/src/types/model.d.ts.map +1 -0
  95. package/dist/core/src/types/pdf.d.ts +68 -0
  96. package/dist/core/src/types/pdf.d.ts.map +1 -0
  97. package/dist/core/src/types/plugin.d.ts +64 -0
  98. package/dist/core/src/types/plugin.d.ts.map +1 -0
  99. package/dist/core/src/types/post.d.ts +242 -0
  100. package/dist/core/src/types/post.d.ts.map +1 -0
  101. package/dist/core/src/types/primitives.d.ts +72 -0
  102. package/dist/core/src/types/primitives.d.ts.map +1 -0
  103. package/dist/core/src/types/runtime.d.ts +106 -0
  104. package/dist/core/src/types/runtime.d.ts.map +1 -0
  105. package/dist/core/src/types/service.d.ts +147 -0
  106. package/dist/core/src/types/service.d.ts.map +1 -0
  107. package/dist/core/src/types/settings.d.ts +30 -0
  108. package/dist/core/src/types/settings.d.ts.map +1 -0
  109. package/dist/core/src/types/state.d.ts +59 -0
  110. package/dist/core/src/types/state.d.ts.map +1 -0
  111. package/dist/core/src/types/task.d.ts +68 -0
  112. package/dist/core/src/types/task.d.ts.map +1 -0
  113. package/dist/core/src/types/tee.d.ts +97 -0
  114. package/dist/core/src/types/tee.d.ts.map +1 -0
  115. package/dist/core/src/types/testing.d.ts +29 -0
  116. package/dist/core/src/types/testing.d.ts.map +1 -0
  117. package/dist/core/src/types/token.d.ts +73 -0
  118. package/dist/core/src/types/token.d.ts.map +1 -0
  119. package/dist/core/src/types/transcription.d.ts +108 -0
  120. package/dist/core/src/types/transcription.d.ts.map +1 -0
  121. package/dist/core/src/types/video.d.ts +93 -0
  122. package/dist/core/src/types/video.d.ts.map +1 -0
  123. package/dist/core/src/types/wallet.d.ts +49 -0
  124. package/dist/core/src/types/wallet.d.ts.map +1 -0
  125. package/dist/core/src/types/web-search.d.ts +112 -0
  126. package/dist/core/src/types/web-search.d.ts.map +1 -0
  127. package/dist/core/src/utils/buffer.d.ts +105 -0
  128. package/dist/core/src/utils/buffer.d.ts.map +1 -0
  129. package/dist/core/src/utils/environment.d.ts +106 -0
  130. package/dist/core/src/utils/environment.d.ts.map +1 -0
  131. package/dist/core/src/utils/server-health.d.ts +23 -0
  132. package/dist/core/src/utils/server-health.d.ts.map +1 -0
  133. package/dist/core/src/utils.d.ts +177 -0
  134. package/dist/core/src/utils.d.ts.map +1 -0
  135. package/dist/index.d.ts +1 -1102
  136. package/dist/index.js +144 -449
  137. package/dist/index.js.map +19 -1
  138. package/dist/tsconfig.build.tsbuildinfo +1 -0
  139. package/package.json +5 -6
@@ -0,0 +1,202 @@
1
+ import { Service } from './service';
2
+ import type { UUID } from './primitives';
3
+ export interface MessageParticipant {
4
+ id: UUID;
5
+ name: string;
6
+ username?: string;
7
+ avatar?: string;
8
+ status?: 'online' | 'offline' | 'away' | 'busy';
9
+ }
10
+ export interface MessageAttachment {
11
+ id: UUID;
12
+ filename: string;
13
+ url: string;
14
+ mimeType: string;
15
+ size: number;
16
+ width?: number;
17
+ height?: number;
18
+ duration?: number;
19
+ thumbnail?: string;
20
+ }
21
+ export interface MessageReaction {
22
+ emoji: string;
23
+ count: number;
24
+ users: UUID[];
25
+ hasReacted: boolean;
26
+ }
27
+ export interface MessageReference {
28
+ messageId: UUID;
29
+ channelId: UUID;
30
+ type: 'reply' | 'forward' | 'quote';
31
+ }
32
+ export interface MessageContent {
33
+ text?: string;
34
+ html?: string;
35
+ markdown?: string;
36
+ attachments?: MessageAttachment[];
37
+ reactions?: MessageReaction[];
38
+ reference?: MessageReference;
39
+ mentions?: UUID[];
40
+ embeds?: Array<{
41
+ title?: string;
42
+ description?: string;
43
+ url?: string;
44
+ image?: string;
45
+ fields?: Array<{
46
+ name: string;
47
+ value: string;
48
+ inline?: boolean;
49
+ }>;
50
+ }>;
51
+ }
52
+ export interface MessageInfo {
53
+ id: UUID;
54
+ channelId: UUID;
55
+ senderId: UUID;
56
+ content: MessageContent;
57
+ timestamp: Date;
58
+ edited?: Date;
59
+ deleted?: Date;
60
+ pinned?: boolean;
61
+ thread?: {
62
+ id: UUID;
63
+ messageCount: number;
64
+ participants: UUID[];
65
+ lastMessageAt: Date;
66
+ };
67
+ }
68
+ export interface MessageSendOptions {
69
+ replyTo?: UUID;
70
+ ephemeral?: boolean;
71
+ silent?: boolean;
72
+ scheduled?: Date;
73
+ thread?: UUID;
74
+ nonce?: string;
75
+ }
76
+ export interface MessageSearchOptions {
77
+ query?: string;
78
+ channelId?: UUID;
79
+ senderId?: UUID;
80
+ before?: Date;
81
+ after?: Date;
82
+ limit?: number;
83
+ offset?: number;
84
+ hasAttachments?: boolean;
85
+ pinned?: boolean;
86
+ mentions?: UUID;
87
+ }
88
+ export interface MessageChannel {
89
+ id: UUID;
90
+ name: string;
91
+ type: 'text' | 'voice' | 'dm' | 'group' | 'announcement' | 'thread';
92
+ description?: string;
93
+ participants?: MessageParticipant[];
94
+ permissions?: {
95
+ canSend: boolean;
96
+ canRead: boolean;
97
+ canDelete: boolean;
98
+ canPin: boolean;
99
+ canManage: boolean;
100
+ };
101
+ lastMessageAt?: Date;
102
+ messageCount?: number;
103
+ unreadCount?: number;
104
+ }
105
+ /**
106
+ * Interface for messaging services
107
+ */
108
+ export declare abstract class IMessageService extends Service {
109
+ static readonly serviceType: "message";
110
+ readonly capabilityDescription = "Message sending, receiving, and management capabilities";
111
+ /**
112
+ * Send a message to a channel
113
+ * @param channelId - Channel ID
114
+ * @param content - Message content
115
+ * @param options - Send options
116
+ * @returns Promise resolving to message ID
117
+ */
118
+ abstract sendMessage(channelId: UUID, content: MessageContent, options?: MessageSendOptions): Promise<UUID>;
119
+ /**
120
+ * Get messages from a channel
121
+ * @param channelId - Channel ID
122
+ * @param options - Search options
123
+ * @returns Promise resolving to array of messages
124
+ */
125
+ abstract getMessages(channelId: UUID, options?: MessageSearchOptions): Promise<MessageInfo[]>;
126
+ /**
127
+ * Get a specific message by ID
128
+ * @param messageId - Message ID
129
+ * @returns Promise resolving to message
130
+ */
131
+ abstract getMessage(messageId: UUID): Promise<MessageInfo>;
132
+ /**
133
+ * Edit a message
134
+ * @param messageId - Message ID
135
+ * @param content - New message content
136
+ * @returns Promise resolving when edit completes
137
+ */
138
+ abstract editMessage(messageId: UUID, content: MessageContent): Promise<void>;
139
+ /**
140
+ * Delete a message
141
+ * @param messageId - Message ID
142
+ * @returns Promise resolving when deletion completes
143
+ */
144
+ abstract deleteMessage(messageId: UUID): Promise<void>;
145
+ /**
146
+ * Add a reaction to a message
147
+ * @param messageId - Message ID
148
+ * @param emoji - Reaction emoji
149
+ * @returns Promise resolving when reaction is added
150
+ */
151
+ abstract addReaction(messageId: UUID, emoji: string): Promise<void>;
152
+ /**
153
+ * Remove a reaction from a message
154
+ * @param messageId - Message ID
155
+ * @param emoji - Reaction emoji
156
+ * @returns Promise resolving when reaction is removed
157
+ */
158
+ abstract removeReaction(messageId: UUID, emoji: string): Promise<void>;
159
+ /**
160
+ * Pin a message
161
+ * @param messageId - Message ID
162
+ * @returns Promise resolving when message is pinned
163
+ */
164
+ abstract pinMessage(messageId: UUID): Promise<void>;
165
+ /**
166
+ * Unpin a message
167
+ * @param messageId - Message ID
168
+ * @returns Promise resolving when message is unpinned
169
+ */
170
+ abstract unpinMessage(messageId: UUID): Promise<void>;
171
+ /**
172
+ * Get available channels
173
+ * @returns Promise resolving to array of channels
174
+ */
175
+ abstract getChannels(): Promise<MessageChannel[]>;
176
+ /**
177
+ * Get channel information
178
+ * @param channelId - Channel ID
179
+ * @returns Promise resolving to channel info
180
+ */
181
+ abstract getChannel(channelId: UUID): Promise<MessageChannel>;
182
+ /**
183
+ * Create a new channel
184
+ * @param name - Channel name
185
+ * @param type - Channel type
186
+ * @param options - Channel options
187
+ * @returns Promise resolving to new channel ID
188
+ */
189
+ abstract createChannel(name: string, type: MessageChannel['type'], options?: {
190
+ description?: string;
191
+ participants?: UUID[];
192
+ private?: boolean;
193
+ }): Promise<UUID>;
194
+ /**
195
+ * Search messages across channels
196
+ * @param query - Search query
197
+ * @param options - Search options
198
+ * @returns Promise resolving to search results
199
+ */
200
+ abstract searchMessages(query: string, options?: MessageSearchOptions): Promise<MessageInfo[]>;
201
+ }
202
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,WAAW,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC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AAQ,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAEnE;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAEtE;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAEnD;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAErD;;;OAGG;IACH,QAAQ,CAAC,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC;IAEjD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC;IAE7D;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;QACtB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GACA,OAAO,CAAC,IAAI,CAAC;IAEhB;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;CAC/F"}
@@ -0,0 +1,45 @@
1
+ import type { Content, UUID } from './primitives';
2
+ import type { IAgentRuntime } from './runtime';
3
+ /**
4
+ * Information describing the target of a message.
5
+ */
6
+ export interface TargetInfo {
7
+ source: string;
8
+ roomId?: UUID;
9
+ channelId?: string;
10
+ serverId?: string;
11
+ entityId?: UUID;
12
+ threadId?: string;
13
+ }
14
+ /**
15
+ * Function signature for handlers responsible for sending messages to specific platforms.
16
+ */
17
+ export type SendHandlerFunction = (runtime: IAgentRuntime, target: TargetInfo, content: Content) => Promise<void>;
18
+ export declare enum SOCKET_MESSAGE_TYPE {
19
+ ROOM_JOINING = 1,
20
+ SEND_MESSAGE = 2,
21
+ MESSAGE = 3,
22
+ ACK = 4,
23
+ THINKING = 5,
24
+ CONTROL = 6
25
+ }
26
+ /**
27
+ * Interface for control messages sent from the backend to the frontend
28
+ * to manage UI state and interaction capabilities
29
+ */
30
+ export interface ControlMessage {
31
+ /** Message type identifier */
32
+ type: 'control';
33
+ /** Control message payload */
34
+ payload: {
35
+ /** Action to perform */
36
+ action: 'disable_input' | 'enable_input';
37
+ /** Optional target element identifier */
38
+ target?: string;
39
+ /** Additional optional parameters */
40
+ [key: string]: unknown;
41
+ };
42
+ /** Room ID to ensure signal is directed to the correct chat window */
43
+ roomId: UUID;
44
+ }
45
+ //# sourceMappingURL=messaging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/messaging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,IAAI,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAEnB;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAChC,OAAO,EAAE,aAAa,EACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;AAEnB,oBAAY,mBAAmB;IAC7B,YAAY,IAAI;IAChB,YAAY,IAAI;IAChB,OAAO,IAAI;IACX,GAAG,IAAI;IACP,QAAQ,IAAI;IACZ,OAAO,IAAI;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,8BAA8B;IAC9B,IAAI,EAAE,SAAS,CAAC;IAEhB,8BAA8B;IAC9B,OAAO,EAAE;QACP,wBAAwB;QACxB,MAAM,EAAE,eAAe,GAAG,cAAc,CAAC;QAEzC,yCAAyC;QACzC,MAAM,CAAC,EAAE,MAAM,CAAC;QAEhB,qCAAqC;QACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IAEF,sEAAsE;IACtE,MAAM,EAAE,IAAI,CAAC;CACd"}
@@ -0,0 +1,319 @@
1
+ import type { IAgentRuntime } from './runtime';
2
+ export type ModelTypeName = (typeof ModelType)[keyof typeof ModelType] | string;
3
+ /**
4
+ * Defines the recognized types of models that the agent runtime can use.
5
+ * These include models for text generation (small, large, reasoning, completion),
6
+ * text embedding, tokenization (encode/decode), image generation and description,
7
+ * audio transcription, text-to-speech, and generic object generation.
8
+ * This constant is used throughout the system, particularly in `AgentRuntime.useModel`,
9
+ * `AgentRuntime.registerModel`, and in `ModelParamsMap` / `ModelResultMap` to ensure
10
+ * type safety and clarity when working with different AI models.
11
+ * String values are used for extensibility with custom model types.
12
+ */
13
+ export declare const ModelType: {
14
+ readonly SMALL: "TEXT_SMALL";
15
+ readonly MEDIUM: "TEXT_LARGE";
16
+ readonly LARGE: "TEXT_LARGE";
17
+ readonly TEXT_SMALL: "TEXT_SMALL";
18
+ readonly TEXT_LARGE: "TEXT_LARGE";
19
+ readonly TEXT_EMBEDDING: "TEXT_EMBEDDING";
20
+ readonly TEXT_TOKENIZER_ENCODE: "TEXT_TOKENIZER_ENCODE";
21
+ readonly TEXT_TOKENIZER_DECODE: "TEXT_TOKENIZER_DECODE";
22
+ readonly TEXT_REASONING_SMALL: "REASONING_SMALL";
23
+ readonly TEXT_REASONING_LARGE: "REASONING_LARGE";
24
+ readonly TEXT_COMPLETION: "TEXT_COMPLETION";
25
+ readonly IMAGE: "IMAGE";
26
+ readonly IMAGE_DESCRIPTION: "IMAGE_DESCRIPTION";
27
+ readonly TRANSCRIPTION: "TRANSCRIPTION";
28
+ readonly TEXT_TO_SPEECH: "TEXT_TO_SPEECH";
29
+ readonly AUDIO: "AUDIO";
30
+ readonly VIDEO: "VIDEO";
31
+ readonly OBJECT_SMALL: "OBJECT_SMALL";
32
+ readonly OBJECT_LARGE: "OBJECT_LARGE";
33
+ };
34
+ /**
35
+ * Model configuration setting keys used in character settings.
36
+ * These constants define the keys for accessing model parameters
37
+ * from character configuration with support for per-model-type settings.
38
+ *
39
+ * Setting Precedence (highest to lowest):
40
+ * 1. Parameters passed directly to useModel()
41
+ * 2. Model-specific settings (e.g., TEXT_SMALL_TEMPERATURE)
42
+ * 3. Default settings (e.g., DEFAULT_TEMPERATURE)
43
+ *
44
+ * Example character settings:
45
+ * ```
46
+ * settings: {
47
+ * DEFAULT_TEMPERATURE: 0.7, // Applies to all models
48
+ * TEXT_SMALL_TEMPERATURE: 0.5, // Overrides default for TEXT_SMALL
49
+ * TEXT_LARGE_MAX_TOKENS: 4096, // Specific to TEXT_LARGE
50
+ * OBJECT_SMALL_TEMPERATURE: 0.3, // Specific to OBJECT_SMALL
51
+ * }
52
+ * ```
53
+ */
54
+ export declare const MODEL_SETTINGS: {
55
+ readonly DEFAULT_MAX_TOKENS: "DEFAULT_MAX_TOKENS";
56
+ readonly DEFAULT_TEMPERATURE: "DEFAULT_TEMPERATURE";
57
+ readonly DEFAULT_FREQUENCY_PENALTY: "DEFAULT_FREQUENCY_PENALTY";
58
+ readonly DEFAULT_PRESENCE_PENALTY: "DEFAULT_PRESENCE_PENALTY";
59
+ readonly TEXT_SMALL_MAX_TOKENS: "TEXT_SMALL_MAX_TOKENS";
60
+ readonly TEXT_SMALL_TEMPERATURE: "TEXT_SMALL_TEMPERATURE";
61
+ readonly TEXT_SMALL_FREQUENCY_PENALTY: "TEXT_SMALL_FREQUENCY_PENALTY";
62
+ readonly TEXT_SMALL_PRESENCE_PENALTY: "TEXT_SMALL_PRESENCE_PENALTY";
63
+ readonly TEXT_LARGE_MAX_TOKENS: "TEXT_LARGE_MAX_TOKENS";
64
+ readonly TEXT_LARGE_TEMPERATURE: "TEXT_LARGE_TEMPERATURE";
65
+ readonly TEXT_LARGE_FREQUENCY_PENALTY: "TEXT_LARGE_FREQUENCY_PENALTY";
66
+ readonly TEXT_LARGE_PRESENCE_PENALTY: "TEXT_LARGE_PRESENCE_PENALTY";
67
+ readonly OBJECT_SMALL_MAX_TOKENS: "OBJECT_SMALL_MAX_TOKENS";
68
+ readonly OBJECT_SMALL_TEMPERATURE: "OBJECT_SMALL_TEMPERATURE";
69
+ readonly OBJECT_SMALL_FREQUENCY_PENALTY: "OBJECT_SMALL_FREQUENCY_PENALTY";
70
+ readonly OBJECT_SMALL_PRESENCE_PENALTY: "OBJECT_SMALL_PRESENCE_PENALTY";
71
+ readonly OBJECT_LARGE_MAX_TOKENS: "OBJECT_LARGE_MAX_TOKENS";
72
+ readonly OBJECT_LARGE_TEMPERATURE: "OBJECT_LARGE_TEMPERATURE";
73
+ readonly OBJECT_LARGE_FREQUENCY_PENALTY: "OBJECT_LARGE_FREQUENCY_PENALTY";
74
+ readonly OBJECT_LARGE_PRESENCE_PENALTY: "OBJECT_LARGE_PRESENCE_PENALTY";
75
+ readonly MODEL_MAX_TOKEN: "MODEL_MAX_TOKEN";
76
+ readonly MODEL_TEMPERATURE: "MODEL_TEMPERATURE";
77
+ readonly MODEL_FREQ_PENALTY: "MODEL_FREQ_PENALTY";
78
+ readonly MODEL_PRESENCE_PENALTY: "MODEL_PRESENCE_PENALTY";
79
+ };
80
+ /**
81
+ * Helper to get the model-specific setting key for a given model type and parameter.
82
+ * @param modelType The model type (e.g., TEXT_SMALL, TEXT_LARGE)
83
+ * @param param The parameter name (e.g., MAX_TOKENS, TEMPERATURE)
84
+ * @returns The appropriate setting key or null if not a supported model type
85
+ */
86
+ export declare function getModelSpecificSettingKey(modelType: ModelTypeName, param: 'MAX_TOKENS' | 'TEMPERATURE' | 'FREQUENCY_PENALTY' | 'PRESENCE_PENALTY'): string | null;
87
+ /**
88
+ * Parameters for generating text using a language model.
89
+ * This structure is typically passed to `AgentRuntime.useModel` when the `modelType` is one of
90
+ * `ModelType.TEXT_SMALL`, `ModelType.TEXT_LARGE`, `ModelType.TEXT_REASONING_SMALL`,
91
+ * `ModelType.TEXT_REASONING_LARGE`, or `ModelType.TEXT_COMPLETION`.
92
+ * It includes essential information like the prompt, model type, and various generation controls.
93
+ */
94
+ export type GenerateTextParams = {
95
+ /** The `AgentRuntime` instance, providing access to models and other services. */
96
+ runtime: IAgentRuntime;
97
+ /** The input string or prompt that the language model will use to generate text. */
98
+ prompt: string;
99
+ /** Specifies the type of text generation model to use (e.g., TEXT_LARGE, REASONING_SMALL). */
100
+ modelType: ModelTypeName;
101
+ /** Optional. The maximum number of tokens to generate in the response. */
102
+ maxTokens?: number;
103
+ /** Optional. Controls randomness (0.0-1.0). Lower values are more deterministic, higher are more creative. */
104
+ temperature?: number;
105
+ /** Optional. Penalizes new tokens based on their existing frequency in the text so far. */
106
+ frequencyPenalty?: number;
107
+ /** Optional. Penalizes new tokens based on whether they appear in the text so far. */
108
+ presencePenalty?: number;
109
+ /** Optional. A list of sequences at which the model will stop generating further tokens. */
110
+ stopSequences?: string[];
111
+ };
112
+ /**
113
+ * Parameters for detokenizing text, i.e., converting a sequence of numerical tokens back into a string.
114
+ * This is the reverse operation of tokenization.
115
+ * This structure is used with `AgentRuntime.useModel` when the `modelType` is `ModelType.TEXT_TOKENIZER_DECODE`.
116
+ */
117
+ export interface DetokenizeTextParams {
118
+ /** An array of numerical tokens to be converted back into text. */
119
+ tokens: number[];
120
+ /** The model type used for detokenization, ensuring consistency with the original tokenization. */
121
+ modelType: ModelTypeName;
122
+ }
123
+ /**
124
+ * Base parameters common to all model types
125
+ */
126
+ export interface BaseModelParams {
127
+ /** The agent runtime for accessing services and utilities */
128
+ runtime: IAgentRuntime;
129
+ }
130
+ /**
131
+ * Parameters for text generation models
132
+ */
133
+ export interface TextGenerationParams extends BaseModelParams {
134
+ /** The prompt to generate text from */
135
+ prompt: string;
136
+ /** Model temperature (0.0 to 1.0, lower is more deterministic) */
137
+ temperature?: number;
138
+ /** Maximum number of tokens to generate */
139
+ maxTokens?: number;
140
+ /** Sequences that should stop generation when encountered */
141
+ stopSequences?: string[];
142
+ /** Frequency penalty to apply */
143
+ frequencyPenalty?: number;
144
+ /** Presence penalty to apply */
145
+ presencePenalty?: number;
146
+ }
147
+ /**
148
+ * Parameters for text embedding models
149
+ */
150
+ export interface TextEmbeddingParams extends BaseModelParams {
151
+ /** The text to create embeddings for */
152
+ text: string;
153
+ }
154
+ /**
155
+ * Parameters for text tokenization models
156
+ */
157
+ export interface TokenizeTextParams extends BaseModelParams {
158
+ /** The text to tokenize */
159
+ prompt: string;
160
+ /** The model type to use for tokenization */
161
+ modelType: ModelTypeName;
162
+ }
163
+ /**
164
+ * Parameters for image generation models
165
+ */
166
+ export interface ImageGenerationParams extends BaseModelParams {
167
+ /** The prompt describing the image to generate */
168
+ prompt: string;
169
+ /** The dimensions of the image to generate */
170
+ size?: string;
171
+ /** Number of images to generate */
172
+ count?: number;
173
+ }
174
+ /**
175
+ * Parameters for image description models
176
+ */
177
+ export interface ImageDescriptionParams extends BaseModelParams {
178
+ /** The URL or path of the image to describe */
179
+ imageUrl: string;
180
+ /** Optional prompt to guide the description */
181
+ prompt?: string;
182
+ }
183
+ /**
184
+ * Parameters for transcription models
185
+ */
186
+ export interface TranscriptionParams extends BaseModelParams {
187
+ /** The URL or path of the audio file to transcribe */
188
+ audioUrl: string;
189
+ /** Optional prompt to guide transcription */
190
+ prompt?: string;
191
+ }
192
+ /**
193
+ * Parameters for text-to-speech models
194
+ */
195
+ export interface TextToSpeechParams extends BaseModelParams {
196
+ /** The text to convert to speech */
197
+ text: string;
198
+ /** The voice to use */
199
+ voice?: string;
200
+ /** The speaking speed */
201
+ speed?: number;
202
+ }
203
+ /**
204
+ * Parameters for audio processing models
205
+ */
206
+ export interface AudioProcessingParams extends BaseModelParams {
207
+ /** The URL or path of the audio file to process */
208
+ audioUrl: string;
209
+ /** The type of audio processing to perform */
210
+ processingType: string;
211
+ }
212
+ /**
213
+ * Parameters for video processing models
214
+ */
215
+ export interface VideoProcessingParams extends BaseModelParams {
216
+ /** The URL or path of the video file to process */
217
+ videoUrl: string;
218
+ /** The type of video processing to perform */
219
+ processingType: string;
220
+ }
221
+ /**
222
+ * Optional JSON schema for validating generated objects
223
+ */
224
+ export type JSONSchema = {
225
+ type: string;
226
+ properties?: Record<string, any>;
227
+ required?: string[];
228
+ items?: JSONSchema;
229
+ [key: string]: any;
230
+ };
231
+ /**
232
+ * Parameters for object generation models
233
+ * @template T - The expected return type, inferred from schema if provided
234
+ */
235
+ export interface ObjectGenerationParams extends BaseModelParams {
236
+ /** The prompt describing the object to generate */
237
+ prompt: string;
238
+ /** Optional JSON schema for validation */
239
+ schema?: JSONSchema;
240
+ /** Type of object to generate */
241
+ output?: 'object' | 'array' | 'enum';
242
+ /** For enum type, the allowed values */
243
+ enumValues?: string[];
244
+ /** Model type to use */
245
+ modelType?: ModelTypeName;
246
+ /** Model temperature (0.0 to 1.0) */
247
+ temperature?: number;
248
+ /** Sequences that should stop generation */
249
+ stopSequences?: string[];
250
+ }
251
+ /**
252
+ * Map of model types to their parameter types
253
+ */
254
+ export interface ModelParamsMap {
255
+ [ModelType.TEXT_SMALL]: TextGenerationParams;
256
+ [ModelType.TEXT_LARGE]: TextGenerationParams;
257
+ [ModelType.TEXT_EMBEDDING]: TextEmbeddingParams | string | null;
258
+ [ModelType.TEXT_TOKENIZER_ENCODE]: TokenizeTextParams;
259
+ [ModelType.TEXT_TOKENIZER_DECODE]: DetokenizeTextParams;
260
+ [ModelType.TEXT_REASONING_SMALL]: TextGenerationParams;
261
+ [ModelType.TEXT_REASONING_LARGE]: TextGenerationParams;
262
+ [ModelType.IMAGE]: ImageGenerationParams;
263
+ [ModelType.IMAGE_DESCRIPTION]: ImageDescriptionParams | string;
264
+ [ModelType.TRANSCRIPTION]: TranscriptionParams | Buffer | string;
265
+ [ModelType.TEXT_TO_SPEECH]: TextToSpeechParams | string;
266
+ [ModelType.AUDIO]: AudioProcessingParams;
267
+ [ModelType.VIDEO]: VideoProcessingParams;
268
+ [ModelType.OBJECT_SMALL]: ObjectGenerationParams;
269
+ [ModelType.OBJECT_LARGE]: ObjectGenerationParams;
270
+ [key: string]: BaseModelParams | any;
271
+ }
272
+ /**
273
+ * Map of model types to their return value types
274
+ */
275
+ export interface ModelResultMap {
276
+ [ModelType.TEXT_SMALL]: string;
277
+ [ModelType.TEXT_LARGE]: string;
278
+ [ModelType.TEXT_EMBEDDING]: number[];
279
+ [ModelType.TEXT_TOKENIZER_ENCODE]: number[];
280
+ [ModelType.TEXT_TOKENIZER_DECODE]: string;
281
+ [ModelType.TEXT_REASONING_SMALL]: string;
282
+ [ModelType.TEXT_REASONING_LARGE]: string;
283
+ [ModelType.IMAGE]: {
284
+ url: string;
285
+ }[];
286
+ [ModelType.IMAGE_DESCRIPTION]: {
287
+ title: string;
288
+ description: string;
289
+ };
290
+ [ModelType.TRANSCRIPTION]: string;
291
+ [ModelType.TEXT_TO_SPEECH]: any | Buffer;
292
+ [ModelType.AUDIO]: any;
293
+ [ModelType.VIDEO]: any;
294
+ [ModelType.OBJECT_SMALL]: any;
295
+ [ModelType.OBJECT_LARGE]: any;
296
+ [key: string]: any;
297
+ }
298
+ /**
299
+ * Defines the structure for a model handler registration within the `AgentRuntime`.
300
+ * Each model (e.g., for text generation, embedding) is associated with a handler function,
301
+ * the name of the provider (plugin or system) that registered it, and an optional priority.
302
+ * The `priority` (higher is more preferred) helps in selecting which handler to use if multiple
303
+ * handlers are registered for the same model type. The `registrationOrder` (not in type, but used in runtime)
304
+ * serves as a tie-breaker. See `AgentRuntime.registerModel` and `AgentRuntime.getModel`.
305
+ */
306
+ export interface ModelHandler {
307
+ /** The function that executes the model, taking runtime and parameters, and returning a Promise. */
308
+ handler: (runtime: IAgentRuntime, params: Record<string, unknown>) => Promise<unknown>;
309
+ /** The name of the provider (e.g., plugin name) that registered this model handler. */
310
+ provider: string;
311
+ /**
312
+ * Optional priority for this model handler. Higher numbers indicate higher priority.
313
+ * This is used by `AgentRuntime.getModel` to select the most appropriate handler
314
+ * when multiple are available for a given model type. Defaults to 0 if not specified.
315
+ */
316
+ priority?: number;
317
+ registrationOrder?: number;
318
+ }
319
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,GAAG,MAAM,CAAC;AAEhF;;;;;;;;;GASG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;CAoBZ,CAAC;AAEX;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;CAoCjB,CAAC;AAEX;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,YAAY,GAAG,aAAa,GAAG,mBAAmB,GAAG,kBAAkB,GAC7E,MAAM,GAAG,IAAI,CAQf;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kFAAkF;IAClF,OAAO,EAAE,aAAa,CAAC;IACvB,oFAAoF;IACpF,MAAM,EAAE,MAAM,CAAC;IACf,8FAA8F;IAC9F,SAAS,EAAE,aAAa,CAAC;IACzB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,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MAAM,WAAW,YAAY;IAC3B,oGAAoG;IACpG,OAAO,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACvF,uFAAuF;IACvF,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1,68 @@
1
+ import { Service } from './service';
2
+ export interface PdfExtractionResult {
3
+ text: string;
4
+ pageCount: number;
5
+ metadata?: {
6
+ title?: string;
7
+ author?: string;
8
+ createdAt?: Date;
9
+ modifiedAt?: Date;
10
+ };
11
+ }
12
+ export interface PdfGenerationOptions {
13
+ format?: 'A4' | 'A3' | 'Letter';
14
+ orientation?: 'portrait' | 'landscape';
15
+ margins?: {
16
+ top?: number;
17
+ bottom?: number;
18
+ left?: number;
19
+ right?: number;
20
+ };
21
+ header?: string;
22
+ footer?: string;
23
+ }
24
+ export interface PdfConversionOptions {
25
+ quality?: 'high' | 'medium' | 'low';
26
+ outputFormat?: 'pdf' | 'pdf/a';
27
+ compression?: boolean;
28
+ }
29
+ /**
30
+ * Interface for PDF processing services
31
+ */
32
+ export declare abstract class IPdfService extends Service {
33
+ static readonly serviceType: "pdf";
34
+ readonly capabilityDescription = "PDF processing, extraction, and generation capabilities";
35
+ /**
36
+ * Extract text and metadata from a PDF file
37
+ * @param pdfPath - Path to the PDF file or buffer
38
+ * @returns Promise resolving to extracted text and metadata
39
+ */
40
+ abstract extractText(pdfPath: string | Buffer): Promise<PdfExtractionResult>;
41
+ /**
42
+ * Generate a PDF from HTML content
43
+ * @param htmlContent - HTML content to convert to PDF
44
+ * @param options - PDF generation options
45
+ * @returns Promise resolving to PDF buffer
46
+ */
47
+ abstract generatePdf(htmlContent: string, options?: PdfGenerationOptions): Promise<Buffer>;
48
+ /**
49
+ * Convert a document to PDF format
50
+ * @param filePath - Path to the document file
51
+ * @param options - Conversion options
52
+ * @returns Promise resolving to PDF buffer
53
+ */
54
+ abstract convertToPdf(filePath: string, options?: PdfConversionOptions): Promise<Buffer>;
55
+ /**
56
+ * Merge multiple PDF files into one
57
+ * @param pdfPaths - Array of PDF file paths or buffers
58
+ * @returns Promise resolving to merged PDF buffer
59
+ */
60
+ abstract mergePdfs(pdfPaths: (string | Buffer)[]): Promise<Buffer>;
61
+ /**
62
+ * Split a PDF into individual pages
63
+ * @param pdfPath - Path to the PDF file or buffer
64
+ * @returns Promise resolving to array of page buffers
65
+ */
66
+ abstract splitPdf(pdfPath: string | Buffer): Promise<Buffer[]>;
67
+ }
68
+ //# sourceMappingURL=pdf.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pdf.d.ts","sourceRoot":"","sources":["../../../../../core/src/types/pdf.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,WAAW,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,IAAI,CAAC;QACjB,UAAU,CAAC,EAAE,IAAI,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,QAAQ,CAAC;IAChC,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACvC,OAAO,CAAC,EAAE;QACR,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IA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