@unbrained/pm-cli 2026.6.30 → 2026.7.2
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 +26 -0
- package/dist/cli/bootstrap-args.js +89 -79
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.d.ts +2 -0
- package/dist/cli/commander-usage.js +58 -47
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/aggregate.js +102 -79
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/calendar.js +339 -303
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +89 -68
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +157 -129
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +50 -42
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/config.d.ts +2 -0
- package/dist/cli/commands/config.js +443 -879
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +365 -287
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.js +352 -238
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +483 -434
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +46 -39
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/dedupe-merge.js +88 -69
- package/dist/cli/commands/dedupe-merge.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/doctor.js +129 -78
- package/dist/cli/commands/extension/doctor.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 +7 -0
- package/dist/cli/commands/extension/scaffold.js +214 -186
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +6 -1
- package/dist/cli/commands/extension.js +1034 -902
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/get.js +114 -81
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +17 -0
- package/dist/cli/commands/health.js +446 -307
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +209 -140
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.js +162 -119
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +120 -85
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/init.d.ts +8 -2
- package/dist/cli/commands/init.js +263 -162
- package/dist/cli/commands/init.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.js +152 -102
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.js +49 -32
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/plan.js +373 -298
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.js +43 -25
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +21 -5
- package/dist/cli/commands/reindex.js +345 -205
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +8 -7
- package/dist/cli/commands/restore.js +105 -69
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.js +33 -30
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +10 -2
- package/dist/cli/commands/search.js +595 -536
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/telemetry.js +98 -87
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/test-all.js +237 -168
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -5
- package/dist/cli/commands/test.js +530 -464
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +57 -42
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +1 -1
- package/dist/cli/commands/update.js +764 -747
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +18 -1
- package/dist/cli/commands/validate.js +466 -343
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +399 -357
- package/dist/cli/error-guidance.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/main.d.ts +47 -0
- package/dist/cli/main.js +428 -341
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.js +22 -45
- package/dist/cli/migration-gates.js.map +1 -1
- package/dist/cli/register-list-query.js +94 -105
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +400 -416
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +86 -66
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +120 -101
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +117 -122
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-MVSEND6D.js → activity-CUC4JY3U.js} +9 -9
- package/dist/cli-bundle/chunks/activity-WEIEMM73.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-MOC4TR2G.js → aggregate-DKUTRY6R.js} +109 -85
- package/dist/cli-bundle/chunks/aggregate-DKUTRY6R.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js → aggregate-SW5PNGCS.js} +108 -84
- package/dist/cli-bundle/chunks/{aggregate-XJHLZQ5X.js.map → aggregate-SW5PNGCS.js.map} +2 -2
- package/dist/cli-bundle/chunks/{append-KDHT4GHI.js → append-H32VOR2Y.js} +6 -6
- package/dist/cli-bundle/chunks/{append-LEDBAM3K.js → append-UBM632FK.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-Z55WX4IQ.js → chunk-2227673O.js} +158 -114
- package/dist/cli-bundle/chunks/chunk-2227673O.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js → chunk-2ASNV4DH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js → chunk-2CHRYUXL.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QE5UFCCO.js → chunk-2KWL5NPW.js} +42 -27
- package/dist/cli-bundle/chunks/chunk-2KWL5NPW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZEATCVAC.js → chunk-36UGKF4O.js} +21 -29
- package/dist/cli-bundle/chunks/chunk-36UGKF4O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JZG5ADVE.js → chunk-3AZUFQK6.js} +1103 -963
- package/dist/cli-bundle/chunks/chunk-3AZUFQK6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DRPF274X.js → chunk-3LCUASYG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js → chunk-3Q2HBMTI.js} +2 -2
- 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-GF7EAR22.js → chunk-4NUOWFBT.js} +109 -72
- package/dist/cli-bundle/chunks/chunk-4NUOWFBT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js → chunk-55XRYWEG.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-5IRVSKPS.js → chunk-5GVTFFTC.js} +150 -224
- package/dist/cli-bundle/chunks/chunk-5GVTFFTC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-CHRNYKNI.js → chunk-5PGBHRY3.js} +41 -26
- package/dist/cli-bundle/chunks/chunk-5PGBHRY3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-53ARXF2O.js → chunk-66Z3X7ZG.js} +261 -161
- package/dist/cli-bundle/chunks/chunk-66Z3X7ZG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-A3UNLXNJ.js → chunk-6ITZLD4T.js} +738 -688
- package/dist/cli-bundle/chunks/chunk-6ITZLD4T.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JTRKME24.js → chunk-6YCYF2AI.js} +262 -162
- package/dist/cli-bundle/chunks/chunk-6YCYF2AI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RM6MHL6A.js → chunk-6ZMBJRDJ.js} +580 -467
- package/dist/cli-bundle/chunks/chunk-6ZMBJRDJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-RPRW26NG.js → chunk-7MYWF4ZX.js} +110 -73
- package/dist/cli-bundle/chunks/chunk-7MYWF4ZX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SNUK7H5J.js → chunk-7NSPKJUS.js} +716 -606
- package/dist/cli-bundle/chunks/chunk-7NSPKJUS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KYDYQMNW.js → chunk-7TH5NMVB.js} +95 -53
- package/dist/cli-bundle/chunks/chunk-7TH5NMVB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VD3LKZFX.js → chunk-7W4H4K26.js} +739 -689
- package/dist/cli-bundle/chunks/chunk-7W4H4K26.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js → chunk-A6VOGKBA.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js → chunk-AIAIXG7I.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NIBP3I7A.js → chunk-AJEBCRIY.js} +128 -126
- package/dist/cli-bundle/chunks/chunk-AJEBCRIY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js → chunk-B4O5S7I3.js} +79 -57
- package/dist/cli-bundle/chunks/{chunk-VZDBVEZR.js.map → chunk-B4O5S7I3.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js → chunk-BTX5MIQF.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js +809 -0
- package/dist/cli-bundle/chunks/chunk-BVZZN2LH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js → chunk-CYBDUHNO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js → chunk-CZPVDLD2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FDEVKXC4.js → chunk-EMPGXBUF.js} +22 -30
- package/dist/cli-bundle/chunks/chunk-EMPGXBUF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js → chunk-EUKTMRN3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js → chunk-FFOQHGNH.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js → chunk-GFMSLORL.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-IZQOJR2B.js → chunk-GRRG3MCT.js} +198 -189
- package/dist/cli-bundle/chunks/chunk-GRRG3MCT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js → chunk-H4GRLYJS.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js → chunk-HQTPRV4D.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-CY5IJMUM.js → chunk-I66WE2HE.js} +712 -602
- package/dist/cli-bundle/chunks/chunk-I66WE2HE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZFIEEDTJ.js → chunk-IEEJQCZ4.js} +509 -363
- package/dist/cli-bundle/chunks/chunk-IEEJQCZ4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DU66JUGT.js → chunk-IG5JYZGU.js} +488 -420
- package/dist/cli-bundle/chunks/chunk-IG5JYZGU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js → chunk-JMK5GCK2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js → chunk-JXAUVO6X.js} +258 -169
- package/dist/cli-bundle/chunks/{chunk-LBH7UYKY.js.map → chunk-JXAUVO6X.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js → chunk-K2VYLVX4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js → chunk-KCO2EAN5.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-T7ZMQI4J.js → chunk-KIYCOJ63.js} +198 -189
- package/dist/cli-bundle/chunks/chunk-KIYCOJ63.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js → chunk-KLXF7NCC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3KLX7U7.js → chunk-KN3URLKS.js} +510 -364
- package/dist/cli-bundle/chunks/chunk-KN3URLKS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js → chunk-LRKMWUUV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js → chunk-LTRAF2D7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5T6WPLRO.js → chunk-MNBPX5JS.js} +394 -354
- package/dist/cli-bundle/chunks/chunk-MNBPX5JS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js → chunk-MRD4T5LF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js → chunk-N2JSWVWG.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7WDETKGP.js → chunk-N3QCJS4M.js} +1105 -965
- package/dist/cli-bundle/chunks/chunk-N3QCJS4M.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KGQ3W65B.js → chunk-NRZS637N.js} +258 -169
- package/dist/cli-bundle/chunks/chunk-NRZS637N.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js +799 -0
- package/dist/cli-bundle/chunks/chunk-OTUJZKGI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZIE6WXJ2.js → chunk-Q6K2OACU.js} +153 -90
- package/dist/cli-bundle/chunks/chunk-Q6K2OACU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-K46GQ265.js → chunk-Q6NXOHS6.js} +489 -421
- package/dist/cli-bundle/chunks/chunk-Q6NXOHS6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js → chunk-QH3FSKRJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UB3V5WUI.js → chunk-RM37OPYK.js} +394 -354
- package/dist/cli-bundle/chunks/chunk-RM37OPYK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js → chunk-S62UANU7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NO6Y6FB2.js → chunk-SPM2XLWI.js} +37 -28
- package/dist/cli-bundle/chunks/chunk-SPM2XLWI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DORJSBGJ.js → chunk-SYNKD3ZG.js} +127 -125
- package/dist/cli-bundle/chunks/chunk-SYNKD3ZG.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6YRAMXRS.js → chunk-SYVUU7EK.js} +581 -468
- package/dist/cli-bundle/chunks/chunk-SYVUU7EK.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D5LYZVGB.js → chunk-TPOFWBMY.js} +95 -53
- package/dist/cli-bundle/chunks/chunk-TPOFWBMY.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IHXXUIXS.js → chunk-TTHCEV5Q.js} +92 -77
- package/dist/cli-bundle/chunks/chunk-TTHCEV5Q.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js → chunk-U2BEEM2X.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-Z5BM2FKQ.js → chunk-UGLU6Q2I.js} +91 -76
- package/dist/cli-bundle/chunks/chunk-UGLU6Q2I.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js → chunk-UT73HUPC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js → chunk-UTSH5GWX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-AWN4PPH5.js → chunk-UWKEJMZU.js} +157 -113
- package/dist/cli-bundle/chunks/chunk-UWKEJMZU.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-KTMMTOIP.js → chunk-W47SML5B.js} +152 -89
- package/dist/cli-bundle/chunks/chunk-W47SML5B.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UFKNF23C.js → chunk-WJAMWAHZ.js} +157 -118
- package/dist/cli-bundle/chunks/chunk-WJAMWAHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HIBK6H4S.js → chunk-XCHUVHKU.js} +685 -544
- package/dist/cli-bundle/chunks/chunk-XCHUVHKU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-DJDXAU74.js → chunk-XEWQKDYZ.js} +685 -544
- package/dist/cli-bundle/chunks/chunk-XEWQKDYZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-BOWQWXLI.js → chunk-XTHQWXVC.js} +158 -119
- package/dist/cli-bundle/chunks/chunk-XTHQWXVC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6T5ZIWBS.js → chunk-XWGEMNBR.js} +150 -224
- package/dist/cli-bundle/chunks/chunk-XWGEMNBR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js → chunk-Y4NRKBFW.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WTRUDJ3R.js → chunk-YLZZ6T54.js} +38 -29
- package/dist/cli-bundle/chunks/chunk-YLZZ6T54.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js → chunk-YPKFV2JR.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js → chunk-Z4DGFQDH.js} +80 -58
- package/dist/cli-bundle/chunks/{chunk-OKQ22KTH.js.map → chunk-Z4DGFQDH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js → chunk-ZNHEYCDD.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js → chunk-ZNT7KEWE.js} +2 -2
- package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js → claim-SENTPZBN.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-6NINZYB3.js → claim-Z7MEQCBT.js} +8 -8
- package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js → close-424MX4CU.js} +7 -7
- package/dist/cli-bundle/chunks/close-YCWQQPDS.js +14 -0
- package/dist/cli-bundle/chunks/{close-many-CXJBOWWY.js → close-many-2IV4J2TR.js} +103 -82
- package/dist/cli-bundle/chunks/close-many-2IV4J2TR.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-BFMP6HHK.js → close-many-SWY34BII.js} +102 -81
- package/dist/cli-bundle/chunks/close-many-SWY34BII.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-ETHABIY6.js → comments-4FGNTSNV.js} +8 -8
- package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js → comments-7YS5MY5X.js} +8 -8
- package/dist/cli-bundle/chunks/config-BZJKK7FZ.js +1062 -0
- package/dist/cli-bundle/chunks/config-BZJKK7FZ.js.map +1 -0
- package/dist/cli-bundle/chunks/config-G74GISC4.js +1072 -0
- package/dist/cli-bundle/chunks/config-G74GISC4.js.map +7 -0
- package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js → context-LHVKJSPJ.js} +12 -12
- package/dist/cli-bundle/chunks/{context-XDI4DKKT.js → context-ZQY54JNS.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-SMOAN5NF.js → contracts-CP2EZJC7.js} +320 -199
- package/dist/cli-bundle/chunks/contracts-CP2EZJC7.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-KP4QAGVW.js → contracts-FIZLMP7O.js} +321 -200
- package/dist/cli-bundle/chunks/contracts-FIZLMP7O.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js → copy-GYNQQPW2.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js → copy-TLW7JTQT.js} +5 -5
- package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js → create-VSKYSOCD.js} +12 -12
- package/dist/cli-bundle/chunks/create-XTMAPS7I.js +28 -0
- package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js → delete-4W5JYCEG.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js → delete-ANTOTI2I.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js → deps-HPPE6MJN.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js → deps-ZQZN54EZ.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js → docs-RPOVFMP3.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-2TIFR62T.js → docs-XJNYBJGE.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js → eval-DM6JBZTS.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js → eval-RFBI5FGS.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js → extension-B3YY4WY5.js} +11 -10
- package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js → extension-TTSEFQTS.js} +11 -10
- package/dist/cli-bundle/chunks/{files-DF3HO6XK.js → files-5D65CHGE.js} +7 -7
- package/dist/cli-bundle/chunks/{files-T5ODMETM.js → files-GPIG77EN.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js → focus-C3PEJV2C.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js → focus-ZHN7WIGX.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js → gc-D4JQ6OWN.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-FULIVYR4.js → gc-VZIXDL32.js} +3 -3
- package/dist/cli-bundle/chunks/{get-VYPIICPC.js → get-GIBRUUOP.js} +121 -81
- package/dist/cli-bundle/chunks/get-GIBRUUOP.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-AWK324RS.js → get-IOVAN6RU.js} +120 -80
- package/dist/cli-bundle/chunks/get-IOVAN6RU.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-Q66C43GN.js → health-L2U3AFKV.js} +437 -264
- package/dist/cli-bundle/chunks/health-L2U3AFKV.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-FBCVZGSX.js → health-MM7AWXYF.js} +436 -263
- package/dist/cli-bundle/chunks/health-MM7AWXYF.js.map +7 -0
- package/dist/cli-bundle/chunks/history-DD7L7BNL.js +18 -0
- package/dist/cli-bundle/chunks/{history-X4OSES6K.js → history-IL7XCEX2.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-2GHT32UX.js → history-compact-HALOTOU7.js} +214 -135
- package/dist/cli-bundle/chunks/history-compact-HALOTOU7.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-compact-WLCQEKXS.js → history-compact-MV25P7DM.js} +213 -134
- package/dist/cli-bundle/chunks/history-compact-MV25P7DM.js.map +7 -0
- package/dist/cli-bundle/chunks/history-redact-IX4YEWMY.js +19 -0
- package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js → history-redact-VYCWQFK7.js} +9 -9
- package/dist/cli-bundle/chunks/{history-repair-FY75IC26.js → history-repair-44MODPQF.js} +124 -84
- package/dist/cli-bundle/chunks/history-repair-44MODPQF.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-GABSDSVD.js → history-repair-CPNAOCNF.js} +123 -83
- package/dist/cli-bundle/chunks/history-repair-CPNAOCNF.js.map +7 -0
- package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js → init-F27NHENZ.js} +12 -11
- package/dist/cli-bundle/chunks/init-HHVQQP6C.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js → learnings-HJVDQIGY.js} +8 -8
- package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js → learnings-XSFSUUWK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js → list-HPMEKCAA.js} +8 -8
- package/dist/cli-bundle/chunks/{list-ROT7JF62.js → list-VMPWTURB.js} +8 -8
- package/dist/cli-bundle/chunks/{next-66BJB4N2.js → next-ETXF2ZCN.js} +59 -37
- package/dist/cli-bundle/chunks/next-ETXF2ZCN.js.map +7 -0
- package/dist/cli-bundle/chunks/{next-N5MWJTBY.js → next-QM6YJIIS.js} +60 -38
- package/dist/cli-bundle/chunks/next-QM6YJIIS.js.map +1 -0
- package/dist/cli-bundle/chunks/{notes-FW6YFLND.js → notes-GDZIKGR6.js} +8 -8
- package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js → notes-WDDBPC4D.js} +8 -8
- package/dist/cli-bundle/chunks/{plan-ZHKZ7JVF.js → plan-BGDR73Z6.js} +373 -279
- package/dist/cli-bundle/chunks/plan-BGDR73Z6.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-DQ7G4EDC.js → plan-C5IMM335.js} +372 -278
- package/dist/cli-bundle/chunks/plan-C5IMM335.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js → profile-CCOKZ2IQ.js} +9 -9
- package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js → profile-HUCENIEQ.js} +9 -9
- package/dist/cli-bundle/chunks/{register-list-query-Y2VRHPCL.js → register-list-query-ROSNIL52.js} +80 -83
- package/dist/cli-bundle/chunks/register-list-query-ROSNIL52.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-KY6Z6WV7.js → register-list-query-XN4ZRHSV.js} +79 -82
- package/dist/cli-bundle/chunks/register-list-query-XN4ZRHSV.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-PCARIGZS.js → register-mutation-CFSB2MS3.js} +406 -385
- package/dist/cli-bundle/chunks/register-mutation-CFSB2MS3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-N6AYSKPM.js → register-mutation-KRLAHEL2.js} +405 -384
- package/dist/cli-bundle/chunks/register-mutation-KRLAHEL2.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-L6CYTOIH.js → register-operations-4PASGJDB.js} +112 -93
- package/dist/cli-bundle/chunks/register-operations-4PASGJDB.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-YAT6FUUB.js → register-operations-MBN4KGUM.js} +113 -94
- package/dist/cli-bundle/chunks/register-operations-MBN4KGUM.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-N7UGXYJC.js → register-setup-VIAWYFP5.js} +129 -104
- package/dist/cli-bundle/chunks/register-setup-VIAWYFP5.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-MPANILQF.js → register-setup-ZCGKHDKL.js} +128 -103
- package/dist/cli-bundle/chunks/register-setup-ZCGKHDKL.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js → restore-4CBWUMCX.js} +9 -9
- package/dist/cli-bundle/chunks/restore-5UEAGG3W.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js → scheduling-shortcuts-6VFKNKCM.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js → scheduling-shortcuts-ERHCVTEM.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js → schema-TDGK6N3I.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js → schema-UE5KKAUX.js} +7 -7
- package/dist/cli-bundle/chunks/{search-KP6H7COV.js → search-FP7MEU4S.js} +10 -10
- package/dist/cli-bundle/chunks/{search-CX5UMV4H.js → search-K4CFLQ5S.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js → stats-NJJCALEZ.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js → stats-XT6QRKQY.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-DIFPXCAT.js → telemetry-5SQ5UDXC.js} +84 -70
- package/dist/cli-bundle/chunks/telemetry-5SQ5UDXC.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-WTYFUPRL.js → telemetry-HVXFZA2U.js} +85 -71
- package/dist/cli-bundle/chunks/telemetry-HVXFZA2U.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-QNDXZQCW.js → test-UFSJ5YIO.js} +15 -14
- package/dist/cli-bundle/chunks/{test-HU2BS7EY.js → test-YCDAUBWF.js} +15 -14
- package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js +427 -0
- package/dist/cli-bundle/chunks/test-all-2BWKY3GQ.js.map +1 -0
- package/dist/cli-bundle/chunks/test-all-PM7UYN42.js +430 -0
- package/dist/cli-bundle/chunks/test-all-PM7UYN42.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-runs-CA6K32RD.js → test-runs-FK5E75AA.js} +185 -147
- package/dist/cli-bundle/chunks/test-runs-FK5E75AA.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-LANLLPVO.js → test-runs-H4TGWGRN.js} +184 -146
- package/dist/cli-bundle/chunks/test-runs-H4TGWGRN.js.map +7 -0
- package/dist/cli-bundle/chunks/update-MTCFES6X.js +24 -0
- package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js → update-Y5WQVT5O.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js → update-many-6YAYYRLE.js} +83 -68
- package/dist/cli-bundle/chunks/{update-many-LU3SCNK5.js.map → update-many-6YAYYRLE.js.map} +2 -2
- package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js → update-many-JTKKSA7Y.js} +84 -69
- package/dist/cli-bundle/chunks/{update-many-VW5DGF3S.js.map → update-many-JTKKSA7Y.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js → upgrade-DTAHZ236.js} +11 -10
- package/dist/cli-bundle/chunks/{upgrade-ICXY244R.js.map → upgrade-DTAHZ236.js.map} +1 -1
- package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js → upgrade-JUDU7YL4.js} +13 -12
- package/dist/cli-bundle/chunks/{upgrade-77FRUAXN.js.map → upgrade-JUDU7YL4.js.map} +1 -1
- package/dist/cli-bundle/chunks/{validate-2G566PKQ.js → validate-732RWS5W.js} +440 -319
- package/dist/cli-bundle/chunks/validate-732RWS5W.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-BDPVXHHH.js → validate-W7H5TEDC.js} +441 -320
- package/dist/cli-bundle/chunks/validate-W7H5TEDC.js.map +1 -0
- package/dist/cli-bundle/main.js +986 -1500
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/core/config/nested-settings.js +89 -67
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/extensions/activation-summary-markdown.js +23 -12
- package/dist/core/extensions/activation-summary-markdown.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/loader.js +310 -232
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/governance/metadata-coverage.js +20 -28
- package/dist/core/governance/metadata-coverage.js.map +1 -1
- package/dist/core/history/drift-scan.js +93 -81
- package/dist/core/history/drift-scan.js.map +1 -1
- package/dist/core/item/item-format.js +523 -410
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.js +14 -14
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/type-registry.js +87 -82
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/output/mutation-projection.js +42 -26
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/schema/runtime-schema.js +34 -28
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +64 -37
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +32 -17
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.js +31 -28
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.js +54 -43
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +239 -153
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.js +33 -26
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings.js +247 -203
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/test/background-runs.js +189 -160
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/mcp/server.js +387 -367
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/flag-contracts.js +111 -180
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +76 -45
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/compose.d.ts +4 -1
- package/dist/sdk/compose.js +181 -115
- package/dist/sdk/compose.js.map +1 -1
- package/docs/RELEASING.md +2 -3
- package/package.json +2 -2
- package/packages/pm-beads/extensions/beads/runtime.ts +240 -167
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +65 -58
- package/packages/pm-todos/extensions/todos/runtime.ts +65 -42
- package/dist/cli-bundle/chunks/activity-EJBMXUBH.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-MOC4TR2G.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-53ARXF2O.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5IRVSKPS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5T6WPLRO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6T5ZIWBS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6YRAMXRS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7WDETKGP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-A3UNLXNJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AWN4PPH5.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BOWQWXLI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js +0 -115
- package/dist/cli-bundle/chunks/chunk-C2KCIZKZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CHRNYKNI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CY5IJMUM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-D5LYZVGB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DJDXAU74.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DORJSBGJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DU66JUGT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js +0 -118
- package/dist/cli-bundle/chunks/chunk-F6VH3LFC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FDEVKXC4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GF7EAR22.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HIBK6H4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IHXXUIXS.js.map +0 -1
- 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-IZQOJR2B.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JTRKME24.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JZG5ADVE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-K46GQ265.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KGQ3W65B.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KTMMTOIP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KYDYQMNW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NIBP3I7A.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NO6Y6FB2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QE5UFCCO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RM6MHL6A.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RPRW26NG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SNUK7H5J.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T7ZMQI4J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UB3V5WUI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UFKNF23C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V3KLX7U7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VD3LKZFX.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-WTRUDJ3R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-Z55WX4IQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-Z5BM2FKQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZEATCVAC.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZFIEEDTJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZIE6WXJ2.js.map +0 -1
- package/dist/cli-bundle/chunks/close-37KEHLYM.js +0 -14
- package/dist/cli-bundle/chunks/close-many-BFMP6HHK.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-CXJBOWWY.js.map +0 -1
- package/dist/cli-bundle/chunks/config-FIXJZEQK.js +0 -1541
- package/dist/cli-bundle/chunks/config-FIXJZEQK.js.map +0 -7
- package/dist/cli-bundle/chunks/config-X3ZVCUUG.js +0 -1531
- package/dist/cli-bundle/chunks/config-X3ZVCUUG.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-KP4QAGVW.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-SMOAN5NF.js.map +0 -7
- package/dist/cli-bundle/chunks/create-DFMNBKBS.js +0 -28
- package/dist/cli-bundle/chunks/get-AWK324RS.js.map +0 -7
- package/dist/cli-bundle/chunks/get-VYPIICPC.js.map +0 -1
- package/dist/cli-bundle/chunks/health-FBCVZGSX.js.map +0 -7
- package/dist/cli-bundle/chunks/health-Q66C43GN.js.map +0 -1
- package/dist/cli-bundle/chunks/history-5XUSLAJA.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-2GHT32UX.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-WLCQEKXS.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-BVHWDXPR.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-FY75IC26.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-GABSDSVD.js.map +0 -7
- package/dist/cli-bundle/chunks/init-TRYJELH4.js +0 -21
- package/dist/cli-bundle/chunks/next-66BJB4N2.js.map +0 -7
- package/dist/cli-bundle/chunks/next-N5MWJTBY.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-DQ7G4EDC.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-ZHKZ7JVF.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-KY6Z6WV7.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-Y2VRHPCL.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-N6AYSKPM.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-PCARIGZS.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-L6CYTOIH.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-YAT6FUUB.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-MPANILQF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-N7UGXYJC.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-IRAKSWIW.js +0 -17
- package/dist/cli-bundle/chunks/telemetry-DIFPXCAT.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-WTYFUPRL.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js +0 -360
- package/dist/cli-bundle/chunks/test-all-PZTBLLQ6.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-XLPI4USF.js +0 -357
- package/dist/cli-bundle/chunks/test-all-XLPI4USF.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-CA6K32RD.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-LANLLPVO.js.map +0 -7
- package/dist/cli-bundle/chunks/update-UXDLTEOZ.js +0 -24
- package/dist/cli-bundle/chunks/validate-2G566PKQ.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-BDPVXHHH.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-MVSEND6D.js.map → activity-CUC4JY3U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-EJBMXUBH.js.map → activity-WEIEMM73.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-KDHT4GHI.js.map → append-H32VOR2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LEDBAM3K.js.map → append-UBM632FK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SJZTPVFT.js.map → chunk-2ASNV4DH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JVQ7UOYC.js.map → chunk-2CHRYUXL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRPF274X.js.map → chunk-3LCUASYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JJ4SG243.js.map → chunk-3Q2HBMTI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TQ6E76BE.js.map → chunk-55XRYWEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IBU2LLWM.js.map → chunk-A6VOGKBA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MLHX6DN5.js.map → chunk-AIAIXG7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5ABGFWR4.js.map → chunk-BTX5MIQF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3JWQCLR5.js.map → chunk-CYBDUHNO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WFJZDUM7.js.map → chunk-CZPVDLD2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HUYYMTGW.js.map → chunk-EUKTMRN3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVWYAG46.js.map → chunk-FFOQHGNH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IF4ERU6A.js.map → chunk-GFMSLORL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IDYCAK35.js.map → chunk-H4GRLYJS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VMY7MZEM.js.map → chunk-HQTPRV4D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7L6TXOOC.js.map → chunk-JMK5GCK2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KRASIL6M.js.map → chunk-K2VYLVX4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4YIMPANT.js.map → chunk-KCO2EAN5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D6USKAMA.js.map → chunk-KLXF7NCC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OB3RJV5F.js.map → chunk-LRKMWUUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-74PUWBGN.js.map → chunk-LTRAF2D7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4TXTVZL3.js.map → chunk-MRD4T5LF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E2Q2ULMR.js.map → chunk-N2JSWVWG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7RIJGN4R.js.map → chunk-QH3FSKRJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OUQ5JEFM.js.map → chunk-S62UANU7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DLDCPF5X.js.map → chunk-U2BEEM2X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-73PTKMAE.js.map → chunk-UT73HUPC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F7G53BOA.js.map → chunk-UTSH5GWX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JIP67N2K.js.map → chunk-Y4NRKBFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FBZ5XAAF.js.map → chunk-YPKFV2JR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BN3CWK6G.js.map → chunk-ZNHEYCDD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YEDFE4DC.js.map → chunk-ZNT7KEWE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-HMCLSLUE.js.map → claim-SENTPZBN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-6NINZYB3.js.map → claim-Z7MEQCBT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-OP3LK7Z2.js.map → close-424MX4CU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-37KEHLYM.js.map → close-YCWQQPDS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-ETHABIY6.js.map → comments-4FGNTSNV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-MU2WMBUY.js.map → comments-7YS5MY5X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-7ZEZV3BV.js.map → context-LHVKJSPJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-XDI4DKKT.js.map → context-ZQY54JNS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-JJ3KOQW2.js.map → copy-GYNQQPW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-CWM6SBY6.js.map → copy-TLW7JTQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-J5Q2ELZT.js.map → create-VSKYSOCD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-DFMNBKBS.js.map → create-XTMAPS7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-2GZLQEUQ.js.map → delete-4W5JYCEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-OOQS4KVD.js.map → delete-ANTOTI2I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-IF4IGL4R.js.map → deps-HPPE6MJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-ZVGGCRR6.js.map → deps-ZQZN54EZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-NFTBCQQC.js.map → docs-RPOVFMP3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-2TIFR62T.js.map → docs-XJNYBJGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-2F6EH4XN.js.map → eval-DM6JBZTS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PFKXQR3B.js.map → eval-RFBI5FGS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-GMVOIP4O.js.map → extension-B3YY4WY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-3LRYX7SW.js.map → extension-TTSEFQTS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-DF3HO6XK.js.map → files-5D65CHGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-T5ODMETM.js.map → files-GPIG77EN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-MY5ARIEK.js.map → focus-C3PEJV2C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DLXKK4AH.js.map → focus-ZHN7WIGX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-MDGRR2SU.js.map → gc-D4JQ6OWN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-FULIVYR4.js.map → gc-VZIXDL32.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-5XUSLAJA.js.map → history-DD7L7BNL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-X4OSES6K.js.map → history-IL7XCEX2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-BVHWDXPR.js.map → history-redact-IX4YEWMY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-45YW65BK.js.map → history-redact-VYCWQFK7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-KO7CGIRQ.js.map → init-F27NHENZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-TRYJELH4.js.map → init-HHVQQP6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LHZT5BHW.js.map → learnings-HJVDQIGY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-3F7YLI45.js.map → learnings-XSFSUUWK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-Y6AU5BJS.js.map → list-HPMEKCAA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-ROT7JF62.js.map → list-VMPWTURB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-FW6YFLND.js.map → notes-GDZIKGR6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-EVJZ3VAB.js.map → notes-WDDBPC4D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-CHAW6SEA.js.map → profile-CCOKZ2IQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-UPZGCDOG.js.map → profile-HUCENIEQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DKMCLPI5.js.map → restore-4CBWUMCX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-IRAKSWIW.js.map → restore-5UEAGG3W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-3F4QUEDH.js.map → scheduling-shortcuts-6VFKNKCM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-BNZLQK36.js.map → scheduling-shortcuts-ERHCVTEM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-OLT6LVKH.js.map → schema-TDGK6N3I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-XJXKJQF5.js.map → schema-UE5KKAUX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KP6H7COV.js.map → search-FP7MEU4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-CX5UMV4H.js.map → search-K4CFLQ5S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-QZUG6MX5.js.map → stats-NJJCALEZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-7XW4OEMK.js.map → stats-XT6QRKQY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-QNDXZQCW.js.map → test-UFSJ5YIO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-HU2BS7EY.js.map → test-YCDAUBWF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-UXDLTEOZ.js.map → update-MTCFES6X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-DJKWLBWJ.js.map → update-Y5WQVT5O.js.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../../core/item/priority.ts","../../../../../../../../core/item/type-synonyms.ts","../../../../../../../../cli/commands/metadata-normalizers.ts","../../../../../../../../cli/commands/legacy-none-tokens.ts","../../../../../../../../cli/commands/lifecycle-transitions.ts","../../../../../../../../cli/commands/shared-unset-fields.ts","../../../../../../../../cli/commands/recurrence-parsers.ts","../../../../../../../../cli/commands/event-validation-messages.ts","../../../../../../../../cli/commands/repeatable-metadata-parsers.ts","../../../../../../../../cli/commands/create.ts"],"sourcesContent":["/**\n * @module core/item/priority\n *\n * Defines item parsing, formatting, and lifecycle helpers for Priority.\n */\nimport { PmCliError } from \"../shared/errors.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\n\n/**\n * Restricts priority values accepted by command, SDK, and storage contracts.\n */\nexport type Priority = 0 | 1 | 2 | 3 | 4;\n\n/**\n * Canonical mapping from named priority levels to numeric values. Agents and\n * humans frequently write words (\"high\") instead of numbers, so both create and\n * update accept either form. This single map is the source of truth so the two\n * commands cannot drift apart.\n */\nexport const PRIORITY_NAME_TO_VALUE: Readonly<Record<string, Priority>> = {\n critical: 0,\n high: 1,\n medium: 2,\n low: 3,\n minimal: 4,\n};\n\nconst PRIORITY_NAME_LIST = Object.keys(PRIORITY_NAME_TO_VALUE);\n\n/**\n * Human-readable description of every accepted priority form. Reused in error\n * messages so the wording stays consistent across commands.\n */\nexport const PRIORITY_ACCEPTED_FORMS_HINT =\n \"numbers 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal) or names \" +\n `(${PRIORITY_NAME_LIST.join(\", \")}), case-insensitive`;\n\nfunction priorityUsageError(raw: string): PmCliError {\n return new PmCliError(\n `Invalid priority \"${raw}\". Accepted values: ${PRIORITY_ACCEPTED_FORMS_HINT}.`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Resolve a raw `--priority` option value to a numeric 0..4 priority.\n *\n * Accepts:\n * - numeric strings 0,1,2,3,4 (unchanged from prior behavior)\n * - named levels (critical/high/medium/low/minimal), case-insensitive\n * - native numbers 0..4 (arrives via MCP tool calls that JSON-encode priority as a number)\n *\n * Throws a USAGE error listing BOTH accepted forms for anything else.\n */\nexport function resolvePriority(raw: string | number): Priority {\n if (typeof raw === \"number\") {\n if (Number.isInteger(raw) && raw >= 0 && raw <= 4) {\n return raw as Priority;\n }\n throw priorityUsageError(String(raw));\n }\n if (typeof raw !== \"string\") {\n throw priorityUsageError(String(raw));\n }\n const trimmed = raw.trim();\n if (trimmed.length === 0) {\n throw priorityUsageError(raw);\n }\n\n const normalizedName = trimmed.toLowerCase();\n if (Object.prototype.hasOwnProperty.call(PRIORITY_NAME_TO_VALUE, normalizedName)) {\n return PRIORITY_NAME_TO_VALUE[normalizedName as keyof typeof PRIORITY_NAME_TO_VALUE];\n }\n\n // Numeric form: only exact integers 0..4 are valid. Number() would accept\n // forms like \"1.0\" or \" 2 \", but we already trimmed and require an integer\n // match so the contract stays tight.\n if (/^[0-4]$/.test(trimmed)) {\n return Number(trimmed) as Priority;\n }\n\n throw priorityUsageError(raw);\n}\n","/**\n * Common type synonyms agents type that are not item types themselves. Telemetry\n * shows real users repeatedly run e.g. `pm create Bug \"...\"` and `pm create Change\n * \"...\"` and hit a hard \"invalid type\" error. Rather than block, `create` maps an\n * unregistered type through this table to its closest canonical built-in type (and\n * prints a note). The mapping is only a FALLBACK: it applies after the real type\n * registry fails to resolve the name, and the canonical target is itself resolved\n * through the live registry — so a project that defines its own `Bug` type keeps it,\n * and a project that has removed `Issue` will simply fall through to the normal error.\n *\n * Keys are compared case-insensitively after trimming. Values are canonical built-in\n * type names (resolved through the registry, never written verbatim).\n */\nexport const TYPE_SYNONYMS: Readonly<Record<string, string>> = {\n bug: \"Issue\",\n bugfix: \"Issue\",\n defect: \"Issue\",\n incident: \"Issue\",\n enhancement: \"Feature\",\n story: \"Feature\",\n userstory: \"Feature\",\n \"user-story\": \"Feature\",\n \"user story\": \"Feature\",\n change: \"Chore\",\n ticket: \"Task\",\n todo: \"Task\",\n};\n\n/**\n * Map a free-form type token to its canonical built-in type synonym, or `undefined`\n * when there is no synonym. The caller must still confirm the canonical target exists\n * in the active type registry before using it.\n */\nexport function resolveTypeSynonym(rawType: string | undefined): string | undefined {\n if (rawType === undefined) {\n return undefined;\n }\n return TYPE_SYNONYMS[rawType.trim().toLowerCase()];\n}\n","/**\n * @module cli/commands/metadata-normalizers\n *\n * Implements the pm metadata normalizers command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { CONFIDENCE_TEXT_VALUES } from \"../../types/index.js\";\n\n/**\n * Implements normalize risk input for the public runtime surface of this module.\n */\nexport function normalizeRiskInput(value: string): string {\n const trimmed = value.trim();\n return trimmed.toLowerCase() === \"med\" ? \"medium\" : trimmed;\n}\n\n/**\n * Implements normalize severity input for the public runtime surface of this module.\n */\nexport function normalizeSeverityInput(value: string): string {\n const trimmed = value.trim();\n return trimmed.toLowerCase() === \"med\" ? \"medium\" : trimmed;\n}\n\n/**\n * Implements parse confidence input for the public runtime surface of this module.\n */\nexport function parseConfidenceInput(value: string): number | \"low\" | \"medium\" | \"high\" {\n const trimmed = value.trim().toLowerCase();\n if (trimmed === \"med\") {\n return \"medium\";\n }\n if (CONFIDENCE_TEXT_VALUES.includes(trimmed as (typeof CONFIDENCE_TEXT_VALUES)[number])) {\n return trimmed as (typeof CONFIDENCE_TEXT_VALUES)[number];\n }\n const parsed = parseOptionalNumber(value, \"confidence\");\n if (!Number.isInteger(parsed) || parsed < 0 || parsed > 100) {\n throw new PmCliError(\"Confidence must be an integer 0..100 or one of low|med|medium|high\", EXIT_CODE.USAGE);\n }\n return parsed;\n}\n\n/**\n * Implements parse regression input for the public runtime surface of this module.\n */\nexport function parseRegressionInput(value: string): boolean {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\") {\n return false;\n }\n throw new PmCliError(\"Regression must be one of true|false|1|0\", EXIT_CODE.USAGE);\n}\n","/**\n * @module cli/commands/legacy-none-tokens\n *\n * Implements the pm legacy none tokens command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\n\n/**\n * Shared legacy \"none\"/\"null\" sentinel handling for the create and update\n * commands. These tokens used to mean \"clear this field\"; they are now\n * rejected in favour of explicit --unset / --clear-* flags.\n *\n * Extracted verbatim from create.ts and update.ts (pm-why9) — behaviour and\n * error strings are identical to the previous per-command copies.\n */\nconst LEGACY_NONE_TOKENS = new Set([\"none\", \"null\"]);\n\n/**\n * Describes a repeatable option whose legacy none/null token maps to a clear flag.\n */\nexport interface LegacyNoneCollectionNormalizer<TOptions extends Record<string, unknown>> {\n optionKey: keyof TOptions;\n clearFlagKey: keyof TOptions;\n valueFlag: string;\n clearFlag: string;\n disableFlagKey?: keyof TOptions;\n}\n\n/**\n * Implements check whether legacy none token for the public runtime surface of this module.\n */\nexport function isLegacyNoneToken(value: string | undefined): boolean {\n if (value === undefined) {\n return false;\n }\n return LEGACY_NONE_TOKENS.has(value.trim().toLowerCase());\n}\n\n/**\n * Implements assert no legacy none token for the public runtime surface of this module.\n */\nexport function assertNoLegacyNoneToken(value: string | undefined, flag: string, replacementHint?: string): void {\n if (!isLegacyNoneToken(value)) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(`${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(), EXIT_CODE.USAGE);\n}\n\n/**\n * Implements assert no legacy none tokens for the public runtime surface of this module.\n */\nexport function assertNoLegacyNoneTokens(values: string[] | undefined, flag: string, replacementHint?: string): void {\n if (!values || values.length === 0) {\n return;\n }\n const hasLegacyToken = values.some((value) => isLegacyNoneToken(value));\n if (!hasLegacyToken) {\n return;\n }\n const suffix = replacementHint ? ` ${replacementHint}` : \"\";\n throw new PmCliError(`${flag} no longer accepts \"none\" or \"null\".${suffix}`.trim(), EXIT_CODE.USAGE);\n}\n\n/**\n * Convert collection-level legacy none/null tokens into their explicit clear flags.\n */\nexport function applyLegacyNoneCollectionNormalizers<TOptions extends Record<string, unknown>>(\n normalized: TOptions,\n definitions: ReadonlyArray<LegacyNoneCollectionNormalizer<TOptions>>,\n): TOptions {\n for (const definition of definitions) {\n const candidate = normalized[definition.optionKey];\n if (!Array.isArray(candidate) || candidate.length === 0) {\n continue;\n }\n if (!candidate.every((entry): entry is string => typeof entry === \"string\")) {\n throw new PmCliError(`${definition.valueFlag} entries must be strings.`, EXIT_CODE.USAGE);\n }\n const entries = candidate;\n const hasLegacy = entries.some((entry) => isLegacyNoneToken(entry));\n if (!hasLegacy) {\n continue;\n }\n const concreteEntries = entries.filter((entry) => !isLegacyNoneToken(entry));\n if (concreteEntries.length > 0) {\n throw new PmCliError(\n `Cannot mix legacy clear token \"none\"/\"null\" with concrete ${definition.valueFlag} entries. Use ${definition.clearFlag} to clear or provide explicit entries.`,\n EXIT_CODE.USAGE,\n );\n }\n normalized[definition.optionKey] = undefined as TOptions[keyof TOptions];\n normalized[definition.clearFlagKey] = true as TOptions[keyof TOptions];\n if (definition.disableFlagKey) {\n normalized[definition.disableFlagKey] = false as TOptions[keyof TOptions];\n }\n }\n return normalized;\n}\n","/**\n * @module cli/commands/lifecycle-transitions\n *\n * Implements the pm lifecycle transitions command surface and its agent-facing runtime behavior.\n */\nimport {\n normalizeStatusInputWithRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\n\n/**\n * GH-216: a contextual next-step hint that nudges agents toward the\n * underutilized `in_progress` lifecycle state instead of jumping straight from\n * `open` to `closed`. The suggestion is intentionally non-binding (no governance\n * enforcement) and only surfaces when a richer transition genuinely exists.\n */\nexport interface LifecycleTransitionSuggestion {\n /** Ready-to-run command that advances the item to the suggested status. */\n command: string;\n /** The status the suggested command moves the item to. */\n to_status: string;\n}\n\n/**\n * Item types whose lifecycle does not follow the\n * `open -> in_progress -> closed` work path. Scheduling/reference types are\n * tracked or scheduled rather than \"worked\", so a `start-task` nudge would be\n * noise. Compared case-insensitively against the resolved item type.\n */\nconst NON_WORKABLE_TYPES = new Set([\n \"event\",\n \"meeting\",\n \"reminder\",\n \"milestone\",\n \"decision\",\n \"adr\",\n]);\n\n/**\n * Suggest the next lifecycle transition for a freshly created (or open) item.\n *\n * Returns a `pm start-task` hint when the item is a workable type currently in\n * the workspace open status AND the workflow defines a distinct `in_progress`\n * status to advance to. Returns `undefined` (no hint) otherwise — including for\n * scheduling types and workflows that collapse `in_progress` into `open` — so\n * the suggestion never fabricates a transition the workflow cannot perform.\n */\nexport function suggestNextLifecycleTransition(\n id: string,\n type: string,\n status: string,\n statusRegistry: RuntimeStatusRegistry,\n): LifecycleTransitionSuggestion | undefined {\n if (NON_WORKABLE_TYPES.has(type.trim().toLowerCase())) {\n return undefined;\n }\n if (status !== statusRegistry.open_status) {\n return undefined;\n }\n const inProgress = normalizeStatusInputWithRegistry(\"in_progress\", statusRegistry);\n if (inProgress === undefined || inProgress === statusRegistry.open_status) {\n return undefined;\n }\n return { command: `pm start-task ${id}`, to_status: inProgress };\n}\n","/**\n * @module cli/commands/shared-unset-fields\n *\n * Single-sources unset-field metadata shared by create and update command handlers.\n */\nimport type { RuntimeFieldCommand, RuntimeFieldRegistry } from \"../../core/schema/runtime-schema.js\";\n\n/**\n * Describes one command option that can be removed from item front matter through `--unset`.\n */\nexport interface CommandUnsetFieldDefinition {\n canonical: string;\n aliases: readonly string[];\n optionKey: string;\n frontMatterKey: string;\n}\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"tags\", aliases: [\"tags\"], optionKey: \"tags\", frontMatterKey: \"tags\" },\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"deadline\", aliases: [\"deadline\"], optionKey: \"deadline\", frontMatterKey: \"deadline\" },\n {\n canonical: \"estimate\",\n aliases: [\"estimate\", \"estimated_minutes\", \"estimated-minutes\"],\n optionKey: \"estimatedMinutes\",\n frontMatterKey: \"estimated_minutes\",\n },\n {\n canonical: \"acceptance-criteria\",\n aliases: [\"acceptance_criteria\", \"acceptance-criteria\", \"ac\"],\n optionKey: \"acceptanceCriteria\",\n frontMatterKey: \"acceptance_criteria\",\n },\n {\n canonical: \"definition-of-ready\",\n aliases: [\"definition_of_ready\", \"definition-of-ready\"],\n optionKey: \"definitionOfReady\",\n frontMatterKey: \"definition_of_ready\",\n },\n { canonical: \"order\", aliases: [\"order\", \"rank\"], optionKey: \"order\", frontMatterKey: \"order\" },\n { canonical: \"goal\", aliases: [\"goal\"], optionKey: \"goal\", frontMatterKey: \"goal\" },\n { canonical: \"objective\", aliases: [\"objective\"], optionKey: \"objective\", frontMatterKey: \"objective\" },\n { canonical: \"value\", aliases: [\"value\"], optionKey: \"value\", frontMatterKey: \"value\" },\n { canonical: \"impact\", aliases: [\"impact\"], optionKey: \"impact\", frontMatterKey: \"impact\" },\n { canonical: \"outcome\", aliases: [\"outcome\"], optionKey: \"outcome\", frontMatterKey: \"outcome\" },\n { canonical: \"why-now\", aliases: [\"why_now\", \"why-now\"], optionKey: \"whyNow\", frontMatterKey: \"why_now\" },\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_CLOSE_REASON,\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_CLOSE_REASON_BEFORE_AUTHOR,\n] as const;\n\nexport const COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR: readonly CommandUnsetFieldDefinition[] = [\n { canonical: \"assignee\", aliases: [\"assignee\"], optionKey: \"assignee\", frontMatterKey: \"assignee\" },\n { canonical: \"parent\", aliases: [\"parent\"], optionKey: \"parent\", frontMatterKey: \"parent\" },\n { canonical: \"reviewer\", aliases: [\"reviewer\"], optionKey: \"reviewer\", frontMatterKey: \"reviewer\" },\n { canonical: \"risk\", aliases: [\"risk\"], optionKey: \"risk\", frontMatterKey: \"risk\" },\n { canonical: \"confidence\", aliases: [\"confidence\"], optionKey: \"confidence\", frontMatterKey: \"confidence\" },\n { canonical: \"sprint\", aliases: [\"sprint\"], optionKey: \"sprint\", frontMatterKey: \"sprint\" },\n { canonical: \"release\", aliases: [\"release\"], optionKey: \"release\", frontMatterKey: \"release\" },\n {\n canonical: \"blocked-by\",\n aliases: [\"blocked_by\", \"blocked-by\"],\n optionKey: \"blockedBy\",\n frontMatterKey: \"blocked_by\",\n },\n {\n canonical: \"blocked-reason\",\n aliases: [\"blocked_reason\", \"blocked-reason\"],\n optionKey: \"blockedReason\",\n frontMatterKey: \"blocked_reason\",\n },\n {\n canonical: \"unblock-note\",\n aliases: [\"unblock_note\", \"unblock-note\"],\n optionKey: \"unblockNote\",\n frontMatterKey: \"unblock_note\",\n },\n { canonical: \"reporter\", aliases: [\"reporter\"], optionKey: \"reporter\", frontMatterKey: \"reporter\" },\n { canonical: \"severity\", aliases: [\"severity\"], optionKey: \"severity\", frontMatterKey: \"severity\" },\n {\n canonical: \"environment\",\n aliases: [\"environment\"],\n optionKey: \"environment\",\n frontMatterKey: \"environment\",\n },\n {\n canonical: \"repro-steps\",\n aliases: [\"repro_steps\", \"repro-steps\"],\n optionKey: \"reproSteps\",\n frontMatterKey: \"repro_steps\",\n },\n {\n canonical: \"resolution\",\n aliases: [\"resolution\"],\n optionKey: \"resolution\",\n frontMatterKey: \"resolution\",\n },\n {\n canonical: \"expected-result\",\n aliases: [\"expected_result\", \"expected-result\"],\n optionKey: \"expectedResult\",\n frontMatterKey: \"expected_result\",\n },\n {\n canonical: \"actual-result\",\n aliases: [\"actual_result\", \"actual-result\"],\n optionKey: \"actualResult\",\n frontMatterKey: \"actual_result\",\n },\n {\n canonical: \"affected-version\",\n aliases: [\"affected_version\", \"affected-version\"],\n optionKey: \"affectedVersion\",\n frontMatterKey: \"affected_version\",\n },\n {\n canonical: \"fixed-version\",\n aliases: [\"fixed_version\", \"fixed-version\"],\n optionKey: \"fixedVersion\",\n frontMatterKey: \"fixed_version\",\n },\n { canonical: \"component\", aliases: [\"component\"], optionKey: \"component\", frontMatterKey: \"component\" },\n { canonical: \"regression\", aliases: [\"regression\"], optionKey: \"regression\", frontMatterKey: \"regression\" },\n {\n canonical: \"customer-impact\",\n aliases: [\"customer_impact\", \"customer-impact\"],\n optionKey: \"customerImpact\",\n frontMatterKey: \"customer_impact\",\n },\n] as const;\n\n/**\n * Result of matching a runtime schema field against a command `--unset` token.\n */\nexport interface RuntimeUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\n/**\n * Resolve a runtime-schema field definition from a command `--unset` token.\n */\nexport function resolveRuntimeUnsetFieldDefinition(\n token: string,\n command: RuntimeFieldCommand,\n runtimeFieldRegistry: RuntimeFieldRegistry | undefined,\n): RuntimeUnsetFieldDefinition | undefined {\n const normalizedToken = token.trim().toLowerCase();\n if (!runtimeFieldRegistry) {\n return undefined;\n }\n const definitions = runtimeFieldRegistry.command_to_fields?.get(command) ?? [];\n for (const definition of definitions) {\n if (definition.allow_unset === false) {\n continue;\n }\n const candidates = new Set<string>();\n if (typeof definition.key === \"string\" && definition.key.length > 0) {\n candidates.add(definition.key.toLowerCase());\n }\n if (typeof definition.metadata_key === \"string\" && definition.metadata_key.length > 0) {\n candidates.add(definition.metadata_key.toLowerCase());\n }\n if (typeof definition.cli_flag === \"string\" && definition.cli_flag.length > 0) {\n candidates.add(definition.cli_flag.replaceAll(\"-\", \"_\").toLowerCase());\n candidates.add(definition.cli_flag.toLowerCase());\n }\n if (Array.isArray(definition.cli_aliases)) {\n for (const alias of definition.cli_aliases) {\n if (typeof alias !== \"string\" || alias.length === 0) {\n continue;\n }\n candidates.add(alias.replaceAll(\"-\", \"_\").toLowerCase());\n candidates.add(alias.toLowerCase());\n }\n }\n if (!candidates.has(normalizedToken)) {\n continue;\n }\n return {\n optionKey: definition.key,\n frontMatterKey: definition.metadata_key,\n };\n }\n return undefined;\n}\n","/**\n * @module cli/commands/recurrence-parsers\n *\n * Implements the pm recurrence parsers command surface and its agent-facing runtime behavior.\n */\nimport { parseOptionalNumber } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport {\n RECURRENCE_FREQUENCY_VALUES,\n RECURRENCE_WEEKDAY_VALUES,\n weekdayOrderIndex,\n} from \"../../types/index.js\";\nimport type { RecurrenceRule } from \"../../types/index.js\";\n\n/**\n * Shared calendar recurrence/event parsing helpers used by the `create` and\n * `update` commands. Extracted verbatim from create.ts and update.ts (pm-why9).\n *\n * `parseEventBoolean`, `parseDelimitedList`, and `ensureEnumValue` were\n * byte-identical between the two commands (update spelled `ensureEnumValue` as\n * `ensureEnum`).\n *\n * `parseRecurrenceRule` was identical apart from the recur_interval/recur_count\n * \"provided\" guard: create used `intervalRaw !== undefined` (an empty\n * `recur_interval=` is parsed and rejected), while update used the truthy\n * `intervalRaw ?` (an empty value is skipped). That distinction is preserved\n * via the `emptyNumericGuard` option so both call sites keep their exact\n * behaviour, including error strings.\n */\n\nexport function parseEventBoolean(value: string, flag: string): boolean {\n const normalized = value.trim().toLowerCase();\n if (normalized === \"true\" || normalized === \"1\" || normalized === \"yes\") {\n return true;\n }\n if (normalized === \"false\" || normalized === \"0\" || normalized === \"no\") {\n return false;\n }\n throw new PmCliError(`${flag} must be one of true|false|1|0|yes|no`, EXIT_CODE.USAGE);\n}\n\n/**\n * Implements parse delimited list for the public runtime surface of this module.\n */\nexport function parseDelimitedList(raw: string | undefined): string[] {\n if (!raw) {\n return [];\n }\n return raw\n .split(\"|\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n}\n\n/**\n * Implements ensure enum value for the public runtime surface of this module.\n */\nexport function ensureEnumValue<T extends string>(value: string, allowed: readonly T[], label: string): T {\n if (!allowed.includes(value as T)) {\n throw new PmCliError(`Invalid ${label} value \"${value}\". Allowed: ${allowed.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return value as T;\n}\n\n/**\n * `\"defined\"` parses `recur_interval=`/`recur_count=` (empty values), matching\n * the historical `create` behaviour. `\"truthy\"` skips empty values, matching\n * the historical `update` behaviour.\n */\nexport type RecurrenceEmptyNumericGuard = \"defined\" | \"truthy\";\n\n/**\n * Authoritative list of the CSV/markdown recurrence keys this parser reads.\n * Co-located with {@link parseRecurrenceRule} so adding a recurrence field\n * updates the reads AND the strict unknown-key allow-list in one place — the\n * `--event` validator (repeatable-metadata-parsers EVENT_KEYS) spreads this, so\n * a new recur key can never be silently rejected (GH-258). Keep in sync with\n * the `kv.recur_*` reads below.\n */\nexport const RECURRENCE_CSV_KEYS = [\n \"recur_freq\",\n \"recur_interval\",\n \"recur_count\",\n \"recur_until\",\n \"recur_by_weekday\",\n \"recur_by_month_day\",\n \"recur_exdates\",\n] as const;\n\n/**\n * Implements parse recurrence rule for the public runtime surface of this module.\n */\nexport function parseRecurrenceRule(\n kv: Record<string, string>,\n startAt: string,\n nowValue: Date,\n emptyNumericGuard: RecurrenceEmptyNumericGuard,\n): RecurrenceRule | undefined {\n const freqRaw = kv.recur_freq?.trim();\n const intervalRaw = kv.recur_interval?.trim();\n const countRaw = kv.recur_count?.trim();\n const untilRaw = kv.recur_until?.trim();\n const byWeekdayRaw = kv.recur_by_weekday?.trim();\n const byMonthDayRaw = kv.recur_by_month_day?.trim();\n const exdatesRaw = kv.recur_exdates?.trim();\n\n const recurrenceInputsProvided = [freqRaw, intervalRaw, countRaw, untilRaw, byWeekdayRaw, byMonthDayRaw, exdatesRaw].some(\n (value) => value !== undefined,\n );\n if (!recurrenceInputsProvided) {\n return undefined;\n }\n if (!freqRaw) {\n throw new PmCliError(\"--event recurrence fields require recur_freq=<daily|weekly|monthly|yearly>\", EXIT_CODE.USAGE);\n }\n\n const numericProvided = (raw: string | undefined): boolean =>\n emptyNumericGuard === \"defined\" ? raw !== undefined : Boolean(raw);\n\n const freq = ensureEnumValue(freqRaw.toLowerCase(), RECURRENCE_FREQUENCY_VALUES, \"event recurrence frequency\");\n const interval = numericProvided(intervalRaw) ? parseOptionalNumber(intervalRaw as string, \"event recur_interval\") : undefined;\n if (interval !== undefined && (!Number.isInteger(interval) || interval < 1)) {\n throw new PmCliError(\"--event recur_interval must be an integer >= 1\", EXIT_CODE.USAGE);\n }\n const count = numericProvided(countRaw) ? parseOptionalNumber(countRaw as string, \"event recur_count\") : undefined;\n if (count !== undefined && (!Number.isInteger(count) || count < 1)) {\n throw new PmCliError(\"--event recur_count must be an integer >= 1\", EXIT_CODE.USAGE);\n }\n const until = untilRaw ? resolveIsoOrRelative(untilRaw, nowValue, \"event.recur_until\") : undefined;\n if (until && until < startAt) {\n throw new PmCliError(\"--event recur_until must be at or after start\", EXIT_CODE.USAGE);\n }\n\n const byWeekday = Array.from(\n new Set(\n parseDelimitedList(byWeekdayRaw).map((value) => ensureEnumValue(value.toLowerCase(), RECURRENCE_WEEKDAY_VALUES, \"event weekday\")),\n ),\n ).sort(\n (left, right) =>\n weekdayOrderIndex(left as (typeof RECURRENCE_WEEKDAY_VALUES)[number]) -\n weekdayOrderIndex(right as (typeof RECURRENCE_WEEKDAY_VALUES)[number]),\n );\n\n const byMonthDay = Array.from(\n new Set(\n parseDelimitedList(byMonthDayRaw).map((value) => {\n const day = parseOptionalNumber(value, \"event recur_by_month_day\");\n if (!Number.isInteger(day) || day < 1 || day > 31) {\n throw new PmCliError(\"--event recur_by_month_day values must be integers 1..31\", EXIT_CODE.USAGE);\n }\n return day;\n }),\n ),\n ).sort((left, right) => left - right);\n\n const exdates = Array.from(\n new Set(parseDelimitedList(exdatesRaw).map((value) => resolveIsoOrRelative(value, nowValue, \"event.recur_exdates\"))),\n ).sort((left, right) => left.localeCompare(right));\n\n return {\n freq,\n interval,\n count,\n until,\n by_weekday: byWeekday.length > 0 ? byWeekday : undefined,\n by_month_day: byMonthDay.length > 0 ? byMonthDay : undefined,\n exdates: exdates.length > 0 ? exdates : undefined,\n };\n}\n","/**\n * @module cli/commands/event-validation-messages\n *\n * Implements the pm event validation messages command surface and its agent-facing runtime behavior.\n */\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\n\nexport const EVENT_END_AFTER_START_MESSAGE =\n \"--event end must be strictly after start. Equal start/end timestamps are treated as an instant event (end is dropped); an end earlier than start is rejected. Omit end for an instant event or set end later than start.\";\n\nexport const EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE =\n \"--event end and duration are mutually exclusive; provide only one (use duration=<relative> like duration=2h, duration=30min, or duration=PT30M, or set an explicit end).\";\n\nconst MINUTE_DURATION = /^([+-]?)(\\d+)(min|mins|minute|minutes)$/i;\nconst ISO_8601_TIME_DURATION = /^([+-]?)[Pp][Tt](?:(\\d+)[Hh])?(?:(\\d+)[Mm])?(?:(\\d+)[Ss])?$/;\nconst MILLIS_PER_SECOND = 1000;\nconst MILLIS_PER_MINUTE = 60 * MILLIS_PER_SECOND;\nconst MILLIS_PER_HOUR = 60 * MILLIS_PER_MINUTE;\n\nfunction toIsoTimestampOrThrow(timestampMs: number, durationRaw: string): string {\n const resolved = new Date(timestampMs);\n if (!Number.isFinite(resolved.getTime())) {\n throw new PmCliError(\n `Invalid event.duration value \"${durationRaw}\". Duration is out of supported timestamp range.`,\n EXIT_CODE.USAGE,\n );\n }\n return resolved.toISOString();\n}\n\nfunction resolveDurationAgainstStart(startAt: string, durationRaw: string): string {\n const start = new Date(startAt);\n const trimmedDuration = durationRaw.trim();\n\n const minuteDuration = MINUTE_DURATION.exec(trimmedDuration);\n if (minuteDuration) {\n const sign = minuteDuration[1] === \"-\" ? -1 : 1;\n const amount = Number.parseInt(minuteDuration[2], 10) * sign;\n return toIsoTimestampOrThrow(start.getTime() + amount * MILLIS_PER_MINUTE, trimmedDuration);\n }\n\n const isoDuration = ISO_8601_TIME_DURATION.exec(trimmedDuration);\n if (isoDuration) {\n const [, signToken, hoursToken, minutesToken, secondsToken] = isoDuration;\n const hasComponent = hoursToken || minutesToken || secondsToken;\n if (hasComponent) {\n const sign = signToken === \"-\" ? -1 : 1;\n const hours = Number.parseInt(hoursToken ?? \"0\", 10);\n const minutes = Number.parseInt(minutesToken ?? \"0\", 10);\n const seconds = Number.parseInt(secondsToken ?? \"0\", 10);\n const totalMillis = hours * MILLIS_PER_HOUR + minutes * MILLIS_PER_MINUTE + seconds * MILLIS_PER_SECOND;\n return toIsoTimestampOrThrow(start.getTime() + sign * totalMillis, trimmedDuration);\n }\n }\n\n const normalizedDuration =\n trimmedDuration.startsWith(\"+\") || trimmedDuration.startsWith(\"-\") ? trimmedDuration : `+${trimmedDuration}`;\n return resolveIsoOrRelative(normalizedDuration, start, \"event.duration\");\n}\n\n// Shared by `pm create` (parseEvents) and `pm update` (parseEventEntries) so the\n// two parallel parse sites cannot drift. Resolves the event end timestamp from\n// either an explicit `end` or a relative `duration` (mutually exclusive).\n// Equal start/end (including a zero-length duration) collapses to an instant\n// event (end dropped); an end earlier than start is rejected.\n/**\n * Implements resolve event end at for the public runtime surface of this module.\n */\nexport function resolveEventEndAt(\n startAt: string,\n endRaw: string | undefined,\n durationRaw: string | undefined,\n referenceDate: Date,\n): string | undefined {\n if (endRaw && durationRaw) {\n throw new PmCliError(EVENT_END_DURATION_MUTUALLY_EXCLUSIVE_MESSAGE, EXIT_CODE.USAGE);\n }\n if (durationRaw) {\n // Resolve duration with startAt as the reference so duration=2h means startAt + 2h.\n // Keep global relative token semantics unchanged (`m` stays months) while\n // allowing explicit sub-hour forms (`30min`, `PT30M`) for event durations.\n const endAt = resolveDurationAgainstStart(startAt, durationRaw);\n if (endAt < startAt) {\n throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);\n }\n // A zero-length duration is an instant event, mirroring explicit equal start/end.\n if (endAt === startAt) {\n return undefined;\n }\n return endAt;\n }\n if (!endRaw) {\n return undefined;\n }\n const endAt = resolveIsoOrRelative(endRaw, referenceDate, \"event.end\");\n if (endAt < startAt) {\n throw new PmCliError(EVENT_END_AFTER_START_MESSAGE, EXIT_CODE.USAGE);\n }\n // Equal start/end collapses to an instant event (drop end) instead of being rejected.\n if (endAt === startAt) {\n return undefined;\n }\n return endAt;\n}\n","/**\n * @module cli/commands/repeatable-metadata-parsers\n *\n * Implements the pm repeatable metadata parsers command surface and its agent-facing runtime behavior.\n */\nimport { assertNoUnknownCsvKeys, parseCsvKv } from \"../../core/item/parse.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport type { CalendarEvent, Reminder } from \"../../types/index.js\";\nimport { resolveEventEndAt } from \"./event-validation-messages.js\";\nimport {\n parseEventBoolean,\n parseRecurrenceRule,\n RECURRENCE_CSV_KEYS,\n type RecurrenceEmptyNumericGuard,\n} from \"./recurrence-parsers.js\";\n\n/** Allowed CSV/markdown keys for `--reminder` (GH-258). */\nconst REMINDER_KEYS = [\"at\", \"date\", \"text\", \"title\"] as const;\n/**\n * Allowed CSV/markdown keys for `--event` (GH-258). Recurrence keys are spread\n * from the authoritative RECURRENCE_CSV_KEYS next to parseRecurrenceRule so the\n * allow-list can never drift from what the recurrence parser actually reads.\n */\nconst EVENT_KEYS = [\n \"start\",\n \"date\",\n \"end\",\n \"duration\",\n \"title\",\n \"description\",\n \"location\",\n \"timezone\",\n \"all_day\",\n ...RECURRENCE_CSV_KEYS,\n] as const;\n/** Allowed CSV/markdown keys for the `--type-option` structured form (GH-258). */\nconst TYPE_OPTION_KEYS = [\"key\", \"value\"] as const;\n\ntype EmptyValueGuard = \"defined\" | \"truthy\";\ntype ReminderValueMode = \"raw\" | \"trimmed\";\n\ninterface ParseReminderEntriesOptions {\n valueMode: ReminderValueMode;\n}\n\ninterface ParseEventEntriesOptions {\n allDayEmptyGuard: EmptyValueGuard;\n recurrenceEmptyNumericGuard: RecurrenceEmptyNumericGuard;\n}\n\nfunction optionalString(value: string | undefined, mode: ReminderValueMode): string | undefined {\n return mode === \"trimmed\" ? value?.trim() : value;\n}\n\nfunction isProvided(value: string | undefined, guard: EmptyValueGuard): boolean {\n return guard === \"defined\" ? value !== undefined : Boolean(value);\n}\n\n/**\n * Implements parse reminder entries for the public runtime surface of this module.\n */\nexport function parseReminderEntries(raw: string[], nowValue: Date, options: ParseReminderEntriesOptions): Reminder[] {\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--reminder\");\n assertNoUnknownCsvKeys(kv, \"--reminder\", REMINDER_KEYS);\n const atRaw = optionalString(kv.at ?? kv.date, options.valueMode);\n const textRaw = optionalString(kv.text ?? kv.title, options.valueMode);\n if (!atRaw || !textRaw) {\n throw new PmCliError(\"--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>\", EXIT_CODE.USAGE);\n }\n const text = textRaw.trim();\n if (!text) {\n throw new PmCliError(\"--reminder text must not be empty\", EXIT_CODE.USAGE);\n }\n return {\n at: resolveIsoOrRelative(atRaw, nowValue, \"reminder.at\"),\n text,\n };\n });\n}\n\n/**\n * Implements parse event entries for the public runtime surface of this module.\n */\nexport function parseEventEntries(raw: string[], nowValue: Date, options: ParseEventEntriesOptions): CalendarEvent[] {\n return raw.map((entry) => {\n const kv = parseCsvKv(entry, \"--event\");\n assertNoUnknownCsvKeys(kv, \"--event\", EVENT_KEYS);\n const startRaw = (kv.start ?? kv.date)?.trim();\n if (!startRaw) {\n throw new PmCliError(\"--event requires start=<iso|relative> or date=<iso|relative>\", EXIT_CODE.USAGE);\n }\n const startAt = resolveIsoOrRelative(startRaw, nowValue, \"event.start\");\n const endRaw = kv.end?.trim();\n const durationRaw = kv.duration?.trim();\n const endAt = resolveEventEndAt(startAt, endRaw, durationRaw, nowValue);\n\n const titleRaw = kv.title;\n const descriptionRaw = kv.description;\n const locationRaw = kv.location;\n const timezoneRaw = kv.timezone;\n\n const title = titleRaw?.trim();\n const description = descriptionRaw?.trim();\n const location = locationRaw?.trim();\n const timezone = timezoneRaw?.trim();\n const optionalTextFields = [\n [\"title\", titleRaw, title],\n [\"description\", descriptionRaw, description],\n [\"location\", locationRaw, location],\n [\"timezone\", timezoneRaw, timezone],\n ] as const;\n for (const [fieldLabel, rawValue, trimmedValue] of optionalTextFields) {\n if (rawValue !== undefined && !trimmedValue) {\n throw new PmCliError(`--event ${fieldLabel} must not be empty`, EXIT_CODE.USAGE);\n }\n }\n\n const allDayRaw = kv.all_day?.trim();\n const recurrence = parseRecurrenceRule(kv, startAt, nowValue, options.recurrenceEmptyNumericGuard);\n const allDay = isProvided(allDayRaw, options.allDayEmptyGuard)\n ? parseEventBoolean(allDayRaw as string, \"--event all_day\")\n : undefined;\n\n return {\n start_at: startAt,\n end_at: endAt,\n title,\n description,\n location,\n all_day: allDay,\n timezone,\n recurrence,\n };\n });\n}\n\n/**\n * Implements parse type option entries for the public runtime surface of this module.\n */\nexport function parseTypeOptionEntries(raw: string[]): Record<string, string> {\n const values: Record<string, string> = {};\n for (const entry of raw) {\n const trimmedEntry = entry.trim();\n if (trimmedEntry.length === 0) {\n throw new PmCliError(\"--type-option values must not be empty\", EXIT_CODE.USAGE);\n }\n let key: string | undefined;\n let value: string | undefined;\n const prefersStructuredKv =\n trimmedEntry.includes(\",\") ||\n trimmedEntry.includes(\"\\n\") ||\n trimmedEntry.startsWith(\"```\") ||\n /^(?:[-*+]\\s+)?(?:key|value)\\s*[:=]/i.test(trimmedEntry);\n if (prefersStructuredKv) {\n const kv = parseCsvKv(trimmedEntry, \"--type-option\");\n assertNoUnknownCsvKeys(kv, \"--type-option\", TYPE_OPTION_KEYS);\n key = kv.key?.trim();\n value = kv.value?.trim();\n } else {\n const equalsIndex = trimmedEntry.indexOf(\"=\");\n const colonIndex = trimmedEntry.indexOf(\":\");\n let separatorIndex = equalsIndex;\n if (equalsIndex <= 0 && colonIndex > 0) {\n separatorIndex = colonIndex;\n }\n if (separatorIndex <= 0 || separatorIndex === trimmedEntry.length - 1) {\n throw new PmCliError(\n \"--type-option requires key=value or key=<name>,value=<value> entries\",\n EXIT_CODE.USAGE,\n );\n }\n key = trimmedEntry.slice(0, separatorIndex).trim();\n value = trimmedEntry.slice(separatorIndex + 1).trim();\n }\n if (!key || !value) {\n throw new PmCliError(\"--type-option requires key and value\", EXIT_CODE.USAGE);\n }\n values[key] = value;\n }\n return Object.fromEntries(Object.entries(values).sort((left, right) => left[0].localeCompare(right[0])));\n}\n","/**\n * @module cli/commands/create\n *\n * Implements the pm create command surface and its agent-facing runtime behavior.\n */\nimport { pathExists, removeFileIfExists, writeFileAtomic } from \"../../core/fs/fs-utils.js\";\nimport { appendHistoryEntry, createHistoryEntry } from \"../../core/history/history.js\";\nimport { generateItemId, normalizeItemId } from \"../../core/item/id.js\";\nimport { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from \"../../core/item/item-format.js\";\nimport {\n normalizeParentReferenceValue,\n validateMissingParentReference,\n} from \"../../core/item/parent-reference-policy.js\";\nimport { validateSprintOrReleaseValue } from \"../../core/item/sprint-release-format.js\";\nimport {\n assertNoUnknownCsvKeys,\n createStdinTokenResolver,\n looksLikeGenericKeyValueEntry,\n mergeAdditiveTags,\n parseCsvKv,\n parseOptionalNumber,\n parseTags,\n} from \"../../core/item/parse.js\";\nimport { resolvePriority } from \"../../core/item/priority.js\";\nimport { getFocusedItem } from \"../../core/session/session-state.js\";\nimport { normalizeStatusInput } from \"../../core/item/status.js\";\nimport { CREATE_DIRECT_CLOSE_REASON_DEFAULT } from \"../../core/shared/constants.js\";\nimport {\n canonicalizeCommandOptionKey,\n commandOptionFlagLabel,\n resolveItemTypeRegistry,\n resolveCommandOptionPolicyState,\n type ResolvedItemTypeDefinition,\n resolveTypeDefinition,\n resolveTypeName,\n validateTypeOptions,\n} from \"../../core/item/type-registry.js\";\nimport { acquireLock } from \"../../core/lock/lock.js\";\nimport { printError } from \"../../core/output/output.js\";\nimport { buildInvalidTypeError } from \"../../core/schema/item-types-file.js\";\nimport { resolveTypeSynonym } from \"../../core/item/type-synonyms.js\";\nimport { collectRuntimeCreateFieldValues } from \"../../core/schema/runtime-field-values.js\";\nimport {\n type RuntimeFieldRegistry,\n resolveItemTypesFilePath,\n resolveRuntimeFieldRegistry,\n resolveRuntimeStatusRegistry,\n type RuntimeStatusRegistry,\n} from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE, FRONT_MATTER_KEY_ORDER } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport { nowIso, resolveIsoOrRelative } from \"../../core/shared/time.js\";\nimport {\n getActiveExtensionRegistrations,\n projectAfterCommandItemSnapshot,\n recordAfterCommandAffectedItem,\n runActiveCommandHandler,\n runActiveOnWriteHooks,\n} from \"../../core/extensions/index.js\";\nimport {\n collectRegisteredItemFieldNames,\n applyRegisteredItemFieldDefaultsAndValidation,\n parseRegisteredItemFieldAssignments,\n} from \"../../core/extensions/item-fields.js\";\nimport { locateItem } from \"../../core/store/item-store.js\";\nimport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport {\n normalizeRiskInput,\n normalizeSeverityInput,\n parseConfidenceInput,\n parseRegressionInput,\n} from \"./metadata-normalizers.js\";\nimport {\n applyLegacyNoneCollectionNormalizers,\n assertNoLegacyNoneToken,\n assertNoLegacyNoneTokens,\n isLegacyNoneToken,\n type LegacyNoneCollectionNormalizer,\n} from \"./legacy-none-tokens.js\";\nimport {\n suggestNextLifecycleTransition,\n type LifecycleTransitionSuggestion,\n} from \"./lifecycle-transitions.js\";\nimport {\n parseLinkedTestAssertionEqualsMap,\n parseLinkedTestAssertionGteMap,\n parseLinkedTestBoolean,\n parseLinkedTestContextMode,\n parseLinkedTestEnvClear,\n parseLinkedTestEnvSet,\n parseLinkedTestMinLines,\n parseLinkedTestRegexList,\n parseLinkedTestStringList,\n} from \"./linked-test-parsers.js\";\nimport { looksLikeStructuredLinkedTestEntry, normalizeStructuredLinkedTestEntry } from \"./linked-test-entry.js\";\nimport {\n COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,\n resolveRuntimeUnsetFieldDefinition,\n type CommandUnsetFieldDefinition,\n} from \"./shared-unset-fields.js\";\nimport { ensureEnumValue } from \"./recurrence-parsers.js\";\nimport {\n parseEventEntries,\n parseReminderEntries,\n parseTypeOptionEntries,\n} from \"./repeatable-metadata-parsers.js\";\nimport type {\n CalendarEvent,\n Comment,\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n Reminder,\n} from \"../../types/index.js\";\nimport {\n DEPENDENCY_KIND_VALUES,\n ISSUE_SEVERITY_VALUES,\n RISK_VALUES,\n SCOPE_VALUES,\n} from \"../../types/index.js\";\n\n/**\n * Documents the create command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CreateCommandOptions {\n title?: string;\n description?: string;\n type?: string;\n status?: string;\n priority?: string;\n tags?: string;\n addTags?: string[];\n body?: string;\n deadline?: string;\n estimatedMinutes?: string;\n acceptanceCriteria?: string;\n definitionOfReady?: string;\n order?: string;\n rank?: string;\n goal?: string;\n objective?: string;\n value?: string;\n impact?: string;\n outcome?: string;\n whyNow?: string;\n author?: string;\n message?: string;\n assignee?: string;\n parent?: string;\n allowMissingParent?: boolean;\n reviewer?: string;\n risk?: string;\n confidence?: string;\n sprint?: string;\n release?: string;\n blockedBy?: string;\n blockedReason?: string;\n unblockNote?: string;\n reporter?: string;\n severity?: string;\n environment?: string;\n reproSteps?: string;\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n affectedVersion?: string;\n fixedVersion?: string;\n component?: string;\n regression?: string;\n customerImpact?: string;\n dep?: string[];\n comment?: string[];\n note?: string[];\n learning?: string[];\n file?: string[];\n test?: string[];\n doc?: string[];\n reminder?: string[];\n event?: string[];\n typeOption?: string[];\n field?: string[];\n template?: string;\n createMode?: string;\n schedulePreset?: string;\n unset?: string[];\n clearDeps?: boolean;\n clearComments?: boolean;\n clearNotes?: boolean;\n clearLearnings?: boolean;\n clearFiles?: boolean;\n clearTests?: boolean;\n clearDocs?: boolean;\n clearReminders?: boolean;\n clearEvents?: boolean;\n clearTypeOptions?: boolean;\n [key: string]: unknown;\n}\n\n/**\n * Documents the create result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CreateResult {\n item: ItemMetadata;\n changed_fields: string[];\n warnings: string[];\n // GH-161: set to \"focus\" when the item's parent was inherited from the\n // session focused item (`pm focus <id>`) rather than an explicit --parent.\n parent_source?: \"focus\";\n // GH-216: optional non-binding nudge toward the next lifecycle transition\n // (e.g. `pm start-task <id>`), present only when a richer transition exists.\n next_transition?: LifecycleTransitionSuggestion;\n}\n\ntype CreateMode = \"strict\" | \"progressive\";\nconst CREATE_MODE_VALUES = [\"strict\", \"progressive\"] as const;\ntype ScheduleCreatePreset = \"lightweight\";\nconst SCHEDULE_CREATE_PRESET_VALUES = [\"lightweight\"] as const;\nconst SCHEDULE_CREATE_PRESET_TYPES = new Set([\"Reminder\", \"Meeting\", \"Event\"]);\nconst LOG_SEED_ALLOWED_KEYS = new Set([\"author\", \"created_at\", \"text\"]);\n\ninterface CreateUnsetFieldDefinition {\n optionKey: string;\n frontMatterKey: string;\n}\n\nconst CREATE_UNSET_FIELD_DEFINITIONS: readonly CommandUnsetFieldDefinition[] = [\n ...COMMON_UNSET_FIELD_DEFINITIONS_BEFORE_AUTHOR,\n { canonical: \"author\", aliases: [\"author\"], optionKey: \"author\", frontMatterKey: \"author\" },\n ...COMMON_UNSET_FIELD_DEFINITIONS_AFTER_AUTHOR,\n];\n\nconst CREATE_UNSET_ALIAS_MAP: Map<string, CreateUnsetFieldDefinition> = (() => {\n const map = new Map<string, CreateUnsetFieldDefinition>();\n for (const definition of CREATE_UNSET_FIELD_DEFINITIONS) {\n for (const alias of definition.aliases) {\n map.set(alias, {\n optionKey: definition.optionKey,\n frontMatterKey: definition.frontMatterKey,\n });\n }\n }\n return map;\n})();\n\nconst CREATE_OPTION_KEY_TO_UNSET_CANONICAL = new Map<string, string>(\n CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => [definition.optionKey, definition.canonical]),\n);\n\nconst CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS = CREATE_UNSET_FIELD_DEFINITIONS.map((definition) => definition.canonical)\n .sort((left, right) => left.localeCompare(right))\n .join(\", \");\n\nfunction buildInvalidLogSeedKeysMessage(\n optionName: \"--comment\" | \"--note\" | \"--learning\",\n unsupportedKeys: string[],\n): string {\n const sortedUnsupported = [...unsupportedKeys].sort((left, right) => left.localeCompare(right));\n const keyLabel = sortedUnsupported.length === 1 ? \"key\" : \"keys\";\n return (\n `${optionName} supports only author, created_at, and text seed fields. ` +\n `Found unsupported ${keyLabel}: ${sortedUnsupported.join(\", \")}. ` +\n `If text contains comma-separated key:value-like fragments, wrap text in quotes ` +\n '(for example text=\"first,scope:project\"), use markdown-style key/value input, ' +\n `or pass ${optionName} - with piped stdin.`\n );\n}\n\nfunction parseStatusValue(value: string, statusRegistry: RuntimeStatusRegistry): ItemStatus {\n const normalized = normalizeStatusInput(value, statusRegistry);\n if (!normalized) {\n const allowedStatuses = statusRegistry.definitions.map((definition) => definition.id);\n throw new PmCliError(`Invalid status value \"${value}\". Allowed: ${allowedStatuses.join(\", \")}`, EXIT_CODE.USAGE);\n }\n return normalized;\n}\n\n/**\n * Resolve the create-time status when `--status` is omitted: a config-driven\n * per-type `default_status` (from `pm schema add-type --default-status`) wins,\n * then the workflow open status. An unknown configured value degrades to the\n * open status rather than blocking the create (never-block-the-agent).\n */\nfunction resolveCreateDefaultStatus(\n typeDefinition: ResolvedItemTypeDefinition,\n statusRegistry: RuntimeStatusRegistry,\n): ItemStatus {\n const configured = typeDefinition.default_status;\n if (configured !== undefined) {\n const normalized = normalizeStatusInput(configured, statusRegistry);\n if (normalized) {\n return normalized;\n }\n }\n return statusRegistry.open_status;\n}\n\nfunction parseCreatedAt(value: string | undefined, currentIso: string): string {\n if (!value || value.trim() === \"\" || value.trim().toLowerCase() === \"now\") {\n return currentIso;\n }\n const parsed = Date.parse(value);\n if (!Number.isFinite(parsed)) {\n throw new PmCliError(`Invalid created_at timestamp \"${value}\"`, EXIT_CODE.USAGE);\n }\n return new Date(parsed).toISOString();\n}\n\nconst CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS: ReadonlyArray<LegacyNoneCollectionNormalizer<CreateCommandOptions>> = [\n { optionKey: \"dep\", clearFlagKey: \"clearDeps\", valueFlag: \"--dep\", clearFlag: \"--clear-deps\" },\n { optionKey: \"comment\", clearFlagKey: \"clearComments\", valueFlag: \"--comment\", clearFlag: \"--clear-comments\" },\n { optionKey: \"note\", clearFlagKey: \"clearNotes\", valueFlag: \"--note\", clearFlag: \"--clear-notes\" },\n { optionKey: \"learning\", clearFlagKey: \"clearLearnings\", valueFlag: \"--learning\", clearFlag: \"--clear-learnings\" },\n { optionKey: \"file\", clearFlagKey: \"clearFiles\", valueFlag: \"--file\", clearFlag: \"--clear-files\" },\n { optionKey: \"test\", clearFlagKey: \"clearTests\", valueFlag: \"--test\", clearFlag: \"--clear-tests\" },\n { optionKey: \"doc\", clearFlagKey: \"clearDocs\", valueFlag: \"--doc\", clearFlag: \"--clear-docs\" },\n { optionKey: \"reminder\", clearFlagKey: \"clearReminders\", valueFlag: \"--reminder\", clearFlag: \"--clear-reminders\" },\n { optionKey: \"event\", clearFlagKey: \"clearEvents\", valueFlag: \"--event\", clearFlag: \"--clear-events\" },\n { optionKey: \"typeOption\", clearFlagKey: \"clearTypeOptions\", valueFlag: \"--type-option\", clearFlag: \"--clear-type-options\" },\n];\n\nfunction normalizeLegacyNoneCreateOptions(options: CreateCommandOptions): CreateCommandOptions {\n const normalized: CreateCommandOptions = {\n ...options,\n unset: options.unset ? [...options.unset] : undefined,\n };\n /* c8 ignore start -- unset dedupe helper branch permutations are covered by legacy option compatibility suites. */\n const appendUnsetTarget = (value: string): void => {\n const current = normalized.unset ? [...normalized.unset] : [];\n if (!current.includes(value)) {\n current.push(value);\n }\n normalized.unset = current;\n };\n /* c8 ignore stop */\n\n if (isLegacyNoneToken(normalized.template)) {\n normalized.template = undefined;\n }\n\n const scalarOptionKeys = new Set<string>([...CREATE_OPTION_KEY_TO_UNSET_CANONICAL.keys(), \"rank\"]);\n for (const optionKey of scalarOptionKeys) {\n const candidate = normalized[optionKey];\n if (typeof candidate !== \"string\" || !isLegacyNoneToken(candidate)) {\n continue;\n }\n /* c8 ignore start -- rank alias canonicalization is exercised in legacy-option compatibility tests. */\n const canonicalUnset = optionKey === \"rank\" ? \"order\" : (CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey);\n appendUnsetTarget(canonicalUnset);\n normalized[optionKey] = undefined;\n /* c8 ignore stop */\n }\n\n return applyLegacyNoneCollectionNormalizers(normalized, CREATE_LEGACY_NONE_COLLECTION_NORMALIZERS);\n}\n\nfunction parseOptionalString(value: string | undefined): string | undefined {\n if (value === undefined) return undefined;\n return value;\n}\n\nfunction parseCreateUnsetTargets(\n raw: string[] | undefined,\n runtimeFieldRegistry?: RuntimeFieldRegistry,\n): { frontMatterKeys: Set<string>; optionKeys: Set<string> } {\n const frontMatterKeys = new Set<string>();\n const optionKeys = new Set<string>();\n if (!raw || raw.length === 0) {\n return { frontMatterKeys, optionKeys };\n }\n\n for (const entry of raw) {\n const trimmed = entry.trim().toLowerCase();\n if (!trimmed) {\n throw new PmCliError(\"--unset values must not be empty\", EXIT_CODE.USAGE);\n }\n if (isLegacyNoneToken(trimmed)) {\n throw new PmCliError(\n '--unset no longer accepts \"none\" or \"null\". Specify concrete field names such as --unset deadline',\n EXIT_CODE.USAGE,\n );\n }\n const definition = CREATE_UNSET_ALIAS_MAP.get(trimmed) ?? resolveRuntimeUnsetFieldDefinition(trimmed, \"create\", runtimeFieldRegistry);\n if (!definition) {\n throw new PmCliError(\n `Unsupported --unset field \"${entry}\". Supported fields: ${CREATE_UNSET_SUPPORTED_CANONICAL_FIELDS}`,\n EXIT_CODE.USAGE,\n );\n }\n frontMatterKeys.add(definition.frontMatterKey);\n optionKeys.add(definition.optionKey);\n }\n\n return { frontMatterKeys, optionKeys };\n}\n\n/** Allowed CSV/markdown keys for the create `--dep` seed (GH-258). */\nconst DEP_SEED_KEYS = [\"id\", \"kind\", \"type\", \"author\", \"created_at\"] as const;\n/** Allowed CSV/markdown keys for create `--file`/`--doc` seeds (GH-258). */\nconst LINKED_ARTIFACT_SEED_KEYS = [\"path\", \"scope\", \"note\"] as const;\n\nfunction parseDependencies(\n raw: string[] | undefined,\n nowValue: string,\n prefix: string,\n): { values: Dependency[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--dep\", \"Use --clear-deps to clear dependencies.\");\n const values: Dependency[] = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, DEP_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--dep\") : { id: trimmedEntry, kind: \"related\" };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--dep\", DEP_SEED_KEYS);\n }\n const id = parseOptionalString(kv.id);\n const kind = normalizeDependencyKindInput(parseOptionalString(kv.kind ?? kv.type));\n if (!id || !kind) {\n throw new PmCliError(\"--dep requires id and kind, or a bare item id to create a related dependency\", EXIT_CODE.USAGE);\n }\n if (id.trim().toLowerCase() === \"undefined\") {\n throw new PmCliError(\n `--dep id must not use placeholder token \"${id}\". Use --clear-deps to clear dependencies.`,\n EXIT_CODE.USAGE,\n );\n }\n return {\n id: normalizeItemId(id, prefix),\n kind: ensureEnumValue(kind, DEPENDENCY_KIND_VALUES, \"dependency kind\"),\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author),\n };\n });\n return { values, explicitEmpty: false };\n}\n\nconst DEPENDENCY_KIND_INPUT_ALIASES: Readonly<Record<string, string>> = {\n \"blocked-by\": \"blocked_by\",\n depends_on: \"blocked_by\",\n \"depends-on\": \"blocked_by\",\n};\n\nfunction normalizeDependencyKindInput(raw: string | undefined): string | undefined {\n if (typeof raw !== \"string\") {\n return raw;\n }\n const alias = DEPENDENCY_KIND_INPUT_ALIASES[raw.toLowerCase()];\n return alias ?? raw;\n}\n\nfunction looksLikeStructuredEntry(raw: string, keys: readonly string[]): boolean {\n if (raw.startsWith(\"```\") || raw.includes(\"\\n\")) {\n return true;\n }\n const keyPattern = keys.map((key) => key.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")).join(\"|\");\n if (new RegExp(`^(?:[-*+]\\\\s+)?(?:${keyPattern})\\\\s*[:=]`, \"i\").test(raw)) {\n return true;\n }\n // A first-key typo (e.g. `bogus=v,id=pm-2`) must still be parsed so the unknown\n // key is rejected rather than swallowed as a bare id/path value (GH-258).\n return looksLikeGenericKeyValueEntry(raw);\n}\n\n/**\n * Implements parse log seed for the public runtime surface of this module.\n */\nexport function parseLogSeed(\n optionName: \"--comment\" | \"--note\" | \"--learning\",\n raw: string[] | undefined,\n nowValue: string,\n fallbackAuthor: string,\n): { values: LogNote[] | Comment[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n const clearHint =\n optionName === \"--comment\"\n ? \"Use --clear-comments to clear comments.\"\n : optionName === \"--note\"\n ? \"Use --clear-notes to clear notes.\"\n : \"Use --clear-learnings to clear learnings.\";\n assertNoLegacyNoneTokens(raw, optionName, clearHint);\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const buildPlainTextCommentSeed = (): Comment => {\n /* c8 ignore start -- empty plaintext fallback is guarded by option parsing before create execution. */\n if (trimmedEntry.length === 0) {\n throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);\n }\n /* c8 ignore stop */\n return {\n created_at: nowValue,\n author: fallbackAuthor,\n text: trimmedEntry,\n };\n };\n let kv: Record<string, string>;\n try {\n kv = parseCsvKv(entry, optionName);\n } catch (error: unknown) {\n /* c8 ignore start -- optionName is type-narrowed to --comment/--note/--learning, so this branch is always true and the rethrow is unreachable. */\n if (optionName === \"--comment\" || optionName === \"--note\" || optionName === \"--learning\") {\n return buildPlainTextCommentSeed();\n }\n throw error;\n /* c8 ignore stop */\n }\n const unsupportedKeys = Object.keys(kv).filter((key) => !LOG_SEED_ALLOWED_KEYS.has(key));\n if (unsupportedKeys.length > 0) {\n return {\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author) ?? fallbackAuthor,\n text: trimmedEntry,\n };\n }\n const text = kv.text ?? \"\";\n if (text === \"\") {\n throw new PmCliError(`${optionName} requires text=<value>`, EXIT_CODE.USAGE);\n }\n return {\n created_at: parseCreatedAt(kv.created_at, nowValue),\n author: parseOptionalString(kv.author) ?? fallbackAuthor,\n text,\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse files for the public runtime surface of this module.\n */\nexport function parseFiles(raw: string[] | undefined): { values: LinkedFile[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--file\", \"Use --clear-files to clear linked files.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, LINKED_ARTIFACT_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--file\") : { path: trimmedEntry };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--file\", LINKED_ARTIFACT_SEED_KEYS);\n }\n if (!kv.path) {\n throw new PmCliError(\"--file requires path=<value> or a bare file path\", EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"file scope\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse tests for the public runtime surface of this module.\n */\nexport function parseTests(raw: string[] | undefined): { values: LinkedTest[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--test\", \"Use --clear-tests to clear linked tests.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const kv = looksLikeStructuredLinkedTestEntry(trimmedEntry)\n ? normalizeStructuredLinkedTestEntry(parseCsvKv(entry, \"--test\"), \"--test\")\n : { command: trimmedEntry };\n const command = parseOptionalString(kv.command);\n const filePath = parseOptionalString(kv.path);\n if (!command) {\n throw new PmCliError(\"--test requires command=<value> or a bare command (path=<value> is optional metadata)\", EXIT_CODE.USAGE);\n }\n const timeoutSecondsRaw = parseOptionalString(kv.timeout_seconds);\n const timeoutAliasRaw = parseOptionalString(kv.timeout);\n if (timeoutSecondsRaw && timeoutAliasRaw && timeoutSecondsRaw !== timeoutAliasRaw) {\n throw new PmCliError(\"--test timeout and timeout_seconds must match when both are provided\", EXIT_CODE.USAGE);\n }\n const timeoutRaw = timeoutSecondsRaw ?? timeoutAliasRaw;\n return {\n command,\n path: filePath,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"test scope\"),\n timeout_seconds: timeoutRaw ? parseOptionalNumber(timeoutRaw, \"timeout_seconds\") : undefined,\n pm_context_mode: parseLinkedTestContextMode(kv.pm_context_mode, \"--test\"),\n env_set: parseLinkedTestEnvSet(kv.env_set, \"--test\"),\n env_clear: parseLinkedTestEnvClear(kv.env_clear, \"--test\"),\n shared_host_safe: parseLinkedTestBoolean(kv.shared_host_safe, \"--test\", \"shared_host_safe\"),\n assert_stdout_contains: parseLinkedTestStringList(kv.assert_stdout_contains),\n assert_stdout_regex: parseLinkedTestRegexList(kv.assert_stdout_regex, \"--test\", \"assert_stdout_regex\"),\n assert_stderr_contains: parseLinkedTestStringList(kv.assert_stderr_contains),\n assert_stderr_regex: parseLinkedTestRegexList(kv.assert_stderr_regex, \"--test\", \"assert_stderr_regex\"),\n assert_stdout_min_lines: parseLinkedTestMinLines(kv.assert_stdout_min_lines, \"--test\"),\n assert_json_field_equals: parseLinkedTestAssertionEqualsMap(kv.assert_json_field_equals, \"--test\"),\n assert_json_field_gte: parseLinkedTestAssertionGteMap(kv.assert_json_field_gte, \"--test\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\n/**\n * Implements parse docs for the public runtime surface of this module.\n */\nexport function parseDocs(raw: string[] | undefined): { values: LinkedDoc[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--doc\", \"Use --clear-docs to clear linked docs.\");\n const values = raw.map((entry) => {\n const trimmedEntry = entry.trim();\n const isStructured = looksLikeStructuredEntry(trimmedEntry, LINKED_ARTIFACT_SEED_KEYS);\n const kv = isStructured ? parseCsvKv(entry, \"--doc\") : { path: trimmedEntry };\n if (isStructured) {\n assertNoUnknownCsvKeys(kv, \"--doc\", LINKED_ARTIFACT_SEED_KEYS);\n }\n if (!kv.path) {\n throw new PmCliError(\"--doc requires path=<value> or a bare doc path\", EXIT_CODE.USAGE);\n }\n return {\n path: kv.path,\n scope: ensureEnumValue(kv.scope ?? \"project\", SCOPE_VALUES, \"doc scope\"),\n note: parseOptionalString(kv.note),\n };\n });\n return { values, explicitEmpty: false };\n}\n\nfunction parseReminders(raw: string[] | undefined, nowValue: string): { values: Reminder[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--reminder\", \"Use --clear-reminders to clear reminders.\");\n return {\n values: parseReminderEntries(raw, new Date(nowValue), { valueMode: \"raw\" }),\n explicitEmpty: false,\n };\n}\n\nfunction parseEvents(raw: string[] | undefined, nowValue: string): { values: CalendarEvent[] | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) return { values: undefined, explicitEmpty: false };\n assertNoLegacyNoneTokens(raw, \"--event\", \"Use --clear-events to clear linked events.\");\n return {\n values: parseEventEntries(raw, new Date(nowValue), {\n allDayEmptyGuard: \"defined\",\n recurrenceEmptyNumericGuard: \"defined\",\n }),\n explicitEmpty: false,\n };\n}\n\nfunction buildChangedFields(\n frontMatter: ItemMetadata,\n body: string,\n explicitUnsets: string[],\n additionalFrontMatterKeys: readonly string[] = [],\n): string[] {\n const changed = [\n ...FRONT_MATTER_KEY_ORDER.filter((key) => frontMatter[key] !== undefined),\n ...additionalFrontMatterKeys.filter((key) => (frontMatter as unknown as Record<string, unknown>)[key] !== undefined),\n ...(body.length > 0 ? [\"body\"] : []),\n ...explicitUnsets.map((key) => `unset:${key}`),\n ];\n return Array.from(new Set(changed));\n}\n\nfunction buildHistoryMessage(baseMessage: string | undefined, explicitUnsets: string[]): string | undefined {\n const trimmed = baseMessage ?? \"\";\n if (explicitUnsets.length === 0) {\n return trimmed;\n }\n const suffix = `explicit_unset=${explicitUnsets.join(\",\")}`;\n return trimmed ? `${trimmed} | ${suffix}` : suffix;\n}\n\nfunction normalizeCreatePolicyOptionKey(raw: string, typeName: string, sourceLabel: string): string {\n const canonical = canonicalizeCommandOptionKey(\"create\", raw);\n if (!canonical) {\n throw new PmCliError(\n `Unsupported ${sourceLabel} entry \"${raw}\" for type \"${typeName}\"`,\n EXIT_CODE.CONFLICT,\n );\n }\n return canonical;\n}\n\nfunction parseTypeOptions(raw: string[] | undefined): { values: Record<string, string> | undefined; explicitEmpty: boolean } {\n if (!raw || raw.length === 0) {\n return { values: undefined, explicitEmpty: false };\n }\n assertNoLegacyNoneTokens(raw, \"--type-option\", \"Use --clear-type-options to clear existing type options.\");\n return {\n values: parseTypeOptionEntries(raw),\n explicitEmpty: false,\n };\n}\n\nasync function resolveCreateStdinInputs(options: CreateCommandOptions): Promise<CreateCommandOptions> {\n const stdinResolver = createStdinTokenResolver();\n return {\n ...options,\n body: await stdinResolver.resolveValue(options.body, \"--body\"),\n dep: await stdinResolver.resolveList(options.dep, \"--dep\"),\n comment: await stdinResolver.resolveList(options.comment, \"--comment\"),\n note: await stdinResolver.resolveList(options.note, \"--note\"),\n learning: await stdinResolver.resolveList(options.learning, \"--learning\"),\n file: await stdinResolver.resolveList(options.file, \"--file\"),\n test: await stdinResolver.resolveList(options.test, \"--test\"),\n doc: await stdinResolver.resolveList(options.doc, \"--doc\"),\n reminder: await stdinResolver.resolveList(options.reminder, \"--reminder\"),\n event: await stdinResolver.resolveList(options.event, \"--event\"),\n typeOption: await stdinResolver.resolveList(options.typeOption, \"--type-option\"),\n field: await stdinResolver.resolveList(options.field, \"--field\"),\n };\n}\n\nfunction resolveCreateMode(createMode: string | undefined, defaultMode: CreateMode): CreateMode {\n if (createMode === undefined) {\n return defaultMode;\n }\n const normalized = createMode.trim().toLowerCase();\n if (normalized.length === 0) {\n return defaultMode;\n }\n if (normalized === \"strict\" || normalized === \"progressive\") {\n return normalized;\n }\n throw new PmCliError(\n `Invalid --create-mode value \"${createMode}\". Allowed: ${CREATE_MODE_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveScheduleCreatePreset(raw: string | undefined): ScheduleCreatePreset | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0) {\n throw new PmCliError(\"--schedule-preset must not be empty\", EXIT_CODE.USAGE);\n }\n if (normalized === \"lightweight\" || normalized === \"lite\" || normalized === \"schedule-lite\") {\n return \"lightweight\";\n }\n throw new PmCliError(\n `Invalid --schedule-preset value \"${raw}\". Allowed: ${SCHEDULE_CREATE_PRESET_VALUES.join(\", \")}`,\n EXIT_CODE.USAGE,\n );\n}\n\nfunction resolveEffectiveCreateMode(\n createMode: string | undefined,\n schedulePreset: ScheduleCreatePreset | undefined,\n defaultMode: CreateMode,\n): CreateMode {\n const resolvedMode = resolveCreateMode(createMode, defaultMode);\n if (schedulePreset === undefined) {\n return resolvedMode;\n }\n const createModeWasExplicit = typeof createMode === \"string\" && createMode.trim().length > 0;\n if (createModeWasExplicit && resolvedMode === \"strict\") {\n throw new PmCliError(\n \"--schedule-preset lightweight cannot be combined with --create-mode strict. Use --create-mode progressive or omit --create-mode.\",\n EXIT_CODE.USAGE,\n );\n }\n return \"progressive\";\n}\n\nfunction requireCreateOptionByType(\n typeDefinition: ResolvedItemTypeDefinition,\n options: CreateCommandOptions,\n createMode: CreateMode,\n clearOptionKeys: Set<string>,\n): string[] {\n const typeName = typeDefinition.name;\n const scalarValues: Record<string, unknown> = {\n title: options.title,\n description: options.description,\n type: options.type,\n status: options.status,\n priority: options.priority,\n tags: options.tags,\n body: options.body,\n deadline: options.deadline,\n estimatedMinutes: options.estimatedMinutes,\n acceptanceCriteria: options.acceptanceCriteria,\n definitionOfReady: options.definitionOfReady,\n order: options.order ?? options.rank,\n goal: options.goal,\n objective: options.objective,\n value: options.value,\n impact: options.impact,\n outcome: options.outcome,\n whyNow: options.whyNow,\n author: options.author,\n message: options.message,\n assignee: options.assignee,\n parent: options.parent,\n reviewer: options.reviewer,\n risk: options.risk,\n confidence: options.confidence,\n sprint: options.sprint,\n release: options.release,\n blockedBy: options.blockedBy,\n blockedReason: options.blockedReason,\n unblockNote: options.unblockNote,\n reporter: options.reporter,\n severity: options.severity,\n environment: options.environment,\n reproSteps: options.reproSteps,\n resolution: options.resolution,\n expectedResult: options.expectedResult,\n actualResult: options.actualResult,\n affectedVersion: options.affectedVersion,\n fixedVersion: options.fixedVersion,\n component: options.component,\n regression: options.regression,\n customerImpact: options.customerImpact,\n };\n const repeatableValues: Record<string, unknown> = {\n dep: options.dep,\n comment: options.comment,\n note: options.note,\n learning: options.learning,\n file: options.file,\n test: options.test,\n doc: options.doc,\n reminder: options.reminder,\n event: options.event,\n typeOption: options.typeOption,\n field: options.field,\n };\n\n const hasOptionValue = (optionKey: string): boolean => {\n // `--add-tags` mutates the same `tags` field as `--tags`, so it must count\n // toward the `tags` command_option_policy (both the disabled guard and the\n // required check) — otherwise `--add-tags` would bypass a rule disabling\n // tags, or fail to satisfy a rule requiring them even though the created\n // item ends up tagged.\n if (optionKey === \"tags\") {\n return scalarValues.tags !== undefined || (Array.isArray(options.addTags) && options.addTags.length > 0);\n }\n if (optionKey in scalarValues) {\n return scalarValues[optionKey] !== undefined;\n }\n /* c8 ignore start -- policy probes only pass canonical CREATE_COMMAND_OPTION_KEYS, all of which exist in scalarValues/repeatableValues, so the in-repeatableValues false arm and trailing return are unreachable. */\n if (optionKey in repeatableValues) {\n const value = repeatableValues[optionKey];\n return Array.isArray(value) && value.length > 0;\n }\n return false;\n /* c8 ignore stop */\n };\n /* c8 ignore next -- policy probes only pass normalized option keys in command-level tests. */\n const hasOptionMutation = (optionKey: string): boolean => hasOptionValue(optionKey) || clearOptionKeys.has(optionKey);\n\n const baseRequiredOptions = new Set<string>([\"title\", \"type\"]);\n if (createMode === \"strict\") {\n for (const field of typeDefinition.required_create_fields) {\n baseRequiredOptions.add(normalizeCreatePolicyOptionKey(field, typeName, \"required_create_fields\"));\n }\n for (const field of typeDefinition.required_create_repeatables) {\n baseRequiredOptions.add(normalizeCreatePolicyOptionKey(field, typeName, \"required_create_repeatables\"));\n }\n }\n\n const policyState = resolveCommandOptionPolicyState(typeDefinition, \"create\", baseRequiredOptions);\n if (policyState.errors.length > 0) {\n throw new PmCliError(policyState.errors.join(\"; \"), EXIT_CODE.CONFLICT);\n }\n\n for (const option of policyState.disabled) {\n if (hasOptionMutation(option)) {\n throw new PmCliError(\n `Option ${commandOptionFlagLabel(\"create\", option)} is disabled for type \"${typeName}\" by command_option_policies`,\n EXIT_CODE.USAGE,\n );\n }\n }\n\n if (createMode === \"strict\") {\n const strictRequiredClears = policyState.required.filter((required) => clearOptionKeys.has(required));\n if (strictRequiredClears.length > 0) {\n /* c8 ignore next -- deterministic ordering fallback only matters when required clear list contains locale ties. */\n const requiredFlags = [...new Set(strictRequiredClears.map((required) => commandOptionFlagLabel(\"create\", required)))].sort(\n (left, right) => left.localeCompare(right),\n );\n /* c8 ignore next -- strict clear conflict envelope is covered by policy integration scenarios. */\n throw new PmCliError(\n `Strict create mode requires concrete values for ${requiredFlags.join(\", \")}; --unset/--clear-* directives cannot satisfy required options`,\n EXIT_CODE.USAGE,\n );\n }\n }\n\n // A configured per-type default_status satisfies a required `status` policy:\n // when --status is omitted, runCreate resolves to that default (or degrades to\n // the workflow open status), so blocking the agent for a \"missing --status\"\n // would contradict the config-driven default. Scoped to status so an explicit\n // status-required policy on a type WITHOUT a default still holds. Only the\n // required check is relaxed; the disabled check above keeps using hasOptionValue.\n const satisfiesRequiredOption = (optionKey: string): boolean => {\n if (optionKey === \"status\" && typeDefinition.default_status !== undefined) {\n return true;\n }\n return hasOptionValue(optionKey);\n };\n const missingRequiredOptions = policyState.required.filter((required) => !satisfiesRequiredOption(required));\n return [...new Set(missingRequiredOptions.map((required) => commandOptionFlagLabel(\"create\", required)))].sort((left, right) =>\n left.localeCompare(right),\n );\n}\n\nconst MISSING_REQUIRED_TYPE_OPTION_PATTERN = /^Missing required type option \"([^\"]+)\" for type \"([^\"]+)\"$/;\n\nfunction collectMissingRequiredTypeOptionKeys(errors: string[], typeName: string): string[] {\n const missingKeys: string[] = [];\n for (const error of errors) {\n const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);\n if (!match) {\n continue;\n }\n if (match[2] !== typeName) {\n continue;\n }\n missingKeys.push(match[1]);\n }\n return [...new Set(missingKeys)].sort((left, right) => left.localeCompare(right));\n}\n\nfunction filterNonMissingTypeOptionErrors(errors: string[], typeName: string): string[] {\n return errors.filter((error) => {\n const match = error.match(MISSING_REQUIRED_TYPE_OPTION_PATTERN);\n return !match || match[2] !== typeName;\n });\n}\n\nfunction typeOptionExampleValue(typeDefinition: ResolvedItemTypeDefinition, key: string): string {\n const optionDefinition = typeDefinition.options.find((option) => option.key === key);\n const firstAllowed = optionDefinition?.values[0];\n if (typeof firstAllowed === \"string\" && firstAllowed.trim().length > 0) {\n return firstAllowed;\n }\n return \"<value>\";\n}\n\nfunction createExampleTokensForFlag(flag: string, typeName: string, openStatus: string): string[] {\n switch (flag) {\n case \"--title\":\n return [\"--title\", `\"${typeName} example title\"`];\n case \"--description\":\n return [\"--description\", `\"${typeName} example description\"`];\n case \"--type\":\n return [\"--type\", typeName];\n case \"--status\":\n return [\"--status\", openStatus];\n case \"--priority\":\n return [\"--priority\", \"1\"];\n case \"--message\":\n return [\"--message\", `\"Create ${typeName} item\"`];\n case \"--dep\":\n return [\"--dep\", \"\\\"id=pm-xxxx,kind=related,author=maintainer,created_at=now\\\"\"];\n case \"--comment\":\n return [\"--comment\", \"\\\"author=maintainer,created_at=now,text=Implementation context\\\"\"];\n case \"--note\":\n return [\"--note\", \"\\\"author=maintainer,created_at=now,text=Design note\\\"\"];\n case \"--learning\":\n return [\"--learning\", \"\\\"author=maintainer,created_at=now,text=Durable lesson\\\"\"];\n case \"--file\":\n return [\"--file\", \"\\\"path=src/example.ts,note=implementation file\\\"\"];\n case \"--test\":\n return [\"--test\", \"\\\"command=node scripts/run-tests.mjs test,timeout_seconds=240\\\"\"];\n case \"--doc\":\n return [\"--doc\", \"\\\"path=README.md,note=reference doc\\\"\"];\n default:\n return [flag, \"\\\"<value>\\\"\"];\n }\n}\n\nfunction buildTypeSpecificCreateExample(\n typeDefinition: ResolvedItemTypeDefinition,\n missingCreateFlags: string[],\n missingTypeOptionKeys: string[],\n openStatus: string,\n): string {\n const tokens = [\"pm\", \"create\", \"--title\", `\"${typeDefinition.name} example title\"`, \"--description\", `\"${typeDefinition.name} example description\"`, \"--type\", typeDefinition.name];\n const optionalRecommendationFlags = [\"--status\", \"--priority\", \"--message\"];\n const orderedFlags = [...new Set([...optionalRecommendationFlags, ...missingCreateFlags])];\n const includedFlags = new Set<string>([\"--title\", \"--description\", \"--type\"]);\n for (const flag of orderedFlags) {\n if (includedFlags.has(flag)) {\n continue;\n }\n tokens.push(...createExampleTokensForFlag(flag, typeDefinition.name, openStatus));\n includedFlags.add(flag);\n }\n for (const key of missingTypeOptionKeys) {\n const value = typeOptionExampleValue(typeDefinition, key);\n tokens.push(\"--type-option\", `${key}=${value}`);\n }\n return tokens.join(\" \");\n}\n\nfunction requireStringOption(value: string | undefined, flag: string): string {\n if (value === undefined) {\n if (flag === \"--title\") {\n throw new PmCliError(\n 'Missing required option --title. Why required: every item needs a human-readable title for lookup, search, and reporting. Retry: pass the title as the first positional argument (example: pm create \"Fix login bug\" --type Issue) or with --title.',\n EXIT_CODE.USAGE,\n );\n }\n throw new PmCliError(`Missing required option ${flag}`, EXIT_CODE.USAGE);\n }\n return value;\n}\n\nfunction selectAuthor(explicitAuthor: string | undefined, settingsAuthor: string): string {\n const candidate = parseOptionalString(explicitAuthor) ?? process.env.PM_AUTHOR ?? settingsAuthor;\n const trimmed = candidate.trim();\n return trimmed || \"unknown\";\n}\n\nfunction ensurePriority(rawPriority: string | number): 0 | 1 | 2 | 3 | 4 {\n return resolvePriority(rawPriority);\n}\n\nfunction mergeCreateOptionsWithTemplate(\n templateOptions: Record<string, string | string[]>,\n explicitOptions: CreateCommandOptions,\n): CreateCommandOptions {\n const merged: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(templateOptions)) {\n merged[key] = Array.isArray(value) ? [...value] : value;\n }\n for (const [key, value] of Object.entries(explicitOptions)) {\n if (value !== undefined) {\n merged[key] = Array.isArray(value) ? [...value] : value;\n }\n }\n return merged as CreateCommandOptions;\n}\n\nfunction normalizeExtensionCommandPath(command: string): string {\n return command\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nfunction hasTemplatesShowHandler(): boolean {\n const registrations = getActiveExtensionRegistrations();\n if (!registrations) {\n return false;\n }\n return registrations.commands.some((entry) => {\n return entry.action === \"templates-show\" || normalizeExtensionCommandPath(entry.command) === \"templates show\";\n });\n}\n\nfunction readTemplateOptionsFromRuntimeResult(result: unknown, templateName: string): Record<string, string | string[]> {\n if (typeof result !== \"object\" || result === null || !(\"options\" in result)) {\n throw new PmCliError(\n `Templates package returned invalid payload for template \"${templateName}\". Expected an options object.`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const options = (result as { options?: unknown }).options;\n if (typeof options !== \"object\" || options === null || Array.isArray(options)) {\n throw new PmCliError(\n `Templates package returned invalid options for template \"${templateName}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n const normalized: Record<string, string | string[]> = {};\n for (const [key, value] of Object.entries(options as Record<string, unknown>)) {\n if (typeof value === \"string\") {\n normalized[key] = value;\n continue;\n }\n if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n normalized[key] = [...value];\n continue;\n }\n throw new PmCliError(\n `Templates package returned unsupported option value for \"${key}\" in template \"${templateName}\".`,\n EXIT_CODE.GENERIC_FAILURE,\n );\n }\n return normalized;\n}\n\nasync function loadCreateTemplateOptionsFromRuntime(\n templateName: string,\n global: GlobalOptions,\n pmRoot: string,\n): Promise<Record<string, string | string[]>> {\n if (!hasTemplatesShowHandler()) {\n throw new PmCliError(\n `--template requires the templates package. Install it first (for example: pm install templates --project).`,\n EXIT_CODE.USAGE,\n );\n }\n const handlerResult = await runActiveCommandHandler({\n command: \"templates show\",\n args: [templateName],\n options: {},\n global,\n pm_root: pmRoot,\n });\n if (!handlerResult.handled) {\n const warningSuffix = handlerResult.warnings.length > 0 ? ` (${handlerResult.warnings.join(\", \")})` : \"\";\n throw new PmCliError(\n `Unable to resolve template \"${templateName}\" via templates package. Run \"pm templates show ${templateName}\" for details.${warningSuffix}`,\n EXIT_CODE.USAGE,\n );\n }\n /* c8 ignore next -- template runtime success path is covered by package-level integration tests. */\n return readTemplateOptionsFromRuntimeResult(handlerResult.result, templateName);\n}\n\nfunction ensureInitHasRun(pmRoot: string): Promise<void> {\n return pathExists(getSettingsPath(pmRoot)).then((exists) => {\n /* c8 ignore next -- init guard failures are covered by top-level create command tests. */\n if (!exists) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n });\n}\n\n/**\n * Implements run create for the public runtime surface of this module.\n */\nexport async function runCreate(options: CreateCommandOptions, global: GlobalOptions): Promise<CreateResult> {\n let resolvedOptions = normalizeLegacyNoneCreateOptions(await resolveCreateStdinInputs(options));\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n await ensureInitHasRun(pmRoot);\n\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);\n const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());\n if (resolvedOptions.template !== undefined) {\n const templateName = resolvedOptions.template.trim();\n if (templateName.length === 0) {\n throw new PmCliError(\"--template must not be empty. Omit --template to disable template usage.\", EXIT_CODE.USAGE);\n }\n /* c8 ignore next -- template merge path is exercised in templates package integration tests. */\n const templateOptions = await loadCreateTemplateOptionsFromRuntime(templateName, global, pmRoot);\n resolvedOptions = normalizeLegacyNoneCreateOptions(mergeCreateOptionsWithTemplate(templateOptions, resolvedOptions));\n }\n if (resolvedOptions.type === undefined) {\n // Default-type fallback is suppressed under explicit --create-mode strict, where the strict\n // required-option contract takes precedence and surfaces the missing_required_option envelope.\n /* c8 ignore next -- explicit strict-mode template interactions are exercised in governance integration tests. */\n const explicitStrictMode = typeof resolvedOptions.createMode === \"string\"\n && resolvedOptions.createMode.trim().toLowerCase() === \"strict\";\n if (!explicitStrictMode) {\n /* c8 ignore next -- governance default-type fallback is validated in governance integration tests. */\n const defaultType = settings.governance.create_default_type?.trim();\n if (defaultType && defaultType.length > 0 && resolveTypeName(defaultType, typeRegistry)) {\n resolvedOptions.type = defaultType;\n } else {\n /* 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. */\n if (resolveTypeName(\"Task\", typeRegistry)) {\n resolvedOptions.type = \"Task\";\n }\n /* c8 ignore stop */\n }\n }\n }\n /* c8 ignore start -- missing/invalid type fallback guards are exercised by create command integration suites. */\n if (resolvedOptions.type === undefined) {\n throw new PmCliError(\"Missing required option --type <value>\", EXIT_CODE.USAGE);\n }\n let resolvedTypeName = resolveTypeName(resolvedOptions.type, typeRegistry);\n if (!resolvedTypeName) {\n // Never block on a near-miss type: map a known synonym (e.g. Bug -> Issue,\n // Change -> Chore) to its canonical built-in type when that type exists in the\n // active registry, and tell the agent how to make it a distinct custom type.\n const synonymCanonical = resolveTypeSynonym(resolvedOptions.type);\n const synonymResolved = synonymCanonical ? resolveTypeName(synonymCanonical, typeRegistry) : undefined;\n if (synonymResolved) {\n printError(\n `[pm] note: type '${resolvedOptions.type.trim()}' is not defined; using closest match '${synonymResolved}'. Run 'pm schema add-type \"${resolvedOptions.type.trim()}\"' to track it as a distinct type.`,\n );\n resolvedOptions.type = synonymResolved;\n resolvedTypeName = synonymResolved;\n } else {\n throw new PmCliError(\n buildInvalidTypeError(resolvedOptions.type, typeRegistry.types, resolveItemTypesFilePath(pmRoot, settings.schema)),\n EXIT_CODE.USAGE,\n );\n }\n }\n /* c8 ignore stop */\n const typeDefinition = resolveTypeDefinition(resolvedTypeName, typeRegistry);\n /* c8 ignore start -- resolvedTypeName came from resolveTypeName succeeding, so resolveTypeDefinition always returns a definition here. */\n if (!typeDefinition) {\n throw new PmCliError(`Invalid type value \"${resolvedOptions.type}\"`, EXIT_CODE.USAGE);\n }\n /* c8 ignore stop */\n const type = typeDefinition.name;\n const schedulePreset = resolveScheduleCreatePreset(resolvedOptions.schedulePreset);\n /* c8 ignore next -- schedule preset/type compatibility conflicts are validated in scheduler integration tests. */\n if (schedulePreset !== undefined && !SCHEDULE_CREATE_PRESET_TYPES.has(type)) {\n throw new PmCliError(\n `--schedule-preset ${schedulePreset} is only supported for Reminder, Meeting, or Event types`,\n EXIT_CODE.USAGE,\n );\n }\n const createMode = resolveEffectiveCreateMode(\n resolvedOptions.createMode,\n schedulePreset,\n settings.governance.create_mode_default,\n );\n const unsetTargets = parseCreateUnsetTargets(resolvedOptions.unset, runtimeFieldRegistry);\n const explicitUnsets = new Set<string>(unsetTargets.frontMatterKeys);\n const clearOptionKeys = new Set<string>(unsetTargets.optionKeys);\n\n const clearCollectionDefinitions: ReadonlyArray<{\n enabled: boolean | undefined;\n optionKey: string;\n clearFlag: string;\n valueFlag: string;\n values: string[] | undefined;\n frontMatterKey: string;\n }> = [\n {\n enabled: resolvedOptions.clearDeps,\n optionKey: \"dep\",\n clearFlag: \"--clear-deps\",\n valueFlag: \"--dep\",\n values: resolvedOptions.dep,\n frontMatterKey: \"dependencies\",\n },\n {\n enabled: resolvedOptions.clearComments,\n optionKey: \"comment\",\n clearFlag: \"--clear-comments\",\n valueFlag: \"--comment\",\n values: resolvedOptions.comment,\n frontMatterKey: \"comments\",\n },\n {\n enabled: resolvedOptions.clearNotes,\n optionKey: \"note\",\n clearFlag: \"--clear-notes\",\n valueFlag: \"--note\",\n values: resolvedOptions.note,\n frontMatterKey: \"notes\",\n },\n {\n enabled: resolvedOptions.clearLearnings,\n optionKey: \"learning\",\n clearFlag: \"--clear-learnings\",\n valueFlag: \"--learning\",\n values: resolvedOptions.learning,\n frontMatterKey: \"learnings\",\n },\n {\n enabled: resolvedOptions.clearFiles,\n optionKey: \"file\",\n clearFlag: \"--clear-files\",\n valueFlag: \"--file\",\n values: resolvedOptions.file,\n frontMatterKey: \"files\",\n },\n {\n enabled: resolvedOptions.clearTests,\n optionKey: \"test\",\n clearFlag: \"--clear-tests\",\n valueFlag: \"--test\",\n values: resolvedOptions.test,\n frontMatterKey: \"tests\",\n },\n {\n enabled: resolvedOptions.clearDocs,\n optionKey: \"doc\",\n clearFlag: \"--clear-docs\",\n valueFlag: \"--doc\",\n values: resolvedOptions.doc,\n frontMatterKey: \"docs\",\n },\n {\n enabled: resolvedOptions.clearReminders,\n optionKey: \"reminder\",\n clearFlag: \"--clear-reminders\",\n valueFlag: \"--reminder\",\n values: resolvedOptions.reminder,\n frontMatterKey: \"reminders\",\n },\n {\n enabled: resolvedOptions.clearEvents,\n optionKey: \"event\",\n clearFlag: \"--clear-events\",\n valueFlag: \"--event\",\n values: resolvedOptions.event,\n frontMatterKey: \"events\",\n },\n {\n enabled: resolvedOptions.clearTypeOptions,\n optionKey: \"typeOption\",\n clearFlag: \"--clear-type-options\",\n valueFlag: \"--type-option\",\n values: resolvedOptions.typeOption,\n frontMatterKey: \"type_options\",\n },\n ];\n for (const definition of clearCollectionDefinitions) {\n if (!definition.enabled) {\n continue;\n }\n /* c8 ignore next -- clear+value conflict paths are covered by command-surface parser tests. */\n if (definition.values && definition.values.length > 0) {\n throw new PmCliError(`Cannot combine ${definition.clearFlag} with ${definition.valueFlag}`, EXIT_CODE.USAGE);\n }\n explicitUnsets.add(definition.frontMatterKey);\n clearOptionKeys.add(definition.optionKey);\n }\n\n const scalarOptionPresence: Record<string, boolean> = {\n tags: resolvedOptions.tags !== undefined,\n deadline: resolvedOptions.deadline !== undefined,\n estimatedMinutes: resolvedOptions.estimatedMinutes !== undefined,\n acceptanceCriteria: resolvedOptions.acceptanceCriteria !== undefined,\n /* c8 ignore next -- definitionOfReady option presence is covered by legacy migration tests. */\n definitionOfReady: resolvedOptions.definitionOfReady !== undefined,\n order: resolvedOptions.order !== undefined || resolvedOptions.rank !== undefined,\n goal: resolvedOptions.goal !== undefined,\n objective: resolvedOptions.objective !== undefined,\n value: resolvedOptions.value !== undefined,\n impact: resolvedOptions.impact !== undefined,\n outcome: resolvedOptions.outcome !== undefined,\n whyNow: resolvedOptions.whyNow !== undefined,\n author: resolvedOptions.author !== undefined,\n assignee: resolvedOptions.assignee !== undefined,\n parent: resolvedOptions.parent !== undefined,\n reviewer: resolvedOptions.reviewer !== undefined,\n risk: resolvedOptions.risk !== undefined,\n confidence: resolvedOptions.confidence !== undefined,\n sprint: resolvedOptions.sprint !== undefined,\n release: resolvedOptions.release !== undefined,\n blockedBy: resolvedOptions.blockedBy !== undefined,\n blockedReason: resolvedOptions.blockedReason !== undefined,\n unblockNote: resolvedOptions.unblockNote !== undefined,\n reporter: resolvedOptions.reporter !== undefined,\n severity: resolvedOptions.severity !== undefined,\n environment: resolvedOptions.environment !== undefined,\n reproSteps: resolvedOptions.reproSteps !== undefined,\n resolution: resolvedOptions.resolution !== undefined,\n expectedResult: resolvedOptions.expectedResult !== undefined,\n actualResult: resolvedOptions.actualResult !== undefined,\n affectedVersion: resolvedOptions.affectedVersion !== undefined,\n fixedVersion: resolvedOptions.fixedVersion !== undefined,\n component: resolvedOptions.component !== undefined,\n regression: resolvedOptions.regression !== undefined,\n customerImpact: resolvedOptions.customerImpact !== undefined,\n };\n /* c8 ignore next -- scalar unset conflict checks are covered by update/create argument contract tests. */\n for (const [optionKey, hasValue] of Object.entries(scalarOptionPresence)) {\n if (!hasValue || !unsetTargets.optionKeys.has(optionKey)) {\n continue;\n }\n /* c8 ignore start -- every scalarOptionPresence key is in CREATE_OPTION_KEY_TO_UNSET_CANONICAL, so the `?? optionKey` fallback is unreachable. */\n const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey) ?? optionKey;\n /* c8 ignore stop */\n throw new PmCliError(\n `Cannot combine --unset ${unsetField} with ${commandOptionFlagLabel(\"create\", optionKey)}`,\n EXIT_CODE.USAGE,\n );\n }\n\n const assertNoLegacyScalarToken = (value: string | undefined, optionKey: string): void => {\n const unsetField = CREATE_OPTION_KEY_TO_UNSET_CANONICAL.get(optionKey);\n const hint = unsetField ? `Use --unset ${unsetField} to clear this field.` : undefined;\n assertNoLegacyNoneToken(value, commandOptionFlagLabel(\"create\", optionKey), hint);\n };\n assertNoLegacyScalarToken(resolvedOptions.tags, \"tags\");\n assertNoLegacyScalarToken(resolvedOptions.deadline, \"deadline\");\n assertNoLegacyScalarToken(resolvedOptions.estimatedMinutes, \"estimatedMinutes\");\n assertNoLegacyScalarToken(resolvedOptions.acceptanceCriteria, \"acceptanceCriteria\");\n /* c8 ignore next -- legacy none-token guard for definitionOfReady is covered in compatibility test suites. */\n assertNoLegacyScalarToken(resolvedOptions.definitionOfReady, \"definitionOfReady\");\n assertNoLegacyScalarToken(resolvedOptions.order ?? resolvedOptions.rank, \"order\");\n assertNoLegacyScalarToken(resolvedOptions.goal, \"goal\");\n assertNoLegacyScalarToken(resolvedOptions.objective, \"objective\");\n assertNoLegacyScalarToken(resolvedOptions.value, \"value\");\n assertNoLegacyScalarToken(resolvedOptions.impact, \"impact\");\n assertNoLegacyScalarToken(resolvedOptions.outcome, \"outcome\");\n assertNoLegacyScalarToken(resolvedOptions.whyNow, \"whyNow\");\n assertNoLegacyScalarToken(resolvedOptions.author, \"author\");\n assertNoLegacyScalarToken(resolvedOptions.assignee, \"assignee\");\n assertNoLegacyScalarToken(resolvedOptions.parent, \"parent\");\n assertNoLegacyScalarToken(resolvedOptions.reviewer, \"reviewer\");\n assertNoLegacyScalarToken(resolvedOptions.risk, \"risk\");\n assertNoLegacyScalarToken(resolvedOptions.confidence, \"confidence\");\n assertNoLegacyScalarToken(resolvedOptions.sprint, \"sprint\");\n assertNoLegacyScalarToken(resolvedOptions.release, \"release\");\n assertNoLegacyScalarToken(resolvedOptions.blockedBy, \"blockedBy\");\n assertNoLegacyScalarToken(resolvedOptions.blockedReason, \"blockedReason\");\n assertNoLegacyScalarToken(resolvedOptions.unblockNote, \"unblockNote\");\n assertNoLegacyScalarToken(resolvedOptions.reporter, \"reporter\");\n assertNoLegacyScalarToken(resolvedOptions.severity, \"severity\");\n assertNoLegacyScalarToken(resolvedOptions.environment, \"environment\");\n assertNoLegacyScalarToken(resolvedOptions.reproSteps, \"reproSteps\");\n assertNoLegacyScalarToken(resolvedOptions.resolution, \"resolution\");\n assertNoLegacyScalarToken(resolvedOptions.expectedResult, \"expectedResult\");\n assertNoLegacyScalarToken(resolvedOptions.actualResult, \"actualResult\");\n assertNoLegacyScalarToken(resolvedOptions.affectedVersion, \"affectedVersion\");\n assertNoLegacyScalarToken(resolvedOptions.fixedVersion, \"fixedVersion\");\n assertNoLegacyScalarToken(resolvedOptions.component, \"component\");\n assertNoLegacyScalarToken(resolvedOptions.regression, \"regression\");\n assertNoLegacyScalarToken(resolvedOptions.customerImpact, \"customerImpact\");\n\n const missingRequiredCreateFlags = requireCreateOptionByType(typeDefinition, resolvedOptions, createMode, clearOptionKeys);\n const nowValue = nowIso();\n const author = selectAuthor(resolvedOptions.author, settings.author_default);\n\n const dependencies = parseDependencies(resolvedOptions.dep, nowValue, settings.id_prefix);\n const comments = parseLogSeed(\"--comment\", resolvedOptions.comment, nowValue, author);\n const notes = parseLogSeed(\"--note\", resolvedOptions.note, nowValue, author);\n const learnings = parseLogSeed(\"--learning\", resolvedOptions.learning, nowValue, author);\n const files = parseFiles(resolvedOptions.file);\n const tests = parseTests(resolvedOptions.test);\n const docs = parseDocs(resolvedOptions.doc);\n const reminders = parseReminders(resolvedOptions.reminder, nowValue);\n const events = parseEvents(resolvedOptions.event, nowValue);\n const typeOptions = parseTypeOptions(resolvedOptions.typeOption);\n const validatedTypeOptions = validateTypeOptions(type, typeOptions.values, typeRegistry);\n const extensionRegistrations = getActiveExtensionRegistrations();\n const extensionFieldNames = collectRegisteredItemFieldNames(extensionRegistrations);\n const registeredItemFieldValues = parseRegisteredItemFieldAssignments(resolvedOptions.field, extensionRegistrations);\n for (const fieldKey of Object.keys(registeredItemFieldValues)) {\n if (!unsetTargets.frontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with --field ${fieldKey}=...`, EXIT_CODE.USAGE);\n }\n const runtimeCreateFieldValues = collectRuntimeCreateFieldValues(\n resolvedOptions as Record<string, unknown>,\n runtimeFieldRegistry,\n type,\n );\n /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */\n for (const fieldKey of Object.keys(runtimeCreateFieldValues.values ?? {})) {\n /* c8 ignore stop */\n if (!unsetTargets.frontMatterKeys.has(fieldKey)) {\n continue;\n }\n throw new PmCliError(`Cannot combine --unset ${fieldKey.replaceAll(\"_\", \"-\")} with its value flag`, EXIT_CODE.USAGE);\n }\n const missingRequiredTypeOptionKeys = collectMissingRequiredTypeOptionKeys(validatedTypeOptions.errors, type);\n const missingRequiredTypeOptionFlags = missingRequiredTypeOptionKeys.map((key) => `--type-option ${key}=<value>`);\n const combinedMissingFlags = [\n ...new Set([\n ...missingRequiredCreateFlags,\n ...missingRequiredTypeOptionFlags,\n /* c8 ignore next -- runtime-required flag aggregation is covered in runtime schema create tests. */\n ...runtimeCreateFieldValues.missing_required_flags,\n ]),\n ].sort((left, right) => left.localeCompare(right));\n if (combinedMissingFlags.length > 0) {\n const nextValidExample = buildTypeSpecificCreateExample(\n typeDefinition,\n missingRequiredCreateFlags,\n missingRequiredTypeOptionKeys,\n statusRegistry.open_status,\n );\n const nextSteps = [`Run \"pm create --help --type ${type}\" for type-aware required option guidance.`];\n if (combinedMissingFlags.includes(\"--title\")) {\n nextSteps.push('Title can also be passed as the first positional argument (example: pm create \"Your title\" --type ' + type + ').');\n }\n if (createMode === \"strict\") {\n nextSteps.push('For staged onboarding, retry with \"--create-mode progressive\".');\n if (SCHEDULE_CREATE_PRESET_TYPES.has(type)) {\n nextSteps.push('For minimal scheduling inputs, try \"--schedule-preset lightweight\".');\n }\n }\n const errorMessage =\n combinedMissingFlags.length === 1\n ? `Missing required option ${combinedMissingFlags[0]} for type \"${type}\"`\n : `Missing required options ${combinedMissingFlags.join(\", \")} for type \"${type}\"`;\n throw new PmCliError(errorMessage, EXIT_CODE.USAGE, {\n code: \"missing_required_option\",\n required: `Provide all required create options and type options for type \"${type}\" in one invocation.`,\n examples: [nextValidExample],\n nextSteps,\n recovery: createMode === \"strict\"\n ? {\n recovery_mode: \"compact\",\n missing_required_fields: combinedMissingFlags,\n suggested_flags: [\"--create-mode progressive\", ...combinedMissingFlags],\n }\n : undefined,\n });\n }\n const nonMissingTypeOptionErrors = filterNonMissingTypeOptionErrors(validatedTypeOptions.errors, type);\n if (nonMissingTypeOptionErrors.length > 0) {\n const nextValidExample = buildTypeSpecificCreateExample(typeDefinition, [], [], statusRegistry.open_status);\n throw new PmCliError(nonMissingTypeOptionErrors.join(\"; \"), EXIT_CODE.USAGE, {\n code: \"invalid_argument_value\",\n required: `Provide valid --type-option key/value pairs for type \"${type}\".`,\n examples: [nextValidExample],\n nextSteps: [`Run \"pm create --help --type ${type}\" to review allowed type-option keys and values.`],\n });\n }\n\n const id = await generateItemId(pmRoot, settings.id_prefix);\n let status =\n resolvedOptions.status !== undefined\n ? parseStatusValue(resolvedOptions.status, statusRegistry)\n : resolveCreateDefaultStatus(typeDefinition, statusRegistry);\n const priority = resolvedOptions.priority !== undefined ? ensurePriority(resolvedOptions.priority) : 2;\n // `--unset tags` clears the field; combining it with `--add-tags` is the same\n // contradiction that `--unset tags --tags ...` already rejects, so reject it\n // here rather than silently letting the additions win over the clear.\n if (\n unsetTargets.frontMatterKeys.has(\"tags\") &&\n Array.isArray(resolvedOptions.addTags) &&\n resolvedOptions.addTags.length > 0\n ) {\n throw new PmCliError(\"Cannot combine --unset tags with --add-tags\", EXIT_CODE.USAGE);\n }\n const baseTags = unsetTargets.frontMatterKeys.has(\"tags\")\n ? []\n : resolvedOptions.tags !== undefined\n ? parseTags(resolvedOptions.tags)\n : [];\n const tags = mergeAdditiveTags(baseTags, resolvedOptions.addTags);\n\n const deadline = unsetTargets.frontMatterKeys.has(\"deadline\")\n ? undefined\n : resolvedOptions.deadline === undefined\n ? undefined\n : resolveIsoOrRelative(resolvedOptions.deadline, new Date(nowValue), \"deadline\");\n const estimatedMinutes = unsetTargets.frontMatterKeys.has(\"estimated_minutes\")\n ? undefined\n : resolvedOptions.estimatedMinutes === undefined\n ? undefined\n : parseOptionalNumber(resolvedOptions.estimatedMinutes, \"estimated-minutes\");\n const acceptanceCriteria = unsetTargets.frontMatterKeys.has(\"acceptance_criteria\")\n ? undefined\n : resolvedOptions.acceptanceCriteria === undefined\n ? undefined\n : resolvedOptions.acceptanceCriteria;\n const definitionOfReady =\n unsetTargets.frontMatterKeys.has(\"definition_of_ready\") || resolvedOptions.definitionOfReady === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.definitionOfReady);\n if (\n resolvedOptions.order !== undefined &&\n resolvedOptions.rank !== undefined &&\n resolvedOptions.order !== resolvedOptions.rank\n ) {\n throw new PmCliError(\"--order and --rank must match when both are provided\", EXIT_CODE.USAGE);\n }\n const orderRaw = resolvedOptions.order ?? resolvedOptions.rank;\n const order =\n unsetTargets.frontMatterKeys.has(\"order\") || orderRaw === undefined ? undefined : parseOptionalNumber(orderRaw, \"order\");\n if (order !== undefined && !Number.isInteger(order)) {\n throw new PmCliError(\"Order must be an integer\", EXIT_CODE.USAGE);\n }\n const goal =\n unsetTargets.frontMatterKeys.has(\"goal\") || resolvedOptions.goal === undefined ? undefined : parseOptionalString(resolvedOptions.goal);\n const objective =\n unsetTargets.frontMatterKeys.has(\"objective\") || resolvedOptions.objective === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.objective);\n const value =\n unsetTargets.frontMatterKeys.has(\"value\") || resolvedOptions.value === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.value);\n const impact =\n unsetTargets.frontMatterKeys.has(\"impact\") || resolvedOptions.impact === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.impact);\n const outcome =\n unsetTargets.frontMatterKeys.has(\"outcome\") || resolvedOptions.outcome === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.outcome);\n const whyNow =\n unsetTargets.frontMatterKeys.has(\"why_now\") || resolvedOptions.whyNow === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.whyNow);\n const assignee =\n unsetTargets.frontMatterKeys.has(\"assignee\") || resolvedOptions.assignee === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.assignee);\n const authorValue = unsetTargets.frontMatterKeys.has(\"author\")\n ? undefined\n : parseOptionalString(resolvedOptions.author) ?? author;\n let parent =\n unsetTargets.frontMatterKeys.has(\"parent\") || resolvedOptions.parent === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.parent);\n // GH-161 (pm-72xf): when no explicit --parent was given (and parent is not\n // being unset), default the parent to the session \"focused\" item set via\n // `pm focus <id>`. An explicit --parent (even `--parent \"\"` to unset)\n // overrides focus. The inherited value flows through the same locateItem /\n // validateMissingParentReference path below, so a stale focus produces the\n // same clear missing-parent error/warning as an explicit stale --parent.\n let parentSource: \"focus\" | undefined;\n if (\n parent === undefined &&\n !unsetTargets.frontMatterKeys.has(\"parent\") &&\n resolvedOptions.parent === undefined\n ) {\n const focused = await getFocusedItem(pmRoot);\n if (focused !== undefined) {\n parent = focused;\n parentSource = \"focus\";\n }\n }\n const reviewer =\n unsetTargets.frontMatterKeys.has(\"reviewer\") || resolvedOptions.reviewer === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.reviewer);\n const riskRaw =\n unsetTargets.frontMatterKeys.has(\"risk\") || resolvedOptions.risk === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.risk);\n const risk = riskRaw !== undefined ? ensureEnumValue(normalizeRiskInput(riskRaw), RISK_VALUES, \"risk\") : undefined;\n const confidenceRaw =\n unsetTargets.frontMatterKeys.has(\"confidence\") || resolvedOptions.confidence === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.confidence);\n const confidence = confidenceRaw !== undefined ? parseConfidenceInput(confidenceRaw) : undefined;\n const parentReferencePolicy =\n resolvedOptions.allowMissingParent === true && settings.validation.parent_reference === \"strict_error\"\n ? \"warn\"\n : settings.validation.parent_reference;\n const sprintReleasePolicy = settings.validation.sprint_release_format;\n const validationWarnings: string[] = [];\n // Event-type items with no attached schedule never surface on the calendar; warn (never block).\n if (type.toLowerCase() === \"event\" && (events.values === undefined || events.values.length === 0)) {\n validationWarnings.push(`event_without_schedule:${id}:no_time_set`);\n }\n // Calendar-relevant types (Milestone, Meeting, Reminder, Event) with NO deadline AND no\n // reminders AND no events are invisible on `pm calendar`. Warn (never block) so the agent\n // can attach a schedule via `pm update`.\n const calendarRelevantTypes = new Set([\"milestone\", \"meeting\", \"reminder\", \"event\"]);\n const hasDeadline = deadline !== undefined;\n const hasReminders = reminders.values !== undefined && reminders.values.length > 0;\n const hasEvents = events.values !== undefined && events.values.length > 0;\n if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {\n // Keep the structured `calendar_item_without_schedule:<id>:<code>` prefix\n // stable (automation/telemetry match on it) and append the actionable hint\n // after the token (pm-2cgu / GH-174).\n validationWarnings.push(\n `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)`,\n );\n }\n if (parent !== undefined) {\n parent = normalizeParentReferenceValue(parent);\n const parentLocated = await locateItem(pmRoot, parent, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!parentLocated) {\n const normalizedParentId = normalizeItemId(parent, settings.id_prefix);\n validationWarnings.push(...validateMissingParentReference(normalizedParentId, parentReferencePolicy).warnings);\n }\n }\n let sprint =\n unsetTargets.frontMatterKeys.has(\"sprint\") || resolvedOptions.sprint === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.sprint);\n if (sprint !== undefined) {\n const sprintValidation = validateSprintOrReleaseValue(\"sprint\", sprint, sprintReleasePolicy);\n sprint = sprintValidation.value;\n validationWarnings.push(...sprintValidation.warnings);\n }\n let release =\n unsetTargets.frontMatterKeys.has(\"release\") || resolvedOptions.release === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.release);\n if (release !== undefined) {\n const releaseValidation = validateSprintOrReleaseValue(\"release\", release, sprintReleasePolicy);\n release = releaseValidation.value;\n validationWarnings.push(...releaseValidation.warnings);\n }\n const blockedBy =\n unsetTargets.frontMatterKeys.has(\"blocked_by\") || resolvedOptions.blockedBy === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.blockedBy);\n let dependencyValues = dependencies.values;\n if (blockedBy !== undefined) {\n const normalizedBlockedBy = normalizeItemId(blockedBy, settings.id_prefix);\n const blockedByLocated = await locateItem(pmRoot, normalizedBlockedBy, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (blockedByLocated) {\n const hasBlockedByDependency = (dependencyValues ?? []).some(\n (dependency) => dependency.id === blockedByLocated.id && dependency.kind === \"blocked_by\",\n );\n if (!hasBlockedByDependency) {\n dependencyValues = [\n ...(dependencyValues ?? []),\n {\n id: blockedByLocated.id,\n kind: \"blocked_by\",\n created_at: nowValue,\n author,\n },\n ];\n }\n if (resolvedOptions.status === undefined) {\n status = statusRegistry.blocked_statuses.has(\"blocked\")\n ? \"blocked\"\n : [...statusRegistry.blocked_statuses].sort((left, right) => left.localeCompare(right))[0] ?? statusRegistry.open_status;\n }\n }\n }\n const blockedReason =\n unsetTargets.frontMatterKeys.has(\"blocked_reason\") || resolvedOptions.blockedReason === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.blockedReason);\n const unblockNote =\n unsetTargets.frontMatterKeys.has(\"unblock_note\") || resolvedOptions.unblockNote === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.unblockNote);\n const reporter =\n /* c8 ignore next -- reporter normalization branch is covered in issue-template integration tests. */\n unsetTargets.frontMatterKeys.has(\"reporter\") || resolvedOptions.reporter === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.reporter);\n const severityRaw =\n unsetTargets.frontMatterKeys.has(\"severity\") || resolvedOptions.severity === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.severity);\n const severity =\n severityRaw !== undefined ? ensureEnumValue(normalizeSeverityInput(severityRaw), ISSUE_SEVERITY_VALUES, \"severity\") : undefined;\n const environment =\n unsetTargets.frontMatterKeys.has(\"environment\") || resolvedOptions.environment === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.environment);\n const reproSteps =\n unsetTargets.frontMatterKeys.has(\"repro_steps\") || resolvedOptions.reproSteps === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.reproSteps);\n const resolution =\n unsetTargets.frontMatterKeys.has(\"resolution\") || resolvedOptions.resolution === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.resolution);\n const expectedResult =\n unsetTargets.frontMatterKeys.has(\"expected_result\") || resolvedOptions.expectedResult === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.expectedResult);\n const actualResult =\n unsetTargets.frontMatterKeys.has(\"actual_result\") || resolvedOptions.actualResult === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.actualResult);\n const affectedVersion =\n unsetTargets.frontMatterKeys.has(\"affected_version\") || resolvedOptions.affectedVersion === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.affectedVersion);\n const fixedVersion =\n unsetTargets.frontMatterKeys.has(\"fixed_version\") || resolvedOptions.fixedVersion === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.fixedVersion);\n const component =\n unsetTargets.frontMatterKeys.has(\"component\") || resolvedOptions.component === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.component);\n const regressionRaw =\n unsetTargets.frontMatterKeys.has(\"regression\") || resolvedOptions.regression === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.regression);\n const regression = regressionRaw !== undefined ? parseRegressionInput(regressionRaw) : undefined;\n const customerImpact =\n unsetTargets.frontMatterKeys.has(\"customer_impact\") || resolvedOptions.customerImpact === undefined\n ? undefined\n : parseOptionalString(resolvedOptions.customerImpact);\n const title = requireStringOption(resolvedOptions.title, \"--title\");\n const description = resolvedOptions.description ?? \"\";\n const body = resolvedOptions.body ?? \"\";\n\n // GH-249: creating an item directly in the close status must honor\n // governance.require_close_reason, just like `pm close` (errors when missing)\n // and `pm update --status closed` (defaults + warns). Record a close_reason\n // derived from --message > --resolution, else a stable placeholder, and warn\n // when defaulted so the create path stops silently bypassing governance.\n let closeReason: string | undefined;\n if (status === statusRegistry.close_status && settings.governance.require_close_reason) {\n const messageText = typeof resolvedOptions.message === \"string\" ? resolvedOptions.message.trim() : \"\";\n const resolutionText = typeof resolution === \"string\" ? resolution.trim() : \"\";\n closeReason = messageText || resolutionText || CREATE_DIRECT_CLOSE_REASON_DEFAULT;\n if (messageText.length === 0 && resolutionText.length === 0) {\n validationWarnings.push(\"close_reason_defaulted\");\n }\n }\n\n const frontMatter: ItemMetadata = normalizeFrontMatter({\n id,\n title,\n description,\n type,\n type_options: validatedTypeOptions.normalized,\n status,\n close_reason: closeReason,\n priority,\n tags,\n created_at: nowValue,\n updated_at: nowValue,\n deadline,\n assignee,\n author: authorValue,\n estimated_minutes: estimatedMinutes,\n acceptance_criteria: acceptanceCriteria,\n definition_of_ready: definitionOfReady,\n order,\n goal,\n objective,\n value,\n impact,\n outcome,\n why_now: whyNow,\n parent,\n reviewer,\n risk,\n confidence,\n sprint,\n release,\n blocked_by: blockedBy,\n blocked_reason: blockedReason,\n unblock_note: unblockNote,\n reporter,\n severity,\n environment,\n repro_steps: reproSteps,\n resolution,\n expected_result: expectedResult,\n actual_result: actualResult,\n affected_version: affectedVersion,\n fixed_version: fixedVersion,\n component,\n regression,\n customer_impact: customerImpact,\n dependencies: dependencyValues,\n comments: comments.values as Comment[] | undefined,\n notes: notes.values as LogNote[] | undefined,\n learnings: learnings.values as LogNote[] | undefined,\n files: files.values,\n tests: tests.values,\n docs: docs.values,\n reminders: reminders.values,\n events: events.values,\n ...registeredItemFieldValues,\n ...runtimeCreateFieldValues.values,\n });\n try {\n applyRegisteredItemFieldDefaultsAndValidation(\n frontMatter as unknown as Record<string, unknown>,\n extensionRegistrations,\n );\n } catch (error: unknown) {\n /* c8 ignore start -- applyRegisteredItemFieldDefaultsAndValidation only throws Error instances, so the non-Error message fallback is unreachable. */\n throw new PmCliError(error instanceof Error ? error.message : \"Invalid extension item field values\", EXIT_CODE.USAGE);\n /* c8 ignore stop */\n }\n\n const afterDocument: ItemDocument = canonicalDocument(\n {\n metadata: frontMatter,\n body,\n },\n { schema: settings.schema, extensionFieldNames },\n );\n const beforeDocument: ItemDocument = {\n metadata: {} as ItemMetadata,\n body: \"\",\n };\n\n const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);\n const historyPath = getHistoryPath(pmRoot, id);\n const lockRelease = await acquireLock(\n pmRoot,\n id,\n settings.locks.ttl_seconds,\n author,\n false,\n settings.governance.force_required_for_stale_lock,\n );\n const explicitUnsetKeys = [...explicitUnsets].sort((left, right) => left.localeCompare(right));\n const historyMessage = buildHistoryMessage(resolvedOptions.message, explicitUnsetKeys);\n const changedFields = buildChangedFields(frontMatter, body, explicitUnsetKeys, [\n ...Object.keys(registeredItemFieldValues),\n /* c8 ignore start -- collectRuntimeCreateFieldValues always returns a `values` object, so the `?? {}` fallback is unreachable. */\n ...Object.keys(runtimeCreateFieldValues.values ?? {}),\n /* c8 ignore stop */\n ]);\n let hookWarnings: string[] = [];\n\n try {\n await writeFileAtomic(\n itemPath,\n serializeItemDocument(afterDocument, {\n format: settings.item_format,\n schema: settings.schema,\n extensionFieldNames,\n }),\n );\n try {\n const entry = createHistoryEntry({\n nowIso: nowValue,\n author,\n op: \"create\",\n before: beforeDocument,\n after: afterDocument,\n message: historyMessage,\n });\n await appendHistoryEntry(historyPath, entry);\n } catch (error: unknown) {\n await removeFileIfExists(itemPath);\n throw error;\n }\n hookWarnings = [\n ...(await runActiveOnWriteHooks({\n path: itemPath,\n scope: \"project\",\n op: \"create\",\n item_id: afterDocument.metadata.id,\n item_type: afterDocument.metadata.type,\n before: beforeDocument,\n after: afterDocument,\n changed_fields: changedFields,\n })),\n ...(await runActiveOnWriteHooks({\n path: historyPath,\n scope: \"project\",\n op: \"create:history\",\n item_id: afterDocument.metadata.id,\n item_type: afterDocument.metadata.type,\n before: beforeDocument,\n after: afterDocument,\n changed_fields: changedFields,\n })),\n ];\n recordAfterCommandAffectedItem({\n id: afterDocument.metadata.id,\n op: \"create\",\n item_type: afterDocument.metadata.type,\n status: afterDocument.metadata.status,\n current: projectAfterCommandItemSnapshot(afterDocument.metadata, changedFields),\n changed_fields: changedFields,\n });\n } finally {\n await lockRelease();\n }\n\n const outputItem = structuredClone(frontMatter);\n\n // GH-216: nudge agents toward the underutilized in_progress state instead of\n // jumping open -> closed. Only surfaces for workable types created in the open\n // status when the workflow defines a distinct in_progress status to move to.\n const nextTransition = suggestNextLifecycleTransition(id, type, status, statusRegistry);\n\n // After the create has committed (so the ID is real and shows up in the suggestion),\n // emit a single non-blocking stderr hint when the new item would be invisible on `pm\n // calendar`. The structured `calendar_item_without_schedule:*` warning above is what\n // automation reads; this stderr line is the human/agent-facing version with a\n // copy-pasteable `pm update` recipe.\n if (calendarRelevantTypes.has(type.toLowerCase()) && !hasDeadline && !hasReminders && !hasEvents) {\n printError(\n `[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>\"'.`,\n );\n }\n\n return {\n item: outputItem,\n changed_fields: changedFields,\n warnings: [...validationWarnings, ...hookWarnings],\n ...(parentSource !== undefined ? { parent_source: parentSource } : {}),\n ...(nextTransition !== undefined ? { next_transition: nextTransition } : {}),\n };\n}\n\nexport const _testOnlyCreateCommand = {\n buildHistoryMessage,\n buildInvalidLogSeedKeysMessage,\n buildTypeSpecificCreateExample,\n collectMissingRequiredTypeOptionKeys,\n createExampleTokensForFlag,\n filterNonMissingTypeOptionErrors,\n hasTemplatesShowHandler,\n loadCreateTemplateOptionsFromRuntime,\n looksLikeStructuredEntry,\n mergeCreateOptionsWithTemplate,\n normalizeCreatePolicyOptionKey,\n normalizeDependencyKindInput,\n normalizeExtensionCommandPath,\n parseCreateUnsetTargets,\n requireStringOption,\n readTemplateOptionsFromRuntimeResult,\n resolveRuntimeCreateUnsetDefinition: (token: string, registry: RuntimeFieldRegistry | undefined) =>\n resolveRuntimeUnsetFieldDefinition(token, \"create\", registry),\n typeOptionExampleValue,\n};\n"],"names":["endAt","value"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBO,IAAM,yBAA6D;EACxE,UAAU;EACV,MAAM;EACN,QAAQ;EACR,KAAK;EACL,SAAS;;AAGX,IAAM,qBAAqB,OAAO,KAAK,sBAAsB;AAMtD,IAAM,+BACX,2EACI,mBAAmB,KAAK,IAAI,CAAC;AAEnC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AAS;QAChC,WAAW,cAAc,SAAS;QAClC,QAAQ;QACR,OAAO;QACP,gBAAgB;OACjB;;AAEH,mCAA+B;MAC7B,IAAI,cAAc,SAAS;MAC3B,IAAI;MACJ,WAAW,cAAc,SAAS;MAClC,QAAQ,cAAc,SAAS;MAC/B,SAAS,gCAAgC,cAAc,UAAU,aAAa;MAC9E,gBAAgB;KACjB;EACH;AACE,UAAM,YAAW;EACnB;AAEA,QAAM,aAAa,gBAAgB,WAAW;AAK9C,QAAM,iBAAiB,+BAA+B,IAAI,MAAM,QAAQ,cAAc;AAOtF,MAAI,sBAAsB,IAAI,KAAK,YAAW,CAAE,KAAK,CAAC,eAAe,CAAC,gBAAgB,CAAC,WAAW;AAChG,eACE,iBAAiB,IAAI,KAAK,EAAE,sGAAiG,EAAE,oCAAoC,EAAE,oCAAoC;EAE7M;AAEA,SAAO;IACL,MAAM;IACN,gBAAgB;IAChB,UAAU,CAAC,GAAG,oBAAoB,GAAG,YAAY;IACjD,GAAI,iBAAiB,SAAY,EAAE,eAAe,aAAY,IAAK,CAAA;IACnE,GAAI,mBAAmB,SAAY,EAAE,iBAAiB,eAAc,IAAK,CAAA;;AAE7E;AAEO,IAAM,yBAAyB;EACpC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,qCAAqC,CAAC,OAAe,aACnD,mCAAmC,OAAO,UAAU,QAAQ;EAC9D","debugId":"fda2d3e3-d8fb-5267-a33c-580f9d20a672"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../../../../../cli/commands/close.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @module cli/commands/close\n *\n * Implements the pm close command surface and its agent-facing runtime behavior.\n */\nimport { pathExists } from \"../../core/fs/fs-utils.js\";\nimport { collectBlockedByIds } from \"../../core/item/actionability.js\";\nimport { toItemRecord } from \"../../core/item/item-record.js\";\nimport { isTerminalStatus } from \"../../core/item/status.js\";\nimport { resolveItemTypeRegistry } from \"../../core/item/type-registry.js\";\nimport { resolveRuntimeStatusRegistry, type RuntimeStatusRegistry } from \"../../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../../core/shared/command-types.js\";\nimport { PmCliError } from \"../../core/shared/errors.js\";\nimport {\n buildItemNotFoundError,\n listAllFrontMatterLight,\n locateItem,\n mutateItem,\n readLocatedItem,\n} from \"../../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../../core/store/paths.js\";\nimport { readSettings } from \"../../core/store/settings.js\";\nimport type { ItemFrontMatter } from \"../../types/index.js\";\n\n/**\n * Documents the close command options payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseCommandOptions {\n author?: string;\n message?: string;\n validateClose?: string;\n force?: boolean;\n // pm-fl0c #11 (2026-05-28): allow setting the three closure validation\n // fields inline on `pm close` so agents do not have to issue a prior\n // `pm update` just to satisfy --validate-close warn|strict. These map 1:1\n // to ItemFrontMatter.{resolution,expected_result,actual_result}.\n resolution?: string;\n expectedResult?: string;\n actualResult?: string;\n duplicateOf?: string;\n}\n\n/**\n * Documents the close result payload exchanged by command, SDK, and package integrations.\n */\nexport interface CloseResult {\n item: Record<string, unknown>;\n changed_fields: string[];\n warnings: string[];\n}\n\ninterface AutoUnblockCandidate {\n id: string;\n blocker_ids: string[];\n}\n\nfunction toAuthor(candidate: string | undefined, defaultAuthor: string): string {\n const resolved = candidate ?? process.env.PM_AUTHOR ?? defaultAuthor;\n const trimmed = resolved.trim();\n return trimmed || \"unknown\";\n}\n\nfunction normalizeCloseReason(reasonText: string | undefined, required: boolean): string | undefined {\n const reason = (reasonText ?? \"\").trim();\n if (reason.length > 0) {\n return reason;\n }\n if (required) {\n throw new PmCliError(\n \"Close reason text is required because governance.require_close_reason is enabled\",\n EXIT_CODE.USAGE,\n {\n code: \"close_reason_required\",\n required: \"Provide a one-line closing summary as the positional text or via --reason.\",\n why: \"governance.require_close_reason is enabled, so every close must record why the item is done.\",\n examples: [\n 'pm close <id> \"Done: <what changed and why>\"',\n 'pm close <id> --reason \"<closing summary>\"',\n \"pm close <id> --duplicate-of <canonical-id>\",\n ],\n nextSteps: [\n \"Re-run the close with a closing summary.\",\n 'When closing as a duplicate, --duplicate-of <id> auto-fills the close reason as \"Duplicate of <id>\".',\n \"To stop requiring reasons, run: pm config set governance-require-close-reason --policy disabled\",\n ],\n },\n );\n }\n return undefined;\n}\n\ntype ValidateCloseMode = \"off\" | \"warn\" | \"strict\";\n\nconst CLOSE_VALIDATION_FIELDS: Array<{ key: keyof Pick<ItemFrontMatter, \"resolution\" | \"expected_result\" | \"actual_result\">; label: string }> = [\n { key: \"resolution\", label: \"resolution\" },\n { key: \"expected_result\", label: \"expected_result\" },\n { key: \"actual_result\", label: \"actual_result\" },\n];\n\nfunction parseValidateCloseMode(raw: string | undefined): ValidateCloseMode | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = raw.trim().toLowerCase();\n if (normalized.length === 0 || normalized === \"warn\") {\n return \"warn\";\n }\n if (normalized === \"off\" || normalized === \"none\" || normalized === \"disabled\") {\n return \"off\";\n }\n if (normalized === \"strict\") {\n return \"strict\";\n }\n throw new PmCliError(`Invalid --validate-close mode \"${raw}\" (expected \"off\", \"warn\", or \"strict\")`, EXIT_CODE.USAGE);\n}\n\nfunction findMissingCloseValidationFields(frontMatter: ItemFrontMatter): string[] {\n const missing: string[] = [];\n for (const field of CLOSE_VALIDATION_FIELDS) {\n const rawValue = frontMatter[field.key];\n if (typeof rawValue !== \"string\" || rawValue.trim().length === 0) {\n missing.push(field.label);\n }\n }\n return missing;\n}\n\nasync function duplicateChainReferencesClosingItem(\n loadItemById: (id: string) => Promise<ItemFrontMatter | null>,\n initialDuplicateOf: unknown,\n closingId: string,\n): Promise<boolean> {\n const visited = new Set<string>();\n let current = initialDuplicateOf;\n while (typeof current === \"string\" && current.trim().length > 0) {\n const currentId = current.trim();\n if (currentId === closingId) {\n return true;\n }\n if (visited.has(currentId)) {\n return false;\n }\n visited.add(currentId);\n current = (await loadItemById(currentId))?.duplicate_of;\n }\n return false;\n}\n\nfunction shouldApplyDuplicateFallback(value: unknown): boolean {\n return typeof value !== \"string\" || value.trim().length === 0;\n}\n\nasync function assertDuplicateTargetExists(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n duplicateOf: string | undefined,\n closingId: string,\n): Promise<string | undefined> {\n const rawTarget = duplicateOf?.trim();\n if (!rawTarget) {\n return undefined;\n }\n if (rawTarget === closingId) {\n throw new PmCliError(\"An item cannot be closed as a duplicate of itself.\", EXIT_CODE.USAGE, {\n code: \"duplicate_target_self\",\n why: \"--duplicate-of must identify the canonical item that should remain open or already represent the work.\",\n });\n }\n const typeRegistry = resolveItemTypeRegistry(settings);\n const itemCache = new Map<string, ItemFrontMatter | null>();\n const loadItemById = async (id: string): Promise<ItemFrontMatter | null> => {\n if (itemCache.has(id)) {\n return itemCache.get(id) ?? null;\n }\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);\n if (!located) {\n itemCache.set(id, null);\n return null;\n }\n const { document } = await readLocatedItem(located, { schema: settings.schema });\n itemCache.set(id, document.metadata);\n return document.metadata;\n };\n const target = await loadItemById(rawTarget);\n if (!target) {\n throw new PmCliError(`Duplicate target \"${rawTarget}\" was not found. Create or locate the canonical item first.`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_missing\",\n why: \"Duplicate closure should point at a real canonical pm item so future dedupe and changelog tooling can trace the relationship.\",\n examples: [`pm close ${closingId} \"Duplicate of ${rawTarget}\" --duplicate-of ${rawTarget}`],\n nextSteps: [\"Run pm search/list to find the canonical item, then retry with --duplicate-of <id>.\"],\n });\n }\n if (await duplicateChainReferencesClosingItem(loadItemById, target.duplicate_of, closingId)) {\n throw new PmCliError(`Circular duplicate reference detected. Target \"${rawTarget}\" points back to \"${closingId}\".`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_circular\",\n why: \"Circular duplicate relationships create loops for dedupe and status propagation tooling.\",\n nextSteps: [\"Choose the existing canonical item, or clear the target duplicate_of metadata before closing this item as a duplicate.\"],\n });\n }\n if (typeof target.duplicate_of === \"string\" && target.duplicate_of.trim().length > 0) {\n throw new PmCliError(`Duplicate target \"${rawTarget}\" is already marked as a duplicate of \"${target.duplicate_of.trim()}\".`, EXIT_CODE.USAGE, {\n code: \"duplicate_target_is_duplicate\",\n why: \"Duplicate closure should point directly at the canonical item, not another duplicate.\",\n examples: [`pm close ${closingId} \"Duplicate of ${target.duplicate_of.trim()}\" --duplicate-of ${target.duplicate_of.trim()}`],\n nextSteps: [\"Use the canonical item referenced by duplicate_of as the --duplicate-of target.\"],\n });\n }\n return target.id;\n}\n\nasync function findActiveChildIds(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n parentId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n return items\n .filter((item) => item.parent === parentId && !isTerminalStatus(item.status, statusRegistry))\n .map((item) => item.id)\n .sort((left, right) => left.localeCompare(right));\n}\n\nasync function findAutoUnblockCandidates(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<AutoUnblockCandidate[]> {\n const typeRegistry = resolveItemTypeRegistry(settings);\n const items = await listAllFrontMatterLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const itemsById = new Map(items.map((item) => [item.id, item]));\n const blockedStatuses = statusRegistry.blocked_statuses;\n return items\n .filter((item) => blockedStatuses.has(item.status))\n .map((item) => ({ item, blockerIds: collectBlockedByIds(item) }))\n .filter(({ blockerIds }) => blockerIds.includes(closedId))\n .filter(({ blockerIds }) =>\n blockerIds.every((blockerId) => {\n const blocker = itemsById.get(blockerId);\n return blocker !== undefined && isTerminalStatus(blocker.status, statusRegistry);\n }),\n )\n .map(({ item, blockerIds }) => ({ id: item.id, blocker_ids: blockerIds }))\n .sort((left, right) => left.id.localeCompare(right.id));\n}\n\nasync function autoUnblockResolvedDependents(\n pmRoot: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n closedId: string,\n author: string,\n statusRegistry: RuntimeStatusRegistry,\n): Promise<string[]> {\n const candidates = await findAutoUnblockCandidates(pmRoot, settings, closedId, statusRegistry);\n const warnings: string[] = [];\n for (const candidate of candidates) {\n try {\n const unblocked = await mutateItem({\n pmRoot,\n settings,\n id: candidate.id,\n op: \"update\",\n author,\n message: `Auto-unblocked after blocker ${closedId} closed`,\n mutate(document) {\n /* c8 ignore start -- normal auto-unblock candidates carry dependency metadata; fallback preserves hand-edited scalar-only blockers. */\n const dependencies = document.metadata.dependencies ?? [];\n /* c8 ignore stop */\n const remainingDependencies = dependencies.filter((dependency) => {\n const dependencyId = dependency.id.trim();\n return dependency.kind !== \"blocked_by\" || !candidate.blocker_ids.includes(dependencyId);\n });\n document.metadata.status = statusRegistry.open_status;\n delete document.metadata.blocked_by;\n delete document.metadata.blocked_reason;\n document.metadata.unblock_note = `Auto-unblocked after blocker ${closedId} closed; all blockers resolved (${candidate.blocker_ids.join(\", \")}).`;\n if (remainingDependencies.length > 0) {\n document.metadata.dependencies = remainingDependencies;\n } else {\n delete document.metadata.dependencies;\n }\n const changedFields = [\"status\", \"blocked_by\", \"blocked_reason\", \"unblock_note\"];\n if (remainingDependencies.length !== dependencies.length) {\n changedFields.push(\"dependencies\");\n }\n return {\n changedFields,\n };\n },\n });\n warnings.push(`auto_unblocked:${unblocked.item.id}:resolved_blockers=${candidate.blocker_ids.join(\",\")}`);\n /* c8 ignore start -- defensive fan-out failure path; normal lock/claim state is auditable and still unblocks. */\n } catch (error) {\n const reason = error instanceof Error ? error.message.replace(/\\s+/g, \" \").trim() : \"unknown\";\n warnings.push(`auto_unblock_failed:${candidate.id}:${reason}`);\n }\n /* c8 ignore stop */\n }\n return warnings;\n}\n\nexport const _testOnlyCloseCommand = {\n blockedByIds: collectBlockedByIds,\n};\n\n/**\n * Implements run close for the public runtime surface of this module.\n */\nexport async function runClose(\n id: string,\n closeReasonText: string | undefined,\n options: CloseCommandOptions,\n global: GlobalOptions,\n): Promise<CloseResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);\n }\n\n const settings = await readSettings(pmRoot);\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const author = toAuthor(options.author, settings.author_default);\n // GH-250: verify the target item EXISTS before the governance close-reason\n // gate fires. Otherwise closing a typo'd id with no reason reports\n // \"Close reason text is required\" and hides the real cause (bad id) until a\n // reason is supplied. Existence is the more fundamental precondition, so it\n // is validated first regardless of whether a reason was provided.\n const typeToFolder = resolveItemTypeRegistry(settings).type_to_folder;\n const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeToFolder);\n if (!located) {\n throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeToFolder);\n }\n // GH-204: resolve the duplicate target BEFORE reason validation so\n // `pm close <id> --duplicate-of <canonical>` succeeds under\n // governance.require_close_reason without a manual reason — when no\n // positional/--reason text is provided the reason defaults to\n // \"Duplicate of <id>\" (mirroring the auto-filled closure metadata).\n // Explicit reason text still wins.\n const duplicateOf = await assertDuplicateTargetExists(pmRoot, settings, options.duplicateOf, id);\n // pm-7x8d / GH-204: when no explicit positional/--reason text is given, derive\n // the close reason from the next-best closure signal instead of hard-blocking\n // under governance.require_close_reason. Precedence: explicit reason text >\n // --duplicate-of (\"Duplicate of <id>\") > --resolution summary. The resolution\n // is still written to metadata.resolution below; reusing it as the close\n // reason just lets a single `pm close <id> --resolution \"...\"` succeed.\n const hasExplicitReason = (closeReasonText ?? \"\").trim().length > 0;\n const trimmedResolution = typeof options.resolution === \"string\" ? options.resolution.trim() : \"\";\n const effectiveCloseReasonText = hasExplicitReason\n ? closeReasonText\n : duplicateOf !== undefined\n ? `Duplicate of ${duplicateOf}`\n : trimmedResolution.length > 0\n ? trimmedResolution\n : closeReasonText;\n const closeReason = normalizeCloseReason(effectiveCloseReasonText, settings.governance.require_close_reason);\n const validateCloseMode = parseValidateCloseMode(options.validateClose) ?? settings.governance.close_validation_default;\n // C3 (pm-fu5d): scan for active children even under minimal governance so\n // closing a parent is never silently orphaning — off mode emits an\n // informational note instead of the warn/strict validation warning.\n const activeChildIds = await findActiveChildIds(pmRoot, settings, id, statusRegistry);\n\n const result = await mutateItem({\n pmRoot,\n settings,\n id,\n op: \"close\",\n author,\n message: options.message,\n force: options.force,\n mutate(document) {\n if (isTerminalStatus(document.metadata.status, statusRegistry) && !options.force) {\n throw new PmCliError(`Item ${document.metadata.id} is already terminal; use --force to close again.`, EXIT_CODE.CONFLICT);\n }\n const mutationWarnings: string[] = [];\n // pm-fl0c #11: apply inline closure fields BEFORE the validation pass so\n // a single `pm close <id> \"reason\" --resolution \"...\"` call satisfies\n // strict validation without a prior pm update. Only meaningful trimmed\n // text writes; an empty/whitespace value is a no-op rather than a clear.\n const inlineCloseFields: Array<{ option: string | undefined; key: \"resolution\" | \"expected_result\" | \"actual_result\" }> = [\n { option: options.resolution, key: \"resolution\" },\n { option: options.expectedResult, key: \"expected_result\" },\n { option: options.actualResult, key: \"actual_result\" },\n ];\n const duplicateFallbackFields: Array<\"resolution\" | \"expected_result\" | \"actual_result\"> = [];\n for (const { option, key } of inlineCloseFields) {\n if (typeof option !== \"string\") continue;\n const trimmed = option.trim();\n if (trimmed.length === 0) continue;\n document.metadata[key] = trimmed;\n }\n if (duplicateOf !== undefined) {\n document.metadata.duplicate_of = duplicateOf;\n const duplicateResolution = `Duplicate of ${duplicateOf}`;\n const duplicateExpectedResult = `Canonical item ${duplicateOf} tracks the work.`;\n const duplicateActualResult = `Closed as duplicate of ${duplicateOf}.`;\n if (shouldApplyDuplicateFallback(document.metadata.resolution)) {\n document.metadata.resolution = duplicateResolution;\n duplicateFallbackFields.push(\"resolution\");\n }\n if (shouldApplyDuplicateFallback(document.metadata.expected_result)) {\n document.metadata.expected_result = duplicateExpectedResult;\n duplicateFallbackFields.push(\"expected_result\");\n }\n if (shouldApplyDuplicateFallback(document.metadata.actual_result)) {\n document.metadata.actual_result = duplicateActualResult;\n duplicateFallbackFields.push(\"actual_result\");\n }\n }\n if (validateCloseMode !== \"off\") {\n const missingFields = findMissingCloseValidationFields(document.metadata);\n if (missingFields.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${document.metadata.id}: missing ${missingFields.join(\", \")}. Populate fields or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n mutationWarnings.push(`close_validation_missing_fields:${document.metadata.id}:${missingFields.join(\",\")}`);\n }\n if (activeChildIds.length > 0) {\n if (validateCloseMode === \"strict\") {\n throw new PmCliError(\n `Cannot close item ${document.metadata.id}: active child items remain open (${activeChildIds.join(\", \")}). Close, cancel, or re-parent them first, or use --validate-close warn.`,\n EXIT_CODE.USAGE,\n );\n }\n mutationWarnings.push(`close_validation_active_children:${document.metadata.id}:${activeChildIds.join(\",\")}`);\n }\n } else if (activeChildIds.length > 0) {\n // C3: minimal governance (validate-close off) should still tell the\n // agent it just closed a parent with open children, without blocking.\n mutationWarnings.push(`closed_with_active_children:${document.metadata.id}:${activeChildIds.join(\",\")}`);\n }\n\n document.metadata.status = statusRegistry.close_status;\n const changedFields = [\"status\"];\n if (closeReason !== undefined) {\n document.metadata.close_reason = closeReason;\n changedFields.push(\"close_reason\");\n } else if (document.metadata.close_reason !== undefined) {\n delete document.metadata.close_reason;\n changedFields.push(\"close_reason\");\n }\n for (const { option, key } of inlineCloseFields) {\n if (typeof option === \"string\" && option.trim().length > 0) {\n changedFields.push(key);\n }\n }\n if (duplicateOf !== undefined) {\n changedFields.push(\"duplicate_of\");\n if (duplicateFallbackFields.includes(\"resolution\") && !changedFields.includes(\"resolution\")) {\n changedFields.push(\"resolution\");\n }\n if (duplicateFallbackFields.includes(\"expected_result\") && !changedFields.includes(\"expected_result\")) {\n changedFields.push(\"expected_result\");\n }\n if (duplicateFallbackFields.includes(\"actual_result\") && !changedFields.includes(\"actual_result\")) {\n changedFields.push(\"actual_result\");\n }\n }\n if (document.metadata.assignee !== undefined) {\n delete document.metadata.assignee;\n changedFields.push(\"assignee\");\n }\n\n // C4 (pm-fu5d): a terminal item is no longer blocked. Clear every active\n // blocker signal independently — scalar blocked_by, blocked_reason, and the\n // blocked_by dependency edges (kept consistent with the kyd6 invariant) —\n // even if only some are present (e.g. an orphaned edge or a stale\n // blocked_reason left by manual edits), so closed work stops surfacing in\n // blockers views, and annotate the cleanup.\n const previousBlockedBy =\n typeof document.metadata.blocked_by === \"string\" ? document.metadata.blocked_by.trim() : \"\";\n const existingDeps = document.metadata.dependencies ?? [];\n const blockedByEdge = existingDeps.find((dep) => dep.kind === \"blocked_by\");\n const hadBlockedReason = document.metadata.blocked_reason !== undefined;\n if (previousBlockedBy.length > 0 || blockedByEdge !== undefined || hadBlockedReason) {\n if (previousBlockedBy.length > 0) {\n delete document.metadata.blocked_by;\n changedFields.push(\"blocked_by\");\n }\n if (hadBlockedReason) {\n delete document.metadata.blocked_reason;\n changedFields.push(\"blocked_reason\");\n }\n if (blockedByEdge !== undefined) {\n const remainingDeps = existingDeps.filter((dep) => dep.kind !== \"blocked_by\");\n if (remainingDeps.length > 0) {\n document.metadata.dependencies = remainingDeps;\n } else {\n delete document.metadata.dependencies;\n }\n changedFields.push(\"dependencies\");\n }\n const reportedBlocker = previousBlockedBy || blockedByEdge?.id || \"unknown\";\n mutationWarnings.push(`closed_cleared_blocked_by:${document.metadata.id}:${reportedBlocker}`);\n }\n\n return {\n changedFields,\n ...(mutationWarnings.length > 0 ? { warnings: mutationWarnings } : {}),\n };\n },\n });\n\n return {\n item: toItemRecord(result.item),\n changed_fields: result.changedFields,\n warnings: [\n ...result.warnings,\n ...(await autoUnblockResolvedDependents(pmRoot, settings, located.id, author, statusRegistry)),\n ],\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,SAAS,SAAS,WAA+B,eAAqB;AACpE,QAAM,WAAW,aAAa,QAAQ,IAAI,aAAa;AACvD,QAAM,UAAU,SAAS,KAAI;AAC7B,SAAO,WAAW;AACpB;AAEA,SAAS,qBAAqB,YAAgC,UAAiB;AAC7E,QAAM,UAAU,cAAc,IAAI,KAAI;AACtC,MAAI,OAAO,SAAS,GAAG;AACrB,WAAO;EACT;AACA,MAAI,UAAU;AACZ,UAAM,IAAI,WACR,oFACA,UAAU,OACV;MACE,MAAM;MACN,UAAU;MACV,KAAK;MACL,UAAU;QACR;QACA;QACA;;MAEF,WAAW;QACT;QACA;QACA;;KAEH;EAEL;AACA,SAAO;AACT;AAIA,IAAM,0BAA0I;EAC9I,EAAE,KAAK,cAAc,OAAO,aAAY;EACxC,EAAE,KAAK,mBAAmB,OAAO,kBAAiB;EAClD,EAAE,KAAK,iBAAiB,OAAO,gBAAe;;AAGhD,SAAS,uBAAuB,KAAuB;AACrD,MAAI,QAAQ,QAAW;AACrB,WAAO;EACT;AACA,QAAM,aAAa,IAAI,KAAI,EAAG,YAAW;AACzC,MAAI,WAAW,WAAW,KAAK,eAAe,QAAQ;AACpD,WAAO;EACT;AACA,MAAI,eAAe,SAAS,eAAe,UAAU,eAAe,YAAY;AAC9E,WAAO;EACT;AACA,MAAI,eAAe,UAAU;AAC3B,WAAO;EACT;AACA,QAAM,IAAI,WAAW,kCAAkC,GAAG,2CAA2C,UAAU,KAAK;AACtH;AAEA,SAAS,iCAAiC,aAA4B;AACpE,QAAM,UAAoB,CAAA;AAC1B,aAAW,SAAS,yBAAyB;AAC3C,UAAM,WAAW,YAAY,M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