Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/windows-full-ci.yml

This file was deleted.

32 changes: 13 additions & 19 deletions herdr-plugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,27 +44,21 @@ command = ["bun", "src/manager.ts"]

# ---------------------------------------------------------------------------------------
# Document review with plannotator-tui (https://github.com/plannotator/plannotator-tui).
# Herdr resolves explicit relative programs against $HERDR_PLUGIN_ROOT. A platform release
# binary is fetched into bin/ at build time. Where it opens (overlay | split | popup) remains
# the user's choice in plannotator-tui's config file.
# Commands resolve through $HERDR_PLUGIN_ROOT: the review pane is opened with --cwd set to
# the folder under review, so a path relative to the plugin root would not resolve there.
# A prebuilt binary is fetched into bin/ at build time; macOS and Linux for now. Where it
# opens (overlay | split | popup) is the user's choice in ~/.config/plannotator-tui/config.toml.

[[build]]
platforms = ["macos", "linux"]
command = ["bash", "scripts/fetch-plannotator-tui.sh"]

[[build]]
platforms = ["windows"]
command = [
"powershell.exe", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass",
"-File", "scripts/fetch-plannotator-tui.ps1",
]

[[panes]]
id = "doc"
title = "Annotate"
placement = "overlay"
platforms = ["macos", "linux", "windows"]
command = ["./bin/plannotator-tui.exe", "herdr", "pane"]
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec bash \"$HERDR_PLUGIN_ROOT/scripts/plannotator-tui.sh\" herdr pane"]

# Both actions run the launcher, which reads Herdr's invocation context: the focused pane's
# folder (open) or the clicked file:// link (open-link), and the focused pane's agent as
Expand All @@ -74,29 +68,29 @@ id = "open"
title = "Annotate: open here"
description = "Review the focused pane's folder in plannotator-tui and send feedback to its agent."
contexts = ["workspace", "pane"]
platforms = ["macos", "linux", "windows"]
command = ["./bin/plannotator-tui.exe", "herdr", "open"]
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec bash \"$HERDR_PLUGIN_ROOT/scripts/plannotator-tui.sh\" herdr open"]

[[actions]]
id = "open-link"
title = "Annotate this file"
description = "Open a Ctrl-clicked Markdown file in plannotator-tui."
contexts = ["pane"]
platforms = ["macos", "linux", "windows"]
command = ["./bin/plannotator-tui.exe", "herdr", "open"]
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec bash \"$HERDR_PLUGIN_ROOT/scripts/plannotator-tui.sh\" herdr open"]

[[actions]]
id = "last"
title = "Annotate: agent's last message"
description = "Review the focused agent's most recent message in plannotator-tui and send feedback back."
contexts = ["pane"]
platforms = ["macos", "linux", "windows"]
command = ["./bin/plannotator-tui.exe", "herdr", "last"]
platforms = ["macos", "linux"]
command = ["sh", "-c", "exec bash \"$HERDR_PLUGIN_ROOT/scripts/plannotator-tui.sh\" herdr last"]

# Ctrl-click on a file:// Markdown link. Anchored on the scheme so web links never match.
[[link_handlers]]
id = "markdown-file"
title = "Annotate this file"
pattern = "^file://.*\\.(md|markdown|mdx)$"
action = "open-link"
platforms = ["macos", "linux", "windows"]
platforms = ["macos", "linux"]
2 changes: 1 addition & 1 deletion plannotator-tui.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.0
0.5.0
157 changes: 0 additions & 157 deletions scripts/fetch-plannotator-tui.ps1

This file was deleted.

20 changes: 8 additions & 12 deletions scripts/fetch-plannotator-tui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# (cwd = plugin root) and by hand for local testing.
#
# plannotator-tui.version the release to install (one line, e.g. 0.1.0)
# bin/plannotator-tui.exe the binary
# bin/plannotator-tui the binary
# bin/plannotator-tui.version what is installed; matching the pin means nothing to do
#
# Modes, in order:
Expand All @@ -19,21 +19,19 @@ cd "$(dirname "$0")/.."
version="$(tr -d '[:space:]' < plannotator-tui.version)"
[ -n "$version" ] || { echo "plannotator-tui.version is empty" >&2; exit 1; }
mkdir -p bin
destination="bin/plannotator-tui.exe"
stamp="bin/plannotator-tui.version"
installed="$(cat bin/plannotator-tui.version 2>/dev/null || true)"

if [ -x "$destination" ] && [ "$installed" = "$version" ] && [ -z "${PLANNOTATOR_TUI_BIN:-}" ]; then
if [ -x bin/plannotator-tui ] && [ "$installed" = "$version" ] && [ -z "${PLANNOTATOR_TUI_BIN:-}" ]; then
echo "plannotator-tui $version already installed"
exit 0
fi

if [ -n "${PLANNOTATOR_TUI_BIN:-}" ]; then
[ -x "$PLANNOTATOR_TUI_BIN" ] || { echo "PLANNOTATOR_TUI_BIN is not an executable: $PLANNOTATOR_TUI_BIN" >&2; exit 1; }
rm -f "$destination"
cp "$PLANNOTATOR_TUI_BIN" "$destination"
chmod +x "$destination"
printf '%s' "$version" > "$stamp"
cp "$PLANNOTATOR_TUI_BIN" bin/plannotator-tui.tmp
chmod +x bin/plannotator-tui.tmp
mv bin/plannotator-tui.tmp bin/plannotator-tui
echo "$version" > bin/plannotator-tui.version
echo "installed plannotator-tui from $PLANNOTATOR_TUI_BIN (local build, stamped $version)"
exit 0
fi
Expand Down Expand Up @@ -76,8 +74,6 @@ fi
[ "$actual" = "$expected" ] || give_up "sha256 mismatch for $asset: expected $expected, got $actual"

chmod +x "$tmp/$asset"
rm -f "$destination"
cp "$tmp/$asset" "$destination"
chmod +x "$destination"
printf '%s' "$version" > "$stamp"
mv "$tmp/$asset" bin/plannotator-tui
echo "$version" > bin/plannotator-tui.version
echo "installed plannotator-tui $version ($target)"
9 changes: 5 additions & 4 deletions scripts/plannotator-tui.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env bash
# Compatibility wrapper for released and local workflows. The current manifest invokes the
# staged binary directly; remove this wrapper after one compatibility release.
# Run the bundled plannotator-tui, or say clearly why it cannot run. Herdr invokes this for
# the review pane and actions; the pane's cwd is the folder under review, so the binary is
# located relative to this script, never to the cwd.
set -euo pipefail
root="$(cd "$(dirname "$0")/.." && pwd)"
if [ -x "$root/bin/plannotator-tui.exe" ]; then
exec "$root/bin/plannotator-tui.exe" "$@"
if [ -x "$root/bin/plannotator-tui" ]; then
exec "$root/bin/plannotator-tui" "$@"
fi
msg="plannotator-tui is not installed. Reinstall the plugin: herdr plugin install plannotator/herdr-annotate"
echo "$msg" >&2
Expand Down
2 changes: 1 addition & 1 deletion scripts/smoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ actions() { herdr plugin action list --plugin annotate | python3 -c "
import json,sys; print(','.join(sorted(a['action_id'] for a in json.load(sys.stdin)['result']['actions'])))"; }
bin_version() {
local root; root="$(plugin_json | field "p['plugin_root']")"
local bin="$root/bin/plannotator-tui.exe"; [ -x "$bin" ] && "$bin" --version | awk '{print $2}' || echo none
local bin="$root/bin/plannotator-tui"; [ -x "$bin" ] && "$bin" --version | awk '{print $2}' || echo none
}
pin() { local root; root="$(plugin_json | field "p['plugin_root']")"; tr -d '[:space:]' < "$root/plannotator-tui.version" 2>/dev/null || echo none; }
check() { if [ "$2" = "$3" ]; then echo " ok $1: $2"; else echo " FAIL $1: got '$2', want '$3'" >&2; failures=$((failures+1)); fi; }
Expand Down
Loading