@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.
- package/README.md +54 -2
- package/dist/agent-inbox.js +1061 -0
- package/dist/agent-inbox.js.map +1 -0
- package/dist/agent-queue.js +1610 -0
- package/dist/agent-queue.js.map +1 -0
- package/dist/agent-run.js +859 -0
- package/dist/agent-run.js.map +1 -0
- package/dist/ai-answer.js +687 -0
- package/dist/ai-answer.js.map +1 -0
- package/dist/components/agent-inbox/agent-inbox.d.ts +158 -0
- package/dist/components/agent-inbox/index.d.ts +2 -0
- package/dist/components/agent-inbox/styles.d.ts +6 -0
- package/dist/components/agent-queue/agent-queue.d.ts +41 -0
- package/dist/components/agent-queue/index.d.ts +6 -0
- package/dist/components/agent-queue/logic.d.ts +261 -0
- package/dist/components/agent-queue/strings.d.ts +473 -0
- package/dist/components/agent-queue/styles.d.ts +8 -0
- package/dist/components/agent-run/agent-run.d.ts +273 -0
- package/dist/components/agent-run/index.d.ts +2 -0
- package/dist/components/agent-run/styles.d.ts +6 -0
- package/dist/components/ai-answer/ai-answer.d.ts +92 -0
- package/dist/components/ai-answer/index.d.ts +2 -0
- package/dist/components/ai-answer/styles.d.ts +2 -0
- package/dist/components/context-window/context-window.d.ts +156 -0
- package/dist/components/context-window/index.d.ts +2 -0
- package/dist/components/context-window/styles.d.ts +2 -0
- package/dist/components/memory-panel/index.d.ts +2 -0
- package/dist/components/memory-panel/memory-panel.d.ts +101 -0
- package/dist/components/memory-panel/styles.d.ts +2 -0
- package/dist/components/model-picker/index.d.ts +2 -0
- package/dist/components/model-picker/model-picker.d.ts +136 -0
- package/dist/components/model-picker/morph.d.ts +9 -0
- package/dist/components/model-picker/styles.d.ts +6 -0
- package/dist/context-window.js +384 -0
- package/dist/context-window.js.map +1 -0
- package/dist/core/element.d.ts +39 -0
- package/dist/core/format.d.ts +14 -0
- package/dist/core/html.d.ts +10 -0
- package/dist/core/tokens.d.ts +14 -0
- package/dist/format-BBGWXPzk.js +51 -0
- package/dist/format-BBGWXPzk.js.map +1 -0
- package/dist/html-DZWnrdcg.js +167 -0
- package/dist/html-DZWnrdcg.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +116 -0
- package/dist/index.js.map +1 -0
- package/dist/memory-panel.js +1255 -0
- package/dist/memory-panel.js.map +1 -0
- package/dist/model-picker.js +858 -0
- package/dist/model-picker.js.map +1 -0
- package/dist/tokens.css +4 -0
- package/package.json +75 -4
package/README.md
CHANGED
|
@@ -1,3 +1,55 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @2lab.ai/ui
|
|
2
2
|
|
|
3
|
-
|
|
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.
|