@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-schema.js","sources":["core/schema/runtime-schema.ts"],"sourceRoot":"/","sourcesContent":["import path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { DEFAULT_STATUS_DEFINITIONS, DEFAULT_WORKFLOW_DEFINITION } from \"../shared/constants.js\";\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n RUNTIME_STATUS_ROLE_VALUES,\n RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,\n STATUS_VALUES,\n} from \"../../types/index.js\";\nimport type {\n ItemTypeDefinition,\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n RuntimeSchemaSettings,\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n RuntimeWorkflowDefinition,\n TypeWorkflowDefinition,\n} from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand } from \"../../types/index.js\";\n\nexport const DEFAULT_RUNTIME_SCHEMA_FILE_PATHS = Object.freeze({\n types: \"schema/types.json\",\n statuses: \"schema/statuses.json\",\n fields: \"schema/fields.json\",\n workflows: \"schema/workflows.json\",\n});\n\n// Default lifecycle status model and workflow role mapping live in\n// src/core/shared/constants.ts as the single source of truth (also referenced\n// by SETTINGS_DEFAULTS). Re-exported here under the historical names.\nexport const DEFAULT_RUNTIME_WORKFLOW: RuntimeWorkflowDefinition = DEFAULT_WORKFLOW_DEFINITION;\n\nexport const DEFAULT_RUNTIME_STATUS_DEFINITIONS: ReadonlyArray<RuntimeStatusDefinition> = DEFAULT_STATUS_DEFINITIONS;\n\nconst DEFAULT_RUNTIME_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\nexport interface RuntimeStatusDefinitionResolved {\n id: string;\n aliases: string[];\n roles: RuntimeStatusRole[];\n description?: string;\n order: number;\n}\n\nexport interface RuntimeFieldDefinitionResolved {\n key: string;\n metadata_key: string;\n cli_flag: string;\n cli_aliases: string[];\n description?: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n repeatable: boolean;\n required: boolean;\n required_on_create: boolean;\n required_types: string[];\n allow_unset: boolean;\n}\n\nexport interface RuntimeStatusRegistry {\n definitions: RuntimeStatusDefinitionResolved[];\n by_id: Map<string, RuntimeStatusDefinitionResolved>;\n alias_to_id: Map<string, string>;\n terminal_statuses: Set<string>;\n terminal_done_statuses: Set<string>;\n terminal_canceled_statuses: Set<string>;\n active_statuses: Set<string>;\n blocked_statuses: Set<string>;\n draft_statuses: Set<string>;\n open_status: string;\n close_status: string;\n canceled_status: string;\n}\n\nexport interface RuntimeFieldRegistry {\n definitions: RuntimeFieldDefinitionResolved[];\n by_key: Map<string, RuntimeFieldDefinitionResolved>;\n by_cli_token: Map<string, RuntimeFieldDefinitionResolved>;\n command_to_fields: Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>;\n}\n\nexport interface RuntimeSchemaFileBootstrapResult {\n created_paths: string[];\n}\n\nexport interface LoadedRuntimeSchemaSections {\n schema: RuntimeSchemaSettings;\n type_definitions_from_file: ItemTypeDefinition[] | undefined;\n warnings: string[];\n created_paths: string[];\n}\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\nconst RUNTIME_UNKNOWN_FIELD_POLICY_SET = new Set<string>(RUNTIME_UNKNOWN_FIELD_POLICY_VALUES);\n\nfunction normalizeStringList(values: string[] | undefined): string[] {\n const candidates = Array.isArray(values) ? values : [];\n return [...new Set(candidates.map((value) => (typeof value === \"string\" ? value.trim() : \"\")).filter((value) => value.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeStatusToken(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\nfunction normalizeStatusId(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.length === 0) {\n return undefined;\n }\n const normalized = normalizeStatusToken(value);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction stripFlagPrefix(value: string): string {\n return value.startsWith(\"--\") ? value.slice(2) : value;\n}\n\nfunction normalizeCliToken(value: unknown): string {\n return typeof value === \"string\" ? stripFlagPrefix(value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\")) : \"\";\n}\n\nfunction keyToDefaultCliFlag(value: string): string {\n return value.replaceAll(\"_\", \"-\");\n}\n\nfunction toCamelCase(input: string): string {\n const segments = input\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return input;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction normalizeRuntimeStatusDefinition(\n definition: RuntimeStatusDefinition,\n fallbackOrder: number,\n): RuntimeStatusDefinitionResolved | null {\n const id = normalizeStatusId(definition.id);\n if (!id) {\n return null;\n }\n const aliases = normalizeStringList(definition.aliases).map((value) => normalizeStatusToken(value)).filter((value) => value !== id);\n const roles = normalizeStringList(definition.roles).filter((value): value is RuntimeStatusRole => RUNTIME_STATUS_ROLE_SET.has(value));\n const description = definition.description?.trim();\n const order = typeof definition.order === \"number\" && Number.isFinite(definition.order) ? definition.order : fallbackOrder;\n return {\n id,\n aliases,\n roles,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction normalizeRuntimeWorkflow(workflow: RuntimeWorkflowDefinition | undefined): RuntimeWorkflowDefinition {\n return {\n draft_status: normalizeStatusId(workflow?.draft_status),\n open_status: normalizeStatusId(workflow?.open_status),\n in_progress_status: normalizeStatusId(workflow?.in_progress_status),\n blocked_status: normalizeStatusId(workflow?.blocked_status),\n close_status: normalizeStatusId(workflow?.close_status),\n canceled_status: normalizeStatusId(workflow?.canceled_status),\n };\n}\n\nfunction normalizeTypeWorkflowDefinitions(\n workflows: TypeWorkflowDefinition[] | undefined,\n): TypeWorkflowDefinition[] | undefined {\n if (!Array.isArray(workflows) || workflows.length === 0) {\n return undefined;\n }\n // Keep the raw (trimmed) type name so it round-trips verbatim; comparison is\n // case-insensitive downstream (resolveTypeWorkflows lower-cases). from/to\n // status tokens use the same normalization rules as runtime statuses.\n //\n // An EXPLICIT empty `allowed_transitions: []` is a deliberate DENY-ALL rule and\n // MUST survive normalization (it must NOT collapse to \"no entry\", which would\n // leave the type unrestricted). But a NON-empty array whose every pair is\n // malformed (e.g. a 3-element tuple typo) must be DROPPED like other malformed\n // schema-file content, NOT silently turned into a deny-all rule — otherwise a\n // typo would start failing every update for that type under strict enforcement.\n const byTypeKey = new Map<string, { type: string; pairs: [string, string][]; denyAll: boolean }>();\n for (const entry of workflows) {\n const rawType = typeof entry?.type === \"string\" ? entry.type.trim() : \"\";\n if (rawType.length === 0) {\n continue;\n }\n if (!Array.isArray(entry?.allowed_transitions)) {\n continue;\n }\n const typeKey = rawType.toLowerCase();\n const pairs = entry.allowed_transitions;\n const record = byTypeKey.get(typeKey) ?? { type: rawType, pairs: [], denyAll: false };\n // Only an explicitly empty array signals an intentional deny-all.\n if (pairs.length === 0) {\n record.denyAll = true;\n }\n for (const pair of pairs) {\n if (!Array.isArray(pair) || pair.length !== 2) {\n continue;\n }\n const from = normalizeStatusToken(pair[0]);\n const to = normalizeStatusToken(pair[1]);\n if (from.length === 0 || to.length === 0) {\n continue;\n }\n if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {\n continue;\n }\n record.pairs.push([from, to]);\n }\n byTypeKey.set(typeKey, record);\n }\n const normalized: TypeWorkflowDefinition[] = [];\n for (const record of byTypeKey.values()) {\n // Keep when there is at least one valid transition OR an explicit deny-all was\n // declared; drop nonempty-but-all-malformed entries (treated as typos).\n if (record.pairs.length > 0 || record.denyAll) {\n normalized.push({ type: record.type, allowed_transitions: record.pairs });\n }\n }\n normalized.sort((left, right) => left.type.localeCompare(right.type));\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeRuntimeFieldDefinition(definition: RuntimeFieldDefinition): RuntimeFieldDefinitionResolved | null {\n const key = normalizeStatusToken(definition.key ?? \"\");\n if (!key) {\n return null;\n }\n const metadataKey = normalizeStatusToken(definition.metadata_key ?? definition.front_matter_key ?? key);\n const cliFlag = normalizeCliToken(definition.cli_flag ?? keyToDefaultCliFlag(key));\n if (!cliFlag) {\n return null;\n }\n const cliAliases = normalizeStringList(definition.cli_aliases)\n .map((value) => normalizeCliToken(value))\n .filter((value) => value.length > 0 && value !== cliFlag);\n const typeCandidate = typeof definition.type === \"string\" ? definition.type.trim().toLowerCase() : \"string\";\n const type = RUNTIME_FIELD_TYPE_SET.has(typeCandidate) ? (typeCandidate as RuntimeFieldType) : \"string\";\n const commands = (() => {\n const normalized = normalizeStringList(definition.commands).filter((value): value is RuntimeFieldCommand =>\n RUNTIME_FIELD_COMMAND_SET.has(value),\n );\n if (normalized.length > 0) {\n return normalized;\n }\n return [...DEFAULT_RUNTIME_FIELD_COMMANDS];\n })();\n const description = definition.description?.trim();\n const requiredTypes = normalizeStringList(definition.required_types);\n return {\n key,\n metadata_key: metadataKey,\n cli_flag: cliFlag,\n cli_aliases: cliAliases,\n description: description && description.length > 0 ? description : undefined,\n type,\n commands,\n repeatable: definition.repeatable === true || type === \"string_array\",\n required: definition.required === true,\n required_on_create: definition.required_on_create === true,\n required_types: requiredTypes,\n allow_unset: definition.allow_unset !== false,\n };\n}\n\nexport function normalizeRuntimeSchemaSettings(schema: Partial<RuntimeSchemaSettings> | undefined): RuntimeSchemaSettings {\n const files = {\n ...DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ...(schema?.files ?? {}),\n };\n const statusesSource = schema?.statuses && schema.statuses.length > 0 ? schema.statuses : DEFAULT_RUNTIME_STATUS_DEFINITIONS;\n const normalizedStatuses = (() => {\n const dedupedById = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const [index, definition] of statusesSource.entries()) {\n const normalized = normalizeRuntimeStatusDefinition(definition, index);\n if (!normalized) {\n continue;\n }\n dedupedById.set(normalized.id, normalized);\n }\n const values = [...dedupedById.values()].sort((left, right) =>\n left.order === right.order ? left.id.localeCompare(right.id) : left.order - right.order,\n );\n if (values.length > 0) {\n return values;\n }\n return DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n })();\n const normalizedFields = (() => {\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of schema?.fields ?? []) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n return [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n })();\n const unknownFieldPolicyCandidate =\n typeof schema?.unknown_field_policy === \"string\" ? schema.unknown_field_policy.trim().toLowerCase() : \"allow\";\n const unknownFieldPolicy = RUNTIME_UNKNOWN_FIELD_POLICY_SET.has(unknownFieldPolicyCandidate)\n ? unknownFieldPolicyCandidate\n : \"allow\";\n return {\n version: typeof schema?.version === \"number\" && Number.isFinite(schema.version) ? Math.floor(schema.version) : 1,\n files,\n statuses: normalizedStatuses.map((definition) => ({\n id: definition.id,\n aliases: definition.aliases.length > 0 ? [...definition.aliases] : undefined,\n roles: definition.roles.length > 0 ? [...definition.roles] : undefined,\n description: definition.description,\n order: definition.order,\n })),\n fields: normalizedFields.map((definition) => ({\n key: definition.key,\n metadata_key: definition.metadata_key !== definition.key ? definition.metadata_key : undefined,\n cli_flag: definition.cli_flag !== keyToDefaultCliFlag(definition.key) ? definition.cli_flag : undefined,\n cli_aliases: definition.cli_aliases.length > 0 ? [...definition.cli_aliases] : undefined,\n description: definition.description,\n type: definition.type,\n commands: [...definition.commands],\n repeatable: definition.repeatable === true ? true : undefined,\n required: definition.required === true ? true : undefined,\n required_on_create: definition.required_on_create === true ? true : undefined,\n required_types: definition.required_types.length > 0 ? [...definition.required_types] : undefined,\n allow_unset: definition.allow_unset === false ? false : undefined,\n })),\n workflow: {\n ...DEFAULT_RUNTIME_WORKFLOW,\n ...normalizeRuntimeWorkflow(schema?.workflow),\n },\n type_workflows: normalizeTypeWorkflowDefinitions(schema?.type_workflows),\n unknown_field_policy: unknownFieldPolicy as RuntimeSchemaSettings[\"unknown_field_policy\"],\n };\n}\n\nfunction serializeJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction buildTypesFileSeed(): unknown {\n return {\n definitions: [],\n };\n}\n\nfunction buildStatusesFileSeed(): unknown {\n return {\n statuses: DEFAULT_RUNTIME_STATUS_DEFINITIONS,\n };\n}\n\nfunction buildFieldsFileSeed(): unknown {\n return {\n fields: [],\n };\n}\n\nfunction buildWorkflowsFileSeed(): unknown {\n return {\n workflow: DEFAULT_RUNTIME_WORKFLOW,\n };\n}\n\nfunction parseOptionalJson(raw: string, warningKey: string, warnings: string[]): unknown | undefined {\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n warnings.push(warningKey);\n return undefined;\n }\n}\n\nfunction readTypeDefinitionsFromSchemaFile(parsed: unknown): ItemTypeDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as ItemTypeDefinition[];\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 as ItemTypeDefinition[];\n }\n if (typeof record.item_types === \"object\" && record.item_types !== null) {\n const itemTypesRecord = record.item_types as Record<string, unknown>;\n if (Array.isArray(itemTypesRecord.definitions)) {\n return itemTypesRecord.definitions as ItemTypeDefinition[];\n }\n }\n return undefined;\n}\n\nfunction readStatusesFromSchemaFile(parsed: unknown): RuntimeStatusDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeStatusDefinition[];\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.statuses)) {\n return record.statuses as RuntimeStatusDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeStatusDefinition[];\n }\n return undefined;\n}\n\nfunction readFieldsFromSchemaFile(parsed: unknown): RuntimeFieldDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeFieldDefinition[];\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 as RuntimeFieldDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeFieldDefinition[];\n }\n return undefined;\n}\n\nfunction readWorkflowFromSchemaFile(parsed: unknown): RuntimeWorkflowDefinition | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (typeof record.workflow === \"object\" && record.workflow !== null && !Array.isArray(record.workflow)) {\n return record.workflow as RuntimeWorkflowDefinition;\n }\n if (typeof record.workflows === \"object\" && record.workflows !== null && !Array.isArray(record.workflows)) {\n return record.workflows as RuntimeWorkflowDefinition;\n }\n return record as RuntimeWorkflowDefinition;\n}\n\nfunction readTypeWorkflowsFromSchemaFile(parsed: unknown): TypeWorkflowDefinition[] | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.type_workflows)) {\n return record.type_workflows as TypeWorkflowDefinition[];\n }\n return undefined;\n}\n\nexport function filePathForSchemaSection(pmRoot: string, configuredPath: string | undefined, fallbackPath: string): string {\n const normalized = configuredPath?.trim() || fallbackPath;\n if (path.isAbsolute(normalized)) {\n return normalized;\n }\n return path.join(pmRoot, normalized);\n}\n\nexport async function ensureRuntimeSchemaFileScaffold(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<RuntimeSchemaFileBootstrapResult> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const specs: Array<{ path: string; seed: unknown }> = [\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),\n seed: buildTypesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),\n seed: buildStatusesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),\n seed: buildFieldsFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows),\n seed: buildWorkflowsFileSeed(),\n },\n ];\n const createdPaths: string[] = [];\n for (const spec of specs) {\n if (await pathExists(spec.path)) {\n continue;\n }\n await writeFileAtomic(spec.path, serializeJson(spec.seed));\n createdPaths.push(spec.path);\n }\n return {\n created_paths: createdPaths,\n };\n}\n\nexport async function loadRuntimeSchemaFromOptionalFiles(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<LoadedRuntimeSchemaSections> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const warnings: string[] = [];\n const typeFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const statusFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n );\n const fieldsFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n const workflowsFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.workflows,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows,\n );\n\n let loadedTypeDefinitions: ItemTypeDefinition[] | undefined;\n let loadedStatuses: RuntimeStatusDefinition[] | undefined;\n let loadedFields: RuntimeFieldDefinition[] | undefined;\n let loadedWorkflow: RuntimeWorkflowDefinition | undefined;\n let loadedTypeWorkflows: TypeWorkflowDefinition[] | undefined;\n\n const readAndParse = async (targetPath: string, warningKey: string): Promise<unknown | undefined> => {\n const raw = await readFileIfExists(targetPath);\n if (raw === null) {\n return undefined;\n }\n return parseOptionalJson(raw, warningKey, warnings);\n };\n\n const parsedTypes = await readAndParse(typeFilePath, \"runtime_schema_types_invalid_json\");\n if (parsedTypes !== undefined) {\n loadedTypeDefinitions = readTypeDefinitionsFromSchemaFile(parsedTypes);\n if (loadedTypeDefinitions === undefined) {\n warnings.push(\"runtime_schema_types_invalid_shape\");\n }\n }\n\n const parsedStatuses = await readAndParse(statusFilePath, \"runtime_schema_statuses_invalid_json\");\n if (parsedStatuses !== undefined) {\n loadedStatuses = readStatusesFromSchemaFile(parsedStatuses);\n if (loadedStatuses === undefined) {\n warnings.push(\"runtime_schema_statuses_invalid_shape\");\n }\n }\n\n const parsedFields = await readAndParse(fieldsFilePath, \"runtime_schema_fields_invalid_json\");\n if (parsedFields !== undefined) {\n loadedFields = readFieldsFromSchemaFile(parsedFields);\n if (loadedFields === undefined) {\n warnings.push(\"runtime_schema_fields_invalid_shape\");\n }\n }\n\n const parsedWorkflow = await readAndParse(workflowsFilePath, \"runtime_schema_workflows_invalid_json\");\n if (parsedWorkflow !== undefined) {\n loadedWorkflow = readWorkflowFromSchemaFile(parsedWorkflow);\n if (loadedWorkflow === undefined) {\n warnings.push(\"runtime_schema_workflows_invalid_shape\");\n }\n // type_workflows live alongside `workflow` in the same file; their absence\n // is not an error (the file may carry only the lifecycle workflow block).\n loadedTypeWorkflows = readTypeWorkflowsFromSchemaFile(parsedWorkflow);\n }\n\n const mergedSchema = normalizeRuntimeSchemaSettings({\n ...normalizedSchema,\n statuses: [...normalizedSchema.statuses, ...(loadedStatuses ?? [])],\n fields: [...normalizedSchema.fields, ...(loadedFields ?? [])],\n workflow: {\n ...normalizedSchema.workflow,\n ...(loadedWorkflow ?? {}),\n },\n type_workflows: [...(normalizedSchema.type_workflows ?? []), ...(loadedTypeWorkflows ?? [])],\n });\n\n return {\n schema: mergedSchema,\n type_definitions_from_file: loadedTypeDefinitions,\n warnings,\n created_paths: [],\n };\n}\n\nfunction preferredStatusForRole(\n definitions: RuntimeStatusDefinitionResolved[],\n role: RuntimeStatusRole,\n fallbackValues: string[],\n): string | undefined {\n const withRole = definitions.filter((definition) => definition.roles.includes(role));\n if (withRole.length > 0) {\n return withRole[0].id;\n }\n for (const value of fallbackValues) {\n const normalized = normalizeStatusId(value);\n if (!normalized) {\n continue;\n }\n if (definitions.some((definition) => definition.id === normalized)) {\n return normalized;\n }\n }\n return definitions[0]?.id;\n}\n\nexport function resolveRuntimeStatusRegistry(schema: RuntimeSchemaSettings): RuntimeStatusRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const definitions = normalizedSchema.statuses.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n const aliasToId = new Map<string, string>();\n const byId = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const definition of definitions) {\n byId.set(definition.id, definition);\n aliasToId.set(definition.id, definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \" \"), definition.id);\n for (const alias of definition.aliases) {\n aliasToId.set(alias, definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \" \"), definition.id);\n }\n }\n const terminalStatuses = new Set<string>();\n const terminalDoneStatuses = new Set<string>();\n const terminalCanceledStatuses = new Set<string>();\n const activeStatuses = new Set<string>();\n const blockedStatuses = new Set<string>();\n const draftStatuses = new Set<string>();\n for (const definition of definitions) {\n const roles = new Set(definition.roles);\n if (roles.has(\"terminal\") || roles.has(\"terminal_done\") || roles.has(\"terminal_canceled\")) {\n terminalStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_done\")) {\n terminalDoneStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_canceled\")) {\n terminalCanceledStatuses.add(definition.id);\n }\n if (roles.has(\"active\")) {\n activeStatuses.add(definition.id);\n }\n if (roles.has(\"blocked\")) {\n blockedStatuses.add(definition.id);\n }\n if (roles.has(\"draft\")) {\n draftStatuses.add(definition.id);\n }\n }\n const workflow = normalizedSchema.workflow;\n const openStatus =\n normalizeStatusId(workflow.open_status) ??\n preferredStatusForRole(definitions, \"default_open\", [\"open\", \"in_progress\", STATUS_VALUES[0] ?? \"open\"]);\n const closeStatus =\n normalizeStatusId(workflow.close_status) ??\n preferredStatusForRole(definitions, \"default_close\", [\"closed\", \"done\", \"complete\"]);\n const canceledStatus =\n normalizeStatusId(workflow.canceled_status) ??\n preferredStatusForRole(definitions, \"default_cancel\", [\"canceled\", \"cancelled\"]);\n\n return {\n definitions,\n by_id: byId,\n alias_to_id: aliasToId,\n terminal_statuses: terminalStatuses,\n terminal_done_statuses: terminalDoneStatuses,\n terminal_canceled_statuses: terminalCanceledStatuses,\n active_statuses: activeStatuses,\n blocked_statuses: blockedStatuses,\n draft_statuses: draftStatuses,\n open_status: openStatus ?? definitions[0]?.id ?? \"open\",\n close_status: closeStatus ?? definitions[0]?.id ?? \"closed\",\n canceled_status: canceledStatus ?? definitions[0]?.id ?? \"canceled\",\n };\n}\n\nexport function normalizeStatusInputWithRegistry(value: unknown, registry: RuntimeStatusRegistry): string | undefined {\n const normalized = normalizeStatusToken(value);\n if (!normalized) {\n return undefined;\n }\n return registry.alias_to_id.get(normalized);\n}\n\nexport function resolveRuntimeFieldRegistry(schema: RuntimeSchemaSettings): RuntimeFieldRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of normalizedSchema.fields) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n const definitions = [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n const byKey = new Map<string, RuntimeFieldDefinitionResolved>();\n const byCliToken = new Map<string, RuntimeFieldDefinitionResolved>();\n const commandToFields = new Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>();\n for (const definition of definitions) {\n byKey.set(definition.key, definition);\n byCliToken.set(definition.cli_flag, definition);\n for (const alias of definition.cli_aliases) {\n byCliToken.set(alias, definition);\n }\n for (const command of definition.commands) {\n const existing = commandToFields.get(command) ?? [];\n existing.push(definition);\n commandToFields.set(command, existing);\n }\n }\n for (const [command, fieldDefinitions] of commandToFields.entries()) {\n fieldDefinitions.sort((left, right) => left.key.localeCompare(right.key));\n commandToFields.set(command, fieldDefinitions);\n }\n return {\n definitions,\n by_key: byKey,\n by_cli_token: byCliToken,\n command_to_fields: commandToFields,\n };\n}\n\nexport function runtimeFieldOptionTarget(field: RuntimeFieldDefinitionResolved): string {\n return toCamelCase(field.key);\n}\n\nexport function statusIsTerminal(status: string, registry: RuntimeStatusRegistry): boolean {\n const normalized = normalizeStatusInputWithRegistry(status, registry);\n if (!normalized) {\n return false;\n }\n return registry.terminal_statuses.has(normalized);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC1B,mCAAmC,EACnC,aAAa,GACd,MAAM,sBAAsB,CAAC;AAe9B,MAAM,CAAC,MAAM,iCAAiC,GAAG,MAAM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,CAAC;YAC1C,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YACpD,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;YAC1B,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,OAAO,EAAE,gBAAgB,CAAC,IAAI,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC;QACpE,gBAAgB,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC1E,eAAe,CAAC,GAAG,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACjD,CAAC;IACD,OAAO;QACL,WAAW;QACX,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,UAAU;QACxB,iBAAiB,EAAE,eAAe;KACnC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAqC;IAC5E,OAAO,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,MAAc,EAAE,QAA+B;IAC9E,MAAM,UAAU,GAAG,gCAAgC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACtE,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC","debugId":"221fcd13-8553-5c32-a2d8-2845d0f71047"}
|
|
1
|
+
{"version":3,"file":"runtime-schema.js","sources":["core/schema/runtime-schema.ts"],"sourceRoot":"/","sourcesContent":["import path from \"node:path\";\nimport { pathExists, readFileIfExists, writeFileAtomic } from \"../fs/fs-utils.js\";\nimport { DEFAULT_STATUS_DEFINITIONS, DEFAULT_WORKFLOW_DEFINITION } from \"../shared/constants.js\";\nimport {\n RUNTIME_FIELD_COMMAND_VALUES,\n RUNTIME_FIELD_TYPE_VALUES,\n RUNTIME_STATUS_ROLE_VALUES,\n RUNTIME_UNKNOWN_FIELD_POLICY_VALUES,\n STATUS_VALUES,\n} from \"../../types/index.js\";\nimport type {\n ItemTypeDefinition,\n RuntimeFieldCommand,\n RuntimeFieldDefinition,\n RuntimeFieldType,\n RuntimeSchemaSettings,\n RuntimeStatusDefinition,\n RuntimeStatusRole,\n RuntimeWorkflowDefinition,\n TypeWorkflowDefinition,\n} from \"../../types/index.js\";\n\nexport type { RuntimeFieldCommand } from \"../../types/index.js\";\n\nexport const DEFAULT_RUNTIME_SCHEMA_FILE_PATHS = Object.freeze({\n types: \"schema/types.json\",\n statuses: \"schema/statuses.json\",\n fields: \"schema/fields.json\",\n workflows: \"schema/workflows.json\",\n});\n\n// Default lifecycle status model and workflow role mapping live in\n// src/core/shared/constants.ts as the single source of truth (also referenced\n// by SETTINGS_DEFAULTS). Re-exported here under the historical names.\nexport const DEFAULT_RUNTIME_WORKFLOW: RuntimeWorkflowDefinition = DEFAULT_WORKFLOW_DEFINITION;\n\nexport const DEFAULT_RUNTIME_STATUS_DEFINITIONS: ReadonlyArray<RuntimeStatusDefinition> = DEFAULT_STATUS_DEFINITIONS;\n\nconst DEFAULT_RUNTIME_FIELD_COMMANDS: RuntimeFieldCommand[] = [\"create\", \"update\"];\n\nexport interface RuntimeStatusDefinitionResolved {\n id: string;\n aliases: string[];\n roles: RuntimeStatusRole[];\n description?: string;\n order: number;\n}\n\nexport interface RuntimeFieldDefinitionResolved {\n key: string;\n metadata_key: string;\n cli_flag: string;\n cli_aliases: string[];\n description?: string;\n type: RuntimeFieldType;\n commands: RuntimeFieldCommand[];\n repeatable: boolean;\n required: boolean;\n required_on_create: boolean;\n required_types: string[];\n allow_unset: boolean;\n}\n\nexport interface RuntimeStatusRegistry {\n definitions: RuntimeStatusDefinitionResolved[];\n by_id: Map<string, RuntimeStatusDefinitionResolved>;\n alias_to_id: Map<string, string>;\n terminal_statuses: Set<string>;\n terminal_done_statuses: Set<string>;\n terminal_canceled_statuses: Set<string>;\n active_statuses: Set<string>;\n blocked_statuses: Set<string>;\n draft_statuses: Set<string>;\n open_status: string;\n close_status: string;\n canceled_status: string;\n}\n\nexport interface RuntimeFieldRegistry {\n definitions: RuntimeFieldDefinitionResolved[];\n by_key: Map<string, RuntimeFieldDefinitionResolved>;\n by_cli_token: Map<string, RuntimeFieldDefinitionResolved>;\n command_to_fields: Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>;\n}\n\nexport interface RuntimeSchemaFileBootstrapResult {\n created_paths: string[];\n}\n\nexport interface LoadedRuntimeSchemaSections {\n schema: RuntimeSchemaSettings;\n type_definitions_from_file: ItemTypeDefinition[] | undefined;\n warnings: string[];\n created_paths: string[];\n}\n\nconst RUNTIME_STATUS_ROLE_SET = new Set<string>(RUNTIME_STATUS_ROLE_VALUES);\nconst RUNTIME_FIELD_TYPE_SET = new Set<string>(RUNTIME_FIELD_TYPE_VALUES);\nconst RUNTIME_FIELD_COMMAND_SET = new Set<string>(RUNTIME_FIELD_COMMAND_VALUES);\nconst RUNTIME_UNKNOWN_FIELD_POLICY_SET = new Set<string>(RUNTIME_UNKNOWN_FIELD_POLICY_VALUES);\n\nfunction normalizeStringList(values: string[] | undefined): string[] {\n const candidates = Array.isArray(values) ? values : [];\n return [...new Set(candidates.map((value) => (typeof value === \"string\" ? value.trim() : \"\")).filter((value) => value.length > 0))]\n .sort((left, right) => left.localeCompare(right));\n}\n\nfunction normalizeStatusToken(value: unknown): string {\n return typeof value === \"string\" ? value.trim().toLowerCase().replaceAll(/[\\s-]+/g, \"_\") : \"\";\n}\n\nfunction normalizeStatusId(value: unknown): string | undefined {\n if (typeof value !== \"string\" || value.length === 0) {\n return undefined;\n }\n const normalized = normalizeStatusToken(value);\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction stripFlagPrefix(value: string): string {\n return value.startsWith(\"--\") ? value.slice(2) : value;\n}\n\nfunction normalizeCliToken(value: unknown): string {\n return typeof value === \"string\" ? stripFlagPrefix(value.trim().toLowerCase().replaceAll(/[\\s_]+/g, \"-\")) : \"\";\n}\n\nfunction keyToDefaultCliFlag(value: string): string {\n return value.replaceAll(\"_\", \"-\");\n}\n\nfunction toCamelCase(input: string): string {\n const segments = input\n .replaceAll(/[^A-Za-z0-9]+/g, \" \")\n .trim()\n .split(/\\s+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => segment.toLowerCase());\n if (segments.length === 0) {\n return input;\n }\n const [first, ...rest] = segments;\n return `${first}${rest.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1)}`).join(\"\")}`;\n}\n\nfunction normalizeRuntimeStatusDefinition(\n definition: RuntimeStatusDefinition,\n fallbackOrder: number,\n): RuntimeStatusDefinitionResolved | null {\n const id = normalizeStatusId(definition.id);\n if (!id) {\n return null;\n }\n const aliases = normalizeStringList(definition.aliases).map((value) => normalizeStatusToken(value)).filter((value) => value !== id);\n const roles = normalizeStringList(definition.roles).filter((value): value is RuntimeStatusRole => RUNTIME_STATUS_ROLE_SET.has(value));\n const description = definition.description?.trim();\n const order = typeof definition.order === \"number\" && Number.isFinite(definition.order) ? definition.order : fallbackOrder;\n return {\n id,\n aliases,\n roles,\n description: description && description.length > 0 ? description : undefined,\n order,\n };\n}\n\nfunction normalizeRuntimeWorkflow(workflow: RuntimeWorkflowDefinition | undefined): RuntimeWorkflowDefinition {\n return {\n draft_status: normalizeStatusId(workflow?.draft_status),\n open_status: normalizeStatusId(workflow?.open_status),\n in_progress_status: normalizeStatusId(workflow?.in_progress_status),\n blocked_status: normalizeStatusId(workflow?.blocked_status),\n close_status: normalizeStatusId(workflow?.close_status),\n canceled_status: normalizeStatusId(workflow?.canceled_status),\n };\n}\n\nfunction normalizeTypeWorkflowDefinitions(\n workflows: TypeWorkflowDefinition[] | undefined,\n): TypeWorkflowDefinition[] | undefined {\n if (!Array.isArray(workflows) || workflows.length === 0) {\n return undefined;\n }\n // Keep the raw (trimmed) type name so it round-trips verbatim; comparison is\n // case-insensitive downstream (resolveTypeWorkflows lower-cases). from/to\n // status tokens use the same normalization rules as runtime statuses.\n //\n // An EXPLICIT empty `allowed_transitions: []` is a deliberate DENY-ALL rule and\n // MUST survive normalization (it must NOT collapse to \"no entry\", which would\n // leave the type unrestricted). But a NON-empty array whose every pair is\n // malformed (e.g. a 3-element tuple typo) must be DROPPED like other malformed\n // schema-file content, NOT silently turned into a deny-all rule — otherwise a\n // typo would start failing every update for that type under strict enforcement.\n const byTypeKey = new Map<string, { type: string; pairs: [string, string][]; denyAll: boolean }>();\n for (const entry of workflows) {\n const rawType = typeof entry?.type === \"string\" ? entry.type.trim() : \"\";\n if (rawType.length === 0) {\n continue;\n }\n if (!Array.isArray(entry?.allowed_transitions)) {\n continue;\n }\n const typeKey = rawType.toLowerCase();\n const pairs = entry.allowed_transitions;\n const record = byTypeKey.get(typeKey) ?? { type: rawType, pairs: [], denyAll: false };\n // Only an explicitly empty array signals an intentional deny-all.\n if (pairs.length === 0) {\n record.denyAll = true;\n }\n for (const pair of pairs) {\n if (!Array.isArray(pair) || pair.length !== 2) {\n continue;\n }\n const from = normalizeStatusToken(pair[0]);\n const to = normalizeStatusToken(pair[1]);\n if (from.length === 0 || to.length === 0) {\n continue;\n }\n if (record.pairs.some((candidate) => candidate[0] === from && candidate[1] === to)) {\n continue;\n }\n record.pairs.push([from, to]);\n }\n byTypeKey.set(typeKey, record);\n }\n const normalized: TypeWorkflowDefinition[] = [];\n for (const record of byTypeKey.values()) {\n // Keep when there is at least one valid transition OR an explicit deny-all was\n // declared; drop nonempty-but-all-malformed entries (treated as typos).\n if (record.pairs.length > 0 || record.denyAll) {\n normalized.push({ type: record.type, allowed_transitions: record.pairs });\n }\n }\n normalized.sort((left, right) => left.type.localeCompare(right.type));\n return normalized.length > 0 ? normalized : undefined;\n}\n\nfunction normalizeRuntimeFieldDefinition(definition: RuntimeFieldDefinition): RuntimeFieldDefinitionResolved | null {\n const key = normalizeStatusToken(definition.key ?? \"\");\n if (!key) {\n return null;\n }\n const metadataKey = normalizeStatusToken(definition.metadata_key ?? definition.front_matter_key ?? key);\n const cliFlag = normalizeCliToken(definition.cli_flag ?? keyToDefaultCliFlag(key));\n if (!cliFlag) {\n return null;\n }\n const cliAliases = normalizeStringList(definition.cli_aliases)\n .map((value) => normalizeCliToken(value))\n .filter((value) => value.length > 0 && value !== cliFlag);\n const typeCandidate = typeof definition.type === \"string\" ? definition.type.trim().toLowerCase() : \"string\";\n const type = RUNTIME_FIELD_TYPE_SET.has(typeCandidate) ? (typeCandidate as RuntimeFieldType) : \"string\";\n const commands = (() => {\n const normalized = normalizeStringList(definition.commands).filter((value): value is RuntimeFieldCommand =>\n RUNTIME_FIELD_COMMAND_SET.has(value),\n );\n if (normalized.length > 0) {\n return normalized;\n }\n return [...DEFAULT_RUNTIME_FIELD_COMMANDS];\n })();\n const description = definition.description?.trim();\n const requiredTypes = normalizeStringList(definition.required_types);\n return {\n key,\n metadata_key: metadataKey,\n cli_flag: cliFlag,\n cli_aliases: cliAliases,\n description: description && description.length > 0 ? description : undefined,\n type,\n commands,\n repeatable: definition.repeatable === true || type === \"string_array\",\n required: definition.required === true,\n required_on_create: definition.required_on_create === true,\n required_types: requiredTypes,\n allow_unset: definition.allow_unset !== false,\n };\n}\n\nexport function normalizeRuntimeSchemaSettings(schema: Partial<RuntimeSchemaSettings> | undefined): RuntimeSchemaSettings {\n const files = {\n ...DEFAULT_RUNTIME_SCHEMA_FILE_PATHS,\n ...(schema?.files ?? {}),\n };\n const statusesSource = schema?.statuses && schema.statuses.length > 0 ? schema.statuses : DEFAULT_RUNTIME_STATUS_DEFINITIONS;\n const normalizedStatuses = (() => {\n const dedupedById = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const [index, definition] of statusesSource.entries()) {\n const normalized = normalizeRuntimeStatusDefinition(definition, index);\n if (!normalized) {\n continue;\n }\n dedupedById.set(normalized.id, normalized);\n }\n const values = [...dedupedById.values()].sort((left, right) =>\n left.order === right.order ? left.id.localeCompare(right.id) : left.order - right.order,\n );\n if (values.length > 0) {\n return values;\n }\n return DEFAULT_RUNTIME_STATUS_DEFINITIONS.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n })();\n const normalizedFields = (() => {\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n for (const definition of schema?.fields ?? []) {\n const normalized = normalizeRuntimeFieldDefinition(definition);\n if (!normalized) {\n continue;\n }\n dedupedByKey.set(normalized.key, normalized);\n }\n return [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n })();\n const unknownFieldPolicyCandidate =\n typeof schema?.unknown_field_policy === \"string\" ? schema.unknown_field_policy.trim().toLowerCase() : \"allow\";\n const unknownFieldPolicy = RUNTIME_UNKNOWN_FIELD_POLICY_SET.has(unknownFieldPolicyCandidate)\n ? unknownFieldPolicyCandidate\n : \"allow\";\n return {\n version: typeof schema?.version === \"number\" && Number.isFinite(schema.version) ? Math.floor(schema.version) : 1,\n files,\n statuses: normalizedStatuses.map((definition) => ({\n id: definition.id,\n aliases: definition.aliases.length > 0 ? [...definition.aliases] : undefined,\n roles: definition.roles.length > 0 ? [...definition.roles] : undefined,\n description: definition.description,\n order: definition.order,\n })),\n fields: normalizedFields.map((definition) => ({\n key: definition.key,\n metadata_key: definition.metadata_key !== definition.key ? definition.metadata_key : undefined,\n cli_flag: definition.cli_flag !== keyToDefaultCliFlag(definition.key) ? definition.cli_flag : undefined,\n cli_aliases: definition.cli_aliases.length > 0 ? [...definition.cli_aliases] : undefined,\n description: definition.description,\n type: definition.type,\n commands: [...definition.commands],\n repeatable: definition.repeatable === true ? true : undefined,\n required: definition.required === true ? true : undefined,\n required_on_create: definition.required_on_create === true ? true : undefined,\n required_types: definition.required_types.length > 0 ? [...definition.required_types] : undefined,\n allow_unset: definition.allow_unset === false ? false : undefined,\n })),\n workflow: {\n ...DEFAULT_RUNTIME_WORKFLOW,\n ...normalizeRuntimeWorkflow(schema?.workflow),\n },\n type_workflows: normalizeTypeWorkflowDefinitions(schema?.type_workflows),\n unknown_field_policy: unknownFieldPolicy as RuntimeSchemaSettings[\"unknown_field_policy\"],\n };\n}\n\nfunction serializeJson(value: unknown): string {\n return `${JSON.stringify(value, null, 2)}\\n`;\n}\n\nfunction buildTypesFileSeed(): unknown {\n return {\n definitions: [],\n };\n}\n\nfunction buildStatusesFileSeed(): unknown {\n return {\n statuses: DEFAULT_RUNTIME_STATUS_DEFINITIONS,\n };\n}\n\nfunction buildFieldsFileSeed(): unknown {\n return {\n fields: [],\n };\n}\n\nfunction buildWorkflowsFileSeed(): unknown {\n return {\n workflow: DEFAULT_RUNTIME_WORKFLOW,\n };\n}\n\nfunction parseOptionalJson(raw: string, warningKey: string, warnings: string[]): unknown | undefined {\n try {\n return JSON.parse(raw) as unknown;\n } catch {\n warnings.push(warningKey);\n return undefined;\n }\n}\n\nfunction readTypeDefinitionsFromSchemaFile(parsed: unknown): ItemTypeDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as ItemTypeDefinition[];\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 as ItemTypeDefinition[];\n }\n if (typeof record.item_types === \"object\" && record.item_types !== null) {\n const itemTypesRecord = record.item_types as Record<string, unknown>;\n if (Array.isArray(itemTypesRecord.definitions)) {\n return itemTypesRecord.definitions as ItemTypeDefinition[];\n }\n }\n return undefined;\n}\n\nfunction readStatusesFromSchemaFile(parsed: unknown): RuntimeStatusDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeStatusDefinition[];\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.statuses)) {\n return record.statuses as RuntimeStatusDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeStatusDefinition[];\n }\n return undefined;\n}\n\nfunction readFieldsFromSchemaFile(parsed: unknown): RuntimeFieldDefinition[] | undefined {\n if (Array.isArray(parsed)) {\n return parsed as RuntimeFieldDefinition[];\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 as RuntimeFieldDefinition[];\n }\n if (Array.isArray(record.definitions)) {\n return record.definitions as RuntimeFieldDefinition[];\n }\n return undefined;\n}\n\nfunction readWorkflowFromSchemaFile(parsed: unknown): RuntimeWorkflowDefinition | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (typeof record.workflow === \"object\" && record.workflow !== null && !Array.isArray(record.workflow)) {\n return record.workflow as RuntimeWorkflowDefinition;\n }\n if (typeof record.workflows === \"object\" && record.workflows !== null && !Array.isArray(record.workflows)) {\n return record.workflows as RuntimeWorkflowDefinition;\n }\n return record as RuntimeWorkflowDefinition;\n}\n\nfunction readTypeWorkflowsFromSchemaFile(parsed: unknown): TypeWorkflowDefinition[] | undefined {\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n return undefined;\n }\n const record = parsed as Record<string, unknown>;\n if (Array.isArray(record.type_workflows)) {\n return record.type_workflows as TypeWorkflowDefinition[];\n }\n return undefined;\n}\n\nexport function filePathForSchemaSection(pmRoot: string, configuredPath: string | undefined, fallbackPath: string): string {\n const normalized = configuredPath?.trim() || fallbackPath;\n if (path.isAbsolute(normalized)) {\n return normalized;\n }\n return path.join(pmRoot, normalized);\n}\n\n/**\n * Resolves the active tracker's `schema/types.json` path so user-facing hints\n * (e.g. the invalid-type error) point at the real `--pm-path` location instead\n * of the hardcoded `.agents/pm` default. Mirrors how `pm schema add/remove-type`\n * report their target path.\n */\nexport function resolveItemTypesFilePath(pmRoot: string, schema: RuntimeSchemaSettings): string {\n return filePathForSchemaSection(pmRoot, schema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n}\n\nexport async function ensureRuntimeSchemaFileScaffold(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<RuntimeSchemaFileBootstrapResult> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const specs: Array<{ path: string; seed: unknown }> = [\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types),\n seed: buildTypesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.statuses, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses),\n seed: buildStatusesFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields),\n seed: buildFieldsFileSeed(),\n },\n {\n path: filePathForSchemaSection(pmRoot, normalizedSchema.files.workflows, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows),\n seed: buildWorkflowsFileSeed(),\n },\n ];\n const createdPaths: string[] = [];\n for (const spec of specs) {\n if (await pathExists(spec.path)) {\n continue;\n }\n await writeFileAtomic(spec.path, serializeJson(spec.seed));\n createdPaths.push(spec.path);\n }\n return {\n created_paths: createdPaths,\n };\n}\n\nexport async function loadRuntimeSchemaFromOptionalFiles(\n pmRoot: string,\n schema: RuntimeSchemaSettings,\n): Promise<LoadedRuntimeSchemaSections> {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const warnings: string[] = [];\n const typeFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.types, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.types);\n const statusFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.statuses,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.statuses,\n );\n const fieldsFilePath = filePathForSchemaSection(pmRoot, normalizedSchema.files.fields, DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.fields);\n const workflowsFilePath = filePathForSchemaSection(\n pmRoot,\n normalizedSchema.files.workflows,\n DEFAULT_RUNTIME_SCHEMA_FILE_PATHS.workflows,\n );\n\n let loadedTypeDefinitions: ItemTypeDefinition[] | undefined;\n let loadedStatuses: RuntimeStatusDefinition[] | undefined;\n let loadedFields: RuntimeFieldDefinition[] | undefined;\n let loadedWorkflow: RuntimeWorkflowDefinition | undefined;\n let loadedTypeWorkflows: TypeWorkflowDefinition[] | undefined;\n\n const readAndParse = async (targetPath: string, warningKey: string): Promise<unknown | undefined> => {\n const raw = await readFileIfExists(targetPath);\n if (raw === null) {\n return undefined;\n }\n return parseOptionalJson(raw, warningKey, warnings);\n };\n\n const parsedTypes = await readAndParse(typeFilePath, \"runtime_schema_types_invalid_json\");\n if (parsedTypes !== undefined) {\n loadedTypeDefinitions = readTypeDefinitionsFromSchemaFile(parsedTypes);\n if (loadedTypeDefinitions === undefined) {\n warnings.push(\"runtime_schema_types_invalid_shape\");\n }\n }\n\n const parsedStatuses = await readAndParse(statusFilePath, \"runtime_schema_statuses_invalid_json\");\n if (parsedStatuses !== undefined) {\n loadedStatuses = readStatusesFromSchemaFile(parsedStatuses);\n if (loadedStatuses === undefined) {\n warnings.push(\"runtime_schema_statuses_invalid_shape\");\n }\n }\n\n const parsedFields = await readAndParse(fieldsFilePath, \"runtime_schema_fields_invalid_json\");\n if (parsedFields !== undefined) {\n loadedFields = readFieldsFromSchemaFile(parsedFields);\n if (loadedFields === undefined) {\n warnings.push(\"runtime_schema_fields_invalid_shape\");\n }\n }\n\n const parsedWorkflow = await readAndParse(workflowsFilePath, \"runtime_schema_workflows_invalid_json\");\n if (parsedWorkflow !== undefined) {\n loadedWorkflow = readWorkflowFromSchemaFile(parsedWorkflow);\n if (loadedWorkflow === undefined) {\n warnings.push(\"runtime_schema_workflows_invalid_shape\");\n }\n // type_workflows live alongside `workflow` in the same file; their absence\n // is not an error (the file may carry only the lifecycle workflow block).\n loadedTypeWorkflows = readTypeWorkflowsFromSchemaFile(parsedWorkflow);\n }\n\n const mergedSchema = normalizeRuntimeSchemaSettings({\n ...normalizedSchema,\n statuses: [...normalizedSchema.statuses, ...(loadedStatuses ?? [])],\n fields: [...normalizedSchema.fields, ...(loadedFields ?? [])],\n workflow: {\n ...normalizedSchema.workflow,\n ...(loadedWorkflow ?? {}),\n },\n type_workflows: [...(normalizedSchema.type_workflows ?? []), ...(loadedTypeWorkflows ?? [])],\n });\n\n return {\n schema: mergedSchema,\n type_definitions_from_file: loadedTypeDefinitions,\n warnings,\n created_paths: [],\n };\n}\n\nfunction preferredStatusForRole(\n definitions: RuntimeStatusDefinitionResolved[],\n role: RuntimeStatusRole,\n fallbackValues: string[],\n): string | undefined {\n const withRole = definitions.filter((definition) => definition.roles.includes(role));\n if (withRole.length > 0) {\n return withRole[0].id;\n }\n const normalizedFallbacks = fallbackValues\n .map((value) => normalizeStatusId(value))\n .filter((value): value is string => typeof value === \"string\");\n for (const normalized of normalizedFallbacks) {\n if (definitions.some((definition) => definition.id === normalized)) {\n return normalized;\n }\n }\n return definitions[0]?.id;\n}\n\nexport function resolveRuntimeStatusRegistry(schema: RuntimeSchemaSettings): RuntimeStatusRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const definitions = normalizedSchema.statuses.map((definition, index) =>\n normalizeRuntimeStatusDefinition(definition, index),\n ).filter((definition): definition is RuntimeStatusDefinitionResolved => definition !== null);\n const aliasToId = new Map<string, string>();\n const byId = new Map<string, RuntimeStatusDefinitionResolved>();\n for (const definition of definitions) {\n byId.set(definition.id, definition);\n aliasToId.set(definition.id, definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(definition.id.replaceAll(\"_\", \" \"), definition.id);\n for (const alias of definition.aliases) {\n aliasToId.set(alias, definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \"-\"), definition.id);\n aliasToId.set(alias.replaceAll(\"_\", \" \"), definition.id);\n }\n }\n const terminalStatuses = new Set<string>();\n const terminalDoneStatuses = new Set<string>();\n const terminalCanceledStatuses = new Set<string>();\n const activeStatuses = new Set<string>();\n const blockedStatuses = new Set<string>();\n const draftStatuses = new Set<string>();\n for (const definition of definitions) {\n const roles = new Set(definition.roles);\n if (roles.has(\"terminal\") || roles.has(\"terminal_done\") || roles.has(\"terminal_canceled\")) {\n terminalStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_done\")) {\n terminalDoneStatuses.add(definition.id);\n }\n if (roles.has(\"terminal_canceled\")) {\n terminalCanceledStatuses.add(definition.id);\n }\n if (roles.has(\"active\")) {\n activeStatuses.add(definition.id);\n }\n if (roles.has(\"blocked\")) {\n blockedStatuses.add(definition.id);\n }\n if (roles.has(\"draft\")) {\n draftStatuses.add(definition.id);\n }\n }\n const workflow = normalizedSchema.workflow;\n const openStatus =\n normalizeStatusId(workflow.open_status) ??\n preferredStatusForRole(definitions, \"default_open\", [\"open\", \"in_progress\", STATUS_VALUES[0]]);\n const closeStatus =\n normalizeStatusId(workflow.close_status) ??\n preferredStatusForRole(definitions, \"default_close\", [\"closed\", \"done\", \"complete\"]);\n const canceledStatus =\n normalizeStatusId(workflow.canceled_status) ??\n preferredStatusForRole(definitions, \"default_cancel\", [\"canceled\", \"cancelled\"]);\n\n return {\n definitions,\n by_id: byId,\n alias_to_id: aliasToId,\n terminal_statuses: terminalStatuses,\n terminal_done_statuses: terminalDoneStatuses,\n terminal_canceled_statuses: terminalCanceledStatuses,\n active_statuses: activeStatuses,\n blocked_statuses: blockedStatuses,\n draft_statuses: draftStatuses,\n open_status: openStatus as string,\n close_status: closeStatus as string,\n canceled_status: canceledStatus as string,\n };\n}\n\nexport function normalizeStatusInputWithRegistry(value: unknown, registry: RuntimeStatusRegistry): string | undefined {\n const normalized = normalizeStatusToken(value);\n if (!normalized) {\n return undefined;\n }\n return registry.alias_to_id.get(normalized);\n}\n\nexport function resolveRuntimeFieldRegistry(schema: RuntimeSchemaSettings): RuntimeFieldRegistry {\n const normalizedSchema = normalizeRuntimeSchemaSettings(schema);\n const dedupedByKey = new Map<string, RuntimeFieldDefinitionResolved>();\n const normalizedFields = normalizedSchema.fields\n .map((definition) => normalizeRuntimeFieldDefinition(definition))\n .filter((definition): definition is RuntimeFieldDefinitionResolved => definition !== null);\n for (const normalized of normalizedFields) {\n dedupedByKey.set(normalized.key, normalized);\n }\n const definitions = [...dedupedByKey.values()].sort((left, right) => left.key.localeCompare(right.key));\n const byKey = new Map<string, RuntimeFieldDefinitionResolved>();\n const byCliToken = new Map<string, RuntimeFieldDefinitionResolved>();\n const commandToFields = new Map<RuntimeFieldCommand, RuntimeFieldDefinitionResolved[]>();\n for (const definition of definitions) {\n byKey.set(definition.key, definition);\n byCliToken.set(definition.cli_flag, definition);\n for (const alias of definition.cli_aliases) {\n byCliToken.set(alias, definition);\n }\n for (const command of definition.commands) {\n const existing = commandToFields.get(command) ?? [];\n existing.push(definition);\n commandToFields.set(command, existing);\n }\n }\n for (const [command, fieldDefinitions] of commandToFields.entries()) {\n fieldDefinitions.sort((left, right) => left.key.localeCompare(right.key));\n commandToFields.set(command, fieldDefinitions);\n }\n return {\n definitions,\n by_key: byKey,\n by_cli_token: byCliToken,\n command_to_fields: commandToFields,\n };\n}\n\nexport function runtimeFieldOptionTarget(field: RuntimeFieldDefinitionResolved): string {\n return toCamelCase(field.key);\n}\n\nexport function statusIsTerminal(status: string, registry: RuntimeStatusRegistry): boolean {\n const normalized = normalizeStatusInputWithRegistry(status, registry);\n if (!normalized) {\n return false;\n }\n return registry.terminal_statuses.has(normalized);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,wBAA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,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;AACpD,CAAC","debugId":"b2eb7998-c31b-5482-a06a-702127583881"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface InferredTypeCandidate {
|
|
2
|
+
/** Suggested PascalCase type name derived from the prefix. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The normalized prefix token (lowercase) the items share. */
|
|
5
|
+
prefix: string;
|
|
6
|
+
/** How many scanned titles carry this prefix. */
|
|
7
|
+
count: number;
|
|
8
|
+
/** A few example titles (capped) for human/agent review. */
|
|
9
|
+
examples: string[];
|
|
10
|
+
/** True when `name` already resolves to a reserved built-in type. */
|
|
11
|
+
shadows_builtin: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface InferTypesOptions {
|
|
14
|
+
/** Minimum number of titles that must share a prefix to surface it (default 10). */
|
|
15
|
+
minCount?: number;
|
|
16
|
+
/** Maximum example titles retained per candidate (default 3). */
|
|
17
|
+
maxExamples?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Extracts the leading prefix token from a title, or undefined when the title has
|
|
21
|
+
* no stable letter-led `PREFIX-`/`PREFIX:` convention.
|
|
22
|
+
*/
|
|
23
|
+
export declare function extractTitlePrefix(title: string): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Converts a normalized prefix token into a PascalCase type name. Internal
|
|
26
|
+
* hyphen/underscore runs become word boundaries; each word is capitalized.
|
|
27
|
+
*/
|
|
28
|
+
export declare function prefixToTypeName(prefix: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Scans titles for shared prefix conventions and returns candidate custom types,
|
|
31
|
+
* sorted by descending frequency then name. Only prefixes carried by at least
|
|
32
|
+
* `minCount` titles are returned.
|
|
33
|
+
*/
|
|
34
|
+
export declare function inferTypesFromTitles(titles: string[], options?: InferTypesOptions): InferredTypeCandidate[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7ded2b63-46ff-5a7e-a47f-5a4488da1cae")}catch(e){}}();
|
|
3
|
+
import { matchBuiltinTypeName } from "./item-types-file.js";
|
|
4
|
+
/**
|
|
5
|
+
* Pure logic for `pm schema add-type --infer`: scan existing item titles for
|
|
6
|
+
* stable `PREFIX-`/`PREFIX:` conventions and propose them as custom item types.
|
|
7
|
+
* The CLI command file (schema.ts) owns IO and the optional registration; this
|
|
8
|
+
* module only derives candidates from a list of titles so it is fully testable
|
|
9
|
+
* and coverage-gated to 100%.
|
|
10
|
+
*
|
|
11
|
+
* Conventions recognized (case-insensitive, first run wins per title):
|
|
12
|
+
* - `INFRA- ...` / `SECURITY-...` (hyphen-delimited prefix)
|
|
13
|
+
* - `BUG: ...` / `SPIKE: ...` (colon-delimited prefix)
|
|
14
|
+
* The prefix token must be a letter-led identifier of letters, digits, and
|
|
15
|
+
* internal hyphens/underscores so it maps cleanly to a single PascalCase type
|
|
16
|
+
* name. Purely numeric or sequence-style prefixes (e.g. `S001-`, `E12-`) are
|
|
17
|
+
* intentionally skipped: they index items, they are not type boundaries.
|
|
18
|
+
*/
|
|
19
|
+
const PREFIX_PATTERN = /^([A-Za-z][A-Za-z0-9_-]*?)\s*[-:]\s+\S/;
|
|
20
|
+
/**
|
|
21
|
+
* Extracts the leading prefix token from a title, or undefined when the title has
|
|
22
|
+
* no stable letter-led `PREFIX-`/`PREFIX:` convention.
|
|
23
|
+
*/
|
|
24
|
+
export function extractTitlePrefix(title) {
|
|
25
|
+
const match = PREFIX_PATTERN.exec(title.trim());
|
|
26
|
+
if (!match) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
const token = match[1];
|
|
30
|
+
// Reject single-character prefixes (e.g. "S-", "E-"): they are sequence/index
|
|
31
|
+
// markers far more often than genuine type boundaries.
|
|
32
|
+
if (token.length < 2) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
// Reject sequence/index-style prefixes — a single leading letter followed by
|
|
36
|
+
// only digits (e.g. "S001-", "E12-", "V1-"). These index items rather than
|
|
37
|
+
// mark a type boundary, matching the convention documented above.
|
|
38
|
+
if (/^[A-Za-z]\d+$/.test(token)) {
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
return token.toLowerCase();
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Converts a normalized prefix token into a PascalCase type name. Internal
|
|
45
|
+
* hyphen/underscore runs become word boundaries; each word is capitalized.
|
|
46
|
+
*/
|
|
47
|
+
export function prefixToTypeName(prefix) {
|
|
48
|
+
return prefix
|
|
49
|
+
.split(/[-_]+/)
|
|
50
|
+
.filter((segment) => segment.length > 0)
|
|
51
|
+
.map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1).toLowerCase()}`)
|
|
52
|
+
.join("");
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Scans titles for shared prefix conventions and returns candidate custom types,
|
|
56
|
+
* sorted by descending frequency then name. Only prefixes carried by at least
|
|
57
|
+
* `minCount` titles are returned.
|
|
58
|
+
*/
|
|
59
|
+
export function inferTypesFromTitles(titles, options = {}) {
|
|
60
|
+
const minCount = typeof options.minCount === "number" && options.minCount > 0 ? Math.trunc(options.minCount) : 10;
|
|
61
|
+
const maxExamples = typeof options.maxExamples === "number" && options.maxExamples > 0 ? Math.trunc(options.maxExamples) : 3;
|
|
62
|
+
const byPrefix = new Map();
|
|
63
|
+
for (const rawTitle of titles) {
|
|
64
|
+
const title = typeof rawTitle === "string" ? rawTitle.trim() : "";
|
|
65
|
+
if (title.length === 0) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const prefix = extractTitlePrefix(title);
|
|
69
|
+
if (prefix === undefined) {
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
const bucket = byPrefix.get(prefix) ?? { count: 0, examples: [] };
|
|
73
|
+
bucket.count += 1;
|
|
74
|
+
if (bucket.examples.length < maxExamples) {
|
|
75
|
+
bucket.examples.push(title);
|
|
76
|
+
}
|
|
77
|
+
byPrefix.set(prefix, bucket);
|
|
78
|
+
}
|
|
79
|
+
const candidates = [];
|
|
80
|
+
for (const [prefix, bucket] of byPrefix.entries()) {
|
|
81
|
+
if (bucket.count < minCount) {
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
const name = prefixToTypeName(prefix);
|
|
85
|
+
candidates.push({
|
|
86
|
+
name,
|
|
87
|
+
prefix,
|
|
88
|
+
count: bucket.count,
|
|
89
|
+
examples: bucket.examples,
|
|
90
|
+
shadows_builtin: matchBuiltinTypeName(name) !== undefined,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
candidates.sort((left, right) => (right.count - left.count) || left.name.localeCompare(right.name));
|
|
94
|
+
return candidates;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=type-inference.js.map
|
|
97
|
+
//# debugId=7ded2b63-46ff-5a7e-a47f-5a4488da1cae
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-inference.js","sources":["core/schema/type-inference.ts"],"sourceRoot":"/","sourcesContent":["import { matchBuiltinTypeName } from \"./item-types-file.js\";\n\n/**\n * Pure logic for `pm schema add-type --infer`: scan existing item titles for\n * stable `PREFIX-`/`PREFIX:` conventions and propose them as custom item types.\n * The CLI command file (schema.ts) owns IO and the optional registration; this\n * module only derives candidates from a list of titles so it is fully testable\n * and coverage-gated to 100%.\n *\n * Conventions recognized (case-insensitive, first run wins per title):\n * - `INFRA- ...` / `SECURITY-...` (hyphen-delimited prefix)\n * - `BUG: ...` / `SPIKE: ...` (colon-delimited prefix)\n * The prefix token must be a letter-led identifier of letters, digits, and\n * internal hyphens/underscores so it maps cleanly to a single PascalCase type\n * name. Purely numeric or sequence-style prefixes (e.g. `S001-`, `E12-`) are\n * intentionally skipped: they index items, they are not type boundaries.\n */\n\nconst PREFIX_PATTERN = /^([A-Za-z][A-Za-z0-9_-]*?)\\s*[-:]\\s+\\S/;\n\nexport interface InferredTypeCandidate {\n /** Suggested PascalCase type name derived from the prefix. */\n name: string;\n /** The normalized prefix token (lowercase) the items share. */\n prefix: string;\n /** How many scanned titles carry this prefix. */\n count: number;\n /** A few example titles (capped) for human/agent review. */\n examples: string[];\n /** True when `name` already resolves to a reserved built-in type. */\n shadows_builtin: boolean;\n}\n\nexport interface InferTypesOptions {\n /** Minimum number of titles that must share a prefix to surface it (default 10). */\n minCount?: number;\n /** Maximum example titles retained per candidate (default 3). */\n maxExamples?: number;\n}\n\n/**\n * Extracts the leading prefix token from a title, or undefined when the title has\n * no stable letter-led `PREFIX-`/`PREFIX:` convention.\n */\nexport function extractTitlePrefix(title: string): string | undefined {\n const match = PREFIX_PATTERN.exec(title.trim());\n if (!match) {\n return undefined;\n }\n const token = match[1];\n // Reject single-character prefixes (e.g. \"S-\", \"E-\"): they are sequence/index\n // markers far more often than genuine type boundaries.\n if (token.length < 2) {\n return undefined;\n }\n // Reject sequence/index-style prefixes — a single leading letter followed by\n // only digits (e.g. \"S001-\", \"E12-\", \"V1-\"). These index items rather than\n // mark a type boundary, matching the convention documented above.\n if (/^[A-Za-z]\\d+$/.test(token)) {\n return undefined;\n }\n return token.toLowerCase();\n}\n\n/**\n * Converts a normalized prefix token into a PascalCase type name. Internal\n * hyphen/underscore runs become word boundaries; each word is capitalized.\n */\nexport function prefixToTypeName(prefix: string): string {\n return prefix\n .split(/[-_]+/)\n .filter((segment) => segment.length > 0)\n .map((segment) => `${segment.slice(0, 1).toUpperCase()}${segment.slice(1).toLowerCase()}`)\n .join(\"\");\n}\n\n/**\n * Scans titles for shared prefix conventions and returns candidate custom types,\n * sorted by descending frequency then name. Only prefixes carried by at least\n * `minCount` titles are returned.\n */\nexport function inferTypesFromTitles(titles: string[], options: InferTypesOptions = {}): InferredTypeCandidate[] {\n const minCount = typeof options.minCount === \"number\" && options.minCount > 0 ? Math.trunc(options.minCount) : 10;\n const maxExamples = typeof options.maxExamples === \"number\" && options.maxExamples > 0 ? Math.trunc(options.maxExamples) : 3;\n const byPrefix = new Map<string, { count: number; examples: string[] }>();\n for (const rawTitle of titles) {\n const title = typeof rawTitle === \"string\" ? rawTitle.trim() : \"\";\n if (title.length === 0) {\n continue;\n }\n const prefix = extractTitlePrefix(title);\n if (prefix === undefined) {\n continue;\n }\n const bucket = byPrefix.get(prefix) ?? { count: 0, examples: [] };\n bucket.count += 1;\n if (bucket.examples.length < maxExamples) {\n bucket.examples.push(title);\n }\n byPrefix.set(prefix, bucket);\n }\n const candidates: InferredTypeCandidate[] = [];\n for (const [prefix, bucket] of byPrefix.entries()) {\n if (bucket.count < minCount) {\n continue;\n }\n const name = prefixToTypeName(prefix);\n candidates.push({\n name,\n prefix,\n count: bucket.count,\n examples: bucket.examples,\n shadows_builtin: matchBuiltinTypeName(name) !== undefined,\n });\n }\n candidates.sort((left, right) => (right.count - left.count) || left.name.localeCompare(right.name));\n return candidates;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AAEH,MAAM,cAAc,GAAG,wCAAwC,CAAC;AAsBhE;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,8EAA8E;IAC9E,uDAAuD;IACvD,IAAI,KAAK,CAAC,MAAM,GA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,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IACpG,OAAO,UAAU,CAAC;AACpB,CAAC","debugId":"7ded2b63-46ff-5a7e-a47f-5a4488da1cae"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NormalizedAddTypeInput, type RawAddTypeInput } from "./item-types-file.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shared domain item-type presets. These power both `pm init --type-preset`
|
|
4
|
+
* (registered during initialization) and the standalone `pm schema apply-preset`
|
|
5
|
+
* subcommand (adopting a preset into an already-initialized project). Keeping the
|
|
6
|
+
* raw definitions and the preset-name normalizer in one place guarantees init and
|
|
7
|
+
* schema register byte-identical types.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TYPE_PRESET_NAMES: readonly ["agile", "ops", "research"];
|
|
10
|
+
export type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];
|
|
11
|
+
/**
|
|
12
|
+
* Raw (pre-normalization) preset definitions keyed by preset name. Each entry is
|
|
13
|
+
* fed through {@link normalizeAddTypeInput} before being upserted so the same
|
|
14
|
+
* validation/normalization the `pm schema add-type` CLI applies governs preset
|
|
15
|
+
* registration too.
|
|
16
|
+
*/
|
|
17
|
+
export declare const TYPE_PRESET_DEFINITIONS: Record<TypePresetName, RawAddTypeInput[]>;
|
|
18
|
+
/**
|
|
19
|
+
* Validates and normalizes a raw preset-name CLI value. Returns `undefined` when
|
|
20
|
+
* the value is omitted (no preset requested). Throws a plain Error with a stable
|
|
21
|
+
* message for an empty or unknown preset; CLI layers map it to a USAGE exit code.
|
|
22
|
+
* Accepts hyphen/underscore-insensitive casing for ergonomics.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizeTypePresetName(rawValue: string | undefined): TypePresetName | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the normalized add-type inputs for a preset, in the order they should
|
|
27
|
+
* be upserted. Each raw definition is run through normalizeAddTypeInput so callers
|
|
28
|
+
* get the same validated shape as an individual `add-type` invocation.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveTypePresetDefinitions(preset: TypePresetName): NormalizedAddTypeInput[];
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="435e9450-a234-54ff-b34e-a992acb16c4e")}catch(e){}}();
|
|
3
|
+
import { normalizeAddTypeInput } from "./item-types-file.js";
|
|
4
|
+
/**
|
|
5
|
+
* Shared domain item-type presets. These power both `pm init --type-preset`
|
|
6
|
+
* (registered during initialization) and the standalone `pm schema apply-preset`
|
|
7
|
+
* subcommand (adopting a preset into an already-initialized project). Keeping the
|
|
8
|
+
* raw definitions and the preset-name normalizer in one place guarantees init and
|
|
9
|
+
* schema register byte-identical types.
|
|
10
|
+
*/
|
|
11
|
+
export const TYPE_PRESET_NAMES = ["agile", "ops", "research"];
|
|
12
|
+
/**
|
|
13
|
+
* Raw (pre-normalization) preset definitions keyed by preset name. Each entry is
|
|
14
|
+
* fed through {@link normalizeAddTypeInput} before being upserted so the same
|
|
15
|
+
* validation/normalization the `pm schema add-type` CLI applies governs preset
|
|
16
|
+
* registration too.
|
|
17
|
+
*/
|
|
18
|
+
export const TYPE_PRESET_DEFINITIONS = {
|
|
19
|
+
agile: [
|
|
20
|
+
{
|
|
21
|
+
name: "Story",
|
|
22
|
+
description: "User-facing outcome or capability slice expressed from a stakeholder perspective.",
|
|
23
|
+
defaultStatus: "open",
|
|
24
|
+
folder: "stories",
|
|
25
|
+
aliases: ["user-story"],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "Spike",
|
|
29
|
+
description: "Time-boxed investigation used to reduce uncertainty before implementation.",
|
|
30
|
+
defaultStatus: "open",
|
|
31
|
+
folder: "spikes",
|
|
32
|
+
aliases: ["research-spike"],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
ops: [
|
|
36
|
+
{
|
|
37
|
+
name: "Incident",
|
|
38
|
+
description: "Operational disruption, degradation, or support escalation with recovery tracking.",
|
|
39
|
+
defaultStatus: "open",
|
|
40
|
+
folder: "incidents",
|
|
41
|
+
aliases: ["outage"],
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "Runbook",
|
|
45
|
+
description: "Repeatable operational procedure, diagnostic path, or response playbook.",
|
|
46
|
+
defaultStatus: "open",
|
|
47
|
+
folder: "runbooks",
|
|
48
|
+
aliases: ["playbook"],
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
research: [
|
|
52
|
+
{
|
|
53
|
+
name: "Experiment",
|
|
54
|
+
description: "Validated-learning activity with hypothesis, method, and outcome tracking.",
|
|
55
|
+
defaultStatus: "open",
|
|
56
|
+
folder: "experiments",
|
|
57
|
+
aliases: ["study"],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: "Hypothesis",
|
|
61
|
+
description: "Testable claim or assumption that should be supported, rejected, or refined.",
|
|
62
|
+
defaultStatus: "open",
|
|
63
|
+
folder: "hypotheses",
|
|
64
|
+
aliases: ["assumption"],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Validates and normalizes a raw preset-name CLI value. Returns `undefined` when
|
|
70
|
+
* the value is omitted (no preset requested). Throws a plain Error with a stable
|
|
71
|
+
* message for an empty or unknown preset; CLI layers map it to a USAGE exit code.
|
|
72
|
+
* Accepts hyphen/underscore-insensitive casing for ergonomics.
|
|
73
|
+
*/
|
|
74
|
+
export function normalizeTypePresetName(rawValue) {
|
|
75
|
+
if (rawValue === undefined) {
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const normalized = rawValue.trim().toLowerCase().replaceAll("-", "_");
|
|
79
|
+
if (normalized.length === 0) {
|
|
80
|
+
throw new Error("Type preset name must not be empty.");
|
|
81
|
+
}
|
|
82
|
+
if (normalized === "agile" || normalized === "ops" || normalized === "research") {
|
|
83
|
+
return normalized;
|
|
84
|
+
}
|
|
85
|
+
throw new Error(`Invalid type preset "${rawValue}". Allowed: ${TYPE_PRESET_NAMES.join(", ")}.`);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Returns the normalized add-type inputs for a preset, in the order they should
|
|
89
|
+
* be upserted. Each raw definition is run through normalizeAddTypeInput so callers
|
|
90
|
+
* get the same validated shape as an individual `add-type` invocation.
|
|
91
|
+
*/
|
|
92
|
+
export function resolveTypePresetDefinitions(preset) {
|
|
93
|
+
return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) => normalizeAddTypeInput(rawDefinition));
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=type-presets.js.map
|
|
96
|
+
//# debugId=435e9450-a234-54ff-b34e-a992acb16c4e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-presets.js","sources":["core/schema/type-presets.ts"],"sourceRoot":"/","sourcesContent":["import { normalizeAddTypeInput, type NormalizedAddTypeInput, type RawAddTypeInput } from \"./item-types-file.js\";\n\n/**\n * Shared domain item-type presets. These power both `pm init --type-preset`\n * (registered during initialization) and the standalone `pm schema apply-preset`\n * subcommand (adopting a preset into an already-initialized project). Keeping the\n * raw definitions and the preset-name normalizer in one place guarantees init and\n * schema register byte-identical types.\n */\n\nexport const TYPE_PRESET_NAMES = [\"agile\", \"ops\", \"research\"] as const;\nexport type TypePresetName = (typeof TYPE_PRESET_NAMES)[number];\n\n/**\n * Raw (pre-normalization) preset definitions keyed by preset name. Each entry is\n * fed through {@link normalizeAddTypeInput} before being upserted so the same\n * validation/normalization the `pm schema add-type` CLI applies governs preset\n * registration too.\n */\nexport const TYPE_PRESET_DEFINITIONS: Record<TypePresetName, RawAddTypeInput[]> = {\n agile: [\n {\n name: \"Story\",\n description: \"User-facing outcome or capability slice expressed from a stakeholder perspective.\",\n defaultStatus: \"open\",\n folder: \"stories\",\n aliases: [\"user-story\"],\n },\n {\n name: \"Spike\",\n description: \"Time-boxed investigation used to reduce uncertainty before implementation.\",\n defaultStatus: \"open\",\n folder: \"spikes\",\n aliases: [\"research-spike\"],\n },\n ],\n ops: [\n {\n name: \"Incident\",\n description: \"Operational disruption, degradation, or support escalation with recovery tracking.\",\n defaultStatus: \"open\",\n folder: \"incidents\",\n aliases: [\"outage\"],\n },\n {\n name: \"Runbook\",\n description: \"Repeatable operational procedure, diagnostic path, or response playbook.\",\n defaultStatus: \"open\",\n folder: \"runbooks\",\n aliases: [\"playbook\"],\n },\n ],\n research: [\n {\n name: \"Experiment\",\n description: \"Validated-learning activity with hypothesis, method, and outcome tracking.\",\n defaultStatus: \"open\",\n folder: \"experiments\",\n aliases: [\"study\"],\n },\n {\n name: \"Hypothesis\",\n description: \"Testable claim or assumption that should be supported, rejected, or refined.\",\n defaultStatus: \"open\",\n folder: \"hypotheses\",\n aliases: [\"assumption\"],\n },\n ],\n};\n\n/**\n * Validates and normalizes a raw preset-name CLI value. Returns `undefined` when\n * the value is omitted (no preset requested). Throws a plain Error with a stable\n * message for an empty or unknown preset; CLI layers map it to a USAGE exit code.\n * Accepts hyphen/underscore-insensitive casing for ergonomics.\n */\nexport function normalizeTypePresetName(rawValue: string | undefined): TypePresetName | undefined {\n if (rawValue === undefined) {\n return undefined;\n }\n const normalized = rawValue.trim().toLowerCase().replaceAll(\"-\", \"_\");\n if (normalized.length === 0) {\n throw new Error(\"Type preset name must not be empty.\");\n }\n if (normalized === \"agile\" || normalized === \"ops\" || normalized === \"research\") {\n return normalized;\n }\n throw new Error(`Invalid type preset \"${rawValue}\". Allowed: ${TYPE_PRESET_NAMES.join(\", \")}.`);\n}\n\n/**\n * Returns the normalized add-type inputs for a preset, in the order they should\n * be upserted. Each raw definition is run through normalizeAddTypeInput so callers\n * get the same validated shape as an individual `add-type` invocation.\n */\nexport function resolveTypePresetDefinitions(preset: TypePresetName): NormalizedAddTypeInput[] {\n return TYPE_PRESET_DEFINITIONS[preset].map((rawDefinition) => normalizeAddTypeInput(rawDefinition));\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EAAE,qBAAqB,EAAqD,MAAM,sBAAsB,CAAC;AAEhH;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,UAAU,CAAU,CAAC;AAGvE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAA8C;IAChF,KAAK,EAAE;QACL;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,mFAAmF;YAChG,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,SAAS;YACjB,OAAO,EAAE,CAAC,YAAY,CAAC;SACxB;QACD;YACE,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,4EAA4E;YACzF,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE,CAAC,gBAAgB,CAAC;SAC5B;KACF;IACD,GAAG,EAAE;QACH;YACE,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,oFAAoF;YACjG,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,CAAC,QAAQ,CAAC;SACpB;QACD;YACE,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,0EAA0E;YACvF,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,UAAU;YAClB,OAAO,EAAE,CAAC,UAAU,CAAC;SACtB;KACF;IACD,QAAQ,EAAE;QACR;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,4EAA4E;YACzF,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,aAAa;YACrB,OAAO,EAAE,CAAC,OAAO,CAAC;SACnB;QACD;YACE,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,8EAA8E;YAC3F,aAAa,EAAE,MAAM;YACrB,MAAM,EAAE,YAAY;YACpB,OAAO,EAAE,CAAC,YAAY,CAAC;SACxB;KACF;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAA4B;IAClE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,UAAU,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IACtE,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,UAAU,KAAK,OAAO,IAAI,UAAU,KAAK,KAAK,IAAI,UAAU,KAAK,UAAU,EAAE,CAAC;QAChF,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,eAAe,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,4BAA4B,CAAC,MAAsB;IACjE,OAAO,uBAAuB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,EAAE,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,CAAC;AACtG,CAAC","debugId":"435e9450-a234-54ff-b34e-a992acb16c4e"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { readSettings } from "../store/settings.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { EmbeddingProviderConfig } from "./providers.js";
|
|
3
|
+
import type { VectorStoreConfig } from "./vector-stores.js";
|
|
4
|
+
import type { VectorizationEmbeddingIdentity, VectorizationEmbeddingMetadata } from "./vectorization-metadata.js";
|
|
3
5
|
export declare const SEARCH_CACHE_ARTIFACT_PATHS: readonly ["index/manifest.json", "search/embeddings.jsonl"];
|
|
4
6
|
export declare const VECTORIZATION_STATUS_LEDGER_PATH = "search/vectorization-status.json";
|
|
5
7
|
export interface SearchCacheInvalidationResult {
|
|
@@ -35,8 +37,17 @@ export interface VectorizationStatusLedgerReadResult {
|
|
|
35
37
|
embedding: VectorizationEmbeddingMetadata | null;
|
|
36
38
|
warnings: string[];
|
|
37
39
|
}
|
|
40
|
+
declare function normalizeVectorizationLedgerEntries(entries: Record<string, string>): Record<string, string>;
|
|
38
41
|
export declare function readVectorizationStatusLedger(pmRoot: string): Promise<VectorizationStatusLedgerReadResult>;
|
|
39
42
|
export declare function writeVectorizationStatusLedger(pmRoot: string, entries: Record<string, string>, embedding?: VectorizationEmbeddingMetadata | null): Promise<void>;
|
|
43
|
+
interface SemanticRefreshOperationResult {
|
|
44
|
+
refreshed: string[];
|
|
45
|
+
skipped: string[];
|
|
46
|
+
warnings: string[];
|
|
47
|
+
}
|
|
48
|
+
declare function buildVectorizationIdentityForProvider(provider: EmbeddingProviderConfig): VectorizationEmbeddingIdentity;
|
|
49
|
+
declare function buildSkippedSemanticRefreshResult(itemIds: string[], warning: string): SemanticMutationRefreshResult;
|
|
50
|
+
declare function resetSemanticVectorStore(vectorStore: VectorStoreConfig, ledgerEntries: Record<string, string>): Promise<SemanticRefreshOperationResult>;
|
|
40
51
|
export declare function invalidateSearchCacheArtifacts(pmRoot: string): Promise<SearchCacheInvalidationResult>;
|
|
41
52
|
export declare function refreshSemanticEmbeddingsForMutatedItems(pmRoot: string, itemIds: string[], options?: SemanticRefreshOptions): Promise<SemanticMutationRefreshResult>;
|
|
42
53
|
/**
|
|
@@ -48,3 +59,10 @@ export declare function refreshSemanticEmbeddingsForMutatedItems(pmRoot: string,
|
|
|
48
59
|
*/
|
|
49
60
|
export declare function isSemanticRefreshActive(settings: Awaited<ReturnType<typeof readSettings>>, applyRuntimeDefaults: boolean): boolean;
|
|
50
61
|
export declare function refreshSearchArtifactsForMutation(pmRoot: string, itemIds: string[], options?: RefreshSearchArtifactsForMutationOptions): Promise<SearchMutationArtifactRefreshResult>;
|
|
62
|
+
export declare const _testOnly: {
|
|
63
|
+
buildSkippedSemanticRefreshResult: typeof buildSkippedSemanticRefreshResult;
|
|
64
|
+
buildVectorizationIdentityForProvider: typeof buildVectorizationIdentityForProvider;
|
|
65
|
+
normalizeVectorizationLedgerEntries: typeof normalizeVectorizationLedgerEntries;
|
|
66
|
+
resetSemanticVectorStore: typeof resetSemanticVectorStore;
|
|
67
|
+
};
|
|
68
|
+
export {};
|