@modootoday/pmcp 0.27.0 → 0.29.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/.agents/plugins/marketplace.json +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/dist/{apply-YNBY2GPK.js → apply-OAZNNNQS.js} +9 -9
- package/dist/{chunk-LKH57HLV.js → chunk-2ZNKC6ZB.js} +2 -2
- package/dist/{chunk-S2FUWBLO.js → chunk-3WXRU25Q.js} +74 -21
- package/dist/{chunk-YKICVMF7.js → chunk-5WAMDZHF.js} +11 -3
- package/dist/{chunk-L5EJK24I.js → chunk-66B5NX2N.js} +2 -2
- package/dist/{chunk-TVA2IN6H.js → chunk-72AF424S.js} +5 -5
- package/dist/{chunk-ZO5CRS2T.js → chunk-7JIJPBER.js} +2 -2
- package/dist/{chunk-OZTEMCCM.js → chunk-7PYTXWZE.js} +3 -3
- package/dist/{chunk-GVKVMSWX.js → chunk-ANSN2XBX.js} +13 -13
- package/dist/{chunk-6U6MLIS2.js → chunk-C3YIVQGU.js} +2 -2
- package/dist/chunk-DXQPI4QB.js +7 -0
- package/dist/{chunk-Q3XLIRIJ.js → chunk-I5JI547U.js} +4 -4
- package/dist/{chunk-M5GNZSOJ.js → chunk-KUQXCJ2W.js} +2 -2
- package/dist/{chunk-XCIFD7G5.js → chunk-L7SCC2OS.js} +2 -2
- package/dist/{chunk-Y5WIIEG2.js → chunk-LYVMXH4Y.js} +4 -4
- package/dist/{chunk-JTKGDT2K.js → chunk-M4CXEF2F.js} +2 -2
- package/dist/{chunk-X2WDR3UK.js → chunk-MYEVRRG2.js} +2 -2
- package/dist/{chunk-PH3P5WEY.js → chunk-OUKRDS4O.js} +3 -3
- package/dist/{chunk-5TT7YAEP.js → chunk-P54WENV4.js} +3 -3
- package/dist/{chunk-OY7XYKVL.js → chunk-POWQPJ5V.js} +2 -2
- package/dist/{chunk-X3LNF5KJ.js → chunk-QTLPN3MY.js} +5 -5
- package/dist/{chunk-ENFF7ZBC.js → chunk-UBCSERU5.js} +2 -2
- package/dist/{cli-FVUHK2NB.js → cli-J2ODG3GH.js} +5 -5
- package/dist/cli.js +3 -3
- package/dist/{completion-WKIMMLNF.js → completion-KE7XNYCC.js} +2 -2
- package/dist/{diagnostics-LCNF5NRK.js → diagnostics-67ODZ4US.js} +5 -5
- package/dist/{doctor-PSMPNQXS.js → doctor-GCGG3QJS.js} +11 -11
- package/dist/{entry-LMAWTZM2.js → entry-KVEZFVS4.js} +9 -9
- package/dist/{exec-mcp-VAP46MKO.js → exec-mcp-CIH2M7S3.js} +7 -7
- package/dist/{harness-ZCMU5MJD.js → harness-AP4WR5T6.js} +3 -3
- package/dist/harness-launch-gate.js +3 -3
- package/dist/harness-worker.js +5 -5
- package/dist/hook-body.js +96 -55
- package/dist/{hooks-AWAO7CQO.js → hooks-NL2NU4LD.js} +3 -3
- package/dist/{host-OBTC2PGQ.js → host-4PTSDTS6.js} +2 -2
- package/dist/{host-I4XIJTXR.js → host-EI63IQAF.js} +6 -6
- package/dist/{host-4GFQQJUS.js → host-OABIC6HJ.js} +9 -9
- package/dist/{host-run-T3FC7L6I.js → host-run-RFDKRQIK.js} +4 -4
- package/dist/http.js +1 -1
- package/dist/{import-mcp-5JSGA5IS.js → import-mcp-V4SU2PZC.js} +6 -6
- package/dist/index.d.ts +1 -1
- package/dist/index.js +10 -10
- package/dist/{init-PZYWBDZS.js → init-WWXUT7II.js} +2 -2
- package/dist/{invoke-DCKJCMRB.js → invoke-TW2CSSZW.js} +7 -7
- package/dist/{list-ZEU7T3XK.js → list-BVKM5YYP.js} +8 -8
- package/dist/{logout-CUSOVMKL.js → logout-AFUL7BL5.js} +7 -7
- package/dist/{mainline-SWZPKA7U.js → mainline-73LPNONI.js} +19 -3
- package/dist/{mcp-ZHOPOFXI.js → mcp-RAHIIHWP.js} +2 -2
- package/dist/{measure-AUBPYT6L.js → measure-PV54XMHK.js} +2 -2
- package/dist/{project-T36TRAWT.js → project-EORCMTYS.js} +4 -4
- package/dist/{run-LMSHQJPQ.js → run-RGFWSEEL.js} +6 -6
- package/dist/{run-37PVE74I.js → run-ZK7OKBCT.js} +4 -4
- package/dist/{serve-E4FD6PAL.js → serve-RKGWB275.js} +3 -3
- package/dist/{setup-7JHWLV7K.js → setup-V7QJKJ3M.js} +2 -2
- package/dist/{start-login-JSKFXSLY.js → start-login-POOTXBPU.js} +7 -7
- package/dist/{status-ZSK3PNM2.js → status-QZKAWH4N.js} +8 -8
- package/dist/{status-ZNWF4362.js → status-Y4IN4X5G.js} +7 -7
- package/dist/stdio.js +2 -2
- package/dist/{test-OCTC2DSZ.js → test-ABDOR6OT.js} +7 -7
- package/dist/{tui-LE2KPUMI.js → tui-JO3L7VY3.js} +4 -4
- package/dist/{worker-6U67LWIP.js → worker-3VI27AFS.js} +7 -7
- package/dist/{worktree-sync-BQZD4J73.js → worktree-sync-SHKTHKBR.js} +4 -2
- package/docs/git-workflow.md +19 -1
- package/gemini-extension.json +2 -2
- package/mcp.json +1 -1
- package/package.json +5 -5
- package/plugin.json +1 -1
- package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
- package/plugins/pmcp/.mcp.json +1 -1
- package/plugins/pmcp/gemini-extension.json +2 -2
- package/plugins/pmcp/mcp.json +1 -1
- package/plugins/pmcp/plugin.json +1 -1
- package/dist/chunk-MXVP3ICV.js +0 -7
package/dist/hook-body.js
CHANGED
|
@@ -4335,37 +4335,68 @@ function displace(root, path) {
|
|
|
4335
4335
|
return target;
|
|
4336
4336
|
}
|
|
4337
4337
|
|
|
4338
|
-
// src/git/
|
|
4338
|
+
// src/git/dir-to-gitlink.ts
|
|
4339
4339
|
import { join as join12 } from "node:path";
|
|
4340
|
+
function dirsBecomingGitlinks(root, from, to) {
|
|
4341
|
+
const raw = gitText(root, [
|
|
4342
|
+
"diff",
|
|
4343
|
+
"--raw",
|
|
4344
|
+
"--abbrev=40",
|
|
4345
|
+
"--no-renames",
|
|
4346
|
+
from,
|
|
4347
|
+
to
|
|
4348
|
+
]);
|
|
4349
|
+
const paths = [];
|
|
4350
|
+
for (const entry of raw.split("\n")) {
|
|
4351
|
+
const added = ADDED_GITLINK.exec(entry);
|
|
4352
|
+
if (!added) continue;
|
|
4353
|
+
const path = added[2] ?? "";
|
|
4354
|
+
const kind = git(root, ["cat-file", "-t", `${from}:${path}`]);
|
|
4355
|
+
if (kind.status !== 0 || kind.stdout.trim() !== "tree") continue;
|
|
4356
|
+
const dir = join12(root, path);
|
|
4357
|
+
if (existsSync(dir) && readdirSync(dir).length > 0) paths.push(path);
|
|
4358
|
+
}
|
|
4359
|
+
return paths;
|
|
4360
|
+
}
|
|
4361
|
+
function dirToGitlinkRefusal(root, from, to, policy) {
|
|
4362
|
+
if (policy?.mode !== "refuse") return null;
|
|
4363
|
+
const paths = dirsBecomingGitlinks(root, from, to);
|
|
4364
|
+
if (paths.length === 0) return null;
|
|
4365
|
+
const hint = policy.hint === void 0 ? "" : `; ${policy.hint}`;
|
|
4366
|
+
return `the move turns ${paths.join(", ")} from a directory with files into a gitlink ([git.submodules] dir_to_gitlink = "refuse"); left where it is${hint}`;
|
|
4367
|
+
}
|
|
4368
|
+
|
|
4369
|
+
// src/git/submodules.ts
|
|
4370
|
+
import { join as join13 } from "node:path";
|
|
4340
4371
|
function clean(dir) {
|
|
4341
4372
|
return git(dir, ["status", "--porcelain"]).stdout.trim() === "";
|
|
4342
4373
|
}
|
|
4343
4374
|
function hasCommit(dir, sha) {
|
|
4344
4375
|
return gitOk(dir, ["cat-file", "-e", `${sha}^{commit}`]);
|
|
4345
4376
|
}
|
|
4377
|
+
function fetchedPin(dir, sha) {
|
|
4378
|
+
if (!hasCommit(dir, sha)) git(dir, ["fetch", "-q", "origin"]);
|
|
4379
|
+
return hasCommit(dir, sha);
|
|
4380
|
+
}
|
|
4381
|
+
function pushed(dir) {
|
|
4382
|
+
return gitText(dir, ["rev-list", "--count", "HEAD", "--not", "--remotes"]) === "0";
|
|
4383
|
+
}
|
|
4346
4384
|
function movableSubmodules(root) {
|
|
4347
4385
|
const listed = git(root, ["submodule", "status"]).stdout;
|
|
4348
4386
|
return listed.split("\n").filter((line) => /^[ +]/u.test(line)).map((line) => line.trim().split(/\s+/u)[1] ?? "").filter((path) => {
|
|
4349
|
-
const dir =
|
|
4350
|
-
if (!path || !existsSync(
|
|
4351
|
-
|
|
4352
|
-
"rev-list",
|
|
4353
|
-
"--count",
|
|
4354
|
-
"HEAD",
|
|
4355
|
-
"--not",
|
|
4356
|
-
"--remotes"
|
|
4357
|
-
]);
|
|
4358
|
-
return clean(dir) && local === "0";
|
|
4387
|
+
const dir = join13(root, path);
|
|
4388
|
+
if (!path || !existsSync(join13(dir, ".git"))) return false;
|
|
4389
|
+
return clean(dir) && pushed(dir);
|
|
4359
4390
|
});
|
|
4360
4391
|
}
|
|
4361
4392
|
function updateToPins(root, paths) {
|
|
4362
4393
|
const lines = [];
|
|
4363
4394
|
for (const path of paths) {
|
|
4364
4395
|
const pin = gitText(root, ["rev-parse", `HEAD:${path}`]);
|
|
4365
|
-
const dir =
|
|
4366
|
-
if (!pin || !
|
|
4396
|
+
const dir = join13(root, path);
|
|
4397
|
+
if (!pin || !fetchedPin(dir, pin)) {
|
|
4367
4398
|
lines.push(
|
|
4368
|
-
`${path}: left alone, ${pin.slice(0, 10) || "its pin"} is not in its checkout`
|
|
4399
|
+
`${path}: left alone, ${pin.slice(0, 10) || "its pin"} is not in its checkout or on its origin`
|
|
4369
4400
|
);
|
|
4370
4401
|
continue;
|
|
4371
4402
|
}
|
|
@@ -4431,6 +4462,16 @@ function syncOnce(options2) {
|
|
|
4431
4462
|
}
|
|
4432
4463
|
const submodules = options2.followSubmodules ? movableSubmodules(ctx.root) : [];
|
|
4433
4464
|
const before2 = gitText(ctx.root, ["rev-parse", "HEAD"]);
|
|
4465
|
+
const replaced = dirToGitlinkRefusal(
|
|
4466
|
+
ctx.root,
|
|
4467
|
+
before2,
|
|
4468
|
+
gitText(ctx.root, ["rev-parse", ctx.upstream]),
|
|
4469
|
+
options2.dirToGitlink
|
|
4470
|
+
);
|
|
4471
|
+
if (replaced !== null) {
|
|
4472
|
+
report2.warn(replaced);
|
|
4473
|
+
return "held";
|
|
4474
|
+
}
|
|
4434
4475
|
const args = counted.ahead > 0 ? ["reset", "--keep", "-q", ctx.upstream] : ["merge", "--ff-only", "-q", ctx.upstream];
|
|
4435
4476
|
const moved = git(ctx.root, args);
|
|
4436
4477
|
if (moved.status !== 0) {
|
|
@@ -6656,18 +6697,18 @@ async function dispatch(raw, compiled, deps) {
|
|
|
6656
6697
|
}
|
|
6657
6698
|
|
|
6658
6699
|
// src/hooks/entry/fail-closed.ts
|
|
6659
|
-
import { join as
|
|
6700
|
+
import { join as join16 } from "node:path";
|
|
6660
6701
|
|
|
6661
6702
|
// src/hooks/compiled.ts
|
|
6662
|
-
import { join as
|
|
6703
|
+
import { join as join15 } from "node:path";
|
|
6663
6704
|
|
|
6664
6705
|
// src/hooks/integrity-cache.ts
|
|
6665
6706
|
import { homedir as homedir4 } from "node:os";
|
|
6666
|
-
import { dirname as dirname8, join as
|
|
6707
|
+
import { dirname as dirname8, join as join14 } from "node:path";
|
|
6667
6708
|
var LIMIT = 64;
|
|
6668
6709
|
function cacheFile() {
|
|
6669
|
-
const base = process.env["XDG_CACHE_HOME"] ||
|
|
6670
|
-
return
|
|
6710
|
+
const base = process.env["XDG_CACHE_HOME"] || join14(homedir4(), ".cache");
|
|
6711
|
+
return join14(base, "pmcp", "hook-verified.json");
|
|
6671
6712
|
}
|
|
6672
6713
|
function readCache() {
|
|
6673
6714
|
try {
|
|
@@ -6737,8 +6778,8 @@ function readLockFile(path) {
|
|
|
6737
6778
|
}
|
|
6738
6779
|
}
|
|
6739
6780
|
function readCompiled(root) {
|
|
6740
|
-
const policyPath =
|
|
6741
|
-
const files2 = [policyPath,
|
|
6781
|
+
const policyPath = join15(root, POLICY_FILE);
|
|
6782
|
+
const files2 = [policyPath, join15(root, LOCK_FILE)];
|
|
6742
6783
|
const before2 = stampOf(files2);
|
|
6743
6784
|
const text9 = readFileSync(policyPath, "utf8");
|
|
6744
6785
|
const lock = readLockFile(files2[1]);
|
|
@@ -6761,7 +6802,7 @@ function readCompiled(root) {
|
|
|
6761
6802
|
var FAILED_CLOSED = "pmcp hook could not evaluate this call and refused it";
|
|
6762
6803
|
function rawFailure(root) {
|
|
6763
6804
|
try {
|
|
6764
|
-
const raw = JSON.parse(readFileSync(
|
|
6805
|
+
const raw = JSON.parse(readFileSync(join16(root, POLICY_FILE), "utf8"))["failure"];
|
|
6765
6806
|
if (!raw || typeof raw.timeoutMs !== "number" || typeof raw.retry !== "number" || !Array.isArray(raw.pass) || !raw.pass.every(
|
|
6766
6807
|
(kind) => PASS_KINDS.includes(kind)
|
|
6767
6808
|
))
|
|
@@ -6796,7 +6837,7 @@ function failClosed(adapter, event, root, error, stated = false) {
|
|
|
6796
6837
|
}
|
|
6797
6838
|
|
|
6798
6839
|
// src/hooks/entry/lock-repair.ts
|
|
6799
|
-
import { join as
|
|
6840
|
+
import { join as join17, resolve as resolve21 } from "node:path";
|
|
6800
6841
|
var REV = /^[\w./~^@{}][\w./~^@{}-]*$/u;
|
|
6801
6842
|
var LOCK_PATHS = /* @__PURE__ */ new Set([LOCK_FILE, `./${LOCK_FILE}`]);
|
|
6802
6843
|
var RESTORE_OPTIONS = /* @__PURE__ */ new Set([
|
|
@@ -6840,7 +6881,7 @@ function repairsLock(input, root) {
|
|
|
6840
6881
|
if (!tool) return false;
|
|
6841
6882
|
if (tool.kind === "read") return true;
|
|
6842
6883
|
if (tool.kind === "edit") {
|
|
6843
|
-
const lock =
|
|
6884
|
+
const lock = join17(root, LOCK_FILE);
|
|
6844
6885
|
return tool.paths.length > 0 && tool.paths.every((path) => resolve21(input.cwd, path) === lock);
|
|
6845
6886
|
}
|
|
6846
6887
|
if (tool.kind === "shell") return restoresLock(tool.command ?? "");
|
|
@@ -6858,7 +6899,7 @@ function lockRepair(adapter, event, root, input, error) {
|
|
|
6858
6899
|
}
|
|
6859
6900
|
|
|
6860
6901
|
// src/hooks/entry/logger.ts
|
|
6861
|
-
import { dirname as dirname9, join as
|
|
6902
|
+
import { dirname as dirname9, join as join19 } from "node:path";
|
|
6862
6903
|
|
|
6863
6904
|
// src/logging/levels.ts
|
|
6864
6905
|
var LEVEL_RANK = {
|
|
@@ -6982,11 +7023,11 @@ var silentLogger = createLogger(() => {
|
|
|
6982
7023
|
});
|
|
6983
7024
|
|
|
6984
7025
|
// src/logging/sinks/file.ts
|
|
6985
|
-
import { join as
|
|
7026
|
+
import { join as join18 } from "node:path";
|
|
6986
7027
|
var FILE = /^pmcp-(\d{8})(?:\.\d+)?\.jsonl$/u;
|
|
6987
7028
|
function dailyLogFile(dir, now = /* @__PURE__ */ new Date()) {
|
|
6988
7029
|
const day = now.toISOString().slice(0, 10).replaceAll("-", "");
|
|
6989
|
-
return
|
|
7030
|
+
return join18(dir, `pmcp-${day}.jsonl`);
|
|
6990
7031
|
}
|
|
6991
7032
|
function roll(file2) {
|
|
6992
7033
|
let index = 1;
|
|
@@ -7017,7 +7058,7 @@ function logFiles(dir) {
|
|
|
7017
7058
|
const part = (name) => Number(/\.(\d+)\.jsonl$/u.exec(name)?.[1] ?? Number.MAX_SAFE_INTEGER);
|
|
7018
7059
|
return names4.sort(
|
|
7019
7060
|
(a, b) => a.slice(5, 13).localeCompare(b.slice(5, 13)) || part(a) - part(b)
|
|
7020
|
-
).map((name) =>
|
|
7061
|
+
).map((name) => join18(dir, name));
|
|
7021
7062
|
}
|
|
7022
7063
|
function pruneLogs(dir, keepDays, now = /* @__PURE__ */ new Date()) {
|
|
7023
7064
|
const cutoff = new Date(now.getTime() - keepDays * 864e5).toISOString().slice(0, 10).replaceAll("-", "");
|
|
@@ -7043,7 +7084,7 @@ function hookLogger(root, compiled, runtime2, event) {
|
|
|
7043
7084
|
process.env["PMCP_LOG"]
|
|
7044
7085
|
);
|
|
7045
7086
|
const file2 = compiled?.logFile ? expandPath(root, compiled.logFile) : void 0;
|
|
7046
|
-
const dir = file2 ? dirname9(file2) :
|
|
7087
|
+
const dir = file2 ? dirname9(file2) : join19(projectStateDir(root, compiled?.stateDir), "logs");
|
|
7047
7088
|
const sink = fileSink({
|
|
7048
7089
|
dir,
|
|
7049
7090
|
...file2 ? { file: file2 } : {},
|
|
@@ -7059,18 +7100,18 @@ function hookLogger(root, compiled, runtime2, event) {
|
|
|
7059
7100
|
}
|
|
7060
7101
|
|
|
7061
7102
|
// src/hooks/entry/state-dir.ts
|
|
7062
|
-
import { join as
|
|
7103
|
+
import { join as join21 } from "node:path";
|
|
7063
7104
|
|
|
7064
7105
|
// src/sessions/lease-files.ts
|
|
7065
|
-
import { dirname as dirname10, isAbsolute as isAbsolute16, join as
|
|
7106
|
+
import { dirname as dirname10, isAbsolute as isAbsolute16, join as join20 } from "node:path";
|
|
7066
7107
|
var GATE_DIR = "${gate_dir}/";
|
|
7067
7108
|
function gateTree(root, stateDir, gate, env) {
|
|
7068
7109
|
const override = gate.treeEnv ? env[gate.treeEnv] : void 0;
|
|
7069
7110
|
if (override) return override;
|
|
7070
|
-
return gate.tree ? expandPath(root, gate.tree) :
|
|
7111
|
+
return gate.tree ? expandPath(root, gate.tree) : join20(stateDir, "gate", "tree");
|
|
7071
7112
|
}
|
|
7072
7113
|
function atGateDir(path, gateDir) {
|
|
7073
|
-
return path.startsWith(GATE_DIR) ?
|
|
7114
|
+
return path.startsWith(GATE_DIR) ? join20(gateDir, path.slice(GATE_DIR.length)) : path;
|
|
7074
7115
|
}
|
|
7075
7116
|
function resolvePauseFile(file2, gateDir) {
|
|
7076
7117
|
return file2 === void 0 ? void 0 : atGateDir(file2, gateDir);
|
|
@@ -7125,7 +7166,7 @@ function pauseFileAnswer(root) {
|
|
|
7125
7166
|
compiled?.sessions.gate,
|
|
7126
7167
|
process.env
|
|
7127
7168
|
);
|
|
7128
|
-
return `${file2 ??
|
|
7169
|
+
return `${file2 ?? join21(stateDir, STATE_FILES.pause)}
|
|
7129
7170
|
`;
|
|
7130
7171
|
}
|
|
7131
7172
|
|
|
@@ -7163,7 +7204,7 @@ var gitProbe = {
|
|
|
7163
7204
|
};
|
|
7164
7205
|
|
|
7165
7206
|
// src/sessions/files/broadcast.ts
|
|
7166
|
-
import { join as
|
|
7207
|
+
import { join as join22 } from "node:path";
|
|
7167
7208
|
|
|
7168
7209
|
// src/sessions/files/json.ts
|
|
7169
7210
|
import { dirname as dirname11 } from "node:path";
|
|
@@ -7210,8 +7251,8 @@ function writeLines(path, values) {
|
|
|
7210
7251
|
|
|
7211
7252
|
// src/sessions/files/broadcast.ts
|
|
7212
7253
|
function filesBroadcast(dir, keep, registry2) {
|
|
7213
|
-
const latestPath =
|
|
7214
|
-
const historyPath =
|
|
7254
|
+
const latestPath = join22(dir, STATE_FILES.broadcast);
|
|
7255
|
+
const historyPath = join22(dir, STATE_FILES.history);
|
|
7215
7256
|
const list = () => {
|
|
7216
7257
|
const latest = asBroadcast(readJson3(latestPath));
|
|
7217
7258
|
if (!latest) return [];
|
|
@@ -7255,9 +7296,9 @@ function filesBroadcast(dir, keep, registry2) {
|
|
|
7255
7296
|
}
|
|
7256
7297
|
|
|
7257
7298
|
// src/sessions/files/leases.ts
|
|
7258
|
-
import { dirname as dirname12, join as
|
|
7299
|
+
import { dirname as dirname12, join as join23 } from "node:path";
|
|
7259
7300
|
function filesLeases(dir, files2 = {}) {
|
|
7260
|
-
const leasePath = (name) => files2[name]?.file ??
|
|
7301
|
+
const leasePath = (name) => files2[name]?.file ?? join23(dir, leaseFile(name));
|
|
7261
7302
|
const read4 = (name) => {
|
|
7262
7303
|
const lease = asLease(readJson3(leasePath(name)));
|
|
7263
7304
|
if (!lease || !alive(lease.pid)) return null;
|
|
@@ -7307,28 +7348,28 @@ function filesLeases(dir, files2 = {}) {
|
|
|
7307
7348
|
}
|
|
7308
7349
|
|
|
7309
7350
|
// src/sessions/files/mailbox.ts
|
|
7310
|
-
import { join as
|
|
7351
|
+
import { join as join24 } from "node:path";
|
|
7311
7352
|
var ID = /^\d{13}-[0-9a-f]{8}$/u;
|
|
7312
7353
|
var SAFE_KEY = /^@?[\w.-]+$/u;
|
|
7313
7354
|
function filesMailbox(dir, settings) {
|
|
7314
|
-
const messages =
|
|
7315
|
-
const inbox =
|
|
7316
|
-
const pathOf = (id) =>
|
|
7355
|
+
const messages = join24(dir, "messages");
|
|
7356
|
+
const inbox = join24(dir, "inbox");
|
|
7357
|
+
const pathOf = (id) => join24(messages, `${id}.json`);
|
|
7317
7358
|
const marker = (key, id, kind) => {
|
|
7318
7359
|
if (!SAFE_KEY.test(key) || !ID.test(id))
|
|
7319
7360
|
throw new Error(`invalid mailbox key ${key} or id ${id}`);
|
|
7320
|
-
return
|
|
7361
|
+
return join24(inbox, key, `${id}.${kind}`);
|
|
7321
7362
|
};
|
|
7322
7363
|
const audit = (event, fields2) => {
|
|
7323
7364
|
if (!settings.audit) return;
|
|
7324
7365
|
const line = { at: (/* @__PURE__ */ new Date()).toISOString(), event, ...fields2 };
|
|
7325
|
-
appendFileSync(
|
|
7366
|
+
appendFileSync(join24(dir, "messages.jsonl"), `${JSON.stringify(line)}
|
|
7326
7367
|
`, {
|
|
7327
7368
|
mode: 384
|
|
7328
7369
|
});
|
|
7329
7370
|
};
|
|
7330
7371
|
const touch = (path) => {
|
|
7331
|
-
mkdirSync(
|
|
7372
|
+
mkdirSync(join24(path, ".."), { recursive: true, mode: 448 });
|
|
7332
7373
|
try {
|
|
7333
7374
|
writeFileSync(path, "", { flag: "wx", mode: 384 });
|
|
7334
7375
|
return true;
|
|
@@ -7345,7 +7386,7 @@ function filesMailbox(dir, settings) {
|
|
|
7345
7386
|
if (existsSync(inbox))
|
|
7346
7387
|
for (const key of readdirSync(inbox))
|
|
7347
7388
|
for (const kind of ["ack", "delivered"])
|
|
7348
|
-
rmSync(
|
|
7389
|
+
rmSync(join24(inbox, key, `${message.id}.${kind}`), { force: true });
|
|
7349
7390
|
audit(event, { id: message.id });
|
|
7350
7391
|
};
|
|
7351
7392
|
return {
|
|
@@ -7421,9 +7462,9 @@ function filesMailbox(dir, settings) {
|
|
|
7421
7462
|
}
|
|
7422
7463
|
|
|
7423
7464
|
// src/sessions/files/pause.ts
|
|
7424
|
-
import { join as
|
|
7465
|
+
import { join as join25 } from "node:path";
|
|
7425
7466
|
function filesPause(dir, file2) {
|
|
7426
|
-
const path = file2 ??
|
|
7467
|
+
const path = file2 ?? join25(dir, STATE_FILES.pause);
|
|
7427
7468
|
return {
|
|
7428
7469
|
read: () => asPause(readJson3(path)),
|
|
7429
7470
|
write(pause2) {
|
|
@@ -7441,12 +7482,12 @@ function filesPause(dir, file2) {
|
|
|
7441
7482
|
}
|
|
7442
7483
|
|
|
7443
7484
|
// src/sessions/files/registry.ts
|
|
7444
|
-
import { join as
|
|
7485
|
+
import { join as join26 } from "node:path";
|
|
7445
7486
|
var SESSION_ID = /^[A-Za-z0-9_-]{8,64}$/u;
|
|
7446
7487
|
function filesRegistry(dir, staleMs) {
|
|
7447
|
-
const records =
|
|
7448
|
-
const dirs = [records,
|
|
7449
|
-
const pathsOf = (session) => dirs.map((records2) =>
|
|
7488
|
+
const records = join26(dir, STATE_FILES.records);
|
|
7489
|
+
const dirs = [records, join26(dir, STATE_FILES.legacyRecords)];
|
|
7490
|
+
const pathsOf = (session) => dirs.map((records2) => join26(records2, `${session}.json`));
|
|
7450
7491
|
const get = (session) => {
|
|
7451
7492
|
if (!SESSION_ID.test(session)) return null;
|
|
7452
7493
|
return latestRecord(
|
|
@@ -7465,7 +7506,7 @@ function filesRegistry(dir, staleMs) {
|
|
|
7465
7506
|
for (const name of names4)
|
|
7466
7507
|
found2.set(name, [
|
|
7467
7508
|
...found2.get(name) ?? [],
|
|
7468
|
-
asRecord(readJson3(
|
|
7509
|
+
asRecord(readJson3(join26(folder, name)))
|
|
7469
7510
|
]);
|
|
7470
7511
|
}
|
|
7471
7512
|
return [...found2.values()].map(latestRecord).filter((record) => record !== null).map((record) => ({ ...record, live: isLive(record, now, staleMs) }));
|
|
@@ -7492,7 +7533,7 @@ function filesRegistry(dir, staleMs) {
|
|
|
7492
7533
|
next["worktree"] = checkout?.root ?? "";
|
|
7493
7534
|
next["branch"] = checkout?.branch ?? "";
|
|
7494
7535
|
}
|
|
7495
|
-
writeJson(
|
|
7536
|
+
writeJson(join26(records, `${session}.json`), next);
|
|
7496
7537
|
return next;
|
|
7497
7538
|
},
|
|
7498
7539
|
sweep(now = Date.now()) {
|
|
@@ -13,12 +13,12 @@ async function run(context) {
|
|
|
13
13
|
const [verb = "list", ...extra] = context.args.positional;
|
|
14
14
|
if (!VERBS.includes(verb)) throw unknownSubcommand("hooks", verb, VERBS);
|
|
15
15
|
if (extra.length) throw new ArgumentError(`unexpected ${extra.join(" ")}`);
|
|
16
|
-
if (verb === "list") return (await import("./list-
|
|
17
|
-
if (verb === "test") return (await import("./test-
|
|
16
|
+
if (verb === "list") return (await import("./list-BVKM5YYP.js")).run(context);
|
|
17
|
+
if (verb === "test") return (await import("./test-ABDOR6OT.js")).run(context);
|
|
18
18
|
return (await import("./report-MWXB5XKE.js")).run(context);
|
|
19
19
|
}
|
|
20
20
|
var hooksCommand = { ...hooksSpec, run };
|
|
21
21
|
export {
|
|
22
22
|
hooksCommand
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=hooks-
|
|
24
|
+
//# sourceMappingURL=hooks-NL2NU4LD.js.map
|
|
@@ -20,7 +20,7 @@ async function run(context) {
|
|
|
20
20
|
throw unknownSubcommand("host io", verb, verbs);
|
|
21
21
|
if (extra !== void 0) throw new ArgumentError(`unexpected ${extra}`);
|
|
22
22
|
if (verb === "measure")
|
|
23
|
-
return (await import("./measure-
|
|
23
|
+
return (await import("./measure-PV54XMHK.js")).ioMeasure(context);
|
|
24
24
|
if (verb === "plan")
|
|
25
25
|
return (await import("./plan-46BTJQIV.js")).ioPlanCommand(context);
|
|
26
26
|
return (await import("./doctor-NKFZNSRD.js")).ioDoctor(context);
|
|
@@ -29,4 +29,4 @@ var hostCommand = { ...hostSpec, run };
|
|
|
29
29
|
export {
|
|
30
30
|
hostCommand
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=host-
|
|
32
|
+
//# sourceMappingURL=host-4PTSDTS6.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
requireTerminal,
|
|
3
3
|
terminalSupport
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7PYTXWZE.js";
|
|
5
5
|
import "./chunk-5ZABTVSW.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-C3YIVQGU.js";
|
|
7
7
|
import "./chunk-LMT3PPXJ.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-2ZNKC6ZB.js";
|
|
9
9
|
import "./chunk-R2GPCZUX.js";
|
|
10
10
|
import "./chunk-34DECPVC.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-POWQPJ5V.js";
|
|
12
12
|
import "./chunk-PZ6D3WKD.js";
|
|
13
13
|
import "./chunk-N7ANFMA5.js";
|
|
14
14
|
import "./chunk-TYY5TYHF.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-KLIYFD3W.js";
|
|
|
17
17
|
import "./chunk-GUHOEIHP.js";
|
|
18
18
|
import "./chunk-IJBSOWHK.js";
|
|
19
19
|
import "./chunk-XWLMZKH2.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-DXQPI4QB.js";
|
|
21
21
|
import "./chunk-GJXOFDJT.js";
|
|
22
22
|
import "./chunk-PMJG2CXF.js";
|
|
23
23
|
import "./chunk-J6KL3COD.js";
|
|
@@ -25,4 +25,4 @@ export {
|
|
|
25
25
|
requireTerminal,
|
|
26
26
|
terminalSupport
|
|
27
27
|
};
|
|
28
|
-
//# sourceMappingURL=host-
|
|
28
|
+
//# sourceMappingURL=host-EI63IQAF.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
} from "./chunk-F5XMGOOX.js";
|
|
5
5
|
import {
|
|
6
6
|
specFrom
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MYEVRRG2.js";
|
|
8
8
|
import "./chunk-7CHUMF3E.js";
|
|
9
9
|
import {
|
|
10
10
|
approvalDir,
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
hostDigest,
|
|
13
13
|
projectedFiles,
|
|
14
14
|
writeApproval
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-7JIJPBER.js";
|
|
16
|
+
import "./chunk-LYVMXH4Y.js";
|
|
17
|
+
import "./chunk-3WXRU25Q.js";
|
|
18
18
|
import "./chunk-FLG7VRTC.js";
|
|
19
19
|
import "./chunk-2GD7PQ7J.js";
|
|
20
20
|
import "./chunk-EATCUWGG.js";
|
|
@@ -26,7 +26,7 @@ import "./chunk-LFFIQBNY.js";
|
|
|
26
26
|
import "./chunk-HQOB7OQS.js";
|
|
27
27
|
import "./chunk-73AKO4UL.js";
|
|
28
28
|
import "./chunk-VQBXWMLT.js";
|
|
29
|
-
import "./chunk-
|
|
29
|
+
import "./chunk-5WAMDZHF.js";
|
|
30
30
|
import "./chunk-WUFNKK3U.js";
|
|
31
31
|
import "./chunk-374AZ4J4.js";
|
|
32
32
|
import "./chunk-SDFJJJB5.js";
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
} from "./chunk-Y6NFETNG.js";
|
|
43
43
|
import {
|
|
44
44
|
hostDoctor
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-POWQPJ5V.js";
|
|
46
46
|
import "./chunk-PZ6D3WKD.js";
|
|
47
47
|
import "./chunk-N7ANFMA5.js";
|
|
48
48
|
import "./chunk-TYY5TYHF.js";
|
|
@@ -51,7 +51,7 @@ import "./chunk-KLIYFD3W.js";
|
|
|
51
51
|
import "./chunk-GUHOEIHP.js";
|
|
52
52
|
import "./chunk-IJBSOWHK.js";
|
|
53
53
|
import "./chunk-XWLMZKH2.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-DXQPI4QB.js";
|
|
55
55
|
import "./chunk-GJXOFDJT.js";
|
|
56
56
|
import "./chunk-PMJG2CXF.js";
|
|
57
57
|
import "./chunk-J6KL3COD.js";
|
|
@@ -145,7 +145,7 @@ async function runHost(context) {
|
|
|
145
145
|
return 1;
|
|
146
146
|
}
|
|
147
147
|
if (verb === "up" || verb === "down" || verb === "unit") {
|
|
148
|
-
const { runHostVerb } = await import("./host-run-
|
|
148
|
+
const { runHostVerb } = await import("./host-run-RFDKRQIK.js");
|
|
149
149
|
return runHostVerb(verb, spec, context);
|
|
150
150
|
}
|
|
151
151
|
if (verb === "status") {
|
|
@@ -173,4 +173,4 @@ async function runHost(context) {
|
|
|
173
173
|
export {
|
|
174
174
|
runHost
|
|
175
175
|
};
|
|
176
|
-
//# sourceMappingURL=host-
|
|
176
|
+
//# sourceMappingURL=host-OABIC6HJ.js.map
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
approvalDir,
|
|
7
7
|
approvalState
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7JIJPBER.js";
|
|
9
9
|
import {
|
|
10
10
|
ArgumentError
|
|
11
11
|
} from "./chunk-Y6NFETNG.js";
|
|
12
12
|
import {
|
|
13
13
|
missingBinary,
|
|
14
14
|
ptyBinary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-POWQPJ5V.js";
|
|
16
16
|
import "./chunk-PZ6D3WKD.js";
|
|
17
17
|
import "./chunk-N7ANFMA5.js";
|
|
18
18
|
import "./chunk-TYY5TYHF.js";
|
|
@@ -25,7 +25,7 @@ import "./chunk-IJBSOWHK.js";
|
|
|
25
25
|
import "./chunk-XWLMZKH2.js";
|
|
26
26
|
import {
|
|
27
27
|
VERSION
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-DXQPI4QB.js";
|
|
29
29
|
import "./chunk-GJXOFDJT.js";
|
|
30
30
|
import "./chunk-PMJG2CXF.js";
|
|
31
31
|
import {
|
|
@@ -333,4 +333,4 @@ async function runHostVerb(verb, spec, context) {
|
|
|
333
333
|
export {
|
|
334
334
|
runHostVerb
|
|
335
335
|
};
|
|
336
|
-
//# sourceMappingURL=host-run-
|
|
336
|
+
//# sourceMappingURL=host-run-RFDKRQIK.js.map
|
package/dist/http.js
CHANGED
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
} from "./chunk-ANJMLKBR.js";
|
|
7
7
|
import {
|
|
8
8
|
readMcp
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-LYVMXH4Y.js";
|
|
10
|
+
import "./chunk-3WXRU25Q.js";
|
|
11
11
|
import "./chunk-FLG7VRTC.js";
|
|
12
12
|
import "./chunk-2GD7PQ7J.js";
|
|
13
13
|
import "./chunk-EATCUWGG.js";
|
|
@@ -17,7 +17,7 @@ import "./chunk-LFFIQBNY.js";
|
|
|
17
17
|
import "./chunk-HQOB7OQS.js";
|
|
18
18
|
import "./chunk-73AKO4UL.js";
|
|
19
19
|
import "./chunk-VQBXWMLT.js";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-5WAMDZHF.js";
|
|
21
21
|
import "./chunk-WUFNKK3U.js";
|
|
22
22
|
import "./chunk-374AZ4J4.js";
|
|
23
23
|
import "./chunk-SDFJJJB5.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
ArgumentError,
|
|
34
34
|
many
|
|
35
35
|
} from "./chunk-Y6NFETNG.js";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-POWQPJ5V.js";
|
|
37
37
|
import "./chunk-PZ6D3WKD.js";
|
|
38
38
|
import "./chunk-N7ANFMA5.js";
|
|
39
39
|
import {
|
|
@@ -44,7 +44,7 @@ import "./chunk-KLIYFD3W.js";
|
|
|
44
44
|
import "./chunk-GUHOEIHP.js";
|
|
45
45
|
import "./chunk-IJBSOWHK.js";
|
|
46
46
|
import "./chunk-XWLMZKH2.js";
|
|
47
|
-
import "./chunk-
|
|
47
|
+
import "./chunk-DXQPI4QB.js";
|
|
48
48
|
import "./chunk-GJXOFDJT.js";
|
|
49
49
|
import "./chunk-PMJG2CXF.js";
|
|
50
50
|
import "./chunk-J6KL3COD.js";
|
|
@@ -409,4 +409,4 @@ function importMcp(context) {
|
|
|
409
409
|
export {
|
|
410
410
|
importMcp
|
|
411
411
|
};
|
|
412
|
-
//# sourceMappingURL=import-mcp-
|
|
412
|
+
//# sourceMappingURL=import-mcp-V4SU2PZC.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -304,7 +304,7 @@ declare function resolveSkillFileUri(uri: string, entries: readonly SkillEntry[]
|
|
|
304
304
|
} | null;
|
|
305
305
|
|
|
306
306
|
declare const SERVER_NAME = "pmcp";
|
|
307
|
-
declare const SERVER_VERSION = "0.
|
|
307
|
+
declare const SERVER_VERSION = "0.29.0";
|
|
308
308
|
declare function registerSkillTools(server: McpServer, tools: SkillTools): McpServer;
|
|
309
309
|
interface SkillMcpOptions extends SkillServerOptions {
|
|
310
310
|
readonly mailbox?: MailboxService;
|
package/dist/index.js
CHANGED
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
} from "./chunk-YOWIYFIV.js";
|
|
5
5
|
import {
|
|
6
6
|
doctor
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-QTLPN3MY.js";
|
|
8
|
+
import "./chunk-7JIJPBER.js";
|
|
9
9
|
import "./chunk-JQVSDPFL.js";
|
|
10
10
|
import "./chunk-VJFEN6DJ.js";
|
|
11
11
|
import "./chunk-NHUMPEPV.js";
|
|
12
12
|
import "./chunk-TIA4SPU2.js";
|
|
13
13
|
import {
|
|
14
14
|
project
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I5JI547U.js";
|
|
16
16
|
import "./chunk-ANJMLKBR.js";
|
|
17
17
|
import {
|
|
18
18
|
prepareSearch
|
|
19
19
|
} from "./chunk-NLHLA2N5.js";
|
|
20
20
|
import {
|
|
21
21
|
deadGlobs
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-OUKRDS4O.js";
|
|
23
23
|
import {
|
|
24
24
|
plan,
|
|
25
25
|
readSpec
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
} from "./chunk-LYVMXH4Y.js";
|
|
27
|
+
import "./chunk-3WXRU25Q.js";
|
|
28
28
|
import "./chunk-FLG7VRTC.js";
|
|
29
29
|
import "./chunk-2GD7PQ7J.js";
|
|
30
30
|
import "./chunk-EATCUWGG.js";
|
|
@@ -34,7 +34,7 @@ import "./chunk-LFFIQBNY.js";
|
|
|
34
34
|
import "./chunk-HQOB7OQS.js";
|
|
35
35
|
import "./chunk-73AKO4UL.js";
|
|
36
36
|
import "./chunk-VQBXWMLT.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-5WAMDZHF.js";
|
|
38
38
|
import "./chunk-WUFNKK3U.js";
|
|
39
39
|
import "./chunk-374AZ4J4.js";
|
|
40
40
|
import "./chunk-SDFJJJB5.js";
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
registerSkillsExtension,
|
|
87
87
|
resolveSkillFileUri,
|
|
88
88
|
skillFileUri
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-L7SCC2OS.js";
|
|
90
90
|
import {
|
|
91
91
|
normaliseIntent
|
|
92
92
|
} from "./chunk-6WXMJOMI.js";
|
|
@@ -121,7 +121,7 @@ import {
|
|
|
121
121
|
import "./chunk-6STKGOCW.js";
|
|
122
122
|
import {
|
|
123
123
|
LOCK_FILE
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-POWQPJ5V.js";
|
|
125
125
|
import "./chunk-PZ6D3WKD.js";
|
|
126
126
|
import "./chunk-N7ANFMA5.js";
|
|
127
127
|
import {
|
|
@@ -133,7 +133,7 @@ import "./chunk-KLIYFD3W.js";
|
|
|
133
133
|
import "./chunk-GUHOEIHP.js";
|
|
134
134
|
import "./chunk-IJBSOWHK.js";
|
|
135
135
|
import "./chunk-XWLMZKH2.js";
|
|
136
|
-
import "./chunk-
|
|
136
|
+
import "./chunk-DXQPI4QB.js";
|
|
137
137
|
import {
|
|
138
138
|
CONFIG_FILE,
|
|
139
139
|
ConfigError,
|
|
@@ -6,9 +6,9 @@ import "./chunk-JPYQDOEW.js";
|
|
|
6
6
|
// src/commands/init.ts
|
|
7
7
|
var initCommand = {
|
|
8
8
|
...initSpec,
|
|
9
|
-
run: async (context) => (await import("./run-
|
|
9
|
+
run: async (context) => (await import("./run-RGFWSEEL.js")).run(context)
|
|
10
10
|
};
|
|
11
11
|
export {
|
|
12
12
|
initCommand
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=init-
|
|
14
|
+
//# sourceMappingURL=init-WWXUT7II.js.map
|