@unbrained/pm-cli 2026.9.22 → 2026.9.25
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/AGENTS.md +6 -20
- package/CHANGELOG.md +43 -0
- package/dist/cli/error-guidance.d.ts +9 -0
- package/dist/cli/error-guidance.js +1 -1
- package/dist/cli/help-content.js +1 -1
- package/dist/cli-bundle/bundle-manifest.json +144 -144
- package/dist/cli-bundle/chunks/{chunk-BJBBOUYQ.js → chunk-25KTCTBL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UDNYAMCM.js → chunk-3IB4THWX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3OFFMS2N.js → chunk-445ARBKY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SBTT42A4.js → chunk-5AP67ZXH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JSW33Q6R.js → chunk-COFQCKF4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XOV7Q5R.js → chunk-CZ3VJJEA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZSPZJOMK.js → chunk-GAU55CWI.js} +28 -28
- package/dist/cli-bundle/chunks/{chunk-ML42DLI3.js → chunk-GOWZEBTH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CM57QHVK.js → chunk-JDHWZYZU.js} +73 -73
- package/dist/cli-bundle/chunks/{chunk-GFTN5OS4.js → chunk-P7ZSJOWH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AVWHZUNC.js → chunk-YABJDOOX.js} +63 -62
- package/dist/cli-bundle/chunks/{chunk-D2OV2UBV.js → chunk-YDIGMRLZ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-list-query-VOS5CBX4.js → register-list-query-IZ7ZVTDE.js} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-LWZH6UFJ.js → register-mutation-IPAZTFDZ.js} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-YJK4DNFZ.js → register-operations-APN33LNI.js} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-Q3CYF67Q.js → register-setup-HPHIKG5U.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-CASXNCNQ.js → chunk-ABA3KRPY.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-XR5EBU3B.js → chunk-HQPTDJLF.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-PRMQTT7X.js → chunk-IXNNMP2R.js} +2 -2
- package/dist/cli-bundle/focused-chunks/chunk-KRIHJH5U.js +75 -0
- package/dist/cli-bundle/focused-chunks/{chunk-QFEDRPPI.js → chunk-MK5AKKHK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-LH24XUPJ.js → chunk-NRHTXBTI.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-URH727T5.js → chunk-NVVB2HJC.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-TSI73EEM.js → chunk-O7MIBEMK.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-V2NARGRH.js → chunk-OY3VHCTX.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UT7VS4X2.js → chunk-PMPFLA6X.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-FKYUTTFL.js → chunk-Q355NPLH.js} +28 -28
- package/dist/cli-bundle/focused-chunks/{chunk-JCD5YESL.js → chunk-TLF6N56J.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-MXESHALQ.js → chunk-UIFVIE5F.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-IOL25GKH.js → chunk-V2X37U6J.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-AO5FR7PN.js → chunk-XKH2FC5D.js} +2 -2
- package/dist/cli-bundle/focused-chunks/{chunk-UAU4DJSR.js → chunk-Y2M4QLAA.js} +2 -2
- package/dist/cli-bundle/main.js +22 -22
- package/dist/cli-bundle/sdk-authoring.js +1 -1
- package/dist/cli-bundle/sdk-contracts.js +1 -1
- package/dist/cli-bundle/sdk-core.js +30 -45
- package/dist/cli-bundle/sdk-governance.js +1 -1
- package/dist/cli-bundle/sdk-graph.js +1 -1
- package/dist/cli-bundle/sdk-merge.js +58 -42
- package/dist/cli-bundle/sdk-query.js +1 -1
- package/dist/cli-bundle/sdk-runtime.js +1 -1
- package/dist/cli-bundle/sdk-testing.js +1 -1
- package/dist/cli-bundle/sdk.js +9 -10
- package/dist/core/policy/workflow-policy-store.js +1 -1
- package/dist/core/shared/errors.d.ts +13 -0
- package/dist/core/shared/errors.js +1 -1
- package/dist/sdk/cli-contracts/commander-types.d.ts +11 -11
- package/dist/sdk/cli-contracts/commander-types.js +1 -1
- package/dist/sdk/completion/bash.js +1 -1
- package/dist/sdk/governance/health.d.ts +1 -1
- package/dist/sdk/governance/health.js +1 -1
- package/dist/sdk/init-agent-guidance.d.ts +2 -1
- package/dist/sdk/init-agent-guidance.js +2 -2
- package/dist/sdk/merge/install.js +2 -2
- package/dist/sdk/merge/worktree-config.d.ts +9 -0
- package/dist/sdk/merge/worktree-config.js +2 -0
- package/dist/sdk/pagination.js +1 -1
- package/dist/sdk/public-surface.json +1 -1
- package/docs/AGENT_RECOVERY_AND_GUIDANCE.md +49 -0
- package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +2 -0
- package/docs/CLAUDE_CODE_PLUGIN.md +18 -7
- package/docs/CODEX_PLUGIN.md +5 -12
- package/docs/DEFECT_RECURRENCE.md +8 -1
- package/docs/DEPENDENCY_KIND_CONTRACT.md +27 -0
- package/docs/MERGE_SAFETY.md +28 -5
- package/docs/QUALITY_EVIDENCE.md +70 -0
- package/docs/README.md +1 -0
- package/docs/RELEASE_RELIABILITY.md +70 -0
- package/docs/RELEASING.md +4 -0
- package/docs/TESTING.md +25 -0
- package/docs/VALIDATION_PORTABILITY.md +20 -11
- package/marketplace.json +2 -2
- package/package.json +12 -6
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-digital-twin/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +6 -5
- package/plugins/pm-claude/hooks/hooks.json +1 -1
- package/plugins/pm-claude/hooks/session-start.mjs +9 -6
- package/plugins/pm-claude/package.json +9 -0
- package/plugins/pm-claude/scripts/plugin-runtime.mjs +84 -0
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +39 -96
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.mcp.json +0 -3
- package/plugins/pm-codex/README.md +1 -1
- package/plugins/pm-codex/package.json +9 -0
- package/plugins/pm-codex/scripts/plugin-runtime.mjs +84 -0
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +38 -99
- package/dist/cli-bundle/focused-chunks/chunk-QYN77MQP.js +0 -59
|
@@ -1,112 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Cached-plugin MCP launcher, copied verbatim into Claude and Codex plugins.
|
|
4
|
+
* The server runs from an exact-version package, never from an npm tag.
|
|
5
5
|
*/
|
|
6
6
|
import { spawn } from "node:child_process";
|
|
7
|
-
import { access } from "node:fs/promises";
|
|
7
|
+
import { access, readFile } from "node:fs/promises";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import { fileURLToPath
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
import { resolvePluginRuntime } from "./plugin-runtime.mjs";
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
try {
|
|
13
|
-
await access(target);
|
|
14
|
-
return true;
|
|
15
|
-
} catch {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
12
|
+
const here = path.dirname(fileURLToPath(import.meta.url));
|
|
19
13
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
/** Return an explicit local server path or this plugin's matching checkout build. */
|
|
15
|
+
async function localServer() {
|
|
16
|
+
const override = process.env.PM_CLI_MCP_SERVER;
|
|
17
|
+
if (override) {
|
|
18
|
+
const target = override.startsWith("file:") ? fileURLToPath(override) : path.resolve(override);
|
|
19
|
+
await access(target);
|
|
20
|
+
return target;
|
|
23
21
|
}
|
|
22
|
+
const repoRoot = path.resolve(here, "..", "..", "..");
|
|
23
|
+
const pluginRoot = path.resolve(here, "..");
|
|
24
|
+
const candidate = path.join(repoRoot, "dist", "mcp", "server.js");
|
|
24
25
|
try {
|
|
25
|
-
|
|
26
|
+
const [repo, plugin] = await Promise.all([
|
|
27
|
+
readFile(path.join(repoRoot, "package.json"), "utf8").then(JSON.parse),
|
|
28
|
+
readFile(path.join(pluginRoot, "package.json"), "utf8").then(JSON.parse),
|
|
29
|
+
]);
|
|
30
|
+
if (repo.name !== "@unbrained/pm-cli" || repo.version !== plugin.version ||
|
|
31
|
+
plugin.dependencies?.[repo.name] !== repo.version) return null;
|
|
32
|
+
await access(candidate);
|
|
33
|
+
return candidate;
|
|
26
34
|
} catch {
|
|
27
|
-
return
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function isMissingLaunchModule(error) {
|
|
32
|
-
return typeof error === "object" && error !== null && error.code === "ERR_MODULE_NOT_FOUND";
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async function importLaunchModule(target) {
|
|
36
|
-
try {
|
|
37
|
-
return await import(target);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
if (isMissingLaunchModule(error)) {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
async function locateRepoServer() {
|
|
47
|
-
let cursor = path.dirname(fileURLToPath(import.meta.url));
|
|
48
|
-
for (let depth = 0; depth < 10; depth += 1) {
|
|
49
|
-
const candidate = path.join(cursor, "dist", "mcp", "server.js");
|
|
50
|
-
if (await canRead(candidate)) {
|
|
51
|
-
return candidate;
|
|
52
|
-
}
|
|
53
|
-
const parent = path.dirname(cursor);
|
|
54
|
-
if (parent === cursor) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
cursor = parent;
|
|
35
|
+
return null;
|
|
58
36
|
}
|
|
59
|
-
return null;
|
|
60
37
|
}
|
|
61
38
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
try {
|
|
76
|
-
filePath = fileURLToPath(url);
|
|
77
|
-
} catch {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
if (!(await canRead(filePath))) {
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const server = await importLaunchModule(target);
|
|
85
|
-
if (!server) {
|
|
86
|
-
return false;
|
|
87
|
-
}
|
|
88
|
-
server.startMcpServer();
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
if (!(await canRead(target))) {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
const server = await importLaunchModule(pathToFileURL(path.resolve(target)).href);
|
|
95
|
-
if (!server) {
|
|
96
|
-
return false;
|
|
97
|
-
}
|
|
98
|
-
server.startMcpServer();
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (!(await launchServer(process.env.PM_CLI_MCP_SERVER)) && !(await launchServer(await locateRepoServer()))) {
|
|
103
|
-
const npxCommand = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
104
|
-
const child = spawn(npxCommand, ["-y", "--package=@unbrained/pm-cli@latest", "pm-mcp"], { stdio: "inherit", env: process.env });
|
|
105
|
-
child.on("exit", (code, signal) => {
|
|
106
|
-
if (signal) {
|
|
107
|
-
process.kill(process.pid, signal);
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
process.exit(code ?? 1);
|
|
111
|
-
});
|
|
112
|
-
}
|
|
39
|
+
const server = (await localServer()) ?? (await resolvePluginRuntime()).server;
|
|
40
|
+
const child = spawn(process.execPath, [server], { stdio: "inherit", env: process.env });
|
|
41
|
+
child.on("error", (error) => {
|
|
42
|
+
console.error(`pm-mcp plugin runtime failed: ${error.message}`);
|
|
43
|
+
process.exitCode = 1;
|
|
44
|
+
});
|
|
45
|
+
child.on("exit", (code, signal) => {
|
|
46
|
+
if (signal) {
|
|
47
|
+
process.kill(process.pid, signal);
|
|
48
|
+
} else {
|
|
49
|
+
process.exitCode = code ?? 1;
|
|
50
|
+
}
|
|
51
|
+
});
|