@modootoday/pmcp 0.19.9 → 0.21.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-TM6B2Y3G.js → apply-6FLMTJDV.js} +57 -23
- package/dist/{attachment-D84OGI6n.d.ts → attachment-ms6s8Aow.d.ts} +1 -1
- package/dist/{available-HYSDAFYH.js → available-BFXLII4A.js} +7 -7
- package/dist/{broadcast-DSCHWUMB.js → broadcast-ZALGUJVR.js} +4 -4
- package/dist/chunk-2GI5RM3M.js +53 -0
- package/dist/{chunk-ICF2JZSN.js → chunk-2MAD4WNZ.js} +2 -2
- package/dist/{chunk-QYQGPDBE.js → chunk-33KGCJB2.js} +2 -2
- package/dist/{chunk-XNPOHPMJ.js → chunk-3X5JQYKN.js} +3 -3
- package/dist/{chunk-4XNAKVSO.js → chunk-57Q75MS4.js} +18 -18
- package/dist/{chunk-2S44RDO4.js → chunk-5FW7A6TG.js} +7 -4
- package/dist/chunk-5YCKFU5Q.js +1672 -0
- package/dist/{chunk-MCYGYZVZ.js → chunk-7FV2LORT.js} +2 -2
- package/dist/{chunk-57FHYW74.js → chunk-DEY23WTH.js} +122 -4
- package/dist/chunk-DJZPPCJP.js +274 -0
- package/dist/{chunk-4XWVLC23.js → chunk-G6JXCUSK.js} +2 -2
- package/dist/{chunk-T6GOWHK6.js → chunk-GFOQDLPL.js} +6 -1
- package/dist/{chunk-PG42KALG.js → chunk-GQP4GWU4.js} +5 -5
- package/dist/chunk-H4ZOKIER.js +7 -0
- package/dist/{chunk-XPWIJOZT.js → chunk-JQVSDPFL.js} +3 -3
- package/dist/{chunk-OG7QR2DP.js → chunk-KEHB4FZP.js} +17 -2
- package/dist/chunk-KUBHGVTD.js +126 -0
- package/dist/{chunk-SPUCY4AG.js → chunk-KVNNVLJR.js} +2 -2
- package/dist/chunk-LFFIQBNY.js +115 -0
- package/dist/{chunk-V7HG3STC.js → chunk-MR5IBS6L.js} +31 -15
- package/dist/{chunk-W5RLIUNC.js → chunk-NHUMPEPV.js} +2 -2
- package/dist/{chunk-I4DLMIN5.js → chunk-OFJIMBTL.js} +2 -2
- package/dist/{chunk-A6TM4NTI.js → chunk-OFPNCLG7.js} +2 -2
- package/dist/{chunk-3UOFHLY4.js → chunk-OS5DF3LL.js} +207 -15
- package/dist/{chunk-BZ2RXI5I.js → chunk-POTI2RJ6.js} +2 -2
- package/dist/{chunk-QTKD7JEL.js → chunk-R3MVL67T.js} +34 -34
- package/dist/{chunk-YN5GQCHN.js → chunk-RHJEGLYM.js} +6 -1
- package/dist/{chunk-YKU7KHJO.js → chunk-TBKVC2TA.js} +3 -5
- package/dist/{chunk-YYG3GUQW.js → chunk-UFWQTZDX.js} +29 -17
- package/dist/{chunk-PBDPWE5J.js → chunk-VBDDFO2V.js} +2 -2
- package/dist/{chunk-BRSESCGX.js → chunk-VUM6LO77.js} +4717 -4694
- package/dist/{chunk-FR6JHNLC.js → chunk-YLITJLTR.js} +3 -3
- package/dist/{chunk-CJ6OFTS3.js → chunk-YOWIYFIV.js} +6 -37
- package/dist/{chunk-VDBUZKXC.js → chunk-Z4Q6RYJH.js} +2 -2
- package/dist/{chunk-RRKGSYQ4.js → chunk-Z6WRFOFT.js} +13 -2
- package/dist/{chunk-YXAPCHXJ.js → chunk-ZIJ5IUXH.js} +31 -5
- package/dist/{claude-2C5L2HQL.js → claude-XVLF4N4S.js} +3 -3
- package/dist/{cli-BVRPAI23.js → cli-6FWRBCWM.js} +8 -8
- package/dist/{cli-YV6SFE4D.js → cli-RVPR3MH3.js} +7 -7
- package/dist/cli.js +11 -11
- package/dist/{completion-B3UT3GVI.js → completion-YTPHEVEW.js} +7 -7
- package/dist/{diagnostics-ONIAKCA3.js → diagnostics-IW54MLFK.js} +5 -6
- package/dist/{doctor-MJFU5L6R.js → doctor-EN4JPSKV.js} +35 -35
- package/dist/{entry-DZGKCL4G.js → entry-TQWSDTJ4.js} +14 -15
- package/dist/{exec-mcp-QK2VC6RX.js → exec-mcp-KKQ75N5O.js} +15 -13
- package/dist/{harness-GTED4GLK.js → harness-EB76F6BG.js} +6 -6
- package/dist/harness-launch-gate.js +3 -4
- package/dist/harness-worker.js +5 -6
- package/dist/hook-body.js +281 -98
- package/dist/{hook-spec-C7umArqw.d.ts → hook-spec-hZL4MSgi.d.ts} +8 -3
- package/dist/hooks-YWSHUNLM.js +24 -0
- package/dist/{host-AGNF2AQH.js → host-LSVITS6M.js} +6 -7
- package/dist/{host-3HTCZNVJ.js → host-OGGADMBT.js} +17 -15
- package/dist/{host-run-2OQZVQID.js → host-run-XO2TS4JC.js} +5 -7
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/{import-mcp-7KEPR2B6.js → import-mcp-BJDJTPVS.js} +14 -11
- package/dist/index.d.ts +12 -3
- package/dist/index.js +25 -25
- package/dist/{init-BHGCF7JL.js → init-773PTQM5.js} +3 -3
- package/dist/{install-HF6CROQP.js → install-7V6NIA7W.js} +4 -4
- package/dist/{invoke-CVHF6PEK.js → invoke-Y7XH5S2L.js} +7 -8
- package/dist/{list-6XGQ3FR3.js → list-5W65XVES.js} +20 -17
- package/dist/{logout-6RJLG2KG.js → logout-XO6ALD45.js} +15 -12
- package/dist/{logs-VTW7S2LR.js → logs-74JGLQG6.js} +4 -4
- package/dist/mailbox/index.d.ts +3 -3
- package/dist/{mailbox-CNAONXN7.js → mailbox-VK5AVTHI.js} +9 -9
- package/dist/{mainline-JSG4MUKH.js → mainline-M2NSTAGC.js} +105 -36
- package/dist/{mcp-P55VLQLR.js → mcp-R62ZNVGJ.js} +2 -2
- package/dist/{pause-V5VCNOSH.js → pause-CZ2OZYLC.js} +4 -4
- package/dist/project/hook-adapter.d.ts +1 -1
- package/dist/{project-B57IQPDK.js → project-W5DQIZA6.js} +5 -5
- package/dist/{pty-FD4JGBZL.js → pty-CDLQ4NP2.js} +3 -3
- package/dist/report-Z3JV2PCT.js +105 -0
- package/dist/{resume-7S4K3R4X.js → resume-DFIHT2RO.js} +4 -4
- package/dist/{run-MC2BPLOE.js → run-OZLGSRHF.js} +14 -11
- package/dist/{run-LFJXONLW.js → run-WYJMTLX7.js} +4 -4
- package/dist/{serve-TFAEVXX3.js → serve-DCQGAGB7.js} +3 -3
- package/dist/{session-XM2CR425.js → session-YZVX4NGN.js} +4 -4
- package/dist/{setup-FHFQZJY6.js → setup-D3KEJBGO.js} +4 -4
- package/dist/smoke-FQQJOQBD.js +16 -0
- package/dist/{start-login-KXOHCR5A.js → start-login-EKXM75XQ.js} +15 -12
- package/dist/{status-YXOIEVOJ.js → status-23UDIYYP.js} +39 -22
- package/dist/{status-OYRB3KL5.js → status-3RTGDN2K.js} +10 -10
- package/dist/{status-AW7DOW7A.js → status-EDSEG32U.js} +15 -12
- package/dist/stdio.d.ts +2 -2
- package/dist/stdio.js +2 -2
- package/dist/{sweep-ZSYG6FNR.js → sweep-EPJMEZR6.js} +4 -4
- package/dist/{test-2HTOY4PJ.js → test-TM6PIZTV.js} +26 -18
- package/dist/{tui-DQFXYQ4H.js → tui-EQNJIDN5.js} +4 -4
- package/dist/{unbroadcast-FONZJWEW.js → unbroadcast-NTOC3PY3.js} +4 -4
- package/dist/{validate-WOFI7TMT.js → validate-KFBCUFI4.js} +2 -2
- package/dist/{worker-UXPGXAV2.js → worker-7X6WBPEI.js} +9 -10
- package/dist/{worktree-list-4PLE7K6L.js → worktree-list-EMKUMCTQ.js} +2 -2
- package/dist/{worktree-sync-GQVYAXGJ.js → worktree-sync-T6C5YEYS.js} +3 -3
- package/docs/commands.md +13 -6
- package/docs/git-workflow.md +46 -10
- package/docs/hooks.md +139 -12
- package/docs/project-configuration.md +34 -6
- package/docs/upgrading.md +94 -0
- 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/mod/reader/read.ts +14 -4
- package/plugins/pmcp/mod/sessions/format.ts +16 -1
- package/plugins/pmcp/mod/sessions/types.ts +1 -1
- package/plugins/pmcp/plugin.json +1 -1
- package/schema/catalog-v1.json +1 -7
- package/dist/chunk-EONAJAMJ.js +0 -130
- package/dist/chunk-IACJDHFQ.js +0 -1025
- package/dist/chunk-ISNRDHSD.js +0 -74
- package/dist/chunk-YGTJQVCK.js +0 -7
- package/dist/chunk-YLPXTJJM.js +0 -396
- package/dist/hooks-FRZ4SUNJ.js +0 -21
- package/dist/{core-C1LPjxK6.d.ts → core-Sug_rZrx.d.ts} +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
storeFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7FV2LORT.js";
|
|
4
4
|
import {
|
|
5
5
|
pmcpCommand
|
|
6
6
|
} from "./chunk-EATCUWGG.js";
|
|
7
7
|
import {
|
|
8
8
|
ptyRef
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OFJIMBTL.js";
|
|
10
10
|
import {
|
|
11
11
|
addressedTo,
|
|
12
12
|
inboxKey,
|
|
13
13
|
normalizeSelector,
|
|
14
14
|
sentBy
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MR5IBS6L.js";
|
|
16
16
|
import {
|
|
17
17
|
ancestors
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Z6WRFOFT.js";
|
|
19
19
|
import {
|
|
20
20
|
ArgumentError,
|
|
21
21
|
many,
|
|
@@ -68,7 +68,7 @@ function inferSession(env, records, chain) {
|
|
|
68
68
|
|
|
69
69
|
// src/sessions/wake/index.ts
|
|
70
70
|
var TRANSPORTS = {
|
|
71
|
-
claude: async () => (await import("./claude-
|
|
71
|
+
claude: async () => (await import("./claude-XVLF4N4S.js")).claudeInbox,
|
|
72
72
|
opencode: async () => (await import("./opencode-CN7JLQYO.js")).opencodeServer
|
|
73
73
|
};
|
|
74
74
|
function recipientOf(record) {
|
|
@@ -78,7 +78,7 @@ function recipientOf(record) {
|
|
|
78
78
|
session: record.session,
|
|
79
79
|
...record.alias ? { alias: record.alias } : {},
|
|
80
80
|
roles,
|
|
81
|
-
...record.worktree ? {
|
|
81
|
+
...record.worktree ? { worktree: record.worktree } : {},
|
|
82
82
|
...record.startedAt ? { since: record.startedAt } : {}
|
|
83
83
|
};
|
|
84
84
|
}
|
|
@@ -90,7 +90,7 @@ function wakeText(session, mail, pmcp = "pmcp") {
|
|
|
90
90
|
var NONE = "no wake transport for this runtime; the mail arrives at its next event";
|
|
91
91
|
async function wakeOne(record, text, context) {
|
|
92
92
|
if (ptyRef(record))
|
|
93
|
-
return (await import("./pty-
|
|
93
|
+
return (await import("./pty-CDLQ4NP2.js")).ptyTurn(record, text, context);
|
|
94
94
|
const load = TRANSPORTS[record.runtime ?? ""];
|
|
95
95
|
if (load) return (await load()).wake(record, text, context);
|
|
96
96
|
const runtime = record.runtime ?? "unknown";
|
|
@@ -156,7 +156,7 @@ function caller(context, store) {
|
|
|
156
156
|
...session ? { session } : {},
|
|
157
157
|
...alias ? { alias } : {},
|
|
158
158
|
roles,
|
|
159
|
-
...record?.worktree ? {
|
|
159
|
+
...record?.worktree ? { worktree: record.worktree } : {},
|
|
160
160
|
...record?.startedAt ? { since: record.startedAt } : {}
|
|
161
161
|
};
|
|
162
162
|
}
|
|
@@ -281,4 +281,4 @@ export {
|
|
|
281
281
|
reply,
|
|
282
282
|
send
|
|
283
283
|
};
|
|
284
|
-
//# sourceMappingURL=mailbox-
|
|
284
|
+
//# sourceMappingURL=mailbox-VK5AVTHI.js.map
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
isAncestor,
|
|
18
18
|
touchedPaths,
|
|
19
19
|
undelivered
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KUBHGVTD.js";
|
|
21
21
|
import {
|
|
22
22
|
reportModes,
|
|
23
23
|
restoreModes,
|
|
@@ -27,12 +27,14 @@ import {
|
|
|
27
27
|
import {
|
|
28
28
|
gateTreePath,
|
|
29
29
|
leaseSpecs
|
|
30
|
-
} from "./chunk-
|
|
31
|
-
import
|
|
30
|
+
} from "./chunk-ZIJ5IUXH.js";
|
|
31
|
+
import {
|
|
32
|
+
detect
|
|
33
|
+
} from "./chunk-2Q6MNGU5.js";
|
|
32
34
|
import {
|
|
33
35
|
createFilesStore
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
36
|
+
} from "./chunk-MR5IBS6L.js";
|
|
37
|
+
import "./chunk-Z6WRFOFT.js";
|
|
36
38
|
import {
|
|
37
39
|
git,
|
|
38
40
|
gitOk,
|
|
@@ -47,6 +49,7 @@ import "./chunk-PMJG2CXF.js";
|
|
|
47
49
|
|
|
48
50
|
// src/git/mainline/deliver.ts
|
|
49
51
|
import { readFileSync as readFileSync2 } from "fs";
|
|
52
|
+
import { dirname as dirname3, join as join5 } from "path";
|
|
50
53
|
import { loadavg } from "os";
|
|
51
54
|
|
|
52
55
|
// src/git/mainline/gate.ts
|
|
@@ -379,6 +382,23 @@ function subject(cwd, sha) {
|
|
|
379
382
|
function fetch(ctx) {
|
|
380
383
|
return git(ctx.root, ["fetch", "-q", ctx.remote, ctx.mainline]).status === 0;
|
|
381
384
|
}
|
|
385
|
+
function push(options, tip, preHook) {
|
|
386
|
+
const { ctx, report } = options;
|
|
387
|
+
const lockEnv = options.gate?.lockEnv;
|
|
388
|
+
const env = {
|
|
389
|
+
...options.deliver.pushEnv,
|
|
390
|
+
...preHook && lockEnv ? { [lockEnv]: "1" } : {},
|
|
391
|
+
PMCP_GIT_DELIVER: "1"
|
|
392
|
+
};
|
|
393
|
+
const args = ["push", ctx.remote, `${tip}:refs/heads/${ctx.mainline}`];
|
|
394
|
+
if (!preHook) return git(ctx.root, args, env);
|
|
395
|
+
const dir = options.gate?.logDir ?? join5(dirname3(gateTree(options.tree).tree), "logs");
|
|
396
|
+
const log = gateLog(dir, tip);
|
|
397
|
+
report.info(`the pre-push hook gates ${tip.slice(0, 10)}; gate log: ${log}`);
|
|
398
|
+
const status = runCommandLogged(["git", ...args], ctx.root, log, env);
|
|
399
|
+
if (options.track) options.track.gate = { exit: status, log, by: "pre-push" };
|
|
400
|
+
return { status, stdout: "", stderr: "" };
|
|
401
|
+
}
|
|
382
402
|
function attempts(options) {
|
|
383
403
|
const { ctx, report } = options;
|
|
384
404
|
const { lock, tree } = gateTree(options.tree);
|
|
@@ -407,7 +427,9 @@ function attempts(options) {
|
|
|
407
427
|
report.warn(replayed.error);
|
|
408
428
|
return 1;
|
|
409
429
|
}
|
|
410
|
-
|
|
430
|
+
if (options.track) options.track.replayed = replayed.tip;
|
|
431
|
+
const preHook = options.deliver.gate === "pre-push";
|
|
432
|
+
const command = preHook ? void 0 : options.gate?.command;
|
|
411
433
|
if (command !== void 0) {
|
|
412
434
|
const run = runGate(
|
|
413
435
|
ctx.mainRoot,
|
|
@@ -420,19 +442,20 @@ function attempts(options) {
|
|
|
420
442
|
options.gate?.logDir,
|
|
421
443
|
options.umask !== void 0
|
|
422
444
|
);
|
|
423
|
-
if (options.track)
|
|
445
|
+
if (options.track)
|
|
446
|
+
options.track.gate = { exit: run.code, log: run.log, by: "command" };
|
|
424
447
|
if (run.code !== 0) {
|
|
425
448
|
report.warn("the gate failed; nothing was pushed");
|
|
426
449
|
return 1;
|
|
427
450
|
}
|
|
428
451
|
}
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
);
|
|
452
|
+
if (options.noPush) {
|
|
453
|
+
report.info(
|
|
454
|
+
`replayed ${replayed.tip.slice(0, 10)}; --no-push, so nothing was pushed`
|
|
455
|
+
);
|
|
456
|
+
return 0;
|
|
457
|
+
}
|
|
458
|
+
const pushed = push(options, replayed.tip, preHook);
|
|
436
459
|
if (pushed.status === 0) {
|
|
437
460
|
if (options.track) options.track.delivered = replayed.tip;
|
|
438
461
|
report.info(`delivered ${replayed.tip.slice(0, 10)} to ${ctx.upstream}`);
|
|
@@ -440,10 +463,15 @@ function attempts(options) {
|
|
|
440
463
|
}
|
|
441
464
|
fetch(ctx);
|
|
442
465
|
if (isAncestor(ctx.root, ctx.upstream, replayed.tip)) {
|
|
443
|
-
|
|
444
|
-
|
|
466
|
+
if (preHook)
|
|
467
|
+
report.warn(
|
|
468
|
+
`the pre-push gate failed (exit ${pushed.status}); nothing was pushed; full gate log: ${options.track?.gate?.log}`
|
|
469
|
+
);
|
|
470
|
+
else
|
|
471
|
+
report.warn(
|
|
472
|
+
`the push failed for a reason other than a newer ${ctx.upstream}:
|
|
445
473
|
${pushed.stderr.trim()}`
|
|
446
|
-
|
|
474
|
+
);
|
|
447
475
|
return 1;
|
|
448
476
|
}
|
|
449
477
|
report.info(`${ctx.upstream} moved while the gate ran; replaying again`);
|
|
@@ -514,7 +542,7 @@ function underLock(options) {
|
|
|
514
542
|
});
|
|
515
543
|
try {
|
|
516
544
|
if (!loadAllows(options)) return 1;
|
|
517
|
-
if (options.pushPins && !pinsPushed(options)) return 1;
|
|
545
|
+
if (options.pushPins && !options.noPush && !pinsPushed(options)) return 1;
|
|
518
546
|
return attempts(options);
|
|
519
547
|
} finally {
|
|
520
548
|
removeHolder(lock);
|
|
@@ -535,7 +563,14 @@ function blocked(options) {
|
|
|
535
563
|
);
|
|
536
564
|
}
|
|
537
565
|
function deliver(options) {
|
|
538
|
-
const track = {
|
|
566
|
+
const track = {
|
|
567
|
+
attempts: 0,
|
|
568
|
+
gate: null,
|
|
569
|
+
replayed: null,
|
|
570
|
+
delivered: null,
|
|
571
|
+
leases: [],
|
|
572
|
+
sync: null
|
|
573
|
+
};
|
|
539
574
|
let reason;
|
|
540
575
|
const report = {
|
|
541
576
|
info: (line) => options.report.info(line),
|
|
@@ -554,14 +589,22 @@ function deliver(options) {
|
|
|
554
589
|
delivered: track.delivered,
|
|
555
590
|
upstream: options.ctx.upstream,
|
|
556
591
|
attempts: track.attempts,
|
|
592
|
+
replayed: track.replayed,
|
|
557
593
|
gate: track.gate,
|
|
558
594
|
leases: track.leases,
|
|
595
|
+
sync: track.sync,
|
|
559
596
|
...code !== 0 && reason ? { reason } : {}
|
|
560
597
|
});
|
|
561
598
|
return code;
|
|
562
599
|
}
|
|
563
600
|
function deliverOnce(options) {
|
|
564
601
|
const { ctx, report } = options;
|
|
602
|
+
if (options.noPush && options.deliver.gate === "pre-push") {
|
|
603
|
+
report.warn(
|
|
604
|
+
'--no-push cannot gate with gate = "pre-push": the push is the gate; nothing ran'
|
|
605
|
+
);
|
|
606
|
+
return 2;
|
|
607
|
+
}
|
|
565
608
|
const refusal2 = blocked(options);
|
|
566
609
|
if (refusal2 !== null) {
|
|
567
610
|
report.warn(refusal2);
|
|
@@ -573,7 +616,7 @@ function deliverOnce(options) {
|
|
|
573
616
|
}
|
|
574
617
|
const commits = undelivered(ctx.root, ctx.upstream, options.named);
|
|
575
618
|
const touched = touchedPaths(ctx.root, commits);
|
|
576
|
-
const leased = options.leases.filter(
|
|
619
|
+
const leased = options.noPush ? [] : options.leases.filter(
|
|
577
620
|
(spec) => spec.paths.some((path) => touched.has(path))
|
|
578
621
|
);
|
|
579
622
|
const last = commits.at(-1) ?? "HEAD";
|
|
@@ -595,8 +638,9 @@ function deliverOnce(options) {
|
|
|
595
638
|
report.info(`took lease ${spec.name}`);
|
|
596
639
|
}
|
|
597
640
|
const code = underLock(options);
|
|
598
|
-
if (code !== 0) return code;
|
|
599
|
-
options.afterDeliver?.();
|
|
641
|
+
if (code !== 0 || options.noPush) return code;
|
|
642
|
+
const synced = options.afterDeliver?.() ?? null;
|
|
643
|
+
if (options.track) options.track.sync = synced;
|
|
600
644
|
if (taken.length > 0)
|
|
601
645
|
options.recordDelivery?.({
|
|
602
646
|
leases: taken,
|
|
@@ -615,7 +659,7 @@ function deliverOnce(options) {
|
|
|
615
659
|
|
|
616
660
|
// src/git/mainline/delivery-events.ts
|
|
617
661
|
import { appendFileSync, mkdirSync as mkdirSync3 } from "fs";
|
|
618
|
-
import { dirname as
|
|
662
|
+
import { dirname as dirname4 } from "path";
|
|
619
663
|
function deliveryEvents(setup) {
|
|
620
664
|
return (delivery) => {
|
|
621
665
|
const specs = leaseSpecs(setup.config);
|
|
@@ -628,7 +672,7 @@ function deliveryEvents(setup) {
|
|
|
628
672
|
const spec = installSpec(sync, setup.stateDir);
|
|
629
673
|
const state = spec ? installState(root, spec) : { hash: lockHash(root, paths), installed: false };
|
|
630
674
|
const { hash, installed } = state;
|
|
631
|
-
mkdirSync3(
|
|
675
|
+
mkdirSync3(dirname4(events), { recursive: true });
|
|
632
676
|
appendFileSync(
|
|
633
677
|
events,
|
|
634
678
|
`${JSON.stringify({
|
|
@@ -660,7 +704,7 @@ function filesSessionGate(stateDir, leaseFiles = {}) {
|
|
|
660
704
|
|
|
661
705
|
// src/git/mainline/sync.ts
|
|
662
706
|
import { existsSync as existsSync4 } from "fs";
|
|
663
|
-
import { join as
|
|
707
|
+
import { join as join7 } from "path";
|
|
664
708
|
|
|
665
709
|
// src/git/mainline/identical-files.ts
|
|
666
710
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
@@ -675,7 +719,7 @@ import {
|
|
|
675
719
|
renameSync,
|
|
676
720
|
rmSync as rmSync4
|
|
677
721
|
} from "fs";
|
|
678
|
-
import { join as
|
|
722
|
+
import { join as join6 } from "path";
|
|
679
723
|
var FILE_MODES = /* @__PURE__ */ new Set(["100644", "100755"]);
|
|
680
724
|
function refuse(path) {
|
|
681
725
|
return {
|
|
@@ -689,7 +733,7 @@ function identical(cwd, path, mode, oid) {
|
|
|
689
733
|
if (!FILE_MODES.has(mode)) return false;
|
|
690
734
|
let current = cwd;
|
|
691
735
|
for (const segment of path.split("/")) {
|
|
692
|
-
current =
|
|
736
|
+
current = join6(current, segment);
|
|
693
737
|
if (lstatSync(current).isSymbolicLink()) return false;
|
|
694
738
|
}
|
|
695
739
|
const stat = lstatSync(current);
|
|
@@ -714,7 +758,7 @@ function adopt(cwd, target, env) {
|
|
|
714
758
|
if (!match) continue;
|
|
715
759
|
const [, mode = "", oid = "", path = ""] = match;
|
|
716
760
|
if (existing.has(path)) continue;
|
|
717
|
-
if (!lstatSync(
|
|
761
|
+
if (!lstatSync(join6(cwd, path), { throwIfNoEntry: false })) continue;
|
|
718
762
|
if (!identical(cwd, path, mode, oid)) return refuse(path);
|
|
719
763
|
const added = git(
|
|
720
764
|
cwd,
|
|
@@ -741,7 +785,7 @@ function resetKeepingIdenticalFiles(cwd, target) {
|
|
|
741
785
|
try {
|
|
742
786
|
fd = openSync2(lock, "wx");
|
|
743
787
|
temporary = mkdtempSync2(`${index}.sync-`);
|
|
744
|
-
const scratch =
|
|
788
|
+
const scratch = join6(temporary, "index");
|
|
745
789
|
copyFileSync(index, scratch);
|
|
746
790
|
const env = { GIT_INDEX_FILE: scratch };
|
|
747
791
|
const refused = adopt(cwd, target, env);
|
|
@@ -785,7 +829,7 @@ function refusal(ctx) {
|
|
|
785
829
|
if (branch !== ctx.mainline)
|
|
786
830
|
return `the main checkout is on ${branch || "a detached HEAD"}, not ${ctx.mainline}`;
|
|
787
831
|
for (const marker of IN_PROGRESS) {
|
|
788
|
-
if (existsSync4(
|
|
832
|
+
if (existsSync4(join7(ctx.gitDir, marker)))
|
|
789
833
|
return `${marker} is present; another git command is running or unfinished`;
|
|
790
834
|
}
|
|
791
835
|
return null;
|
|
@@ -801,6 +845,20 @@ function install(options) {
|
|
|
801
845
|
function syncMainline(options) {
|
|
802
846
|
return withUmask(options.umask, () => syncOnce(options));
|
|
803
847
|
}
|
|
848
|
+
function syncMainlineResult(options) {
|
|
849
|
+
let reason;
|
|
850
|
+
const report = {
|
|
851
|
+
info: (line) => options.report.info(line),
|
|
852
|
+
warn: (line) => {
|
|
853
|
+
reason = line;
|
|
854
|
+
options.report.warn(line);
|
|
855
|
+
}
|
|
856
|
+
};
|
|
857
|
+
const head = () => gitText(options.ctx.root, ["rev-parse", "HEAD"]);
|
|
858
|
+
const from = head();
|
|
859
|
+
const code = syncMainline({ ...options, report });
|
|
860
|
+
return { from, to: head(), code, ...reason ? { reason } : {} };
|
|
861
|
+
}
|
|
804
862
|
function syncOnce(options) {
|
|
805
863
|
const { ctx, sync, report } = options;
|
|
806
864
|
const blocked2 = refusal(ctx);
|
|
@@ -875,22 +933,32 @@ var mainlineDeliver = (setup, context, report) => {
|
|
|
875
933
|
const { config, ctx, stateDir } = setup;
|
|
876
934
|
const settings = config.deliver ?? off("git.mainline.deliver");
|
|
877
935
|
const sync = config.sync;
|
|
936
|
+
const mainCheckout = () => {
|
|
937
|
+
const when = sync?.afterDeliver ?? "from_main";
|
|
938
|
+
if (sync === void 0 || when === "off") return null;
|
|
939
|
+
if (!ctx.linked) return ctx;
|
|
940
|
+
if (when !== "always") return null;
|
|
941
|
+
return detect(ctx.mainRoot, { remote: ctx.remote, mainline: ctx.mainline });
|
|
942
|
+
};
|
|
878
943
|
const afterDeliver = () => {
|
|
879
|
-
|
|
944
|
+
const main = mainCheckout();
|
|
945
|
+
if (sync === void 0 || main === null) return null;
|
|
880
946
|
const followSubmodules = config.submodules?.follow === "clean_pins";
|
|
881
947
|
const sharedSubmodules = config.submodules?.shared ?? [];
|
|
882
|
-
|
|
883
|
-
ctx,
|
|
948
|
+
const synced = syncMainlineResult({
|
|
949
|
+
ctx: main,
|
|
884
950
|
sync,
|
|
885
951
|
followSubmodules,
|
|
886
952
|
sharedSubmodules,
|
|
887
953
|
stateDir,
|
|
888
954
|
report,
|
|
889
955
|
...config.umask !== void 0 ? { umask: config.umask } : {}
|
|
890
|
-
})
|
|
956
|
+
});
|
|
957
|
+
if (synced.code !== 0)
|
|
891
958
|
report.warn(
|
|
892
|
-
"delivered; only the main checkout did not catch up, run pmcp git sync after the refusal above is cleared"
|
|
959
|
+
"delivered; only the main checkout did not catch up, run pmcp git sync there after the refusal above is cleared"
|
|
893
960
|
);
|
|
961
|
+
return synced;
|
|
894
962
|
};
|
|
895
963
|
return deliver({
|
|
896
964
|
ctx,
|
|
@@ -902,6 +970,7 @@ var mainlineDeliver = (setup, context, report) => {
|
|
|
902
970
|
leases: leaseSpecs(config),
|
|
903
971
|
store: filesSessionGate(setup.stateDir, setup.leaseFiles),
|
|
904
972
|
duringPause: context.args.flags.has("during-pause"),
|
|
973
|
+
noPush: context.args.flags.has("no-push"),
|
|
905
974
|
afterDeliver,
|
|
906
975
|
recordDelivery: deliveryEvents(setup),
|
|
907
976
|
pushPins: config.submodules?.push === "pins",
|
|
@@ -917,4 +986,4 @@ export {
|
|
|
917
986
|
mainlineDeliver,
|
|
918
987
|
mainlineSync
|
|
919
988
|
};
|
|
920
|
-
//# sourceMappingURL=mainline-
|
|
989
|
+
//# sourceMappingURL=mainline-M2NSTAGC.js.map
|
|
@@ -5,11 +5,11 @@ import "./chunk-XNML2KIC.js";
|
|
|
5
5
|
|
|
6
6
|
// src/commands/mcp.ts
|
|
7
7
|
async function run(context) {
|
|
8
|
-
const { executeMcpCommand } = await import("./run-
|
|
8
|
+
const { executeMcpCommand } = await import("./run-WYJMTLX7.js");
|
|
9
9
|
return executeMcpCommand(context);
|
|
10
10
|
}
|
|
11
11
|
var mcpCommand = { ...mcpSpec, run };
|
|
12
12
|
export {
|
|
13
13
|
mcpCommand
|
|
14
14
|
};
|
|
15
|
-
//# sourceMappingURL=mcp-
|
|
15
|
+
//# sourceMappingURL=mcp-R62ZNVGJ.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
change
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7FV2LORT.js";
|
|
4
|
+
import "./chunk-MR5IBS6L.js";
|
|
5
|
+
import "./chunk-Z6WRFOFT.js";
|
|
6
6
|
import "./chunk-A4PKLESO.js";
|
|
7
7
|
import "./chunk-OEH47H6A.js";
|
|
8
8
|
import "./chunk-IJBSOWHK.js";
|
|
@@ -14,4 +14,4 @@ var run = (context) => change(context, "pause");
|
|
|
14
14
|
export {
|
|
15
15
|
run
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=pause-
|
|
17
|
+
//# sourceMappingURL=pause-CZ2OZYLC.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-NRBQK6UX.js";
|
|
4
4
|
import {
|
|
5
5
|
projectSpec
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RHJEGLYM.js";
|
|
7
7
|
import "./chunk-JEL35P7S.js";
|
|
8
8
|
import "./chunk-XNML2KIC.js";
|
|
9
9
|
import {
|
|
@@ -19,7 +19,7 @@ async function route(context, verb, name) {
|
|
|
19
19
|
if (name === void 0 || context.args.flags.has("check") || context.args.flags.has("write") || many(context.args, "source").length > 0 || many(context.args, "name").length > 0) {
|
|
20
20
|
throw new ArgumentError("exec-mcp takes only a declared MCP alias");
|
|
21
21
|
}
|
|
22
|
-
const { runExecMcp } = await import("./exec-mcp-
|
|
22
|
+
const { runExecMcp } = await import("./exec-mcp-KKQ75N5O.js");
|
|
23
23
|
return await runExecMcp(context, name);
|
|
24
24
|
}
|
|
25
25
|
if (verb === "import-mcp") {
|
|
@@ -28,13 +28,13 @@ async function route(context, verb, name) {
|
|
|
28
28
|
"import-mcp takes --source, --name and --write; no positional name or --check"
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
const { importMcp } = await import("./import-mcp-
|
|
31
|
+
const { importMcp } = await import("./import-mcp-BJDJTPVS.js");
|
|
32
32
|
return importMcp(context);
|
|
33
33
|
}
|
|
34
34
|
if (many(context.args, "source").length > 0 || one(context.args, "name") !== void 0 || context.args.flags.has("write")) {
|
|
35
35
|
throw new ArgumentError("--source, --name and --write require import-mcp");
|
|
36
36
|
}
|
|
37
|
-
const apply = await import("./apply-
|
|
37
|
+
const apply = await import("./apply-6FLMTJDV.js");
|
|
38
38
|
if (verb === void 0) return apply.projectOrCheck(context);
|
|
39
39
|
if (context.args.flags.has("check")) {
|
|
40
40
|
throw new ArgumentError("--check takes no subcommand");
|
|
@@ -67,4 +67,4 @@ var projectCommand = {
|
|
|
67
67
|
export {
|
|
68
68
|
projectCommand
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=project-
|
|
70
|
+
//# sourceMappingURL=project-W5DQIZA6.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ptyRef
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-OFJIMBTL.js";
|
|
4
|
+
import "./chunk-Z6WRFOFT.js";
|
|
5
5
|
|
|
6
6
|
// src/sessions/wake/pty.ts
|
|
7
7
|
import { createConnection } from "net";
|
|
@@ -91,4 +91,4 @@ async function ptyTurn(record, text, _context) {
|
|
|
91
91
|
export {
|
|
92
92
|
ptyTurn
|
|
93
93
|
};
|
|
94
|
-
//# sourceMappingURL=pty-
|
|
94
|
+
//# sourceMappingURL=pty-CDLQ4NP2.js.map
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import {
|
|
2
|
+
logLocation,
|
|
3
|
+
parseSince,
|
|
4
|
+
readLogs
|
|
5
|
+
} from "./chunk-57Q75MS4.js";
|
|
6
|
+
import {
|
|
7
|
+
configFrom
|
|
8
|
+
} from "./chunk-RPCIROW7.js";
|
|
9
|
+
import {
|
|
10
|
+
guardLines,
|
|
11
|
+
readReportTable,
|
|
12
|
+
report,
|
|
13
|
+
wouldRefuse
|
|
14
|
+
} from "./chunk-LFFIQBNY.js";
|
|
15
|
+
import "./chunk-HQOB7OQS.js";
|
|
16
|
+
import "./chunk-MR5IBS6L.js";
|
|
17
|
+
import "./chunk-Z6WRFOFT.js";
|
|
18
|
+
import {
|
|
19
|
+
ArgumentError,
|
|
20
|
+
one
|
|
21
|
+
} from "./chunk-A4PKLESO.js";
|
|
22
|
+
import "./chunk-OEH47H6A.js";
|
|
23
|
+
import "./chunk-IJBSOWHK.js";
|
|
24
|
+
import "./chunk-GJXOFDJT.js";
|
|
25
|
+
import "./chunk-PMJG2CXF.js";
|
|
26
|
+
|
|
27
|
+
// src/commands/hooks/report.ts
|
|
28
|
+
async function run(context) {
|
|
29
|
+
const config = configFrom(context);
|
|
30
|
+
if (!config)
|
|
31
|
+
throw new ArgumentError("no pmcp.toml here or above; pass --config");
|
|
32
|
+
const hooks = config.raw.hooks ?? {};
|
|
33
|
+
let settings;
|
|
34
|
+
let since;
|
|
35
|
+
try {
|
|
36
|
+
settings = readReportTable(hooks["report"]);
|
|
37
|
+
const value = one(context.args, "since");
|
|
38
|
+
if (value !== void 0) since = parseSince(value);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
throw new ArgumentError(
|
|
41
|
+
error instanceof Error ? error.message : String(error)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
const location = logLocation(config, context.env);
|
|
45
|
+
const logged = readLogs(
|
|
46
|
+
location.dir,
|
|
47
|
+
{ component: "hooks.entry", ...since ? { since } : {} },
|
|
48
|
+
location.file
|
|
49
|
+
);
|
|
50
|
+
const { kept, excluded } = guardLines(logged, settings);
|
|
51
|
+
const guard = one(context.args, "switch-check");
|
|
52
|
+
const json = context.args.flags.has("json");
|
|
53
|
+
if (guard !== void 0) {
|
|
54
|
+
const found = wouldRefuse(kept, guard);
|
|
55
|
+
if (json)
|
|
56
|
+
context.ui.data(
|
|
57
|
+
JSON.stringify({ version: 1, guard, refused: found }) + "\n"
|
|
58
|
+
);
|
|
59
|
+
else {
|
|
60
|
+
for (const line of found)
|
|
61
|
+
context.ui.line(
|
|
62
|
+
[
|
|
63
|
+
line.ts,
|
|
64
|
+
line.runtime,
|
|
65
|
+
line.session.slice(0, 8),
|
|
66
|
+
`${line.mode}: ${line.raw} -> ${line.verdict}`,
|
|
67
|
+
line.tool ?? ""
|
|
68
|
+
].filter(Boolean).join(" ")
|
|
69
|
+
);
|
|
70
|
+
context.ui.line(
|
|
71
|
+
`${guard} would have refused ${found.length} call(s) it let through`
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return 0;
|
|
75
|
+
}
|
|
76
|
+
const summary = report(kept, excluded);
|
|
77
|
+
if (json) {
|
|
78
|
+
context.ui.data(
|
|
79
|
+
JSON.stringify({
|
|
80
|
+
version: 1,
|
|
81
|
+
...since ? { since: since.toISOString() } : {},
|
|
82
|
+
...summary
|
|
83
|
+
}) + "\n"
|
|
84
|
+
);
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
if (summary.lines === 0)
|
|
88
|
+
context.ui.line(
|
|
89
|
+
"no guard log lines; guards log at debug level ([logging] level or PMCP_LOG=debug)"
|
|
90
|
+
);
|
|
91
|
+
for (const row of summary.guards) {
|
|
92
|
+
const counts = (values) => Object.entries(values).sort(([a], [b]) => a.localeCompare(b)).map(([name, value]) => `${name} ${value}`).join(", ");
|
|
93
|
+
context.ui.line(
|
|
94
|
+
`${row.policy} ${row.runtime} [${row.modes.join(",")}]: ${row.calls} call(s), ${row.sessions} session(s); found ${counts(row.raw)}; gave ${counts(row.verdict)}; p50 ${row.durationMs.p50}ms p95 ${row.durationMs.p95}ms max ${row.durationMs.max}ms`
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
context.ui.line(
|
|
98
|
+
`${summary.lines} guard run(s) in ${summary.sessions} session(s)${summary.excluded ? `; ${summary.excluded} excluded by [hooks.report] exclude_sessions` : ""}`
|
|
99
|
+
);
|
|
100
|
+
return 0;
|
|
101
|
+
}
|
|
102
|
+
export {
|
|
103
|
+
run
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=report-Z3JV2PCT.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
change
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-7FV2LORT.js";
|
|
4
|
+
import "./chunk-MR5IBS6L.js";
|
|
5
|
+
import "./chunk-Z6WRFOFT.js";
|
|
6
6
|
import "./chunk-A4PKLESO.js";
|
|
7
7
|
import "./chunk-OEH47H6A.js";
|
|
8
8
|
import "./chunk-IJBSOWHK.js";
|
|
@@ -14,4 +14,4 @@ var run = (context) => change(context, "resume");
|
|
|
14
14
|
export {
|
|
15
15
|
run
|
|
16
16
|
};
|
|
17
|
-
//# sourceMappingURL=resume-
|
|
17
|
+
//# sourceMappingURL=resume-DFIHT2RO.js.map
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readSpec
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-ICF2JZSN.js";
|
|
3
|
+
} from "./chunk-VUM6LO77.js";
|
|
4
|
+
import "./chunk-2MAD4WNZ.js";
|
|
6
5
|
import "./chunk-UD3BEEBQ.js";
|
|
7
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-KUBHGVTD.js";
|
|
8
7
|
import "./chunk-EATCUWGG.js";
|
|
8
|
+
import "./chunk-OFJIMBTL.js";
|
|
9
9
|
import "./chunk-NRBQK6UX.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-LFFIQBNY.js";
|
|
11
|
+
import "./chunk-HQOB7OQS.js";
|
|
12
|
+
import "./chunk-73AKO4UL.js";
|
|
11
13
|
import "./chunk-P6LNYYYH.js";
|
|
12
14
|
import {
|
|
13
15
|
readGitConfig
|
|
14
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZIJ5IUXH.js";
|
|
15
17
|
import {
|
|
16
18
|
detect
|
|
17
19
|
} from "./chunk-2Q6MNGU5.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-MR5IBS6L.js";
|
|
21
|
+
import "./chunk-Z6WRFOFT.js";
|
|
20
22
|
import "./chunk-G7JONWL4.js";
|
|
21
23
|
import "./chunk-Q5H3L6Y4.js";
|
|
24
|
+
import "./chunk-5YCKFU5Q.js";
|
|
22
25
|
import {
|
|
23
26
|
ArgumentError,
|
|
24
27
|
one
|
|
25
28
|
} from "./chunk-A4PKLESO.js";
|
|
26
29
|
import "./chunk-V4NPDK6X.js";
|
|
27
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-DEY23WTH.js";
|
|
28
31
|
import "./chunk-OEH47H6A.js";
|
|
29
32
|
import "./chunk-IJBSOWHK.js";
|
|
30
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-H4ZOKIER.js";
|
|
31
34
|
import {
|
|
32
35
|
readConfig
|
|
33
36
|
} from "./chunk-GJXOFDJT.js";
|
|
@@ -124,4 +127,4 @@ function run(context) {
|
|
|
124
127
|
export {
|
|
125
128
|
run
|
|
126
129
|
};
|
|
127
|
-
//# sourceMappingURL=run-
|
|
130
|
+
//# sourceMappingURL=run-OZLGSRHF.js.map
|
|
@@ -9,11 +9,11 @@ async function executeMcpCommand(context) {
|
|
|
9
9
|
throw new ArgumentError("Use pmcp mcp <login|logout|status> <name>");
|
|
10
10
|
if (context.args.flags.has("json") && verb !== "status")
|
|
11
11
|
throw new ArgumentError("--json requires mcp status");
|
|
12
|
-
if (verb === "status") return (await import("./status-
|
|
13
|
-
if (verb === "logout") return (await import("./logout-
|
|
14
|
-
return (await import("./start-login-
|
|
12
|
+
if (verb === "status") return (await import("./status-EDSEG32U.js")).run(context);
|
|
13
|
+
if (verb === "logout") return (await import("./logout-XO6ALD45.js")).run(context);
|
|
14
|
+
return (await import("./start-login-EKXM75XQ.js")).run(context);
|
|
15
15
|
}
|
|
16
16
|
export {
|
|
17
17
|
executeMcpCommand
|
|
18
18
|
};
|
|
19
|
-
//# sourceMappingURL=run-
|
|
19
|
+
//# sourceMappingURL=run-WYJMTLX7.js.map
|