@unbrained/pm-cli 2026.7.11 → 2026.7.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +2 -2
- package/CHANGELOG.md +36 -2
- package/README.md +0 -33
- package/dist/cli/commands/claim.d.ts +32 -1
- package/dist/cli/commands/claim.js +52 -15
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/completion.js +11 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.js +4 -65
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -1
- package/dist/cli/commands/index.js +3 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.js +18 -2
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/legacy-none-tokens.d.ts +49 -1
- package/dist/cli/commands/legacy-none-tokens.js +73 -2
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
- package/dist/cli/commands/next.d.ts +14 -2
- package/dist/cli/commands/next.js +39 -11
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +5 -0
- package/dist/cli/commands/plan.js +44 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/update.js +7 -67
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +13 -1
- package/dist/cli/extension-command-help.js +79 -5
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/main.js +9 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +3 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +3 -2
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +24 -3
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli-bundle/chunks/append-RH3G5RAV.js +11 -0
- package/dist/cli-bundle/chunks/{append-464PHZ65.js → append-T5DTS4NU.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-YMP6AKGU.js → chunk-2XWRFOPR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HT5P3WC6.js → chunk-2Z36LSAT.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-WQ5227PH.js → chunk-33O5P6KT.js} +135 -41
- package/dist/cli-bundle/chunks/chunk-33O5P6KT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DBV6QRYT.js → chunk-3KJ3FG5O.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AQLKMQQA.js → chunk-3M5BWYUA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GPBKJERW.js → chunk-3WASQS5G.js} +42 -6
- package/dist/cli-bundle/chunks/chunk-3WASQS5G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-47CCRGRH.js → chunk-47TKJR3D.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YCSDMIQW.js → chunk-4MO4PPR2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WCRAUCJO.js → chunk-546WPG33.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-RLOWK5EQ.js → chunk-5754C5XS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7U5INZ2C.js → chunk-5V746BN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7324AI5M.js → chunk-66YL6RR5.js} +30 -20
- package/dist/cli-bundle/chunks/{chunk-7324AI5M.js.map → chunk-66YL6RR5.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZLQDOBZL.js → chunk-6OK5QSGH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ROH64TST.js → chunk-6XNMSLBT.js} +78 -72
- package/dist/cli-bundle/chunks/chunk-6XNMSLBT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2HNZKLHV.js → chunk-7SHFQB2A.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6APTSPP5.js → chunk-7SIWW7C3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7HQQT6AT.js → chunk-7TYZTBEV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VTOQH22Y.js → chunk-A2HZUSEA.js} +8 -6
- package/dist/cli-bundle/chunks/{chunk-VTOQH22Y.js.map → chunk-A2HZUSEA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-YCHJLOO2.js → chunk-A6AK7W5M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WBKZAO3P.js → chunk-A6AVSYRJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-L7C6RTGH.js → chunk-ACDIA6NP.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-AX3BJLPV.js → chunk-ACRC3HI4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QCKPSFII.js → chunk-AHIEDSW2.js} +30 -20
- package/dist/cli-bundle/chunks/{chunk-QCKPSFII.js.map → chunk-AHIEDSW2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-B6JBI7JX.js → chunk-ANLHBXAE.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-2KQG6L3J.js → chunk-AS62PEJE.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-OJ64VYGO.js → chunk-BAK2VLTQ.js} +62 -33
- package/dist/cli-bundle/chunks/chunk-BAK2VLTQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-J3EXRK2H.js → chunk-BLRO2POO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KDNZSVCK.js → chunk-CDR2A3VI.js} +15 -74
- package/dist/cli-bundle/chunks/chunk-CDR2A3VI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2WGV5WRW.js → chunk-DJI5IS46.js} +42 -20
- package/dist/cli-bundle/chunks/{chunk-2WGV5WRW.js.map → chunk-DJI5IS46.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VOXOXART.js → chunk-DLZ3RXAL.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-H6YDNW46.js → chunk-DNH44IKP.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QI5KTH6A.js → chunk-EBBROE54.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-GC5ME4ZU.js → chunk-FF523THY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5OBMSBWX.js → chunk-FIZUJWXQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HLBSL5KE.js → chunk-FVWQFTTW.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-YIWYD7TC.js → chunk-FVZEIWTL.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-E72ZO34Z.js → chunk-G6B5XGNV.js} +97 -32
- package/dist/cli-bundle/chunks/{chunk-E72ZO34Z.js.map → chunk-G6B5XGNV.js.map} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4DC5XNMS.js → chunk-GFBV2254.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-OKZ35F3Y.js → chunk-GRB3TFOC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TZFULSN4.js → chunk-GVGFLZQS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RTG2LHQ7.js → chunk-HLZXQKGZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5F7UJHFY.js → chunk-HO6CDURZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MN2YMU55.js → chunk-HOE3UV3G.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XQLLRYOX.js → chunk-HRCJGQXL.js} +134 -40
- package/dist/cli-bundle/chunks/chunk-HRCJGQXL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-I535LTZ2.js → chunk-IS6M4ETF.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-K7HEURQ4.js → chunk-J2XEW4YL.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GZNB5V5J.js → chunk-J2ZDZG4A.js} +44 -12
- package/dist/cli-bundle/chunks/chunk-J2ZDZG4A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-O2Q7YQGO.js → chunk-J7XSQCJO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RA2LPP6E.js → chunk-JM4Z53DN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JR6FIX53.js → chunk-JNNPTGXR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I5VZGPS2.js → chunk-K7CGOZK5.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-B6OANV3G.js → chunk-KDH62ECD.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LIY2ILWI.js → chunk-KXFY6AI4.js} +41 -5
- package/dist/cli-bundle/chunks/chunk-KXFY6AI4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NR7PTIR7.js → chunk-L23NAJHL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FCZ6WYSR.js → chunk-LEXFDABF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GP54I36Z.js → chunk-LNAGQRIL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DD2WZD6L.js → chunk-LU4Z7POS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FEVEIX53.js → chunk-LX265XY7.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-NJABR6EB.js → chunk-MQAGSAMS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MRMS62WQ.js → chunk-N4NKVLPY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RY57ESL2.js → chunk-ND3MDD6L.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-Y476SA4V.js → chunk-NEJKKTCG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q3EW4RE5.js → chunk-NGL3X3XM.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ENJDRDDP.js → chunk-NK54BSL7.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KHQYX2QB.js → chunk-NN57FRRN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VNCQ7SSG.js → chunk-NNRXTZ7Y.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-KZQHMDS6.js → chunk-NOIIRLCO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CTAPVM6C.js → chunk-O5ELBOEJ.js} +14 -73
- package/dist/cli-bundle/chunks/chunk-O5ELBOEJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-K2PDZYUF.js → chunk-OC2CLNMS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SN7Q7M4U.js → chunk-OKUFGORG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZLWBLI5R.js → chunk-OOK6V7BF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DDEYJ3BH.js → chunk-OUQ4I6HC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C4FIA5U6.js → chunk-OYCZDDUC.js} +61 -32
- package/dist/cli-bundle/chunks/chunk-OYCZDDUC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X7ZXLB3C.js → chunk-PDOJRPYR.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-HDNEQAHV.js → chunk-PHQPQNAT.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FMFSUTTD.js → chunk-PTJ7NVUU.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-5URFS7C4.js → chunk-PUMGO764.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-RPZ57GQ7.js → chunk-QFCCN4JO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RAC2UXLT.js → chunk-QPWXNK56.js} +43 -11
- package/dist/cli-bundle/chunks/chunk-QPWXNK56.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-35YNX7RQ.js → chunk-QYIDXRRX.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-ITIUEWD5.js → chunk-RFDT674H.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2BUNV627.js → chunk-SJ2DADDH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-MSPZSUKQ.js → chunk-SV7PEWKW.js} +41 -19
- package/dist/cli-bundle/chunks/{chunk-MSPZSUKQ.js.map → chunk-SV7PEWKW.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ZYDUOY54.js → chunk-TKD4NESJ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BU2CV5ZU.js → chunk-TMNQV4EK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GJNBKU6G.js → chunk-TWELUDDF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A3AIKEYC.js → chunk-TYCM65DJ.js} +78 -72
- package/dist/cli-bundle/chunks/chunk-TYCM65DJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-Y5E6FCAL.js → chunk-U3S22BOJ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MORRAQXQ.js → chunk-UAZ6W3H3.js} +91 -33
- package/dist/cli-bundle/chunks/chunk-UAZ6W3H3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2BKRMFGK.js → chunk-UFY4ETU6.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EEUIIDWF.js → chunk-UGQENMKM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XK5CTXMB.js → chunk-UGSHP6SR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2JWIRG4V.js → chunk-VF24O6TV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-PZBRTJ3Y.js → chunk-VLVTXEGG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-X6HT3FP3.js → chunk-VMGK6ESD.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-X6HT3FP3.js.map → chunk-VMGK6ESD.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NAGOH4YJ.js → chunk-VXUWCJS7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ETGRUM64.js → chunk-WBMARQCV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-L6C62S4V.js → chunk-WZDABROA.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-P63GUQK5.js → chunk-XG5GVZRX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6UWHAJEX.js → chunk-XGCPTS6L.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-XGUXU4IQ.js → chunk-Y44B5FBE.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-C3QR2DPR.js → chunk-YP6DWEWQ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-TB6364F7.js → chunk-Z7XTVIN5.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-XSJZF3TO.js → chunk-ZEKVLV6P.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SNFLSFFH.js → chunk-ZFPOBSPC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RYASC6U3.js → chunk-ZUB725AA.js} +7 -7
- package/dist/cli-bundle/chunks/{close-A77IGXNC.js → close-CQHW3WMK.js} +5 -5
- package/dist/cli-bundle/chunks/close-ZZW5FLTB.js +12 -0
- package/dist/cli-bundle/chunks/{close-many-P2YOWN52.js → close-many-AR2YH3SJ.js} +12 -12
- package/dist/cli-bundle/chunks/close-many-IKCEGBLQ.js +21 -0
- package/dist/cli-bundle/chunks/comments-NV4SIY5Z.js +13 -0
- package/dist/cli-bundle/chunks/{comments-FNLKE3TW.js → comments-UV4HMI2K.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-U6H22S7E.js → copy-OUFWOHVG.js} +4 -4
- package/dist/cli-bundle/chunks/copy-X7HJFWIH.js +9 -0
- package/dist/cli-bundle/chunks/{create-HS64DHTL.js → create-QEDL4KKT.js} +9 -9
- package/dist/cli-bundle/chunks/create-R6MMMMJS.js +25 -0
- package/dist/cli-bundle/chunks/{delete-4XPF5XLP.js → delete-MJGZFDHZ.js} +4 -4
- package/dist/cli-bundle/chunks/delete-OOJRG4HF.js +10 -0
- package/dist/cli-bundle/chunks/{deps-TMOF765V.js → deps-4OP6Q76N.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-R44LVZTU.js → deps-Y5X6NFT5.js} +4 -4
- package/dist/cli-bundle/chunks/docs-SILTBWSO.js +14 -0
- package/dist/cli-bundle/chunks/{docs-HN6QKGEU.js → docs-UKTQVUHS.js} +6 -6
- package/dist/cli-bundle/chunks/{files-RNFWG435.js → files-2QEI2V3C.js} +6 -6
- package/dist/cli-bundle/chunks/{files-NX4LNOPL.js → files-7OIKZPI3.js} +6 -6
- package/dist/cli-bundle/chunks/focus-3YC5LFCG.js +10 -0
- package/dist/cli-bundle/chunks/{focus-OBSDVVI7.js → focus-FFWH32BF.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-RZMMFSTO.js → history-compact-AAA4W6LY.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-CKNRN637.js → history-compact-PIURAPW5.js} +8 -8
- package/dist/cli-bundle/chunks/history-redact-KWZ7LKQB.js +16 -0
- package/dist/cli-bundle/chunks/{history-redact-W7TTAEX2.js → history-redact-NTO74EIV.js} +6 -6
- package/dist/cli-bundle/chunks/history-repair-QWZJYYOJ.js +18 -0
- package/dist/cli-bundle/chunks/{history-repair-RGAQBOIS.js → history-repair-ROV5TD3L.js} +8 -8
- package/dist/cli-bundle/chunks/learnings-25TJCVON.js +13 -0
- package/dist/cli-bundle/chunks/{learnings-VDRTXWTF.js → learnings-3WJFJT7E.js} +7 -7
- package/dist/cli-bundle/chunks/{notes-UXXTI3J5.js → notes-FM53JJ5C.js} +7 -7
- package/dist/cli-bundle/chunks/notes-IAHGNCYQ.js +13 -0
- package/dist/cli-bundle/chunks/{plan-H3OPE2RP.js → plan-EJ4USP2S.js} +10 -10
- package/dist/cli-bundle/chunks/plan-WHV4H2RW.js +24 -0
- package/dist/cli-bundle/chunks/{profile-PFNN3CBJ.js → profile-SZQVKHUQ.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-FCZWT5LE.js → profile-TXE673DR.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-BGEGWQ6S.js → register-list-query-LSR2G2SJ.js} +16 -16
- package/dist/cli-bundle/chunks/{register-list-query-BGEGWQ6S.js.map → register-list-query-LSR2G2SJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-list-query-ODDZVR6N.js → register-list-query-S6I73L5W.js} +15 -15
- package/dist/cli-bundle/chunks/{register-list-query-ODDZVR6N.js.map → register-list-query-S6I73L5W.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-OAJXSNWK.js → register-mutation-77GYER52.js} +32 -32
- package/dist/cli-bundle/chunks/{register-mutation-OAJXSNWK.js.map → register-mutation-77GYER52.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-mutation-2APBEHTJ.js → register-mutation-A2SC3K5G.js} +31 -31
- package/dist/cli-bundle/chunks/{register-mutation-2APBEHTJ.js.map → register-mutation-A2SC3K5G.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-3TYKCKEZ.js → register-operations-KSAIBSZH.js} +43 -33
- package/dist/cli-bundle/chunks/register-operations-KSAIBSZH.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-WKZSX4QP.js → register-operations-W6Z5LVI5.js} +42 -32
- package/dist/cli-bundle/chunks/register-operations-W6Z5LVI5.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-HSVJDV3R.js → register-setup-KB5U3RES.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-KE5L3H7U.js → register-setup-ZG7YXPHJ.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-MDNVYUDD.js → restore-F5HPTRBR.js} +6 -6
- package/dist/cli-bundle/chunks/restore-LN57EB5H.js +14 -0
- package/dist/cli-bundle/chunks/{schema-AJCAANMB.js → schema-3DKXA4KR.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-2B37DMM2.js → schema-QLTOK23S.js} +6 -6
- package/dist/cli-bundle/chunks/update-2T5EWMXD.js +21 -0
- package/dist/cli-bundle/chunks/{update-ZCDGTSNL.js → update-IKMNH3W4.js} +12 -12
- package/dist/cli-bundle/chunks/{update-many-6E2DDBE4.js → update-many-3Q6Z2Q4Y.js} +19 -19
- package/dist/cli-bundle/chunks/update-many-OTAS4BWH.js +30 -0
- package/dist/cli-bundle/main.js +75 -20
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/cli-bundle/sdk-runtime.js +63 -52
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +63 -54
- package/dist/cli-bundle/sdk.js.map +2 -2
- package/dist/core/extensions/item-fields.js +3 -3
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +29 -20
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/schema/fields-file.js +5 -3
- package/dist/core/schema/fields-file.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +12 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +14 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +18 -6
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/index.d.ts +3 -1
- package/dist/sdk/index.js +4 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +51 -1
- package/dist/sdk/runtime.js +91 -4
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/workspace.d.ts +15 -0
- package/dist/sdk/workspace.js +50 -0
- package/dist/sdk/workspace.js.map +1 -0
- package/docs/AGENT_GUIDE.md +1 -0
- package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +775 -0
- package/docs/CODEX_PLUGIN.md +11 -1
- package/docs/COMMANDS.md +3 -1
- package/docs/README.md +3 -0
- package/docs/SDK.md +204 -71
- package/marketplace.json +2 -2
- package/package.json +3 -2
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +3 -0
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +3 -0
- package/packages/pm-todos/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/append-425YGJMY.js +0 -11
- package/dist/cli-bundle/chunks/chunk-A3AIKEYC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-C4FIA5U6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CTAPVM6C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-GPBKJERW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GZNB5V5J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KDNZSVCK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LIY2ILWI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MORRAQXQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OJ64VYGO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RAC2UXLT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ROH64TST.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WQ5227PH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XQLLRYOX.js.map +0 -1
- package/dist/cli-bundle/chunks/close-II7JKV32.js +0 -12
- package/dist/cli-bundle/chunks/close-many-FD46X4WK.js +0 -21
- package/dist/cli-bundle/chunks/comments-OAU2E7RK.js +0 -13
- package/dist/cli-bundle/chunks/copy-5MOERABQ.js +0 -9
- package/dist/cli-bundle/chunks/create-DOMKSBHN.js +0 -25
- package/dist/cli-bundle/chunks/delete-BMOQWZRQ.js +0 -10
- package/dist/cli-bundle/chunks/docs-J4OI4PWM.js +0 -14
- package/dist/cli-bundle/chunks/focus-7H5B4PKZ.js +0 -10
- package/dist/cli-bundle/chunks/history-redact-ZNS2QTMI.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-LQ5IU4ZX.js +0 -18
- package/dist/cli-bundle/chunks/learnings-AHMJNIQZ.js +0 -13
- package/dist/cli-bundle/chunks/notes-GJI26GJR.js +0 -13
- package/dist/cli-bundle/chunks/plan-ZHJH6VMF.js +0 -24
- package/dist/cli-bundle/chunks/register-operations-3TYKCKEZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-WKZSX4QP.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-AR77QSO6.js +0 -14
- package/dist/cli-bundle/chunks/update-D3ZZ2V7Z.js +0 -21
- package/dist/cli-bundle/chunks/update-many-2Q2PRSSB.js +0 -30
- /package/dist/cli-bundle/chunks/{append-425YGJMY.js.map → append-RH3G5RAV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-464PHZ65.js.map → append-T5DTS4NU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YMP6AKGU.js.map → chunk-2XWRFOPR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HT5P3WC6.js.map → chunk-2Z36LSAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DBV6QRYT.js.map → chunk-3KJ3FG5O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AQLKMQQA.js.map → chunk-3M5BWYUA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-47CCRGRH.js.map → chunk-47TKJR3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCSDMIQW.js.map → chunk-4MO4PPR2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WCRAUCJO.js.map → chunk-546WPG33.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RLOWK5EQ.js.map → chunk-5754C5XS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7U5INZ2C.js.map → chunk-5V746BN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZLQDOBZL.js.map → chunk-6OK5QSGH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2HNZKLHV.js.map → chunk-7SHFQB2A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6APTSPP5.js.map → chunk-7SIWW7C3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7HQQT6AT.js.map → chunk-7TYZTBEV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YCHJLOO2.js.map → chunk-A6AK7W5M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WBKZAO3P.js.map → chunk-A6AVSYRJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L7C6RTGH.js.map → chunk-ACDIA6NP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AX3BJLPV.js.map → chunk-ACRC3HI4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6JBI7JX.js.map → chunk-ANLHBXAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2KQG6L3J.js.map → chunk-AS62PEJE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-J3EXRK2H.js.map → chunk-BLRO2POO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VOXOXART.js.map → chunk-DLZ3RXAL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H6YDNW46.js.map → chunk-DNH44IKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QI5KTH6A.js.map → chunk-EBBROE54.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GC5ME4ZU.js.map → chunk-FF523THY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5OBMSBWX.js.map → chunk-FIZUJWXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLBSL5KE.js.map → chunk-FVWQFTTW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YIWYD7TC.js.map → chunk-FVZEIWTL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4DC5XNMS.js.map → chunk-GFBV2254.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OKZ35F3Y.js.map → chunk-GRB3TFOC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZFULSN4.js.map → chunk-GVGFLZQS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RTG2LHQ7.js.map → chunk-HLZXQKGZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5F7UJHFY.js.map → chunk-HO6CDURZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MN2YMU55.js.map → chunk-HOE3UV3G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I535LTZ2.js.map → chunk-IS6M4ETF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K7HEURQ4.js.map → chunk-J2XEW4YL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O2Q7YQGO.js.map → chunk-J7XSQCJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RA2LPP6E.js.map → chunk-JM4Z53DN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JR6FIX53.js.map → chunk-JNNPTGXR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I5VZGPS2.js.map → chunk-K7CGOZK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B6OANV3G.js.map → chunk-KDH62ECD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NR7PTIR7.js.map → chunk-L23NAJHL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FCZ6WYSR.js.map → chunk-LEXFDABF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GP54I36Z.js.map → chunk-LNAGQRIL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DD2WZD6L.js.map → chunk-LU4Z7POS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FEVEIX53.js.map → chunk-LX265XY7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NJABR6EB.js.map → chunk-MQAGSAMS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MRMS62WQ.js.map → chunk-N4NKVLPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RY57ESL2.js.map → chunk-ND3MDD6L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y476SA4V.js.map → chunk-NEJKKTCG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q3EW4RE5.js.map → chunk-NGL3X3XM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ENJDRDDP.js.map → chunk-NK54BSL7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KHQYX2QB.js.map → chunk-NN57FRRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VNCQ7SSG.js.map → chunk-NNRXTZ7Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KZQHMDS6.js.map → chunk-NOIIRLCO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K2PDZYUF.js.map → chunk-OC2CLNMS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SN7Q7M4U.js.map → chunk-OKUFGORG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZLWBLI5R.js.map → chunk-OOK6V7BF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDEYJ3BH.js.map → chunk-OUQ4I6HC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X7ZXLB3C.js.map → chunk-PDOJRPYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HDNEQAHV.js.map → chunk-PHQPQNAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FMFSUTTD.js.map → chunk-PTJ7NVUU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5URFS7C4.js.map → chunk-PUMGO764.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RPZ57GQ7.js.map → chunk-QFCCN4JO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-35YNX7RQ.js.map → chunk-QYIDXRRX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ITIUEWD5.js.map → chunk-RFDT674H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2BUNV627.js.map → chunk-SJ2DADDH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZYDUOY54.js.map → chunk-TKD4NESJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BU2CV5ZU.js.map → chunk-TMNQV4EK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJNBKU6G.js.map → chunk-TWELUDDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y5E6FCAL.js.map → chunk-U3S22BOJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2BKRMFGK.js.map → chunk-UFY4ETU6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EEUIIDWF.js.map → chunk-UGQENMKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XK5CTXMB.js.map → chunk-UGSHP6SR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2JWIRG4V.js.map → chunk-VF24O6TV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PZBRTJ3Y.js.map → chunk-VLVTXEGG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NAGOH4YJ.js.map → chunk-VXUWCJS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ETGRUM64.js.map → chunk-WBMARQCV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L6C62S4V.js.map → chunk-WZDABROA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P63GUQK5.js.map → chunk-XG5GVZRX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6UWHAJEX.js.map → chunk-XGCPTS6L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XGUXU4IQ.js.map → chunk-Y44B5FBE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-C3QR2DPR.js.map → chunk-YP6DWEWQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TB6364F7.js.map → chunk-Z7XTVIN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XSJZF3TO.js.map → chunk-ZEKVLV6P.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SNFLSFFH.js.map → chunk-ZFPOBSPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RYASC6U3.js.map → chunk-ZUB725AA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-A77IGXNC.js.map → close-CQHW3WMK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-II7JKV32.js.map → close-ZZW5FLTB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-P2YOWN52.js.map → close-many-AR2YH3SJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-FD46X4WK.js.map → close-many-IKCEGBLQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-OAU2E7RK.js.map → comments-NV4SIY5Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-FNLKE3TW.js.map → comments-UV4HMI2K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-U6H22S7E.js.map → copy-OUFWOHVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-5MOERABQ.js.map → copy-X7HJFWIH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-HS64DHTL.js.map → create-QEDL4KKT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-DOMKSBHN.js.map → create-R6MMMMJS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-4XPF5XLP.js.map → delete-MJGZFDHZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-BMOQWZRQ.js.map → delete-OOJRG4HF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-TMOF765V.js.map → deps-4OP6Q76N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-R44LVZTU.js.map → deps-Y5X6NFT5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-J4OI4PWM.js.map → docs-SILTBWSO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-HN6QKGEU.js.map → docs-UKTQVUHS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-RNFWG435.js.map → files-2QEI2V3C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-NX4LNOPL.js.map → files-7OIKZPI3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-7H5B4PKZ.js.map → focus-3YC5LFCG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-OBSDVVI7.js.map → focus-FFWH32BF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-RZMMFSTO.js.map → history-compact-AAA4W6LY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-CKNRN637.js.map → history-compact-PIURAPW5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ZNS2QTMI.js.map → history-redact-KWZ7LKQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-W7TTAEX2.js.map → history-redact-NTO74EIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-LQ5IU4ZX.js.map → history-repair-QWZJYYOJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-RGAQBOIS.js.map → history-repair-ROV5TD3L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-AHMJNIQZ.js.map → learnings-25TJCVON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-VDRTXWTF.js.map → learnings-3WJFJT7E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-UXXTI3J5.js.map → notes-FM53JJ5C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-GJI26GJR.js.map → notes-IAHGNCYQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-H3OPE2RP.js.map → plan-EJ4USP2S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-ZHJH6VMF.js.map → plan-WHV4H2RW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-PFNN3CBJ.js.map → profile-SZQVKHUQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-FCZWT5LE.js.map → profile-TXE673DR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-HSVJDV3R.js.map → register-setup-KB5U3RES.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-KE5L3H7U.js.map → register-setup-ZG7YXPHJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-MDNVYUDD.js.map → restore-F5HPTRBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-AR77QSO6.js.map → restore-LN57EB5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-AJCAANMB.js.map → schema-3DKXA4KR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-2B37DMM2.js.map → schema-QLTOK23S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-D3ZZ2V7Z.js.map → update-2T5EWMXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-ZCDGTSNL.js.map → update-IKMNH3W4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-6E2DDBE4.js.map → update-many-3Q6Z2Q4Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-2Q2PRSSB.js.map → update-many-OTAS4BWH.js.map} +0 -0
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0293afd9-6db0-5680-83bc-e16c04838b33")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
lintProjectProfile
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7SIWW7C3.js";
|
|
6
6
|
import {
|
|
7
7
|
describeExtensionActivation,
|
|
8
8
|
renderExtensionSurfaceMarkdown
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JM4Z53DN.js";
|
|
10
10
|
import {
|
|
11
11
|
getMigrationRuntimeDefinition,
|
|
12
12
|
resolveRegisteredSearchProvider,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
runPreflightOverride,
|
|
37
37
|
runRendererOverride,
|
|
38
38
|
runServiceOverride
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-AHIEDSW2.js";
|
|
40
40
|
|
|
41
41
|
// dist/sdk/compose.js
|
|
42
42
|
function defineExtension(module) {
|
|
@@ -1454,6 +1454,6 @@ export {
|
|
|
1454
1454
|
assertExtensionPreflight,
|
|
1455
1455
|
createExtensionTestHarness
|
|
1456
1456
|
};
|
|
1457
|
-
//# sourceMappingURL=chunk-
|
|
1457
|
+
//# sourceMappingURL=chunk-7SHFQB2A.js.map
|
|
1458
1458
|
|
|
1459
1459
|
//# debugId=0293afd9-6db0-5680-83bc-e16c04838b33
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
TYPE_PRESET_DEFINITIONS,
|
|
12
12
|
normalizeAddFieldInput,
|
|
13
13
|
normalizeAddStatusInput
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-A2HZUSEA.js";
|
|
15
15
|
import {
|
|
16
16
|
normalizeAddTypeInput
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UGQENMKM.js";
|
|
18
18
|
import {
|
|
19
19
|
BUILTIN_ITEM_TYPE_VALUES,
|
|
20
20
|
DEFAULT_RUNTIME_STATUS_DEFINITIONS,
|
|
21
21
|
toErrorMessage
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-AHIEDSW2.js";
|
|
23
23
|
|
|
24
24
|
// dist/core/profile/profile-presets.js
|
|
25
25
|
var PROFILE_NAMES = ["agile", "ops", "research"];
|
|
@@ -668,6 +668,6 @@ export {
|
|
|
668
668
|
PROFILE_LINT_CODES,
|
|
669
669
|
lintProjectProfile
|
|
670
670
|
};
|
|
671
|
-
//# sourceMappingURL=chunk-
|
|
671
|
+
//# sourceMappingURL=chunk-7SIWW7C3.js.map
|
|
672
672
|
|
|
673
673
|
//# debugId=7d0a5087-e290-5a6c-9641-82badd28de0c
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
nowIso,
|
|
5
5
|
readSettings,
|
|
6
6
|
writeSettings
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VXUWCJS7.js";
|
|
8
8
|
import {
|
|
9
9
|
EXIT_CODE,
|
|
10
10
|
appendLineAtomic,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
resolvePmPackageRootFromModule,
|
|
14
14
|
resolveTelemetryErrorCategory,
|
|
15
15
|
writeFileAtomic
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AHIEDSW2.js";
|
|
17
17
|
|
|
18
18
|
// dist/core/telemetry/observability.js
|
|
19
19
|
var SETUP_ROOT_COMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -1828,6 +1828,6 @@ export {
|
|
|
1828
1828
|
finishTelemetryCommand,
|
|
1829
1829
|
emitTelemetryErrorEvent
|
|
1830
1830
|
};
|
|
1831
|
-
//# sourceMappingURL=chunk-
|
|
1831
|
+
//# sourceMappingURL=chunk-7TYZTBEV.js.map
|
|
1832
1832
|
|
|
1833
1833
|
//# debugId=494a8428-0a48-5a0c-b53f-182ebda2ea6d
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="530967bb-33df-5861-80bf-b398d42eab3a")}catch(e){}}();
|
|
3
3
|
import {
|
|
4
4
|
normalizeAddTypeInput
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-UGQENMKM.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_RUNTIME_STATUS_DEFINITIONS,
|
|
8
|
+
FRONT_MATTER_KEY_ORDER,
|
|
8
9
|
RUNTIME_FIELD_COMMAND_VALUES,
|
|
9
10
|
RUNTIME_FIELD_TYPE_VALUES,
|
|
10
11
|
RUNTIME_STATUS_ROLE_VALUES,
|
|
11
12
|
evictOldestMemoEntries
|
|
12
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AHIEDSW2.js";
|
|
13
14
|
|
|
14
15
|
// dist/core/schema/status-defs-file.js
|
|
15
16
|
var RUNTIME_STATUS_ROLE_SET = new Set(RUNTIME_STATUS_ROLE_VALUES);
|
|
@@ -204,6 +205,7 @@ function assertStatusTokensAvailable(input, resolvedAliasToId) {
|
|
|
204
205
|
var RUNTIME_FIELD_TYPE_SET = new Set(RUNTIME_FIELD_TYPE_VALUES);
|
|
205
206
|
var RUNTIME_FIELD_COMMAND_SET = new Set(RUNTIME_FIELD_COMMAND_VALUES);
|
|
206
207
|
var BUILTIN_FIELD_KEYS = /* @__PURE__ */ new Set([
|
|
208
|
+
...FRONT_MATTER_KEY_ORDER.filter((key) => key !== "severity"),
|
|
207
209
|
"id",
|
|
208
210
|
"title",
|
|
209
211
|
"type",
|
|
@@ -287,7 +289,7 @@ function normalizeAddFieldInput(raw) {
|
|
|
287
289
|
throw new Error("Field key must not be empty.");
|
|
288
290
|
}
|
|
289
291
|
if (BUILTIN_FIELD_KEYS.has(key)) {
|
|
290
|
-
throw new Error(`Cannot define custom field "${key}":
|
|
292
|
+
throw new Error(`Cannot define custom field "${key}": custom schema field "${key}" collides with built-in item metadata "${key}". Rename the custom field with a project-specific prefix. Reserved fields: ${[...BUILTIN_FIELD_KEYS].sort((left, right) => left.localeCompare(right)).join(", ")}.`);
|
|
291
293
|
}
|
|
292
294
|
const typeCandidate = typeof raw.type === "string" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : "string";
|
|
293
295
|
if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {
|
|
@@ -526,6 +528,6 @@ export {
|
|
|
526
528
|
normalizeTypePresetName,
|
|
527
529
|
resolveTypePresetDefinitions
|
|
528
530
|
};
|
|
529
|
-
//# sourceMappingURL=chunk-
|
|
531
|
+
//# sourceMappingURL=chunk-A2HZUSEA.js.map
|
|
530
532
|
|
|
531
|
-
//# debugId=
|
|
533
|
+
//# debugId=530967bb-33df-5861-80bf-b398d42eab3a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/schema/status-defs-file.ts","../../../../../../../../core/schema/fields-file.ts","../../../../../../../../core/schema/type-presets.ts"],"sourcesContent":["/**\n * @module core/schema/status-defs-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Status Defs File.\n */\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\nimport { evictOldestMemoEntries } from \"../shared/memo.js\";\n\nexport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * Memo for {@link normalizeStatusToken}. Status ranking inside sort comparators\n * normalizes the same handful of status strings O(n log n) times per corpus scan, and\n * the trim/lowercase/regex pipeline shows up in list/next/context profiles. The cap\n * bounds memory in long-lived hosts against unbounded arbitrary inputs; half-eviction keeps the\n * newest-inserted half when the cap is hit. Declared before\n * BUILTIN_STATUS_IDS, whose module-level initializer already normalizes tokens.\n */\nconst STATUS_TOKEN_MEMO_MAX_ENTRIES = 2_000;\nconst statusTokenMemo = new Map<string, string>();\n\n/** The 5 lifecycle status ids that ship as built-in defaults and may never be removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS: open/in_progress/blocked/closed/canceled). `draft` is also a default but the acceptance criteria enumerate the 5 terminal/active ids explicitly, so the guard derives the full set from the canonical defaults to stay in sync. */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) =>\n normalizeStatusToken(definition.id),\n ).filter((id) => id.length > 0),\n);\n\n/** The shape persisted at `.agents/pm/schema/statuses.json`. */\nexport interface StatusDefsFile {\n /** Value that configures or reports statuses for this contract. */\n statuses: RuntimeStatusDefinition[];\n}\n\n/** Documents the raw add status input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string | undefined;\n /** Value that configures or reports roles for this contract. */\n roles?: string[];\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the normalized add status input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Normalized roles, or `undefined` when the raw input did not supply a roles field at all. `undefined` means \"leave existing roles untouched\" on upsert; an explicit empty array means \"clear roles\". This distinction is what keeps `add-status review --description x` from wiping a previously-set role. */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the upsert status def result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove status def result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/** Normalizes a status token using the same rules as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeStatusToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const memoized = statusTokenMemo.get(value);\n if (memoized !== undefined) {\n return memoized;\n }\n const normalized = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\");\n if (statusTokenMemo.size >= STATUS_TOKEN_MEMO_MAX_ENTRIES) {\n evictOldestMemoEntries(statusTokenMemo);\n }\n statusTokenMemo.set(value, normalized);\n return normalized;\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(\n raw: RawAddStatusInput,\n): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role =\n typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined\n ? undefined\n : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order)\n ? Math.trunc(raw.order)\n : undefined;\n return {\n id,\n roles,\n aliases,\n description:\n description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile. Accepts the canonical `{ statuses: [...] }` shape, a bare array of definitions, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty statuses list. */\nexport function parseStatusDefsFile(\n raw: string | null | undefined,\n): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/** Serializes the status definitions file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a status definition into the parsed file. Matching is by normalized id. When a definition already exists, fields supplied in `input` override the previous values (roles/aliases replace when a non-empty array is given, clear when an explicit empty array is given, and are left UNTOUCHED when the field is `undefined` — i.e. the add-status flag was omitted); description/order override when provided. Fields not addressed by add-status flags are preserved untouched, so `add-status <id> --description x` keeps any previously-set roles/aliases. */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing =\n existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...existing,\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/** Removes a status definition from the parsed file by id (normalized). Throws a plain Error when `id` is empty or matches a reserved built-in default status (those are never stored in the file and must never be deletable). Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeStatusDef(\n file: StatusDefsFile,\n id: string | undefined,\n): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/** Throws when the new status id or any explicitly-supplied alias collides with a DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized token to its owning status id (the runtime status registry's alias_to_id map, which stores ids and aliases in one namespace). Re-adding the same status (matching id) is allowed — only cross-status collisions throw. This prevents a custom status from shadowing a built-in lifecycle token (for example `add-status review --alias open`, or a custom id `cancelled` that aliases the built-in `canceled`), which would make `pm update --status open` resolve to the wrong status. The CLI layer maps the thrown Error to a USAGE exit code. */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n","/**\n * @module core/schema/fields-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Fields File.\n */\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\n\nexport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/** Built-in front-matter field names a custom field key must never shadow. A custom key that collides with one of these would let `pm create --<key>` write over reserved metadata, so add-field rejects them up front (symmetric with the built-in-type guard in item-types-file.ts). */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/** The default commands a field is wired onto when `--commands` is omitted, matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition). */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/** The shape persisted at `.agents/pm/schema/fields.json`. */\nexport interface FieldsFile {\n /** Value that configures or reports fields for this contract. */\n fields: RuntimeFieldDefinition[];\n}\n\n/** Documents the raw add field input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string | undefined;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports commands for this contract. */\n commands?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate?: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset?: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes?: string[];\n}\n\n/** Documents the normalized add field input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: RuntimeFieldType;\n /** Value that configures or reports commands for this contract. */\n commands: RuntimeFieldCommand[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports cli aliases for this contract. */\n cliAliases: string[];\n /** Value that configures or reports required for this contract. */\n required: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes: string[];\n}\n\n/** Documents the upsert field result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove field result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/** Normalizes a field key using the same rule as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\"\n ? value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\")\n : \"\";\n}\n\n/** Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse whitespace/underscore runs to a single hyphen (matches normalizeCliToken in runtime-schema.ts). */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/** Normalizes the command allow-list stored for a custom field definition. */\nfunction normalizeFieldCommands(\n rawCommands: string[] | undefined,\n): RuntimeFieldCommand[] {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of rawCommands ?? []) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(\n `Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`,\n );\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n return rawCommands === undefined || normalized.length === 0\n ? [...DEFAULT_FIELD_COMMANDS]\n : normalized;\n}\n\n/** Validates and normalizes raw add-field CLI input. Throws a plain Error with a stable message when the key is missing/empty, collides with a built-in field, or carries an invalid type/command; the CLI layer maps these to PmCliError exit codes. A `string_array` type implies a repeatable field downstream (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is exposed. */\nexport function normalizeAddFieldInput(\n raw: RawAddFieldInput,\n): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": it shadows a built-in field. Built-in fields are reserved.`,\n );\n }\n\n const typeCandidate =\n typeof raw.type === \"string\" && raw.type.trim().length > 0\n ? raw.type.trim().toLowerCase()\n : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(\n `Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const type = typeCandidate as RuntimeFieldType;\n\n const commands = normalizeFieldCommands(raw.commands);\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag =\n cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key)\n ? cliFlagToken\n : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description:\n description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty fields list. */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/** Serializes the fields file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a custom field into the parsed file. Matching is by normalized key. When a definition already exists, the supplied input fully replaces its add-field-managed attributes (type/commands/description/flags/ required flags) while preserving any unrelated keys the file may carry; any `metadata_key` already stored is preserved so existing item data keeps mapping to the same front-matter column. */\nexport function upsertField(\n file: FieldsFile,\n input: NormalizedAddFieldInput,\n): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find(\n (definition) => normalizeFieldKey(definition.key) === input.key,\n );\n const replaced = existing !== undefined;\n const fields = file.fields.filter(\n (definition) => normalizeFieldKey(definition.key) !== input.key,\n );\n\n const next: RuntimeFieldDefinition = {\n ...existing,\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) =>\n normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)),\n );\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/** Removes a custom field definition from the parsed file by key (normalized). Throws a plain Error when `key` is empty. Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeField(\n file: FieldsFile,\n key: string | undefined,\n): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(\n definition: RuntimeFieldDefinition,\n key: string,\n value: string | undefined,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(\n definition: RuntimeFieldDefinition,\n key: string,\n value: boolean,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n","/**\n * @module core/schema/type-presets\n *\n * Resolves configurable schema, fields, statuses, and workflows for Type Presets.\n */\nimport {\n normalizeAddTypeInput,\n type NormalizedAddTypeInput,\n type RawAddTypeInput,\n} from \"./item-types-file.js\";\n\n/** Shared domain item-type presets. These power both `pm init --type-preset` (registered during initialization) and the standalone `pm schema apply-preset` subcommand (adopting a preset into an already-initialized project). Keeping the raw definitions and the preset-name normalizer in one place guarantees init and schema register byte-identical types. */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\n/** Restricts type preset name values accepted by command, SDK, and storage contracts. */\nexport type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];\n\n/**\n * Raw (pre-normalization) preset definitions keyed by preset name. Each entry is\n * fed through {@link normalizeAddTypeInput} before being upserted so the same\n * validation/normalization the `pm schema add-type` CLI applies governs preset\n * registration too.\n */\nexport const TYPE_PRESET_DEFINITIONS: Record<\n TypePresetName,\n RawAddTypeInput[]\n> = {\n agile: [\n {\n name: \"Story\",\n description:\n \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description:\n \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description:\n \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description:\n \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description:\n \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description:\n \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\n/** Validates and normalizes a raw preset-name CLI value. Returns `undefined` when the value is omitted (no preset requested). Throws a plain Error with a stable message for an empty or unknown preset; CLI layers map it to a USAGE exit code. Accepts hyphen/underscore-insensitive casing for ergonomics. */\nexport function normalizeTypePresetName(\n rawValue: string | undefined,\n): TypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new Error(\"Type preset name must not be empty.\");\n }\n if (\n normalized === \"agile\" ||\n normalized === \"ops\" ||\n normalized === \"research\"\n ) {\n return normalized;\n }\n throw new Error(\n `Invalid type preset \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`,\n );\n}\n\n/** Returns the normalized add-type inputs for a preset, in the order they should be upserted. Each raw definition is run through normalizeAddTypeInput so callers get the same validated shape as an individual `add-type` invocation. */\nexport function resolveTypePresetDefinitions(\n preset: TypePresetName,\n): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) =>\n normalizeAddTypeInput(rawDefinition),\n );\n}\n"],"names":["definition"],"mappings":";;;;;;;;;;;;;;AA8BA,IAAM,0BAA0B,IAAI,IAAY,0BAA0B;AAU1E,IAAM,gCAAgC;AACtC,IAAM,kBAAkB,oBAAI,IA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GAAG;AAC3B,UAAM,IAAI,MAAM,qCAAqC;EACvD;AACA,MACE,eAAe,WACf,eAAe,SACf,eAAe,YACf;AACA,WAAO;EACT;AACA,QAAM,IAAI,MACR,wBAAwB,QAAQ,eAAe,kBAAkB,KAAK,IAAI,CAAC,GAAG;AAElF;AAGM,SAAU,6BACd,QAAsB;AAEtB,SAAO,wBAAwB,MAAM,EAAE,IAAI,CAAC,kBAC1C,sBAAsB,aAAa,CAAC;AAExC","debugId":"b50a9692-fc32-5944-8b60-b0734ec2b1f2"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../core/schema/status-defs-file.ts","../../../../../../../../core/schema/fields-file.ts","../../../../../../../../core/schema/type-presets.ts"],"sourcesContent":["/**\n * @module core/schema/status-defs-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Status Defs File.\n */\nimport { RUNTIME_STATUS_ROLE_VALUES } from \"../../types/index.js\";\nimport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\nimport { DEFAULT_RUNTIME_STATUS_DEFINITIONS } from \"./runtime-schema.js\";\nimport { evictOldestMemoEntries } from \"../shared/memo.js\";\n\nexport type {\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-status` / `pm schema remove-status`\n * commands. The CLI command file (schema.ts) owns IO/governance; everything\n * testable and side-effect-free lives here so it can be coverage-gated to 100%.\n *\n * Statuses persist at `.agents/pm/schema/statuses.json` under the shape\n * `{ statuses: RuntimeStatusDefinition[] }`. When the file is absent the runtime\n * merge layer (src/core/store/settings.ts) still supplies the built-in defaults\n * from DEFAULT_RUNTIME_STATUS_DEFINITIONS, so this module never duplicates them\n * into the persisted file.\n */\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\n\n/**\n * Memo for {@link normalizeStatusToken}. Status ranking inside sort comparators\n * normalizes the same handful of status strings O(n log n) times per corpus scan, and\n * the trim/lowercase/regex pipeline shows up in list/next/context profiles. The cap\n * bounds memory in long-lived hosts against unbounded arbitrary inputs; half-eviction keeps the\n * newest-inserted half when the cap is hit. Declared before\n * BUILTIN_STATUS_IDS, whose module-level initializer already normalizes tokens.\n */\nconst STATUS_TOKEN_MEMO_MAX_ENTRIES = 2_000;\nconst statusTokenMemo = new Map<string, string>();\n\n/** The 5 lifecycle status ids that ship as built-in defaults and may never be removed (their normalized ids match DEFAULT_RUNTIME_STATUS_DEFINITIONS: open/in_progress/blocked/closed/canceled). `draft` is also a default but the acceptance criteria enumerate the 5 terminal/active ids explicitly, so the guard derives the full set from the canonical defaults to stay in sync. */\nexport const BUILTIN_STATUS_IDS: ReadonlySet<string> = new Set(\n DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition) =>\n normalizeStatusToken(definition.id),\n ).filter((id) => id.length > 0),\n);\n\n/** The shape persisted at `.agents/pm/schema/statuses.json`. */\nexport interface StatusDefsFile {\n /** Value that configures or reports statuses for this contract. */\n statuses: RuntimeStatusDefinition[];\n}\n\n/** Documents the raw add status input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string | undefined;\n /** Value that configures or reports roles for this contract. */\n roles?: string[];\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the normalized add status input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddStatusInput {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Normalized roles, or `undefined` when the raw input did not supply a roles field at all. `undefined` means \"leave existing roles untouched\" on upsert; an explicit empty array means \"clear roles\". This distinction is what keeps `add-status review --description x` from wiping a previously-set role. */\n roles?: RuntimeStatusRole[];\n /** Same omitted-vs-explicit-empty semantics as `roles`. */\n aliases?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports order for this contract. */\n order?: number;\n}\n\n/** Documents the upsert status def result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: RuntimeStatusDefinition;\n /** True when an existing definition with the same (normalized) id was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove status def result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveStatusDefResult {\n /** Value that configures or reports file for this contract. */\n file: StatusDefsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested id. */\n definition?: RuntimeStatusDefinition;\n}\n\n/** Normalizes a status token using the same rules as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeStatusToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const memoized = statusTokenMemo.get(value);\n if (memoized !== undefined) {\n return memoized;\n }\n const normalized = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\");\n if (statusTokenMemo.size >= STATUS_TOKEN_MEMO_MAX_ENTRIES) {\n evictOldestMemoEntries(statusTokenMemo);\n }\n statusTokenMemo.set(value, normalized);\n return normalized;\n}\n\nfunction dedupeTokens(values: Iterable<string>): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeStatusToken(value);\n if (token.length > 0) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-status CLI input. Throws a plain Error with a\n * stable message when the id is missing/empty or a role is not one of\n * RUNTIME_STATUS_ROLE_VALUES; the CLI layer maps these to PmCliError exit codes.\n *\n * Omitted vs explicit-empty is preserved end-to-end: when `raw.roles`/`raw.aliases`\n * is `undefined` (flag not supplied) the normalized field is `undefined` so the\n * upsert leaves the existing value untouched; when supplied (even an empty array)\n * the field is normalized to an array so the upsert can apply an explicit clear.\n */\nexport function normalizeAddStatusInput(\n raw: RawAddStatusInput,\n): NormalizedAddStatusInput {\n const id = normalizeStatusToken(raw.id);\n if (id.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n // Built-in lifecycle statuses are reserved and cannot be overridden: an\n // add-status override would change reserved metadata yet remove-status refuses\n // to delete a built-in id, leaving no CLI path to undo it. Reject up front,\n // symmetric with removeStatusDef.\n if (BUILTIN_STATUS_IDS.has(id)) {\n throw new Error(\n `Cannot add-status the built-in status \"${id}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n let roles: RuntimeStatusRole[] | undefined;\n if (raw.roles !== undefined) {\n roles = [];\n const seenRoles = new Set<string>();\n for (const rawRole of raw.roles) {\n const role =\n typeof rawRole === \"string\" ? rawRole.trim().toLowerCase() : \"\";\n if (role.length === 0) {\n continue;\n }\n if (!RUNTIME_STATUS_ROLE_SET.has(role)) {\n throw new Error(\n `Invalid status role \"${rawRole}\". Allowed roles: ${RUNTIME_STATUS_ROLE_VALUES.join(\", \")}.`,\n );\n }\n if (!seenRoles.has(role)) {\n seenRoles.add(role);\n roles.push(role as RuntimeStatusRole);\n }\n }\n }\n const aliases =\n raw.aliases === undefined\n ? undefined\n : dedupeTokens(raw.aliases).filter((alias) => alias !== id);\n const description = raw.description?.trim();\n const order =\n typeof raw.order === \"number\" && Number.isFinite(raw.order)\n ? Math.trunc(raw.order)\n : undefined;\n return {\n id,\n roles,\n aliases,\n description:\n description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction selectStatusesArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.statuses)) {\n return record.statuses;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractStatusDefinitions(parsed: unknown): RuntimeStatusDefinition[] {\n const candidate = selectStatusesArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeStatusDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.id !== \"string\" || record.id.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeStatusDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from statuses.json into a StatusDefsFile. Accepts the canonical `{ statuses: [...] }` shape, a bare array of definitions, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty statuses list. */\nexport function parseStatusDefsFile(\n raw: string | null | undefined,\n): StatusDefsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { statuses: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/statuses.json contains invalid JSON.\");\n }\n return { statuses: extractStatusDefinitions(parsed) };\n}\n\n/** Serializes the status definitions file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeStatusDefsFile(file: StatusDefsFile): string {\n return `${JSON.stringify({ statuses: file.statuses }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a status definition into the parsed file. Matching is by normalized id. When a definition already exists, fields supplied in `input` override the previous values (roles/aliases replace when a non-empty array is given, clear when an explicit empty array is given, and are left UNTOUCHED when the field is `undefined` — i.e. the add-status flag was omitted); description/order override when provided. Fields not addressed by add-status flags are preserved untouched, so `add-status <id> --description x` keeps any previously-set roles/aliases. */\nexport function upsertStatusDef(\n file: StatusDefsFile,\n input: NormalizedAddStatusInput,\n baseDefinition?: RuntimeStatusDefinition,\n): UpsertStatusDefResult {\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === input.id,\n );\n // A file-backed definition is the primary seed; when the status is not yet in\n // statuses.json fall back to `baseDefinition` (the resolved settings-backed\n // definition) so omitting --role/--alias preserves metadata that lives in\n // settings.schema.statuses rather than the file.\n const existing =\n existingIndex >= 0 ? statuses[existingIndex] : baseDefinition;\n\n const next: RuntimeStatusDefinition = {\n ...existing,\n id: input.id,\n };\n if (input.roles !== undefined) {\n if (input.roles.length > 0) {\n next.roles = [...input.roles];\n } else if (next.roles !== undefined) {\n delete next.roles;\n }\n }\n if (input.aliases !== undefined) {\n if (input.aliases.length > 0) {\n next.aliases = [...input.aliases];\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n }\n if (input.description !== undefined) {\n next.description = input.description;\n }\n if (input.order !== undefined) {\n next.order = input.order;\n }\n\n if (existingIndex >= 0) {\n statuses[existingIndex] = next;\n } else {\n statuses.push(next);\n }\n\n return {\n file: { statuses },\n definition: next,\n // \"replaced\" reflects whether the status already existed effectively (in the\n // file OR in resolved settings), so the CLI reports \"Updated\" vs \"Registered\"\n // correctly even when the prior definition lived only in settings.\n replaced: existing !== undefined,\n };\n}\n\n/** Removes a status definition from the parsed file by id (normalized). Throws a plain Error when `id` is empty or matches a reserved built-in default status (those are never stored in the file and must never be deletable). Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeStatusDef(\n file: StatusDefsFile,\n id: string | undefined,\n): RemoveStatusDefResult {\n const normalizedId = normalizeStatusToken(id);\n if (normalizedId.length === 0) {\n throw new Error(\"Status id must not be empty.\");\n }\n if (BUILTIN_STATUS_IDS.has(normalizedId)) {\n throw new Error(\n `Cannot remove built-in status \"${normalizedId}\". Built-in statuses are reserved: ${[...BUILTIN_STATUS_IDS].join(\", \")}.`,\n );\n }\n const statuses = file.statuses.slice();\n const existingIndex = statuses.findIndex(\n (definition) => normalizeStatusToken(definition.id) === normalizedId,\n );\n if (existingIndex < 0) {\n return { file: { statuses }, removed: false };\n }\n const [definition] = statuses.splice(existingIndex, 1);\n return { file: { statuses }, removed: true, definition };\n}\n\n/** Throws when the new status id or any explicitly-supplied alias collides with a DIFFERENT existing status's id/alias. `resolvedAliasToId` maps a normalized token to its owning status id (the runtime status registry's alias_to_id map, which stores ids and aliases in one namespace). Re-adding the same status (matching id) is allowed — only cross-status collisions throw. This prevents a custom status from shadowing a built-in lifecycle token (for example `add-status review --alias open`, or a custom id `cancelled` that aliases the built-in `canceled`), which would make `pm update --status open` resolve to the wrong status. The CLI layer maps the thrown Error to a USAGE exit code. */\nexport function assertStatusTokensAvailable(\n input: { id: string; aliases?: string[] },\n resolvedAliasToId: ReadonlyMap<string, string>,\n): void {\n const candidates = [input.id, ...(input.aliases ?? [])];\n for (const candidate of candidates) {\n const token = normalizeStatusToken(candidate);\n if (token.length === 0) {\n continue;\n }\n const owner = resolvedAliasToId.get(token);\n if (owner !== undefined && owner !== input.id) {\n throw new Error(\n `Status token \"${token}\" already belongs to status \"${owner}\". Choose a different id/alias to avoid shadowing it.`,\n );\n }\n }\n}\n","/**\n * @module core/schema/fields-file\n *\n * Resolves configurable schema, fields, statuses, and workflows for Fields File.\n */\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\nimport { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\n\nexport type {\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n} from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/** Built-in front-matter field names a custom field key must never shadow. A custom key that collides with one of these would let `pm create --<key>` write over reserved metadata, so add-field rejects them up front (symmetric with the built-in-type guard in item-types-file.ts). */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n ...FRONT_MATTER_KEY_ORDER.filter((key) => key !== \"severity\"),\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/** The default commands a field is wired onto when `--commands` is omitted, matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition). */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/** The shape persisted at `.agents/pm/schema/fields.json`. */\nexport interface FieldsFile {\n /** Value that configures or reports fields for this contract. */\n fields: RuntimeFieldDefinition[];\n}\n\n/** Documents the raw add field input payload exchanged by command, SDK, and package integrations. */\nexport interface RawAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string | undefined;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: string;\n /** Value that configures or reports commands for this contract. */\n commands?: string[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports aliases for this contract. */\n aliases?: string[];\n /** Value that configures or reports required for this contract. */\n required?: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate?: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset?: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes?: string[];\n}\n\n/** Documents the normalized add field input payload exchanged by command, SDK, and package integrations. */\nexport interface NormalizedAddFieldInput {\n /** Value that configures or reports key for this contract. */\n key: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type: RuntimeFieldType;\n /** Value that configures or reports commands for this contract. */\n commands: RuntimeFieldCommand[];\n /** Value that configures or reports description for this contract. */\n description?: string;\n /** Value that configures or reports cli flag for this contract. */\n cliFlag?: string;\n /** Value that configures or reports cli aliases for this contract. */\n cliAliases: string[];\n /** Value that configures or reports required for this contract. */\n required: boolean;\n /** Value that configures or reports required on create for this contract. */\n requiredOnCreate: boolean;\n /** Value that configures or reports allow unset for this contract. */\n allowUnset: boolean;\n /** Value that configures or reports required types for this contract. */\n requiredTypes: string[];\n}\n\n/** Documents the upsert field result payload exchanged by command, SDK, and package integrations. */\nexport interface UpsertFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\n/** Documents the remove field result payload exchanged by command, SDK, and package integrations. */\nexport interface RemoveFieldResult {\n /** Value that configures or reports file for this contract. */\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/** Normalizes a field key using the same rule as runtime-schema.ts: lowercase and collapse any run of whitespace/hyphens into a single underscore. */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\"\n ? value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s-]+/g, \"_\")\n : \"\";\n}\n\n/** Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse whitespace/underscore runs to a single hyphen (matches normalizeCliToken in runtime-schema.ts). */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value\n .trim()\n .toLowerCase()\n .replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/** Normalizes the command allow-list stored for a custom field definition. */\nfunction normalizeFieldCommands(\n rawCommands: string[] | undefined,\n): RuntimeFieldCommand[] {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of rawCommands ?? []) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(\n `Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`,\n );\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n return rawCommands === undefined || normalized.length === 0\n ? [...DEFAULT_FIELD_COMMANDS]\n : normalized;\n}\n\n/** Validates and normalizes raw add-field CLI input. Throws a plain Error with a stable message when the key is missing/empty, collides with a built-in field, or carries an invalid type/command; the CLI layer maps these to PmCliError exit codes. A `string_array` type implies a repeatable field downstream (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is exposed. */\nexport function normalizeAddFieldInput(\n raw: RawAddFieldInput,\n): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": custom schema field \"${key}\" collides with built-in item metadata \"${key}\". Rename the custom field with a project-specific prefix. Reserved fields: ${[...BUILTIN_FIELD_KEYS].sort((left, right) => left.localeCompare(right)).join(\", \")}.`,\n );\n }\n\n const typeCandidate =\n typeof raw.type === \"string\" && raw.type.trim().length > 0\n ? raw.type.trim().toLowerCase()\n : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(\n `Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const type = typeCandidate as RuntimeFieldType;\n\n const commands = normalizeFieldCommands(raw.commands);\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag =\n cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key)\n ? cliFlagToken\n : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description:\n description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/** Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }` form, and tolerates a missing/invalid file by returning an empty fields list. */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/** Serializes the fields file with a trailing newline (matches the rest of the schema scaffold files written by pm). */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/** Idempotent UPSERT of a custom field into the parsed file. Matching is by normalized key. When a definition already exists, the supplied input fully replaces its add-field-managed attributes (type/commands/description/flags/ required flags) while preserving any unrelated keys the file may carry; any `metadata_key` already stored is preserved so existing item data keeps mapping to the same front-matter column. */\nexport function upsertField(\n file: FieldsFile,\n input: NormalizedAddFieldInput,\n): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find(\n (definition) => normalizeFieldKey(definition.key) === input.key,\n );\n const replaced = existing !== undefined;\n const fields = file.fields.filter(\n (definition) => normalizeFieldKey(definition.key) !== input.key,\n );\n\n const next: RuntimeFieldDefinition = {\n ...existing,\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) =>\n normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)),\n );\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/** Removes a custom field definition from the parsed file by key (normalized). Throws a plain Error when `key` is empty. Returns `removed: false` when no matching definition exists so the CLI layer can treat the call as an idempotent no-op. */\nexport function removeField(\n file: FieldsFile,\n key: string | undefined,\n): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(\n definition: RuntimeFieldDefinition,\n key: string,\n value: string | undefined,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(\n definition: RuntimeFieldDefinition,\n key: string,\n value: boolean,\n): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n","/**\n * @module core/schema/type-presets\n *\n * Resolves configurable schema, fields, statuses, and workflows for Type Presets.\n */\nimport {\n normalizeAddTypeInput,\n type NormalizedAddTypeInput,\n type RawAddTypeInput,\n} from \"./item-types-file.js\";\n\n/** Shared domain item-type presets. These power both `pm init --type-preset` (registered during initialization) and the standalone `pm schema apply-preset` subcommand (adopting a preset into an already-initialized project). Keeping the raw definitions and the preset-name normalizer in one place guarantees init and schema register byte-identical types. */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\n/** Restricts type preset name values accepted by command, SDK, and storage contracts. */\nexport type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];\n\n/**\n * Raw (pre-normalization) preset definitions keyed by preset name. Each entry is\n * fed through {@link normalizeAddTypeInput} before being upserted so the same\n * validation/normalization the `pm schema add-type` CLI applies governs preset\n * registration too.\n */\nexport const TYPE_PRESET_DEFINITIONS: Record<\n TypePresetName,\n RawAddTypeInput[]\n> = {\n agile: [\n {\n name: \"Story\",\n description:\n \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description:\n \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description:\n \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description:\n \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description:\n \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description:\n \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\n/** Validates and normalizes a raw preset-name CLI value. Returns `undefined` when the value is omitted (no preset requested). Throws a plain Error with a stable message for an empty or unknown preset; CLI layers map it to a USAGE exit code. Accepts hyphen/underscore-insensitive casing for ergonomics. */\nexport function normalizeTypePresetName(\n rawValue: string | undefined,\n): TypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new Error(\"Type preset name must not be empty.\");\n }\n if (\n normalized === \"agile\" ||\n normalized === \"ops\" ||\n normalized === \"research\"\n ) {\n return normalized;\n }\n throw new Error(\n `Invalid type preset \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`,\n );\n}\n\n/** Returns the normalized add-type inputs for a preset, in the order they should be upserted. Each raw definition is run through normalizeAddTypeInput so callers get the same validated shape as an individual `add-type` invocation. */\nexport function resolveTypePresetDefinitions(\n preset: TypePresetName,\n): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) =>\n normalizeAddTypeInput(rawDefinition),\n );\n}\n"],"names":["definition"],"mappings":";;;;;;;;;;;;;;;AA8BA,IAAM,0BAA0B,IAAI,IAAY,0BAA0B;AAU1E,IAAM,gCAAgC;AACtC,IAAM,kBAAkB,oBAAI,IAAG;AAGxB,IAAM,qBAA0C,IAAI,IACzD,mCAAmC,IAAI,CAAC,eACtC,qBAAqB,WAAW,EAAE,CAAC,EACnC,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAAC;AA0D3B,SAAU,qBAAqB,OAAc;AACjD,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,QAAM,WAAW,gBAAgB,IAAI,KAAK;AAC1C,MAAI,aAAa,QAAW;AAC1B,WAAO;EACT;AACA,QAAM,aAAa,MAChB,KAAI,EACJ,YAAW,EACX,WAAW,WAAW,GAAG;AAC5B,MAAI,gBAAgB,QAAQ,+BAA+B;AACzD,2BAAuB,e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wBAAwB,MAAM,EAAE,IAAI,CAAC,kBAC1C,sBAAsB,aAAa,CAAC;AAExC","debugId":"530967bb-33df-5861-80bf-b398d42eab3a"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
renameArtifactsResultKey,
|
|
5
5
|
runLinkedArtifacts
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-N4NKVLPY.js";
|
|
7
7
|
|
|
8
8
|
// dist/cli/commands/docs.js
|
|
9
9
|
async function runDocs(id, options, global) {
|
|
@@ -19,6 +19,6 @@ async function runDocs(id, options, global) {
|
|
|
19
19
|
export {
|
|
20
20
|
runDocs
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=chunk-
|
|
22
|
+
//# sourceMappingURL=chunk-A6AK7W5M.js.map
|
|
23
23
|
|
|
24
24
|
//# debugId=44d979f8-f7b4-51e3-8fa9-14deff99d846
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
readFirstStringFromCommanderOptions,
|
|
14
14
|
readFirstValueFromCommanderOptions,
|
|
15
15
|
readStringArrayFromCommanderOptions
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QPWXNK56.js";
|
|
17
17
|
import {
|
|
18
18
|
printError,
|
|
19
19
|
writeStdout
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NN57FRRN.js";
|
|
21
21
|
import {
|
|
22
22
|
getActiveExtensionRegistrations,
|
|
23
23
|
locateItem,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
readLocatedItem,
|
|
26
26
|
readSettings,
|
|
27
27
|
setActiveCommandResult
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-VXUWCJS7.js";
|
|
29
29
|
import {
|
|
30
30
|
EXIT_CODE,
|
|
31
31
|
PmCliError,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
toNonEmptyString,
|
|
43
43
|
trimTrailingSlashes,
|
|
44
44
|
writeFileAtomic
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-AHIEDSW2.js";
|
|
46
46
|
|
|
47
47
|
// dist/cli/registration-helpers.js
|
|
48
48
|
import { Option } from "commander";
|
|
@@ -2952,6 +2952,6 @@ export {
|
|
|
2952
2952
|
normalizeNextOptions,
|
|
2953
2953
|
invalidateSearchCachesForMutation
|
|
2954
2954
|
};
|
|
2955
|
-
//# sourceMappingURL=chunk-
|
|
2955
|
+
//# sourceMappingURL=chunk-A6AVSYRJ.js.map
|
|
2956
2956
|
|
|
2957
2957
|
//# debugId=032faa13-18ae-5f7a-857d-2fdaae69e061
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
serializeStatusDefsFile,
|
|
19
19
|
upsertField,
|
|
20
20
|
upsertStatusDef
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-A2HZUSEA.js";
|
|
22
22
|
import {
|
|
23
23
|
assertAliasesAvailable,
|
|
24
24
|
assertTypeFolderAvailable,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
removeItemType,
|
|
30
30
|
serializeItemTypesFile,
|
|
31
31
|
upsertItemType
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-UGQENMKM.js";
|
|
33
33
|
import {
|
|
34
34
|
acquireLock,
|
|
35
35
|
getActiveExtensionRegistrations,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
readSettings,
|
|
39
39
|
resolveGovernanceKnobs,
|
|
40
40
|
runActiveOnWriteHooks
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-VXUWCJS7.js";
|
|
42
42
|
import {
|
|
43
43
|
DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,
|
|
44
44
|
EXIT_CODE,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
resolveRuntimeStatusRegistry,
|
|
55
55
|
toDefaultFolder,
|
|
56
56
|
writeFileAtomic
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-AHIEDSW2.js";
|
|
58
58
|
|
|
59
59
|
// dist/cli/commands/schema.js
|
|
60
60
|
import path from "node:path";
|
|
@@ -1234,6 +1234,6 @@ export {
|
|
|
1234
1234
|
formatSchemaInferTypesHuman,
|
|
1235
1235
|
_testOnlySchemaCommand
|
|
1236
1236
|
};
|
|
1237
|
-
//# sourceMappingURL=chunk-
|
|
1237
|
+
//# sourceMappingURL=chunk-ACDIA6NP.js.map
|
|
1238
1238
|
|
|
1239
1239
|
//# debugId=fc95baf3-54c2-5083-a7ff-1d7109f317f7
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {
|
|
4
4
|
getRuntimePath,
|
|
5
5
|
writeFileAtomic
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AHIEDSW2.js";
|
|
7
7
|
|
|
8
8
|
// dist/core/session/session-state.js
|
|
9
9
|
import { promises as fs } from "node:fs";
|
|
@@ -53,6 +53,6 @@ export {
|
|
|
53
53
|
setFocusedItem,
|
|
54
54
|
clearFocusedItem
|
|
55
55
|
};
|
|
56
|
-
//# sourceMappingURL=chunk-
|
|
56
|
+
//# sourceMappingURL=chunk-ACRC3HI4.js.map
|
|
57
57
|
|
|
58
58
|
//# debugId=fe0c58a0-d285-583a-abd6-66aa25b9b668
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// dist/core/fs/fs-utils.js
|
|
2
2
|
|
|
3
|
-
!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
|
+
!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]="4f2ff373-1138-591c-a14c-08dc453352cc")}catch(e){}}();
|
|
4
4
|
import * as fs from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import crypto from "node:crypto";
|
|
@@ -4714,28 +4714,38 @@ var ExtensionApiRegistrar = class {
|
|
|
4714
4714
|
});
|
|
4715
4715
|
}
|
|
4716
4716
|
applyImportExportCommandMetadata(method, commandPath, options) {
|
|
4717
|
-
if (options
|
|
4718
|
-
return;
|
|
4719
|
-
}
|
|
4720
|
-
if (typeof options !== "object" || options === null || Array.isArray(options)) {
|
|
4717
|
+
if (options !== void 0 && (typeof options !== "object" || options === null || Array.isArray(options))) {
|
|
4721
4718
|
throw new TypeError(`${method} options must be an object when provided`);
|
|
4722
4719
|
}
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4720
|
+
const defaultDescription = `${method === "registerImporter" ? "Import" : "Export"} items with the registered extension adapter.`;
|
|
4721
|
+
const defaultArguments = [
|
|
4722
|
+
{
|
|
4723
|
+
name: "file",
|
|
4724
|
+
required: false,
|
|
4725
|
+
description: "Optional input or output file path."
|
|
4726
|
+
}
|
|
4727
|
+
];
|
|
4728
|
+
const resolvedOptions = {
|
|
4729
|
+
...options,
|
|
4730
|
+
description: options?.description ?? defaultDescription,
|
|
4731
|
+
arguments: options?.arguments ?? defaultArguments
|
|
4732
|
+
};
|
|
4733
|
+
assertOptionalStringField(`${method} options.action`, resolvedOptions.action);
|
|
4734
|
+
assertOptionalStringField(`${method} options.description`, resolvedOptions.description);
|
|
4735
|
+
assertOptionalStringField(`${method} options.intent`, resolvedOptions.intent);
|
|
4736
|
+
const action = resolveCommandDefinitionAction(commandPath, resolvedOptions.action);
|
|
4737
|
+
const examples = normalizeOptionalStringArrayField(`${method} options.examples`, resolvedOptions.examples);
|
|
4738
|
+
const failureHints = normalizeOptionalStringArrayField(`${method} options.failure_hints`, resolvedOptions.failure_hints);
|
|
4739
|
+
const argumentsDefinition = normalizeCommandDefinitionArguments(resolvedOptions.arguments);
|
|
4740
|
+
if (resolvedOptions.flags !== void 0) {
|
|
4731
4741
|
assertExtensionCapability(this.#loadedExtension, "schema", `${method} options.flags`);
|
|
4732
4742
|
if (this.allowRegistration("schema.flags", `${method} options.flags`, "schema")) {
|
|
4733
|
-
validateFlagDefinitions(
|
|
4743
|
+
validateFlagDefinitions(resolvedOptions.flags);
|
|
4734
4744
|
this.#registrationRegistry.flags.push({
|
|
4735
4745
|
layer: this.#loadedExtension.layer,
|
|
4736
4746
|
name: this.#loadedExtension.name,
|
|
4737
4747
|
target_command: commandPath,
|
|
4738
|
-
flags: normalizeRegistrationRecordList(`${method} options.flags`,
|
|
4748
|
+
flags: normalizeRegistrationRecordList(`${method} options.flags`, resolvedOptions.flags)
|
|
4739
4749
|
});
|
|
4740
4750
|
}
|
|
4741
4751
|
}
|
|
@@ -4749,11 +4759,11 @@ var ExtensionApiRegistrar = class {
|
|
|
4749
4759
|
failure_hints: failureHints,
|
|
4750
4760
|
arguments: argumentsDefinition
|
|
4751
4761
|
};
|
|
4752
|
-
const description =
|
|
4762
|
+
const description = resolvedOptions.description?.trim();
|
|
4753
4763
|
if (description) {
|
|
4754
4764
|
registration.description = description;
|
|
4755
4765
|
}
|
|
4756
|
-
const intent =
|
|
4766
|
+
const intent = resolvedOptions.intent?.trim();
|
|
4757
4767
|
if (intent) {
|
|
4758
4768
|
registration.intent = intent;
|
|
4759
4769
|
}
|
|
@@ -5964,7 +5974,7 @@ function assertNotReservedItemFieldName(fieldName) {
|
|
|
5964
5974
|
if (!RESERVED_ITEM_FIELD_NAMES.has(fieldName)) {
|
|
5965
5975
|
return;
|
|
5966
5976
|
}
|
|
5967
|
-
throw new PmCliError(`Extension item field "${fieldName}" collides with
|
|
5977
|
+
throw new PmCliError(`Extension item field "${fieldName}" collides with built-in item metadata "${fieldName}"; rename the extension field with an extension-specific prefix. Reserved fields: ${[...RESERVED_ITEM_FIELD_NAMES].sort((left, right) => left.localeCompare(right)).join(", ")}.`, EXIT_CODE.USAGE, {
|
|
5968
5978
|
code: "extension_item_field_reserved",
|
|
5969
5979
|
nextSteps: [
|
|
5970
5980
|
"Rename the extension item field, preferably with an extension-specific prefix."
|
|
@@ -6219,6 +6229,6 @@ export {
|
|
|
6219
6229
|
parseRegisteredItemFieldAssignments,
|
|
6220
6230
|
applyRegisteredItemFieldDefaultsAndValidation
|
|
6221
6231
|
};
|
|
6222
|
-
//# sourceMappingURL=chunk-
|
|
6232
|
+
//# sourceMappingURL=chunk-AHIEDSW2.js.map
|
|
6223
6233
|
|
|
6224
|
-
//# debugId=
|
|
6234
|
+
//# debugId=4f2ff373-1138-591c-a14c-08dc453352cc
|