@2lab.ai/ui 0.0.0-stage → 0.2.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 (60) hide show
  1. package/README.md +55 -2
  2. package/dist/agent-inbox.js +1061 -0
  3. package/dist/agent-inbox.js.map +1 -0
  4. package/dist/agent-queue.js +1610 -0
  5. package/dist/agent-queue.js.map +1 -0
  6. package/dist/agent-run.js +859 -0
  7. package/dist/agent-run.js.map +1 -0
  8. package/dist/ai-answer.js +687 -0
  9. package/dist/ai-answer.js.map +1 -0
  10. package/dist/components/agent-inbox/agent-inbox.d.ts +158 -0
  11. package/dist/components/agent-inbox/index.d.ts +2 -0
  12. package/dist/components/agent-inbox/styles.d.ts +6 -0
  13. package/dist/components/agent-queue/agent-queue.d.ts +41 -0
  14. package/dist/components/agent-queue/index.d.ts +6 -0
  15. package/dist/components/agent-queue/logic.d.ts +261 -0
  16. package/dist/components/agent-queue/strings.d.ts +473 -0
  17. package/dist/components/agent-queue/styles.d.ts +8 -0
  18. package/dist/components/agent-run/agent-run.d.ts +273 -0
  19. package/dist/components/agent-run/index.d.ts +2 -0
  20. package/dist/components/agent-run/styles.d.ts +6 -0
  21. package/dist/components/ai-answer/ai-answer.d.ts +92 -0
  22. package/dist/components/ai-answer/index.d.ts +2 -0
  23. package/dist/components/ai-answer/styles.d.ts +2 -0
  24. package/dist/components/context-window/context-window.d.ts +156 -0
  25. package/dist/components/context-window/index.d.ts +2 -0
  26. package/dist/components/context-window/styles.d.ts +2 -0
  27. package/dist/components/memory-panel/index.d.ts +2 -0
  28. package/dist/components/memory-panel/memory-panel.d.ts +101 -0
  29. package/dist/components/memory-panel/styles.d.ts +2 -0
  30. package/dist/components/model-picker/index.d.ts +2 -0
  31. package/dist/components/model-picker/model-picker.d.ts +136 -0
  32. package/dist/components/model-picker/morph.d.ts +9 -0
  33. package/dist/components/model-picker/styles.d.ts +6 -0
  34. package/dist/components/tool-call-card/index.d.ts +7 -0
  35. package/dist/components/tool-call-card/logic.d.ts +87 -0
  36. package/dist/components/tool-call-card/strings.d.ts +94 -0
  37. package/dist/components/tool-call-card/styles.d.ts +5 -0
  38. package/dist/components/tool-call-card/tool-call-card.d.ts +49 -0
  39. package/dist/components/tool-call-card/tool-call-group.d.ts +32 -0
  40. package/dist/context-window.js +384 -0
  41. package/dist/context-window.js.map +1 -0
  42. package/dist/core/element.d.ts +41 -0
  43. package/dist/core/format.d.ts +14 -0
  44. package/dist/core/html.d.ts +10 -0
  45. package/dist/core/tokens.d.ts +14 -0
  46. package/dist/format-BBGWXPzk.js +51 -0
  47. package/dist/format-BBGWXPzk.js.map +1 -0
  48. package/dist/html-elD6Bb_u.js +175 -0
  49. package/dist/html-elD6Bb_u.js.map +1 -0
  50. package/dist/index.d.ts +16 -0
  51. package/dist/index.js +129 -0
  52. package/dist/index.js.map +1 -0
  53. package/dist/memory-panel.js +1255 -0
  54. package/dist/memory-panel.js.map +1 -0
  55. package/dist/model-picker.js +858 -0
  56. package/dist/model-picker.js.map +1 -0
  57. package/dist/tokens.css +4 -0
  58. package/dist/tool-call-card.js +1046 -0
  59. package/dist/tool-call-card.js.map +1 -0
  60. package/package.json +79 -4
package/README.md CHANGED
@@ -1,3 +1,56 @@
1
- # Temporary Holding Version
1
+ # @2lab.ai/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Agent UI components from the 2lab soma-work dashboard, as **Web Components** with zero runtime dependencies.
4
+
5
+ **Demo & docs: https://ui.2lab.ai**
6
+
7
+ | Component | Tag | What it tells you |
8
+ |---|---|---|
9
+ | Agent Run (screen) | `<ui-agent-run>` | What the agent is doing now, its plan, and what it needs from you |
10
+ | Agent Inbox | `<ui-agent-inbox>` | Which runs need you, which are running, which are done |
11
+ | AI Answer | `<ui-ai-answer>` | The answer, the links in it, copy, response time |
12
+ | Tool Call Card | `<ui-tool-call-card>`, `<ui-tool-call-group>` | What the agent called, with what, what came back, and how long it took |
13
+ | Agent Queue | `<ui-agent-queue>` | Provider capacity, rate limits, and the scheduled-job lane |
14
+ | Context Window | `<ui-context-window>` | How full the context is and how far auto-compaction is |
15
+ | Memory Panel | `<ui-memory-panel>` | What the agent remembers about you — search, edit, delete with undo |
16
+ | Model Picker | `<ui-model-picker>` | Which model and effort to run, with window, compaction and price |
17
+
18
+ ## Install
19
+
20
+ ```
21
+ npm i @2lab.ai/ui
22
+ ```
23
+ ```js
24
+ import '@2lab.ai/ui'; // registers every element
25
+ import '@2lab.ai/ui/context-window'; // or just one
26
+ import '@2lab.ai/ui/tokens.css'; // optional page tokens (data-theme="dark" switches)
27
+ ```
28
+ No build step: `<script type="module" src="https://ui.2lab.ai/lib/index.js"></script>`.
29
+
30
+ ## Use
31
+ ```html
32
+ <ui-context-window lang="en"></ui-context-window>
33
+ <script type="module">
34
+ const el = document.querySelector('ui-context-window');
35
+ el.data = { window: 1_000_000, autoCompactAt: 750_000, parts: { cacheRead: 272300, output: 10 }, canCompact: true };
36
+ el.addEventListener('ui-compact', async () => {
37
+ el.data = { ...el.data, compactState: 'sending' }; // assign a new object — in-place mutation does not re-render
38
+ await fetch('/compact', { method: 'POST' });
39
+ el.data = { ...el.data, compactState: 'sent' };
40
+ });
41
+ </script>
42
+ ```
43
+ Data in (`el.data = {...}` — always assign a new object), events out (`ui-*`, bubbling + composed). Elements never fetch. English by default, Korean with
44
+ `lang="ko"`. Light/dark follow the OS, `theme="light|dark"` pins one, `--ui-*` custom properties theme a page.
45
+
46
+ ## Develop
47
+ ```
48
+ npm i
49
+ npm run dev # demo site with live reload
50
+ npm run verify # biome · tsc · vitest · lib + site build
51
+ ```
52
+ See `AGENTS.md` for the component contract.
53
+
54
+ ## Credits
55
+ Interaction patterns were studied from [affectUI](https://www.affectui.com) and re-implemented for the soma-work dashboard's
56
+ own data. No affectUI code or assets are included.