@agent-native/toolkit 0.217.0 → 0.218.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/agent-native.eject.json +21 -0
- package/dist/app/agent-page/AgentContextTab.d.ts.map +1 -1
- package/dist/app/agent-page/AgentContextTab.js +1 -0
- package/dist/app/agent-page/AgentContextTab.js.map +1 -1
- package/dist/app/agentkit/react/components.d.ts.map +1 -1
- package/dist/app/agentkit/react/components.js +1 -1
- package/dist/app/agentkit/react/components.js.map +1 -1
- package/dist/app/agentkit/react/context.d.ts +4 -1
- package/dist/app/agentkit/react/context.d.ts.map +1 -1
- package/dist/app/agentkit/react/context.js +3 -1
- package/dist/app/agentkit/react/context.js.map +1 -1
- package/dist/app/agentkit/react/data-chart-layout.d.ts +30 -0
- package/dist/app/agentkit/react/data-chart-layout.d.ts.map +1 -0
- package/dist/app/agentkit/react/data-chart-layout.js +2 -0
- package/dist/app/agentkit/react/data-chart-layout.js.map +1 -0
- package/dist/app/agentkit/react/index.d.ts +1 -0
- package/dist/app/agentkit/react/index.d.ts.map +1 -1
- package/dist/app/agentkit/react/index.js +1 -0
- package/dist/app/agentkit/react/index.js.map +1 -1
- package/dist/app/agentkit/react/root.d.ts +3 -1
- package/dist/app/agentkit/react/root.d.ts.map +1 -1
- package/dist/app/agentkit/react/root.js +2 -2
- package/dist/app/agentkit/react/root.js.map +1 -1
- package/dist/app/agentkit/react/styles.css +18 -0
- package/dist/app/agentkit/react/transcript-layout.d.ts +2 -0
- package/dist/app/agentkit/react/transcript-layout.d.ts.map +1 -1
- package/dist/app/agentkit/react/transcript-layout.js.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/AgentKitAssistantChat.js +2 -2
- package/dist/app/chat/AgentKitAssistantChat.js.map +1 -1
- package/dist/app/chat/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/app/chat/MultiTabAssistantChat.js +51 -93
- package/dist/app/chat/MultiTabAssistantChat.js.map +1 -1
- package/dist/app/chat/agentkit-chat/action-widget.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/action-widget.js +3 -1
- package/dist/app/chat/agentkit-chat/action-widget.js.map +1 -1
- package/dist/app/chat/agentkit-chat/rail.d.ts +1 -1
- package/dist/app/chat/agentkit-chat/rail.d.ts.map +1 -1
- package/dist/app/chat/agentkit-chat/rail.js +1 -1
- package/dist/app/chat/agentkit-chat/rail.js.map +1 -1
- package/dist/app/chat/chat/index.d.ts +2 -1
- package/dist/app/chat/chat/index.d.ts.map +1 -1
- package/dist/app/chat/chat/index.js +1 -1
- package/dist/app/chat/chat/index.js.map +1 -1
- package/dist/app/chat/chat/surface-types.d.ts +3 -0
- package/dist/app/chat/chat/surface-types.d.ts.map +1 -1
- package/dist/app/chat/chat/surface-types.js.map +1 -1
- package/dist/app/chat/chat/tool-call-display.d.ts +3 -1
- package/dist/app/chat/chat/tool-call-display.d.ts.map +1 -1
- package/dist/app/chat/chat/tool-call-display.js +4 -3
- package/dist/app/chat/chat/tool-call-display.js.map +1 -1
- package/dist/app/chat/chat/tool-render-registry.d.ts +2 -0
- package/dist/app/chat/chat/tool-render-registry.d.ts.map +1 -1
- package/dist/app/chat/chat/tool-render-registry.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartRenderer.d.ts +3 -1
- package/dist/app/chat/chat/widgets/DataChartRenderer.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartRenderer.js +116 -26
- package/dist/app/chat/chat/widgets/DataChartRenderer.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartWidget.d.ts +3 -1
- package/dist/app/chat/chat/widgets/DataChartWidget.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataChartWidget.js +21 -2
- package/dist/app/chat/chat/widgets/DataChartWidget.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataInsightsWidget.d.ts +3 -1
- package/dist/app/chat/chat/widgets/DataInsightsWidget.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataInsightsWidget.js +2 -2
- package/dist/app/chat/chat/widgets/DataInsightsWidget.js.map +1 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.d.ts +1 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.js +3 -1
- package/dist/app/chat/chat/widgets/DataWidgetDisplayControls.js.map +1 -1
- package/dist/app/chat/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/app/chat/chat/widgets/builtin-tool-renderers.js +2 -2
- package/dist/app/chat/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/app/chat/chat-first/chat-history.d.ts +13 -2
- package/dist/app/chat/chat-first/chat-history.d.ts.map +1 -1
- package/dist/app/chat/chat-first/chat-history.js +24 -3
- package/dist/app/chat/chat-first/chat-history.js.map +1 -1
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.d.ts +6 -0
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.js +9 -0
- package/dist/app/chat/ownership-history/ChatOwnerAvatar.js.map +1 -0
- package/dist/app/chat/ownership-history/index.d.ts +11 -0
- package/dist/app/chat/ownership-history/index.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/index.js +22 -0
- package/dist/app/chat/ownership-history/index.js.map +1 -0
- package/dist/app/chat/ownership-history/rows.d.ts +27 -0
- package/dist/app/chat/ownership-history/rows.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/rows.js +101 -0
- package/dist/app/chat/ownership-history/rows.js.map +1 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.d.ts +52 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.d.ts.map +1 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.js +497 -0
- package/dist/app/chat/ownership-history/useOwnershipChatHistory.js.map +1 -0
- package/dist/app/i18n/catalogs/ar-SA.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ar-SA.js +3 -0
- package/dist/app/i18n/catalogs/ar-SA.js.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/de-DE.js +3 -0
- package/dist/app/i18n/catalogs/de-DE.js.map +1 -1
- package/dist/app/i18n/catalogs/en-US.d.ts +3 -0
- package/dist/app/i18n/catalogs/en-US.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/en-US.js +3 -0
- package/dist/app/i18n/catalogs/en-US.js.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/es-ES.js +3 -0
- package/dist/app/i18n/catalogs/es-ES.js.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/fr-FR.js +3 -0
- package/dist/app/i18n/catalogs/fr-FR.js.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/hi-IN.js +3 -0
- package/dist/app/i18n/catalogs/hi-IN.js.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ja-JP.js +3 -0
- package/dist/app/i18n/catalogs/ja-JP.js.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/ko-KR.js +3 -0
- package/dist/app/i18n/catalogs/ko-KR.js.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/pt-BR.js +3 -0
- package/dist/app/i18n/catalogs/pt-BR.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-CN.js +3 -0
- package/dist/app/i18n/catalogs/zh-CN.js.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.d.ts.map +1 -1
- package/dist/app/i18n/catalogs/zh-TW.js +3 -0
- package/dist/app/i18n/catalogs/zh-TW.js.map +1 -1
- package/dist/app/sharing/ShareButton.d.ts.map +1 -1
- package/dist/app/sharing/ShareButton.js +9 -8
- package/dist/app/sharing/ShareButton.js.map +1 -1
- package/dist/chat-history/ChatHistoryList.d.ts +16 -3
- package/dist/chat-history/ChatHistoryList.d.ts.map +1 -1
- package/dist/chat-history/ChatHistoryList.js +25 -15
- package/dist/chat-history/ChatHistoryList.js.map +1 -1
- package/dist/chat-history.css +109 -9
- package/package.json +10 -3
- package/src/app/agent-page/AgentContextTab.spec.ts +50 -2
- package/src/app/agent-page/AgentContextTab.tsx +1 -0
- package/src/app/agentkit/react/components.interaction.spec.tsx +2 -0
- package/src/app/agentkit/react/components.spec.tsx +4 -1
- package/src/app/agentkit/react/components.tsx +3 -0
- package/src/app/agentkit/react/context.tsx +6 -0
- package/src/app/agentkit/react/data-chart-layout.ts +25 -0
- package/src/app/agentkit/react/index.ts +1 -0
- package/src/app/agentkit/react/root.tsx +4 -0
- package/src/app/agentkit/react/styles.css +18 -0
- package/src/app/agentkit/react/transcript-layout.ts +2 -0
- package/src/app/chat/AgentKitAssistantChat.tsx +2 -0
- package/src/app/chat/MultiTabAssistantChat.spec.tsx +270 -3
- package/src/app/chat/MultiTabAssistantChat.tsx +79 -156
- package/src/app/chat/agentkit-chat/action-widget.tsx +3 -0
- package/src/app/chat/agentkit-chat/rail.ts +11 -0
- package/src/app/chat/chat/index.ts +10 -0
- package/src/app/chat/chat/surface-types.ts +3 -0
- package/src/app/chat/chat/tool-call-display.spec.tsx +29 -0
- package/src/app/chat/chat/tool-call-display.tsx +7 -0
- package/src/app/chat/chat/tool-render-registry.tsx +3 -0
- package/src/app/chat/chat/widgets/DataChartRenderer.spec.tsx +377 -17
- package/src/app/chat/chat/widgets/DataChartRenderer.tsx +232 -63
- package/src/app/chat/chat/widgets/DataChartWidget.spec.tsx +67 -0
- package/src/app/chat/chat/widgets/DataChartWidget.tsx +39 -5
- package/src/app/chat/chat/widgets/DataInsightsWidget.tsx +13 -2
- package/src/app/chat/chat/widgets/DataWidgetDisplayControls.tsx +6 -4
- package/src/app/chat/chat/widgets/builtin-tool-renderers.tsx +5 -1
- package/src/app/chat/chat-first/chat-history.spec.tsx +79 -0
- package/src/app/chat/chat-first/chat-history.tsx +75 -22
- package/src/app/chat/ownership-history/ChatOwnerAvatar.tsx +27 -0
- package/src/app/chat/ownership-history/index.tsx +67 -0
- package/src/app/chat/ownership-history/ownership-history.spec.tsx +3146 -0
- package/src/app/chat/ownership-history/rows.ts +156 -0
- package/src/app/chat/ownership-history/useOwnershipChatHistory.ts +709 -0
- package/src/app/i18n/catalogs/ar-SA.ts +3 -0
- package/src/app/i18n/catalogs/de-DE.ts +3 -0
- package/src/app/i18n/catalogs/en-US.ts +3 -0
- package/src/app/i18n/catalogs/es-ES.ts +3 -0
- package/src/app/i18n/catalogs/fr-FR.ts +3 -0
- package/src/app/i18n/catalogs/hi-IN.ts +3 -0
- package/src/app/i18n/catalogs/ja-JP.ts +3 -0
- package/src/app/i18n/catalogs/ko-KR.ts +3 -0
- package/src/app/i18n/catalogs/pt-BR.ts +3 -0
- package/src/app/i18n/catalogs/zh-CN.ts +3 -0
- package/src/app/i18n/catalogs/zh-TW.ts +3 -0
- package/src/app/sharing/ShareButton.tsx +12 -10
- package/src/chat-history/ChatHistoryList.spec.tsx +51 -0
- package/src/chat-history/ChatHistoryList.tsx +87 -26
- package/src/chat-history/ChatHistoryRailSections.spec.tsx +12 -4
- package/src/chat-history.css +109 -9
package/dist/chat-history.css
CHANGED
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
min-height: 0;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/* A rail inside a popover, such as All chats, scrolls instead of growing. */
|
|
50
|
+
.an-chat-history--rail.an-chat-history--capped .an-chat-history__list {
|
|
51
|
+
max-height: 16rem;
|
|
52
|
+
}
|
|
53
|
+
|
|
49
54
|
.an-chat-history-rail .an-chat-history__state:empty {
|
|
50
55
|
display: none;
|
|
51
56
|
}
|
|
@@ -71,19 +76,60 @@
|
|
|
71
76
|
padding: 0 4px;
|
|
72
77
|
}
|
|
73
78
|
|
|
74
|
-
.an-chat-history-
|
|
79
|
+
.an-chat-history-row__owner-mark {
|
|
80
|
+
display: inline-flex;
|
|
81
|
+
flex-shrink: 0;
|
|
82
|
+
align-self: center;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* The active row has no timestamp; keep its avatar clear of the ⋯ trigger. */
|
|
86
|
+
.an-chat-history--rail
|
|
87
|
+
.an-chat-history-row--has-menu
|
|
88
|
+
.an-chat-history-row__owner-mark:last-child {
|
|
89
|
+
margin-inline-end: 18px;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.an-chat-owner-avatar {
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
flex-shrink: 0;
|
|
97
|
+
width: 16px;
|
|
98
|
+
height: 16px;
|
|
99
|
+
overflow: hidden;
|
|
100
|
+
border-radius: 9999px;
|
|
101
|
+
background: hsl(var(--muted));
|
|
102
|
+
/* guard:allow-raw-color — the initial sits on an emailToColor badge in both themes */
|
|
103
|
+
color: #fff;
|
|
104
|
+
font-size: 8px;
|
|
105
|
+
font-weight: 600;
|
|
106
|
+
line-height: 1;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.an-chat-owner-avatar__image {
|
|
110
|
+
width: 100%;
|
|
111
|
+
height: 100%;
|
|
112
|
+
object-fit: cover;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.an-chat-history-owner {
|
|
75
116
|
display: flex;
|
|
76
|
-
|
|
117
|
+
flex-direction: column;
|
|
118
|
+
gap: 1px;
|
|
77
119
|
min-width: 0;
|
|
78
|
-
|
|
79
|
-
font-size: 10px;
|
|
80
|
-
color: hsl(var(--muted-foreground) / 0.7);
|
|
120
|
+
text-align: start;
|
|
81
121
|
}
|
|
82
122
|
|
|
83
|
-
.an-chat-history-
|
|
123
|
+
.an-chat-history-owner__name {
|
|
124
|
+
min-width: 0;
|
|
84
125
|
overflow: hidden;
|
|
85
126
|
text-overflow: ellipsis;
|
|
86
127
|
white-space: nowrap;
|
|
128
|
+
font-weight: 500;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.an-chat-history-owner__access {
|
|
132
|
+
color: hsl(var(--muted-foreground));
|
|
87
133
|
}
|
|
88
134
|
|
|
89
135
|
.an-chat-history__state--error {
|
|
@@ -149,7 +195,10 @@
|
|
|
149
195
|
}
|
|
150
196
|
|
|
151
197
|
.an-chat-history-rail__disclosure,
|
|
152
|
-
.an-chat-history-rail__new-chat
|
|
198
|
+
.an-chat-history-rail__new-chat,
|
|
199
|
+
.an-chat-history-rail__section-toggle,
|
|
200
|
+
.an-chat-history-rail__load-more,
|
|
201
|
+
.an-chat-history-rail__retry {
|
|
153
202
|
display: flex;
|
|
154
203
|
align-items: center;
|
|
155
204
|
border: 0;
|
|
@@ -160,17 +209,52 @@
|
|
|
160
209
|
}
|
|
161
210
|
|
|
162
211
|
.an-chat-history-rail__disclosure:hover,
|
|
163
|
-
.an-chat-history-rail__new-chat:hover
|
|
212
|
+
.an-chat-history-rail__new-chat:hover,
|
|
213
|
+
.an-chat-history-rail__section-toggle:hover,
|
|
214
|
+
.an-chat-history-rail__load-more:hover,
|
|
215
|
+
.an-chat-history-rail__retry:hover {
|
|
164
216
|
background: hsl(var(--accent) / 0.5);
|
|
165
217
|
color: hsl(var(--accent-foreground));
|
|
166
218
|
}
|
|
167
219
|
|
|
168
220
|
.an-chat-history-rail__disclosure:focus-visible,
|
|
169
|
-
.an-chat-history-rail__new-chat:focus-visible
|
|
221
|
+
.an-chat-history-rail__new-chat:focus-visible,
|
|
222
|
+
.an-chat-history-rail__section-toggle:focus-visible,
|
|
223
|
+
.an-chat-history-rail__load-more:focus-visible,
|
|
224
|
+
.an-chat-history-rail__retry:focus-visible {
|
|
170
225
|
outline: 2px solid hsl(var(--ring));
|
|
171
226
|
outline-offset: -2px;
|
|
172
227
|
}
|
|
173
228
|
|
|
229
|
+
/* Show all, Load more and Retry match New chat: 12px muted text, not a button. */
|
|
230
|
+
.an-chat-history-rail__section-toggle,
|
|
231
|
+
.an-chat-history-rail__load-more,
|
|
232
|
+
.an-chat-history-rail__retry {
|
|
233
|
+
flex: 0 0 auto;
|
|
234
|
+
gap: 4px;
|
|
235
|
+
height: auto;
|
|
236
|
+
min-height: 26px;
|
|
237
|
+
padding: 4px 10px;
|
|
238
|
+
font-size: 12px;
|
|
239
|
+
font-weight: 500;
|
|
240
|
+
line-height: 1.4;
|
|
241
|
+
box-shadow: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.an-chat-history-rail__section-toggle svg,
|
|
245
|
+
.an-chat-history-rail__load-more svg,
|
|
246
|
+
.an-chat-history-rail__retry svg {
|
|
247
|
+
width: 13px;
|
|
248
|
+
height: 13px;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.an-chat-history__state .an-chat-history-rail__retry {
|
|
252
|
+
display: inline-flex;
|
|
253
|
+
min-height: 22px;
|
|
254
|
+
margin-inline-start: 4px;
|
|
255
|
+
padding: 2px 6px;
|
|
256
|
+
}
|
|
257
|
+
|
|
174
258
|
.an-chat-history-rail__disclosure {
|
|
175
259
|
justify-content: center;
|
|
176
260
|
flex: 0 0 auto;
|
|
@@ -267,6 +351,7 @@
|
|
|
267
351
|
|
|
268
352
|
.an-chat-history-row__title {
|
|
269
353
|
min-width: 0;
|
|
354
|
+
margin-inline-end: auto;
|
|
270
355
|
overflow: hidden;
|
|
271
356
|
text-overflow: ellipsis;
|
|
272
357
|
white-space: nowrap;
|
|
@@ -435,6 +520,21 @@
|
|
|
435
520
|
box-shadow: var(--agent-kit-overlay-elevation);
|
|
436
521
|
}
|
|
437
522
|
|
|
523
|
+
.an-chat-history-row__menu-owner {
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
gap: 8px;
|
|
527
|
+
max-width: 260px;
|
|
528
|
+
margin-bottom: 4px;
|
|
529
|
+
padding: 6px 8px 8px;
|
|
530
|
+
border-bottom: 1px solid hsl(var(--border));
|
|
531
|
+
font-size: 12px;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.an-chat-history-row__menu-owner .an-chat-history-owner__access {
|
|
535
|
+
font-size: 11px;
|
|
536
|
+
}
|
|
537
|
+
|
|
438
538
|
.an-chat-history-row__menu-item {
|
|
439
539
|
display: flex;
|
|
440
540
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.218.0",
|
|
4
4
|
"description": "Reusable app-building UI and helpers for Agent-Native apps.",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -46,6 +46,13 @@
|
|
|
46
46
|
"import": "./dist/app/chat/agent-sidebar-events.js",
|
|
47
47
|
"default": "./dist/app/chat/agent-sidebar-events.js"
|
|
48
48
|
},
|
|
49
|
+
"./app/chat/ownership-history": {
|
|
50
|
+
"types": "./dist/app/chat/ownership-history/index.d.ts",
|
|
51
|
+
"browser": "./dist/app/chat/ownership-history/index.js",
|
|
52
|
+
"development": "./dist/app/chat/ownership-history/index.js",
|
|
53
|
+
"import": "./dist/app/chat/ownership-history/index.js",
|
|
54
|
+
"default": "./dist/app/chat/ownership-history/index.js"
|
|
55
|
+
},
|
|
49
56
|
"./app/chat": {
|
|
50
57
|
"types": "./dist/app/chat/index.d.ts",
|
|
51
58
|
"browser": "./dist/app/chat/index.js",
|
|
@@ -678,7 +685,7 @@
|
|
|
678
685
|
"y-protocols": "^1.0.7",
|
|
679
686
|
"yjs": "^13.6.33",
|
|
680
687
|
"zod": "^4.3.6",
|
|
681
|
-
"@agent-native/agentkit": "^0.
|
|
688
|
+
"@agent-native/agentkit": "^0.218.0"
|
|
682
689
|
},
|
|
683
690
|
"devDependencies": {
|
|
684
691
|
"@excalidraw/excalidraw": "0.18.1",
|
|
@@ -702,7 +709,7 @@
|
|
|
702
709
|
"typescript-7": "npm:typescript@^7.0.2",
|
|
703
710
|
"vite": "8.1.0",
|
|
704
711
|
"vitest": "^4.1.5",
|
|
705
|
-
"@agent-native/core": "^0.
|
|
712
|
+
"@agent-native/core": "^0.218.0"
|
|
706
713
|
},
|
|
707
714
|
"peerDependencies": {
|
|
708
715
|
"@agent-native/core": ">=0.205.1",
|
|
@@ -1,7 +1,28 @@
|
|
|
1
1
|
import type { ChatThreadSummary } from "@agent-native/core/client/agent-chat";
|
|
2
|
-
import {
|
|
2
|
+
import { createElement } from "react";
|
|
3
|
+
import { renderToStaticMarkup } from "react-dom/server";
|
|
4
|
+
import { describe, expect, it, vi } from "vitest";
|
|
3
5
|
|
|
4
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
AgentContextTab,
|
|
8
|
+
mostRecentlyUpdatedThread,
|
|
9
|
+
} from "./AgentContextTab.js";
|
|
10
|
+
|
|
11
|
+
const hooks = vi.hoisted(() => ({
|
|
12
|
+
threads: vi.fn(),
|
|
13
|
+
query: vi.fn((..._args: unknown[]) => ({})),
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
vi.mock("@agent-native/core/client/agent-chat", () => ({
|
|
17
|
+
useChatThreads: hooks.threads,
|
|
18
|
+
}));
|
|
19
|
+
vi.mock("@agent-native/core/client/hooks", () => ({
|
|
20
|
+
useActionQuery: hooks.query,
|
|
21
|
+
}));
|
|
22
|
+
vi.mock("../context-xray/index.js", () => ({
|
|
23
|
+
ContextMeter: () => null,
|
|
24
|
+
ContextTreemap: () => null,
|
|
25
|
+
}));
|
|
5
26
|
|
|
6
27
|
function thread(
|
|
7
28
|
id: string,
|
|
@@ -32,4 +53,31 @@ describe("mostRecentlyUpdatedThread", () => {
|
|
|
32
53
|
it("returns undefined when no threads exist", () => {
|
|
33
54
|
expect(mostRecentlyUpdatedThread([])).toBeUndefined();
|
|
34
55
|
});
|
|
56
|
+
|
|
57
|
+
it("requests only owned lifecycle summaries before choosing the latest snapshot", () => {
|
|
58
|
+
hooks.threads.mockReturnValue({
|
|
59
|
+
threads: [thread("old-pinned", 100, 500), thread("newest", 300)],
|
|
60
|
+
});
|
|
61
|
+
hooks.query.mockClear();
|
|
62
|
+
renderToStaticMarkup(createElement(AgentContextTab, { scope: "user" }));
|
|
63
|
+
|
|
64
|
+
expect(hooks.threads).toHaveBeenCalledWith(
|
|
65
|
+
undefined,
|
|
66
|
+
"agent-context-page",
|
|
67
|
+
null,
|
|
68
|
+
{
|
|
69
|
+
autoCreate: false,
|
|
70
|
+
restoreActiveThread: false,
|
|
71
|
+
ownership: "mine",
|
|
72
|
+
},
|
|
73
|
+
);
|
|
74
|
+
expect(hooks.query.mock.calls).toEqual([
|
|
75
|
+
["context-preview-get", { scope: "user" }, { staleTime: 5_000 }],
|
|
76
|
+
[
|
|
77
|
+
"context-manifest-get",
|
|
78
|
+
{ threadId: "newest" },
|
|
79
|
+
{ enabled: true, staleTime: 1_000 },
|
|
80
|
+
],
|
|
81
|
+
]);
|
|
82
|
+
});
|
|
35
83
|
});
|
|
@@ -328,6 +328,7 @@ export function AgentContextTab({ scope }: AgentPageTabProps) {
|
|
|
328
328
|
const threads = useChatThreads(undefined, "agent-context-page", null, {
|
|
329
329
|
autoCreate: false,
|
|
330
330
|
restoreActiveThread: false,
|
|
331
|
+
ownership: "mine",
|
|
331
332
|
});
|
|
332
333
|
const latestThread = mostRecentlyUpdatedThread(threads.threads);
|
|
333
334
|
const liveManifestQuery = useActionQuery(
|
|
@@ -263,6 +263,7 @@ describe("AgentKitChat interactions", () => {
|
|
|
263
263
|
topInset: 5,
|
|
264
264
|
messageLaneWidth: 730,
|
|
265
265
|
messageLaneOffsetInline: -33,
|
|
266
|
+
messageLaneOffsetMode: "responsive",
|
|
266
267
|
messageGap: 12,
|
|
267
268
|
messageLineHeight: 20,
|
|
268
269
|
fontFamily: "IBM Plex Sans",
|
|
@@ -285,6 +286,7 @@ describe("AgentKitChat interactions", () => {
|
|
|
285
286
|
".agentkit-transcript-content",
|
|
286
287
|
);
|
|
287
288
|
expect(transcript).not.toBeNull();
|
|
289
|
+
expect(transcript!.dataset.laneOffsetMode).toBe("responsive");
|
|
288
290
|
expect(
|
|
289
291
|
transcript!.style.getPropertyValue("--agentkit-transcript-top-inset"),
|
|
290
292
|
).toBe("5px");
|
|
@@ -401,7 +401,10 @@ describe("AgentKitChat", () => {
|
|
|
401
401
|
".agentkit-transcript {\n grid-column: 1;\n grid-row: 2;",
|
|
402
402
|
);
|
|
403
403
|
expect(styles).toMatch(
|
|
404
|
-
/\.agentkit-transcript \{[\s\S]*inline-size: 100%;[\s\S]*overflow-y: auto;/,
|
|
404
|
+
/\.agentkit-transcript \{[\s\S]*container-name: agentkit-transcript;[\s\S]*container-type: inline-size;[\s\S]*inline-size: 100%;[\s\S]*overflow-y: auto;/,
|
|
405
|
+
);
|
|
406
|
+
expect(styles).toContain(
|
|
407
|
+
"@container agentkit-transcript (max-width: 74.999rem)",
|
|
405
408
|
);
|
|
406
409
|
expect(styles).not.toMatch(
|
|
407
410
|
/\.agentkit-transcript \{[^}]*inline-size: min\(100%, 47rem\);/,
|
|
@@ -5713,6 +5713,9 @@ export function AgentKitChat({
|
|
|
5713
5713
|
<div
|
|
5714
5714
|
ref={transcriptContentRef}
|
|
5715
5715
|
className="agentkit-transcript-content"
|
|
5716
|
+
data-lane-offset-mode={
|
|
5717
|
+
transcriptLayout?.messageLaneOffsetMode ?? "clamped"
|
|
5718
|
+
}
|
|
5716
5719
|
style={transcriptContentStyle(transcriptLayout)}
|
|
5717
5720
|
>
|
|
5718
5721
|
<AgentKitRegionSlot slot={Transcript} threadId={threadId}>
|
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
type ReactNode,
|
|
44
44
|
} from "react";
|
|
45
45
|
|
|
46
|
+
import type { AgentChatDataChartLayout } from "./data-chart-layout.js";
|
|
46
47
|
import type { AgentMessageContentOrderResolver } from "./message-content-order.js";
|
|
47
48
|
import type { AgentChatWorkedForRowLayout } from "./transcript-layout.js";
|
|
48
49
|
|
|
@@ -498,6 +499,7 @@ export interface AgentKitProviderProps {
|
|
|
498
499
|
onRenderError?: (failure: AgentKitRenderFailure) => void;
|
|
499
500
|
resolveMessageContentOrder?: AgentMessageContentOrderResolver;
|
|
500
501
|
workedForRowLayout?: AgentChatWorkedForRowLayout;
|
|
502
|
+
dataChartLayout?: AgentChatDataChartLayout;
|
|
501
503
|
formatWorkedForDuration?: (durationMs: number) => string;
|
|
502
504
|
onClientEffect?: (effect: {
|
|
503
505
|
type: "client.effect" | "client.deeplink";
|
|
@@ -530,6 +532,7 @@ export interface AgentKitContextValue {
|
|
|
530
532
|
onRenderError?: (failure: AgentKitRenderFailure) => void;
|
|
531
533
|
resolveMessageContentOrder?: AgentMessageContentOrderResolver;
|
|
532
534
|
workedForRowLayout?: AgentChatWorkedForRowLayout;
|
|
535
|
+
dataChartLayout?: AgentChatDataChartLayout;
|
|
533
536
|
formatWorkedForDuration?: (durationMs: number) => string;
|
|
534
537
|
registerComposerFocus: (threadId: ThreadId, focus: () => void) => () => void;
|
|
535
538
|
requestComposerFocus: (threadId: ThreadId) => void;
|
|
@@ -553,6 +556,7 @@ export function AgentKitProvider({
|
|
|
553
556
|
onRenderError,
|
|
554
557
|
resolveMessageContentOrder,
|
|
555
558
|
workedForRowLayout,
|
|
559
|
+
dataChartLayout,
|
|
556
560
|
formatWorkedForDuration,
|
|
557
561
|
onClientEffect,
|
|
558
562
|
children,
|
|
@@ -622,6 +626,7 @@ export function AgentKitProvider({
|
|
|
622
626
|
onRenderError,
|
|
623
627
|
resolveMessageContentOrder,
|
|
624
628
|
workedForRowLayout,
|
|
629
|
+
dataChartLayout,
|
|
625
630
|
formatWorkedForDuration,
|
|
626
631
|
registerComposerFocus,
|
|
627
632
|
requestComposerFocus,
|
|
@@ -642,6 +647,7 @@ export function AgentKitProvider({
|
|
|
642
647
|
onRenderError,
|
|
643
648
|
resolveMessageContentOrder,
|
|
644
649
|
workedForRowLayout,
|
|
650
|
+
dataChartLayout,
|
|
645
651
|
formatWorkedForDuration,
|
|
646
652
|
registerComposerFocus,
|
|
647
653
|
requestComposerFocus,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Optional shared presentation controls for built-in data charts in chat. */
|
|
2
|
+
export interface AgentChatDataChartLayout {
|
|
3
|
+
/** Maximum card width, in CSS pixels. The card remains responsive below it. */
|
|
4
|
+
maxWidth?: number;
|
|
5
|
+
/** Plot spacing in CSS pixels. The left inset remains data-driven. */
|
|
6
|
+
plotInsets?: { top?: number; right?: number; bottom?: number };
|
|
7
|
+
/** CSS font family for chart labels. */
|
|
8
|
+
labelFontFamily?: string;
|
|
9
|
+
/** Chart label font size, in CSS pixels. */
|
|
10
|
+
labelFontSize?: number;
|
|
11
|
+
/** Chart label color treatment. */
|
|
12
|
+
labelTone?: "foreground" | "muted";
|
|
13
|
+
/** CSS font family for the chart title. */
|
|
14
|
+
titleFontFamily?: string;
|
|
15
|
+
/** Chart title font size, in CSS pixels. */
|
|
16
|
+
titleFontSize?: number;
|
|
17
|
+
/** Chart title font weight. */
|
|
18
|
+
titleFontWeight?: number;
|
|
19
|
+
/** Chart title line height, in CSS pixels. */
|
|
20
|
+
titleLineHeight?: number;
|
|
21
|
+
/** Chart title color treatment. */
|
|
22
|
+
titleTone?: "foreground" | "muted";
|
|
23
|
+
/** Visual weight of chart display actions. */
|
|
24
|
+
actionsVariant?: "primary" | "secondary" | "quiet";
|
|
25
|
+
}
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
type AgentKitRunUsageLoader,
|
|
31
31
|
type AgentKitSlots,
|
|
32
32
|
} from "./context.js";
|
|
33
|
+
import type { AgentChatDataChartLayout } from "./data-chart-layout.js";
|
|
33
34
|
import type { AgentMessageContentOrderResolver } from "./message-content-order.js";
|
|
34
35
|
import type { AgentChatWorkedForRowLayout } from "./transcript-layout.js";
|
|
35
36
|
|
|
@@ -88,6 +89,7 @@ export interface AgentKitRootBaseProps {
|
|
|
88
89
|
onRenderError?: (failure: AgentKitRenderFailure) => void;
|
|
89
90
|
resolveMessageContentOrder?: AgentMessageContentOrderResolver;
|
|
90
91
|
workedForRowLayout?: AgentChatWorkedForRowLayout;
|
|
92
|
+
dataChartLayout?: AgentChatDataChartLayout;
|
|
91
93
|
formatWorkedForDuration?: (durationMs: number) => string;
|
|
92
94
|
onClientEffect?: (effect: {
|
|
93
95
|
type: "client.effect" | "client.deeplink";
|
|
@@ -120,6 +122,7 @@ export function AgentKitRoot({
|
|
|
120
122
|
onRenderError,
|
|
121
123
|
resolveMessageContentOrder,
|
|
122
124
|
workedForRowLayout,
|
|
125
|
+
dataChartLayout,
|
|
123
126
|
formatWorkedForDuration,
|
|
124
127
|
onClientEffect,
|
|
125
128
|
load = "auto",
|
|
@@ -300,6 +303,7 @@ export function AgentKitRoot({
|
|
|
300
303
|
onRenderError={onRenderError}
|
|
301
304
|
resolveMessageContentOrder={resolveMessageContentOrder}
|
|
302
305
|
workedForRowLayout={workedForRowLayout}
|
|
306
|
+
dataChartLayout={dataChartLayout}
|
|
303
307
|
formatWorkedForDuration={formatWorkedForDuration}
|
|
304
308
|
onClientEffect={onClientEffect}
|
|
305
309
|
>
|
|
@@ -627,6 +627,8 @@ body:has(> [data-agent-native-composer-popover="true"]) > .fixed.inset-0 {
|
|
|
627
627
|
.agentkit-transcript {
|
|
628
628
|
grid-column: 1;
|
|
629
629
|
grid-row: 2;
|
|
630
|
+
container-name: agentkit-transcript;
|
|
631
|
+
container-type: inline-size;
|
|
630
632
|
inline-size: 100%;
|
|
631
633
|
min-block-size: 0;
|
|
632
634
|
overflow-y: auto;
|
|
@@ -683,6 +685,22 @@ body:has(> [data-agent-native-composer-popover="true"]) > .fixed.inset-0 {
|
|
|
683
685
|
padding-block-start: var(--agentkit-transcript-top-inset, 1.5rem);
|
|
684
686
|
}
|
|
685
687
|
|
|
688
|
+
.agentkit-transcript-content[data-lane-offset-mode="responsive"] {
|
|
689
|
+
inset-inline-start: var(--agentkit-transcript-lane-offset-inline, 0px);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
@container agentkit-transcript (max-width: 74.999rem) {
|
|
693
|
+
.agentkit-transcript-content[data-lane-offset-mode="responsive"] {
|
|
694
|
+
inset-inline-start: clamp(
|
|
695
|
+
calc(
|
|
696
|
+
(100% - min(100%, var(--agentkit-transcript-lane-width, 47rem))) / -2
|
|
697
|
+
),
|
|
698
|
+
var(--agentkit-transcript-lane-offset-inline, 0px),
|
|
699
|
+
calc((100% - min(100%, var(--agentkit-transcript-lane-width, 47rem))) / 2)
|
|
700
|
+
);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
|
|
686
704
|
.agentkit-scroll-to-bottom-control {
|
|
687
705
|
position: sticky;
|
|
688
706
|
z-index: 2;
|
|
@@ -7,6 +7,8 @@ export interface AgentChatTranscriptLayout {
|
|
|
7
7
|
messageLaneWidth?: number;
|
|
8
8
|
/** Signed inline offset for the centered message lane, in CSS pixels. */
|
|
9
9
|
messageLaneOffsetInline?: number;
|
|
10
|
+
/** Keep the offset within the lane at all widths or allow wide-screen docking. */
|
|
11
|
+
messageLaneOffsetMode?: "clamped" | "responsive";
|
|
10
12
|
/** Space after each message, in CSS pixels. */
|
|
11
13
|
messageGap?: number;
|
|
12
14
|
/** Assistant message line height, in CSS pixels. */
|
|
@@ -2108,6 +2108,7 @@ export const AgentKitAssistantChat = forwardRef<
|
|
|
2108
2108
|
loadRunUsage={loadRunUsage}
|
|
2109
2109
|
buildFeedbackReport={formatFeedbackReport}
|
|
2110
2110
|
workedForRowLayout={props.workedForRowLayout}
|
|
2111
|
+
dataChartLayout={props.dataChartLayout}
|
|
2111
2112
|
formatWorkedForDuration={props.formatWorkedForDuration}
|
|
2112
2113
|
onThreadForked={(thread) => props.onForkedThread?.(thread.id)}
|
|
2113
2114
|
onCopyMessage={({ text }) => {
|
|
@@ -6474,6 +6475,7 @@ function AgentKitTool({ value, active }: AgentKitRenderProps<AgentToolCall>) {
|
|
|
6474
6475
|
activity={metadata.activity === true}
|
|
6475
6476
|
isActiveTail={active === true}
|
|
6476
6477
|
workedForRowLayout={surface.props.workedForRowLayout}
|
|
6478
|
+
dataChartLayout={surface.props.dataChartLayout}
|
|
6477
6479
|
formatWorkedForDuration={surface.props.formatWorkedForDuration}
|
|
6478
6480
|
/>
|
|
6479
6481
|
</SuppressInlineOpenAppContext.Provider>
|