@unbrained/pm-cli 2026.7.20 → 2026.7.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +11 -0
- package/dist/cli/commander-usage.d.ts +1 -1
- package/dist/cli/commander-usage.js +5 -5
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/completion.js +13 -5
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/contracts.js +4 -3
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +2 -0
- package/dist/cli/error-guidance.js +7 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/main.d.ts +1 -5
- package/dist/cli/main.js +12 -50
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +13 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +45 -3
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-structured-mutation.d.ts +14 -0
- package/dist/cli/register-structured-mutation.js +62 -0
- package/dist/cli/register-structured-mutation.js.map +1 -0
- package/dist/cli/registration-helpers.js +5 -3
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +280 -296
- package/dist/cli-bundle/chunks/{append-E6V54WOQ.js → append-7OVFYR3C.js} +3 -3
- package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js → append-DFETHAZL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C3KD7U3T.js → chunk-2L6ZP22J.js} +241 -10
- package/dist/cli-bundle/chunks/chunk-2L6ZP22J.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KZEANWJS.js → chunk-4PUUNQDV.js} +98 -30
- package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js → chunk-4QOB7L7I.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RDV4ZFYS.js.map → chunk-4QOB7L7I.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3LPFHE3P.js → chunk-4QSQ6XDK.js} +62 -20
- package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js → chunk-7656MAUL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3AO5VSDR.js → chunk-7RW4JCU2.js} +328 -6
- package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js → chunk-7W2UAXXT.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js → chunk-ABWCF646.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-SSKOQNMS.js.map → chunk-ABWCF646.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-WVA4DVNV.js → chunk-ADBTSVGK.js} +71 -33
- package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-J4FBIFU6.js → chunk-AELMUANP.js} +12 -6
- package/dist/cli-bundle/chunks/chunk-AELMUANP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4F6BWJ4J.js → chunk-AMJPSANK.js} +57 -36
- package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6VIJ7UA5.js → chunk-AS4SAZ5R.js} +850 -819
- package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SG74J6MV.js → chunk-ATBCUC7Y.js} +574 -5
- package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js → chunk-BXNDKOR2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js → chunk-CPX275C6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js → chunk-DZRV2OPA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js → chunk-E5XMKOSB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js → chunk-EWJWSNRU.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DAQ45GCS.js → chunk-F2LBF7XJ.js} +22 -15
- package/dist/cli-bundle/chunks/chunk-F2LBF7XJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6XMUURSS.js → chunk-FJIFFBJX.js} +64 -33
- package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js → chunk-FO6OSVEN.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-E7ICD63T.js.map → chunk-FO6OSVEN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js → chunk-FPBMLYPI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UZDQXNUB.js → chunk-FSE2IKJQ.js} +46 -5
- package/dist/cli-bundle/chunks/chunk-FSE2IKJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IX677TRO.js → chunk-GKX4NJ7U.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-IX677TRO.js.map → chunk-GKX4NJ7U.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js → chunk-GTK4DTEW.js} +5 -5
- package/dist/cli-bundle/chunks/chunk-H7EAER5L.js +974 -0
- package/dist/cli-bundle/chunks/chunk-H7EAER5L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5UX66S6U.js → chunk-ICDAQ4TD.js} +316 -8
- package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js → chunk-JFD5LPMI.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-YQQNAKW3.js.map → chunk-JFD5LPMI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js → chunk-JXCW2TI2.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-QANSTTC7.js.map → chunk-JXCW2TI2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GSJSM5BJ.js → chunk-K36WV5J6.js} +76 -13
- package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GVI6FAFG.js → chunk-K55VMLSS.js} +7 -5
- package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js → chunk-KBLZ3AA5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js → chunk-KH44WBAT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GV2262OF.js → chunk-LAV26CQG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js → chunk-LVC72YRD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VY6MIEO.js → chunk-LZYP423P.js} +35 -6
- package/dist/cli-bundle/chunks/chunk-LZYP423P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js → chunk-MATHDCGG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OV7MSW3I.js → chunk-MWQ2HC2A.js} +99 -31
- package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NHT3F4WZ.js → chunk-NUF7ROFH.js} +840 -816
- package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js → chunk-O4BCOJTZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js → chunk-OCUBRA6D.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5IZJWSDB.js → chunk-OG5DVFMA.js} +22 -15
- package/dist/cli-bundle/chunks/chunk-OG5DVFMA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I577UHC7.js → chunk-OR42SO64.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js → chunk-OY7DMU5P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HEWM6CEN.js → chunk-P7MTHPJQ.js} +50 -9
- package/dist/cli-bundle/chunks/chunk-P7MTHPJQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js → chunk-PFNHX655.js} +236 -12
- package/dist/cli-bundle/chunks/{chunk-2BO4CA46.js.map → chunk-PFNHX655.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js → chunk-PONKZPCJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-THAOZG4U.js → chunk-PQSEQD6E.js} +8 -6
- package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js +991 -0
- package/dist/cli-bundle/chunks/chunk-PWDEHT3L.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js → chunk-PZC2FUOQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js → chunk-QG4GFLQ6.js} +3 -5
- package/dist/cli-bundle/chunks/{chunk-WUVEBQW6.js.map → chunk-QG4GFLQ6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js → chunk-QIH77CAG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js → chunk-QJIKE24M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js → chunk-QOOTOD3W.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-QLZ643FM.js.map → chunk-QOOTOD3W.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js → chunk-R3P6FZJW.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-MYSS5H2A.js.map → chunk-R3P6FZJW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-G3COA6GS.js → chunk-RNPZYNHS.js} +56 -35
- package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-T44FMVRL.js → chunk-RPESLSO5.js} +62 -20
- package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-INSTSQNZ.js → chunk-SY4SFZSD.js} +595 -3
- package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js → chunk-TRSHFPRZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js → chunk-UCBDQI5E.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js → chunk-V22ZPOKN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js → chunk-VHXHVTUU.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LPEYZRUR.js → chunk-VJQG4BIM.js} +35 -6
- package/dist/cli-bundle/chunks/chunk-VJQG4BIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js → chunk-VLRGDBLY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js → chunk-VNTCM3VW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js → chunk-VXOOB6YX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js → chunk-VZIZB6QH.js} +3 -5
- package/dist/cli-bundle/chunks/{chunk-GFQP7HAZ.js.map → chunk-VZIZB6QH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js → chunk-X3W65QK3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js → chunk-XJTABV3X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GVT754PX.js → chunk-YCIUJJOD.js} +11 -5
- package/dist/cli-bundle/chunks/chunk-YCIUJJOD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IJNK6WW2.js → chunk-Z75ONV25.js} +75 -12
- package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js → chunk-Z7VWXXJM.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-4L23AGQ7.js.map → chunk-Z7VWXXJM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js → chunk-ZTVA4KLN.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-YBT7O4KT.js.map → chunk-ZTVA4KLN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js → chunk-ZVZGXPQ5.js} +2 -2
- package/dist/cli-bundle/chunks/{close-many-SDA426VT.js → close-many-5RZXVN4J.js} +5 -6
- package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js → close-many-RZVTUGBG.js} +5 -6
- package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js → comments-TPU7QRBL.js} +4 -4
- package/dist/cli-bundle/chunks/{comments-VBQ345ND.js → comments-Z4KV6FU3.js} +4 -4
- package/dist/cli-bundle/chunks/{create-GG4RBCGC.js → create-EIFBIVNQ.js} +6 -6
- package/dist/cli-bundle/chunks/{create-JBC5KUW6.js → create-RGSPN5GD.js} +6 -6
- package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js → deps-UH5EQQUY.js} +3 -3
- package/dist/cli-bundle/chunks/{deps-DELOO4TL.js → deps-YG7UF3VR.js} +3 -3
- package/dist/cli-bundle/chunks/{docs-6Z2MP526.js → docs-G32TK6XS.js} +4 -4
- package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js → docs-JWWNRC27.js} +4 -4
- package/dist/cli-bundle/chunks/{files-HKEAN5MA.js → files-3H32UQ4K.js} +4 -4
- package/dist/cli-bundle/chunks/{files-HEUGSJZL.js → files-4ALMCSKB.js} +4 -4
- package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js → history-compact-77BT2LUB.js} +3 -4
- package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js → history-compact-VCKGTX64.js} +3 -4
- package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js → history-redact-LJPZPNFA.js} +2 -3
- package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js → history-redact-PWTTJ3XS.js} +2 -3
- package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js → history-repair-I7CBNCV3.js} +5 -6
- package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js → history-repair-YTDZRK5E.js} +5 -6
- package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js → learnings-CYNOICKR.js} +4 -4
- package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js → learnings-KTYW3AL7.js} +4 -4
- package/dist/cli-bundle/chunks/{notes-7JMLQ447.js → notes-FGO63FXL.js} +4 -4
- package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js → notes-ZERD3KB2.js} +4 -4
- package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js → plan-OFJUBIM5.js} +7 -7
- package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js → plan-SGCDDTYR.js} +7 -7
- package/dist/cli-bundle/chunks/{profile-OILJHKUW.js → profile-3THJPIQY.js} +4 -5
- package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js → profile-XEZAMMBW.js} +4 -5
- package/dist/cli-bundle/chunks/{register-list-query-CFVG75P3.js → register-list-query-BR435Q2H.js} +19 -16
- package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-E7UVY4TN.js → register-list-query-RWTWLOBE.js} +18 -15
- package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-IQ55E25C.js → register-mutation-HLWC2WNP.js} +167 -31
- package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-4VJTXBZW.js → register-mutation-ZJX5AZM5.js} +173 -30
- package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js → register-operations-744YBJMV.js} +23 -25
- package/dist/cli-bundle/chunks/{register-operations-AR7RMX4W.js.map → register-operations-744YBJMV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js → register-operations-UEBJH6AN.js} +21 -23
- package/dist/cli-bundle/chunks/{register-operations-NOLZGORC.js.map → register-operations-UEBJH6AN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js → register-setup-5DA4UZXI.js} +7 -8
- package/dist/cli-bundle/chunks/{register-setup-EYZ7VTPZ.js.map → register-setup-5DA4UZXI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js → register-setup-6H25M3BH.js} +9 -10
- package/dist/cli-bundle/chunks/{register-setup-BB77VUEE.js.map → register-setup-6H25M3BH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js → restore-6TDVSATY.js} +4 -5
- package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js → restore-RSL7C7LO.js} +4 -5
- package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js → schema-HFXFSGPG.js} +2 -3
- package/dist/cli-bundle/chunks/{schema-55DL3Q52.js → schema-TPVTIJPO.js} +2 -3
- package/dist/cli-bundle/chunks/{update-FW6FKDOP.js → update-LJZCL5SI.js} +7 -7
- package/dist/cli-bundle/chunks/{update-TJHSPRPT.js → update-SIA7LH5Y.js} +7 -7
- package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js → update-many-BDBZVGQL.js} +11 -12
- package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js → update-many-MOY3A5B3.js} +11 -12
- package/dist/cli-bundle/main.js +60 -85
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +37 -37
- package/dist/cli-bundle/sdk.js +126 -291
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/core/item/parse.d.ts +1 -1
- package/dist/core/item/parse.js +13 -7
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/output/mutation-projection.d.ts +2 -0
- package/dist/core/output/mutation-projection.js +33 -2
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/output/output.d.ts +4 -0
- package/dist/core/output/output.js +18 -13
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +4 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/mcp/server.js +39 -4
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +45 -4
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-bootstrap.d.ts +2 -0
- package/dist/sdk/cli-bootstrap.js +20 -27
- package/dist/sdk/cli-bootstrap.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +2 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +21 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +10 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +16 -3
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +6 -2
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts.js +3 -3
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/cli-program.js +4 -2
- package/dist/sdk/cli-program.js.map +1 -1
- package/dist/sdk/dependencies.d.ts +3 -2
- package/dist/sdk/dependencies.js +13 -12
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/sdk/error-runtime.d.ts +10 -0
- package/dist/sdk/error-runtime.js +59 -0
- package/dist/sdk/error-runtime.js.map +1 -0
- package/dist/sdk/graph/analytics.d.ts +9 -0
- package/dist/sdk/graph/analytics.js +24 -13
- package/dist/sdk/graph/analytics.js.map +1 -1
- package/dist/sdk/graph/assembly.d.ts +39 -0
- package/dist/sdk/graph/assembly.js +92 -12
- package/dist/sdk/graph/assembly.js.map +1 -1
- package/dist/sdk/graph/cache.d.ts +4 -1
- package/dist/sdk/graph/cache.js +17 -4
- package/dist/sdk/graph/cache.js.map +1 -1
- package/dist/sdk/graph/centrality.d.ts +82 -0
- package/dist/sdk/graph/centrality.js +259 -0
- package/dist/sdk/graph/centrality.js.map +1 -0
- package/dist/sdk/graph/durable-cache.d.ts +71 -0
- package/dist/sdk/graph/durable-cache.js +205 -0
- package/dist/sdk/graph/durable-cache.js.map +1 -0
- package/dist/sdk/graph/governance.d.ts +69 -1
- package/dist/sdk/graph/governance.js +143 -35
- package/dist/sdk/graph/governance.js.map +1 -1
- package/dist/sdk/graph/index.d.ts +7 -4
- package/dist/sdk/graph/index.js +8 -5
- package/dist/sdk/graph/index.js.map +1 -1
- package/dist/sdk/graph/mutation-advisory.d.ts +35 -4
- package/dist/sdk/graph/mutation-advisory.js +124 -35
- package/dist/sdk/graph/mutation-advisory.js.map +1 -1
- package/dist/sdk/graph/remediation.js +12 -2
- package/dist/sdk/graph/remediation.js.map +1 -1
- package/dist/sdk/graph/run.d.ts +133 -2
- package/dist/sdk/graph/run.js +217 -8
- package/dist/sdk/graph/run.js.map +1 -1
- package/dist/sdk/graph/scheduling.d.ts +59 -0
- package/dist/sdk/graph/scheduling.js +125 -0
- package/dist/sdk/graph/scheduling.js.map +1 -0
- package/dist/sdk/graph/traversal.d.ts +11 -0
- package/dist/sdk/graph/traversal.js +16 -2
- package/dist/sdk/graph/traversal.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -0
- package/dist/sdk/index.js +6 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime-input.js +7 -2
- package/dist/sdk/runtime-input.js.map +1 -1
- package/dist/sdk/runtime-primitives.d.ts +10 -0
- package/dist/sdk/runtime-primitives.js +14 -0
- package/dist/sdk/runtime-primitives.js.map +1 -0
- package/dist/sdk/runtime.d.ts +15 -0
- package/dist/sdk/runtime.js +16 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/structured-mutations.d.ts +21 -0
- package/dist/sdk/structured-mutations.js +375 -0
- package/dist/sdk/structured-mutations.js.map +1 -0
- package/docs/COMMANDS.md +85 -5
- package/docs/RELATIONSHIP_GRAPH.md +48 -7
- package/docs/SDK.md +78 -3
- package/marketplace.json +2 -2
- package/package.json +1 -1
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/packages/pm-vcs/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +5 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/chunk-3AO5VSDR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3LPFHE3P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3VY6MIEO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4F6BWJ4J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5IZJWSDB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5UX66S6U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js +0 -286
- package/dist/cli-bundle/chunks/chunk-6C2ZZX5Z.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6VIJ7UA5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6XMUURSS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C3KD7U3T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js +0 -334
- package/dist/cli-bundle/chunks/chunk-CFHAODHQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DAQ45GCS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-E6LEMURX.js +0 -249
- package/dist/cli-bundle/chunks/chunk-E6LEMURX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-G3COA6GS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GSJSM5BJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GVI6FAFG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GVT754PX.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HEWM6CEN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IJNK6WW2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-INSTSQNZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J4FBIFU6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KZEANWJS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LPEYZRUR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NHT3F4WZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OV7MSW3I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js +0 -246
- package/dist/cli-bundle/chunks/chunk-P7JTWYLH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js +0 -344
- package/dist/cli-bundle/chunks/chunk-R5U2VZ3K.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SG74J6MV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-T44FMVRL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-THAOZG4U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UQLXSG72.js +0 -289
- package/dist/cli-bundle/chunks/chunk-UQLXSG72.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UZDQXNUB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WVA4DVNV.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-CFVG75P3.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-E7UVY4TN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-4VJTXBZW.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-IQ55E25C.js.map +0 -1
- /package/dist/cli-bundle/chunks/{append-E6V54WOQ.js.map → append-7OVFYR3C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-NNJ3EFIT.js.map → append-DFETHAZL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QJKL5PHS.js.map → chunk-7656MAUL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X6K5XTTN.js.map → chunk-7W2UAXXT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5OK4UGFV.js.map → chunk-BXNDKOR2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KSPWRNVP.js.map → chunk-CPX275C6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JH2ZSLO3.js.map → chunk-DZRV2OPA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L7BH7IWU.js.map → chunk-E5XMKOSB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CQTQKUUV.js.map → chunk-EWJWSNRU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3MCTMJXI.js.map → chunk-FPBMLYPI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DVDBQA3B.js.map → chunk-GTK4DTEW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GIQSU6S2.js.map → chunk-KBLZ3AA5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XJF7CDNH.js.map → chunk-KH44WBAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GV2262OF.js.map → chunk-LAV26CQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VDO2JMD4.js.map → chunk-LVC72YRD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZYPFOO3L.js.map → chunk-MATHDCGG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AOEOYL3S.js.map → chunk-O4BCOJTZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RJO3YAFM.js.map → chunk-OCUBRA6D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I577UHC7.js.map → chunk-OR42SO64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZOJ3LR7O.js.map → chunk-OY7DMU5P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZV2NTVMJ.js.map → chunk-PONKZPCJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UX6SSO2I.js.map → chunk-PZC2FUOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VQIHNHMJ.js.map → chunk-QIH77CAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R3EWPG4A.js.map → chunk-QJIKE24M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HB3P4M52.js.map → chunk-TRSHFPRZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HRW7GF6T.js.map → chunk-UCBDQI5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4U4Z6AHI.js.map → chunk-V22ZPOKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JM6YAXTR.js.map → chunk-VHXHVTUU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D6NXDNP3.js.map → chunk-VLRGDBLY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JAPE62Y5.js.map → chunk-VNTCM3VW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDHPAVVB.js.map → chunk-VXOOB6YX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HQ3SB4CN.js.map → chunk-X3W65QK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RZJLNXFG.js.map → chunk-XJTABV3X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TYHJDFYW.js.map → chunk-ZVZGXPQ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-SDA426VT.js.map → close-many-5RZXVN4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-UTZANOCQ.js.map → close-many-RZVTUGBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-LZN6FXXC.js.map → comments-TPU7QRBL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-VBQ345ND.js.map → comments-Z4KV6FU3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-GG4RBCGC.js.map → create-EIFBIVNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JBC5KUW6.js.map → create-RGSPN5GD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-FI4O6NQS.js.map → deps-UH5EQQUY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-DELOO4TL.js.map → deps-YG7UF3VR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-6Z2MP526.js.map → docs-G32TK6XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-2UYBP5D6.js.map → docs-JWWNRC27.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-HKEAN5MA.js.map → files-3H32UQ4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-HEUGSJZL.js.map → files-4ALMCSKB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-7NDVP3PT.js.map → history-compact-77BT2LUB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-65YVN5DB.js.map → history-compact-VCKGTX64.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-7YBL4XSG.js.map → history-redact-LJPZPNFA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IZGNJBU4.js.map → history-redact-PWTTJ3XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-7M4PYQUH.js.map → history-repair-I7CBNCV3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-GNGETJLI.js.map → history-repair-YTDZRK5E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-3YXDRWFT.js.map → learnings-CYNOICKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-ALC6IMNL.js.map → learnings-KTYW3AL7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-7JMLQ447.js.map → notes-FGO63FXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-JFCLTC5C.js.map → notes-ZERD3KB2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-T3XB3WTK.js.map → plan-OFJUBIM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-KOIPWVOZ.js.map → plan-SGCDDTYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-OILJHKUW.js.map → profile-3THJPIQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-RJXA7PGS.js.map → profile-XEZAMMBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-ZH65GZFB.js.map → restore-6TDVSATY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-L6IAGOD7.js.map → restore-RSL7C7LO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-4ERWM5QJ.js.map → schema-HFXFSGPG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-55DL3Q52.js.map → schema-TPVTIJPO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-FW6FKDOP.js.map → update-LJZCL5SI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-TJHSPRPT.js.map → update-SIA7LH5Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-PWXX5WHO.js.map → update-many-BDBZVGQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-NNALYQCN.js.map → update-many-MOY3A5B3.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../sdk/workspace.ts", "../../../../../../../../sdk/merge/install.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module sdk/workspace\n *\n * Maintains repository-scaffold contracts shared by the public SDK and CLI.\n */\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/** Opening marker for the init-owned ignore block. */\nexport const PM_GITIGNORE_START = \"# pm-cli:runtime-cache:start\";\n/** Closing marker for the init-owned ignore block. */\nexport const PM_GITIGNORE_END = \"# pm-cli:runtime-cache:end\";\n\n/** Default workspace-relative tracker root used when no custom root is resolved. */\nexport const PM_GITIGNORE_DEFAULT_TRACKER_ROOT = \".agents/pm\";\n\n/**\n * Tracker-relative directories that hold per-clone runtime state (caches,\n * search indexes, locks, crash-recovery receipts). They must never be\n * committed: they churn on every command and conflict on every concurrent\n * branch merge. `transactions/` (SDK workspace-transaction journals) and\n * `checkpoints/` (bulk-mutation rollback receipts) are per-branch recovery\n * state with their own GC (`pm gc --scope transactions|checkpoints`), so\n * keeping them untracked is the recorded merge-safety disposition.\n */\nexport const PM_GITIGNORE_RUNTIME_DIRECTORIES = [\n \"runtime/\",\n \"search/\",\n \"locks/\",\n \"transactions/\",\n \"checkpoints/\",\n] as const;\n\n/** Result of reconciling the init-owned repository ignore block. */\nexport interface EnsurePmGitignoreResult {\n /** Absolute path to the reconciled file. */\n path: string;\n /** Whether the file content changed. */\n changed: boolean;\n}\n\nfunction normalizeTrackerRelativeRoot(trackerRelativeRoot: string): string {\n return trackerRelativeRoot\n .replaceAll(\"\\\\\", \"/\")\n .replace(/^\\.\\/+/, \"\")\n .replace(/\\/+$/, \"\");\n}\n\n/** Return whether a relative path escapes its owning root, without rejecting valid names such as `..pm`. */\nexport function isPathOutsideRoot(relativePath: string): boolean {\n const normalized = relativePath.replaceAll(\"\\\\\", \"/\");\n return (\n path.isAbsolute(relativePath) ||\n normalized === \"..\" ||\n normalized.startsWith(\"../\")\n );\n}\n\n/** Return the canonical pm ignore block rendered for the given workspace-relative tracker root (defaults to `.agents/pm`), primarily for documentation and tests. */\nexport function getPmGitignoreBlock(\n trackerRelativeRoot: string = PM_GITIGNORE_DEFAULT_TRACKER_ROOT,\n): string {\n const root = normalizeTrackerRelativeRoot(trackerRelativeRoot);\n return [\n PM_GITIGNORE_START,\n ...PM_GITIGNORE_RUNTIME_DIRECTORIES.map(\n (directory) => `${root}/${directory}`,\n ),\n PM_GITIGNORE_END,\n ].join(\"\\n\");\n}\n\n/**\n * Idempotently create or replace the fenced pm cache block in a workspace\n * `.gitignore`. When `pmRoot` is provided the ignored runtime directories are\n * rendered under the resolved workspace-relative tracker root, so custom-root\n * workspaces (`--pm-path`/`PM_PATH`) stop committing runtime caches (GH-598).\n * A tracker root outside the workspace needs no ignore rules here, so the\n * file is left untouched.\n */\nexport async function ensurePmGitignore(\n workspaceRoot: string,\n options: {\n /** Absolute tracker root; rendered relative to the workspace root. */\n pmRoot?: string;\n } = {},\n): Promise<EnsurePmGitignoreResult> {\n const gitignorePath = path.join(workspaceRoot, \".gitignore\");\n let trackerRelativeRoot = PM_GITIGNORE_DEFAULT_TRACKER_ROOT;\n if (options.pmRoot !== undefined) {\n const relative = normalizeTrackerRelativeRoot(\n path.relative(path.resolve(workspaceRoot), path.resolve(options.pmRoot)),\n );\n if (isPathOutsideRoot(relative)) {\n return { path: gitignorePath, changed: false };\n }\n if (relative.length > 0) {\n trackerRelativeRoot = relative;\n }\n }\n let current = \"\";\n try {\n current = await readFile(gitignorePath, \"utf8\");\n } catch (error: unknown) {\n if (\n !(error instanceof Error && \"code\" in error && error.code === \"ENOENT\")\n ) {\n throw error;\n }\n }\n const start = current.indexOf(PM_GITIGNORE_START);\n const end = current.indexOf(PM_GITIGNORE_END);\n const withoutManagedBlock =\n start >= 0 && end >= start\n ? `${current.slice(0, start)}${current.slice(end + PM_GITIGNORE_END.length)}`\n : current;\n const prefix = withoutManagedBlock.trimEnd();\n const next = `${prefix.length > 0 ? `${prefix}\\n\\n` : \"\"}${getPmGitignoreBlock(trackerRelativeRoot)}\\n`;\n if (next === current) {\n return { path: gitignorePath, changed: false };\n }\n await writeFile(gitignorePath, next, \"utf8\");\n return { path: gitignorePath, changed: true };\n}\n", "/**\n * @module sdk/merge/install\n *\n * Installs the tracker's git merge configuration into a repository: a fenced\n * `.gitattributes` block mapping every mergeable tracker artifact class to a\n * pm merge driver, plus the local `git config` driver definitions that make\n * those attributes effective. Idempotent and re-runnable; schema type\n * mutations refresh the fenced block automatically once it is installed.\n */\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport { execFile } from \"node:child_process\";\nimport path from \"node:path\";\nimport { promisify } from \"node:util\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport {\n readSettings,\n resolveGovernanceKnobs,\n} from \"../../core/store/settings.js\";\nimport { isPathOutsideRoot } from \"../workspace.js\";\n\nconst execFileAsync = promisify(execFile);\n\n/** Opening marker for the pm-owned merge-driver `.gitattributes` block. */\nexport const PM_GITATTRIBUTES_START = \"# pm-cli:merge-drivers:start\";\n/** Closing marker for the pm-owned merge-driver `.gitattributes` block. */\nexport const PM_GITATTRIBUTES_END = \"# pm-cli:merge-drivers:end\";\n\nconst MERGE_FENCE_LOCK_ID = \"merge-fence\";\n\nconst MERGE_DRIVER_DEFINITIONS = [\n {\n key: \"pm-item-toon\",\n name: \"pm field-aware TOON item document merge\",\n artifact: \"item\",\n itemPath: \"item.toon\",\n },\n {\n key: \"pm-item-markdown\",\n name: \"pm field-aware JSON-markdown item document merge\",\n artifact: \"item\",\n itemPath: \"item.md\",\n },\n {\n key: \"pm-history\",\n name: \"pm append-only history stream merge\",\n artifact: \"history\",\n itemPath: undefined,\n },\n {\n key: \"pm-relationship\",\n name: \"pm append-only relationship event store merge\",\n artifact: \"relationship\",\n itemPath: undefined,\n },\n {\n key: \"pm-json\",\n name: \"pm key-level JSON config merge\",\n artifact: \"json\",\n itemPath: undefined,\n },\n] as const;\n\n/** Documents the merge install options payload exchanged by command, SDK, and package integrations. */\nexport interface MergeInstallOptions {\n /** Preview the `.gitattributes` and `git config` changes without writing anything. */\n dryRun?: boolean;\n}\n\n/** Documents the merge install result payload exchanged by command, SDK, and package integrations. */\nexport interface MergeInstallResult {\n /** Whether the installation completed (or, for dry runs, would complete) without errors. */\n ok: boolean;\n /** Whether this run was a preview only. */\n dry_run: boolean;\n /** Repository root the merge configuration was installed into. */\n workspace_root: string;\n /** `.gitattributes` reconciliation outcome. */\n gitattributes: {\n path: string;\n changed: boolean;\n patterns: string[];\n };\n /** Local `git config` merge-driver definitions applied (or previewed). */\n git_config: Array<{ key: string; value: string }>;\n /** Guidance for completing the multi-branch workflow setup. */\n guidance: string[];\n /** ISO 8601 timestamp recording when generated occurred. */\n generated_at: string;\n}\n\nasync function resolveGitWorkspaceRoot(cwd: string): Promise<string> {\n try {\n const { stdout } = await execFileAsync(\n \"git\",\n [\"rev-parse\", \"--show-toplevel\"],\n { cwd, encoding: \"utf8\", windowsHide: true, timeout: 10_000 },\n );\n return stdout.trim();\n } catch {\n throw new PmCliError(\n \"pm merge install requires a git repository (merge drivers are git configuration).\",\n EXIT_CODE.USAGE,\n );\n }\n}\n\nfunction toPosixRelative(fromPath: string, toPath: string): string {\n return path.relative(fromPath, toPath).replaceAll(\"\\\\\", \"/\");\n}\n\n/** Encode one Git attributes pattern with C-style quoting so whitespace, backslashes, and quotation marks remain part of the repository path instead of being parsed as attribute separators. */\nfunction quoteGitAttributePattern(value: string): string {\n return `\"${value.replaceAll(\"\\\\\", \"\\\\\\\\\").replaceAll('\"', '\\\\\"')}\"`;\n}\n\n/**\n * Build the complete fenced `.gitattributes` pattern list for a tracker rooted\n * at `trackerRelativeRoot` (git-root-relative POSIX path, empty when the\n * tracker root IS the git root). This is the single coverage contract shared\n * by `pm merge install` (which writes the fence) and the validate\n * merge-fence-drift detection (which compares the committed fence against the\n * active schema's type folders), so schema-added custom types can never\n * silently diverge from the installed fence without a warning.\n */\nexport function buildMergeAttributePatterns(\n trackerRelativeRoot: string,\n typeFolders: string[],\n): string[] {\n const prefix =\n trackerRelativeRoot.length > 0 ? `${trackerRelativeRoot}/` : \"\";\n const patterns: string[] = [];\n for (const folder of typeFolders) {\n patterns.push(\n `${quoteGitAttributePattern(`${prefix}${folder}/*.toon`)} merge=pm-item-toon`,\n );\n patterns.push(\n `${quoteGitAttributePattern(`${prefix}${folder}/*.md`)} merge=pm-item-markdown`,\n );\n }\n // RelationshipEventStore deliberately accepts a caller-chosen relativePath\n // anywhere below the tracker root. Cover all tracker JSONL first, then let\n // the more-specific history rule below override it. This keeps custom event\n // stores protected without guessing package-owned paths.\n patterns.push(\n `${quoteGitAttributePattern(`${prefix}**/*.jsonl`)} merge=pm-relationship`,\n );\n patterns.push(\n `${quoteGitAttributePattern(`${prefix}history/*.jsonl`)} merge=pm-history`,\n );\n patterns.push(\n `${quoteGitAttributePattern(`${prefix}settings.json`)} merge=pm-json`,\n );\n patterns.push(\n `${quoteGitAttributePattern(`${prefix}schema/*.json`)} merge=pm-json`,\n );\n return patterns;\n}\n\nasync function reconcileGitattributesBlock(\n workspaceRoot: string,\n patterns: string[],\n dryRun: boolean,\n): Promise<{ path: string; changed: boolean }> {\n const gitattributesPath = path.join(workspaceRoot, \".gitattributes\");\n let current = \"\";\n try {\n current = await readFile(gitattributesPath, \"utf8\");\n } catch (error: unknown) {\n if (\n !(error instanceof Error && \"code\" in error && error.code === \"ENOENT\")\n ) {\n throw error;\n }\n }\n const block = [\n PM_GITATTRIBUTES_START,\n ...patterns,\n PM_GITATTRIBUTES_END,\n ].join(\"\\n\");\n const start = current.indexOf(PM_GITATTRIBUTES_START);\n const end = current.indexOf(PM_GITATTRIBUTES_END);\n const withoutManagedBlock =\n start >= 0 && end > start\n ? `${current.slice(0, start)}${current.slice(end + PM_GITATTRIBUTES_END.length)}`\n : current\n .replace(PM_GITATTRIBUTES_START, \"\")\n .replace(PM_GITATTRIBUTES_END, \"\");\n const prefix = withoutManagedBlock.trimEnd();\n const next = `${prefix.length > 0 ? `${prefix}\\n\\n` : \"\"}${block}\\n`;\n if (next === current) {\n return { path: gitattributesPath, changed: false };\n }\n if (!dryRun) {\n await writeFile(gitattributesPath, next, \"utf8\");\n }\n return { path: gitattributesPath, changed: true };\n}\n\n/** Result of comparing the committed merge-fence block against the coverage the active schema requires. */\nexport interface MergeFenceAuditResult {\n /** Audit outcome: no fence installed (nothing to audit), fence matches, or fence drifted from the active schema/type folders. */\n status: \"not_installed\" | \"ok\" | \"drift\";\n /** `.gitattributes` file containing the fence, when one was found. */\n path?: string;\n /** Expected attribute lines absent from the committed fence (for example a schema-added type folder). */\n missing_patterns: string[];\n /** Committed fence lines no longer produced by the coverage contract (for example a removed type folder). */\n stale_patterns: string[];\n}\n\n/**\n * Audit the committed `.gitattributes` merge fence against the coverage the\n * active schema requires, without touching git configuration. The fence file\n * is discovered by walking up from the tracker root (bounded), so the audit\n * stays filesystem-only and safe to run inside `pm validate`. A `drift`\n * result means items of some type folder (or a tracker JSONL store) would\n * merge under git's default text driver despite the fence being installed.\n */\nexport async function auditMergeAttributeFence(\n pmRoot: string,\n typeFolders: string[],\n): Promise<MergeFenceAuditResult> {\n const resolvedRoot = path.resolve(pmRoot);\n let fenceDirectory: string | null = null;\n let fenceContent = \"\";\n let directory = resolvedRoot;\n for (let depth = 0; depth < 8; depth += 1) {\n const candidate = path.join(directory, \".gitattributes\");\n try {\n const raw = await readFile(candidate, \"utf8\");\n if (raw.includes(PM_GITATTRIBUTES_START)) {\n fenceDirectory = directory;\n fenceContent = raw;\n break;\n }\n } catch {\n // No .gitattributes at this level; keep walking up.\n }\n const parent = path.dirname(directory);\n if (parent === directory) {\n break;\n }\n directory = parent;\n }\n if (fenceDirectory === null) {\n return { status: \"not_installed\", missing_patterns: [], stale_patterns: [] };\n }\n const fencePath = path.join(fenceDirectory, \".gitattributes\");\n const start = fenceContent.indexOf(PM_GITATTRIBUTES_START);\n const end = fenceContent.indexOf(PM_GITATTRIBUTES_END);\n const committed =\n end > start\n ? fenceContent\n .slice(start + PM_GITATTRIBUTES_START.length, end)\n .split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n : [];\n const expected = buildMergeAttributePatterns(\n toPosixRelative(fenceDirectory, resolvedRoot),\n typeFolders,\n );\n const committedSet = new Set(committed);\n const expectedSet = new Set(expected);\n const missing = expected.filter((line) => !committedSet.has(line));\n const stale = committed.filter((line) => !expectedSet.has(line));\n return {\n status: missing.length > 0 || stale.length > 0 ? \"drift\" : \"ok\",\n path: fencePath,\n missing_patterns: missing,\n stale_patterns: stale,\n };\n}\n\n/** Outcome of an automatic merge-fence refresh attempted after a schema type mutation. */\nexport interface MergeFenceRefreshOutcome {\n /** What happened: the fence was rewritten, already matched, was never installed (actionable hint), or there is no git repository to configure. */\n status: \"refreshed\" | \"unchanged\" | \"not_installed\" | \"no_git\";\n /** `.gitattributes` path examined, when a git repository was found. */\n path?: string;\n}\n\n/**\n * Refresh the fenced `.gitattributes` merge-driver block after a schema type\n * mutation, but only when `pm merge install` already ran (the fence markers\n * are present). Without this, custom item types registered after install\n * would write items into folders with no merge attribute — silently\n * reintroducing the whole-file conflict class for exactly those items. Repos\n * that never installed the fence get a `not_installed` outcome so callers can\n * surface an actionable hint instead of mutating git configuration nobody\n * asked for.\n */\nexport async function refreshMergeAttributeFenceIfInstalled(\n pmRoot: string,\n): Promise<MergeFenceRefreshOutcome> {\n let workspaceRoot: string;\n try {\n workspaceRoot = await resolveGitWorkspaceRoot(path.resolve(pmRoot));\n } catch {\n return { status: \"no_git\" };\n }\n const trackerRelativeRoot = toPosixRelative(\n workspaceRoot,\n path.resolve(pmRoot),\n );\n const lockSettings = await readSettings(pmRoot);\n const owner = (process.env.PM_AUTHOR ?? lockSettings.author_default).trim();\n const releaseLock = await acquireLock(\n pmRoot,\n MERGE_FENCE_LOCK_ID,\n lockSettings.locks.ttl_seconds,\n owner.length > 0 ? owner : \"unknown\",\n false,\n resolveGovernanceKnobs(lockSettings).force_required_for_stale_lock,\n lockSettings.locks.wait_ms,\n );\n try {\n const gitattributesPath = path.join(workspaceRoot, \".gitattributes\");\n let current: string;\n try {\n current = await readFile(gitattributesPath, \"utf8\");\n } catch (error: unknown) {\n if (\n error instanceof Error &&\n \"code\" in error &&\n error.code === \"ENOENT\"\n ) {\n return { status: \"not_installed\", path: gitattributesPath };\n }\n throw error;\n }\n if (!current.includes(PM_GITATTRIBUTES_START)) {\n return { status: \"not_installed\", path: gitattributesPath };\n }\n // Re-read after acquiring the dedicated fence lock so every concurrent\n // refresher computes from the latest committed type registry.\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const typeFolders = [\n ...new Set(Object.values(typeRegistry.type_to_folder)),\n ].sort((left, right) => left.localeCompare(right));\n const outcome = await reconcileGitattributesBlock(\n workspaceRoot,\n buildMergeAttributePatterns(trackerRelativeRoot, typeFolders),\n false,\n );\n return {\n status: outcome.changed ? \"refreshed\" : \"unchanged\",\n path: outcome.path,\n };\n } finally {\n await releaseLock();\n }\n}\n\n/**\n * Install (or preview) the repository merge configuration for tracker data:\n * writes the fenced merge-driver block into `.gitattributes` (committed and\n * shared with every branch) and defines the `merge.pm-*.driver` entries in the\n * repository-local git config (per-clone, so every collaborator runs this once\n * per checkout). Requires an initialized tracker and a git repository.\n */\nexport async function runMergeInstall(\n options: MergeInstallOptions,\n global: GlobalOptions,\n): Promise<MergeInstallResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const dryRun = options.dryRun === true;\n const workspaceRoot = await resolveGitWorkspaceRoot(process.cwd());\n const trackerRelativeRoot = toPosixRelative(\n workspaceRoot,\n path.resolve(pmRoot),\n );\n if (isPathOutsideRoot(trackerRelativeRoot)) {\n throw new PmCliError(\n `Tracker root ${pmRoot} is outside the git repository ${workspaceRoot}; there is nothing to configure for this repository.`,\n EXIT_CODE.USAGE,\n );\n }\n\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const typeFolders = [\n ...new Set(Object.values(typeRegistry.type_to_folder)),\n ].sort((left, right) => left.localeCompare(right));\n const patterns = buildMergeAttributePatterns(\n trackerRelativeRoot,\n typeFolders,\n );\n const gitattributes = await reconcileGitattributesBlock(\n workspaceRoot,\n patterns,\n dryRun,\n );\n\n const gitConfigEntries: Array<{ key: string; value: string }> = [];\n for (const definition of MERGE_DRIVER_DEFINITIONS) {\n gitConfigEntries.push({\n key: `merge.${definition.key}.name`,\n value: definition.name,\n });\n gitConfigEntries.push({\n key: `merge.${definition.key}.driver`,\n value: `pm merge driver ${definition.artifact} \"%O\" \"%A\" \"%B\"${definition.itemPath === undefined ? \"\" : ` --item-path ${definition.itemPath}`}`,\n });\n }\n if (!dryRun) {\n for (const entry of gitConfigEntries) {\n await execFileAsync(\"git\", [\"config\", entry.key, entry.value], {\n cwd: workspaceRoot,\n encoding: \"utf8\",\n windowsHide: true,\n timeout: 10_000,\n });\n }\n }\n\n return {\n ok: true,\n dry_run: dryRun,\n workspace_root: workspaceRoot,\n gitattributes: {\n path: gitattributes.path,\n changed: gitattributes.changed,\n patterns,\n },\n git_config: gitConfigEntries,\n guidance: [\n \"Commit .gitattributes so every branch and collaborator shares the merge mapping.\",\n 'git config is per-clone: each collaborator (and each fresh worktree/clone) runs \"pm merge install\" once.',\n 'After merging branches, run \"pm validate\" and, if history drift is reported, \"pm history-repair --all\" to reconcile item state with merged history.',\n \"Custom item types registered later refresh this fence automatically (pm schema add-type/remove-type); rerun pm merge install only after out-of-band type-folder edits.\",\n ],\n generated_at: nowIso(),\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;AAKA,SAAS,UAAU,iBAAiB;AACpC,OAAO,UAAU;;;;;;;;AAGV,IAAM,qBAAqB;AAE3B,IAAM,mBAAmB;AAGzB,IAAM,oCAAoC;AAW1C,IAAM,mCAAmC;EAC9C;EACA;EACA;EACA;EACA;;AAWF,SAAS,6BAA6B,qBAA2B;AAC/D,SAAO,oBACJ,WAAW,MAAM,GAAG,EACpB,QAAQ,UAAU,EAAE,EACpB,QAAQ,QAAQ,EAAE;AACvB;AAGM,SAAU,kBAAkB,cAAoB;AACpD,QAAM,aAAa,aAAa,WAAW,MAAM,GAAG;AACpD,SACE,KAAK,WAAW,YAAY,KAC5B,eAAe,QACf,WAAW,WAAW,KAAK;AAE/B;AAGM,SAAU,oBACd,sBAA8B,mCAAiC;AA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MAAM,cAAc;MACpB,SAAS,cAAc;MACvB;;IAEF,YAAY;IACZ,UAAU;MACR;MACA;MACA;MACA;;IAEF,cAAc,OAAM;;AAExB;",
|
|
6
|
-
"names": ["readFile", "writeFile", "path", "path", "readFile", "writeFile", "global"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../sdk/merge/three-way.ts","../../../../../../../../sdk/merge/driver.ts"],"sourcesContent":["/**\n * @module sdk/merge/three-way\n *\n * Field-aware three-way merge primitives for every mergeable tracker artifact\n * class: append-only history JSONL streams, item documents (TOON or\n * JSON+Markdown), and key-level JSON configuration/schema files. These\n * primitives are pure (content in, content out) so the CLI merge driver, the\n * MCP surface, and package integrations all share one merge semantics\n * definition for multi-branch agent workflows.\n */\nimport {\n historyEntriesToRaw,\n reanchorHistoryEntries,\n} from \"../../core/history/replay.js\";\nimport {\n canonicalDocument,\n parseItemDocument,\n serializeItemDocument,\n type ItemDocumentFormatOptions,\n} from \"../../core/item/item-format.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { findFirstMergeConflictMarker } from \"../../core/shared/conflict-markers.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { stableStringify } from \"../../core/shared/serialization.js\";\nimport { compareTimestampStrings } from \"../../core/shared/time.js\";\nimport type {\n HistoryEntry,\n ItemDocument,\n ItemMetadata,\n} from \"../../types/index.js\";\n\n/** Restricts which side of a three-way merge wins an unresolvable conflict. */\nexport type MergePreferredSide = \"ours\" | \"theirs\";\n\n/** Restricts the strategy labels reported by the history stream merge. */\nexport type HistoryMergeStrategy =\n | \"identical\"\n | \"fast_forward_ours\"\n | \"fast_forward_theirs\"\n | \"union_reanchor\";\n\n/** Documents the history stream merge result payload exchanged by command, SDK, and package integrations. */\nexport interface HistoryMergeResult {\n /** Merged JSONL content ready to be written as the resolved history stream. */\n merged: string;\n /** Strategy the merge used: identical inputs, one-sided fast-forward, or a deterministic union with a re-anchored hash chain. */\n strategy: HistoryMergeStrategy;\n /** Number of entries shared by both sides before their streams diverged. */\n common_entries: number;\n /** Number of divergent entries contributed by the ours side. */\n entries_from_ours: number;\n /** Number of divergent entries contributed by the theirs side. */\n entries_from_theirs: number;\n /** Total entries in the merged stream. */\n entries_total: number;\n /** Whether the merged chain required hash re-anchoring (true for every union merge). */\n reanchored: boolean;\n}\n\nfunction parseHistoryJsonl(raw: string, label: string): HistoryEntry[] {\n const conflictMarker = findFirstMergeConflictMarker(raw);\n if (conflictMarker) {\n throw new PmCliError(\n `History merge input (${label}) contains unresolved conflict markers at line ${conflictMarker.line}. Merge drivers must receive clean per-side versions.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const entries: HistoryEntry[] = [];\n for (const [index, rawLine] of raw.split(/\\r?\\n/).entries()) {\n const line = rawLine.trim();\n if (!line) {\n continue;\n }\n try {\n const parsed = JSON.parse(line) as unknown;\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n throw new TypeError(\"history entry must be an object\");\n }\n entries.push(parsed as HistoryEntry);\n } catch {\n throw new PmCliError(\n `History merge input (${label}) contains invalid JSON at line ${index + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n }\n return entries;\n}\n\nfunction historyEntryIdentity(entry: HistoryEntry): string {\n return stableStringify({\n ts: entry.ts,\n author: entry.author,\n op: entry.op,\n patch: entry.patch,\n message: entry.message ?? null,\n });\n}\n\nfunction commonHistoryPrefixLength(\n ours: HistoryEntry[],\n theirs: HistoryEntry[],\n): number {\n const limit = Math.min(ours.length, theirs.length);\n let shared = 0;\n while (\n shared < limit &&\n historyEntryIdentity(ours[shared]) === historyEntryIdentity(theirs[shared])\n ) {\n shared += 1;\n }\n return shared;\n}\n\n/**\n * Deterministically merge two diverged versions of one append-only history\n * JSONL stream. Identical streams and one-sided fast-forwards keep the winning\n * side byte-for-byte; genuinely diverged streams are merged as the shared\n * prefix plus both suffixes ordered by timestamp (ours-first on ties), then\n * hash re-anchored so the resulting chain verifies again. No side's events are\n * ever discarded: content divergence is preserved for the post-merge\n * reconciliation pass (`pm validate` + `pm history-repair`) instead of being\n * silently resolved by last-writer-wins.\n */\nexport function mergeHistoryStreams(\n baseRaw: string,\n oursRaw: string,\n theirsRaw: string,\n): HistoryMergeResult {\n parseHistoryJsonl(baseRaw, \"base\");\n const ours = parseHistoryJsonl(oursRaw, \"ours\");\n const theirs = parseHistoryJsonl(theirsRaw, \"theirs\");\n const shared = commonHistoryPrefixLength(ours, theirs);\n\n if (shared === ours.length && shared === theirs.length) {\n return {\n merged: historyEntriesToRaw(ours),\n strategy: \"identical\",\n common_entries: shared,\n entries_from_ours: 0,\n entries_from_theirs: 0,\n entries_total: ours.length,\n reanchored: false,\n };\n }\n if (shared === theirs.length) {\n return {\n merged: historyEntriesToRaw(ours),\n strategy: \"fast_forward_ours\",\n common_entries: shared,\n entries_from_ours: ours.length - shared,\n entries_from_theirs: 0,\n entries_total: ours.length,\n reanchored: false,\n };\n }\n if (shared === ours.length) {\n return {\n merged: historyEntriesToRaw(theirs),\n strategy: \"fast_forward_theirs\",\n common_entries: shared,\n entries_from_ours: 0,\n entries_from_theirs: theirs.length - shared,\n entries_total: theirs.length,\n reanchored: false,\n };\n }\n\n const oursSuffix = ours.slice(shared);\n const seenIdentities = new Set(oursSuffix.map(historyEntryIdentity));\n const theirsSuffix = theirs\n .slice(shared)\n .filter((entry) => !seenIdentities.has(historyEntryIdentity(entry)));\n const mergedSuffix = [...oursSuffix, ...theirsSuffix].sort((left, right) => {\n const byTs = compareTimestampStrings(left.ts, right.ts);\n if (byTs !== 0) {\n return byTs;\n }\n const leftFromOurs = seenIdentities.has(historyEntryIdentity(left));\n const rightFromOurs = seenIdentities.has(historyEntryIdentity(right));\n if (leftFromOurs !== rightFromOurs) {\n return Number(rightFromOurs) - Number(leftFromOurs);\n }\n return historyEntryIdentity(left).localeCompare(historyEntryIdentity(right));\n });\n const reanchored = reanchorHistoryEntries([\n ...ours.slice(0, shared),\n ...mergedSuffix,\n ]);\n return {\n merged: historyEntriesToRaw(reanchored.entries),\n strategy: \"union_reanchor\",\n common_entries: shared,\n entries_from_ours: oursSuffix.length,\n entries_from_theirs: theirsSuffix.length,\n entries_total: reanchored.entries.length,\n reanchored: true,\n };\n}\n\n/** Documents the relationship event stream merge result payload exchanged by command, SDK, and package integrations. */\nexport interface RelationshipStreamMergeResult {\n /** Merged JSONL content with consecutively renumbered `sequence` values, ready to be written as the resolved event store. */\n merged: string;\n /** Strategy the merge used: identical inputs, one-sided fast-forward, or a deterministic union with renumbered sequences. */\n strategy: HistoryMergeStrategy;\n /** Number of events shared by both sides before their streams diverged. */\n common_entries: number;\n /** Number of divergent events contributed by the ours side. */\n entries_from_ours: number;\n /** Number of divergent events contributed by the theirs side. */\n entries_from_theirs: number;\n /** Total events in the merged stream. */\n entries_total: number;\n /** Whether merged events required sequence renumbering (true for every union merge). */\n reanchored: boolean;\n}\n\ninterface RelationshipStreamEvent {\n /** Globally unique event identity used for prefix detection and suffix deduplication. */\n eventId: string;\n /** One-based append sequence; rewritten consecutively in the merged stream. */\n sequence: number;\n /** ISO timestamp used to order divergent suffixes deterministically. */\n timestamp?: string;\n /** Remaining event payload fields, preserved verbatim. */\n [key: string]: unknown;\n}\n\nfunction parseRelationshipJsonl(\n raw: string,\n label: string,\n): RelationshipStreamEvent[] {\n const conflictMarker = findFirstMergeConflictMarker(raw);\n if (conflictMarker) {\n throw new PmCliError(\n `Relationship merge input (${label}) contains unresolved conflict markers at line ${conflictMarker.line}. Merge drivers must receive clean per-side versions.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const events: RelationshipStreamEvent[] = [];\n for (const [index, rawLine] of raw.split(/\\r?\\n/).entries()) {\n const line = rawLine.trim();\n if (!line) {\n continue;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(line) as unknown;\n } catch {\n throw new PmCliError(\n `Relationship merge input (${label}) contains invalid JSON at line ${index + 1}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n Array.isArray(parsed) ||\n typeof (parsed as { eventId?: unknown }).eventId !== \"string\" ||\n typeof (parsed as { sequence?: unknown }).sequence !== \"number\"\n ) {\n throw new PmCliError(\n `Relationship merge input (${label}) line ${index + 1} is not a relationship event (eventId + sequence required).`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n events.push(parsed as RelationshipStreamEvent);\n }\n return events;\n}\n\nfunction relationshipEventsToRaw(events: RelationshipStreamEvent[]): string {\n return events.length === 0\n ? \"\"\n : `${events.map((event) => JSON.stringify(event)).join(\"\\n\")}\\n`;\n}\n\nfunction renumberRelationshipEvents(\n events: RelationshipStreamEvent[],\n): RelationshipStreamEvent[] {\n return events.map((event, index) => ({ ...event, sequence: index + 1 }));\n}\n\n/**\n * Deterministically merge two diverged versions of one append-only\n * relationship event JSONL store. The store's loader enforces strictly\n * consecutive one-based `sequence` values, so a plain text union of two\n * diverged streams is always unreadable; this merge keeps the shared prefix,\n * unions both divergent suffixes by `eventId` (ordered by event timestamp,\n * ours-first on ties), and renumbers every merged sequence consecutively so\n * the resulting stream loads again. No side's events are ever discarded.\n */\nexport function mergeRelationshipEventStreams(\n baseRaw: string,\n oursRaw: string,\n theirsRaw: string,\n): RelationshipStreamMergeResult {\n parseRelationshipJsonl(baseRaw, \"base\");\n const ours = parseRelationshipJsonl(oursRaw, \"ours\");\n const theirs = parseRelationshipJsonl(theirsRaw, \"theirs\");\n const limit = Math.min(ours.length, theirs.length);\n let shared = 0;\n while (shared < limit && ours[shared].eventId === theirs[shared].eventId) {\n shared += 1;\n }\n\n if (shared === ours.length && shared === theirs.length) {\n return {\n merged: relationshipEventsToRaw(ours),\n strategy: \"identical\",\n common_entries: shared,\n entries_from_ours: 0,\n entries_from_theirs: 0,\n entries_total: ours.length,\n reanchored: false,\n };\n }\n if (shared === theirs.length) {\n return {\n merged: relationshipEventsToRaw(ours),\n strategy: \"fast_forward_ours\",\n common_entries: shared,\n entries_from_ours: ours.length - shared,\n entries_from_theirs: 0,\n entries_total: ours.length,\n reanchored: false,\n };\n }\n if (shared === ours.length) {\n return {\n merged: relationshipEventsToRaw(theirs),\n strategy: \"fast_forward_theirs\",\n common_entries: shared,\n entries_from_ours: 0,\n entries_from_theirs: theirs.length - shared,\n entries_total: theirs.length,\n reanchored: false,\n };\n }\n\n const oursSuffix = ours.slice(shared);\n const oursEventIds = new Set(oursSuffix.map((event) => event.eventId));\n const theirsSuffix = theirs\n .slice(shared)\n .filter((event) => !oursEventIds.has(event.eventId));\n const mergedSuffix = [...oursSuffix, ...theirsSuffix].sort((left, right) => {\n if (left.timestamp !== undefined && right.timestamp !== undefined) {\n const byTs = compareTimestampStrings(left.timestamp, right.timestamp);\n if (byTs !== 0) {\n return byTs;\n }\n } else if (left.timestamp === undefined && right.timestamp !== undefined) {\n return 1;\n } else if (left.timestamp !== undefined) {\n return -1;\n }\n const leftFromOurs = oursEventIds.has(left.eventId);\n const rightFromOurs = oursEventIds.has(right.eventId);\n if (leftFromOurs !== rightFromOurs) {\n return Number(rightFromOurs) - Number(leftFromOurs);\n }\n // Array.prototype.sort is stable: returning zero preserves each side's\n // original append order when its events share a timestamp.\n return 0;\n });\n const merged = renumberRelationshipEvents([\n ...ours.slice(0, shared),\n ...mergedSuffix,\n ]);\n return {\n merged: relationshipEventsToRaw(merged),\n strategy: \"union_reanchor\",\n common_entries: shared,\n entries_from_ours: oursSuffix.length,\n entries_from_theirs: theirsSuffix.length,\n entries_total: merged.length,\n reanchored: true,\n };\n}\n\n/**\n * Item metadata collections merged by element-identity set semantics instead\n * of whole-field three-way comparison: concurrent commutative appends from two\n * branches (notes on A, tags on B, a test run on each) must merge cleanly.\n * Element identity is the stable serialization of the normalized element, so\n * an element edited on one side counts as remove-old + add-new and both sides'\n * contributions survive. Plan collections are deliberately excluded: plan\n * steps carry cross-element ordering invariants that set-union would corrupt,\n * so they stay under scalar three-way semantics with explicit conflicts.\n */\nexport const ITEM_UNION_COLLECTION_FIELDS = [\n \"tags\",\n \"dependencies\",\n \"comments\",\n \"notes\",\n \"learnings\",\n \"files\",\n \"tests\",\n \"test_runs\",\n \"docs\",\n \"reminders\",\n \"events\",\n] as const;\n\n/** Item metadata fields resolved by deterministic latest-timestamp-wins instead of three-way conflict, so disjoint-field edits never conflict on the shared freshness scalar every mutation rewrites. */\nexport const ITEM_LATEST_TIMESTAMP_FIELDS = [\"updated_at\"] as const;\n\n/** Documents the item document merge result payload exchanged by command, SDK, and package integrations. */\nexport interface ItemDocumentMergeResult {\n /** Serialized merged item document (always parseable; count headers recomputed by canonical serialization). */\n merged: string;\n /** Metadata fields (plus `body`) where both sides changed to different values; resolved toward the preferred side. */\n conflict_fields: string[];\n /** Fields taken from the theirs side by clean three-way resolution. */\n fields_from_theirs: string[];\n /** Collection fields that merged by element-identity union. */\n union_fields: string[];\n /** Which side unresolvable conflicts were resolved toward. */\n preferred: MergePreferredSide;\n}\n\nfunction jsonEquals(left: unknown, right: unknown): boolean {\n return stableStringify(left ?? null) === stableStringify(right ?? null);\n}\n\nfunction unionCollection(\n base: unknown,\n ours: unknown,\n theirs: unknown,\n): unknown[] {\n const toEntries = (value: unknown): unknown[] =>\n Array.isArray(value) ? value : [];\n const baseIds = new Set(toEntries(base).map((entry) => stableStringify(entry)));\n const oursEntries = toEntries(ours);\n const oursIds = new Set(oursEntries.map((entry) => stableStringify(entry)));\n const theirsEntries = toEntries(theirs);\n const theirsIds = new Set(\n theirsEntries.map((entry) => stableStringify(entry)),\n );\n const merged = oursEntries.filter((entry) => {\n const identity = stableStringify(entry);\n // An element kept by ours survives unless theirs deleted it (present in\n // base, absent from theirs).\n return !baseIds.has(identity) || theirsIds.has(identity);\n });\n for (const entry of theirsEntries) {\n const identity = stableStringify(entry);\n if (!oursIds.has(identity) && !baseIds.has(identity)) {\n merged.push(entry);\n }\n }\n return merged;\n}\n\nfunction latestTimestamp(ours: unknown, theirs: unknown): unknown {\n return compareTimestampStrings(String(ours), String(theirs)) >= 0\n ? ours\n : theirs;\n}\n\ninterface ScalarMergeOutcome {\n value: unknown;\n from_theirs: boolean;\n conflict: boolean;\n}\n\nfunction mergeScalarThreeWay(\n base: unknown,\n ours: unknown,\n theirs: unknown,\n preferred: MergePreferredSide,\n): ScalarMergeOutcome {\n if (jsonEquals(ours, theirs)) {\n return { value: ours, from_theirs: false, conflict: false };\n }\n if (jsonEquals(base, ours)) {\n return { value: theirs, from_theirs: true, conflict: false };\n }\n if (jsonEquals(base, theirs)) {\n return { value: ours, from_theirs: false, conflict: false };\n }\n return {\n value: preferred === \"theirs\" ? theirs : ours,\n from_theirs: preferred === \"theirs\",\n conflict: true,\n };\n}\n\nfunction toMetadataRecord(document: ItemDocument): Record<string, unknown> {\n return { ...(document.metadata as unknown as Record<string, unknown>) };\n}\n\nfunction parseItemMergeSide(\n raw: string,\n label: string,\n options: ItemDocumentFormatOptions,\n): ItemDocument {\n try {\n return canonicalDocument(parseItemDocument(raw, options), options);\n } catch (error) {\n throw new PmCliError(\n `Item merge input (${label}) is not a readable item document: ${String(error)}`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\ninterface ItemMetadataMergeAccumulator {\n /** Merged metadata values keyed by canonical field name. */\n merged: Record<string, unknown>;\n /** Scalar fields where both sides diverged from the base. */\n conflictFields: string[];\n /** Scalar fields cleanly selected from the other branch. */\n fieldsFromTheirs: string[];\n /** Collection fields whose final union differs from ours. */\n unionFields: string[];\n}\n\nfunction mergeItemMetadataRecords(\n baseRecord: Record<string, unknown>,\n oursRecord: Record<string, unknown>,\n theirsRecord: Record<string, unknown>,\n preferred: MergePreferredSide,\n): ItemMetadataMergeAccumulator {\n const unionFieldSet = new Set<string>(ITEM_UNION_COLLECTION_FIELDS);\n const latestFieldSet = new Set<string>(ITEM_LATEST_TIMESTAMP_FIELDS);\n const fieldNames = [\n ...new Set([...Object.keys(oursRecord), ...Object.keys(theirsRecord)]),\n ].sort((left, right) => left.localeCompare(right));\n const accumulator: ItemMetadataMergeAccumulator = {\n merged: {},\n conflictFields: [],\n fieldsFromTheirs: [],\n unionFields: [],\n };\n\n for (const field of fieldNames) {\n const baseValue = baseRecord[field];\n const oursValue = oursRecord[field];\n const theirsValue = theirsRecord[field];\n if (unionFieldSet.has(field)) {\n const union = unionCollection(baseValue, oursValue, theirsValue);\n // `fieldNames` is derived from both records' own keys, so a collection\n // reached here is declared by at least one side. Preserve even an empty\n // result (`tags` is required) so serialization never drops it.\n accumulator.merged[field] = union;\n if (!jsonEquals(union, oursValue)) {\n accumulator.unionFields.push(field);\n }\n continue;\n }\n if (latestFieldSet.has(field)) {\n accumulator.merged[field] = latestTimestamp(oursValue, theirsValue);\n continue;\n }\n const outcome = mergeScalarThreeWay(\n baseValue,\n oursValue,\n theirsValue,\n preferred,\n );\n if (outcome.value !== undefined) {\n accumulator.merged[field] = outcome.value;\n }\n if (outcome.conflict) {\n accumulator.conflictFields.push(field);\n } else if (outcome.from_theirs) {\n accumulator.fieldsFromTheirs.push(field);\n }\n }\n return accumulator;\n}\n\n/**\n * Field-aware three-way merge of one tracker item document. Commutative\n * collections (notes, tags, tests, ...) union by element identity so\n * concurrent appends never conflict; `updated_at` resolves to the latest\n * timestamp so disjoint-field edits never collide on the shared freshness\n * scalar; every other metadata field and the body use classic three-way\n * resolution. Unresolvable both-sides-changed conflicts are resolved toward\n * the preferred side but reported in `conflict_fields`, and the merged output\n * is always canonically serialized — count-prefixed TOON array headers are\n * recomputed, so the hand-resolution corruption class (stale `notes[N]`\n * headers) cannot be produced by this merge.\n */\nexport function mergeItemDocuments(\n baseRaw: string,\n oursRaw: string,\n theirsRaw: string,\n options: ItemDocumentFormatOptions & {\n /** Side that wins unresolvable conflicts (default \"ours\"). */\n preferred?: MergePreferredSide;\n } = {},\n): ItemDocumentMergeResult {\n const preferred: MergePreferredSide = options.preferred ?? \"ours\";\n // An empty base means both branches created the file independently\n // (add/add); three-way falls back to treating every differing field as an\n // ours/theirs decision, which the scalar resolver already models.\n const hasBase = baseRaw.trim().length > 0;\n const ours = parseItemMergeSide(oursRaw, \"ours\", options);\n const theirs = parseItemMergeSide(theirsRaw, \"theirs\", options);\n const base = hasBase ? parseItemMergeSide(baseRaw, \"base\", options) : ours;\n\n const baseRecord = hasBase\n ? toMetadataRecord(base)\n : ({} as Record<string, unknown>);\n const oursRecord = toMetadataRecord(ours);\n const theirsRecord = toMetadataRecord(theirs);\n const { merged, conflictFields, fieldsFromTheirs, unionFields } =\n mergeItemMetadataRecords(baseRecord, oursRecord, theirsRecord, preferred);\n\n const bodyOutcome = mergeScalarThreeWay(\n hasBase ? base.body : \"\",\n ours.body,\n theirs.body,\n preferred,\n );\n if (bodyOutcome.conflict) {\n conflictFields.push(\"body\");\n } else if (bodyOutcome.from_theirs) {\n fieldsFromTheirs.push(\"body\");\n }\n\n const mergedRaw = serializeItemDocument(\n {\n metadata: merged as unknown as ItemMetadata,\n body: bodyOutcome.value as string,\n },\n options,\n );\n return {\n merged: mergedRaw,\n conflict_fields: conflictFields,\n fields_from_theirs: fieldsFromTheirs,\n union_fields: unionFields,\n preferred,\n };\n}\n\n/** Documents the JSON document merge result payload exchanged by command, SDK, and package integrations. */\nexport interface JsonDocumentMergeResult {\n /** Serialized merged JSON document (two-space indent, trailing newline — the tracker's canonical config style). */\n merged: string;\n /** Dotted key paths where both sides changed to different values; resolved toward the preferred side. */\n conflict_paths: string[];\n /** Dotted key paths taken from the theirs side by clean three-way resolution. */\n paths_from_theirs: string[];\n /** Which side unresolvable conflicts were resolved toward. */\n preferred: MergePreferredSide;\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value)\n );\n}\n\nfunction parseJsonSide(raw: string, label: string): unknown {\n const conflictMarker = findFirstMergeConflictMarker(raw);\n if (conflictMarker) {\n throw new PmCliError(\n `JSON merge input (${label}) contains unresolved conflict markers at line ${conflictMarker.line}.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n if (raw.trim().length === 0) {\n return undefined;\n }\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n throw new PmCliError(\n `JSON merge input (${label}) is not valid JSON.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n}\n\nfunction mergeJsonValue(\n base: unknown,\n ours: unknown,\n theirs: unknown,\n preferred: MergePreferredSide,\n pathPrefix: string,\n conflictPaths: string[],\n pathsFromTheirs: string[],\n): unknown {\n if (jsonEquals(ours, theirs)) {\n return ours;\n }\n if (isPlainObject(ours) && isPlainObject(theirs)) {\n const baseObject = isPlainObject(base) ? base : {};\n const merged: Record<string, unknown> = {};\n const keys = [\n ...new Set([...Object.keys(ours), ...Object.keys(theirs)]),\n ].sort((left, right) => left.localeCompare(right));\n for (const key of keys) {\n const childPath = pathPrefix.length > 0 ? `${pathPrefix}.${key}` : key;\n const child = mergeJsonKey(\n baseObject,\n ours,\n theirs,\n key,\n preferred,\n childPath,\n conflictPaths,\n pathsFromTheirs,\n );\n if (child !== undefined) {\n merged[key] = child;\n }\n }\n return merged;\n }\n const outcome = mergeScalarThreeWay(base, ours, theirs, preferred);\n if (outcome.conflict) {\n conflictPaths.push(pathPrefix);\n } else if (outcome.from_theirs) {\n pathsFromTheirs.push(pathPrefix);\n }\n return outcome.value;\n}\n\nfunction mergeJsonKey(\n base: Record<string, unknown>,\n ours: Record<string, unknown>,\n theirs: Record<string, unknown>,\n key: string,\n preferred: MergePreferredSide,\n childPath: string,\n conflictPaths: string[],\n pathsFromTheirs: string[],\n): unknown {\n const inOurs = Object.prototype.hasOwnProperty.call(ours, key);\n const inTheirs = Object.prototype.hasOwnProperty.call(theirs, key);\n const inBase = Object.prototype.hasOwnProperty.call(base, key);\n if (inOurs && inTheirs) {\n return mergeJsonValue(\n base[key],\n ours[key],\n theirs[key],\n preferred,\n childPath,\n conflictPaths,\n pathsFromTheirs,\n );\n }\n if (inOurs) {\n // Present only in ours: either ours added it (keep) or theirs deleted it\n // (honor the delete when ours left it untouched from base).\n if (inBase && jsonEquals(base[key], ours[key])) {\n pathsFromTheirs.push(childPath);\n return undefined;\n }\n if (inBase) {\n conflictPaths.push(childPath);\n return preferred === \"theirs\" ? undefined : ours[key];\n }\n return ours[key];\n }\n // Present only in theirs (mirror of the branch above).\n if (inBase && jsonEquals(base[key], theirs[key])) {\n return undefined;\n }\n if (inBase) {\n conflictPaths.push(childPath);\n return preferred === \"theirs\" ? theirs[key] : undefined;\n }\n pathsFromTheirs.push(childPath);\n return theirs[key];\n}\n\n/**\n * Key-level three-way merge for the tracker's single-file JSON configuration\n * artifacts (`settings.json`, `schema/*.json`). Nested objects merge\n * recursively per key so two branches editing disjoint settings never\n * conflict; both-sides-changed leaf values resolve toward the preferred side\n * and are reported in `conflict_paths`. The output is always valid JSON, so a\n * merged configuration can never regress into the silent-defaults fallback\n * that raw conflict markers cause.\n */\nexport function mergeJsonDocuments(\n baseRaw: string,\n oursRaw: string,\n theirsRaw: string,\n options: {\n /** Side that wins unresolvable conflicts (default \"ours\"). */\n preferred?: MergePreferredSide;\n } = {},\n): JsonDocumentMergeResult {\n const preferred: MergePreferredSide = options.preferred ?? \"ours\";\n const base = parseJsonSide(baseRaw, \"base\");\n const ours = parseJsonSide(oursRaw, \"ours\");\n const theirs = parseJsonSide(theirsRaw, \"theirs\");\n const conflictPaths: string[] = [];\n const pathsFromTheirs: string[] = [];\n const merged = mergeJsonValue(\n base,\n ours,\n theirs,\n preferred,\n \"\",\n conflictPaths,\n pathsFromTheirs,\n );\n return {\n merged: `${JSON.stringify(merged ?? null, null, 2)}\\n`,\n conflict_paths: conflictPaths,\n paths_from_theirs: pathsFromTheirs,\n preferred,\n };\n}\n","/**\n * @module sdk/merge/driver\n *\n * File-level git merge driver runner for tracker artifacts. Git invokes the\n * driver with the base (%O), ours (%A), and theirs (%B) temporary files; the\n * driver writes the merged content back to the ours path and reports whether\n * unresolvable conflicts remain. Conflicted artifacts are still written as\n * parseable documents (resolved toward the preferred side) so a conflicted\n * merge never corrupts tracker storage the way raw conflict markers do.\n */\nimport { readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFormat, PmSettings } from \"../../types/index.js\";\nimport {\n mergeHistoryStreams,\n mergeItemDocuments,\n mergeJsonDocuments,\n mergeRelationshipEventStreams,\n type MergePreferredSide,\n} from \"./three-way.js\";\n\n/** Supported values accepted by the merge driver artifact contract across CLI, SDK, and MCP surfaces. */\nexport const MERGE_DRIVER_ARTIFACT_VALUES = [\n \"item\",\n \"history\",\n \"relationship\",\n \"json\",\n] as const;\n/** Restricts merge driver artifact values accepted by command, SDK, and storage contracts. */\nexport type MergeDriverArtifact = (typeof MERGE_DRIVER_ARTIFACT_VALUES)[number];\n\n/** Documents the merge driver options payload exchanged by command, SDK, and package integrations. */\nexport interface MergeDriverOptions {\n /** Artifact class being merged: item document, history JSONL stream, relationship event JSONL store, or key-level JSON config. */\n artifact: string;\n /** Path to the common-ancestor version (git %O). */\n basePath: string;\n /** Path to the current-branch version (git %A); also the default output path per the git merge-driver protocol. */\n oursPath: string;\n /** Path to the other-branch version (git %B). */\n theirsPath: string;\n /** Optional explicit output path overriding the git default of writing to the ours path. */\n outputPath?: string;\n /** Original repository-relative item path supplied by Git as `%P`, used to detect item format when temporary side paths lack extensions. */\n itemPath?: string;\n /** Side that wins unresolvable conflicts (default \"ours\"). */\n prefer?: string;\n}\n\n/** Documents the merge driver result payload exchanged by command, SDK, and package integrations. */\nexport interface MergeDriverResult {\n /** Whether the merge completed without unresolvable conflicts. */\n ok: boolean;\n /** Artifact class that was merged. */\n artifact: MergeDriverArtifact;\n /** Path the merged content was written to. */\n output_path: string;\n /** Side unresolvable conflicts were resolved toward. */\n preferred: MergePreferredSide;\n /** Unresolvable conflict labels: metadata field names (item), dotted key paths (json). Empty for history merges. */\n conflicts: string[];\n /** History-merge strategy and entry accounting; present only for the history artifact. */\n history?: {\n strategy: string;\n common_entries: number;\n entries_from_ours: number;\n entries_from_theirs: number;\n entries_total: number;\n reanchored: boolean;\n };\n /** Relationship-event-merge strategy and accounting; present only for the relationship artifact. */\n relationship?: {\n strategy: string;\n common_entries: number;\n entries_from_ours: number;\n entries_from_theirs: number;\n entries_total: number;\n reanchored: boolean;\n };\n /** Item-merge field accounting; present only for the item artifact. */\n item?: {\n fields_from_theirs: string[];\n union_fields: string[];\n };\n /** JSON-merge key accounting; present only for the json artifact. */\n json?: {\n paths_from_theirs: string[];\n };\n /** Guidance for resolving remaining conflicts or verifying the merged workspace. */\n guidance: string[];\n /** ISO 8601 timestamp recording when generated occurred. */\n generated_at: string;\n}\n\nfunction resolveArtifact(value: string): MergeDriverArtifact {\n const normalized = value.trim().toLowerCase();\n if (\n (MERGE_DRIVER_ARTIFACT_VALUES as readonly string[]).includes(normalized)\n ) {\n return normalized as MergeDriverArtifact;\n }\n throw new PmCliError(\n `Unknown merge artifact \"${value}\". Supported values: ${MERGE_DRIVER_ARTIFACT_VALUES.join(\", \")}.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolvePreferredSide(value: string | undefined): MergePreferredSide {\n if (value === undefined) {\n return \"ours\";\n }\n const normalized = value.trim().toLowerCase();\n if (normalized === \"ours\" || normalized === \"theirs\") {\n return normalized;\n }\n throw new PmCliError(\n `Unknown --prefer value \"${value}\". Supported values: ours, theirs.`,\n EXIT_CODE.USAGE,\n );\n}\n\nasync function readSideFile(filePath: string, label: string): Promise<string> {\n try {\n return await readFile(filePath, \"utf8\");\n } catch {\n throw new PmCliError(\n `Cannot read merge ${label} file at ${filePath}.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n}\n\n/**\n * Load the workspace settings when a tracker is initialized at the resolved pm\n * root, or fall back to format defaults when the driver runs outside a tracker\n * (git can invoke merge drivers before `pm init`, e.g. while rebasing the\n * commit that introduces the tracker).\n */\nasync function loadOptionalSettings(\n global: GlobalOptions,\n): Promise<PmSettings | null> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n return null;\n }\n return readSettings(pmRoot);\n}\n\nfunction itemFormatForPath(\n filePath: string,\n settings: PmSettings | null,\n): ItemFormat {\n if (filePath.endsWith(\".md\")) {\n return \"json_markdown\";\n }\n if (filePath.endsWith(\".toon\")) {\n return \"toon\";\n }\n return settings?.item_format ?? \"toon\";\n}\n\n/**\n * Execute one git merge-driver invocation for a tracker artifact. Reads the\n * three per-side versions, applies the artifact's field-aware merge semantics,\n * writes the merged content (parseable even when conflicted) to the output\n * path, and reports remaining conflicts so the CLI can exit non-zero and let\n * git mark the path unmerged.\n */\nexport async function runMergeDriver(\n options: MergeDriverOptions,\n global: GlobalOptions,\n): Promise<MergeDriverResult> {\n const artifact = resolveArtifact(options.artifact);\n const preferred = resolvePreferredSide(options.prefer);\n const outputPath = path.resolve(options.outputPath ?? options.oursPath);\n const [baseRaw, oursRaw, theirsRaw] = await Promise.all([\n readSideFile(options.basePath, \"base\"),\n readSideFile(options.oursPath, \"ours\"),\n readSideFile(options.theirsPath, \"theirs\"),\n ]);\n\n let merged: string;\n const conflicts: string[] = [];\n const result: Partial<MergeDriverResult> = {};\n if (artifact === \"history\") {\n const historyMerge = mergeHistoryStreams(baseRaw, oursRaw, theirsRaw);\n merged = historyMerge.merged;\n result.history = {\n strategy: historyMerge.strategy,\n common_entries: historyMerge.common_entries,\n entries_from_ours: historyMerge.entries_from_ours,\n entries_from_theirs: historyMerge.entries_from_theirs,\n entries_total: historyMerge.entries_total,\n reanchored: historyMerge.reanchored,\n };\n } else if (artifact === \"relationship\") {\n const relationshipMerge = mergeRelationshipEventStreams(\n baseRaw,\n oursRaw,\n theirsRaw,\n );\n merged = relationshipMerge.merged;\n result.relationship = {\n strategy: relationshipMerge.strategy,\n common_entries: relationshipMerge.common_entries,\n entries_from_ours: relationshipMerge.entries_from_ours,\n entries_from_theirs: relationshipMerge.entries_from_theirs,\n entries_total: relationshipMerge.entries_total,\n reanchored: relationshipMerge.reanchored,\n };\n } else if (artifact === \"item\") {\n const settings = await loadOptionalSettings(global);\n const itemMerge = mergeItemDocuments(baseRaw, oursRaw, theirsRaw, {\n format: itemFormatForPath(options.itemPath ?? outputPath, settings),\n schema: settings?.schema,\n extensionFieldNames: collectRegisteredItemFieldNames(\n getActiveExtensionRegistrations(),\n ),\n preferred,\n });\n merged = itemMerge.merged;\n conflicts.push(...itemMerge.conflict_fields);\n result.item = {\n fields_from_theirs: itemMerge.fields_from_theirs,\n union_fields: itemMerge.union_fields,\n };\n } else {\n const jsonMerge = mergeJsonDocuments(baseRaw, oursRaw, theirsRaw, {\n preferred,\n });\n merged = jsonMerge.merged;\n conflicts.push(...jsonMerge.conflict_paths);\n result.json = {\n paths_from_theirs: jsonMerge.paths_from_theirs,\n };\n }\n\n await writeFile(outputPath, merged, \"utf8\");\n const guidance: string[] = [];\n if (conflicts.length > 0) {\n guidance.push(\n `Both branches changed ${conflicts.join(\", \")}; the ${preferred} value was kept. Review the merged file, re-apply the losing change if needed, then \"git add\" it.`,\n );\n }\n if (artifact === \"history\" && result.history?.reanchored) {\n guidance.push(\n 'The merged history chain was re-anchored. Run \"pm validate --check-history-drift\" and \"pm history-repair --all\" after the merge to reconcile item state with merged history.',\n );\n }\n return {\n ok: conflicts.length === 0,\n artifact,\n output_path: outputPath,\n preferred,\n conflicts,\n ...result,\n guidance,\n generated_at: nowIso(),\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DA,SAAS,kBAAkB,KAAa,OAAa;AAC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