agent-ui-kit 0.1.0 → 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 +101 -96
- package/package.json +43 -40
- package/src/client.js +1 -1
- package/src/index.js +5 -1
package/README.md
CHANGED
|
@@ -1,96 +1,101 @@
|
|
|
1
|
-
# agent-ui-kit
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
1
|
+
# agent-ui-kit
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/agent-ui-kit)
|
|
4
|
+
[](https://github.com/arsen-ask-lx/agent-ui-kit/actions/workflows/ci.yml)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](package.json)
|
|
7
|
+
|
|
8
|
+
**Point at an element in your running app, say what is wrong — the note lands
|
|
9
|
+
in a file your coding agent reads.**
|
|
10
|
+
|
|
11
|
+
Between "this button here" and `Rail.tsx:69` somebody has to build a bridge.
|
|
12
|
+
Without one, every conversation about the UI is made of prose descriptions,
|
|
13
|
+
and prose is read two ways.
|
|
14
|
+
|
|
15
|
+
It is a Vite plugin: it lives in the dev server and there is
|
|
16
|
+
nothing to import in your source.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm i -D agent-ui-kit
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
// vite.config.js
|
|
24
|
+
import { defineConfig } from "vite";
|
|
25
|
+
import react from "@vitejs/plugin-react";
|
|
26
|
+
import { agentUiKit } from "agent-ui-kit";
|
|
27
|
+
|
|
28
|
+
export default defineConfig({
|
|
29
|
+
plugins: [react(), agentUiKit()],
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That is the whole installation. Hold **Alt** — the element under the cursor
|
|
34
|
+
lights up. Click — a field opens. Type, press **Enter**.
|
|
35
|
+
|
|
36
|
+
```markdown
|
|
37
|
+
## the channel list slides under the profile instead of scrolling
|
|
38
|
+
|
|
39
|
+
- **where:** `ChatScreen › Rail › RoomList › SidebarSection`
|
|
40
|
+
- **what:** `<button>` — «Channels»
|
|
41
|
+
- **classes:** `flex min-w-0 flex-1 items-center gap-1 rounded px-2.5 py-1 …`
|
|
42
|
+
- **page:** `/c/01a0814d-3bd0-708e-bed0-b1be60d2bbee`
|
|
43
|
+
- **when:** 2026-09-08 18:20:30
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Then you say to your agent: *"work through NOTES.md"*. The component chain
|
|
47
|
+
plus the class list is enough to find the source line with a single search.
|
|
48
|
+
|
|
49
|
+
## Why it is a file and not an MCP server
|
|
50
|
+
|
|
51
|
+
An MCP server would mean either the agent polling for notes or another daemon
|
|
52
|
+
to keep running. A file needs neither: the agent reads it when it looks, and
|
|
53
|
+
**any** agent can — Claude Code, Cursor, Codex, Copilot, or a human with
|
|
54
|
+
`git diff`. Nothing here is tied to one vendor.
|
|
55
|
+
|
|
56
|
+
You walk the screen and leave ten notes in a row; nobody should wait while
|
|
57
|
+
each one is processed. The file collects, the agent works through the list
|
|
58
|
+
afterwards.
|
|
59
|
+
|
|
60
|
+
## Options
|
|
61
|
+
|
|
62
|
+
```js
|
|
63
|
+
agentUiKit({
|
|
64
|
+
file: "NOTES.md", // where notes are collected
|
|
65
|
+
key: "alt", // "alt" | "ctrl" | "meta"
|
|
66
|
+
color: "#e5484d", // highlight colour
|
|
67
|
+
placeholder: "what is wrong? Enter — save, Esc — cancel",
|
|
68
|
+
route: "/__agent-ui-kit", // change only on a collision
|
|
69
|
+
})
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## What it reads off the element
|
|
73
|
+
|
|
74
|
+
- **the component chain** — pulled from React's own fibers on the DOM node
|
|
75
|
+
(`ChatScreen › Rail › RoomList`). React only, and only in dev;
|
|
76
|
+
- **tag, classes, `id`, `data-testid`, a little text** — for everything else
|
|
77
|
+
and for every other framework.
|
|
78
|
+
|
|
79
|
+
If no component names are found the note is still recorded, with the tag, the
|
|
80
|
+
classes and the text. Tooling that dies together with somebody else's
|
|
81
|
+
undocumented detail is worse than no tooling at all.
|
|
82
|
+
|
|
83
|
+
## Dev only
|
|
84
|
+
|
|
85
|
+
The plugin declares `apply: "serve"`. The client is injected by the dev
|
|
86
|
+
server as a virtual module, so there is nothing to import in your source and
|
|
87
|
+
nothing to remember to strip from a production build.
|
|
88
|
+
|
|
89
|
+
## Three things learned the hard way
|
|
90
|
+
|
|
91
|
+
They are in the source as comments, and they are why this is a package rather
|
|
92
|
+
than a snippet:
|
|
93
|
+
|
|
94
|
+
- **no `prompt()` / `confirm()`** — a native dialog freezes the page and
|
|
95
|
+
breaks any automation driving the browser from outside;
|
|
96
|
+
- **the modifier-click belongs to the plugin entirely** — otherwise a note
|
|
97
|
+
about a button also presses that button;
|
|
98
|
+
- **the field closes on click-outside, not on blur** — `blur` fires before
|
|
99
|
+
Enter gets a chance to run, and ate what was typed.
|
|
100
|
+
|
|
101
|
+
MIT.
|
package/package.json
CHANGED
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "agent-ui-kit",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Point at an element in your running app, say what is wrong — the note lands in a file your coding agent reads.",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"vite-plugin",
|
|
7
|
-
"ai",
|
|
8
|
-
"agent",
|
|
9
|
-
"feedback",
|
|
10
|
-
"annotate",
|
|
11
|
-
"claude",
|
|
12
|
-
"cursor",
|
|
13
|
-
"devtools"
|
|
14
|
-
],
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"type": "module",
|
|
17
|
-
"exports": {
|
|
18
|
-
".": {
|
|
19
|
-
"types": "./src/index.d.ts",
|
|
20
|
-
"default": "./src/index.js"
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"files": [
|
|
24
|
-
"src"
|
|
25
|
-
],
|
|
26
|
-
"engines": {
|
|
27
|
-
"node": ">=20"
|
|
28
|
-
},
|
|
29
|
-
"peerDependencies": {
|
|
30
|
-
"vite": ">=5"
|
|
31
|
-
},
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/arsen-ask-lx/agent-ui-kit.git"
|
|
35
|
-
},
|
|
36
|
-
"homepage": "https://github.com/arsen-ask-lx/agent-ui-kit#readme",
|
|
37
|
-
"bugs": {
|
|
38
|
-
"url": "https://github.com/arsen-ask-lx/agent-ui-kit/issues"
|
|
39
|
-
}
|
|
40
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "agent-ui-kit",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Point at an element in your running app, say what is wrong — the note lands in a file your coding agent reads.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"vite-plugin",
|
|
7
|
+
"ai",
|
|
8
|
+
"agent",
|
|
9
|
+
"feedback",
|
|
10
|
+
"annotate",
|
|
11
|
+
"claude",
|
|
12
|
+
"cursor",
|
|
13
|
+
"devtools"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./src/index.d.ts",
|
|
20
|
+
"default": "./src/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=20"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"vite": ">=5"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/arsen-ask-lx/agent-ui-kit.git"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/arsen-ask-lx/agent-ui-kit#readme",
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/arsen-ask-lx/agent-ui-kit/issues"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "node --test"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/src/client.js
CHANGED
package/src/index.js
CHANGED
|
@@ -95,7 +95,11 @@ export function agentUiKit(options = {}) {
|
|
|
95
95
|
placeholder: settings.placeholder,
|
|
96
96
|
route: settings.route,
|
|
97
97
|
};
|
|
98
|
-
|
|
98
|
+
// ⚠️ replaceAll, NOT replace. A single replace hits the first
|
|
99
|
+
// occurrence only — which was the comment above the declaration —
|
|
100
|
+
// and left the constant itself an undefined name, so the client
|
|
101
|
+
// threw a ReferenceError before the first click.
|
|
102
|
+
return source.replaceAll("__AGENT_UI_KIT_OPTIONS__", JSON.stringify(runtime));
|
|
99
103
|
},
|
|
100
104
|
|
|
101
105
|
// ⚠️ INJECTED BY THE PLUGIN, NOT IMPORTED BY THE HOST. One line in the
|