open-plan-annotator 1.0.13 → 1.0.15
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.0.
|
|
8
|
+
"version": "1.0.15"
|
|
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.0.
|
|
15
|
+
"version": "1.0.15",
|
|
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.0.
|
|
4
|
+
"version": "1.0.15",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "ndom91"
|
|
7
7
|
},
|
|
@@ -4,6 +4,7 @@ import { execFileSync, 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
8
|
import { resolveCliMode } from "../shared/cliMode.mjs";
|
|
8
9
|
|
|
9
10
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -20,22 +21,12 @@ if (cliMode === "version") {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
if (cliMode === "help") {
|
|
23
|
-
console.log(
|
|
24
|
-
|
|
25
|
-
Usage:
|
|
26
|
-
open-plan-annotator Show this help (interactive shell)
|
|
27
|
-
open-plan-annotator < event.json Run as a Claude Code hook (reads stdin)
|
|
28
|
-
open-plan-annotator update Update the binary to the latest version
|
|
29
|
-
open-plan-annotator upgrade Alias for update
|
|
30
|
-
open-plan-annotator --version Print version
|
|
31
|
-
open-plan-annotator --help Show this help
|
|
32
|
-
|
|
33
|
-
https://github.com/ndom91/open-plan-annotator`);
|
|
24
|
+
console.log(buildCliHelpText(VERSION));
|
|
34
25
|
process.exit(0);
|
|
35
26
|
}
|
|
36
27
|
|
|
37
28
|
if (cliMode === "unknown") {
|
|
38
|
-
console.error(
|
|
29
|
+
console.error(buildUnknownCommandPrefix(arg));
|
|
39
30
|
console.error("Run `open-plan-annotator --help` for usage.");
|
|
40
31
|
process.exit(1);
|
|
41
32
|
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const REPOSITORY_URL = "https://github.com/ndom91/open-plan-annotator";
|
|
2
|
+
|
|
3
|
+
const HELP_USAGE_LINES = [
|
|
4
|
+
"open-plan-annotator Show this help",
|
|
5
|
+
"open-plan-annotator < event.json Run as a Claude Code hook (debug)",
|
|
6
|
+
"open-plan-annotator update Update the binary to the latest version",
|
|
7
|
+
"open-plan-annotator upgrade Alias for update",
|
|
8
|
+
"open-plan-annotator --version Print version",
|
|
9
|
+
"open-plan-annotator --help Show this help",
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} version
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function buildCliHelpText(version) {
|
|
17
|
+
const usage = HELP_USAGE_LINES.map((line) => ` ${line}`).join("\n");
|
|
18
|
+
return `open-plan-annotator v${version}\n\nUsage:\n${usage}\n\n${REPOSITORY_URL}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* @param {string | undefined} command
|
|
23
|
+
* @returns {string}
|
|
24
|
+
*/
|
|
25
|
+
export function buildUnknownCommandPrefix(command) {
|
|
26
|
+
return `open-plan-annotator: unknown command \`${command ?? ""}\``;
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
import { buildCliHelpText, buildUnknownCommandPrefix } from "./cliHelp.mjs";
|
|
3
|
+
|
|
4
|
+
describe("buildCliHelpText", () => {
|
|
5
|
+
test("builds canonical help text for all entrypoints", () => {
|
|
6
|
+
expect(buildCliHelpText("1.2.3")).toBe(`open-plan-annotator v1.2.3
|
|
7
|
+
|
|
8
|
+
Usage:
|
|
9
|
+
open-plan-annotator Show this help
|
|
10
|
+
open-plan-annotator < event.json Run as a Claude Code hook (debug)
|
|
11
|
+
open-plan-annotator update Update the binary to the latest version
|
|
12
|
+
open-plan-annotator upgrade Alias for update
|
|
13
|
+
open-plan-annotator --version Print version
|
|
14
|
+
open-plan-annotator --help Show this help
|
|
15
|
+
|
|
16
|
+
https://github.com/ndom91/open-plan-annotator`);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe("buildUnknownCommandPrefix", () => {
|
|
21
|
+
test("formats unknown command prefix consistently", () => {
|
|
22
|
+
expect(buildUnknownCommandPrefix("wat")).toBe("open-plan-annotator: unknown command `wat`");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("handles missing command safely", () => {
|
|
26
|
+
expect(buildUnknownCommandPrefix(undefined)).toBe("open-plan-annotator: unknown command ``");
|
|
27
|
+
});
|
|
28
|
+
});
|