@modootoday/pmcp 0.22.4 → 0.22.7

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.
Files changed (82) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +1 -1
  4. package/.mcp.json +1 -1
  5. package/dist/{apply-D2VIRMFY.js → apply-UYCLP5AL.js} +13 -13
  6. package/dist/{chunk-F34XIDXT.js → chunk-2R3FVI6M.js} +2 -2
  7. package/dist/{chunk-RRPNPZ6I.js → chunk-42SO7KYX.js} +2 -2
  8. package/dist/{chunk-JJT5XRMV.js → chunk-4GBK5M5C.js} +2 -2
  9. package/dist/{chunk-MIIGZRVC.js → chunk-565QGUAV.js} +2 -2
  10. package/dist/{chunk-W4W3EHQP.js → chunk-5EZKGPWY.js} +2 -2
  11. package/dist/{chunk-CPFJ7J4G.js → chunk-5NPDVKX5.js} +5 -5
  12. package/dist/{chunk-T7SLHAHQ.js → chunk-667C72QC.js} +2 -2
  13. package/dist/{chunk-QUBU3ETR.js → chunk-6FFGGATI.js} +4 -4
  14. package/dist/{chunk-FE7WOHZM.js → chunk-7CSUKCU7.js} +2 -2
  15. package/dist/chunk-7GL2BXSP.js +7 -0
  16. package/dist/{chunk-JONJ75SF.js → chunk-AOWWLVFL.js} +5 -5
  17. package/dist/{chunk-G7JONWL4.js → chunk-B3OZ4GGO.js} +13 -1
  18. package/dist/{chunk-H45C5W2P.js → chunk-CBGY3ELI.js} +2 -2
  19. package/dist/{chunk-2A3F7ID4.js → chunk-CFSYEB4U.js} +125 -11
  20. package/dist/{chunk-FFCDSSKA.js → chunk-DYAOLBWZ.js} +7 -7
  21. package/dist/{chunk-3IX5TBRW.js → chunk-EKW2TQA3.js} +2 -2
  22. package/dist/{chunk-PFHSFYQB.js → chunk-GTZ5R2ER.js} +2 -2
  23. package/dist/{chunk-5KA3RS5Y.js → chunk-HABVHASY.js} +2 -2
  24. package/dist/{chunk-KR6PFEWU.js → chunk-JX5G2USM.js} +3 -3
  25. package/dist/{chunk-P6LNYYYH.js → chunk-M6X6HVQK.js} +2 -2
  26. package/dist/{chunk-TAVFL3YB.js → chunk-NK5CAYET.js} +2 -2
  27. package/dist/{chunk-MTVRKWQI.js → chunk-NVNC3JY5.js} +3 -3
  28. package/dist/{chunk-7XK2KWLJ.js → chunk-QRTA5NGD.js} +3 -3
  29. package/dist/{chunk-2Q6MNGU5.js → chunk-SUDG7B6S.js} +2 -2
  30. package/dist/{chunk-NDY3T7Z4.js → chunk-XERIEIQ3.js} +12 -12
  31. package/dist/{cli-VCKKTXUU.js → cli-DKVUBOMX.js} +8 -8
  32. package/dist/cli.js +3 -3
  33. package/dist/{completion-AAEBLVVB.js → completion-5WIKJUXU.js} +2 -2
  34. package/dist/{diagnostics-3XI6SJXF.js → diagnostics-6EKKP4FS.js} +5 -5
  35. package/dist/{doctor-GAJKPOKS.js → doctor-XOUT6HJU.js} +15 -15
  36. package/dist/{entry-GZCLQTIN.js → entry-7THS4LUN.js} +9 -9
  37. package/dist/{exec-mcp-3V34UNPH.js → exec-mcp-V4VMYZBN.js} +11 -11
  38. package/dist/{harness-YH6U6MNV.js → harness-3DFGRL57.js} +3 -3
  39. package/dist/harness-launch-gate.js +3 -3
  40. package/dist/harness-worker.js +5 -5
  41. package/dist/hook-body.js +172 -57
  42. package/dist/{hooks-JWB7D4ZB.js → hooks-QGH3RRZH.js} +3 -3
  43. package/dist/{host-DLBXM72V.js → host-64MTQRJZ.js} +6 -6
  44. package/dist/{host-LNH3TUR5.js → host-AWCM6O5R.js} +13 -13
  45. package/dist/{host-run-FVO5PZK2.js → host-run-NCHMUCWE.js} +4 -4
  46. package/dist/http.js +1 -1
  47. package/dist/{import-mcp-O553FGF3.js → import-mcp-WFDAOCTO.js} +10 -10
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +14 -14
  50. package/dist/{init-A6AAIGJU.js → init-GXSUWZC7.js} +2 -2
  51. package/dist/{invoke-GDELKQCE.js → invoke-5FOYWZKY.js} +7 -7
  52. package/dist/{list-CQ4CPNWI.js → list-FOVH6DDM.js} +12 -12
  53. package/dist/{logout-TG32MVMB.js → logout-BV4Z36EL.js} +11 -11
  54. package/dist/{mainline-FMZ44NFC.js → mainline-VOEDBDZE.js} +25 -7
  55. package/dist/{mcp-UYQVTWEF.js → mcp-VQGNYSEO.js} +2 -2
  56. package/dist/{modes-COBVV7RA.js → modes-SEINLLMK.js} +3 -3
  57. package/dist/{project-NOTN6SMK.js → project-4YGFV3OU.js} +4 -4
  58. package/dist/{run-77MDEDAX.js → run-JLZ5SCX6.js} +10 -10
  59. package/dist/{run-S5M6ZUUH.js → run-JP4CIL5Z.js} +4 -4
  60. package/dist/{serve-YNHUW5PQ.js → serve-RYHXWUTT.js} +3 -3
  61. package/dist/{setup-HYEYYVDU.js → setup-SOUBEZ3H.js} +4 -4
  62. package/dist/{start-login-SWQVPQG3.js → start-login-LXP4FVGX.js} +11 -11
  63. package/dist/{status-YPFUSE7K.js → status-6TXNV2GA.js} +11 -11
  64. package/dist/{status-NGO7AC3U.js → status-EBD7PGZZ.js} +12 -12
  65. package/dist/stdio.js +2 -2
  66. package/dist/{test-2UYV4LSU.js → test-56CNS2LD.js} +11 -11
  67. package/dist/{tui-ZKP3D5JM.js → tui-6JJOARKG.js} +4 -4
  68. package/dist/{worker-7OBOBMWM.js → worker-A3ZT5TTF.js} +7 -7
  69. package/dist/{worktree-create-NO4UOOEP.js → worktree-create-KMXPQXIQ.js} +2 -2
  70. package/dist/{worktree-list-6CCHXXOZ.js → worktree-list-WH6OX6U7.js} +4 -4
  71. package/dist/{worktree-sync-5ZVA5PUC.js → worktree-sync-JS7ZSCKX.js} +5 -5
  72. package/docs/git-workflow.md +7 -0
  73. package/gemini-extension.json +2 -2
  74. package/mcp.json +1 -1
  75. package/package.json +5 -5
  76. package/plugin.json +1 -1
  77. package/plugins/pmcp/.claude-plugin/plugin.json +1 -1
  78. package/plugins/pmcp/.mcp.json +1 -1
  79. package/plugins/pmcp/gemini-extension.json +2 -2
  80. package/plugins/pmcp/mcp.json +1 -1
  81. package/plugins/pmcp/plugin.json +1 -1
  82. package/dist/chunk-HOTGJQIV.js +0 -7
@@ -612,7 +612,7 @@
612
612
  },
613
613
  {
614
614
  "name": "pmcp",
615
- "version": "0.22.4",
615
+ "version": "0.22.7",
616
616
  "description": "Find package skills and use native runtime project configuration.",
617
617
  "source": { "source": "local", "path": "./plugins/pmcp" },
618
618
  "policy": { "installation": "AVAILABLE", "authentication": "ON_USE" },
@@ -445,7 +445,7 @@
445
445
  },
446
446
  {
447
447
  "name": "pmcp",
448
- "version": "0.22.4",
448
+ "version": "0.22.7",
449
449
  "description": "Find package skills and use native runtime project configuration.",
450
450
  "source": "./plugins/pmcp"
451
451
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pmcp",
3
- "version": "0.22.4",
3
+ "version": "0.22.7",
4
4
  "description": "Find package skills and use native runtime project configuration.",
5
5
  "author": { "name": "modootoday" },
6
6
  "license": "Elastic-2.0",
package/.mcp.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "pmcp": {
4
4
  "type": "stdio",
5
5
  "command": "npx",
6
- "args": ["-y", "@modootoday/pmcp@0.22.4", "serve"]
6
+ "args": ["-y", "@modootoday/pmcp@0.22.7", "serve"]
7
7
  }
8
8
  }
9
9
  }
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-PEMMV5YQ.js";
4
4
  import {
5
5
  specFrom
6
- } from "./chunk-TAVFL3YB.js";
6
+ } from "./chunk-NK5CAYET.js";
7
7
  import {
8
8
  printSmoke,
9
9
  runSmoke
@@ -15,28 +15,28 @@ import {
15
15
  describeHookProblem,
16
16
  project,
17
17
  unmanagedHookProblems
18
- } from "./chunk-QUBU3ETR.js";
18
+ } from "./chunk-6FFGGATI.js";
19
19
  import "./chunk-P4N7DBD5.js";
20
- import "./chunk-MTVRKWQI.js";
20
+ import "./chunk-NVNC3JY5.js";
21
21
  import {
22
22
  checkBudget,
23
23
  renderFrontmatter,
24
24
  splitFrontmatter
25
- } from "./chunk-FFCDSSKA.js";
25
+ } from "./chunk-DYAOLBWZ.js";
26
26
  import "./chunk-UKR64U7J.js";
27
- import "./chunk-2A3F7ID4.js";
28
- import "./chunk-RRPNPZ6I.js";
27
+ import "./chunk-CFSYEB4U.js";
28
+ import "./chunk-42SO7KYX.js";
29
29
  import "./chunk-EATCUWGG.js";
30
30
  import "./chunk-OFJIMBTL.js";
31
31
  import "./chunk-LFFIQBNY.js";
32
32
  import "./chunk-HQOB7OQS.js";
33
33
  import "./chunk-73AKO4UL.js";
34
- import "./chunk-P6LNYYYH.js";
35
- import "./chunk-FE7WOHZM.js";
36
- import "./chunk-2Q6MNGU5.js";
34
+ import "./chunk-M6X6HVQK.js";
35
+ import "./chunk-7CSUKCU7.js";
36
+ import "./chunk-SUDG7B6S.js";
37
37
  import "./chunk-7I7O7ZNT.js";
38
38
  import "./chunk-Z6WRFOFT.js";
39
- import "./chunk-G7JONWL4.js";
39
+ import "./chunk-B3OZ4GGO.js";
40
40
  import "./chunk-Q5H3L6Y4.js";
41
41
  import {
42
42
  RUNTIMES,
@@ -53,14 +53,14 @@ import {
53
53
  import "./chunk-YSAWTGNA.js";
54
54
  import {
55
55
  recordProjector
56
- } from "./chunk-F34XIDXT.js";
56
+ } from "./chunk-2R3FVI6M.js";
57
57
  import {
58
58
  ProjectError
59
59
  } from "./chunk-NRBQK6UX.js";
60
60
  import "./chunk-OEH47H6A.js";
61
61
  import "./chunk-IJBSOWHK.js";
62
62
  import "./chunk-XWLMZKH2.js";
63
- import "./chunk-HOTGJQIV.js";
63
+ import "./chunk-7GL2BXSP.js";
64
64
  import "./chunk-GJXOFDJT.js";
65
65
  import "./chunk-PMJG2CXF.js";
66
66
  import "./chunk-J6KL3COD.js";
@@ -275,4 +275,4 @@ export {
275
275
  projectOrCheck,
276
276
  removeAndProject
277
277
  };
278
- //# sourceMappingURL=apply-D2VIRMFY.js.map
278
+ //# sourceMappingURL=apply-UYCLP5AL.js.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-XWLMZKH2.js";
10
10
  import {
11
11
  VERSION
12
- } from "./chunk-HOTGJQIV.js";
12
+ } from "./chunk-7GL2BXSP.js";
13
13
  import {
14
14
  ConfigError
15
15
  } from "./chunk-GJXOFDJT.js";
@@ -598,4 +598,4 @@ export {
598
598
  hostEnvDoctor,
599
599
  hostDoctor
600
600
  };
601
- //# sourceMappingURL=chunk-F34XIDXT.js.map
601
+ //# sourceMappingURL=chunk-2R3FVI6M.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  git,
3
3
  gitText
4
- } from "./chunk-G7JONWL4.js";
4
+ } from "./chunk-B3OZ4GGO.js";
5
5
 
6
6
  // src/git/superseded.ts
7
7
  import { existsSync } from "fs";
@@ -129,4 +129,4 @@ export {
129
129
  isAncestor,
130
130
  distance
131
131
  };
132
- //# sourceMappingURL=chunk-RRPNPZ6I.js.map
132
+ //# sourceMappingURL=chunk-42SO7KYX.js.map
@@ -1190,7 +1190,7 @@ function registerReadTool(server, tools) {
1190
1190
 
1191
1191
  // src/mcp.ts
1192
1192
  var SERVER_NAME = "pmcp";
1193
- var SERVER_VERSION = "0.22.4";
1193
+ var SERVER_VERSION = "0.22.7";
1194
1194
  var MAX_TOOL_INPUT_ELEMENTS = 1e4;
1195
1195
  function registerSkillTools(server, tools) {
1196
1196
  registerCatalogTool(server, tools);
@@ -1247,4 +1247,4 @@ export {
1247
1247
  registerSkillTools,
1248
1248
  createSkillServer
1249
1249
  };
1250
- //# sourceMappingURL=chunk-JJT5XRMV.js.map
1250
+ //# sourceMappingURL=chunk-4GBK5M5C.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RPCIROW7.js";
4
4
  import {
5
5
  readSpec
6
- } from "./chunk-FFCDSSKA.js";
6
+ } from "./chunk-DYAOLBWZ.js";
7
7
  import {
8
8
  ArgumentError
9
9
  } from "./chunk-A4PKLESO.js";
@@ -25,4 +25,4 @@ function serverFrom(context) {
25
25
  export {
26
26
  serverFrom
27
27
  };
28
- //# sourceMappingURL=chunk-MIIGZRVC.js.map
28
+ //# sourceMappingURL=chunk-565QGUAV.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-34DECPVC.js";
7
7
  import {
8
8
  ptyBinary
9
- } from "./chunk-F34XIDXT.js";
9
+ } from "./chunk-2R3FVI6M.js";
10
10
 
11
11
  // src/harness/adapters/systemd/admission.ts
12
12
  var nativeHostTools = ["systemctl", "systemd-run"];
@@ -36,4 +36,4 @@ export {
36
36
  nativeHostTools,
37
37
  assertNativeHost
38
38
  };
39
- //# sourceMappingURL=chunk-W4W3EHQP.js.map
39
+ //# sourceMappingURL=chunk-5EZKGPWY.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  hostApprovalDoctor
3
- } from "./chunk-3IX5TBRW.js";
3
+ } from "./chunk-EKW2TQA3.js";
4
4
  import {
5
5
  wakeableBy
6
6
  } from "./chunk-JQVSDPFL.js";
@@ -12,7 +12,7 @@ import {
12
12
  describeHookProblem,
13
13
  project,
14
14
  unmanagedHooks
15
- } from "./chunk-QUBU3ETR.js";
15
+ } from "./chunk-6FFGGATI.js";
16
16
  import {
17
17
  ANTIGRAVITY_MCP_PLUGIN,
18
18
  agentNames,
@@ -23,7 +23,7 @@ import {
23
23
  skillNames,
24
24
  splitFrontmatter,
25
25
  uiClaudeDoctor
26
- } from "./chunk-FFCDSSKA.js";
26
+ } from "./chunk-DYAOLBWZ.js";
27
27
  import {
28
28
  pathPmcp,
29
29
  pmcpCommand
@@ -37,7 +37,7 @@ import {
37
37
  hostEnvDoctor,
38
38
  ptyBinaryDoctor,
39
39
  readLockFile
40
- } from "./chunk-F34XIDXT.js";
40
+ } from "./chunk-2R3FVI6M.js";
41
41
  import {
42
42
  ProjectError
43
43
  } from "./chunk-NRBQK6UX.js";
@@ -671,4 +671,4 @@ export {
671
671
  spawnRunner,
672
672
  doctor
673
673
  };
674
- //# sourceMappingURL=chunk-CPFJ7J4G.js.map
674
+ //# sourceMappingURL=chunk-5NPDVKX5.js.map
@@ -5,7 +5,7 @@ import {
5
5
  POLICIES,
6
6
  customMode,
7
7
  customPolicy
8
- } from "./chunk-FFCDSSKA.js";
8
+ } from "./chunk-DYAOLBWZ.js";
9
9
  import {
10
10
  RUNTIMES
11
11
  } from "./chunk-7DYWCQVB.js";
@@ -42,4 +42,4 @@ function policyRows(compiled) {
42
42
  export {
43
43
  policyRows
44
44
  };
45
- //# sourceMappingURL=chunk-T7SLHAHQ.js.map
45
+ //# sourceMappingURL=chunk-667C72QC.js.map
@@ -7,7 +7,7 @@ import {
7
7
  prepare,
8
8
  present,
9
9
  writeNative
10
- } from "./chunk-MTVRKWQI.js";
10
+ } from "./chunk-NVNC3JY5.js";
11
11
  import {
12
12
  ANTIGRAVITY_MCP_PLUGIN,
13
13
  BUNDLE_NATIVE_FILES,
@@ -21,7 +21,7 @@ import {
21
21
  same,
22
22
  splitKeyed,
23
23
  withoutBlock
24
- } from "./chunk-FFCDSSKA.js";
24
+ } from "./chunk-DYAOLBWZ.js";
25
25
  import {
26
26
  HOOK_DIRECTORY
27
27
  } from "./chunk-7DYWCQVB.js";
@@ -30,7 +30,7 @@ import {
30
30
  replaceFile,
31
31
  replaceLink,
32
32
  writeLock
33
- } from "./chunk-F34XIDXT.js";
33
+ } from "./chunk-2R3FVI6M.js";
34
34
  import {
35
35
  RULES_DIR,
36
36
  legacyLinks
@@ -400,4 +400,4 @@ export {
400
400
  unmanagedHooks,
401
401
  describeHookProblem
402
402
  };
403
- //# sourceMappingURL=chunk-QUBU3ETR.js.map
403
+ //# sourceMappingURL=chunk-6FFGGATI.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  detect
3
- } from "./chunk-2Q6MNGU5.js";
3
+ } from "./chunk-SUDG7B6S.js";
4
4
  import {
5
5
  readStoreSettings,
6
6
  resolveLeaseFiles,
@@ -392,4 +392,4 @@ export {
392
392
  gateTreePath,
393
393
  leaseSpecs
394
394
  };
395
- //# sourceMappingURL=chunk-FE7WOHZM.js.map
395
+ //# sourceMappingURL=chunk-7CSUKCU7.js.map
@@ -0,0 +1,7 @@
1
+ // src/commands/version.ts
2
+ var VERSION = "0.22.7";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-7GL2BXSP.js.map
@@ -7,20 +7,20 @@ import {
7
7
  observeSession,
8
8
  openGroup,
9
9
  runOperation
10
- } from "./chunk-KR6PFEWU.js";
10
+ } from "./chunk-JX5G2USM.js";
11
11
  import {
12
12
  nativeHostTools
13
- } from "./chunk-W4W3EHQP.js";
13
+ } from "./chunk-5EZKGPWY.js";
14
14
  import {
15
15
  locateExecutable
16
16
  } from "./chunk-R2GPCZUX.js";
17
17
  import {
18
18
  artifact,
19
19
  stateDirectory
20
- } from "./chunk-H45C5W2P.js";
20
+ } from "./chunk-CBGY3ELI.js";
21
21
  import {
22
22
  ptyBinary
23
- } from "./chunk-F34XIDXT.js";
23
+ } from "./chunk-2R3FVI6M.js";
24
24
  import {
25
25
  GroupStore,
26
26
  privateJson
@@ -249,4 +249,4 @@ async function invoke(operation) {
249
249
  export {
250
250
  invoke
251
251
  };
252
- //# sourceMappingURL=chunk-JONJ75SF.js.map
252
+ //# sourceMappingURL=chunk-AOWWLVFL.js.map
@@ -24,6 +24,17 @@ function git(cwd, args, extra) {
24
24
  const stderr = run.stderr || run.error?.message || "";
25
25
  return { status: run.status ?? 1, stdout: run.stdout ?? "", stderr };
26
26
  }
27
+ function gitWithInput(cwd, args, input) {
28
+ const run = spawnSync("git", args, {
29
+ cwd,
30
+ encoding: "utf8",
31
+ env: cleanEnv(),
32
+ input,
33
+ maxBuffer: 256 * 1024 * 1024
34
+ });
35
+ const stderr = run.stderr || run.error?.message || "";
36
+ return { status: run.status ?? 1, stdout: run.stdout ?? "", stderr };
37
+ }
27
38
  function gitText(cwd, args) {
28
39
  const run = git(cwd, args);
29
40
  if (run.status !== 0) return "";
@@ -72,9 +83,10 @@ function runCommand(argv, cwd, extra) {
72
83
 
73
84
  export {
74
85
  git,
86
+ gitWithInput,
75
87
  gitText,
76
88
  gitOk,
77
89
  runCommandLogged,
78
90
  runCommand
79
91
  };
80
- //# sourceMappingURL=chunk-G7JONWL4.js.map
92
+ //# sourceMappingURL=chunk-B3OZ4GGO.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-34DECPVC.js";
4
4
  import {
5
5
  ptyBinary
6
- } from "./chunk-F34XIDXT.js";
6
+ } from "./chunk-2R3FVI6M.js";
7
7
  import {
8
8
  GroupStore,
9
9
  egressPolicy,
@@ -775,4 +775,4 @@ export {
775
775
  prepareBridge,
776
776
  assertBridge
777
777
  };
778
- //# sourceMappingURL=chunk-H45C5W2P.js.map
778
+ //# sourceMappingURL=chunk-CBGY3ELI.js.map
@@ -2,19 +2,20 @@ import {
2
2
  GitReadError,
3
3
  cherry,
4
4
  distance
5
- } from "./chunk-RRPNPZ6I.js";
5
+ } from "./chunk-42SO7KYX.js";
6
6
  import {
7
7
  reportModes,
8
8
  restoreModes,
9
9
  restoreSubmoduleModes,
10
10
  withUmask
11
- } from "./chunk-P6LNYYYH.js";
11
+ } from "./chunk-M6X6HVQK.js";
12
12
  import {
13
13
  git,
14
14
  gitOk,
15
15
  gitText,
16
+ gitWithInput,
16
17
  runCommand
17
- } from "./chunk-G7JONWL4.js";
18
+ } from "./chunk-B3OZ4GGO.js";
18
19
 
19
20
  // src/git/install.ts
20
21
  import { createHash } from "crypto";
@@ -85,9 +86,117 @@ function installIfStale(root, spec, report) {
85
86
  return 0;
86
87
  }
87
88
 
89
+ // src/git/added-submodules.ts
90
+ import {
91
+ existsSync as existsSync2,
92
+ mkdirSync as mkdirSync2,
93
+ readdirSync,
94
+ renameSync,
95
+ rmSync,
96
+ writeFileSync as writeFileSync2
97
+ } from "fs";
98
+ import { dirname as dirname2, join as join2 } from "path";
99
+ var ADDED_GITLINK = /^:\d{6} 160000 [0-9a-f]{40} ([0-9a-f]{40}) [AT]\t(.+)$/u;
100
+ function initAddedSubmodules(root, from, to) {
101
+ const raw = gitText(root, [
102
+ "diff",
103
+ "--raw",
104
+ "--abbrev=40",
105
+ "--no-renames",
106
+ from,
107
+ to
108
+ ]);
109
+ const lines = [];
110
+ for (const entry of raw.split("\n")) {
111
+ const added = ADDED_GITLINK.exec(entry);
112
+ if (!added) continue;
113
+ const [, pin = "", path = ""] = added;
114
+ lines.push(`${path}: ${initOne(root, path, pin, from)}`);
115
+ }
116
+ return lines;
117
+ }
118
+ function initOne(root, path, pin, from) {
119
+ const dir = join2(root, path);
120
+ if (existsSync2(join2(dir, ".git"))) return "already checked out";
121
+ let displaced = "";
122
+ if (existsSync2(dir) && readdirSync(dir).length > 0) {
123
+ if (unignoredFiles(root, path, from).length > 0)
124
+ return `new submodule not checked out: ${path} holds files git does not ignore; move them aside, then git submodule update --init ${path}`;
125
+ displaced = displace(root, path);
126
+ }
127
+ const done = git(root, ["submodule", "update", "--init", "-q", "--", path]);
128
+ const aside = displaced ? `; its ignored files from before are in ${displaced}, so run the install again` : "";
129
+ if (done.status !== 0)
130
+ return `new submodule not checked out: ${done.stderr.trim()}${aside}`;
131
+ return `new submodule checked out at ${pin.slice(0, 10)}${aside}`;
132
+ }
133
+ function unignoredFiles(root, path, from) {
134
+ const restored = restoreIgnoreFiles(root, path, from);
135
+ const own = new Set(restored);
136
+ const kept = [];
137
+ try {
138
+ let level = [path];
139
+ while (level.length > 0) {
140
+ const entries = level.flatMap(
141
+ (dir) => readdirSync(join2(root, dir), { withFileTypes: true }).map((entry) => ({
142
+ path: `${dir}/${entry.name}`,
143
+ dir: entry.isDirectory()
144
+ }))
145
+ );
146
+ const checked = gitWithInput(
147
+ root,
148
+ ["check-ignore", "--no-index", "--stdin", "-z"],
149
+ entries.map((entry) => `${entry.path}\0`).join("")
150
+ );
151
+ const ignored = new Set(checked.stdout.split("\0").filter(Boolean));
152
+ const open = entries.filter(
153
+ (entry) => !ignored.has(entry.path) && !own.has(entry.path)
154
+ );
155
+ kept.push(
156
+ ...open.filter((entry) => !entry.dir).map((entry) => entry.path)
157
+ );
158
+ level = open.filter((entry) => entry.dir).map((entry) => entry.path);
159
+ }
160
+ } finally {
161
+ for (const file of restored) rmSync(join2(root, file));
162
+ }
163
+ return kept;
164
+ }
165
+ function restoreIgnoreFiles(root, path, from) {
166
+ const listed = git(root, [
167
+ "ls-tree",
168
+ "-r",
169
+ "-z",
170
+ "--name-only",
171
+ from,
172
+ "--",
173
+ path
174
+ ]);
175
+ if (listed.status !== 0) return [];
176
+ const restored = [];
177
+ for (const file of listed.stdout.split("\0")) {
178
+ if (!file.endsWith("/.gitignore")) continue;
179
+ const target = join2(root, file);
180
+ if (existsSync2(target) || !existsSync2(dirname2(target))) continue;
181
+ const body = git(root, ["show", `${from}:${file}`]);
182
+ if (body.status !== 0) continue;
183
+ writeFileSync2(target, body.stdout);
184
+ restored.push(file);
185
+ }
186
+ return restored;
187
+ }
188
+ function displace(root, path) {
189
+ const gitDir = gitText(root, ["rev-parse", "--absolute-git-dir"]);
190
+ const stamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/gu, "-");
191
+ const target = join2(gitDir, "pmcp-displaced", stamp, path);
192
+ mkdirSync2(dirname2(target), { recursive: true });
193
+ renameSync(join2(root, path), target);
194
+ return target;
195
+ }
196
+
88
197
  // src/git/submodules.ts
89
- import { existsSync as existsSync2 } from "fs";
90
- import { join as join2 } from "path";
198
+ import { existsSync as existsSync3 } from "fs";
199
+ import { join as join3 } from "path";
91
200
  var GITLINK = /^:160000 160000 ([0-9a-f]{40}) ([0-9a-f]{40}) M\t(.+)$/u;
92
201
  function clean(dir) {
93
202
  return git(dir, ["status", "--porcelain"]).stdout.trim() === "";
@@ -104,7 +213,7 @@ function blocking(dir, head, pin) {
104
213
  }
105
214
  function followOne(dir, oldPin, newPin, shared) {
106
215
  const short = newPin.slice(0, 10);
107
- if (!existsSync2(join2(dir, ".git"))) return "not checked out, left alone";
216
+ if (!existsSync3(join3(dir, ".git"))) return "not checked out, left alone";
108
217
  const head = gitText(dir, ["rev-parse", "HEAD"]);
109
218
  if (head === newPin) return `already at ${short}`;
110
219
  if (head !== oldPin)
@@ -137,7 +246,7 @@ function followPins(root, from, to, shared = []) {
137
246
  if (!match) continue;
138
247
  const [, oldPin = "", newPin = "", path = ""] = match;
139
248
  lines.push(
140
- `${path}: ${followOne(join2(root, path), oldPin, newPin, shared.includes(path))}`
249
+ `${path}: ${followOne(join3(root, path), oldPin, newPin, shared.includes(path))}`
141
250
  );
142
251
  }
143
252
  return lines;
@@ -145,8 +254,8 @@ function followPins(root, from, to, shared = []) {
145
254
  function movableSubmodules(root) {
146
255
  const listed = git(root, ["submodule", "status"]).stdout;
147
256
  return listed.split("\n").filter((line) => /^[ +]/u.test(line)).map((line) => line.trim().split(/\s+/u)[1] ?? "").filter((path) => {
148
- const dir = join2(root, path);
149
- if (!path || !existsSync2(join2(dir, ".git"))) return false;
257
+ const dir = join3(root, path);
258
+ if (!path || !existsSync3(join3(dir, ".git"))) return false;
150
259
  const local = gitText(dir, [
151
260
  "rev-list",
152
261
  "--count",
@@ -161,7 +270,7 @@ function updateToPins(root, paths) {
161
270
  const lines = [];
162
271
  for (const path of paths) {
163
272
  const pin = gitText(root, ["rev-parse", `HEAD:${path}`]);
164
- const dir = join2(root, path);
273
+ const dir = join3(root, path);
165
274
  if (!pin || !hasCommit(dir, pin)) {
166
275
  lines.push(
167
276
  `${path}: left alone, ${pin.slice(0, 10) || "its pin"} is not in its checkout`
@@ -243,6 +352,10 @@ function syncOnce(options) {
243
352
  `moved ${before.slice(0, 10)} -> ${after.slice(0, 10)}, ${counted.behind} commit(s)`
244
353
  );
245
354
  for (const line of updateToPins(ctx.root, submodules)) report.info(line);
355
+ if (options.followSubmodules) {
356
+ for (const line of initAddedSubmodules(ctx.root, before, after))
357
+ report.info(line);
358
+ }
246
359
  if (options.umask !== void 0)
247
360
  reportModes(report, [
248
361
  ...restoreModes(ctx.root, before, after),
@@ -258,7 +371,8 @@ export {
258
371
  lockHash,
259
372
  installState,
260
373
  installIfStale,
374
+ initAddedSubmodules,
261
375
  followPins,
262
376
  syncWorktree
263
377
  };
264
- //# sourceMappingURL=chunk-2A3F7ID4.js.map
378
+ //# sourceMappingURL=chunk-CFSYEB4U.js.map
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-UKR64U7J.js";
4
4
  import {
5
5
  syncWorktree
6
- } from "./chunk-2A3F7ID4.js";
6
+ } from "./chunk-CFSYEB4U.js";
7
7
  import {
8
8
  localCli,
9
9
  pmcpCommand,
@@ -24,14 +24,14 @@ import {
24
24
  } from "./chunk-73AKO4UL.js";
25
25
  import {
26
26
  withUmask
27
- } from "./chunk-P6LNYYYH.js";
27
+ } from "./chunk-M6X6HVQK.js";
28
28
  import {
29
29
  leaseSpecs,
30
30
  readGitConfig
31
- } from "./chunk-FE7WOHZM.js";
31
+ } from "./chunk-7CSUKCU7.js";
32
32
  import {
33
33
  detect
34
- } from "./chunk-2Q6MNGU5.js";
34
+ } from "./chunk-SUDG7B6S.js";
35
35
  import {
36
36
  inboxKey,
37
37
  noticeOf,
@@ -43,7 +43,7 @@ import {
43
43
  } from "./chunk-Z6WRFOFT.js";
44
44
  import {
45
45
  gitText
46
- } from "./chunk-G7JONWL4.js";
46
+ } from "./chunk-B3OZ4GGO.js";
47
47
  import {
48
48
  safeEndpoint
49
49
  } from "./chunk-Q5H3L6Y4.js";
@@ -68,7 +68,7 @@ import {
68
68
  readHost,
69
69
  readLock,
70
70
  readLockFile
71
- } from "./chunk-F34XIDXT.js";
71
+ } from "./chunk-2R3FVI6M.js";
72
72
  import {
73
73
  ProjectError,
74
74
  RULES_DIR,
@@ -5513,4 +5513,4 @@ export {
5513
5513
  checkBudget,
5514
5514
  readSpec
5515
5515
  };
5516
- //# sourceMappingURL=chunk-FFCDSSKA.js.map
5516
+ //# sourceMappingURL=chunk-DYAOLBWZ.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  HOST_MANIFEST,
3
3
  HOST_POLICY
4
- } from "./chunk-F34XIDXT.js";
4
+ } from "./chunk-2R3FVI6M.js";
5
5
  import {
6
6
  projectStateDir
7
7
  } from "./chunk-OEH47H6A.js";
@@ -99,4 +99,4 @@ export {
99
99
  hostApprovalDoctor,
100
100
  writeApproval
101
101
  };
102
- //# sourceMappingURL=chunk-3IX5TBRW.js.map
102
+ //# sourceMappingURL=chunk-EKW2TQA3.js.map
@@ -7,7 +7,7 @@ import {
7
7
  import {
8
8
  nativeBinary,
9
9
  ptyBinary
10
- } from "./chunk-F34XIDXT.js";
10
+ } from "./chunk-2R3FVI6M.js";
11
11
 
12
12
  // src/tui/rust.ts
13
13
  import { spawn } from "child_process";
@@ -62,4 +62,4 @@ export {
62
62
  runTui,
63
63
  dependencies
64
64
  };
65
- //# sourceMappingURL=chunk-PFHSFYQB.js.map
65
+ //# sourceMappingURL=chunk-GTZ5R2ER.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createSkillServer
3
- } from "./chunk-JJT5XRMV.js";
3
+ } from "./chunk-4GBK5M5C.js";
4
4
  import {
5
5
  attachMailbox
6
6
  } from "./chunk-JZKAJUVT.js";
@@ -84,4 +84,4 @@ export {
84
84
  serveWithMailbox,
85
85
  main
86
86
  };
87
- //# sourceMappingURL=chunk-5KA3RS5Y.js.map
87
+ //# sourceMappingURL=chunk-HABVHASY.js.map