@agent-om/devtools 0.0.0-stage → 0.1.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.
- package/LICENSE +64 -0
- package/README.md +116 -2
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1964 -0
- package/dist/panel-CFh-FaQK.d.ts +20 -0
- package/dist/stub.d.ts +4 -0
- package/dist/stub.js +10 -0
- package/package.json +53 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Copyright 2026 Sumeet Debnath and Prathmesh Vhatkar
|
|
2
|
+
|
|
3
|
+
@agent-om/devtools is source-available, not open source. It is licensed under the
|
|
4
|
+
PolyForm Strict License 1.0.0, whose full text follows.
|
|
5
|
+
|
|
6
|
+
# PolyForm Strict License 1.0.0
|
|
7
|
+
|
|
8
|
+
<https://polyformproject.org/licenses/strict/1.0.0>
|
|
9
|
+
|
|
10
|
+
## Acceptance
|
|
11
|
+
|
|
12
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
13
|
+
|
|
14
|
+
## Copyright License
|
|
15
|
+
|
|
16
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose, other than distributing the software or making changes or new works based on the software.
|
|
17
|
+
|
|
18
|
+
## Patent License
|
|
19
|
+
|
|
20
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
21
|
+
|
|
22
|
+
## Noncommercial Purposes
|
|
23
|
+
|
|
24
|
+
Any noncommercial purpose is a permitted purpose.
|
|
25
|
+
|
|
26
|
+
## Personal Uses
|
|
27
|
+
|
|
28
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
29
|
+
|
|
30
|
+
## Noncommercial Organizations
|
|
31
|
+
|
|
32
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
33
|
+
|
|
34
|
+
## Fair Use
|
|
35
|
+
|
|
36
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
37
|
+
|
|
38
|
+
## No Other Rights
|
|
39
|
+
|
|
40
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
41
|
+
|
|
42
|
+
## Patent Defense
|
|
43
|
+
|
|
44
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
45
|
+
|
|
46
|
+
## Violations
|
|
47
|
+
|
|
48
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
49
|
+
|
|
50
|
+
## No Liability
|
|
51
|
+
|
|
52
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
53
|
+
|
|
54
|
+
## Definitions
|
|
55
|
+
|
|
56
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
57
|
+
|
|
58
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
59
|
+
|
|
60
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
61
|
+
|
|
62
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
63
|
+
|
|
64
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/README.md
CHANGED
|
@@ -1,3 +1,117 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @agent-om/devtools
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A panel for development builds that shows what an AI agent reads from the page
|
|
4
|
+
you're on. It reads the page the way [`@agent-om/core`](https://www.npmjs.com/package/@agent-om/core)'s
|
|
5
|
+
walk does: the same projection, and the same text, that an agent in the page
|
|
6
|
+
(`@agent-om/in-app-agent`) or the `agent-om-mcp` server sends its model.
|
|
7
|
+
|
|
8
|
+
> **Status:** 0.x. The API can still change.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm install --save-dev @agent-om/core @agent-om/devtools
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
`@agent-om/core` is a peer dependency, so the panel reads the page with the
|
|
15
|
+
app's own copy and its refs are the ones the app's agent uses.
|
|
16
|
+
|
|
17
|
+
## Use
|
|
18
|
+
|
|
19
|
+
Mount it once, in development:
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
if (import.meta.env.DEV) {
|
|
23
|
+
const { mount } = await import('@agent-om/devtools')
|
|
24
|
+
mount()
|
|
25
|
+
}
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The package already gives a production build nothing. Its development build
|
|
29
|
+
(the `development` export condition, which Vite and webpack set in
|
|
30
|
+
development) is the panel, and everything else gets a `mount` that does
|
|
31
|
+
nothing. The conditional import above keeps it out of bundlers that don't set
|
|
32
|
+
the condition too. `@agent-om/devtools/production` is the panel in any build.
|
|
33
|
+
|
|
34
|
+
`mount(options)` returns `{ open, close, unmount }`. Its options:
|
|
35
|
+
|
|
36
|
+
- `corner`: where the button sits: `bottom-right` (the default), `bottom-left`, `top-right` or `top-left`.
|
|
37
|
+
- `open`: open the panel at once (by default, it opens or stays closed as it was last left).
|
|
38
|
+
- `inAutomation`: mount it when a browser automation drives the page too. When
|
|
39
|
+
`navigator.webdriver` is set (Playwright, Selenium), `mount` does nothing by
|
|
40
|
+
default, so an agent driving the app through a browser never finds the panel
|
|
41
|
+
over what it clicks.
|
|
42
|
+
- `document`: the page to read (by default, this one).
|
|
43
|
+
|
|
44
|
+
Alt+Shift+A opens and closes it. Escape closes it. It docks at the bottom or on
|
|
45
|
+
the right; its edge, and the line between its list and the side with the
|
|
46
|
+
selected element, can be dragged (or moved with the arrow keys), and it keeps
|
|
47
|
+
the sizes you leave.
|
|
48
|
+
|
|
49
|
+
## What it shows
|
|
50
|
+
|
|
51
|
+
- **Sent to the model:** the page as a model reads it: `view()` of the
|
|
52
|
+
projection, with the same narrowing as a snapshot: only what can be acted on,
|
|
53
|
+
words to match, one element and what's inside it. Hovering a line outlines its
|
|
54
|
+
element on the page, labelled with the line. Clicking a line selects the
|
|
55
|
+
element, and scrolls it into view when it's off screen or behind the panel
|
|
56
|
+
(so do the rows of the other tabs).
|
|
57
|
+
- **Changes:** each thing done on the page (a click, typing, a key), and what an
|
|
58
|
+
agent would be told changed after it (`changes()`), or the whole page when
|
|
59
|
+
an agent would get that instead.
|
|
60
|
+
- **Picking** on the page selects what the model has a line for: the element
|
|
61
|
+
under the pointer, or the nearest around it with a line of its own (the side
|
|
62
|
+
says what was picked inside it). Hold Alt to pick exactly what's under the
|
|
63
|
+
pointer, to see where it stopped.
|
|
64
|
+
- **Selecting** an element (picking it on the page, or clicking its line or
|
|
65
|
+
row) scrolls each tab's list to its row, opening the projection's and the
|
|
66
|
+
tree's levels around it (where it has no row of its own, the row of what
|
|
67
|
+
holds it, or, when nothing around it has one, the first row of what's inside
|
|
68
|
+
it: a card on a page with no landmarks). Clicking a line or row also scrolls the page to the element when
|
|
69
|
+
it's off screen or under the panel. While the panel is docked at the bottom,
|
|
70
|
+
the page gets room at its end as tall as the panel, kept out of what agents
|
|
71
|
+
read, so even the last content can come out from under it. When an element
|
|
72
|
+
is fixed in place under the panel, the side says so.
|
|
73
|
+
- **Projection:** the projection as JSON, opened level by level. You can copy a
|
|
74
|
+
value, its path, or all of it.
|
|
75
|
+
- **Tree:** the accessibility tree the walk builds as Chrome would, ignored nodes
|
|
76
|
+
included, each with the reason the tree gives.
|
|
77
|
+
- **Where it went** (beside every tab): for the selected element, whether it
|
|
78
|
+
reached the tree, the projection and the view. Where it stopped, it gives the
|
|
79
|
+
reason: what the tree says, or the fact about the element that the walk
|
|
80
|
+
leaves things out for (`aria-hidden`, `inert`, not drawn, kept out by the
|
|
81
|
+
app, outside an open modal dialog). A box with nothing of its own to say is
|
|
82
|
+
folded away, not stopped: what's inside it is read on its own, and the side
|
|
83
|
+
says which lines of the view those are. It also shows the element's
|
|
84
|
+
`data-agentom-*` attributes and any warnings about them.
|
|
85
|
+
- **Refs:** a label with its ref on each element an agent can act on, in
|
|
86
|
+
orange where the agent can't name it (a pointer cursor with no role, a tab
|
|
87
|
+
stop, a control with no name).
|
|
88
|
+
- **Copy:** the whole of what a tab shows, to the clipboard (a list draws only
|
|
89
|
+
the rows in sight; a row's text can also be selected and copied).
|
|
90
|
+
- **Sizes:** the page's elements, the tree's nodes, the projection's bytes, the
|
|
91
|
+
view's lines and characters, and how long the read took.
|
|
92
|
+
|
|
93
|
+
It reads the page again 200 ms after the page changes, while open. When a read
|
|
94
|
+
takes longer than 250 ms (very large pages), it reads only when you press ↻.
|
|
95
|
+
|
|
96
|
+
## What it keeps out
|
|
97
|
+
|
|
98
|
+
- **From agents.** The panel lives in a closed shadow root on a
|
|
99
|
+
`data-agentom-ignore` element, so no reader of the page reads it: the
|
|
100
|
+
projection, from inside the page or from Chrome's tree, is the same with it
|
|
101
|
+
open. It stops the events it handles, so the app's outside-click handlers
|
|
102
|
+
don't close the app's own menus when you use it.
|
|
103
|
+
- **Secrets.** It never shows a secret. The tree is shown as core's
|
|
104
|
+
`shownTree` gives it, with secret fields' values and what the app keeps out
|
|
105
|
+
taken out. A value seen in a secret field is taken out of everything after,
|
|
106
|
+
even once the field shows it as text.
|
|
107
|
+
|
|
108
|
+
## What it doesn't show
|
|
109
|
+
|
|
110
|
+
- **Chrome's own accessibility tree:** a script in the page can't read it.
|
|
111
|
+
What it shows is the walk's copy, which matches Chrome's.
|
|
112
|
+
- **The rest of what a model is sent:** an agent's system prompt and its tools
|
|
113
|
+
differ between agents.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
Source-available, not open source. Licensed under the [PolyForm Strict License 1.0.0](https://github.com/TheAsyncLooop/agent-om/blob/master/packages/devtools/LICENSE). Copyright 2026 Sumeet Debnath and Prathmesh Vhatkar.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { n as DevtoolsOptions, t as Devtools } from "./panel-CFh-FaQK.js";
|
|
2
|
+
/**
|
|
3
|
+
* Put the panel on the page: a button in a corner that opens what an agent reads from the page. Call it in a
|
|
4
|
+
* development build only (the package gives a production build a `mount` that does nothing). Under a browser
|
|
5
|
+
* automation (navigator.webdriver) it does nothing unless asked (`inAutomation`), and a second call on the same page
|
|
6
|
+
* returns the panel already there.
|
|
7
|
+
*/
|
|
8
|
+
export declare function mount(options?: DevtoolsOptions): Devtools;
|
|
9
|
+
export type { Devtools, DevtoolsOptions };
|