agents 0.0.0-f5b5854 → 0.0.0-f5ccde3
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 +257 -27
- package/dist/ai-chat-agent.d.ts +130 -12
- package/dist/ai-chat-agent.js +798 -160
- package/dist/ai-chat-agent.js.map +1 -1
- package/dist/ai-chat-v5-migration-BSiGZmYU.js +155 -0
- package/dist/ai-chat-v5-migration-BSiGZmYU.js.map +1 -0
- package/dist/ai-chat-v5-migration.d.ts +155 -0
- package/dist/ai-chat-v5-migration.js +3 -0
- package/dist/ai-react.d.ts +78 -72
- package/dist/ai-react.js +411 -188
- package/dist/ai-react.js.map +1 -1
- package/dist/ai-types-81H_-Uxh.d.ts +103 -0
- package/dist/ai-types-CrMqkwc_.js +24 -0
- package/dist/ai-types-CrMqkwc_.js.map +1 -0
- package/dist/ai-types.d.ts +6 -69
- package/dist/ai-types.js +3 -1
- package/dist/cli.d.ts +8 -0
- package/dist/cli.js +27 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-B3SR12TQ.js +117 -0
- package/dist/client-B3SR12TQ.js.map +1 -0
- package/dist/client-BAQA84dr.d.ts +104 -0
- package/dist/client-BZq9qau2.js +1093 -0
- package/dist/client-BZq9qau2.js.map +1 -0
- package/dist/client-CsaP9Irq.d.ts +1528 -0
- package/dist/client.d.ts +12 -79
- package/dist/client.js +3 -130
- package/dist/codemode/ai.d.ts +27 -0
- package/dist/codemode/ai.js +151 -0
- package/dist/codemode/ai.js.map +1 -0
- package/dist/do-oauth-client-provider-C2CHH5x-.d.ts +55 -0
- package/dist/do-oauth-client-provider-CwqK5SXm.js +94 -0
- package/dist/do-oauth-client-provider-CwqK5SXm.js.map +1 -0
- package/dist/index-BUle9RiP.d.ts +58 -0
- package/dist/index-Bx5KK3VJ.d.ts +587 -0
- package/dist/index.d.ts +63 -295
- package/dist/index.js +7 -20
- package/dist/mcp/client.d.ts +4 -763
- package/dist/mcp/client.js +3 -407
- package/dist/mcp/do-oauth-client-provider.d.ts +2 -41
- package/dist/mcp/do-oauth-client-provider.js +2 -106
- package/dist/mcp/index.d.ts +191 -59
- package/dist/mcp/index.js +1436 -767
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/x402.d.ts +34 -0
- package/dist/mcp/x402.js +198 -0
- package/dist/mcp/x402.js.map +1 -0
- package/dist/mcp-BwPscEiF.d.ts +61 -0
- package/dist/observability/index.d.ts +3 -0
- package/dist/observability/index.js +7 -0
- package/dist/react-CbwD4fBf.d.ts +113 -0
- package/dist/react.d.ts +10 -39
- package/dist/react.js +183 -98
- package/dist/react.js.map +1 -1
- package/dist/schedule.d.ts +89 -12
- package/dist/schedule.js +46 -23
- package/dist/schedule.js.map +1 -1
- package/dist/serializable-faDkMCai.d.ts +39 -0
- package/dist/serializable.d.ts +7 -0
- package/dist/serializable.js +1 -0
- package/dist/src-D_KKH_4c.js +1184 -0
- package/dist/src-D_KKH_4c.js.map +1 -0
- package/package.json +125 -65
- package/dist/ai-types.js.map +0 -1
- package/dist/chunk-HMLY7DHA.js +0 -16
- package/dist/chunk-HMLY7DHA.js.map +0 -1
- package/dist/chunk-XG52S6YY.js +0 -591
- package/dist/chunk-XG52S6YY.js.map +0 -1
- package/dist/client.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/mcp/client.js.map +0 -1
- package/dist/mcp/do-oauth-client-provider.js.map +0 -1
- package/src/index.ts +0 -912
package/dist/ai-react.d.ts
CHANGED
|
@@ -1,88 +1,94 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import "
|
|
6
|
-
import "
|
|
7
|
-
import "./
|
|
1
|
+
import "./client-CsaP9Irq.js";
|
|
2
|
+
import "./mcp-BwPscEiF.js";
|
|
3
|
+
import "./do-oauth-client-provider-C2CHH5x-.js";
|
|
4
|
+
import "./index-BUle9RiP.js";
|
|
5
|
+
import "./ai-types-81H_-Uxh.js";
|
|
6
|
+
import "./index-Bx5KK3VJ.js";
|
|
7
|
+
import "./serializable-faDkMCai.js";
|
|
8
|
+
import "./client-BAQA84dr.js";
|
|
9
|
+
import { n as useAgent } from "./react-CbwD4fBf.js";
|
|
10
|
+
import { UseChatOptions, useChat } from "@ai-sdk/react";
|
|
11
|
+
import { ChatInit, UIMessage } from "ai";
|
|
8
12
|
|
|
13
|
+
//#region src/ai-react.d.ts
|
|
14
|
+
type AITool<Input = unknown, Output = unknown> = {
|
|
15
|
+
description?: string;
|
|
16
|
+
inputSchema?: unknown;
|
|
17
|
+
execute?: (input: Input) => Output | Promise<Output>;
|
|
18
|
+
};
|
|
9
19
|
type GetInitialMessagesOptions = {
|
|
10
20
|
agent: string;
|
|
11
21
|
name: string;
|
|
12
22
|
url: string;
|
|
13
23
|
};
|
|
24
|
+
type UseChatParams<M extends UIMessage = UIMessage> = ChatInit<M> &
|
|
25
|
+
UseChatOptions<M>;
|
|
14
26
|
/**
|
|
15
27
|
* Options for the useAgentChat hook
|
|
16
28
|
*/
|
|
17
|
-
type UseAgentChatOptions<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
type UseAgentChatOptions<
|
|
30
|
+
State,
|
|
31
|
+
ChatMessage extends UIMessage = UIMessage
|
|
32
|
+
> = Omit<UseChatParams<ChatMessage>, "fetch"> & {
|
|
33
|
+
/** Agent connection from useAgent */
|
|
34
|
+
agent: ReturnType<typeof useAgent<State>>;
|
|
35
|
+
getInitialMessages?:
|
|
36
|
+
| undefined
|
|
37
|
+
| null
|
|
38
|
+
| ((options: GetInitialMessagesOptions) => Promise<ChatMessage[]>);
|
|
39
|
+
/** Request credentials */
|
|
40
|
+
credentials?: RequestCredentials;
|
|
41
|
+
/** Request headers */
|
|
42
|
+
headers?: HeadersInit;
|
|
43
|
+
/**
|
|
44
|
+
* @description Whether to automatically resolve tool calls that do not require human interaction.
|
|
45
|
+
* @experimental
|
|
46
|
+
*/
|
|
47
|
+
experimental_automaticToolResolution?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* @description Tools object for automatic detection of confirmation requirements.
|
|
50
|
+
* Tools without execute function will require confirmation.
|
|
51
|
+
*/
|
|
52
|
+
tools?: Record<string, AITool<unknown, unknown>>;
|
|
53
|
+
/**
|
|
54
|
+
* @description Manual override for tools requiring confirmation.
|
|
55
|
+
* If not provided, will auto-detect from tools object.
|
|
56
|
+
*/
|
|
57
|
+
toolsRequiringConfirmation?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* When true (default), automatically sends the next message only after
|
|
60
|
+
* all pending confirmation-required tool calls have been resolved.
|
|
61
|
+
* @default true
|
|
62
|
+
*/
|
|
63
|
+
autoSendAfterAllConfirmationsResolved?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Set to false to disable automatic stream resumption.
|
|
66
|
+
* @default true
|
|
67
|
+
*/
|
|
68
|
+
resume?: boolean;
|
|
69
|
+
};
|
|
28
70
|
/**
|
|
29
71
|
* React hook for building AI chat interfaces using an Agent
|
|
30
72
|
* @param options Chat options including the agent connection
|
|
31
73
|
* @returns Chat interface controls and state with added clearHistory method
|
|
32
74
|
*/
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
75
|
+
/**
|
|
76
|
+
* Automatically detects which tools require confirmation based on their configuration.
|
|
77
|
+
* Tools require confirmation if they have no execute function AND are not server-executed.
|
|
78
|
+
* @param tools - Record of tool name to tool definition
|
|
79
|
+
* @returns Array of tool names that require confirmation
|
|
80
|
+
*/
|
|
81
|
+
declare function detectToolsRequiringConfirmation(
|
|
82
|
+
tools?: Record<string, AITool<unknown, unknown>>
|
|
83
|
+
): string[];
|
|
84
|
+
declare function useAgentChat<
|
|
85
|
+
State = unknown,
|
|
86
|
+
ChatMessage extends UIMessage = UIMessage
|
|
87
|
+
>(
|
|
88
|
+
options: UseAgentChatOptions<State, ChatMessage>
|
|
89
|
+
): ReturnType<typeof useChat<ChatMessage>> & {
|
|
44
90
|
clearHistory: () => void;
|
|
45
|
-
messages: ai.UIMessage[];
|
|
46
|
-
error: undefined | Error;
|
|
47
|
-
append: (
|
|
48
|
-
message: Message | ai.CreateMessage,
|
|
49
|
-
chatRequestOptions?: ai.ChatRequestOptions
|
|
50
|
-
) => Promise<string | null | undefined>;
|
|
51
|
-
reload: (
|
|
52
|
-
chatRequestOptions?: ai.ChatRequestOptions
|
|
53
|
-
) => Promise<string | null | undefined>;
|
|
54
|
-
stop: () => void;
|
|
55
|
-
input: string;
|
|
56
|
-
setInput: React.Dispatch<React.SetStateAction<string>>;
|
|
57
|
-
handleInputChange: (
|
|
58
|
-
e:
|
|
59
|
-
| React.ChangeEvent<HTMLInputElement>
|
|
60
|
-
| React.ChangeEvent<HTMLTextAreaElement>
|
|
61
|
-
) => void;
|
|
62
|
-
handleSubmit: (
|
|
63
|
-
event?: {
|
|
64
|
-
preventDefault?: () => void;
|
|
65
|
-
},
|
|
66
|
-
chatRequestOptions?: ai.ChatRequestOptions
|
|
67
|
-
) => void;
|
|
68
|
-
metadata?: Object;
|
|
69
|
-
isLoading: boolean;
|
|
70
|
-
status: "submitted" | "streaming" | "ready" | "error";
|
|
71
|
-
data?: ai.JSONValue[];
|
|
72
|
-
setData: (
|
|
73
|
-
data:
|
|
74
|
-
| ai.JSONValue[]
|
|
75
|
-
| undefined
|
|
76
|
-
| ((data: ai.JSONValue[] | undefined) => ai.JSONValue[] | undefined)
|
|
77
|
-
) => void;
|
|
78
|
-
id: string;
|
|
79
|
-
addToolResult: ({
|
|
80
|
-
toolCallId,
|
|
81
|
-
result,
|
|
82
|
-
}: {
|
|
83
|
-
toolCallId: string;
|
|
84
|
-
result: any;
|
|
85
|
-
}) => void;
|
|
86
91
|
};
|
|
87
|
-
|
|
88
|
-
export { useAgentChat };
|
|
92
|
+
//#endregion
|
|
93
|
+
export { AITool, detectToolsRequiringConfirmation, useAgentChat };
|
|
94
|
+
//# sourceMappingURL=ai-react.d.ts.map
|