@unbrained/pm-cli 2026.6.24 → 2026.7.1
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/AGENTS.md +2 -0
- package/CHANGELOG.md +113 -1
- package/CONTRIBUTING.md +30 -0
- package/README.md +16 -3
- package/dist/cli/bootstrap-args.js +89 -79
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +3 -3
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/aggregate.js +8 -7
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +63 -62
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close.d.ts +2 -4
- package/dist/cli/commands/close.js +5 -17
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +158 -9
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +1 -1
- package/dist/cli/commands/config.js +2 -2
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +31 -4
- package/dist/cli/commands/context.js +33 -10
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +48 -8
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -6
- package/dist/cli/commands/create.js +491 -587
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.js +59 -46
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/describe.d.ts +15 -0
- package/dist/cli/commands/extension/describe.js +48 -2
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/doctor.js +129 -75
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.js +37 -7
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/managed-state.js +101 -57
- package/dist/cli/commands/extension/managed-state.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.d.ts +38 -8
- package/dist/cli/commands/extension/scaffold.js +1956 -242
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +28 -3
- package/dist/cli/commands/extension.js +1181 -880
- package/dist/cli/commands/extension.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/item-filter-options.d.ts +63 -0
- package/dist/cli/commands/item-filter-options.js +10 -0
- package/dist/cli/commands/item-filter-options.js.map +1 -0
- package/dist/cli/commands/legacy-none-tokens.d.ts +14 -0
- package/dist/cli/commands/legacy-none-tokens.js +31 -2
- package/dist/cli/commands/legacy-none-tokens.js.map +1 -1
- package/dist/cli/commands/linked-artifacts.d.ts +7 -0
- package/dist/cli/commands/linked-artifacts.js +12 -2
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/list-filter-shared.js +55 -48
- package/dist/cli/commands/list-filter-shared.js.map +1 -1
- package/dist/cli/commands/list.d.ts +16 -39
- package/dist/cli/commands/list.js +127 -118
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.d.ts +98 -0
- package/dist/cli/commands/next.js +304 -0
- package/dist/cli/commands/next.js.map +1 -0
- package/dist/cli/commands/profile.d.ts +208 -0
- package/dist/cli/commands/profile.js +418 -0
- package/dist/cli/commands/profile.js.map +1 -0
- package/dist/cli/commands/repeatable-metadata-parsers.js +12 -13
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +7 -0
- package/dist/cli/commands/schema.js +9 -3
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +2 -39
- package/dist/cli/commands/search.js +196 -172
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/shared-unset-fields.d.ts +30 -0
- package/dist/cli/commands/shared-unset-fields.js +161 -0
- package/dist/cli/commands/shared-unset-fields.js.map +1 -0
- package/dist/cli/commands/stats.js +15 -3
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/test.js +115 -125
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -6
- package/dist/cli/commands/update.js +37 -232
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +20 -5
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/extension-command-options.js +48 -21
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.js +26 -2
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.js +3 -3
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +27 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +42 -3
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +86 -2
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +67 -6
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +9 -1
- package/dist/cli/registration-helpers.js +149 -123
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +16 -0
- package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js → activity-DBLQVIP6.js} +9 -11
- package/dist/cli-bundle/chunks/{aggregate-63NWNIBR.js → aggregate-JTEF4BP7.js} +17 -18
- package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-YHCYX2EV.js → aggregate-SDF7DUOD.js} +16 -17
- package/dist/cli-bundle/chunks/aggregate-SDF7DUOD.js.map +7 -0
- package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js → append-LOVPGVPT.js} +8 -10
- package/dist/cli-bundle/chunks/{append-VLQQDHMJ.js.map → append-LOVPGVPT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{append-PUKREFV5.js → append-QCFJSDFL.js} +10 -12
- package/dist/cli-bundle/chunks/{append-PUKREFV5.js.map → append-QCFJSDFL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js → chunk-22WKIL3H.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-ABYCA5VX.js.map → chunk-22WKIL3H.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js → chunk-2466X6E4.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-A66VYUOV.js.map → chunk-2466X6E4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js → chunk-27BXPBAY.js} +3 -3
- package/dist/cli-bundle/chunks/{schema-QO5I4FBL.js → chunk-2D4HATP2.js} +136 -66
- package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-J7I4C5ZB.js → chunk-3J6JRJ3I.js} +153 -125
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OHDQNKJB.js → chunk-3K2M5OYU.js} +106 -34
- package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XVYKWZNL.js → chunk-3S2KT7NG.js} +127 -127
- package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js → chunk-3VGN2UWE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-N5B6WZC5.js → chunk-3XZCOZ5J.js} +115 -123
- package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4A3BJ675.js +799 -0
- package/dist/cli-bundle/chunks/chunk-4A3BJ675.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js +87 -0
- package/dist/cli-bundle/chunks/chunk-4BU75MF4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js → chunk-4DSGXSBL.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-HZF5RLKX.js.map → chunk-4DSGXSBL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js → chunk-4DUVCVLZ.js} +4 -6
- package/dist/cli-bundle/chunks/{chunk-JV27C7OZ.js.map → chunk-4DUVCVLZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IAP5KYBQ.js → chunk-4XOIEKSD.js} +563 -506
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-5LB7UGKE.js → chunk-55SNVXRQ.js} +79 -82
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BFFO3AIB.js → chunk-5CGRF3L5.js} +128 -128
- package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JKL6HRMV.js → chunk-5QFDBI4F.js} +1260 -1046
- package/dist/cli-bundle/chunks/chunk-5QFDBI4F.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js → chunk-64HNBBFQ.js} +8 -12
- package/dist/cli-bundle/chunks/{chunk-LU36E6GU.js.map → chunk-64HNBBFQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js +2444 -0
- package/dist/cli-bundle/chunks/chunk-6AQZPVHQ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js +17 -0
- package/dist/cli-bundle/chunks/chunk-7M2HAZEB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VSAABFGQ.js → chunk-7R4QEMZZ.js} +1490 -734
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M6TUBOGW.js → chunk-A7FPBAQS.js} +19 -12
- package/dist/cli-bundle/chunks/chunk-A7FPBAQS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GQYJEEFX.js → chunk-AVEE5EHK.js} +53 -54
- package/dist/cli-bundle/chunks/chunk-AVEE5EHK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js → chunk-AXIDKKAT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js → chunk-BDTISOSD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-C4C3EJCJ.js → chunk-BHO33VBQ.js} +509 -363
- package/dist/cli-bundle/chunks/chunk-BHO33VBQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6W3Y65PL.js → chunk-BZCEN4JA.js} +198 -177
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RRP6D345.js → chunk-CF7RL6FR.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-RRP6D345.js.map → chunk-CF7RL6FR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-HC2S36NB.js → chunk-CWFNTKQJ.js} +154 -126
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-CZVISY5A.js +87 -0
- package/dist/cli-bundle/chunks/chunk-CZVISY5A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js → chunk-DDPTYJIM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js → chunk-EJUDVUYZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js → chunk-EVMTBV6V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RAWA3Y7O.js → chunk-FFMQB7WR.js} +199 -178
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js → chunk-G7I7DEZA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MEXZ5XUM.js → chunk-GJ326ZKX.js} +53 -54
- package/dist/cli-bundle/chunks/chunk-GJ326ZKX.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js +119 -0
- package/dist/cli-bundle/chunks/chunk-HPPFYYOV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OF7V47P3.js → chunk-HXTQJXWT.js} +2172 -2146
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js → chunk-HYTGA6GI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js → chunk-HZZEHPRG.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js +14 -0
- package/dist/cli-bundle/chunks/chunk-IBMFIKVS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js → chunk-IJYK2T43.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js → chunk-IPYBJWTE.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-4XDGYFHL.js.map → chunk-IPYBJWTE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js → chunk-IZBR4NRW.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-6EBNFQOR.js.map → chunk-IZBR4NRW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js → chunk-JLM7BHI7.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-VFJYVXHL.js.map → chunk-JLM7BHI7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-6EL7SW5C.js → chunk-JMP4E6D7.js} +114 -122
- package/dist/cli-bundle/chunks/chunk-JMP4E6D7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js → chunk-JPECA746.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KJZOSF7J.js → chunk-JSU5P7VS.js} +100 -35
- package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-55VEOYI3.js → chunk-JWXRETDF.js} +79 -82
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js → chunk-KNPEF7QG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js → chunk-L5OEFZQG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js → chunk-LB6TP6MC.js} +5 -7
- package/dist/cli-bundle/chunks/{chunk-DTABLLVE.js.map → chunk-LB6TP6MC.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js → chunk-MAUKX7JC.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-TSI32UEL.js.map → chunk-MAUKX7JC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SMXSDY7J.js → chunk-MDPEOIGN.js} +2221 -2172
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js → chunk-N74UMG5H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IXAZI443.js → chunk-NFDPYAIP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js → chunk-NKZAN7BD.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js +116 -0
- package/dist/cli-bundle/chunks/chunk-NOLPZMSV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-L7UXKP2I.js → chunk-NU2UEROZ.js} +1257 -1029
- package/dist/cli-bundle/chunks/chunk-NU2UEROZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HBAEFWX3.js → chunk-NUHHPVVS.js} +65 -335
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js → chunk-NWMZWYYB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js → chunk-OGXLACHC.js} +10 -14
- package/dist/cli-bundle/chunks/{chunk-MWMHZOZZ.js.map → chunk-OGXLACHC.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js +379 -0
- package/dist/cli-bundle/chunks/chunk-OKQ22KTH.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js → chunk-OTUHB4HS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ZLWRPBOW.js → chunk-QCWF6IYD.js} +510 -364
- package/dist/cli-bundle/chunks/chunk-QCWF6IYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-PRVTGX64.js → chunk-RGEMWD6Q.js} +11 -23
- package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js +809 -0
- package/dist/cli-bundle/chunks/chunk-RH5ZBYFD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js → chunk-RLDHZHQS.js} +12 -16
- package/dist/cli-bundle/chunks/{chunk-ALQKV6U7.js.map → chunk-RLDHZHQS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{schema-C6QA367T.js → chunk-RMMQ74TG.js} +144 -67
- package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EYPINTFR.js → chunk-RVUALSJF.js} +1516 -753
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js +2468 -0
- package/dist/cli-bundle/chunks/chunk-SDR5J34Q.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js → chunk-SLMUGTK3.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SUREE24M.js → chunk-TP5Q5ZD3.js} +12 -24
- package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js → chunk-UYUYDGIB.js} +7 -9
- package/dist/cli-bundle/chunks/{chunk-UACWNBL2.js.map → chunk-UYUYDGIB.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js → chunk-UZIWVBE6.js} +6 -8
- package/dist/cli-bundle/chunks/{chunk-V4UYNSEM.js.map → chunk-UZIWVBE6.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js → chunk-V3NOKJF2.js} +11 -13
- package/dist/cli-bundle/chunks/{chunk-EWRSXOIZ.js.map → chunk-V3NOKJF2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-XXKV4UWE.js → chunk-VARHOHYV.js} +571 -507
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AEACLRVH.js → chunk-VICZWYGZ.js} +18 -11
- package/dist/cli-bundle/chunks/chunk-VICZWYGZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js +84 -0
- package/dist/cli-bundle/chunks/chunk-VY3VQ22F.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js +382 -0
- package/dist/cli-bundle/chunks/chunk-VZDBVEZR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js → chunk-W4ULYO7Z.js} +11 -13
- package/dist/cli-bundle/chunks/{chunk-GDUMGZK3.js.map → chunk-W4ULYO7Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js → chunk-WYDHYJPO.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js → chunk-YITK2PJ6.js} +9 -11
- package/dist/cli-bundle/chunks/{chunk-ALKFCIIB.js.map → chunk-YITK2PJ6.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js +84 -0
- package/dist/cli-bundle/chunks/chunk-YJIEJRZB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LNEDHJNQ.js → chunk-ZETXE4SE.js} +66 -329
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js → chunk-ZRP4VG5U.js} +2 -2
- package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js → claim-EMQLYPRW.js} +10 -12
- package/dist/cli-bundle/chunks/{claim-FZZZCAY6.js.map → claim-EMQLYPRW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js → claim-T3GCKV7C.js} +8 -10
- package/dist/cli-bundle/chunks/{claim-XK5QBZE3.js.map → claim-T3GCKV7C.js.map} +1 -1
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +14 -0
- package/dist/cli-bundle/chunks/{close-QHMVWM7M.js → close-TQYAAFJP.js} +7 -8
- package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js → close-many-BG5QQIDQ.js} +16 -18
- package/dist/cli-bundle/chunks/{close-many-OIXJE2JZ.js.map → close-many-BG5QQIDQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js → close-many-LDRVEQY2.js} +18 -20
- package/dist/cli-bundle/chunks/{close-many-SUU5BS2C.js.map → close-many-LDRVEQY2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-5YM62D75.js → comments-QCKR2YY2.js} +11 -13
- package/dist/cli-bundle/chunks/{comments-5YM62D75.js.map → comments-QCKR2YY2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js → comments-YUXJRZPQ.js} +9 -11
- package/dist/cli-bundle/chunks/{comments-RH3IBIRH.js.map → comments-YUXJRZPQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{config-NCNNWF6R.js → config-DMSU64QO.js} +18 -387
- package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-SW3U7XP2.js → config-QH2DICD6.js} +18 -380
- package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +1 -0
- package/dist/cli-bundle/chunks/context-B6275WPX.js +46 -0
- package/dist/cli-bundle/chunks/context-OCZ3FJ4Z.js +42 -0
- package/dist/cli-bundle/chunks/{contracts-SY6PDFIK.js → contracts-HN7ABKLP.js} +72 -15
- package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-JXFGBOYT.js → contracts-W4FZVVD6.js} +72 -15
- package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js → copy-BTJOSKKT.js} +7 -11
- package/dist/cli-bundle/chunks/{copy-N3GE6FYS.js.map → copy-BTJOSKKT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js → copy-DEM4DATS.js} +9 -13
- package/dist/cli-bundle/chunks/{copy-IEDBJOOX.js.map → copy-DEM4DATS.js.map} +1 -1
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +28 -0
- package/dist/cli-bundle/chunks/{create-O4VONGPG.js → create-RLRJMRTM.js} +12 -14
- package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js → delete-BHK7VB2Z.js} +5 -7
- package/dist/cli-bundle/chunks/{delete-LPEIF7RU.js.map → delete-BHK7VB2Z.js.map} +1 -1
- package/dist/cli-bundle/chunks/{delete-724EQ6OS.js → delete-LSVHAB4Y.js} +7 -9
- package/dist/cli-bundle/chunks/{delete-724EQ6OS.js.map → delete-LSVHAB4Y.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js → deps-4UDFJRUA.js} +8 -11
- package/dist/cli-bundle/chunks/{deps-RSBU4SIU.js.map → deps-4UDFJRUA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js → deps-XHYXWEPT.js} +6 -9
- package/dist/cli-bundle/chunks/{deps-T3Y6Y7RT.js.map → deps-XHYXWEPT.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js → docs-26S44RXU.js} +8 -9
- package/dist/cli-bundle/chunks/{docs-IFS7HZPP.js.map → docs-26S44RXU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js → docs-GYZNVS26.js} +10 -11
- package/dist/cli-bundle/chunks/{docs-75ZLCO3G.js.map → docs-GYZNVS26.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js → eval-PGRVIJQU.js} +12 -14
- package/dist/cli-bundle/chunks/{eval-L2KD7W3M.js.map → eval-PGRVIJQU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js → eval-UYF3ZPVO.js} +10 -12
- package/dist/cli-bundle/chunks/{eval-QGR7JCQO.js.map → eval-UYF3ZPVO.js.map} +1 -1
- package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js → extension-CPSLJQVE.js} +12 -7
- package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js → extension-CXJ6RELI.js} +12 -7
- package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js → files-MBNICQFM.js} +9 -11
- package/dist/cli-bundle/chunks/{files-EPEJMJHQ.js.map → files-MBNICQFM.js.map} +1 -1
- package/dist/cli-bundle/chunks/{files-5BQWDRDT.js → files-NQHEXUZD.js} +11 -13
- package/dist/cli-bundle/chunks/{files-5BQWDRDT.js.map → files-NQHEXUZD.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-RWGKD76E.js → focus-DWYIG7GU.js} +10 -14
- package/dist/cli-bundle/chunks/{focus-RWGKD76E.js.map → focus-DWYIG7GU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js → focus-XZW5423D.js} +8 -12
- package/dist/cli-bundle/chunks/{focus-DQVJAPOE.js.map → focus-XZW5423D.js.map} +1 -1
- package/dist/cli-bundle/chunks/{gc-BEJMQT64.js → gc-7GQYOS2G.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js → gc-LPVMKJQJ.js} +3 -3
- package/dist/cli-bundle/chunks/{get-LQG6PEVG.js → get-A7MAOHCU.js} +10 -13
- package/dist/cli-bundle/chunks/{get-LQG6PEVG.js.map → get-A7MAOHCU.js.map} +1 -1
- package/dist/cli-bundle/chunks/{get-WVN75H42.js → get-DSDEKJ3L.js} +12 -15
- package/dist/cli-bundle/chunks/{get-WVN75H42.js.map → get-DSDEKJ3L.js.map} +1 -1
- package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js → health-3IPFLKXB.js} +17 -17
- package/dist/cli-bundle/chunks/{health-P67NZ6TT.js → health-GZXGBZ36.js} +17 -17
- package/dist/cli-bundle/chunks/{history-RUKPKNY7.js → history-NERDJNUB.js} +8 -10
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +18 -0
- package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js → history-compact-2WRZ2WK4.js} +11 -14
- package/dist/cli-bundle/chunks/{history-compact-NQ7VPRVT.js.map → history-compact-2WRZ2WK4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js → history-compact-HR7BB4LR.js} +13 -16
- package/dist/cli-bundle/chunks/{history-compact-ZAOWR7GD.js.map → history-compact-HR7BB4LR.js.map} +1 -1
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js → history-redact-O3NBCNWC.js} +9 -11
- package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js → history-repair-LCMOS45X.js} +11 -14
- package/dist/cli-bundle/chunks/{history-repair-EHL4ODQY.js.map → history-repair-LCMOS45X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js → history-repair-XA3LC4GA.js} +13 -16
- package/dist/cli-bundle/chunks/{history-repair-YSQH6SY6.js.map → history-repair-XA3LC4GA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{init-HBFGYS66.js → init-64XDLQJB.js} +12 -11
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js → learnings-JR6MA5TI.js} +9 -11
- package/dist/cli-bundle/chunks/{learnings-KFQO7GEZ.js.map → learnings-JR6MA5TI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js → learnings-LPKCSJX7.js} +11 -13
- package/dist/cli-bundle/chunks/{learnings-J555ZFPD.js.map → learnings-LPKCSJX7.js.map} +1 -1
- package/dist/cli-bundle/chunks/{list-C7R33MD5.js → list-DNBJVO3E.js} +10 -10
- package/dist/cli-bundle/chunks/{list-DSN6UNFB.js → list-G5Y65VF6.js} +10 -10
- package/dist/cli-bundle/chunks/next-BCERKDUR.js +277 -0
- package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +7 -0
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js +274 -0
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js → notes-2BMU3VVQ.js} +9 -11
- package/dist/cli-bundle/chunks/{notes-V4VNIQL4.js.map → notes-2BMU3VVQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js → notes-6KTGO2OJ.js} +11 -13
- package/dist/cli-bundle/chunks/{notes-VYJFN2A3.js.map → notes-6KTGO2OJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js → plan-4WXEQCTN.js} +15 -18
- package/dist/cli-bundle/chunks/{plan-RBHQ5PO7.js.map → plan-4WXEQCTN.js.map} +1 -1
- package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js → plan-RKZHQVXR.js} +17 -20
- package/dist/cli-bundle/chunks/{plan-DHRSVSHR.js.map → plan-RKZHQVXR.js.map} +1 -1
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js +1235 -0
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +7 -0
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js +1197 -0
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-OM3E2KMY.js → register-list-query-7LV46VAU.js} +45 -21
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-CCMHGZTF.js → register-list-query-SNG5PGA4.js} +44 -20
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-N3CDEGZU.js → register-mutation-ENNDUAZG.js} +106 -40
- package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UXTTWL6N.js → register-mutation-KK7PHYYU.js} +105 -39
- package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js → register-operations-C6OWLDSH.js} +32 -34
- package/dist/cli-bundle/chunks/{register-operations-UDIFMQKD.js.map → register-operations-C6OWLDSH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js → register-operations-HZ6XERQG.js} +30 -32
- package/dist/cli-bundle/chunks/{register-operations-R2FLOCRI.js.map → register-operations-HZ6XERQG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-G5LTSFYK.js → register-setup-P67EMBDJ.js} +68 -25
- package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-TWHKICM2.js → register-setup-ZKJ53RS7.js} +67 -24
- package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js → restore-4MHZFJ2E.js} +9 -11
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js → scheduling-shortcuts-LB6DOLRL.js} +14 -16
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-M4H2ZI64.js.map → scheduling-shortcuts-LB6DOLRL.js.map} +1 -1
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js → scheduling-shortcuts-UTOYKLXQ.js} +12 -14
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-255GI3BU.js.map → scheduling-shortcuts-UTOYKLXQ.js.map} +1 -1
- package/dist/cli-bundle/chunks/schema-73HR2OJW.js +75 -0
- package/dist/cli-bundle/chunks/schema-U6LJKSIR.js +71 -0
- package/dist/cli-bundle/chunks/{search-2EI6EAXH.js → search-AXPXKZER.js} +10 -12
- package/dist/cli-bundle/chunks/{search-QBFBLQRO.js → search-KILGT37L.js} +10 -12
- package/dist/cli-bundle/chunks/{stats-TKC6CAKB.js → stats-PSYVVTNZ.js} +21 -13
- package/dist/cli-bundle/chunks/stats-PSYVVTNZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-TCW2SZQG.js → stats-W5KNVJWQ.js} +20 -12
- package/dist/cli-bundle/chunks/stats-W5KNVJWQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js → telemetry-BZUF6H7G.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js → telemetry-GAHHQTOS.js} +4 -4
- package/dist/cli-bundle/chunks/test-ACD52Z3S.js +35 -0
- package/dist/cli-bundle/chunks/test-ACD52Z3S.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-NV2DRPUS.js → test-PWDIZ255.js} +15 -16
- package/dist/cli-bundle/chunks/test-PWDIZ255.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js → test-all-L2MDDUCA.js} +20 -22
- package/dist/cli-bundle/chunks/{test-all-DZ76VTPQ.js.map → test-all-L2MDDUCA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-all-REW67LXT.js → test-all-RBZ6DLU2.js} +18 -20
- package/dist/cli-bundle/chunks/{test-all-REW67LXT.js.map → test-all-RBZ6DLU2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{test-runs-PX73DMMI.js → test-runs-PLRAZEFW.js} +5 -6
- package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-runs-FQ5WNQLP.js → test-runs-UXIXPDKU.js} +6 -7
- package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +1 -0
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +24 -0
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js.map +7 -0
- package/dist/cli-bundle/chunks/update-KFX2SIAC.js +28 -0
- package/dist/cli-bundle/chunks/update-KFX2SIAC.js.map +1 -0
- package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js → update-many-RNSBX2TA.js} +35 -36
- package/dist/cli-bundle/chunks/{update-many-Q5ZEI64S.js.map → update-many-RNSBX2TA.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js → update-many-Z5GJS5LC.js} +33 -34
- package/dist/cli-bundle/chunks/{update-many-2ILP6E4Y.js.map → update-many-Z5GJS5LC.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js → upgrade-BRL6KCOJ.js} +13 -8
- package/dist/cli-bundle/chunks/{upgrade-FOZKQTQF.js.map → upgrade-BRL6KCOJ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js → upgrade-HAK6JG2O.js} +11 -6
- package/dist/cli-bundle/chunks/{upgrade-DHL74PQH.js.map → upgrade-HAK6JG2O.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-HYZNIB6W.js → validate-MTUVL5VC.js} +38 -28
- package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-54SYJ7QW.js → validate-X5W76YJL.js} +39 -29
- package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +1 -0
- package/dist/cli-bundle/main.js +95 -724
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/config/positional-value.d.ts +2 -0
- package/dist/core/config/positional-value.js +2 -2
- package/dist/core/config/positional-value.js.map +1 -1
- package/dist/core/extensions/activation-summary-markdown.d.ts +71 -0
- package/dist/core/extensions/activation-summary-markdown.js +151 -0
- package/dist/core/extensions/activation-summary-markdown.js.map +1 -0
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +3 -2
- package/dist/core/extensions/activation-summary.js.map +1 -1
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +4 -3
- package/dist/core/extensions/capability-usage.js.map +1 -1
- package/dist/core/extensions/extension-policy.d.ts +18 -3
- package/dist/core/extensions/extension-policy.js +116 -106
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-registries.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +21 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +439 -232
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/fs/fs-utils.js +27 -2
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/item/actionability.d.ts +57 -0
- package/dist/core/item/actionability.js +178 -0
- package/dist/core/item/actionability.js.map +1 -0
- package/dist/core/item/item-format.js +523 -410
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/type-registry.js +18 -45
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/profile/profile-describe.d.ts +64 -0
- package/dist/core/profile/profile-describe.js +83 -0
- package/dist/core/profile/profile-describe.js.map +1 -0
- package/dist/core/profile/profile-lint.d.ts +53 -0
- package/dist/core/profile/profile-lint.js +422 -0
- package/dist/core/profile/profile-lint.js.map +1 -0
- package/dist/core/profile/profile-plan.d.ts +145 -0
- package/dist/core/profile/profile-plan.js +0 -0
- package/dist/core/profile/profile-plan.js.map +1 -0
- package/dist/core/profile/profile-presets.d.ts +218 -0
- package/dist/core/profile/profile-presets.js +325 -0
- package/dist/core/profile/profile-presets.js.map +1 -0
- package/dist/core/schema/fields-file.js +25 -25
- package/dist/core/schema/fields-file.js.map +1 -1
- package/dist/core/schema/item-types-file.js +3 -3
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +4 -4
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +3 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/shared/serialization.js +83 -62
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/store/item-store.d.ts +1 -0
- package/dist/core/store/item-store.js +16 -8
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js +4 -32
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.js +14 -14
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +50 -54
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +11 -2
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.js +3 -2
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/validate/linked-artifact-reference.d.ts +24 -0
- package/dist/core/validate/linked-artifact-reference.js +41 -0
- package/dist/core/validate/linked-artifact-reference.js.map +1 -0
- package/dist/mcp/server.js +540 -420
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +33 -2
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.d.ts +1 -0
- package/dist/sdk/cli-contracts/commander-types.js +15 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +3 -3
- package/dist/sdk/cli-contracts/enum-contracts.js +6 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.d.ts +149 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +1514 -0
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -0
- package/dist/sdk/cli-contracts/string-lists.d.ts +14 -0
- package/dist/sdk/cli-contracts/string-lists.js +20 -0
- package/dist/sdk/cli-contracts/string-lists.js.map +1 -0
- package/dist/sdk/cli-contracts/tool-option-contracts.d.ts +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +51 -109
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +17 -0
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +54 -5
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.d.ts +74 -0
- package/dist/sdk/cli-contracts/tool-schema.js +871 -0
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +13 -193
- package/dist/sdk/cli-contracts.js +5 -2277
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/compose.d.ts +11 -5
- package/dist/sdk/compose.js +240 -124
- package/dist/sdk/compose.js.map +1 -1
- package/dist/sdk/define.d.ts +14 -0
- package/dist/sdk/define.js +17 -2
- package/dist/sdk/define.js.map +1 -1
- package/dist/sdk/index.d.ts +14 -3
- package/dist/sdk/index.js +14 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/testing.d.ts +82 -2
- package/dist/sdk/testing.js +74 -3
- package/dist/sdk/testing.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -0
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +37 -0
- package/docs/EXTENSIONS.md +12 -13
- package/docs/RELEASING.md +8 -4
- package/docs/SDK.md +184 -17
- package/docs/TESTING.md +12 -0
- package/docs/examples/policy-restricted-extension/README.md +6 -0
- package/docs/examples/policy-restricted-extension/index.ts +40 -0
- package/docs/examples/policy-restricted-extension/manifest.json +2 -2
- package/docs/examples/starter-extension/README.md +14 -2
- package/docs/examples/starter-extension/{index.js → index.ts} +51 -6
- package/docs/examples/starter-extension/manifest.json +2 -2
- package/package.json +20 -7
- package/packages/pm-beads/extensions/beads/index.ts +3 -3
- package/packages/pm-beads/extensions/beads/manifest.json +2 -2
- package/packages/pm-beads/extensions/beads/runtime-loader.ts +19 -7
- package/packages/pm-beads/extensions/beads/runtime.ts +155 -37
- package/packages/pm-calendar/extensions/calendar/index.ts +3 -3
- package/packages/pm-calendar/extensions/calendar/manifest.json +2 -2
- package/packages/pm-calendar/extensions/calendar/runtime.ts +2 -2
- package/packages/pm-command-kit/extensions/command-kit/index.ts +1 -1
- package/packages/pm-command-kit/extensions/command-kit/manifest.json +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +2 -2
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +2 -2
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +2 -2
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +1 -1
- package/packages/pm-kanban/README.md +97 -0
- package/packages/pm-kanban/extensions/kanban/index.ts +191 -0
- package/packages/pm-kanban/extensions/kanban/manifest.json +19 -0
- package/packages/pm-kanban/package.json +57 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.ts +1 -1
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +2 -2
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +2 -2
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +2 -2
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +1 -1
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -2
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +2 -2
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +1 -1
- package/packages/pm-templates/extensions/templates/index.ts +2 -2
- package/packages/pm-templates/extensions/templates/manifest.json +2 -2
- package/packages/pm-templates/extensions/templates/runtime.ts +1 -1
- package/packages/pm-todos/extensions/todos/index.ts +3 -3
- package/packages/pm-todos/extensions/todos/manifest.json +2 -2
- package/packages/pm-todos/extensions/todos/runtime-loader.ts +19 -7
- package/packages/pm-todos/extensions/todos/runtime.ts +177 -43
- package/plugins/pm-claude/scripts/pm-mcp-server.mjs +2 -2
- package/plugins/pm-codex/scripts/pm-mcp-server.mjs +2 -2
- package/scripts/bundle-cli.mjs +1 -1
- package/dist/cli-bundle/chunks/activity-54TXGJ2T.js +0 -18
- package/dist/cli-bundle/chunks/aggregate-63NWNIBR.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-YHCYX2EV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6EL7SW5C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6W3Y65PL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AEACLRVH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B74BP6IS.js +0 -78
- package/dist/cli-bundle/chunks/chunk-B74BP6IS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BFFO3AIB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C4C3EJCJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EYPINTFR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js +0 -75
- package/dist/cli-bundle/chunks/chunk-FBLT6WGK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GQYJEEFX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HBAEFWX3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HC2S36NB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IAP5KYBQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-INPHFO33.js +0 -764
- package/dist/cli-bundle/chunks/chunk-INPHFO33.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js +0 -86
- package/dist/cli-bundle/chunks/chunk-IOT6WRL5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ISEKN64V.js +0 -35
- package/dist/cli-bundle/chunks/chunk-ISEKN64V.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js +0 -115
- package/dist/cli-bundle/chunks/chunk-J3NMWFIN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-J7I4C5ZB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JKL6HRMV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KJZOSF7J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L7UXKP2I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LNEDHJNQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-M6TUBOGW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MEXZ5XUM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-N5B6WZC5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js +0 -761
- package/dist/cli-bundle/chunks/chunk-NJ73ALW2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js +0 -83
- package/dist/cli-bundle/chunks/chunk-NVXGVEFD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OF7V47P3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OHDQNKJB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js +0 -118
- package/dist/cli-bundle/chunks/chunk-PEL2NLQE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PRVTGX64.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RAWA3Y7O.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SMXSDY7J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SUREE24M.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js +0 -654
- package/dist/cli-bundle/chunks/chunk-TKPP4GOO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VSAABFGQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js +0 -32
- package/dist/cli-bundle/chunks/chunk-W2VMLL5S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XVYKWZNL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XXKV4UWE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZLWRPBOW.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js +0 -657
- package/dist/cli-bundle/chunks/chunk-ZV7IQ23N.js.map +0 -7
- package/dist/cli-bundle/chunks/close-JEBZXONN.js +0 -15
- package/dist/cli-bundle/chunks/config-NCNNWF6R.js.map +0 -7
- package/dist/cli-bundle/chunks/config-SW3U7XP2.js.map +0 -1
- package/dist/cli-bundle/chunks/context-55VEOYI3.js.map +0 -1
- package/dist/cli-bundle/chunks/context-5LB7UGKE.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-JXFGBOYT.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-SY6PDFIK.js.map +0 -7
- package/dist/cli-bundle/chunks/create-CLSCHGJJ.js +0 -30
- package/dist/cli-bundle/chunks/history-ALTM2RRP.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-5YGLWUDH.js +0 -21
- package/dist/cli-bundle/chunks/init-C4CRHW22.js +0 -21
- package/dist/cli-bundle/chunks/register-list-query-CCMHGZTF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-OM3E2KMY.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-N3CDEGZU.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-UXTTWL6N.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-G5LTSFYK.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-TWHKICM2.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-LQHXBAY5.js +0 -19
- package/dist/cli-bundle/chunks/schema-C6QA367T.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-QO5I4FBL.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-TCW2SZQG.js.map +0 -7
- package/dist/cli-bundle/chunks/stats-TKC6CAKB.js.map +0 -1
- package/dist/cli-bundle/chunks/test-WA6RZGM2.js +0 -36
- package/dist/cli-bundle/chunks/test-runs-FQ5WNQLP.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-PX73DMMI.js.map +0 -7
- package/dist/cli-bundle/chunks/update-BSKMQOYH.js +0 -28
- package/dist/cli-bundle/chunks/update-FIGYNQ2I.js +0 -24
- package/dist/cli-bundle/chunks/validate-54SYJ7QW.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-HYZNIB6W.js.map +0 -7
- package/docs/examples/policy-restricted-extension/index.js +0 -21
- package/packages/pm-beads/extensions/beads/index.js +0 -64
- package/packages/pm-beads/extensions/beads/runtime-loader.js +0 -86
- package/packages/pm-beads/extensions/beads/runtime.js +0 -482
- package/packages/pm-calendar/extensions/calendar/index.js +0 -150
- package/packages/pm-calendar/extensions/calendar/runtime.js +0 -126
- package/packages/pm-command-kit/extensions/command-kit/index.js +0 -181
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +0 -177
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +0 -153
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +0 -98
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +0 -294
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/index.js +0 -18
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +0 -124
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +0 -110
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +0 -258
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +0 -361
- package/packages/pm-templates/extensions/templates/index.js +0 -132
- package/packages/pm-templates/extensions/templates/runtime.js +0 -35
- package/packages/pm-todos/extensions/todos/index.js +0 -81
- package/packages/pm-todos/extensions/todos/runtime-loader.js +0 -86
- package/packages/pm-todos/extensions/todos/runtime.js +0 -545
- /package/dist/cli-bundle/chunks/{activity-54TXGJ2T.js.map → activity-AW6XVFH6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-N7RVTLBQ.js.map → activity-DBLQVIP6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F32L4HR6.js.map → chunk-27BXPBAY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5BBEWX6C.js.map → chunk-3VGN2UWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FMWW2JDU.js.map → chunk-AXIDKKAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TIM4OD74.js.map → chunk-BDTISOSD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CZIFFMZI.js.map → chunk-DDPTYJIM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AYPQUFCX.js.map → chunk-EJUDVUYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EOGBMLCE.js.map → chunk-EVMTBV6V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CG3KP6I5.js.map → chunk-G7I7DEZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F4BNR2IN.js.map → chunk-HYTGA6GI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2WCYE3IF.js.map → chunk-HZZEHPRG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YV2OSAMS.js.map → chunk-IJYK2T43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QOUOMPHO.js.map → chunk-JPECA746.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OQ2E64FH.js.map → chunk-KNPEF7QG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3BKH2CL3.js.map → chunk-L5OEFZQG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5S4ZGDB2.js.map → chunk-N74UMG5H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IXAZI443.js.map → chunk-NFDPYAIP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SKC4UTRP.js.map → chunk-NKZAN7BD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JPJDP4VU.js.map → chunk-NWMZWYYB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KKX4Z2SE.js.map → chunk-OTUHB4HS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WB5BYQMF.js.map → chunk-SLMUGTK3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I6QMJ2XT.js.map → chunk-WYDHYJPO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KIEAK7YE.js.map → chunk-ZRP4VG5U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-JEBZXONN.js.map → close-E6ZZGCJY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-QHMVWM7M.js.map → close-TQYAAFJP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-O4VONGPG.js.map → context-B6275WPX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-CLSCHGJJ.js.map → context-OCZ3FJ4Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-YQF4CPIR.js.map → create-OH3BDGBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-3JYWJ5K2.js.map → create-RLRJMRTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-ALTM2RRP.js.map → extension-CPSLJQVE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-RUKPKNY7.js.map → extension-CXJ6RELI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-BEJMQT64.js.map → gc-7GQYOS2G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-JEFQDJPA.js.map → gc-LPVMKJQJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-JJJOY7DJ.js.map → health-3IPFLKXB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{health-P67NZ6TT.js.map → health-GZXGBZ36.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-YY4XYVEP.js.map → history-NERDJNUB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-5YGLWUDH.js.map → history-WSZHY3PN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-C4CRHW22.js.map → history-redact-MP6CH7U5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-HBFGYS66.js.map → history-redact-O3NBCNWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-C7R33MD5.js.map → init-64XDLQJB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DSN6UNFB.js.map → init-PAX32BJA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-LL2WLEDG.js.map → list-DNBJVO3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-LQHXBAY5.js.map → list-G5Y65VF6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-2EI6EAXH.js.map → restore-4MHZFJ2E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-QBFBLQRO.js.map → restore-YALDGTQR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-NV2DRPUS.js.map → schema-73HR2OJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-WA6RZGM2.js.map → schema-U6LJKSIR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-BSKMQOYH.js.map → search-AXPXKZER.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-FIGYNQ2I.js.map → search-KILGT37L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-BT2VSWU2.js.map → telemetry-BZUF6H7G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-LQ6FRTUT.js.map → telemetry-GAHHQTOS.js.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Implements the pm create command surface and its agent-facing runtime behavior.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="39253884-2bdf-54e5-9cf2-6ac279638287")}catch(e){}}();
|
|
8
8
|
import { pathExists, removeFileIfExists, writeFileAtomic } from "../../core/fs/fs-utils.js";
|
|
9
9
|
import { appendHistoryEntry, createHistoryEntry } from "../../core/history/history.js";
|
|
10
10
|
import { generateItemId, normalizeItemId } from "../../core/item/id.js";
|
|
@@ -32,10 +32,11 @@ import { locateItem } from "../../core/store/item-store.js";
|
|
|
32
32
|
import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
33
33
|
import { readSettings } from "../../core/store/settings.js";
|
|
34
34
|
import { normalizeRiskInput, normalizeSeverityInput, parseConfidenceInput, parseRegressionInput, } from "./metadata-normalizers.js";
|
|
35
|
-
import { assertNoLegacyNoneToken, assertNoLegacyNoneTokens, isLegacyNoneToken } from "./legacy-none-tokens.js";
|
|
35
|
+
import { applyLegacyNoneCollectionNormalizers, assertNoLegacyNoneToken, assertNoLegacyNoneTokens, isLegacyNoneToken, } from "./legacy-none-tokens.js";
|
|
36
36
|
import { suggestNextLifecycleTransition, } from "./lifecycle-transitions.js";
|
|
37
37
|
import { parseLinkedTestAssertionEqualsMap, parseLinkedTestAssertionGteMap, parseLinkedTestBoolean, parseLinkedTestContextMode, parseLinkedTestEnvClear, parseLinkedTestEnvSet, parseLinkedTestMinLines, parseLinkedTestRegexList, parseLinkedTestStringList, } from "./linked-test-parsers.js";
|
|
38
38
|
import { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry } from "./linked-test-entry.js";
|
|
39
|
+
import { COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR, COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR, resolveRuntimeUnsetFieldDefinition, } from "./shared-unset-fields.js";
|
|
39
40
|
import { ensureEnumValue } from "./recurrence-parsers.js";
|
|
40
41
|
import { parseEventEntries, parseReminderEntries, parseTypeOptionEntries, } from "./repeatable-metadata-parsers.js";
|
|
41
42
|
import { DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, SCOPE_VALUES, } from "../../types/index.js";
|
|
@@ -44,111 +45,9 @@ const SCHEDULE_CREATE_PRESET_VALUES = ["lightweight"];
|
|
|
44
45
|
const SCHEDULE_CREATE_PRESET_TYPES = new Set(["Reminder", "Meeting", "Event"]);
|
|
45
46
|
const LOG_SEED_ALLOWED_KEYS = new Set(["author", "created_at", "text"]);
|
|
46
47
|
const CREATE_UNSET_FIELD_DEFINITIONS = [
|
|
47
|
-
|
|
48
|
-
{ canonical: "deadline", aliases: ["deadline"], optionKey: "deadline", frontMatterKey: "deadline" },
|
|
49
|
-
{
|
|
50
|
-
canonical: "estimate",
|
|
51
|
-
aliases: ["estimate", "estimated_minutes", "estimated-minutes"],
|
|
52
|
-
optionKey: "estimatedMinutes",
|
|
53
|
-
frontMatterKey: "estimated_minutes",
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
canonical: "acceptance-criteria",
|
|
57
|
-
aliases: ["acceptance_criteria", "acceptance-criteria", "ac"],
|
|
58
|
-
optionKey: "acceptanceCriteria",
|
|
59
|
-
frontMatterKey: "acceptance_criteria",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
canonical: "definition-of-ready",
|
|
63
|
-
aliases: ["definition_of_ready", "definition-of-ready"],
|
|
64
|
-
optionKey: "definitionOfReady",
|
|
65
|
-
frontMatterKey: "definition_of_ready",
|
|
66
|
-
},
|
|
67
|
-
{ canonical: "order", aliases: ["order", "rank"], optionKey: "order", frontMatterKey: "order" },
|
|
68
|
-
{ canonical: "goal", aliases: ["goal"], optionKey: "goal", frontMatterKey: "goal" },
|
|
69
|
-
{ canonical: "objective", aliases: ["objective"], optionKey: "objective", frontMatterKey: "objective" },
|
|
70
|
-
{ canonical: "value", aliases: ["value"], optionKey: "value", frontMatterKey: "value" },
|
|
71
|
-
{ canonical: "impact", aliases: ["impact"], optionKey: "impact", frontMatterKey: "impact" },
|
|
72
|
-
{ canonical: "outcome", aliases: ["outcome"], optionKey: "outcome", frontMatterKey: "outcome" },
|
|
73
|
-
{ canonical: "why-now", aliases: ["why_now", "why-now"], optionKey: "whyNow", frontMatterKey: "why_now" },
|
|
48
|
+
...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,
|
|
74
49
|
{ canonical: "author", aliases: ["author"], optionKey: "author", frontMatterKey: "author" },
|
|
75
|
-
|
|
76
|
-
{ canonical: "parent", aliases: ["parent"], optionKey: "parent", frontMatterKey: "parent" },
|
|
77
|
-
{ canonical: "reviewer", aliases: ["reviewer"], optionKey: "reviewer", frontMatterKey: "reviewer" },
|
|
78
|
-
{ canonical: "risk", aliases: ["risk"], optionKey: "risk", frontMatterKey: "risk" },
|
|
79
|
-
{ canonical: "confidence", aliases: ["confidence"], optionKey: "confidence", frontMatterKey: "confidence" },
|
|
80
|
-
{ canonical: "sprint", aliases: ["sprint"], optionKey: "sprint", frontMatterKey: "sprint" },
|
|
81
|
-
{ canonical: "release", aliases: ["release"], optionKey: "release", frontMatterKey: "release" },
|
|
82
|
-
{
|
|
83
|
-
canonical: "blocked-by",
|
|
84
|
-
aliases: ["blocked_by", "blocked-by"],
|
|
85
|
-
optionKey: "blockedBy",
|
|
86
|
-
frontMatterKey: "blocked_by",
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
canonical: "blocked-reason",
|
|
90
|
-
aliases: ["blocked_reason", "blocked-reason"],
|
|
91
|
-
optionKey: "blockedReason",
|
|
92
|
-
frontMatterKey: "blocked_reason",
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
canonical: "unblock-note",
|
|
96
|
-
aliases: ["unblock_note", "unblock-note"],
|
|
97
|
-
optionKey: "unblockNote",
|
|
98
|
-
frontMatterKey: "unblock_note",
|
|
99
|
-
},
|
|
100
|
-
{ canonical: "reporter", aliases: ["reporter"], optionKey: "reporter", frontMatterKey: "reporter" },
|
|
101
|
-
{ canonical: "severity", aliases: ["severity"], optionKey: "severity", frontMatterKey: "severity" },
|
|
102
|
-
{
|
|
103
|
-
canonical: "environment",
|
|
104
|
-
aliases: ["environment"],
|
|
105
|
-
optionKey: "environment",
|
|
106
|
-
frontMatterKey: "environment",
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
canonical: "repro-steps",
|
|
110
|
-
aliases: ["repro_steps", "repro-steps"],
|
|
111
|
-
optionKey: "reproSteps",
|
|
112
|
-
frontMatterKey: "repro_steps",
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
canonical: "resolution",
|
|
116
|
-
aliases: ["resolution"],
|
|
117
|
-
optionKey: "resolution",
|
|
118
|
-
frontMatterKey: "resolution",
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
canonical: "expected-result",
|
|
122
|
-
aliases: ["expected_result", "expected-result"],
|
|
123
|
-
optionKey: "expectedResult",
|
|
124
|
-
frontMatterKey: "expected_result",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
canonical: "actual-result",
|
|
128
|
-
aliases: ["actual_result", "actual-result"],
|
|
129
|
-
optionKey: "actualResult",
|
|
130
|
-
frontMatterKey: "actual_result",
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
canonical: "affected-version",
|
|
134
|
-
aliases: ["affected_version", "affected-version"],
|
|
135
|
-
optionKey: "affectedVersion",
|
|
136
|
-
frontMatterKey: "affected_version",
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
canonical: "fixed-version",
|
|
140
|
-
aliases: ["fixed_version", "fixed-version"],
|
|
141
|
-
optionKey: "fixedVersion",
|
|
142
|
-
frontMatterKey: "fixed_version",
|
|
143
|
-
},
|
|
144
|
-
{ canonical: "component", aliases: ["component"], optionKey: "component", frontMatterKey: "component" },
|
|
145
|
-
{ canonical: "regression", aliases: ["regression"], optionKey: "regression", frontMatterKey: "regression" },
|
|
146
|
-
{
|
|
147
|
-
canonical: "customer-impact",
|
|
148
|
-
aliases: ["customer_impact", "customer-impact"],
|
|
149
|
-
optionKey: "customerImpact",
|
|
150
|
-
frontMatterKey: "customer_impact",
|
|
151
|
-
},
|
|
50
|
+
...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,
|
|
152
51
|
];
|
|
153
52
|
const CREATE_UNSET_ALIAS_MAP = (() => {
|
|
154
53
|
const map = new Map();
|
|
@@ -250,55 +149,13 @@ function normalizeLegacyNoneCreateOptions(options) {
|
|
|
250
149
|
normalized[optionKey] = undefined;
|
|
251
150
|
/* c8 ignore stop */
|
|
252
151
|
}
|
|
253
|
-
|
|
254
|
-
const entries = normalized[definition.optionKey];
|
|
255
|
-
if (!Array.isArray(entries) || entries.length === 0) {
|
|
256
|
-
continue;
|
|
257
|
-
}
|
|
258
|
-
const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));
|
|
259
|
-
if (!hasLegacy) {
|
|
260
|
-
continue;
|
|
261
|
-
}
|
|
262
|
-
const concreteEntries = entries.filter((entry) => !isLegacyNoneToken(entry));
|
|
263
|
-
if (concreteEntries.length > 0) {
|
|
264
|
-
throw new PmCliError(`Cannot mix legacy clear token "none"/"null" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`, EXIT_CODE.USAGE);
|
|
265
|
-
}
|
|
266
|
-
normalized[definition.optionKey] = undefined;
|
|
267
|
-
normalized[definition.clearFlagKey] = true;
|
|
268
|
-
}
|
|
269
|
-
return normalized;
|
|
152
|
+
return applyLegacyNoneCollectionNormalizers(normalized, CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS);
|
|
270
153
|
}
|
|
271
154
|
function parseOptionalString(value) {
|
|
272
155
|
if (value === undefined)
|
|
273
156
|
return undefined;
|
|
274
157
|
return value;
|
|
275
158
|
}
|
|
276
|
-
function resolveRuntimeCreateUnsetDefinition(token, runtimeFieldRegistry) {
|
|
277
|
-
if (!runtimeFieldRegistry) {
|
|
278
|
-
return undefined;
|
|
279
|
-
}
|
|
280
|
-
for (const definition of runtimeFieldRegistry.definitions) {
|
|
281
|
-
if (definition.allow_unset === false) {
|
|
282
|
-
continue;
|
|
283
|
-
}
|
|
284
|
-
const candidates = new Set([
|
|
285
|
-
definition.key,
|
|
286
|
-
definition.metadata_key,
|
|
287
|
-
definition.cli_flag.replaceAll("-", "_"),
|
|
288
|
-
definition.cli_flag,
|
|
289
|
-
...definition.cli_aliases.map((alias) => alias.replaceAll("-", "_")),
|
|
290
|
-
...definition.cli_aliases,
|
|
291
|
-
]);
|
|
292
|
-
if (!candidates.has(token)) {
|
|
293
|
-
continue;
|
|
294
|
-
}
|
|
295
|
-
return {
|
|
296
|
-
optionKey: definition.key,
|
|
297
|
-
frontMatterKey: definition.metadata_key,
|
|
298
|
-
};
|
|
299
|
-
}
|
|
300
|
-
return undefined;
|
|
301
|
-
}
|
|
302
159
|
function parseCreateUnsetTargets(raw, runtimeFieldRegistry) {
|
|
303
160
|
const frontMatterKeys = new Set();
|
|
304
161
|
const optionKeys = new Set();
|
|
@@ -313,7 +170,7 @@ function parseCreateUnsetTargets(raw, runtimeFieldRegistry) {
|
|
|
313
170
|
if (isLegacyNoneToken(trimmed)) {
|
|
314
171
|
throw new PmCliError('--unset no longer accepts "none" or "null". Specify concrete field names such as --unset deadline', EXIT_CODE.USAGE);
|
|
315
172
|
}
|
|
316
|
-
const definition = CREATE_UNSET_ALIAS_MAP.get(trimmed) ??
|
|
173
|
+
const definition = CREATE_UNSET_ALIAS_MAP.get(trimmed) ?? resolveRuntimeUnsetFieldDefinition(trimmed, "create", runtimeFieldRegistry);
|
|
317
174
|
if (!definition) {
|
|
318
175
|
throw new PmCliError(`Unsupported --unset field "${entry}". Supported fields: ${CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS}`, EXIT_CODE.USAGE);
|
|
319
176
|
}
|
|
@@ -937,16 +794,171 @@ function ensureInitHasRun(pmRoot) {
|
|
|
937
794
|
});
|
|
938
795
|
}
|
|
939
796
|
/**
|
|
940
|
-
*
|
|
797
|
+
* Resolve an optional string front-matter field for {@link runCreate}: yields
|
|
798
|
+
* `undefined` when the field is being cleared via `--unset <key>` or was never
|
|
799
|
+
* supplied, otherwise the (identity-parsed) raw value. Collapses the pervasive
|
|
800
|
+
* `unset ? undefined : raw === undefined ? undefined : parseOptionalString(raw)`
|
|
801
|
+
* triple-ternary each optional scalar field repeated inline, keeping `runCreate`
|
|
802
|
+
* under the complexity ceiling without changing any resolved value.
|
|
941
803
|
*/
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
804
|
+
function resolveUnsettableOptionalString(unsetKeys, frontMatterKey, raw) {
|
|
805
|
+
return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : parseOptionalString(raw);
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* Resolve an optional field that maps its raw string through `transform` once
|
|
809
|
+
* present: yields `undefined` when the field is being cleared via `--unset` or
|
|
810
|
+
* was never supplied, otherwise `transform(raw)`. The non-string return type is
|
|
811
|
+
* inferred from `transform`, so this serves numeric, ISO-date, and enum fields
|
|
812
|
+
* alike while keeping the unset/absent guard in one place.
|
|
813
|
+
*/
|
|
814
|
+
function resolveUnsettableTransformed(unsetKeys, frontMatterKey, raw, transform) {
|
|
815
|
+
return unsetKeys.has(frontMatterKey) || raw === undefined ? undefined : transform(raw);
|
|
816
|
+
}
|
|
817
|
+
/** Calendar-relevant item types whose entries are invisible on `pm calendar` without a schedule. */
|
|
818
|
+
const CALENDAR_RELEVANT_CREATE_TYPES = new Set(["milestone", "meeting", "reminder", "event"]);
|
|
819
|
+
/**
|
|
820
|
+
* Whether a calendar-relevant item would be invisible on `pm calendar`: a
|
|
821
|
+
* Milestone/Meeting/Reminder/Event created with no deadline AND no reminders AND
|
|
822
|
+
* no events never surfaces there. Shared by the structured create warning and the
|
|
823
|
+
* post-write stderr hint so both stay in lockstep.
|
|
824
|
+
*/
|
|
825
|
+
function createItemLacksSchedule(type, deadline, reminders, events) {
|
|
826
|
+
const hasDeadline = deadline !== undefined;
|
|
827
|
+
const hasReminders = reminders !== undefined && reminders.length > 0;
|
|
828
|
+
const hasEvents = events !== undefined && events.length > 0;
|
|
829
|
+
return CALENDAR_RELEVANT_CREATE_TYPES.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Build the never-blocking schedule-visibility warnings for a new item: an
|
|
833
|
+
* `event_without_schedule` token for Event-type items with no attached events,
|
|
834
|
+
* and a `calendar_item_without_schedule` token (with an actionable hint) for any
|
|
835
|
+
* calendar-relevant type that would be invisible on `pm calendar`. The structured
|
|
836
|
+
* prefixes are stable for automation/telemetry (pm-2cgu / GH-174).
|
|
837
|
+
*/
|
|
838
|
+
function collectCreateScheduleWarnings(type, id, deadline, reminders, events) {
|
|
839
|
+
const warnings = [];
|
|
840
|
+
if (type.toLowerCase() === "event" && (events === undefined || events.length === 0)) {
|
|
841
|
+
warnings.push(`event_without_schedule:${id}:no_time_set`);
|
|
842
|
+
}
|
|
843
|
+
if (createItemLacksSchedule(type, deadline, reminders, events)) {
|
|
844
|
+
warnings.push(`calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event (hint: set --deadline <ISO> or --reminder "<when>", or link an Event via --event "start=<ISO>,end=<ISO>"; otherwise this item never appears on pm calendar)`);
|
|
845
|
+
}
|
|
846
|
+
return warnings;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Resolve the effective parent for a new item, inheriting the session-focused
|
|
850
|
+
* item (set via `pm focus <id>`) only when no explicit `--parent` was supplied
|
|
851
|
+
* and parent is not being unset (GH-161 / pm-72xf). An explicit `--parent`
|
|
852
|
+
* (including `--parent ""`) always overrides focus; the inherited value flows
|
|
853
|
+
* through the same locate/validate path as an explicit parent.
|
|
854
|
+
*/
|
|
855
|
+
async function inheritFocusedParent(parent, resolvedOptions, unsetKeys, pmRoot) {
|
|
856
|
+
if (parent !== undefined || unsetKeys.has("parent") || resolvedOptions.parent !== undefined) {
|
|
857
|
+
return { parent, parentSource: undefined };
|
|
858
|
+
}
|
|
859
|
+
const focused = await getFocusedItem(pmRoot);
|
|
860
|
+
if (focused === undefined) {
|
|
861
|
+
return { parent, parentSource: undefined };
|
|
862
|
+
}
|
|
863
|
+
return { parent: focused, parentSource: "focus" };
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Normalize and locate a new item's parent reference, returning the normalized
|
|
867
|
+
* value plus any never-blocking missing-parent warnings the configured
|
|
868
|
+
* `parent_reference` policy produces when the target does not resolve.
|
|
869
|
+
*/
|
|
870
|
+
async function validateCreateParentReference(pmRoot, settings, typeRegistry, parent, policy) {
|
|
871
|
+
const normalized = normalizeParentReferenceValue(parent);
|
|
872
|
+
const parentLocated = await locateItem(pmRoot, normalized, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
873
|
+
if (parentLocated) {
|
|
874
|
+
return { parent: normalized, warnings: [] };
|
|
875
|
+
}
|
|
876
|
+
const normalizedParentId = normalizeItemId(normalized, settings.id_prefix);
|
|
877
|
+
return { parent: normalized, warnings: validateMissingParentReference(normalizedParentId, policy).warnings };
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Resolve a sprint or release field: `undefined` when cleared/absent, otherwise
|
|
881
|
+
* the format-validated value plus any never-blocking format warnings from the
|
|
882
|
+
* configured `sprint_release_format` policy.
|
|
883
|
+
*/
|
|
884
|
+
function resolveCreateSprintOrRelease(unsetKeys, frontMatterKey, raw, field, policy) {
|
|
885
|
+
const resolved = resolveUnsettableOptionalString(unsetKeys, frontMatterKey, raw);
|
|
886
|
+
if (resolved === undefined) {
|
|
887
|
+
return { value: undefined, warnings: [] };
|
|
888
|
+
}
|
|
889
|
+
const validation = validateSprintOrReleaseValue(field, resolved, policy);
|
|
890
|
+
return { value: validation.value, warnings: validation.warnings };
|
|
891
|
+
}
|
|
892
|
+
/**
|
|
893
|
+
* Apply the `--blocked-by` convenience: when the target locates, add a
|
|
894
|
+
* `blocked_by` dependency (if not already present) and, unless `--status` was
|
|
895
|
+
* given explicitly, move the new item into the blocked status. Returns the
|
|
896
|
+
* (possibly augmented) dependency list and the (possibly rerouted) status; a
|
|
897
|
+
* `blockedBy` that is absent or does not locate leaves both unchanged.
|
|
898
|
+
*/
|
|
899
|
+
async function resolveCreateBlockedByDependency(params) {
|
|
900
|
+
const { pmRoot, settings, typeRegistry, statusRegistry, blockedBy, status, statusExplicit, nowValue, author } = params;
|
|
901
|
+
let dependencyValues = params.dependencyValues;
|
|
902
|
+
if (blockedBy === undefined) {
|
|
903
|
+
return { dependencyValues, status };
|
|
904
|
+
}
|
|
905
|
+
const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);
|
|
906
|
+
const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
907
|
+
if (!blockedByLocated) {
|
|
908
|
+
return { dependencyValues, status };
|
|
909
|
+
}
|
|
910
|
+
const hasBlockedByDependency = (dependencyValues ?? []).some((dependency) => dependency.id === blockedByLocated.id && dependency.kind === "blocked_by");
|
|
911
|
+
if (!hasBlockedByDependency) {
|
|
912
|
+
dependencyValues = [
|
|
913
|
+
...(dependencyValues ?? []),
|
|
914
|
+
{ id: blockedByLocated.id, kind: "blocked_by", created_at: nowValue, author },
|
|
915
|
+
];
|
|
916
|
+
}
|
|
917
|
+
if (statusExplicit) {
|
|
918
|
+
return { dependencyValues, status };
|
|
919
|
+
}
|
|
920
|
+
const blockedStatus = statusRegistry.blocked_statuses.has("blocked")
|
|
921
|
+
? "blocked"
|
|
922
|
+
: [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;
|
|
923
|
+
return { dependencyValues, status: blockedStatus };
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* Apply the governance default-type fallback when `pm create` was invoked with no
|
|
927
|
+
* `--type`: honor `governance.create_default_type` when it resolves in the active
|
|
928
|
+
* registry, else fall back to the built-in `Task`. Suppressed under explicit
|
|
929
|
+
* `--create-mode strict`, where the strict required-option contract must surface
|
|
930
|
+
* the missing_required_option envelope instead. Mutates `resolvedOptions.type`.
|
|
931
|
+
*/
|
|
932
|
+
function applyCreateDefaultType(resolvedOptions, settings, typeRegistry) {
|
|
933
|
+
// Default-type fallback is suppressed under explicit --create-mode strict, where the strict
|
|
934
|
+
// required-option contract takes precedence and surfaces the missing_required_option envelope.
|
|
935
|
+
/* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */
|
|
936
|
+
const explicitStrictMode = typeof resolvedOptions.createMode === "string" && resolvedOptions.createMode.trim().toLowerCase() === "strict";
|
|
937
|
+
if (explicitStrictMode) {
|
|
938
|
+
return;
|
|
939
|
+
}
|
|
940
|
+
/* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */
|
|
941
|
+
const defaultType = settings.governance.create_default_type?.trim();
|
|
942
|
+
if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {
|
|
943
|
+
resolvedOptions.type = defaultType;
|
|
944
|
+
return;
|
|
945
|
+
}
|
|
946
|
+
/* c8 ignore start -- "Task" is a built-in type present in every default registry; reaching this arm requires a custom schema that removed Task with no create_default_type configured. */
|
|
947
|
+
if (resolveTypeName("Task", typeRegistry)) {
|
|
948
|
+
resolvedOptions.type = "Task";
|
|
949
|
+
}
|
|
950
|
+
/* c8 ignore stop */
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Resolve the target item type and creation mode for `pm create`: merge any
|
|
954
|
+
* `--template` options, apply the governance default-type fallback, map a
|
|
955
|
+
* near-miss `--type` to its canonical synonym (never blocking), and derive the
|
|
956
|
+
* schedule preset and effective create mode. Returns the (possibly
|
|
957
|
+
* template-merged) options alongside the resolved type definition, canonical
|
|
958
|
+
* type name, schedule preset, and create mode.
|
|
959
|
+
*/
|
|
960
|
+
async function resolveCreateTypeSelection(options, global, pmRoot, settings, typeRegistry) {
|
|
961
|
+
let resolvedOptions = options;
|
|
950
962
|
if (resolvedOptions.template !== undefined) {
|
|
951
963
|
const templateName = resolvedOptions.template.trim();
|
|
952
964
|
if (templateName.length === 0) {
|
|
@@ -957,25 +969,7 @@ export async function runCreate(options, global) {
|
|
|
957
969
|
resolvedOptions = normalizeLegacyNoneCreateOptions(mergeCreateOptionsWithTemplate(templateOptions, resolvedOptions));
|
|
958
970
|
}
|
|
959
971
|
if (resolvedOptions.type === undefined) {
|
|
960
|
-
|
|
961
|
-
// required-option contract takes precedence and surfaces the missing_required_option envelope.
|
|
962
|
-
/* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */
|
|
963
|
-
const explicitStrictMode = typeof resolvedOptions.createMode === "string"
|
|
964
|
-
&& resolvedOptions.createMode.trim().toLowerCase() === "strict";
|
|
965
|
-
if (!explicitStrictMode) {
|
|
966
|
-
/* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */
|
|
967
|
-
const defaultType = settings.governance.create_default_type?.trim();
|
|
968
|
-
if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {
|
|
969
|
-
resolvedOptions.type = defaultType;
|
|
970
|
-
}
|
|
971
|
-
else {
|
|
972
|
-
/* c8 ignore start -- "Task" is a built-in type present in every default registry; reaching the false arm requires a custom schema that removed Task with no create_default_type configured. */
|
|
973
|
-
if (resolveTypeName("Task", typeRegistry)) {
|
|
974
|
-
resolvedOptions.type = "Task";
|
|
975
|
-
}
|
|
976
|
-
/* c8 ignore stop */
|
|
977
|
-
}
|
|
978
|
-
}
|
|
972
|
+
applyCreateDefaultType(resolvedOptions, settings, typeRegistry);
|
|
979
973
|
}
|
|
980
974
|
/* c8 ignore start -- missing/invalid type fallback guards are exercised by create command integration suites. */
|
|
981
975
|
if (resolvedOptions.type === undefined) {
|
|
@@ -1011,90 +1005,30 @@ export async function runCreate(options, global) {
|
|
|
1011
1005
|
throw new PmCliError(`--schedule-preset ${schedulePreset} is only supported for Reminder, Meeting, or Event types`, EXIT_CODE.USAGE);
|
|
1012
1006
|
}
|
|
1013
1007
|
const createMode = resolveEffectiveCreateMode(resolvedOptions.createMode, schedulePreset, settings.governance.create_mode_default);
|
|
1014
|
-
|
|
1008
|
+
return { resolvedOptions, typeDefinition, type, schedulePreset, createMode };
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Seed the explicit-unset and clear-option key sets from the parsed `--unset`
|
|
1012
|
+
* targets, then fold in each enabled `--clear-<collection>` flag: it marks the
|
|
1013
|
+
* collection's front-matter key as explicitly unset and its option key as
|
|
1014
|
+
* cleared, and rejects combining a clear flag with its own value flag. Returns
|
|
1015
|
+
* the augmented sets used downstream for required-flag relaxation and history
|
|
1016
|
+
* messaging.
|
|
1017
|
+
*/
|
|
1018
|
+
function collectCreateClearTargets(resolvedOptions, unsetTargets) {
|
|
1015
1019
|
const explicitUnsets = new Set(unsetTargets.frontMatterKeys);
|
|
1016
1020
|
const clearOptionKeys = new Set(unsetTargets.optionKeys);
|
|
1017
1021
|
const clearCollectionDefinitions = [
|
|
1018
|
-
{
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
|
|
1028
|
-
optionKey: "comment",
|
|
1029
|
-
clearFlag: "--clear-comments",
|
|
1030
|
-
valueFlag: "--comment",
|
|
1031
|
-
values: resolvedOptions.comment,
|
|
1032
|
-
frontMatterKey: "comments",
|
|
1033
|
-
},
|
|
1034
|
-
{
|
|
1035
|
-
enabled: resolvedOptions.clearNotes,
|
|
1036
|
-
optionKey: "note",
|
|
1037
|
-
clearFlag: "--clear-notes",
|
|
1038
|
-
valueFlag: "--note",
|
|
1039
|
-
values: resolvedOptions.note,
|
|
1040
|
-
frontMatterKey: "notes",
|
|
1041
|
-
},
|
|
1042
|
-
{
|
|
1043
|
-
enabled: resolvedOptions.clearLearnings,
|
|
1044
|
-
optionKey: "learning",
|
|
1045
|
-
clearFlag: "--clear-learnings",
|
|
1046
|
-
valueFlag: "--learning",
|
|
1047
|
-
values: resolvedOptions.learning,
|
|
1048
|
-
frontMatterKey: "learnings",
|
|
1049
|
-
},
|
|
1050
|
-
{
|
|
1051
|
-
enabled: resolvedOptions.clearFiles,
|
|
1052
|
-
optionKey: "file",
|
|
1053
|
-
clearFlag: "--clear-files",
|
|
1054
|
-
valueFlag: "--file",
|
|
1055
|
-
values: resolvedOptions.file,
|
|
1056
|
-
frontMatterKey: "files",
|
|
1057
|
-
},
|
|
1058
|
-
{
|
|
1059
|
-
enabled: resolvedOptions.clearTests,
|
|
1060
|
-
optionKey: "test",
|
|
1061
|
-
clearFlag: "--clear-tests",
|
|
1062
|
-
valueFlag: "--test",
|
|
1063
|
-
values: resolvedOptions.test,
|
|
1064
|
-
frontMatterKey: "tests",
|
|
1065
|
-
},
|
|
1066
|
-
{
|
|
1067
|
-
enabled: resolvedOptions.clearDocs,
|
|
1068
|
-
optionKey: "doc",
|
|
1069
|
-
clearFlag: "--clear-docs",
|
|
1070
|
-
valueFlag: "--doc",
|
|
1071
|
-
values: resolvedOptions.doc,
|
|
1072
|
-
frontMatterKey: "docs",
|
|
1073
|
-
},
|
|
1074
|
-
{
|
|
1075
|
-
enabled: resolvedOptions.clearReminders,
|
|
1076
|
-
optionKey: "reminder",
|
|
1077
|
-
clearFlag: "--clear-reminders",
|
|
1078
|
-
valueFlag: "--reminder",
|
|
1079
|
-
values: resolvedOptions.reminder,
|
|
1080
|
-
frontMatterKey: "reminders",
|
|
1081
|
-
},
|
|
1082
|
-
{
|
|
1083
|
-
enabled: resolvedOptions.clearEvents,
|
|
1084
|
-
optionKey: "event",
|
|
1085
|
-
clearFlag: "--clear-events",
|
|
1086
|
-
valueFlag: "--event",
|
|
1087
|
-
values: resolvedOptions.event,
|
|
1088
|
-
frontMatterKey: "events",
|
|
1089
|
-
},
|
|
1090
|
-
{
|
|
1091
|
-
enabled: resolvedOptions.clearTypeOptions,
|
|
1092
|
-
optionKey: "typeOption",
|
|
1093
|
-
clearFlag: "--clear-type-options",
|
|
1094
|
-
valueFlag: "--type-option",
|
|
1095
|
-
values: resolvedOptions.typeOption,
|
|
1096
|
-
frontMatterKey: "type_options",
|
|
1097
|
-
},
|
|
1022
|
+
{ enabled: resolvedOptions.clearDeps, optionKey: "dep", clearFlag: "--clear-deps", valueFlag: "--dep", values: resolvedOptions.dep, frontMatterKey: "dependencies" },
|
|
1023
|
+
{ enabled: resolvedOptions.clearComments, optionKey: "comment", clearFlag: "--clear-comments", valueFlag: "--comment", values: resolvedOptions.comment, frontMatterKey: "comments" },
|
|
1024
|
+
{ enabled: resolvedOptions.clearNotes, optionKey: "note", clearFlag: "--clear-notes", valueFlag: "--note", values: resolvedOptions.note, frontMatterKey: "notes" },
|
|
1025
|
+
{ enabled: resolvedOptions.clearLearnings, optionKey: "learning", clearFlag: "--clear-learnings", valueFlag: "--learning", values: resolvedOptions.learning, frontMatterKey: "learnings" },
|
|
1026
|
+
{ enabled: resolvedOptions.clearFiles, optionKey: "file", clearFlag: "--clear-files", valueFlag: "--file", values: resolvedOptions.file, frontMatterKey: "files" },
|
|
1027
|
+
{ enabled: resolvedOptions.clearTests, optionKey: "test", clearFlag: "--clear-tests", valueFlag: "--test", values: resolvedOptions.test, frontMatterKey: "tests" },
|
|
1028
|
+
{ enabled: resolvedOptions.clearDocs, optionKey: "doc", clearFlag: "--clear-docs", valueFlag: "--doc", values: resolvedOptions.doc, frontMatterKey: "docs" },
|
|
1029
|
+
{ enabled: resolvedOptions.clearReminders, optionKey: "reminder", clearFlag: "--clear-reminders", valueFlag: "--reminder", values: resolvedOptions.reminder, frontMatterKey: "reminders" },
|
|
1030
|
+
{ enabled: resolvedOptions.clearEvents, optionKey: "event", clearFlag: "--clear-events", valueFlag: "--event", values: resolvedOptions.event, frontMatterKey: "events" },
|
|
1031
|
+
{ enabled: resolvedOptions.clearTypeOptions, optionKey: "typeOption", clearFlag: "--clear-type-options", valueFlag: "--type-option", values: resolvedOptions.typeOption, frontMatterKey: "type_options" },
|
|
1098
1032
|
];
|
|
1099
1033
|
for (const definition of clearCollectionDefinitions) {
|
|
1100
1034
|
if (!definition.enabled) {
|
|
@@ -1107,6 +1041,14 @@ export async function runCreate(options, global) {
|
|
|
1107
1041
|
explicitUnsets.add(definition.frontMatterKey);
|
|
1108
1042
|
clearOptionKeys.add(definition.optionKey);
|
|
1109
1043
|
}
|
|
1044
|
+
return { explicitUnsets, clearOptionKeys };
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* Reject combining `--unset <field>` with the same field's scalar value flag
|
|
1048
|
+
* (for example `--unset goal --goal ...`) — the single-value analog of the
|
|
1049
|
+
* collection clear/value conflict enforced by {@link collectCreateClearTargets}.
|
|
1050
|
+
*/
|
|
1051
|
+
function assertNoCreateScalarUnsetConflicts(resolvedOptions, unsetTargets) {
|
|
1110
1052
|
const scalarOptionPresence = {
|
|
1111
1053
|
tags: resolvedOptions.tags !== undefined,
|
|
1112
1054
|
deadline: resolvedOptions.deadline !== undefined,
|
|
@@ -1155,6 +1097,13 @@ export async function runCreate(options, global) {
|
|
|
1155
1097
|
/* c8 ignore stop */
|
|
1156
1098
|
throw new PmCliError(`Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel("create", optionKey)}`, EXIT_CODE.USAGE);
|
|
1157
1099
|
}
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Reject the legacy literal `none`/`null` sentinel on any create scalar option,
|
|
1103
|
+
* pointing the author at the modern `--unset <field>` clear syntax (surfacing the
|
|
1104
|
+
* canonical unset key in the hint when the option maps to one).
|
|
1105
|
+
*/
|
|
1106
|
+
function assertNoLegacyCreateScalarTokens(resolvedOptions) {
|
|
1158
1107
|
const assertNoLegacyScalarToken = (value, optionKey) => {
|
|
1159
1108
|
const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);
|
|
1160
1109
|
const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : undefined;
|
|
@@ -1196,6 +1145,191 @@ export async function runCreate(options, global) {
|
|
|
1196
1145
|
assertNoLegacyScalarToken(resolvedOptions.component, "component");
|
|
1197
1146
|
assertNoLegacyScalarToken(resolvedOptions.regression, "regression");
|
|
1198
1147
|
assertNoLegacyScalarToken(resolvedOptions.customerImpact, "customerImpact");
|
|
1148
|
+
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Reject combining `--unset <field>` with an extension-registered or
|
|
1151
|
+
* runtime-schema field's value flag. These custom fields are validated
|
|
1152
|
+
* separately from the built-in scalar options but honor the same clear/value
|
|
1153
|
+
* mutual exclusion.
|
|
1154
|
+
*/
|
|
1155
|
+
function assertNoCreateFieldUnsetConflicts(registeredItemFieldValues, runtimeCreateFieldValues, unsetTargets) {
|
|
1156
|
+
for (const fieldKey of Object.keys(registeredItemFieldValues)) {
|
|
1157
|
+
if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);
|
|
1161
|
+
}
|
|
1162
|
+
/* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */
|
|
1163
|
+
for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {
|
|
1164
|
+
/* c8 ignore stop */
|
|
1165
|
+
if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
|
|
1166
|
+
continue;
|
|
1167
|
+
}
|
|
1168
|
+
throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with its value flag`, EXIT_CODE.USAGE);
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
/**
|
|
1172
|
+
* Throw the aggregated `missing_required_option` error when a type's required
|
|
1173
|
+
* create options and/or required type-option keys were not all supplied in one
|
|
1174
|
+
* invocation. Builds a type-aware valid example and staged-onboarding next steps
|
|
1175
|
+
* (a strict-mode invocation also carries a compact recovery envelope). A no-op
|
|
1176
|
+
* when nothing is missing.
|
|
1177
|
+
*/
|
|
1178
|
+
function assertNoMissingRequiredCreateOptions(params) {
|
|
1179
|
+
const { combinedMissingFlags, typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus, type, createMode } = params;
|
|
1180
|
+
if (combinedMissingFlags.length === 0) {
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, missingRequiredCreateFlags, missingRequiredTypeOptionKeys, openStatus);
|
|
1184
|
+
const nextSteps = [`Run "pm create --help --type ${type}" for type-aware required option guidance.`];
|
|
1185
|
+
if (combinedMissingFlags.includes("--title")) {
|
|
1186
|
+
nextSteps.push('Title can also be passed as the first positional argument (example: pm create "Your title" --type ' + type + ").");
|
|
1187
|
+
}
|
|
1188
|
+
if (createMode === "strict") {
|
|
1189
|
+
nextSteps.push('For staged onboarding, retry with "--create-mode progressive".');
|
|
1190
|
+
if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {
|
|
1191
|
+
nextSteps.push('For minimal scheduling inputs, try "--schedule-preset lightweight".');
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
const errorMessage = combinedMissingFlags.length === 1
|
|
1195
|
+
? `Missing required option ${combinedMissingFlags[0]} for type "${type}"`
|
|
1196
|
+
: `Missing required options ${combinedMissingFlags.join(", ")} for type "${type}"`;
|
|
1197
|
+
throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {
|
|
1198
|
+
code: "missing_required_option",
|
|
1199
|
+
required: `Provide all required create options and type options for type "${type}" in one invocation.`,
|
|
1200
|
+
examples: [nextValidExample],
|
|
1201
|
+
nextSteps,
|
|
1202
|
+
recovery: createMode === "strict"
|
|
1203
|
+
? {
|
|
1204
|
+
recovery_mode: "compact",
|
|
1205
|
+
missing_required_fields: combinedMissingFlags,
|
|
1206
|
+
suggested_flags: ["--create-mode progressive", ...combinedMissingFlags],
|
|
1207
|
+
}
|
|
1208
|
+
: undefined,
|
|
1209
|
+
});
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Resolve the new item's tags: an empty list when `--unset tags` clears the
|
|
1213
|
+
* field (rejecting a contradictory `--add-tags`), otherwise the parsed `--tags`
|
|
1214
|
+
* merged with any additive `--add-tags`.
|
|
1215
|
+
*/
|
|
1216
|
+
function resolveCreateTags(unsetKeys, resolvedOptions) {
|
|
1217
|
+
if (unsetKeys.has("tags") && Array.isArray(resolvedOptions.addTags) && resolvedOptions.addTags.length > 0) {
|
|
1218
|
+
throw new PmCliError("Cannot combine --unset tags with --add-tags", EXIT_CODE.USAGE);
|
|
1219
|
+
}
|
|
1220
|
+
const baseTags = unsetKeys.has("tags") ? [] : resolvedOptions.tags !== undefined ? parseTags(resolvedOptions.tags) : [];
|
|
1221
|
+
return mergeAdditiveTags(baseTags, resolvedOptions.addTags);
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Resolve the new item's integer `order`: `undefined` when cleared/absent, else
|
|
1225
|
+
* the parsed value. Rejects mismatched `--order`/`--rank` and non-integer values.
|
|
1226
|
+
*/
|
|
1227
|
+
function resolveCreateOrder(unsetKeys, resolvedOptions) {
|
|
1228
|
+
if (resolvedOptions.order !== undefined && resolvedOptions.rank !== undefined && resolvedOptions.order !== resolvedOptions.rank) {
|
|
1229
|
+
throw new PmCliError("--order and --rank must match when both are provided", EXIT_CODE.USAGE);
|
|
1230
|
+
}
|
|
1231
|
+
const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;
|
|
1232
|
+
const order = resolveUnsettableTransformed(unsetKeys, "order", orderRaw, (raw) => parseOptionalNumber(raw, "order"));
|
|
1233
|
+
if (order !== undefined && !Number.isInteger(order)) {
|
|
1234
|
+
throw new PmCliError("Order must be an integer", EXIT_CODE.USAGE);
|
|
1235
|
+
}
|
|
1236
|
+
return order;
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Resolve the close reason for an item created directly in the close status
|
|
1240
|
+
* (GH-249): honor `governance.require_close_reason` like `pm close`, deriving it
|
|
1241
|
+
* from `--message` > `--resolution` and falling back to a stable placeholder,
|
|
1242
|
+
* warning `close_reason_defaulted` when neither was supplied. Returns `undefined`
|
|
1243
|
+
* (and no warnings) when the item is not being created closed or the policy is
|
|
1244
|
+
* off.
|
|
1245
|
+
*/
|
|
1246
|
+
function resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution) {
|
|
1247
|
+
if (status !== statusRegistry.close_status || !settings.governance.require_close_reason) {
|
|
1248
|
+
return { closeReason: undefined, warnings: [] };
|
|
1249
|
+
}
|
|
1250
|
+
const messageText = typeof resolvedOptions.message === "string" ? resolvedOptions.message.trim() : "";
|
|
1251
|
+
const resolutionText = typeof resolution === "string" ? resolution.trim() : "";
|
|
1252
|
+
const closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;
|
|
1253
|
+
const warnings = messageText.length === 0 && resolutionText.length === 0 ? ["close_reason_defaulted"] : [];
|
|
1254
|
+
return { closeReason, warnings };
|
|
1255
|
+
}
|
|
1256
|
+
/**
|
|
1257
|
+
* Commit a freshly built item under its per-id lock: write the serialized
|
|
1258
|
+
* document, append the create history entry (rolling back the item file if the
|
|
1259
|
+
* history append throws), run the item + history `onWrite` hooks, and record the
|
|
1260
|
+
* after-command affected item. Returns the collected hook warnings; the lock is
|
|
1261
|
+
* always released.
|
|
1262
|
+
*/
|
|
1263
|
+
async function writeCreatedItem(params) {
|
|
1264
|
+
const { pmRoot, type, id, settings, typeRegistry, author, extensionFieldNames, afterDocument, beforeDocument, historyMessage, changedFields, nowValue } = params;
|
|
1265
|
+
const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
|
|
1266
|
+
const historyPath = getHistoryPath(pmRoot, id);
|
|
1267
|
+
const lockRelease = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
|
|
1268
|
+
let hookWarnings = [];
|
|
1269
|
+
try {
|
|
1270
|
+
await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: settings.item_format, schema: settings.schema, extensionFieldNames }));
|
|
1271
|
+
try {
|
|
1272
|
+
const entry = createHistoryEntry({ nowIso: nowValue, author, op: "create", before: beforeDocument, after: afterDocument, message: historyMessage });
|
|
1273
|
+
await appendHistoryEntry(historyPath, entry);
|
|
1274
|
+
}
|
|
1275
|
+
catch (error) {
|
|
1276
|
+
await removeFileIfExists(itemPath);
|
|
1277
|
+
throw error;
|
|
1278
|
+
}
|
|
1279
|
+
hookWarnings = [
|
|
1280
|
+
...(await runActiveOnWriteHooks({
|
|
1281
|
+
path: itemPath,
|
|
1282
|
+
scope: "project",
|
|
1283
|
+
op: "create",
|
|
1284
|
+
item_id: afterDocument.metadata.id,
|
|
1285
|
+
item_type: afterDocument.metadata.type,
|
|
1286
|
+
before: beforeDocument,
|
|
1287
|
+
after: afterDocument,
|
|
1288
|
+
changed_fields: changedFields,
|
|
1289
|
+
})),
|
|
1290
|
+
...(await runActiveOnWriteHooks({
|
|
1291
|
+
path: historyPath,
|
|
1292
|
+
scope: "project",
|
|
1293
|
+
op: "create:history",
|
|
1294
|
+
item_id: afterDocument.metadata.id,
|
|
1295
|
+
item_type: afterDocument.metadata.type,
|
|
1296
|
+
before: beforeDocument,
|
|
1297
|
+
after: afterDocument,
|
|
1298
|
+
changed_fields: changedFields,
|
|
1299
|
+
})),
|
|
1300
|
+
];
|
|
1301
|
+
recordAfterCommandAffectedItem({
|
|
1302
|
+
id: afterDocument.metadata.id,
|
|
1303
|
+
op: "create",
|
|
1304
|
+
item_type: afterDocument.metadata.type,
|
|
1305
|
+
status: afterDocument.metadata.status,
|
|
1306
|
+
current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),
|
|
1307
|
+
changed_fields: changedFields,
|
|
1308
|
+
});
|
|
1309
|
+
}
|
|
1310
|
+
finally {
|
|
1311
|
+
await lockRelease();
|
|
1312
|
+
}
|
|
1313
|
+
return hookWarnings;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Implements run create for the public runtime surface of this module.
|
|
1317
|
+
*/
|
|
1318
|
+
export async function runCreate(options, global) {
|
|
1319
|
+
let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));
|
|
1320
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1321
|
+
await ensureInitHasRun(pmRoot);
|
|
1322
|
+
const settings = await readSettings(pmRoot);
|
|
1323
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
1324
|
+
const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
|
|
1325
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
1326
|
+
const typeSelection = await resolveCreateTypeSelection(resolvedOptions, global, pmRoot, settings, typeRegistry);
|
|
1327
|
+
resolvedOptions = typeSelection.resolvedOptions;
|
|
1328
|
+
const { typeDefinition, type, createMode } = typeSelection;
|
|
1329
|
+
const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);
|
|
1330
|
+
const { explicitUnsets, clearOptionKeys } = collectCreateClearTargets(resolvedOptions, unsetTargets);
|
|
1331
|
+
assertNoCreateScalarUnsetConflicts(resolvedOptions, unsetTargets);
|
|
1332
|
+
assertNoLegacyCreateScalarTokens(resolvedOptions);
|
|
1199
1333
|
const missingRequiredCreateFlags = requireCreateOptionByType(typeDefinition, resolvedOptions, createMode, clearOptionKeys);
|
|
1200
1334
|
const nowValue = nowIso();
|
|
1201
1335
|
const author = selectAuthor(resolvedOptions.author, settings.author_default);
|
|
@@ -1213,21 +1347,8 @@ export async function runCreate(options, global) {
|
|
|
1213
1347
|
const extensionRegistrations = getActiveExtensionRegistrations();
|
|
1214
1348
|
const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);
|
|
1215
1349
|
const registeredItemFieldValues = parseRegisteredItemFieldAssignments(resolvedOptions.field, extensionRegistrations);
|
|
1216
|
-
for (const fieldKey of Object.keys(registeredItemFieldValues)) {
|
|
1217
|
-
if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
|
|
1218
|
-
continue;
|
|
1219
|
-
}
|
|
1220
|
-
throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);
|
|
1221
|
-
}
|
|
1222
1350
|
const runtimeCreateFieldValues = collectRuntimeCreateFieldValues(resolvedOptions, runtimeFieldRegistry, type);
|
|
1223
|
-
|
|
1224
|
-
for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {
|
|
1225
|
-
/* c8 ignore stop */
|
|
1226
|
-
if (!unsetTargets.frontMatterKeys.has(fieldKey)) {
|
|
1227
|
-
continue;
|
|
1228
|
-
}
|
|
1229
|
-
throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll("_", "-")} with its value flag`, EXIT_CODE.USAGE);
|
|
1230
|
-
}
|
|
1351
|
+
assertNoCreateFieldUnsetConflicts(registeredItemFieldValues, runtimeCreateFieldValues, unsetTargets);
|
|
1231
1352
|
const missingRequiredTypeOptionKeys = collectMissingRequiredTypeOptionKeys(validatedTypeOptions.errors, type);
|
|
1232
1353
|
const missingRequiredTypeOptionFlags = missingRequiredTypeOptionKeys.map((key) => `--type-option ${key}=<value>`);
|
|
1233
1354
|
const combinedMissingFlags = [
|
|
@@ -1238,35 +1359,15 @@ export async function runCreate(options, global) {
|
|
|
1238
1359
|
...runtimeCreateFieldValues.missing_required_flags,
|
|
1239
1360
|
]),
|
|
1240
1361
|
].sort((left, right) => left.localeCompare(right));
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
nextSteps.push('For minimal scheduling inputs, try "--schedule-preset lightweight".');
|
|
1251
|
-
}
|
|
1252
|
-
}
|
|
1253
|
-
const errorMessage = combinedMissingFlags.length === 1
|
|
1254
|
-
? `Missing required option ${combinedMissingFlags[0]} for type "${type}"`
|
|
1255
|
-
: `Missing required options ${combinedMissingFlags.join(", ")} for type "${type}"`;
|
|
1256
|
-
throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {
|
|
1257
|
-
code: "missing_required_option",
|
|
1258
|
-
required: `Provide all required create options and type options for type "${type}" in one invocation.`,
|
|
1259
|
-
examples: [nextValidExample],
|
|
1260
|
-
nextSteps,
|
|
1261
|
-
recovery: createMode === "strict"
|
|
1262
|
-
? {
|
|
1263
|
-
recovery_mode: "compact",
|
|
1264
|
-
missing_required_fields: combinedMissingFlags,
|
|
1265
|
-
suggested_flags: ["--create-mode progressive", ...combinedMissingFlags],
|
|
1266
|
-
}
|
|
1267
|
-
: undefined,
|
|
1268
|
-
});
|
|
1269
|
-
}
|
|
1362
|
+
assertNoMissingRequiredCreateOptions({
|
|
1363
|
+
combinedMissingFlags,
|
|
1364
|
+
typeDefinition,
|
|
1365
|
+
missingRequiredCreateFlags,
|
|
1366
|
+
missingRequiredTypeOptionKeys,
|
|
1367
|
+
openStatus: statusRegistry.open_status,
|
|
1368
|
+
type,
|
|
1369
|
+
createMode,
|
|
1370
|
+
});
|
|
1270
1371
|
const nonMissingTypeOptionErrors = filterNonMissingTypeOptionErrors(validatedTypeOptions.errors, type);
|
|
1271
1372
|
if (nonMissingTypeOptionErrors.length > 0) {
|
|
1272
1373
|
const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, [], [], statusRegistry.open_status);
|
|
@@ -1282,236 +1383,86 @@ export async function runCreate(options, global) {
|
|
|
1282
1383
|
? parseStatusValue(resolvedOptions.status, statusRegistry)
|
|
1283
1384
|
: resolveCreateDefaultStatus(typeDefinition, statusRegistry);
|
|
1284
1385
|
const priority = resolvedOptions.priority !== undefined ? ensurePriority(resolvedOptions.priority) : 2;
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
const
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
: resolvedOptions.acceptanceCriteria === undefined
|
|
1312
|
-
? undefined
|
|
1313
|
-
: resolvedOptions.acceptanceCriteria;
|
|
1314
|
-
const definitionOfReady = unsetTargets.frontMatterKeys.has("definition_of_ready") || resolvedOptions.definitionOfReady === undefined
|
|
1315
|
-
? undefined
|
|
1316
|
-
: parseOptionalString(resolvedOptions.definitionOfReady);
|
|
1317
|
-
if (resolvedOptions.order !== undefined &&
|
|
1318
|
-
resolvedOptions.rank !== undefined &&
|
|
1319
|
-
resolvedOptions.order !== resolvedOptions.rank) {
|
|
1320
|
-
throw new PmCliError("--order and --rank must match when both are provided", EXIT_CODE.USAGE);
|
|
1321
|
-
}
|
|
1322
|
-
const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;
|
|
1323
|
-
const order = unsetTargets.frontMatterKeys.has("order") || orderRaw === undefined ? undefined : parseOptionalNumber(orderRaw, "order");
|
|
1324
|
-
if (order !== undefined && !Number.isInteger(order)) {
|
|
1325
|
-
throw new PmCliError("Order must be an integer", EXIT_CODE.USAGE);
|
|
1326
|
-
}
|
|
1327
|
-
const goal = unsetTargets.frontMatterKeys.has("goal") || resolvedOptions.goal === undefined ? undefined : parseOptionalString(resolvedOptions.goal);
|
|
1328
|
-
const objective = unsetTargets.frontMatterKeys.has("objective") || resolvedOptions.objective === undefined
|
|
1329
|
-
? undefined
|
|
1330
|
-
: parseOptionalString(resolvedOptions.objective);
|
|
1331
|
-
const value = unsetTargets.frontMatterKeys.has("value") || resolvedOptions.value === undefined
|
|
1332
|
-
? undefined
|
|
1333
|
-
: parseOptionalString(resolvedOptions.value);
|
|
1334
|
-
const impact = unsetTargets.frontMatterKeys.has("impact") || resolvedOptions.impact === undefined
|
|
1335
|
-
? undefined
|
|
1336
|
-
: parseOptionalString(resolvedOptions.impact);
|
|
1337
|
-
const outcome = unsetTargets.frontMatterKeys.has("outcome") || resolvedOptions.outcome === undefined
|
|
1338
|
-
? undefined
|
|
1339
|
-
: parseOptionalString(resolvedOptions.outcome);
|
|
1340
|
-
const whyNow = unsetTargets.frontMatterKeys.has("why_now") || resolvedOptions.whyNow === undefined
|
|
1341
|
-
? undefined
|
|
1342
|
-
: parseOptionalString(resolvedOptions.whyNow);
|
|
1343
|
-
const assignee = unsetTargets.frontMatterKeys.has("assignee") || resolvedOptions.assignee === undefined
|
|
1344
|
-
? undefined
|
|
1345
|
-
: parseOptionalString(resolvedOptions.assignee);
|
|
1346
|
-
const authorValue = unsetTargets.frontMatterKeys.has("author")
|
|
1347
|
-
? undefined
|
|
1348
|
-
: parseOptionalString(resolvedOptions.author) ?? author;
|
|
1349
|
-
let parent = unsetTargets.frontMatterKeys.has("parent") || resolvedOptions.parent === undefined
|
|
1350
|
-
? undefined
|
|
1351
|
-
: parseOptionalString(resolvedOptions.parent);
|
|
1352
|
-
// GH-161 (pm-72xf): when no explicit --parent was given (and parent is not
|
|
1353
|
-
// being unset), default the parent to the session "focused" item set via
|
|
1354
|
-
// `pm focus <id>`. An explicit --parent (even `--parent ""` to unset)
|
|
1355
|
-
// overrides focus. The inherited value flows through the same locateItem /
|
|
1356
|
-
// validateMissingParentReference path below, so a stale focus produces the
|
|
1357
|
-
// same clear missing-parent error/warning as an explicit stale --parent.
|
|
1358
|
-
let parentSource;
|
|
1359
|
-
if (parent === undefined &&
|
|
1360
|
-
!unsetTargets.frontMatterKeys.has("parent") &&
|
|
1361
|
-
resolvedOptions.parent === undefined) {
|
|
1362
|
-
const focused = await getFocusedItem(pmRoot);
|
|
1363
|
-
if (focused !== undefined) {
|
|
1364
|
-
parent = focused;
|
|
1365
|
-
parentSource = "focus";
|
|
1366
|
-
}
|
|
1367
|
-
}
|
|
1368
|
-
const reviewer = unsetTargets.frontMatterKeys.has("reviewer") || resolvedOptions.reviewer === undefined
|
|
1369
|
-
? undefined
|
|
1370
|
-
: parseOptionalString(resolvedOptions.reviewer);
|
|
1371
|
-
const riskRaw = unsetTargets.frontMatterKeys.has("risk") || resolvedOptions.risk === undefined
|
|
1372
|
-
? undefined
|
|
1373
|
-
: parseOptionalString(resolvedOptions.risk);
|
|
1374
|
-
const risk = riskRaw !== undefined ? ensureEnumValue(normalizeRiskInput(riskRaw), RISK_VALUES, "risk") : undefined;
|
|
1375
|
-
const confidenceRaw = unsetTargets.frontMatterKeys.has("confidence") || resolvedOptions.confidence === undefined
|
|
1376
|
-
? undefined
|
|
1377
|
-
: parseOptionalString(resolvedOptions.confidence);
|
|
1378
|
-
const confidence = confidenceRaw !== undefined ? parseConfidenceInput(confidenceRaw) : undefined;
|
|
1386
|
+
const unsetKeys = unsetTargets.frontMatterKeys;
|
|
1387
|
+
const tags = resolveCreateTags(unsetKeys, resolvedOptions);
|
|
1388
|
+
const deadline = resolveUnsettableTransformed(unsetKeys, "deadline", resolvedOptions.deadline, (raw) => resolveIsoOrRelative(raw, new Date(nowValue), "deadline"));
|
|
1389
|
+
const estimatedMinutes = resolveUnsettableTransformed(unsetKeys, "estimated_minutes", resolvedOptions.estimatedMinutes, (raw) => parseOptionalNumber(raw, "estimated-minutes"));
|
|
1390
|
+
const acceptanceCriteria = resolveUnsettableOptionalString(unsetKeys, "acceptance_criteria", resolvedOptions.acceptanceCriteria);
|
|
1391
|
+
const definitionOfReady = resolveUnsettableOptionalString(unsetKeys, "definition_of_ready", resolvedOptions.definitionOfReady);
|
|
1392
|
+
const order = resolveCreateOrder(unsetKeys, resolvedOptions);
|
|
1393
|
+
const goal = resolveUnsettableOptionalString(unsetKeys, "goal", resolvedOptions.goal);
|
|
1394
|
+
const objective = resolveUnsettableOptionalString(unsetKeys, "objective", resolvedOptions.objective);
|
|
1395
|
+
const value = resolveUnsettableOptionalString(unsetKeys, "value", resolvedOptions.value);
|
|
1396
|
+
const impact = resolveUnsettableOptionalString(unsetKeys, "impact", resolvedOptions.impact);
|
|
1397
|
+
const outcome = resolveUnsettableOptionalString(unsetKeys, "outcome", resolvedOptions.outcome);
|
|
1398
|
+
const whyNow = resolveUnsettableOptionalString(unsetKeys, "why_now", resolvedOptions.whyNow);
|
|
1399
|
+
const assignee = resolveUnsettableOptionalString(unsetKeys, "assignee", resolvedOptions.assignee);
|
|
1400
|
+
const authorValue = unsetKeys.has("author") ? undefined : parseOptionalString(resolvedOptions.author) ?? author;
|
|
1401
|
+
// GH-161 (pm-72xf): inherit the session-focused parent when no explicit
|
|
1402
|
+
// --parent was supplied and parent is not being unset; an explicit --parent
|
|
1403
|
+
// (including `--parent ""`) overrides focus. The inherited value flows through
|
|
1404
|
+
// the same locate/validate path below as an explicit parent.
|
|
1405
|
+
const initialParent = resolveUnsettableOptionalString(unsetKeys, "parent", resolvedOptions.parent);
|
|
1406
|
+
const inheritedParent = await inheritFocusedParent(initialParent, resolvedOptions, unsetKeys, pmRoot);
|
|
1407
|
+
let parent = inheritedParent.parent;
|
|
1408
|
+
const parentSource = inheritedParent.parentSource;
|
|
1409
|
+
const reviewer = resolveUnsettableOptionalString(unsetKeys, "reviewer", resolvedOptions.reviewer);
|
|
1410
|
+
const risk = resolveUnsettableTransformed(unsetKeys, "risk", resolvedOptions.risk, (raw) => ensureEnumValue(normalizeRiskInput(raw), RISK_VALUES, "risk"));
|
|
1411
|
+
const confidence = resolveUnsettableTransformed(unsetKeys, "confidence", resolvedOptions.confidence, (raw) => parseConfidenceInput(raw));
|
|
1379
1412
|
const parentReferencePolicy = resolvedOptions.allowMissingParent === true && settings.validation.parent_reference === "strict_error"
|
|
1380
1413
|
? "warn"
|
|
1381
1414
|
: settings.validation.parent_reference;
|
|
1382
1415
|
const sprintReleasePolicy = settings.validation.sprint_release_format;
|
|
1383
|
-
const validationWarnings =
|
|
1384
|
-
// Event-type items with no attached schedule never surface on the calendar; warn (never block).
|
|
1385
|
-
if (type.toLowerCase() === "event" && (events.values === undefined || events.values.length === 0)) {
|
|
1386
|
-
validationWarnings.push(`event_without_schedule:${id}:no_time_set`);
|
|
1387
|
-
}
|
|
1388
|
-
// Calendar-relevant types (Milestone, Meeting, Reminder, Event) with NO deadline AND no
|
|
1389
|
-
// reminders AND no events are invisible on `pm calendar`. Warn (never block) so the agent
|
|
1390
|
-
// can attach a schedule via `pm update`.
|
|
1391
|
-
const calendarRelevantTypes = new Set(["milestone", "meeting", "reminder", "event"]);
|
|
1392
|
-
const hasDeadline = deadline !== undefined;
|
|
1393
|
-
const hasReminders = reminders.values !== undefined && reminders.values.length > 0;
|
|
1394
|
-
const hasEvents = events.values !== undefined && events.values.length > 0;
|
|
1395
|
-
if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {
|
|
1396
|
-
// Keep the structured `calendar_item_without_schedule:<id>:<code>` prefix
|
|
1397
|
-
// stable (automation/telemetry match on it) and append the actionable hint
|
|
1398
|
-
// after the token (pm-2cgu / GH-174).
|
|
1399
|
-
validationWarnings.push(`calendar_item_without_schedule:${id}:no_deadline_or_reminder_or_event (hint: set --deadline <ISO> or --reminder "<when>", or link an Event via --event "start=<ISO>,end=<ISO>"; otherwise this item never appears on pm calendar)`);
|
|
1400
|
-
}
|
|
1416
|
+
const validationWarnings = collectCreateScheduleWarnings(type, id, deadline, reminders.values, events.values);
|
|
1401
1417
|
if (parent !== undefined) {
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
:
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
}
|
|
1425
|
-
const
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
author,
|
|
1442
|
-
},
|
|
1443
|
-
];
|
|
1444
|
-
}
|
|
1445
|
-
if (resolvedOptions.status === undefined) {
|
|
1446
|
-
status = statusRegistry.blocked_statuses.has("blocked")
|
|
1447
|
-
? "blocked"
|
|
1448
|
-
: [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;
|
|
1449
|
-
}
|
|
1450
|
-
}
|
|
1451
|
-
}
|
|
1452
|
-
const blockedReason = unsetTargets.frontMatterKeys.has("blocked_reason") || resolvedOptions.blockedReason === undefined
|
|
1453
|
-
? undefined
|
|
1454
|
-
: parseOptionalString(resolvedOptions.blockedReason);
|
|
1455
|
-
const unblockNote = unsetTargets.frontMatterKeys.has("unblock_note") || resolvedOptions.unblockNote === undefined
|
|
1456
|
-
? undefined
|
|
1457
|
-
: parseOptionalString(resolvedOptions.unblockNote);
|
|
1458
|
-
const reporter =
|
|
1459
|
-
/* c8 ignore next -- reporter normalization branch is covered in issue-template integration tests. */
|
|
1460
|
-
unsetTargets.frontMatterKeys.has("reporter") || resolvedOptions.reporter === undefined
|
|
1461
|
-
? undefined
|
|
1462
|
-
: parseOptionalString(resolvedOptions.reporter);
|
|
1463
|
-
const severityRaw = unsetTargets.frontMatterKeys.has("severity") || resolvedOptions.severity === undefined
|
|
1464
|
-
? undefined
|
|
1465
|
-
: parseOptionalString(resolvedOptions.severity);
|
|
1466
|
-
const severity = severityRaw !== undefined ? ensureEnumValue(normalizeSeverityInput(severityRaw), ISSUE_SEVERITY_VALUES, "severity") : undefined;
|
|
1467
|
-
const environment = unsetTargets.frontMatterKeys.has("environment") || resolvedOptions.environment === undefined
|
|
1468
|
-
? undefined
|
|
1469
|
-
: parseOptionalString(resolvedOptions.environment);
|
|
1470
|
-
const reproSteps = unsetTargets.frontMatterKeys.has("repro_steps") || resolvedOptions.reproSteps === undefined
|
|
1471
|
-
? undefined
|
|
1472
|
-
: parseOptionalString(resolvedOptions.reproSteps);
|
|
1473
|
-
const resolution = unsetTargets.frontMatterKeys.has("resolution") || resolvedOptions.resolution === undefined
|
|
1474
|
-
? undefined
|
|
1475
|
-
: parseOptionalString(resolvedOptions.resolution);
|
|
1476
|
-
const expectedResult = unsetTargets.frontMatterKeys.has("expected_result") || resolvedOptions.expectedResult === undefined
|
|
1477
|
-
? undefined
|
|
1478
|
-
: parseOptionalString(resolvedOptions.expectedResult);
|
|
1479
|
-
const actualResult = unsetTargets.frontMatterKeys.has("actual_result") || resolvedOptions.actualResult === undefined
|
|
1480
|
-
? undefined
|
|
1481
|
-
: parseOptionalString(resolvedOptions.actualResult);
|
|
1482
|
-
const affectedVersion = unsetTargets.frontMatterKeys.has("affected_version") || resolvedOptions.affectedVersion === undefined
|
|
1483
|
-
? undefined
|
|
1484
|
-
: parseOptionalString(resolvedOptions.affectedVersion);
|
|
1485
|
-
const fixedVersion = unsetTargets.frontMatterKeys.has("fixed_version") || resolvedOptions.fixedVersion === undefined
|
|
1486
|
-
? undefined
|
|
1487
|
-
: parseOptionalString(resolvedOptions.fixedVersion);
|
|
1488
|
-
const component = unsetTargets.frontMatterKeys.has("component") || resolvedOptions.component === undefined
|
|
1489
|
-
? undefined
|
|
1490
|
-
: parseOptionalString(resolvedOptions.component);
|
|
1491
|
-
const regressionRaw = unsetTargets.frontMatterKeys.has("regression") || resolvedOptions.regression === undefined
|
|
1492
|
-
? undefined
|
|
1493
|
-
: parseOptionalString(resolvedOptions.regression);
|
|
1494
|
-
const regression = regressionRaw !== undefined ? parseRegressionInput(regressionRaw) : undefined;
|
|
1495
|
-
const customerImpact = unsetTargets.frontMatterKeys.has("customer_impact") || resolvedOptions.customerImpact === undefined
|
|
1496
|
-
? undefined
|
|
1497
|
-
: parseOptionalString(resolvedOptions.customerImpact);
|
|
1418
|
+
const parentValidation = await validateCreateParentReference(pmRoot, settings, typeRegistry, parent, parentReferencePolicy);
|
|
1419
|
+
parent = parentValidation.parent;
|
|
1420
|
+
validationWarnings.push(...parentValidation.warnings);
|
|
1421
|
+
}
|
|
1422
|
+
const sprintResolved = resolveCreateSprintOrRelease(unsetKeys, "sprint", resolvedOptions.sprint, "sprint", sprintReleasePolicy);
|
|
1423
|
+
const sprint = sprintResolved.value;
|
|
1424
|
+
validationWarnings.push(...sprintResolved.warnings);
|
|
1425
|
+
const releaseResolved = resolveCreateSprintOrRelease(unsetKeys, "release", resolvedOptions.release, "release", sprintReleasePolicy);
|
|
1426
|
+
const release = releaseResolved.value;
|
|
1427
|
+
validationWarnings.push(...releaseResolved.warnings);
|
|
1428
|
+
const blockedBy = resolveUnsettableOptionalString(unsetKeys, "blocked_by", resolvedOptions.blockedBy);
|
|
1429
|
+
const blockedByResolution = await resolveCreateBlockedByDependency({
|
|
1430
|
+
pmRoot,
|
|
1431
|
+
settings,
|
|
1432
|
+
typeRegistry,
|
|
1433
|
+
statusRegistry,
|
|
1434
|
+
blockedBy,
|
|
1435
|
+
dependencyValues: dependencies.values,
|
|
1436
|
+
status,
|
|
1437
|
+
statusExplicit: resolvedOptions.status !== undefined,
|
|
1438
|
+
nowValue,
|
|
1439
|
+
author,
|
|
1440
|
+
});
|
|
1441
|
+
const dependencyValues = blockedByResolution.dependencyValues;
|
|
1442
|
+
status = blockedByResolution.status;
|
|
1443
|
+
const blockedReason = resolveUnsettableOptionalString(unsetKeys, "blocked_reason", resolvedOptions.blockedReason);
|
|
1444
|
+
const unblockNote = resolveUnsettableOptionalString(unsetKeys, "unblock_note", resolvedOptions.unblockNote);
|
|
1445
|
+
const reporter = resolveUnsettableOptionalString(unsetKeys, "reporter", resolvedOptions.reporter);
|
|
1446
|
+
const severity = resolveUnsettableTransformed(unsetKeys, "severity", resolvedOptions.severity, (raw) => ensureEnumValue(normalizeSeverityInput(raw), ISSUE_SEVERITY_VALUES, "severity"));
|
|
1447
|
+
const environment = resolveUnsettableOptionalString(unsetKeys, "environment", resolvedOptions.environment);
|
|
1448
|
+
const reproSteps = resolveUnsettableOptionalString(unsetKeys, "repro_steps", resolvedOptions.reproSteps);
|
|
1449
|
+
const resolution = resolveUnsettableOptionalString(unsetKeys, "resolution", resolvedOptions.resolution);
|
|
1450
|
+
const expectedResult = resolveUnsettableOptionalString(unsetKeys, "expected_result", resolvedOptions.expectedResult);
|
|
1451
|
+
const actualResult = resolveUnsettableOptionalString(unsetKeys, "actual_result", resolvedOptions.actualResult);
|
|
1452
|
+
const affectedVersion = resolveUnsettableOptionalString(unsetKeys, "affected_version", resolvedOptions.affectedVersion);
|
|
1453
|
+
const fixedVersion = resolveUnsettableOptionalString(unsetKeys, "fixed_version", resolvedOptions.fixedVersion);
|
|
1454
|
+
const component = resolveUnsettableOptionalString(unsetKeys, "component", resolvedOptions.component);
|
|
1455
|
+
const regression = resolveUnsettableTransformed(unsetKeys, "regression", resolvedOptions.regression, (raw) => parseRegressionInput(raw));
|
|
1456
|
+
const customerImpact = resolveUnsettableOptionalString(unsetKeys, "customer_impact", resolvedOptions.customerImpact);
|
|
1498
1457
|
const title = requireStringOption(resolvedOptions.title, "--title");
|
|
1499
1458
|
const description = resolvedOptions.description ?? "";
|
|
1500
1459
|
const body = resolvedOptions.body ?? "";
|
|
1501
1460
|
// GH-249: creating an item directly in the close status must honor
|
|
1502
1461
|
// governance.require_close_reason, just like `pm close` (errors when missing)
|
|
1503
|
-
// and `pm update --status closed` (defaults + warns).
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
if (status === statusRegistry.close_status && settings.governance.require_close_reason) {
|
|
1508
|
-
const messageText = typeof resolvedOptions.message === "string" ? resolvedOptions.message.trim() : "";
|
|
1509
|
-
const resolutionText = typeof resolution === "string" ? resolution.trim() : "";
|
|
1510
|
-
closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;
|
|
1511
|
-
if (messageText.length === 0 && resolutionText.length === 0) {
|
|
1512
|
-
validationWarnings.push("close_reason_defaulted");
|
|
1513
|
-
}
|
|
1514
|
-
}
|
|
1462
|
+
// and `pm update --status closed` (defaults + warns).
|
|
1463
|
+
const closeReasonResolution = resolveCreateCloseReason(status, statusRegistry, settings, resolvedOptions, resolution);
|
|
1464
|
+
const closeReason = closeReasonResolution.closeReason;
|
|
1465
|
+
validationWarnings.push(...closeReasonResolution.warnings);
|
|
1515
1466
|
const frontMatter = normalizeFrontMatter({
|
|
1516
1467
|
id,
|
|
1517
1468
|
title,
|
|
@@ -1568,9 +1519,7 @@ export async function runCreate(options, global) {
|
|
|
1568
1519
|
reminders: reminders.values,
|
|
1569
1520
|
events: events.values,
|
|
1570
1521
|
...registeredItemFieldValues,
|
|
1571
|
-
|
|
1572
|
-
...(runtimeCreateFieldValues.values ?? {}),
|
|
1573
|
-
/* c8 ignore stop */
|
|
1522
|
+
...runtimeCreateFieldValues.values,
|
|
1574
1523
|
});
|
|
1575
1524
|
try {
|
|
1576
1525
|
applyRegisteredItemFieldDefaultsAndValidation(frontMatter, extensionRegistrations);
|
|
@@ -1588,9 +1537,6 @@ export async function runCreate(options, global) {
|
|
|
1588
1537
|
metadata: {},
|
|
1589
1538
|
body: "",
|
|
1590
1539
|
};
|
|
1591
|
-
const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
|
|
1592
|
-
const historyPath = getHistoryPath(pmRoot, id);
|
|
1593
|
-
const lockRelease = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author, false, settings.governance.force_required_for_stale_lock);
|
|
1594
1540
|
const explicitUnsetKeys = [...explicitUnsets].sort((left, right) => left.localeCompare(right));
|
|
1595
1541
|
const historyMessage = buildHistoryMessage(resolvedOptions.message, explicitUnsetKeys);
|
|
1596
1542
|
const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys, [
|
|
@@ -1599,62 +1545,20 @@ export async function runCreate(options, global) {
|
|
|
1599
1545
|
...Object.keys(runtimeCreateFieldValues.values ?? {}),
|
|
1600
1546
|
/* c8 ignore stop */
|
|
1601
1547
|
]);
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
message: historyMessage,
|
|
1617
|
-
});
|
|
1618
|
-
await appendHistoryEntry(historyPath, entry);
|
|
1619
|
-
}
|
|
1620
|
-
catch (error) {
|
|
1621
|
-
await removeFileIfExists(itemPath);
|
|
1622
|
-
throw error;
|
|
1623
|
-
}
|
|
1624
|
-
hookWarnings = [
|
|
1625
|
-
...(await runActiveOnWriteHooks({
|
|
1626
|
-
path: itemPath,
|
|
1627
|
-
scope: "project",
|
|
1628
|
-
op: "create",
|
|
1629
|
-
item_id: afterDocument.metadata.id,
|
|
1630
|
-
item_type: afterDocument.metadata.type,
|
|
1631
|
-
before: beforeDocument,
|
|
1632
|
-
after: afterDocument,
|
|
1633
|
-
changed_fields: changedFields,
|
|
1634
|
-
})),
|
|
1635
|
-
...(await runActiveOnWriteHooks({
|
|
1636
|
-
path: historyPath,
|
|
1637
|
-
scope: "project",
|
|
1638
|
-
op: "create:history",
|
|
1639
|
-
item_id: afterDocument.metadata.id,
|
|
1640
|
-
item_type: afterDocument.metadata.type,
|
|
1641
|
-
before: beforeDocument,
|
|
1642
|
-
after: afterDocument,
|
|
1643
|
-
changed_fields: changedFields,
|
|
1644
|
-
})),
|
|
1645
|
-
];
|
|
1646
|
-
recordAfterCommandAffectedItem({
|
|
1647
|
-
id: afterDocument.metadata.id,
|
|
1648
|
-
op: "create",
|
|
1649
|
-
item_type: afterDocument.metadata.type,
|
|
1650
|
-
status: afterDocument.metadata.status,
|
|
1651
|
-
current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),
|
|
1652
|
-
changed_fields: changedFields,
|
|
1653
|
-
});
|
|
1654
|
-
}
|
|
1655
|
-
finally {
|
|
1656
|
-
await lockRelease();
|
|
1657
|
-
}
|
|
1548
|
+
const hookWarnings = await writeCreatedItem({
|
|
1549
|
+
pmRoot,
|
|
1550
|
+
type,
|
|
1551
|
+
id,
|
|
1552
|
+
settings,
|
|
1553
|
+
typeRegistry,
|
|
1554
|
+
author,
|
|
1555
|
+
extensionFieldNames,
|
|
1556
|
+
afterDocument,
|
|
1557
|
+
beforeDocument,
|
|
1558
|
+
historyMessage,
|
|
1559
|
+
changedFields,
|
|
1560
|
+
nowValue,
|
|
1561
|
+
});
|
|
1658
1562
|
const outputItem = structuredClone(frontMatter);
|
|
1659
1563
|
// GH-216: nudge agents toward the underutilized in_progress state instead of
|
|
1660
1564
|
// jumping open -> closed. Only surfaces for workable types created in the open
|
|
@@ -1665,7 +1569,7 @@ export async function runCreate(options, global) {
|
|
|
1665
1569
|
// calendar`. The structured `calendar_item_without_schedule:*` warning above is what
|
|
1666
1570
|
// automation reads; this stderr line is the human/agent-facing version with a
|
|
1667
1571
|
// copy-pasteable `pm update` recipe.
|
|
1668
|
-
if (
|
|
1572
|
+
if (createItemLacksSchedule(type, deadline, reminders.values, events.values)) {
|
|
1669
1573
|
printError(`[pm] warning: ${type} '${id}' has no deadline/reminder/event — it will not appear on the calendar. Add one via 'pm update ${id} --deadline <ISO>' or 'pm update ${id} --event "start=<ISO>,end=<ISO>"'.`);
|
|
1670
1574
|
}
|
|
1671
1575
|
return {
|
|
@@ -1693,8 +1597,8 @@ export const _testOnlyCreateCommand = {
|
|
|
1693
1597
|
parseCreateUnsetTargets,
|
|
1694
1598
|
requireStringOption,
|
|
1695
1599
|
readTemplateOptionsFromRuntimeResult,
|
|
1696
|
-
resolveRuntimeCreateUnsetDefinition,
|
|
1600
|
+
resolveRuntimeCreateUnsetDefinition: (token, registry) => resolveRuntimeUnsetFieldDefinition(token, "create", registry),
|
|
1697
1601
|
typeOptionExampleValue,
|
|
1698
1602
|
};
|
|
1699
1603
|
//# sourceMappingURL=create.js.map
|
|
1700
|
-
//# debugId=
|
|
1604
|
+
//# debugId=39253884-2bdf-54e5-9cf2-6ac279638287
|