@unbrained/pm-cli 2026.7.1 → 2026.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +3 -3
- package/CHANGELOG.md +25 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +1 -1
- package/dist/cli/commander-usage.d.ts +2 -0
- package/dist/cli/commander-usage.js +110 -86
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +79 -57
- package/dist/cli/commands/activity.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 +278 -243
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/close-many.js +176 -114
- 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 +32 -17
- 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/doctor.js +56 -67
- package/dist/cli/commands/extension/doctor.js.map +1 -1
- package/dist/cli/commands/extension/shared.js +21 -15
- package/dist/cli/commands/extension/shared.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 +545 -417
- 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-agent-guidance.js +32 -19
- package/dist/cli/commands/init-agent-guidance.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.js +152 -102
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/next.js +60 -40
- 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/profile.js +23 -15
- package/dist/cli/commands/profile.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 +503 -470
- 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 +424 -344
- 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 +738 -671
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +20 -1
- package/dist/cli/commands/validate.js +478 -343
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +406 -361
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +27 -19
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/help-json-payload.js +57 -49
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +47 -0
- package/dist/cli/main.js +474 -371
- 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 +299 -310
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +763 -779
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +386 -362
- 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.d.ts +4 -0
- package/dist/cli/registration-helpers.js +45 -56
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js → activity-5YWLSPGE.js} +9 -9
- package/dist/cli-bundle/chunks/activity-BIML7K2D.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js → aggregate-2V2M3JZU.js} +107 -83
- package/dist/cli-bundle/chunks/{aggregate-SDF7DUOD.js.map → aggregate-2V2M3JZU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{aggregate-JTEF4BP7.js → aggregate-EK7DXML7.js} +108 -84
- package/dist/cli-bundle/chunks/aggregate-EK7DXML7.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-LOVPGVPT.js → append-EZESUVJT.js} +8 -8
- package/dist/cli-bundle/chunks/{append-QCFJSDFL.js → append-JFG4WQMG.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-TP5Q5ZD3.js → chunk-32IUNTG4.js} +158 -119
- package/dist/cli-bundle/chunks/chunk-32IUNTG4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js → chunk-3W2HJKJX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VARHOHYV.js → chunk-4EXFFP7T.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-4EXFFP7T.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js → chunk-4PFVUUYV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JSU5P7VS.js → chunk-4WB6S4YX.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-4WB6S4YX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HXTQJXWT.js → chunk-572FKBRL.js} +61 -102
- package/dist/cli-bundle/chunks/chunk-572FKBRL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js → chunk-5E7N4T2Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js → chunk-5IZUBZBR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js → chunk-5JIWFWOZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FFMQB7WR.js → chunk-67LARBDL.js} +493 -404
- package/dist/cli-bundle/chunks/chunk-67LARBDL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js → chunk-6CDCWKSX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3K2M5OYU.js → chunk-6KRFL33E.js} +308 -184
- package/dist/cli-bundle/chunks/chunk-6KRFL33E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js → chunk-6NYJGMTY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js → chunk-7CLLC75T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-2466X6E4.js → chunk-7LYO6S5A.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js → chunk-A3OQ7TFW.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-5CGRF3L5.js → chunk-AIKU3IIL.js} +153 -90
- package/dist/cli-bundle/chunks/chunk-AIKU3IIL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-WYDHYJPO.js → chunk-AJHYQCBJ.js} +39 -5
- package/dist/cli-bundle/chunks/chunk-AJHYQCBJ.js.map +7 -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-OTUHB4HS.js → chunk-BE2SR6QL.js} +92 -77
- package/dist/cli-bundle/chunks/chunk-BE2SR6QL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JLM7BHI7.js → chunk-BI4R7HI2.js} +75 -53
- package/dist/cli-bundle/chunks/chunk-BI4R7HI2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AXIDKKAT.js → chunk-CXR3CMBQ.js} +33 -6
- package/dist/cli-bundle/chunks/chunk-CXR3CMBQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZETXE4SE.js → chunk-ECU6MMTQ.js} +713 -613
- package/dist/cli-bundle/chunks/chunk-ECU6MMTQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2D4HATP2.js → chunk-EJ2OCBHF.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-EJ2OCBHF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BDTISOSD.js → chunk-EQURFOMH.js} +41 -26
- package/dist/cli-bundle/chunks/chunk-EQURFOMH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js → chunk-ER4ME5U2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js → chunk-ERG65A2L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IZBR4NRW.js → chunk-F6WNBITZ.js} +157 -113
- package/dist/cli-bundle/chunks/chunk-F6WNBITZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js → chunk-FH2H3CBD.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-JPECA746.js → chunk-FUFFPIYA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CF7RL6FR.js → chunk-FZJM2TXF.js} +110 -73
- package/dist/cli-bundle/chunks/chunk-FZJM2TXF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js → chunk-GUYNUXQT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js → chunk-GVJE5T7Q.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3J6JRJ3I.js → chunk-HB4FAT3O.js} +42 -60
- package/dist/cli-bundle/chunks/chunk-HB4FAT3O.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-55SNVXRQ.js → chunk-HQAF23Q2.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-HQAF23Q2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js → chunk-JBZ2NTKX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMMQ74TG.js → chunk-JPATY4SE.js} +54 -30
- package/dist/cli-bundle/chunks/chunk-JPATY4SE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IPYBJWTE.js → chunk-K5DT2YKM.js} +109 -72
- package/dist/cli-bundle/chunks/chunk-K5DT2YKM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js → chunk-KEZOIPCR.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-RVUALSJF.js → chunk-KHVGM5CS.js} +466 -365
- package/dist/cli-bundle/chunks/chunk-KHVGM5CS.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YITK2PJ6.js → chunk-KS6ATO47.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-KS6ATO47.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7R4QEMZZ.js → chunk-L4SLHV6G.js} +463 -362
- package/dist/cli-bundle/chunks/chunk-L4SLHV6G.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RLDHZHQS.js → chunk-LBE5QFMZ.js} +158 -114
- package/dist/cli-bundle/chunks/chunk-LBE5QFMZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-22WKIL3H.js → chunk-LCWQP6NM.js} +76 -54
- package/dist/cli-bundle/chunks/chunk-LCWQP6NM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KNPEF7QG.js → chunk-LOWVNZBZ.js} +91 -76
- package/dist/cli-bundle/chunks/chunk-LOWVNZBZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js → chunk-MDHWWBNZ.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js → chunk-MEZZZBYX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-V3NOKJF2.js → chunk-MHRS5FUX.js} +288 -175
- package/dist/cli-bundle/chunks/chunk-MHRS5FUX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3XZCOZ5J.js → chunk-NOIEVOK5.js} +391 -313
- package/dist/cli-bundle/chunks/chunk-NOIEVOK5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js → chunk-NZ7QIUP5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js → chunk-OGLGI22K.js} +115 -67
- package/dist/cli-bundle/chunks/{chunk-UYUYDGIB.js.map → chunk-OGLGI22K.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js → chunk-P5L7Z2O6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BZCEN4JA.js → chunk-PULUSQAV.js} +492 -403
- package/dist/cli-bundle/chunks/chunk-PULUSQAV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3VGN2UWE.js → chunk-QCDTQCMW.js} +22 -30
- package/dist/cli-bundle/chunks/chunk-QCDTQCMW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js → chunk-QNNQAAZ5.js} +24 -18
- package/dist/cli-bundle/chunks/{chunk-4A3BJ675.js.map → chunk-QNNQAAZ5.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MDPEOIGN.js → chunk-RAHINBVP.js} +60 -101
- package/dist/cli-bundle/chunks/chunk-RAHINBVP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-CWFNTKQJ.js → chunk-RJH5VQHW.js} +43 -61
- package/dist/cli-bundle/chunks/chunk-RJH5VQHW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js → chunk-SU2E4AWU.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js → chunk-SU3TB4NS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JWXRETDF.js → chunk-SYE6WMV6.js} +626 -484
- package/dist/cli-bundle/chunks/chunk-SYE6WMV6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-NWMZWYYB.js → chunk-T3P7PMZP.js} +42 -27
- package/dist/cli-bundle/chunks/chunk-T3P7PMZP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js → chunk-T4XBKJ3F.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js → chunk-T6AXEBOP.js} +23 -17
- package/dist/cli-bundle/chunks/{chunk-RH5ZBYFD.js.map → chunk-T6AXEBOP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js → chunk-TQ6AX5SQ.js} +58 -69
- package/dist/cli-bundle/chunks/{chunk-5QFDBI4F.js.map → chunk-TQ6AX5SQ.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4XOIEKSD.js → chunk-U3S2B7TA.js} +86 -52
- package/dist/cli-bundle/chunks/chunk-U3S2B7TA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js → chunk-U5TR4N7J.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js → chunk-UMNQZS4H.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js → chunk-WJA3PXW7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-RGEMWD6Q.js → chunk-WRYERRZX.js} +157 -118
- package/dist/cli-bundle/chunks/chunk-WRYERRZX.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NUHHPVVS.js → chunk-WYOIIFSE.js} +712 -612
- package/dist/cli-bundle/chunks/chunk-WYOIIFSE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js → chunk-XRYSCRZR.js} +116 -68
- package/dist/cli-bundle/chunks/{chunk-4DSGXSBL.js.map → chunk-XRYSCRZR.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js → chunk-YF746GTH.js} +59 -70
- package/dist/cli-bundle/chunks/{chunk-NU2UEROZ.js.map → chunk-YF746GTH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js → chunk-YPWUSH72.js} +390 -312
- package/dist/cli-bundle/chunks/{chunk-JMP4E6D7.js.map → chunk-YPWUSH72.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js → chunk-YSDFIY7N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js → chunk-YSGTMDWC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NFDPYAIP.js → chunk-YVKZ3ANP.js} +21 -29
- package/dist/cli-bundle/chunks/chunk-YVKZ3ANP.js.map +7 -0
- 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-64HNBBFQ.js → chunk-Z5F6XZXE.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js → chunk-Z7RPDF2Y.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-3S2KT7NG.js → chunk-ZFTKYWIF.js} +152 -89
- package/dist/cli-bundle/chunks/chunk-ZFTKYWIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js → claim-2BGBGSVI.js} +8 -8
- package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js → claim-5GU7OE67.js} +8 -8
- package/dist/cli-bundle/chunks/close-6YODBUIV.js +14 -0
- package/dist/cli-bundle/chunks/{close-TQYAAFJP.js → close-AFVKPR57.js} +7 -7
- package/dist/cli-bundle/chunks/{close-many-BG5QQIDQ.js → close-many-7KLOSYLP.js} +186 -122
- package/dist/cli-bundle/chunks/close-many-7KLOSYLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-many-LDRVEQY2.js → close-many-JKUJMHLG.js} +187 -123
- package/dist/cli-bundle/chunks/close-many-JKUJMHLG.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js → comments-DNWHEBOS.js} +9 -9
- package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js → comments-RW23R3VE.js} +9 -9
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js +1072 -0
- package/dist/cli-bundle/chunks/config-AUM5WBYA.js.map +7 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js +1062 -0
- package/dist/cli-bundle/chunks/config-OZWSA2NP.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-B6275WPX.js → context-OYXRGY7S.js} +12 -12
- package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js → context-PKCEHQY3.js} +12 -12
- package/dist/cli-bundle/chunks/{contracts-HN7ABKLP.js → contracts-L6ODXNUM.js} +320 -199
- package/dist/cli-bundle/chunks/contracts-L6ODXNUM.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-W4FZVVD6.js → contracts-X74F2GSM.js} +321 -200
- package/dist/cli-bundle/chunks/contracts-X74F2GSM.js.map +1 -0
- package/dist/cli-bundle/chunks/{copy-DEM4DATS.js → copy-6XOR3HKN.js} +5 -5
- package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js → copy-I4NCLBR4.js} +5 -5
- package/dist/cli-bundle/chunks/{create-RLRJMRTM.js → create-PM45M6PE.js} +12 -12
- package/dist/cli-bundle/chunks/create-Z7YCH3BE.js +28 -0
- package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js → delete-7YXHYG67.js} +5 -5
- package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js → delete-LPISP43T.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js → deps-N2T26FME.js} +5 -5
- package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js → deps-WATKQDE3.js} +5 -5
- package/dist/cli-bundle/chunks/{docs-GYZNVS26.js → docs-6LQ3GLM7.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-26S44RXU.js → docs-Z3X6JZLT.js} +7 -7
- package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js → eval-6DCLG52D.js} +10 -10
- package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js → eval-Y3ZCUTHK.js} +10 -10
- package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js → extension-BNINIMT7.js} +11 -11
- package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js → extension-QWE4YYK5.js} +11 -11
- package/dist/cli-bundle/chunks/{files-NQHEXUZD.js → files-6SGKHS6O.js} +7 -7
- package/dist/cli-bundle/chunks/{files-MBNICQFM.js → files-FUYPSOFJ.js} +7 -7
- package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js → focus-2Q3K76G2.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XZW5423D.js → focus-ATLBWXXD.js} +6 -6
- package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js → gc-RUYEMNRF.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js → gc-TDWSDR66.js} +3 -3
- package/dist/cli-bundle/chunks/{get-A7MAOHCU.js → get-2WGLX74N.js} +120 -80
- package/dist/cli-bundle/chunks/get-2WGLX74N.js.map +7 -0
- package/dist/cli-bundle/chunks/{get-DSDEKJ3L.js → get-LY6M2JIM.js} +121 -81
- package/dist/cli-bundle/chunks/get-LY6M2JIM.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-3IPFLKXB.js → health-4RKHYS3T.js} +535 -371
- package/dist/cli-bundle/chunks/health-4RKHYS3T.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-GZXGBZ36.js → health-TMFVNYRA.js} +534 -370
- package/dist/cli-bundle/chunks/health-TMFVNYRA.js.map +7 -0
- package/dist/cli-bundle/chunks/history-CGNQJXFE.js +18 -0
- package/dist/cli-bundle/chunks/{history-NERDJNUB.js → history-SGRRS72R.js} +8 -8
- package/dist/cli-bundle/chunks/{history-compact-2WRZ2WK4.js → history-compact-LOED43R3.js} +213 -134
- package/dist/cli-bundle/chunks/history-compact-LOED43R3.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-HR7BB4LR.js → history-compact-V5DNAQHH.js} +214 -135
- package/dist/cli-bundle/chunks/history-compact-V5DNAQHH.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js → history-redact-IRL7WJ3E.js} +9 -9
- package/dist/cli-bundle/chunks/history-redact-N3JK7VBW.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-XA3LC4GA.js → history-repair-4WVBVHFR.js} +124 -84
- package/dist/cli-bundle/chunks/history-repair-4WVBVHFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-LCMOS45X.js → history-repair-PGYQJMGD.js} +123 -83
- package/dist/cli-bundle/chunks/history-repair-PGYQJMGD.js.map +7 -0
- package/dist/cli-bundle/chunks/{init-64XDLQJB.js → init-4GESW7RM.js} +12 -12
- package/dist/cli-bundle/chunks/init-XIDPABA4.js +22 -0
- package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js → learnings-4BHWFFUV.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js → learnings-4FJY7WIW.js} +9 -9
- package/dist/cli-bundle/chunks/{list-G5Y65VF6.js → list-472TIOVK.js} +8 -8
- package/dist/cli-bundle/chunks/{list-DNBJVO3E.js → list-D7BF5CL2.js} +8 -8
- package/dist/cli-bundle/chunks/{next-FYTQF6HG.js → next-D5STGWI2.js} +71 -46
- package/dist/cli-bundle/chunks/next-D5STGWI2.js.map +1 -0
- package/dist/cli-bundle/chunks/{next-BCERKDUR.js → next-SFQZVX2B.js} +70 -45
- package/dist/cli-bundle/chunks/next-SFQZVX2B.js.map +7 -0
- package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js → notes-6KNOSLIT.js} +9 -9
- package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js → notes-W4UEICGF.js} +9 -9
- package/dist/cli-bundle/chunks/{plan-RKZHQVXR.js → plan-JO6V7BXO.js} +373 -279
- package/dist/cli-bundle/chunks/plan-JO6V7BXO.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-4WXEQCTN.js → plan-MJQW5XK3.js} +372 -278
- package/dist/cli-bundle/chunks/plan-MJQW5XK3.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-4OMM32CD.js → profile-3TOTMUR4.js} +27 -19
- package/dist/cli-bundle/chunks/profile-3TOTMUR4.js.map +7 -0
- package/dist/cli-bundle/chunks/{profile-QLER5ENE.js → profile-WIQY2KCV.js} +28 -20
- package/dist/cli-bundle/chunks/profile-WIQY2KCV.js.map +1 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js +416 -0
- package/dist/cli-bundle/chunks/register-list-query-ELBHCCFI.js.map +7 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js +406 -0
- package/dist/cli-bundle/chunks/register-list-query-GAPQ6DM3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-KK7PHYYU.js → register-mutation-ROFE2YPC.js} +729 -702
- package/dist/cli-bundle/chunks/register-mutation-ROFE2YPC.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ENNDUAZG.js → register-mutation-SJWMVIJ2.js} +730 -703
- package/dist/cli-bundle/chunks/register-mutation-SJWMVIJ2.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-HZ6XERQG.js → register-operations-IADFVH53.js} +389 -365
- package/dist/cli-bundle/chunks/register-operations-IADFVH53.js.map +7 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js +510 -0
- package/dist/cli-bundle/chunks/register-operations-MEKU3AKC.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-ZKJ53RS7.js → register-setup-3QJY43CY.js} +128 -103
- package/dist/cli-bundle/chunks/register-setup-3QJY43CY.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-P67EMBDJ.js → register-setup-AJWUSSQX.js} +129 -104
- package/dist/cli-bundle/chunks/register-setup-AJWUSSQX.js.map +1 -0
- package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js → restore-44IHMMZZ.js} +9 -9
- package/dist/cli-bundle/chunks/restore-EXHU34EU.js +17 -0
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js → scheduling-shortcuts-OLHNLAZY.js} +12 -12
- package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js → scheduling-shortcuts-TSBK4AY5.js} +12 -12
- package/dist/cli-bundle/chunks/{schema-73HR2OJW.js → schema-IB2NZZWD.js} +7 -7
- package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js → schema-VBCELP5G.js} +7 -7
- package/dist/cli-bundle/chunks/{search-AXPXKZER.js → search-7UBETML4.js} +10 -10
- package/dist/cli-bundle/chunks/{search-KILGT37L.js → search-R227JOL6.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js → stats-FAG7COEH.js} +6 -6
- package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js → stats-MCK7PLYS.js} +6 -6
- package/dist/cli-bundle/chunks/{telemetry-GAHHQTOS.js → telemetry-DRPDZMAO.js} +84 -70
- package/dist/cli-bundle/chunks/telemetry-DRPDZMAO.js.map +7 -0
- package/dist/cli-bundle/chunks/{telemetry-BZUF6H7G.js → telemetry-GVVUQSJQ.js} +85 -71
- package/dist/cli-bundle/chunks/telemetry-GVVUQSJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-PWDIZ255.js → test-QY44WAMR.js} +15 -15
- package/dist/cli-bundle/chunks/{test-ACD52Z3S.js → test-SY76DZTO.js} +15 -15
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js +430 -0
- package/dist/cli-bundle/chunks/test-all-QD6QAEG7.js.map +7 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js +427 -0
- package/dist/cli-bundle/chunks/test-all-USPJHXFR.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-UXIXPDKU.js → test-runs-MG5VIGSK.js} +185 -147
- package/dist/cli-bundle/chunks/test-runs-MG5VIGSK.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-PLRAZEFW.js → test-runs-QIR5MJPL.js} +184 -146
- package/dist/cli-bundle/chunks/test-runs-QIR5MJPL.js.map +7 -0
- package/dist/cli-bundle/chunks/update-A7EICML6.js +24 -0
- package/dist/cli-bundle/chunks/{update-KFX2SIAC.js → update-IKJZWLQC.js} +15 -15
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js → update-many-BEMTDA2X.js} +84 -69
- package/dist/cli-bundle/chunks/{update-many-RNSBX2TA.js.map → update-many-BEMTDA2X.js.map} +1 -1
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js → update-many-RATAARHU.js} +83 -68
- package/dist/cli-bundle/chunks/{update-many-Z5GJS5LC.js.map → update-many-RATAARHU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js → upgrade-NWMR3VQL.js} +11 -11
- package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js → upgrade-VU46BLJZ.js} +11 -11
- package/dist/cli-bundle/chunks/{validate-X5W76YJL.js → validate-GAJ6FUSI.js} +451 -321
- package/dist/cli-bundle/chunks/validate-GAJ6FUSI.js.map +1 -0
- package/dist/cli-bundle/chunks/{validate-MTUVL5VC.js → validate-NRY6MFXN.js} +450 -320
- package/dist/cli-bundle/chunks/validate-NRY6MFXN.js.map +7 -0
- package/dist/cli-bundle/main.js +1107 -916
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/core/config/nested-settings.js +89 -67
- package/dist/core/config/nested-settings.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-type-definition.js +14 -14
- package/dist/core/item/item-type-definition.js.map +1 -1
- package/dist/core/item/type-registry.js +114 -99
- 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 +97 -80
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/status-defs-file.js +26 -3
- package/dist/core/schema/status-defs-file.js.map +1 -1
- package/dist/core/search/corpus.js +25 -19
- package/dist/core/search/corpus.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/shared/memo.d.ts +12 -0
- package/dist/core/shared/memo.js +25 -0
- package/dist/core/shared/memo.js.map +1 -0
- package/dist/core/shared/serialization.js +24 -14
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/time.js +26 -4
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +5 -0
- package/dist/core/store/front-matter-cache.js +316 -171
- 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/sdk/cli-contracts/flag-contracts.js +71 -99
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/compose.js +51 -42
- package/dist/sdk/compose.js.map +1 -1
- package/docs/AGENT_GUIDE.md +2 -2
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/COMMANDS.md +8 -4
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +12 -12
- package/docs/ONBOARDING.md +4 -2
- package/docs/README.md +2 -0
- package/docs/examples/starter-extension/README.md +11 -10
- package/marketplace.json +3 -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/plugins/pm-claude/.claude-plugin/plugin.json +2 -2
- package/plugins/pm-claude/README.md +6 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/dist/cli-bundle/chunks/activity-AW6XVFH6.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-JTEF4BP7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-22WKIL3H.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2D4HATP2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3J6JRJ3I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3K2M5OYU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3S2KT7NG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VGN2UWE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3XZCOZ5J.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4XOIEKSD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-55SNVXRQ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CGRF3L5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7R4QEMZZ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AXIDKKAT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BDTISOSD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BZCEN4JA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-CF7RL6FR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CWFNTKQJ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FFMQB7WR.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-HXTQJXWT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IPYBJWTE.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZBR4NRW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JLM7BHI7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-JSU5P7VS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXRETDF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-KNPEF7QG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MDPEOIGN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NFDPYAIP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NUHHPVVS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-NWMZWYYB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-OTUHB4HS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGEMWD6Q.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RLDHZHQS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RMMQ74TG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RVUALSJF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TP5Q5ZD3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-V3NOKJF2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VARHOHYV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WYDHYJPO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-YITK2PJ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ZETXE4SE.js.map +0 -1
- package/dist/cli-bundle/chunks/close-E6ZZGCJY.js +0 -14
- package/dist/cli-bundle/chunks/close-many-BG5QQIDQ.js.map +0 -7
- package/dist/cli-bundle/chunks/close-many-LDRVEQY2.js.map +0 -1
- package/dist/cli-bundle/chunks/config-DMSU64QO.js +0 -1541
- package/dist/cli-bundle/chunks/config-DMSU64QO.js.map +0 -7
- package/dist/cli-bundle/chunks/config-QH2DICD6.js +0 -1531
- package/dist/cli-bundle/chunks/config-QH2DICD6.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-HN7ABKLP.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-W4FZVVD6.js.map +0 -1
- package/dist/cli-bundle/chunks/create-OH3BDGBB.js +0 -28
- package/dist/cli-bundle/chunks/get-A7MAOHCU.js.map +0 -7
- package/dist/cli-bundle/chunks/get-DSDEKJ3L.js.map +0 -1
- package/dist/cli-bundle/chunks/health-3IPFLKXB.js.map +0 -1
- package/dist/cli-bundle/chunks/health-GZXGBZ36.js.map +0 -7
- package/dist/cli-bundle/chunks/history-WSZHY3PN.js +0 -18
- package/dist/cli-bundle/chunks/history-compact-2WRZ2WK4.js.map +0 -7
- package/dist/cli-bundle/chunks/history-compact-HR7BB4LR.js.map +0 -1
- package/dist/cli-bundle/chunks/history-redact-MP6CH7U5.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-LCMOS45X.js.map +0 -7
- package/dist/cli-bundle/chunks/history-repair-XA3LC4GA.js.map +0 -1
- package/dist/cli-bundle/chunks/init-PAX32BJA.js +0 -22
- package/dist/cli-bundle/chunks/next-BCERKDUR.js.map +0 -7
- package/dist/cli-bundle/chunks/next-FYTQF6HG.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-4WXEQCTN.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-RKZHQVXR.js.map +0 -1
- package/dist/cli-bundle/chunks/profile-4OMM32CD.js.map +0 -7
- package/dist/cli-bundle/chunks/profile-QLER5ENE.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js +0 -400
- package/dist/cli-bundle/chunks/register-list-query-7LV46VAU.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js +0 -410
- package/dist/cli-bundle/chunks/register-list-query-SNG5PGA4.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ENNDUAZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-KK7PHYYU.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js +0 -486
- package/dist/cli-bundle/chunks/register-operations-C6OWLDSH.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-HZ6XERQG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-P67EMBDJ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-ZKJ53RS7.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-YALDGTQR.js +0 -17
- package/dist/cli-bundle/chunks/telemetry-BZUF6H7G.js.map +0 -1
- package/dist/cli-bundle/chunks/telemetry-GAHHQTOS.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js +0 -358
- package/dist/cli-bundle/chunks/test-all-L2MDDUCA.js.map +0 -1
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js +0 -361
- package/dist/cli-bundle/chunks/test-all-RBZ6DLU2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-PLRAZEFW.js.map +0 -7
- package/dist/cli-bundle/chunks/test-runs-UXIXPDKU.js.map +0 -1
- package/dist/cli-bundle/chunks/update-AMRSOIWP.js +0 -24
- package/dist/cli-bundle/chunks/validate-MTUVL5VC.js.map +0 -7
- package/dist/cli-bundle/chunks/validate-X5W76YJL.js.map +0 -1
- /package/dist/cli-bundle/chunks/{activity-DBLQVIP6.js.map → activity-5YWLSPGE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-AW6XVFH6.js.map → activity-BIML7K2D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-LOVPGVPT.js.map → append-EZESUVJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-QCFJSDFL.js.map → append-JFG4WQMG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BHO33VBQ.js.map → chunk-3W2HJKJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4DUVCVLZ.js.map → chunk-4PFVUUYV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IJYK2T43.js.map → chunk-5E7N4T2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKZAN7BD.js.map → chunk-5IZUBZBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NOLPZMSV.js.map → chunk-5JIWFWOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6AQZPVHQ.js.map → chunk-6CDCWKSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LB6TP6MC.js.map → chunk-6NYJGMTY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SLMUGTK3.js.map → chunk-7CLLC75T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2466X6E4.js.map → chunk-7LYO6S5A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W4ULYO7Z.js.map → chunk-A3OQ7TFW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GJ326ZKX.js.map → chunk-ER4ME5U2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HZZEHPRG.js.map → chunk-ERG65A2L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L5OEFZQG.js.map → chunk-FH2H3CBD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JPECA746.js.map → chunk-FUFFPIYA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-27BXPBAY.js.map → chunk-GUYNUXQT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MAUKX7JC.js.map → chunk-GVJE5T7Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZRP4VG5U.js.map → chunk-JBZ2NTKX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EJUDVUYZ.js.map → chunk-KEZOIPCR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HYTGA6GI.js.map → chunk-MDHWWBNZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N74UMG5H.js.map → chunk-MEZZZBYX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SDR5J34Q.js.map → chunk-NZ7QIUP5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDPTYJIM.js.map → chunk-P5L7Z2O6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OGXLACHC.js.map → chunk-SU2E4AWU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HPPFYYOV.js.map → chunk-SU3TB4NS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G7I7DEZA.js.map → chunk-T4XBKJ3F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VICZWYGZ.js.map → chunk-U5TR4N7J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EVMTBV6V.js.map → chunk-UMNQZS4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A7FPBAQS.js.map → chunk-WJA3PXW7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QCWF6IYD.js.map → chunk-YSDFIY7N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UZIWVBE6.js.map → chunk-YSGTMDWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-64HNBBFQ.js.map → chunk-Z5F6XZXE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AVEE5EHK.js.map → chunk-Z7RPDF2Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-T3GCKV7C.js.map → claim-2BGBGSVI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-EMQLYPRW.js.map → claim-5GU7OE67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-E6ZZGCJY.js.map → close-6YODBUIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-TQYAAFJP.js.map → close-AFVKPR57.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-YUXJRZPQ.js.map → comments-DNWHEBOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-QCKR2YY2.js.map → comments-RW23R3VE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-B6275WPX.js.map → context-OYXRGY7S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{context-OCZ3FJ4Z.js.map → context-PKCEHQY3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-DEM4DATS.js.map → copy-6XOR3HKN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-BTJOSKKT.js.map → copy-I4NCLBR4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-RLRJMRTM.js.map → create-PM45M6PE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-OH3BDGBB.js.map → create-Z7YCH3BE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-BHK7VB2Z.js.map → delete-7YXHYG67.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-LSVHAB4Y.js.map → delete-LPISP43T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-XHYXWEPT.js.map → deps-N2T26FME.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-4UDFJRUA.js.map → deps-WATKQDE3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-GYZNVS26.js.map → docs-6LQ3GLM7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-26S44RXU.js.map → docs-Z3X6JZLT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-UYF3ZPVO.js.map → eval-6DCLG52D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{eval-PGRVIJQU.js.map → eval-Y3ZCUTHK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CPSLJQVE.js.map → extension-BNINIMT7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CXJ6RELI.js.map → extension-QWE4YYK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-NQHEXUZD.js.map → files-6SGKHS6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-MBNICQFM.js.map → files-FUYPSOFJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-DWYIG7GU.js.map → focus-2Q3K76G2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XZW5423D.js.map → focus-ATLBWXXD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-LPVMKJQJ.js.map → gc-RUYEMNRF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-7GQYOS2G.js.map → gc-TDWSDR66.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-WSZHY3PN.js.map → history-CGNQJXFE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-NERDJNUB.js.map → history-SGRRS72R.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-O3NBCNWC.js.map → history-redact-IRL7WJ3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-MP6CH7U5.js.map → history-redact-N3JK7VBW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-64XDLQJB.js.map → init-4GESW7RM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-PAX32BJA.js.map → init-XIDPABA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-LPKCSJX7.js.map → learnings-4BHWFFUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-JR6MA5TI.js.map → learnings-4FJY7WIW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-G5Y65VF6.js.map → list-472TIOVK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-DNBJVO3E.js.map → list-D7BF5CL2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2BMU3VVQ.js.map → notes-6KNOSLIT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-6KTGO2OJ.js.map → notes-W4UEICGF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-4MHZFJ2E.js.map → restore-44IHMMZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-YALDGTQR.js.map → restore-EXHU34EU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-LB6DOLRL.js.map → scheduling-shortcuts-OLHNLAZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{scheduling-shortcuts-UTOYKLXQ.js.map → scheduling-shortcuts-TSBK4AY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-73HR2OJW.js.map → schema-IB2NZZWD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U6LJKSIR.js.map → schema-VBCELP5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-AXPXKZER.js.map → search-7UBETML4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-KILGT37L.js.map → search-R227JOL6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-W5KNVJWQ.js.map → stats-FAG7COEH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-PSYVVTNZ.js.map → stats-MCK7PLYS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-PWDIZ255.js.map → test-QY44WAMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-ACD52Z3S.js.map → test-SY76DZTO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-AMRSOIWP.js.map → update-A7EICML6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-KFX2SIAC.js.map → update-IKJZWLQC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-BRL6KCOJ.js.map → upgrade-NWMR3VQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-HAK6JG2O.js.map → upgrade-VU46BLJZ.js.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Defines item parsing, formatting, and lifecycle helpers for Type Registry.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
7
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e9e27e2d-967c-5e17-8266-d661f65b78ac")}catch(e){}}();
|
|
8
8
|
import { TYPE_TO_FOLDER } from "../shared/constants.js";
|
|
9
9
|
import { ITEM_TYPE_VALUES } from "../../types/index.js";
|
|
10
10
|
import { normalizeItemTypeDefinition as normalizeSharedItemTypeDefinition, normalizeItemTypeStringList, strictPolicyCommand, } from "./item-type-definition.js";
|
|
@@ -330,6 +330,62 @@ function toSlugToken(value) {
|
|
|
330
330
|
function normalizeTypeDefinition(definition) {
|
|
331
331
|
return normalizeSharedItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });
|
|
332
332
|
}
|
|
333
|
+
function readStringArray(record, key) {
|
|
334
|
+
const value = record[key];
|
|
335
|
+
return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : undefined;
|
|
336
|
+
}
|
|
337
|
+
function coerceOptionDefinitionFromUnknown(raw) {
|
|
338
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
const optionRecord = raw;
|
|
342
|
+
if (typeof optionRecord.key !== "string") {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
key: optionRecord.key,
|
|
347
|
+
values: readStringArray(optionRecord, "values") ?? [],
|
|
348
|
+
required: optionRecord.required === undefined ? undefined : Boolean(optionRecord.required),
|
|
349
|
+
aliases: readStringArray(optionRecord, "aliases"),
|
|
350
|
+
description: typeof optionRecord.description === "string" ? optionRecord.description : undefined,
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
function coerceCommandOptionPolicyFromUnknown(raw) {
|
|
354
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
355
|
+
return null;
|
|
356
|
+
}
|
|
357
|
+
const policyRecord = raw;
|
|
358
|
+
if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
|
|
359
|
+
return null;
|
|
360
|
+
}
|
|
361
|
+
const normalizedCommand = policyRecord.command.trim().toLowerCase();
|
|
362
|
+
if (normalizedCommand !== "create" && normalizedCommand !== "update") {
|
|
363
|
+
return null;
|
|
364
|
+
}
|
|
365
|
+
return {
|
|
366
|
+
command: normalizedCommand,
|
|
367
|
+
option: policyRecord.option,
|
|
368
|
+
required: policyRecord.required === undefined ? undefined : Boolean(policyRecord.required),
|
|
369
|
+
visible: policyRecord.visible === undefined ? undefined : Boolean(policyRecord.visible),
|
|
370
|
+
enabled: policyRecord.enabled === undefined ? undefined : Boolean(policyRecord.enabled),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
function coerceOptionDefinitionsFromRecord(record) {
|
|
374
|
+
if (!Array.isArray(record.options)) {
|
|
375
|
+
return undefined;
|
|
376
|
+
}
|
|
377
|
+
return record.options
|
|
378
|
+
.map((entry) => coerceOptionDefinitionFromUnknown(entry))
|
|
379
|
+
.filter((entry) => entry !== null);
|
|
380
|
+
}
|
|
381
|
+
function coerceCommandOptionPoliciesFromRecord(record) {
|
|
382
|
+
if (!Array.isArray(record.command_option_policies)) {
|
|
383
|
+
return undefined;
|
|
384
|
+
}
|
|
385
|
+
return record.command_option_policies
|
|
386
|
+
.map((entry) => coerceCommandOptionPolicyFromUnknown(entry))
|
|
387
|
+
.filter((entry) => entry !== null);
|
|
388
|
+
}
|
|
333
389
|
function coerceTypeDefinitionFromUnknown(raw) {
|
|
334
390
|
if (typeof raw !== "object" || raw === null || Array.isArray(raw)) {
|
|
335
391
|
return null;
|
|
@@ -342,73 +398,38 @@ function coerceTypeDefinitionFromUnknown(raw) {
|
|
|
342
398
|
const folder = typeof record.folder === "string" ? record.folder : undefined;
|
|
343
399
|
const description = typeof record.description === "string" ? record.description : undefined;
|
|
344
400
|
const defaultStatus = typeof record.default_status === "string" ? record.default_status : undefined;
|
|
345
|
-
const aliases = Array.isArray(record.aliases) ? record.aliases.filter((value) => typeof value === "string") : undefined;
|
|
346
|
-
const requiredCreateFields = Array.isArray(record.required_create_fields)
|
|
347
|
-
? record.required_create_fields.filter((value) => typeof value === "string")
|
|
348
|
-
: undefined;
|
|
349
|
-
const requiredCreateRepeatables = Array.isArray(record.required_create_repeatables)
|
|
350
|
-
? record.required_create_repeatables.filter((value) => typeof value === "string")
|
|
351
|
-
: undefined;
|
|
352
|
-
let options;
|
|
353
|
-
if (Array.isArray(record.options)) {
|
|
354
|
-
options = [];
|
|
355
|
-
for (const entry of record.options) {
|
|
356
|
-
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
const optionRecord = entry;
|
|
360
|
-
if (typeof optionRecord.key !== "string") {
|
|
361
|
-
continue;
|
|
362
|
-
}
|
|
363
|
-
options.push({
|
|
364
|
-
key: optionRecord.key,
|
|
365
|
-
values: Array.isArray(optionRecord.values)
|
|
366
|
-
? optionRecord.values.filter((value) => typeof value === "string")
|
|
367
|
-
: [],
|
|
368
|
-
required: optionRecord.required === undefined ? undefined : Boolean(optionRecord.required),
|
|
369
|
-
aliases: Array.isArray(optionRecord.aliases)
|
|
370
|
-
? optionRecord.aliases.filter((value) => typeof value === "string")
|
|
371
|
-
: undefined,
|
|
372
|
-
description: typeof optionRecord.description === "string" ? optionRecord.description : undefined,
|
|
373
|
-
});
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
let commandOptionPolicies;
|
|
377
|
-
if (Array.isArray(record.command_option_policies)) {
|
|
378
|
-
commandOptionPolicies = [];
|
|
379
|
-
for (const entry of record.command_option_policies) {
|
|
380
|
-
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
381
|
-
continue;
|
|
382
|
-
}
|
|
383
|
-
const policyRecord = entry;
|
|
384
|
-
if (typeof policyRecord.command !== "string" || typeof policyRecord.option !== "string") {
|
|
385
|
-
continue;
|
|
386
|
-
}
|
|
387
|
-
const normalizedCommand = policyRecord.command.trim().toLowerCase();
|
|
388
|
-
if (normalizedCommand !== "create" && normalizedCommand !== "update") {
|
|
389
|
-
continue;
|
|
390
|
-
}
|
|
391
|
-
commandOptionPolicies.push({
|
|
392
|
-
command: normalizedCommand,
|
|
393
|
-
option: policyRecord.option,
|
|
394
|
-
required: policyRecord.required === undefined ? undefined : Boolean(policyRecord.required),
|
|
395
|
-
visible: policyRecord.visible === undefined ? undefined : Boolean(policyRecord.visible),
|
|
396
|
-
enabled: policyRecord.enabled === undefined ? undefined : Boolean(policyRecord.enabled),
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
401
|
return {
|
|
401
402
|
name,
|
|
402
403
|
description,
|
|
403
404
|
default_status: defaultStatus,
|
|
404
405
|
folder,
|
|
405
|
-
aliases,
|
|
406
|
-
required_create_fields:
|
|
407
|
-
required_create_repeatables:
|
|
408
|
-
options,
|
|
409
|
-
command_option_policies:
|
|
406
|
+
aliases: readStringArray(record, "aliases"),
|
|
407
|
+
required_create_fields: readStringArray(record, "required_create_fields"),
|
|
408
|
+
required_create_repeatables: readStringArray(record, "required_create_repeatables"),
|
|
409
|
+
options: coerceOptionDefinitionsFromRecord(record),
|
|
410
|
+
command_option_policies: coerceCommandOptionPoliciesFromRecord(record),
|
|
410
411
|
};
|
|
411
412
|
}
|
|
413
|
+
function resolveDefinitionRequiredCreateFields(normalizedDefinition, existing) {
|
|
414
|
+
return normalizedDefinition.required_create_fields
|
|
415
|
+
? normalizeItemTypeStringList(normalizedDefinition.required_create_fields)
|
|
416
|
+
: existing?.required_create_fields ?? [];
|
|
417
|
+
}
|
|
418
|
+
function resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing) {
|
|
419
|
+
return normalizedDefinition.required_create_repeatables
|
|
420
|
+
? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables)
|
|
421
|
+
: existing?.required_create_repeatables ?? [];
|
|
422
|
+
}
|
|
423
|
+
function resolveDefinitionOptions(normalizedDefinition, existing) {
|
|
424
|
+
return normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];
|
|
425
|
+
}
|
|
426
|
+
function resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing) {
|
|
427
|
+
return normalizedDefinition.command_option_policies
|
|
428
|
+
? normalizedDefinition.command_option_policies
|
|
429
|
+
: existing?.command_option_policies
|
|
430
|
+
? [...existing.command_option_policies]
|
|
431
|
+
: [];
|
|
432
|
+
}
|
|
412
433
|
function applyTypeDefinitions(source, target) {
|
|
413
434
|
for (const rawDefinition of source) {
|
|
414
435
|
const normalizedDefinition = normalizeTypeDefinition(rawDefinition);
|
|
@@ -423,22 +444,6 @@ function applyTypeDefinitions(source, target) {
|
|
|
423
444
|
...(existing?.aliases ?? []),
|
|
424
445
|
...(normalizedDefinition.aliases ?? []),
|
|
425
446
|
]);
|
|
426
|
-
const requiredCreateFields = normalizedDefinition.required_create_fields
|
|
427
|
-
? normalizeItemTypeStringList(normalizedDefinition.required_create_fields)
|
|
428
|
-
: existing?.required_create_fields ?? [];
|
|
429
|
-
const requiredCreateRepeatables = normalizedDefinition.required_create_repeatables
|
|
430
|
-
? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables)
|
|
431
|
-
: existing?.required_create_repeatables ?? [];
|
|
432
|
-
const options = normalizedDefinition.options
|
|
433
|
-
? normalizedDefinition.options
|
|
434
|
-
: existing?.options
|
|
435
|
-
? [...existing.options]
|
|
436
|
-
: [];
|
|
437
|
-
const commandOptionPolicies = normalizedDefinition.command_option_policies
|
|
438
|
-
? normalizedDefinition.command_option_policies
|
|
439
|
-
: existing?.command_option_policies
|
|
440
|
-
? [...existing.command_option_policies]
|
|
441
|
-
: [];
|
|
442
447
|
const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;
|
|
443
448
|
const description = normalizedDefinition.description ?? existing?.description;
|
|
444
449
|
target.set(lowerName, {
|
|
@@ -447,10 +452,10 @@ function applyTypeDefinitions(source, target) {
|
|
|
447
452
|
...(defaultStatus ? { default_status: defaultStatus } : {}),
|
|
448
453
|
folder,
|
|
449
454
|
aliases,
|
|
450
|
-
required_create_fields:
|
|
451
|
-
required_create_repeatables:
|
|
452
|
-
options,
|
|
453
|
-
command_option_policies:
|
|
455
|
+
required_create_fields: resolveDefinitionRequiredCreateFields(normalizedDefinition, existing),
|
|
456
|
+
required_create_repeatables: resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing),
|
|
457
|
+
options: resolveDefinitionOptions(normalizedDefinition, existing),
|
|
458
|
+
command_option_policies: resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing),
|
|
454
459
|
});
|
|
455
460
|
}
|
|
456
461
|
}
|
|
@@ -593,6 +598,29 @@ export function resolveCommandOptionPolicyState(typeDefinition, command, baseReq
|
|
|
593
598
|
errors,
|
|
594
599
|
};
|
|
595
600
|
}
|
|
601
|
+
function buildTypeOptionAliasMap(typeDefinition) {
|
|
602
|
+
const optionByAlias = new Map();
|
|
603
|
+
for (const option of typeDefinition.options) {
|
|
604
|
+
optionByAlias.set(option.key.toLowerCase(), option);
|
|
605
|
+
for (const alias of option.aliases ?? []) {
|
|
606
|
+
optionByAlias.set(alias.toLowerCase(), option);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
return optionByAlias;
|
|
610
|
+
}
|
|
611
|
+
function resolveTypeOptionValue(optionDefinition, trimmedValue, errors) {
|
|
612
|
+
const allowedValues = optionDefinition.values;
|
|
613
|
+
if (allowedValues.length === 0) {
|
|
614
|
+
return trimmedValue;
|
|
615
|
+
}
|
|
616
|
+
const valueLookup = new Map(allowedValues.map((value) => [value.toLowerCase(), value]));
|
|
617
|
+
const canonical = valueLookup.get(trimmedValue.toLowerCase());
|
|
618
|
+
if (!canonical) {
|
|
619
|
+
errors.push(`Invalid value "${trimmedValue}" for type option "${optionDefinition.key}". Allowed: ${allowedValues.join(", ")}`);
|
|
620
|
+
return undefined;
|
|
621
|
+
}
|
|
622
|
+
return canonical;
|
|
623
|
+
}
|
|
596
624
|
/**
|
|
597
625
|
* Implements validate type options for the public runtime surface of this module.
|
|
598
626
|
*/
|
|
@@ -605,13 +633,7 @@ export function validateTypeOptions(typeName, rawTypeOptions, registry) {
|
|
|
605
633
|
};
|
|
606
634
|
}
|
|
607
635
|
const errors = [];
|
|
608
|
-
const optionByAlias =
|
|
609
|
-
for (const option of typeDefinition.options) {
|
|
610
|
-
optionByAlias.set(option.key.toLowerCase(), option);
|
|
611
|
-
for (const alias of option.aliases ?? []) {
|
|
612
|
-
optionByAlias.set(alias.toLowerCase(), option);
|
|
613
|
-
}
|
|
614
|
-
}
|
|
636
|
+
const optionByAlias = buildTypeOptionAliasMap(typeDefinition);
|
|
615
637
|
const normalized = {};
|
|
616
638
|
for (const [rawKey, rawValue] of Object.entries(rawTypeOptions ?? {})) {
|
|
617
639
|
const trimmedKey = rawKey.trim();
|
|
@@ -632,16 +654,9 @@ export function validateTypeOptions(typeName, rawTypeOptions, registry) {
|
|
|
632
654
|
: `Type "${typeDefinition.name}" does not define any configurable type options`);
|
|
633
655
|
continue;
|
|
634
656
|
}
|
|
635
|
-
const
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
const valueLookup = new Map(allowedValues.map((value) => [value.toLowerCase(), value]));
|
|
639
|
-
const canonical = valueLookup.get(trimmedValue.toLowerCase());
|
|
640
|
-
if (!canonical) {
|
|
641
|
-
errors.push(`Invalid value "${trimmedValue}" for type option "${optionDefinition.key}". Allowed: ${allowedValues.join(", ")}`);
|
|
642
|
-
continue;
|
|
643
|
-
}
|
|
644
|
-
resolvedValue = canonical;
|
|
657
|
+
const resolvedValue = resolveTypeOptionValue(optionDefinition, trimmedValue, errors);
|
|
658
|
+
if (resolvedValue === undefined) {
|
|
659
|
+
continue;
|
|
645
660
|
}
|
|
646
661
|
normalized[optionDefinition.key] = resolvedValue;
|
|
647
662
|
}
|
|
@@ -663,4 +678,4 @@ export function validateTypeOptions(typeName, rawTypeOptions, registry) {
|
|
|
663
678
|
};
|
|
664
679
|
}
|
|
665
680
|
//# sourceMappingURL=type-registry.js.map
|
|
666
|
-
//# debugId=
|
|
681
|
+
//# debugId=e9e27e2d-967c-5e17-8266-d661f65b78ac
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-registry.js","sources":["core/item/type-registry.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/type-registry\n *\n * Defines item parsing, formatting, and lifecycle helpers for Type Registry.\n */\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport type { ExtensionRegistrationRegistry } from \"../extensions/loader.js\";\nimport type {\n ItemTypeCommandOptionPolicy,\n ItemTypeDefinition,\n ItemTypeOptionDefinition,\n PmSettings,\n} from \"../../types/index.js\";\nimport { ITEM_TYPE_VALUES } from \"../../types/index.js\";\nimport {\n normalizeItemTypeDefinition as normalizeSharedItemTypeDefinition,\n normalizeItemTypeStringList,\n strictPolicyCommand,\n} from \"./item-type-definition.js\";\n\nexport const DEFAULT_REQUIRED_CREATE_FIELDS = [\n \"title\",\n \"description\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"author\",\n \"message\",\n \"assignee\",\n] as const;\n\nexport const DEFAULT_REQUIRED_CREATE_REPEATABLES = [\"dep\", \"comment\", \"note\", \"learning\", \"file\", \"test\", \"doc\"] as const;\n\n/**\n * Restricts command option policy command values accepted by command, SDK, and storage contracts.\n */\nexport type CommandOptionPolicyCommand = \"create\" | \"update\";\n\n// Keep aligned with cli/commands/shared-unset-fields.ts. This core registry\n// cannot import CLI unset metadata without creating a core -> CLI dependency.\nconst COMMON_MUTATION_COMMAND_OPTION_KEYS = [\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"definitionOfReady\",\n \"order\",\n \"goal\",\n \"objective\",\n \"value\",\n \"impact\",\n \"outcome\",\n \"whyNow\",\n \"assignee\",\n \"parent\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n \"blockedBy\",\n \"blockedReason\",\n \"unblockNote\",\n \"reporter\",\n \"severity\",\n \"environment\",\n \"reproSteps\",\n \"resolution\",\n \"expectedResult\",\n \"actualResult\",\n \"affectedVersion\",\n \"fixedVersion\",\n \"component\",\n \"regression\",\n \"customerImpact\",\n] as const;\n\nconst CREATE_COMMAND_OPTION_KEYS = [\n \"title\",\n \"description\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n ...COMMON_MUTATION_COMMAND_OPTION_KEYS,\n \"author\",\n \"message\",\n \"dep\",\n \"comment\",\n \"note\",\n \"learning\",\n \"file\",\n \"test\",\n \"doc\",\n \"reminder\",\n \"event\",\n \"typeOption\",\n \"field\",\n] as const;\n\nconst UPDATE_COMMAND_OPTION_KEYS = [\n \"title\",\n \"description\",\n \"body\",\n \"status\",\n \"closeReason\",\n \"priority\",\n \"type\",\n \"tags\",\n ...COMMON_MUTATION_COMMAND_OPTION_KEYS,\n \"author\",\n \"message\",\n \"comment\",\n \"note\",\n \"learning\",\n \"file\",\n \"test\",\n \"doc\",\n \"reminder\",\n \"event\",\n \"typeOption\",\n \"field\",\n \"allowAuditUpdate\",\n \"force\",\n] as const;\n\nconst SHARED_COMMAND_OPTION_ALIASES: Record<string, string> = {\n \"close-reason\": \"closeReason\",\n close_reason: \"closeReason\",\n \"estimated-minutes\": \"estimatedMinutes\",\n estimated_minutes: \"estimatedMinutes\",\n estimate: \"estimatedMinutes\",\n \"acceptance-criteria\": \"acceptanceCriteria\",\n acceptance_criteria: \"acceptanceCriteria\",\n ac: \"acceptanceCriteria\",\n \"definition-of-ready\": \"definitionOfReady\",\n definition_of_ready: \"definitionOfReady\",\n rank: \"order\",\n \"why-now\": \"whyNow\",\n why_now: \"whyNow\",\n \"blocked-by\": \"blockedBy\",\n blocked_by: \"blockedBy\",\n \"blocked-reason\": \"blockedReason\",\n blocked_reason: \"blockedReason\",\n \"unblock-note\": \"unblockNote\",\n unblock_note: \"unblockNote\",\n \"repro-steps\": \"reproSteps\",\n repro_steps: \"reproSteps\",\n \"expected-result\": \"expectedResult\",\n expected_result: \"expectedResult\",\n \"actual-result\": \"actualResult\",\n actual_result: \"actualResult\",\n \"affected-version\": \"affectedVersion\",\n affected_version: \"affectedVersion\",\n \"fixed-version\": \"fixedVersion\",\n fixed_version: \"fixedVersion\",\n \"customer-impact\": \"customerImpact\",\n customer_impact: \"customerImpact\",\n \"type-option\": \"typeOption\",\n type_option: \"typeOption\",\n type_options: \"typeOption\",\n};\n\nconst CREATE_COMMAND_OPTION_ALIASES: Record<string, string> = {\n ...SHARED_COMMAND_OPTION_ALIASES,\n};\n\nconst UPDATE_COMMAND_OPTION_ALIASES: Record<string, string> = {\n ...SHARED_COMMAND_OPTION_ALIASES,\n \"allow-audit-update\": \"allowAuditUpdate\",\n allow_audit_update: \"allowAuditUpdate\",\n};\n\nconst CREATE_COMMAND_OPTION_FLAG_LABELS: Record<string, string> = {\n title: \"--title\",\n description: \"--description\",\n type: \"--type\",\n status: \"--status\",\n priority: \"--priority\",\n tags: \"--tags\",\n body: \"--body\",\n deadline: \"--deadline\",\n estimatedMinutes: \"--estimate/--estimated-minutes\",\n acceptanceCriteria: \"--acceptance-criteria/--ac\",\n definitionOfReady: \"--definition-of-ready\",\n order: \"--order/--rank\",\n goal: \"--goal\",\n objective: \"--objective\",\n value: \"--value\",\n impact: \"--impact\",\n outcome: \"--outcome\",\n whyNow: \"--why-now\",\n author: \"--author\",\n message: \"--message\",\n assignee: \"--assignee\",\n parent: \"--parent\",\n reviewer: \"--reviewer\",\n risk: \"--risk\",\n confidence: \"--confidence\",\n sprint: \"--sprint\",\n release: \"--release\",\n blockedBy: \"--blocked-by\",\n blockedReason: \"--blocked-reason\",\n unblockNote: \"--unblock-note\",\n reporter: \"--reporter\",\n severity: \"--severity\",\n environment: \"--environment\",\n reproSteps: \"--repro-steps\",\n resolution: \"--resolution\",\n expectedResult: \"--expected-result\",\n actualResult: \"--actual-result\",\n affectedVersion: \"--affected-version\",\n fixedVersion: \"--fixed-version\",\n component: \"--component\",\n regression: \"--regression\",\n customerImpact: \"--customer-impact\",\n dep: \"--dep\",\n comment: \"--comment\",\n note: \"--note\",\n learning: \"--learning\",\n file: \"--file\",\n test: \"--test\",\n doc: \"--doc\",\n reminder: \"--reminder\",\n event: \"--event\",\n typeOption: \"--type-option\",\n};\n\nconst UPDATE_COMMAND_OPTION_FLAG_LABELS: Record<string, string> = {\n title: \"--title\",\n description: \"--description\",\n body: \"--body\",\n status: \"--status\",\n closeReason: \"--close-reason\",\n priority: \"--priority\",\n type: \"--type\",\n tags: \"--tags\",\n deadline: \"--deadline\",\n estimatedMinutes: \"--estimate/--estimated-minutes\",\n acceptanceCriteria: \"--acceptance-criteria/--ac\",\n definitionOfReady: \"--definition-of-ready\",\n order: \"--order/--rank\",\n goal: \"--goal\",\n objective: \"--objective\",\n value: \"--value\",\n impact: \"--impact\",\n outcome: \"--outcome\",\n whyNow: \"--why-now\",\n assignee: \"--assignee\",\n parent: \"--parent\",\n reviewer: \"--reviewer\",\n risk: \"--risk\",\n confidence: \"--confidence\",\n sprint: \"--sprint\",\n release: \"--release\",\n blockedBy: \"--blocked-by\",\n blockedReason: \"--blocked-reason\",\n unblockNote: \"--unblock-note\",\n reporter: \"--reporter\",\n severity: \"--severity\",\n environment: \"--environment\",\n reproSteps: \"--repro-steps\",\n resolution: \"--resolution\",\n expectedResult: \"--expected-result\",\n actualResult: \"--actual-result\",\n affectedVersion: \"--affected-version\",\n fixedVersion: \"--fixed-version\",\n component: \"--component\",\n regression: \"--regression\",\n customerImpact: \"--customer-impact\",\n comment: \"--comment\",\n note: \"--note\",\n learning: \"--learning\",\n file: \"--file\",\n test: \"--test\",\n doc: \"--doc\",\n reminder: \"--reminder\",\n event: \"--event\",\n typeOption: \"--type-option\",\n allowAuditUpdate: \"--allow-audit-update\",\n author: \"--author\",\n message: \"--message\",\n force: \"--force\",\n};\n\n/**\n * Documents the command option policy state payload exchanged by command, SDK, and package integrations.\n */\nexport interface CommandOptionPolicyState {\n required: string[];\n hidden: string[];\n disabled: string[];\n errors: string[];\n}\n\n/**\n * Documents the resolved item type definition payload exchanged by command, SDK, and package integrations.\n */\nexport interface ResolvedItemTypeDefinition {\n name: string;\n /** Optional human description carried from the type definition. */\n description?: string;\n folder: string;\n aliases: string[];\n /** Optional per-type status applied at create time when `--status` is omitted. */\n default_status?: string;\n required_create_fields: string[];\n required_create_repeatables: string[];\n options: ItemTypeOptionDefinition[];\n command_option_policies: ItemTypeCommandOptionPolicy[];\n}\n\n/**\n * Documents the item type registry payload exchanged by command, SDK, and package integrations.\n */\nexport interface ItemTypeRegistry {\n types: string[];\n folders: string[];\n type_to_folder: Record<string, string>;\n by_type: Record<string, ResolvedItemTypeDefinition>;\n alias_to_type: Record<string, string>;\n}\n\nfunction normalizeCommandOptionToken(value: string): string {\n return value.trim().replace(/^--+/, \"\").toLowerCase();\n}\n\nfunction commandOptionKeys(command: CommandOptionPolicyCommand): readonly string[] {\n return command === \"create\" ? CREATE_COMMAND_OPTION_KEYS : UPDATE_COMMAND_OPTION_KEYS;\n}\n\nfunction commandOptionAliases(command: CommandOptionPolicyCommand): Record<string, string> {\n return command === \"create\" ? CREATE_COMMAND_OPTION_ALIASES : UPDATE_COMMAND_OPTION_ALIASES;\n}\n\n/**\n * Implements canonicalize command option key for the public runtime surface of this module.\n */\nexport function canonicalizeCommandOptionKey(\n command: CommandOptionPolicyCommand,\n rawOption: string,\n): string | undefined {\n const normalizedToken = normalizeCommandOptionToken(rawOption);\n if (normalizedToken.length === 0) {\n return undefined;\n }\n const aliased = commandOptionAliases(command)[normalizedToken];\n if (aliased) {\n return aliased;\n }\n return commandOptionKeys(command).find((candidate) => candidate.toLowerCase() === normalizedToken);\n}\n\n/**\n * Implements command option flag label for the public runtime surface of this module.\n */\nexport function commandOptionFlagLabel(command: CommandOptionPolicyCommand, optionKey: string): string {\n const labels = command === \"create\" ? CREATE_COMMAND_OPTION_FLAG_LABELS : UPDATE_COMMAND_OPTION_FLAG_LABELS;\n return labels[optionKey] ?? `--${optionKey.replace(/([A-Z])/g, \"-$1\").toLowerCase()}`;\n}\n\n/**\n * Implements to default folder for the public runtime surface of this module.\n */\nexport function toDefaultFolder(name: string): string {\n const normalized = toSlugToken(name);\n if (normalized.length === 0) {\n return \"items\";\n }\n return normalized.endsWith(\"s\") ? normalized : `${normalized}s`;\n}\n\nfunction toSlugToken(value: string): string {\n const trimmed = value.trim().toLowerCase();\n let slug = \"\";\n let pendingDash = false;\n for (const character of trimmed) {\n const code = character.charCodeAt(0);\n const isAlpha = code >= 97 && code <= 122;\n const isDigit = code >= 48 && code <= 57;\n if (isAlpha || isDigit) {\n if (pendingDash && slug.length > 0) {\n slug += \"-\";\n }\n slug += character;\n pendingDash = false;\n continue;\n }\n if (slug.length > 0) {\n pendingDash = true;\n }\n }\n return slug;\n}\n\n// Runtime registry consumes untrusted extension/file definitions, so it uses the\n// strict policy-command resolver (trim + lowercase, reject non-create/update). All\n// other normalization is single-sourced from ./item-type-definition.ts (pm-v798).\nfunction normalizeTypeDefinition(definition: ItemTypeDefinition): ItemTypeDefinition | null {\n return normalizeSharedItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });\n}\n\nfunction coerceTypeDefinitionFromUnknown(raw: unknown): ItemTypeDefinition | null {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return null;\n }\n const record = raw as Record<string, unknown>;\n const name = typeof record.name === \"string\" ? record.name : \"\";\n if (name.trim().length === 0) {\n return null;\n }\n const folder = typeof record.folder === \"string\" ? record.folder : undefined;\n const description = typeof record.description === \"string\" ? record.description : undefined;\n const defaultStatus = typeof record.default_status === \"string\" ? record.default_status : undefined;\n const aliases = Array.isArray(record.aliases) ? record.aliases.filter((value): value is string => typeof value === \"string\") : undefined;\n const requiredCreateFields = Array.isArray(record.required_create_fields)\n ? record.required_create_fields.filter((value): value is string => typeof value === \"string\")\n : undefined;\n const requiredCreateRepeatables = Array.isArray(record.required_create_repeatables)\n ? record.required_create_repeatables.filter((value): value is string => typeof value === \"string\")\n : undefined;\n let options: ItemTypeOptionDefinition[] | undefined;\n if (Array.isArray(record.options)) {\n options = [];\n for (const entry of record.options) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const optionRecord = entry as Record<string, unknown>;\n if (typeof optionRecord.key !== \"string\") {\n continue;\n }\n options.push({\n key: optionRecord.key,\n values: Array.isArray(optionRecord.values)\n ? optionRecord.values.filter((value): value is string => typeof value === \"string\")\n : [],\n required: optionRecord.required === undefined ? undefined : Boolean(optionRecord.required),\n aliases: Array.isArray(optionRecord.aliases)\n ? optionRecord.aliases.filter((value): value is string => typeof value === \"string\")\n : undefined,\n description: typeof optionRecord.description === \"string\" ? optionRecord.description : undefined,\n });\n }\n }\n let commandOptionPolicies: ItemTypeCommandOptionPolicy[] | undefined;\n if (Array.isArray(record.command_option_policies)) {\n commandOptionPolicies = [];\n for (const entry of record.command_option_policies) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const policyRecord = entry as Record<string, unknown>;\n if (typeof policyRecord.command !== \"string\" || typeof policyRecord.option !== \"string\") {\n continue;\n }\n const normalizedCommand = policyRecord.command.trim().toLowerCase();\n if (normalizedCommand !== \"create\" && normalizedCommand !== \"update\") {\n continue;\n }\n commandOptionPolicies.push({\n command: normalizedCommand,\n option: policyRecord.option,\n required: policyRecord.required === undefined ? undefined : Boolean(policyRecord.required),\n visible: policyRecord.visible === undefined ? undefined : Boolean(policyRecord.visible),\n enabled: policyRecord.enabled === undefined ? undefined : Boolean(policyRecord.enabled),\n });\n }\n }\n return {\n name,\n description,\n default_status: defaultStatus,\n folder,\n aliases,\n required_create_fields: requiredCreateFields,\n required_create_repeatables: requiredCreateRepeatables,\n options,\n command_option_policies: commandOptionPolicies,\n };\n}\n\nfunction applyTypeDefinitions(\n source: ItemTypeDefinition[],\n target: Map<string, ResolvedItemTypeDefinition>,\n): void {\n for (const rawDefinition of source) {\n const normalizedDefinition = normalizeTypeDefinition(rawDefinition);\n if (!normalizedDefinition) {\n continue;\n }\n const lowerName = normalizedDefinition.name.toLowerCase();\n const existing = target.get(lowerName);\n const keepName = existing?.name ?? normalizedDefinition.name;\n const folder = normalizedDefinition.folder ?? existing?.folder ?? toDefaultFolder(keepName);\n const aliases = normalizeItemTypeStringList([\n ...(existing?.aliases ?? []),\n ...(normalizedDefinition.aliases ?? []),\n ]);\n const requiredCreateFields = normalizedDefinition.required_create_fields\n ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields)\n : existing?.required_create_fields ?? [];\n const requiredCreateRepeatables = normalizedDefinition.required_create_repeatables\n ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables)\n : existing?.required_create_repeatables ?? [];\n const options = normalizedDefinition.options\n ? normalizedDefinition.options\n : existing?.options\n ? [...existing.options]\n : [];\n const commandOptionPolicies = normalizedDefinition.command_option_policies\n ? normalizedDefinition.command_option_policies\n : existing?.command_option_policies\n ? [...existing.command_option_policies]\n : [];\n const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;\n const description = normalizedDefinition.description ?? existing?.description;\n target.set(lowerName, {\n name: keepName,\n ...(description ? { description } : {}),\n ...(defaultStatus ? { default_status: defaultStatus } : {}),\n folder,\n aliases,\n required_create_fields: requiredCreateFields,\n required_create_repeatables: requiredCreateRepeatables,\n options,\n command_option_policies: commandOptionPolicies,\n });\n }\n}\n\nfunction collectExtensionTypeDefinitions(registrations: ExtensionRegistrationRegistry | null | undefined): ItemTypeDefinition[] {\n if (!registrations) {\n return [];\n }\n const definitions: ItemTypeDefinition[] = [];\n for (const registration of registrations.item_types ?? []) {\n const typeDefinitionsRaw = (registration as { types?: unknown[] }).types;\n if (!Array.isArray(typeDefinitionsRaw)) {\n continue;\n }\n for (const rawDefinition of typeDefinitionsRaw) {\n const normalized = coerceTypeDefinitionFromUnknown(rawDefinition);\n if (normalized) {\n definitions.push(normalized);\n }\n }\n }\n return definitions;\n}\n\n/**\n * Implements resolve item type registry for the public runtime surface of this module.\n */\nexport function resolveItemTypeRegistry(\n settings: PmSettings,\n extensionRegistrations: ExtensionRegistrationRegistry | null | undefined = null,\n): ItemTypeRegistry {\n const byLowerName = new Map<string, ResolvedItemTypeDefinition>();\n for (const builtin of ITEM_TYPE_VALUES) {\n byLowerName.set(builtin.toLowerCase(), {\n name: builtin,\n folder: TYPE_TO_FOLDER[builtin],\n aliases: [],\n required_create_fields: [...DEFAULT_REQUIRED_CREATE_FIELDS],\n required_create_repeatables: [...DEFAULT_REQUIRED_CREATE_REPEATABLES],\n options: [],\n command_option_policies: [],\n });\n }\n\n applyTypeDefinitions(settings.item_types?.definitions ?? [], byLowerName);\n applyTypeDefinitions(collectExtensionTypeDefinitions(extensionRegistrations), byLowerName);\n\n const definitions = [...byLowerName.values()].sort((left, right) => left.name.localeCompare(right.name));\n const byType: Record<string, ResolvedItemTypeDefinition> = {};\n const aliasToType: Record<string, string> = {};\n const typeToFolder: Record<string, string> = {};\n for (const definition of definitions) {\n byType[definition.name] = definition;\n typeToFolder[definition.name] = definition.folder;\n aliasToType[definition.name.toLowerCase()] = definition.name;\n for (const alias of definition.aliases) {\n aliasToType[alias.toLowerCase()] = definition.name;\n }\n }\n const folders = [...new Set(definitions.map((definition) => definition.folder))].sort((left, right) => left.localeCompare(right));\n return {\n types: definitions.map((definition) => definition.name),\n folders,\n type_to_folder: typeToFolder,\n by_type: byType,\n alias_to_type: aliasToType,\n };\n}\n\n/**\n * Implements resolve type name for the public runtime surface of this module.\n */\nexport function resolveTypeName(rawType: string | undefined, registry: ItemTypeRegistry): string | undefined {\n if (rawType === undefined) {\n return undefined;\n }\n return registry.alias_to_type[rawType.trim().toLowerCase()];\n}\n\n/**\n * Implements resolve type definition for the public runtime surface of this module.\n */\nexport function resolveTypeDefinition(\n typeName: string | undefined,\n registry: ItemTypeRegistry,\n): ResolvedItemTypeDefinition | undefined {\n const resolvedName = resolveTypeName(typeName, registry);\n if (!resolvedName) {\n return undefined;\n }\n return registry.by_type[resolvedName];\n}\n\n/**\n * Implements resolve command option policy state for the public runtime surface of this module.\n */\nexport function resolveCommandOptionPolicyState(\n typeDefinition: ResolvedItemTypeDefinition,\n command: CommandOptionPolicyCommand,\n baseRequiredOptions: Iterable<string>,\n): CommandOptionPolicyState {\n const errors: string[] = [];\n const required = new Set<string>();\n const hidden = new Set<string>();\n const disabled = new Set<string>();\n\n for (const rawBase of baseRequiredOptions) {\n const canonical = canonicalizeCommandOptionKey(command, rawBase);\n if (!canonical) {\n errors.push(\n `Unsupported base required option \"${rawBase}\" for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n continue;\n }\n required.add(canonical);\n }\n\n for (const policy of typeDefinition.command_option_policies) {\n if (policy.command !== command) {\n continue;\n }\n const canonical = canonicalizeCommandOptionKey(command, policy.option);\n if (!canonical) {\n errors.push(\n `Unsupported command_option_policies option \"${policy.option}\" for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n continue;\n }\n if (policy.required !== undefined) {\n if (policy.required) {\n required.add(canonical);\n } else {\n required.delete(canonical);\n }\n }\n if (policy.visible !== undefined) {\n if (policy.visible) {\n hidden.delete(canonical);\n } else {\n hidden.add(canonical);\n }\n }\n if (policy.enabled !== undefined) {\n if (policy.enabled) {\n disabled.delete(canonical);\n } else {\n disabled.add(canonical);\n }\n }\n }\n\n for (const option of required) {\n if (disabled.has(option)) {\n errors.push(\n `Option \"${option}\" cannot be both required and disabled for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n }\n }\n\n return {\n required: [...required],\n hidden: [...hidden].sort((left, right) => left.localeCompare(right)),\n disabled: [...disabled].sort((left, right) => left.localeCompare(right)),\n errors,\n };\n}\n\n/**\n * Implements validate type options for the public runtime surface of this module.\n */\nexport function validateTypeOptions(\n typeName: string,\n rawTypeOptions: Record<string, string> | undefined,\n registry: ItemTypeRegistry,\n): { normalized: Record<string, string> | undefined; errors: string[] } {\n const typeDefinition = resolveTypeDefinition(typeName, registry);\n if (!typeDefinition) {\n return {\n normalized: undefined,\n errors: [`Unknown type \"${typeName}\"`],\n };\n }\n const errors: string[] = [];\n const optionByAlias = new Map<string, ItemTypeOptionDefinition>();\n for (const option of typeDefinition.options) {\n optionByAlias.set(option.key.toLowerCase(), option);\n for (const alias of option.aliases ?? []) {\n optionByAlias.set(alias.toLowerCase(), option);\n }\n }\n\n const normalized: Record<string, string> = {};\n for (const [rawKey, rawValue] of Object.entries(rawTypeOptions ?? {})) {\n const trimmedKey = rawKey.trim();\n const trimmedValue = rawValue.trim();\n if (trimmedKey.length === 0) {\n errors.push(\"type option keys must not be empty\");\n continue;\n }\n if (trimmedValue.length === 0) {\n errors.push(`type option \"${trimmedKey}\" must not be empty`);\n continue;\n }\n const optionDefinition = optionByAlias.get(trimmedKey.toLowerCase());\n if (!optionDefinition) {\n const allowed = typeDefinition.options.map((option) => option.key).join(\", \");\n errors.push(\n typeDefinition.options.length > 0\n ? `Unknown type option \"${trimmedKey}\" for type \"${typeDefinition.name}\". Allowed: ${allowed}`\n : `Type \"${typeDefinition.name}\" does not define any configurable type options`,\n );\n continue;\n }\n const allowedValues = optionDefinition.values;\n let resolvedValue = trimmedValue;\n if (allowedValues.length > 0) {\n const valueLookup = new Map(allowedValues.map((value) => [value.toLowerCase(), value]));\n const canonical = valueLookup.get(trimmedValue.toLowerCase());\n if (!canonical) {\n errors.push(\n `Invalid value \"${trimmedValue}\" for type option \"${optionDefinition.key}\". Allowed: ${allowedValues.join(\", \")}`,\n );\n continue;\n }\n resolvedValue = canonical;\n }\n normalized[optionDefinition.key] = resolvedValue;\n }\n\n for (const option of typeDefinition.options) {\n if (option.required && !(option.key in normalized)) {\n errors.push(`Missing required type option \"${option.key}\" for type \"${typeDefinition.name}\"`);\n }\n }\n\n const sortedKeys = Object.keys(normalized).sort((left, right) => left.localeCompare(right));\n if (sortedKeys.length === 0) {\n return {\n normalized: undefined,\n errors,\n };\n }\n return {\n normalized: Object.fromEntries(sortedKeys.map((key) => [key, normalized[key]])),\n errors,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EACL,2BAA2B,IAAI,iCAAiC,EAChE,2BAA2B,EAC3B,mBAAmB,GACpB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,OAAO;IACP,aAAa;IACb,QAAQ;IACR,UAAU;IACV,MAAM;IACN,MAAM;IACN,UAAU;IACV,kBAAkB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ACrB,MAAM;SACP,CAAC;IACJ,CAAC;IACD,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM;KACP,CAAC;AACJ,CAAC","debugId":"aca609de-d881-5f34-804f-ed3daa6aab2a"}
|
|
1
|
+
{"version":3,"file":"type-registry.js","sources":["core/item/type-registry.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module core/item/type-registry\n *\n * Defines item parsing, formatting, and lifecycle helpers for Type Registry.\n */\nimport { TYPE_TO_FOLDER } from \"../shared/constants.js\";\nimport type { ExtensionRegistrationRegistry } from \"../extensions/loader.js\";\nimport type {\n ItemTypeCommandOptionPolicy,\n ItemTypeDefinition,\n ItemTypeOptionDefinition,\n PmSettings,\n} from \"../../types/index.js\";\nimport { ITEM_TYPE_VALUES } from \"../../types/index.js\";\nimport {\n normalizeItemTypeDefinition as normalizeSharedItemTypeDefinition,\n normalizeItemTypeStringList,\n strictPolicyCommand,\n} from \"./item-type-definition.js\";\n\nexport const DEFAULT_REQUIRED_CREATE_FIELDS = [\n \"title\",\n \"description\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"author\",\n \"message\",\n \"assignee\",\n] as const;\n\nexport const DEFAULT_REQUIRED_CREATE_REPEATABLES = [\"dep\", \"comment\", \"note\", \"learning\", \"file\", \"test\", \"doc\"] as const;\n\n/**\n * Restricts command option policy command values accepted by command, SDK, and storage contracts.\n */\nexport type CommandOptionPolicyCommand = \"create\" | \"update\";\n\n// Keep aligned with cli/commands/shared-unset-fields.ts. This core registry\n// cannot import CLI unset metadata without creating a core -> CLI dependency.\nconst COMMON_MUTATION_COMMAND_OPTION_KEYS = [\n \"deadline\",\n \"estimatedMinutes\",\n \"acceptanceCriteria\",\n \"definitionOfReady\",\n \"order\",\n \"goal\",\n \"objective\",\n \"value\",\n \"impact\",\n \"outcome\",\n \"whyNow\",\n \"assignee\",\n \"parent\",\n \"reviewer\",\n \"risk\",\n \"confidence\",\n \"sprint\",\n \"release\",\n \"blockedBy\",\n \"blockedReason\",\n \"unblockNote\",\n \"reporter\",\n \"severity\",\n \"environment\",\n \"reproSteps\",\n \"resolution\",\n \"expectedResult\",\n \"actualResult\",\n \"affectedVersion\",\n \"fixedVersion\",\n \"component\",\n \"regression\",\n \"customerImpact\",\n] as const;\n\nconst CREATE_COMMAND_OPTION_KEYS = [\n \"title\",\n \"description\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"body\",\n ...COMMON_MUTATION_COMMAND_OPTION_KEYS,\n \"author\",\n \"message\",\n \"dep\",\n \"comment\",\n \"note\",\n \"learning\",\n \"file\",\n \"test\",\n \"doc\",\n \"reminder\",\n \"event\",\n \"typeOption\",\n \"field\",\n] as const;\n\nconst UPDATE_COMMAND_OPTION_KEYS = [\n \"title\",\n \"description\",\n \"body\",\n \"status\",\n \"closeReason\",\n \"priority\",\n \"type\",\n \"tags\",\n ...COMMON_MUTATION_COMMAND_OPTION_KEYS,\n \"author\",\n \"message\",\n \"comment\",\n \"note\",\n \"learning\",\n \"file\",\n \"test\",\n \"doc\",\n \"reminder\",\n \"event\",\n \"typeOption\",\n \"field\",\n \"allowAuditUpdate\",\n \"force\",\n] as const;\n\nconst SHARED_COMMAND_OPTION_ALIASES: Record<string, string> = {\n \"close-reason\": \"closeReason\",\n close_reason: \"closeReason\",\n \"estimated-minutes\": \"estimatedMinutes\",\n estimated_minutes: \"estimatedMinutes\",\n estimate: \"estimatedMinutes\",\n \"acceptance-criteria\": \"acceptanceCriteria\",\n acceptance_criteria: \"acceptanceCriteria\",\n ac: \"acceptanceCriteria\",\n \"definition-of-ready\": \"definitionOfReady\",\n definition_of_ready: \"definitionOfReady\",\n rank: \"order\",\n \"why-now\": \"whyNow\",\n why_now: \"whyNow\",\n \"blocked-by\": \"blockedBy\",\n blocked_by: \"blockedBy\",\n \"blocked-reason\": \"blockedReason\",\n blocked_reason: \"blockedReason\",\n \"unblock-note\": \"unblockNote\",\n unblock_note: \"unblockNote\",\n \"repro-steps\": \"reproSteps\",\n repro_steps: \"reproSteps\",\n \"expected-result\": \"expectedResult\",\n expected_result: \"expectedResult\",\n \"actual-result\": \"actualResult\",\n actual_result: \"actualResult\",\n \"affected-version\": \"affectedVersion\",\n affected_version: \"affectedVersion\",\n \"fixed-version\": \"fixedVersion\",\n fixed_version: \"fixedVersion\",\n \"customer-impact\": \"customerImpact\",\n customer_impact: \"customerImpact\",\n \"type-option\": \"typeOption\",\n type_option: \"typeOption\",\n type_options: \"typeOption\",\n};\n\nconst CREATE_COMMAND_OPTION_ALIASES: Record<string, string> = {\n ...SHARED_COMMAND_OPTION_ALIASES,\n};\n\nconst UPDATE_COMMAND_OPTION_ALIASES: Record<string, string> = {\n ...SHARED_COMMAND_OPTION_ALIASES,\n \"allow-audit-update\": \"allowAuditUpdate\",\n allow_audit_update: \"allowAuditUpdate\",\n};\n\nconst CREATE_COMMAND_OPTION_FLAG_LABELS: Record<string, string> = {\n title: \"--title\",\n description: \"--description\",\n type: \"--type\",\n status: \"--status\",\n priority: \"--priority\",\n tags: \"--tags\",\n body: \"--body\",\n deadline: \"--deadline\",\n estimatedMinutes: \"--estimate/--estimated-minutes\",\n acceptanceCriteria: \"--acceptance-criteria/--ac\",\n definitionOfReady: \"--definition-of-ready\",\n order: \"--order/--rank\",\n goal: \"--goal\",\n objective: \"--objective\",\n value: \"--value\",\n impact: \"--impact\",\n outcome: \"--outcome\",\n whyNow: \"--why-now\",\n author: \"--author\",\n message: \"--message\",\n assignee: \"--assignee\",\n parent: \"--parent\",\n reviewer: \"--reviewer\",\n risk: \"--risk\",\n confidence: \"--confidence\",\n sprint: \"--sprint\",\n release: \"--release\",\n blockedBy: \"--blocked-by\",\n blockedReason: \"--blocked-reason\",\n unblockNote: \"--unblock-note\",\n reporter: \"--reporter\",\n severity: \"--severity\",\n environment: \"--environment\",\n reproSteps: \"--repro-steps\",\n resolution: \"--resolution\",\n expectedResult: \"--expected-result\",\n actualResult: \"--actual-result\",\n affectedVersion: \"--affected-version\",\n fixedVersion: \"--fixed-version\",\n component: \"--component\",\n regression: \"--regression\",\n customerImpact: \"--customer-impact\",\n dep: \"--dep\",\n comment: \"--comment\",\n note: \"--note\",\n learning: \"--learning\",\n file: \"--file\",\n test: \"--test\",\n doc: \"--doc\",\n reminder: \"--reminder\",\n event: \"--event\",\n typeOption: \"--type-option\",\n};\n\nconst UPDATE_COMMAND_OPTION_FLAG_LABELS: Record<string, string> = {\n title: \"--title\",\n description: \"--description\",\n body: \"--body\",\n status: \"--status\",\n closeReason: \"--close-reason\",\n priority: \"--priority\",\n type: \"--type\",\n tags: \"--tags\",\n deadline: \"--deadline\",\n estimatedMinutes: \"--estimate/--estimated-minutes\",\n acceptanceCriteria: \"--acceptance-criteria/--ac\",\n definitionOfReady: \"--definition-of-ready\",\n order: \"--order/--rank\",\n goal: \"--goal\",\n objective: \"--objective\",\n value: \"--value\",\n impact: \"--impact\",\n outcome: \"--outcome\",\n whyNow: \"--why-now\",\n assignee: \"--assignee\",\n parent: \"--parent\",\n reviewer: \"--reviewer\",\n risk: \"--risk\",\n confidence: \"--confidence\",\n sprint: \"--sprint\",\n release: \"--release\",\n blockedBy: \"--blocked-by\",\n blockedReason: \"--blocked-reason\",\n unblockNote: \"--unblock-note\",\n reporter: \"--reporter\",\n severity: \"--severity\",\n environment: \"--environment\",\n reproSteps: \"--repro-steps\",\n resolution: \"--resolution\",\n expectedResult: \"--expected-result\",\n actualResult: \"--actual-result\",\n affectedVersion: \"--affected-version\",\n fixedVersion: \"--fixed-version\",\n component: \"--component\",\n regression: \"--regression\",\n customerImpact: \"--customer-impact\",\n comment: \"--comment\",\n note: \"--note\",\n learning: \"--learning\",\n file: \"--file\",\n test: \"--test\",\n doc: \"--doc\",\n reminder: \"--reminder\",\n event: \"--event\",\n typeOption: \"--type-option\",\n allowAuditUpdate: \"--allow-audit-update\",\n author: \"--author\",\n message: \"--message\",\n force: \"--force\",\n};\n\n/**\n * Documents the command option policy state payload exchanged by command, SDK, and package integrations.\n */\nexport interface CommandOptionPolicyState {\n required: string[];\n hidden: string[];\n disabled: string[];\n errors: string[];\n}\n\n/**\n * Documents the resolved item type definition payload exchanged by command, SDK, and package integrations.\n */\nexport interface ResolvedItemTypeDefinition {\n name: string;\n /** Optional human description carried from the type definition. */\n description?: string;\n folder: string;\n aliases: string[];\n /** Optional per-type status applied at create time when `--status` is omitted. */\n default_status?: string;\n required_create_fields: string[];\n required_create_repeatables: string[];\n options: ItemTypeOptionDefinition[];\n command_option_policies: ItemTypeCommandOptionPolicy[];\n}\n\n/**\n * Documents the item type registry payload exchanged by command, SDK, and package integrations.\n */\nexport interface ItemTypeRegistry {\n types: string[];\n folders: string[];\n type_to_folder: Record<string, string>;\n by_type: Record<string, ResolvedItemTypeDefinition>;\n alias_to_type: Record<string, string>;\n}\n\nfunction normalizeCommandOptionToken(value: string): string {\n return value.trim().replace(/^--+/, \"\").toLowerCase();\n}\n\nfunction commandOptionKeys(command: CommandOptionPolicyCommand): readonly string[] {\n return command === \"create\" ? CREATE_COMMAND_OPTION_KEYS : UPDATE_COMMAND_OPTION_KEYS;\n}\n\nfunction commandOptionAliases(command: CommandOptionPolicyCommand): Record<string, string> {\n return command === \"create\" ? CREATE_COMMAND_OPTION_ALIASES : UPDATE_COMMAND_OPTION_ALIASES;\n}\n\n/**\n * Implements canonicalize command option key for the public runtime surface of this module.\n */\nexport function canonicalizeCommandOptionKey(\n command: CommandOptionPolicyCommand,\n rawOption: string,\n): string | undefined {\n const normalizedToken = normalizeCommandOptionToken(rawOption);\n if (normalizedToken.length === 0) {\n return undefined;\n }\n const aliased = commandOptionAliases(command)[normalizedToken];\n if (aliased) {\n return aliased;\n }\n return commandOptionKeys(command).find((candidate) => candidate.toLowerCase() === normalizedToken);\n}\n\n/**\n * Implements command option flag label for the public runtime surface of this module.\n */\nexport function commandOptionFlagLabel(command: CommandOptionPolicyCommand, optionKey: string): string {\n const labels = command === \"create\" ? CREATE_COMMAND_OPTION_FLAG_LABELS : UPDATE_COMMAND_OPTION_FLAG_LABELS;\n return labels[optionKey] ?? `--${optionKey.replace(/([A-Z])/g, \"-$1\").toLowerCase()}`;\n}\n\n/**\n * Implements to default folder for the public runtime surface of this module.\n */\nexport function toDefaultFolder(name: string): string {\n const normalized = toSlugToken(name);\n if (normalized.length === 0) {\n return \"items\";\n }\n return normalized.endsWith(\"s\") ? normalized : `${normalized}s`;\n}\n\nfunction toSlugToken(value: string): string {\n const trimmed = value.trim().toLowerCase();\n let slug = \"\";\n let pendingDash = false;\n for (const character of trimmed) {\n const code = character.charCodeAt(0);\n const isAlpha = code >= 97 && code <= 122;\n const isDigit = code >= 48 && code <= 57;\n if (isAlpha || isDigit) {\n if (pendingDash && slug.length > 0) {\n slug += \"-\";\n }\n slug += character;\n pendingDash = false;\n continue;\n }\n if (slug.length > 0) {\n pendingDash = true;\n }\n }\n return slug;\n}\n\n// Runtime registry consumes untrusted extension/file definitions, so it uses the\n// strict policy-command resolver (trim + lowercase, reject non-create/update). All\n// other normalization is single-sourced from ./item-type-definition.ts (pm-v798).\nfunction normalizeTypeDefinition(definition: ItemTypeDefinition): ItemTypeDefinition | null {\n return normalizeSharedItemTypeDefinition(definition, { resolvePolicyCommand: strictPolicyCommand });\n}\n\nfunction readStringArray(record: Record<string, unknown>, key: string): string[] | undefined {\n const value = record[key];\n return Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === \"string\") : undefined;\n}\n\nfunction coerceOptionDefinitionFromUnknown(raw: unknown): ItemTypeOptionDefinition | null {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return null;\n }\n const optionRecord = raw as Record<string, unknown>;\n if (typeof optionRecord.key !== \"string\") {\n return null;\n }\n return {\n key: optionRecord.key,\n values: readStringArray(optionRecord, \"values\") ?? [],\n required: optionRecord.required === undefined ? undefined : Boolean(optionRecord.required),\n aliases: readStringArray(optionRecord, \"aliases\"),\n description: typeof optionRecord.description === \"string\" ? optionRecord.description : undefined,\n };\n}\n\nfunction coerceCommandOptionPolicyFromUnknown(raw: unknown): ItemTypeCommandOptionPolicy | null {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return null;\n }\n const policyRecord = raw as Record<string, unknown>;\n if (typeof policyRecord.command !== \"string\" || typeof policyRecord.option !== \"string\") {\n return null;\n }\n const normalizedCommand = policyRecord.command.trim().toLowerCase();\n if (normalizedCommand !== \"create\" && normalizedCommand !== \"update\") {\n return null;\n }\n return {\n command: normalizedCommand,\n option: policyRecord.option,\n required: policyRecord.required === undefined ? undefined : Boolean(policyRecord.required),\n visible: policyRecord.visible === undefined ? undefined : Boolean(policyRecord.visible),\n enabled: policyRecord.enabled === undefined ? undefined : Boolean(policyRecord.enabled),\n };\n}\n\nfunction coerceOptionDefinitionsFromRecord(record: Record<string, unknown>): ItemTypeOptionDefinition[] | undefined {\n if (!Array.isArray(record.options)) {\n return undefined;\n }\n return record.options\n .map((entry) => coerceOptionDefinitionFromUnknown(entry))\n .filter((entry): entry is ItemTypeOptionDefinition => entry !== null);\n}\n\nfunction coerceCommandOptionPoliciesFromRecord(record: Record<string, unknown>): ItemTypeCommandOptionPolicy[] | undefined {\n if (!Array.isArray(record.command_option_policies)) {\n return undefined;\n }\n return record.command_option_policies\n .map((entry) => coerceCommandOptionPolicyFromUnknown(entry))\n .filter((entry): entry is ItemTypeCommandOptionPolicy => entry !== null);\n}\n\nfunction coerceTypeDefinitionFromUnknown(raw: unknown): ItemTypeDefinition | null {\n if (typeof raw !== \"object\" || raw === null || Array.isArray(raw)) {\n return null;\n }\n const record = raw as Record<string, unknown>;\n const name = typeof record.name === \"string\" ? record.name : \"\";\n if (name.trim().length === 0) {\n return null;\n }\n const folder = typeof record.folder === \"string\" ? record.folder : undefined;\n const description = typeof record.description === \"string\" ? record.description : undefined;\n const defaultStatus = typeof record.default_status === \"string\" ? record.default_status : undefined;\n return {\n name,\n description,\n default_status: defaultStatus,\n folder,\n aliases: readStringArray(record, \"aliases\"),\n required_create_fields: readStringArray(record, \"required_create_fields\"),\n required_create_repeatables: readStringArray(record, \"required_create_repeatables\"),\n options: coerceOptionDefinitionsFromRecord(record),\n command_option_policies: coerceCommandOptionPoliciesFromRecord(record),\n };\n}\n\nfunction resolveDefinitionRequiredCreateFields(\n normalizedDefinition: ItemTypeDefinition,\n existing: ResolvedItemTypeDefinition | undefined,\n): string[] {\n return normalizedDefinition.required_create_fields\n ? normalizeItemTypeStringList(normalizedDefinition.required_create_fields)\n : existing?.required_create_fields ?? [];\n}\n\nfunction resolveDefinitionRequiredCreateRepeatables(\n normalizedDefinition: ItemTypeDefinition,\n existing: ResolvedItemTypeDefinition | undefined,\n): string[] {\n return normalizedDefinition.required_create_repeatables\n ? normalizeItemTypeStringList(normalizedDefinition.required_create_repeatables)\n : existing?.required_create_repeatables ?? [];\n}\n\nfunction resolveDefinitionOptions(\n normalizedDefinition: ItemTypeDefinition,\n existing: ResolvedItemTypeDefinition | undefined,\n): ItemTypeOptionDefinition[] {\n return normalizedDefinition.options ? normalizedDefinition.options : existing?.options ? [...existing.options] : [];\n}\n\nfunction resolveDefinitionCommandOptionPolicies(\n normalizedDefinition: ItemTypeDefinition,\n existing: ResolvedItemTypeDefinition | undefined,\n): ItemTypeCommandOptionPolicy[] {\n return normalizedDefinition.command_option_policies\n ? normalizedDefinition.command_option_policies\n : existing?.command_option_policies\n ? [...existing.command_option_policies]\n : [];\n}\n\nfunction applyTypeDefinitions(\n source: ItemTypeDefinition[],\n target: Map<string, ResolvedItemTypeDefinition>,\n): void {\n for (const rawDefinition of source) {\n const normalizedDefinition = normalizeTypeDefinition(rawDefinition);\n if (!normalizedDefinition) {\n continue;\n }\n const lowerName = normalizedDefinition.name.toLowerCase();\n const existing = target.get(lowerName);\n const keepName = existing?.name ?? normalizedDefinition.name;\n const folder = normalizedDefinition.folder ?? existing?.folder ?? toDefaultFolder(keepName);\n const aliases = normalizeItemTypeStringList([\n ...(existing?.aliases ?? []),\n ...(normalizedDefinition.aliases ?? []),\n ]);\n const defaultStatus = normalizedDefinition.default_status ?? existing?.default_status;\n const description = normalizedDefinition.description ?? existing?.description;\n target.set(lowerName, {\n name: keepName,\n ...(description ? { description } : {}),\n ...(defaultStatus ? { default_status: defaultStatus } : {}),\n folder,\n aliases,\n required_create_fields: resolveDefinitionRequiredCreateFields(normalizedDefinition, existing),\n required_create_repeatables: resolveDefinitionRequiredCreateRepeatables(normalizedDefinition, existing),\n options: resolveDefinitionOptions(normalizedDefinition, existing),\n command_option_policies: resolveDefinitionCommandOptionPolicies(normalizedDefinition, existing),\n });\n }\n}\n\nfunction collectExtensionTypeDefinitions(registrations: ExtensionRegistrationRegistry | null | undefined): ItemTypeDefinition[] {\n if (!registrations) {\n return [];\n }\n const definitions: ItemTypeDefinition[] = [];\n for (const registration of registrations.item_types ?? []) {\n const typeDefinitionsRaw = (registration as { types?: unknown[] }).types;\n if (!Array.isArray(typeDefinitionsRaw)) {\n continue;\n }\n for (const rawDefinition of typeDefinitionsRaw) {\n const normalized = coerceTypeDefinitionFromUnknown(rawDefinition);\n if (normalized) {\n definitions.push(normalized);\n }\n }\n }\n return definitions;\n}\n\n/**\n * Implements resolve item type registry for the public runtime surface of this module.\n */\nexport function resolveItemTypeRegistry(\n settings: PmSettings,\n extensionRegistrations: ExtensionRegistrationRegistry | null | undefined = null,\n): ItemTypeRegistry {\n const byLowerName = new Map<string, ResolvedItemTypeDefinition>();\n for (const builtin of ITEM_TYPE_VALUES) {\n byLowerName.set(builtin.toLowerCase(), {\n name: builtin,\n folder: TYPE_TO_FOLDER[builtin],\n aliases: [],\n required_create_fields: [...DEFAULT_REQUIRED_CREATE_FIELDS],\n required_create_repeatables: [...DEFAULT_REQUIRED_CREATE_REPEATABLES],\n options: [],\n command_option_policies: [],\n });\n }\n\n applyTypeDefinitions(settings.item_types?.definitions ?? [], byLowerName);\n applyTypeDefinitions(collectExtensionTypeDefinitions(extensionRegistrations), byLowerName);\n\n const definitions = [...byLowerName.values()].sort((left, right) => left.name.localeCompare(right.name));\n const byType: Record<string, ResolvedItemTypeDefinition> = {};\n const aliasToType: Record<string, string> = {};\n const typeToFolder: Record<string, string> = {};\n for (const definition of definitions) {\n byType[definition.name] = definition;\n typeToFolder[definition.name] = definition.folder;\n aliasToType[definition.name.toLowerCase()] = definition.name;\n for (const alias of definition.aliases) {\n aliasToType[alias.toLowerCase()] = definition.name;\n }\n }\n const folders = [...new Set(definitions.map((definition) => definition.folder))].sort((left, right) => left.localeCompare(right));\n return {\n types: definitions.map((definition) => definition.name),\n folders,\n type_to_folder: typeToFolder,\n by_type: byType,\n alias_to_type: aliasToType,\n };\n}\n\n/**\n * Implements resolve type name for the public runtime surface of this module.\n */\nexport function resolveTypeName(rawType: string | undefined, registry: ItemTypeRegistry): string | undefined {\n if (rawType === undefined) {\n return undefined;\n }\n return registry.alias_to_type[rawType.trim().toLowerCase()];\n}\n\n/**\n * Implements resolve type definition for the public runtime surface of this module.\n */\nexport function resolveTypeDefinition(\n typeName: string | undefined,\n registry: ItemTypeRegistry,\n): ResolvedItemTypeDefinition | undefined {\n const resolvedName = resolveTypeName(typeName, registry);\n if (!resolvedName) {\n return undefined;\n }\n return registry.by_type[resolvedName];\n}\n\n/**\n * Implements resolve command option policy state for the public runtime surface of this module.\n */\nexport function resolveCommandOptionPolicyState(\n typeDefinition: ResolvedItemTypeDefinition,\n command: CommandOptionPolicyCommand,\n baseRequiredOptions: Iterable<string>,\n): CommandOptionPolicyState {\n const errors: string[] = [];\n const required = new Set<string>();\n const hidden = new Set<string>();\n const disabled = new Set<string>();\n\n for (const rawBase of baseRequiredOptions) {\n const canonical = canonicalizeCommandOptionKey(command, rawBase);\n if (!canonical) {\n errors.push(\n `Unsupported base required option \"${rawBase}\" for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n continue;\n }\n required.add(canonical);\n }\n\n for (const policy of typeDefinition.command_option_policies) {\n if (policy.command !== command) {\n continue;\n }\n const canonical = canonicalizeCommandOptionKey(command, policy.option);\n if (!canonical) {\n errors.push(\n `Unsupported command_option_policies option \"${policy.option}\" for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n continue;\n }\n if (policy.required !== undefined) {\n if (policy.required) {\n required.add(canonical);\n } else {\n required.delete(canonical);\n }\n }\n if (policy.visible !== undefined) {\n if (policy.visible) {\n hidden.delete(canonical);\n } else {\n hidden.add(canonical);\n }\n }\n if (policy.enabled !== undefined) {\n if (policy.enabled) {\n disabled.delete(canonical);\n } else {\n disabled.add(canonical);\n }\n }\n }\n\n for (const option of required) {\n if (disabled.has(option)) {\n errors.push(\n `Option \"${option}\" cannot be both required and disabled for command \"${command}\" on type \"${typeDefinition.name}\"`,\n );\n }\n }\n\n return {\n required: [...required],\n hidden: [...hidden].sort((left, right) => left.localeCompare(right)),\n disabled: [...disabled].sort((left, right) => left.localeCompare(right)),\n errors,\n };\n}\n\nfunction buildTypeOptionAliasMap(typeDefinition: ResolvedItemTypeDefinition): Map<string, ItemTypeOptionDefinition> {\n const optionByAlias = new Map<string, ItemTypeOptionDefinition>();\n for (const option of typeDefinition.options) {\n optionByAlias.set(option.key.toLowerCase(), option);\n for (const alias of option.aliases ?? []) {\n optionByAlias.set(alias.toLowerCase(), option);\n }\n }\n return optionByAlias;\n}\n\nfunction resolveTypeOptionValue(\n optionDefinition: ItemTypeOptionDefinition,\n trimmedValue: string,\n errors: string[],\n): string | undefined {\n const allowedValues = optionDefinition.values;\n if (allowedValues.length === 0) {\n return trimmedValue;\n }\n const valueLookup = new Map(allowedValues.map((value) => [value.toLowerCase(), value]));\n const canonical = valueLookup.get(trimmedValue.toLowerCase());\n if (!canonical) {\n errors.push(`Invalid value \"${trimmedValue}\" for type option \"${optionDefinition.key}\". Allowed: ${allowedValues.join(\", \")}`);\n return undefined;\n }\n return canonical;\n}\n\n/**\n * Implements validate type options for the public runtime surface of this module.\n */\nexport function validateTypeOptions(\n typeName: string,\n rawTypeOptions: Record<string, string> | undefined,\n registry: ItemTypeRegistry,\n): { normalized: Record<string, string> | undefined; errors: string[] } {\n const typeDefinition = resolveTypeDefinition(typeName, registry);\n if (!typeDefinition) {\n return {\n normalized: undefined,\n errors: [`Unknown type \"${typeName}\"`],\n };\n }\n const errors: string[] = [];\n const optionByAlias = buildTypeOptionAliasMap(typeDefinition);\n\n const normalized: Record<string, string> = {};\n for (const [rawKey, rawValue] of Object.entries(rawTypeOptions ?? {})) {\n const trimmedKey = rawKey.trim();\n const trimmedValue = rawValue.trim();\n if (trimmedKey.length === 0) {\n errors.push(\"type option keys must not be empty\");\n continue;\n }\n if (trimmedValue.length === 0) {\n errors.push(`type option \"${trimmedKey}\" must not be empty`);\n continue;\n }\n const optionDefinition = optionByAlias.get(trimmedKey.toLowerCase());\n if (!optionDefinition) {\n const allowed = typeDefinition.options.map((option) => option.key).join(\", \");\n errors.push(\n typeDefinition.options.length > 0\n ? `Unknown type option \"${trimmedKey}\" for type \"${typeDefinition.name}\". Allowed: ${allowed}`\n : `Type \"${typeDefinition.name}\" does not define any configurable type options`,\n );\n continue;\n }\n const resolvedValue = resolveTypeOptionValue(optionDefinition, trimmedValue, errors);\n if (resolvedValue === undefined) {\n continue;\n }\n normalized[optionDefinition.key] = resolvedValue;\n }\n\n for (const option of typeDefinition.options) {\n if (option.required && !(option.key in normalized)) {\n errors.push(`Missing required type option \"${option.key}\" for type \"${typeDefinition.name}\"`);\n }\n }\n\n const sortedKeys = Object.keys(normalized).sort((left, right) => left.localeCompare(right));\n if (sortedKeys.length === 0) {\n return {\n normalized: undefined,\n errors,\n };\n }\n return {\n normalized: Object.fromEntries(sortedKeys.map((key) => [key, normalized[key]])),\n errors,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAQxD,OAAO,EAAE,gBAAgB,E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,CAAC;QACD,MAAM,aAAa,GAAG,sBAAsB,CAAC,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;QACrF,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;YAChC,SAAS;QACX,CAAC;QACD,UAAU,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC;IACnD,CAAC;IAED,KAAK,MAAM,MAAM,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;QAC5C,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,EAAE,CAAC;YACnD,MAAM,CAAC,IAAI,CAAC,iCAAiC,MAAM,CAAC,GAAG,eAAe,cAAc,CAAC,IAAI,GAAG,CAAC,CAAC;QAChG,CAAC;IACH,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5F,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO;YACL,UAAU,EAAE,SAAS;YACrB,MAAM;SACP,CAAC;IACJ,CAAC;IACD,OAAO;QACL,UAAU,EAAE,MAAM,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC/E,MAAM;KACP,CAAC;AACJ,CAAC","debugId":"e9e27e2d-967c-5e17-8266-d661f65b78ac"}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* MCP server, and returns the original reference unchanged when nothing is compacted.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
22
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="31ecd51a-b5e0-503b-b488-4e6a12815ffe")}catch(e){}}();
|
|
23
23
|
const CHANGED_FIELDS_KEY = "changed_fields";
|
|
24
24
|
const CHANGED_FIELD_COUNT_KEY = "changed_field_count";
|
|
25
25
|
const ROWS_KEY = "rows";
|
|
@@ -60,17 +60,48 @@ function replaceRows(envelope, rows) {
|
|
|
60
60
|
projected[ROWS_KEY] = rows;
|
|
61
61
|
return projected;
|
|
62
62
|
}
|
|
63
|
+
function projectIdOnlyResult(result) {
|
|
64
|
+
if (!isPlainObject(result) || !isPlainObject(result.item)) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const id = typeof result.item.id === "string" ? result.item.id : undefined;
|
|
68
|
+
const status = typeof result.item.status === "string" ? result.item.status : undefined;
|
|
69
|
+
if (!id) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
return status ? { id, status } : { id };
|
|
73
|
+
}
|
|
74
|
+
function compactUpdateManyRows(envelope) {
|
|
75
|
+
const rows = isUpdateManyMutationEnvelope(envelope) ? envelope[ROWS_KEY] : undefined;
|
|
76
|
+
if (!Array.isArray(rows)) {
|
|
77
|
+
return { projected: envelope, changed: false };
|
|
78
|
+
}
|
|
79
|
+
let rowsChanged = false;
|
|
80
|
+
const nextRows = rows.map((row) => {
|
|
81
|
+
if (!isPlainObject(row)) {
|
|
82
|
+
return row;
|
|
83
|
+
}
|
|
84
|
+
const compactedRow = compactOwnChangedFields(row);
|
|
85
|
+
if (compactedRow) {
|
|
86
|
+
rowsChanged = true;
|
|
87
|
+
return compactedRow;
|
|
88
|
+
}
|
|
89
|
+
return row;
|
|
90
|
+
});
|
|
91
|
+
return rowsChanged
|
|
92
|
+
? { projected: replaceRows(envelope, nextRows), changed: true }
|
|
93
|
+
: { projected: envelope, changed: false };
|
|
94
|
+
}
|
|
63
95
|
/**
|
|
64
96
|
* Returns a copy of a mutation result with the envelope `changed_fields` arrays
|
|
65
97
|
* replaced by `changed_field_count` when compact mode is requested. Inputs that are
|
|
66
98
|
* not a mutation envelope (or full mode) are returned unchanged (same reference).
|
|
67
99
|
*/
|
|
68
100
|
export function projectMutationResult(result, options = {}) {
|
|
69
|
-
if (options.idOnly === true
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return status ? { id, status } : { id };
|
|
101
|
+
if (options.idOnly === true) {
|
|
102
|
+
const idOnly = projectIdOnlyResult(result);
|
|
103
|
+
if (idOnly !== null) {
|
|
104
|
+
return idOnly;
|
|
74
105
|
}
|
|
75
106
|
}
|
|
76
107
|
const mode = options.changedFields ?? "full";
|
|
@@ -84,27 +115,12 @@ export function projectMutationResult(result, options = {}) {
|
|
|
84
115
|
projected = compactedTop;
|
|
85
116
|
changed = true;
|
|
86
117
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const nextRows = rows.map((row) => {
|
|
92
|
-
if (!isPlainObject(row)) {
|
|
93
|
-
return row;
|
|
94
|
-
}
|
|
95
|
-
const compactedRow = compactOwnChangedFields(row);
|
|
96
|
-
if (compactedRow) {
|
|
97
|
-
rowsChanged = true;
|
|
98
|
-
return compactedRow;
|
|
99
|
-
}
|
|
100
|
-
return row;
|
|
101
|
-
});
|
|
102
|
-
if (rowsChanged) {
|
|
103
|
-
projected = replaceRows(projected, nextRows);
|
|
104
|
-
changed = true;
|
|
105
|
-
}
|
|
118
|
+
const rowProjection = compactUpdateManyRows(projected);
|
|
119
|
+
if (rowProjection.changed) {
|
|
120
|
+
projected = rowProjection.projected;
|
|
121
|
+
changed = true;
|
|
106
122
|
}
|
|
107
123
|
return changed ? projected : result;
|
|
108
124
|
}
|
|
109
125
|
//# sourceMappingURL=mutation-projection.js.map
|
|
110
|
-
//# debugId=
|
|
126
|
+
//# debugId=31ecd51a-b5e0-503b-b488-4e6a12815ffe
|