agents 0.0.0-c3e8618 → 0.0.0-c41ebbc

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 (76) hide show
  1. package/README.md +255 -27
  2. package/dist/_esm-LV5FJ3HK.js +3922 -0
  3. package/dist/_esm-LV5FJ3HK.js.map +1 -0
  4. package/dist/ai-chat-agent.d.ts +78 -23
  5. package/dist/ai-chat-agent.js +657 -0
  6. package/dist/ai-chat-agent.js.map +1 -0
  7. package/dist/ai-chat-v5-migration.d.ts +152 -0
  8. package/dist/ai-chat-v5-migration.js +20 -0
  9. package/dist/ai-chat-v5-migration.js.map +1 -0
  10. package/dist/ai-react.d.ts +86 -47
  11. package/dist/ai-react.js +356 -0
  12. package/dist/ai-react.js.map +1 -0
  13. package/dist/ai-types.d.ts +84 -41
  14. package/dist/ai-types.js +8 -0
  15. package/dist/ai-types.js.map +1 -0
  16. package/dist/ccip-CMBYN64O.js +15 -0
  17. package/dist/ccip-CMBYN64O.js.map +1 -0
  18. package/dist/chunk-5Y6BEZDY.js +276 -0
  19. package/dist/chunk-5Y6BEZDY.js.map +1 -0
  20. package/dist/chunk-BER7KXUJ.js +18 -0
  21. package/dist/chunk-BER7KXUJ.js.map +1 -0
  22. package/dist/chunk-C2OEBJZ2.js +113 -0
  23. package/dist/chunk-C2OEBJZ2.js.map +1 -0
  24. package/dist/chunk-JJBFIGUC.js +5202 -0
  25. package/dist/chunk-JJBFIGUC.js.map +1 -0
  26. package/dist/chunk-PR4QN5HX.js +43 -0
  27. package/dist/chunk-PR4QN5HX.js.map +1 -0
  28. package/dist/chunk-QEVM4BVL.js +116 -0
  29. package/dist/chunk-QEVM4BVL.js.map +1 -0
  30. package/dist/chunk-TYAY6AU6.js +159 -0
  31. package/dist/chunk-TYAY6AU6.js.map +1 -0
  32. package/dist/chunk-UJVEAURM.js +150 -0
  33. package/dist/chunk-UJVEAURM.js.map +1 -0
  34. package/dist/chunk-XGMKNUJA.js +1343 -0
  35. package/dist/chunk-XGMKNUJA.js.map +1 -0
  36. package/dist/chunk-ZMMHNOMZ.js +942 -0
  37. package/dist/chunk-ZMMHNOMZ.js.map +1 -0
  38. package/dist/client-D1Fa-xS_.d.ts +5120 -0
  39. package/dist/client.d.ts +71 -37
  40. package/dist/client.js +13 -0
  41. package/dist/client.js.map +1 -0
  42. package/dist/codemode/ai.d.ts +25 -0
  43. package/dist/codemode/ai.js +5200 -0
  44. package/dist/codemode/ai.js.map +1 -0
  45. package/dist/index.d.ts +479 -181
  46. package/dist/index.js +32 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/mcp/client.d.ts +12 -675
  49. package/dist/mcp/client.js +10 -0
  50. package/dist/mcp/client.js.map +1 -0
  51. package/dist/mcp/do-oauth-client-provider.d.ts +42 -0
  52. package/dist/mcp/do-oauth-client-provider.js +8 -0
  53. package/dist/mcp/do-oauth-client-provider.js.map +1 -0
  54. package/dist/mcp/index.d.ts +71 -33
  55. package/dist/mcp/index.js +1099 -0
  56. package/dist/mcp/index.js.map +1 -0
  57. package/dist/mcp/x402.d.ts +39 -0
  58. package/dist/mcp/x402.js +3195 -0
  59. package/dist/mcp/x402.js.map +1 -0
  60. package/dist/mcp-BH1fJeiU.d.ts +58 -0
  61. package/dist/observability/index.d.ts +34 -0
  62. package/dist/observability/index.js +12 -0
  63. package/dist/observability/index.js.map +1 -0
  64. package/dist/react.d.ts +115 -18
  65. package/dist/react.js +216 -0
  66. package/dist/react.js.map +1 -0
  67. package/dist/schedule.d.ts +106 -22
  68. package/dist/schedule.js +86 -0
  69. package/dist/schedule.js.map +1 -0
  70. package/dist/secp256k1-M22GZP2U.js +2193 -0
  71. package/dist/secp256k1-M22GZP2U.js.map +1 -0
  72. package/dist/serializable.d.ts +32 -0
  73. package/dist/serializable.js +1 -0
  74. package/dist/serializable.js.map +1 -0
  75. package/package.json +103 -52
  76. package/src/index.ts +1268 -156
package/dist/client.d.ts CHANGED
@@ -1,57 +1,81 @@
1
- import { PartySocketOptions, PartyFetchOptions, PartySocket } from 'partysocket';
1
+ import {
2
+ PartySocketOptions,
3
+ PartyFetchOptions,
4
+ PartySocket
5
+ } from "partysocket";
6
+ import { SerializableReturnValue, SerializableValue } from "./serializable.js";
2
7
 
3
8
  /**
4
9
  * Options for creating an AgentClient
5
10
  */
6
- type AgentClientOptions<State = unknown> = Omit<PartySocketOptions, "party" | "room"> & {
7
- /** Name of the agent to connect to */
8
- agent: string;
9
- /** Name of the specific Agent instance */
10
- name?: string;
11
- /** Called when the Agent's state is updated */
12
- onStateUpdate?: (state: State, source: "server" | "client") => void;
11
+ type AgentClientOptions<State = unknown> = Omit<
12
+ PartySocketOptions,
13
+ "party" | "room"
14
+ > & {
15
+ /** Name of the agent to connect to */
16
+ agent: string;
17
+ /** Name of the specific Agent instance */
18
+ name?: string;
19
+ /** Called when the Agent's state is updated */
20
+ onStateUpdate?: (state: State, source: "server" | "client") => void;
13
21
  };
14
22
  /**
15
23
  * Options for streaming RPC calls
16
24
  */
17
25
  type StreamOptions = {
18
- /** Called when a chunk of data is received */
19
- onChunk?: (chunk: unknown) => void;
20
- /** Called when the stream ends */
21
- onDone?: (finalChunk: unknown) => void;
22
- /** Called when an error occurs */
23
- onError?: (error: string) => void;
26
+ /** Called when a chunk of data is received */
27
+ onChunk?: (chunk: unknown) => void;
28
+ /** Called when the stream ends */
29
+ onDone?: (finalChunk: unknown) => void;
30
+ /** Called when an error occurs */
31
+ onError?: (error: string) => void;
24
32
  };
25
33
  /**
26
34
  * Options for the agentFetch function
27
35
  */
28
36
  type AgentClientFetchOptions = Omit<PartyFetchOptions, "party" | "room"> & {
29
- /** Name of the agent to connect to */
30
- agent: string;
31
- /** Name of the specific Agent instance */
32
- name?: string;
37
+ /** Name of the agent to connect to */
38
+ agent: string;
39
+ /** Name of the specific Agent instance */
40
+ name?: string;
33
41
  };
42
+ /**
43
+ * Convert a camelCase string to a kebab-case string
44
+ * @param str The string to convert
45
+ * @returns The kebab-case string
46
+ */
47
+ declare function camelCaseToKebabCase(str: string): string;
34
48
  /**
35
49
  * WebSocket client for connecting to an Agent
36
50
  */
37
51
  declare class AgentClient<State = unknown> extends PartySocket {
38
- #private;
39
- /**
40
- * @deprecated Use agentFetch instead
41
- */
42
- static fetch(_opts: PartyFetchOptions): Promise<Response>;
43
- agent: string;
44
- name: string;
45
- constructor(options: AgentClientOptions<State>);
46
- setState(state: State): void;
47
- /**
48
- * Call a method on the Agent
49
- * @param method Name of the method to call
50
- * @param args Arguments to pass to the method
51
- * @param streamOptions Options for handling streaming responses
52
- * @returns Promise that resolves with the method's return value
53
- */
54
- call<T = unknown>(method: string, args?: unknown[], streamOptions?: StreamOptions): Promise<T>;
52
+ /**
53
+ * @deprecated Use agentFetch instead
54
+ */
55
+ static fetch(_opts: PartyFetchOptions): Promise<Response>;
56
+ agent: string;
57
+ name: string;
58
+ private options;
59
+ private _pendingCalls;
60
+ constructor(options: AgentClientOptions<State>);
61
+ setState(state: State): void;
62
+ /**
63
+ * Call a method on the Agent
64
+ * @param method Name of the method to call
65
+ * @param args Arguments to pass to the method
66
+ * @param streamOptions Options for handling streaming responses
67
+ * @returns Promise that resolves with the method's return value
68
+ */
69
+ call<T extends SerializableReturnValue>(
70
+ method: string,
71
+ args?: SerializableValue[],
72
+ streamOptions?: StreamOptions
73
+ ): Promise<T>;
74
+ call<T = unknown>(
75
+ method: string,
76
+ args?: unknown[],
77
+ streamOptions?: StreamOptions
78
+ ): Promise<T>;
55
79
  }
56
80
  /**
57
81
  * Make an HTTP request to an Agent
@@ -59,6 +83,16 @@ declare class AgentClient<State = unknown> extends PartySocket {
59
83
  * @param init Request initialization options
60
84
  * @returns Promise resolving to a Response
61
85
  */
62
- declare function agentFetch(opts: AgentClientFetchOptions, init?: RequestInit): Promise<Response>;
86
+ declare function agentFetch(
87
+ opts: AgentClientFetchOptions,
88
+ init?: RequestInit
89
+ ): Promise<Response>;
63
90
 
64
- export { AgentClient, type AgentClientFetchOptions, type AgentClientOptions, type StreamOptions, agentFetch };
91
+ export {
92
+ AgentClient,
93
+ type AgentClientFetchOptions,
94
+ type AgentClientOptions,
95
+ type StreamOptions,
96
+ agentFetch,
97
+ camelCaseToKebabCase
98
+ };
package/dist/client.js ADDED
@@ -0,0 +1,13 @@
1
+ import {
2
+ AgentClient,
3
+ agentFetch,
4
+ camelCaseToKebabCase
5
+ } from "./chunk-QEVM4BVL.js";
6
+ import "./chunk-BER7KXUJ.js";
7
+ import "./chunk-PR4QN5HX.js";
8
+ export {
9
+ AgentClient,
10
+ agentFetch,
11
+ camelCaseToKebabCase
12
+ };
13
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,25 @@
1
+ import { ToolSet } from 'ai';
2
+ import { WorkerEntrypoint } from 'cloudflare:workers';
3
+
4
+ declare class CodeModeProxy extends WorkerEntrypoint<Cloudflare.Env, {
5
+ binding: string;
6
+ name: string;
7
+ callback: string;
8
+ }> {
9
+ callFunction(options: {
10
+ functionName: string;
11
+ args: unknown[];
12
+ }): Promise<any>;
13
+ }
14
+ declare function experimental_codemode(options: {
15
+ tools: ToolSet;
16
+ prompt: string;
17
+ globalOutbound: Fetcher;
18
+ loader: WorkerLoader;
19
+ proxy: Fetcher<CodeModeProxy>;
20
+ }): Promise<{
21
+ prompt: string;
22
+ tools: ToolSet;
23
+ }>;
24
+
25
+ export { CodeModeProxy, experimental_codemode };