@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,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseAnnotationTextInput,
|
|
3
3
|
runAnnotationCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TKWTJGD6.js";
|
|
5
5
|
import {
|
|
6
6
|
createStdinTokenResolver
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-CGDUIPJL.js";
|
|
8
8
|
|
|
9
9
|
// dist/cli/commands/notes.js
|
|
10
10
|
!(function() {
|
|
11
11
|
try {
|
|
12
12
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
13
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
13
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "a43d68a5-885e-54f6-b266-03d8debc1a3a");
|
|
14
14
|
} catch (e2) {
|
|
15
15
|
}
|
|
16
16
|
})();
|
|
@@ -19,7 +19,7 @@ async function runNotes(id, options, global2) {
|
|
|
19
19
|
const addInput = options.add === void 0 ? void 0 : await stdinResolver.resolveValue(options.add, "--add");
|
|
20
20
|
return runAnnotationCommand(id, options, global2, {
|
|
21
21
|
// addInput is defined whenever options.add is defined (see resolveValue), so the cast is safe.
|
|
22
|
-
input: options.add === void 0 ? { mode: "list" } : { mode: "add", value: addInput, emptyFlag: "--add" },
|
|
22
|
+
input: options.add === void 0 ? { mode: "list" } : { mode: "add", value: addInput, rawValue: options.add, emptyFlag: "--add" },
|
|
23
23
|
collectionKey: "notes",
|
|
24
24
|
op: "note_add",
|
|
25
25
|
parseText: (raw) => parseAnnotationTextInput(raw),
|
|
@@ -38,4 +38,4 @@ async function runNotes(id, options, global2) {
|
|
|
38
38
|
export {
|
|
39
39
|
runNotes
|
|
40
40
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
41
|
+
//# sourceMappingURL=chunk-QJZM5WO5.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/notes.ts"],
|
|
4
|
-
"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
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAmCA,eAAsB,SAAS,IAAY,SAA8BA,SAAqB;AAC5F,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAAuC,IAAI,SAASA,SAAQ;;IAEjE,OAAO,QAAQ,QAAQ,
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;AAmCA,eAAsB,SAAS,IAAY,SAA8BA,SAAqB;AAC5F,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,WAAW,QAAQ,QAAQ,SAAY,SAAY,MAAM,cAAc,aAAa,QAAQ,KAAK,OAAO;AAE9G,SAAO,qBAAuC,IAAI,SAASA,SAAQ;;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;",
|
|
6
6
|
"names": ["global"]
|
|
7
7
|
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
2
|
verifyHistoryChain
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GLMJLBLR.js";
|
|
4
4
|
import {
|
|
5
5
|
hashDocument
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BPJ5NYSJ.js";
|
|
7
7
|
import {
|
|
8
8
|
getHistoryPath,
|
|
9
9
|
writeFileAtomic
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2BVD4ZD2.js";
|
|
11
11
|
|
|
12
12
|
// dist/core/history/drift-scan.js
|
|
13
|
-
import fs from "fs/promises";
|
|
13
|
+
import fs from "node:fs/promises";
|
|
14
14
|
import { createHash } from "node:crypto";
|
|
15
15
|
import path from "node:path";
|
|
16
16
|
!(function() {
|
|
17
17
|
try {
|
|
18
18
|
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
19
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "
|
|
19
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "20ed642a-081f-55bd-9bbe-840b1a1bd3b5");
|
|
20
20
|
} catch (e2) {
|
|
21
21
|
}
|
|
22
22
|
})();
|
|
@@ -207,4 +207,4 @@ async function scanHistoryDrift(pmRoot, items, options = {}) {
|
|
|
207
207
|
export {
|
|
208
208
|
scanHistoryDrift
|
|
209
209
|
};
|
|
210
|
-
//# sourceMappingURL=chunk-
|
|
210
|
+
//# sourceMappingURL=chunk-QLEH6FTQ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../core/history/drift-scan.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * @module core/history/drift-scan\n *\n * Implements append-only history and replay behavior for Drift Scan.\n */\nimport type { Stats } from \"node:fs\";\nimport fs from \"node:fs/promises\";\nimport { createHash } from \"node:crypto\";\nimport path from \"node:path\";\nimport { getHistoryPath } from \"../store/paths.js\";\nimport { writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { hashDocument } from \"./history.js\";\nimport { verifyHistoryChain } from \"./replay.js\";\nimport type { HistoryEntry, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Documents the drift scan result payload exchanged by command, SDK, and package integrations.\n */\nexport interface DriftScanResult {\n missingStreams: string[];\n unreadableStreams: string[];\n hashMismatches: string[];\n chainMismatches: string[];\n driftedItems: string[];\n}\n\nconst DRIFT_CACHE_VERSION = 3;\nconst DRIFT_CACHE_FILENAME = \"history-drift-cache.json\";\n\n/**\n * Controls how cached history stream verification is trusted when the file stat\n * tuple still matches a previous scan.\n */\nexport type DriftCacheHitVerification = \"content_hash\" | \"metadata\";\n\n/**\n * Documents the history drift scan options shared by health, validate, and\n * repair callers.\n */\nexport interface DriftScanOptions {\n cacheHitVerification?: DriftCacheHitVerification;\n}\n\ninterface DriftCacheEntry {\n mtime_ms: number;\n ctime_ms: number;\n size: number;\n content_hash: string;\n latest_after_hash: string;\n chain_ok: boolean;\n}\n\ninterface DriftCacheEnvelope {\n version: number;\n entries: Record<string, DriftCacheEntry>;\n}\n\nfunction getDriftCachePath(pmRoot: string): string {\n return path.join(pmRoot, \"runtime\", DRIFT_CACHE_FILENAME);\n}\n\nasync function loadDriftCache(pmRoot: string): Promise<DriftCacheEnvelope | null> {\n try {\n const raw = await fs.readFile(getDriftCachePath(pmRoot), \"utf8\");\n const parsed = JSON.parse(raw) as DriftCacheEnvelope;\n if (parsed.version !== DRIFT_CACHE_VERSION || typeof parsed.entries !== \"object\" || parsed.entries === null) {\n return null;\n }\n return parsed;\n } catch {\n return null;\n }\n}\n\nfunction isErrno(error: unknown, code: string): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === code;\n}\n\ninterface StreamVerification {\n latestAfterHash: string;\n chainOk: boolean;\n contentHash: string;\n}\n\ninterface DriftScanAccumulator {\n missingStreams: string[];\n unreadableStreams: string[];\n hashMismatches: string[];\n chainMismatches: string[];\n}\n\nfunction hashContent(raw: string): string {\n return createHash(\"sha256\").update(raw).digest(\"hex\");\n}\n\nasync function readHistoryContentHash(historyPath: string): Promise<string> {\n const raw = await fs.readFile(historyPath, \"utf8\");\n return hashContent(raw);\n}\n\n/**\n * Read and fully verify one history stream's hash chain. Returns null for an\n * empty/missing stream (caller records it as a missing stream).\n */\nasync function verifyHistoryStream(historyPath: string): Promise<StreamVerification | null> {\n const raw = await fs.readFile(historyPath, \"utf8\");\n const contentHash = hashContent(raw);\n if (raw.trim().length === 0) {\n return null;\n }\n const entries: HistoryEntry[] = [];\n let latestAfterHash: string | null = null;\n for (const line of raw.split(/\\r?\\n/)) {\n const trimmed = line.trim();\n if (trimmed.length === 0) {\n continue;\n }\n const parsed = JSON.parse(trimmed) as HistoryEntry;\n if (typeof parsed.after_hash !== \"string\" || parsed.after_hash.trim().length === 0) {\n throw new Error(\"missing after_hash\");\n }\n entries.push(parsed);\n latestAfterHash = parsed.after_hash;\n }\n /* c8 ignore start -- defensive guard for future history schema changes. */\n if (!latestAfterHash) {\n return null;\n }\n /* c8 ignore stop */\n return {\n latestAfterHash,\n chainOk: verifyHistoryChain(entries).ok,\n contentHash,\n };\n}\n\nfunction cacheMetadataMatches(cached: DriftCacheEntry | undefined, stat: Stats): boolean {\n return cached !== undefined && cached.mtime_ms === stat.mtimeMs && cached.ctime_ms === stat.ctimeMs && cached.size === stat.size;\n}\n\nasync function loadFreshStreamVerification(\n itemId: string,\n historyPath: string,\n accumulator: DriftScanAccumulator,\n): Promise<StreamVerification | null> {\n try {\n const loaded = await verifyHistoryStream(historyPath);\n if (!loaded) {\n accumulator.missingStreams.push(itemId);\n return null;\n }\n return loaded;\n } catch {\n accumulator.unreadableStreams.push(itemId);\n return null;\n }\n}\n\nasync function resolveStreamVerification(params: {\n itemId: string;\n historyPath: string;\n stat: Stats;\n cached: DriftCacheEntry | undefined;\n verifyCacheHitByContent: boolean;\n accumulator: DriftScanAccumulator;\n}): Promise<{ verification: StreamVerification | null; cacheDirty: boolean }> {\n const cachedContentHash =\n typeof params.cached?.content_hash === \"string\" && params.cached.content_hash.length > 0\n ? params.cached.content_hash\n : undefined;\n const canUseCache = cacheMetadataMatches(params.cached, params.stat) && cachedContentHash !== undefined && params.cached !== undefined;\n if (!canUseCache || !params.cached) {\n return {\n verification: await loadFreshStreamVerification(params.itemId, params.historyPath, params.accumulator),\n cacheDirty: true,\n };\n }\n let currentContentHash: string;\n if (params.verifyCacheHitByContent) {\n try {\n currentContentHash = await readHistoryContentHash(params.historyPath);\n } catch {\n params.accumulator.unreadableStreams.push(params.itemId);\n return { verification: null, cacheDirty: false };\n }\n } else {\n currentContentHash = cachedContentHash;\n }\n if (!params.verifyCacheHitByContent || currentContentHash === cachedContentHash) {\n return {\n verification: {\n latestAfterHash: params.cached.latest_after_hash,\n chainOk: params.cached.chain_ok,\n contentHash: currentContentHash,\n },\n cacheDirty: false,\n };\n }\n return {\n verification: await loadFreshStreamVerification(params.itemId, params.historyPath, params.accumulator),\n cacheDirty: true,\n };\n}\n\n/**\n * Scan every item's history stream for drift (missing/unreadable streams, broken\n * hash chains, and item/history hash mismatches).\n *\n * Full chain re-verification of a large history tree is the dominant cost of\n * `pm health`. We cache the per-stream verification keyed by the history file's\n * mtime/ctime/size plus content hash. Strict callers keep recomputing the\n * content hash on metadata hits; latency-sensitive health checks can opt into\n * trusting the stat tuple and skip rereading unchanged streams.\n */\nexport async function scanHistoryDrift(\n pmRoot: string,\n items: Array<ItemMetadata & { body: string }>,\n options: DriftScanOptions = {},\n): Promise<DriftScanResult> {\n const accumulator: DriftScanAccumulator = {\n missingStreams: [],\n unreadableStreams: [],\n hashMismatches: [],\n chainMismatches: [],\n };\n\n const cache = await loadDriftCache(pmRoot);\n const previousEntries: Record<string, DriftCacheEntry> = cache?.entries ?? {};\n const nextEntries: Record<string, DriftCacheEntry> = {};\n let cacheDirty = false;\n // Metadata mode does not open a stat-matched stream, so unreadable-after-stat\n // failures are intentionally deferred to strict validate/history-repair scans.\n const verifyCacheHitByContent = options.cacheHitVerification !== \"metadata\";\n\n for (const item of items) {\n const historyPath = getHistoryPath(pmRoot, item.id);\n\n let stat: Stats;\n try {\n stat = await fs.stat(historyPath);\n } catch (error: unknown) {\n if (isErrno(error, \"ENOENT\")) {\n accumulator.missingStreams.push(item.id);\n } else {\n accumulator.unreadableStreams.push(item.id);\n }\n continue;\n }\n\n const cached = previousEntries[item.id];\n const resolved = await resolveStreamVerification({\n itemId: item.id,\n historyPath,\n stat,\n cached,\n verifyCacheHitByContent,\n accumulator,\n });\n cacheDirty ||= resolved.cacheDirty;\n if (!resolved.verification) {\n continue;\n }\n\n if (!resolved.verification.chainOk) {\n accumulator.chainMismatches.push(item.id);\n }\n nextEntries[item.id] = {\n mtime_ms: stat.mtimeMs,\n ctime_ms: stat.ctimeMs,\n size: stat.size,\n content_hash: resolved.verification.contentHash,\n latest_after_hash: resolved.verification.latestAfterHash,\n chain_ok: resolved.verification.chainOk,\n };\n\n const { body, ...frontMatter } = item;\n const currentHash = hashDocument({\n metadata: frontMatter as ItemMetadata,\n body,\n });\n if (currentHash !== resolved.verification.latestAfterHash) {\n accumulator.hashMismatches.push(item.id);\n }\n }\n\n if (cacheDirty || Object.keys(previousEntries).length !== Object.keys(nextEntries).length) {\n const cachePath = getDriftCachePath(pmRoot);\n try {\n await fs.mkdir(path.dirname(cachePath), { recursive: true });\n await writeFileAtomic(cachePath, JSON.stringify({ version: DRIFT_CACHE_VERSION, entries: nextEntries }));\n } catch {\n // Best-effort cache write: a failed persist must never fail a health scan.\n }\n }\n\n const driftedItems = [\n ...new Set([\n ...accumulator.missingStreams,\n ...accumulator.unreadableStreams,\n ...accumulator.hashMismatches,\n ...accumulator.chainMismatches,\n ]),\n ].sort((a, b) => a.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,UAAM,EAAE,MAAM,GAAG,YAAW,IAAK;AACjC,UAAM,cAAc,aAAa;MAC/B,UAAU;MACV;KACD;AACD,QAAI,gBAAgB,SAAS,aAAa,iBAAiB;AACzD,kBAAY,eAAe,KAAK,KAAK,EAAE;IACzC;EACF;AAEA,MAAI,cAAc,OAAO,KAAK,eAAe,EAAE,WAAW,OAAO,KAAK,WAAW,EAAE,QAAQ;AACzF,UAAM,YAAY,kBAAkB,MAAM;AAC1C,QAAI;AACF,YAAM,GAAG,MAAM,KAAK,QAAQ,SAAS,GAAG,EAAE,WAAW,KAAI,CAAE;AAC3D,YAAM,gBAAgB,WAAW,KAAK,UAAU,EAAE,SAAS,qBAAqB,SAAS,YAAW,CAAE,CAAC;IACzG,QAAQ;IAER;EACF;AAEA,QAAM,eAAe;IACnB,GAAG,oBAAI,IAAI;MACT,GAAG,YAAY;MACf,GAAG,YAAY;MACf,GAAG,YAAY;MACf,GAAG,YAAY;KAChB;IACD,KAAK,CAAC,GAAG,MAAM,EAAE,cAAc,CAAC,CAAC;AACnC,SAAO,EAAE,GAAG,aAAa,aAAY;AACvC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isRemoteLinkedArtifactReference
|
|
3
3
|
} from "./chunk-7M2HAZEB.js";
|
|
4
|
+
import {
|
|
5
|
+
resolveAuthor
|
|
6
|
+
} from "./chunk-WW4E2DC3.js";
|
|
4
7
|
import {
|
|
5
8
|
assertNoUnknownCsvKeys,
|
|
6
9
|
createStdinTokenResolver,
|
|
7
10
|
looksLikeGenericKeyValueEntry,
|
|
8
11
|
parseCsvKv
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
resolveAuthor
|
|
12
|
-
} from "./chunk-WW4E2DC3.js";
|
|
12
|
+
} from "./chunk-CGDUIPJL.js";
|
|
13
13
|
import {
|
|
14
14
|
splitCommaList
|
|
15
15
|
} from "./chunk-5HIZDR5A.js";
|
|
16
16
|
import {
|
|
17
|
+
PmCliError,
|
|
18
|
+
getActiveExtensionRegistrations,
|
|
17
19
|
listAllFrontMatter,
|
|
18
20
|
locateItem,
|
|
19
21
|
mutateItem,
|
|
20
|
-
readLocatedItem
|
|
21
|
-
} from "./chunk-5VAA4YHR.js";
|
|
22
|
-
import {
|
|
23
|
-
PmCliError,
|
|
24
|
-
getActiveExtensionRegistrations,
|
|
22
|
+
readLocatedItem,
|
|
25
23
|
readSettings
|
|
26
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-BPJ5NYSJ.js";
|
|
27
25
|
import {
|
|
28
26
|
EXIT_CODE,
|
|
29
27
|
SCOPE_VALUES,
|
|
@@ -31,7 +29,7 @@ import {
|
|
|
31
29
|
pathExists,
|
|
32
30
|
resolveItemTypeRegistry,
|
|
33
31
|
resolvePmRoot
|
|
34
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-2BVD4ZD2.js";
|
|
35
33
|
|
|
36
34
|
// dist/cli/commands/linked-artifacts.js
|
|
37
35
|
import fs from "node:fs/promises";
|
|
@@ -398,4 +396,4 @@ export {
|
|
|
398
396
|
runLinkedArtifacts,
|
|
399
397
|
renameArtifactsResultKey
|
|
400
398
|
};
|
|
401
|
-
//# sourceMappingURL=chunk-
|
|
399
|
+
//# sourceMappingURL=chunk-QYZMZD4L.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/linked-artifacts.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * @module cli/commands/linked-artifacts\n *\n * Implements the pm linked artifacts command surface and its agent-facing runtime behavior.\n */\nimport fs from \"node:fs/promises\";\nimport path from \"node:path\";\nimport fg from \"fast-glob\";\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport {\n assertNoUnknownCsvKeys,\n createStdinTokenResolver,\n looksLikeGenericKeyValueEntry,\n parseCsvKv,\n} from \"../../core/item/parse.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { isRemoteLinkedArtifactReference } from \"../../core/validate/linked-artifact-reference.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 { splitCommaList } from \"../../core/shared/split-comma-list.js\";\nimport { listAllFrontMatter, 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 { SCOPE_VALUES } from \"../../types/index.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport type { LinkScope } from \"../../types/index.js\";\n\n/**\n * Restricts linked artifact values accepted by command, SDK, and storage contracts.\n */\nexport type LinkedArtifact = {\n path: string;\n scope: LinkScope;\n note?: string;\n};\n\n/** Allowed CSV/markdown keys for each structured linked-artifact option (GH-258). */\nexport const LINKED_ARTIFACT_ADD_KEYS = [\"path\", \"scope\", \"note\"] as const;\nexport const LINKED_ARTIFACT_ADD_GLOB_KEYS = [\"pattern\", \"glob\", \"path\", \"scope\", \"note\"] as const;\nexport const LINKED_ARTIFACT_REMOVE_KEYS = [\"path\"] as const;\nexport const LINKED_ARTIFACT_MIGRATE_KEYS = [\"from\", \"to\"] as const;\n/**\n * Keys that are valid on --add but meaningless on --remove (GH-277). Rejected\n * with audit-trail guidance (--message) rather than the generic unknown-key\n * error so agents are not left believing a removal note was recorded.\n */\nconst LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS: ReadonlySet<string> = new Set([\"note\", \"scope\"]);\n\n/**\n * Documents the linked artifact command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedArtifactCommandOptions {\n add?: string[];\n addGlob?: string[];\n remove?: string[];\n migrate?: string[];\n /**\n * GH-170 (pm-pfnx): standalone note applied to every link added by --add /\n * --add-glob in the same invocation. A per-entry embedded note (the\n * `path=...,note=...` pair syntax) takes precedence over this flag.\n * Requires at least one --add/--add-glob; rejected otherwise.\n */\n note?: string;\n list?: boolean;\n appendStable?: boolean;\n validatePaths?: boolean;\n audit?: boolean;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the path migration payload exchanged by command, SDK, and package integrations.\n */\nexport interface PathMigration {\n from: string;\n to: string;\n}\n\n/**\n * Documents the add glob entry payload exchanged by command, SDK, and package integrations.\n */\nexport interface AddGlobEntry {\n pattern: string;\n scope: LinkScope;\n note?: string;\n}\n\n/**\n * Documents the linked path validation payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedPathValidation {\n checked: number;\n existing_files: string[];\n missing_paths: string[];\n non_file_paths: string[];\n /**\n * Remote references (https:// URLs and other `scheme://` paths) recorded as\n * links — most often a PR/issue/design-doc URL added via `pm docs --add`.\n * These are not local files, so they bypass the existence probe and are\n * reported here rather than counted as missing.\n */\n remote_references: string[];\n}\n\n/**\n * Documents the linked path audit entry payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedPathAuditEntry {\n path: string;\n linked_by_count: number;\n linked_item_ids: string[];\n}\n\n/**\n * Documents the linked artifact result payload exchanged by command, SDK, and package integrations.\n */\nexport interface LinkedArtifactResult {\n id: string;\n changed: boolean;\n count: number;\n migrations_applied?: number;\n validation?: LinkedPathValidation;\n audit?: LinkedPathAuditEntry[];\n artifacts: LinkedArtifact[];\n}\n\n/**\n * Configuration that adapts the shared linked-artifact command core to a\n * specific resource kind (files or docs) while preserving every behavioral\n * detail of the original twin implementations.\n */\nexport interface LinkedArtifactKindConfig {\n /** Metadata key under which the artifacts are stored (e.g. \"files\" | \"docs\"). */\n metadataKey: \"files\" | \"docs\";\n /** Mutation op recorded in history (e.g. \"files_add\" | \"docs_add\"). */\n op: \"files_add\" | \"docs_add\";\n /** Noun used in the \"bare <noun> path\" --add usage error (e.g. \"file\" | \"doc\"). */\n bareNoun: \"file\" | \"doc\";\n /**\n * Whether this kind honors the append-stable option. files supports it;\n * docs always sorts and must never expose append-stable behavior.\n */\n supportsAppendStable: boolean;\n}\n\n/**\n * Implements ensure scope for the public runtime surface of this module.\n */\nexport function ensureScope(raw: string | undefined): LinkScope {\n const value = (raw ?? \"project\") as LinkScope;\n if (!SCOPE_VALUES.includes(value)) {\n throw new PmCliError(\n `Invalid scope \"${raw}\". Valid scopes: ${SCOPE_VALUES.join(\", \")} (default: project).`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/**\n * Implements looks like structured path entry for the public runtime surface of this module.\n */\nexport function looksLikeStructuredPathEntry(raw: string): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n if (/^(?:[-*+]\\s+)?(?:path|scope|note)\\s*[:=]/i.test(raw)) {\n return true;\n }\n // A first-key typo (e.g. `lable=main,path=…`) must still be parsed so the\n // unknown key is rejected rather than swallowed as a bare path (GH-258).\n return looksLikeGenericKeyValueEntry(raw);\n}\n\nfunction expandBareCommaSeparatedAddEntries(raw: string[]): string[] {\n return raw.flatMap((entry) => {\n const trimmed = entry.trim();\n if (trimmed.length === 0 || looksLikeStructuredPathEntry(trimmed) || !trimmed.includes(\",\")) {\n return [entry];\n }\n return splitCommaList(trimmed);\n });\n}\n\n/**\n * Implements parse add entries for the public runtime surface of this module.\n */\nexport function parseAddEntries(raw: string[] | undefined, bareNoun: \"file\" | \"doc\"): LinkedArtifact[] {\n if (!raw) return [];\n return expandBareCommaSeparatedAddEntries(raw).map((entry) => {\n const trimmed = entry.trim();\n const kv = looksLikeStructuredPathEntry(trimmed) ? parseCsvKv(entry, \"--add\") : { path: trimmed };\n assertNoUnknownCsvKeys(kv, \"--add\", LINKED_ARTIFACT_ADD_KEYS);\n if (!kv.path) {\n throw new PmCliError(`--add requires path=<value> or a bare ${bareNoun} path`, EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureScope(kv.scope),\n note: kv.note?.trim() || undefined,\n };\n });\n}\n\n/**\n * Implements parse add glob entries for the public runtime surface of this module.\n */\nexport function parseAddGlobEntries(raw: string[] | undefined): AddGlobEntry[] {\n if (!raw) return [];\n return raw.map((entry) => {\n const trimmed = entry.trim();\n if (!trimmed) {\n throw new PmCliError(\"--add-glob requires a glob pattern value\", EXIT_CODE.USAGE);\n }\n if (trimmed.includes(\"=\") || /^(?:[-*+]\\s+)?(?:pattern|glob|path)\\s*[:=]/i.test(trimmed) || trimmed.startsWith(\"```\")) {\n const kv = parseCsvKv(trimmed, \"--add-glob\");\n assertNoUnknownCsvKeys(kv, \"--add-glob\", LINKED_ARTIFACT_ADD_GLOB_KEYS);\n const pattern = kv.pattern?.trim() || kv.glob?.trim() || kv.path?.trim();\n if (!pattern) {\n throw new PmCliError(\"--add-glob key/value form requires pattern=<glob>\", EXIT_CODE.USAGE);\n }\n return {\n pattern,\n scope: ensureScope(kv.scope),\n note: kv.note?.trim() || undefined,\n };\n }\n return {\n pattern: trimmed,\n scope: \"project\",\n };\n });\n}\n\n/**\n * Implements parse remove entries for the public runtime surface of this module.\n */\nexport function parseRemoveEntries(raw: string[] | undefined): string[] {\n if (!raw) return [];\n return raw.map((entry) => {\n const trimmed = entry.trim();\n if (!trimmed) {\n throw new PmCliError(\"--remove requires a path value\", EXIT_CODE.USAGE);\n }\n if (trimmed.includes(\"=\") || /^(?:[-*+]\\s+)?path\\s*[:=]/i.test(trimmed) || trimmed.startsWith(\"```\")) {\n const kv = parseCsvKv(trimmed, \"--remove\");\n // GH-277: --remove identifies an existing link by path only; it does not\n // attach per-link metadata. Reject the --add-only keys with guidance toward\n // the audit-trail path (--message) rather than the generic \"unrecognized\n // key\" error, which left agents believing they had recorded a removal note.\n const unsupportedRemoveKeys = Object.keys(kv).filter((key) =>\n LINKED_ARTIFACT_REMOVE_UNSUPPORTED_KEYS.has(key.toLowerCase()),\n );\n if (unsupportedRemoveKeys.length > 0) {\n throw new PmCliError(\n `--remove identifies a linked artifact by path only and does not accept ${unsupportedRemoveKeys\n .map((key) => `\"${key}\"`)\n .join(\", \")}. Pass just the path (path=<value>, path:<value>, or a bare path); record removal context with --message \"<why removed>\".`,\n EXIT_CODE.USAGE,\n );\n }\n assertNoUnknownCsvKeys(kv, \"--remove\", LINKED_ARTIFACT_REMOVE_KEYS);\n if (!kv.path) {\n throw new PmCliError(\"--remove key/value form requires path=<value>\", EXIT_CODE.USAGE);\n }\n return kv.path;\n }\n return trimmed;\n });\n}\n\n/**\n * Implements parse migrate entries for the public runtime surface of this module.\n */\nexport function parseMigrateEntries(raw: string[] | undefined): PathMigration[] {\n if (!raw) return [];\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--migrate\");\n assertNoUnknownCsvKeys(kv, \"--migrate\", LINKED_ARTIFACT_MIGRATE_KEYS);\n const from = kv.from?.trim();\n const to = kv.to?.trim();\n if (!from || !to) {\n throw new PmCliError(\"--migrate requires from=<value> and to=<value>\", EXIT_CODE.USAGE);\n }\n return { from, to };\n });\n}\n\n/**\n * Implements apply path migrations for the public runtime surface of this module.\n */\nexport function applyPathMigrations(artifactPath: string, migrations: PathMigration[]): string {\n let next = artifactPath;\n for (const migration of migrations) {\n if (next.startsWith(migration.from)) {\n next = `${migration.to}${next.slice(migration.from.length)}`;\n }\n }\n return next;\n}\n\n/**\n * Implements normalize linked path for the public runtime surface of this module.\n */\nexport function normalizeLinkedPath(value: string): string {\n return value.split(path.sep).join(\"/\");\n}\n\n/**\n * Implements expand add glob entries for the public runtime surface of this module.\n */\nexport async function expandAddGlobEntries(entries: AddGlobEntry[]): Promise<LinkedArtifact[]> {\n const expanded: LinkedArtifact[] = [];\n for (const entry of entries) {\n const absolutePattern = path.isAbsolute(entry.pattern);\n const matches = await fg(entry.pattern, {\n cwd: process.cwd(),\n absolute: absolutePattern,\n onlyFiles: true,\n dot: true,\n unique: true,\n followSymbolicLinks: true,\n });\n const sortedMatches = [...new Set(matches.map((match) => normalizeLinkedPath(path.normalize(match))))].sort((left, right) =>\n left.localeCompare(right),\n );\n for (const matchedPath of sortedMatches) {\n expanded.push({\n path: matchedPath,\n scope: entry.scope,\n note: entry.note,\n });\n }\n }\n return expanded;\n}\n\n/**\n * GH-170 (pm-pfnx): apply a standalone --note to the links added in this\n * invocation. Semantics (documented on pm-pfnx): the note is attached to EVERY\n * entry added via --add/--add-glob so a single flag annotates the whole batch\n * predictably; a per-entry embedded `note=` wins over the standalone flag; and\n * --note without any --add/--add-glob flag is a usage error because there is\n * nothing to annotate (it never retro-edits existing links). `hasAddFlags`\n * reflects flag presence, not match count, so a glob that legitimately matches\n * zero files is not an error.\n */\nexport function applyStandaloneNote(\n adds: LinkedArtifact[],\n note: string | undefined,\n hasAddFlags: boolean,\n): LinkedArtifact[] {\n if (note === undefined) {\n return adds;\n }\n if (!hasAddFlags) {\n throw new PmCliError(\n \"--note requires --add or --add-glob in the same invocation (the note annotates the links being added)\",\n EXIT_CODE.USAGE,\n );\n }\n const trimmed = note.trim();\n if (trimmed.length === 0) {\n return adds;\n }\n return adds.map((entry) => (entry.note === undefined ? { ...entry, note: trimmed } : entry));\n}\n\n/**\n * Implements artifact key for the public runtime surface of this module.\n */\nexport function artifactKey(value: Pick<LinkedArtifact, \"path\" | \"scope\">): string {\n return `${value.path}::${value.scope}`;\n}\n\n/**\n * Implements sort linked artifacts for the public runtime surface of this module.\n */\nexport function sortLinkedArtifacts(artifacts: LinkedArtifact[]): LinkedArtifact[] {\n return [...artifacts].sort((left, right) => {\n const byPath = left.path.localeCompare(right.path);\n if (byPath !== 0) return byPath;\n return left.scope.localeCompare(right.scope);\n });\n}\n\n/**\n * Implements dedupe linked artifacts for the public runtime surface of this module.\n */\nexport function dedupeLinkedArtifacts(artifacts: LinkedArtifact[]): LinkedArtifact[] {\n return [...new Map(artifacts.map((entry) => [artifactKey(entry), entry])).values()].map((entry) => ({\n ...entry,\n note: entry.note?.trim() || undefined,\n }));\n}\n\n/**\n * Implements validate linked paths for the public runtime surface of this module.\n */\nexport async function validateLinkedPaths(paths: string[]): Promise<LinkedPathValidation> {\n const uniquePaths = [...new Set(paths)].sort((left, right) => left.localeCompare(right));\n const existingFiles: string[] = [];\n const missingPaths: string[] = [];\n const nonFilePaths: string[] = [];\n const remoteReferences: string[] = [];\n for (const relativePath of uniquePaths) {\n // Remote references (https:// PR/issue/design-doc URLs) are not local\n // files; report them separately (trimmed, to match buildFilesCheck's\n // output shape) instead of probing a meaningless path.\n if (isRemoteLinkedArtifactReference(relativePath)) {\n remoteReferences.push(relativePath.trim());\n continue;\n }\n const resolvedPath = path.isAbsolute(relativePath) ? relativePath : path.resolve(process.cwd(), relativePath);\n try {\n const stats = await fs.stat(resolvedPath);\n if (stats.isFile()) {\n existingFiles.push(relativePath);\n } else {\n nonFilePaths.push(relativePath);\n }\n } catch (error: unknown) {\n if (typeof error === \"object\" && error !== null && \"code\" in error && (error as { code?: string }).code === \"ENOENT\") {\n missingPaths.push(relativePath);\n continue;\n }\n nonFilePaths.push(relativePath);\n }\n }\n return {\n checked: uniquePaths.length,\n existing_files: existingFiles,\n missing_paths: missingPaths,\n non_file_paths: nonFilePaths,\n remote_references: remoteReferences,\n };\n}\n\n/**\n * Implements build linked path audit for the public runtime surface of this module.\n */\nexport function buildLinkedPathAudit(\n paths: string[],\n allItems: Array<{ id: string; artifacts?: LinkedArtifact[] }>,\n): LinkedPathAuditEntry[] {\n const index = new Map<string, Set<string>>();\n for (const item of allItems) {\n for (const linkedArtifact of item.artifacts ?? []) {\n const seen = index.get(linkedArtifact.path) ?? new Set<string>();\n seen.add(item.id);\n index.set(linkedArtifact.path, seen);\n }\n }\n return [...new Set(paths)]\n .sort((left, right) => left.localeCompare(right))\n .map((linkedPath) => {\n const linkedIds = [...(index.get(linkedPath) ?? new Set<string>())].sort((left, right) => left.localeCompare(right));\n return {\n path: linkedPath,\n linked_by_count: linkedIds.length,\n linked_item_ids: linkedIds,\n };\n });\n}\n\n/**\n * Shared linked-artifact list/mutate command core used by runFiles and runDocs.\n * The kind config selects metadata key, op, bare-path noun, and whether\n * append-stable ordering is honored, preserving each twin's exact semantics.\n */\nexport async function runLinkedArtifacts(\n id: string,\n options: LinkedArtifactCommandOptions,\n global: GlobalOptions,\n config: LinkedArtifactKindConfig,\n): Promise<LinkedArtifactResult> {\n const { metadataKey } = config;\n const stdinResolver = createStdinTokenResolver();\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 resolvedAdds = await stdinResolver.resolveList(options.add, \"--add\");\n const resolvedAddGlobs = await stdinResolver.resolveList(options.addGlob, \"--add-glob\");\n const resolvedRemoves = await stdinResolver.resolveList(options.remove, \"--remove\");\n const resolvedMigrations = await stdinResolver.resolveList(options.migrate, \"--migrate\");\n const parsedAdds = parseAddEntries(resolvedAdds, config.bareNoun);\n const addGlobs = parseAddGlobEntries(resolvedAddGlobs);\n const expandedGlobAdds = await expandAddGlobEntries(addGlobs);\n const adds = applyStandaloneNote(\n [...parsedAdds, ...expandedGlobAdds],\n options.note,\n parsedAdds.length > 0 || addGlobs.length > 0,\n );\n const removes = parseRemoveEntries(resolvedRemoves);\n const migrations = parseMigrateEntries(resolvedMigrations);\n const shouldMutate = adds.length > 0 || removes.length > 0 || migrations.length > 0;\n\n const collectAuditItems = async (): Promise<Array<{ id: string; artifacts?: LinkedArtifact[] }>> =>\n (await listAllFrontMatter(pmRoot, settings.item_format, typeRegistry.type_to_folder, undefined, settings.schema)).map((entry) => ({\n id: entry.id,\n artifacts: (entry as Record<string, unknown>)[metadataKey] as LinkedArtifact[] | undefined,\n }));\n\n if (!shouldMutate) {\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 artifacts = ((loaded.document.metadata as Record<string, unknown>)[metadataKey] as LinkedArtifact[] | undefined) ?? [];\n return {\n id: located.id,\n artifacts,\n changed: false,\n count: artifacts.length,\n validation: options.validatePaths ? await validateLinkedPaths(artifacts.map((entry) => entry.path)) : undefined,\n audit: options.audit ? buildLinkedPathAudit(artifacts.map((entry) => entry.path), await collectAuditItems()) : undefined,\n };\n }\n\n const author = resolveAuthor(options.author, settings.author_default);\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: config.op,\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n const metadata = document.metadata as Record<string, unknown>;\n const next = [...((metadata[metadataKey] as LinkedArtifact[] | undefined) ?? [])];\n let migrationCount = 0;\n if (migrations.length > 0) {\n for (let index = 0; index < next.length; index += 1) {\n const migratedPath = applyPathMigrations(next[index].path, migrations);\n if (migratedPath !== next[index].path) {\n next[index] = { ...next[index], path: migratedPath };\n migrationCount += 1;\n }\n }\n }\n const migratedAdds = adds.map((entry) => {\n const migratedPath = applyPathMigrations(entry.path, migrations);\n if (migratedPath !== entry.path) {\n migrationCount += 1;\n }\n return {\n ...entry,\n path: migratedPath,\n };\n });\n const migratedRemoves = removes.map((entry) => applyPathMigrations(entry, migrations));\n for (const add of migratedAdds) {\n const exists = next.some((entry) => entry.path === add.path && entry.scope === add.scope);\n if (!exists) {\n next.push(add);\n }\n }\n if (migratedRemoves.length > 0) {\n for (let i = next.length - 1; i >= 0; i -= 1) {\n if (migratedRemoves.includes(next[i].path)) {\n next.splice(i, 1);\n }\n }\n }\n const deduped = dedupeLinkedArtifacts(next);\n const normalized = config.supportsAppendStable && options.appendStable ? deduped : sortLinkedArtifacts(deduped);\n if (normalized.length > 0) {\n metadata[metadataKey] = normalized;\n } else {\n delete metadata[metadataKey];\n }\n return { changedFields: [metadataKey], warnings: migrationCount > 0 ? [`path_migrations_applied:${migrationCount}`] : [] };\n },\n });\n\n const artifacts = ((result.item as Record<string, unknown>)[metadataKey] as LinkedArtifact[] | undefined) ?? [];\n const migrationWarning = result.warnings.find((warning) => warning.startsWith(\"path_migrations_applied:\"));\n const migrationCount = migrationWarning ? Number(migrationWarning.slice(\"path_migrations_applied:\".length)) : 0;\n const allItems = options.audit ? await collectAuditItems() : [];\n return {\n id: result.item.id,\n artifacts,\n changed: true,\n count: artifacts.length,\n migrations_applied: migrationCount > 0 ? migrationCount : undefined,\n validation: options.validatePaths ? await validateLinkedPaths(artifacts.map((entry) => entry.path)) : undefined,\n audit: options.audit ? buildLinkedPathAudit(artifacts.map((entry) => entry.path), allItems) : undefined,\n };\n}\n\n/**\n * Re-key the generic `artifacts` field to the resource-specific name (files/docs)\n * while preserving the original key order and presence so kind-specific result\n * shapes (and their deterministic JSON key ordering) stay byte-identical.\n */\nexport function renameArtifactsResultKey(result: LinkedArtifactResult, key: \"files\" | \"docs\"): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [field, value] of Object.entries(result)) {\n out[field === \"artifacts\" ? key : field] = value;\n }\n return out;\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,OAAO,QAAQ;AACf,OAAO,UAAU;AACjB,OAAO,QAAQ;;;;;;;;AAgCR,IAAM,2BAA2B,CAAC,QAAQ,SAAS,MAAM;AACzD,IAAM,gCAAgC,CAAC,WAAW,QAAQ,QAAQ,SAAS,MAAM;AACjF,IAAM,8BAA8B,CAAC,MAAM;AAC3C,IAAM,+BAA+B,CAAC,QAAQ,IAAI;AAMzD,IAAM,0CAA+D,oBAAI,IAAI,CAAC,QAAQ,OAAO,CAAC;AAwGxF,SAAU,YAAY,KAAuB;AACjD,QAAM,QAAS,OAAO;AACtB,MAAI,CAAC,aAAa,SAAS,KAAK,GAAG;AACjC,UAAM,IAAI,WACR,kBAAkB,GAAG,oBAAoB,aAAa,KAAK,IAAI,CAAC,wBAChE,UAA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MAAM,GAAG;AACnD,QAAI,UAAU,cAAc,MAAM,KAAK,IAAI;EAC7C;AACA,SAAO;AACT;",
|
|
6
6
|
"names": ["global", "artifacts", "migrationCount"]
|
|
7
7
|
}
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
collectBlockedByIds
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5VAZHYVQ.js";
|
|
4
4
|
import {
|
|
5
|
+
PmCliError,
|
|
5
6
|
buildItemNotFoundError,
|
|
7
|
+
isTerminalStatus,
|
|
6
8
|
listAllFrontMatterLight,
|
|
7
9
|
locateItem,
|
|
8
10
|
mutateItem,
|
|
9
11
|
readLocatedItem,
|
|
12
|
+
readSettings,
|
|
10
13
|
toItemRecord
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
isTerminalStatus
|
|
14
|
-
} from "./chunk-NMP5I3I5.js";
|
|
15
|
-
import {
|
|
16
|
-
PmCliError,
|
|
17
|
-
readSettings
|
|
18
|
-
} from "./chunk-SHQY2IDC.js";
|
|
14
|
+
} from "./chunk-BPJ5NYSJ.js";
|
|
19
15
|
import {
|
|
20
16
|
EXIT_CODE,
|
|
21
17
|
getSettingsPath,
|
|
@@ -23,7 +19,7 @@ import {
|
|
|
23
19
|
resolveItemTypeRegistry,
|
|
24
20
|
resolvePmRoot,
|
|
25
21
|
resolveRuntimeStatusRegistry
|
|
26
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-2BVD4ZD2.js";
|
|
27
23
|
|
|
28
24
|
// dist/cli/commands/close.js
|
|
29
25
|
!(function() {
|
|
@@ -444,4 +440,4 @@ export {
|
|
|
444
440
|
_testOnlyCloseCommand,
|
|
445
441
|
runClose
|
|
446
442
|
};
|
|
447
|
-
//# sourceMappingURL=chunk-
|
|
443
|
+
//# sourceMappingURL=chunk-RDJXIAJB.js.map
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../../cli/commands/close.ts"],
|
|
4
4
|
"sourcesContent": ["/**\n * @module cli/commands/close\n *\n * Implements the pm close command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { collectBlockedByIds } from \"../../core/item/actionability.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } 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 {\n buildItemNotFoundError,\n listAllFrontMatterLight,\n locateItem,\n mutateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter } from \"../../types/index.js\";\n\n/**\n * Documents the close command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseCommandOptions {\n author?: string;\n message?: string;\n validateClose?: string;\n force?: boolean;\n // pm-fl0c #11 (2026-05-28): allow setting the three closure validation\n // fields inline on `pm close` so agents do not have to issue a prior\n // `pm update` just to satisfy --validate-close warn|strict. These map 1:1\n // to ItemFrontMatter.{resolution,expected_result,actual_result}.\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n duplicateOf?: string;\n}\n\n/**\n * Documents the close result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n warnings: string[];\n}\n\ninterface AutoUnblockCandidate {\n id: string;\n blocker_ids: string[];\n}\n\ntype CloseInlineFieldKey = \"resolution\" | \"expected_result\" | \"actual_result\";\n\ninterface CloseMutationContext {\n statusRegistry: RuntimeStatusRegistry;\n force: boolean | undefined;\n options: CloseCommandOptions;\n duplicateOf: string | undefined;\n validateCloseMode: ValidateCloseMode;\n activeChildIds: string[];\n closeReason: string | undefined;\n}\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed || \"unknown\";\n}\n\nfunction normalizeCloseReason(reasonText: string | undefined, required: boolean): string | undefined {\n const reason = (reasonText ?? \"\").trim();\n if (reason.length > 0) {\n return reason;\n }\n if (required) {\n throw new PmCliError(\n \"Close reason text is required because governance.require_close_reason is enabled\",\n EXIT_CODE.USAGE,\n {\n code: \"close_reason_required\",\n required: \"Provide a one-line closing summary as the positional text, --reason, or --message.\",\n why: \"governance.require_close_reason is enabled, so every close must record why the item is done.\",\n examples: [\n 'pm close <id> \"Done: <what changed and why>\"',\n 'pm close <id> --reason \"<closing summary>\"',\n 'pm close <id> -m \"<closing summary>\"',\n \"pm close <id> --duplicate-of <canonical-id>\",\n ],\n nextSteps: [\n \"Re-run the close with a closing summary.\",\n 'When closing as a duplicate, --duplicate-of <id> auto-fills the close reason as \"Duplicate of <id>\".',\n \"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled\",\n ],\n },\n );\n }\n return undefined;\n}\n\ntype ValidateCloseMode = \"off\" | \"warn\" | \"strict\";\n\ninterface CloseReasonFallbackInput {\n closeReasonText: string | undefined;\n duplicateOf: string | undefined;\n resolution: string | undefined;\n message: string | undefined;\n requireCloseReason: boolean;\n}\n\nfunction resolveEffectiveCloseReasonText(input: CloseReasonFallbackInput): string | undefined {\n if ((input.closeReasonText ?? \"\").trim().length > 0) {\n return input.closeReasonText;\n }\n if (input.duplicateOf !== undefined) {\n return `Duplicate of ${input.duplicateOf}`;\n }\n const trimmedResolution = typeof input.resolution === \"string\" ? input.resolution.trim() : \"\";\n if (trimmedResolution.length > 0) {\n return trimmedResolution;\n }\n const trimmedMessage = typeof input.message === \"string\" ? input.message.trim() : \"\";\n if (input.requireCloseReason && trimmedMessage.length > 0) {\n return trimmedMessage;\n }\n return input.closeReasonText;\n}\n\nconst CLOSE_VALIDATION_FIELDS: Array<{ key: keyof Pick<ItemFrontMatter, \"resolution\" | \"expected_result\" | \"actual_result\">; label: string }> = [\n { key: \"resolution\", label: \"resolution\" },\n { key: \"expected_result\", label: \"expected_result\" },\n { key: \"actual_result\", label: \"actual_result\" },\n];\n\nfunction parseValidateCloseMode(raw: string | undefined): ValidateCloseMode | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0 || normalized === \"warn\") {\n return \"warn\";\n }\n if (normalized === \"off\" || normalized === \"none\" || normalized === \"disabled\") {\n return \"off\";\n }\n if (normalized === \"strict\") {\n return \"strict\";\n }\n throw new PmCliError(`Invalid --validate-close mode \"${raw}\" (expected \"off\", \"warn\", or \"strict\")`, EXIT_CODE.USAGE);\n}\n\nfunction findMissingCloseValidationFields(frontMatter: ItemFrontMatter): string[] {\n const missing: string[] = [];\n for (const field of CLOSE_VALIDATION_FIELDS) {\n const rawValue = frontMatter[field.key];\n if (typeof rawValue !== \"string\" || rawValue.trim().length === 0) {\n missing.push(field.label);\n }\n }\n return missing;\n}\n\nasync function duplicateChainReferencesClosingItem(\n loadItemById: (id: string) => Promise<ItemFrontMatter | null>,\n initialDuplicateOf: unknown,\n closingId: string,\n): Promise<boolean> {\n const visited = new Set<string>();\n let current = initialDuplicateOf;\n while (typeof current === \"string\" && current.trim().length > 0) {\n const currentId = current.trim();\n if (currentId === closingId) {\n return true;\n }\n if (visited.has(currentId)) {\n return false;\n }\n visited.add(currentId);\n current = (await loadItemById(currentId))?.duplicate_of;\n }\n return false;\n}\n\nfunction shouldApplyDuplicateFallback(value: unknown): boolean {\n return typeof value !== \"string\" || value.trim().length === 0;\n}\n\nasync function assertDuplicateTargetExists(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n duplicateOf: string | undefined,\n closingId: string,\n): Promise<string | undefined> {\n const rawTarget = duplicateOf?.trim();\n if (!rawTarget) {\n return undefined;\n }\n if (rawTarget === closingId) {\n throw new PmCliError(\"An item cannot be closed as a duplicate of itself.\", EXIT_CODE.USAGE, {\n code: \"duplicate_target_self\",\n why: \"--duplicate-of must identify the canonical item that should remain open or already represent the work.\",\n });\n }\n const typeRegistry = resolveItemTypeRegistry(settings);\n const itemCache = new Map<string, ItemFrontMatter | null>();\n const loadItemById = async (id: string): Promise<ItemFrontMatter | null> => {\n if (itemCache.has(id)) {\n return itemCache.get(id) ?? null;\n }\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n itemCache.set(id, null);\n return null;\n }\n const { document } = await readLocatedItem(located, { schema: settings.schema });\n itemCache.set(id, document.metadata);\n return document.metadata;\n };\n const target = await loadItemById(rawTarget);\n if (!target) {\n throw new PmCliError(`Duplicate target \"${rawTarget}\" was not found. Create or locate the canonical item first.`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_missing\",\n why: \"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.\",\n examples: [`pm close ${closingId} \"Duplicate of ${rawTarget}\" --duplicate-of ${rawTarget}`],\n nextSteps: [\"Run pm search/list to find the canonical item, then retry with --duplicate-of <id>.\"],\n });\n }\n if (await duplicateChainReferencesClosingItem(loadItemById, target.duplicate_of, closingId)) {\n throw new PmCliError(`Circular duplicate reference detected. Target \"${rawTarget}\" points back to \"${closingId}\".`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_circular\",\n why: \"Circular duplicate relationships create loops for dedupe and status propagation tooling.\",\n nextSteps: [\"Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate.\"],\n });\n }\n if (typeof target.duplicate_of === \"string\" && target.duplicate_of.trim().length > 0) {\n throw new PmCliError(`Duplicate target \"${rawTarget}\" is already marked as a duplicate of \"${target.duplicate_of.trim()}\".`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_is_duplicate\",\n why: \"Duplicate closure should point directly at the canonical item, not another duplicate.\",\n examples: [`pm close ${closingId} \"Duplicate of ${target.duplicate_of.trim()}\" --duplicate-of ${target.duplicate_of.trim()}`],\n nextSteps: [\"Use the canonical item referenced by duplicate_of as the --duplicate-of target.\"],\n });\n }\n return target.id;\n}\n\nasync function findActiveChildIds(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n parentId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n return items\n .filter((item) => item.parent === parentId && !isTerminalStatus(item.status, statusRegistry))\n .map((item) => item.id)\n .sort((left, right) => left.localeCompare(right));\n}\n\nasync function findAutoUnblockCandidates(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<AutoUnblockCandidate[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const itemsById = new Map(items.map((item) => [item.id, item]));\n const blockedStatuses = statusRegistry.blocked_statuses;\n return items\n .filter((item) => blockedStatuses.has(item.status))\n .map((item) => ({ item, blockerIds: collectBlockedByIds(item) }))\n .filter(({ blockerIds }) => blockerIds.includes(closedId))\n .filter(({ blockerIds }) =>\n blockerIds.every((blockerId) => {\n const blocker = itemsById.get(blockerId);\n return blocker !== undefined && isTerminalStatus(blocker.status, statusRegistry);\n }),\n )\n .map(({ item, blockerIds }) => ({ id: item.id, blocker_ids: blockerIds }))\n .sort((left, right) => left.id.localeCompare(right.id));\n}\n\nasync function autoUnblockResolvedDependents(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n author: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const candidates = await findAutoUnblockCandidates(pmRoot, settings, closedId, statusRegistry);\n const warnings: string[] = [];\n for (const candidate of candidates) {\n try {\n const unblocked = await mutateItem({\n pmRoot,\n settings,\n id: candidate.id,\n op: \"update\",\n author,\n message: `Auto-unblocked after blocker ${closedId} closed`,\n mutate(document) {\n /* c8 ignore start -- normal auto-unblock candidates carry dependency metadata; fallback preserves hand-edited scalar-only blockers. */\n const dependencies = document.metadata.dependencies ?? [];\n /* c8 ignore stop */\n const remainingDependencies = dependencies.filter((dependency) => {\n const dependencyId = dependency.id.trim();\n return dependency.kind !== \"blocked_by\" || !candidate.blocker_ids.includes(dependencyId);\n });\n document.metadata.status = statusRegistry.open_status;\n delete document.metadata.blocked_by;\n delete document.metadata.blocked_reason;\n document.metadata.unblock_note = `Auto-unblocked after blocker ${closedId} closed; all blockers resolved (${candidate.blocker_ids.join(\", \")}).`;\n if (remainingDependencies.length > 0) {\n document.metadata.dependencies = remainingDependencies;\n } else {\n delete document.metadata.dependencies;\n }\n const changedFields = [\"status\", \"blocked_by\", \"blocked_reason\", \"unblock_note\"];\n if (remainingDependencies.length !== dependencies.length) {\n changedFields.push(\"dependencies\");\n }\n return {\n changedFields,\n };\n },\n });\n warnings.push(`auto_unblocked:${unblocked.item.id}:resolved_blockers=${candidate.blocker_ids.join(\",\")}`);\n /* c8 ignore start -- defensive fan-out failure path; normal lock/claim state is auditable and still unblocks. */\n } catch (error) {\n const reason = error instanceof Error ? error.message.replace(/\\s+/g, \" \").trim() : \"unknown\";\n warnings.push(`auto_unblock_failed:${candidate.id}:${reason}`);\n }\n /* c8 ignore stop */\n }\n return warnings;\n}\n\nfunction applyInlineCloseFields(metadata: ItemFrontMatter, options: CloseCommandOptions): CloseInlineFieldKey[] {\n const changedFields: CloseInlineFieldKey[] = [];\n const inlineCloseFields: Array<{ option: string | undefined; key: CloseInlineFieldKey }> = [\n { option: options.resolution, key: \"resolution\" },\n { option: options.expectedResult, key: \"expected_result\" },\n { option: options.actualResult, key: \"actual_result\" },\n ];\n for (const { option, key } of inlineCloseFields) {\n if (typeof option !== \"string\") {\n continue;\n }\n const trimmed = option.trim();\n if (trimmed.length === 0) {\n continue;\n }\n metadata[key] = trimmed;\n changedFields.push(key);\n }\n return changedFields;\n}\n\nfunction applyDuplicateCloseMetadata(metadata: ItemFrontMatter, duplicateOf: string | undefined): CloseInlineFieldKey[] {\n if (duplicateOf === undefined) {\n return [];\n }\n metadata.duplicate_of = duplicateOf;\n const duplicateFallbackFields: CloseInlineFieldKey[] = [];\n const fallbackValues: Array<{ key: CloseInlineFieldKey; value: string }> = [\n { key: \"resolution\", value: `Duplicate of ${duplicateOf}` },\n { key: \"expected_result\", value: `Canonical item ${duplicateOf} tracks the work.` },\n { key: \"actual_result\", value: `Closed as duplicate of ${duplicateOf}.` },\n ];\n for (const { key, value } of fallbackValues) {\n if (shouldApplyDuplicateFallback(metadata[key])) {\n metadata[key] = value;\n duplicateFallbackFields.push(key);\n }\n }\n return duplicateFallbackFields;\n}\n\nfunction collectCloseValidationWarnings(\n metadata: ItemFrontMatter,\n validateCloseMode: ValidateCloseMode,\n activeChildIds: string[],\n): string[] {\n const warnings: string[] = [];\n if (validateCloseMode !== \"off\") {\n const missingFields = findMissingCloseValidationFields(metadata);\n if (missingFields.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${metadata.id}: missing ${missingFields.join(\", \")}. Populate fields or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n warnings.push(`close_validation_missing_fields:${metadata.id}:${missingFields.join(\",\")}`);\n }\n if (activeChildIds.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${metadata.id}: active child items remain open (${activeChildIds.join(\", \")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n warnings.push(`close_validation_active_children:${metadata.id}:${activeChildIds.join(\",\")}`);\n }\n return warnings;\n }\n if (activeChildIds.length > 0) {\n warnings.push(`closed_with_active_children:${metadata.id}:${activeChildIds.join(\",\")}`);\n }\n return warnings;\n}\n\nfunction applyCloseReason(metadata: ItemFrontMatter, closeReason: string | undefined): string[] {\n if (closeReason !== undefined) {\n metadata.close_reason = closeReason;\n return [\"close_reason\"];\n }\n if (metadata.close_reason !== undefined) {\n delete metadata.close_reason;\n return [\"close_reason\"];\n }\n return [];\n}\n\nfunction clearCloseAssignee(metadata: ItemFrontMatter): string[] {\n if (metadata.assignee === undefined) {\n return [];\n }\n delete metadata.assignee;\n return [\"assignee\"];\n}\n\nfunction clearClosedBlockerSignals(metadata: ItemFrontMatter): { changedFields: string[]; warnings: string[] } {\n const previousBlockedBy = typeof metadata.blocked_by === \"string\" ? metadata.blocked_by.trim() : \"\";\n const existingDeps = metadata.dependencies ?? [];\n const blockedByEdge = existingDeps.find((dep) => dep.kind === \"blocked_by\");\n const hadBlockedReason = metadata.blocked_reason !== undefined;\n if (previousBlockedBy.length === 0 && blockedByEdge === undefined && !hadBlockedReason) {\n return { changedFields: [], warnings: [] };\n }\n const changedFields: string[] = [];\n if (previousBlockedBy.length > 0) {\n delete metadata.blocked_by;\n changedFields.push(\"blocked_by\");\n }\n if (hadBlockedReason) {\n delete metadata.blocked_reason;\n changedFields.push(\"blocked_reason\");\n }\n if (blockedByEdge !== undefined) {\n const remainingDeps = existingDeps.filter((dep) => dep.kind !== \"blocked_by\");\n if (remainingDeps.length > 0) {\n metadata.dependencies = remainingDeps;\n } else {\n delete metadata.dependencies;\n }\n changedFields.push(\"dependencies\");\n }\n // A stale reason-only close has no blocker identity; omit the blocker-clear warning instead of inventing one.\n const reportedBlocker = previousBlockedBy || blockedByEdge?.id;\n return {\n changedFields,\n warnings: reportedBlocker ? [`closed_cleared_blocked_by:${metadata.id}:${reportedBlocker}`] : [],\n };\n}\n\nfunction mutateCloseMetadata(metadata: ItemFrontMatter, context: CloseMutationContext): { changedFields: string[]; warnings?: string[] } {\n if (isTerminalStatus(metadata.status, context.statusRegistry) && !context.force) {\n throw new PmCliError(`Item ${metadata.id} is already terminal; use --force to close again.`, EXIT_CODE.CONFLICT);\n }\n const inlineChangedFields = applyInlineCloseFields(metadata, context.options);\n const duplicateFallbackFields = applyDuplicateCloseMetadata(metadata, context.duplicateOf);\n const mutationWarnings = collectCloseValidationWarnings(metadata, context.validateCloseMode, context.activeChildIds);\n metadata.status = context.statusRegistry.close_status;\n const changedFields = [\n \"status\",\n ...applyCloseReason(metadata, context.closeReason),\n ...inlineChangedFields,\n ];\n if (context.duplicateOf !== undefined) {\n changedFields.push(\"duplicate_of\");\n for (const key of duplicateFallbackFields) {\n /* v8 ignore start -- duplicate fallback keys are already pre-deduped by applyDuplicateCloseMetadata in covered close paths */\n if (!changedFields.includes(key)) {\n changedFields.push(key);\n }\n /* v8 ignore stop */\n }\n }\n changedFields.push(...clearCloseAssignee(metadata));\n const blockerCleanup = clearClosedBlockerSignals(metadata);\n changedFields.push(...blockerCleanup.changedFields);\n mutationWarnings.push(...blockerCleanup.warnings);\n return {\n changedFields,\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n}\n\nexport const _testOnlyCloseCommand = {\n blockedByIds: collectBlockedByIds,\n};\n\n/**\n * Implements run close for the public runtime surface of this module.\n */\nexport async function runClose(\n id: string,\n closeReasonText: string | undefined,\n options: CloseCommandOptions,\n global: GlobalOptions,\n): Promise<CloseResult> {\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\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = toAuthor(options.author, settings.author_default);\n // GH-250: verify the target item EXISTS before the governance close-reason\n // gate fires. Otherwise closing a typo'd id with no reason reports\n // \"Close reason text is required\" and hides the real cause (bad id) until a\n // reason is supplied. Existence is the more fundamental precondition, so it\n // is validated first regardless of whether a reason was provided.\n const typeToFolder = resolveItemTypeRegistry(settings).type_to_folder;\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeToFolder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeToFolder);\n }\n // GH-204: resolve the duplicate target BEFORE reason validation so\n // `pm close <id> --duplicate-of <canonical>` succeeds under\n // governance.require_close_reason without a manual reason — when no\n // positional/--reason text is provided the reason defaults to\n // \"Duplicate of <id>\" (mirroring the auto-filled closure metadata).\n // Explicit reason text still wins.\n const duplicateOf = await assertDuplicateTargetExists(pmRoot, settings, options.duplicateOf, id);\n // pm-7x8d / pm-9hry / GH-204: when no explicit positional/--reason text is given, derive\n // the close reason from the next-best closure signal instead of hard-blocking\n // under governance.require_close_reason. Precedence: explicit reason text >\n // --duplicate-of (\"Duplicate of <id>\") > --resolution summary > --message.\n // Resolution still writes metadata.resolution below; message still writes the\n // history entry through mutateItem. Reusing either as the close reason just lets\n // a single agent-authored close command succeed when it already supplied a\n // closure summary through another structured option.\n const effectiveCloseReasonText = resolveEffectiveCloseReasonText({\n closeReasonText,\n duplicateOf,\n resolution: options.resolution,\n message: options.message,\n requireCloseReason: settings.governance.require_close_reason,\n });\n const closeReason = normalizeCloseReason(effectiveCloseReasonText, settings.governance.require_close_reason);\n const validateCloseMode = parseValidateCloseMode(options.validateClose) ?? settings.governance.close_validation_default;\n // C3 (pm-fu5d): scan for active children even under minimal governance so\n // closing a parent is never silently orphaning — off mode emits an\n // informational note instead of the warn/strict validation warning.\n const activeChildIds = await findActiveChildIds(pmRoot, settings, id, statusRegistry);\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"close\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n return mutateCloseMetadata(document.metadata, {\n statusRegistry,\n force: options.force,\n options,\n duplicateOf,\n validateCloseMode,\n activeChildIds,\n closeReason,\n });\n },\n });\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n warnings: [\n ...result.warnings,\n ...(await autoUnblockResolvedDependents(pmRoot, settings, located.id, author, statusRegistry)),\n ],\n };\n}\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,SAAS,SAAS,WAA+B,eAAqB;AACpE,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI;AAC7B,SAAO,WAAW;AACpB;AAEA,SAAS,qBAAqB,YAAgC,UAAiB;AAC7E,QAAM,UAAU,cAAc,IAAI,KAAI;AACtC,MAAI,OAAO,SAAS,GAAG;AACrB,WAAO;EACT;AACA,MAAI,UAAU;AACZ,UAAM,IAAI,WACR,oFACA,UAAU,OACV;MACE,MAAM;MACN,UAAU;MACV,KAAK;MACL,UAAU;QACR;QACA;QACA;QACA;;MAEF,WAAW;QACT;QACA;QACA;;KAEH;EAEL;AACA,SAAO;AACT;AAYA,SAAS,gCAAgC,OAA+B;AACtE,OAAK,MAAM,mBAAmB,IAAI,KAAI,EAAG,SAAS,GAAG;AACnD,WAAO,MAAM;EACf;AACA,MAAI,MAAM,gBAAgB,QAAW;AACnC,WAAO,gBAAgB,MAAM,WAAW;EAC1C;AACA,QAAM,oBAAoB,OAAO,MAAM,eAAe,WAAW,MAAM,WAAW,KAAI,IAAK;AAC3F,MAAI,kBAAkB,SAAS,GAAG;AAChC,WAAO;EACT;AACA,QAAM,iBAAiB,OAAO,MAAM,YAAY,WAAW,MAAM,QAAQ,KAAI,IAAK;AAClF,MAAI,MAAM,sBAAsB,eAAe,SAAS,GAAG;AACzD,WAAO;EACT;AACA,SAAO,MAAM;AACf;AAEA,IAAM,0BAA0I;EAC9I,EAAE,KAAK,cAAc,OAAO,aAAY;EACxC,EAAE,KAAK,mBAAmB,OAAO,kBAAiB;EAClD,EAAE,KAAK,iBAAiB,OAAO,gBAAe;;AAGhD,SAAS,uBAAuB,KAAuB;AACrD,MAAI,QAAQ,Q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;AAGlG;",
|
|
6
6
|
"names": ["global"]
|
|
7
7
|
}
|
|
@@ -1,14 +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]="e5aa93b8-d63d-557c-9183-bbd636aa5dee")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
|
+
PmCliError,
|
|
4
5
|
normalizeItemId
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
PmCliError
|
|
8
|
-
} from "./chunk-E3SZTQ4K.js";
|
|
6
|
+
} from "./chunk-NTOOEVJ4.js";
|
|
9
7
|
import {
|
|
10
8
|
EXIT_CODE
|
|
11
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MFLLULHU.js";
|
|
12
10
|
|
|
13
11
|
// dist/core/item/parent-reference-policy.js
|
|
14
12
|
var PLACEHOLDER_REFERENCE_TOKENS = /* @__PURE__ */ new Set(["none", "null", "undefined"]);
|
|
@@ -97,6 +95,6 @@ export {
|
|
|
97
95
|
normalizeSprintReleaseFormatPolicy,
|
|
98
96
|
validateSprintOrReleaseValue
|
|
99
97
|
};
|
|
100
|
-
//# sourceMappingURL=chunk-
|
|
98
|
+
//# sourceMappingURL=chunk-RFHLRMLQ.js.map
|
|
101
99
|
|
|
102
|
-
//# debugId=
|
|
100
|
+
//# debugId=e5aa93b8-d63d-557c-9183-bbd636aa5dee
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/item/parent-reference-policy.ts","../../../../../../../../core/item/sprint-release-format.ts"],"sourcesContent":["/**\n * @module core/item/parent-reference-policy\n *\n * Defines item parsing, formatting, and lifecycle helpers for Parent Reference Policy.\n */\nimport type { ParentReferencePolicy } from \"../../types/index.js\";\nimport { normalizeItemId } from \"./id.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst PLACEHOLDER_REFERENCE_TOKENS = new Set([\"none\", \"null\", \"undefined\"]);\n\n/**\n * Implements normalize parent reference policy for the public runtime surface of this module.\n */\nexport function normalizeParentReferencePolicy(value: string | undefined): ParentReferencePolicy {\n const normalized = value?.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized === \"warn\" || normalized === \"strict_error\") {\n return normalized;\n }\n if (normalized === \"strict\") {\n return \"strict_error\";\n }\n throw new PmCliError(\n \"Config set parent-reference-policy requires --policy with one of: warn, strict_error (alias: strict)\",\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Implements normalize parent reference value for the public runtime surface of this module.\n */\nexport function normalizeParentReferenceValue(rawValue: unknown): string {\n if (typeof rawValue !== \"string\") {\n throw new PmCliError(\"--parent must be a string. Use --unset parent to clear this field.\", EXIT_CODE.USAGE);\n }\n const value = rawValue.trim();\n if (value.length === 0) {\n throw new PmCliError(\"--parent must not be empty. Use --parent none to unset.\", EXIT_CODE.USAGE);\n }\n if (isPlaceholderReferenceToken(value)) {\n throw new PmCliError(\n `--parent must not use placeholder token \"${value}\". Use --unset parent to clear this field.`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/**\n * Detects parent-style placeholder tokens that should never become stored ids.\n */\nexport function isPlaceholderReferenceToken(value: string): boolean {\n return PLACEHOLDER_REFERENCE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/**\n * Implements validate missing parent reference for the public runtime surface of this module.\n */\nexport function validateMissingParentReference(\n parentId: string,\n policy: ParentReferencePolicy,\n): { warnings: string[] } {\n if (policy === \"strict_error\") {\n throw new PmCliError(\n `Parent item \"${parentId}\" was not found. Create it first or use --parent none.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n warnings: [`validation_warning:parent_reference_missing:${parentId}`],\n };\n}\n\n/**\n * Rejects the one-node hierarchy cycle where an item points at itself.\n */\nexport function assertParentReferenceIsNotSelf(itemId: string, parentId: string, prefix: string): void {\n const normalizedItemId = normalizeItemId(itemId, prefix);\n const normalizedParentId = normalizeItemId(parentId, prefix);\n if (normalizedItemId !== normalizedParentId) {\n return;\n }\n const normalizationDetail =\n parentId !== normalizedParentId || itemId !== normalizedItemId\n ? ` (normalized from parent \"${parentId}\" and item \"${itemId}\")`\n : \"\";\n throw new PmCliError(\n `Parent item \"${normalizedParentId}\" cannot be the same as item \"${normalizedItemId}\"${normalizationDetail}. Use --unset parent to clear this field.`,\n EXIT_CODE.USAGE,\n );\n}\n","/**\n * @module core/item/sprint-release-format\n *\n * Defines item parsing, formatting, and lifecycle helpers for Sprint Release Format.\n */\nimport type { SprintReleaseFormatPolicy } from \"../../types/index.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst SPRINT_RELEASE_VALUE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;\nconst SPRINT_RELEASE_MAX_LENGTH = 64;\n\n/**\n * Implements normalize sprint release format policy for the public runtime surface of this module.\n */\nexport function normalizeSprintReleaseFormatPolicy(value: string | undefined): SprintReleaseFormatPolicy {\n const normalized = value?.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized === \"warn\" || normalized === \"strict_error\") {\n return normalized;\n }\n if (normalized === \"strict\") {\n return \"strict_error\";\n }\n throw new PmCliError(\n \"Config set sprint-release-format-policy requires --policy with one of: warn, strict_error (alias: strict)\",\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Implements validate sprint or release value for the public runtime surface of this module.\n */\nexport function validateSprintOrReleaseValue(\n field: \"sprint\" | \"release\",\n rawValue: string,\n policy: SprintReleaseFormatPolicy,\n): { value: string; warnings: string[] } {\n const value = rawValue.trim();\n if (value.length === 0) {\n throw new PmCliError(`--${field} must not be empty. Use --${field} none to unset.`, EXIT_CODE.USAGE);\n }\n const isValid = value.length <= SPRINT_RELEASE_MAX_LENGTH && SPRINT_RELEASE_VALUE_PATTERN.test(value);\n if (isValid) {\n return { value, warnings: [] };\n }\n const guidance = \"Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._/-]* (no spaces).\";\n if (policy === \"strict_error\") {\n throw new PmCliError(`Invalid --${field} value \"${value}\". ${guidance}`, EXIT_CODE.USAGE);\n }\n return {\n value,\n warnings: [`validation_warning:${field}_format:${value}`],\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../core/item/parent-reference-policy.ts","../../../../../../../../core/item/sprint-release-format.ts"],"sourcesContent":["/**\n * @module core/item/parent-reference-policy\n *\n * Defines item parsing, formatting, and lifecycle helpers for Parent Reference Policy.\n */\nimport type { ParentReferencePolicy } from \"../../types/index.js\";\nimport { normalizeItemId } from \"./id.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst PLACEHOLDER_REFERENCE_TOKENS = new Set([\"none\", \"null\", \"undefined\"]);\n\n/**\n * Implements normalize parent reference policy for the public runtime surface of this module.\n */\nexport function normalizeParentReferencePolicy(value: string | undefined): ParentReferencePolicy {\n const normalized = value?.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized === \"warn\" || normalized === \"strict_error\") {\n return normalized;\n }\n if (normalized === \"strict\") {\n return \"strict_error\";\n }\n throw new PmCliError(\n \"Config set parent-reference-policy requires --policy with one of: warn, strict_error (alias: strict)\",\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Implements normalize parent reference value for the public runtime surface of this module.\n */\nexport function normalizeParentReferenceValue(rawValue: unknown): string {\n if (typeof rawValue !== \"string\") {\n throw new PmCliError(\"--parent must be a string. Use --unset parent to clear this field.\", EXIT_CODE.USAGE);\n }\n const value = rawValue.trim();\n if (value.length === 0) {\n throw new PmCliError(\"--parent must not be empty. Use --parent none to unset.\", EXIT_CODE.USAGE);\n }\n if (isPlaceholderReferenceToken(value)) {\n throw new PmCliError(\n `--parent must not use placeholder token \"${value}\". Use --unset parent to clear this field.`,\n EXIT_CODE.USAGE,\n );\n }\n return value;\n}\n\n/**\n * Detects parent-style placeholder tokens that should never become stored ids.\n */\nexport function isPlaceholderReferenceToken(value: string): boolean {\n return PLACEHOLDER_REFERENCE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/**\n * Implements validate missing parent reference for the public runtime surface of this module.\n */\nexport function validateMissingParentReference(\n parentId: string,\n policy: ParentReferencePolicy,\n): { warnings: string[] } {\n if (policy === \"strict_error\") {\n throw new PmCliError(\n `Parent item \"${parentId}\" was not found. Create it first or use --parent none.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n warnings: [`validation_warning:parent_reference_missing:${parentId}`],\n };\n}\n\n/**\n * Rejects the one-node hierarchy cycle where an item points at itself.\n */\nexport function assertParentReferenceIsNotSelf(itemId: string, parentId: string, prefix: string): void {\n const normalizedItemId = normalizeItemId(itemId, prefix);\n const normalizedParentId = normalizeItemId(parentId, prefix);\n if (normalizedItemId !== normalizedParentId) {\n return;\n }\n const normalizationDetail =\n parentId !== normalizedParentId || itemId !== normalizedItemId\n ? ` (normalized from parent \"${parentId}\" and item \"${itemId}\")`\n : \"\";\n throw new PmCliError(\n `Parent item \"${normalizedParentId}\" cannot be the same as item \"${normalizedItemId}\"${normalizationDetail}. Use --unset parent to clear this field.`,\n EXIT_CODE.USAGE,\n );\n}\n","/**\n * @module core/item/sprint-release-format\n *\n * Defines item parsing, formatting, and lifecycle helpers for Sprint Release Format.\n */\nimport type { SprintReleaseFormatPolicy } from \"../../types/index.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { PmCliError } from \"../shared/errors.js\";\n\nconst SPRINT_RELEASE_VALUE_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._/-]*$/;\nconst SPRINT_RELEASE_MAX_LENGTH = 64;\n\n/**\n * Implements normalize sprint release format policy for the public runtime surface of this module.\n */\nexport function normalizeSprintReleaseFormatPolicy(value: string | undefined): SprintReleaseFormatPolicy {\n const normalized = value?.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized === \"warn\" || normalized === \"strict_error\") {\n return normalized;\n }\n if (normalized === \"strict\") {\n return \"strict_error\";\n }\n throw new PmCliError(\n \"Config set sprint-release-format-policy requires --policy with one of: warn, strict_error (alias: strict)\",\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Implements validate sprint or release value for the public runtime surface of this module.\n */\nexport function validateSprintOrReleaseValue(\n field: \"sprint\" | \"release\",\n rawValue: string,\n policy: SprintReleaseFormatPolicy,\n): { value: string; warnings: string[] } {\n const value = rawValue.trim();\n if (value.length === 0) {\n throw new PmCliError(`--${field} must not be empty. Use --${field} none to unset.`, EXIT_CODE.USAGE);\n }\n const isValid = value.length <= SPRINT_RELEASE_MAX_LENGTH && SPRINT_RELEASE_VALUE_PATTERN.test(value);\n if (isValid) {\n return { value, warnings: [] };\n }\n const guidance = \"Expected 1-64 characters matching [A-Za-z0-9][A-Za-z0-9._/-]* (no spaces).\";\n if (policy === \"strict_error\") {\n throw new PmCliError(`Invalid --${field} value \"${value}\". ${guidance}`, EXIT_CODE.USAGE);\n }\n return {\n value,\n warnings: [`validation_warning:${field}_format:${value}`],\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAUA,IAAM,+BAA+B,oBAAI,IAAI,CAAC,QAAQ,QAAQ,WAAW,CAAC;AAKpE,SAAU,+BAA+B,OAAyB;AACtE,QAAM,aAAa,OAAO,KAAI,EAAG,YAAW,EAAG,WAAW,KAAK,GAAG;AAClE,MAAI,eAAe,UAAU,eAAe,gBAAgB;AAC1D,WAAO;EACT;AACA,MAAI,eAAe,UAAU;AAC3B,WAAO;EACT;AACA,QAAM,IAAI,WACR,wGACA,UAAU,KAAK;AAE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EnB;AAKM,SAAU,6BACd,OACA,UACA,QAAiC;AAEjC,QAAM,QAAQ,SAAS,KAAI;AAC3B,MAAI,MAAM,WAAW,GAAG;AACtB,UAAM,IAAI,WAAW,KAAK,KAAK,6BAA6B,KAAK,mBAAmB,UAAU,KAAK;EACrG;AACA,QAAM,UAAU,MAAM,UAAU,6BAA6B,6BAA6B,KAAK,KAAK;AACpG,MAAI,SAAS;AACX,WAAO,EAAE,OAAO,UAAU,CAAA,EAAE;EAC9B;AACA,QAAM,WAAW;AACjB,MAAI,WAAW,gBAAgB;AAC7B,UAAM,IAAI,WAAW,aAAa,KAAK,WAAW,KAAK,MAAM,QAAQ,IAAI,UAAU,KAAK;EAC1F;AACA,SAAO;IACL;IACA,UAAU,CAAC,sBAAsB,KAAK,WAAW,KAAK,EAAE;;AAE5D","debugId":"e5aa93b8-d63d-557c-9183-bbd636aa5dee"}
|
|
@@ -1,25 +1,23 @@
|
|
|
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
|
-
createStdinTokenResolver
|
|
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]="24eeed2f-0f2f-592d-98f4-775ddf375e86")}catch(e){}}();
|
|
6
3
|
import {
|
|
7
4
|
resolveAuthor
|
|
8
5
|
} from "./chunk-T5RRNDA7.js";
|
|
9
6
|
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} from "./chunk-ENGQOEUY.js";
|
|
7
|
+
createStdinTokenResolver
|
|
8
|
+
} from "./chunk-3SHDAKMF.js";
|
|
13
9
|
import {
|
|
14
10
|
PmCliError,
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
mutateItem,
|
|
12
|
+
readSettings,
|
|
13
|
+
toItemRecord
|
|
14
|
+
} from "./chunk-NTOOEVJ4.js";
|
|
17
15
|
import {
|
|
18
16
|
EXIT_CODE,
|
|
19
17
|
getSettingsPath,
|
|
20
18
|
pathExists,
|
|
21
19
|
resolvePmRoot
|
|
22
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-MFLLULHU.js";
|
|
23
21
|
|
|
24
22
|
// dist/cli/commands/append.js
|
|
25
23
|
async function runAppend(id, options, global) {
|
|
@@ -63,6 +61,6 @@ async function runAppend(id, options, global) {
|
|
|
63
61
|
export {
|
|
64
62
|
runAppend
|
|
65
63
|
};
|
|
66
|
-
//# sourceMappingURL=chunk-
|
|
64
|
+
//# sourceMappingURL=chunk-RL24NAUX.js.map
|
|
67
65
|
|
|
68
|
-
//# debugId=
|
|
66
|
+
//# debugId=24eeed2f-0f2f-592d-98f4-775ddf375e86
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../cli/commands/append.ts"],"sourcesContent":["/**\n * @module cli/commands/append\n *\n * Implements the pm append command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\n/**\n * Documents the append command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface AppendCommandOptions {\n body: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the append result payload exchanged by command, SDK, and package integrations.\n */\nexport interface AppendResult {\n item: Record<string, unknown>;\n appended: string;\n changed_fields: string[];\n}\n\n\n/**\n * Implements run append for the public runtime surface of this module.\n */\nexport async function runAppend(id: string, options: AppendCommandOptions, global: GlobalOptions): Promise<AppendResult> {\n if (options.body === undefined) {\n throw new PmCliError(\"Missing required --body text\", EXIT_CODE.USAGE);\n }\n const stdinResolver = createStdinTokenResolver();\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 author = resolveAuthor(options.author, settings.author_default);\n // options.body is guaranteed defined by the guard above, so resolveValue returns a defined string.\n const bodyInput = await stdinResolver.resolveValue(options.body, \"--body\");\n const appended = (bodyInput as string).trim();\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"append\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n if (appended.length === 0) {\n return { changedFields: [] };\n }\n const spacer = document.body.trim().length > 0 ? \"\\n\\n\" : \"\";\n document.body = `${document.body.replace(/\\s+$/, \"\")}${spacer}${appended}\\n`;\n return { changedFields: [\"body\"] };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n appended: appended.length > 0 ? appended : \"\",\n changed_fields: result.changedFields,\n };\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../cli/commands/append.ts"],"sourcesContent":["/**\n * @module cli/commands/append\n *\n * Implements the pm append command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveAuthor } from \"../../core/shared/author.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { createStdinTokenResolver } from \"../../core/item/parse.js\";\nimport { mutateItem } from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\n\n/**\n * Documents the append command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface AppendCommandOptions {\n body: string;\n author?: string;\n message?: string;\n force?: boolean;\n}\n\n/**\n * Documents the append result payload exchanged by command, SDK, and package integrations.\n */\nexport interface AppendResult {\n item: Record<string, unknown>;\n appended: string;\n changed_fields: string[];\n}\n\n\n/**\n * Implements run append for the public runtime surface of this module.\n */\nexport async function runAppend(id: string, options: AppendCommandOptions, global: GlobalOptions): Promise<AppendResult> {\n if (options.body === undefined) {\n throw new PmCliError(\"Missing required --body text\", EXIT_CODE.USAGE);\n }\n const stdinResolver = createStdinTokenResolver();\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 author = resolveAuthor(options.author, settings.author_default);\n // options.body is guaranteed defined by the guard above, so resolveValue returns a defined string.\n const bodyInput = await stdinResolver.resolveValue(options.body, \"--body\");\n const appended = (bodyInput as string).trim();\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"append\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n if (appended.length === 0) {\n return { changedFields: [] };\n }\n const spacer = document.body.trim().length > 0 ? \"\\n\\n\" : \"\";\n document.body = `${document.body.replace(/\\s+$/, \"\")}${spacer}${appended}\\n`;\n return { changedFields: [\"body\"] };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n appended: appended.length > 0 ? appended : \"\",\n changed_fields: result.changedFields,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,eAAsB,UAAU,IAAY,SAA+B,QAAqB;AAC9F,MAAI,QAAQ,SAAS,QAAW;AAC9B,UAAM,IAAI,WAAW,gCAAgC,UAAU,KAAK;EACtE;AACA,QAAM,gBAAgB,yBAAwB;AAC9C,QAAM,SAAS,cAAc,QAAQ,IAAG,GAAI,OAAO,IAAI;AACvD,MAAI,CAAE,MAAM,WAAW,gBAAgB,MAAM,CAAC,GAAI;AAChD,UAAM,IAAI,WAAW,iCAAiC,MAAM,wBAAwB,UAAU,SAAS;EACzG;AACA,QAAM,WAAW,MAAM,aAAa,MAAM;AAC1C,QAAM,SAAS,cAAc,QAAQ,QAAQ,SAAS,cAAc;AAEpE,QAAM,YAAY,MAAM,cAAc,aAAa,QAAQ,MAAM,QAAQ;AACzE,QAAM,WAAY,UAAqB,KAAI;AAE3C,QAAM,SAAS,MAAM,WAAW;IAC9B;IACA;IACA;IACA,IAAI;IACJ;IACA,SAAS,QAAQ;IACjB,OAAO,QAAQ;IACf,OAAO,UAAQ;AACb,UAAI,SAAS,WAAW,GAAG;AACzB,eAAO,EAAE,eAAe,CAAA,EAAE;MAC5B;AACA,YAAM,SAAS,SAAS,KAAK,KAAI,EAAG,SAAS,IAAI,SAAS;AAC1D,eAAS,OAAO,GAAG,SAAS,KAAK,QAAQ,QAAQ,EAAE,CAAC,GAAG,MAAM,GAAG,QAAQ;;AACxE,aAAO,EAAE,eAAe,CAAC,MAAM,EAAC;IAClC;GACD;AAED,SAAO;IACL,MAAM,aAAa,OAAO,IAAI;IAC9B,UAAU,SAAS,SAAS,IAAI,WAAW;IAC3C,gBAAgB,OAAO;;AAE3B","debugId":"24eeed2f-0f2f-592d-98f4-775ddf375e86"}
|