open-plan-annotator 1.8.6 → 1.8.7

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.
@@ -5,14 +5,14 @@
5
5
  },
6
6
  "metadata": {
7
7
  "description": "Interactive plan annotation plugin for Claude Code",
8
- "version": "1.8.6"
8
+ "version": "1.8.7"
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.8.6",
15
+ "version": "1.8.7",
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.8.6",
4
+ "version": "1.8.7",
5
5
  "author": {
6
6
  "name": "ndom91"
7
7
  },
package/README.md CHANGED
@@ -96,6 +96,21 @@ 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
116
  - Claude Code: update the marketplace/plugin install, then restart Claude Code.
@@ -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 { buildCliHelpText, buildUnknownCommandPrefix } from "../shared/cliHelp.mjs";
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.8.6",
3
+ "version": "1.8.7",
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.8.6",
86
- "@open-plan-annotator/runtime-darwin-x64": "1.8.6",
87
- "@open-plan-annotator/runtime-linux-arm64": "1.8.6",
88
- "@open-plan-annotator/runtime-linux-x64": "1.8.6"
87
+ "@open-plan-annotator/runtime-darwin-arm64": "1.8.7",
88
+ "@open-plan-annotator/runtime-darwin-x64": "1.8.7",
89
+ "@open-plan-annotator/runtime-linux-arm64": "1.8.7",
90
+ "@open-plan-annotator/runtime-linux-x64": "1.8.7"
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.`;
@@ -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}
@@ -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
+ }