asta-ui 0.9.4 → 0.9.6
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/css/asta.css +2 -2
- package/css/asta.js +1461 -1
- package/css/components.css +1900 -138
- package/css/runtime/agent.css +136 -0
- package/css/runtime/agent.js +173 -0
- package/css/runtime/assist.css +79 -0
- package/css/runtime/assist.js +799 -0
- package/css/runtime/controls.css +48 -0
- package/css/runtime/controls.js +482 -0
- package/css/src/agent.css +484 -0
- package/css/src/assist.css +598 -0
- package/css/src/controls.css +424 -0
- package/css/tokens.css +16 -0
- package/dist/agent-plan.d.ts +2 -0
- package/dist/agent-plan.js +11 -0
- package/dist/agent-team.d.ts +2 -0
- package/dist/agent-team.js +7 -0
- package/dist/api-keys.d.ts +2 -0
- package/dist/api-keys.js +10 -0
- package/dist/autonomy-dial.d.ts +2 -0
- package/dist/autonomy-dial.js +7 -0
- package/dist/base/agent-plan.d.ts +2 -0
- package/dist/base/agent-plan.js +11 -0
- package/dist/base/agent-team.d.ts +2 -0
- package/dist/base/agent-team.js +7 -0
- package/dist/base/api-keys.d.ts +2 -0
- package/dist/base/api-keys.js +10 -0
- package/dist/base/autonomy-dial.d.ts +2 -0
- package/dist/base/autonomy-dial.js +7 -0
- package/dist/base/change-ledger.d.ts +2 -0
- package/dist/base/change-ledger.js +7 -0
- package/dist/base/citations.d.ts +2 -0
- package/dist/base/citations.js +9 -0
- package/dist/base/context-meter.d.ts +2 -0
- package/dist/base/context-meter.js +14 -0
- package/dist/base/fallback-chain.d.ts +2 -0
- package/dist/base/fallback-chain.js +7 -0
- package/dist/base/model-picker.d.ts +2 -0
- package/dist/base/model-picker.js +9 -0
- package/dist/base/prompt-composer.d.ts +2 -0
- package/dist/base/prompt-composer.js +9 -0
- package/dist/base/scrub-input.d.ts +2 -0
- package/dist/base/scrub-input.js +13 -0
- package/dist/base/thinking.d.ts +2 -0
- package/dist/base/thinking.js +11 -0
- package/dist/base/tool-approval.d.ts +2 -0
- package/dist/base/tool-approval.js +9 -0
- package/dist/base/trace-waterfall.d.ts +2 -0
- package/dist/base/trace-waterfall.js +9 -0
- package/dist/base.js +202 -134
- package/dist/change-ledger.d.ts +2 -0
- package/dist/change-ledger.js +7 -0
- package/dist/chunk-24O5V2PQ.js +253 -0
- package/dist/chunk-44DNL43W.js +490 -0
- package/dist/chunk-45IXJ7W7.js +245 -0
- package/dist/chunk-ANL6VX4X.js +326 -0
- package/dist/chunk-DNROUJ62.js +432 -0
- package/dist/chunk-F4CWSZXK.js +226 -0
- package/dist/chunk-GBOJUMMY.js +163 -0
- package/dist/chunk-H4NFBYKY.js +275 -0
- package/dist/chunk-KFPGQ5RT.js +321 -0
- package/dist/chunk-OIIMYSVT.js +342 -0
- package/dist/chunk-TL32C2SQ.js +221 -0
- package/dist/chunk-UBTYMAKF.js +240 -0
- package/dist/chunk-W6YVDJHX.js +235 -0
- package/dist/chunk-XYQI4ZYV.js +314 -0
- package/dist/citations.d.ts +2 -0
- package/dist/citations.js +9 -0
- package/dist/context-meter.d.ts +2 -0
- package/dist/context-meter.js +14 -0
- package/dist/fallback-chain.d.ts +2 -0
- package/dist/fallback-chain.js +7 -0
- package/dist/index.js +202 -134
- package/dist/model-picker.d.ts +2 -0
- package/dist/model-picker.js +9 -0
- package/dist/prompt-composer.d.ts +2 -0
- package/dist/prompt-composer.js +9 -0
- package/dist/scrub-input.d.ts +2 -0
- package/dist/scrub-input.js +13 -0
- package/dist/thinking.d.ts +2 -0
- package/dist/thinking.js +11 -0
- package/dist/tool-approval.d.ts +2 -0
- package/dist/tool-approval.js +9 -0
- package/dist/trace-waterfall.d.ts +2 -0
- package/dist/trace-waterfall.js +9 -0
- package/dist/types/components/kit/agent-plan.d.ts +34 -0
- package/dist/types/components/kit/api-keys.d.ts +62 -0
- package/dist/types/components/kit/citations.d.ts +34 -0
- package/dist/types/components/kit/context-meter.d.ts +38 -0
- package/dist/types/components/kit/model-picker.d.ts +46 -0
- package/dist/types/components/kit/prompt-composer.d.ts +61 -0
- package/dist/types/components/kit/scrub-input.d.ts +44 -0
- package/dist/types/components/kit/thinking.d.ts +28 -0
- package/dist/types/components/kit/tool-approval.d.ts +43 -0
- package/dist/types/components/kit/trace-waterfall.d.ts +44 -0
- package/dist/types/components/lab/blocks/AgentTeam.d.ts +2 -0
- package/dist/types/components/lab/blocks/AutonomyDial.d.ts +2 -0
- package/dist/types/components/lab/blocks/ChangeLedger.d.ts +2 -0
- package/dist/types/components/lab/blocks/FallbackChain.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/agent-plan.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/agent-team.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/api-keys.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/autonomy-dial.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/agent-plan.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/agent-team.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/api-keys.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/autonomy-dial.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/change-ledger.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/citations.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/context-meter.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/fallback-chain.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/model-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/prompt-composer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/scrub-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/thinking.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/tool-approval.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base/trace-waterfall.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/base.d.ts +25 -1
- package/dist/types/packages/asta-ui/src/change-ledger.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/citations.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/context-meter.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/fallback-chain.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/index.d.ts +25 -1
- package/dist/types/packages/asta-ui/src/model-picker.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/prompt-composer.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/scrub-input.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/thinking.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/tool-approval.d.ts +2 -0
- package/dist/types/packages/asta-ui/src/trace-waterfall.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,484 @@
|
|
|
1
|
+
/* Agent: thinking, context meter, agent plan, tool approval. Class lists mirror the React kit.
|
|
2
|
+
* The context meter opens with core's popover (popovertarget + data-asta-popover) and the tool approval split menu is
|
|
3
|
+
* an asta-dropdown, so asta.js positions both. Tool approval decisions, Enter / Esc and the elapsed timers come from
|
|
4
|
+
* runtime/agent.js; its state CSS (shimmer, spinners, checks) lives in runtime/agent.css. */
|
|
5
|
+
|
|
6
|
+
/* ---- Thinking ----
|
|
7
|
+
* <details class="asta-thinking" data-status="thinking" open>
|
|
8
|
+
* <summary class="asta-thinking-head"><svg class="asta-thinking-icon">…</svg>
|
|
9
|
+
* <span class="asta-thinking-label">Thinking<span class="asta-thinking-shine" aria-hidden="true"><span><span>Thinking</span></span></span></span>
|
|
10
|
+
* <span class="asta-thinking-time" data-asta-elapsed="now">0s</span><svg class="asta-thinking-chevron">…</svg>
|
|
11
|
+
* <span class="asta-thinking-preview">Latest line, shown while folded</span></summary>
|
|
12
|
+
* <ol class="asta-thinking-steps"><li>…</li></ol></details>
|
|
13
|
+
* data-status: thinking | done | stopped. Done: drop the shine and time, label "Thought for 12s". Variant
|
|
14
|
+
* asta-thinking-inline (one line, no panel: use a <div> and a <span class="asta-thinking-head">). Size asta-thinking-sm. */
|
|
15
|
+
.asta-thinking {
|
|
16
|
+
@apply flex w-full min-w-0 flex-col text-[13.5px] text-ink;
|
|
17
|
+
}
|
|
18
|
+
.asta-thinking-sm {
|
|
19
|
+
@apply text-[12.5px];
|
|
20
|
+
}
|
|
21
|
+
.asta-thinking-inline {
|
|
22
|
+
@apply inline-flex w-auto max-w-full align-middle;
|
|
23
|
+
}
|
|
24
|
+
.asta-thinking-head {
|
|
25
|
+
@apply -mx-1.5 flex min-w-0 max-w-full cursor-pointer flex-wrap list-none items-center gap-x-1.5 gap-y-0.5 self-start rounded-md px-1.5 py-1 font-medium outline-none transition-colors duration-200;
|
|
26
|
+
@apply hover:bg-paper-2 focus-visible:ring-2 focus-visible:ring-brand/50 [&::-webkit-details-marker]:hidden;
|
|
27
|
+
span& {
|
|
28
|
+
@apply mx-0 cursor-default px-0 hover:bg-transparent;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
.asta-thinking-icon {
|
|
32
|
+
@apply h-4 w-4 shrink-0 text-mute;
|
|
33
|
+
.asta-thinking-sm & {
|
|
34
|
+
@apply h-3.5 w-3.5;
|
|
35
|
+
}
|
|
36
|
+
[data-status="thinking"] & {
|
|
37
|
+
@apply text-brand;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.asta-thinking-label {
|
|
41
|
+
@apply relative inline-block truncate text-ink;
|
|
42
|
+
[data-status="thinking"] > .asta-thinking-head > & {
|
|
43
|
+
@apply text-mute;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.asta-thinking-shine {
|
|
47
|
+
@apply pointer-events-none absolute inset-0 hidden overflow-hidden;
|
|
48
|
+
[data-status="thinking"] & {
|
|
49
|
+
@apply block;
|
|
50
|
+
}
|
|
51
|
+
& > span {
|
|
52
|
+
@apply absolute inset-0 [mask-image:linear-gradient(90deg,transparent_32%,#000_50%,transparent_68%)];
|
|
53
|
+
}
|
|
54
|
+
& > span > span {
|
|
55
|
+
@apply absolute inset-0 whitespace-nowrap text-ink;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.asta-thinking-time {
|
|
59
|
+
@apply hidden shrink-0 font-normal tabular-nums text-mute;
|
|
60
|
+
[data-status="thinking"] & {
|
|
61
|
+
@apply inline;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.asta-thinking-chevron {
|
|
65
|
+
@apply h-3.5 w-3.5 shrink-0 text-mute transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
|
|
66
|
+
[open] > .asta-thinking-head > & {
|
|
67
|
+
@apply rotate-90;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
.asta-thinking-preview {
|
|
71
|
+
@apply block w-full basis-full truncate pl-[22px] font-normal text-mute;
|
|
72
|
+
[open] > summary > & {
|
|
73
|
+
@apply hidden;
|
|
74
|
+
}
|
|
75
|
+
.asta-thinking-sm & {
|
|
76
|
+
@apply pl-5;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
.asta-thinking-steps {
|
|
80
|
+
@apply ml-[7px] mt-1 flex flex-col gap-2 pb-1 pl-[14px] shadow-[inset_1px_0_0_color-mix(in_srgb,var(--ink)_12%,transparent)];
|
|
81
|
+
& > li {
|
|
82
|
+
@apply leading-relaxed text-ink-2;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* ---- Context meter ----
|
|
87
|
+
* <button class="asta-context-meter" popovertarget="ctx" aria-haspopup="dialog" aria-label="Context window: 62% used" data-warn>
|
|
88
|
+
* <svg class="asta-context-meter-ring" viewBox="0 0 16 16" aria-hidden="true"><circle class="asta-context-meter-ring-track" cx="8" cy="8" r="6.25"/>
|
|
89
|
+
* <circle class="asta-context-meter-ring-bar" cx="8" cy="8" r="6.25" pathLength="100" stroke-dasharray="100 100" stroke-dashoffset="38"/></svg>
|
|
90
|
+
* <span>62%</span><span class="asta-context-meter-of">of 200k</span><span class="asta-context-meter-warn">· Near limit</span></button>
|
|
91
|
+
* <div id="ctx" popover="auto" role="dialog" data-asta-popover data-side="top" data-align="end" class="asta-float asta-popover asta-context-meter-panel">
|
|
92
|
+
* <div class="asta-context-meter-breakdown">head · total · bar (asta-context-meter-seg with --start/--value) · legend · warn · compact</div></div>
|
|
93
|
+
* data-warn on the button and the breakdown near the limit. Segments and legend dots take their fill from their position. */
|
|
94
|
+
.asta-context-meter {
|
|
95
|
+
@apply inline-flex h-8 shrink-0 items-center gap-1.5 rounded-md px-2 text-[12.5px] tabular-nums text-mute outline-none transition-colors duration-200;
|
|
96
|
+
@apply hover:bg-paper-2 hover:text-ink focus-visible:ring-2 focus-visible:ring-brand/50 aria-expanded:bg-paper-2;
|
|
97
|
+
&[data-warn] {
|
|
98
|
+
@apply font-medium text-ink;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
.asta-context-meter-sm {
|
|
102
|
+
@apply h-7 px-1.5;
|
|
103
|
+
& .asta-context-meter-of,
|
|
104
|
+
& .asta-context-meter-warn {
|
|
105
|
+
@apply hidden;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
.asta-context-meter-of {
|
|
109
|
+
[data-warn] > & {
|
|
110
|
+
@apply hidden;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.asta-context-meter-warn {
|
|
114
|
+
@apply hidden;
|
|
115
|
+
[data-warn] > & {
|
|
116
|
+
@apply inline;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
.asta-context-meter-ring {
|
|
120
|
+
@apply h-4 w-4 shrink-0 -rotate-90;
|
|
121
|
+
}
|
|
122
|
+
.asta-context-meter-ring-track {
|
|
123
|
+
@apply fill-none stroke-[color-mix(in_srgb,var(--ink)_11%,transparent)] [stroke-width:2.5];
|
|
124
|
+
}
|
|
125
|
+
.asta-context-meter-ring-bar {
|
|
126
|
+
@apply fill-none stroke-brand [stroke-linecap:round] [stroke-width:2.5] transition-[stroke-dashoffset,stroke] duration-700 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
|
|
127
|
+
[data-warn] & {
|
|
128
|
+
@apply stroke-ink;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
/* Doubled with .asta-popover so it beats the popover's w-max, whatever order the groups load in. */
|
|
132
|
+
.asta-context-meter-panel,
|
|
133
|
+
.asta-popover.asta-context-meter-panel {
|
|
134
|
+
@apply w-[300px] p-4;
|
|
135
|
+
}
|
|
136
|
+
.asta-context-meter-breakdown {
|
|
137
|
+
@apply flex w-full flex-col gap-3 text-ink;
|
|
138
|
+
}
|
|
139
|
+
.asta-context-meter-head {
|
|
140
|
+
@apply flex items-baseline justify-between gap-3;
|
|
141
|
+
& > :first-child {
|
|
142
|
+
@apply text-[13.5px] font-medium;
|
|
143
|
+
}
|
|
144
|
+
& > :last-child:not(:first-child) {
|
|
145
|
+
@apply truncate text-[12px] text-mute;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
.asta-context-meter-total {
|
|
149
|
+
@apply flex items-baseline justify-between gap-3 text-[12.5px] tabular-nums text-mute;
|
|
150
|
+
& b {
|
|
151
|
+
@apply text-[22px] font-medium tracking-[-0.03em] text-ink;
|
|
152
|
+
}
|
|
153
|
+
[data-warn] & > :last-child {
|
|
154
|
+
@apply font-medium text-ink;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
.asta-context-meter-bar {
|
|
158
|
+
@apply relative h-2 w-full overflow-hidden rounded-full bg-paper-2 shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_6%,transparent)];
|
|
159
|
+
}
|
|
160
|
+
.asta-context-meter-seg {
|
|
161
|
+
@apply absolute inset-0 origin-left bg-brand shadow-[inset_-1px_0_0_var(--paper)] transition-transform duration-700 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
|
|
162
|
+
transform: translateX(calc(var(--start, 0) * 100%)) scaleX(var(--value, 0));
|
|
163
|
+
}
|
|
164
|
+
.asta-context-meter-seg:nth-child(2),
|
|
165
|
+
.asta-context-meter-legend > li:nth-child(2) > .asta-context-meter-dot {
|
|
166
|
+
@apply bg-[color-mix(in_srgb,var(--brand)_55%,var(--paper))];
|
|
167
|
+
}
|
|
168
|
+
.asta-context-meter-seg:nth-child(3),
|
|
169
|
+
.asta-context-meter-legend > li:nth-child(3) > .asta-context-meter-dot {
|
|
170
|
+
@apply bg-[color-mix(in_srgb,var(--ink)_62%,var(--paper))];
|
|
171
|
+
}
|
|
172
|
+
.asta-context-meter-seg:nth-child(4),
|
|
173
|
+
.asta-context-meter-legend > li:nth-child(4) > .asta-context-meter-dot {
|
|
174
|
+
@apply bg-[color-mix(in_srgb,var(--ink)_28%,var(--paper))];
|
|
175
|
+
}
|
|
176
|
+
.asta-context-meter-legend {
|
|
177
|
+
@apply flex flex-col gap-1.5 text-[12.5px];
|
|
178
|
+
& > li {
|
|
179
|
+
@apply flex items-center gap-2 text-ink-2;
|
|
180
|
+
}
|
|
181
|
+
& > li > :nth-child(2) {
|
|
182
|
+
@apply min-w-0 flex-1 truncate;
|
|
183
|
+
}
|
|
184
|
+
& > li > :nth-child(3) {
|
|
185
|
+
@apply tabular-nums text-ink;
|
|
186
|
+
}
|
|
187
|
+
& > li > :nth-child(4) {
|
|
188
|
+
@apply w-9 text-right tabular-nums text-mute;
|
|
189
|
+
}
|
|
190
|
+
& > li[data-free] > :nth-child(2) {
|
|
191
|
+
@apply text-mute;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
.asta-context-meter-dot {
|
|
195
|
+
@apply h-2 w-2 shrink-0 rounded-full bg-brand;
|
|
196
|
+
[data-free] > & {
|
|
197
|
+
@apply bg-transparent shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_22%,transparent)];
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
.asta-context-meter-note {
|
|
201
|
+
@apply flex gap-1.5 rounded-lg bg-paper-2 px-2.5 py-2 text-[12.5px] leading-snug text-ink [&>svg]:mt-px [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0;
|
|
202
|
+
& b {
|
|
203
|
+
@apply font-medium;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
.asta-context-meter-compact {
|
|
207
|
+
@apply flex h-8 w-full items-center justify-center gap-2 rounded-md bg-paper-2 text-[13px] font-medium text-ink outline-none transition-[background-color,opacity,transform] duration-200 [&>svg]:h-3.5 [&>svg]:w-3.5;
|
|
208
|
+
@apply hover:bg-[color-mix(in_srgb,var(--ink)_8%,var(--paper-2))] active:scale-[0.98] focus-visible:ring-2 focus-visible:ring-brand/50;
|
|
209
|
+
@apply disabled:pointer-events-none disabled:opacity-60 aria-busy:pointer-events-none aria-busy:opacity-60 [&.htmx-request]:opacity-60;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/* ---- Agent plan ----
|
|
213
|
+
* <section class="asta-agent-plan" aria-label="Migrate billing">
|
|
214
|
+
* <header class="asta-agent-plan-head"><p class="asta-agent-plan-state">Running · 8.3s</p><h3 class="asta-agent-plan-title">…</h3>
|
|
215
|
+
* <div class="asta-agent-plan-progress"><span class="asta-agent-plan-track"><span style="--value:.43"></span></span><span><b>3</b> of 7</span></div></header>
|
|
216
|
+
* <ol class="asta-agent-plan-steps">
|
|
217
|
+
* <li class="asta-agent-plan-step" data-status="done"><details><summary class="asta-agent-plan-row"><span class="asta-agent-plan-icon"></span>
|
|
218
|
+
* <span class="asta-agent-plan-name">…</span><span class="asta-agent-plan-time">1.6s</span><svg class="asta-agent-plan-chevron">…</svg></summary>
|
|
219
|
+
* <div class="asta-agent-plan-body"><p class="asta-agent-plan-detail">…</p><ul class="asta-agent-plan-subs"><li data-status="done"><span class="asta-agent-plan-icon"></span>…</li></ul></div></details></li>
|
|
220
|
+
* <li class="asta-agent-plan-step" data-status="pending"><div class="asta-agent-plan-row">…</div></li></ol></section>
|
|
221
|
+
* data-status: pending | running | done | skipped | failed. The icon is drawn from it. Add <span class="asta-agent-plan-badge">Failed</span>
|
|
222
|
+
* after the name for skipped and failed steps, open the running step's <details>, and data-failed on the section after a failure. */
|
|
223
|
+
.asta-agent-plan {
|
|
224
|
+
@apply flex w-full flex-col rounded-[14px] bg-paper text-ink shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_9%,transparent),0_1px_2px_rgb(0_0_0/0.04)];
|
|
225
|
+
}
|
|
226
|
+
.asta-agent-plan-head {
|
|
227
|
+
@apply flex flex-col px-4 pb-3 pt-4;
|
|
228
|
+
}
|
|
229
|
+
.asta-agent-plan-state {
|
|
230
|
+
@apply flex items-center gap-1.5 text-[12px] tabular-nums text-mute;
|
|
231
|
+
[data-failed] & {
|
|
232
|
+
@apply font-medium text-ink;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
.asta-agent-plan-title {
|
|
236
|
+
@apply mt-0.5 text-[14.5px] font-medium leading-snug tracking-[-0.01em];
|
|
237
|
+
}
|
|
238
|
+
.asta-agent-plan-progress {
|
|
239
|
+
@apply mt-3 flex items-center gap-3 text-[12px] tabular-nums text-mute;
|
|
240
|
+
& b {
|
|
241
|
+
@apply font-medium text-ink;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
.asta-agent-plan-track {
|
|
245
|
+
@apply relative h-1 flex-1 overflow-hidden rounded-full bg-paper-2;
|
|
246
|
+
& > span {
|
|
247
|
+
@apply absolute inset-0 origin-left scale-x-[var(--value,0)] bg-brand transition-transform duration-700 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
|
|
248
|
+
[data-failed] & {
|
|
249
|
+
@apply bg-ink;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
.asta-agent-plan-steps {
|
|
254
|
+
@apply flex flex-col px-2 pb-2;
|
|
255
|
+
}
|
|
256
|
+
.asta-agent-plan-step {
|
|
257
|
+
@apply relative;
|
|
258
|
+
&:not(:last-child) {
|
|
259
|
+
@apply after:pointer-events-none after:absolute after:bottom-[-6px] after:left-[17px] after:top-[30px] after:w-px after:bg-[color-mix(in_srgb,var(--ink)_10%,transparent)] after:content-[''];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
.asta-agent-plan-row {
|
|
263
|
+
@apply flex min-h-10 w-full list-none items-center gap-2.5 rounded-lg px-2 py-2 outline-none [&::-webkit-details-marker]:hidden;
|
|
264
|
+
summary& {
|
|
265
|
+
@apply cursor-pointer transition-colors duration-200 hover:bg-paper-2 focus-visible:ring-2 focus-visible:ring-brand/50;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
.asta-agent-plan-name {
|
|
269
|
+
@apply min-w-0 flex-1 text-left text-[13.5px] leading-snug [overflow-wrap:anywhere];
|
|
270
|
+
[data-status="pending"] > * > &,
|
|
271
|
+
[data-status="pending"] > * > * > & {
|
|
272
|
+
@apply text-mute;
|
|
273
|
+
}
|
|
274
|
+
[data-status="running"] > * > &,
|
|
275
|
+
[data-status="running"] > * > * > &,
|
|
276
|
+
[data-status="failed"] > * > &,
|
|
277
|
+
[data-status="failed"] > * > * > & {
|
|
278
|
+
@apply font-medium;
|
|
279
|
+
}
|
|
280
|
+
[data-status="done"] > * > &,
|
|
281
|
+
[data-status="done"] > * > * > & {
|
|
282
|
+
@apply text-ink-2;
|
|
283
|
+
}
|
|
284
|
+
[data-status="skipped"] > * > &,
|
|
285
|
+
[data-status="skipped"] > * > * > & {
|
|
286
|
+
@apply text-mute line-through decoration-[color-mix(in_srgb,var(--ink)_30%,transparent)];
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
.asta-agent-plan-badge {
|
|
290
|
+
@apply shrink-0 rounded bg-paper-2 px-1.5 py-px text-[11px] text-mute;
|
|
291
|
+
[data-status="failed"] > * > &,
|
|
292
|
+
[data-status="failed"] > * > * > & {
|
|
293
|
+
@apply bg-ink font-medium text-paper;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
.asta-agent-plan-time {
|
|
297
|
+
@apply w-12 shrink-0 text-right text-[12px] tabular-nums text-mute;
|
|
298
|
+
}
|
|
299
|
+
.asta-agent-plan-chevron {
|
|
300
|
+
@apply h-3.5 w-3.5 shrink-0 text-mute transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)] motion-reduce:transition-none;
|
|
301
|
+
[open] > summary > & {
|
|
302
|
+
@apply rotate-90;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
.asta-agent-plan-body {
|
|
306
|
+
@apply flex flex-col gap-1.5 pb-2 pl-[38px] pr-2;
|
|
307
|
+
}
|
|
308
|
+
.asta-agent-plan-detail {
|
|
309
|
+
@apply truncate text-[12px] leading-relaxed text-mute;
|
|
310
|
+
[data-status="running"] & {
|
|
311
|
+
@apply font-mono;
|
|
312
|
+
}
|
|
313
|
+
[data-status="failed"] & {
|
|
314
|
+
@apply whitespace-normal text-ink;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
.asta-agent-plan-subs {
|
|
318
|
+
@apply flex flex-col gap-1;
|
|
319
|
+
& > li {
|
|
320
|
+
@apply flex items-center gap-2 text-[12.5px] text-ink-2;
|
|
321
|
+
}
|
|
322
|
+
& > li[data-status="pending"] {
|
|
323
|
+
@apply text-mute;
|
|
324
|
+
}
|
|
325
|
+
& .asta-agent-plan-icon {
|
|
326
|
+
@apply h-3.5 w-3.5;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
.asta-agent-plan-icon {
|
|
330
|
+
@apply relative grid h-[18px] w-[18px] shrink-0 place-items-center rounded-full shadow-[inset_0_0_0_1.5px_color-mix(in_srgb,var(--ink)_20%,transparent)];
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* ---- Tool approval ----
|
|
334
|
+
* <div class="asta-tool-approval" data-asta-tool-approval>
|
|
335
|
+
* <ul class="asta-tool-approval-receipts" aria-label="Tool calls"></ul>
|
|
336
|
+
* <div class="asta-tool-approval-queue">
|
|
337
|
+
* <div class="asta-tool-approval-card" role="group" tabindex="0" aria-label="Approve run_sql" data-tool="run_sql" data-id="c1">
|
|
338
|
+
* <div class="asta-tool-approval-head"><span class="asta-tool-approval-icon"><svg/></span><div class="asta-tool-approval-meta">
|
|
339
|
+
* <p class="asta-tool-approval-source">Wants to use a tool · Postgres</p><p class="asta-tool-approval-tool">run_sql</p></div>
|
|
340
|
+
* <span class="asta-tool-approval-count">1 of 3</span></div>
|
|
341
|
+
* <p class="asta-tool-approval-summary">…</p> then <pre class="asta-tool-approval-code">, .asta-tool-approval-diff or <dl class="asta-tool-approval-args">
|
|
342
|
+
* <div class="asta-tool-approval-foot"><p class="asta-tool-approval-risk" data-risk="read|write|destructive"><svg/>Read only</p>
|
|
343
|
+
* <div class="asta-tool-approval-actions"><button class="asta-tool-approval-deny" data-asta-decide="deny">Deny <kbd>Esc</kbd></button>
|
|
344
|
+
* <div class="asta-dropdown asta-tool-approval-split" data-asta-dropdown data-align="end"><button class="asta-tool-approval-allow" data-asta-decide="once">Allow once</button>
|
|
345
|
+
* <button class="asta-tool-approval-more" data-asta-dropdown-trigger aria-haspopup="menu" …><svg/></button>
|
|
346
|
+
* <div role="menu" popover="manual" data-asta-mpanel class="asta-float asta-dropdown-panel">…data-asta-decide="always"…</div></div></div></div></div>
|
|
347
|
+
* …more cards queue behind the first</div></div>
|
|
348
|
+
* asta.js turns a decision into a receipt (data-decision), runs queued calls to an always-allowed tool, and fires
|
|
349
|
+
* "asta:tool-decision". The server can replace a receipt with one that carries a time: <span class="asta-tool-approval-receipt-time">. */
|
|
350
|
+
.asta-tool-approval {
|
|
351
|
+
@apply flex w-full flex-col gap-3 text-ink;
|
|
352
|
+
}
|
|
353
|
+
.asta-tool-approval-receipts {
|
|
354
|
+
@apply -mx-2.5 flex flex-col empty:hidden;
|
|
355
|
+
}
|
|
356
|
+
.asta-tool-approval-receipt {
|
|
357
|
+
@apply flex min-h-8 items-center gap-2 rounded-lg px-2.5 py-1.5 text-[12.5px] [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0 [&>svg]:text-brand;
|
|
358
|
+
&[data-decision="deny"] > svg,
|
|
359
|
+
&[data-state="error"] > svg {
|
|
360
|
+
@apply text-ink;
|
|
361
|
+
}
|
|
362
|
+
& > b {
|
|
363
|
+
@apply font-medium;
|
|
364
|
+
}
|
|
365
|
+
& > code {
|
|
366
|
+
@apply min-w-0 truncate font-mono text-[12px] text-ink-2;
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
.asta-tool-approval-receipt-sep {
|
|
370
|
+
@apply text-mute;
|
|
371
|
+
}
|
|
372
|
+
.asta-tool-approval-receipts:focus {
|
|
373
|
+
@apply outline-none;
|
|
374
|
+
}
|
|
375
|
+
.asta-tool-approval-receipt-summary {
|
|
376
|
+
@apply hidden min-w-0 flex-1 truncate text-mute sm:block;
|
|
377
|
+
}
|
|
378
|
+
.asta-tool-approval-receipt-time {
|
|
379
|
+
@apply ml-auto shrink-0 tabular-nums text-mute;
|
|
380
|
+
}
|
|
381
|
+
.asta-tool-approval-queue {
|
|
382
|
+
@apply relative isolate empty:hidden;
|
|
383
|
+
}
|
|
384
|
+
.asta-tool-approval-card {
|
|
385
|
+
@apply relative flex flex-col gap-3 rounded-[14px] bg-paper p-4 outline-none;
|
|
386
|
+
@apply shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_10%,transparent),0_10px_28px_-16px_rgb(0_0_0/0.25),0_1px_2px_rgb(0_0_0/0.04)];
|
|
387
|
+
@apply focus-visible:shadow-[inset_0_0_0_1px_var(--brand),0_0_0_3px_color-mix(in_srgb,var(--brand)_16%,transparent)];
|
|
388
|
+
.asta-tool-approval-queue > &:not(:first-child) {
|
|
389
|
+
@apply hidden;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
.asta-tool-approval-head {
|
|
393
|
+
@apply flex items-start gap-3;
|
|
394
|
+
}
|
|
395
|
+
.asta-tool-approval-icon {
|
|
396
|
+
@apply grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-paper-2 text-ink [&>svg]:h-4 [&>svg]:w-4;
|
|
397
|
+
}
|
|
398
|
+
.asta-tool-approval-meta {
|
|
399
|
+
@apply min-w-0 flex-1;
|
|
400
|
+
}
|
|
401
|
+
.asta-tool-approval-source {
|
|
402
|
+
@apply truncate text-[12px] text-mute;
|
|
403
|
+
}
|
|
404
|
+
.asta-tool-approval-tool {
|
|
405
|
+
@apply truncate font-mono text-[13.5px] font-medium;
|
|
406
|
+
}
|
|
407
|
+
.asta-tool-approval-count {
|
|
408
|
+
@apply shrink-0 rounded-md bg-paper-2 px-1.5 py-0.5 text-[11.5px] tabular-nums text-mute;
|
|
409
|
+
}
|
|
410
|
+
.asta-tool-approval-summary {
|
|
411
|
+
@apply text-[13.5px] leading-snug text-ink-2;
|
|
412
|
+
}
|
|
413
|
+
.asta-tool-approval-code {
|
|
414
|
+
@apply overflow-x-auto rounded-lg bg-paper-2 px-3 py-2.5 font-mono text-[12px] leading-[1.6] text-ink [scrollbar-width:thin];
|
|
415
|
+
}
|
|
416
|
+
.asta-tool-approval-diff {
|
|
417
|
+
@apply overflow-hidden rounded-lg bg-paper-2 text-[12px];
|
|
418
|
+
}
|
|
419
|
+
.asta-tool-approval-diff-file {
|
|
420
|
+
@apply flex items-center justify-between gap-3 px-3 pb-1 pt-2 font-mono text-ink-2;
|
|
421
|
+
& > :last-child {
|
|
422
|
+
@apply shrink-0 tabular-nums text-mute;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
.asta-tool-approval-diff-lines {
|
|
426
|
+
@apply overflow-x-auto pb-1.5 font-mono leading-[1.6] [scrollbar-width:thin];
|
|
427
|
+
& > div {
|
|
428
|
+
@apply flex min-w-max whitespace-pre pr-3 text-ink before:w-6 before:shrink-0 before:select-none before:text-center before:text-mute before:content-['_'];
|
|
429
|
+
}
|
|
430
|
+
& > div[data-sign="+"] {
|
|
431
|
+
@apply bg-[color-mix(in_srgb,var(--brand)_9%,transparent)] before:text-brand before:content-['+'];
|
|
432
|
+
}
|
|
433
|
+
& > div[data-sign="-"] {
|
|
434
|
+
@apply text-mute line-through decoration-[color-mix(in_srgb,var(--ink)_25%,transparent)] before:content-['−'];
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
.asta-tool-approval-args {
|
|
438
|
+
@apply grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 rounded-lg bg-paper-2 px-3 py-2.5 text-[12.5px];
|
|
439
|
+
& dt {
|
|
440
|
+
@apply text-mute;
|
|
441
|
+
}
|
|
442
|
+
& dd {
|
|
443
|
+
@apply min-w-0 break-words font-mono text-[12px] text-ink;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
.asta-tool-approval-foot {
|
|
447
|
+
@apply flex flex-wrap items-center justify-between gap-x-3 gap-y-2.5 pt-0.5;
|
|
448
|
+
}
|
|
449
|
+
.asta-tool-approval-risk {
|
|
450
|
+
@apply flex items-center gap-1.5 text-[12.5px] text-mute [&>svg]:h-3.5 [&>svg]:w-3.5 [&>svg]:shrink-0;
|
|
451
|
+
&[data-risk="destructive"] {
|
|
452
|
+
@apply font-medium text-ink;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
.asta-tool-approval-actions {
|
|
456
|
+
@apply ml-auto flex items-center gap-2;
|
|
457
|
+
& kbd {
|
|
458
|
+
@apply ml-1 hidden rounded bg-[color-mix(in_srgb,currentColor_14%,transparent)] px-1 font-sans text-[10.5px] leading-[1.5] sm:inline;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
.asta-tool-approval-deny {
|
|
462
|
+
@apply inline-flex h-8 items-center rounded-md px-3 text-[13px] font-medium text-ink-2 outline-none shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--ink)_14%,transparent)];
|
|
463
|
+
@apply transition-[background-color,color,transform] duration-150 hover:bg-paper-2 hover:text-ink active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-brand/50;
|
|
464
|
+
}
|
|
465
|
+
.asta-tool-approval-split {
|
|
466
|
+
@apply flex;
|
|
467
|
+
}
|
|
468
|
+
.asta-tool-approval-allow,
|
|
469
|
+
.asta-tool-approval-more {
|
|
470
|
+
@apply inline-flex h-8 items-center bg-ink text-[13px] font-medium text-paper outline-none transition-[background-color,transform] duration-150;
|
|
471
|
+
@apply hover:bg-[color-mix(in_srgb,var(--ink)_86%,var(--paper))] active:scale-[0.97] focus-visible:ring-2 focus-visible:ring-brand/50 focus-visible:ring-offset-2 focus-visible:ring-offset-paper;
|
|
472
|
+
}
|
|
473
|
+
.asta-tool-approval-allow {
|
|
474
|
+
@apply rounded-l-md pl-3 pr-2.5;
|
|
475
|
+
}
|
|
476
|
+
.asta-tool-approval-more {
|
|
477
|
+
@apply w-7 justify-center rounded-r-md shadow-[inset_1px_0_0_color-mix(in_srgb,var(--paper)_22%,transparent)] [&>svg]:h-3.5 [&>svg]:w-3.5;
|
|
478
|
+
& > svg {
|
|
479
|
+
@apply transition-transform duration-300 ease-[cubic-bezier(.16,1,.3,1)];
|
|
480
|
+
}
|
|
481
|
+
[data-open] > & > svg {
|
|
482
|
+
@apply rotate-180;
|
|
483
|
+
}
|
|
484
|
+
}
|