hybrid 1.2.2 → 1.2.3

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.
@@ -1,7 +1,8 @@
1
1
  import * as ai from 'ai';
2
- import { UIMessage, LanguageModel, generateText, TelemetrySettings, streamText, UIMessageStreamOnFinishCallback } from 'ai';
2
+ import { LanguageModel, UIMessage, generateText, TelemetrySettings, streamText, UIMessageStreamOnFinishCallback } from 'ai';
3
3
  import { z } from 'zod';
4
- import { HonoVariables, MessageListenerConfig, XmtpConversation, XmtpMessage, XmtpSender, XmtpSubjects, XmtpServiceClient } from '@hybrd/xmtp';
4
+ import { HonoVariables, MessageListenerConfig } from '@hybrd/xmtp';
5
+ import { A as AgentRuntime, T as Tool } from './tool-CoVdD8Fb.js';
5
6
  import { Hono } from 'hono';
6
7
 
7
8
  /**
@@ -151,74 +152,6 @@ type ListenOptions = {
151
152
  */
152
153
  declare function listen({ agent, port, filter, plugins }: ListenOptions): Promise<void>;
153
154
 
154
- interface BaseRuntime extends Record<string, unknown> {
155
- conversation: XmtpConversation;
156
- message: XmtpMessage;
157
- parentMessage?: XmtpMessage;
158
- rootMessage: XmtpMessage;
159
- sender: XmtpSender;
160
- subjects: XmtpSubjects;
161
- xmtpClient: XmtpServiceClient;
162
- }
163
- type AgentRuntime = BaseRuntime & {
164
- chatId?: string;
165
- messages: Array<UIMessage>;
166
- };
167
- interface XmtpCredentials {
168
- inboxId: string;
169
- xmtpServiceUrl: string;
170
- xmtpServiceToken: string;
171
- }
172
-
173
- type DefaultRuntimeExtension$1 = Record<string, never>;
174
- /**
175
- * Configuration interface for creating custom tools that integrate with AI SDK.
176
- */
177
- interface ToolConfig<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny, TRuntimeExtension = DefaultRuntimeExtension$1> {
178
- /** Unique identifier for the tool */
179
- id: string;
180
- /** Human-readable description of what the tool does */
181
- description: string;
182
- /** Zod schema for validating tool input */
183
- inputSchema: TInput;
184
- /** Optional Zod schema for validating tool output */
185
- outputSchema?: TOutput;
186
- /** Function that executes the tool's logic */
187
- execute: (args: {
188
- input: z.infer<TInput>;
189
- runtime: AgentRuntime & TRuntimeExtension;
190
- messages: UIMessage[];
191
- }) => Promise<z.infer<TOutput>>;
192
- }
193
- /**
194
- * Internal tool interface used throughout the agent framework.
195
- * Similar to ToolConfig but without the ID field, used after tool creation.
196
- */
197
- interface Tool<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny, TRuntimeExtension = DefaultRuntimeExtension$1> {
198
- /** Human-readable description of what the tool does */
199
- description: string;
200
- /** Zod schema for validating tool input */
201
- inputSchema: TInput;
202
- /** Optional Zod schema for validating tool output */
203
- outputSchema?: TOutput;
204
- /** Function that executes the tool's logic */
205
- execute: (args: {
206
- input: z.infer<TInput>;
207
- runtime: AgentRuntime & TRuntimeExtension;
208
- messages: UIMessage[];
209
- }) => Promise<z.infer<TOutput>>;
210
- }
211
- /**
212
- * Factory function to create tools with custom runtime extensions.
213
- * Provides proper type inference for input/output schemas and runtime extensions.
214
- */
215
- declare function toolFactory<TRuntimeExtension = DefaultRuntimeExtension$1>(): <TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny>(config: ToolConfig<TInput, TOutput, TRuntimeExtension>) => Tool<TInput, TOutput, TRuntimeExtension>;
216
- /**
217
- * Default tool factory with no runtime extensions.
218
- * Type-safe at creation time with proper schema inference.
219
- */
220
- declare const createTool: <TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny>(config: ToolConfig<TInput, TOutput, DefaultRuntimeExtension$1>) => Tool<TInput, TOutput, DefaultRuntimeExtension$1>;
221
-
222
155
  type DefaultRuntimeExtension = Record<string, never>;
223
156
  /**
224
157
  * Tool that can be used in Agent configuration.
@@ -398,4 +331,4 @@ declare class Agent<TRuntimeExtension = DefaultRuntimeExtension> {
398
331
  listen(opts: Omit<ListenOptions, "agent">): Promise<void>;
399
332
  }
400
333
 
401
- export { Agent as A, type BaseRuntime as B, type DefaultRuntimeExtension as D, type ListenOptions as L, PluginRegistry as P, type Tool as T, type XmtpCredentials as X, type AgentConfig as a, type Plugin as b, createTool as c, type ToolConfig as d, type AgentRuntime as e, type PluginContext as f, listen as l, toolFactory as t };
334
+ export { Agent as A, type DefaultRuntimeExtension as D, type ListenOptions as L, PluginRegistry as P, type AgentConfig as a, type Plugin as b, type PluginContext as c, listen as l };
@@ -1,7 +1,8 @@
1
1
  import * as ai from 'ai';
2
- import { UIMessage, LanguageModel, generateText, TelemetrySettings, streamText, UIMessageStreamOnFinishCallback } from 'ai';
2
+ import { LanguageModel, UIMessage, generateText, TelemetrySettings, streamText, UIMessageStreamOnFinishCallback } from 'ai';
3
3
  import { z } from 'zod';
4
- import { HonoVariables, MessageListenerConfig, XmtpConversation, XmtpMessage, XmtpSender, XmtpSubjects, XmtpServiceClient } from '@hybrd/xmtp';
4
+ import { HonoVariables, MessageListenerConfig } from '@hybrd/xmtp';
5
+ import { A as AgentRuntime, T as Tool } from './tool-CoVdD8Fb.cjs';
5
6
  import { Hono } from 'hono';
6
7
 
7
8
  /**
@@ -151,74 +152,6 @@ type ListenOptions = {
151
152
  */
152
153
  declare function listen({ agent, port, filter, plugins }: ListenOptions): Promise<void>;
153
154
 
154
- interface BaseRuntime extends Record<string, unknown> {
155
- conversation: XmtpConversation;
156
- message: XmtpMessage;
157
- parentMessage?: XmtpMessage;
158
- rootMessage: XmtpMessage;
159
- sender: XmtpSender;
160
- subjects: XmtpSubjects;
161
- xmtpClient: XmtpServiceClient;
162
- }
163
- type AgentRuntime = BaseRuntime & {
164
- chatId?: string;
165
- messages: Array<UIMessage>;
166
- };
167
- interface XmtpCredentials {
168
- inboxId: string;
169
- xmtpServiceUrl: string;
170
- xmtpServiceToken: string;
171
- }
172
-
173
- type DefaultRuntimeExtension$1 = Record<string, never>;
174
- /**
175
- * Configuration interface for creating custom tools that integrate with AI SDK.
176
- */
177
- interface ToolConfig<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny, TRuntimeExtension = DefaultRuntimeExtension$1> {
178
- /** Unique identifier for the tool */
179
- id: string;
180
- /** Human-readable description of what the tool does */
181
- description: string;
182
- /** Zod schema for validating tool input */
183
- inputSchema: TInput;
184
- /** Optional Zod schema for validating tool output */
185
- outputSchema?: TOutput;
186
- /** Function that executes the tool's logic */
187
- execute: (args: {
188
- input: z.infer<TInput>;
189
- runtime: AgentRuntime & TRuntimeExtension;
190
- messages: UIMessage[];
191
- }) => Promise<z.infer<TOutput>>;
192
- }
193
- /**
194
- * Internal tool interface used throughout the agent framework.
195
- * Similar to ToolConfig but without the ID field, used after tool creation.
196
- */
197
- interface Tool<TInput extends z.ZodTypeAny = z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny, TRuntimeExtension = DefaultRuntimeExtension$1> {
198
- /** Human-readable description of what the tool does */
199
- description: string;
200
- /** Zod schema for validating tool input */
201
- inputSchema: TInput;
202
- /** Optional Zod schema for validating tool output */
203
- outputSchema?: TOutput;
204
- /** Function that executes the tool's logic */
205
- execute: (args: {
206
- input: z.infer<TInput>;
207
- runtime: AgentRuntime & TRuntimeExtension;
208
- messages: UIMessage[];
209
- }) => Promise<z.infer<TOutput>>;
210
- }
211
- /**
212
- * Factory function to create tools with custom runtime extensions.
213
- * Provides proper type inference for input/output schemas and runtime extensions.
214
- */
215
- declare function toolFactory<TRuntimeExtension = DefaultRuntimeExtension$1>(): <TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny>(config: ToolConfig<TInput, TOutput, TRuntimeExtension>) => Tool<TInput, TOutput, TRuntimeExtension>;
216
- /**
217
- * Default tool factory with no runtime extensions.
218
- * Type-safe at creation time with proper schema inference.
219
- */
220
- declare const createTool: <TInput extends z.ZodTypeAny, TOutput extends z.ZodTypeAny = z.ZodTypeAny>(config: ToolConfig<TInput, TOutput, DefaultRuntimeExtension$1>) => Tool<TInput, TOutput, DefaultRuntimeExtension$1>;
221
-
222
155
  type DefaultRuntimeExtension = Record<string, never>;
223
156
  /**
224
157
  * Tool that can be used in Agent configuration.
@@ -398,4 +331,4 @@ declare class Agent<TRuntimeExtension = DefaultRuntimeExtension> {
398
331
  listen(opts: Omit<ListenOptions, "agent">): Promise<void>;
399
332
  }
400
333
 
401
- export { Agent as A, type BaseRuntime as B, type DefaultRuntimeExtension as D, type ListenOptions as L, PluginRegistry as P, type Tool as T, type XmtpCredentials as X, type AgentConfig as a, type Plugin as b, createTool as c, type ToolConfig as d, type AgentRuntime as e, type PluginContext as f, listen as l, toolFactory as t };
334
+ export { Agent as A, type DefaultRuntimeExtension as D, type ListenOptions as L, PluginRegistry as P, type AgentConfig as a, type Plugin as b, type PluginContext as c, listen as l };