@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
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
asPause,
|
|
5
5
|
asRecord,
|
|
6
6
|
isLeaseFile,
|
|
7
|
+
latestRecord,
|
|
7
8
|
recordLive,
|
|
8
9
|
STATE_FILES,
|
|
9
10
|
} from "../sessions/format";
|
|
@@ -49,11 +50,20 @@ export async function readRecords(
|
|
|
49
50
|
files: StateFiles,
|
|
50
51
|
options: ReadOptions,
|
|
51
52
|
): Promise<SessionRecord[]> {
|
|
52
|
-
|
|
53
|
-
const
|
|
53
|
+
// sessions/ and the deprecated fleet/: each session once, the copy updated last.
|
|
54
|
+
const found = new Map<string, (SessionRecord | null)[]>();
|
|
55
|
+
for (const folder of [STATE_PATHS.records, STATE_FILES.legacyRecords]) {
|
|
56
|
+
const directory = `${options.stateDir}/${folder}`;
|
|
57
|
+
const names = await files.list(directory).catch(() => [] as string[]);
|
|
58
|
+
for (const name of names.filter((item) => item.endsWith(".json")))
|
|
59
|
+
found.set(name, [
|
|
60
|
+
...(found.get(name) ?? []),
|
|
61
|
+
asRecord(await readJson(files, `${directory}/${name}`)),
|
|
62
|
+
]);
|
|
63
|
+
}
|
|
54
64
|
const records: SessionRecord[] = [];
|
|
55
|
-
for (const name of
|
|
56
|
-
const record =
|
|
65
|
+
for (const name of [...found.keys()].sort()) {
|
|
66
|
+
const record = latestRecord(found.get(name)!);
|
|
57
67
|
if (!record) continue;
|
|
58
68
|
const pidAlive = await isAlive(files, record.pid);
|
|
59
69
|
if (recordLive(record, options.now, pidAlive)) records.push(record);
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
import type { Broadcast, Lease, Pause, SessionRecord } from "./types";
|
|
4
4
|
|
|
5
5
|
export const STATE_FILES = {
|
|
6
|
-
records: "
|
|
6
|
+
records: "sessions",
|
|
7
|
+
// The records' former directory. Deprecated: read beside sessions/ but no longer written; a
|
|
8
|
+
// pmcp before 0.20 sharing the state directory still writes there.
|
|
9
|
+
legacyRecords: "fleet",
|
|
7
10
|
pause: "pause.json",
|
|
8
11
|
broadcast: "broadcast.json",
|
|
9
12
|
history: "broadcast-history.jsonl",
|
|
@@ -11,6 +14,18 @@ export const STATE_FILES = {
|
|
|
11
14
|
|
|
12
15
|
export const STALE_MS = 30 * 60 * 1000;
|
|
13
16
|
|
|
17
|
+
// Of a session's copies (sessions/ and fleet/), the one updated last; the first wins a tie.
|
|
18
|
+
export function latestRecord(
|
|
19
|
+
copies: readonly (SessionRecord | null)[],
|
|
20
|
+
): SessionRecord | null {
|
|
21
|
+
const time = (record: SessionRecord) =>
|
|
22
|
+
Date.parse(record.updatedAt ?? record.startedAt ?? "") || 0;
|
|
23
|
+
let latest: SessionRecord | null = null;
|
|
24
|
+
for (const copy of copies)
|
|
25
|
+
if (copy && (!latest || time(copy) > time(latest))) latest = copy;
|
|
26
|
+
return latest;
|
|
27
|
+
}
|
|
28
|
+
|
|
14
29
|
const LEASE_NAME = /^[a-z0-9][a-z0-9_-]*$/u;
|
|
15
30
|
|
|
16
31
|
// The lease file name is part of the shared formats (docs/git-workflow.md); never change it.
|
|
@@ -118,7 +118,7 @@ export interface Recipient {
|
|
|
118
118
|
readonly session?: string;
|
|
119
119
|
readonly alias?: string;
|
|
120
120
|
readonly roles?: readonly string[];
|
|
121
|
-
readonly
|
|
121
|
+
readonly worktree?: string;
|
|
122
122
|
// When the session started: a broadcast to all sent before then is not for it.
|
|
123
123
|
readonly since?: string;
|
|
124
124
|
}
|
package/plugins/pmcp/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "pmcp",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.21.0",
|
|
5
5
|
"description": "Find package skills and use native runtime project configuration.",
|
|
6
6
|
"author": { "name": "modootoday" },
|
|
7
7
|
"license": "Elastic-2.0",
|
package/schema/catalog-v1.json
CHANGED
package/dist/chunk-EONAJAMJ.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
missingBinary,
|
|
3
|
-
nativeBinary,
|
|
4
|
-
readLock
|
|
5
|
-
} from "./chunk-57FHYW74.js";
|
|
6
|
-
import {
|
|
7
|
-
VERSION
|
|
8
|
-
} from "./chunk-YGTJQVCK.js";
|
|
9
|
-
import {
|
|
10
|
-
pickEnv
|
|
11
|
-
} from "./chunk-J6KL3COD.js";
|
|
12
|
-
|
|
13
|
-
// src/project/host.ts
|
|
14
|
-
import { createHash } from "crypto";
|
|
15
|
-
import { existsSync, readFileSync } from "fs";
|
|
16
|
-
import { join } from "path";
|
|
17
|
-
var HOST_DIRECTORY = ".agents/pmcp-pty";
|
|
18
|
-
var HOST_MANIFEST = `${HOST_DIRECTORY}/host.json`;
|
|
19
|
-
var HOST_POLICY = `${HOST_DIRECTORY}/policy.json`;
|
|
20
|
-
function hostPolicy(host) {
|
|
21
|
-
const browser = host.browser.allowPrivate;
|
|
22
|
-
const launch = host.desktop.launch;
|
|
23
|
-
return {
|
|
24
|
-
version: 1,
|
|
25
|
-
mcp_write: host.mcpWrite,
|
|
26
|
-
roots: host.roots,
|
|
27
|
-
allow: host.answers.map((a) => ({
|
|
28
|
-
profile: a.runtime,
|
|
29
|
-
dialog: a.dialog,
|
|
30
|
-
options: a.options
|
|
31
|
-
})),
|
|
32
|
-
...browser.length > 0 ? { browser: { allow_private: browser } } : {},
|
|
33
|
-
...launch.length > 0 ? { desktop: { launch } } : {}
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function hostManifest(host) {
|
|
37
|
-
return {
|
|
38
|
-
version: 1,
|
|
39
|
-
sessions: host.sessions.map((s) => ({
|
|
40
|
-
name: s.name,
|
|
41
|
-
profile: s.runtime,
|
|
42
|
-
cwd: s.cwd,
|
|
43
|
-
argv: s.argv,
|
|
44
|
-
labels: { ...s.labels, "pmcp.host": s.name },
|
|
45
|
-
restart: s.restart,
|
|
46
|
-
max_restarts: s.maxRestarts,
|
|
47
|
-
delivery_setup: true,
|
|
48
|
-
// Only when declared, so an approval made before env existed stays valid.
|
|
49
|
-
...s.env.length > 0 ? { env: s.env } : {}
|
|
50
|
-
}))
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
var json = (value) => `${JSON.stringify(value, null, 2)}
|
|
54
|
-
`;
|
|
55
|
-
function hostOutputs(spec) {
|
|
56
|
-
if (!spec.host) return [];
|
|
57
|
-
return [
|
|
58
|
-
{
|
|
59
|
-
kind: "file",
|
|
60
|
-
path: HOST_MANIFEST,
|
|
61
|
-
content: json(hostManifest(spec.host))
|
|
62
|
-
},
|
|
63
|
-
{ kind: "file", path: HOST_POLICY, content: json(hostPolicy(spec.host)) }
|
|
64
|
-
];
|
|
65
|
-
}
|
|
66
|
-
function ptyBinary(env) {
|
|
67
|
-
return nativeBinary("pmcp-pty", "PMCP_PTY_BIN", env);
|
|
68
|
-
}
|
|
69
|
-
function ptyBinaryDoctor(env) {
|
|
70
|
-
const found = ptyBinary(env);
|
|
71
|
-
return found ? { tool: "project", check: "pmcp-pty binary", status: "ok", detail: found } : {
|
|
72
|
-
tool: "project",
|
|
73
|
-
check: "pmcp-pty binary",
|
|
74
|
-
status: "warn",
|
|
75
|
-
detail: missingBinary("pmcp-pty", "PMCP_PTY_BIN", VERSION)
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function hostEnvDoctor(spec, env) {
|
|
79
|
-
return (spec.host?.sessions ?? []).filter((s) => s.env.length > 0).map((s) => {
|
|
80
|
-
const { missing } = pickEnv(s.env, env);
|
|
81
|
-
return missing.length === 0 ? {
|
|
82
|
-
tool: "project",
|
|
83
|
-
check: `host env (${s.name})`,
|
|
84
|
-
status: "ok",
|
|
85
|
-
detail: `set: ${s.env.join(", ")}`
|
|
86
|
-
} : {
|
|
87
|
-
tool: "project",
|
|
88
|
-
check: `host env (${s.name})`,
|
|
89
|
-
status: "warn",
|
|
90
|
-
detail: `not set: ${missing.join(", ")}; host up refuses ${s.name} until they are`
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
var sha256 = (text) => createHash("sha256").update(text).digest("hex");
|
|
95
|
-
function hostDoctor(spec) {
|
|
96
|
-
if (!spec.host) return [];
|
|
97
|
-
const lock = new Map(readLock(spec.root).map((e) => [e.path, e]));
|
|
98
|
-
const bad = [HOST_MANIFEST, HOST_POLICY].filter((path) => {
|
|
99
|
-
const file = join(spec.root, path);
|
|
100
|
-
if (!existsSync(file)) return true;
|
|
101
|
-
const entry = lock.get(path);
|
|
102
|
-
return entry?.sha256 !== sha256(readFileSync(file, "utf8"));
|
|
103
|
-
});
|
|
104
|
-
const { sessions, answers, mcpWrite } = spec.host;
|
|
105
|
-
const summary = `${sessions.length} session(s), ${answers.length} answer rule(s), mcp_write ${mcpWrite}`;
|
|
106
|
-
return [
|
|
107
|
-
bad.length === 0 ? {
|
|
108
|
-
tool: "project",
|
|
109
|
-
check: "pmcp-pty host projected",
|
|
110
|
-
status: "ok",
|
|
111
|
-
detail: summary
|
|
112
|
-
} : {
|
|
113
|
-
tool: "project",
|
|
114
|
-
check: "pmcp-pty host projected",
|
|
115
|
-
status: "fail",
|
|
116
|
-
detail: `run pmcp project: ${bad.join(", ")}`
|
|
117
|
-
}
|
|
118
|
-
];
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export {
|
|
122
|
-
HOST_MANIFEST,
|
|
123
|
-
HOST_POLICY,
|
|
124
|
-
hostOutputs,
|
|
125
|
-
ptyBinary,
|
|
126
|
-
ptyBinaryDoctor,
|
|
127
|
-
hostEnvDoctor,
|
|
128
|
-
hostDoctor
|
|
129
|
-
};
|
|
130
|
-
//# sourceMappingURL=chunk-EONAJAMJ.js.map
|