@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.
Files changed (88) hide show
  1. package/ARCHITECTURE.md +290 -0
  2. package/README.md +822 -0
  3. package/dist/adapters/http.d.ts +56 -0
  4. package/dist/adapters/http.d.ts.map +1 -0
  5. package/dist/adapters/http.js +950 -0
  6. package/dist/adapters/http.js.map +1 -0
  7. package/dist/adapters/index.d.ts +2 -0
  8. package/dist/adapters/index.d.ts.map +1 -0
  9. package/dist/adapters/index.js +2 -0
  10. package/dist/adapters/index.js.map +1 -0
  11. package/dist/client/client.d.ts +240 -0
  12. package/dist/client/client.d.ts.map +1 -0
  13. package/dist/client/client.js +1605 -0
  14. package/dist/client/client.js.map +1 -0
  15. package/dist/client/index.d.ts +3 -0
  16. package/dist/client/index.d.ts.map +1 -0
  17. package/dist/client/index.js +3 -0
  18. package/dist/client/index.js.map +1 -0
  19. package/dist/client/state.d.ts +72 -0
  20. package/dist/client/state.d.ts.map +1 -0
  21. package/dist/client/state.js +385 -0
  22. package/dist/client/state.js.map +1 -0
  23. package/dist/conformance/index.d.ts +41 -0
  24. package/dist/conformance/index.d.ts.map +1 -0
  25. package/dist/conformance/index.js +924 -0
  26. package/dist/conformance/index.js.map +1 -0
  27. package/dist/index.d.ts +3 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +3 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/protocol/agui-codec.d.ts +28 -0
  32. package/dist/protocol/agui-codec.d.ts.map +1 -0
  33. package/dist/protocol/agui-codec.js +250 -0
  34. package/dist/protocol/agui-codec.js.map +1 -0
  35. package/dist/protocol/agui.d.ts +144 -0
  36. package/dist/protocol/agui.d.ts.map +1 -0
  37. package/dist/protocol/agui.js +253 -0
  38. package/dist/protocol/agui.js.map +1 -0
  39. package/dist/protocol/compatibility.d.ts +35 -0
  40. package/dist/protocol/compatibility.d.ts.map +1 -0
  41. package/dist/protocol/compatibility.js +160 -0
  42. package/dist/protocol/compatibility.js.map +1 -0
  43. package/dist/protocol/errors.d.ts +24 -0
  44. package/dist/protocol/errors.d.ts.map +1 -0
  45. package/dist/protocol/errors.js +77 -0
  46. package/dist/protocol/errors.js.map +1 -0
  47. package/dist/protocol/index.d.ts +982 -0
  48. package/dist/protocol/index.d.ts.map +1 -0
  49. package/dist/protocol/index.js +56 -0
  50. package/dist/protocol/index.js.map +1 -0
  51. package/dist/protocol/validation.d.ts +94 -0
  52. package/dist/protocol/validation.d.ts.map +1 -0
  53. package/dist/protocol/validation.js +1871 -0
  54. package/dist/protocol/validation.js.map +1 -0
  55. package/dist/protocol/version.d.ts +7 -0
  56. package/dist/protocol/version.d.ts.map +1 -0
  57. package/dist/protocol/version.js +9 -0
  58. package/dist/protocol/version.js.map +1 -0
  59. package/dist/react/chat.d.ts +34 -0
  60. package/dist/react/chat.d.ts.map +1 -0
  61. package/dist/react/chat.js +23 -0
  62. package/dist/react/chat.js.map +1 -0
  63. package/dist/react/components.d.ts +96 -0
  64. package/dist/react/components.d.ts.map +1 -0
  65. package/dist/react/components.js +1300 -0
  66. package/dist/react/components.js.map +1 -0
  67. package/dist/react/context.d.ts +259 -0
  68. package/dist/react/context.d.ts.map +1 -0
  69. package/dist/react/context.js +359 -0
  70. package/dist/react/context.js.map +1 -0
  71. package/dist/react/headless.d.ts +3 -0
  72. package/dist/react/headless.d.ts.map +1 -0
  73. package/dist/react/headless.js +3 -0
  74. package/dist/react/headless.js.map +1 -0
  75. package/dist/react/index.d.ts +6 -0
  76. package/dist/react/index.d.ts.map +1 -0
  77. package/dist/react/index.js +6 -0
  78. package/dist/react/index.js.map +1 -0
  79. package/dist/react/root.d.ts +58 -0
  80. package/dist/react/root.d.ts.map +1 -0
  81. package/dist/react/root.js +151 -0
  82. package/dist/react/root.js.map +1 -0
  83. package/dist/react/streaming-text.d.ts +19 -0
  84. package/dist/react/streaming-text.d.ts.map +1 -0
  85. package/dist/react/streaming-text.js +259 -0
  86. package/dist/react/streaming-text.js.map +1 -0
  87. package/dist/react/styles.css +1477 -0
  88. package/package.json +112 -0
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ /** Advances one synthetic frame for non-React consumers and focused tests. */
3
+ export declare function advanceBufferedText(visible: string, target: string): string;
4
+ export interface UseBufferedAgentTextOptions {
5
+ active: boolean;
6
+ resetKey: string;
7
+ frameMs?: number;
8
+ }
9
+ /** Smooths irregular transport chunks into animation-frame-paced text. */
10
+ export declare function useBufferedAgentText(text: string, { active, resetKey, frameMs, }: UseBufferedAgentTextOptions): string;
11
+ export interface AgentStreamingTextProps {
12
+ text: string;
13
+ active: boolean;
14
+ resetKey: string;
15
+ frameMs?: number;
16
+ children?: (visibleText: string) => ReactNode;
17
+ }
18
+ export declare function AgentStreamingText({ text, active, resetKey, frameMs, children, }: AgentStreamingTextProps): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | Iterable<ReactNode> | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | import("react").ReactPortal | null | undefined> | null | undefined;
19
+ //# sourceMappingURL=streaming-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming-text.d.ts","sourceRoot":"","sources":["../../src/react/streaming-text.tsx"],"names":[],"mappings":"AAOA,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAoEf,8EAA8E;AAC9E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAW3E;AAED,MAAM,WAAW,2BAA2B;IAC1C,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,EACE,MAAM,EACN,QAAQ,EACR,OAA6C,GAC9C,EAAE,2BAA2B,GAC7B,MAAM,CAqNR;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,SAAS,CAAC;CAC/C;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,QAAQ,GACT,EAAE,uBAAuB,+TAOzB"}
@@ -0,0 +1,259 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { initialSmoothStreamingGraphemeCount, smoothStreamingPunctuationDelayMs, smoothStreamingRevealCount, splitStreamingTextGraphemes, SMOOTH_STREAMING_COMMIT_INTERVAL_MS, } from "@agent-native/toolkit/agentkit";
3
+ import { Fragment, useCallback, useEffect, useRef, useState, } from "react";
4
+ const bufferedTextCache = new Map();
5
+ const maximumCacheEntries = 128;
6
+ const emptyGraphemes = [];
7
+ function cachedBufferedText(resetKey, targetText) {
8
+ const cached = bufferedTextCache.get(resetKey);
9
+ if (!cached)
10
+ return undefined;
11
+ return targetText.startsWith(cached.targetText) &&
12
+ targetText.startsWith(cached.visibleText)
13
+ ? cached.visibleText
14
+ : undefined;
15
+ }
16
+ function remember(resetKey, targetText, visibleText) {
17
+ bufferedTextCache.delete(resetKey);
18
+ bufferedTextCache.set(resetKey, { targetText, visibleText });
19
+ if (bufferedTextCache.size <= maximumCacheEntries)
20
+ return;
21
+ const oldest = bufferedTextCache.keys().next().value;
22
+ if (oldest !== undefined)
23
+ bufferedTextCache.delete(oldest);
24
+ }
25
+ function sliceGraphemes(targetText, graphemes, count) {
26
+ if (count >= graphemes.length)
27
+ return targetText;
28
+ if (count <= 0)
29
+ return "";
30
+ return graphemes.slice(0, count).join("");
31
+ }
32
+ function usePrefersReducedMotion() {
33
+ const [prefersReducedMotion, setPrefersReducedMotion] = useState(() => typeof window !== "undefined" && window.matchMedia
34
+ ? window.matchMedia("(prefers-reduced-motion: reduce)").matches
35
+ : false);
36
+ useEffect(() => {
37
+ if (typeof window === "undefined" || !window.matchMedia)
38
+ return;
39
+ const media = window.matchMedia("(prefers-reduced-motion: reduce)");
40
+ const handleChange = () => setPrefersReducedMotion(media.matches);
41
+ handleChange();
42
+ if (typeof media.addEventListener === "function") {
43
+ media.addEventListener("change", handleChange);
44
+ return () => media.removeEventListener("change", handleChange);
45
+ }
46
+ media.addListener(handleChange);
47
+ return () => media.removeListener(handleChange);
48
+ }, []);
49
+ return prefersReducedMotion;
50
+ }
51
+ /** Advances one synthetic frame for non-React consumers and focused tests. */
52
+ export function advanceBufferedText(visible, target) {
53
+ if (!target.startsWith(visible))
54
+ return target;
55
+ const targetGraphemes = splitStreamingTextGraphemes(target);
56
+ const visibleCount = splitStreamingTextGraphemes(visible).length;
57
+ const backlog = targetGraphemes.length - visibleCount;
58
+ if (backlog <= 0)
59
+ return target;
60
+ const revealCount = smoothStreamingRevealCount({
61
+ backlog,
62
+ elapsedMs: SMOOTH_STREAMING_COMMIT_INTERVAL_MS,
63
+ });
64
+ return sliceGraphemes(target, targetGraphemes, visibleCount + revealCount);
65
+ }
66
+ /** Smooths irregular transport chunks into animation-frame-paced text. */
67
+ export function useBufferedAgentText(text, { active, resetKey, frameMs = SMOOTH_STREAMING_COMMIT_INTERVAL_MS, }) {
68
+ const prefersReducedMotion = usePrefersReducedMotion();
69
+ const [visible, setVisible] = useState(() => {
70
+ if (!active || prefersReducedMotion)
71
+ return text;
72
+ const cached = cachedBufferedText(resetKey, text);
73
+ if (cached !== undefined)
74
+ return cached;
75
+ const targetGraphemes = splitStreamingTextGraphemes(text);
76
+ return sliceGraphemes(text, targetGraphemes, initialSmoothStreamingGraphemeCount(targetGraphemes));
77
+ });
78
+ const visibleRef = useRef(visible);
79
+ const targetRef = useRef(text);
80
+ const targetGraphemesRef = useRef(emptyGraphemes);
81
+ const visibleCountRef = useRef(-1);
82
+ if (visibleCountRef.current < 0) {
83
+ if (active && !prefersReducedMotion) {
84
+ targetGraphemesRef.current = splitStreamingTextGraphemes(text);
85
+ visibleCountRef.current = splitStreamingTextGraphemes(visible).length;
86
+ }
87
+ else {
88
+ visibleCountRef.current = 0;
89
+ }
90
+ }
91
+ const frameRef = useRef(null);
92
+ const lastCommitAtRef = useRef(0);
93
+ const pauseUntilRef = useRef(0);
94
+ const inputDoneRef = useRef(false);
95
+ const resetKeyRef = useRef(resetKey);
96
+ const cacheKeyRef = useRef(resetKey);
97
+ const cacheActiveRef = useRef(active);
98
+ const cacheReducedMotionRef = useRef(prefersReducedMotion);
99
+ const stepRef = useRef(() => { });
100
+ cacheKeyRef.current = resetKey;
101
+ cacheActiveRef.current = active;
102
+ cacheReducedMotionRef.current = prefersReducedMotion;
103
+ const commitVisibleCount = useCallback((nextCount) => {
104
+ const targetGraphemes = targetGraphemesRef.current;
105
+ const boundedCount = Math.max(0, Math.min(nextCount, targetGraphemes.length));
106
+ const nextText = sliceGraphemes(targetRef.current, targetGraphemes, boundedCount);
107
+ visibleCountRef.current = boundedCount;
108
+ if (visibleRef.current !== nextText) {
109
+ visibleRef.current = nextText;
110
+ setVisible(nextText);
111
+ }
112
+ if (cacheActiveRef.current && !cacheReducedMotionRef.current) {
113
+ remember(cacheKeyRef.current, targetRef.current, nextText);
114
+ }
115
+ }, []);
116
+ const cancelFrame = useCallback(() => {
117
+ if (frameRef.current !== null &&
118
+ typeof window !== "undefined" &&
119
+ typeof window.cancelAnimationFrame === "function") {
120
+ window.cancelAnimationFrame(frameRef.current);
121
+ }
122
+ frameRef.current = null;
123
+ pauseUntilRef.current = 0;
124
+ }, []);
125
+ const scheduleFrame = useCallback(() => {
126
+ if (frameRef.current !== null)
127
+ return;
128
+ if (typeof window === "undefined" ||
129
+ typeof window.requestAnimationFrame !== "function") {
130
+ commitVisibleCount(targetGraphemesRef.current.length);
131
+ return;
132
+ }
133
+ frameRef.current = window.requestAnimationFrame((time) => {
134
+ frameRef.current = null;
135
+ stepRef.current(time);
136
+ });
137
+ }, [commitVisibleCount]);
138
+ stepRef.current = (time) => {
139
+ const targetGraphemes = targetGraphemesRef.current;
140
+ const backlog = targetGraphemes.length - visibleCountRef.current;
141
+ if (backlog <= 0) {
142
+ pauseUntilRef.current = 0;
143
+ return;
144
+ }
145
+ if (pauseUntilRef.current > time) {
146
+ scheduleFrame();
147
+ return;
148
+ }
149
+ const lastCommitAt = lastCommitAtRef.current || time - frameMs;
150
+ if (time - lastCommitAt < frameMs && backlog > 1) {
151
+ scheduleFrame();
152
+ return;
153
+ }
154
+ const revealCount = smoothStreamingRevealCount({
155
+ backlog,
156
+ elapsedMs: Math.min(120, Math.max(8, time - lastCommitAt)),
157
+ inputDone: inputDoneRef.current,
158
+ });
159
+ if (revealCount > 0) {
160
+ commitVisibleCount(visibleCountRef.current + revealCount);
161
+ lastCommitAtRef.current = time;
162
+ const nextBacklog = targetGraphemes.length - visibleCountRef.current;
163
+ const pauseMs = smoothStreamingPunctuationDelayMs(targetGraphemes[visibleCountRef.current - 1], nextBacklog);
164
+ pauseUntilRef.current = pauseMs > 0 ? time + pauseMs : 0;
165
+ }
166
+ if (visibleCountRef.current < targetGraphemes.length) {
167
+ scheduleFrame();
168
+ }
169
+ else {
170
+ pauseUntilRef.current = 0;
171
+ }
172
+ };
173
+ useEffect(() => {
174
+ targetRef.current = text;
175
+ const keyChanged = resetKeyRef.current !== resetKey;
176
+ resetKeyRef.current = resetKey;
177
+ const targetGraphemes = splitStreamingTextGraphemes(text);
178
+ const shouldDrain = !keyChanged &&
179
+ !active &&
180
+ !prefersReducedMotion &&
181
+ visibleRef.current.length > 0 &&
182
+ visibleRef.current !== text &&
183
+ text.startsWith(visibleRef.current);
184
+ if (shouldDrain) {
185
+ targetGraphemesRef.current = targetGraphemes;
186
+ inputDoneRef.current = true;
187
+ scheduleFrame();
188
+ return;
189
+ }
190
+ if (!active || prefersReducedMotion) {
191
+ cancelFrame();
192
+ inputDoneRef.current = false;
193
+ targetGraphemesRef.current = emptyGraphemes;
194
+ visibleCountRef.current = 0;
195
+ if (visibleRef.current !== text) {
196
+ visibleRef.current = text;
197
+ setVisible(text);
198
+ }
199
+ return;
200
+ }
201
+ targetGraphemesRef.current = targetGraphemes;
202
+ inputDoneRef.current = false;
203
+ const visibleNoLongerMatches = visibleRef.current.length > 0 && !text.startsWith(visibleRef.current);
204
+ if (keyChanged ||
205
+ visibleNoLongerMatches ||
206
+ visibleCountRef.current > targetGraphemes.length) {
207
+ commitVisibleCount(initialSmoothStreamingGraphemeCount(targetGraphemes));
208
+ lastCommitAtRef.current = 0;
209
+ pauseUntilRef.current = 0;
210
+ }
211
+ if (visibleCountRef.current < targetGraphemes.length)
212
+ scheduleFrame();
213
+ }, [
214
+ active,
215
+ cancelFrame,
216
+ commitVisibleCount,
217
+ prefersReducedMotion,
218
+ resetKey,
219
+ scheduleFrame,
220
+ text,
221
+ ]);
222
+ useEffect(() => {
223
+ if (!active || prefersReducedMotion)
224
+ return;
225
+ remember(resetKey, text, visible);
226
+ }, [active, prefersReducedMotion, resetKey, text, visible]);
227
+ useEffect(() => {
228
+ if (typeof document === "undefined")
229
+ return;
230
+ const handleVisibilityChange = () => {
231
+ if (document.visibilityState !== "visible" ||
232
+ !active ||
233
+ prefersReducedMotion) {
234
+ return;
235
+ }
236
+ const targetGraphemes = targetGraphemesRef.current;
237
+ const backlog = targetGraphemes.length - visibleCountRef.current;
238
+ if (backlog <= 2_000)
239
+ return;
240
+ commitVisibleCount(Math.max(0, targetGraphemes.length - 200));
241
+ lastCommitAtRef.current = 0;
242
+ pauseUntilRef.current = 0;
243
+ scheduleFrame();
244
+ };
245
+ document.addEventListener("visibilitychange", handleVisibilityChange);
246
+ return () => document.removeEventListener("visibilitychange", handleVisibilityChange);
247
+ }, [active, commitVisibleCount, prefersReducedMotion, scheduleFrame]);
248
+ useEffect(() => cancelFrame, [cancelFrame]);
249
+ return visible;
250
+ }
251
+ export function AgentStreamingText({ text, active, resetKey, frameMs, children, }) {
252
+ const visibleText = useBufferedAgentText(text, {
253
+ active,
254
+ resetKey,
255
+ frameMs,
256
+ });
257
+ return children ? children(visibleText) : _jsx(Fragment, { children: visibleText });
258
+ }
259
+ //# sourceMappingURL=streaming-text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streaming-text.js","sourceRoot":"","sources":["../../src/react/streaming-text.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,mCAAmC,EACnC,iCAAiC,EACjC,0BAA0B,EAC1B,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAOf,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkC,CAAC;AACpE,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,cAAc,GAAa,EAAE,CAAC;AAEpC,SAAS,kBAAkB,CACzB,QAAgB,EAChB,UAAkB;IAElB,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC;QAC7C,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC;QACzC,CAAC,CAAC,MAAM,CAAC,WAAW;QACpB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,SAAS,QAAQ,CACf,QAAgB,EAChB,UAAkB,EAClB,WAAmB;IAEnB,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IACnC,iBAAiB,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC;IAC7D,IAAI,iBAAiB,CAAC,IAAI,IAAI,mBAAmB;QAAE,OAAO;IA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