@agent-native/agentkit 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/ARCHITECTURE.md +290 -0
- package/README.md +822 -0
- package/dist/adapters/http.d.ts +56 -0
- package/dist/adapters/http.d.ts.map +1 -0
- package/dist/adapters/http.js +950 -0
- package/dist/adapters/http.js.map +1 -0
- package/dist/adapters/index.d.ts +2 -0
- package/dist/adapters/index.d.ts.map +1 -0
- package/dist/adapters/index.js +2 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/client/client.d.ts +240 -0
- package/dist/client/client.d.ts.map +1 -0
- package/dist/client/client.js +1605 -0
- package/dist/client/client.js.map +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +3 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/state.d.ts +72 -0
- package/dist/client/state.d.ts.map +1 -0
- package/dist/client/state.js +385 -0
- package/dist/client/state.js.map +1 -0
- package/dist/conformance/index.d.ts +41 -0
- package/dist/conformance/index.d.ts.map +1 -0
- package/dist/conformance/index.js +924 -0
- package/dist/conformance/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol/agui-codec.d.ts +28 -0
- package/dist/protocol/agui-codec.d.ts.map +1 -0
- package/dist/protocol/agui-codec.js +250 -0
- package/dist/protocol/agui-codec.js.map +1 -0
- package/dist/protocol/agui.d.ts +144 -0
- package/dist/protocol/agui.d.ts.map +1 -0
- package/dist/protocol/agui.js +253 -0
- package/dist/protocol/agui.js.map +1 -0
- package/dist/protocol/compatibility.d.ts +35 -0
- package/dist/protocol/compatibility.d.ts.map +1 -0
- package/dist/protocol/compatibility.js +160 -0
- package/dist/protocol/compatibility.js.map +1 -0
- package/dist/protocol/errors.d.ts +24 -0
- package/dist/protocol/errors.d.ts.map +1 -0
- package/dist/protocol/errors.js +77 -0
- package/dist/protocol/errors.js.map +1 -0
- package/dist/protocol/index.d.ts +982 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/index.js +56 -0
- package/dist/protocol/index.js.map +1 -0
- package/dist/protocol/validation.d.ts +94 -0
- package/dist/protocol/validation.d.ts.map +1 -0
- package/dist/protocol/validation.js +1871 -0
- package/dist/protocol/validation.js.map +1 -0
- package/dist/protocol/version.d.ts +7 -0
- package/dist/protocol/version.d.ts.map +1 -0
- package/dist/protocol/version.js +9 -0
- package/dist/protocol/version.js.map +1 -0
- package/dist/react/chat.d.ts +34 -0
- package/dist/react/chat.d.ts.map +1 -0
- package/dist/react/chat.js +23 -0
- package/dist/react/chat.js.map +1 -0
- package/dist/react/components.d.ts +96 -0
- package/dist/react/components.d.ts.map +1 -0
- package/dist/react/components.js +1300 -0
- package/dist/react/components.js.map +1 -0
- package/dist/react/context.d.ts +259 -0
- package/dist/react/context.d.ts.map +1 -0
- package/dist/react/context.js +359 -0
- package/dist/react/context.js.map +1 -0
- package/dist/react/headless.d.ts +3 -0
- package/dist/react/headless.d.ts.map +1 -0
- package/dist/react/headless.js +3 -0
- package/dist/react/headless.js.map +1 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +6 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/root.d.ts +58 -0
- package/dist/react/root.d.ts.map +1 -0
- package/dist/react/root.js +151 -0
- package/dist/react/root.js.map +1 -0
- package/dist/react/streaming-text.d.ts +19 -0
- package/dist/react/streaming-text.d.ts.map +1 -0
- package/dist/react/streaming-text.js +259 -0
- package/dist/react/streaming-text.js.map +1 -0
- package/dist/react/styles.css +1477 -0
- package/package.json +112 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, useSyncExternalStore, } from "react";
|
|
3
|
+
import { selectActiveAgentRoster, } from "../client/index.js";
|
|
4
|
+
import { resolveAgentCapabilityAffordance } from "../protocol/index.js";
|
|
5
|
+
export const defaultAgentKitLabels = {
|
|
6
|
+
conversation: "Agent conversation",
|
|
7
|
+
assistant: "Assistant",
|
|
8
|
+
you: "You",
|
|
9
|
+
approvalApprove: "Approve",
|
|
10
|
+
approvalDeny: "Deny",
|
|
11
|
+
approvalSubmit: "Submit",
|
|
12
|
+
approvalOther: "Other",
|
|
13
|
+
approvalOtherPlaceholder: "Type your answer",
|
|
14
|
+
connectionConnect: "Connect",
|
|
15
|
+
connectionConnecting: "Connecting…",
|
|
16
|
+
connectionConnected: "Connected",
|
|
17
|
+
connectionNotNow: "Not now",
|
|
18
|
+
connectionRetry: "Try again",
|
|
19
|
+
connectionFailed: "Connection failed",
|
|
20
|
+
connectionAdminRequired: "Ask a workspace admin to connect this service.",
|
|
21
|
+
activities: "Agent activity",
|
|
22
|
+
working: "Working",
|
|
23
|
+
workingFor: "Working for {{duration}}",
|
|
24
|
+
worked: "Worked",
|
|
25
|
+
workedFor: "Worked for {{duration}}",
|
|
26
|
+
durationHourShort: "h",
|
|
27
|
+
durationMinuteShort: "m",
|
|
28
|
+
durationSecondShort: "s",
|
|
29
|
+
agents: "Agent collaboration",
|
|
30
|
+
tasks: "Agent tasks",
|
|
31
|
+
composerLabel: "Message agent",
|
|
32
|
+
composerPlaceholder: "Ask the agent to explore, build, or explain…",
|
|
33
|
+
queue: "Queued messages",
|
|
34
|
+
queueSteer: "Steer",
|
|
35
|
+
queueSteerHint: "Send this message to the active run",
|
|
36
|
+
queueRemove: "Remove queued message",
|
|
37
|
+
queueMore: "More actions",
|
|
38
|
+
suggestions: "Suggested next actions",
|
|
39
|
+
copy: "Copy message",
|
|
40
|
+
copied: "Copied",
|
|
41
|
+
positiveFeedback: "Helpful",
|
|
42
|
+
negativeFeedback: "Not helpful",
|
|
43
|
+
fork: "Fork conversation",
|
|
44
|
+
copyUnavailable: "Copying is unavailable in this browser.",
|
|
45
|
+
error: "Something went wrong",
|
|
46
|
+
renderError: "This content couldn’t be displayed.",
|
|
47
|
+
runFailed: "Run failed",
|
|
48
|
+
reconnect: "Reconnect",
|
|
49
|
+
reasoning: "Thinking",
|
|
50
|
+
expandActivity: "Show activity details",
|
|
51
|
+
collapseActivity: "Hide activity details",
|
|
52
|
+
agentStarted: "started working",
|
|
53
|
+
agentResumed: "resumed working",
|
|
54
|
+
agentMessaged: "sent a message",
|
|
55
|
+
agentDelegated: "delegated work",
|
|
56
|
+
agentPaused: "paused",
|
|
57
|
+
agentCompleted: "finished",
|
|
58
|
+
agentFailed: "needs attention",
|
|
59
|
+
agentClosed: "closed",
|
|
60
|
+
};
|
|
61
|
+
const AgentKitContext = createContext(null);
|
|
62
|
+
export function AgentKitProvider({ controller, threadId, slots = {}, registry = {}, labels, onOpenObject, onThreadForked, onConnectionRequest, onRenderError, onClientEffect, children, }) {
|
|
63
|
+
const composerFocusTargets = useRef(new Map());
|
|
64
|
+
const registerComposerFocus = useCallback((targetThreadId, focus) => {
|
|
65
|
+
composerFocusTargets.current.set(targetThreadId, focus);
|
|
66
|
+
return () => {
|
|
67
|
+
if (composerFocusTargets.current.get(targetThreadId) === focus) {
|
|
68
|
+
composerFocusTargets.current.delete(targetThreadId);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
}, []);
|
|
72
|
+
const requestComposerFocus = useCallback((targetThreadId) => {
|
|
73
|
+
composerFocusTargets.current.get(targetThreadId)?.();
|
|
74
|
+
}, []);
|
|
75
|
+
const mergedLabels = useMemo(() => ({ ...defaultAgentKitLabels, ...labels }), [labels]);
|
|
76
|
+
const value = useMemo(() => ({
|
|
77
|
+
controller,
|
|
78
|
+
threadId,
|
|
79
|
+
slots,
|
|
80
|
+
registry,
|
|
81
|
+
labels: mergedLabels,
|
|
82
|
+
onOpenObject,
|
|
83
|
+
onThreadForked,
|
|
84
|
+
onConnectionRequest,
|
|
85
|
+
onRenderError,
|
|
86
|
+
registerComposerFocus,
|
|
87
|
+
requestComposerFocus,
|
|
88
|
+
}), [
|
|
89
|
+
controller,
|
|
90
|
+
threadId,
|
|
91
|
+
slots,
|
|
92
|
+
registry,
|
|
93
|
+
mergedLabels,
|
|
94
|
+
onOpenObject,
|
|
95
|
+
onThreadForked,
|
|
96
|
+
onConnectionRequest,
|
|
97
|
+
onRenderError,
|
|
98
|
+
registerComposerFocus,
|
|
99
|
+
requestComposerFocus,
|
|
100
|
+
]);
|
|
101
|
+
const seenEffects = useRef({
|
|
102
|
+
controller,
|
|
103
|
+
threadId,
|
|
104
|
+
ids: new Set(),
|
|
105
|
+
});
|
|
106
|
+
if (seenEffects.current.controller !== controller ||
|
|
107
|
+
seenEffects.current.threadId !== threadId) {
|
|
108
|
+
seenEffects.current = { controller, threadId, ids: new Set() };
|
|
109
|
+
}
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
if (!onClientEffect)
|
|
112
|
+
return;
|
|
113
|
+
const scope = seenEffects.current;
|
|
114
|
+
const deliver = () => {
|
|
115
|
+
if (seenEffects.current !== scope)
|
|
116
|
+
return;
|
|
117
|
+
const events = controller.getSnapshot().threads[threadId]?.events ?? [];
|
|
118
|
+
for (const event of events) {
|
|
119
|
+
if ((event.type === "client.effect" ||
|
|
120
|
+
event.type === "client.deeplink") &&
|
|
121
|
+
!scope.ids.has(event.id)) {
|
|
122
|
+
scope.ids.add(event.id);
|
|
123
|
+
onClientEffect({
|
|
124
|
+
type: event.type,
|
|
125
|
+
name: event.name,
|
|
126
|
+
data: event.data,
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
deliver();
|
|
132
|
+
return controller.subscribe(deliver);
|
|
133
|
+
}, [controller, onClientEffect, threadId]);
|
|
134
|
+
return (_jsx(AgentKitContext.Provider, { value: value, children: children }));
|
|
135
|
+
}
|
|
136
|
+
/** Coalesces same-turn transport bursts without dropping the latest snapshot. */
|
|
137
|
+
function subscribeToAgentKitUpdate(controller, listener) {
|
|
138
|
+
let timeout;
|
|
139
|
+
const notify = () => {
|
|
140
|
+
timeout = undefined;
|
|
141
|
+
listener();
|
|
142
|
+
};
|
|
143
|
+
const schedule = () => {
|
|
144
|
+
if (timeout !== undefined)
|
|
145
|
+
return;
|
|
146
|
+
timeout = setTimeout(notify, 0);
|
|
147
|
+
};
|
|
148
|
+
const unsubscribe = controller.subscribe(schedule);
|
|
149
|
+
return () => {
|
|
150
|
+
unsubscribe();
|
|
151
|
+
if (timeout !== undefined)
|
|
152
|
+
clearTimeout(timeout);
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function useAgentKitControllerSnapshot(controller) {
|
|
156
|
+
const subscribe = useCallback((listener) => subscribeToAgentKitUpdate(controller, listener), [controller]);
|
|
157
|
+
return useSyncExternalStore(subscribe, controller.getSnapshot, controller.getSnapshot);
|
|
158
|
+
}
|
|
159
|
+
export function useAgentKit() {
|
|
160
|
+
const value = useContext(AgentKitContext);
|
|
161
|
+
if (!value)
|
|
162
|
+
throw new Error("AgentKit hooks require an AgentKitProvider.");
|
|
163
|
+
return value;
|
|
164
|
+
}
|
|
165
|
+
export function useAgentKitSnapshot() {
|
|
166
|
+
const { controller } = useAgentKit();
|
|
167
|
+
return useAgentKitControllerSnapshot(controller);
|
|
168
|
+
}
|
|
169
|
+
export function useAgentKitSelector(selector, isEqual = Object.is) {
|
|
170
|
+
const { controller } = useAgentKit();
|
|
171
|
+
const subscribe = useCallback((listener) => subscribeToAgentKitUpdate(controller, listener), [controller]);
|
|
172
|
+
const selectorRef = useRef(selector);
|
|
173
|
+
const equalityRef = useRef(isEqual);
|
|
174
|
+
const cacheRef = useRef(null);
|
|
175
|
+
selectorRef.current = selector;
|
|
176
|
+
equalityRef.current = isEqual;
|
|
177
|
+
const getSelection = useCallback(() => {
|
|
178
|
+
const snapshot = controller.getSnapshot();
|
|
179
|
+
const cached = cacheRef.current;
|
|
180
|
+
if (cached?.controller === controller &&
|
|
181
|
+
cached.snapshot === snapshot &&
|
|
182
|
+
cached.selector === selectorRef.current &&
|
|
183
|
+
cached.isEqual === equalityRef.current) {
|
|
184
|
+
return cached.selection;
|
|
185
|
+
}
|
|
186
|
+
const selection = selectorRef.current(snapshot);
|
|
187
|
+
if (cached?.controller === controller &&
|
|
188
|
+
equalityRef.current(cached.selection, selection)) {
|
|
189
|
+
cacheRef.current = {
|
|
190
|
+
controller,
|
|
191
|
+
snapshot,
|
|
192
|
+
selector: selectorRef.current,
|
|
193
|
+
isEqual: equalityRef.current,
|
|
194
|
+
selection: cached.selection,
|
|
195
|
+
};
|
|
196
|
+
return cached.selection;
|
|
197
|
+
}
|
|
198
|
+
cacheRef.current = {
|
|
199
|
+
controller,
|
|
200
|
+
snapshot,
|
|
201
|
+
selector: selectorRef.current,
|
|
202
|
+
isEqual: equalityRef.current,
|
|
203
|
+
selection,
|
|
204
|
+
};
|
|
205
|
+
return selection;
|
|
206
|
+
}, [controller]);
|
|
207
|
+
return useSyncExternalStore(subscribe, getSelection, getSelection);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Gives custom AgentKit controls the same race-safe pending and error contract
|
|
211
|
+
* as the reference components. Only the latest invocation owns visible state.
|
|
212
|
+
*/
|
|
213
|
+
export function useAgentKitMutation(mutation, scopeKey) {
|
|
214
|
+
const { controller, threadId } = useAgentKit();
|
|
215
|
+
const mutationRef = useRef(mutation);
|
|
216
|
+
const invocationRef = useRef(0);
|
|
217
|
+
const scopeRef = useRef({ controller, threadId, scopeKey });
|
|
218
|
+
const [state, setState] = useState({ status: "idle" });
|
|
219
|
+
if (scopeRef.current.controller !== controller ||
|
|
220
|
+
scopeRef.current.threadId !== threadId ||
|
|
221
|
+
scopeRef.current.scopeKey !== scopeKey) {
|
|
222
|
+
scopeRef.current = { controller, threadId, scopeKey };
|
|
223
|
+
invocationRef.current += 1;
|
|
224
|
+
}
|
|
225
|
+
mutationRef.current = mutation;
|
|
226
|
+
const execute = useCallback(async (...args) => {
|
|
227
|
+
const invocation = ++invocationRef.current;
|
|
228
|
+
const scope = scopeRef.current;
|
|
229
|
+
setState({ status: "pending", ...scope });
|
|
230
|
+
try {
|
|
231
|
+
const result = await mutationRef.current(...args);
|
|
232
|
+
if (invocation === invocationRef.current) {
|
|
233
|
+
setState({ status: "succeeded", ...scope });
|
|
234
|
+
}
|
|
235
|
+
return result;
|
|
236
|
+
}
|
|
237
|
+
catch (cause) {
|
|
238
|
+
const error = cause instanceof Error ? cause : new Error(String(cause));
|
|
239
|
+
if (invocation === invocationRef.current) {
|
|
240
|
+
setState({ status: "failed", error, ...scope });
|
|
241
|
+
}
|
|
242
|
+
throw error;
|
|
243
|
+
}
|
|
244
|
+
}, []);
|
|
245
|
+
const reset = useCallback(() => {
|
|
246
|
+
invocationRef.current += 1;
|
|
247
|
+
setState({ status: "idle", ...scopeRef.current });
|
|
248
|
+
}, []);
|
|
249
|
+
const visibleState = state.controller === controller &&
|
|
250
|
+
state.threadId === threadId &&
|
|
251
|
+
state.scopeKey === scopeKey
|
|
252
|
+
? state
|
|
253
|
+
: { status: "idle" };
|
|
254
|
+
return {
|
|
255
|
+
status: visibleState.status,
|
|
256
|
+
pending: visibleState.status === "pending",
|
|
257
|
+
error: visibleState.error,
|
|
258
|
+
execute,
|
|
259
|
+
reset,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* The boolean projection cannot express degraded or temporarily unavailable
|
|
264
|
+
* capabilities, and it renders an unreported capability identically to a
|
|
265
|
+
* denied one. Gate affordances on `useAgentCapability` instead.
|
|
266
|
+
*/
|
|
267
|
+
export function useAgentCapabilities() {
|
|
268
|
+
return useAgentKitSelector((snapshot) => snapshot.capabilities);
|
|
269
|
+
}
|
|
270
|
+
export function useAgentCapability(capability) {
|
|
271
|
+
return useAgentKitSelector((snapshot) => resolveAgentCapabilityAffordance({
|
|
272
|
+
discovery: snapshot.capabilityDiscovery,
|
|
273
|
+
capabilities: snapshot.capabilities,
|
|
274
|
+
}, capability), (previous, next) => previous.state === next.state &&
|
|
275
|
+
previous.visible === next.visible &&
|
|
276
|
+
previous.enabled === next.enabled &&
|
|
277
|
+
previous.reason === next.reason);
|
|
278
|
+
}
|
|
279
|
+
export function useAgentConnection() {
|
|
280
|
+
return useAgentKitSelector((snapshot) => ({
|
|
281
|
+
status: snapshot.connection,
|
|
282
|
+
error: snapshot.error,
|
|
283
|
+
}), (previous, next) => previous.status === next.status && previous.error === next.error);
|
|
284
|
+
}
|
|
285
|
+
export function useAgentRun(runId) {
|
|
286
|
+
const thread = useAgentThread();
|
|
287
|
+
return runId ? thread.runs[runId] : undefined;
|
|
288
|
+
}
|
|
289
|
+
export function useAgentParticipant(agentId) {
|
|
290
|
+
const thread = useAgentThread();
|
|
291
|
+
return agentId ? thread.agents[agentId] : undefined;
|
|
292
|
+
}
|
|
293
|
+
export function useAgentRoster() {
|
|
294
|
+
const thread = useAgentThread();
|
|
295
|
+
return useMemo(() => selectActiveAgentRoster(thread.agents), [thread.agents]);
|
|
296
|
+
}
|
|
297
|
+
export function useAgentInteractions(filter = {}) {
|
|
298
|
+
const thread = useAgentThread();
|
|
299
|
+
return useMemo(() => thread.events.flatMap((event) => {
|
|
300
|
+
if (event.type !== "agent.interaction")
|
|
301
|
+
return [];
|
|
302
|
+
if (filter.runId && event.runId !== filter.runId)
|
|
303
|
+
return [];
|
|
304
|
+
if (filter.agentId &&
|
|
305
|
+
event.interaction.agentId !== filter.agentId &&
|
|
306
|
+
event.interaction.targetAgentId !== filter.agentId) {
|
|
307
|
+
return [];
|
|
308
|
+
}
|
|
309
|
+
if (filter.scope && event.interaction.scope !== filter.scope) {
|
|
310
|
+
return [];
|
|
311
|
+
}
|
|
312
|
+
return [event.interaction];
|
|
313
|
+
}), [filter.agentId, filter.runId, filter.scope, thread.events]);
|
|
314
|
+
}
|
|
315
|
+
export function useAgentThread(requestedThreadId) {
|
|
316
|
+
const { controller, threadId: contextThreadId } = useAgentKit();
|
|
317
|
+
const threadId = requestedThreadId ?? contextThreadId;
|
|
318
|
+
return useAgentKitSelector((snapshot) => snapshot.threads[threadId] ?? controller.getThread(threadId));
|
|
319
|
+
}
|
|
320
|
+
export function useAgentKitControl(requestedThreadId) {
|
|
321
|
+
const { controller, threadId: contextThreadId } = useAgentKit();
|
|
322
|
+
const threadId = requestedThreadId ?? contextThreadId;
|
|
323
|
+
return useMemo(() => ({
|
|
324
|
+
send: (text, options) => controller.sendMessage({ threadId, text, options }),
|
|
325
|
+
sendMessage: (input) => controller.sendMessage({ ...input, threadId }),
|
|
326
|
+
load: () => controller.loadThread(threadId),
|
|
327
|
+
resubscribe: (runId) => controller.resubscribeRun(threadId, runId),
|
|
328
|
+
queue: (text) => controller.queueMessage({ threadId, text }),
|
|
329
|
+
queueMessage: (input) => controller.queueMessage({ ...input, threadId }),
|
|
330
|
+
cancel: (runId) => controller.cancelRun(threadId, runId),
|
|
331
|
+
approve: (runId, approvalId, optionId, input) => controller.resolveApproval({
|
|
332
|
+
threadId,
|
|
333
|
+
runId,
|
|
334
|
+
approvalId,
|
|
335
|
+
optionId,
|
|
336
|
+
response: {
|
|
337
|
+
decision: "approve",
|
|
338
|
+
optionIds: optionId ? [optionId] : undefined,
|
|
339
|
+
input,
|
|
340
|
+
},
|
|
341
|
+
}),
|
|
342
|
+
resolveApproval: (runId, approvalId, response) => controller.resolveApproval({ threadId, runId, approvalId, response }),
|
|
343
|
+
resolveConnectionRequest: (runId, requestId, response) => controller.resolveConnectionRequest({
|
|
344
|
+
threadId,
|
|
345
|
+
runId,
|
|
346
|
+
requestId,
|
|
347
|
+
response,
|
|
348
|
+
}),
|
|
349
|
+
removeQueued: (messageId) => controller.removeQueuedMessage(threadId, messageId),
|
|
350
|
+
steerQueued: (messageId) => controller.steerQueuedMessage(threadId, messageId),
|
|
351
|
+
submitFeedback: (messageId, value) => controller.submitFeedback(threadId, messageId, value),
|
|
352
|
+
fork: (fromMessageId) => controller.forkThread(threadId, fromMessageId),
|
|
353
|
+
updateThread: (patch) => controller.updateThread(threadId, patch),
|
|
354
|
+
deleteThread: () => controller.deleteThread(threadId),
|
|
355
|
+
uploadFiles: controller.uploadFiles.bind(controller, threadId),
|
|
356
|
+
invokeAction: controller.invokeAction.bind(controller),
|
|
357
|
+
}), [controller, threadId]);
|
|
358
|
+
}
|
|
359
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/react/context.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,EACR,oBAAoB,GAGrB,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,uBAAuB,GAGxB,MAAM,oBAAoB,CAAC;AA0B5B,OAAO,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AA4LxE,MAAM,CAAC,MAAM,qBAAqB,GAAmB;IACnD,YAAY,EAAE,oBAAoB;IAClC,SAAS,EAAE,WAAW;IACtB,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,OAAO;IACtB,wBAAwB,EAAE,kBAAkB;IAC5C,iBAAiB,EAAE,SAAS;IAC5B,oBAAoB,EAAE,aAAa;IACnC,mBAAmB,EAAE,WAAW;IAChC,gBAAgB,EAAE,SAAS;IAC3B,eAAe,EAAE,WAAW;IAC5B,gBAAgB,EAAE,mBAAmB;IACrC,uBAAuB,EAAE,gDAAgD;IACzE,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,0BAA0B;IACtC,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,yBAAyB;IACpC,iBAAiB,EAAE,GAAG;IACtB,mBAAmB,EAAE,GAAG;IACxB,mBAAmB,EAAE,GAAG;IACxB,MAAM,EAAE,qBAAqB;IAC7B,KAAK,E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,YAAY,EAAE,CACZ,KAAwD,EACxD,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC;QAC7C,YAAY,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC;QACrD,WAAW,EAAE,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;QAC9D,YAAY,EAAE,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC;KACvD,CAAC,EACF,CAAC,UAAU,EAAE,QAAQ,CAAC,CACvB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless.d.ts","sourceRoot":"","sources":["../../src/react/headless.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headless.js","sourceRoot":"","sources":["../../src/react/headless.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type AgentKitHttpTransportOptions } from "../adapters/index.js";
|
|
3
|
+
import { type AgentKitClientOptions, type AgentKitController } from "../client/index.js";
|
|
4
|
+
import type { AgentConnectionRequest, AgentConnectionResponse, AgentObjectReference, AgentThread, AgentTransport, ThreadId } from "../protocol/index.js";
|
|
5
|
+
import { type AgentKitLabels, type AgentKitRegistry, type AgentKitRenderFailure, type AgentKitSlots } from "./context.js";
|
|
6
|
+
export interface AgentKitManagedClientOptions extends Omit<AgentKitClientOptions, "transport"> {
|
|
7
|
+
}
|
|
8
|
+
export type AgentKitClientSource = {
|
|
9
|
+
/** A host-owned controller. AgentKit never disposes it. */
|
|
10
|
+
controller: AgentKitController;
|
|
11
|
+
transport?: never;
|
|
12
|
+
clientOptions?: never;
|
|
13
|
+
endpoint?: never;
|
|
14
|
+
http?: never;
|
|
15
|
+
} | {
|
|
16
|
+
/** A host-owned transport used by one AgentKit-managed controller. */
|
|
17
|
+
controller?: never;
|
|
18
|
+
transport: AgentTransport;
|
|
19
|
+
clientOptions?: AgentKitManagedClientOptions;
|
|
20
|
+
endpoint?: never;
|
|
21
|
+
http?: never;
|
|
22
|
+
} | {
|
|
23
|
+
/** HTTP endpoint used by an AgentKit-managed transport and controller. */
|
|
24
|
+
endpoint: string;
|
|
25
|
+
http?: Omit<AgentKitHttpTransportOptions, "baseUrl">;
|
|
26
|
+
controller?: never;
|
|
27
|
+
transport?: never;
|
|
28
|
+
clientOptions?: AgentKitManagedClientOptions;
|
|
29
|
+
};
|
|
30
|
+
export interface AgentKitRootBaseProps {
|
|
31
|
+
threadId: ThreadId;
|
|
32
|
+
children: ReactNode;
|
|
33
|
+
slots?: AgentKitSlots;
|
|
34
|
+
registry?: AgentKitRegistry;
|
|
35
|
+
labels?: Partial<AgentKitLabels>;
|
|
36
|
+
onOpenObject?: (object: AgentObjectReference) => void;
|
|
37
|
+
/** Navigates or otherwise activates a newly forked thread. */
|
|
38
|
+
onThreadForked?: (thread: AgentThread) => void;
|
|
39
|
+
onConnectionRequest?: (request: AgentConnectionRequest) => Promise<AgentConnectionResponse>;
|
|
40
|
+
/** Reports custom renderer failures without exposing internals to users. */
|
|
41
|
+
onRenderError?: (failure: AgentKitRenderFailure) => void;
|
|
42
|
+
onClientEffect?: (effect: {
|
|
43
|
+
type: "client.effect" | "client.deeplink";
|
|
44
|
+
name: string;
|
|
45
|
+
data?: Record<string, unknown>;
|
|
46
|
+
}) => void;
|
|
47
|
+
/** Loads the thread projection on mount and whenever `threadId` changes. */
|
|
48
|
+
load?: "auto" | "manual";
|
|
49
|
+
/** Observes an initial load failure in addition to the rendered error state. */
|
|
50
|
+
onLoadError?: (error: unknown) => void;
|
|
51
|
+
}
|
|
52
|
+
export type AgentKitRootProps = AgentKitRootBaseProps & AgentKitClientSource;
|
|
53
|
+
/**
|
|
54
|
+
* Owns AgentKit's controller lifecycle without imposing a visual shell.
|
|
55
|
+
* Use this for custom products that compose the headless hooks directly.
|
|
56
|
+
*/
|
|
57
|
+
export declare function AgentKitRoot({ controller, transport, endpoint, http, clientOptions, threadId, slots, registry, labels, onOpenObject, onThreadForked, onConnectionRequest, onRenderError, onClientEffect, load, onLoadError, children, }: AgentKitRootProps): import("react").JSX.Element;
|
|
58
|
+
//# sourceMappingURL=root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.d.ts","sourceRoot":"","sources":["../../src/react/root.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA8B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnE,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAGL,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,WAAW,EACX,cAAc,EACd,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,gB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B,OAAO,EAAE,sBAAsB,KAC5B,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,4EAA4E;IAC5E,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACzD,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE;QACxB,IAAI,EAAE,eAAe,GAAG,iBAAiB,CAAC;QAC1C,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAChC,KAAK,IAAI,CAAC;IACX,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IACzB,gFAAgF;IAChF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC;AAED,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG,oBAAoB,CAAC;AAE7E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,EAC3B,UAAU,EACV,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,IAAa,EACb,WAAW,EACX,QAAQ,GACT,EAAE,iBAAiB,+BA6KnB"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { createAgentKitHttpTransport, } from "../adapters/index.js";
|
|
4
|
+
import { createAgentKitClient, } from "../client/index.js";
|
|
5
|
+
import { AgentKitProvider, } from "./context.js";
|
|
6
|
+
const mountedManagedClients = new WeakMap();
|
|
7
|
+
/**
|
|
8
|
+
* Owns AgentKit's controller lifecycle without imposing a visual shell.
|
|
9
|
+
* Use this for custom products that compose the headless hooks directly.
|
|
10
|
+
*/
|
|
11
|
+
export function AgentKitRoot({ controller, transport, endpoint, http, clientOptions, threadId, slots, registry, labels, onOpenObject, onThreadForked, onConnectionRequest, onRenderError, onClientEffect, load = "auto", onLoadError, children, }) {
|
|
12
|
+
const sourceCount = Number(controller !== undefined) +
|
|
13
|
+
Number(transport !== undefined) +
|
|
14
|
+
Number(endpoint !== undefined);
|
|
15
|
+
if (sourceCount !== 1) {
|
|
16
|
+
throw new Error("AgentKitRoot requires exactly one controller, transport, or HTTP endpoint.");
|
|
17
|
+
}
|
|
18
|
+
const httpFetch = http?.fetch;
|
|
19
|
+
const httpHeaders = http?.headers;
|
|
20
|
+
const httpCreateCorrelationId = http?.createCorrelationId;
|
|
21
|
+
const httpSignal = http?.signal;
|
|
22
|
+
const resolvedTransport = useMemo(() => transport ??
|
|
23
|
+
(endpoint
|
|
24
|
+
? createAgentKitHttpTransport({
|
|
25
|
+
baseUrl: endpoint,
|
|
26
|
+
fetch: httpFetch,
|
|
27
|
+
headers: httpHeaders,
|
|
28
|
+
createCorrelationId: httpCreateCorrelationId,
|
|
29
|
+
signal: httpSignal,
|
|
30
|
+
})
|
|
31
|
+
: undefined), [
|
|
32
|
+
endpoint,
|
|
33
|
+
httpCreateCorrelationId,
|
|
34
|
+
httpFetch,
|
|
35
|
+
httpHeaders,
|
|
36
|
+
httpSignal,
|
|
37
|
+
transport,
|
|
38
|
+
]);
|
|
39
|
+
const createId = clientOptions?.createId;
|
|
40
|
+
const now = clientOptions?.now;
|
|
41
|
+
const reconnectAttempts = clientOptions?.reconnect?.attempts;
|
|
42
|
+
const reconnectDelay = clientOptions?.reconnect?.delayMs;
|
|
43
|
+
const onError = clientOptions?.onError;
|
|
44
|
+
const onIntegrityReport = clientOptions?.onIntegrityReport;
|
|
45
|
+
const upload = clientOptions?.upload;
|
|
46
|
+
const transportOwnership = endpoint
|
|
47
|
+
? "owned"
|
|
48
|
+
: clientOptions?.transportOwnership;
|
|
49
|
+
const retainActiveRunsOnThreadRelease = clientOptions?.retainActiveRunsOnThreadRelease;
|
|
50
|
+
const managedClient = useMemo(() => controller
|
|
51
|
+
? undefined
|
|
52
|
+
: createAgentKitClient({
|
|
53
|
+
transport: resolvedTransport,
|
|
54
|
+
transportOwnership,
|
|
55
|
+
createId,
|
|
56
|
+
now,
|
|
57
|
+
reconnect: {
|
|
58
|
+
attempts: reconnectAttempts,
|
|
59
|
+
delayMs: reconnectDelay,
|
|
60
|
+
},
|
|
61
|
+
onError,
|
|
62
|
+
onIntegrityReport,
|
|
63
|
+
retainActiveRunsOnThreadRelease,
|
|
64
|
+
upload,
|
|
65
|
+
}), [
|
|
66
|
+
controller,
|
|
67
|
+
createId,
|
|
68
|
+
now,
|
|
69
|
+
onError,
|
|
70
|
+
onIntegrityReport,
|
|
71
|
+
reconnectAttempts,
|
|
72
|
+
reconnectDelay,
|
|
73
|
+
resolvedTransport,
|
|
74
|
+
retainActiveRunsOnThreadRelease,
|
|
75
|
+
transportOwnership,
|
|
76
|
+
upload,
|
|
77
|
+
]);
|
|
78
|
+
const resolvedController = controller ?? managedClient;
|
|
79
|
+
if (!resolvedController) {
|
|
80
|
+
throw new Error("AgentKitRoot requires a controller, transport, or HTTP endpoint.");
|
|
81
|
+
}
|
|
82
|
+
const activeLoadLease = useRef(undefined);
|
|
83
|
+
const onLoadErrorRef = useRef(onLoadError);
|
|
84
|
+
onLoadErrorRef.current = onLoadError;
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (load !== "auto")
|
|
87
|
+
return;
|
|
88
|
+
const lease = {
|
|
89
|
+
controller: resolvedController,
|
|
90
|
+
threadId,
|
|
91
|
+
released: false,
|
|
92
|
+
};
|
|
93
|
+
activeLoadLease.current = lease;
|
|
94
|
+
// openThread loads the projection, resumes active runs, and owns the
|
|
95
|
+
// subscriptions until this client/thread scope releases its lease.
|
|
96
|
+
void resolvedController
|
|
97
|
+
.openThread(threadId)
|
|
98
|
+
.then((threadLease) => {
|
|
99
|
+
lease.thread = threadLease;
|
|
100
|
+
if (lease.released || activeLoadLease.current !== lease) {
|
|
101
|
+
threadLease.release();
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
.catch((error) => {
|
|
105
|
+
if (!lease.released && activeLoadLease.current === lease) {
|
|
106
|
+
onLoadErrorRef.current?.(error);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const active = activeLoadLease.current;
|
|
110
|
+
if (!active ||
|
|
111
|
+
active.released ||
|
|
112
|
+
active.controller !== resolvedController) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
// A caller-owned client can finish an obsolete load after the current
|
|
116
|
+
// thread succeeded. Refresh the active projection so that stale global
|
|
117
|
+
// connection state cannot replace the current thread's recovered state.
|
|
118
|
+
void active.controller
|
|
119
|
+
.loadThread(active.threadId)
|
|
120
|
+
.catch((activeError) => {
|
|
121
|
+
if (activeLoadLease.current === active && !active.released) {
|
|
122
|
+
onLoadErrorRef.current?.(activeError);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
return () => {
|
|
127
|
+
lease.released = true;
|
|
128
|
+
lease.thread?.release();
|
|
129
|
+
};
|
|
130
|
+
}, [load, resolvedController, threadId]);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!managedClient)
|
|
133
|
+
return;
|
|
134
|
+
mountedManagedClients.set(managedClient, (mountedManagedClients.get(managedClient) ?? 0) + 1);
|
|
135
|
+
return () => {
|
|
136
|
+
const remaining = (mountedManagedClients.get(managedClient) ?? 1) - 1;
|
|
137
|
+
mountedManagedClients.set(managedClient, remaining);
|
|
138
|
+
// Strict Mode replays effects in the same task. Deferring disposal lets
|
|
139
|
+
// the replacement setup retain the same client while real unmounts still
|
|
140
|
+
// release it deterministically.
|
|
141
|
+
queueMicrotask(() => {
|
|
142
|
+
if ((mountedManagedClients.get(managedClient) ?? 0) > 0)
|
|
143
|
+
return;
|
|
144
|
+
mountedManagedClients.delete(managedClient);
|
|
145
|
+
managedClient.dispose();
|
|
146
|
+
});
|
|
147
|
+
};
|
|
148
|
+
}, [managedClient]);
|
|
149
|
+
return (_jsx(AgentKitProvider, { controller: resolvedController, threadId: threadId, slots: slots, registry: registry, labels: labels, onOpenObject: onOpenObject, onThreadForked: onThreadForked, onConnectionRequest: onConnectionRequest, onRenderError: onRenderError, onClientEffect: onClientEffect, children: children }));
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../src/react/root.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAkB,MAAM,OAAO,CAAC;AAEnE,OAAO,EACL,2BAA2B,GAE5B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,GAKrB,MAAM,oBAAoB,CAAC;AAS5B,OAAO,EACL,gBAAgB,GAKjB,MAAM,cAAc,CAAC;AAEtB,MAAM,qBAAqB,GAAG,IAAI,OAAO,EAA0B,CAAC;AAmEpE;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,UAAU,EACV,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,aAAa,EACb,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,MAAM,EACN,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,IAAI,GAAG,MAAM,EACb,WAAW,EACX,QAAQ,GACU;IAClB,MAAM,WAAW,GACf,MAAM,CAAC,UAAU,KAAK,SAAS,CAAC;QAChC,MAAM,CAAC,SAAS,KAAK,SAAS,CAAC;QAC/B,MAAM,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC;IACjC,IAAI,WAAW,KAAK,CAAC,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CACb,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,IAAI,EAAE,KAAK,CAAC;IAC9B,MAAM,WAAW,GAAG,IAAI,EAAE,OAAO,CAAC;IACl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