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.
Files changed (130) hide show
  1. package/css/asta.css +2 -2
  2. package/css/asta.js +1461 -1
  3. package/css/components.css +1900 -138
  4. package/css/runtime/agent.css +136 -0
  5. package/css/runtime/agent.js +173 -0
  6. package/css/runtime/assist.css +79 -0
  7. package/css/runtime/assist.js +799 -0
  8. package/css/runtime/controls.css +48 -0
  9. package/css/runtime/controls.js +482 -0
  10. package/css/src/agent.css +484 -0
  11. package/css/src/assist.css +598 -0
  12. package/css/src/controls.css +424 -0
  13. package/css/tokens.css +16 -0
  14. package/dist/agent-plan.d.ts +2 -0
  15. package/dist/agent-plan.js +11 -0
  16. package/dist/agent-team.d.ts +2 -0
  17. package/dist/agent-team.js +7 -0
  18. package/dist/api-keys.d.ts +2 -0
  19. package/dist/api-keys.js +10 -0
  20. package/dist/autonomy-dial.d.ts +2 -0
  21. package/dist/autonomy-dial.js +7 -0
  22. package/dist/base/agent-plan.d.ts +2 -0
  23. package/dist/base/agent-plan.js +11 -0
  24. package/dist/base/agent-team.d.ts +2 -0
  25. package/dist/base/agent-team.js +7 -0
  26. package/dist/base/api-keys.d.ts +2 -0
  27. package/dist/base/api-keys.js +10 -0
  28. package/dist/base/autonomy-dial.d.ts +2 -0
  29. package/dist/base/autonomy-dial.js +7 -0
  30. package/dist/base/change-ledger.d.ts +2 -0
  31. package/dist/base/change-ledger.js +7 -0
  32. package/dist/base/citations.d.ts +2 -0
  33. package/dist/base/citations.js +9 -0
  34. package/dist/base/context-meter.d.ts +2 -0
  35. package/dist/base/context-meter.js +14 -0
  36. package/dist/base/fallback-chain.d.ts +2 -0
  37. package/dist/base/fallback-chain.js +7 -0
  38. package/dist/base/model-picker.d.ts +2 -0
  39. package/dist/base/model-picker.js +9 -0
  40. package/dist/base/prompt-composer.d.ts +2 -0
  41. package/dist/base/prompt-composer.js +9 -0
  42. package/dist/base/scrub-input.d.ts +2 -0
  43. package/dist/base/scrub-input.js +13 -0
  44. package/dist/base/thinking.d.ts +2 -0
  45. package/dist/base/thinking.js +11 -0
  46. package/dist/base/tool-approval.d.ts +2 -0
  47. package/dist/base/tool-approval.js +9 -0
  48. package/dist/base/trace-waterfall.d.ts +2 -0
  49. package/dist/base/trace-waterfall.js +9 -0
  50. package/dist/base.js +202 -134
  51. package/dist/change-ledger.d.ts +2 -0
  52. package/dist/change-ledger.js +7 -0
  53. package/dist/chunk-24O5V2PQ.js +253 -0
  54. package/dist/chunk-44DNL43W.js +490 -0
  55. package/dist/chunk-45IXJ7W7.js +245 -0
  56. package/dist/chunk-ANL6VX4X.js +326 -0
  57. package/dist/chunk-DNROUJ62.js +432 -0
  58. package/dist/chunk-F4CWSZXK.js +226 -0
  59. package/dist/chunk-GBOJUMMY.js +163 -0
  60. package/dist/chunk-H4NFBYKY.js +275 -0
  61. package/dist/chunk-KFPGQ5RT.js +321 -0
  62. package/dist/chunk-OIIMYSVT.js +342 -0
  63. package/dist/chunk-TL32C2SQ.js +221 -0
  64. package/dist/chunk-UBTYMAKF.js +240 -0
  65. package/dist/chunk-W6YVDJHX.js +235 -0
  66. package/dist/chunk-XYQI4ZYV.js +314 -0
  67. package/dist/citations.d.ts +2 -0
  68. package/dist/citations.js +9 -0
  69. package/dist/context-meter.d.ts +2 -0
  70. package/dist/context-meter.js +14 -0
  71. package/dist/fallback-chain.d.ts +2 -0
  72. package/dist/fallback-chain.js +7 -0
  73. package/dist/index.js +202 -134
  74. package/dist/model-picker.d.ts +2 -0
  75. package/dist/model-picker.js +9 -0
  76. package/dist/prompt-composer.d.ts +2 -0
  77. package/dist/prompt-composer.js +9 -0
  78. package/dist/scrub-input.d.ts +2 -0
  79. package/dist/scrub-input.js +13 -0
  80. package/dist/thinking.d.ts +2 -0
  81. package/dist/thinking.js +11 -0
  82. package/dist/tool-approval.d.ts +2 -0
  83. package/dist/tool-approval.js +9 -0
  84. package/dist/trace-waterfall.d.ts +2 -0
  85. package/dist/trace-waterfall.js +9 -0
  86. package/dist/types/components/kit/agent-plan.d.ts +34 -0
  87. package/dist/types/components/kit/api-keys.d.ts +62 -0
  88. package/dist/types/components/kit/citations.d.ts +34 -0
  89. package/dist/types/components/kit/context-meter.d.ts +38 -0
  90. package/dist/types/components/kit/model-picker.d.ts +46 -0
  91. package/dist/types/components/kit/prompt-composer.d.ts +61 -0
  92. package/dist/types/components/kit/scrub-input.d.ts +44 -0
  93. package/dist/types/components/kit/thinking.d.ts +28 -0
  94. package/dist/types/components/kit/tool-approval.d.ts +43 -0
  95. package/dist/types/components/kit/trace-waterfall.d.ts +44 -0
  96. package/dist/types/components/lab/blocks/AgentTeam.d.ts +2 -0
  97. package/dist/types/components/lab/blocks/AutonomyDial.d.ts +2 -0
  98. package/dist/types/components/lab/blocks/ChangeLedger.d.ts +2 -0
  99. package/dist/types/components/lab/blocks/FallbackChain.d.ts +2 -0
  100. package/dist/types/packages/asta-ui/src/agent-plan.d.ts +2 -0
  101. package/dist/types/packages/asta-ui/src/agent-team.d.ts +2 -0
  102. package/dist/types/packages/asta-ui/src/api-keys.d.ts +2 -0
  103. package/dist/types/packages/asta-ui/src/autonomy-dial.d.ts +2 -0
  104. package/dist/types/packages/asta-ui/src/base/agent-plan.d.ts +2 -0
  105. package/dist/types/packages/asta-ui/src/base/agent-team.d.ts +2 -0
  106. package/dist/types/packages/asta-ui/src/base/api-keys.d.ts +2 -0
  107. package/dist/types/packages/asta-ui/src/base/autonomy-dial.d.ts +2 -0
  108. package/dist/types/packages/asta-ui/src/base/change-ledger.d.ts +2 -0
  109. package/dist/types/packages/asta-ui/src/base/citations.d.ts +2 -0
  110. package/dist/types/packages/asta-ui/src/base/context-meter.d.ts +2 -0
  111. package/dist/types/packages/asta-ui/src/base/fallback-chain.d.ts +2 -0
  112. package/dist/types/packages/asta-ui/src/base/model-picker.d.ts +2 -0
  113. package/dist/types/packages/asta-ui/src/base/prompt-composer.d.ts +2 -0
  114. package/dist/types/packages/asta-ui/src/base/scrub-input.d.ts +2 -0
  115. package/dist/types/packages/asta-ui/src/base/thinking.d.ts +2 -0
  116. package/dist/types/packages/asta-ui/src/base/tool-approval.d.ts +2 -0
  117. package/dist/types/packages/asta-ui/src/base/trace-waterfall.d.ts +2 -0
  118. package/dist/types/packages/asta-ui/src/base.d.ts +25 -1
  119. package/dist/types/packages/asta-ui/src/change-ledger.d.ts +2 -0
  120. package/dist/types/packages/asta-ui/src/citations.d.ts +2 -0
  121. package/dist/types/packages/asta-ui/src/context-meter.d.ts +2 -0
  122. package/dist/types/packages/asta-ui/src/fallback-chain.d.ts +2 -0
  123. package/dist/types/packages/asta-ui/src/index.d.ts +25 -1
  124. package/dist/types/packages/asta-ui/src/model-picker.d.ts +2 -0
  125. package/dist/types/packages/asta-ui/src/prompt-composer.d.ts +2 -0
  126. package/dist/types/packages/asta-ui/src/scrub-input.d.ts +2 -0
  127. package/dist/types/packages/asta-ui/src/thinking.d.ts +2 -0
  128. package/dist/types/packages/asta-ui/src/tool-approval.d.ts +2 -0
  129. package/dist/types/packages/asta-ui/src/trace-waterfall.d.ts +2 -0
  130. package/package.json +1 -1
@@ -0,0 +1,136 @@
1
+ /* Agent: thinking shimmer, agent plan status icons, tool approval entrances.
2
+ * Only what Tailwind classes can't express. Motion is transform and opacity only, with the kit's easing. */
3
+
4
+ @keyframes asta-agent-sweep { from { transform: translateX(-100%) } 70%, to { transform: translateX(100%) } }
5
+ @keyframes asta-agent-counter { from { transform: translateX(100%) } 70%, to { transform: translateX(-100%) } }
6
+ @keyframes asta-agent-pulse { 0%, 100% { opacity: 0.4 } 50% { opacity: 1 } }
7
+ @keyframes asta-agent-in { from { opacity: 0; transform: translateY(4px) } }
8
+ @keyframes asta-agent-pop { from { opacity: 0; transform: scale(0.6) } }
9
+ @keyframes asta-agent-spin { to { transform: rotate(360deg) } }
10
+ @keyframes asta-agent-card { from { opacity: 0; transform: translateY(6px) scale(0.98) } }
11
+
12
+ /* ---------- Thinking: the light slides, the letters stay ---------- */
13
+
14
+ .asta-thinking[data-status="thinking"] .asta-thinking-shine > span {
15
+ animation: asta-agent-sweep 2.2s linear infinite;
16
+ }
17
+ .asta-thinking[data-status="thinking"] .asta-thinking-shine > span > span {
18
+ animation: asta-agent-counter 2.2s linear infinite;
19
+ }
20
+ .asta-thinking[data-status="thinking"] .asta-thinking-icon {
21
+ animation: asta-agent-pulse 1.6s ease-in-out infinite;
22
+ }
23
+ .asta-thinking[open] .asta-thinking-steps > li {
24
+ animation: asta-agent-in 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
25
+ }
26
+ .asta-thinking[data-status="thinking"] .asta-thinking-steps > li:last-child::after {
27
+ content: "";
28
+ display: inline-block;
29
+ width: 6px;
30
+ height: 6px;
31
+ margin-left: 6px;
32
+ border-radius: 999px;
33
+ vertical-align: middle;
34
+ background: var(--brand);
35
+ animation: asta-agent-pulse 1.2s ease-in-out infinite;
36
+ }
37
+
38
+ /* ---------- Agent plan: the icon follows data-status ---------- */
39
+
40
+ :is([data-status="running"] > .asta-agent-plan-icon, [data-status="running"] > * > .asta-agent-plan-icon, [data-status="running"] > * > * > .asta-agent-plan-icon) {
41
+ box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--brand) 20%, transparent);
42
+ }
43
+ :is([data-status="running"] > .asta-agent-plan-icon, [data-status="running"] > * > .asta-agent-plan-icon, [data-status="running"] > * > * > .asta-agent-plan-icon)::after {
44
+ content: "";
45
+ position: absolute;
46
+ inset: 0;
47
+ border-radius: 999px;
48
+ border: 2px solid transparent;
49
+ border-top-color: var(--brand);
50
+ animation: asta-agent-spin 0.8s linear infinite;
51
+ }
52
+ :is([data-status="done"] > .asta-agent-plan-icon, [data-status="done"] > * > .asta-agent-plan-icon, [data-status="done"] > * > * > .asta-agent-plan-icon) {
53
+ background: var(--brand);
54
+ box-shadow: none;
55
+ animation: asta-agent-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
56
+ }
57
+ :is([data-status="done"] > .asta-agent-plan-icon, [data-status="done"] > * > .asta-agent-plan-icon, [data-status="done"] > * > * > .asta-agent-plan-icon)::after {
58
+ content: "";
59
+ width: 28%;
60
+ height: 50%;
61
+ margin-top: -12%;
62
+ border: solid #fff;
63
+ border-width: 0 2px 2px 0;
64
+ transform: rotate(45deg);
65
+ }
66
+ :is([data-status="failed"] > .asta-agent-plan-icon, [data-status="failed"] > * > .asta-agent-plan-icon, [data-status="failed"] > * > * > .asta-agent-plan-icon) {
67
+ background: var(--ink);
68
+ box-shadow: none;
69
+ animation: asta-agent-pop 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
70
+ }
71
+ :is([data-status="failed"] > .asta-agent-plan-icon, [data-status="failed"] > * > .asta-agent-plan-icon, [data-status="failed"] > * > * > .asta-agent-plan-icon)::after {
72
+ content: "!";
73
+ color: var(--paper);
74
+ font-size: 11px;
75
+ font-weight: 700;
76
+ line-height: 1;
77
+ }
78
+ :is([data-status="skipped"] > .asta-agent-plan-icon, [data-status="skipped"] > * > .asta-agent-plan-icon, [data-status="skipped"] > * > * > .asta-agent-plan-icon)::after {
79
+ content: "";
80
+ width: 40%;
81
+ height: 2px;
82
+ border-radius: 2px;
83
+ background: var(--mute);
84
+ }
85
+ .asta-agent-plan-step[data-status="running"] > details[open] > .asta-agent-plan-body,
86
+ .asta-agent-plan-detail {
87
+ animation: asta-agent-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
88
+ }
89
+
90
+ /* ---------- Tool approval: the next card rises in, receipts slide down ---------- */
91
+
92
+ .asta-tool-approval-card {
93
+ animation: asta-agent-card 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
94
+ }
95
+ .asta-tool-approval-receipt {
96
+ animation: asta-agent-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
97
+ }
98
+ /* Queued calls show as two cards stacked behind the first. */
99
+ .asta-tool-approval-queue[data-more] {
100
+ padding-bottom: 12px;
101
+ }
102
+ .asta-tool-approval-queue[data-more]::before,
103
+ .asta-tool-approval-queue[data-more="2"]::after {
104
+ content: "";
105
+ position: absolute;
106
+ inset: 0 0 12px;
107
+ z-index: -1;
108
+ border-radius: 14px;
109
+ background: var(--paper);
110
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 9%, transparent);
111
+ transform: translateY(7px) scaleX(0.96);
112
+ opacity: 0.75;
113
+ }
114
+ .asta-tool-approval-queue[data-more="2"]::after {
115
+ z-index: -2;
116
+ transform: translateY(14px) scaleX(0.92);
117
+ opacity: 0.5;
118
+ }
119
+
120
+ @media (prefers-reduced-motion: reduce) {
121
+ .asta-thinking *,
122
+ .asta-thinking-steps > li,
123
+ .asta-agent-plan-icon,
124
+ .asta-agent-plan-body,
125
+ .asta-agent-plan-detail,
126
+ .asta-tool-approval-card,
127
+ .asta-tool-approval-receipt {
128
+ animation: none !important;
129
+ }
130
+ .asta-agent-plan-icon::after {
131
+ animation-duration: 2.4s !important;
132
+ }
133
+ .asta-thinking-shine {
134
+ display: none !important;
135
+ }
136
+ }
@@ -0,0 +1,173 @@
1
+ /* Agent: elapsed timers and tool approval.
2
+ * Event delegation on document, so markup swapped in by htmx works without re-init.
3
+ * Elapsed [data-asta-elapsed="<epoch ms>"] counts up from that time, or from when it first shows with "now" ("12s", "1m 04s"; inside an agent plan "4.2s"
4
+ * under ten seconds). Rests off screen and in hidden tabs. Remove the attribute to stop it.
5
+ * Tool [data-asta-tool-approval]: [data-asta-decide="deny|once|always"] inside a .asta-tool-approval-card, or
6
+ * Enter (allow once) / Esc (deny) while the card has focus. The card becomes a receipt in
7
+ * .asta-tool-approval-receipts, queued calls to an always-allowed tool follow on their own ("auto"), and
8
+ * "asta:tool-decision" fires with detail { id, tool, decision }. Cancel it to handle the swap yourself.
9
+ */
10
+ (() => {
11
+ if (window.astaAgent) return;
12
+ window.astaAgent = true;
13
+ const el = (e) => (e.target instanceof Element ? e.target : null);
14
+
15
+ /* ---------- Elapsed ---------- */
16
+
17
+ const seen = new WeakSet();
18
+ const onScreen = new Set();
19
+ const io = "IntersectionObserver" in window ? new IntersectionObserver((es) => es.forEach((e) => onScreen[e.isIntersecting ? "add" : "delete"](e.target))) : null;
20
+ const fmt = (ms, tenths) => {
21
+ const s = Math.max(0, ms) / 1000;
22
+ if (tenths && s < 10) return `${s.toFixed(1)}s`;
23
+ if (s < 60) return `${Math.floor(s)}s`;
24
+ return `${Math.floor(s / 60)}m ${String(Math.floor(s % 60)).padStart(2, "0")}s`;
25
+ };
26
+ function paint(node) {
27
+ if (node.getAttribute("data-asta-elapsed") === "now") node.setAttribute("data-asta-elapsed", String(Date.now()));
28
+ const from = Number(node.getAttribute("data-asta-elapsed"));
29
+ if (!Number.isFinite(from) || from <= 0) return;
30
+ const next = fmt(Date.now() - from, !!node.closest(".asta-agent-plan"));
31
+ if (node.textContent !== next) node.textContent = next;
32
+ }
33
+ function scan() {
34
+ document.querySelectorAll("[data-asta-elapsed]").forEach((n) => {
35
+ if (seen.has(n)) return;
36
+ seen.add(n);
37
+ if (io) io.observe(n);
38
+ else onScreen.add(n);
39
+ paint(n);
40
+ });
41
+ onScreen.forEach((n) => {
42
+ if (n.isConnected && n.hasAttribute("data-asta-elapsed")) return paint(n);
43
+ onScreen.delete(n);
44
+ seen.delete(n);
45
+ io?.unobserve(n);
46
+ });
47
+ }
48
+ let timer = 0;
49
+ const run = () => {
50
+ clearInterval(timer);
51
+ if (!document.hidden) timer = setInterval(scan, 500);
52
+ scan();
53
+ };
54
+ document.addEventListener("visibilitychange", run);
55
+
56
+ /* ---------- Tool approval ---------- */
57
+
58
+ const WORD = { deny: "Denied", once: "Allowed", always: "Always allowed", auto: "Auto-allowed" };
59
+ const NS = "http://www.w3.org/2000/svg";
60
+ const PATH = { ok: "m3.5 8.5 3 3 6-7", deny: "M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12ZM3.8 12.2l8.4-8.4" };
61
+
62
+ function icon(d) {
63
+ const svg = document.createElementNS(NS, "svg");
64
+ svg.setAttribute("viewBox", "0 0 16 16");
65
+ svg.setAttribute("fill", "none");
66
+ svg.setAttribute("stroke", "currentColor");
67
+ svg.setAttribute("stroke-width", "1.8");
68
+ svg.setAttribute("stroke-linecap", "round");
69
+ svg.setAttribute("stroke-linejoin", "round");
70
+ svg.setAttribute("aria-hidden", "true");
71
+ const p = document.createElementNS(NS, "path");
72
+ p.setAttribute("d", d);
73
+ svg.append(p);
74
+ return svg;
75
+ }
76
+
77
+ function receipt(card, decision) {
78
+ const li = document.createElement("li");
79
+ li.className = "asta-tool-approval-receipt";
80
+ li.dataset.decision = decision;
81
+ if (card.dataset.id) li.dataset.id = card.dataset.id;
82
+ const word = document.createElement("b");
83
+ word.textContent = WORD[decision];
84
+ const sep = document.createElement("span");
85
+ sep.className = "asta-tool-approval-receipt-sep";
86
+ sep.setAttribute("aria-hidden", "true");
87
+ sep.textContent = "·";
88
+ const code = document.createElement("code");
89
+ code.textContent = card.dataset.tool || card.querySelector(".asta-tool-approval-tool")?.textContent || "tool";
90
+ li.append(icon(decision === "deny" ? PATH.deny : PATH.ok), word, sep, code);
91
+ const sum = card.querySelector(".asta-tool-approval-summary")?.textContent;
92
+ if (sum) {
93
+ const s = document.createElement("span");
94
+ s.className = "asta-tool-approval-receipt-summary";
95
+ s.textContent = sum;
96
+ li.append(s);
97
+ }
98
+ return li;
99
+ }
100
+
101
+ // Queue look and "n of total" labels.
102
+ function sync(root) {
103
+ const queue = root.querySelector(".asta-tool-approval-queue");
104
+ const cards = queue ? [...queue.querySelectorAll(":scope > .asta-tool-approval-card")] : [];
105
+ const done = root.querySelectorAll(".asta-tool-approval-receipt").length;
106
+ const total = done + cards.length;
107
+ if (queue) {
108
+ if (cards.length > 1) queue.setAttribute("data-more", String(Math.min(2, cards.length - 1)));
109
+ else queue.removeAttribute("data-more");
110
+ }
111
+ cards.forEach((c, i) => {
112
+ const n = c.querySelector(".asta-tool-approval-count");
113
+ if (n) n.textContent = total > 1 ? `${done + i + 1} of ${total}` : "";
114
+ if (n) n.hidden = total < 2;
115
+ if (i === 0 && total > 1) c.setAttribute("aria-label", `Approve ${c.dataset.tool || "tool"}, ${done + 1} of ${total}`);
116
+ });
117
+ }
118
+
119
+ function decide(card, decision) {
120
+ const root = card.closest("[data-asta-tool-approval]");
121
+ if (!root || !card.isConnected) return;
122
+ const detail = { id: card.dataset.id, tool: card.dataset.tool, decision };
123
+ if (!card.dispatchEvent(new CustomEvent("asta:tool-decision", { bubbles: true, cancelable: true, detail }))) return;
124
+ const refocus = card.contains(document.activeElement);
125
+ let list = root.querySelector(".asta-tool-approval-receipts");
126
+ if (!list) {
127
+ list = document.createElement("ul");
128
+ list.className = "asta-tool-approval-receipts";
129
+ list.setAttribute("aria-label", "Tool calls");
130
+ root.prepend(list);
131
+ }
132
+ list.append(receipt(card, decision));
133
+ card.remove();
134
+ if (decision === "always" && card.dataset.tool) {
135
+ root.querySelectorAll(`.asta-tool-approval-card[data-tool="${CSS.escape(card.dataset.tool)}"]`).forEach((c) => decide(c, "auto"));
136
+ }
137
+ sync(root);
138
+ if (refocus) {
139
+ const next = root.querySelector(".asta-tool-approval-queue > .asta-tool-approval-card");
140
+ if (!next) list.tabIndex = -1;
141
+ (next || list).focus({ preventScroll: true });
142
+ }
143
+ }
144
+
145
+ document.addEventListener("click", (e) => {
146
+ const b = el(e)?.closest("[data-asta-decide]");
147
+ const card = b?.closest(".asta-tool-approval-card");
148
+ if (!card || b.disabled) return;
149
+ decide(card, b.getAttribute("data-asta-decide"));
150
+ });
151
+
152
+ document.addEventListener("keydown", (e) => {
153
+ if (e.defaultPrevented || e.isComposing) return;
154
+ const t = el(e);
155
+ const card = t?.closest(".asta-tool-approval-card");
156
+ if (!card || t.closest("[data-asta-mpanel]")) return;
157
+ if (e.key === "Escape") {
158
+ e.preventDefault();
159
+ decide(card, "deny");
160
+ } else if (e.key === "Enter" && !t.closest("button,a,input,textarea,select,summary")) {
161
+ e.preventDefault();
162
+ decide(card, "once");
163
+ }
164
+ });
165
+
166
+ const init = () => {
167
+ run();
168
+ document.querySelectorAll("[data-asta-tool-approval]").forEach(sync);
169
+ };
170
+ document.addEventListener("htmx:load", () => document.querySelectorAll("[data-asta-tool-approval]").forEach(sync));
171
+ if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init, { once: true });
172
+ else init();
173
+ })();
@@ -0,0 +1,79 @@
1
+ /* Assist: model picker, citations, trace waterfall, prompt composer.
2
+ * Only what Tailwind classes can't express. Motion is transform and opacity only, with the kit's easing. */
3
+
4
+ @keyframes asta-assist-in { from { opacity: 0; transform: translateY(var(--asta-assist-y, 4px)) scale(0.98) } }
5
+ @keyframes asta-assist-rise { from { opacity: 0; transform: translateY(6px) } }
6
+ @keyframes asta-trace-grow { from { transform: translateX(var(--x, 0%)) scaleX(0) } }
7
+ @keyframes asta-trace-run { 50% { opacity: 0.45 } }
8
+ @keyframes asta-prompt-orbit { to { transform: translate(-50%, -50%) rotate(1turn) } }
9
+
10
+ /* ---------- Model picker: the popup and its marks ---------- */
11
+
12
+ .asta-model-picker-panel:not([hidden]) {
13
+ animation: asta-assist-in 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
14
+ }
15
+ .asta-model-picker-top .asta-model-picker-panel { --asta-assist-y: -4px; }
16
+ .asta-model-picker-mark,
17
+ .asta-model-picker-bar { will-change: transform; }
18
+
19
+ /* ---------- Citations: card pops in, the expanded list rises ---------- */
20
+
21
+ .asta-citations-card:not([hidden]) {
22
+ animation: asta-assist-in 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
23
+ }
24
+ .asta-citations-card[data-below] { --asta-assist-y: -4px; }
25
+ .asta-citations[data-expanded] .asta-citations-list > li {
26
+ animation: asta-assist-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
27
+ }
28
+ .asta-citations[data-expanded] .asta-citations-list > li:nth-child(2) { animation-delay: 30ms; }
29
+ .asta-citations[data-expanded] .asta-citations-list > li:nth-child(3) { animation-delay: 60ms; }
30
+ .asta-citations[data-expanded] .asta-citations-list > li:nth-child(4) { animation-delay: 90ms; }
31
+ .asta-citations[data-expanded] .asta-citations-list > li:nth-child(n + 5) { animation-delay: 120ms; }
32
+
33
+ /* ---------- Trace waterfall: bars grow in from the left, running spans breathe ---------- */
34
+
35
+ .asta-trace-bar {
36
+ transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
37
+ animation: asta-trace-grow 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
38
+ }
39
+ .asta-trace-bar[data-running] {
40
+ animation: asta-trace-grow 0.6s cubic-bezier(0.16, 1, 0.3, 1) both, asta-trace-run 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.6s infinite;
41
+ }
42
+ .asta-trace:is([data-offscreen], [data-paused]) .asta-trace-bar[data-running] { animation-play-state: running, paused; }
43
+ .asta-trace-detail[data-fresh] {
44
+ animation: asta-assist-rise 0.35s cubic-bezier(0.16, 1, 0.3, 1);
45
+ }
46
+ .asta-trace-row[hidden] { display: none; }
47
+
48
+ /* ---------- Prompt composer: a band of light orbits the border while it works ---------- */
49
+
50
+ .asta-prompt-ring {
51
+ -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
52
+ -webkit-mask-composite: xor;
53
+ mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
54
+ }
55
+ .asta-prompt[data-running] .asta-prompt-spin {
56
+ animation: asta-prompt-orbit 2.6s linear infinite;
57
+ }
58
+ .asta-prompt:is([data-offscreen], [data-paused]) .asta-prompt-spin { animation-play-state: paused; }
59
+ .asta-prompt-menu:not([hidden]) {
60
+ animation: asta-assist-in 0.14s cubic-bezier(0.16, 1, 0.3, 1) both;
61
+ }
62
+ .asta-prompt-menu [hidden] { display: none; }
63
+ .asta-prompt-file {
64
+ animation: asta-assist-rise 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
65
+ }
66
+
67
+ @media (prefers-reduced-motion: reduce) {
68
+ .asta-model-picker-panel:not([hidden]),
69
+ .asta-citations-card:not([hidden]),
70
+ .asta-citations[data-expanded] .asta-citations-list > li,
71
+ .asta-trace-bar,
72
+ .asta-trace-detail[data-fresh],
73
+ .asta-prompt-menu:not([hidden]),
74
+ .asta-prompt-file { animation: none; }
75
+ .asta-model-picker-mark,
76
+ .asta-model-picker-bar { transition: none !important; }
77
+ /* A still brand ring instead of the orbit. */
78
+ .asta-prompt[data-running] .asta-prompt-spin { animation: none; background: var(--brand); }
79
+ }