agents 0.22.0 → 0.23.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 +20 -1
- package/dist/{agent-routing-CnkaHb-v.d.ts → agent-routing-DE5zmCQ8.d.ts} +1038 -394
- package/dist/agent-routing.d.ts +1 -1
- package/dist/agent-tool-types.d.ts +26 -26
- package/dist/{agent-tools-C0XJqWzB.d.ts → agent-tools-DtXMTDGM.d.ts} +7 -7
- package/dist/agent-tools.d.ts +21 -21
- package/dist/browser/ai.js +4 -1
- package/dist/browser/ai.js.map +1 -1
- package/dist/browser/tanstack-ai.js.map +1 -1
- package/dist/callable-decorator-DP__HhBA.d.ts +72 -0
- package/dist/callable-decorator.d.ts +18 -0
- package/dist/callable-decorator.js +71 -0
- package/dist/callable-decorator.js.map +1 -0
- package/dist/capability-BjSKYpzg.js.map +1 -1
- package/dist/capability-runner-Be_-PLR1.d.ts +459 -0
- package/dist/channel-Bnm4S7T2.d.ts +491 -0
- package/dist/channels/ai-sdk.d.ts +46 -0
- package/dist/channels/ai-sdk.js +120 -0
- package/dist/channels/ai-sdk.js.map +1 -0
- package/dist/channels/email.d.ts +95 -0
- package/dist/channels/email.js +323 -0
- package/dist/channels/email.js.map +1 -0
- package/dist/channels/index.d.ts +233 -0
- package/dist/channels/index.js +608 -0
- package/dist/channels/index.js.map +1 -0
- package/dist/channels/slack.d.ts +140 -0
- package/dist/channels/slack.js +614 -0
- package/dist/channels/slack.js.map +1 -0
- package/dist/channels/tanstack-ai.d.ts +39 -0
- package/dist/channels/tanstack-ai.js +17 -0
- package/dist/channels/tanstack-ai.js.map +1 -0
- package/dist/channels/telegram.d.ts +106 -0
- package/dist/channels/telegram.js +427 -0
- package/dist/channels/telegram.js.map +1 -0
- package/dist/channels/voice.d.ts +45 -0
- package/dist/channels/voice.js +122 -0
- package/dist/channels/voice.js.map +1 -0
- package/dist/chat/index.d.ts +2325 -2019
- package/dist/chat/index.js +888 -518
- package/dist/chat/index.js.map +1 -1
- package/dist/chat-sdk/index.d.ts +7 -7
- package/dist/chat-sdk/index.js +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/context/index.d.ts +216 -0
- package/dist/context/index.js +454 -0
- package/dist/context/index.js.map +1 -0
- package/dist/{current-agent-CuMErtly.d.ts → current-agent-Da_C9a3b.d.ts} +90 -107
- package/dist/current-agent-DhoDkSnH.js.map +1 -1
- package/dist/{diagnostics-CaBjfz4J.js → diagnostics-BzvaX2UT.js} +5 -1
- package/dist/diagnostics-BzvaX2UT.js.map +1 -0
- package/dist/diagnostics-C4jcz3VK.js +360 -0
- package/dist/diagnostics-C4jcz3VK.js.map +1 -0
- package/dist/index-BB0kqhIz.d.ts +101 -0
- package/dist/index-BVVgDSdq.d.ts +1 -0
- package/dist/index-XDkuQ7zm.d.ts +89 -0
- package/dist/{index-DcSAZKsB.d.ts → index-YSKgfgg9.d.ts} +3 -1
- package/dist/index.d.ts +91 -82
- package/dist/index.js +3 -2
- package/dist/ingress-BfetZbMO.js +83 -0
- package/dist/ingress-BfetZbMO.js.map +1 -0
- package/dist/internal-CYlgHl1l.js +59 -0
- package/dist/internal-CYlgHl1l.js.map +1 -0
- package/dist/internal_context.d.ts +1 -1
- package/dist/lifecycle/index.d.ts +35 -17
- package/dist/lifecycle/index.js +1 -1
- package/dist/lifecycle-CMRGjZdw.js +1299 -0
- package/dist/lifecycle-CMRGjZdw.js.map +1 -0
- package/dist/mcp/client/index.d.ts +20 -20
- package/dist/mcp/index.d.ts +35 -35
- package/dist/mcp/index.js +1 -1
- package/dist/observability/index.d.ts +1 -1
- package/dist/observability/index.js +1 -1
- package/dist/react.d.ts +4 -4
- package/dist/{retries-CAvxtG9d.d.ts → retries-D9Ds-1lz.d.ts} +17 -6
- package/dist/retries.d.ts +8 -6
- package/dist/retries.js +13 -1
- package/dist/retries.js.map +1 -1
- package/dist/routing/index.d.ts +137 -0
- package/dist/routing/index.js +244 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/sanitize-D9TujEK8.js +79 -0
- package/dist/sanitize-D9TujEK8.js.map +1 -0
- package/dist/scheduler-DD9NdYbF.js +665 -0
- package/dist/scheduler-DD9NdYbF.js.map +1 -0
- package/dist/{scheduler-DQoTGoAW.d.ts → scheduler-Dwh85ZGl.d.ts} +21 -22
- package/dist/schedules/index.d.ts +1 -1
- package/dist/schedules/index.js +1 -1
- package/dist/sentence-chunker-BAidJ4DA.d.ts +68 -0
- package/dist/serializable.d.ts +1 -1
- package/dist/sessions/index.d.ts +441 -0
- package/dist/sessions/index.js +2063 -0
- package/dist/sessions/index.js.map +1 -0
- package/dist/skills/index.d.ts +99 -0
- package/dist/skills/index.js +254 -5
- package/dist/skills/index.js.map +1 -1
- package/dist/{src-5W6JNKVb.js → src-DlSHshb2.js} +1460 -1110
- package/dist/src-DlSHshb2.js.map +1 -0
- package/dist/streams/index.d.ts +120 -0
- package/dist/streams/index.js +107 -0
- package/dist/streams/index.js.map +1 -0
- package/dist/streams-D6tJ0NN9.d.ts +370 -0
- package/dist/streams-DZKgAj9b.js +709 -0
- package/dist/streams-DZKgAj9b.js.map +1 -0
- package/dist/sub-routing.d.ts +12 -12
- package/dist/surface-bZZJqBka.js +17 -0
- package/dist/surface-bZZJqBka.js.map +1 -0
- package/dist/tasks/index.d.ts +64 -0
- package/dist/tasks/index.js +2 -0
- package/dist/tasks-BRJ5zgya.d.ts +517 -0
- package/dist/tasks-ylZgBjhj.js +1656 -0
- package/dist/tasks-ylZgBjhj.js.map +1 -0
- package/dist/text-segment-joiner-BtAFQSA_.js +57 -0
- package/dist/text-segment-joiner-BtAFQSA_.js.map +1 -0
- package/dist/text-stream-CpdiKrJB.js +272 -0
- package/dist/text-stream-CpdiKrJB.js.map +1 -0
- package/dist/tokens-nHAKcN6M.js +52 -0
- package/dist/tokens-nHAKcN6M.js.map +1 -0
- package/dist/tool-schema-CBjGPrsQ.js +31 -0
- package/dist/tool-schema-CBjGPrsQ.js.map +1 -0
- package/dist/types-B7LojTe4.d.ts +202 -0
- package/dist/types-_Faxb570.d.ts +439 -0
- package/dist/voice/client.d.ts +226 -0
- package/dist/voice/client.js +932 -0
- package/dist/voice/client.js.map +1 -0
- package/dist/voice/errors.d.ts +43 -0
- package/dist/voice/errors.js +41 -0
- package/dist/voice/errors.js.map +1 -0
- package/dist/voice/index.d.ts +271 -0
- package/dist/voice/index.js +1812 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/react.d.ts +167 -0
- package/dist/voice/react.js +234 -0
- package/dist/voice/react.js.map +1 -0
- package/dist/voice/sfu.d.ts +71 -0
- package/dist/voice/sfu.js +157 -0
- package/dist/voice/sfu.js.map +1 -0
- package/dist/voice/text.d.ts +6 -0
- package/dist/voice/text.js +2 -0
- package/dist/voice/types.d.ts +58 -0
- package/dist/voice/types.js +18 -0
- package/dist/voice/types.js.map +1 -0
- package/dist/voice/workers-ai.d.ts +136 -0
- package/dist/voice/workers-ai.js +568 -0
- package/dist/voice/workers-ai.js.map +1 -0
- package/dist/websockets/index.d.ts +192 -0
- package/dist/websockets/index.js +2 -0
- package/dist/websockets-DUfRHPRq.js +502 -0
- package/dist/websockets-DUfRHPRq.js.map +1 -0
- package/dist/workflow-types.d.ts +25 -25
- package/dist/workflows.d.ts +21 -21
- package/dist/workflows.js +1 -1
- package/docs/agent-class.md +2 -2
- package/docs/agent-tools.md +2 -1
- package/docs/channels.md +323 -0
- package/docs/chat-agents.md +6 -13
- package/docs/context.md +131 -0
- package/docs/index.md +15 -12
- package/docs/lifecycle.md +102 -55
- package/docs/long-running-agents.md +2 -2
- package/docs/mcp-servers.md +5 -1
- package/docs/resumable-streaming.md +1 -1
- package/docs/routing.md +105 -0
- package/docs/sessions.md +237 -871
- package/docs/streams.md +213 -0
- package/docs/sub-agents.md +184 -124
- package/docs/tasks.md +246 -0
- package/docs/voice.md +745 -0
- package/package.json +115 -13
- package/dist/capability-runner-CvHGZqUu.d.ts +0 -150
- package/dist/compaction-helpers-iiKMr2TQ.js +0 -340
- package/dist/compaction-helpers-iiKMr2TQ.js.map +0 -1
- package/dist/compaction-helpers-wUz6M3us.d.ts +0 -621
- package/dist/diagnostics-CaBjfz4J.js.map +0 -1
- package/dist/durable-object-lifecycle-D6nNQJJd.js +0 -862
- package/dist/durable-object-lifecycle-D6nNQJJd.js.map +0 -1
- package/dist/experimental/memory/session/index.d.ts +0 -671
- package/dist/experimental/memory/session/index.js +0 -2379
- package/dist/experimental/memory/session/index.js.map +0 -1
- package/dist/experimental/memory/utils/index.d.ts +0 -96
- package/dist/experimental/memory/utils/index.js +0 -79
- package/dist/experimental/memory/utils/index.js.map +0 -1
- package/dist/scheduler-CR9RHGos.js +0 -857
- package/dist/scheduler-CR9RHGos.js.map +0 -1
- package/dist/src-5W6JNKVb.js.map +0 -1
- package/dist/tool-output-truncation-CNnnGZQ3.js +0 -98
- package/dist/tool-output-truncation-CNnnGZQ3.js.map +0 -1
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import {
|
|
2
|
+
A as ChannelIngressEnvelope,
|
|
3
|
+
B as isChannelMessageSurface,
|
|
4
|
+
C as ChannelEmailIngressResult,
|
|
5
|
+
D as ChannelInboundMessage,
|
|
6
|
+
E as ChannelEventContextInput,
|
|
7
|
+
F as ChannelMessageSurface,
|
|
8
|
+
G as UserIdentityConflictError,
|
|
9
|
+
H as ChannelIdentityInput,
|
|
10
|
+
I as ChannelMessageSurfaceInput,
|
|
11
|
+
J as UserIdentityStore,
|
|
12
|
+
K as UserIdentitySqlValue,
|
|
13
|
+
L as ChannelSurfaceArray,
|
|
14
|
+
M as ChannelIngressEventInput,
|
|
15
|
+
N as ChannelIngressResult,
|
|
16
|
+
O as ChannelInboundMessageInput,
|
|
17
|
+
P as matchesPath,
|
|
18
|
+
Q as linkChannelIdentities,
|
|
19
|
+
R as ChannelSurfaceObject,
|
|
20
|
+
S as ChannelEmailIngress,
|
|
21
|
+
T as ChannelEventContext,
|
|
22
|
+
U as UserIdentity,
|
|
23
|
+
V as ChannelIdentity,
|
|
24
|
+
W as UserIdentityConflict,
|
|
25
|
+
X as createUserIdentityStore,
|
|
26
|
+
Y as UserIdentityStoreOptions,
|
|
27
|
+
Z as identityKey,
|
|
28
|
+
_ as ChannelActor,
|
|
29
|
+
a as ChannelApprovalRequestOptions,
|
|
30
|
+
b as ChannelApprovalResponseInput,
|
|
31
|
+
c as ChannelDeliveryContext,
|
|
32
|
+
d as ChannelRoute,
|
|
33
|
+
f as ChannelRouteContext,
|
|
34
|
+
g as OutboundResolver,
|
|
35
|
+
h as DeliveryResult,
|
|
36
|
+
i as ChannelApprovalRequest,
|
|
37
|
+
j as ChannelIngressEvent,
|
|
38
|
+
k as ChannelIngress,
|
|
39
|
+
l as ChannelDeliveryOptions,
|
|
40
|
+
m as DeliveryFailure,
|
|
41
|
+
n as Channel,
|
|
42
|
+
o as ChannelChunk,
|
|
43
|
+
p as ChannelStreamOptions,
|
|
44
|
+
q as UserIdentityStorage,
|
|
45
|
+
r as ChannelApprovalLinks,
|
|
46
|
+
s as ChannelChunkSource,
|
|
47
|
+
t as Awaitable,
|
|
48
|
+
u as ChannelMessage,
|
|
49
|
+
v as ChannelActorInput,
|
|
50
|
+
w as ChannelEmailInput,
|
|
51
|
+
x as ChannelAttachment,
|
|
52
|
+
y as ChannelApprovalResponse,
|
|
53
|
+
z as ChannelSurfaceValue
|
|
54
|
+
} from "../channel-Bnm4S7T2.js";
|
|
55
|
+
import {
|
|
56
|
+
a as ChannelRouteEvent,
|
|
57
|
+
i as ChannelMessageEvent,
|
|
58
|
+
n as ChannelHost,
|
|
59
|
+
r as ChannelHostOptions,
|
|
60
|
+
t as ChannelApprovalResponseEvent
|
|
61
|
+
} from "../index-BB0kqhIz.js";
|
|
62
|
+
|
|
63
|
+
//#region src/channels/fallback.d.ts
|
|
64
|
+
type FallbackSurface = ChannelMessageSurface<
|
|
65
|
+
"fallback",
|
|
66
|
+
{
|
|
67
|
+
surfaces: readonly ChannelMessageSurface[];
|
|
68
|
+
}
|
|
69
|
+
>;
|
|
70
|
+
/** A non-empty sequence of destinations ordered from preferred to final. */
|
|
71
|
+
type FallbackSurfaceOptions = readonly [
|
|
72
|
+
ChannelMessageSurface,
|
|
73
|
+
...ChannelMessageSurface[]
|
|
74
|
+
];
|
|
75
|
+
/**
|
|
76
|
+
* Build an inert fallback destination for a `ChannelHost` to resolve.
|
|
77
|
+
*
|
|
78
|
+
* The Host skips unavailable destinations, advances after confirmed failures,
|
|
79
|
+
* and stops after a delivered or uncertain result to avoid duplicates.
|
|
80
|
+
*/
|
|
81
|
+
declare function fallback(surfaces: FallbackSurfaceOptions): FallbackSurface;
|
|
82
|
+
/** Build the ordinary Channel installed under the reserved fallback key. */
|
|
83
|
+
declare function fallbackChannel(resolve: OutboundResolver): Channel;
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/channels/fanout.d.ts
|
|
86
|
+
type FanoutSurface = ChannelMessageSurface<
|
|
87
|
+
"fanout",
|
|
88
|
+
{
|
|
89
|
+
surfaces: readonly ChannelMessageSurface[];
|
|
90
|
+
}
|
|
91
|
+
>;
|
|
92
|
+
/** A non-empty set of destinations that must all receive each delivery. */
|
|
93
|
+
type FanoutSurfaceOptions = readonly [
|
|
94
|
+
ChannelMessageSurface,
|
|
95
|
+
...ChannelMessageSurface[]
|
|
96
|
+
];
|
|
97
|
+
/** Build an inert fanout destination for a `ChannelHost` to resolve. */
|
|
98
|
+
declare function fanout(surfaces: FanoutSurfaceOptions): FanoutSurface;
|
|
99
|
+
/** Build the ordinary Channel installed under the reserved fanout key. */
|
|
100
|
+
declare function fanoutChannel(resolve: OutboundResolver): Channel;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/channels/routes.d.ts
|
|
103
|
+
/**
|
|
104
|
+
* Common deterministic routing policies for normalized Channel events.
|
|
105
|
+
*
|
|
106
|
+
* Each one maps an event to a namespaced application route. Deciding whether
|
|
107
|
+
* an event is relevant at all is application policy: write that in your own
|
|
108
|
+
* `route` function and return `null` to ignore the event.
|
|
109
|
+
*/
|
|
110
|
+
declare const routes: {
|
|
111
|
+
/**
|
|
112
|
+
* Give every event its own application route. Useful to kick off a
|
|
113
|
+
* new conversation for each ingress, and where you don't want subsequent
|
|
114
|
+
* messages routed back to that same conversation.
|
|
115
|
+
**/
|
|
116
|
+
perEvent(
|
|
117
|
+
event: ChannelIngressEvent
|
|
118
|
+
): string /** Send every event in the same thread to the same conversation */;
|
|
119
|
+
perThread(event: ChannelIngressEvent): string;
|
|
120
|
+
/**
|
|
121
|
+
* Prefer the sender's own channel identity, then delegate to another route
|
|
122
|
+
* policy. Without a fallback, an event carrying no identity is ignored.
|
|
123
|
+
*
|
|
124
|
+
* This groups events that carry the *same* identity. It never infers that
|
|
125
|
+
* two different identities belong to one person: that is an explicit
|
|
126
|
+
* application decision, exposed to routing through `byUser`.
|
|
127
|
+
*/
|
|
128
|
+
byIdentity<TRaw>(
|
|
129
|
+
fallback?: ChannelRoute<TRaw>
|
|
130
|
+
): ChannelRoute<TRaw> /** Prefer an explicitly linked user, then delegate to another route policy. */;
|
|
131
|
+
byUser<TRaw>(fallback: ChannelRoute<TRaw>): ChannelRoute<TRaw>;
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/channels/stream.d.ts
|
|
135
|
+
/** Why a consumption loop stopped reading. */
|
|
136
|
+
type StreamOutcome =
|
|
137
|
+
| {
|
|
138
|
+
interrupted: false;
|
|
139
|
+
}
|
|
140
|
+
| {
|
|
141
|
+
interrupted: true;
|
|
142
|
+
error: unknown;
|
|
143
|
+
};
|
|
144
|
+
type ChunkConsumer<TChunk, TResult> = {
|
|
145
|
+
onChunk(
|
|
146
|
+
chunk: TChunk
|
|
147
|
+
): Awaitable<void> /** Runs exactly once, whether the stream closed or ended abnormally. */;
|
|
148
|
+
onFinish(outcome: StreamOutcome): Awaitable<TResult>;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* Read a stream to completion, then finalize exactly once.
|
|
152
|
+
*
|
|
153
|
+
* `onFinish` runs whether the stream closed normally, errored because the
|
|
154
|
+
* generation failed, or stopped because `onChunk` threw. A Channel that
|
|
155
|
+
* finalizes here cannot lose a terminal provider call to an early ending.
|
|
156
|
+
*/
|
|
157
|
+
declare function consumeChunks<TChunk, TResult>(
|
|
158
|
+
chunks: ReadableStream<TChunk>,
|
|
159
|
+
consumer: ChunkConsumer<TChunk, TResult>
|
|
160
|
+
): Promise<TResult>;
|
|
161
|
+
//#endregion
|
|
162
|
+
export {
|
|
163
|
+
Awaitable,
|
|
164
|
+
Channel,
|
|
165
|
+
ChannelActor,
|
|
166
|
+
ChannelActorInput,
|
|
167
|
+
ChannelApprovalLinks,
|
|
168
|
+
ChannelApprovalRequest,
|
|
169
|
+
ChannelApprovalRequestOptions,
|
|
170
|
+
ChannelApprovalResponse,
|
|
171
|
+
ChannelApprovalResponseEvent,
|
|
172
|
+
ChannelApprovalResponseInput,
|
|
173
|
+
ChannelAttachment,
|
|
174
|
+
ChannelChunk,
|
|
175
|
+
ChannelChunkSource,
|
|
176
|
+
ChannelDeliveryContext,
|
|
177
|
+
ChannelDeliveryOptions,
|
|
178
|
+
ChannelEmailIngress,
|
|
179
|
+
ChannelEmailIngressResult,
|
|
180
|
+
ChannelEmailInput,
|
|
181
|
+
ChannelEventContext,
|
|
182
|
+
ChannelEventContextInput,
|
|
183
|
+
ChannelHost,
|
|
184
|
+
ChannelHostOptions,
|
|
185
|
+
ChannelIdentity,
|
|
186
|
+
ChannelIdentityInput,
|
|
187
|
+
ChannelInboundMessage,
|
|
188
|
+
ChannelInboundMessageInput,
|
|
189
|
+
ChannelIngress,
|
|
190
|
+
ChannelIngressEnvelope,
|
|
191
|
+
ChannelIngressEvent,
|
|
192
|
+
ChannelIngressEventInput,
|
|
193
|
+
ChannelIngressResult,
|
|
194
|
+
ChannelMessage,
|
|
195
|
+
ChannelMessageEvent,
|
|
196
|
+
ChannelMessageSurface,
|
|
197
|
+
ChannelMessageSurfaceInput,
|
|
198
|
+
ChannelRoute,
|
|
199
|
+
ChannelRouteContext,
|
|
200
|
+
ChannelRouteEvent,
|
|
201
|
+
ChannelStreamOptions,
|
|
202
|
+
ChannelSurfaceArray,
|
|
203
|
+
ChannelSurfaceObject,
|
|
204
|
+
ChannelSurfaceValue,
|
|
205
|
+
type ChunkConsumer,
|
|
206
|
+
DeliveryFailure,
|
|
207
|
+
DeliveryResult,
|
|
208
|
+
FallbackSurface,
|
|
209
|
+
FallbackSurfaceOptions,
|
|
210
|
+
FanoutSurface,
|
|
211
|
+
FanoutSurfaceOptions,
|
|
212
|
+
OutboundResolver,
|
|
213
|
+
type StreamOutcome,
|
|
214
|
+
UserIdentity,
|
|
215
|
+
UserIdentityConflict,
|
|
216
|
+
UserIdentityConflictError,
|
|
217
|
+
UserIdentitySqlValue,
|
|
218
|
+
UserIdentityStorage,
|
|
219
|
+
UserIdentityStore,
|
|
220
|
+
UserIdentityStoreOptions,
|
|
221
|
+
consumeChunks,
|
|
222
|
+
createUserIdentityStore,
|
|
223
|
+
fallback,
|
|
224
|
+
fallbackChannel,
|
|
225
|
+
fanout,
|
|
226
|
+
fanoutChannel,
|
|
227
|
+
identityKey,
|
|
228
|
+
isChannelMessageSurface,
|
|
229
|
+
linkChannelIdentities,
|
|
230
|
+
matchesPath,
|
|
231
|
+
routes
|
|
232
|
+
};
|
|
233
|
+
//# sourceMappingURL=index.d.ts.map
|