@signal9/era-ui 2.1.0 → 2.3.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.
Files changed (213) hide show
  1. package/dist/ai/actions/action.svelte +41 -0
  2. package/dist/ai/actions/action.svelte.d.ts +12 -0
  3. package/dist/ai/actions/actions.svelte +15 -0
  4. package/dist/ai/actions/actions.svelte.d.ts +8 -0
  5. package/dist/ai/actions/index.d.ts +2 -0
  6. package/dist/ai/actions/index.js +2 -0
  7. package/dist/ai/artifact/artifact-actions.svelte +7 -0
  8. package/dist/ai/artifact/artifact-actions.svelte.d.ts +8 -0
  9. package/dist/ai/artifact/artifact-close.svelte +9 -0
  10. package/dist/ai/artifact/artifact-close.svelte.d.ts +6 -0
  11. package/dist/ai/artifact/artifact-content.svelte +7 -0
  12. package/dist/ai/artifact/artifact-content.svelte.d.ts +8 -0
  13. package/dist/ai/artifact/artifact-description.svelte +7 -0
  14. package/dist/ai/artifact/artifact-description.svelte.d.ts +8 -0
  15. package/dist/ai/artifact/artifact-header.svelte +16 -0
  16. package/dist/ai/artifact/artifact-header.svelte.d.ts +8 -0
  17. package/dist/ai/artifact/artifact-title.svelte +7 -0
  18. package/dist/ai/artifact/artifact-title.svelte.d.ts +8 -0
  19. package/dist/ai/artifact/artifact.svelte +16 -0
  20. package/dist/ai/artifact/artifact.svelte.d.ts +8 -0
  21. package/dist/ai/artifact/index.d.ts +8 -0
  22. package/dist/ai/artifact/index.js +8 -0
  23. package/dist/ai/chain-of-thought/chain-of-thought-step.svelte +39 -0
  24. package/dist/ai/chain-of-thought/chain-of-thought-step.svelte.d.ts +11 -0
  25. package/dist/ai/chain-of-thought/chain-of-thought.svelte +30 -0
  26. package/dist/ai/chain-of-thought/chain-of-thought.svelte.d.ts +11 -0
  27. package/dist/ai/chain-of-thought/index.d.ts +3 -0
  28. package/dist/ai/chain-of-thought/index.js +3 -0
  29. package/dist/ai/checkpoint.svelte +27 -0
  30. package/dist/ai/checkpoint.svelte.d.ts +10 -0
  31. package/dist/ai/confirmation/confirmation-actions.svelte +9 -0
  32. package/dist/ai/confirmation/confirmation-actions.svelte.d.ts +8 -0
  33. package/dist/ai/confirmation/confirmation.svelte +36 -0
  34. package/dist/ai/confirmation/confirmation.svelte.d.ts +11 -0
  35. package/dist/ai/confirmation/index.d.ts +2 -0
  36. package/dist/ai/confirmation/index.js +2 -0
  37. package/dist/ai/context/context.svelte +49 -0
  38. package/dist/ai/context/context.svelte.d.ts +9 -0
  39. package/dist/ai/context/index.d.ts +1 -0
  40. package/dist/ai/context/index.js +1 -0
  41. package/dist/ai/conversation/context.d.ts +3 -0
  42. package/dist/ai/conversation/context.js +12 -0
  43. package/dist/ai/conversation/conversation-content.svelte +32 -0
  44. package/dist/ai/conversation/conversation-content.svelte.d.ts +8 -0
  45. package/dist/ai/conversation/conversation-empty-state.svelte +32 -0
  46. package/dist/ai/conversation/conversation-empty-state.svelte.d.ts +11 -0
  47. package/dist/ai/conversation/conversation-scroll-button.svelte +27 -0
  48. package/dist/ai/conversation/conversation-scroll-button.svelte.d.ts +6 -0
  49. package/dist/ai/conversation/conversation.svelte +21 -0
  50. package/dist/ai/conversation/conversation.svelte.d.ts +8 -0
  51. package/dist/ai/conversation/index.d.ts +5 -0
  52. package/dist/ai/conversation/index.js +5 -0
  53. package/dist/ai/copy-button.svelte +42 -0
  54. package/dist/ai/copy-button.svelte.d.ts +8 -0
  55. package/dist/ai/image.svelte +19 -0
  56. package/dist/ai/image.svelte.d.ts +8 -0
  57. package/dist/ai/index.d.ts +29 -0
  58. package/dist/ai/index.js +31 -0
  59. package/dist/ai/inline-citation/index.d.ts +1 -0
  60. package/dist/ai/inline-citation/index.js +1 -0
  61. package/dist/ai/inline-citation/inline-citation.svelte +66 -0
  62. package/dist/ai/inline-citation/inline-citation.svelte.d.ts +11 -0
  63. package/dist/ai/loader.svelte +8 -0
  64. package/dist/ai/loader.svelte.d.ts +6 -0
  65. package/dist/ai/message/branch.svelte.d.ts +10 -0
  66. package/dist/ai/message/branch.svelte.js +28 -0
  67. package/dist/ai/message/context.d.ts +6 -0
  68. package/dist/ai/message/context.js +1 -0
  69. package/dist/ai/message/index.d.ts +8 -0
  70. package/dist/ai/message/index.js +7 -0
  71. package/dist/ai/message/message-branch-content.svelte +24 -0
  72. package/dist/ai/message/message-branch-content.svelte.d.ts +10 -0
  73. package/dist/ai/message/message-branch-selector.svelte +25 -0
  74. package/dist/ai/message/message-branch-selector.svelte.d.ts +6 -0
  75. package/dist/ai/message/message-branch.svelte +25 -0
  76. package/dist/ai/message/message-branch.svelte.d.ts +9 -0
  77. package/dist/ai/message/message-content.svelte +24 -0
  78. package/dist/ai/message/message-content.svelte.d.ts +8 -0
  79. package/dist/ai/message/message-toolbar.svelte +23 -0
  80. package/dist/ai/message/message-toolbar.svelte.d.ts +8 -0
  81. package/dist/ai/message/message.svelte +27 -0
  82. package/dist/ai/message/message.svelte.d.ts +10 -0
  83. package/dist/ai/model-selector/index.d.ts +1 -0
  84. package/dist/ai/model-selector/index.js +1 -0
  85. package/dist/ai/model-selector/model-selector.svelte +61 -0
  86. package/dist/ai/model-selector/model-selector.svelte.d.ts +15 -0
  87. package/dist/ai/open-in-chat/index.d.ts +1 -0
  88. package/dist/ai/open-in-chat/index.js +1 -0
  89. package/dist/ai/open-in-chat/open-in-chat.svelte +41 -0
  90. package/dist/ai/open-in-chat/open-in-chat.svelte.d.ts +32 -0
  91. package/dist/ai/plan/index.d.ts +3 -0
  92. package/dist/ai/plan/index.js +3 -0
  93. package/dist/ai/plan/plan-content.svelte +13 -0
  94. package/dist/ai/plan/plan-content.svelte.d.ts +8 -0
  95. package/dist/ai/plan/plan-header.svelte +22 -0
  96. package/dist/ai/plan/plan-header.svelte.d.ts +9 -0
  97. package/dist/ai/plan/plan.svelte +23 -0
  98. package/dist/ai/plan/plan.svelte.d.ts +10 -0
  99. package/dist/ai/prompt-input/attachments.svelte.d.ts +27 -0
  100. package/dist/ai/prompt-input/attachments.svelte.js +60 -0
  101. package/dist/ai/prompt-input/index.d.ts +7 -0
  102. package/dist/ai/prompt-input/index.js +7 -0
  103. package/dist/ai/prompt-input/prompt-input-add-attachments.svelte +12 -0
  104. package/dist/ai/prompt-input/prompt-input-add-attachments.svelte.d.ts +6 -0
  105. package/dist/ai/prompt-input/prompt-input-attachments.svelte +40 -0
  106. package/dist/ai/prompt-input/prompt-input-attachments.svelte.d.ts +18 -0
  107. package/dist/ai/prompt-input/prompt-input-submit.svelte +49 -0
  108. package/dist/ai/prompt-input/prompt-input-submit.svelte.d.ts +10 -0
  109. package/dist/ai/prompt-input/prompt-input-textarea.svelte +57 -0
  110. package/dist/ai/prompt-input/prompt-input-textarea.svelte.d.ts +7 -0
  111. package/dist/ai/prompt-input/prompt-input-toolbar.svelte +15 -0
  112. package/dist/ai/prompt-input/prompt-input-toolbar.svelte.d.ts +8 -0
  113. package/dist/ai/prompt-input/prompt-input.svelte +98 -0
  114. package/dist/ai/prompt-input/prompt-input.svelte.d.ts +17 -0
  115. package/dist/ai/queue/index.d.ts +2 -0
  116. package/dist/ai/queue/index.js +2 -0
  117. package/dist/ai/queue/queue-item.svelte +26 -0
  118. package/dist/ai/queue/queue-item.svelte.d.ts +9 -0
  119. package/dist/ai/queue/queue.svelte +14 -0
  120. package/dist/ai/queue/queue.svelte.d.ts +8 -0
  121. package/dist/ai/reasoning/index.d.ts +3 -0
  122. package/dist/ai/reasoning/index.js +3 -0
  123. package/dist/ai/reasoning/reasoning-trigger.svelte +22 -0
  124. package/dist/ai/reasoning/reasoning-trigger.svelte.d.ts +9 -0
  125. package/dist/ai/reasoning/reasoning.svelte +52 -0
  126. package/dist/ai/reasoning/reasoning.svelte.d.ts +13 -0
  127. package/dist/ai/response/index.d.ts +2 -0
  128. package/dist/ai/response/index.js +2 -0
  129. package/dist/ai/response/repair.d.ts +7 -0
  130. package/dist/ai/response/repair.js +26 -0
  131. package/dist/ai/response/response.svelte +112 -0
  132. package/dist/ai/response/response.svelte.d.ts +10 -0
  133. package/dist/ai/shimmer.svelte +15 -0
  134. package/dist/ai/shimmer.svelte.d.ts +9 -0
  135. package/dist/ai/sources/index.d.ts +4 -0
  136. package/dist/ai/sources/index.js +4 -0
  137. package/dist/ai/sources/source.svelte +16 -0
  138. package/dist/ai/sources/source.svelte.d.ts +7 -0
  139. package/dist/ai/sources/sources-trigger.svelte +12 -0
  140. package/dist/ai/sources/sources-trigger.svelte.d.ts +8 -0
  141. package/dist/ai/sources/sources.svelte +15 -0
  142. package/dist/ai/sources/sources.svelte.d.ts +9 -0
  143. package/dist/ai/stick-to-bottom.svelte.d.ts +38 -0
  144. package/dist/ai/stick-to-bottom.svelte.js +133 -0
  145. package/dist/ai/suggestion/index.d.ts +2 -0
  146. package/dist/ai/suggestion/index.js +2 -0
  147. package/dist/ai/suggestion/suggestion.svelte +25 -0
  148. package/dist/ai/suggestion/suggestion.svelte.d.ts +10 -0
  149. package/dist/ai/suggestion/suggestions.svelte +18 -0
  150. package/dist/ai/suggestion/suggestions.svelte.d.ts +8 -0
  151. package/dist/ai/task/index.d.ts +5 -0
  152. package/dist/ai/task/index.js +5 -0
  153. package/dist/ai/task/task-content.svelte +14 -0
  154. package/dist/ai/task/task-content.svelte.d.ts +8 -0
  155. package/dist/ai/task/task-item-file.svelte +8 -0
  156. package/dist/ai/task/task-item-file.svelte.d.ts +7 -0
  157. package/dist/ai/task/task-item.svelte +8 -0
  158. package/dist/ai/task/task-item.svelte.d.ts +8 -0
  159. package/dist/ai/task/task-trigger.svelte +12 -0
  160. package/dist/ai/task/task-trigger.svelte.d.ts +8 -0
  161. package/dist/ai/task/task.svelte +17 -0
  162. package/dist/ai/task/task.svelte.d.ts +11 -0
  163. package/dist/ai/tool/index.d.ts +5 -0
  164. package/dist/ai/tool/index.js +5 -0
  165. package/dist/ai/tool/tool-header.svelte +20 -0
  166. package/dist/ai/tool/tool-header.svelte.d.ts +9 -0
  167. package/dist/ai/tool/tool-input.svelte +10 -0
  168. package/dist/ai/tool/tool-input.svelte.d.ts +6 -0
  169. package/dist/ai/tool/tool-output.svelte +20 -0
  170. package/dist/ai/tool/tool-output.svelte.d.ts +7 -0
  171. package/dist/ai/tool/tool.svelte +41 -0
  172. package/dist/ai/tool/tool.svelte.d.ts +12 -0
  173. package/dist/ai/web-preview/index.d.ts +1 -0
  174. package/dist/ai/web-preview/index.js +1 -0
  175. package/dist/ai/web-preview/web-preview.svelte +48 -0
  176. package/dist/ai/web-preview/web-preview.svelte.d.ts +8 -0
  177. package/dist/ai/workflow/canvas.svelte +19 -0
  178. package/dist/ai/workflow/canvas.svelte.d.ts +11 -0
  179. package/dist/ai/workflow/index.d.ts +2 -0
  180. package/dist/ai/workflow/index.js +2 -0
  181. package/dist/ai/workflow/node.svelte +27 -0
  182. package/dist/ai/workflow/node.svelte.d.ts +9 -0
  183. package/dist/era-ui.css +1 -1
  184. package/dist/generated-docs/llms-full.txt +56 -0
  185. package/dist/generated-docs/llms.txt +1 -1
  186. package/dist/generated-docs/manifest.json +14 -0
  187. package/dist/generated-docs/step.md +51 -0
  188. package/dist/index.d.ts +1 -0
  189. package/dist/index.js +1 -0
  190. package/dist/os/motion.d.ts +1 -19
  191. package/dist/os/motion.js +3 -44
  192. package/dist/os/taskbar.svelte +6 -3
  193. package/dist/styles/index.css +26 -0
  194. package/dist/ui/command-bar/command-bar.svelte +8 -6
  195. package/dist/ui/index.d.ts +1 -0
  196. package/dist/ui/index.js +1 -0
  197. package/dist/ui/step/context.d.ts +8 -0
  198. package/dist/ui/step/context.js +8 -0
  199. package/dist/ui/step/index.d.ts +5 -0
  200. package/dist/ui/step/index.js +4 -0
  201. package/dist/ui/step/step-content.svelte +55 -0
  202. package/dist/ui/step/step-content.svelte.d.ts +5 -0
  203. package/dist/ui/step/step-root.svelte +31 -0
  204. package/dist/ui/step/step-root.svelte.d.ts +9 -0
  205. package/dist/ui/step/step-section.svelte +23 -0
  206. package/dist/ui/step/step-section.svelte.d.ts +10 -0
  207. package/dist/ui/step/step-summary.svelte +55 -0
  208. package/dist/ui/step/step-summary.svelte.d.ts +5 -0
  209. package/dist/utils/index.d.ts +1 -0
  210. package/dist/utils/index.js +1 -0
  211. package/dist/utils/motion.d.ts +19 -0
  212. package/dist/utils/motion.js +44 -0
  213. package/package.json +14 -1
@@ -0,0 +1,133 @@
1
+ /**
2
+ * The stick-to-bottom contract, distilled from the reference implementations
3
+ * (use-stick-to-bottom, open-webui, vercel/ai-elements):
4
+ *
5
+ * - auto-follow content growth while pinned to the bottom;
6
+ * - ANY user-initiated upward intent breaks the pin instantly (wheel up,
7
+ * touch drag, PageUp/ArrowUp/Home, or a scroll event that moved up and
8
+ * wasn't ours);
9
+ * - scrolling back to within `threshold` px of the bottom re-pins;
10
+ * - content growth is watched with a ResizeObserver on the CONTENT (scroll
11
+ * events alone miss it — images, code blocks, expanding steps), and the
12
+ * scroll events a resize provokes are guarded so a reflow never reads as
13
+ * the user scrolling away;
14
+ * - an active text selection inside the viewport suspends following (never
15
+ * yank text out from under a selecting user);
16
+ * - scrolling is a direct scrollTop write on the container, coalesced through
17
+ * rAF — never scrollIntoView (it scrolls ancestors too).
18
+ *
19
+ * CSS `overflow-anchor` and `column-reverse` are deliberately not used: no
20
+ * Safari support for the former; reversed DOM order breaks screen readers,
21
+ * selection, and `role="log"` semantics for the latter.
22
+ */
23
+ export class StickToBottom {
24
+ /** True while auto-following. Reactive — drive the ↓ button off it. */
25
+ pinned = $state(true);
26
+ /** Px from the bottom still considered "at bottom" for re-pinning. */
27
+ threshold = 70;
28
+ #el = null;
29
+ #lastTop = 0;
30
+ #programmatic = 0;
31
+ #resizeGuard = 0;
32
+ #raf = 0;
33
+ /** Attach to the scroll container (`overflow-y-auto`). */
34
+ viewport = (el) => {
35
+ this.#el = el;
36
+ this.#lastTop = el.scrollTop;
37
+ const unpin = () => (this.pinned = false);
38
+ const onWheel = (e) => {
39
+ if (e.deltaY < 0)
40
+ unpin();
41
+ };
42
+ const onTouchMove = () => {
43
+ // A touch drag is user intent; if it lands near the bottom the
44
+ // scroll handler re-pins right after.
45
+ if (!this.#nearBottom())
46
+ unpin();
47
+ };
48
+ const onKeyDown = (e) => {
49
+ if (e.key === 'PageUp' || e.key === 'ArrowUp' || e.key === 'Home')
50
+ unpin();
51
+ };
52
+ const onScroll = () => {
53
+ const top = el.scrollTop;
54
+ const wasOurs = this.#programmatic > 0 || this.#resizeGuard > 0;
55
+ if (!wasOurs) {
56
+ if (top < this.#lastTop - 1)
57
+ unpin();
58
+ else if (this.#nearBottom())
59
+ this.pinned = true;
60
+ }
61
+ this.#lastTop = top;
62
+ };
63
+ const onScrollEnd = () => {
64
+ this.#programmatic = 0;
65
+ };
66
+ el.addEventListener('wheel', onWheel, { passive: true });
67
+ el.addEventListener('touchmove', onTouchMove, { passive: true });
68
+ el.addEventListener('keydown', onKeyDown);
69
+ el.addEventListener('scroll', onScroll, { passive: true });
70
+ el.addEventListener('scrollend', onScrollEnd);
71
+ return () => {
72
+ el.removeEventListener('wheel', onWheel);
73
+ el.removeEventListener('touchmove', onTouchMove);
74
+ el.removeEventListener('keydown', onKeyDown);
75
+ el.removeEventListener('scroll', onScroll);
76
+ el.removeEventListener('scrollend', onScrollEnd);
77
+ if (this.#el === el)
78
+ this.#el = null;
79
+ };
80
+ };
81
+ /** Attach to the content wrapper INSIDE the viewport. */
82
+ content = (el) => {
83
+ const ro = new ResizeObserver(() => {
84
+ if (!this.#el)
85
+ return;
86
+ // Guard the scroll events this resize provokes for two frames so a
87
+ // code-block reflow never reads as the user scrolling away.
88
+ this.#resizeGuard++;
89
+ if (this.pinned && !this.#selecting())
90
+ this.scrollToBottom();
91
+ requestAnimationFrame(() => requestAnimationFrame(() => {
92
+ this.#resizeGuard = Math.max(0, this.#resizeGuard - 1);
93
+ }));
94
+ });
95
+ ro.observe(el);
96
+ return () => ro.disconnect();
97
+ };
98
+ #nearBottom() {
99
+ const el = this.#el;
100
+ if (!el)
101
+ return true;
102
+ return el.scrollHeight - el.scrollTop - el.clientHeight <= this.threshold;
103
+ }
104
+ #selecting() {
105
+ if (typeof window === 'undefined')
106
+ return false;
107
+ const sel = window.getSelection();
108
+ return !!sel && !sel.isCollapsed && this.#el?.contains(sel.anchorNode) === true;
109
+ }
110
+ /** Jump the viewport to the bottom (rAF-coalesced; safe to call per token). */
111
+ scrollToBottom() {
112
+ if (this.#raf)
113
+ return;
114
+ this.#raf = requestAnimationFrame(() => {
115
+ this.#raf = 0;
116
+ const el = this.#el;
117
+ if (!el)
118
+ return;
119
+ this.#programmatic++;
120
+ el.scrollTop = el.scrollHeight;
121
+ // scrollend clears the flag; the double-rAF is the fallback for
122
+ // browsers that don't fire it.
123
+ requestAnimationFrame(() => requestAnimationFrame(() => {
124
+ this.#programmatic = Math.max(0, this.#programmatic - 1);
125
+ }));
126
+ });
127
+ }
128
+ /** The ↓ button's action: re-pin and go. */
129
+ repin() {
130
+ this.pinned = true;
131
+ this.scrollToBottom();
132
+ }
133
+ }
@@ -0,0 +1,2 @@
1
+ export { default as Root } from './suggestions.svelte';
2
+ export { default as Suggestion } from './suggestion.svelte';
@@ -0,0 +1,2 @@
1
+ export { default as Root } from './suggestions.svelte';
2
+ export { default as Suggestion } from './suggestion.svelte';
@@ -0,0 +1,25 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { Button } from '../../ui/button/index.js';
4
+ import { cn } from '../../utils/index.js';
5
+
6
+ let {
7
+ suggestion,
8
+ onSelect,
9
+ children,
10
+ class: className
11
+ }: {
12
+ suggestion: string;
13
+ onSelect?: (suggestion: string) => void;
14
+ children?: Snippet;
15
+ class?: string;
16
+ } = $props();
17
+ </script>
18
+
19
+ <Button
20
+ size="sm"
21
+ class={cn('shrink-0 rounded-full', className)}
22
+ onclick={() => onSelect?.(suggestion)}
23
+ >
24
+ {#if children}{@render children()}{:else}{suggestion}{/if}
25
+ </Button>
@@ -0,0 +1,10 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ suggestion: string;
4
+ onSelect?: (suggestion: string) => void;
5
+ children?: Snippet;
6
+ class?: string;
7
+ };
8
+ declare const Suggestion: import("svelte").Component<$$ComponentProps, {}, "">;
9
+ type Suggestion = ReturnType<typeof Suggestion>;
10
+ export default Suggestion;
@@ -0,0 +1,18 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { HTMLAttributes } from 'svelte/elements';
4
+ import { cn } from '../../utils/index.js';
5
+
6
+ let {
7
+ children,
8
+ class: className,
9
+ ...restProps
10
+ }: HTMLAttributes<HTMLDivElement> & { children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <div
14
+ class={cn('scrollbar-none flex w-full flex-nowrap items-center gap-(--era-gap) overflow-x-auto', className)}
15
+ {...restProps}
16
+ >
17
+ {@render children?.()}
18
+ </div>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAttributes } from 'svelte/elements';
3
+ type $$ComponentProps = HTMLAttributes<HTMLDivElement> & {
4
+ children?: Snippet;
5
+ };
6
+ declare const Suggestions: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type Suggestions = ReturnType<typeof Suggestions>;
8
+ export default Suggestions;
@@ -0,0 +1,5 @@
1
+ export { default as Root } from './task.svelte';
2
+ export { default as Trigger } from './task-trigger.svelte';
3
+ export { default as Content } from './task-content.svelte';
4
+ export { default as Item } from './task-item.svelte';
5
+ export { default as ItemFile } from './task-item-file.svelte';
@@ -0,0 +1,5 @@
1
+ export { default as Root } from './task.svelte';
2
+ export { default as Trigger } from './task-trigger.svelte';
3
+ export { default as Content } from './task-content.svelte';
4
+ export { default as Item } from './task-item.svelte';
5
+ export { default as ItemFile } from './task-item-file.svelte';
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import * as Step from '../../ui/step/index.js';
4
+ import { cn } from '../../utils/index.js';
5
+
6
+ let { children, class: className }: { children?: Snippet; class?: string } = $props();
7
+ </script>
8
+
9
+ <!-- The task log rail: items hang off a left border, terminal-trace style. -->
10
+ <Step.Content
11
+ class={cn('border-s-2 border-divider-faded bg-transparent p-0 ps-(--era-pad-sm) shadow-none', className)}
12
+ >
13
+ {@render children?.()}
14
+ </Step.Content>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ class?: string;
5
+ };
6
+ declare const TaskContent: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type TaskContent = ReturnType<typeof TaskContent>;
8
+ export default TaskContent;
@@ -0,0 +1,8 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { Chip } from '../../ui/chip/index.js';
4
+
5
+ let { children }: { children?: Snippet } = $props();
6
+ </script>
7
+
8
+ <Chip>{@render children?.()}</Chip>
@@ -0,0 +1,7 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ };
5
+ declare const TaskItemFile: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type TaskItemFile = ReturnType<typeof TaskItemFile>;
7
+ export default TaskItemFile;
@@ -0,0 +1,8 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { cn } from '../../utils/index.js';
4
+
5
+ let { children, class: className }: { children?: Snippet; class?: string } = $props();
6
+ </script>
7
+
8
+ <div class={cn('min-w-0 text-body text-muted', className)}>{@render children?.()}</div>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ children?: Snippet;
4
+ class?: string;
5
+ };
6
+ declare const TaskItem: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type TaskItem = ReturnType<typeof TaskItem>;
8
+ export default TaskItem;
@@ -0,0 +1,12 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import Search from '@lucide/svelte/icons/search';
4
+ import * as Step from '../../ui/step/index.js';
5
+
6
+ let { title, children }: { title?: string; children?: Snippet } = $props();
7
+ </script>
8
+
9
+ <Step.Summary>
10
+ <Search class="size-(--era-h-xs) shrink-0" aria-hidden="true" />
11
+ {#if children}{@render children()}{:else}{title}{/if}
12
+ </Step.Summary>
@@ -0,0 +1,8 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ title?: string;
4
+ children?: Snippet;
5
+ };
6
+ declare const TaskTrigger: import("svelte").Component<$$ComponentProps, {}, "">;
7
+ type TaskTrigger = ReturnType<typeof TaskTrigger>;
8
+ export default TaskTrigger;
@@ -0,0 +1,17 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import type { StepStatus } from '../../ui/step/index.js';
4
+ import * as Step from '../../ui/step/index.js';
5
+ import { cn } from '../../utils/index.js';
6
+
7
+ let {
8
+ open = $bindable(true),
9
+ status = 'done',
10
+ children,
11
+ class: className
12
+ }: { open?: boolean; status?: StepStatus; children?: Snippet; class?: string } = $props();
13
+ </script>
14
+
15
+ <Step.Root {status} bind:open class={cn(className)}>
16
+ {@render children?.()}
17
+ </Step.Root>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { StepStatus } from '../../ui/step/index.js';
3
+ type $$ComponentProps = {
4
+ open?: boolean;
5
+ status?: StepStatus;
6
+ children?: Snippet;
7
+ class?: string;
8
+ };
9
+ declare const Task: import("svelte").Component<$$ComponentProps, {}, "open">;
10
+ type Task = ReturnType<typeof Task>;
11
+ export default Task;
@@ -0,0 +1,5 @@
1
+ export { default as Root, type ToolState } from './tool.svelte';
2
+ export { default as Header } from './tool-header.svelte';
3
+ export { default as Input } from './tool-input.svelte';
4
+ export { default as Output } from './tool-output.svelte';
5
+ export { Content } from '../../ui/step/index.js';
@@ -0,0 +1,5 @@
1
+ export { default as Root } from './tool.svelte';
2
+ export { default as Header } from './tool-header.svelte';
3
+ export { default as Input } from './tool-input.svelte';
4
+ export { default as Output } from './tool-output.svelte';
5
+ export { Content } from '../../ui/step/index.js';
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import Wrench from '@lucide/svelte/icons/wrench';
4
+ import * as Step from '../../ui/step/index.js';
5
+
6
+ let {
7
+ type,
8
+ children
9
+ }: {
10
+ /** The tool name, e.g. `search_flights`. */
11
+ type: string;
12
+ children?: Snippet;
13
+ } = $props();
14
+ </script>
15
+
16
+ <Step.Summary>
17
+ <Wrench class="size-(--era-h-xs) shrink-0" aria-hidden="true" />
18
+ <span class="truncate text-fg">{type}</span>
19
+ {@render children?.()}
20
+ </Step.Summary>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ /** The tool name, e.g. `search_flights`. */
4
+ type: string;
5
+ children?: Snippet;
6
+ };
7
+ declare const ToolHeader: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type ToolHeader = ReturnType<typeof ToolHeader>;
9
+ export default ToolHeader;
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import * as Step from '../../ui/step/index.js';
3
+ import { CodeBlock } from '../../ui/code-block/index.js';
4
+
5
+ let { input }: { input: unknown } = $props();
6
+ </script>
7
+
8
+ <Step.Section label="input">
9
+ <CodeBlock code={JSON.stringify(input, null, 2)} />
10
+ </Step.Section>
@@ -0,0 +1,6 @@
1
+ type $$ComponentProps = {
2
+ input: unknown;
3
+ };
4
+ declare const ToolInput: import("svelte").Component<$$ComponentProps, {}, "">;
5
+ type ToolInput = ReturnType<typeof ToolInput>;
6
+ export default ToolInput;
@@ -0,0 +1,20 @@
1
+ <script lang="ts">
2
+ import * as Step from '../../ui/step/index.js';
3
+ import { CodeBlock } from '../../ui/code-block/index.js';
4
+
5
+ let { output, errorText }: { output?: unknown; errorText?: string } = $props();
6
+ </script>
7
+
8
+ {#if errorText}
9
+ <Step.Section label="error">
10
+ <p class="text-body text-destructive">{errorText}</p>
11
+ </Step.Section>
12
+ {:else if output !== undefined}
13
+ <Step.Section label="output">
14
+ {#if typeof output === 'string'}
15
+ <p class="text-body whitespace-pre-wrap text-muted">{output}</p>
16
+ {:else}
17
+ <CodeBlock code={JSON.stringify(output, null, 2)} />
18
+ {/if}
19
+ </Step.Section>
20
+ {/if}
@@ -0,0 +1,7 @@
1
+ type $$ComponentProps = {
2
+ output?: unknown;
3
+ errorText?: string;
4
+ };
5
+ declare const ToolOutput: import("svelte").Component<$$ComponentProps, {}, "">;
6
+ type ToolOutput = ReturnType<typeof ToolOutput>;
7
+ export default ToolOutput;
@@ -0,0 +1,41 @@
1
+ <script lang="ts" module>
2
+ /** AI-SDK tool part lifecycle. */
3
+ export type ToolState =
4
+ | 'input-streaming'
5
+ | 'input-available'
6
+ | 'output-available'
7
+ | 'output-error';
8
+ </script>
9
+
10
+ <script lang="ts">
11
+ import type { Snippet } from 'svelte';
12
+ import * as Step from '../../ui/step/index.js';
13
+ import { cn } from '../../utils/index.js';
14
+
15
+ let {
16
+ state: toolState = 'input-streaming',
17
+ open = $bindable(false),
18
+ children,
19
+ class: className
20
+ }: {
21
+ state?: ToolState;
22
+ open?: boolean;
23
+ children?: Snippet;
24
+ class?: string;
25
+ } = $props();
26
+
27
+ const status = $derived(
28
+ (
29
+ {
30
+ 'input-streaming': 'pending',
31
+ 'input-available': 'running',
32
+ 'output-available': 'done',
33
+ 'output-error': 'error'
34
+ } as const
35
+ )[toolState]
36
+ );
37
+ </script>
38
+
39
+ <Step.Root {status} bind:open class={cn(className)}>
40
+ {@render children?.()}
41
+ </Step.Root>
@@ -0,0 +1,12 @@
1
+ /** AI-SDK tool part lifecycle. */
2
+ export type ToolState = 'input-streaming' | 'input-available' | 'output-available' | 'output-error';
3
+ import type { Snippet } from 'svelte';
4
+ type $$ComponentProps = {
5
+ state?: ToolState;
6
+ open?: boolean;
7
+ children?: Snippet;
8
+ class?: string;
9
+ };
10
+ declare const Tool: import("svelte").Component<$$ComponentProps, {}, "open">;
11
+ type Tool = ReturnType<typeof Tool>;
12
+ export default Tool;
@@ -0,0 +1 @@
1
+ export { default as Root } from './web-preview.svelte';
@@ -0,0 +1 @@
1
+ export { default as Root } from './web-preview.svelte';
@@ -0,0 +1,48 @@
1
+ <script lang="ts">
2
+ import RotateCw from '@lucide/svelte/icons/rotate-cw';
3
+ import { Bar } from '../../ui/bar/index.js';
4
+ import { Button } from '../../ui/button/index.js';
5
+ import { Input } from '../../ui/input/index.js';
6
+ import { cn } from '../../utils/index.js';
7
+
8
+ let {
9
+ url = $bindable(''),
10
+ onUrlChange,
11
+ class: className
12
+ }: { url?: string; onUrlChange?: (url: string) => void; class?: string } = $props();
13
+
14
+ let draft = $derived(url);
15
+ let nonce = $state(0);
16
+ </script>
17
+
18
+ <div
19
+ class={cn(
20
+ 'flex min-h-0 flex-col overflow-hidden rounded-(--era-rd-lg) bg-(--era-surface-bg) shadow-(--era-shadow-lg)',
21
+ className
22
+ )}
23
+ >
24
+ <Bar size="md" class="shrink-0 rounded-none gap-(--era-gap)">
25
+ <Button icon size="sm" aria-label="Reload" onclick={() => (nonce += 1)}>
26
+ <RotateCw class="size-(--era-h-xs)" />
27
+ </Button>
28
+ <Input
29
+ bind:value={draft}
30
+ class="h-(--era-h-sm) flex-1"
31
+ placeholder="https://…"
32
+ onkeydown={(e: KeyboardEvent) => {
33
+ if (e.key === 'Enter') {
34
+ url = draft;
35
+ onUrlChange?.(url);
36
+ }
37
+ }}
38
+ />
39
+ </Bar>
40
+ {#key nonce}
41
+ <iframe
42
+ src={url}
43
+ title="Web preview"
44
+ sandbox="allow-scripts allow-same-origin allow-forms allow-popups"
45
+ class="min-h-0 w-full flex-1 border-0 bg-white"
46
+ ></iframe>
47
+ {/key}
48
+ </div>
@@ -0,0 +1,8 @@
1
+ type $$ComponentProps = {
2
+ url?: string;
3
+ onUrlChange?: (url: string) => void;
4
+ class?: string;
5
+ };
6
+ declare const WebPreview: import("svelte").Component<$$ComponentProps, {}, "url">;
7
+ type WebPreview = ReturnType<typeof WebPreview>;
8
+ export default WebPreview;
@@ -0,0 +1,19 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { SvelteFlow, Background, Controls, type Node, type Edge } from '@xyflow/svelte';
4
+ import '@xyflow/svelte/dist/style.css';
5
+
6
+ let {
7
+ nodes = $bindable([]),
8
+ edges = $bindable([]),
9
+ children
10
+ }: { nodes?: Node[]; edges?: Edge[]; children?: Snippet } = $props();
11
+ </script>
12
+
13
+ <!-- Thin era skin over Svelte Flow — the graph engine is xyflow's. This file
14
+ lives on its own subpath so the dependency stays opt-in. -->
15
+ <SvelteFlow bind:nodes bind:edges fitView class="rounded-(--era-rd-lg) shadow-(--era-shadow)">
16
+ <Background bgColor="var(--color-1)" />
17
+ <Controls />
18
+ {@render children?.()}
19
+ </SvelteFlow>
@@ -0,0 +1,11 @@
1
+ import type { Snippet } from 'svelte';
2
+ import { type Node, type Edge } from '@xyflow/svelte';
3
+ import '@xyflow/svelte/dist/style.css';
4
+ type $$ComponentProps = {
5
+ nodes?: Node[];
6
+ edges?: Edge[];
7
+ children?: Snippet;
8
+ };
9
+ declare const Canvas: import("svelte").Component<$$ComponentProps, {}, "nodes" | "edges">;
10
+ type Canvas = ReturnType<typeof Canvas>;
11
+ export default Canvas;
@@ -0,0 +1,2 @@
1
+ export { default as Canvas } from './canvas.svelte';
2
+ export { default as Node } from './node.svelte';
@@ -0,0 +1,2 @@
1
+ export { default as Canvas } from './canvas.svelte';
2
+ export { default as Node } from './node.svelte';
@@ -0,0 +1,27 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+ import { Handle, Position } from '@xyflow/svelte';
4
+ import { cn } from '../../utils/index.js';
5
+
6
+ let {
7
+ title,
8
+ children,
9
+ class: className
10
+ }: { title?: string; children?: Snippet; class?: string } = $props();
11
+ </script>
12
+
13
+ <div
14
+ class={cn(
15
+ 'flex w-56 flex-col overflow-hidden rounded-(--era-rd-md) bg-(--era-surface-bg-elevated) text-body shadow-(--era-shadow-lg)',
16
+ className
17
+ )}
18
+ >
19
+ <Handle type="target" position={Position.Left} />
20
+ {#if title}
21
+ <div class="flex h-(--era-h-md) items-center border-b border-divider-faded px-(--era-inset-md) font-medium text-bright">
22
+ {title}
23
+ </div>
24
+ {/if}
25
+ <div class="p-(--era-inset-md) text-fg">{@render children?.()}</div>
26
+ <Handle type="source" position={Position.Right} />
27
+ </div>
@@ -0,0 +1,9 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ title?: string;
4
+ children?: Snippet;
5
+ class?: string;
6
+ };
7
+ declare const Node: import("svelte").Component<$$ComponentProps, {}, "">;
8
+ type Node = ReturnType<typeof Node>;
9
+ export default Node;