@nxxxsooo/opencode-annotate 0.17.0 → 0.17.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/CHANGELOG.md +9 -0
- package/README.md +21 -0
- package/browser/capture.js +24 -4
- package/browser/manifest.json +1 -1
- package/package.json +1 -1
- package/tui/README.md +32 -0
- package/tui/bin/darwin-arm64/annotate-tui +0 -0
- package/tui/bin/darwin-x64/annotate-tui +0 -0
- package/tui/bin/linux-arm64/annotate-tui +0 -0
- package/tui/bin/linux-x64/annotate-tui +0 -0
- package/tui/bin/win32-x64/annotate-tui.exe +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.17.1 — picking inside modal drawers
|
|
4
|
+
|
|
5
|
+
- Keep element highlights, saved-note markers and reveal outlines visible above
|
|
6
|
+
modal dialogs and drawers, including nested dialogs and same-origin frames.
|
|
7
|
+
- Restore the overlay as dialogs open, close or reopen without intercepting page
|
|
8
|
+
clicks. Saved notes and browser protocol 8 are unchanged.
|
|
9
|
+
- Reload the Chrome extension and refresh pages already using annotation tools
|
|
10
|
+
after updating. Saved notes remain available.
|
|
11
|
+
|
|
3
12
|
## 0.17.0 — clear the round
|
|
4
13
|
|
|
5
14
|
- **Clear** in the notes header removes every unsent note in the round; each page
|
package/README.md
CHANGED
|
@@ -107,6 +107,27 @@ Browser setup is separate from the plugin install. Safari supports local notes a
|
|
|
107
107
|
|
|
108
108
|
Numbered `/annotate N`, `/annotate-last` and `/annotate-web` are retired. Use `/annotate-pick` for earlier text, `/annotate` for the latest reply, and `/annotate <url-or-html>` for a page. Browser connection controls live in the extension's destination menu.
|
|
109
109
|
|
|
110
|
+
## Herdr
|
|
111
|
+
|
|
112
|
+
Run the bundled `annotate-tui` directly from a Herdr pane. Herdr needs an enabled
|
|
113
|
+
`annotate` plugin with a `doc` pane entrypoint; see the [TUI setup](tui/README.md#herdr).
|
|
114
|
+
OpenCode's `/annotate` keeps its own session delivery, even when OpenCode runs in Herdr.
|
|
115
|
+
|
|
116
|
+
```sh
|
|
117
|
+
annotate-tui herdr open docs/plan.md --placement split --deliver-to w1:p2
|
|
118
|
+
annotate-tui herdr open docs/ --deliver-to w1:p2
|
|
119
|
+
annotate-tui herdr last --deliver-to w1:p2
|
|
120
|
+
annotate-tui herdr terminal --lines 20 --deliver-to w1:p2
|
|
121
|
+
annotate-tui herdr terminal --lines 5 --print
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
- `open`, `last` and `terminal` accept `--placement overlay|split|tab|zoomed`. The default is `overlay`.
|
|
125
|
+
- `last` opens a reply picker; add `--newest` to open the newest reply directly. With `--deliver-to`, it reads that pane's agent session.
|
|
126
|
+
- `terminal` reviews recent output from the calling pane, even if feedback goes to a different pane. `--print` writes a fenced Markdown block to stdout instead of opening a reviewer.
|
|
127
|
+
- Replace `w1:p2` with the receiving agent's pane ID. **Send** submits the feedback as a prompt, including Enter. If Herdr reports the agent is blocked at a dialog, no prompt is sent. Annotate keeps the notes pending and tries to copy the feedback to the terminal clipboard; resolve the dialog and retry when ready.
|
|
128
|
+
|
|
129
|
+
Outside Herdr, use `annotate-tui docs/plan.md` to copy feedback via a terminal that supports OSC 52. `herdr open` requires a Herdr pane.
|
|
130
|
+
|
|
110
131
|
## Upgrading from the TUI-only package
|
|
111
132
|
|
|
112
133
|
`opencode-annotate` replaces `opencode-plannotator-tui` (0.4.2 and earlier). To switch, run `opencode plugin remove opencode-plannotator-tui@latest` and then install this package as shown above.
|
package/browser/capture.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
if (globalThis.__opencodeAnnotate === true) throw new Error("Refresh this page once to update annotation tools. Saved notes will remain.")
|
|
3
|
-
if (globalThis.__opencodeAnnotate?.version ===
|
|
3
|
+
if (globalThis.__opencodeAnnotate?.version === 8) return
|
|
4
4
|
globalThis.__opencodeAnnotate?.dispose()
|
|
5
5
|
if (!["text/html", "application/xhtml+xml"].includes(document.contentType)) throw new Error("Only HTML pages are supported")
|
|
6
6
|
const listeners = new AbortController()
|
|
7
7
|
const on = (target, event, handler, options = {}) => target.addEventListener(event, handler, { ...options, signal: listeners.signal })
|
|
8
8
|
const host = document.createElement("div")
|
|
9
9
|
host.setAttribute("data-opencode-annotate", "")
|
|
10
|
+
// A manual popover puts the pointer-transparent viewport overlay in the top
|
|
11
|
+
// layer without moving it under transformed/clipping dialog ancestors.
|
|
12
|
+
host.setAttribute("popover", "manual")
|
|
10
13
|
host.style.cssText = "all:initial!important;position:fixed!important;inset:0!important;pointer-events:none!important;z-index:2147483647!important"
|
|
11
14
|
const root = host.attachShadow({ mode: "closed" })
|
|
12
15
|
const style = document.createElement("style")
|
|
@@ -16,6 +19,16 @@
|
|
|
16
19
|
const highlight = document.createElement("div"); highlight.className = "box"
|
|
17
20
|
let highlighted, highlightTimer
|
|
18
21
|
let picking = false, url = location.href, timer, markers = [], active = true
|
|
22
|
+
let modals = []
|
|
23
|
+
function syncLayer(force = false) {
|
|
24
|
+
const next = [...document.querySelectorAll("dialog:modal")]
|
|
25
|
+
const changed = force || next.length !== modals.length || next.some((node, index) => node !== modals[index])
|
|
26
|
+
if (changed) box.remove()
|
|
27
|
+
if (changed && host.matches(":popover-open")) host.hidePopover()
|
|
28
|
+
if (!host.matches(":popover-open")) host.showPopover()
|
|
29
|
+
modals = next
|
|
30
|
+
}
|
|
31
|
+
syncLayer()
|
|
19
32
|
function send(anchor = null, error = null, modeOnly = false, ready = false) {
|
|
20
33
|
if (!active) return
|
|
21
34
|
try {
|
|
@@ -42,6 +55,7 @@
|
|
|
42
55
|
on(document, "pointerup", selection)
|
|
43
56
|
const hover = event => {
|
|
44
57
|
if (!picking) return
|
|
58
|
+
syncLayer()
|
|
45
59
|
if (["iframe", "frame", "frameset"].includes(event.target.localName)) {
|
|
46
60
|
box.remove()
|
|
47
61
|
if (event.target.localName !== "frameset") {
|
|
@@ -103,6 +117,7 @@
|
|
|
103
117
|
} catch { return "invalid selector" }
|
|
104
118
|
}
|
|
105
119
|
function draw() {
|
|
120
|
+
syncLayer()
|
|
106
121
|
if (highlighted?.isConnected) {
|
|
107
122
|
const rect = highlighted.getBoundingClientRect()
|
|
108
123
|
highlight.style.cssText = `left:${rect.left}px;top:${rect.top}px;width:${rect.width}px;height:${rect.height}px`
|
|
@@ -121,8 +136,13 @@
|
|
|
121
136
|
}
|
|
122
137
|
}
|
|
123
138
|
on(document, "scroll", draw, { capture: true, passive: true }); on(window, "resize", draw)
|
|
124
|
-
const observer = new MutationObserver(
|
|
125
|
-
|
|
139
|
+
const observer = new MutationObserver(records => {
|
|
140
|
+
// showModal/close mutate `open`; observe it as well as removed dialogs.
|
|
141
|
+
// Force a raise even if a dialog closes and reopens in one mutation batch.
|
|
142
|
+
syncLayer(records.some(record => record.type === "attributes" && record.target.localName === "dialog"))
|
|
143
|
+
clearTimeout(timer); timer = setTimeout(draw, 160)
|
|
144
|
+
})
|
|
145
|
+
observer.observe(document.documentElement, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ["open"] })
|
|
126
146
|
on(document, "load", event => {
|
|
127
147
|
if (["iframe", "frame"].includes(event.target.localName)) chrome.runtime.sendMessage({ action: "frames-changed" }).catch(() => {})
|
|
128
148
|
}, { capture: true })
|
|
@@ -133,6 +153,6 @@
|
|
|
133
153
|
try { chrome.runtime.onMessage.removeListener(onMessage) } catch { /* previous extension context may already be invalidated */ }
|
|
134
154
|
delete globalThis.__opencodeAnnotate
|
|
135
155
|
}
|
|
136
|
-
globalThis.__opencodeAnnotate = { dispose, version:
|
|
156
|
+
globalThis.__opencodeAnnotate = { dispose, version: 8 }
|
|
137
157
|
send(null, null, true, true)
|
|
138
158
|
})();
|
package/browser/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "OpenCode Annotate",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.1",
|
|
5
5
|
"description": "Annotate HTML-based page feedback, private drafts, and paired OpenCode delivery.",
|
|
6
6
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAp7TG2yzekNKpQvHBtj4jqkOxtoeDIBhNIjPi37Os/ksuhzPp1pHnrJPV4WV2ToatUaD5x5/SpLP8qZKLBD+wuraEE/TeclEZ8HvEs1yhlnx/S7piTG/s0eV5umuTEx2w66Hi0w3dhTC7ZZfJXCLyqs1feBtWzQx6ClgaHNYly4iJ03pV7RfguqpIaG9LV8Oa8ELA+7Ubr0BAujXrSlvqLF5oAKGoXXcpvTL5rgMRIH4Q/85tnvrk0pRVg+1z9IGNzSfjN82iveC/JAriyWABp8YuswtvKfI2Wb+KspaisBh39Y3BRqlyo8I2Cr+01uE6G5pWiJIWMLhe0glrMr5I2wIDAQAB",
|
|
7
7
|
"permissions": ["activeTab", "scripting", "storage", "sidePanel", "nativeMessaging", "clipboardWrite"],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxxxsooo/opencode-annotate",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.1",
|
|
4
4
|
"description": "Unofficial OpenCode annotation plugin: review AI replies and Markdown with a bundled terminal reviewer; annotate webpages with the browser companion.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/tui/README.md
CHANGED
|
@@ -55,6 +55,38 @@ Standalone annotation data defaults to `~/.local/share/opencode-annotate/tui`
|
|
|
55
55
|
(`%LOCALAPPDATA%/opencode-annotate/tui` on Windows). Hosted reviews use their own private
|
|
56
56
|
snapshot stores. An explicit `PLANNOTATOR_DATA_DIR` can still open a retained older draft.
|
|
57
57
|
|
|
58
|
+
## Herdr
|
|
59
|
+
|
|
60
|
+
The [Herdr commands](../README.md#herdr) use an enabled plugin with ID `annotate`.
|
|
61
|
+
For a local setup on macOS (tested with Herdr 0.9.5), save this as `herdr-plugin.toml`
|
|
62
|
+
and run `herdr plugin link /absolute/path/to/plugin-directory`:
|
|
63
|
+
|
|
64
|
+
```toml
|
|
65
|
+
id = "annotate"
|
|
66
|
+
name = "Annotate"
|
|
67
|
+
version = "0.1.0"
|
|
68
|
+
min_herdr_version = "0.9.5"
|
|
69
|
+
platforms = ["macos"]
|
|
70
|
+
|
|
71
|
+
[[panes]]
|
|
72
|
+
id = "doc"
|
|
73
|
+
title = "Annotate"
|
|
74
|
+
placement = "overlay"
|
|
75
|
+
command = ["/absolute/path/to/annotate-tui", "herdr", "pane"]
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`herdr pane` is the plugin entrypoint: it reads the file, reply or terminal source
|
|
79
|
+
passed by the launcher. Set `--placement overlay|split|tab|zoomed` on `herdr open`,
|
|
80
|
+
`herdr last` or `herdr terminal`; the default is `overlay`. Remove any old
|
|
81
|
+
`popup_width` and `popup_height` settings and replace `placement = "popup"` with
|
|
82
|
+
one of the supported values. Agent delivery uses `herdr agent prompt`; a blocked send
|
|
83
|
+
leaves notes pending for a manual retry and attempts an OSC 52 clipboard copy.
|
|
84
|
+
OpenCode's `/annotate` clears the inherited `HERDR_*` variables before launching
|
|
85
|
+
the reviewer, so it does not use this route.
|
|
86
|
+
|
|
87
|
+
Runtime checks used fixture panes and a local transcript. Real model turns and
|
|
88
|
+
OS clipboard integration were not tested.
|
|
89
|
+
|
|
58
90
|
## Local image-toolbar trial
|
|
59
91
|
|
|
60
92
|
The default toolbar remains Unicode. To opt in, add to the TUI config selected by
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|