open-plan-annotator 1.8.6 → 1.9.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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +24 -9
- package/bin/open-plan-annotator.mjs +19 -6
- package/package.json +7 -5
- package/shared/agentSetup.mjs +20 -0
- package/shared/cliHelp.mjs +11 -0
- package/shared/cliMode.mjs +4 -1
- package/shared/runtimeEnv.mjs +16 -0
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
},
|
|
6
6
|
"metadata": {
|
|
7
7
|
"description": "Interactive plan annotation plugin for Claude Code",
|
|
8
|
-
"version": "1.
|
|
8
|
+
"version": "1.9.0"
|
|
9
9
|
},
|
|
10
10
|
"plugins": [
|
|
11
11
|
{
|
|
12
12
|
"name": "open-plan-annotator",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"description": "Interactive plan annotation UI: review, strikethrough, and comment on Claude's plans before approving. Fully local, no external services.",
|
|
15
|
-
"version": "1.
|
|
15
|
+
"version": "1.9.0",
|
|
16
16
|
"author": {
|
|
17
17
|
"name": "ndom91"
|
|
18
18
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-plan-annotator",
|
|
3
3
|
"description": "Interactive plan annotation UI: review, strikethrough, and comment on Claude's plans before approving. Fully local, no external services.",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.9.0",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ndom91"
|
|
7
7
|
},
|
package/README.md
CHANGED
|
@@ -11,19 +11,19 @@ Select text to <code>strikethrough</code>, <code>replace</code>, <code>insert</c
|
|
|
11
11
|
|
|
12
12
|
## How It Works
|
|
13
13
|
|
|
14
|
-
1. Your coding agent (Claude Code
|
|
14
|
+
1. Your coding agent (Claude Code, OpenCode, and pi) finishes writing a plan
|
|
15
15
|
2. The plugin launches an ephemeral HTTP server and opens a React UI in your browser
|
|
16
16
|
3. You review the plan and annotate it — strikethrough, replace, insert, or comment on any section
|
|
17
17
|
4. **Approve** to let the agent proceed, or **Request Changes** to send your annotations back as structured feedback
|
|
18
18
|
5. The agent revises the plan and the cycle repeats until you're satisfied
|
|
19
19
|
|
|
20
|
-
Everything runs locally.
|
|
20
|
+
Everything runs locally.
|
|
21
21
|
|
|
22
|
-

|
|
23
23
|
|
|
24
24
|
## Install
|
|
25
25
|
|
|
26
|
-
`open-plan-annotator` is package-managed
|
|
26
|
+
`open-plan-annotator` is package-managed as a plugin within your harness of choice. The main plugin package then installs the specific local platform runtime it needs for your host (`linux`/`darwin`, `x86_64`/`arm64`, etc). After installing the plugin, your agent will call `open-plan-annotator` autonomously when you ask it to "make a plan" or any similar such comment, including in claude-code specifically as a hook when exiting `PlanMode`. Alternatively, you can call it yourself explicitly via the exposed command. See below for more details.
|
|
27
27
|
|
|
28
28
|
### Claude Code
|
|
29
29
|
|
|
@@ -48,7 +48,7 @@ Add the plugin to your OpenCode config (`opencode.json` or `.opencode/config.jso
|
|
|
48
48
|
|
|
49
49
|
```json
|
|
50
50
|
{
|
|
51
|
-
"plugin": ["open-plan-annotator@
|
|
51
|
+
"plugin": ["open-plan-annotator@1.8.7"]
|
|
52
52
|
}
|
|
53
53
|
```
|
|
54
54
|
|
|
@@ -96,12 +96,27 @@ This adds the `open-plan-annotator` command. To verify the resolved runtime:
|
|
|
96
96
|
open-plan-annotator doctor
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
+
You can also review a Markdown plan directly from disk, which is useful for agents without a native plugin:
|
|
100
|
+
|
|
101
|
+
```sh
|
|
102
|
+
open-plan-annotator review /absolute/path/to/plan.md
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
The command opens the same local review UI and blocks until approval or requested changes. It prints review result JSON to stdout when the user is done.
|
|
106
|
+
|
|
107
|
+
Generic agent setup instructions are available with:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
open-plan-annotator agent-setup
|
|
111
|
+
open-plan-annotator help agent
|
|
112
|
+
```
|
|
113
|
+
|
|
99
114
|
## Updates
|
|
100
115
|
|
|
101
|
-
- Claude Code
|
|
102
|
-
- OpenCode
|
|
103
|
-
- Pi
|
|
104
|
-
- Manual/global install
|
|
116
|
+
- **Claude Code**: navigate to the `/plugin` -> "Installed" -> `open-plan-annotator` entry and select "Update", then restart Claude Code.
|
|
117
|
+
- **OpenCode**: bump the version number in your `opencode.jsonc` `plugins` `open-plan-annotator` entry, then restart OpenCode.
|
|
118
|
+
- **Pi**: update the Pi extension, then restart Pi.
|
|
119
|
+
- **Manual/global install**: update the npm package, then rerun `open-plan-annotator`.
|
|
105
120
|
|
|
106
121
|
## Keyboard Shortcuts
|
|
107
122
|
|
|
@@ -4,10 +4,12 @@ import { spawn } from "node:child_process";
|
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import {
|
|
7
|
+
import { AGENT_SETUP_TEXT } from "../shared/agentSetup.mjs";
|
|
8
|
+
import { buildCliHelpText, buildUnknownCommandPrefix, isAgentHelpTopic } from "../shared/cliHelp.mjs";
|
|
8
9
|
import { resolveCliMode } from "../shared/cliMode.mjs";
|
|
9
10
|
import { detectPackageManager } from "../shared/packageManager.mjs";
|
|
10
11
|
import { resolveRuntimeBinary } from "../shared/runtimeResolver.mjs";
|
|
12
|
+
import { buildRuntimeEnv } from "../shared/runtimeEnv.mjs";
|
|
11
13
|
import { buildUpdateMessage } from "../shared/updateMessage.mjs";
|
|
12
14
|
|
|
13
15
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -22,10 +24,20 @@ if (cliMode === "version") {
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
if (cliMode === "help") {
|
|
27
|
+
if (isAgentHelpTopic(process.argv[3])) {
|
|
28
|
+
console.log(AGENT_SETUP_TEXT);
|
|
29
|
+
process.exit(0);
|
|
30
|
+
}
|
|
31
|
+
|
|
25
32
|
console.log(buildCliHelpText(VERSION));
|
|
26
33
|
process.exit(0);
|
|
27
34
|
}
|
|
28
35
|
|
|
36
|
+
if (cliMode === "agentSetup") {
|
|
37
|
+
console.log(AGENT_SETUP_TEXT);
|
|
38
|
+
process.exit(0);
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
if (cliMode === "doctor") {
|
|
30
42
|
await printDoctor();
|
|
31
43
|
process.exit(0);
|
|
@@ -68,14 +80,15 @@ try {
|
|
|
68
80
|
process.exit(1);
|
|
69
81
|
}
|
|
70
82
|
|
|
83
|
+
const childEnv = buildRuntimeEnv({
|
|
84
|
+
cliMode,
|
|
85
|
+
packageManager: detectPackageManager({ installPath: fileURLToPath(import.meta.url) }),
|
|
86
|
+
});
|
|
87
|
+
|
|
71
88
|
const child = spawn(runtime.binaryPath, process.argv.slice(2), {
|
|
72
89
|
stdio: ["pipe", "pipe", "inherit"],
|
|
73
90
|
detached: true,
|
|
74
|
-
env:
|
|
75
|
-
...process.env,
|
|
76
|
-
OPEN_PLAN_HOST: process.env.OPEN_PLAN_HOST || "claude-code",
|
|
77
|
-
OPEN_PLAN_PKG_MANAGER: detectPackageManager({ installPath: fileURLToPath(import.meta.url) }),
|
|
78
|
-
},
|
|
91
|
+
env: childEnv,
|
|
79
92
|
});
|
|
80
93
|
|
|
81
94
|
child.stdin.write(stdinBuffer);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-plan-annotator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fully local plugin for interactive plan annotation from your Agentic assistants",
|
|
6
6
|
"author": "ndom91",
|
|
@@ -28,12 +28,14 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"bin/open-plan-annotator.mjs",
|
|
30
30
|
"scripts/install-runtime.mjs",
|
|
31
|
+
"shared/agentSetup.mjs",
|
|
31
32
|
"scripts/session-context.mjs",
|
|
32
33
|
"shared/cliHelp.mjs",
|
|
33
34
|
"shared/cliMode.mjs",
|
|
34
35
|
"shared/packageManager.mjs",
|
|
35
36
|
"shared/updateMessage.mjs",
|
|
36
37
|
"shared/runtimeResolver.mjs",
|
|
38
|
+
"shared/runtimeEnv.mjs",
|
|
37
39
|
"shared/updateHints.mjs",
|
|
38
40
|
"shared/versionInfo.mjs",
|
|
39
41
|
"shared/planReview.mjs",
|
|
@@ -82,10 +84,10 @@
|
|
|
82
84
|
}
|
|
83
85
|
},
|
|
84
86
|
"optionalDependencies": {
|
|
85
|
-
"@open-plan-annotator/runtime-darwin-arm64": "1.
|
|
86
|
-
"@open-plan-annotator/runtime-darwin-x64": "1.
|
|
87
|
-
"@open-plan-annotator/runtime-linux-arm64": "1.
|
|
88
|
-
"@open-plan-annotator/runtime-linux-x64": "1.
|
|
87
|
+
"@open-plan-annotator/runtime-darwin-arm64": "1.9.0",
|
|
88
|
+
"@open-plan-annotator/runtime-darwin-x64": "1.9.0",
|
|
89
|
+
"@open-plan-annotator/runtime-linux-arm64": "1.9.0",
|
|
90
|
+
"@open-plan-annotator/runtime-linux-x64": "1.9.0"
|
|
89
91
|
},
|
|
90
92
|
"overrides": {
|
|
91
93
|
"uuid": "^14.0.0"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const REVIEW_COMMAND = 'open-plan-annotator review "/absolute/path/to/plan.md"';
|
|
2
|
+
|
|
3
|
+
export const AGENT_SETUP_TEXT = `## Open Plan Annotator
|
|
4
|
+
|
|
5
|
+
Use Open Plan Annotator when the user wants to review a plan, proposal, implementation strategy, migration path, rollout plan, or other approval-oriented plan before code is written.
|
|
6
|
+
|
|
7
|
+
For agents without a native Open Plan Annotator integration:
|
|
8
|
+
|
|
9
|
+
1. Write the plan to a Markdown file on disk.
|
|
10
|
+
2. Run:
|
|
11
|
+
|
|
12
|
+
\`\`\`sh
|
|
13
|
+
${REVIEW_COMMAND}
|
|
14
|
+
\`\`\`
|
|
15
|
+
|
|
16
|
+
3. Leave the command running until the user approves or requests changes.
|
|
17
|
+
4. If the result is approved, proceed with implementation immediately.
|
|
18
|
+
5. If changes are requested, revise the plan using the returned feedback and submit the revised Markdown file for review again.
|
|
19
|
+
|
|
20
|
+
After approval, do not open another plan review unless the user explicitly asks to revise or re-plan.`;
|
package/shared/cliHelp.mjs
CHANGED
|
@@ -3,6 +3,9 @@ const REPOSITORY_URL = "https://github.com/ndom91/open-plan-annotator";
|
|
|
3
3
|
const HELP_USAGE_LINES = [
|
|
4
4
|
"open-plan-annotator Show this help",
|
|
5
5
|
"open-plan-annotator < event.json Run as a Claude Code hook (debug)",
|
|
6
|
+
"open-plan-annotator review <file> Review a Markdown plan from disk",
|
|
7
|
+
"open-plan-annotator agent-setup Print generic agent setup instructions",
|
|
8
|
+
"open-plan-annotator help agent Print generic agent setup instructions",
|
|
6
9
|
"open-plan-annotator doctor Show resolved runtime details",
|
|
7
10
|
"open-plan-annotator update Show package-managed update guidance",
|
|
8
11
|
"open-plan-annotator upgrade Alias for update",
|
|
@@ -19,6 +22,14 @@ export function buildCliHelpText(version) {
|
|
|
19
22
|
return `open-plan-annotator v${version}\n\nUsage:\n${usage}\n\n${REPOSITORY_URL}`;
|
|
20
23
|
}
|
|
21
24
|
|
|
25
|
+
/**
|
|
26
|
+
* @param {string | undefined} topic
|
|
27
|
+
* @returns {boolean}
|
|
28
|
+
*/
|
|
29
|
+
export function isAgentHelpTopic(topic) {
|
|
30
|
+
return topic === "agent" || topic === "agent-setup";
|
|
31
|
+
}
|
|
32
|
+
|
|
22
33
|
/**
|
|
23
34
|
* @param {string | undefined} command
|
|
24
35
|
* @returns {string}
|
package/shared/cliMode.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {"hook" | "update" | "doctor" | "help" | "version" | "unknown"} CliMode
|
|
2
|
+
* @typedef {"hook" | "review" | "agentSetup" | "update" | "doctor" | "help" | "version" | "unknown"} CliMode
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -18,6 +18,9 @@ export function resolveCliMode(arg, options = {}) {
|
|
|
18
18
|
|
|
19
19
|
if (arg === "update" || arg === "upgrade") return "update";
|
|
20
20
|
if (arg === "doctor") return "doctor";
|
|
21
|
+
if (arg === "review") return "review";
|
|
22
|
+
if (arg === "agent-setup") return "agentSetup";
|
|
23
|
+
if (arg === "help") return "help";
|
|
21
24
|
if (arg === "--help" || arg === "-h") return "help";
|
|
22
25
|
if (arg === "--version" || arg === "-v") return "version";
|
|
23
26
|
return "unknown";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param {{ cliMode: string, baseEnv?: NodeJS.ProcessEnv, packageManager: string }} options
|
|
3
|
+
* @returns {NodeJS.ProcessEnv}
|
|
4
|
+
*/
|
|
5
|
+
export function buildRuntimeEnv({ cliMode, baseEnv = process.env, packageManager }) {
|
|
6
|
+
const env = {
|
|
7
|
+
...baseEnv,
|
|
8
|
+
OPEN_PLAN_PKG_MANAGER: packageManager,
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
if (!env.OPEN_PLAN_HOST && cliMode === "hook") {
|
|
12
|
+
env.OPEN_PLAN_HOST = "claude-code";
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return env;
|
|
16
|
+
}
|