@unbrained/pm-cli 2026.7.6 → 2026.7.8
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/CHANGELOG.md +50 -0
- package/dist/cli/commands/annotation-command.d.ts +1 -0
- package/dist/cli/commands/annotation-command.js +29 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/comments.js +3 -4
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +10 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/context.d.ts +1 -0
- package/dist/cli/commands/context.js +4 -4
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +3 -0
- package/dist/cli/commands/extension/bundled-catalog.js +38 -28
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +81 -18
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +23 -19
- package/dist/cli/commands/extension.js +167 -57
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/health.js +9 -5
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/learnings.js +5 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/notes.js +5 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +4 -3
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/search.js +4 -4
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +144 -105
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/extension-command-help.js +10 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-content.js +28 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +19 -27
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-operations.d.ts +0 -8
- package/dist/cli/register-operations.js +41 -46
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +119 -13
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +5 -1
- package/dist/cli/registration-helpers.js +14 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/append-CDPAYYSB.js +11 -0
- package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js → append-RSPHC423.js} +8 -9
- package/dist/cli-bundle/chunks/{chunk-LK6XLOGP.js → chunk-2BVD4ZD2.js} +288 -233
- package/dist/cli-bundle/chunks/chunk-2BVD4ZD2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TKD5VCTD.js → chunk-2RADY7IB.js} +517 -195
- package/dist/cli-bundle/chunks/chunk-2RADY7IB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-COSPOP7H.js → chunk-3FRNNVWY.js} +518 -196
- package/dist/cli-bundle/chunks/chunk-3FRNNVWY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-24YG75HI.js → chunk-3FUXM574.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js → chunk-3SHDAKMF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js → chunk-3UXIMY62.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-O6AWCQRQ.js.map → chunk-3UXIMY62.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js → chunk-3V5C7PUH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js → chunk-3YJDIJIE.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ALFPSEWO.js.map → chunk-3YJDIJIE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js → chunk-4I7KS5ES.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js → chunk-4OCWJ2AP.js} +13 -17
- package/dist/cli-bundle/chunks/{chunk-CRVYGJUI.js.map → chunk-4OCWJ2AP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js → chunk-5STY7NVM.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js → chunk-5VAZHYVQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js → chunk-6FU5BVRB.js} +12 -14
- package/dist/cli-bundle/chunks/{chunk-CFB33L7W.js.map → chunk-6FU5BVRB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js → chunk-6RR4XM5H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-K46RF36U.js → chunk-6TD5QGIB.js} +7 -7
- package/dist/cli-bundle/chunks/chunk-6TD5QGIB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js → chunk-6WCXSC5V.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-IX5BXEMX.js.map → chunk-6WCXSC5V.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js → chunk-6ZKDMEVT.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-ZWBEPGD7.js.map → chunk-6ZKDMEVT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js → chunk-7QKSLAHB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js → chunk-7TBUV7XS.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-MVSP7WGJ.js.map → chunk-7TBUV7XS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js → chunk-7UCBLJDF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js → chunk-AEOFBBWO.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-F3K4JGFD.js.map → chunk-AEOFBBWO.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js +10498 -0
- package/dist/cli-bundle/chunks/chunk-ASMRSIDX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js → chunk-BFNFTHWQ.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js +5509 -0
- package/dist/cli-bundle/chunks/chunk-BPJ5NYSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js → chunk-C3YU3TXX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VPIM42PC.js → chunk-C6XSTACC.js} +11 -7
- package/dist/cli-bundle/chunks/chunk-C6XSTACC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js → chunk-CGDUIPJL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js → chunk-CXH7EMSB.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-FT3QTERD.js.map → chunk-CXH7EMSB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DMRNBQOI.js → chunk-D63PEJTB.js} +256 -36
- package/dist/cli-bundle/chunks/chunk-D63PEJTB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js → chunk-D6J5673C.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-RCQZK2GO.js.map → chunk-D6J5673C.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js → chunk-DUBC6TI3.js} +28 -34
- package/dist/cli-bundle/chunks/{chunk-3UJRFJ5R.js.map → chunk-DUBC6TI3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js → chunk-EEJKHF7M.js} +7 -6
- package/dist/cli-bundle/chunks/{chunk-NC33K5ZS.js.map → chunk-EEJKHF7M.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XG625QP4.js → chunk-EP2CKDS7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js → chunk-EYPIUFWJ.js} +24 -32
- package/dist/cli-bundle/chunks/{chunk-NZEHECMW.js.map → chunk-EYPIUFWJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js → chunk-F5DDGY6R.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-45FYNUFJ.js.map → chunk-F5DDGY6R.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js → chunk-FFB3WITE.js} +10 -16
- package/dist/cli-bundle/chunks/{chunk-4ZBE5GUN.js.map → chunk-FFB3WITE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js → chunk-FJR2S7S4.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-7D7OOEYG.js.map → chunk-FJR2S7S4.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-FL625JJM.js +6792 -0
- package/dist/cli-bundle/chunks/chunk-FL625JJM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js → chunk-FOJEBRDD.js} +16 -20
- package/dist/cli-bundle/chunks/{chunk-LPSSSDJR.js.map → chunk-FOJEBRDD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EOKXK3R3.js → chunk-G4FKP4ID.js} +1220 -398
- package/dist/cli-bundle/chunks/chunk-G4FKP4ID.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-GE44TQMC.js +6726 -0
- package/dist/cli-bundle/chunks/chunk-GE44TQMC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js → chunk-GLMJLBLR.js} +6 -10
- package/dist/cli-bundle/chunks/{chunk-XUC7PI2H.js.map → chunk-GLMJLBLR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js → chunk-GO2X6ZRB.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-GANUTS7W.js.map → chunk-GO2X6ZRB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js → chunk-GQOKFX2G.js} +22 -26
- package/dist/cli-bundle/chunks/{chunk-CFNGIXZP.js.map → chunk-GQOKFX2G.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js → chunk-GSQVQINP.js} +8 -10
- package/dist/cli-bundle/chunks/{chunk-XHET7YUZ.js.map → chunk-GSQVQINP.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-HI27UADG.js +5434 -0
- package/dist/cli-bundle/chunks/chunk-HI27UADG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js → chunk-HZZ3AC27.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-I36Y7PCE.js.map → chunk-HZZ3AC27.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js → chunk-IINCZYM3.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-OGWQ2IEP.js.map → chunk-IINCZYM3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EKFNL33R.js → chunk-INOWVPUD.js} +37 -16
- package/dist/cli-bundle/chunks/chunk-INOWVPUD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js → chunk-IYRG5AEC.js} +15 -23
- package/dist/cli-bundle/chunks/{chunk-4LELACOL.js.map → chunk-IYRG5AEC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js → chunk-J6AD3GWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js → chunk-JH5XDDYS.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-D2XRLB55.js.map → chunk-JH5XDDYS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js → chunk-JYVPLGOW.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-HOVCGJSD.js.map → chunk-JYVPLGOW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js → chunk-K52C6YPA.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-MA4SM3QZ.js.map → chunk-K52C6YPA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js → chunk-KFL3XHMA.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js +10320 -0
- package/dist/cli-bundle/chunks/chunk-KMXVZ2P7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js → chunk-LD2NBQ5T.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-4CJFCTLM.js.map → chunk-LD2NBQ5T.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js → chunk-LG4N6YOK.js} +8 -7
- package/dist/cli-bundle/chunks/{chunk-6QBJLYBP.js.map → chunk-LG4N6YOK.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js → chunk-LHDHS4Z6.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-L5PSPMZ4.js.map → chunk-LHDHS4Z6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js → chunk-MCH6IKK7.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-M7JNBQAD.js.map → chunk-MCH6IKK7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-57NWPFF2.js → chunk-MFLLULHU.js} +281 -233
- package/dist/cli-bundle/chunks/chunk-MFLLULHU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EGAP5OWD.js → chunk-ML27MHNM.js} +35 -17
- package/dist/cli-bundle/chunks/chunk-ML27MHNM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js → chunk-MYHFZNBO.js} +20 -24
- package/dist/cli-bundle/chunks/{chunk-3N6RRO2Q.js.map → chunk-MYHFZNBO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js → chunk-NGBWEYNY.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-6LLVNJXT.js.map → chunk-NGBWEYNY.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js → chunk-NRMDT4OV.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-GDDAGPWJ.js.map → chunk-NRMDT4OV.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js +5359 -0
- package/dist/cli-bundle/chunks/chunk-NTOOEVJ4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js → chunk-P2WE5KCU.js} +261 -34
- package/dist/cli-bundle/chunks/{chunk-W6DYWXPQ.js.map → chunk-P2WE5KCU.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js → chunk-PAWPLIWW.js} +14 -20
- package/dist/cli-bundle/chunks/{chunk-YN7Y6DQZ.js.map → chunk-PAWPLIWW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js → chunk-PCBZ2VJD.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ZSUS2OD3.js → chunk-PJPZTE7P.js} +1216 -387
- package/dist/cli-bundle/chunks/chunk-PJPZTE7P.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js → chunk-Q3CFSOQZ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js → chunk-QJZM5WO5.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NO442GWJ.js.map → chunk-QJZM5WO5.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QLMX7SRD.js → chunk-QLEH6FTQ.js} +6 -6
- package/dist/cli-bundle/chunks/chunk-QLEH6FTQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js → chunk-QYZMZD4L.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-GBAX2ZAQ.js.map → chunk-QYZMZD4L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js → chunk-RDJXIAJB.js} +7 -11
- package/dist/cli-bundle/chunks/{chunk-W3DSJQIO.js.map → chunk-RDJXIAJB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js → chunk-RFHLRMLQ.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-7WBAJSS6.js.map → chunk-RFHLRMLQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js → chunk-RL24NAUX.js} +10 -12
- package/dist/cli-bundle/chunks/{chunk-SGMFPXKR.js.map → chunk-RL24NAUX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-46CUF5L6.js → chunk-RLHQ3G4M.js} +99 -51
- package/dist/cli-bundle/chunks/chunk-RLHQ3G4M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js → chunk-SCJPFQQT.js} +12 -18
- package/dist/cli-bundle/chunks/{chunk-UH7T2DAX.js.map → chunk-SCJPFQQT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js → chunk-SIQGG335.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-B6XS3R3O.js.map → chunk-SIQGG335.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js → chunk-SN5X5GTU.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-E42XTBSP.js.map → chunk-SN5X5GTU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-CL36D4PC.js → chunk-TKWTJGD6.js} +36 -15
- package/dist/cli-bundle/chunks/chunk-TKWTJGD6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VIIUS6N6.js → chunk-TR2C6V5T.js} +37 -19
- package/dist/cli-bundle/chunks/chunk-TR2C6V5T.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js +5514 -0
- package/dist/cli-bundle/chunks/chunk-TTCJCKUJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js → chunk-TU5P744I.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TULGS6X6.js → chunk-TUDAYIO7.js} +529 -46
- package/dist/cli-bundle/chunks/chunk-TUDAYIO7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MLIYFOE7.js → chunk-U72GF3I2.js} +12 -8
- package/dist/cli-bundle/chunks/chunk-U72GF3I2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js → chunk-UCRYCT5M.js} +30 -36
- package/dist/cli-bundle/chunks/{chunk-ZZD4J5XY.js.map → chunk-UCRYCT5M.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js → chunk-UEATYUZW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js → chunk-UFNFHCAC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js → chunk-UH6VFRV6.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-NB7RLQFW.js.map → chunk-UH6VFRV6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js → chunk-UIHDZS6X.js} +11 -15
- package/dist/cli-bundle/chunks/{chunk-SQOIV3OQ.js.map → chunk-UIHDZS6X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js → chunk-UURYLDDC.js} +14 -18
- package/dist/cli-bundle/chunks/{chunk-W572BIEB.js.map → chunk-UURYLDDC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js → chunk-UVFJSKTF.js} +9 -13
- package/dist/cli-bundle/chunks/{chunk-G64OCSKU.js.map → chunk-UVFJSKTF.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js → chunk-W2VFNVSJ.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SMB7RV23.js.map → chunk-W2VFNVSJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js → chunk-WVEMZZCR.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-HIHMT6WS.js.map → chunk-WVEMZZCR.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3VHSI5FL.js → chunk-XN5BEN2B.js} +94 -53
- package/dist/cli-bundle/chunks/chunk-XN5BEN2B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SCUR7K7N.js → chunk-XPSGJ4IV.js} +541 -44
- package/dist/cli-bundle/chunks/chunk-XPSGJ4IV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js → chunk-YQEKE4FO.js} +13 -21
- package/dist/cli-bundle/chunks/{chunk-ZJ262CED.js.map → chunk-YQEKE4FO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js → chunk-YR5R4FMQ.js} +26 -34
- package/dist/cli-bundle/chunks/{chunk-EBRZZ54H.js.map → chunk-YR5R4FMQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js → chunk-YSRXFGNV.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-XB7KFVFI.js.map → chunk-YSRXFGNV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js → chunk-YUCKM3MD.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-HFDADVJZ.js.map → chunk-YUCKM3MD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js → chunk-YUMNZS3X.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-SQYJ4HF2.js.map → chunk-YUMNZS3X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js → chunk-Z2JQH2MG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js → chunk-Z6RLSNUX.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-ZGK4L4JM.js.map → chunk-Z6RLSNUX.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js → chunk-ZMOPZFVT.js} +4 -4
- package/dist/cli-bundle/chunks/close-E3RLZSP2.js +12 -0
- package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js → close-K6BFI3OX.js} +5 -9
- package/dist/cli-bundle/chunks/close-many-6NBL3PM4.js +26 -0
- package/dist/cli-bundle/chunks/close-many-X4YKS3RO.js +22 -0
- package/dist/cli-bundle/chunks/comments-PLFK5ZKK.js +17 -0
- package/dist/cli-bundle/chunks/comments-ZNOD5PTV.js +13 -0
- package/dist/cli-bundle/chunks/copy-F7BUFY4J.js +9 -0
- package/dist/cli-bundle/chunks/{copy-32ROBIDL.js → copy-VH3L4MN2.js} +4 -8
- package/dist/cli-bundle/chunks/create-AMBMYP6F.js +25 -0
- package/dist/cli-bundle/chunks/{create-E77SDCUP.js → create-TRIBYORN.js} +9 -14
- package/dist/cli-bundle/chunks/delete-6KQHZYIP.js +10 -0
- package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js → delete-ZNXUNCZR.js} +4 -8
- package/dist/cli-bundle/chunks/deps-CVDY7FFK.js +13 -0
- package/dist/cli-bundle/chunks/{deps-32SU7HO5.js → deps-SZXQHV73.js} +4 -8
- package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js → docs-DR74ITCD.js} +6 -10
- package/dist/cli-bundle/chunks/docs-WCVYY6I7.js +14 -0
- package/dist/cli-bundle/chunks/files-H5YCA74Z.js +18 -0
- package/dist/cli-bundle/chunks/{files-PYKR2UUG.js → files-QEFQ2M3H.js} +6 -10
- package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js → focus-55TRYSNA.js} +7 -9
- package/dist/cli-bundle/chunks/focus-N2QGNS5D.js +10 -0
- package/dist/cli-bundle/chunks/history-compact-GWQ4UOEI.js +21 -0
- package/dist/cli-bundle/chunks/{history-compact-3MNXLKAT.js → history-compact-JJZ4EFL3.js} +9 -13
- package/dist/cli-bundle/chunks/history-redact-4GJOLXCM.js +17 -0
- package/dist/cli-bundle/chunks/{history-redact-P6DYF55G.js → history-redact-TPPUT3A5.js} +7 -11
- package/dist/cli-bundle/chunks/history-repair-HVCVCGUF.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-ZJQFMWPD.js → history-repair-J7PIZ6ZP.js} +9 -13
- package/dist/cli-bundle/chunks/{append-BGML6VLD.js → learnings-KB6BT4NR.js} +9 -11
- package/dist/cli-bundle/chunks/learnings-YYY3U2Y7.js +13 -0
- package/dist/cli-bundle/chunks/notes-BGG7VL72.js +13 -0
- package/dist/cli-bundle/chunks/notes-ZTHXVOKM.js +17 -0
- package/dist/cli-bundle/chunks/{plan-CHVE7PBR.js → plan-CJPKFRBK.js} +10 -15
- package/dist/cli-bundle/chunks/plan-MK2QY3GA.js +24 -0
- package/dist/cli-bundle/chunks/{profile-ZXGSKBJD.js → profile-AQNHXOYA.js} +9 -13
- package/dist/cli-bundle/chunks/{profile-LD23PSI6.js → profile-HTBFINKQ.js} +9 -13
- package/dist/cli-bundle/chunks/{register-list-query-B42JCCOI.js → register-list-query-EEF33SUJ.js} +43 -34
- package/dist/cli-bundle/chunks/register-list-query-EEF33SUJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-OEYQHFXO.js → register-list-query-S4FBWIWN.js} +42 -33
- package/dist/cli-bundle/chunks/register-list-query-S4FBWIWN.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js → register-mutation-L5Q7AUDN.js} +34 -39
- package/dist/cli-bundle/chunks/{register-mutation-3QXIHCQG.js.map → register-mutation-L5Q7AUDN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js → register-mutation-QFLRBCI7.js} +36 -41
- package/dist/cli-bundle/chunks/{register-mutation-IAEST26S.js.map → register-mutation-QFLRBCI7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5BMM6XQY.js → register-operations-HDE4FVW4.js} +79 -46
- package/dist/cli-bundle/chunks/register-operations-HDE4FVW4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z3U3U5KD.js → register-operations-QDU43FCG.js} +78 -45
- package/dist/cli-bundle/chunks/register-operations-QDU43FCG.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-Q6KFNIOZ.js → register-setup-EGMTAXDC.js} +134 -32
- package/dist/cli-bundle/chunks/register-setup-EGMTAXDC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-3ZVVX2VN.js → register-setup-PNIO3L2P.js} +133 -31
- package/dist/cli-bundle/chunks/register-setup-PNIO3L2P.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-5RQHAPMA.js → restore-BTBEZ5CK.js} +7 -11
- package/dist/cli-bundle/chunks/restore-EX4UUZL6.js +15 -0
- package/dist/cli-bundle/chunks/{schema-HBORFC6B.js → schema-DGSTYYQB.js} +6 -10
- package/dist/cli-bundle/chunks/{schema-245WW4G2.js → schema-HAIBEE24.js} +6 -10
- package/dist/cli-bundle/chunks/update-MP4XLU56.js +25 -0
- package/dist/cli-bundle/chunks/update-SDIRJGSY.js +21 -0
- package/dist/cli-bundle/chunks/update-many-34AIU6W7.js +31 -0
- package/dist/cli-bundle/chunks/update-many-JUPCNOKV.js +35 -0
- package/dist/cli-bundle/main.js +56 -32
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +161 -107
- package/dist/cli-bundle/sdk-testing.js +7 -8
- package/dist/cli-bundle/sdk.js +154 -117
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/extensions/extension-types.d.ts +1 -0
- package/dist/core/extensions/extension-types.js +2 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +268 -231
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/drift-scan.js +3 -8
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/output/mutation-projection.js +11 -5
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/search/cache.js +3 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/semantic-defaults.d.ts +2 -0
- package/dist/core/search/semantic-defaults.js +11 -4
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.d.ts +1 -1
- package/dist/core/search/vector-stores.js +33 -7
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +3 -3
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +12 -8
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +10 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +14 -8
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +3 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +282 -8
- package/dist/sdk/runtime.js +453 -14
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/start-task-status.d.ts +13 -0
- package/dist/sdk/start-task-status.js +19 -0
- package/dist/sdk/start-task-status.js.map +1 -0
- package/docs/COMMANDS.md +10 -1
- package/docs/EXTENSIONS.md +7 -20
- package/docs/RELEASING.md +6 -0
- package/docs/SDK.md +65 -0
- package/docs/TESTING.md +3 -0
- package/package.json +2 -1
- package/dist/cli-bundle/chunks/activity-WJCGCYPU.js +0 -18
- package/dist/cli-bundle/chunks/activity-Z6QUAUSG.js +0 -22
- package/dist/cli-bundle/chunks/aggregate-BDM6EIAR.js +0 -25
- package/dist/cli-bundle/chunks/aggregate-VQ2DHU3S.js +0 -21
- package/dist/cli-bundle/chunks/append-RKJYPU74.js +0 -15
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js +0 -218
- package/dist/cli-bundle/chunks/chunk-2XG4IZON.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js +0 -217
- package/dist/cli-bundle/chunks/chunk-37E72CNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js +0 -228
- package/dist/cli-bundle/chunks/chunk-3GCS5SKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js +0 -2330
- package/dist/cli-bundle/chunks/chunk-3KTN6IBA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VHSI5FL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js +0 -278
- package/dist/cli-bundle/chunks/chunk-425E4QL5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-46CUF5L6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +0 -87
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js +0 -249
- package/dist/cli-bundle/chunks/chunk-4HIFVN7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js +0 -819
- package/dist/cli-bundle/chunks/chunk-4IWYTWGF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js +0 -279
- package/dist/cli-bundle/chunks/chunk-4MZVRJOE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-57NWPFF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js +0 -268
- package/dist/cli-bundle/chunks/chunk-5AJXHQM7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5BMM6XQY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js +0 -1868
- package/dist/cli-bundle/chunks/chunk-5GZ7TDD6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js +0 -1749
- package/dist/cli-bundle/chunks/chunk-5VAA4YHR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js +0 -1961
- package/dist/cli-bundle/chunks/chunk-64YKRTSV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js +0 -23
- package/dist/cli-bundle/chunks/chunk-7C2O74AE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js +0 -421
- package/dist/cli-bundle/chunks/chunk-B7FRNMYN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js +0 -1985
- package/dist/cli-bundle/chunks/chunk-C5JBZRPU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CL36D4PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COSPOP7H.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js +0 -3461
- package/dist/cli-bundle/chunks/chunk-COWTDV6B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js +0 -1858
- package/dist/cli-bundle/chunks/chunk-DEWEK6AN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DMRNBQOI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js +0 -1932
- package/dist/cli-bundle/chunks/chunk-E3SZTQ4K.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EGAP5OWD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EKFNL33R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js +0 -1704
- package/dist/cli-bundle/chunks/chunk-ENGQOEUY.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EOKXK3R3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js +0 -231
- package/dist/cli-bundle/chunks/chunk-FLZSGSQR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js +0 -2090
- package/dist/cli-bundle/chunks/chunk-FOUYJE4A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js +0 -1570
- package/dist/cli-bundle/chunks/chunk-G24G7ZAV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js +0 -239
- package/dist/cli-bundle/chunks/chunk-GEYZ4G4O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js +0 -530
- package/dist/cli-bundle/chunks/chunk-GPLPTGOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js +0 -1005
- package/dist/cli-bundle/chunks/chunk-GZRDYONU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js +0 -277
- package/dist/cli-bundle/chunks/chunk-HN6NSXNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js +0 -309
- package/dist/cli-bundle/chunks/chunk-IQNVQHOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js +0 -371
- package/dist/cli-bundle/chunks/chunk-JINYH2DB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js +0 -2257
- package/dist/cli-bundle/chunks/chunk-JQXPY7DN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-K46RF36U.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js +0 -371
- package/dist/cli-bundle/chunks/chunk-KERMZVY5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js +0 -76
- package/dist/cli-bundle/chunks/chunk-KSRUHV2H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LK6XLOGP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js +0 -140
- package/dist/cli-bundle/chunks/chunk-LP3HSFZ2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js +0 -1601
- package/dist/cli-bundle/chunks/chunk-MAWDPCJW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js +0 -1031
- package/dist/cli-bundle/chunks/chunk-MFAZSEM5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js +0 -995
- package/dist/cli-bundle/chunks/chunk-MFSCBT5Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js +0 -296
- package/dist/cli-bundle/chunks/chunk-ML5X7DP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MLIYFOE7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js +0 -2043
- package/dist/cli-bundle/chunks/chunk-MR6FJ7LL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js +0 -2033
- package/dist/cli-bundle/chunks/chunk-MXYA5SAJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js +0 -1604
- package/dist/cli-bundle/chunks/chunk-N745W3B3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js +0 -1615
- package/dist/cli-bundle/chunks/chunk-NMP5I3I5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js +0 -20
- package/dist/cli-bundle/chunks/chunk-NNHHXJB2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js +0 -143
- package/dist/cli-bundle/chunks/chunk-PZUGEOPS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QLMX7SRD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js +0 -398
- package/dist/cli-bundle/chunks/chunk-QX6HM775.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js +0 -220
- package/dist/cli-bundle/chunks/chunk-QZ342C63.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js +0 -368
- package/dist/cli-bundle/chunks/chunk-R2EMWY7Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js +0 -520
- package/dist/cli-bundle/chunks/chunk-RFNYTESG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js +0 -79
- package/dist/cli-bundle/chunks/chunk-RKQOO2UM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js +0 -282
- package/dist/cli-bundle/chunks/chunk-RQLT6ZWB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js +0 -274
- package/dist/cli-bundle/chunks/chunk-S3JS6YVZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SCUR7K7N.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js +0 -1977
- package/dist/cli-bundle/chunks/chunk-SHQY2IDC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js +0 -1041
- package/dist/cli-bundle/chunks/chunk-SPZ6DOGY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js +0 -822
- package/dist/cli-bundle/chunks/chunk-T42JWV3F.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TKD5VCTD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TULGS6X6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js +0 -2306
- package/dist/cli-bundle/chunks/chunk-TZXRBVAM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VIIUS6N6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VPIM42PC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js +0 -368
- package/dist/cli-bundle/chunks/chunk-VQRSPVME.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +0 -84
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js +0 -3423
- package/dist/cli-bundle/chunks/chunk-WG34ZNQQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js +0 -2247
- package/dist/cli-bundle/chunks/chunk-WLSM645P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js +0 -215
- package/dist/cli-bundle/chunks/chunk-WRTENIX3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js +0 -388
- package/dist/cli-bundle/chunks/chunk-WSBLYDWV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js +0 -306
- package/dist/cli-bundle/chunks/chunk-XC5BURG2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js +0 -424
- package/dist/cli-bundle/chunks/chunk-XDB7RWQT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js +0 -2128
- package/dist/cli-bundle/chunks/chunk-Y6BK55A3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Z3U3U5KD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js +0 -299
- package/dist/cli-bundle/chunks/chunk-ZO3XKAOP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZSUS2OD3.js.map +0 -7
- package/dist/cli-bundle/chunks/claim-RFS7BROJ.js +0 -19
- package/dist/cli-bundle/chunks/claim-XP5AWZ5H.js +0 -23
- package/dist/cli-bundle/chunks/close-GEANHQ2J.js +0 -16
- package/dist/cli-bundle/chunks/close-many-CMZW7ITN.js +0 -31
- package/dist/cli-bundle/chunks/close-many-ZFDIG6M7.js +0 -27
- package/dist/cli-bundle/chunks/comments-MFSYVNNU.js +0 -21
- package/dist/cli-bundle/chunks/comments-XUBPXDYX.js +0 -17
- package/dist/cli-bundle/chunks/config-D7XQMONX.js +0 -18
- package/dist/cli-bundle/chunks/config-T4FHBSYN.js +0 -22
- package/dist/cli-bundle/chunks/context-DIU275XI.js +0 -48
- package/dist/cli-bundle/chunks/context-JCOYB4LZ.js +0 -44
- package/dist/cli-bundle/chunks/contracts-BVO7CSLK.js +0 -12
- package/dist/cli-bundle/chunks/copy-NAGLGMHZ.js +0 -13
- package/dist/cli-bundle/chunks/create-4V7SWNBB.js +0 -30
- package/dist/cli-bundle/chunks/delete-NQI5OSKN.js +0 -14
- package/dist/cli-bundle/chunks/deps-T7SCWXEX.js +0 -17
- package/dist/cli-bundle/chunks/docs-WL2IWGWV.js +0 -18
- package/dist/cli-bundle/chunks/eval-NF2J5SHR.js +0 -23
- package/dist/cli-bundle/chunks/eval-SKDT3MZU.js +0 -27
- package/dist/cli-bundle/chunks/extension-LAXKCAYE.js +0 -42
- package/dist/cli-bundle/chunks/extension-ZISPBRBC.js +0 -38
- package/dist/cli-bundle/chunks/files-EWRQHGIS.js +0 -22
- package/dist/cli-bundle/chunks/focus-4T7TM4MT.js +0 -18
- package/dist/cli-bundle/chunks/focus-L3YUASOD.js +0 -14
- package/dist/cli-bundle/chunks/gc-2PCTYYRI.js +0 -12
- package/dist/cli-bundle/chunks/get-7DMITJ3G.js +0 -23
- package/dist/cli-bundle/chunks/get-VKQXCXLL.js +0 -19
- package/dist/cli-bundle/chunks/health-CVSTAR2F.js +0 -31
- package/dist/cli-bundle/chunks/health-TV3GKTFN.js +0 -35
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js +0 -20
- package/dist/cli-bundle/chunks/history-D4JUX5XV.js.map +0 -7
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js +0 -24
- package/dist/cli-bundle/chunks/history-LQ2UWZTE.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-3MNXLKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js +0 -25
- package/dist/cli-bundle/chunks/history-compact-QWEO32FP.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js +0 -21
- package/dist/cli-bundle/chunks/history-redact-3OIVBVIY.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-P6DYF55G.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js +0 -23
- package/dist/cli-bundle/chunks/history-repair-I3E73UGQ.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-ZJQFMWPD.js.map +0 -1
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js +0 -30
- package/dist/cli-bundle/chunks/init-C3LJPWQZ.js.map +0 -1
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js +0 -26
- package/dist/cli-bundle/chunks/init-J3DPGWQI.js.map +0 -7
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js +0 -21
- package/dist/cli-bundle/chunks/learnings-5BO2SNDW.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js +0 -17
- package/dist/cli-bundle/chunks/learnings-OGP4JB4I.js.map +0 -7
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js +0 -36
- package/dist/cli-bundle/chunks/list-O5NZVSPN.js.map +0 -1
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js +0 -32
- package/dist/cli-bundle/chunks/list-Z55YCNTC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js +0 -28
- package/dist/cli-bundle/chunks/next-GBNTGXFC.js.map +0 -7
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js +0 -32
- package/dist/cli-bundle/chunks/next-QKW7PTKE.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js +0 -17
- package/dist/cli-bundle/chunks/notes-R5FZTKWF.js.map +0 -7
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js +0 -21
- package/dist/cli-bundle/chunks/notes-WCGIULVG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js +0 -29
- package/dist/cli-bundle/chunks/plan-ADISFYH4.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-CHVE7PBR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-LD23PSI6.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-ZXGSKBJD.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-B42JCCOI.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-OEYQHFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js +0 -19
- package/dist/cli-bundle/chunks/register-operations-I3M3U7DS.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js +0 -23
- package/dist/cli-bundle/chunks/register-operations-UHKENLZV.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-3ZVVX2VN.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-Q6KFNIOZ.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-5RQHAPMA.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js +0 -19
- package/dist/cli-bundle/chunks/restore-PNEIBBLW.js.map +0 -7
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js +0 -29
- package/dist/cli-bundle/chunks/scheduling-shortcuts-4G56YHVQ.js.map +0 -1
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js +0 -25
- package/dist/cli-bundle/chunks/scheduling-shortcuts-75DULBYP.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-245WW4G2.js.map +0 -1
- package/dist/cli-bundle/chunks/schema-HBORFC6B.js.map +0 -7
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js +0 -34
- package/dist/cli-bundle/chunks/search-AOZC5SIK.js.map +0 -7
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js +0 -38
- package/dist/cli-bundle/chunks/search-DRXPGHD7.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js +0 -21
- package/dist/cli-bundle/chunks/stats-NJG4NLHG.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js +0 -17
- package/dist/cli-bundle/chunks/stats-RG6AG4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js +0 -14
- package/dist/cli-bundle/chunks/telemetry-HQC2JJIF.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js +0 -18
- package/dist/cli-bundle/chunks/telemetry-MPNL3HHY.js.map +0 -1
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js +0 -39
- package/dist/cli-bundle/chunks/test-6CMOCWUC.js.map +0 -7
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js +0 -43
- package/dist/cli-bundle/chunks/test-RI7XHBZL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js +0 -29
- package/dist/cli-bundle/chunks/test-all-7R7YRZIA.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js +0 -33
- package/dist/cli-bundle/chunks/test-all-QEIORFYW.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js +0 -28
- package/dist/cli-bundle/chunks/test-runs-5Y2BOU2S.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js +0 -24
- package/dist/cli-bundle/chunks/test-runs-PVGC3GRZ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js +0 -30
- package/dist/cli-bundle/chunks/update-QVJDFEAP.js.map +0 -1
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js +0 -26
- package/dist/cli-bundle/chunks/update-VQVHAY6X.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js +0 -37
- package/dist/cli-bundle/chunks/update-many-S7XWBSB3.js.map +0 -7
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js +0 -41
- package/dist/cli-bundle/chunks/update-many-YIYW6XQ6.js.map +0 -1
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js +0 -24
- package/dist/cli-bundle/chunks/upgrade-OPRXA56R.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js +0 -28
- package/dist/cli-bundle/chunks/upgrade-WH4BTQLX.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js +0 -36
- package/dist/cli-bundle/chunks/validate-4NTXSB62.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js +0 -32
- package/dist/cli-bundle/chunks/validate-MUFXQZMI.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-WJCGCYPU.js.map → append-CDPAYYSB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-Z6QUAUSG.js.map → append-RSPHC423.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-24YG75HI.js.map → chunk-3FUXM574.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IWVU4C2F.js.map → chunk-3SHDAKMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MUH7A3FD.js.map → chunk-3V5C7PUH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EGY6JBQ3.js.map → chunk-4I7KS5ES.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ7QC5DJ.js.map → chunk-5STY7NVM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJP45OEI.js.map → chunk-5VAZHYVQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-22KBU3MW.js.map → chunk-6RR4XM5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KUOOJR35.js.map → chunk-7QKSLAHB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NGXQ3PFT.js.map → chunk-7UCBLJDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7DT4WSH2.js.map → chunk-BFNFTHWQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y46GD4IX.js.map → chunk-C3YU3TXX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AZYGZGGI.js.map → chunk-CGDUIPJL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XG625QP4.js.map → chunk-EP2CKDS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MVYWGY2A.js.map → chunk-J6AD3GWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5BMJX33.js.map → chunk-KFL3XHMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MWMVPCIE.js.map → chunk-PCBZ2VJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6DUFX6H.js.map → chunk-Q3CFSOQZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KGFUY7WN.js.map → chunk-TU5P744I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JDDLOQAE.js.map → chunk-UEATYUZW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVH7QBVV.js.map → chunk-UFNFHCAC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AGHMOTGM.js.map → chunk-Z2JQH2MG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y4M7CPQP.js.map → chunk-ZMOPZFVT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-VQ2DHU3S.js.map → close-E3RLZSP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-BDM6EIAR.js.map → close-K6BFI3OX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-BGML6VLD.js.map → close-many-6NBL3PM4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-RKJYPU74.js.map → close-many-X4YKS3RO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-XP5AWZ5H.js.map → comments-PLFK5ZKK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-RFS7BROJ.js.map → comments-ZNOD5PTV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GEANHQ2J.js.map → copy-F7BUFY4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-2SSSHHUZ.js.map → copy-VH3L4MN2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZFDIG6M7.js.map → create-AMBMYP6F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-CMZW7ITN.js.map → create-TRIBYORN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-XUBPXDYX.js.map → delete-6KQHZYIP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MFSYVNNU.js.map → delete-ZNXUNCZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-D7XQMONX.js.map → deps-CVDY7FFK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-T4FHBSYN.js.map → deps-SZXQHV73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-DIU275XI.js.map → docs-DR74ITCD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-JCOYB4LZ.js.map → docs-WCVYY6I7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-BVO7CSLK.js.map → files-H5YCA74Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{contracts-NYPEW2G4.js.map → files-QEFQ2M3H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-32ROBIDL.js.map → focus-55TRYSNA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NAGLGMHZ.js.map → focus-N2QGNS5D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4V7SWNBB.js.map → history-compact-GWQ4UOEI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-E77SDCUP.js.map → history-compact-JJZ4EFL3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-NQI5OSKN.js.map → history-redact-4GJOLXCM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-RA5KTCLB.js.map → history-redact-TPPUT3A5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-T7SCWXEX.js.map → history-repair-HVCVCGUF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-32SU7HO5.js.map → history-repair-J7PIZ6ZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RRUPT7O2.js.map → learnings-KB6BT4NR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-WL2IWGWV.js.map → learnings-YYY3U2Y7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-NF2J5SHR.js.map → notes-BGG7VL72.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-SKDT3MZU.js.map → notes-ZTHXVOKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-LAXKCAYE.js.map → plan-CJPKFRBK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-ZISPBRBC.js.map → plan-MK2QY3GA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-PYKR2UUG.js.map → profile-AQNHXOYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EWRQHGIS.js.map → profile-HTBFINKQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-4T7TM4MT.js.map → restore-BTBEZ5CK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-L3YUASOD.js.map → restore-EX4UUZL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2PCTYYRI.js.map → schema-DGSTYYQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2DNMPXMC.js.map → schema-HAIBEE24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-7DMITJ3G.js.map → update-MP4XLU56.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-VKQXCXLL.js.map → update-SDIRJGSY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-CVSTAR2F.js.map → update-many-34AIU6W7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-TV3GKTFN.js.map → update-many-JUPCNOKV.js.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
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]="
|
|
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]="0d5e890c-ab35-52a4-91c0-dc6af493e7be")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
parseAnnotationTextInput,
|
|
5
5
|
runAnnotationCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-INOWVPUD.js";
|
|
7
7
|
import {
|
|
8
8
|
createStdinTokenResolver
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3SHDAKMF.js";
|
|
10
10
|
|
|
11
11
|
// dist/cli/commands/notes.js
|
|
12
12
|
async function runNotes(id, options, global) {
|
|
@@ -14,7 +14,7 @@ async function runNotes(id, options, global) {
|
|
|
14
14
|
const addInput = options.add === void 0 ? void 0 : await stdinResolver.resolveValue(options.add, "--add");
|
|
15
15
|
return runAnnotationCommand(id, options, global, {
|
|
16
16
|
// addInput is defined whenever options.add is defined (see resolveValue), so the cast is safe.
|
|
17
|
-
input: options.add === void 0 ? { mode: "list" } : { mode: "add", value: addInput, emptyFlag: "--add" },
|
|
17
|
+
input: options.add === void 0 ? { mode: "list" } : { mode: "add", value: addInput, rawValue: options.add, emptyFlag: "--add" },
|
|
18
18
|
collectionKey: "notes",
|
|
19
19
|
op: "note_add",
|
|
20
20
|
parseText: (raw) => parseAnnotationTextInput(raw),
|
|
@@ -33,6 +33,6 @@ async function runNotes(id, options, global) {
|
|
|
33
33
|
export {
|
|
34
34
|
runNotes
|
|
35
35
|
};
|
|
36
|
-
//# sourceMappingURL=chunk-
|
|
36
|
+
//# sourceMappingURL=chunk-HZZ3AC27.js.map
|
|
37
37
|
|
|
38
|
-
//# debugId=
|
|
38
|
+
//# debugId=0d5e890c-ab35-52a4-91c0-dc6af493e7be
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/notes.ts"],"sourcesContent":["/**\n * @module cli/commands/notes\n *\n * Implements the pm notes command surface and its agent-facing runtime behavior.\n */\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { LogNote } from \"../../types/index.js\";\nimport { parseAnnotationTextInput, runAnnotationCommand } from \"./annotation-command.js\";\n\n/**\n * Documents the notes command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface NotesCommandOptions {\n add?: string;\n limit?: string;\n author?: string;\n message?: string;\n allowAuditNote?: boolean;\n allowAuditComment?: boolean;\n force?: boolean;\n}\n\n/**\n * Documents the notes result payload exchanged by command, SDK, and package integrations.\n */\nexport interface NotesResult {\n id: string;\n notes: LogNote[];\n count: number;\n}\n\n/**\n * Implements run notes for the public runtime surface of this module.\n */\nexport async function runNotes(id: string, options: NotesCommandOptions, global: GlobalOptions): Promise<NotesResult> {\n const stdinResolver = createStdinTokenResolver();\n const addInput = options.add === undefined ? undefined : await stdinResolver.resolveValue(options.add, \"--add\");\n\n return runAnnotationCommand<\"notes\", LogNote>(id, options, global, {\n // addInput is defined whenever options.add is defined (see resolveValue), so the cast is safe.\n input: options.add === undefined
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/notes.ts"],"sourcesContent":["/**\n * @module cli/commands/notes\n *\n * Implements the pm notes command surface and its agent-facing runtime behavior.\n */\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport type { LogNote } from \"../../types/index.js\";\nimport { parseAnnotationTextInput, runAnnotationCommand } from \"./annotation-command.js\";\n\n/**\n * Documents the notes command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface NotesCommandOptions {\n add?: string;\n limit?: string;\n author?: string;\n message?: string;\n allowAuditNote?: boolean;\n allowAuditComment?: boolean;\n force?: boolean;\n}\n\n/**\n * Documents the notes result payload exchanged by command, SDK, and package integrations.\n */\nexport interface NotesResult {\n id: string;\n notes: LogNote[];\n count: number;\n}\n\n/**\n * Implements run notes for the public runtime surface of this module.\n */\nexport async function runNotes(id: string, options: NotesCommandOptions, global: GlobalOptions): Promise<NotesResult> {\n const stdinResolver = createStdinTokenResolver();\n const addInput = options.add === undefined ? undefined : await stdinResolver.resolveValue(options.add, \"--add\");\n\n return runAnnotationCommand<\"notes\", LogNote>(id, options, global, {\n // addInput is defined whenever options.add is defined (see resolveValue), so the cast is safe.\n input: options.add === undefined\n ? { mode: \"list\" }\n : { mode: \"add\", value: addInput as string, rawValue: options.add, emptyFlag: \"--add\" },\n collectionKey: \"notes\",\n op: \"note_add\",\n parseText: (raw) => parseAnnotationTextInput(raw),\n allowAuditBypass: Boolean(options.allowAuditNote || options.allowAuditComment),\n conflictGuidance: {\n required:\n \"For append-only note audits on another owner's item, prefer --allow-audit-note (legacy alias: --allow-audit-comment) before considering --force.\",\n examples: ['pm notes pm-a1b2 --add \"audit note\" --author \"reviewer\" --allow-audit-note'],\n nextSteps: [\n \"Retry with --allow-audit-note (or legacy --allow-audit-comment) for append-only note audits that do not mutate item metadata beyond notes.\",\n \"Use --force only when an ownership override is explicitly approved.\",\n ],\n },\n });\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAmCA,eAAsB,SAAS,IAAY,SAA8B,QAAqB;AAC5F,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAAuC,IAAI,SAAS,QAAQ;;IAEjE,OAAO,QAAQ,QAAQ,SACnB,EAAE,MAAM,OAAM,IACd,EAAE,MAAM,OAAO,OAAO,UAAoB,UAAU,QAAQ,KAAK,WAAW,QAAO;IACvF,eAAe;IACf,IAAI;IACJ,WAAW,CAAC,QAAQ,yBAAyB,GAAG;IAChD,kBAAkB,QAAQ,QAAQ,kBAAkB,QAAQ,iBAAiB;IAC7E,kBAAkB;MAChB,UACE;MACF,UAAU,CAAC,4EAA4E;MACvF,WAAW;QACT;QACA;;;GAGL;AACH","debugId":"0d5e890c-ab35-52a4-91c0-dc6af493e7be"}
|
|
@@ -1,20 +1,16 @@
|
|
|
1
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]="
|
|
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]="37c78950-fdd3-5a0c-b304-41409da0a899")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
|
+
canonicalDocument,
|
|
4
5
|
hashDocument,
|
|
5
|
-
toItemRecord
|
|
6
|
-
} from "./chunk-ENGQOEUY.js";
|
|
7
|
-
import {
|
|
8
|
-
canonicalDocument
|
|
9
|
-
} from "./chunk-G24G7ZAV.js";
|
|
10
|
-
import {
|
|
11
6
|
orderObject,
|
|
12
7
|
sha256Hex,
|
|
13
|
-
stableStringify
|
|
14
|
-
|
|
8
|
+
stableStringify,
|
|
9
|
+
toItemRecord
|
|
10
|
+
} from "./chunk-NTOOEVJ4.js";
|
|
15
11
|
import {
|
|
16
12
|
FRONT_MATTER_KEY_ORDER
|
|
17
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-MFLLULHU.js";
|
|
18
14
|
|
|
19
15
|
// dist/core/history/replay.js
|
|
20
16
|
import jsonPatch from "fast-json-patch";
|
|
@@ -235,6 +231,6 @@ export {
|
|
|
235
231
|
reanchorHistoryEntries,
|
|
236
232
|
historyEntriesToRaw
|
|
237
233
|
};
|
|
238
|
-
//# sourceMappingURL=chunk-
|
|
234
|
+
//# sourceMappingURL=chunk-IINCZYM3.js.map
|
|
239
235
|
|
|
240
|
-
//# debugId=
|
|
236
|
+
//# debugId=37c78950-fdd3-5a0c-b304-41409da0a899
|
|
@@ -1 +1 @@
|
|
|
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 { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { canonicalDocument } from \"../item/item-format.js\";\nimport { toItemRecord } from \"../item/item-record.js\";\nimport { orderObject, sha256Hex, stableStringify } from \"../shared/serialization.js\";\nimport { hashDocument } from \"./history.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument, ItemMetadata } 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 metadata: Record<string, unknown>;\n body: string;\n}\n\nexport const EMPTY_REPLAY_DOCUMENT: ReplayDocument = {\n metadata: {},\n body: \"\",\n};\n\n/**\n * Implements clone empty replay document for the public runtime surface of this module.\n */\nexport function cloneEmptyReplayDocument(): ReplayDocument {\n return structuredClone(EMPTY_REPLAY_DOCUMENT);\n}\n\n/**\n * Implements replay hash for the public runtime surface of this module.\n */\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(stableStringify({ replay_fallback: true, metadata: document.metadata, body: document.body }));\n }\n}\n\n/**\n * Implements replay to item document for the public runtime surface of this module.\n */\nexport function replayToItemDocument(document: ReplayDocument): ItemDocument {\n return {\n metadata: document.metadata as ItemMetadata,\n body: document.body,\n };\n}\n\n/**\n * Converts a materialized replay document into a canonical item document. Use\n * this when callers have already rejected the empty/deleted replay state and\n * need restored metadata validated through the normal front-matter rules.\n */\nexport function replayToCanonicalItemDocument(\n document: ReplayDocument,\n options: Parameters<typeof canonicalDocument>[1] = {},\n): ItemDocument {\n return canonicalDocument(replayToItemDocument(document), options);\n}\n\n/**\n * Canonicalize an item document into the ordered replay form used when comparing\n * a replayed chain against the on-disk item (restore + history-repair reconciliation).\n */\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(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER),\n body: canonical.body,\n };\n}\n\n/**\n * Implements normalize replay patch path for the public runtime surface of this module.\n */\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/**\n * Implements normalize replay patch ops for the public runtime surface of this module.\n */\nexport function normalizeReplayPatchOps(patch: HistoryPatchOp[] | unknown): 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: typeof operation.from === \"string\" ? normalizeReplayPatchPath(operation.from) : undefined,\n }));\n}\n\nfunction isReplayDocumentShape(value: unknown): 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/**\n * Restricts replay apply result values accepted by command, SDK, and storage contracts.\n */\nexport type ReplayApplyResult =\n | { ok: true; document: ReplayDocument }\n | { ok: false; error: unknown };\n\n/**\n * Strictly apply a history patch (front_matter->metadata normalized) to a replay\n * document. Returns a result envelope rather than throwing so each caller can\n * format its own error contract.\n */\nexport function tryApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): 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 { ok: false, error: new Error(\"history_replay_invalid_document_shape\") };\n }\n return { ok: true, document: { metadata: applied.metadata, body: applied.body } };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Deterministically verify a history chain: each entry's before_hash must equal\n * the prior replayed after_hash, the patch must strictly apply, and the recorded\n * after_hash must equal the replayed result.\n */\nexport function verifyHistoryChain(entries: HistoryEntry[]): { ok: boolean; errors: string[] } {\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/**\n * Documents the lenient apply result payload exchanged by command, SDK, and package integrations.\n */\nexport interface LenientApplyResult {\n document: ReplayDocument;\n convertedReplaceToAdd: number;\n skippedOps: number;\n}\n\nfunction tryApplySingleOp(document: unknown, op: HistoryPatchOp): { 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/**\n * Apply a legacy patch op-by-op, recovering from drift that strict replay rejects:\n * a `replace` whose path no longer exists is retried as `add`, and any op that\n * still cannot apply against the current replay state is skipped. The resulting\n * document is what the repaired entry's recomputed patch should target.\n */\nexport function lenientApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): 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/**\n * Documents the reanchor entry detail payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReanchorEntryDetail {\n index: number;\n rehashed: boolean;\n patch_repaired: boolean;\n converted_replace_to_add: number;\n skipped_ops: number;\n}\n\n/**\n * Documents the reanchor result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReanchorResult {\n entries: HistoryEntry[];\n finalDocument: ReplayDocument;\n entriesRehashed: number;\n entriesPatchRepaired: number;\n convertedReplaceToAdd: number;\n skippedOps: number;\n details: ReanchorEntryDetail[];\n}\n\n/**\n * Re-anchor a drifted history chain: replay every entry from empty, recompute the\n * before/after hashes, and only rewrite a patch when the original op set no longer\n * strictly applies (legacy drift). Clean entries keep their patch verbatim so the\n * on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain.\n */\nexport function reanchorHistoryEntries(entries: HistoryEntry[]): 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 = 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/**\n * Implements history entries to raw for the public runtime surface of this module.\n */\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":";;;;;;;;;;;;;;;;;;;AAKA,OAAO,eAAe;AAsBf,IAAM,wB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MAAM;AACpC,UAAM,SAAS,oBAAoB,QAAQ,MAAM,KAAK;AAEtD,QAAI;AACJ,QAAI;AACJ,QAAI,gBAAgB;AACpB,QAAI,iBAAiB;AACrB,QAAI,eAAe;AAEnB,QAAI,OAAO,IAAI;AACb,aAAO,OAAO;AACd,iBAAW,MAAM;IACnB,OAAO;AACL,YAAM,UAAU,wBAAwB,QAAQ,MAAM,KAAK;AAC3D,aAAO,QAAQ;AACf,iBAAW,UAAU,QAAQ,QAAQ,IAAI;AACzC,sBAAgB;AAChB,uBAAiB,QAAQ;AACzB,qBAAe,QAAQ;AACvB,+BAAyB;AACzB,oBAAc;AACd,8BAAwB;IAC1B;AAEA,UAAM,YAAY,WAAW,IAAI;AACjC,UAAM,WAAW,eAAe,MAAM,eAAe,cAAc,MAAM;AACzE,QAAI,UAAU;AACZ,yBAAmB;IACrB;AAEA,cAAU,KAAK;MACb,GAAG;MACH,OAAO;MACP,aAAa;MACb,YAAY;KACb;AACD,YAAQ,KAAK;MACX,OAAO,QAAQ;MACf;MACA,gBAAgB;MAChB,0BAA0B;MAC1B,aAAa;KACd;AACD,aAAS;EACX;AAEA,SAAO;IACL,SAAS;IACT,eAAe;IACf;IACA;IACA;IACA;IACA;;AAEJ;AAKM,SAAU,oBAAoB,SAAuB;AACzD,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO;EACT;AACA,SAAO,GAAG,QAAQ,IAAI,CAAC,UAAU,KAAK,UAAU,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC;;AACpE","debugId":"60ce5760-cb2c-5450-b92b-48275942b6ad"}
|
|
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 { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { canonicalDocument } from \"../item/item-format.js\";\nimport { toItemRecord } from \"../item/item-record.js\";\nimport { orderObject, sha256Hex, stableStringify } from \"../shared/serialization.js\";\nimport { hashDocument } from \"./history.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument, ItemMetadata } 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 metadata: Record<string, unknown>;\n body: string;\n}\n\nexport const EMPTY_REPLAY_DOCUMENT: ReplayDocument = {\n metadata: {},\n body: \"\",\n};\n\n/**\n * Implements clone empty replay document for the public runtime surface of this module.\n */\nexport function cloneEmptyReplayDocument(): ReplayDocument {\n return structuredClone(EMPTY_REPLAY_DOCUMENT);\n}\n\n/**\n * Implements replay hash for the public runtime surface of this module.\n */\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(stableStringify({ replay_fallback: true, metadata: document.metadata, body: document.body }));\n }\n}\n\n/**\n * Implements replay to item document for the public runtime surface of this module.\n */\nexport function replayToItemDocument(document: ReplayDocument): ItemDocument {\n return {\n metadata: document.metadata as ItemMetadata,\n body: document.body,\n };\n}\n\n/**\n * Converts a materialized replay document into a canonical item document. Use\n * this when callers have already rejected the empty/deleted replay state and\n * need restored metadata validated through the normal front-matter rules.\n */\nexport function replayToCanonicalItemDocument(\n document: ReplayDocument,\n options: Parameters<typeof canonicalDocument>[1] = {},\n): ItemDocument {\n return canonicalDocument(replayToItemDocument(document), options);\n}\n\n/**\n * Canonicalize an item document into the ordered replay form used when comparing\n * a replayed chain against the on-disk item (restore + history-repair reconciliation).\n */\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(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER),\n body: canonical.body,\n };\n}\n\n/**\n * Implements normalize replay patch path for the public runtime surface of this module.\n */\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/**\n * Implements normalize replay patch ops for the public runtime surface of this module.\n */\nexport function normalizeReplayPatchOps(patch: HistoryPatchOp[] | unknown): 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: typeof operation.from === \"string\" ? normalizeReplayPatchPath(operation.from) : undefined,\n }));\n}\n\nfunction isReplayDocumentShape(value: unknown): 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/**\n * Restricts replay apply result values accepted by command, SDK, and storage contracts.\n */\nexport type ReplayApplyResult =\n | { ok: true; document: ReplayDocument }\n | { ok: false; error: unknown };\n\n/**\n * Strictly apply a history patch (front_matter->metadata normalized) to a replay\n * document. Returns a result envelope rather than throwing so each caller can\n * format its own error contract.\n */\nexport function tryApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): 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 { ok: false, error: new Error(\"history_replay_invalid_document_shape\") };\n }\n return { ok: true, document: { metadata: applied.metadata, body: applied.body } };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Deterministically verify a history chain: each entry's before_hash must equal\n * the prior replayed after_hash, the patch must strictly apply, and the recorded\n * after_hash must equal the replayed result.\n */\nexport function verifyHistoryChain(entries: HistoryEntry[]): { ok: boolean; errors: string[] } {\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/**\n * Documents the lenient apply result payload exchanged by command, SDK, and package integrations.\n */\nexport interface LenientApplyResult {\n document: ReplayDocument;\n convertedReplaceToAdd: number;\n skippedOps: number;\n}\n\nfunction tryApplySingleOp(document: unknown, op: HistoryPatchOp): { 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/**\n * Apply a legacy patch op-by-op, recovering from drift that strict replay rejects:\n * a `replace` whose path no longer exists is retried as `add`, and any op that\n * still cannot apply against the current replay state is skipped. The resulting\n * document is what the repaired entry's recomputed patch should target.\n */\nexport function lenientApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): 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/**\n * Documents the reanchor entry detail payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReanchorEntryDetail {\n index: number;\n rehashed: boolean;\n patch_repaired: boolean;\n converted_replace_to_add: number;\n skipped_ops: number;\n}\n\n/**\n * Documents the reanchor result payload exchanged by command, SDK, and package integrations.\n */\nexport interface ReanchorResult {\n entries: HistoryEntry[];\n finalDocument: ReplayDocument;\n entriesRehashed: number;\n entriesPatchRepaired: number;\n convertedReplaceToAdd: number;\n skippedOps: number;\n details: ReanchorEntryDetail[];\n}\n\n/**\n * Re-anchor a drifted history chain: replay every entry from empty, recompute the\n * before/after hashes, and only rewrite a patch when the original op set no longer\n * strictly applies (legacy drift). Clean entries keep their patch verbatim so the\n * on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain.\n */\nexport function reanchorHistoryEntries(entries: HistoryEntry[]): 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 = 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/**\n * Implements history entries to raw for the public runtime surface of this module.\n */\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":";;;;;;;;;;;;;;;AAKA,OAAO,eAAe;AAsBf,IAAM,wBAAwC;EACnD,UAAU,CAAA;EACV,MAAM;;AAMF,SAAU,2BAAwB;AACtC,SAAO,gBAAgB,qBAAqB;AAC9C;AAKM,SAAU,WAAW,UAAwB;AACjD,M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AAI,eAAe;AAEnB,QAAI,OAAO,IAAI;AACb,aAAO,OAAO;AACd,iBAAW,MAAM;IACnB,OAAO;AACL,YAAM,UAAU,wBAAwB,QAAQ,MAAM,KAAK;AAC3D,aAAO,QAAQ;AACf,iBAAW,UAAU,QAAQ,QAAQ,IAAI;AACzC,sBAAgB;AAChB,uBAAiB,QAAQ;AACzB,qBAAe,QAAQ;AACvB,+BAAyB;AACzB,oBAAc;AACd,8BAAwB;IAC1B;AAEA,UAAM,YAAY,WAAW,IAAI;AACjC,UAAM,WAAW,eAAe,MAAM,eAAe,cAAc,MAAM;AACzE,QAAI,UAAU;AACZ,yBAAmB;IACrB;AAEA,cAAU,KAAK;MACb,GAAG;MACH,OAAO;MACP,aAAa;MACb,YAAY;KACb;AACD,YAAQ,KAAK;MACX,OAAO,QAAQ;MACf;MACA,gBAAgB;MAChB,0BAA0B;MAC1B,aAAa;KACd;AACD,aAAS;EACX;AAEA,SAAO;IACL,SAAS;IACT,eAAe;IACf;IACA;IACA;IACA;IACA;;AAEJ;AAKM,SAAU,oBAAoB,SAAuB;AACzD,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO;EACT;AACA,SAAO,GAAG,QAAQ,IAAI,CAAC,UAAU,KAAK,UAAU,KAAK,CAAC,EAAE,KAAK,IAAI,CAAC;;AACpE","debugId":"37c78950-fdd3-5a0c-b304-41409da0a899"}
|
|
@@ -1,34 +1,30 @@
|
|
|
1
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]="
|
|
3
|
-
import {
|
|
4
|
-
parseCsvKv
|
|
5
|
-
} from "./chunk-IWVU4C2F.js";
|
|
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]="696488c2-34f1-5097-a1c0-d97b38ae7d0a")}catch(e){}}();
|
|
6
3
|
import {
|
|
7
4
|
resolveAuthor
|
|
8
5
|
} from "./chunk-T5RRNDA7.js";
|
|
9
6
|
import {
|
|
10
7
|
parseLimit
|
|
11
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6RR4XM5H.js";
|
|
12
9
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
readLocatedItem
|
|
16
|
-
} from "./chunk-ENGQOEUY.js";
|
|
17
|
-
import {
|
|
18
|
-
nowIso
|
|
19
|
-
} from "./chunk-3GCS5SKL.js";
|
|
10
|
+
parseCsvKv
|
|
11
|
+
} from "./chunk-3SHDAKMF.js";
|
|
20
12
|
import {
|
|
21
13
|
PmCliError,
|
|
22
14
|
getActiveExtensionRegistrations,
|
|
15
|
+
locateItem,
|
|
16
|
+
mutateItem,
|
|
17
|
+
nowIso,
|
|
18
|
+
readLocatedItem,
|
|
23
19
|
readSettings
|
|
24
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NTOOEVJ4.js";
|
|
25
21
|
import {
|
|
26
22
|
EXIT_CODE,
|
|
27
23
|
getSettingsPath,
|
|
28
24
|
pathExists,
|
|
29
25
|
resolveItemTypeRegistry,
|
|
30
26
|
resolvePmRoot
|
|
31
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-MFLLULHU.js";
|
|
32
28
|
|
|
33
29
|
// dist/cli/commands/annotation-command.js
|
|
34
30
|
function limitAnnotationEntries(values, limit) {
|
|
@@ -79,6 +75,29 @@ function wrapOwnershipConflict(error, guidance) {
|
|
|
79
75
|
}
|
|
80
76
|
throw error;
|
|
81
77
|
}
|
|
78
|
+
function annotationStdinHint(collectionKey) {
|
|
79
|
+
return collectionKey === "comments" ? "--stdin" : "--add -";
|
|
80
|
+
}
|
|
81
|
+
function assertAnnotationAddValueIsNotFlagLike(raw, config) {
|
|
82
|
+
const emptyFlag = config.input.emptyFlag ?? "--add";
|
|
83
|
+
if (emptyFlag !== "--add") {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const trimmed = raw.trim();
|
|
87
|
+
if (!/^-{1,2}[A-Za-z][\w-]*(?:=.*)?$/.test(trimmed)) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
const stdinHint = annotationStdinHint(config.collectionKey);
|
|
91
|
+
const commandPrefix = config.input.mode === "edit" ? `pm ${config.collectionKey} <id> --edit <index>` : `pm ${config.collectionKey} <id>`;
|
|
92
|
+
throw new PmCliError(`--add value "${trimmed}" looks like an option, not annotation text. Use ${stdinHint} to read stdin, or use text=${trimmed} for literal dash-leading text.`, EXIT_CODE.USAGE, {
|
|
93
|
+
code: "annotation_flag_like_value",
|
|
94
|
+
required: `Use ${stdinHint} for stdin input, pass plain text, or use text=${trimmed} when the text really starts with "-".`,
|
|
95
|
+
examples: [
|
|
96
|
+
`${commandPrefix} ${stdinHint}`,
|
|
97
|
+
`${commandPrefix} --add text=${trimmed}`
|
|
98
|
+
]
|
|
99
|
+
});
|
|
100
|
+
}
|
|
82
101
|
async function runAnnotationCommand(id, options, global, config) {
|
|
83
102
|
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
84
103
|
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
@@ -124,6 +143,8 @@ async function runAnnotationCommand(id, options, global, config) {
|
|
|
124
143
|
const allEntries2 = readAnnotationEntries(result2.item, config.collectionKey);
|
|
125
144
|
return renderAnnotationResult(result2.item.id, config.collectionKey, allEntries2, limit, options.includeMeta === true);
|
|
126
145
|
}
|
|
146
|
+
const rawText = config.input.rawValue ?? config.input.value ?? "";
|
|
147
|
+
assertAnnotationAddValueIsNotFlagLike(rawText, config);
|
|
127
148
|
const text = config.parseText(config.input.value ?? "");
|
|
128
149
|
if (!text.trim()) {
|
|
129
150
|
throw new PmCliError(`${config.input.emptyFlag ?? "--add"} text cannot be empty`, EXIT_CODE.USAGE);
|
|
@@ -217,6 +238,6 @@ export {
|
|
|
217
238
|
wrapOwnershipConflict,
|
|
218
239
|
runAnnotationCommand
|
|
219
240
|
};
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
241
|
+
//# sourceMappingURL=chunk-INOWVPUD.js.map
|
|
221
242
|
|
|
222
|
-
//# debugId=
|
|
243
|
+
//# debugId=696488c2-34f1-5097-a1c0-d97b38ae7d0a
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/annotation-command.ts"],"sourcesContent":["/**\n * @module cli/commands/annotation-command\n *\n * Implements the pm annotation command command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { parseCsvKv } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { locateItem, mutateItem, readLocatedItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { parseLimit } from \"../shared-parsers.js\";\n\ninterface AnnotationEntry {\n created_at: string;\n author: string;\n text: string;\n edited_at?: string;\n}\n\ninterface AnnotationCommandOptions {\n limit?: string;\n author?: string;\n message?: string;\n force?: boolean;\n includeMeta?: boolean;\n}\n\ninterface AnnotationInput {\n mode: \"list\" | \"add\" | \"stdin\" | \"file\" | \"edit\" | \"delete\";\n value?: string;\n rawValue?: string;\n emptyFlag?: string;\n index?: number;\n}\n\ninterface OwnershipConflictGuidance {\n required: string;\n examples: string[];\n nextSteps: string[];\n}\n\ninterface AnnotationCommandConfig<TKey extends string> {\n input: AnnotationInput;\n collectionKey: TKey;\n op: Parameters<typeof mutateItem>[0][\"op\"];\n editOp?: Parameters<typeof mutateItem>[0][\"op\"];\n deleteOp?: Parameters<typeof mutateItem>[0][\"op\"];\n parseText: (raw: string) => string;\n allowAuditBypass: boolean;\n conflictGuidance: OwnershipConflictGuidance;\n}\n\ntype AnnotationCommandResult<TKey extends string, TEntry extends AnnotationEntry> = {\n id: string;\n count: number;\n} & Record<TKey, TEntry[]> & {\n total_count?: number;\n returned_count?: number;\n has_more?: boolean;\n limit?: number;\n };\n\n/**\n * Implements limit annotation entries for the public runtime surface of this module.\n */\nexport function limitAnnotationEntries<TEntry>(values: TEntry[], limit: number | undefined): TEntry[] {\n if (limit === undefined) return values;\n if (limit === 0) return [];\n return values.slice(Math.max(0, values.length - limit));\n}\n\n/**\n * Implements read annotation entries for the public runtime surface of this module.\n */\nexport function readAnnotationEntries<TEntry>(source: Record<string, unknown>, collectionKey: string): TEntry[] {\n const value = source[collectionKey];\n return Array.isArray(value) ? (value as TEntry[]) : [];\n}\n\n/**\n * Implements parse annotation text input for the public runtime surface of this module.\n */\nexport function parseAnnotationTextInput(raw: string, options: { stripPlainTextPrefix?: boolean } = {}): string {\n const trimmed = raw.trim();\n if (!trimmed) {\n return \"\";\n }\n const textPrefixMatch = /^(?:[-*+]\\s*)?text\\s*[:=]/i.exec(trimmed);\n if (options.stripPlainTextPrefix === true && textPrefixMatch && !trimmed.startsWith(\"```\")) {\n const text = trimmed.slice(textPrefixMatch[0].length).trim();\n return text || trimmed;\n }\n const looksStructured = /^(?:[-*+]\\s*)?text\\s*[:=]/im.test(trimmed) || trimmed.startsWith(\"```\");\n if (!looksStructured) {\n return trimmed;\n }\n try {\n const kv = parseCsvKv(trimmed, \"--add\");\n const keys = Object.keys(kv).map((key) => key.trim().toLowerCase());\n if (keys.some((key) => key !== \"text\")) {\n return trimmed;\n }\n const text = kv.text?.trim();\n return text || trimmed;\n } catch {\n return trimmed;\n }\n}\n\n/**\n * Implements wrap ownership conflict for the public runtime surface of this module.\n */\nexport function wrapOwnershipConflict(error: unknown, guidance: OwnershipConflictGuidance): never {\n if (\n error instanceof PmCliError &&\n error.exitCode === EXIT_CODE.CONFLICT &&\n error.message.includes(\"is assigned to\") &&\n error.message.includes(\"Use --force to override\")\n ) {\n throw new PmCliError(error.message, error.exitCode, {\n code: \"ownership_conflict\",\n required: guidance.required,\n examples: guidance.examples,\n nextSteps: guidance.nextSteps,\n });\n }\n throw error;\n}\n\nfunction annotationStdinHint(collectionKey: string): string {\n return collectionKey === \"comments\" ? \"--stdin\" : \"--add -\";\n}\n\nfunction assertAnnotationAddValueIsNotFlagLike(raw: string, config: AnnotationCommandConfig<string>): void {\n const emptyFlag = config.input.emptyFlag ?? \"--add\";\n if (emptyFlag !== \"--add\") {\n return;\n }\n const trimmed = raw.trim();\n if (!/^-{1,2}[A-Za-z][\\w-]*(?:=.*)?$/.test(trimmed)) {\n return;\n }\n const stdinHint = annotationStdinHint(config.collectionKey);\n const commandPrefix =\n config.input.mode === \"edit\"\n ? `pm ${config.collectionKey} <id> --edit <index>`\n : `pm ${config.collectionKey} <id>`;\n throw new PmCliError(\n `--add value \"${trimmed}\" looks like an option, not annotation text. Use ${stdinHint} to read stdin, or use text=${trimmed} for literal dash-leading text.`,\n EXIT_CODE.USAGE,\n {\n code: \"annotation_flag_like_value\",\n required: `Use ${stdinHint} for stdin input, pass plain text, or use text=${trimmed} when the text really starts with \"-\".`,\n examples: [\n `${commandPrefix} ${stdinHint}`,\n `${commandPrefix} --add text=${trimmed}`,\n ],\n },\n );\n}\n\n/**\n * Implements run annotation command for the public runtime surface of this module.\n */\nexport async function runAnnotationCommand<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n options: AnnotationCommandOptions,\n global: GlobalOptions,\n config: AnnotationCommandConfig<TKey>,\n): Promise<AnnotationCommandResult<TKey, TEntry>> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const limit = parseLimit(options.limit);\n\n if (config.input.mode === \"list\") {\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n const loaded = await readLocatedItem(located, { schema: settings.schema });\n const allEntries = readAnnotationEntries<TEntry>(loaded.document.metadata, config.collectionKey);\n return renderAnnotationResult(located.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n\n if (config.input.mode === \"delete\") {\n const op = config.deleteOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n entries.splice(arrayIndex, 1);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n const rawText = config.input.rawValue ?? config.input.value ?? \"\";\n assertAnnotationAddValueIsNotFlagLike(rawText, config);\n const text = config.parseText(config.input.value ?? \"\");\n if (!text.trim()) {\n throw new PmCliError(`${config.input.emptyFlag ?? \"--add\"} text cannot be empty`, EXIT_CODE.USAGE);\n }\n\n if (config.input.mode === \"edit\") {\n const op = config.editOp ?? config.op;\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n const arrayIndex = resolveAnnotationIndex(config.input.index, entries.length, config.collectionKey);\n const existing = entries[arrayIndex];\n entries[arrayIndex] = {\n ...existing,\n text,\n edited_at: nowIso(),\n } as TEntry;\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n }\n\n let result: Awaited<ReturnType<typeof mutateItem>>;\n try {\n result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: config.op,\n author,\n message: options.message,\n force: options.force,\n bypassAssigneeConflict: config.allowAuditBypass,\n mutate(document) {\n const entries = readAnnotationEntries<TEntry>(document.metadata, config.collectionKey);\n entries.push({\n created_at: nowIso(),\n author,\n text,\n } as TEntry);\n document.metadata[config.collectionKey] = entries as never;\n return { changedFields: [config.collectionKey] };\n },\n });\n } catch (error: unknown) {\n wrapOwnershipConflict(error, config.conflictGuidance);\n }\n\n const allEntries = readAnnotationEntries<TEntry>(result.item, config.collectionKey);\n return renderAnnotationResult(result.item.id, config.collectionKey, allEntries, limit, options.includeMeta === true);\n}\n\n/**\n * Implements resolve annotation index for the public runtime surface of this module.\n */\nexport function resolveAnnotationIndex(\n oneBasedIndex: number | undefined,\n count: number,\n collectionKey: string,\n): number {\n if (oneBasedIndex === undefined || !Number.isInteger(oneBasedIndex) || oneBasedIndex < 1 || oneBasedIndex > count) {\n const singular = collectionKey.replace(/s$/, \"\");\n const label = `${singular.charAt(0).toUpperCase()}${singular.slice(1)}`;\n const noun = count === 1 ? `1 ${singular}` : `${count} ${collectionKey}`;\n throw new PmCliError(\n `${label} index ${oneBasedIndex ?? \"(missing)\"} out of range (item has ${noun})`,\n EXIT_CODE.USAGE,\n );\n }\n return oneBasedIndex - 1;\n}\n\nfunction renderAnnotationResult<TKey extends string, TEntry extends AnnotationEntry>(\n id: string,\n collectionKey: TKey,\n allEntries: TEntry[],\n limit: number | undefined,\n includeMeta: boolean,\n): AnnotationCommandResult<TKey, TEntry> {\n const entries = limitAnnotationEntries(allEntries, limit);\n return {\n id,\n [collectionKey]: entries,\n count: entries.length,\n ...(includeMeta\n ? {\n total_count: allEntries.length,\n returned_count: entries.length,\n has_more: entries.length < allEntries.length,\n ...(limit !== undefined ? { limit } : {}),\n }\n : {}),\n } as AnnotationCommandResult<TKey, TEntry>;\n}\n"],"names":["allEntries","result"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEM,SAAU,uBAA+B,QAAkB,OAAyB;AACxF,MAAI,UAAU;AAAW,WAAO;AAChC,MAAI,UAAU;AAAG,WAAO,CAAA;AACxB,SAAO,OAAO,MAAM,KAAK,IAAI,GAAG,OAAO,SAAS,KAAK,CAAC;AACxD;AAKM,SAAU,sBAA8B,QAAiC,eAAqB;AAClG,QAAM,QAAQ,OAAO,aAAa;AAClC,SAAO,MAAM,QAAQ,KAAK,IAAK,QAAqB,CAAA;AACtD;AAKM,SAAU,yBAAyB,KAAa,UAA8C,CAAA,GAAE;AACpG,QAAM,UAAU,IAAI,KAAI;AACxB,MAAI,CAAC,SAAS;AACZ,WAAO;EACT;AACA,QAAM,kBAAkB,6BAA6B,KAAK,OAAO;AACjE,MAAI,QAAQ,yBAAyB,QAAQ,mBAAmB,CAAC,QAAQ,WAAW,KAAK,GAAG;AAC1F,UAAM,OAAO,QAAQ,MAAM,gBAAgB,CAAC,EAAE,MAAM,EAAE,KAAI;AAC1D,WAAO,QAAQ;EACjB;AACA,QAAM,kBAAkB,8BAA8B,KAAK,OAAO,KAAK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;MACE,aAAa,WAAW;MACxB,gBAAgB,QAAQ;MACxB,UAAU,QAAQ,SAAS,WAAW;MACtC,GAAI,UAAU,SAAY,EAAE,MAAK,IAAK,CAAA;QAExC,CAAA;;AAER","debugId":"696488c2-34f1-5097-a1c0-d97b38ae7d0a"}
|
|
@@ -1,40 +1,32 @@
|
|
|
1
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]="
|
|
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]="0a9c0e97-1d91-55f1-830c-2822eb0a32bb")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
createCheckpointId,
|
|
5
5
|
loadMutationCheckpoint,
|
|
6
6
|
restoreCheckpointItems,
|
|
7
7
|
writeMutationCheckpoint
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
runClose
|
|
11
|
-
} from "./chunk-G64OCSKU.js";
|
|
8
|
+
} from "./chunk-W2VFNVSJ.js";
|
|
12
9
|
import {
|
|
13
10
|
runRestore
|
|
14
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-PAWPLIWW.js";
|
|
12
|
+
import {
|
|
13
|
+
runClose
|
|
14
|
+
} from "./chunk-UVFJSKTF.js";
|
|
15
15
|
import {
|
|
16
16
|
resolveAuthor
|
|
17
17
|
} from "./chunk-T5RRNDA7.js";
|
|
18
18
|
import {
|
|
19
|
-
hasListFilters
|
|
20
|
-
} from "./chunk-VY3VQ22F.js";
|
|
21
|
-
import {
|
|
19
|
+
hasListFilters,
|
|
22
20
|
runList
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
listAllFrontMatterLight
|
|
26
|
-
} from "./chunk-ENGQOEUY.js";
|
|
27
|
-
import {
|
|
28
|
-
isTerminalStatus
|
|
29
|
-
} from "./chunk-G24G7ZAV.js";
|
|
30
|
-
import {
|
|
31
|
-
nowIso
|
|
32
|
-
} from "./chunk-3GCS5SKL.js";
|
|
21
|
+
} from "./chunk-XN5BEN2B.js";
|
|
33
22
|
import {
|
|
34
23
|
PmCliError,
|
|
35
24
|
getActiveExtensionRegistrations,
|
|
25
|
+
isTerminalStatus,
|
|
26
|
+
listAllFrontMatterLight,
|
|
27
|
+
nowIso,
|
|
36
28
|
readSettings
|
|
37
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-NTOOEVJ4.js";
|
|
38
30
|
import {
|
|
39
31
|
EXIT_CODE,
|
|
40
32
|
getSettingsPath,
|
|
@@ -43,7 +35,7 @@ import {
|
|
|
43
35
|
resolvePmRoot,
|
|
44
36
|
resolveRuntimeStatusRegistry,
|
|
45
37
|
toErrorMessage
|
|
46
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MFLLULHU.js";
|
|
47
39
|
|
|
48
40
|
// dist/cli/commands/close-many.js
|
|
49
41
|
var CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;
|
|
@@ -386,6 +378,6 @@ export {
|
|
|
386
378
|
runCloseMany,
|
|
387
379
|
_testOnly
|
|
388
380
|
};
|
|
389
|
-
//# sourceMappingURL=chunk-
|
|
381
|
+
//# sourceMappingURL=chunk-IYRG5AEC.js.map
|
|
390
382
|
|
|
391
|
-
//# debugId=
|
|
383
|
+
//# debugId=0a9c0e97-1d91-55f1-830c-2822eb0a32bb
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/close-many.ts"],"sourcesContent":["/**\n * @module cli/commands/close-many\n *\n * Implements the pm close many command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n createCheckpointId,\n loadMutationCheckpoint,\n restoreCheckpointItems,\n writeMutationCheckpoint,\n type MutationCheckpointItem,\n} from \"../../core/checkpoint/mutation-checkpoint.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toErrorMessage } from \"../../core/shared/primitives.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { runClose, type CloseCommandOptions } from \"./close.js\";\nimport { hasListFilters } from \"./list-filter-shared.js\";\nimport { runList, type ListOptions, type ListedItem } from \"./list.js\";\nimport { runRestore } from \"./restore.js\";\n\nconst CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;\nconst CLOSE_MANY_CHECKPOINT_SUBDIR = \"close-many\";\n\nconst CLOSE_MANY_FILTER_GUIDANCE = [\n \"--filter-status\",\n \"--filter-type\",\n \"--filter-tag\",\n \"--filter-priority\",\n \"--filter-sprint\",\n \"--filter-release\",\n \"--filter-parent\",\n \"--filter-assignee\",\n \"--filter-updated-before\",\n \"--ids\",\n].join(\", \");\n\n/**\n * Documents the close many command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseManyCommandOptions {\n status?: string;\n list?: ListOptions;\n reason?: string;\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n validateClose?: string;\n author?: string;\n message?: string;\n force?: boolean;\n dryRun?: boolean;\n rollback?: string;\n checkpoint?: boolean;\n}\n\ninterface CloseManyPlanRow {\n id: string;\n title: string;\n status: string;\n action: \"close\" | \"skip\";\n skip_reason?: string;\n active_child_ids?: string[];\n}\n\ninterface CloseManyApplyRow {\n id: string;\n status: \"closed\" | \"skipped\" | \"failed\";\n skip_reason?: string;\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\ninterface CloseManyPlanContext {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>;\n reason: string | undefined;\n validateCloseMode: string | undefined;\n force: boolean;\n listed: Awaited<ReturnType<typeof runList>>;\n matched: ListedItem[];\n planRows: CloseManyPlanRow[];\n}\n\n/**\n * Documents the close many result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseManyResult {\n mode: \"dry_run\" | \"apply\" | \"rollback\";\n matched_count: number;\n dry_run: boolean;\n reason?: string;\n filters?: Record<string, unknown>;\n validate_close?: string;\n item_plans?: CloseManyPlanRow[];\n checkpoint?: {\n id: string;\n created_at: string;\n path: string;\n rollback_command: string;\n };\n closed_count?: number;\n skipped_count?: number;\n failed_count?: number;\n restored_count?: number;\n rollback_checkpoint_id?: string;\n rows?: CloseManyApplyRow[] | Array<{ id: string; status: \"restored\" | \"failed\"; changed_fields?: string[]; warnings?: string[]; error?: string }>;\n ids: string[];\n}\n\nfunction hasCloseManyFilters(list: ListOptions | undefined, status: string | undefined): boolean {\n return hasListFilters(list, status, { includePagination: false });\n}\n\nfunction hasCloseManyRollbackConflicts(list: ListOptions | undefined, status: string | undefined): boolean {\n return hasListFilters(list, status);\n}\n\nfunction rejectBlankIdsFilter(list: ListOptions | undefined): void {\n if (list?.ids != null && String(list.ids).trim().length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n}\n\nfunction activeListOptions(list: ListOptions | undefined): ListOptions {\n const active: ListOptions = {};\n if (!list) {\n return active;\n }\n for (const [key, value] of Object.entries(list) as Array<[keyof ListOptions, unknown]>) {\n if (value == null || (typeof value === \"string\" && !value.split(\",\").some((entry) => entry.trim().length > 0))) {\n continue;\n }\n (active as Record<string, unknown>)[key] = value;\n }\n return active;\n}\n\nfunction resolveReason(reason: unknown, required: boolean): string | undefined {\n const trimmed = String(reason ?? \"\").trim();\n if (trimmed.length > 0) {\n return trimmed;\n }\n if (required) {\n throw new PmCliError(\n \"pm close-many requires a shared close reason via --reason because governance.require_close_reason is enabled.\",\n EXIT_CODE.USAGE,\n {\n code: \"close_reason_required\",\n required: \"Provide a shared closing summary via --reason for the whole batch.\",\n why: \"governance.require_close_reason is enabled, so every close must record why the items are done.\",\n examples: [\n 'pm close-many --filter-sprint S-12 --reason \"Sprint S-12 acceptance criteria met\"',\n 'pm close-many --ids pm-a,pm-b --reason \"Superseded by redesign\"',\n ],\n nextSteps: [\n \"Re-run with --reason describing the shared outcome.\",\n \"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled\",\n ],\n },\n );\n }\n return undefined;\n}\n\n// Build a parent -> non-terminal child id map in a single light scan so each\n// matched parent can be annotated with the active children that closing it\n// would orphan (the same signal runClose surfaces per item on apply).\nasync function buildActiveChildrenByParent(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n): Promise<{ childrenByParent: Map<string, string[]>; parentByChild: Map<string, string> }> {\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const childrenByParent = new Map<string, string[]>();\n const parentByChild = new Map<string, string>();\n for (const item of items) {\n if (typeof item.parent !== \"string\" || item.parent.length === 0) {\n continue;\n }\n parentByChild.set(item.id, item.parent);\n if (isTerminalStatus(item.status, statusRegistry)) {\n continue;\n }\n const existing = childrenByParent.get(item.parent);\n if (existing) {\n existing.push(item.id);\n } else {\n childrenByParent.set(item.parent, [item.id]);\n }\n }\n for (const ids of childrenByParent.values()) {\n ids.sort((left, right) => left.localeCompare(right));\n }\n return { childrenByParent, parentByChild };\n}\n\nfunction hierarchyDepth(id: string, parentByChild: Map<string, string>, cache?: Map<string, number>): number {\n const cached = cache?.get(id);\n if (cached !== undefined) {\n return cached;\n }\n let depth = 0;\n let current = parentByChild.get(id);\n const path: string[] = [];\n const visited = new Set<string>();\n let hasCycle = false;\n while (current !== undefined && !visited.has(current)) {\n const cachedCurrent = cache?.get(current);\n if (cachedCurrent !== undefined) {\n depth += cachedCurrent + 1;\n break;\n }\n visited.add(current);\n path.push(current);\n depth += 1;\n current = parentByChild.get(current);\n }\n if (current !== undefined && visited.has(current)) {\n hasCycle = true;\n }\n if (!hasCycle) {\n cache?.set(id, depth);\n for (const [index, ancestorId] of path.entries()) {\n cache?.set(ancestorId, depth - index - 1);\n }\n }\n return depth;\n}\n\nasync function runCloseManyRollback(params: {\n pmRoot: string;\n rollbackId: string;\n options: CloseManyCommandOptions;\n global: GlobalOptions;\n}): Promise<CloseManyResult> {\n const checkpoint = await loadMutationCheckpoint(\n params.pmRoot,\n CLOSE_MANY_CHECKPOINT_SUBDIR,\n params.rollbackId,\n CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION,\n );\n const restoreMessage = params.options.message ?? `Rollback close-many checkpoint ${checkpoint.id}`;\n const rollback = await restoreCheckpointItems(checkpoint.items, (id, targetUpdatedAt) =>\n runRestore(id, targetUpdatedAt, { author: params.options.author, message: restoreMessage, force: true }, params.global),\n );\n return {\n mode: \"rollback\",\n matched_count: checkpoint.items.length,\n dry_run: false,\n rollback_checkpoint_id: checkpoint.id,\n checkpoint: {\n id: checkpoint.id,\n created_at: checkpoint.created_at,\n path: checkpoint.path,\n rollback_command: `pm close-many --rollback ${checkpoint.id}`,\n },\n restored_count: rollback.restored_ids.length,\n failed_count: rollback.failed_count,\n rows: rollback.rows,\n ids: rollback.restored_ids,\n };\n}\n\nfunction planCloseManyRows(\n matched: ListedItem[],\n childrenByParent: Map<string, string[]>,\n closePlannedIds: Set<string>,\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>,\n force: boolean,\n): CloseManyPlanRow[] {\n return matched.map((item) => {\n const activeChildIds = (childrenByParent.get(item.id) ?? []).filter((childId) => !closePlannedIds.has(childId));\n const willSkip = !canCloseManyItem(item, statusRegistry, force);\n return {\n id: item.id,\n title: typeof item.title === \"string\" ? item.title : \"\",\n status: item.status,\n action: willSkip ? \"skip\" : \"close\",\n ...(willSkip ? { skip_reason: \"already_terminal\" } : {}),\n ...(activeChildIds.length > 0 ? { active_child_ids: activeChildIds } : {}),\n };\n });\n}\n\nasync function writeCloseManyCheckpoint(params: {\n pmRoot: string;\n checkpointId: string;\n nowValue: string;\n options: CloseManyCommandOptions;\n reason: string | undefined;\n filters: Record<string, unknown>;\n checkpointItems: MutationCheckpointItem[];\n}): Promise<CloseManyResult[\"checkpoint\"]> {\n const checkpointPath = await writeMutationCheckpoint(params.pmRoot, CLOSE_MANY_CHECKPOINT_SUBDIR, params.checkpointId, {\n schema_version: CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION,\n id: params.checkpointId,\n created_at: params.nowValue,\n author: resolveAuthor(params.options.author, \"unknown\"),\n ...(params.reason !== undefined ? { reason: params.reason } : {}),\n filters: params.filters,\n items: params.checkpointItems,\n });\n return {\n id: params.checkpointId,\n created_at: params.nowValue,\n path: checkpointPath,\n rollback_command: `pm close-many --rollback ${params.checkpointId}`,\n };\n}\n\nasync function applyCloseManyRows(params: {\n matched: ListedItem[];\n closableIds: Set<string>;\n reason: string | undefined;\n closeOptions: CloseCommandOptions;\n global: GlobalOptions;\n}): Promise<{ rows: CloseManyApplyRow[]; closedIds: string[] }> {\n const rows: CloseManyApplyRow[] = [];\n const closedIds: string[] = [];\n for (const item of params.matched) {\n if (!params.closableIds.has(item.id)) {\n rows.push({ id: item.id, status: \"skipped\", skip_reason: \"already_terminal\" });\n continue;\n }\n try {\n const result = await runClose(item.id, params.reason, params.closeOptions, params.global);\n rows.push({\n id: item.id,\n status: \"closed\",\n changed_fields: result.changed_fields,\n ...(result.warnings && result.warnings.length > 0 ? { warnings: result.warnings } : {}),\n });\n closedIds.push(item.id);\n } catch (error: unknown) {\n rows.push({ id: item.id, status: \"failed\", error: toErrorMessage(error) });\n }\n }\n return { rows, closedIds };\n}\n\nfunction resolveCloseManyRollbackId(options: CloseManyCommandOptions): string | undefined {\n return typeof options.rollback === \"string\" ? options.rollback : undefined;\n}\n\nfunction validateCloseManyRollbackOptions(options: CloseManyCommandOptions, rollbackId: string): void {\n if (rollbackId.trim().length === 0) {\n throw new PmCliError(\"--rollback requires a checkpoint id\", EXIT_CODE.USAGE);\n }\n if (options.dryRun === true) {\n throw new PmCliError(\"--dry-run cannot be combined with --rollback\", EXIT_CODE.USAGE);\n }\n if (hasCloseManyRollbackConflicts(options.list, options.status)) {\n throw new PmCliError(\"Rollback mode does not accept filter options\", EXIT_CODE.USAGE);\n }\n}\n\nfunction assertCloseManyHasFilters(options: CloseManyCommandOptions): void {\n if (hasCloseManyFilters(options.list, options.status)) {\n return;\n }\n throw new PmCliError(\n `close-many requires at least one filter to scope the close (for example: ${CLOSE_MANY_FILTER_GUIDANCE}). Refusing to match every item.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction sortCloseManyMatchedItems(matched: ListedItem[], parentByChild: Map<string, string>): ListedItem[] {\n const depthCache = new Map<string, number>();\n return [...matched].sort((left, right) => {\n const depthDelta = hierarchyDepth(right.id, parentByChild, depthCache) - hierarchyDepth(left.id, parentByChild, depthCache);\n return depthDelta !== 0 ? depthDelta : left.id.localeCompare(right.id);\n });\n}\n\nfunction canCloseManyItem(\n item: ListedItem,\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>,\n force: boolean,\n): boolean {\n return force || !isTerminalStatus(item.status, statusRegistry);\n}\n\nfunction resolveCloseManyPlannedIds(\n matched: ListedItem[],\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>,\n force: boolean,\n): Set<string> {\n return new Set(matched.filter((item) => canCloseManyItem(item, statusRegistry, force)).map((item) => item.id));\n}\n\nasync function buildCloseManyPlanContext(params: {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n options: CloseManyCommandOptions;\n global: GlobalOptions;\n}): Promise<CloseManyPlanContext> {\n assertCloseManyHasFilters(params.options);\n const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);\n const reason = resolveReason(params.options.reason, params.settings.governance.require_close_reason);\n const force = params.options.force === true;\n const listed = await runList(params.options.status, activeListOptions(params.options.list), params.global);\n const { childrenByParent, parentByChild } = await buildActiveChildrenByParent(params.pmRoot, params.settings);\n const matched = sortCloseManyMatchedItems(listed.items as ListedItem[], parentByChild);\n const closePlannedIds = resolveCloseManyPlannedIds(matched, statusRegistry, force);\n return {\n pmRoot: params.pmRoot,\n settings: params.settings,\n statusRegistry,\n reason,\n validateCloseMode: params.options.validateClose,\n force,\n listed,\n matched,\n planRows: planCloseManyRows(matched, childrenByParent, closePlannedIds, statusRegistry, force),\n };\n}\n\nfunction buildCloseManyDryRunResult(context: CloseManyPlanContext): CloseManyResult {\n return {\n mode: \"dry_run\",\n matched_count: context.matched.length,\n dry_run: true,\n ...(context.reason !== undefined ? { reason: context.reason } : {}),\n filters: context.listed.filters,\n ...(context.validateCloseMode ? { validate_close: context.validateCloseMode } : {}),\n item_plans: context.planRows,\n ids: [],\n };\n}\n\nasync function resolveCloseManyCheckpointInfo(params: {\n context: CloseManyPlanContext;\n options: CloseManyCommandOptions;\n closableIds: Set<string>;\n checkpointId: string;\n nowValue: string;\n}): Promise<CloseManyResult[\"checkpoint\"]> {\n if (params.options.checkpoint === false || params.closableIds.size === 0) {\n return undefined;\n }\n const checkpointItems: MutationCheckpointItem[] = params.context.matched\n .filter((item) => params.closableIds.has(item.id))\n .map((item) => ({ id: item.id, target_updated_at: item.updated_at }));\n return writeCloseManyCheckpoint({\n pmRoot: params.context.pmRoot,\n checkpointId: params.checkpointId,\n nowValue: params.nowValue,\n options: params.options,\n reason: params.context.reason,\n filters: params.context.listed.filters,\n checkpointItems,\n });\n}\n\n/**\n * Implements run close many for the public runtime surface of this module.\n */\nexport async function runCloseMany(options: CloseManyCommandOptions, global: GlobalOptions): Promise<CloseManyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n\n const dryRun = options.dryRun === true;\n const rollbackId = resolveCloseManyRollbackId(options);\n rejectBlankIdsFilter(options.list);\n\n if (rollbackId !== undefined) {\n validateCloseManyRollbackOptions(options, rollbackId);\n return runCloseManyRollback({ pmRoot, rollbackId, options, global });\n }\n\n const context = await buildCloseManyPlanContext({ pmRoot, settings, options, global });\n\n if (dryRun) {\n return buildCloseManyDryRunResult(context);\n }\n\n const closableIds = new Set(context.planRows.filter((row) => row.action === \"close\").map((row) => row.id));\n const nowValue = nowIso();\n const checkpointId = createCheckpointId(CLOSE_MANY_CHECKPOINT_SUBDIR, nowValue);\n const checkpointInfo = await resolveCloseManyCheckpointInfo({ context, options, closableIds, checkpointId, nowValue });\n\n const closeOptions: CloseCommandOptions = {\n author: options.author,\n message: options.message ?? `close-many apply ${checkpointId}`,\n validateClose: context.validateCloseMode,\n force: context.force,\n resolution: options.resolution,\n expectedResult: options.expectedResult,\n actualResult: options.actualResult,\n };\n\n const { rows, closedIds } = await applyCloseManyRows({\n matched: context.matched,\n closableIds,\n reason: context.reason,\n closeOptions,\n global,\n });\n\n return {\n mode: \"apply\",\n matched_count: context.matched.length,\n dry_run: false,\n ...(context.reason !== undefined ? { reason: context.reason } : {}),\n filters: context.listed.filters,\n ...(context.validateCloseMode ? { validate_close: context.validateCloseMode } : {}),\n ...(checkpointInfo ? { checkpoint: checkpointInfo } : {}),\n closed_count: rows.filter((row) => row.status === \"closed\").length,\n skipped_count: rows.filter((row) => row.status === \"skipped\").length,\n failed_count: rows.filter((row) => row.status === \"failed\").length,\n rows,\n ids: closedIds,\n };\n}\n\nexport const _testOnly = {\n activeListOptions,\n buildActiveChildrenByParent,\n hasCloseManyFilters,\n hasCloseManyRollbackConflicts,\n hierarchyDepth,\n rejectBlankIdsFilter,\n resolveReason,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,uCAAuC;AAC7C,IAAM,+BAA+B;AAErC,IAAM,6BAA6B;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KAAK,IAAI;AA6EX,SAAS,oBAAoB,MAA+B,QAA0B;AACpF,SAAO,eAAe,MAAM,QAAQ,EAAE,mBAAmB,MAAK,CAAE;AAClE;AAEA,SAAS,8BAA8B,MAA+B,QAA0B;AAC9F,SAAO,eAAe,MAAM,MAAM;AACpC;AAEA,SAAS,qBAAqB,MAA6B;AACzD,MAAI,MAAM,OAAO,QAAQ,OAAO,KAAK,GAAG,EAAE,KAAI,EAAG,WAAW,GAAG;AAC7D,UAAM,IAAI,WAAW,iDAAiD,UAAU,KAAK;EACvF;AACF;AAEA,SAAS,kBAAkB,MAA6B;AACtD,QAAM,SAAsB,CAAA;AAC5B,MAAI,CAAC,MAAM;AACT,WAAO;EACT;AACA,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,IAAI,GAA0C;AACtF,QAAI,SAAS,QAAS,OAAO,UAAU,YAAY,CAAC,MAAM,MAAM,GAAG,EAAE,KAAK,CAAC,UAAU,MAAM,KAAI,EAAG,SAAS,CAAC,GAAI;AAC9G;IACF;AACC,WAAmC,GAAG,IAAI;EAC7C;AACA,SAAO;AACT;AAEA,SAAS,cAAc,QAAiB,UAAiB;AACvD,QAAM,UAAU,OAAO,UAAU,EAAE,EAAE,KAAI;AACzC,MAAI,QAAQ,SAAS,GAAG;AACtB,WAAO;EACT;AACA,MAAI,UAAU;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M,UAAS,IAAK,MAAM,mBAAmB;IACnD,SAAS,QAAQ;IACjB;IACA,QAAQ,QAAQ;IAChB;IACA;GACD;AAED,SAAO;IACL,MAAM;IACN,eAAe,QAAQ,QAAQ;IAC/B,SAAS;IACT,GAAI,QAAQ,WAAW,SAAY,EAAE,QAAQ,QAAQ,OAAM,IAAK,CAAA;IAChE,SAAS,QAAQ,OAAO;IACxB,GAAI,QAAQ,oBAAoB,EAAE,gBAAgB,QAAQ,kBAAiB,IAAK,CAAA;IAChF,GAAI,iBAAiB,EAAE,YAAY,eAAc,IAAK,CAAA;IACtD,cAAc,KAAK,OAAO,CAAC,QAAQ,IAAI,WAAW,QAAQ,EAAE;IAC5D,eAAe,KAAK,OAAO,CAAC,QAAQ,IAAI,WAAW,SAAS,EAAE;IAC9D,cAAc,KAAK,OAAO,CAAC,QAAQ,IAAI,WAAW,QAAQ,EAAE;IAC5D;IACA,KAAK;;AAET;AAEO,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA","debugId":"2b2c2276-a114-5a33-ae5c-a97fe33dded1"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/close-many.ts"],"sourcesContent":["/**\n * @module cli/commands/close-many\n *\n * Implements the pm close many command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport {\n createCheckpointId,\n loadMutationCheckpoint,\n restoreCheckpointItems,\n writeMutationCheckpoint,\n type MutationCheckpointItem,\n} from \"../../core/checkpoint/mutation-checkpoint.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { toErrorMessage } from \"../../core/shared/primitives.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { nowIso } from \"../../core/shared/time.js\";\nimport { listAllFrontMatterLight } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport { runClose, type CloseCommandOptions } from \"./close.js\";\nimport { hasListFilters } from \"./list-filter-shared.js\";\nimport { runList, type ListOptions, type ListedItem } from \"./list.js\";\nimport { runRestore } from \"./restore.js\";\n\nconst CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION = 1;\nconst CLOSE_MANY_CHECKPOINT_SUBDIR = \"close-many\";\n\nconst CLOSE_MANY_FILTER_GUIDANCE = [\n \"--filter-status\",\n \"--filter-type\",\n \"--filter-tag\",\n \"--filter-priority\",\n \"--filter-sprint\",\n \"--filter-release\",\n \"--filter-parent\",\n \"--filter-assignee\",\n \"--filter-updated-before\",\n \"--ids\",\n].join(\", \");\n\n/**\n * Documents the close many command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseManyCommandOptions {\n status?: string;\n list?: ListOptions;\n reason?: string;\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n validateClose?: string;\n author?: string;\n message?: string;\n force?: boolean;\n dryRun?: boolean;\n rollback?: string;\n checkpoint?: boolean;\n}\n\ninterface CloseManyPlanRow {\n id: string;\n title: string;\n status: string;\n action: \"close\" | \"skip\";\n skip_reason?: string;\n active_child_ids?: string[];\n}\n\ninterface CloseManyApplyRow {\n id: string;\n status: \"closed\" | \"skipped\" | \"failed\";\n skip_reason?: string;\n changed_fields?: string[];\n warnings?: string[];\n error?: string;\n}\n\ninterface CloseManyPlanContext {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>;\n reason: string | undefined;\n validateCloseMode: string | undefined;\n force: boolean;\n listed: Awaited<ReturnType<typeof runList>>;\n matched: ListedItem[];\n planRows: CloseManyPlanRow[];\n}\n\n/**\n * Documents the close many result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseManyResult {\n mode: \"dry_run\" | \"apply\" | \"rollback\";\n matched_count: number;\n dry_run: boolean;\n reason?: string;\n filters?: Record<string, unknown>;\n validate_close?: string;\n item_plans?: CloseManyPlanRow[];\n checkpoint?: {\n id: string;\n created_at: string;\n path: string;\n rollback_command: string;\n };\n closed_count?: number;\n skipped_count?: number;\n failed_count?: number;\n restored_count?: number;\n rollback_checkpoint_id?: string;\n rows?: CloseManyApplyRow[] | Array<{ id: string; status: \"restored\" | \"failed\"; changed_fields?: string[]; warnings?: string[]; error?: string }>;\n ids: string[];\n}\n\nfunction hasCloseManyFilters(list: ListOptions | undefined, status: string | undefined): boolean {\n return hasListFilters(list, status, { includePagination: false });\n}\n\nfunction hasCloseManyRollbackConflicts(list: ListOptions | undefined, status: string | undefined): boolean {\n return hasListFilters(list, status);\n}\n\nfunction rejectBlankIdsFilter(list: ListOptions | undefined): void {\n if (list?.ids != null && String(list.ids).trim().length === 0) {\n throw new PmCliError(\"--ids requires at least one non-empty item ID\", EXIT_CODE.USAGE);\n }\n}\n\nfunction activeListOptions(list: ListOptions | undefined): ListOptions {\n const active: ListOptions = {};\n if (!list) {\n return active;\n }\n for (const [key, value] of Object.entries(list) as Array<[keyof ListOptions, unknown]>) {\n if (value == null || (typeof value === \"string\" && !value.split(\",\").some((entry) => entry.trim().length > 0))) {\n continue;\n }\n (active as Record<string, unknown>)[key] = value;\n }\n return active;\n}\n\nfunction resolveReason(reason: unknown, required: boolean): string | undefined {\n const trimmed = String(reason ?? \"\").trim();\n if (trimmed.length > 0) {\n return trimmed;\n }\n if (required) {\n throw new PmCliError(\n \"pm close-many requires a shared close reason via --reason because governance.require_close_reason is enabled.\",\n EXIT_CODE.USAGE,\n {\n code: \"close_reason_required\",\n required: \"Provide a shared closing summary via --reason for the whole batch.\",\n why: \"governance.require_close_reason is enabled, so every close must record why the items are done.\",\n examples: [\n 'pm close-many --filter-sprint S-12 --reason \"Sprint S-12 acceptance criteria met\"',\n 'pm close-many --ids pm-a,pm-b --reason \"Superseded by redesign\"',\n ],\n nextSteps: [\n \"Re-run with --reason describing the shared outcome.\",\n \"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled\",\n ],\n },\n );\n }\n return undefined;\n}\n\n// Build a parent -> non-terminal child id map in a single light scan so each\n// matched parent can be annotated with the active children that closing it\n// would orphan (the same signal runClose surfaces per item on apply).\nasync function buildActiveChildrenByParent(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n): Promise<{ childrenByParent: Map<string, string[]>; parentByChild: Map<string, string> }> {\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const childrenByParent = new Map<string, string[]>();\n const parentByChild = new Map<string, string>();\n for (const item of items) {\n if (typeof item.parent !== \"string\" || item.parent.length === 0) {\n continue;\n }\n parentByChild.set(item.id, item.parent);\n if (isTerminalStatus(item.status, statusRegistry)) {\n continue;\n }\n const existing = childrenByParent.get(item.parent);\n if (existing) {\n existing.push(item.id);\n } else {\n childrenByParent.set(item.parent, [item.id]);\n }\n }\n for (const ids of childrenByParent.values()) {\n ids.sort((left, right) => left.localeCompare(right));\n }\n return { childrenByParent, parentByChild };\n}\n\nfunction hierarchyDepth(id: string, parentByChild: Map<string, string>, cache?: Map<string, number>): number {\n const cached = cache?.get(id);\n if (cached !== undefined) {\n return cached;\n }\n let depth = 0;\n let current = parentByChild.get(id);\n const path: string[] = [];\n const visited = new Set<string>();\n let hasCycle = false;\n while (current !== undefined && !visited.has(current)) {\n const cachedCurrent = cache?.get(current);\n if (cachedCurrent !== undefined) {\n depth += cachedCurrent + 1;\n break;\n }\n visited.add(current);\n path.push(current);\n depth += 1;\n current = parentByChild.get(current);\n }\n if (current !== undefined && visited.has(current)) {\n hasCycle = true;\n }\n if (!hasCycle) {\n cache?.set(id, depth);\n for (const [index, ancestorId] of path.entries()) {\n cache?.set(ancestorId, depth - index - 1);\n }\n }\n return depth;\n}\n\nasync function runCloseManyRollback(params: {\n pmRoot: string;\n rollbackId: string;\n options: CloseManyCommandOptions;\n global: GlobalOptions;\n}): Promise<CloseManyResult> {\n const checkpoint = await loadMutationCheckpoint(\n params.pmRoot,\n CLOSE_MANY_CHECKPOINT_SUBDIR,\n params.rollbackId,\n CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION,\n );\n const restoreMessage = params.options.message ?? `Rollback close-many checkpoint ${checkpoint.id}`;\n const rollback = await restoreCheckpointItems(checkpoint.items, (id, targetUpdatedAt) =>\n runRestore(id, targetUpdatedAt, { author: params.options.author, message: restoreMessage, force: true }, params.global),\n );\n return {\n mode: \"rollback\",\n matched_count: checkpoint.items.length,\n dry_run: false,\n rollback_checkpoint_id: checkpoint.id,\n checkpoint: {\n id: checkpoint.id,\n created_at: checkpoint.created_at,\n path: checkpoint.path,\n rollback_command: `pm close-many --rollback ${checkpoint.id}`,\n },\n restored_count: rollback.restored_ids.length,\n failed_count: rollback.failed_count,\n rows: rollback.rows,\n ids: rollback.restored_ids,\n };\n}\n\nfunction planCloseManyRows(\n matched: ListedItem[],\n childrenByParent: Map<string, string[]>,\n closePlannedIds: Set<string>,\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>,\n force: boolean,\n): CloseManyPlanRow[] {\n return matched.map((item) => {\n const activeChildIds = (childrenByParent.get(item.id) ?? []).filter((childId) => !closePlannedIds.has(childId));\n const willSkip = !canCloseManyItem(item, statusRegistry, force);\n return {\n id: item.id,\n title: typeof item.title === \"string\" ? item.title : \"\",\n status: item.status,\n action: willSkip ? \"skip\" : \"close\",\n ...(willSkip ? { skip_reason: \"already_terminal\" } : {}),\n ...(activeChildIds.length > 0 ? { active_child_ids: activeChildIds } : {}),\n };\n });\n}\n\nasync function writeCloseManyCheckpoint(params: {\n pmRoot: string;\n checkpointId: string;\n nowValue: string;\n options: CloseManyCommandOptions;\n reason: string | undefined;\n filters: Record<string, unknown>;\n checkpointItems: MutationCheckpointItem[];\n}): Promise<CloseManyResult[\"checkpoint\"]> {\n const checkpointPath = await writeMutationCheckpoint(params.pmRoot, CLOSE_MANY_CHECKPOINT_SUBDIR, params.checkpointId, {\n schema_version: CLOSE_MANY_CHECKPOINT_SCHEMA_VERSION,\n id: params.checkpointId,\n created_at: params.nowValue,\n author: resolveAuthor(params.options.author, \"unknown\"),\n ...(params.reason !== undefined ? { reason: params.reason } : {}),\n filters: params.filters,\n items: params.checkpointItems,\n });\n return {\n id: params.checkpointId,\n created_at: params.nowValue,\n path: checkpointPath,\n rollback_command: `pm close-many --rollback ${params.checkpointId}`,\n };\n}\n\nasync function applyCloseManyRows(params: {\n matched: ListedItem[];\n closableIds: Set<string>;\n reason: string | undefined;\n closeOptions: CloseCommandOptions;\n global: GlobalOptions;\n}): Promise<{ rows: CloseManyApplyRow[]; closedIds: string[] }> {\n const rows: CloseManyApplyRow[] = [];\n const closedIds: string[] = [];\n for (const item of params.matched) {\n if (!params.closableIds.has(item.id)) {\n rows.push({ id: item.id, status: \"skipped\", skip_reason: \"already_terminal\" });\n continue;\n }\n try {\n const result = await runClose(item.id, params.reason, params.closeOptions, params.global);\n rows.push({\n id: item.id,\n status: \"closed\",\n changed_fields: result.changed_fields,\n ...(result.warnings && result.warnings.length > 0 ? { warnings: result.warnings } : {}),\n });\n closedIds.push(item.id);\n } catch (error: unknown) {\n rows.push({ id: item.id, status: \"failed\", error: toErrorMessage(error) });\n }\n }\n return { rows, closedIds };\n}\n\nfunction resolveCloseManyRollbackId(options: CloseManyCommandOptions): string | undefined {\n return typeof options.rollback === \"string\" ? options.rollback : undefined;\n}\n\nfunction validateCloseManyRollbackOptions(options: CloseManyCommandOptions, rollbackId: string): void {\n if (rollbackId.trim().length === 0) {\n throw new PmCliError(\"--rollback requires a checkpoint id\", EXIT_CODE.USAGE);\n }\n if (options.dryRun === true) {\n throw new PmCliError(\"--dry-run cannot be combined with --rollback\", EXIT_CODE.USAGE);\n }\n if (hasCloseManyRollbackConflicts(options.list, options.status)) {\n throw new PmCliError(\"Rollback mode does not accept filter options\", EXIT_CODE.USAGE);\n }\n}\n\nfunction assertCloseManyHasFilters(options: CloseManyCommandOptions): void {\n if (hasCloseManyFilters(options.list, options.status)) {\n return;\n }\n throw new PmCliError(\n `close-many requires at least one filter to scope the close (for example: ${CLOSE_MANY_FILTER_GUIDANCE}). Refusing to match every item.`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction sortCloseManyMatchedItems(matched: ListedItem[], parentByChild: Map<string, string>): ListedItem[] {\n const depthCache = new Map<string, number>();\n return [...matched].sort((left, right) => {\n const depthDelta = hierarchyDepth(right.id, parentByChild, depthCache) - hierarchyDepth(left.id, parentByChild, depthCache);\n return depthDelta !== 0 ? depthDelta : left.id.localeCompare(right.id);\n });\n}\n\nfunction canCloseManyItem(\n item: ListedItem,\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>,\n force: boolean,\n): boolean {\n return force || !isTerminalStatus(item.status, statusRegistry);\n}\n\nfunction resolveCloseManyPlannedIds(\n matched: ListedItem[],\n statusRegistry: ReturnType<typeof resolveRuntimeStatusRegistry>,\n force: boolean,\n): Set<string> {\n return new Set(matched.filter((item) => canCloseManyItem(item, statusRegistry, force)).map((item) => item.id));\n}\n\nasync function buildCloseManyPlanContext(params: {\n pmRoot: string;\n settings: Awaited<ReturnType<typeof readSettings>>;\n options: CloseManyCommandOptions;\n global: GlobalOptions;\n}): Promise<CloseManyPlanContext> {\n assertCloseManyHasFilters(params.options);\n const statusRegistry = resolveRuntimeStatusRegistry(params.settings.schema);\n const reason = resolveReason(params.options.reason, params.settings.governance.require_close_reason);\n const force = params.options.force === true;\n const listed = await runList(params.options.status, activeListOptions(params.options.list), params.global);\n const { childrenByParent, parentByChild } = await buildActiveChildrenByParent(params.pmRoot, params.settings);\n const matched = sortCloseManyMatchedItems(listed.items as ListedItem[], parentByChild);\n const closePlannedIds = resolveCloseManyPlannedIds(matched, statusRegistry, force);\n return {\n pmRoot: params.pmRoot,\n settings: params.settings,\n statusRegistry,\n reason,\n validateCloseMode: params.options.validateClose,\n force,\n listed,\n matched,\n planRows: planCloseManyRows(matched, childrenByParent, closePlannedIds, statusRegistry, force),\n };\n}\n\nfunction buildCloseManyDryRunResult(context: CloseManyPlanContext): CloseManyResult {\n return {\n mode: \"dry_run\",\n matched_count: context.matched.length,\n dry_run: true,\n ...(context.reason !== undefined ? { reason: context.reason } : {}),\n filters: context.listed.filters,\n ...(context.validateCloseMode ? { validate_close: context.validateCloseMode } : {}),\n item_plans: context.planRows,\n ids: [],\n };\n}\n\nasync function resolveCloseManyCheckpointInfo(params: {\n context: CloseManyPlanContext;\n options: CloseManyCommandOptions;\n closableIds: Set<string>;\n checkpointId: string;\n nowValue: string;\n}): Promise<CloseManyResult[\"checkpoint\"]> {\n if (params.options.checkpoint === false || params.closableIds.size === 0) {\n return undefined;\n }\n const checkpointItems: MutationCheckpointItem[] = params.context.matched\n .filter((item) => params.closableIds.has(item.id))\n .map((item) => ({ id: item.id, target_updated_at: item.updated_at }));\n return writeCloseManyCheckpoint({\n pmRoot: params.context.pmRoot,\n checkpointId: params.checkpointId,\n nowValue: params.nowValue,\n options: params.options,\n reason: params.context.reason,\n filters: params.context.listed.filters,\n checkpointItems,\n });\n}\n\n/**\n * Implements run close many for the public runtime surface of this module.\n */\nexport async function runCloseMany(options: CloseManyCommandOptions, global: GlobalOptions): Promise<CloseManyResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n const settings = await readSettings(pmRoot);\n\n const dryRun = options.dryRun === true;\n const rollbackId = resolveCloseManyRollbackId(options);\n rejectBlankIdsFilter(options.list);\n\n if (rollbackId !== undefined) {\n validateCloseManyRollbackOptions(options, rollbackId);\n return runCloseManyRollback({ pmRoot, rollbackId, options, global });\n }\n\n const context = await buildCloseManyPlanContext({ pmRoot, settings, options, global });\n\n if (dryRun) {\n return buildCloseManyDryRunResult(context);\n }\n\n const closableIds = new Set(context.planRows.filter((row) => row.action === \"close\").map((row) => row.id));\n const nowValue = nowIso();\n const checkpointId = createCheckpointId(CLOSE_MANY_CHECKPOINT_SUBDIR, nowValue);\n const checkpointInfo = await resolveCloseManyCheckpointInfo({ context, options, closableIds, checkpointId, nowValue });\n\n const closeOptions: CloseCommandOptions = {\n author: options.author,\n message: options.message ?? `close-many apply ${checkpointId}`,\n validateClose: context.validateCloseMode,\n force: context.force,\n resolution: options.resolution,\n expectedResult: options.expectedResult,\n actualResult: options.actualResult,\n };\n\n const { rows, closedIds } = await applyCloseManyRows({\n matched: context.matched,\n closableIds,\n reason: context.reason,\n closeOptions,\n global,\n });\n\n return {\n mode: \"apply\",\n matched_count: context.matched.length,\n dry_run: false,\n ...(context.reason !== undefined ? { reason: context.reason } : {}),\n filters: context.listed.filters,\n ...(context.validateCloseMode ? { validate_close: context.validateCloseMode } : {}),\n ...(checkpointInfo ? { checkpoint: checkpointInfo } : {}),\n closed_count: rows.filter((row) => row.status === \"closed\").length,\n skipped_count: rows.filter((row) => row.status === \"skipped\").length,\n failed_count: rows.filter((row) => row.status === \"failed\").length,\n rows,\n ids: closedIds,\n };\n}\n\nexport const _testOnly = {\n activeListOptions,\n buildActiveChildrenByParent,\n hasCloseManyFilters,\n hasCloseManyRollbackConflicts,\n hierarchyDepth,\n rejectBlankIdsFilter,\n resolveReason,\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,IAAM,uCAAuC;AAC7C,IAAM,+BAA+B;AAErC,IAAM,6BAA6B;EACjC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,KA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IAAI,WAAW,QAAQ,EAAE;IAC5D,eAAe,KAAK,OAAO,CAAC,QAAQ,IAAI,WAAW,SAAS,EAAE;IAC9D,cAAc,KAAK,OAAO,CAAC,QAAQ,IAAI,WAAW,QAAQ,EAAE;IAC5D;IACA,KAAK;;AAET;AAEO,IAAM,YAAY;EACvB;EACA;EACA;EACA;EACA;EACA;EACA","debugId":"0a9c0e97-1d91-55f1-830c-2822eb0a32bb"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
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]="1f86aff5-7cfc-566c-8c4b-af6365719945")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
toNonEmptyStringOrUndefined
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MFLLULHU.js";
|
|
6
6
|
|
|
7
7
|
// dist/core/governance/metadata-coverage.js
|
|
8
8
|
function normalizeStatus(status, registry) {
|
|
@@ -257,6 +257,6 @@ export {
|
|
|
257
257
|
computeMetadataCoverage,
|
|
258
258
|
groupItemsByDimension
|
|
259
259
|
};
|
|
260
|
-
//# sourceMappingURL=chunk-
|
|
260
|
+
//# sourceMappingURL=chunk-J6AD3GWC.js.map
|
|
261
261
|
|
|
262
262
|
//# debugId=1f86aff5-7cfc-566c-8c4b-af6365719945
|
|
@@ -1,11 +1,11 @@
|
|
|
1
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]="
|
|
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]="dfca79bb-75b6-55a7-84b0-07b24f504e5b")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
resolveAuthor
|
|
5
5
|
} from "./chunk-T5RRNDA7.js";
|
|
6
6
|
import {
|
|
7
7
|
readHistoryEntries
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6WCXSC5V.js";
|
|
9
9
|
import {
|
|
10
10
|
EMPTY_REPLAY_DOCUMENT,
|
|
11
11
|
historyEntriesToRaw,
|
|
@@ -13,29 +13,23 @@ import {
|
|
|
13
13
|
replayToItemDocument,
|
|
14
14
|
tryApplyReplayPatch,
|
|
15
15
|
verifyHistoryChain
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-IINCZYM3.js";
|
|
17
17
|
import {
|
|
18
|
+
PmCliError,
|
|
18
19
|
acquireLock,
|
|
20
|
+
canonicalDocument,
|
|
19
21
|
createHistoryEntry,
|
|
22
|
+
getActiveExtensionRegistrations,
|
|
20
23
|
locateItem,
|
|
21
|
-
readLocatedItem
|
|
22
|
-
} from "./chunk-ENGQOEUY.js";
|
|
23
|
-
import {
|
|
24
|
-
canonicalDocument,
|
|
25
24
|
normalizeItemId,
|
|
26
25
|
normalizeRawItemId,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
import {
|
|
30
|
-
nowIso
|
|
31
|
-
} from "./chunk-3GCS5SKL.js";
|
|
32
|
-
import {
|
|
33
|
-
PmCliError,
|
|
34
|
-
getActiveExtensionRegistrations,
|
|
26
|
+
nowIso,
|
|
27
|
+
readLocatedItem,
|
|
35
28
|
readSettings,
|
|
36
29
|
resolveGovernanceKnobs,
|
|
37
|
-
runActiveOnWriteHooks
|
|
38
|
-
|
|
30
|
+
runActiveOnWriteHooks,
|
|
31
|
+
serializeItemDocument
|
|
32
|
+
} from "./chunk-NTOOEVJ4.js";
|
|
39
33
|
import {
|
|
40
34
|
EXIT_CODE,
|
|
41
35
|
getHistoryPath,
|
|
@@ -46,7 +40,7 @@ import {
|
|
|
46
40
|
resolveItemTypeRegistry,
|
|
47
41
|
resolvePmRoot,
|
|
48
42
|
writeFileAtomic
|
|
49
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-MFLLULHU.js";
|
|
50
44
|
|
|
51
45
|
// dist/cli/commands/history-redact.js
|
|
52
46
|
import fs2 from "node:fs/promises";
|
|
@@ -640,6 +634,6 @@ export {
|
|
|
640
634
|
runHistoryRedact,
|
|
641
635
|
_testOnly
|
|
642
636
|
};
|
|
643
|
-
//# sourceMappingURL=chunk-
|
|
637
|
+
//# sourceMappingURL=chunk-JH5XDDYS.js.map
|
|
644
638
|
|
|
645
|
-
//# debugId=
|
|
639
|
+
//# debugId=dfca79bb-75b6-55a7-84b0-07b24f504e5b
|