@unbrained/pm-cli 2026.7.21 → 2026.7.22
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 +25 -0
- package/dist/cli/bundle-integrity.js +3 -3
- package/dist/cli/bundle-integrity.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +5 -0
- package/dist/cli/commands/contracts.js +8 -6
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/copy.js +36 -20
- package/dist/cli/commands/copy.js.map +1 -1
- package/dist/cli/commands/create.js +48 -24
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/merge.d.ts +1 -1
- package/dist/cli/commands/merge.js +3 -3
- package/dist/cli/commands/merge.js.map +1 -1
- package/dist/cli/commands/restore.js +40 -22
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/update.js +12 -9
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/extension-command-help.js +3 -4
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/main.d.ts +3 -2
- package/dist/cli/main.js +6 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +33 -21
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +63 -37
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +2 -0
- package/dist/cli/registration-helpers.js +3 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +349 -341
- package/dist/cli-bundle/chunks/{append-7OVFYR3C.js → append-CYMA7RJT.js} +5 -5
- package/dist/cli-bundle/chunks/append-H53CAPMP.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-PFNHX655.js → chunk-2P7OK4WG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EJDGV4GR.js → chunk-3EBGHNNQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DZRV2OPA.js → chunk-3EDFN3VV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZOY5K4D3.js → chunk-3PWJWLLQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VXOOB6YX.js → chunk-3SJAR3CY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-GTLCVJOE.js → chunk-3WVKMF2A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-LAV26CQG.js → chunk-42SYYKA4.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-NLR32VFS.js → chunk-4IXLNV7W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BKIAH72N.js → chunk-4LTPHDKA.js} +39 -23
- package/dist/cli-bundle/chunks/chunk-4LTPHDKA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ABWCF646.js → chunk-4YTQVO3V.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-E5XMKOSB.js → chunk-5EBRMHI6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-IY6VZ3IW.js → chunk-5FAG2JUC.js} +320 -62
- package/dist/cli-bundle/chunks/chunk-5FAG2JUC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GKX4NJ7U.js → chunk-5K5LHZZX.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-T6PPNM7V.js → chunk-5K7BOAB6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4QOB7L7I.js → chunk-5MUZ54G2.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-SF3DT5HJ.js → chunk-5QME4KX2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RMF7LMBS.js → chunk-6PDGFY3P.js} +27 -17
- package/dist/cli-bundle/chunks/{chunk-RMF7LMBS.js.map → chunk-6PDGFY3P.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TRSHFPRZ.js → chunk-6PM6CPPP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-O4BCOJTZ.js → chunk-7AHRY3ZB.js} +21 -16
- package/dist/cli-bundle/chunks/chunk-7AHRY3ZB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OR42SO64.js → chunk-7B36A3VT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QWRVBJ4D.js → chunk-7OR2YKKD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FPBMLYPI.js → chunk-7QUV54XX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WWNL6WMH.js → chunk-7WXW6JHG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BXNDKOR2.js → chunk-A2VL5SVG.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-AXGDUXJW.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-IAQE32BI.js → chunk-B2AVNGG3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-K36WV5J6.js → chunk-B7O44UBR.js} +71 -8
- package/dist/cli-bundle/chunks/chunk-B7O44UBR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HCEBZNC3.js → chunk-BRMPF2RM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-Z7VWXXJM.js → chunk-BTNKMF2A.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-KH44WBAT.js → chunk-CD4643VW.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-OWXOPDHD.js → chunk-CJEEC5O4.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-PZC2FUOQ.js → chunk-CTPKCZCF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7W2UAXXT.js → chunk-D4OBQVL3.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-EWJWSNRU.js → chunk-DM4TYC2A.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-VJQG4BIM.js → chunk-DSFTAQ7T.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AELMUANP.js → chunk-DVB6SQU7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KBLZ3AA5.js → chunk-E3ZWOFSO.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-EP25DV6P.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-GTK4DTEW.js → chunk-F4VCB4WY.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-V22ZPOKN.js → chunk-F4XAQUQA.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-QOOTOD3W.js → chunk-FGR6IBAF.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-JSLT7WVE.js → chunk-FKBMT2Q6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QIH77CAG.js → chunk-G5RLSSIX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P7MTHPJQ.js → chunk-GEKRVH3G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-2L6ZP22J.js → chunk-GSP6IZFU.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ATBCUC7Y.js → chunk-H3MDK2VU.js} +48 -30
- package/dist/cli-bundle/chunks/chunk-H3MDK2VU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZVZGXPQ5.js → chunk-HYZZM3Q2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XJTABV3X.js → chunk-IBWG3OSH.js} +22 -17
- package/dist/cli-bundle/chunks/chunk-IBWG3OSH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4XGJLADW.js → chunk-IHY5SX7O.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UCBDQI5E.js → chunk-IMU7JLUI.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-Z75ONV25.js → chunk-IPAQAJWB.js} +77 -7
- package/dist/cli-bundle/chunks/chunk-IPAQAJWB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7RW4JCU2.js → chunk-IQCD6OO3.js} +25 -13
- package/dist/cli-bundle/chunks/chunk-IQCD6OO3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YQWCZ5AC.js → chunk-J3ZKFEDM.js} +38 -22
- package/dist/cli-bundle/chunks/chunk-J3ZKFEDM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PEQGTJ5Q.js → chunk-JCLXCGIL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GROYI4RB.js → chunk-JLTHOYR7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JHJSFOAM.js → chunk-JMPVHM44.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MATHDCGG.js → chunk-JWYG36RV.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-ZTVA4KLN.js → chunk-KEGVMZNA.js} +28 -16
- package/dist/cli-bundle/chunks/chunk-KEGVMZNA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VLRGDBLY.js → chunk-KEHOPUHH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-K55VMLSS.js → chunk-KJ4ZF35M.js} +63 -13
- package/dist/cli-bundle/chunks/chunk-KJ4ZF35M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CPX275C6.js → chunk-KPCZL2YK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-POG76WWZ.js → chunk-L7DZV6EZ.js} +319 -61
- package/dist/cli-bundle/chunks/chunk-L7DZV6EZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FO6OSVEN.js → chunk-LANV45W2.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-LVC72YRD.js → chunk-LC5ZUXWE.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-SY4SFZSD.js → chunk-LE522OXA.js} +55 -30
- package/dist/cli-bundle/chunks/chunk-LE522OXA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TVYYO5A7.js → chunk-MBHYQYCS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FJIFFBJX.js → chunk-MROP2RNT.js} +66 -74
- package/dist/cli-bundle/chunks/chunk-MROP2RNT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7656MAUL.js → chunk-MUAJHL2R.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-R3P6FZJW.js → chunk-N6QCY2AX.js} +43 -25
- package/dist/cli-bundle/chunks/chunk-N6QCY2AX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7WCE6Y64.js → chunk-NUQCSV4P.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SZVB53Y3.js → chunk-O3GFE2PX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OY7DMU5P.js → chunk-O43LEUSD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AMJPSANK.js → chunk-O7RH6BWP.js} +103 -44
- package/dist/cli-bundle/chunks/chunk-O7RH6BWP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NUF7ROFH.js → chunk-OODR5KYF.js} +26 -27
- package/dist/cli-bundle/chunks/chunk-OODR5KYF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LZYP423P.js → chunk-OZ25YD4Q.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VZIZB6QH.js → chunk-PKYKQCTJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UZLJOEAC.js → chunk-PMRED6QZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ADBTSVGK.js → chunk-PPATPPI6.js} +65 -73
- package/dist/cli-bundle/chunks/chunk-PPATPPI6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K4CI6Y45.js → chunk-PWGJCP2V.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UVN66B3M.js → chunk-Q3Z2Y5WJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RNPZYNHS.js → chunk-Q6YZ3VCI.js} +104 -45
- package/dist/cli-bundle/chunks/chunk-Q6YZ3VCI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7DOJC3HS.js → chunk-QE5EUHKN.js} +28 -18
- package/dist/cli-bundle/chunks/chunk-QE5EUHKN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AS4SAZ5R.js → chunk-QKMMWESK.js} +25 -26
- package/dist/cli-bundle/chunks/chunk-QKMMWESK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-R7QV7ICM.js → chunk-QSXN2FAN.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5NTE36LD.js → chunk-RBECHH5K.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JXCW2TI2.js → chunk-RPNC7M63.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-ICDAQ4TD.js → chunk-S2QQNTA6.js} +26 -14
- package/dist/cli-bundle/chunks/chunk-S2QQNTA6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JFD5LPMI.js → chunk-SP3BAXFF.js} +29 -17
- package/dist/cli-bundle/chunks/chunk-SP3BAXFF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-F2LBF7XJ.js → chunk-SUSFH6F7.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-VHXHVTUU.js → chunk-TDOPC7UY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HYW67VJ5.js → chunk-TLF52ZDP.js} +30 -25
- package/dist/cli-bundle/chunks/chunk-TLF52ZDP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FSE2IKJQ.js → chunk-TWHG646K.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OCUBRA6D.js → chunk-U7U7WGEC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-PONKZPCJ.js → chunk-UFRVIIJ2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-VNTCM3VW.js → chunk-VKX2VZZH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-7AVEY74G.js → chunk-VTOCZ343.js} +29 -24
- package/dist/cli-bundle/chunks/chunk-VTOCZ343.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6JUTHVQS.js → chunk-W2JDNTN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PQSEQD6E.js → chunk-W35PHE44.js} +62 -12
- package/dist/cli-bundle/chunks/chunk-W35PHE44.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4QSQ6XDK.js → chunk-WT4KXBUD.js} +68 -31
- package/dist/cli-bundle/chunks/chunk-WT4KXBUD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RPESLSO5.js → chunk-XC5RVKHH.js} +69 -32
- package/dist/cli-bundle/chunks/chunk-XC5RVKHH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QG4GFLQ6.js → chunk-XD6UF2NB.js} +42 -24
- package/dist/cli-bundle/chunks/chunk-XD6UF2NB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AF2CCM5U.js → chunk-XKRVX4B3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JGUKMMRS.js → chunk-XN4NQZJK.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3P7UJQOX.js → chunk-YKFMLQNK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YCIUJJOD.js → chunk-YKWKMGL7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TOBGV45Y.js → chunk-YUKIFPWK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-72LQ4TKV.js → chunk-YYEZEP3E.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-X3W65QK3.js → chunk-ZEY3XSZQ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-MWQ2HC2A.js → chunk-ZKOQHLJP.js} +59 -34
- package/dist/cli-bundle/chunks/chunk-ZKOQHLJP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QJIKE24M.js → chunk-ZQ3UMKWE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4PUUNQDV.js → chunk-ZVVEWHWK.js} +58 -33
- package/dist/cli-bundle/chunks/chunk-ZVVEWHWK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OG5DVFMA.js → chunk-ZXE6SNKO.js} +5 -5
- package/dist/cli-bundle/chunks/close-GAUIGOQC.js +12 -0
- package/dist/cli-bundle/chunks/{close-QEMOYZN3.js → close-SJIEKNY4.js} +5 -5
- package/dist/cli-bundle/chunks/{close-many-RZVTUGBG.js → close-many-B6AIC5OQ.js} +15 -14
- package/dist/cli-bundle/chunks/close-many-QCINT6I2.js +24 -0
- package/dist/cli-bundle/chunks/comments-4SK5EUEJ.js +13 -0
- package/dist/cli-bundle/chunks/{comments-TPU7QRBL.js → comments-DM5KV2RS.js} +7 -7
- package/dist/cli-bundle/chunks/copy-4KCCLTYQ.js +10 -0
- package/dist/cli-bundle/chunks/{copy-DKTSSCK7.js → copy-HEP5SZHB.js} +5 -4
- package/dist/cli-bundle/chunks/create-BDKQFPRE.js +30 -0
- package/dist/cli-bundle/chunks/{create-EIFBIVNQ.js → create-VCGBCYL2.js} +11 -10
- package/dist/cli-bundle/chunks/delete-JWDXPR3H.js +10 -0
- package/dist/cli-bundle/chunks/{delete-LCS3VPDH.js → delete-ZSPBTVJD.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-YG7UF3VR.js → deps-BZTWWOIE.js} +6 -6
- package/dist/cli-bundle/chunks/{deps-UH5EQQUY.js → deps-OVAJOQIE.js} +6 -6
- package/dist/cli-bundle/chunks/{docs-G32TK6XS.js → docs-3GFMSWLL.js} +6 -6
- package/dist/cli-bundle/chunks/docs-SY2NPT6Y.js +14 -0
- package/dist/cli-bundle/chunks/{files-4ALMCSKB.js → files-2SEL4QIU.js} +6 -6
- package/dist/cli-bundle/chunks/{files-3H32UQ4K.js → files-FYMMJGNN.js} +6 -6
- package/dist/cli-bundle/chunks/focus-4A27YJ2Z.js +10 -0
- package/dist/cli-bundle/chunks/{focus-7SOUT5PZ.js → focus-TEUJKTAT.js} +5 -5
- package/dist/cli-bundle/chunks/history-compact-7QOKL2NB.js +16 -0
- package/dist/cli-bundle/chunks/{history-compact-77BT2LUB.js → history-compact-U7A37VR6.js} +6 -6
- package/dist/cli-bundle/chunks/{history-redact-LJPZPNFA.js → history-redact-TNKUO4ZE.js} +4 -4
- package/dist/cli-bundle/chunks/{history-redact-PWTTJ3XS.js → history-redact-ZWRUWQY3.js} +4 -4
- package/dist/cli-bundle/chunks/{history-repair-I7CBNCV3.js → history-repair-6IU5VWHN.js} +7 -7
- package/dist/cli-bundle/chunks/history-repair-GWCGJUM2.js +17 -0
- package/dist/cli-bundle/chunks/learnings-DDFAUUX3.js +13 -0
- package/dist/cli-bundle/chunks/{learnings-KTYW3AL7.js → learnings-GOEZXMKL.js} +7 -7
- package/dist/cli-bundle/chunks/{notes-ZERD3KB2.js → notes-BZWODAEK.js} +7 -7
- package/dist/cli-bundle/chunks/notes-OBJ6FL36.js +13 -0
- package/dist/cli-bundle/chunks/{plan-OFJUBIM5.js → plan-V57VQTAG.js} +12 -11
- package/dist/cli-bundle/chunks/plan-ZMOBD6FX.js +27 -0
- package/dist/cli-bundle/chunks/{profile-3THJPIQY.js → profile-BG3N4ETA.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-XEZAMMBW.js → profile-XLM45FKV.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-BR435Q2H.js → register-list-query-EYYNTGMF.js} +48 -38
- package/dist/cli-bundle/chunks/register-list-query-EYYNTGMF.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-RWTWLOBE.js → register-list-query-WGXJPXXY.js} +47 -37
- package/dist/cli-bundle/chunks/register-list-query-WGXJPXXY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-HLWC2WNP.js → register-mutation-3YSDDVOL.js} +131 -105
- package/dist/cli-bundle/chunks/register-mutation-3YSDDVOL.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-ZJX5AZM5.js → register-mutation-VDGUMMUY.js} +131 -105
- package/dist/cli-bundle/chunks/register-mutation-VDGUMMUY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-744YBJMV.js → register-operations-H4URGAHX.js} +36 -35
- package/dist/cli-bundle/chunks/{register-operations-744YBJMV.js.map → register-operations-H4URGAHX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-UEBJH6AN.js → register-operations-HSO7X77D.js} +34 -33
- package/dist/cli-bundle/chunks/{register-operations-UEBJH6AN.js.map → register-operations-HSO7X77D.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-5DA4UZXI.js → register-setup-HZ2KKXK4.js} +13 -13
- package/dist/cli-bundle/chunks/{register-setup-6H25M3BH.js → register-setup-WCBKJ3H3.js} +13 -13
- package/dist/cli-bundle/chunks/{restore-6TDVSATY.js → restore-3NGRFDPX.js} +7 -6
- package/dist/cli-bundle/chunks/restore-LNVNUWHE.js +15 -0
- package/dist/cli-bundle/chunks/{schema-TPVTIJPO.js → schema-LMFZ742C.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-HFXFSGPG.js → schema-O34O33UW.js} +6 -6
- package/dist/cli-bundle/chunks/update-BN6VZSYX.js +24 -0
- package/dist/cli-bundle/chunks/{update-LJZCL5SI.js → update-FDLPLKOB.js} +14 -13
- package/dist/cli-bundle/chunks/update-many-WCKOPN3K.js +35 -0
- package/dist/cli-bundle/chunks/update-many-WCKOPN3K.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-X6DVGOMM.js +39 -0
- package/dist/cli-bundle/chunks/update-many-X6DVGOMM.js.map +1 -0
- package/dist/cli-bundle/main.js +65 -64
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +53 -52
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +362 -56
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/cli.js +10 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/search/background-refresh.d.ts +3 -1
- package/dist/core/search/background-refresh.js +34 -6
- package/dist/core/search/background-refresh.js.map +1 -1
- package/dist/core/search/cache.js +28 -5
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/shared/constants.d.ts +2 -0
- package/dist/core/shared/constants.js +29 -24
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/store/item-metadata-cache.d.ts +32 -1
- package/dist/core/store/item-metadata-cache.js +289 -21
- package/dist/core/store/item-metadata-cache.js.map +1 -1
- package/dist/core/store/item-store.js +71 -34
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings.js +9 -3
- package/dist/core/store/settings.js.map +1 -1
- package/dist/sdk/cli-bootstrap.js +68 -76
- package/dist/sdk/cli-bootstrap.js.map +1 -1
- package/dist/sdk/compile-cache.d.ts +16 -0
- package/dist/sdk/compile-cache.js +73 -0
- package/dist/sdk/compile-cache.js.map +1 -0
- package/dist/sdk/context-relevance.d.ts +16 -1
- package/dist/sdk/context-relevance.js +20 -8
- package/dist/sdk/context-relevance.js.map +1 -1
- package/dist/sdk/context-signal-store.d.ts +77 -0
- package/dist/sdk/context-signal-store.js +201 -0
- package/dist/sdk/context-signal-store.js.map +1 -0
- package/dist/sdk/dependency-provenance.d.ts +12 -0
- package/dist/sdk/dependency-provenance.js +38 -0
- package/dist/sdk/dependency-provenance.js.map +1 -0
- package/dist/sdk/governance/storage-integrity.d.ts +1 -1
- package/dist/sdk/governance/storage-integrity.js +47 -6
- package/dist/sdk/governance/storage-integrity.js.map +1 -1
- package/dist/sdk/graph/assembly.d.ts +2 -0
- package/dist/sdk/graph/assembly.js +51 -4
- package/dist/sdk/graph/assembly.js.map +1 -1
- package/dist/sdk/graph/run.js +12 -13
- package/dist/sdk/graph/run.js.map +1 -1
- package/dist/sdk/index.d.ts +5 -0
- package/dist/sdk/index.js +7 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/item-metadata-index.d.ts +11 -0
- package/dist/sdk/item-metadata-index.js +15 -0
- package/dist/sdk/item-metadata-index.js.map +1 -0
- package/dist/sdk/merge/index.d.ts +1 -0
- package/dist/sdk/merge/index.js +3 -2
- package/dist/sdk/merge/index.js.map +1 -1
- package/dist/sdk/merge/install.js +25 -9
- package/dist/sdk/merge/install.js.map +1 -1
- package/dist/sdk/merge/reconcile.d.ts +46 -0
- package/dist/sdk/merge/reconcile.js +46 -0
- package/dist/sdk/merge/reconcile.js.map +1 -0
- package/dist/sdk/query/list.d.ts +5 -4
- package/dist/sdk/query/list.js +22 -14
- package/dist/sdk/query/list.js.map +1 -1
- package/dist/sdk/relationship-history.d.ts +30 -0
- package/dist/sdk/relationship-history.js +75 -7
- package/dist/sdk/relationship-history.js.map +1 -1
- package/dist/sdk/relationship-migration.d.ts +42 -0
- package/dist/sdk/relationship-migration.js +78 -0
- package/dist/sdk/relationship-migration.js.map +1 -0
- package/dist/sdk/structured-mutations.js +4 -25
- package/dist/sdk/structured-mutations.js.map +1 -1
- package/docs/COMMANDS.md +26 -3
- package/docs/CONFIGURATION.md +1 -1
- package/docs/MERGE_SAFETY.md +14 -5
- package/docs/PERFORMANCE.md +28 -0
- package/docs/RELATIONSHIP_GRAPH.md +47 -1
- package/docs/SDK.md +78 -5
- package/marketplace.json +2 -2
- package/package.json +2 -2
- 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-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/append-DFETHAZL.js +0 -11
- package/dist/cli-bundle/chunks/chunk-4PUUNQDV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4QSQ6XDK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7AVEY74G.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7DOJC3HS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7RW4JCU2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ADBTSVGK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AMJPSANK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AS4SAZ5R.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ATBCUC7Y.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BKIAH72N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FJIFFBJX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HYW67VJ5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ICDAQ4TD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IY6VZ3IW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JFD5LPMI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K36WV5J6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K55VMLSS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MWQ2HC2A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NUF7ROFH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-O4BCOJTZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-POG76WWZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PQSEQD6E.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QG4GFLQ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R3P6FZJW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RNPZYNHS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RPESLSO5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SY4SFZSD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XJTABV3X.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YQWCZ5AC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z75ONV25.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZTVA4KLN.js.map +0 -7
- package/dist/cli-bundle/chunks/close-O5QVZ6ET.js +0 -12
- package/dist/cli-bundle/chunks/close-many-5RZXVN4J.js +0 -23
- package/dist/cli-bundle/chunks/comments-Z4KV6FU3.js +0 -13
- package/dist/cli-bundle/chunks/copy-M7DDI6LS.js +0 -9
- package/dist/cli-bundle/chunks/create-RGSPN5GD.js +0 -29
- package/dist/cli-bundle/chunks/delete-MD7YXQLH.js +0 -10
- package/dist/cli-bundle/chunks/docs-JWWNRC27.js +0 -14
- package/dist/cli-bundle/chunks/focus-DRQ6FQH6.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-VCKGTX64.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-YTDZRK5E.js +0 -17
- package/dist/cli-bundle/chunks/learnings-CYNOICKR.js +0 -13
- package/dist/cli-bundle/chunks/notes-FGO63FXL.js +0 -13
- package/dist/cli-bundle/chunks/plan-SGCDDTYR.js +0 -26
- package/dist/cli-bundle/chunks/register-list-query-BR435Q2H.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-RWTWLOBE.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-HLWC2WNP.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-ZJX5AZM5.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-RSL7C7LO.js +0 -14
- package/dist/cli-bundle/chunks/update-SIA7LH5Y.js +0 -23
- package/dist/cli-bundle/chunks/update-many-BDBZVGQL.js +0 -38
- package/dist/cli-bundle/chunks/update-many-MOY3A5B3.js +0 -34
- /package/dist/cli-bundle/chunks/{append-7OVFYR3C.js.map → append-CYMA7RJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-DFETHAZL.js.map → append-H53CAPMP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PFNHX655.js.map → chunk-2P7OK4WG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJDGV4GR.js.map → chunk-3EBGHNNQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DZRV2OPA.js.map → chunk-3EDFN3VV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZOY5K4D3.js.map → chunk-3PWJWLLQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VXOOB6YX.js.map → chunk-3SJAR3CY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GTLCVJOE.js.map → chunk-3WVKMF2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LAV26CQG.js.map → chunk-42SYYKA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NLR32VFS.js.map → chunk-4IXLNV7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ABWCF646.js.map → chunk-4YTQVO3V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E5XMKOSB.js.map → chunk-5EBRMHI6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GKX4NJ7U.js.map → chunk-5K5LHZZX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T6PPNM7V.js.map → chunk-5K7BOAB6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4QOB7L7I.js.map → chunk-5MUZ54G2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SF3DT5HJ.js.map → chunk-5QME4KX2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TRSHFPRZ.js.map → chunk-6PM6CPPP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OR42SO64.js.map → chunk-7B36A3VT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QWRVBJ4D.js.map → chunk-7OR2YKKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FPBMLYPI.js.map → chunk-7QUV54XX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WWNL6WMH.js.map → chunk-7WXW6JHG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BXNDKOR2.js.map → chunk-A2VL5SVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-QEMOYZN3.js.map → chunk-AXGDUXJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IAQE32BI.js.map → chunk-B2AVNGG3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HCEBZNC3.js.map → chunk-BRMPF2RM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z7VWXXJM.js.map → chunk-BTNKMF2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KH44WBAT.js.map → chunk-CD4643VW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OWXOPDHD.js.map → chunk-CJEEC5O4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PZC2FUOQ.js.map → chunk-CTPKCZCF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7W2UAXXT.js.map → chunk-D4OBQVL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EWJWSNRU.js.map → chunk-DM4TYC2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VJQG4BIM.js.map → chunk-DSFTAQ7T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AELMUANP.js.map → chunk-DVB6SQU7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KBLZ3AA5.js.map → chunk-E3ZWOFSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-O5QVZ6ET.js.map → chunk-EP25DV6P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GTK4DTEW.js.map → chunk-F4VCB4WY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-V22ZPOKN.js.map → chunk-F4XAQUQA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QOOTOD3W.js.map → chunk-FGR6IBAF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JSLT7WVE.js.map → chunk-FKBMT2Q6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QIH77CAG.js.map → chunk-G5RLSSIX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P7MTHPJQ.js.map → chunk-GEKRVH3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2L6ZP22J.js.map → chunk-GSP6IZFU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZVZGXPQ5.js.map → chunk-HYZZM3Q2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4XGJLADW.js.map → chunk-IHY5SX7O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UCBDQI5E.js.map → chunk-IMU7JLUI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PEQGTJ5Q.js.map → chunk-JCLXCGIL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GROYI4RB.js.map → chunk-JLTHOYR7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JHJSFOAM.js.map → chunk-JMPVHM44.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MATHDCGG.js.map → chunk-JWYG36RV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VLRGDBLY.js.map → chunk-KEHOPUHH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CPX275C6.js.map → chunk-KPCZL2YK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FO6OSVEN.js.map → chunk-LANV45W2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LVC72YRD.js.map → chunk-LC5ZUXWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TVYYO5A7.js.map → chunk-MBHYQYCS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7656MAUL.js.map → chunk-MUAJHL2R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7WCE6Y64.js.map → chunk-NUQCSV4P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SZVB53Y3.js.map → chunk-O3GFE2PX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OY7DMU5P.js.map → chunk-O43LEUSD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LZYP423P.js.map → chunk-OZ25YD4Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VZIZB6QH.js.map → chunk-PKYKQCTJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UZLJOEAC.js.map → chunk-PMRED6QZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K4CI6Y45.js.map → chunk-PWGJCP2V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UVN66B3M.js.map → chunk-Q3Z2Y5WJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R7QV7ICM.js.map → chunk-QSXN2FAN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5NTE36LD.js.map → chunk-RBECHH5K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JXCW2TI2.js.map → chunk-RPNC7M63.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F2LBF7XJ.js.map → chunk-SUSFH6F7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VHXHVTUU.js.map → chunk-TDOPC7UY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FSE2IKJQ.js.map → chunk-TWHG646K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OCUBRA6D.js.map → chunk-U7U7WGEC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PONKZPCJ.js.map → chunk-UFRVIIJ2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VNTCM3VW.js.map → chunk-VKX2VZZH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6JUTHVQS.js.map → chunk-W2JDNTN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AF2CCM5U.js.map → chunk-XKRVX4B3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JGUKMMRS.js.map → chunk-XN4NQZJK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3P7UJQOX.js.map → chunk-YKFMLQNK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCIUJJOD.js.map → chunk-YKWKMGL7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TOBGV45Y.js.map → chunk-YUKIFPWK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-72LQ4TKV.js.map → chunk-YYEZEP3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X3W65QK3.js.map → chunk-ZEY3XSZQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QJIKE24M.js.map → chunk-ZQ3UMKWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OG5DVFMA.js.map → chunk-ZXE6SNKO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-5RZXVN4J.js.map → close-GAUIGOQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-RZVTUGBG.js.map → close-SJIEKNY4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-TPU7QRBL.js.map → close-many-B6AIC5OQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-Z4KV6FU3.js.map → close-many-QCINT6I2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-M7DDI6LS.js.map → comments-4SK5EUEJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-DKTSSCK7.js.map → comments-DM5KV2RS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-RGSPN5GD.js.map → copy-4KCCLTYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-EIFBIVNQ.js.map → copy-HEP5SZHB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-MD7YXQLH.js.map → create-BDKQFPRE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-LCS3VPDH.js.map → create-VCGBCYL2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-YG7UF3VR.js.map → delete-JWDXPR3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-UH5EQQUY.js.map → delete-ZSPBTVJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-JWWNRC27.js.map → deps-BZTWWOIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-G32TK6XS.js.map → deps-OVAJOQIE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-3H32UQ4K.js.map → docs-3GFMSWLL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-4ALMCSKB.js.map → docs-SY2NPT6Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DRQ6FQH6.js.map → files-2SEL4QIU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-7SOUT5PZ.js.map → files-FYMMJGNN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-VCKGTX64.js.map → focus-4A27YJ2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-77BT2LUB.js.map → focus-TEUJKTAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-PWTTJ3XS.js.map → history-compact-7QOKL2NB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-LJPZPNFA.js.map → history-compact-U7A37VR6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-I7CBNCV3.js.map → history-redact-TNKUO4ZE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-YTDZRK5E.js.map → history-redact-ZWRUWQY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-KTYW3AL7.js.map → history-repair-6IU5VWHN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-CYNOICKR.js.map → history-repair-GWCGJUM2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-FGO63FXL.js.map → learnings-DDFAUUX3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-ZERD3KB2.js.map → learnings-GOEZXMKL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-OFJUBIM5.js.map → notes-BZWODAEK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-SGCDDTYR.js.map → notes-OBJ6FL36.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-3THJPIQY.js.map → plan-V57VQTAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-XEZAMMBW.js.map → plan-ZMOBD6FX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-6TDVSATY.js.map → profile-BG3N4ETA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-RSL7C7LO.js.map → profile-XLM45FKV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-5DA4UZXI.js.map → register-setup-HZ2KKXK4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-6H25M3BH.js.map → register-setup-WCBKJ3H3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-TPVTIJPO.js.map → restore-3NGRFDPX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-HFXFSGPG.js.map → restore-LNVNUWHE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-LJZCL5SI.js.map → schema-LMFZ742C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SIA7LH5Y.js.map → schema-O34O33UW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-MOY3A5B3.js.map → update-BN6VZSYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-BDBZVGQL.js.map → update-FDLPLKOB.js.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm copy command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="5e51abfc-3eb4-5e01-a103-d2e236d6e68f")}catch(e){}}();
|
|
8
8
|
import { pathExists, removeFileIfExists, writeFileAtomic, } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { appendHistoryEntry, createHistoryEntry, } from "../../core/history/history.js";
|
|
10
10
|
import { generateItemId } from "../../core/item/id.js";
|
|
@@ -18,6 +18,7 @@ import { nowIso } from "../../core/shared/time.js";
|
|
|
18
18
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
19
19
|
import { resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
20
20
|
import { buildItemNotFoundError, locateItem, readLocatedItem, } from "../../core/store/item-store.js";
|
|
21
|
+
import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../../sdk/item-metadata-index.js";
|
|
21
22
|
import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot, } from "../../core/store/paths.js";
|
|
22
23
|
import { readSettings } from "../../core/store/settings.js";
|
|
23
24
|
function selectAuthor(explicitAuthor, settingsAuthor) {
|
|
@@ -96,27 +97,42 @@ export async function runCopy(sourceId, options, global) {
|
|
|
96
97
|
metadata: {},
|
|
97
98
|
body: "",
|
|
98
99
|
};
|
|
99
|
-
let hookWarnings
|
|
100
|
+
let hookWarnings;
|
|
101
|
+
let derivedIndexWarnings;
|
|
100
102
|
try {
|
|
101
|
-
await
|
|
102
|
-
format: settings.item_format,
|
|
103
|
-
schema: settings.schema,
|
|
104
|
-
extensionFieldNames,
|
|
105
|
-
}));
|
|
103
|
+
const releaseDerivedIndexLock = await acquireItemMetadataDerivedIndexLock(pmRoot, author);
|
|
106
104
|
try {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
await writeFileAtomic(itemPath, serializeItemDocument(copiedDocument, {
|
|
106
|
+
format: settings.item_format,
|
|
107
|
+
schema: settings.schema,
|
|
108
|
+
extensionFieldNames,
|
|
109
|
+
}));
|
|
110
|
+
try {
|
|
111
|
+
const historyEntry = createHistoryEntry({
|
|
112
|
+
nowIso: copiedAt,
|
|
113
|
+
author,
|
|
114
|
+
op: "create",
|
|
115
|
+
before: beforeDocument,
|
|
116
|
+
after: copiedDocument,
|
|
117
|
+
message: buildCopyMessage(located.id, options.message),
|
|
118
|
+
});
|
|
119
|
+
await appendHistoryEntry(historyPath, historyEntry);
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
await removeFileIfExists(itemPath);
|
|
123
|
+
throw error;
|
|
124
|
+
}
|
|
125
|
+
derivedIndexWarnings = await refreshItemMetadataDerivedIndex({
|
|
126
|
+
pmRoot,
|
|
127
|
+
preferredFormat: settings.item_format,
|
|
128
|
+
typeToFolder: typeRegistry.type_to_folder,
|
|
129
|
+
schema: settings.schema,
|
|
130
|
+
itemPath,
|
|
131
|
+
document: copiedDocument,
|
|
114
132
|
});
|
|
115
|
-
await appendHistoryEntry(historyPath, historyEntry);
|
|
116
133
|
}
|
|
117
|
-
|
|
118
|
-
await
|
|
119
|
-
throw error;
|
|
134
|
+
finally {
|
|
135
|
+
await releaseDerivedIndexLock();
|
|
120
136
|
}
|
|
121
137
|
hookWarnings = [
|
|
122
138
|
...(await runActiveOnWriteHooks({
|
|
@@ -156,8 +172,8 @@ export async function runCopy(sourceId, options, global) {
|
|
|
156
172
|
source_id: located.id,
|
|
157
173
|
item: structuredClone(copiedDocument.metadata),
|
|
158
174
|
changed_fields: changedFields,
|
|
159
|
-
warnings: hookWarnings,
|
|
175
|
+
warnings: [...derivedIndexWarnings, ...hookWarnings],
|
|
160
176
|
};
|
|
161
177
|
}
|
|
162
178
|
//# sourceMappingURL=copy.js.map
|
|
163
|
-
//# debugId=
|
|
179
|
+
//# debugId=5e51abfc-3eb4-5e01-a103-d2e236d6e68f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","sources":["cli/commands/copy.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/copy\n *\n * Implements the pm copy command surface and its agent-facing runtime behavior.\n */\nimport {\n pathExists,\n removeFileIfExists,\n writeFileAtomic,\n} from \"../../core/fs/fs-utils.js\";\nimport {\n appendHistoryEntry,\n createHistoryEntry,\n} from \"../../core/history/history.js\";\nimport { generateItemId } from \"../../core/item/id.js\";\nimport {\n canonicalDocument,\n serializeItemDocument,\n} from \"../../core/item/item-format.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport {\n EXIT_CODE,\n ITEM_METADATA_KEY_ORDER,\n} from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n buildItemNotFoundError,\n locateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport {\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n resolvePmRoot,\n} from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/** Documents the copy options payload exchanged by command, SDK, and package integrations. */\nexport interface CopyOptions {\n /** Value that configures or reports title for this contract. */\n title?: string;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n}\n\n/** Documents the copy result payload exchanged by command, SDK, and package integrations. */\nexport interface CopyResult {\n /** Value that configures or reports source id for this contract. */\n source_id: string;\n /** Value that configures or reports item for this contract. */\n item: ItemMetadata;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields: string[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\nfunction selectAuthor(\n explicitAuthor: string | undefined,\n settingsAuthor: string,\n): string {\n const candidate = explicitAuthor ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nfunction buildChangedFields(itemMetadata: ItemMetadata, body: string): string[] {\n const changed = [\n ...new Set([\n ...ITEM_METADATA_KEY_ORDER.filter((key) => itemMetadata[key] !== undefined),\n ...Object.keys(itemMetadata).filter(\n (key) => itemMetadata[key] !== undefined,\n ),\n ...(body.length > 0 ? [\"body\"] : []),\n ]),\n ];\n return changed.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildCopyMessage(\n sourceId: string,\n message: string | undefined,\n): string {\n const suffix = `copied_from=${sourceId}`;\n if (!message) {\n return suffix;\n }\n const trimmed = message.trim();\n return trimmed.length > 0 ? `${trimmed} | ${suffix}` : suffix;\n}\n\n/** Implements run copy for the public runtime surface of this module. */\nexport async function runCopy(\n sourceId: string,\n options: CopyOptions,\n global: GlobalOptions,\n): Promise<CopyResult> {\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\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const located = await locateItem(\n pmRoot,\n sourceId,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n throw await buildItemNotFoundError(\n pmRoot,\n sourceId,\n settings.id_prefix,\n typeRegistry.type_to_folder,\n );\n }\n const sourceLoaded = await readLocatedItem(located, {\n schema: settings.schema,\n });\n const sourceMetadata = sourceLoaded.document.metadata;\n const copiedAt = nowIso();\n const author = selectAuthor(options.author, settings.author_default);\n const newId = await generateItemId(pmRoot, settings.id_prefix, {\n tokenLength: settings.ids.token_length,\n });\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const titleOverride = options.title?.trim();\n if (titleOverride !== undefined && titleOverride.length === 0) {\n throw new PmCliError(\"Copy --title must not be empty\", EXIT_CODE.USAGE);\n }\n\n const copiedMetadata: ItemMetadata = {\n ...(sourceMetadata as Record<string, unknown>),\n id: newId,\n title: titleOverride ?? sourceMetadata.title,\n status: statusRegistry.open_status,\n created_at: copiedAt,\n updated_at: copiedAt,\n } as ItemMetadata;\n delete copiedMetadata.closed_at;\n delete copiedMetadata.close_reason;\n delete copiedMetadata.test_runs;\n\n const extensionFieldNames = collectRegisteredItemFieldNames(\n getActiveExtensionRegistrations(),\n );\n const copiedDocument = canonicalDocument(\n {\n metadata: copiedMetadata,\n body: sourceLoaded.document.body,\n },\n {\n schema: settings.schema,\n extensionFieldNames,\n },\n );\n const changedFields = buildChangedFields(\n copiedDocument.metadata,\n copiedDocument.body,\n );\n const itemPath = getItemPath(\n pmRoot,\n copiedDocument.metadata.type,\n newId,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n const historyPath = getHistoryPath(pmRoot, newId);\n const lockRelease = await acquireLock(\n pmRoot,\n newId,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n let hookWarnings: string[] = [];\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(copiedDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const historyEntry = createHistoryEntry({\n nowIso: copiedAt,\n author,\n op: \"create\",\n before: beforeDocument,\n after: copiedDocument,\n message: buildCopyMessage(located.id, options.message),\n });\n await appendHistoryEntry(historyPath, historyEntry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: copiedDocument.metadata.id,\n op: \"create\",\n item_type: copiedDocument.metadata.type,\n status: copiedDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(\n copiedDocument.metadata,\n changedFields,\n ),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n return {\n source_id: located.id,\n item: structuredClone(copiedDocument.metadata),\n changed_fields: changedFields,\n warnings: hookWarnings,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAA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AQ,CAAC,MAAM;YACtC,OAAO,EAAE,+BAA+B,CACtC,cAAc,CAAC,QAAQ,EACvB,aAAa,CACd;YACD,cAAc,EAAE,aAAa;SAC9B,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,EAAE,CAAC;IACtB,CAAC;IAED,OAAO;QACL,SAAS,EAAE,OAAO,CAAC,EAAE;QACrB,IAAI,EAAE,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;QAC9C,cAAc,EAAE,aAAa;QAC7B,QAAQ,EAAE,YAAY;KACvB,CAAC;AACJ,CAAC","debugId":"deccf6ff-b472-5c49-bd10-165086192cb2"}
|
|
1
|
+
{"version":3,"file":"copy.js","sources":["cli/commands/copy.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module cli/commands/copy\n *\n * Implements the pm copy command surface and its agent-facing runtime behavior.\n */\nimport {\n pathExists,\n removeFileIfExists,\n writeFileAtomic,\n} from \"../../core/fs/fs-utils.js\";\nimport {\n appendHistoryEntry,\n createHistoryEntry,\n} from \"../../core/history/history.js\";\nimport { generateItemId } from \"../../core/item/id.js\";\nimport {\n canonicalDocument,\n serializeItemDocument,\n} from \"../../core/item/item-format.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport { collectRegisteredItemFieldNames } from \"../../core/extensions/item-fields.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport {\n EXIT_CODE,\n ITEM_METADATA_KEY_ORDER,\n} from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport {\n buildItemNotFoundError,\n locateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport {\n acquireItemMetadataDerivedIndexLock,\n refreshItemMetadataDerivedIndex,\n} from \"../../sdk/item-metadata-index.js\";\nimport {\n getHistoryPath,\n getItemPath,\n getSettingsPath,\n resolvePmRoot,\n} from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/** Documents the copy options payload exchanged by command, SDK, and package integrations. */\nexport interface CopyOptions {\n /** Value that configures or reports title for this contract. */\n title?: string;\n /** Value that configures or reports author for this contract. */\n author?: string;\n /** Human-readable explanation suitable for logs and agent-facing output. */\n message?: string;\n}\n\n/** Documents the copy result payload exchanged by command, SDK, and package integrations. */\nexport interface CopyResult {\n /** Value that configures or reports source id for this contract. */\n source_id: string;\n /** Value that configures or reports item for this contract. */\n item: ItemMetadata;\n /** Value that configures or reports changed fields for this contract. */\n changed_fields: string[];\n /** Value that configures or reports warnings for this contract. */\n warnings: string[];\n}\n\nfunction selectAuthor(\n explicitAuthor: string | undefined,\n settingsAuthor: string,\n): string {\n const candidate = explicitAuthor ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed.length > 0 ? trimmed : \"unknown\";\n}\n\nfunction buildChangedFields(\n itemMetadata: ItemMetadata,\n body: string,\n): string[] {\n const changed = [\n ...new Set([\n ...ITEM_METADATA_KEY_ORDER.filter(\n (key) => itemMetadata[key] !== undefined,\n ),\n ...Object.keys(itemMetadata).filter(\n (key) => itemMetadata[key] !== undefined,\n ),\n ...(body.length > 0 ? [\"body\"] : []),\n ]),\n ];\n return changed.sort((left, right) => left.localeCompare(right));\n}\n\nfunction buildCopyMessage(\n sourceId: string,\n message: string | undefined,\n): string {\n const suffix = `copied_from=${sourceId}`;\n if (!message) {\n return suffix;\n }\n const trimmed = message.trim();\n return trimmed.length > 0 ? `${trimmed} | ${suffix}` : suffix;\n}\n\n/** Implements run copy for the public runtime surface of this module. */\nexport async function runCopy(\n sourceId: string,\n options: CopyOptions,\n global: GlobalOptions,\n): Promise<CopyResult> {\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\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const located = await locateItem(\n pmRoot,\n sourceId,\n settings.id_prefix,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n if (!located) {\n throw await buildItemNotFoundError(\n pmRoot,\n sourceId,\n settings.id_prefix,\n typeRegistry.type_to_folder,\n );\n }\n const sourceLoaded = await readLocatedItem(located, {\n schema: settings.schema,\n });\n const sourceMetadata = sourceLoaded.document.metadata;\n const copiedAt = nowIso();\n const author = selectAuthor(options.author, settings.author_default);\n const newId = await generateItemId(pmRoot, settings.id_prefix, {\n tokenLength: settings.ids.token_length,\n });\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const titleOverride = options.title?.trim();\n if (titleOverride !== undefined && titleOverride.length === 0) {\n throw new PmCliError(\"Copy --title must not be empty\", EXIT_CODE.USAGE);\n }\n\n const copiedMetadata: ItemMetadata = {\n ...(sourceMetadata as Record<string, unknown>),\n id: newId,\n title: titleOverride ?? sourceMetadata.title,\n status: statusRegistry.open_status,\n created_at: copiedAt,\n updated_at: copiedAt,\n } as ItemMetadata;\n delete copiedMetadata.closed_at;\n delete copiedMetadata.close_reason;\n delete copiedMetadata.test_runs;\n\n const extensionFieldNames = collectRegisteredItemFieldNames(\n getActiveExtensionRegistrations(),\n );\n const copiedDocument = canonicalDocument(\n {\n metadata: copiedMetadata,\n body: sourceLoaded.document.body,\n },\n {\n schema: settings.schema,\n extensionFieldNames,\n },\n );\n const changedFields = buildChangedFields(\n copiedDocument.metadata,\n copiedDocument.body,\n );\n const itemPath = getItemPath(\n pmRoot,\n copiedDocument.metadata.type,\n newId,\n settings.item_format,\n typeRegistry.type_to_folder,\n );\n const historyPath = getHistoryPath(pmRoot, newId);\n const lockRelease = await acquireLock(\n pmRoot,\n newId,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n settings.locks.wait_ms,\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n let hookWarnings: string[];\n let derivedIndexWarnings: string[];\n try {\n const releaseDerivedIndexLock = await acquireItemMetadataDerivedIndexLock(\n pmRoot,\n author,\n );\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(copiedDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const historyEntry = createHistoryEntry({\n nowIso: copiedAt,\n author,\n op: \"create\",\n before: beforeDocument,\n after: copiedDocument,\n message: buildCopyMessage(located.id, options.message),\n });\n await appendHistoryEntry(historyPath, historyEntry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n derivedIndexWarnings = await refreshItemMetadataDerivedIndex({\n pmRoot,\n preferredFormat: settings.item_format,\n typeToFolder: typeRegistry.type_to_folder,\n schema: settings.schema,\n itemPath,\n document: copiedDocument,\n });\n } finally {\n await releaseDerivedIndexLock();\n }\n\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: copiedDocument.metadata.id,\n item_type: copiedDocument.metadata.type,\n before: beforeDocument,\n after: copiedDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: copiedDocument.metadata.id,\n op: \"create\",\n item_type: copiedDocument.metadata.type,\n status: copiedDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(\n copiedDocument.metadata,\n changedFields,\n ),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n return {\n source_id: located.id,\n item: structuredClone(copiedDocument.metadata),\n changed_fields: changedFields,\n warnings: [...derivedIndexWarnings, ...hookWarnings],\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,eAAe,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAC/B,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AACvF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AACnF,OAAO,EACL,SAAS,EACT,uBAAuB,GACxB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EACL,sBAAsB,EACtB,UAAU,EACV,eAAe,GAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mCAAmC,EACnC,+BAA+B,GAChC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EACL,cAAc,EACd,WAAW,EACX,eAAe,EACf,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAyB5D,S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,OAAO,CAAC,EAAE;QACrB,IAAI,EAAE,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC;QAC9C,cAAc,EAAE,aAAa;QAC7B,QAAQ,EAAE,CAAC,GAAG,oBAAoB,EAAE,GAAG,YAAY,CAAC;KACrD,CAAC;AACJ,CAAC","debugId":"5e51abfc-3eb4-5e01-a103-d2e236d6e68f"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm create command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!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]="
|
|
7
|
+
!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]="dd41d74c-1e7a-5543-bf68-ec1a7f490e0e")}catch(e){}}();
|
|
8
8
|
import { pathExists, removeFileIfExists, writeFileAtomic, } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { appendHistoryEntry, createHistoryEntry, } from "../../core/history/history.js";
|
|
10
10
|
import { generateItemId, normalizeItemId } from "../../core/item/id.js";
|
|
@@ -29,6 +29,7 @@ import { nowIso, resolveIsoOrRelative } from "../../core/shared/time.js";
|
|
|
29
29
|
import { getActiveExtensionRegistrations, projectAfterCommandItemSnapshot, recordAfterCommandAffectedItem, runActiveCommandHandler, runActiveOnWriteHooks, } from "../../core/extensions/index.js";
|
|
30
30
|
import { collectRegisteredItemFieldNames, applyRegisteredItemFieldDefaultsAndValidation, parseRegisteredItemFieldAssignments, } from "../../core/extensions/item-fields.js";
|
|
31
31
|
import { listAllItemMetadataLight, locateItem, } from "../../core/store/item-store.js";
|
|
32
|
+
import { acquireItemMetadataDerivedIndexLock, refreshItemMetadataDerivedIndex, } from "../../sdk/item-metadata-index.js";
|
|
32
33
|
import { collectNewOrderingCycleWarnings } from "../../sdk/graph/mutation-advisory.js";
|
|
33
34
|
import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot, } from "../../core/store/paths.js";
|
|
34
35
|
import { readSettings } from "../../core/store/settings.js";
|
|
@@ -40,6 +41,7 @@ import { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry,
|
|
|
40
41
|
import { COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR, parseCommandUnsetTargets, resolveRuntimeUnsetFieldDefinition, } from "./shared-unset-fields.js";
|
|
41
42
|
import { ensureEnumValue } from "./recurrence-parsers.js";
|
|
42
43
|
import { assertValidBareDependencyFlagValue } from "../../sdk/dependency-flag-validation.js";
|
|
44
|
+
import { normalizeDependencySeedId, normalizeDependencySourceKind, } from "../../sdk/dependency-provenance.js";
|
|
43
45
|
import { parseEventEntries, parseReminderEntries, parseTypeOptionEntries, } from "./repeatable-metadata-parsers.js";
|
|
44
46
|
import { DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, SCOPE_VALUES, } from "../../types/index.js";
|
|
45
47
|
const CREATE_MODE_VALUES = ["strict", "progressive"];
|
|
@@ -164,7 +166,14 @@ function parseCreateUnsetTargets(raw, runtimeFieldRegistry) {
|
|
|
164
166
|
});
|
|
165
167
|
}
|
|
166
168
|
/** Allowed CSV/markdown keys for the create `--dep` seed (GH-258). */
|
|
167
|
-
const DEP_SEED_KEYS = [
|
|
169
|
+
const DEP_SEED_KEYS = [
|
|
170
|
+
"id",
|
|
171
|
+
"kind",
|
|
172
|
+
"type",
|
|
173
|
+
"author",
|
|
174
|
+
"created_at",
|
|
175
|
+
"source_kind",
|
|
176
|
+
];
|
|
168
177
|
/** Allowed CSV/markdown keys for create `--file`/`--doc` seeds (GH-258). */
|
|
169
178
|
const LINKED_ARTIFACT_SEED_KEYS = ["path", "scope", "note"];
|
|
170
179
|
function parseDependencies(raw, nowValue, prefix) {
|
|
@@ -189,11 +198,13 @@ function parseDependencies(raw, nowValue, prefix) {
|
|
|
189
198
|
if (id.trim().toLowerCase() === "undefined") {
|
|
190
199
|
throw new PmCliError(`--dep id must not use placeholder token "${id}". Use --clear-deps to clear dependencies.`, EXIT_CODE.USAGE);
|
|
191
200
|
}
|
|
201
|
+
const sourceKind = normalizeDependencySourceKind(parseOptionalString(kv.source_kind));
|
|
192
202
|
return {
|
|
193
|
-
id:
|
|
203
|
+
id: normalizeDependencySeedId(id, prefix, sourceKind),
|
|
194
204
|
kind: ensureEnumValue(kind, DEPENDENCY_KIND_VALUES, "dependency kind"),
|
|
195
205
|
created_at: parseCreatedAt(kv.created_at, nowValue),
|
|
196
206
|
author: parseOptionalString(kv.author),
|
|
207
|
+
source_kind: sourceKind,
|
|
197
208
|
};
|
|
198
209
|
});
|
|
199
210
|
return { values, explicitEmpty: false };
|
|
@@ -1428,30 +1439,46 @@ async function writeCreatedItem(params) {
|
|
|
1428
1439
|
if (existing) {
|
|
1429
1440
|
throw new PmCliError(`Item "${id}" already exists`, EXIT_CODE.CONFLICT);
|
|
1430
1441
|
}
|
|
1431
|
-
await
|
|
1432
|
-
|
|
1433
|
-
schema: settings.schema,
|
|
1434
|
-
extensionFieldNames,
|
|
1435
|
-
}));
|
|
1442
|
+
const releaseDerivedIndexLock = await acquireItemMetadataDerivedIndexLock(pmRoot, author);
|
|
1443
|
+
let derivedIndexWarnings = [];
|
|
1436
1444
|
try {
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1445
|
+
await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, {
|
|
1446
|
+
format: settings.item_format,
|
|
1447
|
+
schema: settings.schema,
|
|
1448
|
+
extensionFieldNames,
|
|
1449
|
+
}));
|
|
1450
|
+
try {
|
|
1451
|
+
const entry = createHistoryEntry({
|
|
1452
|
+
nowIso: nowValue,
|
|
1453
|
+
author,
|
|
1454
|
+
op: "create",
|
|
1455
|
+
before: beforeDocument,
|
|
1456
|
+
after: afterDocument,
|
|
1457
|
+
message: historyMessage,
|
|
1458
|
+
});
|
|
1459
|
+
await appendHistoryEntry(historyPath, entry);
|
|
1460
|
+
}
|
|
1461
|
+
catch (error) {
|
|
1462
|
+
await removeFileIfExists(itemPath);
|
|
1463
|
+
throw error;
|
|
1464
|
+
}
|
|
1465
|
+
derivedIndexWarnings = await refreshItemMetadataDerivedIndex({
|
|
1466
|
+
pmRoot,
|
|
1467
|
+
preferredFormat: settings.item_format,
|
|
1468
|
+
typeToFolder: typeRegistry.type_to_folder,
|
|
1469
|
+
schema: settings.schema,
|
|
1470
|
+
itemPath,
|
|
1471
|
+
document: afterDocument,
|
|
1444
1472
|
});
|
|
1445
|
-
await appendHistoryEntry(historyPath, entry);
|
|
1446
1473
|
}
|
|
1447
|
-
|
|
1448
|
-
await
|
|
1449
|
-
throw error;
|
|
1474
|
+
finally {
|
|
1475
|
+
await releaseDerivedIndexLock();
|
|
1450
1476
|
}
|
|
1451
1477
|
hookWarnings = [
|
|
1452
1478
|
...(graphBeforeCreate
|
|
1453
1479
|
? collectNewOrderingCycleWarnings(graphBeforeCreate, [...graphBeforeCreate, afterDocument.metadata], id)
|
|
1454
1480
|
: []),
|
|
1481
|
+
...derivedIndexWarnings,
|
|
1455
1482
|
...(await runActiveOnWriteHooks({
|
|
1456
1483
|
path: itemPath,
|
|
1457
1484
|
scope: "project",
|
|
@@ -1757,10 +1784,7 @@ export async function runCreate(options, global) {
|
|
|
1757
1784
|
return {
|
|
1758
1785
|
item: outputItem,
|
|
1759
1786
|
changed_fields: changedFields,
|
|
1760
|
-
warnings: [
|
|
1761
|
-
...validationWarnings,
|
|
1762
|
-
...hookWarnings,
|
|
1763
|
-
],
|
|
1787
|
+
warnings: [...validationWarnings, ...hookWarnings],
|
|
1764
1788
|
...(parentSource !== undefined ? { parent_source: parentSource } : {}),
|
|
1765
1789
|
...(nextTransition !== undefined
|
|
1766
1790
|
? { next_transition: nextTransition }
|
|
@@ -1791,4 +1815,4 @@ export const _testOnlyCreateCommand = {
|
|
|
1791
1815
|
typeOptionExampleValue,
|
|
1792
1816
|
};
|
|
1793
1817
|
//# sourceMappingURL=create.js.map
|
|
1794
|
-
//# debugId=
|
|
1818
|
+
//# debugId=dd41d74c-1e7a-5543-bf68-ec1a7f490e0e
|