@artooi/ag-ui-web-component 0.19.0 → 0.20.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/CHANGELOG.md +102 -5
- package/README.md +63 -6
- package/dist/ag-ui-web-component.bundle.js +173 -29
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/agui_client.d.ts.map +1 -1
- package/dist/index.js +401 -12
- package/dist/index.js.map +4 -4
- package/dist/skills/parse_skills.d.ts.map +1 -1
- package/dist/skills/skill.d.ts +14 -4
- package/dist/skills/skill.d.ts.map +1 -1
- package/dist/ui/resize_handle.d.ts +81 -0
- package/dist/ui/resize_handle.d.ts.map +1 -0
- package/dist/ui/skills_menu.d.ts.map +1 -1
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/ui_strings.d.ts +2 -0
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/core/ag_ui_chat.ts +203 -5
- package/src/core/agui_client.ts +27 -1
- package/src/skills/parse_skills.ts +8 -2
- package/src/skills/skill.ts +14 -4
- package/src/ui/resize_handle.ts +176 -0
- package/src/ui/skills_menu.ts +13 -1
- package/src/ui/styles.ts +146 -2
- package/src/ui/ui_strings.ts +4 -1
- package/src/version.ts +1 -1
package/src/ui/styles.ts
CHANGED
|
@@ -168,7 +168,72 @@ export const STYLES = `
|
|
|
168
168
|
padding-inline: max(var(--ag-ui-pad), calc((100% - var(--ag-ui-content-max-width)) / 2));
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
:host([placement="page"])
|
|
171
|
+
:host([placement="page"]) /* Resize handle: a corner grip on a floating panel, an edge grip on a docked
|
|
172
|
+
one. Absent entirely where the placement is full-bleed, since there is
|
|
173
|
+
nothing to drag. */
|
|
174
|
+
.resize-handle {
|
|
175
|
+
position: absolute;
|
|
176
|
+
z-index: 2;
|
|
177
|
+
background: transparent;
|
|
178
|
+
touch-action: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.resize-handle:focus-visible {
|
|
182
|
+
outline: 2px solid var(--ag-ui-accent);
|
|
183
|
+
outline-offset: -2px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* The grip sits at the corner the panel grows toward. Which corner that is
|
|
187
|
+
depends on the host's layout, not on placement, so the element measures it
|
|
188
|
+
and stamps data-resize-anchor with the edges that stay put.
|
|
189
|
+
|
|
190
|
+
Default (bottom-right pinned, the floating case) puts the grip top-left. */
|
|
191
|
+
.resize-handle {
|
|
192
|
+
top: 0;
|
|
193
|
+
left: 0;
|
|
194
|
+
width: 14px;
|
|
195
|
+
height: 14px;
|
|
196
|
+
cursor: nwse-resize;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:host([data-resize-anchor~="left"]) .resize-handle {
|
|
200
|
+
left: auto;
|
|
201
|
+
right: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
:host([data-resize-anchor~="top"]) .resize-handle {
|
|
205
|
+
top: auto;
|
|
206
|
+
bottom: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* One axis flipped means the drag runs along the other diagonal. */
|
|
210
|
+
:host([data-resize-anchor="top-right"]) .resize-handle,
|
|
211
|
+
:host([data-resize-anchor="bottom-left"]) .resize-handle {
|
|
212
|
+
cursor: nesw-resize;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/* Docked: the placement owns the height, so only the inner edge is the user's. */
|
|
216
|
+
:host([placement="sidebar"]) .resize-handle,
|
|
217
|
+
:host([placement="side"]) .resize-handle {
|
|
218
|
+
top: 0;
|
|
219
|
+
bottom: auto;
|
|
220
|
+
width: 8px;
|
|
221
|
+
height: 100%;
|
|
222
|
+
cursor: ew-resize;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Full-bleed: nothing to drag. */
|
|
226
|
+
:host([placement="full"]) .resize-handle,
|
|
227
|
+
:host([placement="page"]) .resize-handle {
|
|
228
|
+
display: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.resize-handle[data-dragging] {
|
|
232
|
+
background: var(--ag-ui-accent);
|
|
233
|
+
opacity: 0.35;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.input-row {
|
|
172
237
|
padding-inline: max(12px, calc((100% - var(--ag-ui-content-max-width)) / 2));
|
|
173
238
|
}
|
|
174
239
|
|
|
@@ -828,6 +893,13 @@ export const STYLES = `
|
|
|
828
893
|
|
|
829
894
|
/* The record of a human decision on a gated call. An approved call used to
|
|
830
895
|
look exactly like one that was never gated. */
|
|
896
|
+
.skill-item-token {
|
|
897
|
+
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
898
|
+
font-size: 0.92em;
|
|
899
|
+
color: var(--ag-ui-accent);
|
|
900
|
+
margin-right: 6px;
|
|
901
|
+
}
|
|
902
|
+
|
|
831
903
|
.tool-call-decision {
|
|
832
904
|
flex: none;
|
|
833
905
|
font-size: 11px;
|
|
@@ -905,6 +977,75 @@ export const STYLES = `
|
|
|
905
977
|
content: "▾ ";
|
|
906
978
|
}
|
|
907
979
|
|
|
980
|
+
/* Resize handle: a corner grip on a floating panel, an edge grip on a docked
|
|
981
|
+
one. Absent entirely where the placement is full-bleed, since there is
|
|
982
|
+
nothing to drag. */
|
|
983
|
+
.resize-handle {
|
|
984
|
+
position: absolute;
|
|
985
|
+
z-index: 2;
|
|
986
|
+
background: transparent;
|
|
987
|
+
touch-action: none;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.resize-handle:focus-visible {
|
|
991
|
+
outline: 2px solid var(--ag-ui-accent);
|
|
992
|
+
outline-offset: -2px;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
/* The grip sits on the corner opposite the panel's anchor, because a resize
|
|
996
|
+
measures from whichever edge is not moving. Selected from the host attribute,
|
|
997
|
+
so switching placement moves the grip immediately.
|
|
998
|
+
|
|
999
|
+
Default is floating: pinned bottom-right, so the grip is top-left. */
|
|
1000
|
+
.resize-handle {
|
|
1001
|
+
top: 0;
|
|
1002
|
+
left: 0;
|
|
1003
|
+
width: 14px;
|
|
1004
|
+
height: 14px;
|
|
1005
|
+
cursor: nwse-resize;
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/* Embedded sits in normal flow, pinned top-left, so it grows bottom-right. */
|
|
1009
|
+
:host([placement="embedded"]) .resize-handle {
|
|
1010
|
+
top: auto;
|
|
1011
|
+
left: auto;
|
|
1012
|
+
right: 0;
|
|
1013
|
+
bottom: 0;
|
|
1014
|
+
cursor: nwse-resize;
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
/* Pinned bottom-left, so the free corner is top-right. */
|
|
1018
|
+
:host([placement="bottom-left"]) .resize-handle {
|
|
1019
|
+
left: auto;
|
|
1020
|
+
right: 0;
|
|
1021
|
+
cursor: nesw-resize;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
/* Docked: the placement owns the height, so only the inner edge is the user's. */
|
|
1025
|
+
:host([placement="sidebar"]) .resize-handle,
|
|
1026
|
+
:host([placement="side"]) .resize-handle {
|
|
1027
|
+
width: 8px;
|
|
1028
|
+
height: 100%;
|
|
1029
|
+
cursor: ew-resize;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
/* Docked to the left, so the inner edge is the right-hand one. */
|
|
1033
|
+
:host([placement="sidebar"][data-side="left"]) .resize-handle {
|
|
1034
|
+
left: auto;
|
|
1035
|
+
right: 0;
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
/* Full-bleed: nothing to drag. */
|
|
1039
|
+
:host([placement="full"]) .resize-handle,
|
|
1040
|
+
:host([placement="page"]) .resize-handle {
|
|
1041
|
+
display: none;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
.resize-handle[data-dragging] {
|
|
1045
|
+
background: var(--ag-ui-accent);
|
|
1046
|
+
opacity: 0.35;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
908
1049
|
.input-row {
|
|
909
1050
|
display: flex;
|
|
910
1051
|
gap: 8px;
|
|
@@ -1382,9 +1523,12 @@ export const STYLES = `
|
|
|
1382
1523
|
color: var(--ag-ui-muted);
|
|
1383
1524
|
}
|
|
1384
1525
|
|
|
1526
|
+
/* The hint sits directly above the composer's top border, so a zero bottom
|
|
1527
|
+
margin left the text touching the divider. */
|
|
1385
1528
|
.skill-hint {
|
|
1386
|
-
margin: 8px 12px
|
|
1529
|
+
margin: 8px 12px;
|
|
1387
1530
|
font-size: 0.85em;
|
|
1531
|
+
line-height: 1.4;
|
|
1388
1532
|
color: var(--ag-ui-danger);
|
|
1389
1533
|
}
|
|
1390
1534
|
|
package/src/ui/ui_strings.ts
CHANGED
|
@@ -89,6 +89,8 @@ export interface UiStrings {
|
|
|
89
89
|
toolError: string;
|
|
90
90
|
/** Status pill on a declined call. */
|
|
91
91
|
toolDeclined: string;
|
|
92
|
+
/** Accessible label on the panel resize handle. */
|
|
93
|
+
resizePanel: string;
|
|
92
94
|
/** Note on a tool card whose call a human approved. */
|
|
93
95
|
decisionApproved: string;
|
|
94
96
|
/** Note on a tool card whose call a human declined. */
|
|
@@ -227,7 +229,7 @@ export const DEFAULT_UI_STRINGS: UiStrings = {
|
|
|
227
229
|
"The page changed since you last looked at it. Call read_page to see the current page, then retry.",
|
|
228
230
|
attachmentsStillUploading:
|
|
229
231
|
"{n} file still uploading — it was not sent with this message and is still attached.",
|
|
230
|
-
skillNeeds: "“{title}” needs
|
|
232
|
+
skillNeeds: "“{title}” needs {fields} — fill it in below, then send.",
|
|
231
233
|
|
|
232
234
|
message: "Message",
|
|
233
235
|
inputPlaceholder: "Ask anything…",
|
|
@@ -243,6 +245,7 @@ export const DEFAULT_UI_STRINGS: UiStrings = {
|
|
|
243
245
|
toolDone: "✓ done",
|
|
244
246
|
toolError: "⚠ error",
|
|
245
247
|
toolDeclined: "⊘ declined",
|
|
248
|
+
resizePanel: "Resize the chat panel",
|
|
246
249
|
decisionApproved: "approved by you",
|
|
247
250
|
decisionDeclined: "declined by you",
|
|
248
251
|
argumentsLabel: "Arguments",
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION: string = "0.
|
|
1
|
+
export const VERSION: string = "0.20.0";
|