@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,246 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d77401e4-b01b-5a23-b696-886d2009861c")}catch(e){}}();
|
|
3
|
-
import {
|
|
4
|
-
canonicalDocument,
|
|
5
|
-
hashDocument,
|
|
6
|
-
orderObject,
|
|
7
|
-
sha256Hex,
|
|
8
|
-
stableStringify,
|
|
9
|
-
toItemRecord
|
|
10
|
-
} from "./chunk-POG76WWZ.js";
|
|
11
|
-
import {
|
|
12
|
-
ITEM_METADATA_KEY_ORDER
|
|
13
|
-
} from "./chunk-HYW67VJ5.js";
|
|
14
|
-
|
|
15
|
-
// dist/core/history/replay.js
|
|
16
|
-
import jsonPatch from "fast-json-patch";
|
|
17
|
-
var EMPTY_REPLAY_DOCUMENT = {
|
|
18
|
-
metadata: {},
|
|
19
|
-
body: ""
|
|
20
|
-
};
|
|
21
|
-
function cloneEmptyReplayDocument() {
|
|
22
|
-
return structuredClone(EMPTY_REPLAY_DOCUMENT);
|
|
23
|
-
}
|
|
24
|
-
function replayHash(document) {
|
|
25
|
-
try {
|
|
26
|
-
return hashDocument(replayToItemDocument(document));
|
|
27
|
-
} catch {
|
|
28
|
-
return sha256Hex(stableStringify({
|
|
29
|
-
replay_fallback: true,
|
|
30
|
-
metadata: document.metadata,
|
|
31
|
-
body: document.body
|
|
32
|
-
}));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
function replayToItemDocument(document) {
|
|
36
|
-
return {
|
|
37
|
-
metadata: document.metadata,
|
|
38
|
-
body: document.body
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
function replayToCanonicalItemDocument(document, options = {}) {
|
|
42
|
-
return canonicalDocument(replayToItemDocument(document), options);
|
|
43
|
-
}
|
|
44
|
-
function toReplayDocument(document) {
|
|
45
|
-
if (!document.metadata || Object.keys(document.metadata).length === 0) {
|
|
46
|
-
return {
|
|
47
|
-
metadata: {},
|
|
48
|
-
body: document.body ?? ""
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
const canonical = canonicalDocument(document);
|
|
52
|
-
return {
|
|
53
|
-
metadata: orderObject(toItemRecord(canonical.metadata), ITEM_METADATA_KEY_ORDER),
|
|
54
|
-
body: canonical.body
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function normalizeReplayPatchPath(path) {
|
|
58
|
-
if (path === "/front_matter") {
|
|
59
|
-
return "/metadata";
|
|
60
|
-
}
|
|
61
|
-
if (path.startsWith("/front_matter/")) {
|
|
62
|
-
return `/metadata/${path.slice("/front_matter/".length)}`;
|
|
63
|
-
}
|
|
64
|
-
return path;
|
|
65
|
-
}
|
|
66
|
-
function isHistoryPatchOp(value) {
|
|
67
|
-
return typeof value === "object" && value !== null && typeof value.op === "string" && typeof value.path === "string";
|
|
68
|
-
}
|
|
69
|
-
function normalizeReplayPatchOps(patch) {
|
|
70
|
-
if (!Array.isArray(patch)) {
|
|
71
|
-
return [];
|
|
72
|
-
}
|
|
73
|
-
return patch.filter(isHistoryPatchOp).map((operation) => ({
|
|
74
|
-
...operation,
|
|
75
|
-
path: normalizeReplayPatchPath(operation.path),
|
|
76
|
-
from: typeof operation.from === "string" ? normalizeReplayPatchPath(operation.from) : void 0
|
|
77
|
-
}));
|
|
78
|
-
}
|
|
79
|
-
function isReplayDocumentShape(value) {
|
|
80
|
-
return typeof value === "object" && value !== null && "metadata" in value && "body" in value && typeof value.body === "string" && typeof value.metadata === "object" && value.metadata !== null;
|
|
81
|
-
}
|
|
82
|
-
function tryApplyReplayPatch(current, patch) {
|
|
83
|
-
try {
|
|
84
|
-
const normalizedPatch = normalizeReplayPatchOps(patch);
|
|
85
|
-
const applied = jsonPatch.applyPatch(structuredClone(current), normalizedPatch, true, false).newDocument;
|
|
86
|
-
if (!isReplayDocumentShape(applied)) {
|
|
87
|
-
return {
|
|
88
|
-
ok: false,
|
|
89
|
-
error: new Error("history_replay_invalid_document_shape")
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
ok: true,
|
|
94
|
-
document: { metadata: applied.metadata, body: applied.body }
|
|
95
|
-
};
|
|
96
|
-
} catch (error) {
|
|
97
|
-
return { ok: false, error };
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
function verifyHistoryChain(entries) {
|
|
101
|
-
let replay = cloneEmptyReplayDocument();
|
|
102
|
-
for (let index = 0; index < entries.length; index += 1) {
|
|
103
|
-
const entry = entries[index];
|
|
104
|
-
if (replayHash(replay) !== entry.before_hash) {
|
|
105
|
-
return {
|
|
106
|
-
ok: false,
|
|
107
|
-
errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`]
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
const applied = tryApplyReplayPatch(replay, entry.patch);
|
|
111
|
-
if (!applied.ok) {
|
|
112
|
-
return {
|
|
113
|
-
ok: false,
|
|
114
|
-
errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`]
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
replay = applied.document;
|
|
118
|
-
if (replayHash(replay) !== entry.after_hash) {
|
|
119
|
-
return {
|
|
120
|
-
ok: false,
|
|
121
|
-
errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`]
|
|
122
|
-
};
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
return { ok: true, errors: [] };
|
|
126
|
-
}
|
|
127
|
-
function tryApplySingleOp(document, op) {
|
|
128
|
-
try {
|
|
129
|
-
const applied = jsonPatch.applyPatch(structuredClone(document), [op], true, false).newDocument;
|
|
130
|
-
return { ok: true, document: applied };
|
|
131
|
-
} catch {
|
|
132
|
-
return { ok: false };
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function lenientApplyReplayPatch(current, patch) {
|
|
136
|
-
let working = structuredClone(current);
|
|
137
|
-
let convertedReplaceToAdd = 0;
|
|
138
|
-
let skippedOps = 0;
|
|
139
|
-
for (const op of normalizeReplayPatchOps(patch)) {
|
|
140
|
-
const direct = tryApplySingleOp(working, op);
|
|
141
|
-
if (direct.ok) {
|
|
142
|
-
working = direct.document;
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
if (op.op === "replace") {
|
|
146
|
-
const asAdd = tryApplySingleOp(working, { ...op, op: "add" });
|
|
147
|
-
if (asAdd.ok) {
|
|
148
|
-
working = asAdd.document;
|
|
149
|
-
convertedReplaceToAdd += 1;
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
skippedOps += 1;
|
|
154
|
-
}
|
|
155
|
-
const candidate = working;
|
|
156
|
-
const document = {
|
|
157
|
-
metadata: typeof candidate.metadata === "object" && candidate.metadata !== null ? candidate.metadata : {},
|
|
158
|
-
body: typeof candidate.body === "string" ? candidate.body : current.body
|
|
159
|
-
};
|
|
160
|
-
return { document, convertedReplaceToAdd, skippedOps };
|
|
161
|
-
}
|
|
162
|
-
function reanchorHistoryEntries(entries) {
|
|
163
|
-
let replay = cloneEmptyReplayDocument();
|
|
164
|
-
const rewritten = [];
|
|
165
|
-
const details = [];
|
|
166
|
-
let entriesRehashed = 0;
|
|
167
|
-
let entriesPatchRepaired = 0;
|
|
168
|
-
let convertedReplaceToAdd = 0;
|
|
169
|
-
let skippedOps = 0;
|
|
170
|
-
for (let index = 0; index < entries.length; index += 1) {
|
|
171
|
-
const entry = entries[index];
|
|
172
|
-
const beforeHash = replayHash(replay);
|
|
173
|
-
const strict = tryApplyReplayPatch(replay, entry.patch);
|
|
174
|
-
let next;
|
|
175
|
-
let outPatch;
|
|
176
|
-
let patchRepaired = false;
|
|
177
|
-
let entryConverted = 0;
|
|
178
|
-
let entrySkipped = 0;
|
|
179
|
-
if (strict.ok) {
|
|
180
|
-
next = strict.document;
|
|
181
|
-
outPatch = entry.patch;
|
|
182
|
-
} else {
|
|
183
|
-
const lenient = lenientApplyReplayPatch(replay, entry.patch);
|
|
184
|
-
next = lenient.document;
|
|
185
|
-
outPatch = jsonPatch.compare(replay, next);
|
|
186
|
-
patchRepaired = true;
|
|
187
|
-
entryConverted = lenient.convertedReplaceToAdd;
|
|
188
|
-
entrySkipped = lenient.skippedOps;
|
|
189
|
-
convertedReplaceToAdd += entryConverted;
|
|
190
|
-
skippedOps += entrySkipped;
|
|
191
|
-
entriesPatchRepaired += 1;
|
|
192
|
-
}
|
|
193
|
-
const afterHash = replayHash(next);
|
|
194
|
-
const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;
|
|
195
|
-
if (rehashed) {
|
|
196
|
-
entriesRehashed += 1;
|
|
197
|
-
}
|
|
198
|
-
rewritten.push({
|
|
199
|
-
...entry,
|
|
200
|
-
patch: outPatch,
|
|
201
|
-
before_hash: beforeHash,
|
|
202
|
-
after_hash: afterHash
|
|
203
|
-
});
|
|
204
|
-
details.push({
|
|
205
|
-
index: index + 1,
|
|
206
|
-
rehashed,
|
|
207
|
-
patch_repaired: patchRepaired,
|
|
208
|
-
converted_replace_to_add: entryConverted,
|
|
209
|
-
skipped_ops: entrySkipped
|
|
210
|
-
});
|
|
211
|
-
replay = next;
|
|
212
|
-
}
|
|
213
|
-
return {
|
|
214
|
-
entries: rewritten,
|
|
215
|
-
finalDocument: replay,
|
|
216
|
-
entriesRehashed,
|
|
217
|
-
entriesPatchRepaired,
|
|
218
|
-
convertedReplaceToAdd,
|
|
219
|
-
skippedOps,
|
|
220
|
-
details
|
|
221
|
-
};
|
|
222
|
-
}
|
|
223
|
-
function historyEntriesToRaw(entries) {
|
|
224
|
-
if (entries.length === 0) {
|
|
225
|
-
return "";
|
|
226
|
-
}
|
|
227
|
-
return `${entries.map((entry) => JSON.stringify(entry)).join("\n")}
|
|
228
|
-
`;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export {
|
|
232
|
-
EMPTY_REPLAY_DOCUMENT,
|
|
233
|
-
cloneEmptyReplayDocument,
|
|
234
|
-
replayHash,
|
|
235
|
-
replayToItemDocument,
|
|
236
|
-
replayToCanonicalItemDocument,
|
|
237
|
-
toReplayDocument,
|
|
238
|
-
normalizeReplayPatchOps,
|
|
239
|
-
tryApplyReplayPatch,
|
|
240
|
-
verifyHistoryChain,
|
|
241
|
-
reanchorHistoryEntries,
|
|
242
|
-
historyEntriesToRaw
|
|
243
|
-
};
|
|
244
|
-
//# sourceMappingURL=chunk-P7JTWYLH.js.map
|
|
245
|
-
|
|
246
|
-
//# debugId=d77401e4-b01b-5a23-b696-886d2009861c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/history/replay.ts"],"sourcesContent":["/**\n * @module core/history/replay\n *\n * Implements append-only history and replay behavior for Replay.\n */\nimport jsonPatch from \"fast-json-patch\";\nimport { ITEM_METADATA_KEY_ORDER } from \"../shared/constants.js\";\nimport { canonicalDocument } from \"../item/item-format.js\";\nimport { toItemRecord } from \"../item/item-record.js\";\nimport {\n orderObject,\n sha256Hex,\n stableStringify,\n} from \"../shared/serialization.js\";\nimport { hashDocument } from \"./history.js\";\nimport type {\n HistoryEntry,\n HistoryPatchOp,\n ItemDocument,\n ItemMetadata,\n} from \"../../types/index.js\";\n\n/**\n * Shared history replay/patch mechanics single-sourced for the history, restore,\n * history-redact, and history-repair commands plus the health/validate drift checks.\n *\n * Each command keeps its own thin error-formatting wrapper so the exact CLI error\n * contracts (restore's rich patch-failure context, redact's op tag, history's\n * generic message) are preserved; only the underlying replay/patch logic is shared.\n */\n\nexport interface ReplayDocument {\n /** Value that configures or reports metadata for this contract. */\n metadata: Record<string, unknown>;\n /** Value that configures or reports body for this contract. */\n body: string;\n}\n\n/** Public contract for empty replay document, shared by SDK and presentation-layer consumers. */\nexport const EMPTY_REPLAY_DOCUMENT: ReplayDocument = {\n metadata: {},\n body: \"\",\n};\n\n/** Implements clone empty replay document for the public runtime surface of this module. */\nexport function cloneEmptyReplayDocument(): ReplayDocument {\n return structuredClone(EMPTY_REPLAY_DOCUMENT);\n}\n\n/** Implements replay hash for the public runtime surface of this module. */\nexport function replayHash(document: ReplayDocument): string {\n try {\n return hashDocument(replayToItemDocument(document));\n } catch {\n // Legacy/malformed replay states (for example a stream whose first entry never\n // established a full `create` document, so the canonicalizer cannot normalize it)\n // cannot be canonically hashed. Fall back to a deterministic structural hash so\n // re-anchor and verification stay internally consistent for these streams. Fully\n // formed documents always take the canonical path above, so valid streams are\n // unaffected.\n return sha256Hex(\n stableStringify({\n replay_fallback: true,\n metadata: document.metadata,\n body: document.body,\n }),\n );\n }\n}\n\n/** Implements replay to item document for the public runtime surface of this module. */\nexport function replayToItemDocument(document: ReplayDocument): ItemDocument {\n return {\n metadata: document.metadata as ItemMetadata,\n body: document.body,\n };\n}\n\n/** Converts a materialized replay document into a canonical item document. Use this when callers have already rejected the empty/deleted replay state and need restored metadata validated through the normal item-metadata rules. */\nexport function replayToCanonicalItemDocument(\n document: ReplayDocument,\n options: Parameters<typeof canonicalDocument>[1] = {},\n): ItemDocument {\n return canonicalDocument(replayToItemDocument(document), options);\n}\n\n/** Canonicalize an item document into the ordered replay form used when comparing a replayed chain against the on-disk item (restore + history-repair reconciliation). */\nexport function toReplayDocument(document: ItemDocument): ReplayDocument {\n if (!document.metadata || Object.keys(document.metadata).length === 0) {\n return {\n metadata: {},\n body: document.body ?? \"\",\n };\n }\n const canonical = canonicalDocument(document);\n return {\n metadata: orderObject(\n toItemRecord(canonical.metadata),\n ITEM_METADATA_KEY_ORDER,\n ),\n body: canonical.body,\n };\n}\n\n/** Implements normalize replay patch path for the public runtime surface of this module. */\nexport function normalizeReplayPatchPath(path: string): string {\n if (path === \"/front_matter\") {\n return \"/metadata\";\n }\n if (path.startsWith(\"/front_matter/\")) {\n return `/metadata/${path.slice(\"/front_matter/\".length)}`;\n }\n return path;\n}\n\nfunction isHistoryPatchOp(value: unknown): value is HistoryPatchOp {\n return (\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as { op?: unknown }).op === \"string\" &&\n typeof (value as { path?: unknown }).path === \"string\"\n );\n}\n\n/** Implements normalize replay patch ops for the public runtime surface of this module. */\nexport function normalizeReplayPatchOps(\n patch: HistoryPatchOp[] | unknown,\n): HistoryPatchOp[] {\n if (!Array.isArray(patch)) {\n return [];\n }\n return patch.filter(isHistoryPatchOp).map((operation) => ({\n ...operation,\n path: normalizeReplayPatchPath(operation.path),\n from:\n typeof operation.from === \"string\"\n ? normalizeReplayPatchPath(operation.from)\n : undefined,\n }));\n}\n\nfunction isReplayDocumentShape(\n value: unknown,\n): value is { metadata: Record<string, unknown>; body: string } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"metadata\" in value &&\n \"body\" in value &&\n typeof (value as { body: unknown }).body === \"string\" &&\n typeof (value as { metadata: unknown }).metadata === \"object\" &&\n (value as { metadata: unknown }).metadata !== null\n );\n}\n\n/** Restricts replay apply result values accepted by command, SDK, and storage contracts. */\nexport type ReplayApplyResult =\n | { ok: true; document: ReplayDocument }\n | { ok: false; error: unknown };\n\n/** Strictly apply a history patch (front_matter->metadata normalized) to a replay document. Returns a result envelope rather than throwing so each caller can format its own error contract. */\nexport function tryApplyReplayPatch(\n current: ReplayDocument,\n patch: HistoryPatchOp[],\n): ReplayApplyResult {\n try {\n const normalizedPatch = normalizeReplayPatchOps(patch);\n const applied = jsonPatch.applyPatch(\n structuredClone(current),\n normalizedPatch as jsonPatch.Operation[],\n true,\n false,\n ).newDocument as unknown;\n if (!isReplayDocumentShape(applied)) {\n return {\n ok: false,\n error: new Error(\"history_replay_invalid_document_shape\"),\n };\n }\n return {\n ok: true,\n document: { metadata: applied.metadata, body: applied.body },\n };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/** Deterministically verify a history chain: each entry's before_hash must equal the prior replayed after_hash, the patch must strictly apply, and the recorded after_hash must equal the replayed result. */\nexport function verifyHistoryChain(entries: HistoryEntry[]): {\n ok: boolean;\n errors: string[];\n} {\n let replay = cloneEmptyReplayDocument();\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n return {\n ok: false,\n errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`],\n };\n }\n const applied = tryApplyReplayPatch(replay, entry.patch);\n if (!applied.ok) {\n return {\n ok: false,\n errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`],\n };\n }\n replay = applied.document;\n if (replayHash(replay) !== entry.after_hash) {\n return {\n ok: false,\n errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`],\n };\n }\n }\n return { ok: true, errors: [] };\n}\n\n/** Documents the lenient apply result payload exchanged by command, SDK, and package integrations. */\nexport interface LenientApplyResult {\n /** Value that configures or reports document for this contract. */\n document: ReplayDocument;\n /** Value that configures or reports converted replace to add for this contract. */\n convertedReplaceToAdd: number;\n /** Value that configures or reports skipped ops for this contract. */\n skippedOps: number;\n}\n\nfunction tryApplySingleOp(\n document: unknown,\n op: HistoryPatchOp,\n): { ok: true; document: unknown } | { ok: false } {\n try {\n const applied = jsonPatch.applyPatch(\n structuredClone(document),\n [op as jsonPatch.Operation],\n true,\n false,\n ).newDocument as unknown;\n return { ok: true, document: applied };\n } catch {\n return { ok: false };\n }\n}\n\n/** Apply a legacy patch op-by-op, recovering from drift that strict replay rejects: a `replace` whose path no longer exists is retried as `add`, and any op that still cannot apply against the current replay state is skipped. The resulting document is what the repaired entry's recomputed patch should target. */\nexport function lenientApplyReplayPatch(\n current: ReplayDocument,\n patch: HistoryPatchOp[],\n): LenientApplyResult {\n let working: unknown = structuredClone(current);\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (const op of normalizeReplayPatchOps(patch)) {\n const direct = tryApplySingleOp(working, op);\n if (direct.ok) {\n working = direct.document;\n continue;\n }\n if (op.op === \"replace\") {\n const asAdd = tryApplySingleOp(working, { ...op, op: \"add\" });\n if (asAdd.ok) {\n working = asAdd.document;\n convertedReplaceToAdd += 1;\n continue;\n }\n }\n skippedOps += 1;\n }\n\n const candidate = working as { metadata?: unknown; body?: unknown };\n const document: ReplayDocument = {\n metadata:\n typeof candidate.metadata === \"object\" && candidate.metadata !== null\n ? (candidate.metadata as Record<string, unknown>)\n : {},\n body: typeof candidate.body === \"string\" ? candidate.body : current.body,\n };\n return { document, convertedReplaceToAdd, skippedOps };\n}\n\n/** Documents the reanchor entry detail payload exchanged by command, SDK, and package integrations. */\nexport interface ReanchorEntryDetail {\n /** Value that configures or reports index for this contract. */\n index: number;\n /** Value that configures or reports rehashed for this contract. */\n rehashed: boolean;\n /** Value that configures or reports patch repaired for this contract. */\n patch_repaired: boolean;\n /** Value that configures or reports converted replace to add for this contract. */\n converted_replace_to_add: number;\n /** Value that configures or reports skipped ops for this contract. */\n skipped_ops: number;\n}\n\n/** Documents the reanchor result payload exchanged by command, SDK, and package integrations. */\nexport interface ReanchorResult {\n /** Value that configures or reports entries for this contract. */\n entries: HistoryEntry[];\n /** Value that configures or reports final document for this contract. */\n finalDocument: ReplayDocument;\n /** Value that configures or reports entries rehashed for this contract. */\n entriesRehashed: number;\n /** Value that configures or reports entries patch repaired for this contract. */\n entriesPatchRepaired: number;\n /** Value that configures or reports converted replace to add for this contract. */\n convertedReplaceToAdd: number;\n /** Value that configures or reports skipped ops for this contract. */\n skippedOps: number;\n /** Value that configures or reports details for this contract. */\n details: ReanchorEntryDetail[];\n}\n\n/** Re-anchor a drifted history chain: replay every entry from empty, recompute the before/after hashes, and only rewrite a patch when the original op set no longer strictly applies (legacy drift). Clean entries keep their patch verbatim so the on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain. */\nexport function reanchorHistoryEntries(\n entries: HistoryEntry[],\n): ReanchorResult {\n let replay = cloneEmptyReplayDocument();\n const rewritten: HistoryEntry[] = [];\n const details: ReanchorEntryDetail[] = [];\n let entriesRehashed = 0;\n let entriesPatchRepaired = 0;\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n const beforeHash = replayHash(replay);\n const strict = tryApplyReplayPatch(replay, entry.patch);\n\n let next: ReplayDocument;\n let outPatch: HistoryPatchOp[];\n let patchRepaired = false;\n let entryConverted = 0;\n let entrySkipped = 0;\n\n if (strict.ok) {\n next = strict.document;\n outPatch = entry.patch;\n } else {\n const lenient = lenientApplyReplayPatch(replay, entry.patch);\n next = lenient.document;\n outPatch = jsonPatch.compare(replay, next) as HistoryPatchOp[];\n patchRepaired = true;\n entryConverted = lenient.convertedReplaceToAdd;\n entrySkipped = lenient.skippedOps;\n convertedReplaceToAdd += entryConverted;\n skippedOps += entrySkipped;\n entriesPatchRepaired += 1;\n }\n\n const afterHash = replayHash(next);\n const rehashed =\n beforeHash !== entry.before_hash || afterHash !== entry.after_hash;\n if (rehashed) {\n entriesRehashed += 1;\n }\n\n rewritten.push({\n ...entry,\n patch: outPatch,\n before_hash: beforeHash,\n after_hash: afterHash,\n });\n details.push({\n index: index + 1,\n rehashed,\n patch_repaired: patchRepaired,\n converted_replace_to_add: entryConverted,\n skipped_ops: entrySkipped,\n });\n replay = next;\n }\n\n return {\n entries: rewritten,\n finalDocument: replay,\n entriesRehashed,\n entriesPatchRepaired,\n convertedReplaceToAdd,\n skippedOps,\n details,\n };\n}\n\n/** Implements history entries to raw for the public runtime surface of this module. */\nexport function historyEntriesToRaw(entries: HistoryEntry[]): string {\n if (entries.length === 0) {\n return \"\";\n }\n return `${entries.map((entry) => JSON.stringify(entry)).join(\"\\n\")}\\n`;\n}\n"],"names":[],"mappings":"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","debugId":"d77401e4-b01b-5a23-b696-886d2009861c"}
|
|
@@ -1,344 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
acquireLock,
|
|
3
|
-
getActiveExtensionRegistrations,
|
|
4
|
-
nowIso,
|
|
5
|
-
readSettings,
|
|
6
|
-
resolveGovernanceKnobs
|
|
7
|
-
} from "./chunk-IY6VZ3IW.js";
|
|
8
|
-
import {
|
|
9
|
-
EXIT_CODE,
|
|
10
|
-
PmCliError,
|
|
11
|
-
getSettingsPath,
|
|
12
|
-
pathExists,
|
|
13
|
-
resolveItemTypeRegistry,
|
|
14
|
-
resolvePmRoot
|
|
15
|
-
} from "./chunk-7AVEY74G.js";
|
|
16
|
-
|
|
17
|
-
// dist/sdk/workspace.js
|
|
18
|
-
import { readFile, writeFile } from "node:fs/promises";
|
|
19
|
-
import path from "node:path";
|
|
20
|
-
!(function() {
|
|
21
|
-
try {
|
|
22
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
23
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "2ebcdfcf-c29b-50d6-940d-299d7699059a");
|
|
24
|
-
} catch (e2) {
|
|
25
|
-
}
|
|
26
|
-
})();
|
|
27
|
-
var PM_GITIGNORE_START = "# pm-cli:runtime-cache:start";
|
|
28
|
-
var PM_GITIGNORE_END = "# pm-cli:runtime-cache:end";
|
|
29
|
-
var PM_GITIGNORE_DEFAULT_TRACKER_ROOT = ".agents/pm";
|
|
30
|
-
var PM_GITIGNORE_RUNTIME_DIRECTORIES = [
|
|
31
|
-
"runtime/",
|
|
32
|
-
"search/",
|
|
33
|
-
"locks/",
|
|
34
|
-
"transactions/",
|
|
35
|
-
"checkpoints/"
|
|
36
|
-
];
|
|
37
|
-
function normalizeTrackerRelativeRoot(trackerRelativeRoot) {
|
|
38
|
-
return trackerRelativeRoot.replaceAll("\\", "/").replace(/^\.\/+/, "").replace(/\/+$/, "");
|
|
39
|
-
}
|
|
40
|
-
function isPathOutsideRoot(relativePath) {
|
|
41
|
-
const normalized = relativePath.replaceAll("\\", "/");
|
|
42
|
-
return path.isAbsolute(relativePath) || normalized === ".." || normalized.startsWith("../");
|
|
43
|
-
}
|
|
44
|
-
function getPmGitignoreBlock(trackerRelativeRoot = PM_GITIGNORE_DEFAULT_TRACKER_ROOT) {
|
|
45
|
-
const root = normalizeTrackerRelativeRoot(trackerRelativeRoot);
|
|
46
|
-
return [
|
|
47
|
-
PM_GITIGNORE_START,
|
|
48
|
-
...PM_GITIGNORE_RUNTIME_DIRECTORIES.map((directory) => `${root}/${directory}`),
|
|
49
|
-
PM_GITIGNORE_END
|
|
50
|
-
].join("\n");
|
|
51
|
-
}
|
|
52
|
-
async function ensurePmGitignore(workspaceRoot, options = {}) {
|
|
53
|
-
const gitignorePath = path.join(workspaceRoot, ".gitignore");
|
|
54
|
-
let trackerRelativeRoot = PM_GITIGNORE_DEFAULT_TRACKER_ROOT;
|
|
55
|
-
if (options.pmRoot !== void 0) {
|
|
56
|
-
const relative = normalizeTrackerRelativeRoot(path.relative(path.resolve(workspaceRoot), path.resolve(options.pmRoot)));
|
|
57
|
-
if (isPathOutsideRoot(relative)) {
|
|
58
|
-
return { path: gitignorePath, changed: false };
|
|
59
|
-
}
|
|
60
|
-
if (relative.length > 0) {
|
|
61
|
-
trackerRelativeRoot = relative;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
let current = "";
|
|
65
|
-
try {
|
|
66
|
-
current = await readFile(gitignorePath, "utf8");
|
|
67
|
-
} catch (error) {
|
|
68
|
-
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) {
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
const start = current.indexOf(PM_GITIGNORE_START);
|
|
73
|
-
const end = current.indexOf(PM_GITIGNORE_END);
|
|
74
|
-
const withoutManagedBlock = start >= 0 && end >= start ? `${current.slice(0, start)}${current.slice(end + PM_GITIGNORE_END.length)}` : current;
|
|
75
|
-
const prefix = withoutManagedBlock.trimEnd();
|
|
76
|
-
const next = `${prefix.length > 0 ? `${prefix}
|
|
77
|
-
|
|
78
|
-
` : ""}${getPmGitignoreBlock(trackerRelativeRoot)}
|
|
79
|
-
`;
|
|
80
|
-
if (next === current) {
|
|
81
|
-
return { path: gitignorePath, changed: false };
|
|
82
|
-
}
|
|
83
|
-
await writeFile(gitignorePath, next, "utf8");
|
|
84
|
-
return { path: gitignorePath, changed: true };
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// dist/sdk/merge/install.js
|
|
88
|
-
import { readFile as readFile2, writeFile as writeFile2 } from "node:fs/promises";
|
|
89
|
-
import { execFile } from "node:child_process";
|
|
90
|
-
import path2 from "node:path";
|
|
91
|
-
import { promisify } from "node:util";
|
|
92
|
-
!(function() {
|
|
93
|
-
try {
|
|
94
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
95
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "86f1b43a-3b30-5791-ba03-fc362dfe5585");
|
|
96
|
-
} catch (e2) {
|
|
97
|
-
}
|
|
98
|
-
})();
|
|
99
|
-
var execFileAsync = promisify(execFile);
|
|
100
|
-
var PM_GITATTRIBUTES_START = "# pm-cli:merge-drivers:start";
|
|
101
|
-
var PM_GITATTRIBUTES_END = "# pm-cli:merge-drivers:end";
|
|
102
|
-
var MERGE_FENCE_LOCK_ID = "merge-fence";
|
|
103
|
-
var MERGE_DRIVER_DEFINITIONS = [
|
|
104
|
-
{
|
|
105
|
-
key: "pm-item-toon",
|
|
106
|
-
name: "pm field-aware TOON item document merge",
|
|
107
|
-
artifact: "item",
|
|
108
|
-
itemPath: "item.toon"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: "pm-item-markdown",
|
|
112
|
-
name: "pm field-aware JSON-markdown item document merge",
|
|
113
|
-
artifact: "item",
|
|
114
|
-
itemPath: "item.md"
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
key: "pm-history",
|
|
118
|
-
name: "pm append-only history stream merge",
|
|
119
|
-
artifact: "history",
|
|
120
|
-
itemPath: void 0
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
key: "pm-relationship",
|
|
124
|
-
name: "pm append-only relationship event store merge",
|
|
125
|
-
artifact: "relationship",
|
|
126
|
-
itemPath: void 0
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
key: "pm-json",
|
|
130
|
-
name: "pm key-level JSON config merge",
|
|
131
|
-
artifact: "json",
|
|
132
|
-
itemPath: void 0
|
|
133
|
-
}
|
|
134
|
-
];
|
|
135
|
-
async function resolveGitWorkspaceRoot(cwd) {
|
|
136
|
-
try {
|
|
137
|
-
const { stdout } = await execFileAsync("git", ["rev-parse", "--show-toplevel"], { cwd, encoding: "utf8", windowsHide: true, timeout: 1e4 });
|
|
138
|
-
return stdout.trim();
|
|
139
|
-
} catch {
|
|
140
|
-
throw new PmCliError("pm merge install requires a git repository (merge drivers are git configuration).", EXIT_CODE.USAGE);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
function toPosixRelative(fromPath, toPath) {
|
|
144
|
-
return path2.relative(fromPath, toPath).replaceAll("\\", "/");
|
|
145
|
-
}
|
|
146
|
-
function quoteGitAttributePattern(value) {
|
|
147
|
-
return `"${value.replaceAll("\\", "\\\\").replaceAll('"', '\\"')}"`;
|
|
148
|
-
}
|
|
149
|
-
function buildMergeAttributePatterns(trackerRelativeRoot, typeFolders) {
|
|
150
|
-
const prefix = trackerRelativeRoot.length > 0 ? `${trackerRelativeRoot}/` : "";
|
|
151
|
-
const patterns = [];
|
|
152
|
-
for (const folder of typeFolders) {
|
|
153
|
-
patterns.push(`${quoteGitAttributePattern(`${prefix}${folder}/*.toon`)} merge=pm-item-toon`);
|
|
154
|
-
patterns.push(`${quoteGitAttributePattern(`${prefix}${folder}/*.md`)} merge=pm-item-markdown`);
|
|
155
|
-
}
|
|
156
|
-
patterns.push(`${quoteGitAttributePattern(`${prefix}**/*.jsonl`)} merge=pm-relationship`);
|
|
157
|
-
patterns.push(`${quoteGitAttributePattern(`${prefix}history/*.jsonl`)} merge=pm-history`);
|
|
158
|
-
patterns.push(`${quoteGitAttributePattern(`${prefix}settings.json`)} merge=pm-json`);
|
|
159
|
-
patterns.push(`${quoteGitAttributePattern(`${prefix}schema/*.json`)} merge=pm-json`);
|
|
160
|
-
return patterns;
|
|
161
|
-
}
|
|
162
|
-
async function reconcileGitattributesBlock(workspaceRoot, patterns, dryRun) {
|
|
163
|
-
const gitattributesPath = path2.join(workspaceRoot, ".gitattributes");
|
|
164
|
-
let current = "";
|
|
165
|
-
try {
|
|
166
|
-
current = await readFile2(gitattributesPath, "utf8");
|
|
167
|
-
} catch (error) {
|
|
168
|
-
if (!(error instanceof Error && "code" in error && error.code === "ENOENT")) {
|
|
169
|
-
throw error;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
const block = [
|
|
173
|
-
PM_GITATTRIBUTES_START,
|
|
174
|
-
...patterns,
|
|
175
|
-
PM_GITATTRIBUTES_END
|
|
176
|
-
].join("\n");
|
|
177
|
-
const start = current.indexOf(PM_GITATTRIBUTES_START);
|
|
178
|
-
const end = current.indexOf(PM_GITATTRIBUTES_END);
|
|
179
|
-
const withoutManagedBlock = start >= 0 && end > start ? `${current.slice(0, start)}${current.slice(end + PM_GITATTRIBUTES_END.length)}` : current.replace(PM_GITATTRIBUTES_START, "").replace(PM_GITATTRIBUTES_END, "");
|
|
180
|
-
const prefix = withoutManagedBlock.trimEnd();
|
|
181
|
-
const next = `${prefix.length > 0 ? `${prefix}
|
|
182
|
-
|
|
183
|
-
` : ""}${block}
|
|
184
|
-
`;
|
|
185
|
-
if (next === current) {
|
|
186
|
-
return { path: gitattributesPath, changed: false };
|
|
187
|
-
}
|
|
188
|
-
if (!dryRun) {
|
|
189
|
-
await writeFile2(gitattributesPath, next, "utf8");
|
|
190
|
-
}
|
|
191
|
-
return { path: gitattributesPath, changed: true };
|
|
192
|
-
}
|
|
193
|
-
async function auditMergeAttributeFence(pmRoot, typeFolders) {
|
|
194
|
-
const resolvedRoot = path2.resolve(pmRoot);
|
|
195
|
-
let fenceDirectory = null;
|
|
196
|
-
let fenceContent = "";
|
|
197
|
-
let directory = resolvedRoot;
|
|
198
|
-
for (let depth = 0; depth < 8; depth += 1) {
|
|
199
|
-
const candidate = path2.join(directory, ".gitattributes");
|
|
200
|
-
try {
|
|
201
|
-
const raw = await readFile2(candidate, "utf8");
|
|
202
|
-
if (raw.includes(PM_GITATTRIBUTES_START)) {
|
|
203
|
-
fenceDirectory = directory;
|
|
204
|
-
fenceContent = raw;
|
|
205
|
-
break;
|
|
206
|
-
}
|
|
207
|
-
} catch {
|
|
208
|
-
}
|
|
209
|
-
const parent = path2.dirname(directory);
|
|
210
|
-
if (parent === directory) {
|
|
211
|
-
break;
|
|
212
|
-
}
|
|
213
|
-
directory = parent;
|
|
214
|
-
}
|
|
215
|
-
if (fenceDirectory === null) {
|
|
216
|
-
return { status: "not_installed", missing_patterns: [], stale_patterns: [] };
|
|
217
|
-
}
|
|
218
|
-
const fencePath = path2.join(fenceDirectory, ".gitattributes");
|
|
219
|
-
const start = fenceContent.indexOf(PM_GITATTRIBUTES_START);
|
|
220
|
-
const end = fenceContent.indexOf(PM_GITATTRIBUTES_END);
|
|
221
|
-
const committed = end > start ? fenceContent.slice(start + PM_GITATTRIBUTES_START.length, end).split("\n").map((line) => line.trim()).filter((line) => line.length > 0) : [];
|
|
222
|
-
const expected = buildMergeAttributePatterns(toPosixRelative(fenceDirectory, resolvedRoot), typeFolders);
|
|
223
|
-
const committedSet = new Set(committed);
|
|
224
|
-
const expectedSet = new Set(expected);
|
|
225
|
-
const missing = expected.filter((line) => !committedSet.has(line));
|
|
226
|
-
const stale = committed.filter((line) => !expectedSet.has(line));
|
|
227
|
-
return {
|
|
228
|
-
status: missing.length > 0 || stale.length > 0 ? "drift" : "ok",
|
|
229
|
-
path: fencePath,
|
|
230
|
-
missing_patterns: missing,
|
|
231
|
-
stale_patterns: stale
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
async function refreshMergeAttributeFenceIfInstalled(pmRoot) {
|
|
235
|
-
let workspaceRoot;
|
|
236
|
-
try {
|
|
237
|
-
workspaceRoot = await resolveGitWorkspaceRoot(path2.resolve(pmRoot));
|
|
238
|
-
} catch {
|
|
239
|
-
return { status: "no_git" };
|
|
240
|
-
}
|
|
241
|
-
const trackerRelativeRoot = toPosixRelative(workspaceRoot, path2.resolve(pmRoot));
|
|
242
|
-
const lockSettings = await readSettings(pmRoot);
|
|
243
|
-
const owner = (process.env.PM_AUTHOR ?? lockSettings.author_default).trim();
|
|
244
|
-
const releaseLock = await acquireLock(pmRoot, MERGE_FENCE_LOCK_ID, lockSettings.locks.ttl_seconds, owner.length > 0 ? owner : "unknown", false, resolveGovernanceKnobs(lockSettings).force_required_for_stale_lock, lockSettings.locks.wait_ms);
|
|
245
|
-
try {
|
|
246
|
-
const gitattributesPath = path2.join(workspaceRoot, ".gitattributes");
|
|
247
|
-
let current;
|
|
248
|
-
try {
|
|
249
|
-
current = await readFile2(gitattributesPath, "utf8");
|
|
250
|
-
} catch (error) {
|
|
251
|
-
if (error instanceof Error && "code" in error && error.code === "ENOENT") {
|
|
252
|
-
return { status: "not_installed", path: gitattributesPath };
|
|
253
|
-
}
|
|
254
|
-
throw error;
|
|
255
|
-
}
|
|
256
|
-
if (!current.includes(PM_GITATTRIBUTES_START)) {
|
|
257
|
-
return { status: "not_installed", path: gitattributesPath };
|
|
258
|
-
}
|
|
259
|
-
const settings = await readSettings(pmRoot);
|
|
260
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
261
|
-
const typeFolders = [
|
|
262
|
-
...new Set(Object.values(typeRegistry.type_to_folder))
|
|
263
|
-
].sort((left, right) => left.localeCompare(right));
|
|
264
|
-
const outcome = await reconcileGitattributesBlock(workspaceRoot, buildMergeAttributePatterns(trackerRelativeRoot, typeFolders), false);
|
|
265
|
-
return {
|
|
266
|
-
status: outcome.changed ? "refreshed" : "unchanged",
|
|
267
|
-
path: outcome.path
|
|
268
|
-
};
|
|
269
|
-
} finally {
|
|
270
|
-
await releaseLock();
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
async function runMergeInstall(options, global2) {
|
|
274
|
-
const pmRoot = resolvePmRoot(process.cwd(), global2.path);
|
|
275
|
-
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
276
|
-
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
277
|
-
}
|
|
278
|
-
const dryRun = options.dryRun === true;
|
|
279
|
-
const workspaceRoot = await resolveGitWorkspaceRoot(process.cwd());
|
|
280
|
-
const trackerRelativeRoot = toPosixRelative(workspaceRoot, path2.resolve(pmRoot));
|
|
281
|
-
if (isPathOutsideRoot(trackerRelativeRoot)) {
|
|
282
|
-
throw new PmCliError(`Tracker root ${pmRoot} is outside the git repository ${workspaceRoot}; there is nothing to configure for this repository.`, EXIT_CODE.USAGE);
|
|
283
|
-
}
|
|
284
|
-
const settings = await readSettings(pmRoot);
|
|
285
|
-
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
286
|
-
const typeFolders = [
|
|
287
|
-
...new Set(Object.values(typeRegistry.type_to_folder))
|
|
288
|
-
].sort((left, right) => left.localeCompare(right));
|
|
289
|
-
const patterns = buildMergeAttributePatterns(trackerRelativeRoot, typeFolders);
|
|
290
|
-
const gitattributes = await reconcileGitattributesBlock(workspaceRoot, patterns, dryRun);
|
|
291
|
-
const gitConfigEntries = [];
|
|
292
|
-
for (const definition of MERGE_DRIVER_DEFINITIONS) {
|
|
293
|
-
gitConfigEntries.push({
|
|
294
|
-
key: `merge.${definition.key}.name`,
|
|
295
|
-
value: definition.name
|
|
296
|
-
});
|
|
297
|
-
gitConfigEntries.push({
|
|
298
|
-
key: `merge.${definition.key}.driver`,
|
|
299
|
-
value: `pm merge driver ${definition.artifact} "%O" "%A" "%B"${definition.itemPath === void 0 ? "" : ` --item-path ${definition.itemPath}`}`
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
if (!dryRun) {
|
|
303
|
-
for (const entry of gitConfigEntries) {
|
|
304
|
-
await execFileAsync("git", ["config", entry.key, entry.value], {
|
|
305
|
-
cwd: workspaceRoot,
|
|
306
|
-
encoding: "utf8",
|
|
307
|
-
windowsHide: true,
|
|
308
|
-
timeout: 1e4
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
return {
|
|
313
|
-
ok: true,
|
|
314
|
-
dry_run: dryRun,
|
|
315
|
-
workspace_root: workspaceRoot,
|
|
316
|
-
gitattributes: {
|
|
317
|
-
path: gitattributes.path,
|
|
318
|
-
changed: gitattributes.changed,
|
|
319
|
-
patterns
|
|
320
|
-
},
|
|
321
|
-
git_config: gitConfigEntries,
|
|
322
|
-
guidance: [
|
|
323
|
-
"Commit .gitattributes so every branch and collaborator shares the merge mapping.",
|
|
324
|
-
'git config is per-clone: each collaborator (and each fresh worktree/clone) runs "pm merge install" once.',
|
|
325
|
-
'After merging branches, run "pm validate" and, if history drift is reported, "pm history-repair --all" to reconcile item state with merged history.',
|
|
326
|
-
"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."
|
|
327
|
-
],
|
|
328
|
-
generated_at: nowIso()
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
export {
|
|
333
|
-
PM_GITIGNORE_START,
|
|
334
|
-
PM_GITIGNORE_END,
|
|
335
|
-
getPmGitignoreBlock,
|
|
336
|
-
ensurePmGitignore,
|
|
337
|
-
PM_GITATTRIBUTES_START,
|
|
338
|
-
PM_GITATTRIBUTES_END,
|
|
339
|
-
buildMergeAttributePatterns,
|
|
340
|
-
auditMergeAttributeFence,
|
|
341
|
-
refreshMergeAttributeFenceIfInstalled,
|
|
342
|
-
runMergeInstall
|
|
343
|
-
};
|
|
344
|
-
//# sourceMappingURL=chunk-R5U2VZ3K.js.map
|