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