experimental-agent 0.3.0 → 0.4.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/README.md +61 -0
- package/dist/{adapter-BigchkkI.d.mts → adapter-zgOel4wW.d.mts} +89 -34
- package/dist/{adapter-BigchkkI.d.ts → adapter-zgOel4wW.d.ts} +89 -34
- package/dist/chunk-IV75IMEW.mjs +328 -0
- package/dist/{chunk-ELWIUJUK.mjs → chunk-MSTM6W3Y.mjs} +5 -2
- package/dist/{entry-CZd9aAwn.d.mts → entry-6HYg5qqg.d.mts} +1 -1
- package/dist/{entry-BmQ8FO-5.d.ts → entry-BrWOmEK2.d.ts} +1 -1
- package/dist/index.d.mts +45 -59
- package/dist/index.d.ts +45 -59
- package/dist/index.js +411 -57
- package/dist/index.mjs +282 -59
- package/dist/lifecycle-workflow-steps.d.mts +2 -2
- package/dist/lifecycle-workflow-steps.d.ts +2 -2
- package/dist/lifecycle-workflow.d.mts +2 -2
- package/dist/lifecycle-workflow.d.ts +2 -2
- package/dist/next/loader.js +5 -2
- package/dist/next/loader.mjs +1 -1
- package/dist/next.js +9 -3
- package/dist/next.mjs +6 -3
- package/dist/sandbox.d.mts +3 -3
- package/dist/sandbox.d.ts +3 -3
- package/dist/{steps-u-mGDbP_.d.mts → steps-BIsP57pm.d.mts} +1 -1
- package/dist/{steps-BnkRQKlc.d.ts → steps-DShnXBLf.d.ts} +1 -1
- package/dist/storage.d.mts +9 -3
- package/dist/storage.d.ts +9 -3
- package/dist/storage.js +135 -1
- package/dist/storage.mjs +5 -1
- package/package.json +4 -1
- package/dist/chunk-DOD4MC5D.mjs +0 -196
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as _vercel_sandbox from '@vercel/sandbox';
|
|
2
|
-
import { S as SandboxBinding, a as SandboxSetupFields, b as SandboxInstance, W as WithConfig, c as LoggingConfig, E as ExecResult, U as UploadableFile } from './steps-
|
|
3
|
-
export { d as SandboxAgentRef } from './steps-
|
|
4
|
-
import { L as LocalBindingConfig, a as LocalBindingMetadata, V as VercelBindingConfig, b as VercelBindingMetadata, D as DockerBindingConfig, c as DockerBindingMetadata } from './entry-
|
|
2
|
+
import { S as SandboxBinding, a as SandboxSetupFields, b as SandboxInstance, W as WithConfig, c as LoggingConfig, E as ExecResult, U as UploadableFile } from './steps-DShnXBLf.js';
|
|
3
|
+
export { d as SandboxAgentRef } from './steps-DShnXBLf.js';
|
|
4
|
+
import { L as LocalBindingConfig, a as LocalBindingMetadata, V as VercelBindingConfig, b as VercelBindingMetadata, D as DockerBindingConfig, c as DockerBindingMetadata } from './entry-BrWOmEK2.js';
|
|
5
5
|
import * as ai from 'ai';
|
|
6
6
|
import { InferToolInput, ModelMessage, ToolSet, UIMessage, InferUITools, GatewayModelId } from 'ai';
|
|
7
|
-
import { b as Session, e as Storage, i as StorageInput } from './adapter-BigchkkI.js';
|
|
8
7
|
import { z } from 'zod';
|
|
8
|
+
import { c as Session, f as Storage, j as SkillInput, k as StorageInput } from './adapter-zgOel4wW.js';
|
|
9
|
+
export { l as GitSkillEntry, m as GitSkillInput, H as HostSkillEntry, n as HostSkillInput, I as InlineSkillEntry, o as InlineSkillInput, p as SandboxSkillEntry, q as SandboxSkillInput, r as SkillEntry, s as SkillSourceType } from './adapter-zgOel4wW.js';
|
|
9
10
|
import { WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@workflow/serde';
|
|
10
11
|
import * as errore from 'errore';
|
|
11
12
|
|
|
@@ -59,16 +60,6 @@ type SessionUsage = {
|
|
|
59
60
|
byMessageId: Record<string, UsageSummary | null>;
|
|
60
61
|
};
|
|
61
62
|
|
|
62
|
-
type StreamOptions = {
|
|
63
|
-
messageId?: string;
|
|
64
|
-
startIndex?: number;
|
|
65
|
-
};
|
|
66
|
-
type WorkflowRunLike = {
|
|
67
|
-
getReadable(options?: {
|
|
68
|
-
startIndex?: number;
|
|
69
|
-
}): ReadableStream;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
63
|
type ToolContext<TContext = Record<string, unknown>> = {
|
|
73
64
|
session: Session;
|
|
74
65
|
sandbox: SandboxInstance;
|
|
@@ -231,14 +222,45 @@ type NeedsApprovalMap<Tools> = {
|
|
|
231
222
|
};
|
|
232
223
|
type InferUIMessage<A> = A extends {
|
|
233
224
|
tools: infer T extends ToolSet;
|
|
225
|
+
$UIMessage: UIMessage<infer M>;
|
|
226
|
+
} ? UIMessage<M, AgentDataTypes, InferUITools<T>> : A extends {
|
|
227
|
+
tools: infer T extends ToolSet;
|
|
234
228
|
} ? UIMessage<unknown, AgentDataTypes, InferUITools<T>> : UIMessage<unknown, AgentDataTypes>;
|
|
235
|
-
type TypedUIMessage<Tools extends ToolSet = ToolSet> = UIMessage<
|
|
229
|
+
type TypedUIMessage<TMessageMetadata = unknown, Tools extends ToolSet = ToolSet> = UIMessage<TMessageMetadata, AgentDataTypes, InferUITools<Tools>>;
|
|
230
|
+
|
|
231
|
+
type StreamOptions = {
|
|
232
|
+
messageId?: string;
|
|
233
|
+
startIndex?: number;
|
|
234
|
+
};
|
|
235
|
+
type WorkflowRunLike = {
|
|
236
|
+
getReadable(options?: {
|
|
237
|
+
startIndex?: number;
|
|
238
|
+
}): ReadableStream;
|
|
239
|
+
};
|
|
236
240
|
|
|
237
241
|
type UpdateOptions<Tools extends ToolSet> = Partial<Omit<Session, "id" | "activeTools" | "model"> & {
|
|
238
242
|
model?: GatewayModelId;
|
|
239
243
|
activeTools?: (Extract<keyof Tools, string> | BuiltInToolName)[];
|
|
240
244
|
}>;
|
|
241
245
|
|
|
246
|
+
type ApprovalData = {
|
|
247
|
+
approvalId: string;
|
|
248
|
+
approved: boolean;
|
|
249
|
+
reason?: string;
|
|
250
|
+
};
|
|
251
|
+
type MessageData<Tools extends ToolSet> = UIMessage | {
|
|
252
|
+
role?: TypedUIMessage<unknown, Tools>["role"];
|
|
253
|
+
parts: TypedUIMessage<unknown, Tools>["parts"];
|
|
254
|
+
metadata?: Record<string, unknown> | null;
|
|
255
|
+
id?: string;
|
|
256
|
+
};
|
|
257
|
+
type SendInput<Tools extends ToolSet> = string | MessageData<Tools> | {
|
|
258
|
+
type: "message";
|
|
259
|
+
message: MessageData<Tools>;
|
|
260
|
+
} | {
|
|
261
|
+
type: "approval";
|
|
262
|
+
approval: ApprovalData;
|
|
263
|
+
};
|
|
242
264
|
type SendOptions<Tools extends ToolSet, TContext> = {
|
|
243
265
|
interruptIfStreaming?: boolean | {
|
|
244
266
|
lastPart: {
|
|
@@ -266,7 +288,7 @@ type SessionDefaults<Tools extends ToolSet = ToolSet> = {
|
|
|
266
288
|
system?: string;
|
|
267
289
|
generation?: Session["generation"];
|
|
268
290
|
activeTools?: (Extract<keyof Tools, string> | BuiltInToolName)[];
|
|
269
|
-
|
|
291
|
+
skills?: SkillInput[];
|
|
270
292
|
};
|
|
271
293
|
type AgentOptions<Tools extends ToolSet = any, TSandboxBindings extends SandboxBinding | SandboxBinding[] = SandboxBinding, TContext extends Record<string, unknown> = Record<string, never>> = SessionDefaults<Tools> & {
|
|
272
294
|
storage?: StorageInput;
|
|
@@ -277,10 +299,10 @@ type AgentOptions<Tools extends ToolSet = any, TSandboxBindings extends SandboxB
|
|
|
277
299
|
contextSchema?: z.ZodType<TContext>;
|
|
278
300
|
logging?: Omit<LoggingConfig, "name">;
|
|
279
301
|
};
|
|
280
|
-
type AnyAgent = Agent<any, any, any>;
|
|
302
|
+
type AnyAgent = Agent<any, any, any, any>;
|
|
281
303
|
type InferSession<Agent extends AnyAgent = AnyAgent> = ReturnType<Agent["session"]>;
|
|
282
304
|
type SessionSendArgs<Agent extends AnyAgent, Session extends InferSession<Agent> = InferSession<Agent>> = Parameters<Session["send"]>;
|
|
283
|
-
declare class Agent<Tools extends ToolSet, TSandboxBindings extends SandboxBinding | SandboxBinding[] = SandboxBinding, TContext extends Record<string, unknown> = Record<string, never>> {
|
|
305
|
+
declare class Agent<TMessageMetadata = unknown, Tools extends ToolSet = ToolSet, TSandboxBindings extends SandboxBinding | SandboxBinding[] = SandboxBinding, TContext extends Record<string, unknown> = Record<string, never>> {
|
|
284
306
|
readonly name: string;
|
|
285
307
|
options: AgentOptions<Tools, TSandboxBindings, TContext>;
|
|
286
308
|
constructor(name: string, options?: AgentOptions<Tools, TSandboxBindings, TContext>);
|
|
@@ -290,7 +312,7 @@ declare class Agent<Tools extends ToolSet, TSandboxBindings extends SandboxBindi
|
|
|
290
312
|
static [WORKFLOW_DESERIALIZE](data: {
|
|
291
313
|
name: string;
|
|
292
314
|
}): AnyAgent;
|
|
293
|
-
private
|
|
315
|
+
private _resolvedStorage;
|
|
294
316
|
get storage(): Storage;
|
|
295
317
|
get tools(): typeof builtInTools & Tools;
|
|
296
318
|
get sessionDefaults(): SessionDefaults;
|
|
@@ -299,43 +321,7 @@ declare class Agent<Tools extends ToolSet, TSandboxBindings extends SandboxBindi
|
|
|
299
321
|
id?: string;
|
|
300
322
|
} | undefined) => {
|
|
301
323
|
id: string;
|
|
302
|
-
send: (input:
|
|
303
|
-
type: "approval";
|
|
304
|
-
approval: {
|
|
305
|
-
approvalId: string;
|
|
306
|
-
approved: boolean;
|
|
307
|
-
reason?: string;
|
|
308
|
-
};
|
|
309
|
-
} | (UIMessage<unknown, ai.UIDataTypes, ai.UITools> | {
|
|
310
|
-
role?: TypedUIMessage<Tools_1>["role"];
|
|
311
|
-
parts: ai.UIMessagePart<AgentDataTypes, InferUITools<Tools>>[];
|
|
312
|
-
id?: string;
|
|
313
|
-
}) | {
|
|
314
|
-
type: "message";
|
|
315
|
-
message: UIMessage<unknown, ai.UIDataTypes, ai.UITools> | {
|
|
316
|
-
role?: TypedUIMessage<Tools_1>["role"];
|
|
317
|
-
parts: ai.UIMessagePart<AgentDataTypes, InferUITools<Tools>>[];
|
|
318
|
-
id?: string;
|
|
319
|
-
};
|
|
320
|
-
}) | (string | {
|
|
321
|
-
type: "approval";
|
|
322
|
-
approval: {
|
|
323
|
-
approvalId: string;
|
|
324
|
-
approved: boolean;
|
|
325
|
-
reason?: string;
|
|
326
|
-
};
|
|
327
|
-
} | (UIMessage<unknown, ai.UIDataTypes, ai.UITools> | {
|
|
328
|
-
role?: TypedUIMessage<Tools_1>["role"];
|
|
329
|
-
parts: ai.UIMessagePart<AgentDataTypes, InferUITools<Tools>>[];
|
|
330
|
-
id?: string;
|
|
331
|
-
}) | {
|
|
332
|
-
type: "message";
|
|
333
|
-
message: UIMessage<unknown, ai.UIDataTypes, ai.UITools> | {
|
|
334
|
-
role?: TypedUIMessage<Tools_1>["role"];
|
|
335
|
-
parts: ai.UIMessagePart<AgentDataTypes, InferUITools<Tools>>[];
|
|
336
|
-
id?: string;
|
|
337
|
-
};
|
|
338
|
-
})[], opts?: SendOptions<Tools, TContext> | undefined) => Promise<SendResult>;
|
|
324
|
+
send: (input: SendInput<Tools> | SendInput<Tools>[], opts?: SendOptions<Tools, TContext> | undefined) => Promise<SendResult>;
|
|
339
325
|
stream: (runOrOpts?: WorkflowRunLike | StreamOptions | undefined) => Promise<ReadableStream<ai.UIMessageChunk>>;
|
|
340
326
|
history: () => Promise<{
|
|
341
327
|
messages: UIMessage<unknown, AgentDataTypes, InferUITools<Tools>>[];
|
|
@@ -398,9 +384,9 @@ declare class Agent<Tools extends ToolSet, TSandboxBindings extends SandboxBindi
|
|
|
398
384
|
} | undefined) => Promise<"pending" | "running" | "stopping" | "stopped" | "failed">;
|
|
399
385
|
};
|
|
400
386
|
/** Phantom property for type inference. Use `typeof myAgent.$UIMessage` to get the typed UIMessage. */
|
|
401
|
-
readonly $UIMessage: UIMessage<
|
|
387
|
+
readonly $UIMessage: UIMessage<TMessageMetadata, AgentDataTypes, InferUITools<typeof builtInTools & Tools>>;
|
|
402
388
|
}
|
|
403
|
-
declare function agent<Tools extends ToolSet, TSandboxBindings extends SandboxBinding | SandboxBinding[] = SandboxBinding, TContext extends Record<string, unknown> = Record<string, never>>(name: string, options?: AgentOptions<Tools, TSandboxBindings, TContext>): Agent<Tools, TSandboxBindings, TContext>;
|
|
389
|
+
declare function agent<TMessageMetadata = unknown, Tools extends ToolSet = ToolSet, TSandboxBindings extends SandboxBinding | SandboxBinding[] = SandboxBinding, TContext extends Record<string, unknown> = Record<string, never>>(name: string, options?: AgentOptions<Tools, TSandboxBindings, TContext>): Agent<TMessageMetadata, Tools, TSandboxBindings, TContext>;
|
|
404
390
|
|
|
405
391
|
declare const SessionNotFoundError_base: errore.FactoryTaggedErrorClass<"SessionNotFoundError", "Session $id not found", Error>;
|
|
406
392
|
declare class SessionNotFoundError extends SessionNotFoundError_base {
|
|
@@ -421,4 +407,4 @@ declare const MessageNotFoundError_base: errore.FactoryTaggedErrorClass<"Message
|
|
|
421
407
|
declare class MessageNotFoundError extends MessageNotFoundError_base {
|
|
422
408
|
}
|
|
423
409
|
|
|
424
|
-
export { type AgentDataTypes, type AgentHooks, type AgentOptions, AgentStatus, type AnyAgent, type BuiltInToolName, ExecResult, type InferSession, type InferUIMessage, MessageNotFoundError, type NeedsApprovalMap, SandboxBinding, SandboxError, SandboxInstance, SandboxNotFoundError, SandboxSetupFields, type SessionDefaults, SessionNotFoundError, type SessionSendArgs, type StepUsage, StorageConflictError, StorageError, type ToolContext, UploadableFile, type UsageSummary, type WorkflowRunLike, agent, builtinToolNames };
|
|
410
|
+
export { type AgentDataTypes, type AgentHooks, type AgentOptions, AgentStatus, type AnyAgent, type ApprovalData, type BuiltInToolName, ExecResult, type InferSession, type InferUIMessage, MessageNotFoundError, type NeedsApprovalMap, SandboxBinding, SandboxError, SandboxInstance, SandboxNotFoundError, SandboxSetupFields, type SendInput, type SessionDefaults, SessionNotFoundError, type SessionSendArgs, SkillInput, type StepUsage, StorageConflictError, StorageError, type ToolContext, UploadableFile, type UsageSummary, type WorkflowRunLike, agent, builtinToolNames };
|