@unbrained/pm-cli 2026.6.13 → 2026.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +102 -0
- package/README.md +1 -1
- package/dist/cli/bootstrap-args.d.ts +29 -0
- package/dist/cli/bootstrap-args.js +11 -4
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.d.ts +12 -0
- package/dist/cli/commander-usage.js +18 -7
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.d.ts +19 -0
- package/dist/cli/commands/activity.js +12 -2
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +58 -0
- package/dist/cli/commands/aggregate.js +48 -15
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +6 -1
- package/dist/cli/commands/annotation-command.js +72 -2
- package/dist/cli/commands/annotation-command.js.map +1 -1
- package/dist/cli/commands/append.js +4 -3
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/close-many.d.ts +20 -0
- package/dist/cli/commands/close-many.js +14 -23
- package/dist/cli/commands/close-many.js.map +1 -1
- package/dist/cli/commands/close.js +37 -4
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +3 -2
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +2 -0
- package/dist/cli/commands/comments.js +49 -23
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +362 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +51 -1
- package/dist/cli/commands/config.js +50 -12
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +79 -1
- package/dist/cli/commands/context.js +151 -25
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +80 -1
- package/dist/cli/commands/contracts.js +54 -4
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +51 -0
- package/dist/cli/commands/create.js +137 -18
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.d.ts +33 -0
- package/dist/cli/commands/dedupe-audit.js +18 -14
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/deps.js +7 -4
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.js +3 -3
- package/dist/cli/commands/event-validation-messages.js.map +1 -1
- package/dist/cli/commands/extension/bundled-catalog.d.ts +7 -0
- package/dist/cli/commands/extension/bundled-catalog.js +19 -15
- package/dist/cli/commands/extension/bundled-catalog.js.map +1 -1
- package/dist/cli/commands/extension/install-sources.d.ts +41 -1
- package/dist/cli/commands/extension/install-sources.js +26 -8
- package/dist/cli/commands/extension/install-sources.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +5 -0
- package/dist/cli/commands/extension/shared.js +9 -3
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +133 -1
- package/dist/cli/commands/extension.js +127 -9
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.d.ts +30 -1
- package/dist/cli/commands/files.js +21 -2
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/focus.d.ts +11 -0
- package/dist/cli/commands/focus.js +86 -0
- package/dist/cli/commands/focus.js.map +1 -0
- package/dist/cli/commands/get.d.ts +9 -2
- package/dist/cli/commands/get.js +34 -6
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.d.ts +5 -0
- package/dist/cli/commands/guide.js +6 -3
- package/dist/cli/commands/guide.js.map +1 -1
- package/dist/cli/commands/health.d.ts +109 -0
- package/dist/cli/commands/health.js +87 -35
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.js +27 -36
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +46 -0
- package/dist/cli/commands/history-redact.js +99 -67
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.js +34 -37
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/history.js +6 -2
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +4 -1
- package/dist/cli/commands/index.js +6 -3
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +54 -0
- package/dist/cli/commands/init-agent-guidance.js +31 -4
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +38 -2
- package/dist/cli/commands/init.js +50 -64
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +4 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/lifecycle-transitions.d.ts +23 -0
- package/dist/cli/commands/lifecycle-transitions.js +41 -0
- package/dist/cli/commands/lifecycle-transitions.js.map +1 -0
- package/dist/cli/commands/linked-artifacts.d.ts +5 -0
- package/dist/cli/commands/linked-artifacts.js +18 -4
- package/dist/cli/commands/linked-artifacts.js.map +1 -1
- package/dist/cli/commands/linked-test-parsers.d.ts +5 -0
- package/dist/cli/commands/linked-test-parsers.js +5 -2
- package/dist/cli/commands/linked-test-parsers.js.map +1 -1
- package/dist/cli/commands/list-filter-shared.d.ts +8 -0
- package/dist/cli/commands/list-filter-shared.js +70 -0
- package/dist/cli/commands/list-filter-shared.js.map +1 -0
- package/dist/cli/commands/list.d.ts +116 -0
- package/dist/cli/commands/list.js +194 -6
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/normalize.js +16 -2
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +4 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.js +3 -2
- package/dist/cli/commands/plan.js.map +1 -1
- package/dist/cli/commands/recurrence-parsers.d.ts +9 -0
- package/dist/cli/commands/recurrence-parsers.js +19 -2
- package/dist/cli/commands/recurrence-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +83 -0
- package/dist/cli/commands/reindex.js +45 -10
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/repeatable-metadata-parsers.js +28 -4
- package/dist/cli/commands/repeatable-metadata-parsers.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +40 -1
- package/dist/cli/commands/restore.js +27 -2
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/scheduling-shortcuts.d.ts +43 -0
- package/dist/cli/commands/scheduling-shortcuts.js +87 -0
- package/dist/cli/commands/scheduling-shortcuts.js.map +1 -0
- package/dist/cli/commands/schema.d.ts +152 -2
- package/dist/cli/commands/schema.js +510 -4
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/search.d.ts +289 -1
- package/dist/cli/commands/search.js +367 -60
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.d.ts +38 -0
- package/dist/cli/commands/stats.js +38 -10
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/telemetry.js +5 -3
- package/dist/cli/commands/telemetry.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +18 -0
- package/dist/cli/commands/templates.js +9 -2
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +5 -0
- package/dist/cli/commands/test-all.js +9 -3
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +70 -1
- package/dist/cli/commands/test.js +84 -3
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.d.ts +34 -1
- package/dist/cli/commands/update-many.js +60 -31
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.d.ts +71 -0
- package/dist/cli/commands/update.js +91 -11
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.d.ts +28 -1
- package/dist/cli/commands/upgrade.js +17 -4
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +114 -0
- package/dist/cli/commands/validate.js +153 -8
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +30 -0
- package/dist/cli/error-guidance.js +41 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-options.js +9 -7
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.d.ts +8 -0
- package/dist/cli/help-content.js +54 -6
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +19 -1
- package/dist/cli/help-json-payload.js +16 -7
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.d.ts +242 -0
- package/dist/cli/main.js +241 -45
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +62 -5
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +16 -0
- package/dist/cli/register-mutation.js +376 -100
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.d.ts +8 -0
- package/dist/cli/register-operations.js +134 -11
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +9 -6
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +4 -0
- package/dist/cli/registration-helpers.js +124 -38
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/activity-PZYSZA26.js +18 -0
- package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js → activity-SFM4THAU.js} +13 -11
- package/dist/cli-bundle/chunks/{aggregate-IRHJWEKG.js → aggregate-Y5ADDKBM.js} +55 -26
- package/dist/cli-bundle/chunks/aggregate-Y5ADDKBM.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-XEBW22UQ.js → aggregate-YTAUQLRW.js} +54 -25
- package/dist/cli-bundle/chunks/aggregate-YTAUQLRW.js.map +7 -0
- package/dist/cli-bundle/chunks/{append-NL67JNJU.js → append-4M7OVV7M.js} +11 -11
- package/dist/cli-bundle/chunks/append-4M7OVV7M.js.map +1 -0
- package/dist/cli-bundle/chunks/{append-N2AWXKZC.js → append-HSPK4L4V.js} +10 -10
- package/dist/cli-bundle/chunks/{append-N2AWXKZC.js.map → append-HSPK4L4V.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js → chunk-26BM6YLO.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js → chunk-2C6FU3D3.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-CEGUH2E5.js.map → chunk-2C6FU3D3.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-SQDKAEKG.js → chunk-2OPYLXDO.js} +117 -37
- package/dist/cli-bundle/chunks/chunk-2OPYLXDO.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4ZKKZMLH.js → chunk-2S46FKLB.js} +104 -30
- package/dist/cli-bundle/chunks/chunk-2S46FKLB.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js → chunk-2TMKMTEI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js → chunk-2VH7DFSJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RHYBR6G7.js → chunk-3ENF4NO4.js} +74 -14
- package/dist/cli-bundle/chunks/chunk-3ENF4NO4.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js +404 -0
- package/dist/cli-bundle/chunks/chunk-3GR2HTYY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AAUYXSFF.js → chunk-3R3FYCBV.js} +223 -50
- package/dist/cli-bundle/chunks/chunk-3R3FYCBV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5HSAHRYA.js → chunk-3UKJX3RP.js} +82 -21
- package/dist/cli-bundle/chunks/chunk-3UKJX3RP.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js +83 -0
- package/dist/cli-bundle/chunks/chunk-4RTLBTYS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UCVJP4JL.js → chunk-5FDYWOJT.js} +52 -8
- package/dist/cli-bundle/chunks/chunk-5FDYWOJT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js → chunk-5XGWFUW2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-LYNQ3NGI.js → chunk-6BD77FGL.js} +309 -20
- package/dist/cli-bundle/chunks/chunk-6BD77FGL.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js +35 -0
- package/dist/cli-bundle/chunks/chunk-6EFCFPNE.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-36BCSMKP.js → chunk-6HF6CIY2.js} +26 -11
- package/dist/cli-bundle/chunks/chunk-6HF6CIY2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-M3SI2REU.js → chunk-6PBPD4MN.js} +322 -19
- package/dist/cli-bundle/chunks/chunk-6PBPD4MN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TSXWFN3L.js → chunk-6VFUEGOA.js} +53 -9
- package/dist/cli-bundle/chunks/chunk-6VFUEGOA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2J2AH4V5.js → chunk-AAOXSPAE.js} +56 -72
- package/dist/cli-bundle/chunks/chunk-AAOXSPAE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js → chunk-AJCQ5GT6.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js +61 -0
- package/dist/cli-bundle/chunks/chunk-ALTGYHN3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-KHGTYCJ6.js → chunk-AOJQL33L.js} +83 -22
- package/dist/cli-bundle/chunks/chunk-AOJQL33L.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js → chunk-AXLDUGXA.js} +7 -4
- package/dist/cli-bundle/chunks/{chunk-5LMF75Q7.js.map → chunk-AXLDUGXA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js → chunk-BITCVGHT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js → chunk-CGQTFWYI.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LFW5NQUP.js → chunk-CHM2VFVL.js} +407 -290
- package/dist/cli-bundle/chunks/chunk-CHM2VFVL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js → chunk-COVLE33A.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-SGMGMCIF.js → chunk-DDNBWH4W.js} +157 -25
- package/dist/cli-bundle/chunks/chunk-DDNBWH4W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js → chunk-F5MSD5HE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6TBR5AZ2.js → chunk-FAXB6F6R.js} +76 -8
- package/dist/cli-bundle/chunks/chunk-FAXB6F6R.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L6YQONLM.js → chunk-FPDK5BZQ.js} +18 -19
- package/dist/cli-bundle/chunks/chunk-FPDK5BZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-AGG32LKL.js → chunk-FPY2TOFI.js} +480 -24
- package/dist/cli-bundle/chunks/chunk-FPY2TOFI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JWXTOYBI.js → chunk-G2MOUCTU.js} +121 -44
- package/dist/cli-bundle/chunks/chunk-G2MOUCTU.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3VULHQNS.js → chunk-G57RHEGP.js} +36 -18
- package/dist/cli-bundle/chunks/chunk-G57RHEGP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QQG4HEX7.js → chunk-IROHIK2T.js} +37 -63
- package/dist/cli-bundle/chunks/chunk-IROHIK2T.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js → chunk-JZHL4E3Q.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XXLMJDUB.js → chunk-KA22USXD.js} +21 -22
- package/dist/cli-bundle/chunks/chunk-KA22USXD.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WLH7X4RN.js → chunk-KBC4O7SY.js} +56 -72
- package/dist/cli-bundle/chunks/chunk-KBC4O7SY.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js → chunk-KCAGIH6K.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BVL5KGVA.js → chunk-KO3VM5GS.js} +27 -12
- package/dist/cli-bundle/chunks/chunk-KO3VM5GS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IXVSSHGV.js → chunk-LNH5Q32E.js} +13 -8
- package/dist/cli-bundle/chunks/chunk-LNH5Q32E.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js → chunk-LORM3M2I.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-3FMQMHAG.js.map → chunk-LORM3M2I.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-PNYAAB4S.js → chunk-LWGMDLQ6.js} +8 -3
- package/dist/cli-bundle/chunks/chunk-LWGMDLQ6.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js → chunk-M4AVU7VC.js} +19 -8
- package/dist/cli-bundle/chunks/{chunk-GFBEXDCQ.js.map → chunk-M4AVU7VC.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js → chunk-MIBX6ZRN.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AUDDXKNX.js → chunk-MMF2E3FM.js} +77 -9
- package/dist/cli-bundle/chunks/chunk-MMF2E3FM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RFR2YQGO.js → chunk-MORZOR7W.js} +21 -8
- package/dist/cli-bundle/chunks/chunk-MORZOR7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4TPFXE2R.js → chunk-MUTUZ2HD.js} +118 -74
- package/dist/cli-bundle/chunks/chunk-MUTUZ2HD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HZOX5BYD.js → chunk-OGXEBTX3.js} +35 -17
- package/dist/cli-bundle/chunks/chunk-OGXEBTX3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js → chunk-OOIH6J5T.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LOAR5TKX.js.map → chunk-OOIH6J5T.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-VNC2HBL4.js → chunk-OSBJPPX3.js} +20 -9
- package/dist/cli-bundle/chunks/chunk-OSBJPPX3.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2ANTZBYF.js → chunk-PJS3WDO2.js} +122 -45
- package/dist/cli-bundle/chunks/chunk-PJS3WDO2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7SM7VA5I.js → chunk-QGPE2H6Z.js} +19 -8
- package/dist/cli-bundle/chunks/chunk-QGPE2H6Z.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js +58 -0
- package/dist/cli-bundle/chunks/chunk-QVTFFLR2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js → chunk-QW2F6ARZ.js} +8 -5
- package/dist/cli-bundle/chunks/{chunk-JCTZV7TO.js.map → chunk-QW2F6ARZ.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-TOX7YQ7X.js → chunk-QXC3LWB7.js} +223 -50
- package/dist/cli-bundle/chunks/chunk-QXC3LWB7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-W6KNFAMZ.js → chunk-QXMXRPX5.js} +9 -8
- package/dist/cli-bundle/chunks/chunk-QXMXRPX5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js → chunk-R4AKUPKI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-O3YCJOVX.js.map → chunk-R4AKUPKI.js.map} +1 -1
- package/dist/cli-bundle/chunks/chunk-RASR23HV.js +394 -0
- package/dist/cli-bundle/chunks/chunk-RASR23HV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-JW7D6437.js → chunk-SCDCNGCV.js} +20 -9
- package/dist/cli-bundle/chunks/chunk-SCDCNGCV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js → chunk-SCS5PVAA.js} +10 -9
- package/dist/cli-bundle/chunks/{chunk-GRZGHGRG.js.map → chunk-SCS5PVAA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-S2CDTRJ6.js → chunk-SJCMTOEU.js} +381 -271
- package/dist/cli-bundle/chunks/chunk-SJCMTOEU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js → chunk-SO2ES46D.js} +11 -10
- package/dist/cli-bundle/chunks/{chunk-XWDZVCBJ.js.map → chunk-SO2ES46D.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-MACCNKSZ.js → chunk-TBV33CB4.js} +36 -62
- package/dist/cli-bundle/chunks/chunk-TBV33CB4.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js +86 -0
- package/dist/cli-bundle/chunks/chunk-TEFEXQWI.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HLEGAQXT.js → chunk-TWBDDVIF.js} +20 -7
- package/dist/cli-bundle/chunks/chunk-TWBDDVIF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4JHJ7YG2.js → chunk-UGUJ2UOR.js} +118 -74
- package/dist/cli-bundle/chunks/chunk-UGUJ2UOR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js → chunk-UN6P3IJ4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-32XSW44C.js → chunk-V2GYOMEX.js} +10 -9
- package/dist/cli-bundle/chunks/chunk-V2GYOMEX.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HWHONML5.js → chunk-VF3KQGNY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-SOHXUA2Q.js → chunk-VHG6LUKR.js} +116 -36
- package/dist/cli-bundle/chunks/chunk-VHG6LUKR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7CRFV6JR.js → chunk-VXHMQDXA.js} +483 -27
- package/dist/cli-bundle/chunks/chunk-VXHMQDXA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IZHCCG4S.js → chunk-VXRFAE7W.js} +14 -9
- package/dist/cli-bundle/chunks/chunk-VXRFAE7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-R4VWYWRN.js → chunk-W3HFLORZ.js} +7 -2
- package/dist/cli-bundle/chunks/chunk-W3HFLORZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-4FHLNNW7.js → chunk-WQRL4COW.js} +74 -14
- package/dist/cli-bundle/chunks/chunk-WQRL4COW.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js +32 -0
- package/dist/cli-bundle/chunks/chunk-X3W5ESZQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-MGAQ6KZG.js → chunk-XESAPVZ4.js} +166 -27
- package/dist/cli-bundle/chunks/chunk-XESAPVZ4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-PEH7SZD2.js → chunk-YLAW3FZN.js} +105 -31
- package/dist/cli-bundle/chunks/chunk-YLAW3FZN.js.map +7 -0
- package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js → claim-WGAWJCPY.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js → claim-ZI6P4LMU.js} +10 -10
- package/dist/cli-bundle/chunks/close-I7PRQ5G7.js +13 -0
- package/dist/cli-bundle/chunks/{close-SPUFW5QR.js → close-JMVVSIQE.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-GKAJX54X.js → close-many-IKPJXVOZ.js} +32 -20
- package/dist/cli-bundle/chunks/close-many-IKPJXVOZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{close-many-GL6NRUU5.js → close-many-TXABDCSJ.js} +31 -19
- package/dist/cli-bundle/chunks/close-many-TXABDCSJ.js.map +7 -0
- package/dist/cli-bundle/chunks/{comments-5FPT6L7N.js → comments-RLWR2S7W.js} +55 -31
- package/dist/cli-bundle/chunks/comments-RLWR2S7W.js.map +1 -0
- package/dist/cli-bundle/chunks/{comments-TOLOYWNI.js → comments-YAMXKHUX.js} +54 -30
- package/dist/cli-bundle/chunks/comments-YAMXKHUX.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-7N6D7YJE.js → config-7ICYC2WU.js} +83 -19
- package/dist/cli-bundle/chunks/config-7ICYC2WU.js.map +7 -0
- package/dist/cli-bundle/chunks/{config-4MN45TIH.js → config-NGWN3EXC.js} +83 -19
- package/dist/cli-bundle/chunks/config-NGWN3EXC.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-AQSLE7DZ.js → context-K6QAHN5H.js} +128 -39
- package/dist/cli-bundle/chunks/context-K6QAHN5H.js.map +1 -0
- package/dist/cli-bundle/chunks/{context-U3PUJMVN.js → context-VGXOOAH2.js} +127 -38
- package/dist/cli-bundle/chunks/context-VGXOOAH2.js.map +7 -0
- package/dist/cli-bundle/chunks/{contracts-ITSJXO3O.js → contracts-KJGY2AQA.js} +99 -15
- package/dist/cli-bundle/chunks/contracts-KJGY2AQA.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-H7KCQXLY.js → contracts-KMA6OJY7.js} +99 -15
- package/dist/cli-bundle/chunks/contracts-KMA6OJY7.js.map +7 -0
- package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js → copy-Q2PPU4AY.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-C4W522JM.js → copy-SC6UF3PI.js} +7 -7
- package/dist/cli-bundle/chunks/{create-4EQNELMY.js → create-76FE7JVF.js} +16 -13
- package/dist/cli-bundle/chunks/create-RTRFW6RE.js +30 -0
- package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js → delete-T6DJSUJI.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js → delete-XFUX533E.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js → deps-5GWMMS6D.js} +9 -10
- package/dist/cli-bundle/chunks/{deps-GPB3LGWN.js.map → deps-5GWMMS6D.js.map} +2 -2
- package/dist/cli-bundle/chunks/{deps-HV2C2L46.js → deps-MCCU633S.js} +10 -11
- package/dist/cli-bundle/chunks/deps-MCCU633S.js.map +1 -0
- package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js → docs-HE3HCQ4S.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-RJQPLROO.js → docs-SXMOABHR.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js → extension-E23K4QRR.js} +7 -5
- package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js → extension-PMD3XMLN.js} +7 -5
- package/dist/cli-bundle/chunks/{files-OIFN3DQX.js → files-2RSWGPEU.js} +25 -11
- package/dist/cli-bundle/chunks/files-2RSWGPEU.js.map +1 -0
- package/dist/cli-bundle/chunks/{files-LIFDKNCN.js → files-ZWFJFWBK.js} +24 -10
- package/dist/cli-bundle/chunks/files-ZWFJFWBK.js.map +7 -0
- package/dist/cli-bundle/chunks/focus-KTTB3P3F.js +106 -0
- package/dist/cli-bundle/chunks/focus-KTTB3P3F.js.map +1 -0
- package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js +109 -0
- package/dist/cli-bundle/chunks/focus-ZMDP4FEL.js.map +7 -0
- package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js → gc-BXIAKLAH.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js → gc-C7K6JNUO.js} +3 -3
- package/dist/cli-bundle/chunks/{get-SAB7CRBG.js → get-AZQLC4NO.js} +43 -16
- package/dist/cli-bundle/chunks/get-AZQLC4NO.js.map +1 -0
- package/dist/cli-bundle/chunks/{get-K7UULTQF.js → get-I65HTAWO.js} +42 -15
- package/dist/cli-bundle/chunks/get-I65HTAWO.js.map +7 -0
- package/dist/cli-bundle/chunks/{health-NUVZYIEV.js → health-3MFFPQVZ.js} +75 -49
- package/dist/cli-bundle/chunks/health-3MFFPQVZ.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-VJWH3ZFK.js → health-MYZEOCLI.js} +74 -48
- package/dist/cli-bundle/chunks/health-MYZEOCLI.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-GYFD2DJW.js → history-73Z6OBFZ.js} +10 -10
- package/dist/cli-bundle/chunks/history-BIPHVUMF.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-WQZQ6KXM.js → history-compact-24VQ63A3.js} +37 -46
- package/dist/cli-bundle/chunks/history-compact-24VQ63A3.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-compact-SLL6ESXH.js → history-compact-UIAR2OI4.js} +38 -47
- package/dist/cli-bundle/chunks/history-compact-UIAR2OI4.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js → history-redact-7YCXEWJD.js} +13 -11
- package/dist/cli-bundle/chunks/history-redact-WZZ6GZ2Z.js +21 -0
- package/dist/cli-bundle/chunks/{history-repair-BJCGM6Q3.js → history-repair-4NOFFG2W.js} +44 -49
- package/dist/cli-bundle/chunks/history-repair-4NOFFG2W.js.map +1 -0
- package/dist/cli-bundle/chunks/{history-repair-UCYS55ZX.js → history-repair-GQN2X4TR.js} +43 -48
- package/dist/cli-bundle/chunks/history-repair-GQN2X4TR.js.map +7 -0
- package/dist/cli-bundle/chunks/init-K34V4PZR.js +20 -0
- package/dist/cli-bundle/chunks/{init-MXV57LKL.js → init-TDEDNVMM.js} +12 -9
- package/dist/cli-bundle/chunks/{learnings-QKJOKEAO.js → learnings-TV2CTGJ3.js} +13 -12
- package/dist/cli-bundle/chunks/learnings-TV2CTGJ3.js.map +7 -0
- package/dist/cli-bundle/chunks/{learnings-L6KTZGOT.js → learnings-U67FTXPB.js} +14 -13
- package/dist/cli-bundle/chunks/learnings-U67FTXPB.js.map +1 -0
- package/dist/cli-bundle/chunks/list-MSHYOCFU.js +33 -0
- package/dist/cli-bundle/chunks/list-VV57WGUD.js +29 -0
- package/dist/cli-bundle/chunks/{notes-HMCB7TK6.js → notes-EUANWWKD.js} +13 -12
- package/dist/cli-bundle/chunks/notes-EUANWWKD.js.map +7 -0
- package/dist/cli-bundle/chunks/{notes-3NLK7WTZ.js → notes-GYVNDAL4.js} +14 -13
- package/dist/cli-bundle/chunks/notes-GYVNDAL4.js.map +1 -0
- package/dist/cli-bundle/chunks/{plan-NANUWH4T.js → plan-4LF4AV63.js} +15 -14
- package/dist/cli-bundle/chunks/plan-4LF4AV63.js.map +7 -0
- package/dist/cli-bundle/chunks/{plan-DWBYI5C6.js → plan-W27O6DBS.js} +16 -15
- package/dist/cli-bundle/chunks/plan-W27O6DBS.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-SMMMLSWW.js → register-list-query-BXLEHJ7L.js} +32 -23
- package/dist/cli-bundle/chunks/register-list-query-BXLEHJ7L.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-PWQ5F2VI.js → register-list-query-C2MS3BVQ.js} +31 -22
- package/dist/cli-bundle/chunks/register-list-query-C2MS3BVQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-QKFPTIZG.js → register-mutation-6UCOEQ6L.js} +361 -106
- package/dist/cli-bundle/chunks/register-mutation-6UCOEQ6L.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-ZYJQ4DVP.js → register-mutation-HE73PREP.js} +355 -107
- package/dist/cli-bundle/chunks/register-mutation-HE73PREP.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-2FMZ6WEF.js → register-operations-L6C32FDA.js} +111 -39
- package/dist/cli-bundle/chunks/register-operations-L6C32FDA.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-BAFQURZG.js → register-operations-QQEHEX4P.js} +112 -40
- package/dist/cli-bundle/chunks/register-operations-QQEHEX4P.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-QN2XV7UL.js → register-setup-A7N4PNT3.js} +18 -21
- package/dist/cli-bundle/chunks/register-setup-A7N4PNT3.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-setup-DQEIKBIP.js → register-setup-WHG3NBP6.js} +17 -20
- package/dist/cli-bundle/chunks/register-setup-WHG3NBP6.js.map +7 -0
- package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js → restore-TSWSULYY.js} +13 -11
- package/dist/cli-bundle/chunks/restore-XQXICL3V.js +19 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js +91 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-NC46K6BD.js.map +7 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js +88 -0
- package/dist/cli-bundle/chunks/scheduling-shortcuts-UGDPQALY.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-ZZ7ZDM2X.js → schema-7U7JUYGK.js} +797 -10
- package/dist/cli-bundle/chunks/schema-7U7JUYGK.js.map +1 -0
- package/dist/cli-bundle/chunks/{schema-RNVJ55V2.js → schema-TSBYSEMW.js} +810 -9
- package/dist/cli-bundle/chunks/schema-TSBYSEMW.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-BJ457C2A.js → search-OXLSQKHP.js} +328 -71
- package/dist/cli-bundle/chunks/search-OXLSQKHP.js.map +7 -0
- package/dist/cli-bundle/chunks/{search-FQDZXX7P.js → search-T3TOFLOQ.js} +328 -71
- package/dist/cli-bundle/chunks/search-T3TOFLOQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{stats-DUQWCVOS.js → stats-5CLG22YZ.js} +41 -16
- package/dist/cli-bundle/chunks/stats-5CLG22YZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{stats-CUG3ZHOI.js → stats-XEMUXS42.js} +42 -17
- package/dist/cli-bundle/chunks/stats-XEMUXS42.js.map +1 -0
- package/dist/cli-bundle/chunks/{telemetry-RK2VX75A.js → telemetry-23OPBBZT.js} +7 -7
- package/dist/cli-bundle/chunks/telemetry-23OPBBZT.js.map +1 -0
- package/dist/cli-bundle/chunks/{telemetry-33MRGX4Z.js → telemetry-I3D7XZ55.js} +6 -6
- package/dist/cli-bundle/chunks/telemetry-I3D7XZ55.js.map +7 -0
- package/dist/cli-bundle/chunks/test-AROS3LIV.js +35 -0
- package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js → test-CECIMKOA.js} +17 -14
- package/dist/cli-bundle/chunks/{test-all-ARSMX33Q.js → test-all-4DEQPIXH.js} +25 -17
- package/dist/cli-bundle/chunks/test-all-4DEQPIXH.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-all-ANYQ33O2.js → test-all-6RO6X3SM.js} +24 -16
- package/dist/cli-bundle/chunks/test-all-6RO6X3SM.js.map +7 -0
- package/dist/cli-bundle/chunks/{test-runs-5URSD34O.js → test-runs-AAXVFWKH.js} +62 -65
- package/dist/cli-bundle/chunks/test-runs-AAXVFWKH.js.map +1 -0
- package/dist/cli-bundle/chunks/{test-runs-XNACGSNQ.js → test-runs-LYBQSYRC.js} +61 -64
- package/dist/cli-bundle/chunks/test-runs-LYBQSYRC.js.map +7 -0
- package/dist/cli-bundle/chunks/update-MIWEJC76.js +24 -0
- package/dist/cli-bundle/chunks/update-P7I5YSRB.js +28 -0
- package/dist/cli-bundle/chunks/{update-many-724JCVDE.js → update-many-5B4HLVBK.js} +79 -33
- package/dist/cli-bundle/chunks/update-many-5B4HLVBK.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-many-6B7PJ33I.js → update-many-G2QOVZSB.js} +80 -34
- package/dist/cli-bundle/chunks/update-many-G2QOVZSB.js.map +1 -0
- package/dist/cli-bundle/chunks/{upgrade-QHRGDBSA.js → upgrade-GFIDL62L.js} +23 -9
- package/dist/cli-bundle/chunks/upgrade-GFIDL62L.js.map +1 -0
- package/dist/cli-bundle/chunks/{upgrade-ALBEZAI7.js → upgrade-QUQYL7D3.js} +22 -8
- package/dist/cli-bundle/chunks/upgrade-QUQYL7D3.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-UY6DRCG5.js → validate-ADDZBMM3.js} +236 -30
- package/dist/cli-bundle/chunks/validate-ADDZBMM3.js.map +7 -0
- package/dist/cli-bundle/chunks/{validate-IQRYFXIV.js → validate-MAS3H6ZP.js} +222 -30
- package/dist/cli-bundle/chunks/validate-MAS3H6ZP.js.map +1 -0
- package/dist/cli-bundle/main.js +312 -139
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/cli.d.ts +10 -0
- package/dist/cli.js +21 -8
- package/dist/cli.js.map +1 -1
- package/dist/core/config/nested-settings.js +40 -2
- package/dist/core/config/nested-settings.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +7 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-policy.js +14 -15
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/item-fields.js +4 -5
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +75 -1
- package/dist/core/extensions/loader.js +56 -32
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/governance/content-fields.d.ts +84 -0
- package/dist/core/governance/content-fields.js +182 -0
- package/dist/core/governance/content-fields.js.map +1 -0
- package/dist/core/governance/issue-codes.d.ts +51 -0
- package/dist/core/governance/issue-codes.js +95 -0
- package/dist/core/governance/issue-codes.js.map +1 -0
- package/dist/core/governance/metadata-coverage.d.ts +168 -0
- package/dist/core/governance/metadata-coverage.js +362 -0
- package/dist/core/governance/metadata-coverage.js.map +1 -0
- package/dist/core/history/history-rewrite.d.ts +22 -0
- package/dist/core/history/history-rewrite.js +38 -2
- package/dist/core/history/history-rewrite.js.map +1 -1
- package/dist/core/history/history.d.ts +7 -0
- package/dist/core/history/history.js +6 -2
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/io/body-file.d.ts +14 -0
- package/dist/core/io/body-file.js +47 -0
- package/dist/core/io/body-file.js.map +1 -0
- package/dist/core/item/item-format.d.ts +46 -1
- package/dist/core/item/item-format.js +51 -60
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/parse.d.ts +41 -0
- package/dist/core/item/parse.js +69 -16
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/type-registry.d.ts +1 -0
- package/dist/core/item/type-registry.js +8 -10
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/lock.d.ts +26 -0
- package/dist/core/lock/lock.js +10 -2
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/output.d.ts +7 -0
- package/dist/core/output/output.js +6 -2
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/schema/fields-file.d.ts +94 -0
- package/dist/core/schema/fields-file.js +317 -0
- package/dist/core/schema/fields-file.js.map +1 -0
- package/dist/core/schema/item-types-file.d.ts +25 -2
- package/dist/core/schema/item-types-file.js +78 -6
- package/dist/core/schema/item-types-file.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +7 -0
- package/dist/core/schema/runtime-schema.js +23 -16
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/schema/type-inference.d.ts +34 -0
- package/dist/core/schema/type-inference.js +97 -0
- package/dist/core/schema/type-inference.js.map +1 -0
- package/dist/core/schema/type-presets.d.ts +30 -0
- package/dist/core/schema/type-presets.js +96 -0
- package/dist/core/schema/type-presets.js.map +1 -0
- package/dist/core/search/cache.d.ts +19 -1
- package/dist/core/search/cache.js +11 -3
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +36 -2
- package/dist/core/search/corpus.js +120 -24
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/providers.d.ts +19 -0
- package/dist/core/search/providers.js +19 -2
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/sentry/instrument.d.ts +1 -0
- package/dist/core/sentry/instrument.js +6 -2
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/session/session-state.d.ts +16 -0
- package/dist/core/session/session-state.js +48 -0
- package/dist/core/session/session-state.js.map +1 -0
- package/dist/core/shared/constants.d.ts +8 -0
- package/dist/core/shared/constants.js +11 -2
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/text-normalization.js +4 -3
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/shared/time.d.ts +13 -0
- package/dist/core/shared/time.js +19 -7
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.d.ts +13 -0
- package/dist/core/store/front-matter-cache.js +21 -11
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-store.d.ts +11 -0
- package/dist/core/store/item-store.js +12 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +2 -0
- package/dist/core/store/settings-validator.js +25 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.d.ts +60 -1
- package/dist/core/store/settings.js +100 -46
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/observability.js +10 -8
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +272 -1
- package/dist/core/telemetry/runtime.js +358 -37
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.d.ts +35 -0
- package/dist/core/test/background-runs.js +72 -61
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/test/run-selectors.js +5 -4
- package/dist/core/test/run-selectors.js.map +1 -1
- package/dist/core/validate/estimate-defaults.d.ts +39 -0
- package/dist/core/validate/estimate-defaults.js +117 -0
- package/dist/core/validate/estimate-defaults.js.map +1 -0
- package/dist/core/validate/fix-planning.d.ts +21 -3
- package/dist/core/validate/fix-planning.js +31 -4
- package/dist/core/validate/fix-planning.js.map +1 -1
- package/dist/core/validate/missing-link-owners.d.ts +64 -0
- package/dist/core/validate/missing-link-owners.js +98 -0
- package/dist/core/validate/missing-link-owners.js.map +1 -0
- package/dist/mcp/server.d.ts +61 -0
- package/dist/mcp/server.js +98 -8
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.js +64 -10
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +13 -2
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +2 -2
- package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
- package/dist/sdk/cli-contracts/enum-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +110 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +127 -11
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +31 -0
- package/dist/sdk/cli-contracts.js +238 -12
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/types.d.ts +17 -1
- package/dist/types.js +3 -3
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +15 -3
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +171 -10
- package/docs/CONFIGURATION.md +135 -0
- package/docs/TESTING.md +6 -4
- package/package.json +6 -4
- package/packages/pm-calendar/extensions/calendar/runtime.js +6 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +12 -0
- package/packages/pm-todos/extensions/todos/runtime.ts +5 -0
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +3 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +1 -1
- package/scripts/bundle-cli.mjs +46 -37
- package/scripts/finalize-build.mjs +20 -9
- package/scripts/prepare-build-cache.mjs +27 -16
- package/dist/cli-bundle/chunks/activity-XIOTGZMU.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-IRHJWEKG.js.map +0 -1
- package/dist/cli-bundle/chunks/aggregate-XEBW22UQ.js.map +0 -7
- package/dist/cli-bundle/chunks/append-NL67JNJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2ANTZBYF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2J2AH4V5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-32XSW44C.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-36BCSMKP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3VULHQNS.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4FHLNNW7.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4JHJ7YG2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4TPFXE2R.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4ZKKZMLH.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-5HSAHRYA.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6TBR5AZ2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7CRFV6JR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-7SM7VA5I.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AAUYXSFF.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-AGG32LKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-AUDDXKNX.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BVL5KGVA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-C24PWDFG.js +0 -138
- package/dist/cli-bundle/chunks/chunk-C24PWDFG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HLEGAQXT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HZOX5BYD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IXVSSHGV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-IZHCCG4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JW7D6437.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JWXTOYBI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KHGTYCJ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L6YQONLM.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LFW5NQUP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-LYNQ3NGI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-M3SI2REU.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MACCNKSZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MGAQ6KZG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PEH7SZD2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-PNYAAB4S.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QQG4HEX7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-R4VWYWRN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RFR2YQGO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RHYBR6G7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-S2CDTRJ6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SGMGMCIF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SOHXUA2Q.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-SQDKAEKG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TOX7YQ7X.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-TSXWFN3L.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UCVJP4JL.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js +0 -128
- package/dist/cli-bundle/chunks/chunk-V4KP3TCN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-VNC2HBL4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-W6KNFAMZ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WLH7X4RN.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XXLMJDUB.js.map +0 -7
- package/dist/cli-bundle/chunks/close-WOG5WTMZ.js +0 -13
- package/dist/cli-bundle/chunks/close-many-GKAJX54X.js.map +0 -1
- package/dist/cli-bundle/chunks/close-many-GL6NRUU5.js.map +0 -7
- package/dist/cli-bundle/chunks/comments-5FPT6L7N.js.map +0 -1
- package/dist/cli-bundle/chunks/comments-TOLOYWNI.js.map +0 -7
- package/dist/cli-bundle/chunks/config-4MN45TIH.js.map +0 -1
- package/dist/cli-bundle/chunks/config-7N6D7YJE.js.map +0 -7
- package/dist/cli-bundle/chunks/context-AQSLE7DZ.js.map +0 -1
- package/dist/cli-bundle/chunks/context-U3PUJMVN.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-H7KCQXLY.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-ITSJXO3O.js.map +0 -1
- package/dist/cli-bundle/chunks/create-NW3K7LVG.js +0 -27
- package/dist/cli-bundle/chunks/deps-HV2C2L46.js.map +0 -1
- package/dist/cli-bundle/chunks/files-LIFDKNCN.js.map +0 -7
- package/dist/cli-bundle/chunks/files-OIFN3DQX.js.map +0 -1
- package/dist/cli-bundle/chunks/get-K7UULTQF.js.map +0 -7
- package/dist/cli-bundle/chunks/get-SAB7CRBG.js.map +0 -1
- package/dist/cli-bundle/chunks/health-NUVZYIEV.js.map +0 -1
- package/dist/cli-bundle/chunks/health-VJWH3ZFK.js.map +0 -7
- package/dist/cli-bundle/chunks/history-IUVN4NTN.js +0 -20
- package/dist/cli-bundle/chunks/history-compact-SLL6ESXH.js.map +0 -1
- package/dist/cli-bundle/chunks/history-compact-WQZQ6KXM.js.map +0 -7
- package/dist/cli-bundle/chunks/history-redact-75KIIJUJ.js +0 -19
- package/dist/cli-bundle/chunks/history-repair-BJCGM6Q3.js.map +0 -1
- package/dist/cli-bundle/chunks/history-repair-UCYS55ZX.js.map +0 -7
- package/dist/cli-bundle/chunks/init-JJFYRUKG.js +0 -17
- package/dist/cli-bundle/chunks/learnings-L6KTZGOT.js.map +0 -1
- package/dist/cli-bundle/chunks/learnings-QKJOKEAO.js.map +0 -7
- package/dist/cli-bundle/chunks/list-GGVPXEV6.js +0 -23
- package/dist/cli-bundle/chunks/list-VOQDQHA4.js +0 -19
- package/dist/cli-bundle/chunks/notes-3NLK7WTZ.js.map +0 -1
- package/dist/cli-bundle/chunks/notes-HMCB7TK6.js.map +0 -7
- package/dist/cli-bundle/chunks/plan-DWBYI5C6.js.map +0 -1
- package/dist/cli-bundle/chunks/plan-NANUWH4T.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-PWQ5F2VI.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-SMMMLSWW.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-QKFPTIZG.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-ZYJQ4DVP.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-2FMZ6WEF.js.map +0 -7
- package/dist/cli-bundle/chunks/register-operations-BAFQURZG.js.map +0 -1
- package/dist/cli-bundle/chunks/register-setup-DQEIKBIP.js.map +0 -7
- package/dist/cli-bundle/chunks/register-setup-QN2XV7UL.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-DRBNXJJH.js +0 -17
- package/dist/cli-bundle/chunks/schema-RNVJ55V2.js.map +0 -7
- package/dist/cli-bundle/chunks/schema-ZZ7ZDM2X.js.map +0 -1
- package/dist/cli-bundle/chunks/search-BJ457C2A.js.map +0 -7
- package/dist/cli-bundle/chunks/search-FQDZXX7P.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-CUG3ZHOI.js.map +0 -1
- package/dist/cli-bundle/chunks/stats-DUQWCVOS.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-33MRGX4Z.js.map +0 -7
- package/dist/cli-bundle/chunks/telemetry-RK2VX75A.js.map +0 -1
- package/dist/cli-bundle/chunks/test-SDMYEQHH.js +0 -32
- package/dist/cli-bundle/chunks/test-all-ANYQ33O2.js.map +0 -7
- package/dist/cli-bundle/chunks/test-all-ARSMX33Q.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-5URSD34O.js.map +0 -1
- package/dist/cli-bundle/chunks/test-runs-XNACGSNQ.js.map +0 -7
- package/dist/cli-bundle/chunks/update-PD46VOXI.js +0 -21
- package/dist/cli-bundle/chunks/update-U235A7WP.js +0 -25
- package/dist/cli-bundle/chunks/update-many-6B7PJ33I.js.map +0 -1
- package/dist/cli-bundle/chunks/update-many-724JCVDE.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-ALBEZAI7.js.map +0 -7
- package/dist/cli-bundle/chunks/upgrade-QHRGDBSA.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-IQRYFXIV.js.map +0 -1
- package/dist/cli-bundle/chunks/validate-UY6DRCG5.js.map +0 -7
- /package/dist/cli-bundle/chunks/{activity-XIOTGZMU.js.map → activity-PZYSZA26.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-PPO7QWJF.js.map → activity-SFM4THAU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IIOIBAQW.js.map → chunk-26BM6YLO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSSTKL3Y.js.map → chunk-2TMKMTEI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QU3OPNVV.js.map → chunk-2VH7DFSJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LGOXXQUW.js.map → chunk-5XGWFUW2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Z647PYLD.js.map → chunk-AJCQ5GT6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DWG4FHPY.js.map → chunk-BITCVGHT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JE5IZXDS.js.map → chunk-CGQTFWYI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VYZNX4C5.js.map → chunk-COVLE33A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6ZFTM65G.js.map → chunk-F5MSD5HE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GOO4UXBI.js.map → chunk-JZHL4E3Q.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NN6RKGFW.js.map → chunk-KCAGIH6K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CQPVBK3.js.map → chunk-MIBX6ZRN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XOYHMHFF.js.map → chunk-UN6P3IJ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HWHONML5.js.map → chunk-VF3KQGNY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-HE6KEGJW.js.map → claim-WGAWJCPY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-QJOQBH7J.js.map → claim-ZI6P4LMU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-WOG5WTMZ.js.map → close-I7PRQ5G7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-SPUFW5QR.js.map → close-JMVVSIQE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-EB3MUCSW.js.map → copy-Q2PPU4AY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-C4W522JM.js.map → copy-SC6UF3PI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-4EQNELMY.js.map → create-76FE7JVF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-NW3K7LVG.js.map → create-RTRFW6RE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-X5QLXIQX.js.map → delete-T6DJSUJI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ZLGUYIXU.js.map → delete-XFUX533E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-SRTLCQOL.js.map → docs-HE3HCQ4S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-RJQPLROO.js.map → docs-SXMOABHR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-WKPVPNCC.js.map → extension-E23K4QRR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-MM3TVWOO.js.map → extension-PMD3XMLN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-NRFHLVFT.js.map → gc-BXIAKLAH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-DL6AVOX5.js.map → gc-C7K6JNUO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-GYFD2DJW.js.map → history-73Z6OBFZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-IUVN4NTN.js.map → history-BIPHVUMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-SDTDR6WM.js.map → history-redact-7YCXEWJD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-75KIIJUJ.js.map → history-redact-WZZ6GZ2Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-JJFYRUKG.js.map → init-K34V4PZR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-MXV57LKL.js.map → init-TDEDNVMM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-GGVPXEV6.js.map → list-MSHYOCFU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-VOQDQHA4.js.map → list-VV57WGUD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-FJQWXMPY.js.map → restore-TSWSULYY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-DRBNXJJH.js.map → restore-XQXICL3V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-SDMYEQHH.js.map → test-AROS3LIV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-Y3CTFMEC.js.map → test-CECIMKOA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-PD46VOXI.js.map → update-MIWEJC76.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-U235A7WP.js.map → update-P7I5YSRB.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields-file.js","sources":["core/schema/fields-file.ts"],"sourceRoot":"/","sourcesContent":["import {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n} from \"../../types/index.js\";\nimport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand, RuntimeFieldDefinition, RuntimeFieldType } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-field` / `pm schema remove-field` commands\n * and the `list-fields` / `show-field` inspectors. The CLI command file\n * (schema.ts) owns IO/governance; everything testable and side-effect-free lives\n * here so it can be coverage-gated to 100%.\n *\n * Custom fields persist at `.agents/pm/schema/fields.json` under the shape\n * `{ fields: RuntimeFieldDefinition[] }`. The runtime merge layer\n * (loadRuntimeSchemaFromOptionalFiles) reads that file and dynamically registers\n * a CLI flag per field on create/update/list/search/context, so this module only\n * has to manage the persisted entries; it never duplicates the registration.\n */\n\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\n\n/**\n * Built-in front-matter field names a custom field key must never shadow. A\n * custom key that collides with one of these would let `pm create --<key>` write\n * over reserved metadata, so add-field rejects them up front (symmetric with the\n * built-in-type guard in item-types-file.ts).\n */\nexport const BUILTIN_FIELD_KEYS: ReadonlySet<string> = new Set([\n \"id\",\n \"title\",\n \"type\",\n \"status\",\n \"priority\",\n \"tags\",\n \"assignee\",\n \"parent\",\n \"description\",\n \"body\",\n \"created_at\",\n \"updated_at\",\n \"closed_at\",\n \"author\",\n \"deadline\",\n \"estimate\",\n \"sprint\",\n \"release\",\n \"risk\",\n \"confidence\",\n \"reviewer\",\n \"resolution\",\n \"expected\",\n \"actual\",\n]);\n\n/**\n * The default commands a field is wired onto when `--commands` is omitted,\n * matching the runtime default in runtime-schema.ts (normalizeRuntimeFieldDefinition).\n */\nconst DEFAULT_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\n/**\n * The shape persisted at `.agents/pm/schema/fields.json`.\n */\nexport interface FieldsFile {\n fields: RuntimeFieldDefinition[];\n}\n\nexport interface RawAddFieldInput {\n key: string | undefined;\n type?: string;\n commands?: string[];\n description?: string;\n cliFlag?: string;\n aliases?: string[];\n required?: boolean;\n requiredOnCreate?: boolean;\n allowUnset?: boolean;\n requiredTypes?: string[];\n}\n\nexport interface NormalizedAddFieldInput {\n key: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n description?: string;\n cliFlag?: string;\n cliAliases: string[];\n required: boolean;\n requiredOnCreate: boolean;\n allowUnset: boolean;\n requiredTypes: string[];\n}\n\nexport interface UpsertFieldResult {\n file: FieldsFile;\n /** The definition as stored after the upsert. */\n definition: RuntimeFieldDefinition;\n /** True when an existing definition with the same (normalized) key was replaced. */\n replaced: boolean;\n}\n\nexport interface RemoveFieldResult {\n file: FieldsFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched the requested key. */\n definition?: RuntimeFieldDefinition;\n}\n\n/**\n * Normalizes a field key using the same rule as runtime-schema.ts: lowercase and\n * collapse any run of whitespace/hyphens into a single underscore.\n */\nexport function normalizeFieldKey(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\n/**\n * Normalizes a CLI flag token: strip a leading `--`, lowercase, and collapse\n * whitespace/underscore runs to a single hyphen (matches normalizeCliToken in\n * runtime-schema.ts).\n */\nfunction normalizeCliToken(value: unknown): string {\n if (typeof value !== \"string\") {\n return \"\";\n }\n const collapsed = value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\");\n return collapsed.startsWith(\"--\") ? collapsed.slice(2) : collapsed;\n}\n\nfunction keyToDefaultCliFlag(key: string): string {\n return key.replaceAll(\"_\", \"-\");\n}\n\nfunction dedupeCliTokens(values: Iterable<string>, exclude: string): string[] {\n const seen = new Set<string>();\n for (const value of values) {\n const token = normalizeCliToken(value);\n if (token.length > 0 && token !== exclude) {\n seen.add(token);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\nfunction dedupeStringList(values: string[] | undefined): string[] {\n const seen = new Set<string>();\n for (const value of values ?? []) {\n const trimmed = value.trim();\n if (trimmed.length > 0) {\n seen.add(trimmed);\n }\n }\n return [...seen].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-field CLI input. Throws a plain Error with a\n * stable message when the key is missing/empty, collides with a built-in field,\n * or carries an invalid type/command; the CLI layer maps these to PmCliError\n * exit codes. A `string_array` type implies a repeatable field downstream\n * (runtime-schema.ts derives `repeatable`), so no separate repeatable flag is\n * exposed.\n */\nexport function normalizeAddFieldInput(raw: RawAddFieldInput): NormalizedAddFieldInput {\n const key = normalizeFieldKey(raw.key);\n if (key.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n if (BUILTIN_FIELD_KEYS.has(key)) {\n throw new Error(\n `Cannot define custom field \"${key}\": it shadows a built-in field. Built-in fields are reserved.`,\n );\n }\n\n const typeCandidate = typeof raw.type === \"string\" && raw.type.trim().length > 0 ? raw.type.trim().toLowerCase() : \"string\";\n if (!RUNTIME_FIELD_TYPE_SET.has(typeCandidate)) {\n throw new Error(`Invalid field type \"${raw.type}\". Allowed: ${RUNTIME_FIELD_TYPE_VALUES.join(\", \")}.`);\n }\n const type = typeCandidate as RuntimeFieldType;\n\n let commands: RuntimeFieldCommand[];\n if (raw.commands === undefined) {\n commands = [...DEFAULT_FIELD_COMMANDS];\n } else {\n const seen = new Set<string>();\n const normalized: RuntimeFieldCommand[] = [];\n for (const rawCommand of raw.commands) {\n const command = rawCommand.trim().toLowerCase();\n if (command.length === 0) {\n continue;\n }\n if (!RUNTIME_FIELD_COMMAND_SET.has(command)) {\n throw new Error(`Invalid field command \"${rawCommand}\". Allowed: ${RUNTIME_FIELD_COMMAND_VALUES.join(\", \")}.`);\n }\n if (!seen.has(command)) {\n seen.add(command);\n normalized.push(command as RuntimeFieldCommand);\n }\n }\n commands = normalized.length > 0 ? normalized : [...DEFAULT_FIELD_COMMANDS];\n }\n\n const cliFlagToken = normalizeCliToken(raw.cliFlag);\n const cliFlag = cliFlagToken.length > 0 && cliFlagToken !== keyToDefaultCliFlag(key) ? cliFlagToken : undefined;\n const effectiveFlag = cliFlag ?? keyToDefaultCliFlag(key);\n const cliAliases = dedupeCliTokens(raw.aliases ?? [], effectiveFlag);\n\n const description = raw.description?.trim();\n return {\n key,\n type,\n commands,\n description: description && description.length > 0 ? description : undefined,\n cliFlag,\n cliAliases,\n required: raw.required === true,\n requiredOnCreate: raw.requiredOnCreate === true,\n // allow_unset defaults to true (omitted) and is only persisted when an\n // operator explicitly disables it with --no-allow-unset (allowUnset === false).\n allowUnset: raw.allowUnset !== false,\n requiredTypes: dedupeStringList(raw.requiredTypes),\n };\n}\n\nfunction selectFieldsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.fields)) {\n return record.fields;\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n return undefined;\n}\n\nfunction extractFieldDefinitions(parsed: unknown): RuntimeFieldDefinition[] {\n const candidate = selectFieldsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: RuntimeFieldDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.key !== \"string\" || record.key.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as RuntimeFieldDefinition);\n }\n return definitions;\n}\n\n/**\n * Coerces an arbitrary parsed value from fields.json into a FieldsFile. Accepts\n * the canonical `{ fields: [...] }` shape, a bare array, or a `{ definitions: [...] }`\n * form, and tolerates a missing/invalid file by returning an empty fields list.\n */\nexport function parseFieldsFile(raw: string | null | undefined): FieldsFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { fields: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/fields.json contains invalid JSON.\");\n }\n return { fields: extractFieldDefinitions(parsed) };\n}\n\n/**\n * Serializes the fields file with a trailing newline (matches the rest of the\n * schema scaffold files written by pm).\n */\nexport function serializeFieldsFile(file: FieldsFile): string {\n return `${JSON.stringify({ fields: file.fields }, null, 2)}\\n`;\n}\n\n/**\n * Idempotent UPSERT of a custom field into the parsed file. Matching is by\n * normalized key. When a definition already exists, the supplied input fully\n * replaces its add-field-managed attributes (type/commands/description/flags/\n * required flags) while preserving any unrelated keys the file may carry; any\n * `metadata_key` already stored is preserved so existing item data keeps mapping\n * to the same front-matter column.\n */\nexport function upsertField(file: FieldsFile, input: NormalizedAddFieldInput): UpsertFieldResult {\n // Match by normalized key. A hand-authored file may carry more than one entry\n // for the same key, so drop ALL matches and re-insert a single merged result\n // (collapsing duplicates) rather than only rewriting the first occurrence. The\n // first existing match seeds preserved attributes (e.g. metadata_key).\n const existing = file.fields.find((definition) => normalizeFieldKey(definition.key) === input.key);\n const replaced = existing !== undefined;\n const fields = file.fields.filter((definition) => normalizeFieldKey(definition.key) !== input.key);\n\n const next: RuntimeFieldDefinition = {\n ...(existing ?? {}),\n key: input.key,\n type: input.type,\n commands: [...input.commands],\n };\n applyOptionalString(next, \"description\", input.description);\n applyOptionalString(next, \"cli_flag\", input.cliFlag);\n if (input.cliAliases.length > 0) {\n next.cli_aliases = [...input.cliAliases];\n } else {\n delete next.cli_aliases;\n }\n applyBooleanFlag(next, \"required\", input.required);\n applyBooleanFlag(next, \"required_on_create\", input.requiredOnCreate);\n // allow_unset defaults true; only persist the explicit false override.\n if (input.allowUnset === false) {\n next.allow_unset = false;\n } else {\n delete next.allow_unset;\n }\n if (input.requiredTypes.length > 0) {\n next.required_types = [...input.requiredTypes];\n } else {\n delete next.required_types;\n }\n\n fields.push(next);\n fields.sort((left, right) => normalizeFieldKey(left.key).localeCompare(normalizeFieldKey(right.key)));\n\n return {\n file: { fields },\n definition: next,\n replaced,\n };\n}\n\n/**\n * Removes a custom field definition from the parsed file by key (normalized).\n * Throws a plain Error when `key` is empty. Returns `removed: false` when no\n * matching definition exists so the CLI layer can treat the call as an\n * idempotent no-op.\n */\nexport function removeField(file: FieldsFile, key: string | undefined): RemoveFieldResult {\n const normalizedKey = normalizeFieldKey(key);\n if (normalizedKey.length === 0) {\n throw new Error(\"Field key must not be empty.\");\n }\n // Remove ALL matches (a hand-authored file may carry duplicate entries for the\n // same normalized key) so no stale duplicate survives the removal.\n const removed: RuntimeFieldDefinition[] = [];\n const fields = file.fields.filter((definition) => {\n if (normalizeFieldKey(definition.key) === normalizedKey) {\n removed.push(definition);\n return false;\n }\n return true;\n });\n if (removed.length === 0) {\n return { file: { fields }, removed: false };\n }\n return { file: { fields }, removed: true, definition: removed[0] };\n}\n\nfunction applyOptionalString(definition: RuntimeFieldDefinition, key: string, value: string | undefined): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined && value.length > 0) {\n record[key] = value;\n } else {\n delete record[key];\n }\n}\n\nfunction applyBooleanFlag(definition: RuntimeFieldDefinition, key: string, value: boolean): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value) {\n record[key] = true;\n } else {\n delete record[key];\n }\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAK9B;;;;;;;;;;;GAWG;AAEH,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAS,yBAAyB,CAAC,CAAC;AAC1E,MAAM,yBAAyB,GAAG,IAAI,GAAG,CAAS,4BAA4B,CAAC,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,IAAI;IACJ,OAAO;IACP,MAAM;IACN,QAAQ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EAAE,GAAW,EAAE,KAAc;IACvF,MAAM,MAAM,GAAG,UAAgD,CAAC;IAChE,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;AACH,CAAC","debugId":"01bca6b9-49d3-5785-9d18-8399a0aac293"}
|
|
@@ -26,6 +26,11 @@ export interface UpsertItemTypeResult {
|
|
|
26
26
|
definition: ItemTypeDefinition;
|
|
27
27
|
/** True when an existing definition with the same (case-insensitive) name was replaced. */
|
|
28
28
|
replaced: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The canonical name of the replaced definition (only present when `replaced`).
|
|
31
|
+
* Lets the caller detect a silent recase (e.g. "Spike" -> "spike") and warn.
|
|
32
|
+
*/
|
|
33
|
+
previousName?: string;
|
|
29
34
|
}
|
|
30
35
|
export interface RemoveItemTypeResult {
|
|
31
36
|
file: ItemTypesFile;
|
|
@@ -60,6 +65,21 @@ export declare function normalizeAddTypeInput(raw: RawAddTypeInput): NormalizedA
|
|
|
60
65
|
* upserted are ignored, keeping re-runs idempotent.
|
|
61
66
|
*/
|
|
62
67
|
export declare function assertAliasesAvailable(input: NormalizedAddTypeInput, existing: ItemTypesFile): void;
|
|
68
|
+
/**
|
|
69
|
+
* Throws when the requested type's storage folder would collide with a
|
|
70
|
+
* DIFFERENT existing definition's folder. Two distinct type names can slug to
|
|
71
|
+
* one folder ("Spike"/"Spikes", "code-review"/"code_review"), which would make
|
|
72
|
+
* their item files share a directory and silently corrupt the taxonomy. The
|
|
73
|
+
* same-named definition being upserted is ignored (folder reuse on re-run is
|
|
74
|
+
* expected). Resolving the collision is a matter of passing a distinct
|
|
75
|
+
* `--folder`, so the error says so.
|
|
76
|
+
*
|
|
77
|
+
* `reservedFolders` carries the folders already owned by built-in and extension
|
|
78
|
+
* types (folder-slug → owner name); a custom type whose slug matches one of
|
|
79
|
+
* those (e.g. "Tasks" → "tasks", owned by the built-in Task) is just as
|
|
80
|
+
* corrupting as a custom-vs-custom collision, so both are checked.
|
|
81
|
+
*/
|
|
82
|
+
export declare function assertTypeFolderAvailable(input: NormalizedAddTypeInput, existing: ItemTypesFile, reservedFolders?: ReadonlyMap<string, string>): void;
|
|
63
83
|
/**
|
|
64
84
|
* Coerces an arbitrary parsed value from types.json into an ItemTypesFile.
|
|
65
85
|
* Accepts the canonical `{ definitions: [...] }` shape, a bare array of
|
|
@@ -92,9 +112,12 @@ export declare function serializeItemTypesFile(file: ItemTypesFile): string;
|
|
|
92
112
|
* custom types exist and how to register one. Quotes are chosen so the printed
|
|
93
113
|
* line is copy-pasteable as a shell command.
|
|
94
114
|
*/
|
|
95
|
-
export declare function buildInvalidTypeHint(name: string): string;
|
|
115
|
+
export declare function buildInvalidTypeHint(name: string, typesFilePath?: string): string;
|
|
96
116
|
/**
|
|
97
117
|
* Builds the full invalid-type error message used by create/update: the
|
|
98
118
|
* existing "Invalid type ... Allowed: ..." line plus the discoverable hint.
|
|
119
|
+
* `typesFilePath` should be the resolved schema/types.json path for the active
|
|
120
|
+
* tracker (see {@link resolveItemTypesFilePath}) so the hint reflects a custom
|
|
121
|
+
* `--pm-path` instead of the hardcoded `.agents/pm` default.
|
|
99
122
|
*/
|
|
100
|
-
export declare function buildInvalidTypeError(name: string, allowedTypes: readonly string[]): string;
|
|
123
|
+
export declare function buildInvalidTypeError(name: string, allowedTypes: readonly string[], typesFilePath?: string): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="995e9919-c166-505a-8821-d8a859a60ae8")}catch(e){}}();
|
|
3
3
|
import { BUILTIN_ITEM_TYPE_VALUES } from "../../types/index.js";
|
|
4
|
+
import { toDefaultFolder } from "../item/type-registry.js";
|
|
4
5
|
/**
|
|
5
6
|
* Pure logic for the `pm schema add-type` command and the create/update
|
|
6
7
|
* invalid-type discoverability hint. The CLI command file (schema.ts) handles
|
|
@@ -8,6 +9,21 @@ import { BUILTIN_ITEM_TYPE_VALUES } from "../../types/index.js";
|
|
|
8
9
|
* be coverage-gated to 100%.
|
|
9
10
|
*/
|
|
10
11
|
const BUILTIN_NAME_LOOKUP = new Map(BUILTIN_ITEM_TYPE_VALUES.map((name) => [name.toLowerCase(), name]));
|
|
12
|
+
/**
|
|
13
|
+
* Custom item type names (and aliases) must be a single letter-led identifier
|
|
14
|
+
* token: letters, digits, hyphen, or underscore — no whitespace or other
|
|
15
|
+
* punctuation. This keeps names copy-pasteable as shell arguments and folder
|
|
16
|
+
* slugs deterministic, matching the single-token PascalCase shape of every
|
|
17
|
+
* built-in type. Folder/slug overlap between two distinct valid tokens (e.g.
|
|
18
|
+
* "Spike"/"Spikes", "code-review"/"code_review") is rejected separately by
|
|
19
|
+
* assertTypeFolderAvailable.
|
|
20
|
+
*/
|
|
21
|
+
const TYPE_NAME_TOKEN_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
22
|
+
function assertValidTypeToken(value, label) {
|
|
23
|
+
if (!TYPE_NAME_TOKEN_PATTERN.test(value)) {
|
|
24
|
+
throw new Error(`${label} "${value}" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. "Spike" or "code-review").`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
11
27
|
/**
|
|
12
28
|
* Returns the canonical built-in name when `name` collides (case-insensitively)
|
|
13
29
|
* with a reserved built-in item type, otherwise undefined.
|
|
@@ -55,6 +71,7 @@ export function normalizeAddTypeInput(raw) {
|
|
|
55
71
|
if (name.length === 0) {
|
|
56
72
|
throw new Error("Type name must not be empty.");
|
|
57
73
|
}
|
|
74
|
+
assertValidTypeToken(name, "Type name");
|
|
58
75
|
const builtinMatch = matchBuiltinTypeName(name);
|
|
59
76
|
if (builtinMatch) {
|
|
60
77
|
throw new Error(`Cannot redefine built-in item type "${builtinMatch}". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(", ")}.`);
|
|
@@ -64,6 +81,7 @@ export function normalizeAddTypeInput(raw) {
|
|
|
64
81
|
const folder = raw.folder?.trim();
|
|
65
82
|
const aliases = dedupeAliases(raw.aliases ?? []);
|
|
66
83
|
for (const alias of aliases) {
|
|
84
|
+
assertValidTypeToken(alias, "Alias");
|
|
67
85
|
const aliasBuiltin = matchBuiltinTypeName(alias);
|
|
68
86
|
if (aliasBuiltin) {
|
|
69
87
|
throw new Error(`Alias "${alias}" collides with built-in item type "${aliasBuiltin}". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(", ")}.`);
|
|
@@ -114,6 +132,55 @@ export function assertAliasesAvailable(input, existing) {
|
|
|
114
132
|
}
|
|
115
133
|
}
|
|
116
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Resolves the storage folder a definition would use: an explicit non-empty
|
|
137
|
+
* `folder` wins, otherwise the deterministic slug derived from the name (the
|
|
138
|
+
* same derivation the runtime registry applies, single-sourced from
|
|
139
|
+
* type-registry.toDefaultFolder).
|
|
140
|
+
*/
|
|
141
|
+
function resolveDefinitionFolder(name, folder) {
|
|
142
|
+
if (typeof folder === "string" && folder.trim().length > 0) {
|
|
143
|
+
return folder.trim().toLowerCase();
|
|
144
|
+
}
|
|
145
|
+
return toDefaultFolder(name).toLowerCase();
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Throws when the requested type's storage folder would collide with a
|
|
149
|
+
* DIFFERENT existing definition's folder. Two distinct type names can slug to
|
|
150
|
+
* one folder ("Spike"/"Spikes", "code-review"/"code_review"), which would make
|
|
151
|
+
* their item files share a directory and silently corrupt the taxonomy. The
|
|
152
|
+
* same-named definition being upserted is ignored (folder reuse on re-run is
|
|
153
|
+
* expected). Resolving the collision is a matter of passing a distinct
|
|
154
|
+
* `--folder`, so the error says so.
|
|
155
|
+
*
|
|
156
|
+
* `reservedFolders` carries the folders already owned by built-in and extension
|
|
157
|
+
* types (folder-slug → owner name); a custom type whose slug matches one of
|
|
158
|
+
* those (e.g. "Tasks" → "tasks", owned by the built-in Task) is just as
|
|
159
|
+
* corrupting as a custom-vs-custom collision, so both are checked.
|
|
160
|
+
*/
|
|
161
|
+
export function assertTypeFolderAvailable(input, existing, reservedFolders) {
|
|
162
|
+
const selfLower = input.name.toLowerCase();
|
|
163
|
+
const inputFolder = resolveDefinitionFolder(input.name, input.folder);
|
|
164
|
+
const fail = (ownerName) => {
|
|
165
|
+
throw new Error(`Item type "${input.name}" would store items in folder "${inputFolder}", which already belongs to existing item type "${ownerName}". Pass a distinct --folder to keep their storage separate.`);
|
|
166
|
+
};
|
|
167
|
+
for (const definition of existing.definitions) {
|
|
168
|
+
if (typeof definition.name !== "string") {
|
|
169
|
+
continue;
|
|
170
|
+
}
|
|
171
|
+
const definitionName = definition.name.trim();
|
|
172
|
+
if (definitionName.length === 0 || definitionName.toLowerCase() === selfLower) {
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
if (resolveDefinitionFolder(definitionName, definition.folder) === inputFolder) {
|
|
176
|
+
fail(definitionName);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const reservedOwner = reservedFolders?.get(inputFolder);
|
|
180
|
+
if (reservedOwner !== undefined && reservedOwner.toLowerCase() !== selfLower) {
|
|
181
|
+
fail(reservedOwner);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
117
184
|
/**
|
|
118
185
|
* Coerces an arbitrary parsed value from types.json into an ItemTypesFile.
|
|
119
186
|
* Accepts the canonical `{ definitions: [...] }` shape, a bare array of
|
|
@@ -208,6 +275,7 @@ export function upsertItemType(file, input) {
|
|
|
208
275
|
file: { definitions },
|
|
209
276
|
definition: next,
|
|
210
277
|
replaced: existingIndex >= 0,
|
|
278
|
+
...(existing && typeof existing.name === "string" ? { previousName: existing.name } : {}),
|
|
211
279
|
};
|
|
212
280
|
}
|
|
213
281
|
/**
|
|
@@ -253,16 +321,20 @@ export function serializeItemTypesFile(file) {
|
|
|
253
321
|
* custom types exist and how to register one. Quotes are chosen so the printed
|
|
254
322
|
* line is copy-pasteable as a shell command.
|
|
255
323
|
*/
|
|
256
|
-
export function buildInvalidTypeHint(name) {
|
|
324
|
+
export function buildInvalidTypeHint(name, typesFilePath) {
|
|
257
325
|
const safeName = name.trim().length > 0 ? name.trim() : name;
|
|
258
|
-
|
|
326
|
+
const target = typesFilePath?.trim() || ".agents/pm/schema/types.json";
|
|
327
|
+
return `To register a custom type, run: pm schema add-type "${escapeForDoubleQuotes(safeName)}" (writes ${target}).`;
|
|
259
328
|
}
|
|
260
329
|
/**
|
|
261
330
|
* Builds the full invalid-type error message used by create/update: the
|
|
262
331
|
* existing "Invalid type ... Allowed: ..." line plus the discoverable hint.
|
|
332
|
+
* `typesFilePath` should be the resolved schema/types.json path for the active
|
|
333
|
+
* tracker (see {@link resolveItemTypesFilePath}) so the hint reflects a custom
|
|
334
|
+
* `--pm-path` instead of the hardcoded `.agents/pm` default.
|
|
263
335
|
*/
|
|
264
|
-
export function buildInvalidTypeError(name, allowedTypes) {
|
|
265
|
-
return `Invalid type value "${name}". Allowed: ${allowedTypes.join(", ")}. ${buildInvalidTypeHint(name)}`;
|
|
336
|
+
export function buildInvalidTypeError(name, allowedTypes, typesFilePath) {
|
|
337
|
+
return `Invalid type value "${name}". Allowed: ${allowedTypes.join(", ")}. ${buildInvalidTypeHint(name, typesFilePath)}`;
|
|
266
338
|
}
|
|
267
339
|
//# sourceMappingURL=item-types-file.js.map
|
|
268
|
-
//# debugId=
|
|
340
|
+
//# debugId=995e9919-c166-505a-8821-d8a859a60ae8
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-types-file.js","sources":["core/schema/item-types-file.ts"],"sourceRoot":"/","sourcesContent":["import { BUILTIN_ITEM_TYPE_VALUES } from \"../../types/index.js\";\nimport type { ItemTypeDefinition } from \"../../types/index.js\";\n\nexport type { ItemTypeDefinition } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-type` command and the create/update\n * invalid-type discoverability hint. The CLI command file (schema.ts) handles\n * IO/governance; everything testable and side-effect-free lives here so it can\n * be coverage-gated to 100%.\n */\n\nconst BUILTIN_NAME_LOOKUP = new Map<string, string>(\n BUILTIN_ITEM_TYPE_VALUES.map((name) => [name.toLowerCase(), name]),\n);\n\n/**\n * The shape persisted at `.agents/pm/schema/types.json`.\n */\nexport interface ItemTypesFile {\n definitions: ItemTypeDefinition[];\n}\n\nexport interface NormalizedAddTypeInput {\n name: string;\n description?: string;\n defaultStatus?: string;\n folder?: string;\n aliases: string[];\n}\n\nexport interface RawAddTypeInput {\n name: string | undefined;\n description?: string;\n defaultStatus?: string;\n folder?: string;\n aliases?: string[];\n}\n\nexport interface UpsertItemTypeResult {\n file: ItemTypesFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: ItemTypeDefinition;\n /** True when an existing definition with the same (case-insensitive) name was replaced. */\n replaced: boolean;\n}\n\nexport interface RemoveItemTypeResult {\n file: ItemTypesFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched (case-insensitively) the requested name. */\n definition?: ItemTypeDefinition;\n}\n\n/**\n * Returns the canonical built-in name when `name` collides (case-insensitively)\n * with a reserved built-in item type, otherwise undefined.\n */\nexport function matchBuiltinTypeName(name: string): string | undefined {\n return BUILTIN_NAME_LOOKUP.get(name.trim().toLowerCase());\n}\n\n/**\n * Coerces a persisted `aliases` value into a string array, tolerating malformed\n * data (a non-array, or an array containing non-string entries) without throwing\n * or exploding a stray string into character aliases.\n */\nfunction coerceAliasArray(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === \"string\") : [];\n}\n\n/**\n * Escapes a value for safe interpolation inside a double-quoted shell string so\n * suggested copy-pasteable commands stay well-formed for names containing\n * `\"`, `` ` ``, `$`, or `\\`.\n */\nexport function escapeForDoubleQuotes(value: string): string {\n return value.replace(/[\\\\\"`$]/g, (char) => `\\\\${char}`);\n}\n\nfunction dedupeAliases(values: Iterable<string>): string[] {\n const seen = new Map<string, string>();\n for (const value of values) {\n const trimmed = value.trim();\n if (trimmed.length === 0) {\n continue;\n }\n const key = trimmed.toLowerCase();\n if (!seen.has(key)) {\n seen.set(key, trimmed);\n }\n }\n return [...seen.values()].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-type CLI input. Throws a plain Error with a\n * stable message when the name is missing/empty or collides with a built-in;\n * the CLI layer maps these to PmCliError exit codes.\n */\nexport function normalizeAddTypeInput(raw: RawAddTypeInput): NormalizedAddTypeInput {\n const name = (raw.name ?? \"\").trim();\n if (name.length === 0) {\n throw new Error(\"Type name must not be empty.\");\n }\n const builtinMatch = matchBuiltinTypeName(name);\n if (builtinMatch) {\n throw new Error(\n `Cannot redefine built-in item type \"${builtinMatch}\". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const description = raw.description?.trim();\n const defaultStatus = raw.defaultStatus?.trim();\n const folder = raw.folder?.trim();\n const aliases = dedupeAliases(raw.aliases ?? []);\n for (const alias of aliases) {\n const aliasBuiltin = matchBuiltinTypeName(alias);\n if (aliasBuiltin) {\n throw new Error(\n `Alias \"${alias}\" collides with built-in item type \"${aliasBuiltin}\". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(\", \")}.`,\n );\n }\n }\n return {\n name,\n description: description && description.length > 0 ? description : undefined,\n defaultStatus: defaultStatus && defaultStatus.length > 0 ? defaultStatus : undefined,\n folder: folder && folder.length > 0 ? folder : undefined,\n aliases,\n };\n}\n\n/**\n * Throws when the requested name or any alias collides (case-insensitively)\n * with the canonical name or an alias of a DIFFERENT existing definition.\n * Such collisions would make `pm create`/`pm update --type` resolve\n * ambiguously (the runtime registry keys a single lowercase alias map), so\n * they are rejected. Tokens belonging to the same-named definition being\n * upserted are ignored, keeping re-runs idempotent.\n */\nexport function assertAliasesAvailable(input: NormalizedAddTypeInput, existing: ItemTypesFile): void {\n const selfLower = input.name.toLowerCase();\n const taken = new Map<string, string>();\n for (const definition of existing.definitions) {\n if (typeof definition.name !== \"string\") {\n continue;\n }\n const definitionName = definition.name.trim();\n if (definitionName.length === 0 || definitionName.toLowerCase() === selfLower) {\n continue;\n }\n taken.set(definitionName.toLowerCase(), definitionName);\n for (const alias of coerceAliasArray(definition.aliases)) {\n if (alias.trim().length > 0) {\n taken.set(alias.trim().toLowerCase(), definitionName);\n }\n }\n }\n const nameOwner = taken.get(selfLower);\n if (nameOwner) {\n throw new Error(`Type name \"${input.name}\" collides with an alias of existing item type \"${nameOwner}\".`);\n }\n for (const alias of input.aliases) {\n const owner = taken.get(alias.toLowerCase());\n if (owner) {\n throw new Error(`Alias \"${alias}\" already maps to existing item type \"${owner}\".`);\n }\n }\n}\n\n/**\n * Coerces an arbitrary parsed value from types.json into an ItemTypesFile.\n * Accepts the canonical `{ definitions: [...] }` shape, a bare array of\n * definitions, or a nested `{ item_types: { definitions: [...] } }` form, and\n * tolerates a missing/invalid file by returning an empty definitions list.\n */\nexport function parseItemTypesFile(raw: string | null | undefined): ItemTypesFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { definitions: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/types.json contains invalid JSON.\");\n }\n return { definitions: extractDefinitions(parsed) };\n}\n\nfunction extractDefinitions(parsed: unknown): ItemTypeDefinition[] {\n const candidate = selectDefinitionsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: ItemTypeDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.name !== \"string\" || record.name.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as ItemTypeDefinition);\n }\n return definitions;\n}\n\nfunction selectDefinitionsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n if (typeof record.item_types === \"object\" && record.item_types !== null) {\n const nested = record.item_types as Record<string, unknown>;\n if (Array.isArray(nested.definitions)) {\n return nested.definitions;\n }\n }\n return undefined;\n}\n\n/**\n * Idempotent UPSERT of a custom item type into the parsed file. Matching is\n * case-insensitive by name. When a definition already exists, fields supplied\n * in `input` override the previous values; aliases are merged (deduped); other\n * fields not addressed by add-type flags are preserved untouched.\n */\nexport function upsertItemType(file: ItemTypesFile, input: NormalizedAddTypeInput): UpsertItemTypeResult {\n const lowerName = input.name.toLowerCase();\n const definitions = file.definitions.slice();\n const existingIndex = definitions.findIndex(\n (definition) => typeof definition.name === \"string\" && definition.name.trim().toLowerCase() === lowerName,\n );\n const existing = existingIndex >= 0 ? definitions[existingIndex] : undefined;\n\n const mergedAliases = dedupeAliases([...coerceAliasArray(existing?.aliases), ...input.aliases]);\n\n const next: ItemTypeDefinition = {\n ...(existing ?? {}),\n name: input.name,\n };\n if (input.folder !== undefined) {\n next.folder = input.folder;\n }\n if (mergedAliases.length > 0) {\n next.aliases = mergedAliases;\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n applyAttribute(next, \"description\", input.description);\n applyAttribute(next, \"default_status\", input.defaultStatus);\n\n if (existingIndex >= 0) {\n definitions[existingIndex] = next;\n } else {\n definitions.push(next);\n }\n definitions.sort((left, right) => left.name.localeCompare(right.name));\n\n return {\n file: { definitions },\n definition: next,\n replaced: existingIndex >= 0,\n };\n}\n\n/**\n * Removes a custom item type definition from the parsed file by name\n * (case-insensitive). Throws a plain Error when `name` is empty or collides\n * with a reserved built-in type (built-ins are not stored in the file and must\n * never be deletable). Returns `removed: false` when no matching custom\n * definition exists so the CLI layer can treat the call as an idempotent no-op.\n */\nexport function removeItemType(file: ItemTypesFile, name: string | undefined): RemoveItemTypeResult {\n const trimmed = (name ?? \"\").trim();\n if (trimmed.length === 0) {\n throw new Error(\"Type name must not be empty.\");\n }\n const builtinMatch = matchBuiltinTypeName(trimmed);\n if (builtinMatch) {\n throw new Error(\n `Cannot remove built-in item type \"${builtinMatch}\". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const lowerName = trimmed.toLowerCase();\n const definitions = file.definitions.slice();\n const existingIndex = definitions.findIndex(\n (definition) => typeof definition.name === \"string\" && definition.name.trim().toLowerCase() === lowerName,\n );\n if (existingIndex < 0) {\n return { file: { definitions }, removed: false };\n }\n const [definition] = definitions.splice(existingIndex, 1);\n return { file: { definitions }, removed: true, definition };\n}\n\nfunction applyAttribute(definition: ItemTypeDefinition, key: string, value: string | undefined): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined) {\n record[key] = value;\n }\n}\n\n/**\n * Serializes the item types file with a trailing newline (matches the rest of\n * the schema scaffold files written by pm).\n */\nexport function serializeItemTypesFile(file: ItemTypesFile): string {\n return `${JSON.stringify({ definitions: file.definitions }, null, 2)}\\n`;\n}\n\n/**\n * Appends a discoverable hint to the \"Invalid type\" error so agents learn that\n * custom types exist and how to register one. Quotes are chosen so the printed\n * line is copy-pasteable as a shell command.\n */\nexport function buildInvalidTypeHint(name: string): string {\n const safeName = name.trim().length > 0 ? name.trim() : name;\n return `To register a custom type, run: pm schema add-type \"${escapeForDoubleQuotes(safeName)}\" (writes .agents/pm/schema/types.json).`;\n}\n\n/**\n * Builds the full invalid-type error message used by create/update: the\n * existing \"Invalid type ... Allowed: ...\" line plus the discoverable hint.\n */\nexport function buildInvalidTypeError(name: string, allowedTypes: readonly string[]): string {\n return `Invalid type value \"${name}\". Allowed: ${allowedTypes.join(\", \")}. ${buildInvalidTypeHint(name)}`;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAKhE;;;;;GAKG;AAEH,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,wBAAwB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,CAAC,CAAC,CACnE,CAAC;AAyCF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,mBAAmB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED;;;;GAIG;AACH,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACzG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,KAAa;IACjD,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,aAAa,CAAC,MAAwB;IAC7C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkB,CAAC;IACvC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,SAAS;QACX,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AI,eAAe,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,oBAAoB,CAAC,IAAI,CAAC,EAAE,CAAC;AAC5G,CAAC","debugId":"77a0faf1-6f19-5f27-9123-f589cf398634"}
|
|
1
|
+
{"version":3,"file":"item-types-file.js","sources":["core/schema/item-types-file.ts"],"sourceRoot":"/","sourcesContent":["import { BUILTIN_ITEM_TYPE_VALUES } from \"../../types/index.js\";\nimport type { ItemTypeDefinition } from \"../../types/index.js\";\nimport { toDefaultFolder } from \"../item/type-registry.js\";\n\nexport type { ItemTypeDefinition } from \"../../types/index.js\";\n\n/**\n * Pure logic for the `pm schema add-type` command and the create/update\n * invalid-type discoverability hint. The CLI command file (schema.ts) handles\n * IO/governance; everything testable and side-effect-free lives here so it can\n * be coverage-gated to 100%.\n */\n\nconst BUILTIN_NAME_LOOKUP = new Map<string, string>(\n BUILTIN_ITEM_TYPE_VALUES.map((name) => [name.toLowerCase(), name]),\n);\n\n/**\n * The shape persisted at `.agents/pm/schema/types.json`.\n */\nexport interface ItemTypesFile {\n definitions: ItemTypeDefinition[];\n}\n\nexport interface NormalizedAddTypeInput {\n name: string;\n description?: string;\n defaultStatus?: string;\n folder?: string;\n aliases: string[];\n}\n\nexport interface RawAddTypeInput {\n name: string | undefined;\n description?: string;\n defaultStatus?: string;\n folder?: string;\n aliases?: string[];\n}\n\nexport interface UpsertItemTypeResult {\n file: ItemTypesFile;\n /** The definition as stored after the upsert (existing fields preserved). */\n definition: ItemTypeDefinition;\n /** True when an existing definition with the same (case-insensitive) name was replaced. */\n replaced: boolean;\n /**\n * The canonical name of the replaced definition (only present when `replaced`).\n * Lets the caller detect a silent recase (e.g. \"Spike\" -> \"spike\") and warn.\n */\n previousName?: string;\n}\n\n/**\n * Custom item type names (and aliases) must be a single letter-led identifier\n * token: letters, digits, hyphen, or underscore — no whitespace or other\n * punctuation. This keeps names copy-pasteable as shell arguments and folder\n * slugs deterministic, matching the single-token PascalCase shape of every\n * built-in type. Folder/slug overlap between two distinct valid tokens (e.g.\n * \"Spike\"/\"Spikes\", \"code-review\"/\"code_review\") is rejected separately by\n * assertTypeFolderAvailable.\n */\nconst TYPE_NAME_TOKEN_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/;\n\nfunction assertValidTypeToken(value: string, label: string): void {\n if (!TYPE_NAME_TOKEN_PATTERN.test(value)) {\n throw new Error(\n `${label} \"${value}\" is not a valid identifier. Use a single letter-led token of letters, digits, hyphen, or underscore with no spaces or punctuation (e.g. \"Spike\" or \"code-review\").`,\n );\n }\n}\n\nexport interface RemoveItemTypeResult {\n file: ItemTypesFile;\n /** True when a matching definition existed and was dropped from the file. */\n removed: boolean;\n /** The removed definition, when one matched (case-insensitively) the requested name. */\n definition?: ItemTypeDefinition;\n}\n\n/**\n * Returns the canonical built-in name when `name` collides (case-insensitively)\n * with a reserved built-in item type, otherwise undefined.\n */\nexport function matchBuiltinTypeName(name: string): string | undefined {\n return BUILTIN_NAME_LOOKUP.get(name.trim().toLowerCase());\n}\n\n/**\n * Coerces a persisted `aliases` value into a string array, tolerating malformed\n * data (a non-array, or an array containing non-string entries) without throwing\n * or exploding a stray string into character aliases.\n */\nfunction coerceAliasArray(value: unknown): string[] {\n return Array.isArray(value) ? value.filter((entry): entry is string => typeof entry === \"string\") : [];\n}\n\n/**\n * Escapes a value for safe interpolation inside a double-quoted shell string so\n * suggested copy-pasteable commands stay well-formed for names containing\n * `\"`, `` ` ``, `$`, or `\\`.\n */\nexport function escapeForDoubleQuotes(value: string): string {\n return value.replace(/[\\\\\"`$]/g, (char) => `\\\\${char}`);\n}\n\nfunction dedupeAliases(values: Iterable<string>): string[] {\n const seen = new Map<string, string>();\n for (const value of values) {\n const trimmed = value.trim();\n if (trimmed.length === 0) {\n continue;\n }\n const key = trimmed.toLowerCase();\n if (!seen.has(key)) {\n seen.set(key, trimmed);\n }\n }\n return [...seen.values()].sort((left, right) => left.localeCompare(right));\n}\n\n/**\n * Validates and normalizes raw add-type CLI input. Throws a plain Error with a\n * stable message when the name is missing/empty or collides with a built-in;\n * the CLI layer maps these to PmCliError exit codes.\n */\nexport function normalizeAddTypeInput(raw: RawAddTypeInput): NormalizedAddTypeInput {\n const name = (raw.name ?? \"\").trim();\n if (name.length === 0) {\n throw new Error(\"Type name must not be empty.\");\n }\n assertValidTypeToken(name, \"Type name\");\n const builtinMatch = matchBuiltinTypeName(name);\n if (builtinMatch) {\n throw new Error(\n `Cannot redefine built-in item type \"${builtinMatch}\". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const description = raw.description?.trim();\n const defaultStatus = raw.defaultStatus?.trim();\n const folder = raw.folder?.trim();\n const aliases = dedupeAliases(raw.aliases ?? []);\n for (const alias of aliases) {\n assertValidTypeToken(alias, \"Alias\");\n const aliasBuiltin = matchBuiltinTypeName(alias);\n if (aliasBuiltin) {\n throw new Error(\n `Alias \"${alias}\" collides with built-in item type \"${aliasBuiltin}\". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(\", \")}.`,\n );\n }\n }\n return {\n name,\n description: description && description.length > 0 ? description : undefined,\n defaultStatus: defaultStatus && defaultStatus.length > 0 ? defaultStatus : undefined,\n folder: folder && folder.length > 0 ? folder : undefined,\n aliases,\n };\n}\n\n/**\n * Throws when the requested name or any alias collides (case-insensitively)\n * with the canonical name or an alias of a DIFFERENT existing definition.\n * Such collisions would make `pm create`/`pm update --type` resolve\n * ambiguously (the runtime registry keys a single lowercase alias map), so\n * they are rejected. Tokens belonging to the same-named definition being\n * upserted are ignored, keeping re-runs idempotent.\n */\nexport function assertAliasesAvailable(input: NormalizedAddTypeInput, existing: ItemTypesFile): void {\n const selfLower = input.name.toLowerCase();\n const taken = new Map<string, string>();\n for (const definition of existing.definitions) {\n if (typeof definition.name !== \"string\") {\n continue;\n }\n const definitionName = definition.name.trim();\n if (definitionName.length === 0 || definitionName.toLowerCase() === selfLower) {\n continue;\n }\n taken.set(definitionName.toLowerCase(), definitionName);\n for (const alias of coerceAliasArray(definition.aliases)) {\n if (alias.trim().length > 0) {\n taken.set(alias.trim().toLowerCase(), definitionName);\n }\n }\n }\n const nameOwner = taken.get(selfLower);\n if (nameOwner) {\n throw new Error(`Type name \"${input.name}\" collides with an alias of existing item type \"${nameOwner}\".`);\n }\n for (const alias of input.aliases) {\n const owner = taken.get(alias.toLowerCase());\n if (owner) {\n throw new Error(`Alias \"${alias}\" already maps to existing item type \"${owner}\".`);\n }\n }\n}\n\n/**\n * Resolves the storage folder a definition would use: an explicit non-empty\n * `folder` wins, otherwise the deterministic slug derived from the name (the\n * same derivation the runtime registry applies, single-sourced from\n * type-registry.toDefaultFolder).\n */\nfunction resolveDefinitionFolder(name: string, folder: unknown): string {\n if (typeof folder === \"string\" && folder.trim().length > 0) {\n return folder.trim().toLowerCase();\n }\n return toDefaultFolder(name).toLowerCase();\n}\n\n/**\n * Throws when the requested type's storage folder would collide with a\n * DIFFERENT existing definition's folder. Two distinct type names can slug to\n * one folder (\"Spike\"/\"Spikes\", \"code-review\"/\"code_review\"), which would make\n * their item files share a directory and silently corrupt the taxonomy. The\n * same-named definition being upserted is ignored (folder reuse on re-run is\n * expected). Resolving the collision is a matter of passing a distinct\n * `--folder`, so the error says so.\n *\n * `reservedFolders` carries the folders already owned by built-in and extension\n * types (folder-slug → owner name); a custom type whose slug matches one of\n * those (e.g. \"Tasks\" → \"tasks\", owned by the built-in Task) is just as\n * corrupting as a custom-vs-custom collision, so both are checked.\n */\nexport function assertTypeFolderAvailable(\n input: NormalizedAddTypeInput,\n existing: ItemTypesFile,\n reservedFolders?: ReadonlyMap<string, string>,\n): void {\n const selfLower = input.name.toLowerCase();\n const inputFolder = resolveDefinitionFolder(input.name, input.folder);\n const fail = (ownerName: string): never => {\n throw new Error(\n `Item type \"${input.name}\" would store items in folder \"${inputFolder}\", which already belongs to existing item type \"${ownerName}\". Pass a distinct --folder to keep their storage separate.`,\n );\n };\n for (const definition of existing.definitions) {\n if (typeof definition.name !== \"string\") {\n continue;\n }\n const definitionName = definition.name.trim();\n if (definitionName.length === 0 || definitionName.toLowerCase() === selfLower) {\n continue;\n }\n if (resolveDefinitionFolder(definitionName, definition.folder) === inputFolder) {\n fail(definitionName);\n }\n }\n const reservedOwner = reservedFolders?.get(inputFolder);\n if (reservedOwner !== undefined && reservedOwner.toLowerCase() !== selfLower) {\n fail(reservedOwner);\n }\n}\n\n/**\n * Coerces an arbitrary parsed value from types.json into an ItemTypesFile.\n * Accepts the canonical `{ definitions: [...] }` shape, a bare array of\n * definitions, or a nested `{ item_types: { definitions: [...] } }` form, and\n * tolerates a missing/invalid file by returning an empty definitions list.\n */\nexport function parseItemTypesFile(raw: string | null | undefined): ItemTypesFile {\n if (raw === null || raw === undefined || raw.trim().length === 0) {\n return { definitions: [] };\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw) as unknown;\n } catch {\n throw new Error(\"schema/types.json contains invalid JSON.\");\n }\n return { definitions: extractDefinitions(parsed) };\n}\n\nfunction extractDefinitions(parsed: unknown): ItemTypeDefinition[] {\n const candidate = selectDefinitionsArray(parsed);\n if (!candidate) {\n return [];\n }\n const definitions: ItemTypeDefinition[] = [];\n for (const entry of candidate) {\n if (typeof entry !== \"object\" || entry === null || Array.isArray(entry)) {\n continue;\n }\n const record = entry as Record<string, unknown>;\n if (typeof record.name !== \"string\" || record.name.trim().length === 0) {\n continue;\n }\n definitions.push(record as unknown as ItemTypeDefinition);\n }\n return definitions;\n}\n\nfunction selectDefinitionsArray(parsed: unknown): unknown[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed;\n }\n if (typeof parsed !== \"object\" || parsed === null) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.definitions)) {\n return record.definitions;\n }\n if (typeof record.item_types === \"object\" && record.item_types !== null) {\n const nested = record.item_types as Record<string, unknown>;\n if (Array.isArray(nested.definitions)) {\n return nested.definitions;\n }\n }\n return undefined;\n}\n\n/**\n * Idempotent UPSERT of a custom item type into the parsed file. Matching is\n * case-insensitive by name. When a definition already exists, fields supplied\n * in `input` override the previous values; aliases are merged (deduped); other\n * fields not addressed by add-type flags are preserved untouched.\n */\nexport function upsertItemType(file: ItemTypesFile, input: NormalizedAddTypeInput): UpsertItemTypeResult {\n const lowerName = input.name.toLowerCase();\n const definitions = file.definitions.slice();\n const existingIndex = definitions.findIndex(\n (definition) => typeof definition.name === \"string\" && definition.name.trim().toLowerCase() === lowerName,\n );\n const existing = existingIndex >= 0 ? definitions[existingIndex] : undefined;\n\n const mergedAliases = dedupeAliases([...coerceAliasArray(existing?.aliases), ...input.aliases]);\n\n const next: ItemTypeDefinition = {\n ...(existing ?? {}),\n name: input.name,\n };\n if (input.folder !== undefined) {\n next.folder = input.folder;\n }\n if (mergedAliases.length > 0) {\n next.aliases = mergedAliases;\n } else if (next.aliases !== undefined) {\n delete next.aliases;\n }\n applyAttribute(next, \"description\", input.description);\n applyAttribute(next, \"default_status\", input.defaultStatus);\n\n if (existingIndex >= 0) {\n definitions[existingIndex] = next;\n } else {\n definitions.push(next);\n }\n definitions.sort((left, right) => left.name.localeCompare(right.name));\n\n return {\n file: { definitions },\n definition: next,\n replaced: existingIndex >= 0,\n ...(existing && typeof existing.name === \"string\" ? { previousName: existing.name } : {}),\n };\n}\n\n/**\n * Removes a custom item type definition from the parsed file by name\n * (case-insensitive). Throws a plain Error when `name` is empty or collides\n * with a reserved built-in type (built-ins are not stored in the file and must\n * never be deletable). Returns `removed: false` when no matching custom\n * definition exists so the CLI layer can treat the call as an idempotent no-op.\n */\nexport function removeItemType(file: ItemTypesFile, name: string | undefined): RemoveItemTypeResult {\n const trimmed = (name ?? \"\").trim();\n if (trimmed.length === 0) {\n throw new Error(\"Type name must not be empty.\");\n }\n const builtinMatch = matchBuiltinTypeName(trimmed);\n if (builtinMatch) {\n throw new Error(\n `Cannot remove built-in item type \"${builtinMatch}\". Built-in types are reserved: ${BUILTIN_ITEM_TYPE_VALUES.join(\", \")}.`,\n );\n }\n const lowerName = trimmed.toLowerCase();\n const definitions = file.definitions.slice();\n const existingIndex = definitions.findIndex(\n (definition) => typeof definition.name === \"string\" && definition.name.trim().toLowerCase() === lowerName,\n );\n if (existingIndex < 0) {\n return { file: { definitions }, removed: false };\n }\n const [definition] = definitions.splice(existingIndex, 1);\n return { file: { definitions }, removed: true, definition };\n}\n\nfunction applyAttribute(definition: ItemTypeDefinition, key: string, value: string | undefined): void {\n const record = definition as unknown as Record<string, unknown>;\n if (value !== undefined) {\n record[key] = value;\n }\n}\n\n/**\n * Serializes the item types file with a trailing newline (matches the rest of\n * the schema scaffold files written by pm).\n */\nexport function serializeItemTypesFile(file: ItemTypesFile): string {\n return `${JSON.stringify({ definitions: file.definitions }, null, 2)}\\n`;\n}\n\n/**\n * Appends a discoverable hint to the \"Invalid type\" error so agents learn that\n * custom types exist and how to register one. Quotes are chosen so the printed\n * line is copy-pasteable as a shell command.\n */\nexport function buildInvalidTypeHint(name: string, typesFilePath?: string): string {\n const safeName = name.trim().length > 0 ? name.trim() : name;\n const target = typesFilePath?.trim() || \".agents/pm/schema/types.json\";\n return `To register a custom type, run: pm schema add-type \"${escapeForDoubleQuotes(safeName)}\" (writes ${target}).`;\n}\n\n/**\n * Builds the full invalid-type error message used by create/update: the\n * existing \"Invalid type ... Allowed: ...\" line plus the discoverable hint.\n * `typesFilePath` should be the resolved schema/types.json path for the active\n * tracker (see {@link resolveItemTypesFilePath}) so the hint reflects a custom\n * `--pm-path` instead of the hardcoded `.agents/pm` default.\n */\nexport function buildInvalidTypeError(name: string, allowedTypes: readonly string[], typesFilePath?: string): string {\n return `Invalid type value \"${name}\". Allowed: ${allowedTypes.join(\", \")}. ${buildInvalidTypeHint(name, typesFilePath)}`;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAI3D;;;;;GAKG;AAEH,MAAM,mBAAmB,GAAG,I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EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;AAC3E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAY,EAAE,aAAsB;IACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7D,MAAM,MAAM,GAAG,aAAa,EAAE,IAAI,EAAE,IAAI,8BAA8B,CAAC;IACvE,OAAO,uDAAuD,qBAAqB,CAAC,QAAQ,CAAC,aAAa,MAAM,IAAI,CAAC;AACvH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,YAA+B,EAAE,aAAsB;IACzG,OAAO,uBAAuB,IAAI,eAAe,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,oBAAoB,CAAC,IAAI,EAAE,aAAa,CAAC,EAAE,CAAC;AAC3H,CAAC","debugId":"995e9919-c166-505a-8821-d8a859a60ae8"}
|
|
@@ -60,6 +60,13 @@ export interface LoadedRuntimeSchemaSections {
|
|
|
60
60
|
}
|
|
61
61
|
export declare function normalizeRuntimeSchemaSettings(schema: Partial<RuntimeSchemaSettings> | undefined): RuntimeSchemaSettings;
|
|
62
62
|
export declare function filePathForSchemaSection(pmRoot: string, configuredPath: string | undefined, fallbackPath: string): string;
|
|
63
|
+
/**
|
|
64
|
+
* Resolves the active tracker's `schema/types.json` path so user-facing hints
|
|
65
|
+
* (e.g. the invalid-type error) point at the real `--pm-path` location instead
|
|
66
|
+
* of the hardcoded `.agents/pm` default. Mirrors how `pm schema add/remove-type`
|
|
67
|
+
* report their target path.
|
|
68
|
+
*/
|
|
69
|
+
export declare function resolveItemTypesFilePath(pmRoot: string, schema: RuntimeSchemaSettings): string;
|
|
63
70
|
export declare function ensureRuntimeSchemaFileScaffold(pmRoot: string, schema: RuntimeSchemaSettings): Promise<RuntimeSchemaFileBootstrapResult>;
|
|
64
71
|
export declare function loadRuntimeSchemaFromOptionalFiles(pmRoot: string, schema: RuntimeSchemaSettings): Promise<LoadedRuntimeSchemaSections>;
|
|
65
72
|
export declare function resolveRuntimeStatusRegistry(schema: RuntimeSchemaSettings): RuntimeStatusRegistry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b2eb7998-c31b-5482-a06a-702127583881")}catch(e){}}();
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { pathExists, readFileIfExists, writeFileAtomic } from "../fs/fs-utils.js";
|
|
5
5
|
import { DEFAULT_STATUS_DEFINITIONS, DEFAULT_WORKFLOW_DEFINITION } from "../shared/constants.js";
|
|
@@ -361,6 +361,15 @@ export function filePathForSchemaSection(pmRoot, configuredPath, fallbackPath) {
|
|
|
361
361
|
}
|
|
362
362
|
return path.join(pmRoot, normalized);
|
|
363
363
|
}
|
|
364
|
+
/**
|
|
365
|
+
* Resolves the active tracker's `schema/types.json` path so user-facing hints
|
|
366
|
+
* (e.g. the invalid-type error) point at the real `--pm-path` location instead
|
|
367
|
+
* of the hardcoded `.agents/pm` default. Mirrors how `pm schema add/remove-type`
|
|
368
|
+
* report their target path.
|
|
369
|
+
*/
|
|
370
|
+
export function resolveItemTypesFilePath(pmRoot, schema) {
|
|
371
|
+
return filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);
|
|
372
|
+
}
|
|
364
373
|
export async function ensureRuntimeSchemaFileScaffold(pmRoot, schema) {
|
|
365
374
|
const normalizedSchema = normalizeRuntimeSchemaSettings(schema);
|
|
366
375
|
const specs = [
|
|
@@ -465,11 +474,10 @@ function preferredStatusForRole(definitions, role, fallbackValues) {
|
|
|
465
474
|
if (withRole.length > 0) {
|
|
466
475
|
return withRole[0].id;
|
|
467
476
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
477
|
+
const normalizedFallbacks = fallbackValues
|
|
478
|
+
.map((value) => normalizeStatusId(value))
|
|
479
|
+
.filter((value) => typeof value === "string");
|
|
480
|
+
for (const normalized of normalizedFallbacks) {
|
|
473
481
|
if (definitions.some((definition) => definition.id === normalized)) {
|
|
474
482
|
return normalized;
|
|
475
483
|
}
|
|
@@ -521,7 +529,7 @@ export function resolveRuntimeStatusRegistry(schema) {
|
|
|
521
529
|
}
|
|
522
530
|
const workflow = normalizedSchema.workflow;
|
|
523
531
|
const openStatus = normalizeStatusId(workflow.open_status) ??
|
|
524
|
-
preferredStatusForRole(definitions, "default_open", ["open", "in_progress", STATUS_VALUES[0]
|
|
532
|
+
preferredStatusForRole(definitions, "default_open", ["open", "in_progress", STATUS_VALUES[0]]);
|
|
525
533
|
const closeStatus = normalizeStatusId(workflow.close_status) ??
|
|
526
534
|
preferredStatusForRole(definitions, "default_close", ["closed", "done", "complete"]);
|
|
527
535
|
const canceledStatus = normalizeStatusId(workflow.canceled_status) ??
|
|
@@ -536,9 +544,9 @@ export function resolveRuntimeStatusRegistry(schema) {
|
|
|
536
544
|
active_statuses: activeStatuses,
|
|
537
545
|
blocked_statuses: blockedStatuses,
|
|
538
546
|
draft_statuses: draftStatuses,
|
|
539
|
-
open_status: openStatus
|
|
540
|
-
close_status: closeStatus
|
|
541
|
-
canceled_status: canceledStatus
|
|
547
|
+
open_status: openStatus,
|
|
548
|
+
close_status: closeStatus,
|
|
549
|
+
canceled_status: canceledStatus,
|
|
542
550
|
};
|
|
543
551
|
}
|
|
544
552
|
export function normalizeStatusInputWithRegistry(value, registry) {
|
|
@@ -551,11 +559,10 @@ export function normalizeStatusInputWithRegistry(value, registry) {
|
|
|
551
559
|
export function resolveRuntimeFieldRegistry(schema) {
|
|
552
560
|
const normalizedSchema = normalizeRuntimeSchemaSettings(schema);
|
|
553
561
|
const dedupedByKey = new Map();
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
}
|
|
562
|
+
const normalizedFields = normalizedSchema.fields
|
|
563
|
+
.map((definition) => normalizeRuntimeFieldDefinition(definition))
|
|
564
|
+
.filter((definition) => definition !== null);
|
|
565
|
+
for (const normalized of normalizedFields) {
|
|
559
566
|
dedupedByKey.set(normalized.key, normalized);
|
|
560
567
|
}
|
|
561
568
|
const definitions = [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));
|
|
@@ -596,4 +603,4 @@ export function statusIsTerminal(status, registry) {
|
|
|
596
603
|
return registry.terminal_statuses.has(normalized);
|
|
597
604
|
}
|
|
598
605
|
//# sourceMappingURL=runtime-schema.js.map
|
|
599
|
-
//# debugId=
|
|
606
|
+
//# debugId=b2eb7998-c31b-5482-a06a-702127583881
|