@2lab.ai/ui 0.0.0-stage → 0.1.1

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 (52) hide show
  1. package/README.md +54 -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/context-window.js +384 -0
  35. package/dist/context-window.js.map +1 -0
  36. package/dist/core/element.d.ts +39 -0
  37. package/dist/core/format.d.ts +14 -0
  38. package/dist/core/html.d.ts +10 -0
  39. package/dist/core/tokens.d.ts +14 -0
  40. package/dist/format-BBGWXPzk.js +51 -0
  41. package/dist/format-BBGWXPzk.js.map +1 -0
  42. package/dist/html-DZWnrdcg.js +167 -0
  43. package/dist/html-DZWnrdcg.js.map +1 -0
  44. package/dist/index.d.ts +15 -0
  45. package/dist/index.js +116 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/memory-panel.js +1255 -0
  48. package/dist/memory-panel.js.map +1 -0
  49. package/dist/model-picker.js +858 -0
  50. package/dist/model-picker.js.map +1 -0
  51. package/dist/tokens.css +4 -0
  52. package/package.json +75 -4
package/README.md CHANGED
@@ -1,3 +1,55 @@
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
+ | Agent Queue | `<ui-agent-queue>` | Provider capacity, rate limits, and the scheduled-job lane |
13
+ | Context Window | `<ui-context-window>` | How full the context is and how far auto-compaction is |
14
+ | Memory Panel | `<ui-memory-panel>` | What the agent remembers about you — search, edit, delete with undo |
15
+ | Model Picker | `<ui-model-picker>` | Which model and effort to run, with window, compaction and price |
16
+
17
+ ## Install
18
+
19
+ ```
20
+ npm i @2lab.ai/ui
21
+ ```
22
+ ```js
23
+ import '@2lab.ai/ui'; // registers every element
24
+ import '@2lab.ai/ui/context-window'; // or just one
25
+ import '@2lab.ai/ui/tokens.css'; // optional page tokens (data-theme="dark" switches)
26
+ ```
27
+ No build step: `<script type="module" src="https://ui.2lab.ai/lib/index.js"></script>`.
28
+
29
+ ## Use
30
+ ```html
31
+ <ui-context-window lang="en"></ui-context-window>
32
+ <script type="module">
33
+ const el = document.querySelector('ui-context-window');
34
+ el.data = { window: 1_000_000, autoCompactAt: 750_000, parts: { cacheRead: 272300, output: 10 }, canCompact: true };
35
+ el.addEventListener('ui-compact', async () => {
36
+ el.data = { ...el.data, compactState: 'sending' }; // assign a new object — in-place mutation does not re-render
37
+ await fetch('/compact', { method: 'POST' });
38
+ el.data = { ...el.data, compactState: 'sent' };
39
+ });
40
+ </script>
41
+ ```
42
+ Data in (`el.data = {...}` — always assign a new object), events out (`ui-*`, bubbling + composed). Elements never fetch. English by default, Korean with
43
+ `lang="ko"`. Light/dark follow the OS, `theme="light|dark"` pins one, `--ui-*` custom properties theme a page.
44
+
45
+ ## Develop
46
+ ```
47
+ npm i
48
+ npm run dev # demo site with live reload
49
+ npm run verify # biome · tsc · vitest · lib + site build
50
+ ```
51
+ See `AGENTS.md` for the component contract.
52
+
53
+ ## Credits
54
+ Interaction patterns were studied from [affectUI](https://www.affectui.com) and re-implemented for the soma-work dashboard's
55
+ own data. No affectUI code or assets are included.