@slashfi/agents-sdk 0.1.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.
- package/LICENSE +21 -0
- package/README.md +274 -0
- package/dist/auth.d.ts +109 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +329 -0
- package/dist/auth.js.map +1 -0
- package/dist/build.d.ts +68 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +159 -0
- package/dist/build.js.map +1 -0
- package/dist/define.d.ts +87 -0
- package/dist/define.d.ts.map +1 -0
- package/dist/define.js +71 -0
- package/dist/define.js.map +1 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/registry.d.ts +48 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +274 -0
- package/dist/registry.js.map +1 -0
- package/dist/server.d.ts +66 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +308 -0
- package/dist/server.js.map +1 -0
- package/dist/types.d.ts +389 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +54 -0
- package/src/auth.ts +493 -0
- package/src/build.ts +238 -0
- package/src/define.ts +153 -0
- package/src/index.ts +111 -0
- package/src/registry.ts +403 -0
- package/src/server.ts +460 -0
- package/src/types.ts +524 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Types for Agents SDK
|
|
3
|
+
*
|
|
4
|
+
* Defines the fundamental types for agent definitions, tools, and contexts.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* JSON Schema definition for tool input parameters.
|
|
8
|
+
*/
|
|
9
|
+
export type JsonSchema = {
|
|
10
|
+
type: "object" | "array" | "string" | "number" | "boolean" | "null";
|
|
11
|
+
properties?: Record<string, JsonSchema>;
|
|
12
|
+
items?: JsonSchema;
|
|
13
|
+
required?: string[];
|
|
14
|
+
description?: string;
|
|
15
|
+
enum?: unknown[];
|
|
16
|
+
default?: unknown;
|
|
17
|
+
additionalProperties?: boolean | JsonSchema;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Supported actions for agents.
|
|
22
|
+
*/
|
|
23
|
+
export type AgentAction = "invoke" | "ask" | "execute_tool" | "describe_tools" | "load" | "learn";
|
|
24
|
+
/**
|
|
25
|
+
* Agent configuration options.
|
|
26
|
+
*/
|
|
27
|
+
export interface AgentConfig {
|
|
28
|
+
/** Unique identifier for the agent */
|
|
29
|
+
id?: string;
|
|
30
|
+
/** Human-readable name */
|
|
31
|
+
name?: string;
|
|
32
|
+
/** Description of what the agent does */
|
|
33
|
+
description?: string;
|
|
34
|
+
/** Which actions this agent supports */
|
|
35
|
+
supportedActions?: AgentAction[];
|
|
36
|
+
/** LLM model to use */
|
|
37
|
+
model?: string;
|
|
38
|
+
/** Model-specific parameters */
|
|
39
|
+
modelParams?: {
|
|
40
|
+
maxTokens?: number;
|
|
41
|
+
temperature?: number;
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
};
|
|
44
|
+
/** Additional configuration */
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Caller type for context.
|
|
49
|
+
*/
|
|
50
|
+
export type CallerType = "agent" | "user" | "system";
|
|
51
|
+
/**
|
|
52
|
+
* Core context shared across all executions.
|
|
53
|
+
*/
|
|
54
|
+
export interface CoreContext {
|
|
55
|
+
/** Tenant ID for multi-tenant deployments */
|
|
56
|
+
tenantId: string;
|
|
57
|
+
/** Agent path being executed */
|
|
58
|
+
agentPath: string;
|
|
59
|
+
/** Branch ID for session context */
|
|
60
|
+
branchId?: string;
|
|
61
|
+
/** Current node ID within the branch */
|
|
62
|
+
nodeId?: string;
|
|
63
|
+
/** Branch attributes */
|
|
64
|
+
branchAttributes?: Record<string, string>;
|
|
65
|
+
/** ID of the caller */
|
|
66
|
+
callerId?: string;
|
|
67
|
+
/** Type of caller */
|
|
68
|
+
callerType?: CallerType;
|
|
69
|
+
/** Additional metadata */
|
|
70
|
+
metadata?: Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Context passed to tool execution.
|
|
74
|
+
*/
|
|
75
|
+
export interface ToolContext extends CoreContext {
|
|
76
|
+
/** ID of the caller (required for tools) */
|
|
77
|
+
callerId: string;
|
|
78
|
+
/** Type of caller (required for tools) */
|
|
79
|
+
callerType: CallerType;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Context for the onInvoke hook.
|
|
83
|
+
*
|
|
84
|
+
* @experimental The onInvoke hook is not yet implemented.
|
|
85
|
+
*/
|
|
86
|
+
export interface InvokeContext extends CoreContext {
|
|
87
|
+
/** The prompt/message that triggered this invocation */
|
|
88
|
+
prompt: string;
|
|
89
|
+
/** Session ID for continuity */
|
|
90
|
+
sessionId?: string;
|
|
91
|
+
/** Caller identity */
|
|
92
|
+
callerId: string;
|
|
93
|
+
callerType: CallerType;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Context for the onTick hook (heartbeat/scheduled).
|
|
97
|
+
*
|
|
98
|
+
* @experimental The onTick hook is not yet implemented.
|
|
99
|
+
*/
|
|
100
|
+
export interface TickContext extends CoreContext {
|
|
101
|
+
/** Timestamp of this tick */
|
|
102
|
+
timestamp: number;
|
|
103
|
+
/** Previous tick timestamp (for delta calculations) */
|
|
104
|
+
previousTick?: number;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Context for the onStep hook (after each LLM step).
|
|
108
|
+
*
|
|
109
|
+
* @experimental The onStep hook is not yet implemented.
|
|
110
|
+
*/
|
|
111
|
+
export interface StepContext extends CoreContext {
|
|
112
|
+
/** Sequence number in the branch */
|
|
113
|
+
sequence: number;
|
|
114
|
+
/** Type of step that completed */
|
|
115
|
+
stepType: "user" | "assistant" | "tool_use" | "tool_result";
|
|
116
|
+
/** Whether this step used tools */
|
|
117
|
+
usedTools: boolean;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Context for the onMessage hook (external message arrived).
|
|
121
|
+
*
|
|
122
|
+
* @experimental The onMessage hook is not yet implemented.
|
|
123
|
+
*/
|
|
124
|
+
export interface MessageContext extends CoreContext {
|
|
125
|
+
/** The message content */
|
|
126
|
+
content: string;
|
|
127
|
+
/** Source of the message */
|
|
128
|
+
source: {
|
|
129
|
+
type: "slack" | "email" | "api" | "thread" | string;
|
|
130
|
+
/** External ID (e.g., channel:thread_ts for Slack) */
|
|
131
|
+
externalId?: string;
|
|
132
|
+
};
|
|
133
|
+
/** Sender identity */
|
|
134
|
+
senderId: string;
|
|
135
|
+
senderType: "human" | "agent" | "bot" | "system";
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Context for the onLearn hook.
|
|
139
|
+
*
|
|
140
|
+
* @experimental The onLearn hook is not yet implemented.
|
|
141
|
+
*/
|
|
142
|
+
export interface LearnContext extends CoreContext {
|
|
143
|
+
/** Content to internalize */
|
|
144
|
+
content: string;
|
|
145
|
+
/** How long to remember */
|
|
146
|
+
scope: "session" | "persistent" | "global";
|
|
147
|
+
/** Category/topic for organization */
|
|
148
|
+
category?: string;
|
|
149
|
+
/** Who is teaching */
|
|
150
|
+
callerId: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Context for dynamic tool selection.
|
|
154
|
+
*/
|
|
155
|
+
export interface ToolSelectionContext extends CoreContext {
|
|
156
|
+
/** The current prompt/message */
|
|
157
|
+
prompt: string;
|
|
158
|
+
/** Caller identity and role */
|
|
159
|
+
caller: {
|
|
160
|
+
id: string;
|
|
161
|
+
type: CallerType;
|
|
162
|
+
role?: string;
|
|
163
|
+
};
|
|
164
|
+
/** Recent messages for context */
|
|
165
|
+
recentMessages?: string[];
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Agent runtime hooks.
|
|
169
|
+
*
|
|
170
|
+
* All hooks are optional. Agents without a runtime use default behavior.
|
|
171
|
+
*
|
|
172
|
+
* Currently supported:
|
|
173
|
+
* - `selectTools` - dynamic tool filtering
|
|
174
|
+
*
|
|
175
|
+
* Other hooks are defined for future use but not yet wired up.
|
|
176
|
+
*/
|
|
177
|
+
export interface AgentRuntime {
|
|
178
|
+
/**
|
|
179
|
+
* Called when the agent is invoked (new session or message).
|
|
180
|
+
* Use for setup, context hydration, routing decisions.
|
|
181
|
+
*
|
|
182
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
183
|
+
*/
|
|
184
|
+
onInvoke?: (ctx: InvokeContext) => Promise<void>;
|
|
185
|
+
/**
|
|
186
|
+
* Called periodically for background work.
|
|
187
|
+
* Use for polling, cleanup, proactive actions.
|
|
188
|
+
*
|
|
189
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
190
|
+
*/
|
|
191
|
+
onTick?: (ctx: TickContext) => Promise<void>;
|
|
192
|
+
/**
|
|
193
|
+
* Called after each LLM step completes.
|
|
194
|
+
* Use for logging, metrics, side effects.
|
|
195
|
+
*
|
|
196
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
197
|
+
*/
|
|
198
|
+
onStep?: (ctx: StepContext) => Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* Called when an external message arrives.
|
|
201
|
+
* Use for routing, filtering, pre-processing.
|
|
202
|
+
*
|
|
203
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
204
|
+
*/
|
|
205
|
+
onMessage?: (ctx: MessageContext) => Promise<void>;
|
|
206
|
+
/**
|
|
207
|
+
* Called when learning new information.
|
|
208
|
+
* Use for memory management, knowledge updates.
|
|
209
|
+
*
|
|
210
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
211
|
+
*/
|
|
212
|
+
onLearn?: (ctx: LearnContext) => Promise<void>;
|
|
213
|
+
/**
|
|
214
|
+
* Dynamically select which tools to expose for a request.
|
|
215
|
+
* Return tool names to include. If not implemented, all tools exposed.
|
|
216
|
+
*/
|
|
217
|
+
selectTools?: (ctx: ToolSelectionContext) => Promise<string[]>;
|
|
218
|
+
/**
|
|
219
|
+
* Called once when the agent starts.
|
|
220
|
+
*
|
|
221
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
222
|
+
*/
|
|
223
|
+
onStart?: () => Promise<void>;
|
|
224
|
+
/**
|
|
225
|
+
* Called once when the agent shuts down.
|
|
226
|
+
*
|
|
227
|
+
* @experimental Not yet implemented in the agent runtime.
|
|
228
|
+
*/
|
|
229
|
+
onStop?: () => Promise<void>;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Visibility level for tools and agents.
|
|
233
|
+
*/
|
|
234
|
+
export type Visibility = "public" | "internal" | "private";
|
|
235
|
+
/**
|
|
236
|
+
* A tool definition with execute function.
|
|
237
|
+
*/
|
|
238
|
+
export interface ToolDefinition<TContext extends ToolContext = ToolContext, TInput = unknown, TOutput = unknown> {
|
|
239
|
+
/** Tool name (unique within agent) */
|
|
240
|
+
name: string;
|
|
241
|
+
/** Short description for tool discovery */
|
|
242
|
+
description: string;
|
|
243
|
+
/** JSON Schema for input parameters */
|
|
244
|
+
inputSchema: JsonSchema;
|
|
245
|
+
/** JSON Schema for output (optional, for documentation) */
|
|
246
|
+
outputSchema?: JsonSchema;
|
|
247
|
+
/**
|
|
248
|
+
* Visibility level:
|
|
249
|
+
* - 'public': Anyone can call this tool
|
|
250
|
+
* - 'internal': Only agents in the same registry can call
|
|
251
|
+
* - 'private': Only the owning agent can call
|
|
252
|
+
*/
|
|
253
|
+
visibility?: Visibility;
|
|
254
|
+
/**
|
|
255
|
+
* Explicit list of callers allowed to use this tool.
|
|
256
|
+
*/
|
|
257
|
+
allowedCallers?: string[];
|
|
258
|
+
/**
|
|
259
|
+
* Execute the tool with validated input.
|
|
260
|
+
*/
|
|
261
|
+
execute: (input: TInput, ctx: TContext) => Promise<TOutput>;
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Tool schema for describe_tools response.
|
|
265
|
+
*/
|
|
266
|
+
export interface ToolSchema {
|
|
267
|
+
name: string;
|
|
268
|
+
description: string;
|
|
269
|
+
inputSchema: JsonSchema;
|
|
270
|
+
outputSchema?: JsonSchema;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Complete agent definition.
|
|
274
|
+
*/
|
|
275
|
+
export interface AgentDefinition<TContext extends ToolContext = ToolContext> {
|
|
276
|
+
/** Agent path (e.g., '@example', '/agents/my-agent') */
|
|
277
|
+
path: string;
|
|
278
|
+
/** System prompt / entrypoint content */
|
|
279
|
+
entrypoint: string;
|
|
280
|
+
/** Agent configuration */
|
|
281
|
+
config?: AgentConfig;
|
|
282
|
+
/** Tools provided by this agent */
|
|
283
|
+
tools: ToolDefinition<TContext, unknown, unknown>[];
|
|
284
|
+
/**
|
|
285
|
+
* Runtime hooks factory.
|
|
286
|
+
* Called once to create the runtime for this agent.
|
|
287
|
+
*/
|
|
288
|
+
runtime?: () => AgentRuntime;
|
|
289
|
+
/** Visibility level for the agent itself */
|
|
290
|
+
visibility?: Visibility;
|
|
291
|
+
/** Explicit list of callers allowed to invoke this agent */
|
|
292
|
+
allowedCallers?: string[];
|
|
293
|
+
}
|
|
294
|
+
/** Base request fields */
|
|
295
|
+
interface CallAgentBaseRequest {
|
|
296
|
+
/** Target agent path */
|
|
297
|
+
path: string;
|
|
298
|
+
/** Caller ID for access control */
|
|
299
|
+
callerId?: string;
|
|
300
|
+
/** Caller type */
|
|
301
|
+
callerType?: CallerType;
|
|
302
|
+
/** Additional metadata */
|
|
303
|
+
metadata?: Record<string, unknown>;
|
|
304
|
+
}
|
|
305
|
+
/** Invoke: fire-and-forget */
|
|
306
|
+
export interface CallAgentInvokeRequest extends CallAgentBaseRequest {
|
|
307
|
+
action: "invoke";
|
|
308
|
+
prompt: string;
|
|
309
|
+
sessionId?: string;
|
|
310
|
+
branchAttributes?: Record<string, string>;
|
|
311
|
+
}
|
|
312
|
+
/** Ask: invoke and wait for response */
|
|
313
|
+
export interface CallAgentAskRequest extends CallAgentBaseRequest {
|
|
314
|
+
action: "ask";
|
|
315
|
+
prompt: string;
|
|
316
|
+
sessionId?: string;
|
|
317
|
+
branchAttributes?: Record<string, string>;
|
|
318
|
+
}
|
|
319
|
+
/** Execute a specific tool */
|
|
320
|
+
export interface CallAgentExecuteToolRequest extends CallAgentBaseRequest {
|
|
321
|
+
action: "execute_tool";
|
|
322
|
+
tool: string;
|
|
323
|
+
params?: Record<string, unknown>;
|
|
324
|
+
}
|
|
325
|
+
/** Get tool schemas */
|
|
326
|
+
export interface CallAgentDescribeToolsRequest extends CallAgentBaseRequest {
|
|
327
|
+
action: "describe_tools";
|
|
328
|
+
/** Optional: filter to specific tools */
|
|
329
|
+
tools?: string[];
|
|
330
|
+
}
|
|
331
|
+
/** Load: get agent definition */
|
|
332
|
+
export interface CallAgentLoadRequest extends CallAgentBaseRequest {
|
|
333
|
+
action: "load";
|
|
334
|
+
}
|
|
335
|
+
/** Learn: teach the agent something */
|
|
336
|
+
export interface CallAgentLearnRequest extends CallAgentBaseRequest {
|
|
337
|
+
action: "learn";
|
|
338
|
+
content: string;
|
|
339
|
+
scope?: "session" | "persistent" | "global";
|
|
340
|
+
category?: string;
|
|
341
|
+
}
|
|
342
|
+
/** Union of all request types */
|
|
343
|
+
export type CallAgentRequest = CallAgentInvokeRequest | CallAgentAskRequest | CallAgentExecuteToolRequest | CallAgentDescribeToolsRequest | CallAgentLoadRequest | CallAgentLearnRequest;
|
|
344
|
+
/** Success response for invoke */
|
|
345
|
+
export interface CallAgentInvokeResponse {
|
|
346
|
+
success: true;
|
|
347
|
+
branchId: string;
|
|
348
|
+
}
|
|
349
|
+
/** Success response for ask */
|
|
350
|
+
export interface CallAgentAskResponse {
|
|
351
|
+
success: true;
|
|
352
|
+
branchId: string;
|
|
353
|
+
response: string;
|
|
354
|
+
}
|
|
355
|
+
/** Success response for execute_tool */
|
|
356
|
+
export interface CallAgentExecuteToolResponse {
|
|
357
|
+
success: true;
|
|
358
|
+
result: unknown;
|
|
359
|
+
}
|
|
360
|
+
/** Success response for describe_tools */
|
|
361
|
+
export interface CallAgentDescribeToolsResponse {
|
|
362
|
+
success: true;
|
|
363
|
+
tools: ToolSchema[];
|
|
364
|
+
}
|
|
365
|
+
/** Success response for load */
|
|
366
|
+
export interface CallAgentLoadResponse {
|
|
367
|
+
success: true;
|
|
368
|
+
result: {
|
|
369
|
+
path: string;
|
|
370
|
+
entrypoint: string;
|
|
371
|
+
config: AgentConfig | undefined;
|
|
372
|
+
tools: ToolSchema[];
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
/** Success response for learn */
|
|
376
|
+
export interface CallAgentLearnResponse {
|
|
377
|
+
success: true;
|
|
378
|
+
action: "stored" | "updated" | "ignored";
|
|
379
|
+
}
|
|
380
|
+
/** Error response */
|
|
381
|
+
export interface CallAgentErrorResponse {
|
|
382
|
+
success: false;
|
|
383
|
+
error: string;
|
|
384
|
+
code?: string;
|
|
385
|
+
}
|
|
386
|
+
/** Union of all response types */
|
|
387
|
+
export type CallAgentResponse = CallAgentInvokeResponse | CallAgentAskResponse | CallAgentExecuteToolResponse | CallAgentDescribeToolsResponse | CallAgentLoadResponse | CallAgentLearnResponse | CallAgentErrorResponse;
|
|
388
|
+
export {};
|
|
389
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,MA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,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC;QAChC,KAAK,EAAE,UAAU,EAAE,CAAC;KACrB,CAAC;CACH;AAED,iCAAiC;AACjC,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;CAC1C;AAED,qBAAqB;AACrB,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,kCAAkC;AAClC,MAAM,MAAM,iBAAiB,GACzB,uBAAuB,GACvB,oBAAoB,GACpB,4BAA4B,GAC5B,8BAA8B,GAC9B,qBAAqB,GACrB,sBAAsB,GACtB,sBAAsB,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@slashfi/agents-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"author": "Slash Financial",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/slashfi/agents-sdk.git"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@biomejs/biome": "^1.9.4",
|
|
12
|
+
"@types/bun": "^1.1.0",
|
|
13
|
+
"typescript": "^5.7.0"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"zod": "^3.23.0"
|
|
17
|
+
},
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"bun": "./src/index.ts",
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"import": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"description": "SDK for building AI agents with tool definitions and JSON-RPC servers",
|
|
26
|
+
"files": [
|
|
27
|
+
"dist",
|
|
28
|
+
"src"
|
|
29
|
+
],
|
|
30
|
+
"keywords": [
|
|
31
|
+
"ai",
|
|
32
|
+
"agents",
|
|
33
|
+
"llm",
|
|
34
|
+
"tools",
|
|
35
|
+
"mcp",
|
|
36
|
+
"json-rpc"
|
|
37
|
+
],
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"peerDependenciesMeta": {
|
|
40
|
+
"zod": {
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc",
|
|
46
|
+
"dev": "tsc --watch",
|
|
47
|
+
"test": "bun test",
|
|
48
|
+
"lint": "biome check src/",
|
|
49
|
+
"lint:fix": "biome check --write src/",
|
|
50
|
+
"prepublishOnly": "npm run build"
|
|
51
|
+
},
|
|
52
|
+
"type": "module",
|
|
53
|
+
"types": "dist/index.d.ts"
|
|
54
|
+
}
|