@unbrained/pm-cli 2026.6.16 → 2026.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cli/commands/completion.js +96 -10
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/create.d.ts +2 -0
- package/dist/cli/commands/create.js +34 -13
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/index.d.ts +3 -1
- package/dist/cli/commands/index.js +5 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +2 -1
- package/dist/cli/commands/init.js +14 -61
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/lifecycle-transitions.d.ts +23 -0
- package/dist/cli/commands/lifecycle-transitions.js +41 -0
- package/dist/cli/commands/lifecycle-transitions.js.map +1 -0
- package/dist/cli/commands/linked-artifacts.d.ts +5 -0
- package/dist/cli/commands/linked-artifacts.js +18 -4
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.d.ts +9 -0
- package/dist/cli/commands/recurrence-parsers.js +19 -2
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.js +28 -4
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
- package/dist/cli/commands/scheduling-shortcuts.d.ts +43 -0
- package/dist/cli/commands/scheduling-shortcuts.js +87 -0
- package/dist/cli/commands/scheduling-shortcuts.js.map +1 -0
- package/dist/cli/commands/schema.d.ts +134 -2
- package/dist/cli/commands/schema.js +482 -3
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/update.js +19 -5
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/help-content.js +26 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.d.ts +19 -0
- package/dist/cli/main.js +40 -2
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-mutation.js +168 -62
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +103 -2
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-PZYSZA26.js +18 -0
- package/dist/cli-bundle/chunks/{activity-MJGTX4LO.js → activity-SFM4THAU.js} +11 -11
- package/dist/cli-bundle/chunks/{aggregate-OUGCDFNC.js → aggregate-Y5ADDKBM.js} +10 -10
- package/dist/cli-bundle/chunks/{aggregate-MH3GROKB.js → aggregate-YTAUQLRW.js} +10 -10
- package/dist/cli-bundle/chunks/{append-VCRUG2W6.js → append-4M7OVV7M.js} +8 -8
- package/dist/cli-bundle/chunks/{append-2Q4BPUBW.js → append-HSPK4L4V.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-F2GC6L3N.js → chunk-26BM6YLO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ILHLIA47.js → chunk-2C6FU3D3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-B5Q7XC4K.js → chunk-2OPYLXDO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CBMETQ2U.js → chunk-2S46FKLB.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-MJZUZ2QE.js → chunk-2TMKMTEI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-M23HXJL3.js → chunk-2VH7DFSJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BJWTFOZM.js → chunk-3ENF4NO4.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-7EILPFMA.js → chunk-3GR2HTYY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-764O7EUA.js → chunk-3R3FYCBV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-G3CEIXTV.js → chunk-3UKJX3RP.js} +27 -15
- package/dist/cli-bundle/chunks/chunk-3UKJX3RP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js +83 -0
- package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4VLB4JH2.js → chunk-5FDYWOJT.js} +4 -3
- package/dist/cli-bundle/chunks/{chunk-WZCQVABQ.js → chunk-5XGWFUW2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-667XI4UJ.js → chunk-6BD77FGL.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KZYVTOG5.js → chunk-6HF6CIY2.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-XLNNCKTN.js → chunk-6PBPD4MN.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-Z3MUNQRV.js → chunk-6VFUEGOA.js} +4 -3
- package/dist/cli-bundle/chunks/{chunk-HDIDUME4.js → chunk-AAOXSPAE.js} +19 -67
- package/dist/cli-bundle/chunks/chunk-AAOXSPAE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-O46LTCXQ.js → chunk-AJCQ5GT6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7ZGKNHUL.js → chunk-ALTGYHN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PZD7WPUC.js → chunk-AOJQL33L.js} +28 -16
- package/dist/cli-bundle/chunks/chunk-AOJQL33L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SY4PZWIZ.js → chunk-AXLDUGXA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YGRPBFMA.js → chunk-BITCVGHT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UUKORJSN.js → chunk-CGQTFWYI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LV5FFQ7M.js → chunk-CHM2VFVL.js} +3 -1
- package/dist/cli-bundle/chunks/{chunk-7AGIXLNK.js → chunk-COVLE33A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SY4GKIWT.js → chunk-DDNBWH4W.js} +91 -20
- package/dist/cli-bundle/chunks/chunk-DDNBWH4W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2JEGCDYT.js → chunk-F5MSD5HE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NIQHNDBZ.js → chunk-FAXB6F6R.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-7K2MXFMX.js → chunk-FPDK5BZQ.js} +15 -14
- package/dist/cli-bundle/chunks/chunk-FPDK5BZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3XOXWOGA.js → chunk-FPY2TOFI.js} +125 -9
- package/dist/cli-bundle/chunks/chunk-FPY2TOFI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TIRZIQRP.js → chunk-G2MOUCTU.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-F7WSO5UX.js → chunk-G57RHEGP.js} +33 -4
- package/dist/cli-bundle/chunks/chunk-G57RHEGP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GAVE4MYM.js → chunk-IROHIK2T.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZJRDVYZI.js → chunk-JZHL4E3Q.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-4KBK4BA3.js → chunk-KA22USXD.js} +14 -13
- package/dist/cli-bundle/chunks/chunk-KA22USXD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KQ3LAMDO.js → chunk-KBC4O7SY.js} +18 -66
- package/dist/cli-bundle/chunks/chunk-KBC4O7SY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UBMCSJXX.js → chunk-KCAGIH6K.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-656HPQPO.js → chunk-KO3VM5GS.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-OY3P2I6B.js → chunk-LNH5Q32E.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GQ4JKNMV.js → chunk-LORM3M2I.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OCTQJP42.js → chunk-M4AVU7VC.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-3WAULYOY.js → chunk-MIBX6ZRN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-FXNT5LPX.js → chunk-MMF2E3FM.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-AERT7KT3.js → chunk-MORZOR7W.js} +21 -8
- package/dist/cli-bundle/chunks/chunk-MORZOR7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IMQG4VR3.js → chunk-MUTUZ2HD.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-7L5VOUYP.js → chunk-OGXEBTX3.js} +32 -3
- package/dist/cli-bundle/chunks/{chunk-7L5VOUYP.js.map → chunk-OGXEBTX3.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NCIBNERT.js → chunk-OOIH6J5T.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-II7OGE3V.js → chunk-OSBJPPX3.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-HPELHUTG.js → chunk-PJS3WDO2.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-6NQXMGYU.js → chunk-QGPE2H6Z.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-ASM4DVRW.js → chunk-QVTFFLR2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FTAZLAR7.js → chunk-QW2F6ARZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-A576QZDL.js → chunk-QXC3LWB7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-6BV7ENQL.js → chunk-QXMXRPX5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SPYPC5CB.js → chunk-R4AKUPKI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UAR2VNCK.js → chunk-RASR23HV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YXTLI4XP.js → chunk-SCDCNGCV.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-2IUJBMKS.js → chunk-SCS5PVAA.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-KTVETP66.js → chunk-SJCMTOEU.js} +3 -1
- package/dist/cli-bundle/chunks/{chunk-L6FJPOT4.js → chunk-SO2ES46D.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-GYMG7AG6.js → chunk-TBV33CB4.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js +86 -0
- package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OLTYNVJR.js → chunk-TWBDDVIF.js} +20 -7
- package/dist/cli-bundle/chunks/chunk-TWBDDVIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XNOY7TCB.js → chunk-UGUJ2UOR.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-E6J2PEK6.js → chunk-UN6P3IJ4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZONXMSVB.js → chunk-V2GYOMEX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-T5VU7ROQ.js → chunk-VF3KQGNY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RKKIH2ZQ.js → chunk-VHG6LUKR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-H6EH6ENJ.js → chunk-VXHMQDXA.js} +126 -10
- package/dist/cli-bundle/chunks/chunk-VXHMQDXA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-G2YVUY7I.js → chunk-VXRFAE7W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q5RLUCP3.js → chunk-WQRL4COW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-IQVB3YDD.js → chunk-XESAPVZ4.js} +99 -21
- package/dist/cli-bundle/chunks/chunk-XESAPVZ4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TUB3DZAZ.js → chunk-YLAW3FZN.js} +5 -5
- package/dist/cli-bundle/chunks/{claim-NEO7AGWH.js → claim-WGAWJCPY.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-4APLUXJW.js → claim-ZI6P4LMU.js} +10 -10
- package/dist/cli-bundle/chunks/close-I7PRQ5G7.js +13 -0
- package/dist/cli-bundle/chunks/{close-3QABBNGU.js → close-JMVVSIQE.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-MIZLTYGL.js → close-many-IKPJXVOZ.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-Q7Y5AHQI.js → close-many-TXABDCSJ.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-DAIQPOMU.js → comments-RLWR2S7W.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-IWFSVM4P.js → comments-YAMXKHUX.js} +10 -10
- package/dist/cli-bundle/chunks/{config-PXTMAYV3.js → config-7ICYC2WU.js} +47 -9
- package/dist/cli-bundle/chunks/config-7ICYC2WU.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-IOJELD6O.js → config-NGWN3EXC.js} +48 -10
- package/dist/cli-bundle/chunks/config-NGWN3EXC.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-QHJSCJW4.js → context-K6QAHN5H.js} +13 -13
- package/dist/cli-bundle/chunks/{context-XZS2VFKU.js → context-VGXOOAH2.js} +13 -13
- package/dist/cli-bundle/chunks/{contracts-B7U4OJTV.js → contracts-KJGY2AQA.js} +51 -11
- package/dist/cli-bundle/chunks/contracts-KJGY2AQA.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-NSBVLXQ3.js → contracts-KMA6OJY7.js} +50 -10
- package/dist/cli-bundle/chunks/{contracts-B7U4OJTV.js.map → contracts-KMA6OJY7.js.map} +7 -1
- package/dist/cli-bundle/chunks/{copy-Q64T5FD4.js → copy-Q2PPU4AY.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-SG34LCMU.js → copy-SC6UF3PI.js} +7 -7
- package/dist/cli-bundle/chunks/{create-IPAX2SNL.js → create-76FE7JVF.js} +14 -14
- package/dist/cli-bundle/chunks/create-RTRFW6RE.js +30 -0
- package/dist/cli-bundle/chunks/{delete-VH3L7DZ6.js → delete-T6DJSUJI.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-TLXR7LJ2.js → delete-XFUX533E.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-J3HBBLDB.js → deps-5GWMMS6D.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-XV6JJ6IN.js → deps-MCCU633S.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-GWDEB7JH.js → docs-HE3HCQ4S.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-RCLNSKID.js → docs-SXMOABHR.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-7KO2NX2A.js → extension-E23K4QRR.js} +5 -5
- package/dist/cli-bundle/chunks/{extension-5RN65LHT.js → extension-PMD3XMLN.js} +5 -5
- package/dist/cli-bundle/chunks/{files-3TCQHUHA.js → files-2RSWGPEU.js} +9 -9
- package/dist/cli-bundle/chunks/{files-5FDUPSEA.js → files-ZWFJFWBK.js} +9 -9
- package/dist/cli-bundle/chunks/{focus-HQXBYPKM.js → focus-KTTB3P3F.js} +8 -8
- package/dist/cli-bundle/chunks/{focus-7AQMNRSU.js → focus-ZMDP4FEL.js} +8 -8
- package/dist/cli-bundle/chunks/{gc-5B6ABL3Z.js → gc-BXIAKLAH.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-2FGKYRJ4.js → gc-C7K6JNUO.js} +3 -3
- package/dist/cli-bundle/chunks/{get-FUMVOJQD.js → get-AZQLC4NO.js} +11 -11
- package/dist/cli-bundle/chunks/{get-H5BZTW4A.js → get-I65HTAWO.js} +11 -11
- package/dist/cli-bundle/chunks/{health-JSVOR6B4.js → health-3MFFPQVZ.js} +13 -13
- package/dist/cli-bundle/chunks/{health-LE2ZQGSM.js → health-MYZEOCLI.js} +13 -13
- package/dist/cli-bundle/chunks/{history-QO4JVJJP.js → history-73Z6OBFZ.js} +10 -10
- package/dist/cli-bundle/chunks/history-BIPHVUMF.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-ID74DOUI.js → history-compact-24VQ63A3.js} +11 -11
- package/dist/cli-bundle/chunks/{history-compact-SDFRPZ4V.js → history-compact-UIAR2OI4.js} +11 -11
- package/dist/cli-bundle/chunks/{history-redact-Z4P5MM3G.js → history-redact-7YCXEWJD.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-WZZ6GZ2Z.js +21 -0
- package/dist/cli-bundle/chunks/{history-repair-CKE7GLZR.js → history-repair-4NOFFG2W.js} +12 -12
- package/dist/cli-bundle/chunks/{history-repair-ANHEYWKF.js → history-repair-GQN2X4TR.js} +12 -12
- package/dist/cli-bundle/chunks/init-K34V4PZR.js +20 -0
- package/dist/cli-bundle/chunks/{init-K6MSMB37.js → init-TDEDNVMM.js} +10 -9
- package/dist/cli-bundle/chunks/{learnings-VIS3NOQV.js → learnings-TV2CTGJ3.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-YYNB64GN.js → learnings-U67FTXPB.js} +10 -10
- package/dist/cli-bundle/chunks/{list-UHMA3N2K.js → list-MSHYOCFU.js} +10 -10
- package/dist/cli-bundle/chunks/{list-7UE44A2R.js → list-VV57WGUD.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-IN3UMA7W.js → notes-EUANWWKD.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-2HRMV67I.js → notes-GYVNDAL4.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-PAWCCAPW.js → plan-4LF4AV63.js} +14 -14
- package/dist/cli-bundle/chunks/{plan-I3SVH7FV.js → plan-W27O6DBS.js} +14 -14
- package/dist/cli-bundle/chunks/{register-list-query-OTIK4DVA.js → register-list-query-BXLEHJ7L.js} +18 -18
- package/dist/cli-bundle/chunks/{register-list-query-N7Z7RTDM.js → register-list-query-C2MS3BVQ.js} +18 -18
- package/dist/cli-bundle/chunks/{register-mutation-UFZK6Q57.js → register-mutation-6UCOEQ6L.js} +179 -74
- package/dist/cli-bundle/chunks/register-mutation-6UCOEQ6L.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-XFORLS6D.js → register-mutation-HE73PREP.js} +180 -75
- package/dist/cli-bundle/chunks/register-mutation-HE73PREP.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-6ZCLKRBG.js → register-operations-L6C32FDA.js} +89 -31
- package/dist/cli-bundle/chunks/{register-operations-6ZCLKRBG.js.map → register-operations-L6C32FDA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-operations-ITE7JTH3.js → register-operations-QQEHEX4P.js} +90 -32
- package/dist/cli-bundle/chunks/{register-operations-ITE7JTH3.js.map → register-operations-QQEHEX4P.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-7RKGE4BQ.js → register-setup-A7N4PNT3.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-7UKEFKT6.js → register-setup-WHG3NBP6.js} +15 -15
- package/dist/cli-bundle/chunks/{restore-NNVPBBVJ.js → restore-TSWSULYY.js} +11 -11
- package/dist/cli-bundle/chunks/restore-XQXICL3V.js +19 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js +91 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js.map +7 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js +88 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-3YKCQ3VO.js → schema-7U7JUYGK.js} +779 -10
- package/dist/cli-bundle/chunks/schema-7U7JUYGK.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-3HCLXCFX.js → schema-TSBYSEMW.js} +792 -9
- package/dist/cli-bundle/chunks/schema-TSBYSEMW.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-NQ42NC6A.js → search-OXLSQKHP.js} +11 -11
- package/dist/cli-bundle/chunks/{search-V7PZ2ICH.js → search-T3TOFLOQ.js} +11 -11
- package/dist/cli-bundle/chunks/{stats-7KD4PJC5.js → stats-5CLG22YZ.js} +8 -8
- package/dist/cli-bundle/chunks/{stats-GRHO6RFB.js → stats-XEMUXS42.js} +8 -8
- package/dist/cli-bundle/chunks/{telemetry-TRRYZXWT.js → telemetry-23OPBBZT.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-H5GLXNG5.js → telemetry-I3D7XZ55.js} +4 -4
- package/dist/cli-bundle/chunks/{test-6CZNIIGA.js → test-AROS3LIV.js} +15 -14
- package/dist/cli-bundle/chunks/{test-7GVQ3VMN.js → test-CECIMKOA.js} +15 -14
- package/dist/cli-bundle/chunks/{test-all-ODVADHV6.js → test-all-4DEQPIXH.js} +17 -16
- package/dist/cli-bundle/chunks/{test-all-ODVADHV6.js.map → test-all-4DEQPIXH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-3LF2OZD2.js → test-all-6RO6X3SM.js} +15 -14
- package/dist/cli-bundle/chunks/{test-all-3LF2OZD2.js.map → test-all-6RO6X3SM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-LYT6ZTNQ.js → test-runs-AAXVFWKH.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-RVP6VWN7.js → test-runs-LYBQSYRC.js} +5 -5
- package/dist/cli-bundle/chunks/update-MIWEJC76.js +24 -0
- package/dist/cli-bundle/chunks/update-P7I5YSRB.js +28 -0
- package/dist/cli-bundle/chunks/{update-many-XSEQJ24X.js → update-many-5B4HLVBK.js} +23 -23
- package/dist/cli-bundle/chunks/{update-many-FCU6RKTO.js → update-many-G2QOVZSB.js} +23 -23
- package/dist/cli-bundle/chunks/{upgrade-FOB5LHO5.js → upgrade-GFIDL62L.js} +5 -5
- package/dist/cli-bundle/chunks/{upgrade-A6TL3INC.js → upgrade-QUQYL7D3.js} +5 -5
- package/dist/cli-bundle/chunks/{validate-EHL3MI2V.js → validate-ADDZBMM3.js} +20 -19
- package/dist/cli-bundle/chunks/{validate-EHL3MI2V.js.map → validate-ADDZBMM3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-7BLDG3AT.js → validate-MAS3H6ZP.js} +22 -21
- package/dist/cli-bundle/chunks/{validate-7BLDG3AT.js.map → validate-MAS3H6ZP.js.map} +1 -1
- package/dist/cli-bundle/main.js +61 -19
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/core/config/nested-settings.js +40 -2
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/item/parse.d.ts +32 -0
- package/dist/core/item/parse.js +61 -2
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/schema/fields-file.d.ts +94 -0
- package/dist/core/schema/fields-file.js +317 -0
- package/dist/core/schema/fields-file.js.map +1 -0
- package/dist/core/schema/type-inference.d.ts +34 -0
- package/dist/core/schema/type-inference.js +97 -0
- package/dist/core/schema/type-inference.js.map +1 -0
- package/dist/core/schema/type-presets.d.ts +30 -0
- package/dist/core/schema/type-presets.js +96 -0
- package/dist/core/schema/type-presets.js.map +1 -0
- package/dist/core/store/front-matter-cache.d.ts +13 -0
- package/dist/core/store/front-matter-cache.js +21 -11
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/mcp/server.js +51 -4
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +49 -8
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.js +5 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +46 -5
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +3 -0
- package/dist/sdk/cli-contracts.js +76 -3
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/docs/COMMANDS.md +35 -3
- package/docs/CONFIGURATION.md +83 -0
- package/package.json +1 -1
- package/dist/cli-bundle/chunks/activity-5P2KQCTH.js +0 -18
- package/dist/cli-bundle/chunks/chunk-3XOXWOGA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4KBK4BA3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7K2MXFMX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AERT7KT3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-F7WSO5UX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-G3CEIXTV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-H6EH6ENJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HDIDUME4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IQVB3YDD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KQ3LAMDO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OLTYNVJR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PZD7WPUC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SY4GKIWT.js.map +0 -1
- package/dist/cli-bundle/chunks/close-ILMZR3D7.js +0 -13
- package/dist/cli-bundle/chunks/config-IOJELD6O.js.map +0 -1
- package/dist/cli-bundle/chunks/config-PXTMAYV3.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-NSBVLXQ3.js.map +0 -7
- package/dist/cli-bundle/chunks/create-F5HZX2S4.js +0 -30
- package/dist/cli-bundle/chunks/history-SSXGGTVZ.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-VBH44Y7F.js +0 -21
- package/dist/cli-bundle/chunks/init-7FBQO77A.js +0 -19
- package/dist/cli-bundle/chunks/register-mutation-UFZK6Q57.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-XFORLS6D.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-XXXLQ2XC.js +0 -19
- package/dist/cli-bundle/chunks/schema-3HCLXCFX.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-3YKCQ3VO.js.map +0 -1
- package/dist/cli-bundle/chunks/update-MPGM6SBE.js +0 -28
- package/dist/cli-bundle/chunks/update-UN75XW3C.js +0 -24
- /package/dist/cli-bundle/chunks/{activity-5P2KQCTH.js.map → activity-PZYSZA26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-MJGTX4LO.js.map → activity-SFM4THAU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-OUGCDFNC.js.map → aggregate-Y5ADDKBM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{aggregate-MH3GROKB.js.map → aggregate-YTAUQLRW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-VCRUG2W6.js.map → append-4M7OVV7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-2Q4BPUBW.js.map → append-HSPK4L4V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F2GC6L3N.js.map → chunk-26BM6YLO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ILHLIA47.js.map → chunk-2C6FU3D3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B5Q7XC4K.js.map → chunk-2OPYLXDO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CBMETQ2U.js.map → chunk-2S46FKLB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MJZUZ2QE.js.map → chunk-2TMKMTEI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M23HXJL3.js.map → chunk-2VH7DFSJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BJWTFOZM.js.map → chunk-3ENF4NO4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7EILPFMA.js.map → chunk-3GR2HTYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-764O7EUA.js.map → chunk-3R3FYCBV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4VLB4JH2.js.map → chunk-5FDYWOJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WZCQVABQ.js.map → chunk-5XGWFUW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-667XI4UJ.js.map → chunk-6BD77FGL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KZYVTOG5.js.map → chunk-6HF6CIY2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XLNNCKTN.js.map → chunk-6PBPD4MN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z3MUNQRV.js.map → chunk-6VFUEGOA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-O46LTCXQ.js.map → chunk-AJCQ5GT6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7ZGKNHUL.js.map → chunk-ALTGYHN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SY4PZWIZ.js.map → chunk-AXLDUGXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YGRPBFMA.js.map → chunk-BITCVGHT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UUKORJSN.js.map → chunk-CGQTFWYI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LV5FFQ7M.js.map → chunk-CHM2VFVL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7AGIXLNK.js.map → chunk-COVLE33A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2JEGCDYT.js.map → chunk-F5MSD5HE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NIQHNDBZ.js.map → chunk-FAXB6F6R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TIRZIQRP.js.map → chunk-G2MOUCTU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GAVE4MYM.js.map → chunk-IROHIK2T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZJRDVYZI.js.map → chunk-JZHL4E3Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UBMCSJXX.js.map → chunk-KCAGIH6K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-656HPQPO.js.map → chunk-KO3VM5GS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OY3P2I6B.js.map → chunk-LNH5Q32E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GQ4JKNMV.js.map → chunk-LORM3M2I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OCTQJP42.js.map → chunk-M4AVU7VC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3WAULYOY.js.map → chunk-MIBX6ZRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FXNT5LPX.js.map → chunk-MMF2E3FM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IMQG4VR3.js.map → chunk-MUTUZ2HD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NCIBNERT.js.map → chunk-OOIH6J5T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-II7OGE3V.js.map → chunk-OSBJPPX3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPELHUTG.js.map → chunk-PJS3WDO2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6NQXMGYU.js.map → chunk-QGPE2H6Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ASM4DVRW.js.map → chunk-QVTFFLR2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FTAZLAR7.js.map → chunk-QW2F6ARZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A576QZDL.js.map → chunk-QXC3LWB7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6BV7ENQL.js.map → chunk-QXMXRPX5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SPYPC5CB.js.map → chunk-R4AKUPKI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UAR2VNCK.js.map → chunk-RASR23HV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YXTLI4XP.js.map → chunk-SCDCNGCV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IUJBMKS.js.map → chunk-SCS5PVAA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KTVETP66.js.map → chunk-SJCMTOEU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L6FJPOT4.js.map → chunk-SO2ES46D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GYMG7AG6.js.map → chunk-TBV33CB4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XNOY7TCB.js.map → chunk-UGUJ2UOR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E6J2PEK6.js.map → chunk-UN6P3IJ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZONXMSVB.js.map → chunk-V2GYOMEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T5VU7ROQ.js.map → chunk-VF3KQGNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RKKIH2ZQ.js.map → chunk-VHG6LUKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G2YVUY7I.js.map → chunk-VXRFAE7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q5RLUCP3.js.map → chunk-WQRL4COW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TUB3DZAZ.js.map → chunk-YLAW3FZN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-NEO7AGWH.js.map → claim-WGAWJCPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-4APLUXJW.js.map → claim-ZI6P4LMU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-ILMZR3D7.js.map → close-I7PRQ5G7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-3QABBNGU.js.map → close-JMVVSIQE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-MIZLTYGL.js.map → close-many-IKPJXVOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-Q7Y5AHQI.js.map → close-many-TXABDCSJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-DAIQPOMU.js.map → comments-RLWR2S7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-IWFSVM4P.js.map → comments-YAMXKHUX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-QHJSCJW4.js.map → context-K6QAHN5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-XZS2VFKU.js.map → context-VGXOOAH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-Q64T5FD4.js.map → copy-Q2PPU4AY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-SG34LCMU.js.map → copy-SC6UF3PI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-IPAX2SNL.js.map → create-76FE7JVF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-F5HZX2S4.js.map → create-RTRFW6RE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-VH3L7DZ6.js.map → delete-T6DJSUJI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-TLXR7LJ2.js.map → delete-XFUX533E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-J3HBBLDB.js.map → deps-5GWMMS6D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-XV6JJ6IN.js.map → deps-MCCU633S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GWDEB7JH.js.map → docs-HE3HCQ4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RCLNSKID.js.map → docs-SXMOABHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-7KO2NX2A.js.map → extension-E23K4QRR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-5RN65LHT.js.map → extension-PMD3XMLN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-3TCQHUHA.js.map → files-2RSWGPEU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-5FDUPSEA.js.map → files-ZWFJFWBK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-HQXBYPKM.js.map → focus-KTTB3P3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-7AQMNRSU.js.map → focus-ZMDP4FEL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-5B6ABL3Z.js.map → gc-BXIAKLAH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-2FGKYRJ4.js.map → gc-C7K6JNUO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-FUMVOJQD.js.map → get-AZQLC4NO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-H5BZTW4A.js.map → get-I65HTAWO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-JSVOR6B4.js.map → health-3MFFPQVZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-LE2ZQGSM.js.map → health-MYZEOCLI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-QO4JVJJP.js.map → history-73Z6OBFZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-SSXGGTVZ.js.map → history-BIPHVUMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-ID74DOUI.js.map → history-compact-24VQ63A3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-SDFRPZ4V.js.map → history-compact-UIAR2OI4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-Z4P5MM3G.js.map → history-redact-7YCXEWJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-VBH44Y7F.js.map → history-redact-WZZ6GZ2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-CKE7GLZR.js.map → history-repair-4NOFFG2W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-ANHEYWKF.js.map → history-repair-GQN2X4TR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-7FBQO77A.js.map → init-K34V4PZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-K6MSMB37.js.map → init-TDEDNVMM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-VIS3NOQV.js.map → learnings-TV2CTGJ3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-YYNB64GN.js.map → learnings-U67FTXPB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-UHMA3N2K.js.map → list-MSHYOCFU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-7UE44A2R.js.map → list-VV57WGUD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-IN3UMA7W.js.map → notes-EUANWWKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2HRMV67I.js.map → notes-GYVNDAL4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-PAWCCAPW.js.map → plan-4LF4AV63.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-I3SVH7FV.js.map → plan-W27O6DBS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-OTIK4DVA.js.map → register-list-query-BXLEHJ7L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-N7Z7RTDM.js.map → register-list-query-C2MS3BVQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-7RKGE4BQ.js.map → register-setup-A7N4PNT3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-7UKEFKT6.js.map → register-setup-WHG3NBP6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-NNVPBBVJ.js.map → restore-TSWSULYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-XXXLQ2XC.js.map → restore-XQXICL3V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-NQ42NC6A.js.map → search-OXLSQKHP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-V7PZ2ICH.js.map → search-T3TOFLOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-7KD4PJC5.js.map → stats-5CLG22YZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-GRHO6RFB.js.map → stats-XEMUXS42.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-TRRYZXWT.js.map → telemetry-23OPBBZT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-H5GLXNG5.js.map → telemetry-I3D7XZ55.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-6CZNIIGA.js.map → test-AROS3LIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-7GVQ3VMN.js.map → test-CECIMKOA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-LYT6ZTNQ.js.map → test-runs-AAXVFWKH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-RVP6VWN7.js.map → test-runs-LYBQSYRC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-UN75XW3C.js.map → update-MIWEJC76.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-MPGM6SBE.js.map → update-P7I5YSRB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-XSEQJ24X.js.map → update-many-5B4HLVBK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-FCU6RKTO.js.map → update-many-G2QOVZSB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-FOB5LHO5.js.map → upgrade-GFIDL62L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-A6TL3INC.js.map → upgrade-QUQYL7D3.js.map} +0 -0
|
@@ -0,0 +1,317 @@
|
|
|
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]="01bca6b9-49d3-5785-9d18-8399a0aac293")}catch(e){}}();
|
|
3
|
+
import { RUNTIME_FIELD_COMMAND_VALUES, RUNTIME_FIELD_TYPE_VALUES, } from "../../types/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Pure logic for the `pm schema add-field` / `pm schema remove-field` commands
|
|
6
|
+
* and the `list-fields` / `show-field` inspectors. The CLI command file
|
|
7
|
+
* (schema.ts) owns IO/governance; everything testable and side-effect-free lives
|
|
8
|
+
* here so it can be coverage-gated to 100%.
|
|
9
|
+
*
|
|
10
|
+
* Custom fields persist at `.agents/pm/schema/fields.json` under the shape
|
|
11
|
+
* `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer
|
|
12
|
+
* (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers
|
|
13
|
+
* a CLI flag per field on create/update/list/search/context, so this module only
|
|
14
|
+
* has to manage the persisted entries; it never duplicates the registration.
|
|
15
|
+
*/
|
|
16
|
+
const RUNTIME_FIELD_TYPE_SET = new Set(RUNTIME_FIELD_TYPE_VALUES);
|
|
17
|
+
const RUNTIME_FIELD_COMMAND_SET = new Set(RUNTIME_FIELD_COMMAND_VALUES);
|
|
18
|
+
/**
|
|
19
|
+
* Built-in front-matter field names a custom field key must never shadow. A
|
|
20
|
+
* custom key that collides with one of these would let `pm create --<key>` write
|
|
21
|
+
* over reserved metadata, so add-field rejects them up front (symmetric with the
|
|
22
|
+
* built-in-type guard in item-types-file.ts).
|
|
23
|
+
*/
|
|
24
|
+
export const BUILTIN_FIELD_KEYS = new Set([
|
|
25
|
+
"id",
|
|
26
|
+
"title",
|
|
27
|
+
"type",
|
|
28
|
+
"status",
|
|
29
|
+
"priority",
|
|
30
|
+
"tags",
|
|
31
|
+
"assignee",
|
|
32
|
+
"parent",
|
|
33
|
+
"description",
|
|
34
|
+
"body",
|
|
35
|
+
"created_at",
|
|
36
|
+
"updated_at",
|
|
37
|
+
"closed_at",
|
|
38
|
+
"author",
|
|
39
|
+
"deadline",
|
|
40
|
+
"estimate",
|
|
41
|
+
"sprint",
|
|
42
|
+
"release",
|
|
43
|
+
"risk",
|
|
44
|
+
"confidence",
|
|
45
|
+
"reviewer",
|
|
46
|
+
"resolution",
|
|
47
|
+
"expected",
|
|
48
|
+
"actual",
|
|
49
|
+
]);
|
|
50
|
+
/**
|
|
51
|
+
* The default commands a field is wired onto when `--commands` is omitted,
|
|
52
|
+
* matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition).
|
|
53
|
+
*/
|
|
54
|
+
const DEFAULT_FIELD_COMMANDS = ["create", "update"];
|
|
55
|
+
/**
|
|
56
|
+
* Normalizes a field key using the same rule as runtime-schema.ts: lowercase and
|
|
57
|
+
* collapse any run of whitespace/hyphens into a single underscore.
|
|
58
|
+
*/
|
|
59
|
+
export function normalizeFieldKey(value) {
|
|
60
|
+
return typeof value === "string" ? value.trim().toLowerCase().replaceAll(/[\s-]+/g, "_") : "";
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse
|
|
64
|
+
* whitespace/underscore runs to a single hyphen (matches normalizeCliToken in
|
|
65
|
+
* runtime-schema.ts).
|
|
66
|
+
*/
|
|
67
|
+
function normalizeCliToken(value) {
|
|
68
|
+
if (typeof value !== "string") {
|
|
69
|
+
return "";
|
|
70
|
+
}
|
|
71
|
+
const collapsed = value.trim().toLowerCase().replaceAll(/[\s_]+/g, "-");
|
|
72
|
+
return collapsed.startsWith("--") ? collapsed.slice(2) : collapsed;
|
|
73
|
+
}
|
|
74
|
+
function keyToDefaultCliFlag(key) {
|
|
75
|
+
return key.replaceAll("_", "-");
|
|
76
|
+
}
|
|
77
|
+
function dedupeCliTokens(values, exclude) {
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
for (const value of values) {
|
|
80
|
+
const token = normalizeCliToken(value);
|
|
81
|
+
if (token.length > 0 && token !== exclude) {
|
|
82
|
+
seen.add(token);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [...seen].sort((left, right) => left.localeCompare(right));
|
|
86
|
+
}
|
|
87
|
+
function dedupeStringList(values) {
|
|
88
|
+
const seen = new Set();
|
|
89
|
+
for (const value of values ?? []) {
|
|
90
|
+
const trimmed = value.trim();
|
|
91
|
+
if (trimmed.length > 0) {
|
|
92
|
+
seen.add(trimmed);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return [...seen].sort((left, right) => left.localeCompare(right));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Validates and normalizes raw add-field CLI input. Throws a plain Error with a
|
|
99
|
+
* stable message when the key is missing/empty, collides with a built-in field,
|
|
100
|
+
* or carries an invalid type/command; the CLI layer maps these to PmCliError
|
|
101
|
+
* exit codes. A `string_array` type implies a repeatable field downstream
|
|
102
|
+
* (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is
|
|
103
|
+
* exposed.
|
|
104
|
+
*/
|
|
105
|
+
export function normalizeAddFieldInput(raw) {
|
|
106
|
+
const key = normalizeFieldKey(raw.key);
|
|
107
|
+
if (key.length === 0) {
|
|
108
|
+
throw new Error("Field key must not be empty.");
|
|
109
|
+
}
|
|
110
|
+
if (BUILTIN_FIELD_KEYS.has(key)) {
|
|
111
|
+
throw new Error(`Cannot define custom field "${key}": it shadows a built-in field. Built-in fields are reserved.`);
|
|
112
|
+
}
|
|
113
|
+
const typeCandidate = typeof raw.type === "string" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : "string";
|
|
114
|
+
if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {
|
|
115
|
+
throw new Error(`Invalid field type "${raw.type}". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(", ")}.`);
|
|
116
|
+
}
|
|
117
|
+
const type = typeCandidate;
|
|
118
|
+
let commands;
|
|
119
|
+
if (raw.commands === undefined) {
|
|
120
|
+
commands = [...DEFAULT_FIELD_COMMANDS];
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
const seen = new Set();
|
|
124
|
+
const normalized = [];
|
|
125
|
+
for (const rawCommand of raw.commands) {
|
|
126
|
+
const command = rawCommand.trim().toLowerCase();
|
|
127
|
+
if (command.length === 0) {
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {
|
|
131
|
+
throw new Error(`Invalid field command "${rawCommand}". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(", ")}.`);
|
|
132
|
+
}
|
|
133
|
+
if (!seen.has(command)) {
|
|
134
|
+
seen.add(command);
|
|
135
|
+
normalized.push(command);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
commands = normalized.length > 0 ? normalized : [...DEFAULT_FIELD_COMMANDS];
|
|
139
|
+
}
|
|
140
|
+
const cliFlagToken = normalizeCliToken(raw.cliFlag);
|
|
141
|
+
const cliFlag = cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key) ? cliFlagToken : undefined;
|
|
142
|
+
const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);
|
|
143
|
+
const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);
|
|
144
|
+
const description = raw.description?.trim();
|
|
145
|
+
return {
|
|
146
|
+
key,
|
|
147
|
+
type,
|
|
148
|
+
commands,
|
|
149
|
+
description: description && description.length > 0 ? description : undefined,
|
|
150
|
+
cliFlag,
|
|
151
|
+
cliAliases,
|
|
152
|
+
required: raw.required === true,
|
|
153
|
+
requiredOnCreate: raw.requiredOnCreate === true,
|
|
154
|
+
// allow_unset defaults to true (omitted) and is only persisted when an
|
|
155
|
+
// operator explicitly disables it with --no-allow-unset (allowUnset === false).
|
|
156
|
+
allowUnset: raw.allowUnset !== false,
|
|
157
|
+
requiredTypes: dedupeStringList(raw.requiredTypes),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
function selectFieldsArray(parsed) {
|
|
161
|
+
if (Array.isArray(parsed)) {
|
|
162
|
+
return parsed;
|
|
163
|
+
}
|
|
164
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
165
|
+
return undefined;
|
|
166
|
+
}
|
|
167
|
+
const record = parsed;
|
|
168
|
+
if (Array.isArray(record.fields)) {
|
|
169
|
+
return record.fields;
|
|
170
|
+
}
|
|
171
|
+
if (Array.isArray(record.definitions)) {
|
|
172
|
+
return record.definitions;
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
function extractFieldDefinitions(parsed) {
|
|
177
|
+
const candidate = selectFieldsArray(parsed);
|
|
178
|
+
if (!candidate) {
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
const definitions = [];
|
|
182
|
+
for (const entry of candidate) {
|
|
183
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
const record = entry;
|
|
187
|
+
if (typeof record.key !== "string" || record.key.trim().length === 0) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
definitions.push(record);
|
|
191
|
+
}
|
|
192
|
+
return definitions;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts
|
|
196
|
+
* the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }`
|
|
197
|
+
* form, and tolerates a missing/invalid file by returning an empty fields list.
|
|
198
|
+
*/
|
|
199
|
+
export function parseFieldsFile(raw) {
|
|
200
|
+
if (raw === null || raw === undefined || raw.trim().length === 0) {
|
|
201
|
+
return { fields: [] };
|
|
202
|
+
}
|
|
203
|
+
let parsed;
|
|
204
|
+
try {
|
|
205
|
+
parsed = JSON.parse(raw);
|
|
206
|
+
}
|
|
207
|
+
catch {
|
|
208
|
+
throw new Error("schema/fields.json contains invalid JSON.");
|
|
209
|
+
}
|
|
210
|
+
return { fields: extractFieldDefinitions(parsed) };
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Serializes the fields file with a trailing newline (matches the rest of the
|
|
214
|
+
* schema scaffold files written by pm).
|
|
215
|
+
*/
|
|
216
|
+
export function serializeFieldsFile(file) {
|
|
217
|
+
return `${JSON.stringify({ fields: file.fields }, null, 2)}\n`;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Idempotent UPSERT of a custom field into the parsed file. Matching is by
|
|
221
|
+
* normalized key. When a definition already exists, the supplied input fully
|
|
222
|
+
* replaces its add-field-managed attributes (type/commands/description/flags/
|
|
223
|
+
* required flags) while preserving any unrelated keys the file may carry; any
|
|
224
|
+
* `metadata_key` already stored is preserved so existing item data keeps mapping
|
|
225
|
+
* to the same front-matter column.
|
|
226
|
+
*/
|
|
227
|
+
export function upsertField(file, input) {
|
|
228
|
+
// Match by normalized key. A hand-authored file may carry more than one entry
|
|
229
|
+
// for the same key, so drop ALL matches and re-insert a single merged result
|
|
230
|
+
// (collapsing duplicates) rather than only rewriting the first occurrence. The
|
|
231
|
+
// first existing match seeds preserved attributes (e.g. metadata_key).
|
|
232
|
+
const existing = file.fields.find((definition) => normalizeFieldKey(definition.key) === input.key);
|
|
233
|
+
const replaced = existing !== undefined;
|
|
234
|
+
const fields = file.fields.filter((definition) => normalizeFieldKey(definition.key) !== input.key);
|
|
235
|
+
const next = {
|
|
236
|
+
...(existing ?? {}),
|
|
237
|
+
key: input.key,
|
|
238
|
+
type: input.type,
|
|
239
|
+
commands: [...input.commands],
|
|
240
|
+
};
|
|
241
|
+
applyOptionalString(next, "description", input.description);
|
|
242
|
+
applyOptionalString(next, "cli_flag", input.cliFlag);
|
|
243
|
+
if (input.cliAliases.length > 0) {
|
|
244
|
+
next.cli_aliases = [...input.cliAliases];
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
delete next.cli_aliases;
|
|
248
|
+
}
|
|
249
|
+
applyBooleanFlag(next, "required", input.required);
|
|
250
|
+
applyBooleanFlag(next, "required_on_create", input.requiredOnCreate);
|
|
251
|
+
// allow_unset defaults true; only persist the explicit false override.
|
|
252
|
+
if (input.allowUnset === false) {
|
|
253
|
+
next.allow_unset = false;
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
delete next.allow_unset;
|
|
257
|
+
}
|
|
258
|
+
if (input.requiredTypes.length > 0) {
|
|
259
|
+
next.required_types = [...input.requiredTypes];
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
delete next.required_types;
|
|
263
|
+
}
|
|
264
|
+
fields.push(next);
|
|
265
|
+
fields.sort((left, right) => normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)));
|
|
266
|
+
return {
|
|
267
|
+
file: { fields },
|
|
268
|
+
definition: next,
|
|
269
|
+
replaced,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Removes a custom field definition from the parsed file by key (normalized).
|
|
274
|
+
* Throws a plain Error when `key` is empty. Returns `removed: false` when no
|
|
275
|
+
* matching definition exists so the CLI layer can treat the call as an
|
|
276
|
+
* idempotent no-op.
|
|
277
|
+
*/
|
|
278
|
+
export function removeField(file, key) {
|
|
279
|
+
const normalizedKey = normalizeFieldKey(key);
|
|
280
|
+
if (normalizedKey.length === 0) {
|
|
281
|
+
throw new Error("Field key must not be empty.");
|
|
282
|
+
}
|
|
283
|
+
// Remove ALL matches (a hand-authored file may carry duplicate entries for the
|
|
284
|
+
// same normalized key) so no stale duplicate survives the removal.
|
|
285
|
+
const removed = [];
|
|
286
|
+
const fields = file.fields.filter((definition) => {
|
|
287
|
+
if (normalizeFieldKey(definition.key) === normalizedKey) {
|
|
288
|
+
removed.push(definition);
|
|
289
|
+
return false;
|
|
290
|
+
}
|
|
291
|
+
return true;
|
|
292
|
+
});
|
|
293
|
+
if (removed.length === 0) {
|
|
294
|
+
return { file: { fields }, removed: false };
|
|
295
|
+
}
|
|
296
|
+
return { file: { fields }, removed: true, definition: removed[0] };
|
|
297
|
+
}
|
|
298
|
+
function applyOptionalString(definition, key, value) {
|
|
299
|
+
const record = definition;
|
|
300
|
+
if (value !== undefined && value.length > 0) {
|
|
301
|
+
record[key] = value;
|
|
302
|
+
}
|
|
303
|
+
else {
|
|
304
|
+
delete record[key];
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
function applyBooleanFlag(definition, key, value) {
|
|
308
|
+
const record = definition;
|
|
309
|
+
if (value) {
|
|
310
|
+
record[key] = true;
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
delete record[key];
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
//# sourceMappingURL=fields-file.js.map
|
|
317
|
+
//# debugId=01bca6b9-49d3-5785-9d18-8399a0aac293
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-file.js","sources":["core/schema/fields-file.ts"],"sourceRoot":"/","sourcesContent":["import {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } 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/**\n * Built-in front-matter field names a custom field key must never shadow. A\n * custom key that collides with one of these would let `pm create --<key>` write\n * over reserved metadata, so add-field rejects them up front (symmetric with the\n * built-in-type guard in item-types-file.ts).\n */\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/**\n * The default commands a field is wired onto when `--commands` is omitted,\n * matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition).\n */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/**\n * The shape persisted at `.agents/pm/schema/fields.json`.\n */\nexport interface FieldsFile {\n fields: RuntimeFieldDefinition[];\n}\n\nexport interface RawAddFieldInput {\n key: string | undefined;\n type?: string;\n commands?: string[];\n description?: string;\n cliFlag?: string;\n aliases?: string[];\n required?: boolean;\n requiredOnCreate?: boolean;\n allowUnset?: boolean;\n requiredTypes?: string[];\n}\n\nexport interface NormalizedAddFieldInput {\n key: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n description?: string;\n cliFlag?: string;\n cliAliases: string[];\n required: boolean;\n requiredOnCreate: boolean;\n allowUnset: boolean;\n requiredTypes: string[];\n}\n\nexport interface UpsertFieldResult {\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\nexport interface RemoveFieldResult {\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/**\n * Normalizes a field key using the same rule as runtime-schema.ts: lowercase and\n * collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\n/**\n * Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse\n * whitespace/underscore runs to a single hyphen (matches normalizeCliToken in\n * runtime-schema.ts).\n */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value.trim().toLowerCase().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/**\n * Validates and normalizes raw add-field CLI input. Throws a plain Error with a\n * stable message when the key is missing/empty, collides with a built-in field,\n * or carries an invalid type/command; the CLI layer maps these to PmCliError\n * exit codes. A `string_array` type implies a repeatable field downstream\n * (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is\n * exposed.\n */\nexport function normalizeAddFieldInput(raw: RawAddFieldInput): 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 = typeof raw.type === \"string\" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(`Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`);\n }\n const type = typeCandidate as RuntimeFieldType;\n\n let commands: RuntimeFieldCommand[];\n if (raw.commands === undefined) {\n commands = [...DEFAULT_FIELD_COMMANDS];\n } else {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of raw.commands) {\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(`Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`);\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n commands = normalized.length > 0 ? normalized : [...DEFAULT_FIELD_COMMANDS];\n }\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag = cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key) ? cliFlagToken : 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: 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/**\n * Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts\n * the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }`\n * form, and tolerates a missing/invalid file by returning an empty fields list.\n */\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/**\n * Serializes the fields file with a trailing newline (matches the rest of the\n * schema scaffold files written by pm).\n */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a custom field into the parsed file. Matching is by\n * normalized key. When a definition already exists, the supplied input fully\n * replaces its add-field-managed attributes (type/commands/description/flags/\n * required flags) while preserving any unrelated keys the file may carry; any\n * `metadata_key` already stored is preserved so existing item data keeps mapping\n * to the same front-matter column.\n */\nexport function upsertField(file: FieldsFile, input: NormalizedAddFieldInput): 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((definition) => normalizeFieldKey(definition.key) === input.key);\n const replaced = existing !== undefined;\n const fields = file.fields.filter((definition) => normalizeFieldKey(definition.key) !== input.key);\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) => normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)));\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/**\n * Removes a custom field definition from the parsed file by key (normalized).\n * Throws a plain Error when `key` is empty. Returns `removed: false` when no\n * matching definition exists so the CLI layer can treat the call as an\n * idempotent no-op.\n */\nexport function removeField(file: FieldsFile, key: string | undefined): 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(definition: RuntimeFieldDefinition, key: string, value: string | undefined): 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(definition: RuntimeFieldDefinition, key: string, value: boolean): 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"],"names":[],"mappings":";;AAAA,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAK9B;;;;;;;;;;;GAWG;AAEH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAS,yBAAyB,CAAC,CAAC;AAC1E,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AE,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;IACtB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,UAAkC,EAAE,GAAW,EAAE,KAAc;IACvF,MAAM,MAAM,GAAG,UAAgD,CAAC;IAChE,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACH,CAAC","debugId":"01bca6b9-49d3-5785-9d18-8399a0aac293"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface InferredTypeCandidate {
|
|
2
|
+
/** Suggested PascalCase type name derived from the prefix. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The normalized prefix token (lowercase) the items share. */
|
|
5
|
+
prefix: string;
|
|
6
|
+
/** How many scanned titles carry this prefix. */
|
|
7
|
+
count: number;
|
|
8
|
+
/** A few example titles (capped) for human/agent review. */
|
|
9
|
+
examples: string[];
|
|
10
|
+
/** True when `name` already resolves to a reserved built-in type. */
|
|
11
|
+
shadows_builtin: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface InferTypesOptions {
|
|
14
|
+
/** Minimum number of titles that must share a prefix to surface it (default 10). */
|
|
15
|
+
minCount?: number;
|
|
16
|
+
/** Maximum example titles retained per candidate (default 3). */
|
|
17
|
+
maxExamples?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extracts the leading prefix token from a title, or undefined when the title has
|
|
21
|
+
* no stable letter-led `PREFIX-`/`PREFIX:` convention.
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractTitlePrefix(title: string): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Converts a normalized prefix token into a PascalCase type name. Internal
|
|
26
|
+
* hyphen/underscore runs become word boundaries; each word is capitalized.
|
|
27
|
+
*/
|
|
28
|
+
export declare function prefixToTypeName(prefix: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Scans titles for shared prefix conventions and returns candidate custom types,
|
|
31
|
+
* sorted by descending frequency then name. Only prefixes carried by at least
|
|
32
|
+
* `minCount` titles are returned.
|
|
33
|
+
*/
|
|
34
|
+
export declare function inferTypesFromTitles(titles: string[], options?: InferTypesOptions): InferredTypeCandidate[];
|
|
@@ -0,0 +1,97 @@
|
|
|
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]="7ded2b63-46ff-5a7e-a47f-5a4488da1cae")}catch(e){}}();
|
|
3
|
+
import { matchBuiltinTypeName } from "./item-types-file.js";
|
|
4
|
+
/**
|
|
5
|
+
* Pure logic for `pm schema add-type --infer`: scan existing item titles for
|
|
6
|
+
* stable `PREFIX-`/`PREFIX:` conventions and propose them as custom item types.
|
|
7
|
+
* The CLI command file (schema.ts) owns IO and the optional registration; this
|
|
8
|
+
* module only derives candidates from a list of titles so it is fully testable
|
|
9
|
+
* and coverage-gated to 100%.
|
|
10
|
+
*
|
|
11
|
+
* Conventions recognized (case-insensitive, first run wins per title):
|
|
12
|
+
* - `INFRA- ...` / `SECURITY-...` (hyphen-delimited prefix)
|
|
13
|
+
* - `BUG: ...` / `SPIKE: ...` (colon-delimited prefix)
|
|
14
|
+
* The prefix token must be a letter-led identifier of letters, digits, and
|
|
15
|
+
* internal hyphens/underscores so it maps cleanly to a single PascalCase type
|
|
16
|
+
* name. Purely numeric or sequence-style prefixes (e.g. `S001-`, `E12-`) are
|
|
17
|
+
* intentionally skipped: they index items, they are not type boundaries.
|
|
18
|
+
*/
|
|
19
|
+
const PREFIX_PATTERN = /^([A-Za-z][A-Za-z0-9_-]*?)\s*[-:]\s+\S/;
|
|
20
|
+
/**
|
|
21
|
+
* Extracts the leading prefix token from a title, or undefined when the title has
|
|
22
|
+
* no stable letter-led `PREFIX-`/`PREFIX:` convention.
|
|
23
|
+
*/
|
|
24
|
+
export function extractTitlePrefix(title) {
|
|
25
|
+
const match = PREFIX_PATTERN.exec(title.trim());
|
|
26
|
+
if (!match) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const token = match[1];
|
|
30
|
+
// Reject single-character prefixes (e.g. "S-", "E-"): they are sequence/index
|
|
31
|
+
// markers far more often than genuine type boundaries.
|
|
32
|
+
if (token.length < 2) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
// Reject sequence/index-style prefixes — a single leading letter followed by
|
|
36
|
+
// only digits (e.g. "S001-", "E12-", "V1-"). These index items rather than
|
|
37
|
+
// mark a type boundary, matching the convention documented above.
|
|
38
|
+
if (/^[A-Za-z]\d+$/.test(token)) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return token.toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Converts a normalized prefix token into a PascalCase type name. Internal
|
|
45
|
+
* hyphen/underscore runs become word boundaries; each word is capitalized.
|
|
46
|
+
*/
|
|
47
|
+
export function prefixToTypeName(prefix) {
|
|
48
|
+
return prefix
|
|
49
|
+
.split(/[-_]+/)
|
|
50
|
+
.filter((segment) => segment.length > 0)
|
|
51
|
+
.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1).toLowerCase()}`)
|
|
52
|
+
.join("");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Scans titles for shared prefix conventions and returns candidate custom types,
|
|
56
|
+
* sorted by descending frequency then name. Only prefixes carried by at least
|
|
57
|
+
* `minCount` titles are returned.
|
|
58
|
+
*/
|
|
59
|
+
export function inferTypesFromTitles(titles, options = {}) {
|
|
60
|
+
const minCount = typeof options.minCount === "number" && options.minCount > 0 ? Math.trunc(options.minCount) : 10;
|
|
61
|
+
const maxExamples = typeof options.maxExamples === "number" && options.maxExamples > 0 ? Math.trunc(options.maxExamples) : 3;
|
|
62
|
+
const byPrefix = new Map();
|
|
63
|
+
for (const rawTitle of titles) {
|
|
64
|
+
const title = typeof rawTitle === "string" ? rawTitle.trim() : "";
|
|
65
|
+
if (title.length === 0) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const prefix = extractTitlePrefix(title);
|
|
69
|
+
if (prefix === undefined) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const bucket = byPrefix.get(prefix) ?? { count: 0, examples: [] };
|
|
73
|
+
bucket.count += 1;
|
|
74
|
+
if (bucket.examples.length < maxExamples) {
|
|
75
|
+
bucket.examples.push(title);
|
|
76
|
+
}
|
|
77
|
+
byPrefix.set(prefix, bucket);
|
|
78
|
+
}
|
|
79
|
+
const candidates = [];
|
|
80
|
+
for (const [prefix, bucket] of byPrefix.entries()) {
|
|
81
|
+
if (bucket.count < minCount) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const name = prefixToTypeName(prefix);
|
|
85
|
+
candidates.push({
|
|
86
|
+
name,
|
|
87
|
+
prefix,
|
|
88
|
+
count: bucket.count,
|
|
89
|
+
examples: bucket.examples,
|
|
90
|
+
shadows_builtin: matchBuiltinTypeName(name) !== undefined,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
candidates.sort((left, right) => (right.count - left.count) || left.name.localeCompare(right.name));
|
|
94
|
+
return candidates;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=type-inference.js.map
|
|
97
|
+
//# debugId=7ded2b63-46ff-5a7e-a47f-5a4488da1cae
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-inference.js","sources":["core/schema/type-inference.ts"],"sourceRoot":"/","sourcesContent":["import { matchBuiltinTypeName } from \"./item-types-file.js\";\n\n/**\n * Pure logic for `pm schema add-type --infer`: scan existing item titles for\n * stable `PREFIX-`/`PREFIX:` conventions and propose them as custom item types.\n * The CLI command file (schema.ts) owns IO and the optional registration; this\n * module only derives candidates from a list of titles so it is fully testable\n * and coverage-gated to 100%.\n *\n * Conventions recognized (case-insensitive, first run wins per title):\n * - `INFRA- ...` / `SECURITY-...` (hyphen-delimited prefix)\n * - `BUG: ...` / `SPIKE: ...` (colon-delimited prefix)\n * The prefix token must be a letter-led identifier of letters, digits, and\n * internal hyphens/underscores so it maps cleanly to a single PascalCase type\n * name. Purely numeric or sequence-style prefixes (e.g. `S001-`, `E12-`) are\n * intentionally skipped: they index items, they are not type boundaries.\n */\n\nconst PREFIX_PATTERN = /^([A-Za-z][A-Za-z0-9_-]*?)\\s*[-:]\\s+\\S/;\n\nexport interface InferredTypeCandidate {\n /** Suggested PascalCase type name derived from the prefix. */\n name: string;\n /** The normalized prefix token (lowercase) the items share. */\n prefix: string;\n /** How many scanned titles carry this prefix. */\n count: number;\n /** A few example titles (capped) for human/agent review. */\n examples: string[];\n /** True when `name` already resolves to a reserved built-in type. */\n shadows_builtin: boolean;\n}\n\nexport interface InferTypesOptions {\n /** Minimum number of titles that must share a prefix to surface it (default 10). */\n minCount?: number;\n /** Maximum example titles retained per candidate (default 3). */\n maxExamples?: number;\n}\n\n/**\n * Extracts the leading prefix token from a title, or undefined when the title has\n * no stable letter-led `PREFIX-`/`PREFIX:` convention.\n */\nexport function extractTitlePrefix(title: string): string | undefined {\n const match = PREFIX_PATTERN.exec(title.trim());\n if (!match) {\n return undefined;\n }\n const token = match[1];\n // Reject single-character prefixes (e.g. \"S-\", \"E-\"): they are sequence/index\n // markers far more often than genuine type boundaries.\n if (token.length < 2) {\n return undefined;\n }\n // Reject sequence/index-style prefixes — a single leading letter followed by\n // only digits (e.g. \"S001-\", \"E12-\", \"V1-\"). These index items rather than\n // mark a type boundary, matching the convention documented above.\n if (/^[A-Za-z]\\d+$/.test(token)) {\n return undefined;\n }\n return token.toLowerCase();\n}\n\n/**\n * Converts a normalized prefix token into a PascalCase type name. Internal\n * hyphen/underscore runs become word boundaries; each word is capitalized.\n */\nexport function prefixToTypeName(prefix: string): string {\n return prefix\n .split(/[-_]+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1).toLowerCase()}`)\n .join(\"\");\n}\n\n/**\n * Scans titles for shared prefix conventions and returns candidate custom types,\n * sorted by descending frequency then name. Only prefixes carried by at least\n * `minCount` titles are returned.\n */\nexport function inferTypesFromTitles(titles: string[], options: InferTypesOptions = {}): InferredTypeCandidate[] {\n const minCount = typeof options.minCount === \"number\" && options.minCount > 0 ? Math.trunc(options.minCount) : 10;\n const maxExamples = typeof options.maxExamples === \"number\" && options.maxExamples > 0 ? Math.trunc(options.maxExamples) : 3;\n const byPrefix = new Map<string, { count: number; examples: string[] }>();\n for (const rawTitle of titles) {\n const title = typeof rawTitle === \"string\" ? rawTitle.trim() : \"\";\n if (title.length === 0) {\n continue;\n }\n const prefix = extractTitlePrefix(title);\n if (prefix === undefined) {\n continue;\n }\n const bucket = byPrefix.get(prefix) ?? { count: 0, examples: [] };\n bucket.count += 1;\n if (bucket.examples.length < maxExamples) {\n bucket.examples.push(title);\n }\n byPrefix.set(prefix, bucket);\n }\n const candidates: InferredTypeCandidate[] = [];\n for (const [prefix, bucket] of byPrefix.entries()) {\n if (bucket.count < minCount) {\n continue;\n }\n const name = prefixToTypeName(prefix);\n candidates.push({\n name,\n prefix,\n count: bucket.count,\n examples: bucket.examples,\n shadows_builtin: matchBuiltinTypeName(name) !== undefined,\n });\n }\n candidates.sort((left, right) => (right.count - left.count) || left.name.localeCompare(right.name));\n return candidates;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAsBhE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MA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AC,CAAC;QACtC,UAAU,CAAC,IAAI,CAAC;YACd,IAAI;YACJ,MAAM;YACN,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;YACzB,eAAe,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,SAAS;SAC1D,CAAC,CAAC;IACL,CAAC;IACD,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACpG,OAAO,UAAU,CAAC;AACpB,CAAC","debugId":"7ded2b63-46ff-5a7e-a47f-5a4488da1cae"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NormalizedAddTypeInput, type RawAddTypeInput } from "./item-types-file.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shared domain item-type presets. These power both `pm init --type-preset`
|
|
4
|
+
* (registered during initialization) and the standalone `pm schema apply-preset`
|
|
5
|
+
* subcommand (adopting a preset into an already-initialized project). Keeping the
|
|
6
|
+
* raw definitions and the preset-name normalizer in one place guarantees init and
|
|
7
|
+
* schema register byte-identical types.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TYPE_PRESET_NAMES: readonly ["agile", "ops", "research"];
|
|
10
|
+
export type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];
|
|
11
|
+
/**
|
|
12
|
+
* Raw (pre-normalization) preset definitions keyed by preset name. Each entry is
|
|
13
|
+
* fed through {@link normalizeAddTypeInput} before being upserted so the same
|
|
14
|
+
* validation/normalization the `pm schema add-type` CLI applies governs preset
|
|
15
|
+
* registration too.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TYPE_PRESET_DEFINITIONS: Record<TypePresetName, RawAddTypeInput[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Validates and normalizes a raw preset-name CLI value. Returns `undefined` when
|
|
20
|
+
* the value is omitted (no preset requested). Throws a plain Error with a stable
|
|
21
|
+
* message for an empty or unknown preset; CLI layers map it to a USAGE exit code.
|
|
22
|
+
* Accepts hyphen/underscore-insensitive casing for ergonomics.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeTypePresetName(rawValue: string | undefined): TypePresetName | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the normalized add-type inputs for a preset, in the order they should
|
|
27
|
+
* be upserted. Each raw definition is run through normalizeAddTypeInput so callers
|
|
28
|
+
* get the same validated shape as an individual `add-type` invocation.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveTypePresetDefinitions(preset: TypePresetName): NormalizedAddTypeInput[];
|
|
@@ -0,0 +1,96 @@
|
|
|
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]="435e9450-a234-54ff-b34e-a992acb16c4e")}catch(e){}}();
|
|
3
|
+
import { normalizeAddTypeInput } from "./item-types-file.js";
|
|
4
|
+
/**
|
|
5
|
+
* Shared domain item-type presets. These power both `pm init --type-preset`
|
|
6
|
+
* (registered during initialization) and the standalone `pm schema apply-preset`
|
|
7
|
+
* subcommand (adopting a preset into an already-initialized project). Keeping the
|
|
8
|
+
* raw definitions and the preset-name normalizer in one place guarantees init and
|
|
9
|
+
* schema register byte-identical types.
|
|
10
|
+
*/
|
|
11
|
+
export const TYPE_PRESET_NAMES = ["agile", "ops", "research"];
|
|
12
|
+
/**
|
|
13
|
+
* Raw (pre-normalization) preset definitions keyed by preset name. Each entry is
|
|
14
|
+
* fed through {@link normalizeAddTypeInput} before being upserted so the same
|
|
15
|
+
* validation/normalization the `pm schema add-type` CLI applies governs preset
|
|
16
|
+
* registration too.
|
|
17
|
+
*/
|
|
18
|
+
export const TYPE_PRESET_DEFINITIONS = {
|
|
19
|
+
agile: [
|
|
20
|
+
{
|
|
21
|
+
name: "Story",
|
|
22
|
+
description: "User-facing outcome or capability slice expressed from a stakeholder perspective.",
|
|
23
|
+
defaultStatus: "open",
|
|
24
|
+
folder: "stories",
|
|
25
|
+
aliases: ["user-story"],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "Spike",
|
|
29
|
+
description: "Time-boxed investigation used to reduce uncertainty before implementation.",
|
|
30
|
+
defaultStatus: "open",
|
|
31
|
+
folder: "spikes",
|
|
32
|
+
aliases: ["research-spike"],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
ops: [
|
|
36
|
+
{
|
|
37
|
+
name: "Incident",
|
|
38
|
+
description: "Operational disruption, degradation, or support escalation with recovery tracking.",
|
|
39
|
+
defaultStatus: "open",
|
|
40
|
+
folder: "incidents",
|
|
41
|
+
aliases: ["outage"],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Runbook",
|
|
45
|
+
description: "Repeatable operational procedure, diagnostic path, or response playbook.",
|
|
46
|
+
defaultStatus: "open",
|
|
47
|
+
folder: "runbooks",
|
|
48
|
+
aliases: ["playbook"],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
research: [
|
|
52
|
+
{
|
|
53
|
+
name: "Experiment",
|
|
54
|
+
description: "Validated-learning activity with hypothesis, method, and outcome tracking.",
|
|
55
|
+
defaultStatus: "open",
|
|
56
|
+
folder: "experiments",
|
|
57
|
+
aliases: ["study"],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "Hypothesis",
|
|
61
|
+
description: "Testable claim or assumption that should be supported, rejected, or refined.",
|
|
62
|
+
defaultStatus: "open",
|
|
63
|
+
folder: "hypotheses",
|
|
64
|
+
aliases: ["assumption"],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Validates and normalizes a raw preset-name CLI value. Returns `undefined` when
|
|
70
|
+
* the value is omitted (no preset requested). Throws a plain Error with a stable
|
|
71
|
+
* message for an empty or unknown preset; CLI layers map it to a USAGE exit code.
|
|
72
|
+
* Accepts hyphen/underscore-insensitive casing for ergonomics.
|
|
73
|
+
*/
|
|
74
|
+
export function normalizeTypePresetName(rawValue) {
|
|
75
|
+
if (rawValue === undefined) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const normalized = rawValue.trim().toLowerCase().replaceAll("-", "_");
|
|
79
|
+
if (normalized.length === 0) {
|
|
80
|
+
throw new Error("Type preset name must not be empty.");
|
|
81
|
+
}
|
|
82
|
+
if (normalized === "agile" || normalized === "ops" || normalized === "research") {
|
|
83
|
+
return normalized;
|
|
84
|
+
}
|
|
85
|
+
throw new Error(`Invalid type preset "${rawValue}". Allowed: ${TYPE_PRESET_NAMES.join(", ")}.`);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns the normalized add-type inputs for a preset, in the order they should
|
|
89
|
+
* be upserted. Each raw definition is run through normalizeAddTypeInput so callers
|
|
90
|
+
* get the same validated shape as an individual `add-type` invocation.
|
|
91
|
+
*/
|
|
92
|
+
export function resolveTypePresetDefinitions(preset) {
|
|
93
|
+
return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) => normalizeAddTypeInput(rawDefinition));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=type-presets.js.map
|
|
96
|
+
//# debugId=435e9450-a234-54ff-b34e-a992acb16c4e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-presets.js","sources":["core/schema/type-presets.ts"],"sourceRoot":"/","sourcesContent":["import { normalizeAddTypeInput, type NormalizedAddTypeInput, type RawAddTypeInput } from \"./item-types-file.js\";\n\n/**\n * Shared domain item-type presets. These power both `pm init --type-preset`\n * (registered during initialization) and the standalone `pm schema apply-preset`\n * subcommand (adopting a preset into an already-initialized project). Keeping the\n * raw definitions and the preset-name normalizer in one place guarantees init and\n * schema register byte-identical types.\n */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\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<TypePresetName, RawAddTypeInput[]> = {\n agile: [\n {\n name: \"Story\",\n description: \"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: \"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: \"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: \"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: \"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: \"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/**\n * Validates and normalizes a raw preset-name CLI value. Returns `undefined` when\n * the value is omitted (no preset requested). Throws a plain Error with a stable\n * message for an empty or unknown preset; CLI layers map it to a USAGE exit code.\n * Accepts hyphen/underscore-insensitive casing for ergonomics.\n */\nexport function normalizeTypePresetName(rawValue: string | undefined): 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 (normalized === \"agile\" || normalized === \"ops\" || normalized === \"research\") {\n return normalized;\n }\n throw new Error(`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\n * be upserted. Each raw definition is run through normalizeAddTypeInput so callers\n * get the same validated shape as an individual `add-type` invocation.\n */\nexport function resolveTypePresetDefinitions(preset: TypePresetName): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) => normalizeAddTypeInput(rawDefinition));\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,qBAAqB,EAAqD,MAAM,sBAAsB,CAAC;AAEhH;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAU,CAAC;AAGvE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA8C;IAChF,KAAK,EAAE;QACL;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,mFAAmF;YAChG,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,CAAC,YAAY,CAAC;SACxB;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,4EAA4E;YACzF,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC5B;KACF;IACD,GAAG,EAAE;QACH;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,oFAAoF;YACjG,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,CAAC,QAAQ,CAAC;SACpB;QACD;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,0EAA0E;YACvF,aAAa,EAAE,MAA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