@artooi/ag-ui-web-component 0.44.0 → 0.46.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 +182 -1
- package/README.md +245 -32
- package/dist/ag-ui-web-component.bundle.js +3696 -2798
- package/dist/ag-ui-web-component.bundle.js.map +4 -4
- package/dist/constants.d.ts +4 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/core/ag_ui_chat.d.ts +28 -8
- package/dist/core/ag_ui_chat.d.ts.map +1 -1
- package/dist/core/read_flag.d.ts +11 -0
- package/dist/core/read_flag.d.ts.map +1 -0
- package/dist/core/read_json_attribute.d.ts +15 -0
- package/dist/core/read_json_attribute.d.ts.map +1 -0
- package/dist/index.js +5084 -3481
- package/dist/index.js.map +4 -4
- package/dist/tools/tool_catalog.d.ts +5 -0
- package/dist/tools/tool_catalog.d.ts.map +1 -1
- package/dist/tools/tool_dispatch.d.ts.map +1 -1
- package/dist/ui/charts/chart_styles.d.ts +2 -0
- package/dist/ui/charts/chart_styles.d.ts.map +1 -0
- package/dist/ui/composer/attachment_styles.d.ts +2 -0
- package/dist/ui/composer/attachment_styles.d.ts.map +1 -0
- package/dist/ui/composer/build_composer.d.ts +30 -0
- package/dist/ui/composer/build_composer.d.ts.map +1 -0
- package/dist/ui/composer/composer_styles.d.ts +2 -0
- package/dist/ui/composer/composer_styles.d.ts.map +1 -0
- package/dist/ui/composer/skill_styles.d.ts +2 -0
- package/dist/ui/composer/skill_styles.d.ts.map +1 -0
- package/dist/ui/history/history_styles.d.ts +2 -0
- package/dist/ui/history/history_styles.d.ts.map +1 -0
- package/dist/ui/interrupts/approval_styles.d.ts +2 -0
- package/dist/ui/interrupts/approval_styles.d.ts.map +1 -0
- package/dist/ui/interrupts/confirmation_styles.d.ts +2 -0
- package/dist/ui/interrupts/confirmation_styles.d.ts.map +1 -0
- package/dist/ui/interrupts/question_styles.d.ts +2 -0
- package/dist/ui/interrupts/question_styles.d.ts.map +1 -0
- package/dist/ui/placement/collapse_styles.d.ts +2 -0
- package/dist/ui/placement/collapse_styles.d.ts.map +1 -0
- package/dist/ui/placement/embedded_styles.d.ts +2 -0
- package/dist/ui/placement/embedded_styles.d.ts.map +1 -0
- package/dist/ui/placement/launcher_styles.d.ts +2 -0
- package/dist/ui/placement/launcher_styles.d.ts.map +1 -0
- package/dist/ui/placement/page_styles.d.ts +2 -0
- package/dist/ui/placement/page_styles.d.ts.map +1 -0
- package/dist/ui/placement/panel_placement.d.ts.map +1 -1
- package/dist/ui/placement/preset_styles.d.ts +2 -0
- package/dist/ui/placement/preset_styles.d.ts.map +1 -0
- package/dist/ui/placement/resize_styles.d.ts +2 -0
- package/dist/ui/placement/resize_styles.d.ts.map +1 -0
- package/dist/ui/placement/sidebar_styles.d.ts +2 -0
- package/dist/ui/placement/sidebar_styles.d.ts.map +1 -0
- package/dist/ui/placement/small_viewport_styles.d.ts +2 -0
- package/dist/ui/placement/small_viewport_styles.d.ts.map +1 -0
- package/dist/ui/placement/surface_for.d.ts +74 -0
- package/dist/ui/placement/surface_for.d.ts.map +1 -0
- package/dist/ui/progress/run_notice_styles.d.ts +2 -0
- package/dist/ui/progress/run_notice_styles.d.ts.map +1 -0
- package/dist/ui/progress/thoughts_styles.d.ts +2 -0
- package/dist/ui/progress/thoughts_styles.d.ts.map +1 -0
- package/dist/ui/progress/tool_call_card.d.ts +8 -0
- package/dist/ui/progress/tool_call_card.d.ts.map +1 -1
- package/dist/ui/progress/tool_group_styles.d.ts +2 -0
- package/dist/ui/progress/tool_group_styles.d.ts.map +1 -0
- package/dist/ui/progress/tool_step_group.d.ts +47 -0
- package/dist/ui/progress/tool_step_group.d.ts.map +1 -0
- package/dist/ui/progress/tool_step_styles.d.ts +2 -0
- package/dist/ui/progress/tool_step_styles.d.ts.map +1 -0
- package/dist/ui/shell/adopt_styles.d.ts +9 -4
- package/dist/ui/shell/adopt_styles.d.ts.map +1 -1
- package/dist/ui/shell/build_header.d.ts +40 -0
- package/dist/ui/shell/build_header.d.ts.map +1 -0
- package/dist/ui/shell/build_launcher.d.ts +20 -0
- package/dist/ui/shell/build_launcher.d.ts.map +1 -0
- package/dist/ui/shell/frame_styles.d.ts +2 -0
- package/dist/ui/shell/frame_styles.d.ts.map +1 -0
- package/dist/ui/shell/theme_styles.d.ts +2 -0
- package/dist/ui/shell/theme_styles.d.ts.map +1 -0
- package/dist/ui/shell/token_styles.d.ts +2 -0
- package/dist/ui/shell/token_styles.d.ts.map +1 -0
- package/dist/ui/styles.d.ts +1 -1
- package/dist/ui/styles.d.ts.map +1 -1
- package/dist/ui/themes/classic_styles.d.ts +2 -0
- package/dist/ui/themes/classic_styles.d.ts.map +1 -0
- package/dist/ui/themes/classic_tokens.d.ts +2 -0
- package/dist/ui/themes/classic_tokens.d.ts.map +1 -0
- package/dist/ui/themes/code_tokens.d.ts +2 -0
- package/dist/ui/themes/code_tokens.d.ts.map +1 -0
- package/dist/ui/themes/ledger_styles.d.ts +2 -0
- package/dist/ui/themes/ledger_styles.d.ts.map +1 -0
- package/dist/ui/themes/ledger_tokens.d.ts +2 -0
- package/dist/ui/themes/ledger_tokens.d.ts.map +1 -0
- package/dist/ui/themes/modern_styles.d.ts +2 -0
- package/dist/ui/themes/modern_styles.d.ts.map +1 -0
- package/dist/ui/themes/quiet_styles.d.ts +2 -0
- package/dist/ui/themes/quiet_styles.d.ts.map +1 -0
- package/dist/ui/themes/scheme_styles.d.ts +2 -0
- package/dist/ui/themes/scheme_styles.d.ts.map +1 -0
- package/dist/ui/themes/soft_styles.d.ts +2 -0
- package/dist/ui/themes/soft_styles.d.ts.map +1 -0
- package/dist/ui/themes/soft_tokens.d.ts +2 -0
- package/dist/ui/themes/soft_tokens.d.ts.map +1 -0
- package/dist/ui/themes/theme_hosts.d.ts +15 -0
- package/dist/ui/themes/theme_hosts.d.ts.map +1 -0
- package/dist/ui/transcript/attachment_chip_styles.d.ts +2 -0
- package/dist/ui/transcript/attachment_chip_styles.d.ts.map +1 -0
- package/dist/ui/transcript/build_transcript.d.ts +21 -0
- package/dist/ui/transcript/build_transcript.d.ts.map +1 -0
- package/dist/ui/transcript/greeting_styles.d.ts +2 -0
- package/dist/ui/transcript/greeting_styles.d.ts.map +1 -0
- package/dist/ui/transcript/groups_tool_steps.d.ts +13 -0
- package/dist/ui/transcript/groups_tool_steps.d.ts.map +1 -0
- package/dist/ui/transcript/message_action_styles.d.ts +2 -0
- package/dist/ui/transcript/message_action_styles.d.ts.map +1 -0
- package/dist/ui/transcript/message_styles.d.ts +2 -0
- package/dist/ui/transcript/message_styles.d.ts.map +1 -0
- package/dist/ui/transcript/transcript.d.ts +16 -1
- package/dist/ui/transcript/transcript.d.ts.map +1 -1
- package/dist/ui/transcript/transcript_styles.d.ts +2 -0
- package/dist/ui/transcript/transcript_styles.d.ts.map +1 -0
- package/dist/ui/ui_strings.d.ts +18 -0
- package/dist/ui/ui_strings.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/constants.ts +4 -1
- package/src/core/ag_ui_chat.ts +164 -299
- package/src/core/read_flag.ts +13 -0
- package/src/core/read_json_attribute.ts +30 -0
- package/src/tools/tool_catalog.ts +23 -10
- package/src/tools/tool_dispatch.ts +26 -11
- package/src/ui/charts/chart_block.ts +9 -9
- package/src/ui/charts/chart_styles.ts +63 -0
- package/src/ui/composer/attachment_styles.ts +71 -0
- package/src/ui/composer/build_composer.ts +112 -0
- package/src/ui/composer/composer_styles.ts +174 -0
- package/src/ui/composer/skill_styles.ts +120 -0
- package/src/ui/history/history_styles.ts +484 -0
- package/src/ui/interrupts/approval_styles.ts +52 -0
- package/src/ui/interrupts/confirmation_styles.ts +114 -0
- package/src/ui/interrupts/question_styles.ts +73 -0
- package/src/ui/placement/collapse_styles.ts +137 -0
- package/src/ui/placement/embedded_styles.ts +14 -0
- package/src/ui/placement/launcher_styles.ts +189 -0
- package/src/ui/placement/page_styles.ts +47 -0
- package/src/ui/placement/panel_placement.ts +3 -12
- package/src/ui/placement/preset_styles.ts +33 -0
- package/src/ui/placement/resize_styles.ts +186 -0
- package/src/ui/placement/sidebar_styles.ts +88 -0
- package/src/ui/placement/small_viewport_styles.ts +56 -0
- package/src/ui/placement/surface_for.ts +135 -0
- package/src/ui/progress/run_notice_styles.ts +52 -0
- package/src/ui/progress/thoughts_styles.ts +65 -0
- package/src/ui/progress/tool_call_card.ts +11 -0
- package/src/ui/progress/tool_group_styles.ts +232 -0
- package/src/ui/progress/tool_step_group.ts +269 -0
- package/src/ui/progress/tool_step_styles.ts +472 -0
- package/src/ui/shell/adopt_styles.ts +11 -5
- package/src/ui/shell/build_header.ts +108 -0
- package/src/ui/shell/build_launcher.ts +50 -0
- package/src/ui/shell/frame_styles.ts +119 -0
- package/src/ui/shell/theme_styles.ts +11 -0
- package/src/ui/shell/token_styles.ts +406 -0
- package/src/ui/styles.ts +104 -3774
- package/src/ui/themes/classic_styles.ts +32 -0
- package/src/ui/themes/classic_tokens.ts +50 -0
- package/src/ui/themes/code_tokens.ts +21 -0
- package/src/ui/themes/ledger_styles.ts +168 -0
- package/src/ui/themes/ledger_tokens.ts +32 -0
- package/src/ui/themes/modern_styles.ts +80 -0
- package/src/ui/themes/quiet_styles.ts +115 -0
- package/src/ui/themes/scheme_styles.ts +17 -0
- package/src/ui/themes/soft_styles.ts +148 -0
- package/src/ui/themes/soft_tokens.ts +28 -0
- package/src/ui/themes/theme_hosts.ts +14 -0
- package/src/ui/transcript/attachment_chip_styles.ts +116 -0
- package/src/ui/transcript/build_transcript.ts +67 -0
- package/src/ui/transcript/greeting_styles.ts +171 -0
- package/src/ui/transcript/groups_tool_steps.ts +16 -0
- package/src/ui/transcript/message_action_styles.ts +155 -0
- package/src/ui/transcript/message_styles.ts +262 -0
- package/src/ui/transcript/transcript.ts +109 -3
- package/src/ui/transcript/transcript_styles.ts +140 -0
- package/src/ui/ui_strings.ts +31 -0
- package/src/version.ts +1 -1
- package/dist/ui/placement/is_collapsible_placement.d.ts +0 -18
- package/dist/ui/placement/is_collapsible_placement.d.ts.map +0 -1
- package/dist/ui/placement/is_draggable_placement.d.ts +0 -9
- package/dist/ui/placement/is_draggable_placement.d.ts.map +0 -1
- package/src/ui/placement/is_collapsible_placement.ts +0 -19
- package/src/ui/placement/is_draggable_placement.ts +0 -23
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
// Skills and suggestions over the composer: the chip rows and the / palette.
|
|
2
|
+
export const SKILL_STYLES: string = `
|
|
3
|
+
/* Skills — chips row + the /-command palette, above the input. */
|
|
4
|
+
.skill-chips {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-wrap: wrap;
|
|
7
|
+
gap: 6px;
|
|
8
|
+
padding: 10px 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/* The row is hidden whenever the host offers no skills, which is most elements
|
|
12
|
+
most of the time, and an author display beats the user-agent rule for the
|
|
13
|
+
hidden attribute. Without this it kept its padding: 20px of panel between
|
|
14
|
+
the transcript and the composer, under every placement, reading as the gap
|
|
15
|
+
under whatever the transcript ends with. */
|
|
16
|
+
.skill-chips[hidden] {
|
|
17
|
+
display: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.skill-chip {
|
|
21
|
+
border: 1px solid var(--_border);
|
|
22
|
+
border-radius: 999px;
|
|
23
|
+
padding: 4px 12px;
|
|
24
|
+
font: inherit;
|
|
25
|
+
font-size: 0.9em;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
background: var(--_assistant-bg);
|
|
28
|
+
color: var(--_fg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.skill-chip:hover {
|
|
32
|
+
border-color: var(--_accent);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Follow-up suggestion chips. Deliberately the skill chips' shape rather than a
|
|
36
|
+
second chip vocabulary -- both are "a question you could ask", and the only
|
|
37
|
+
difference is who chose it. Inside the transcript, so they scroll with the
|
|
38
|
+
answer they follow instead of hovering above the composer. */
|
|
39
|
+
.suggestions {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-wrap: wrap;
|
|
42
|
+
gap: 6px;
|
|
43
|
+
align-self: stretch;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.suggestion-chip {
|
|
47
|
+
border: 1px solid var(--_border);
|
|
48
|
+
border-radius: 999px;
|
|
49
|
+
padding: 4px 12px;
|
|
50
|
+
font: inherit;
|
|
51
|
+
font-size: 0.9em;
|
|
52
|
+
text-align: left;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
background: var(--_assistant-bg);
|
|
55
|
+
color: var(--_fg);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.suggestion-chip:hover,
|
|
59
|
+
.suggestion-chip:focus-visible {
|
|
60
|
+
border-color: var(--_accent);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.skill-palette {
|
|
64
|
+
margin: 8px 12px 0;
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
max-height: 220px;
|
|
68
|
+
overflow: auto;
|
|
69
|
+
/* Scrolling past the end of this must not scroll the page behind it. */
|
|
70
|
+
overscroll-behavior: contain;
|
|
71
|
+
background: var(--_bg);
|
|
72
|
+
border: 1px solid var(--_border);
|
|
73
|
+
border-radius: 8px;
|
|
74
|
+
box-shadow: 0 8px 24px rgba(20, 20, 50, 0.16);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Closed nearly all of the time and mounted on every element. The display
|
|
78
|
+
above beats the user-agent rule for the hidden attribute, so without this a
|
|
79
|
+
closed palette still painted its margin, border and shadow as a line over
|
|
80
|
+
the composer. */
|
|
81
|
+
.skill-palette[hidden] {
|
|
82
|
+
display: none;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.skill-item {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: 2px;
|
|
89
|
+
align-items: flex-start;
|
|
90
|
+
padding: 8px 12px;
|
|
91
|
+
border: none;
|
|
92
|
+
background: none;
|
|
93
|
+
font: inherit;
|
|
94
|
+
text-align: left;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
color: var(--_fg);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.skill-item[aria-selected="true"] {
|
|
100
|
+
background: var(--_assistant-bg);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.skill-item-title {
|
|
104
|
+
font-weight: 600;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.skill-item-desc {
|
|
108
|
+
font-size: 0.85em;
|
|
109
|
+
color: var(--_muted);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* The hint sits directly above the composer's top border, so a zero bottom
|
|
113
|
+
margin left the text touching the divider. */
|
|
114
|
+
.skill-hint {
|
|
115
|
+
margin: 8px 12px;
|
|
116
|
+
font-size: 0.85em;
|
|
117
|
+
line-height: 1.4;
|
|
118
|
+
color: var(--_danger);
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
// The thread drawer, its list and filter, and the checkpoint menu. The
|
|
2
|
+
// queued-message row over the composer sits among them only because no rule
|
|
3
|
+
// moved in the split.
|
|
4
|
+
export const HISTORY_STYLES: string = `
|
|
5
|
+
/* Chat-history drawer — a slide-over within the chat panel.
|
|
6
|
+
The hidden attribute stays the single source of truth for open/closed (no
|
|
7
|
+
JS-driven animation state): display is transitioned discretely, so on close
|
|
8
|
+
the drawer stays displayed for the whole exit and is removed only at the end,
|
|
9
|
+
which is what lets the backdrop fade and the panel slide out. */
|
|
10
|
+
.drawer {
|
|
11
|
+
position: absolute;
|
|
12
|
+
inset: 0;
|
|
13
|
+
z-index: 5;
|
|
14
|
+
display: flex;
|
|
15
|
+
/* Visible at once on the way in. Opening moves focus to the list in the
|
|
16
|
+
same task that unhides it, and an element still hidden cannot take focus:
|
|
17
|
+
a transition on visibility starts at its first value, so easing it in
|
|
18
|
+
left the drawer hidden at exactly that instant and the focus call was
|
|
19
|
+
dropped at every placement. Reduced motion shortens the transition
|
|
20
|
+
without removing it, so it had the same first frame. */
|
|
21
|
+
transition: visibility 0s;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* Closed. The overlay keeps its box (display, not none) so the backdrop and
|
|
25
|
+
panel inside it stay rendered and can transition both ways; visibility is
|
|
26
|
+
what takes the whole subtree out of the tab order, the a11y tree and hit
|
|
27
|
+
testing at rest. On the way out it is delayed rather than eased, so it
|
|
28
|
+
flips only once the slide has finished. A transition is read from the
|
|
29
|
+
state being entered, which is what lets the two directions differ. */
|
|
30
|
+
.drawer[hidden] {
|
|
31
|
+
display: flex;
|
|
32
|
+
visibility: hidden;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
transition: visibility 0s var(--_motion);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.drawer[hidden] .drawer-backdrop {
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.drawer[hidden] .drawer-panel {
|
|
42
|
+
transform: translateX(-100%);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.checkpoints {
|
|
46
|
+
position: absolute;
|
|
47
|
+
inset-block-start: 3rem;
|
|
48
|
+
inset-inline: 0.75rem;
|
|
49
|
+
z-index: 6;
|
|
50
|
+
display: flex;
|
|
51
|
+
flex-direction: column;
|
|
52
|
+
gap: 0.25rem;
|
|
53
|
+
padding: 0.5rem;
|
|
54
|
+
border: 1px solid var(--_border);
|
|
55
|
+
border-radius: 0.5rem;
|
|
56
|
+
background: var(--_assistant-bg);
|
|
57
|
+
box-shadow: 0 6px 24px rgb(0 0 0 / 12%);
|
|
58
|
+
max-height: 60%;
|
|
59
|
+
overflow-y: auto;
|
|
60
|
+
/* Scrolling past the end of this must not scroll the page behind it. */
|
|
61
|
+
overscroll-behavior: contain;
|
|
62
|
+
transform-origin: top center;
|
|
63
|
+
/* Visibility flips at once on the way in, for the drawer's reason: opening
|
|
64
|
+
focuses the panel in the same task that unhides it, and an element still
|
|
65
|
+
hidden cannot take focus. The fade and the scale still ease in. */
|
|
66
|
+
transition:
|
|
67
|
+
opacity var(--_motion) var(--_ease),
|
|
68
|
+
transform var(--_motion) var(--_ease),
|
|
69
|
+
visibility 0s;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Same idiom as the drawer: laid out at rest, hidden by visibility, so the
|
|
73
|
+
popover can animate open and closed. The whole list is restated because a
|
|
74
|
+
transition is read from the state being entered; only visibility differs,
|
|
75
|
+
delayed rather than eased so it flips once the exit has played. */
|
|
76
|
+
.checkpoints[hidden] {
|
|
77
|
+
display: flex;
|
|
78
|
+
visibility: hidden;
|
|
79
|
+
pointer-events: none;
|
|
80
|
+
opacity: 0;
|
|
81
|
+
transform: scale(0.96) translateY(-6px);
|
|
82
|
+
transition:
|
|
83
|
+
opacity var(--_motion) var(--_ease),
|
|
84
|
+
transform var(--_motion) var(--_ease),
|
|
85
|
+
visibility 0s var(--_motion);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.checkpoints-title {
|
|
89
|
+
font-size: 0.75rem;
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
opacity: 0.7;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.checkpoints-empty {
|
|
95
|
+
padding: 0.5rem 0.25rem;
|
|
96
|
+
font-size: 0.8125rem;
|
|
97
|
+
opacity: 0.7;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* A row is a label and two buttons, and nothing about the row itself is
|
|
101
|
+
pressable. It used to light up on hover, which is the affordance of something
|
|
102
|
+
clickable and made the buttons look like decoration on a clickable strip. The
|
|
103
|
+
resting surface groups the row instead, so hover can mean what it says: only
|
|
104
|
+
the buttons respond to it.
|
|
105
|
+
|
|
106
|
+
It wraps for the same reason the tool-call head does. Every child but the label
|
|
107
|
+
is fixed-width, so in a narrow panel the label is the only thing that can give
|
|
108
|
+
-- and a flex-basis of zero lets it give everything. Adding the run id was
|
|
109
|
+
enough to crush "just now" to zero pixels: present, correct, and invisible.
|
|
110
|
+
Wrapping puts the buttons on their own line instead. */
|
|
111
|
+
.checkpoint-row {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-wrap: wrap;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: 0.5rem;
|
|
116
|
+
padding: 0.3125rem 0.4375rem;
|
|
117
|
+
border-radius: 0.375rem;
|
|
118
|
+
background: var(--_hover);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/* Grows into spare room, and refuses to shrink past the shortest thing it ever
|
|
122
|
+
says. A time is short and bounded, so there is no case for eliding it. */
|
|
123
|
+
.checkpoint-label {
|
|
124
|
+
flex: 1 1 auto;
|
|
125
|
+
min-width: 7ch;
|
|
126
|
+
font-size: 0.8125rem;
|
|
127
|
+
white-space: nowrap;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/* When the label holds the run's first message, the time moves here: still worth
|
|
133
|
+
showing, no longer what identifies the row. Muted and unshrinkable, so it does
|
|
134
|
+
not compete with the words beside it. */
|
|
135
|
+
.checkpoint-time {
|
|
136
|
+
flex: 0 0 auto;
|
|
137
|
+
font-size: 0.6875rem;
|
|
138
|
+
opacity: 0.7;
|
|
139
|
+
white-space: nowrap;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* Enough of the run id to tell two runs apart when both say "just now". Muted
|
|
143
|
+
and monospaced: it is a reference, not a name. */
|
|
144
|
+
.checkpoint-id {
|
|
145
|
+
flex: 0 0 auto;
|
|
146
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
147
|
+
font-size: 0.6875rem;
|
|
148
|
+
opacity: 0.55;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* On the panel's own surface, not the row's: the row now paints the hover token
|
|
152
|
+
itself, and a badge the same colour as what it sits on is not a badge. */
|
|
153
|
+
.checkpoint-branch {
|
|
154
|
+
font-size: 0.6875rem;
|
|
155
|
+
padding: 0 0.375rem;
|
|
156
|
+
border-radius: 999px;
|
|
157
|
+
background: var(--_assistant-bg);
|
|
158
|
+
opacity: 0.8;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/* The two things in the row that actually do something, so they are the two
|
|
162
|
+
things that look like it: a filled surface at rest rather than a transparent
|
|
163
|
+
outline, which on top of the old row highlight was nearly invisible. */
|
|
164
|
+
.checkpoint-action {
|
|
165
|
+
font: inherit;
|
|
166
|
+
font-size: 0.75rem;
|
|
167
|
+
line-height: 1.4;
|
|
168
|
+
cursor: pointer;
|
|
169
|
+
padding: 0.1875rem 0.5625rem;
|
|
170
|
+
border: 1px solid var(--_border);
|
|
171
|
+
border-radius: 0.375rem;
|
|
172
|
+
background: var(--_bg);
|
|
173
|
+
color: inherit;
|
|
174
|
+
transition:
|
|
175
|
+
background var(--_motion) var(--_ease),
|
|
176
|
+
border-color var(--_motion) var(--_ease),
|
|
177
|
+
transform var(--_motion) var(--_ease);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/* Resume is what a reader wants nine times in ten; fork is the deliberate choice
|
|
181
|
+
beside it. Filled and outlined, the same pair the confirmation and approval
|
|
182
|
+
cards already use for their primary and secondary action. */
|
|
183
|
+
.checkpoint-resume {
|
|
184
|
+
font-weight: 600;
|
|
185
|
+
border-color: var(--_accent);
|
|
186
|
+
background: var(--_accent);
|
|
187
|
+
color: var(--_on-accent);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.checkpoint-fork:hover {
|
|
191
|
+
background: var(--_hover);
|
|
192
|
+
border-color: var(--_accent);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* The filled one cannot go lighter on hover without losing its contrast with the
|
|
196
|
+
white label, so it dims instead. */
|
|
197
|
+
.checkpoint-resume:hover {
|
|
198
|
+
opacity: 0.88;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/* Pressed: a pixel down, so the click is felt as well as seen. */
|
|
202
|
+
.checkpoint-action:active {
|
|
203
|
+
transform: translateY(1px);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/* Keyboard focus was invisible here, in a panel that traps focus and is reached
|
|
207
|
+
by Tab -- so the one navigation path guaranteed to land on these buttons was
|
|
208
|
+
the one with nothing to show for it. */
|
|
209
|
+
.checkpoint-action:focus-visible {
|
|
210
|
+
outline: 2px solid var(--_accent);
|
|
211
|
+
outline-offset: 2px;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.drawer-backdrop {
|
|
215
|
+
position: absolute;
|
|
216
|
+
inset: 0;
|
|
217
|
+
background: rgba(20, 20, 50, 0.32);
|
|
218
|
+
opacity: 1;
|
|
219
|
+
transition: opacity var(--_motion) var(--_ease);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.drawer-panel {
|
|
223
|
+
position: relative;
|
|
224
|
+
display: flex;
|
|
225
|
+
flex-direction: column;
|
|
226
|
+
width: min(300px, 85%);
|
|
227
|
+
height: 100%;
|
|
228
|
+
background: var(--_bg);
|
|
229
|
+
border-right: 1px solid var(--_border);
|
|
230
|
+
box-shadow: var(--_shadow);
|
|
231
|
+
overflow: hidden;
|
|
232
|
+
transform: none;
|
|
233
|
+
transition: transform var(--_motion) var(--_ease);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.drawer-header {
|
|
237
|
+
display: flex;
|
|
238
|
+
align-items: center;
|
|
239
|
+
justify-content: space-between;
|
|
240
|
+
gap: var(--_space);
|
|
241
|
+
padding: var(--_pad);
|
|
242
|
+
border-bottom: 1px solid var(--_border);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.drawer-title {
|
|
246
|
+
/* Takes the slack so the two controls group at the trailing edge. With
|
|
247
|
+
space-between and three items the middle one floats, which reads as the
|
|
248
|
+
title and the close button being a pair with New chat wedged between
|
|
249
|
+
them. Truncates rather than pushing them off the row. */
|
|
250
|
+
flex: 1 1 auto;
|
|
251
|
+
min-width: 0;
|
|
252
|
+
overflow: hidden;
|
|
253
|
+
text-overflow: ellipsis;
|
|
254
|
+
white-space: nowrap;
|
|
255
|
+
font-weight: 600;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.drawer-new {
|
|
259
|
+
flex: 0 0 auto;
|
|
260
|
+
border: 1px solid var(--_border);
|
|
261
|
+
border-radius: var(--_radius);
|
|
262
|
+
background: var(--_bg);
|
|
263
|
+
color: var(--_accent);
|
|
264
|
+
padding: 4px 10px;
|
|
265
|
+
font: inherit;
|
|
266
|
+
font-size: 0.85em;
|
|
267
|
+
cursor: pointer;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Narrows the list. Sits under the header rather than in it: the header's two
|
|
271
|
+
controls act on the conversation, and a field that filters what is below it
|
|
272
|
+
belongs with what it filters. */
|
|
273
|
+
/* What is waiting for the run to finish. Above the composer, beside the
|
|
274
|
+
attachment tray, because both are things already handed over and not yet
|
|
275
|
+
sent. Each chip is a button: pressing it takes that message back. */
|
|
276
|
+
.queued {
|
|
277
|
+
display: flex;
|
|
278
|
+
flex-wrap: wrap;
|
|
279
|
+
gap: var(--_space);
|
|
280
|
+
padding: 0 var(--_pad) var(--_space);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* Empty whenever no run is in flight, and hidden then. Same reason as the
|
|
284
|
+
palette: the display above would otherwise keep the bottom padding as dead
|
|
285
|
+
space over the composer. */
|
|
286
|
+
.queued[hidden] {
|
|
287
|
+
display: none;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.queued-chip {
|
|
291
|
+
max-width: 100%;
|
|
292
|
+
overflow: hidden;
|
|
293
|
+
padding: 4px 10px;
|
|
294
|
+
border: 1px dashed var(--_border);
|
|
295
|
+
border-radius: var(--_msg-radius);
|
|
296
|
+
background: var(--_bg);
|
|
297
|
+
color: var(--_muted);
|
|
298
|
+
font: inherit;
|
|
299
|
+
font-size: 0.9em;
|
|
300
|
+
text-overflow: ellipsis;
|
|
301
|
+
white-space: nowrap;
|
|
302
|
+
cursor: pointer;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
.queued-chip:hover {
|
|
306
|
+
border-style: solid;
|
|
307
|
+
color: var(--_fg);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.drawer-filter {
|
|
311
|
+
flex: 0 0 auto;
|
|
312
|
+
box-sizing: border-box;
|
|
313
|
+
width: calc(100% - var(--_pad) * 2);
|
|
314
|
+
margin: var(--_space) var(--_pad) 0;
|
|
315
|
+
padding: 6px 10px;
|
|
316
|
+
border: 1px solid var(--_border);
|
|
317
|
+
border-radius: var(--_radius);
|
|
318
|
+
background: var(--_input-bg);
|
|
319
|
+
color: var(--_fg);
|
|
320
|
+
font: inherit;
|
|
321
|
+
font-size: 0.9em;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
.drawer-filter::placeholder {
|
|
325
|
+
color: var(--_muted);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.drawer-list {
|
|
329
|
+
flex: 1;
|
|
330
|
+
min-height: 0;
|
|
331
|
+
overflow-y: auto;
|
|
332
|
+
/* Scrolling past the end of this must not scroll the page behind it. */
|
|
333
|
+
overscroll-behavior: contain;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
.drawer-empty {
|
|
337
|
+
padding: var(--_pad);
|
|
338
|
+
font-size: 0.9em;
|
|
339
|
+
color: var(--_muted);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
.drawer-row {
|
|
343
|
+
display: flex;
|
|
344
|
+
align-items: stretch;
|
|
345
|
+
border-bottom: 1px solid var(--_border);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.drawer-row--active {
|
|
349
|
+
background: var(--_assistant-bg);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
.drawer-row-select {
|
|
353
|
+
flex: 1;
|
|
354
|
+
min-width: 0;
|
|
355
|
+
display: flex;
|
|
356
|
+
flex-direction: column;
|
|
357
|
+
gap: 2px;
|
|
358
|
+
padding: 8px 12px;
|
|
359
|
+
border: none;
|
|
360
|
+
background: none;
|
|
361
|
+
color: inherit;
|
|
362
|
+
font: inherit;
|
|
363
|
+
text-align: left;
|
|
364
|
+
cursor: pointer;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.drawer-row-title {
|
|
368
|
+
font-weight: 600;
|
|
369
|
+
overflow: hidden;
|
|
370
|
+
white-space: nowrap;
|
|
371
|
+
text-overflow: ellipsis;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
.drawer-row-time {
|
|
375
|
+
font-size: 0.72em;
|
|
376
|
+
color: var(--_muted);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.drawer-row-preview {
|
|
380
|
+
font-size: 0.8em;
|
|
381
|
+
color: var(--_muted);
|
|
382
|
+
overflow: hidden;
|
|
383
|
+
white-space: nowrap;
|
|
384
|
+
text-overflow: ellipsis;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.drawer-row-actions {
|
|
388
|
+
display: flex;
|
|
389
|
+
align-items: center;
|
|
390
|
+
gap: 2px;
|
|
391
|
+
padding: 0 6px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.drawer-row-rename,
|
|
395
|
+
.drawer-row-delete {
|
|
396
|
+
border: none;
|
|
397
|
+
background: none;
|
|
398
|
+
color: var(--_muted);
|
|
399
|
+
font-size: 0.9em;
|
|
400
|
+
padding: 4px;
|
|
401
|
+
cursor: pointer;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.drawer-rename-input {
|
|
405
|
+
flex: 1;
|
|
406
|
+
min-width: 0;
|
|
407
|
+
margin: 6px 10px;
|
|
408
|
+
padding: 4px 8px;
|
|
409
|
+
border: 1px solid var(--_accent);
|
|
410
|
+
border-radius: 6px;
|
|
411
|
+
background: var(--_input-bg);
|
|
412
|
+
color: var(--_fg);
|
|
413
|
+
font: inherit;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.drawer-confirm {
|
|
417
|
+
display: flex;
|
|
418
|
+
align-items: center;
|
|
419
|
+
gap: 8px;
|
|
420
|
+
padding: 8px 12px;
|
|
421
|
+
font-size: 0.85em;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.drawer-confirm-label {
|
|
425
|
+
color: var(--_danger);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.drawer-confirm-yes {
|
|
429
|
+
border: none;
|
|
430
|
+
border-radius: 6px;
|
|
431
|
+
background: var(--_danger);
|
|
432
|
+
color: var(--_on-danger);
|
|
433
|
+
padding: 3px 10px;
|
|
434
|
+
font: inherit;
|
|
435
|
+
cursor: pointer;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.drawer-confirm-no {
|
|
439
|
+
border: 1px solid var(--_border);
|
|
440
|
+
border-radius: 6px;
|
|
441
|
+
background: none;
|
|
442
|
+
color: inherit;
|
|
443
|
+
padding: 3px 10px;
|
|
444
|
+
font: inherit;
|
|
445
|
+
cursor: pointer;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/* Embedded placement: an inline, flush side panel rather than a dimmed,
|
|
449
|
+
floating slide-over. */
|
|
450
|
+
:host([placement="embedded"]) .drawer-backdrop {
|
|
451
|
+
background: none;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/* The way back out of the list. It sits beside New chat, which is the control
|
|
455
|
+
it must not be mistaken for: one returns you to the conversation you were
|
|
456
|
+
reading, the other replaces it. */
|
|
457
|
+
.drawer-close {
|
|
458
|
+
flex: 0 0 auto;
|
|
459
|
+
display: inline-flex;
|
|
460
|
+
align-items: center;
|
|
461
|
+
justify-content: center;
|
|
462
|
+
width: 26px;
|
|
463
|
+
height: 26px;
|
|
464
|
+
padding: 0;
|
|
465
|
+
border: 0;
|
|
466
|
+
border-radius: 6px;
|
|
467
|
+
background: none;
|
|
468
|
+
color: inherit;
|
|
469
|
+
font: inherit;
|
|
470
|
+
font-size: 18px;
|
|
471
|
+
line-height: 1;
|
|
472
|
+
cursor: pointer;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.drawer-close:hover {
|
|
476
|
+
background: var(--_hover);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
:host([placement="embedded"]) .drawer-panel {
|
|
480
|
+
width: 100%;
|
|
481
|
+
border-right: none;
|
|
482
|
+
box-shadow: none;
|
|
483
|
+
}
|
|
484
|
+
`;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// The approval card that gates a server-side tool call.
|
|
2
|
+
export const APPROVAL_STYLES: string = `
|
|
3
|
+
/* Approval card — the server-side-tool gate (approve/deny an interrupt). */
|
|
4
|
+
.approval {
|
|
5
|
+
align-self: stretch;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 8px;
|
|
10
|
+
padding: 12px;
|
|
11
|
+
background: var(--_bg);
|
|
12
|
+
border: 1px solid var(--_accent);
|
|
13
|
+
border-radius: 10px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.approval[data-resolved] {
|
|
17
|
+
opacity: 0.7;
|
|
18
|
+
border-color: var(--_border);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.approval-body {
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.approval-actions {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 8px;
|
|
28
|
+
justify-content: flex-end;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.approval-btn {
|
|
32
|
+
border: 1px solid var(--_border);
|
|
33
|
+
border-radius: 8px;
|
|
34
|
+
padding: 8px 14px;
|
|
35
|
+
font: inherit;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
background: var(--_bg);
|
|
39
|
+
color: var(--_fg);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.approval-btn:disabled {
|
|
43
|
+
cursor: default;
|
|
44
|
+
opacity: 0.6;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.approval-btn--approve {
|
|
48
|
+
border-color: var(--_accent);
|
|
49
|
+
background: var(--_accent);
|
|
50
|
+
color: var(--_on-accent);
|
|
51
|
+
}
|
|
52
|
+
`;
|