@unbrained/pm-cli 2026.6.9 → 2026.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +59 -0
- package/README.md +1 -1
- package/dist/cli/bootstrap-args.d.ts +11 -0
- package/dist/cli/bootstrap-args.js +90 -4
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commands/aggregate.d.ts +7 -0
- package/dist/cli/commands/aggregate.js +53 -12
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/close.d.ts +1 -0
- package/dist/cli/commands/close.js +106 -3
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/completion.js +20 -7
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/context.d.ts +9 -0
- package/dist/cli/commands/context.js +149 -20
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +2 -0
- package/dist/cli/commands/contracts.js +9 -2
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +5 -3
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension.js +4 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/health.js +44 -6
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.js +6 -5
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/linked-test-parsers.d.ts +1 -0
- package/dist/cli/commands/linked-test-parsers.js +289 -2
- package/dist/cli/commands/linked-test-parsers.js.map +1 -1
- package/dist/cli/commands/reindex.d.ts +1 -0
- package/dist/cli/commands/reindex.js +33 -4
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/test.d.ts +6 -0
- package/dist/cli/commands/test.js +46 -5
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +8 -0
- package/dist/cli/error-guidance.js +102 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +1 -0
- package/dist/cli/extension-command-help.js +42 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +2 -0
- package/dist/cli/extension-command-options.js +51 -2
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/main.js +26 -26
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +3 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +4 -2
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +15 -6
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/registration-helpers.js +9 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/chunks/{activity-RUJATACW.js → activity-XADJOG6G.js} +11 -11
- package/dist/cli-bundle/chunks/activity-XZIUPGZH.js +16 -0
- package/dist/cli-bundle/chunks/{aggregate-TT7OCHHT.js → aggregate-6OTS3AOO.js} +65 -24
- package/dist/cli-bundle/chunks/aggregate-6OTS3AOO.js.map +1 -0
- package/dist/cli-bundle/chunks/{aggregate-IQ27NFBI.js → aggregate-OD36DJU5.js} +64 -23
- package/dist/cli-bundle/chunks/aggregate-OD36DJU5.js.map +7 -0
- package/dist/cli-bundle/chunks/{append-E7AJ5RTR.js → append-JYWO4P7W.js} +8 -8
- package/dist/cli-bundle/chunks/{append-CWQZBUWV.js → append-KG55G7S3.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-LF2VNLEZ.js → chunk-3KLPFWZ4.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-LF2VNLEZ.js.map → chunk-3KLPFWZ4.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ENCVPOID.js → chunk-3SLOMKCJ.js} +12 -12
- package/dist/cli-bundle/chunks/chunk-4HFU4UO2.js +518 -0
- package/dist/cli-bundle/chunks/chunk-4HFU4UO2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-F2REA7VW.js → chunk-4JCSYR6F.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-CAXUGAAF.js → chunk-4YFAGDRH.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-U3Z4OCZC.js → chunk-5SCT2JCT.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-NHRZSYAA.js → chunk-73ZPG2I3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-D5D7VKIC.js → chunk-7IYFN5R7.js} +6 -5
- package/dist/cli-bundle/chunks/chunk-7IYFN5R7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-A5342JVL.js → chunk-7RIT3OCD.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-LU54Z4QI.js → chunk-7UGSRQCL.js} +76 -74
- package/dist/cli-bundle/chunks/{chunk-LU54Z4QI.js.map → chunk-7UGSRQCL.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-5JF76OJF.js → chunk-A6LXQFO7.js} +290 -25
- package/dist/cli-bundle/chunks/chunk-A6LXQFO7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7CR4GAYN.js → chunk-ATEES5SX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FHUI7AXS.js → chunk-AVGHVVF7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-T7B5VAKD.js → chunk-B65UUCGQ.js} +13 -6
- package/dist/cli-bundle/chunks/chunk-B65UUCGQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-42IULX44.js → chunk-CCX4RSYZ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EFRHTZO4.js → chunk-CW6E4NAT.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-JN3BT7UY.js → chunk-DY6C42S6.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-PUSOAQCR.js → chunk-E5DUIJA4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-E7LOIIFP.js → chunk-ESANVZF4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-WQZCEEQN.js → chunk-EWFY7SLA.js} +157 -12
- package/dist/cli-bundle/chunks/chunk-EWFY7SLA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YI6W2DBN.js → chunk-F75JSIOZ.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-6IGTNFE3.js → chunk-FDH2X65L.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-GPOSGWCN.js → chunk-FXRU333M.js} +68 -7
- package/dist/cli-bundle/chunks/chunk-FXRU333M.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-C72IQIBT.js → chunk-FY4SPXSC.js} +302 -30
- package/dist/cli-bundle/chunks/chunk-FY4SPXSC.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TLD3UYGY.js → chunk-GKIZW7SM.js} +5 -4
- package/dist/cli-bundle/chunks/chunk-GKIZW7SM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YSANBZAE.js → chunk-GWZSYR6X.js} +12 -5
- package/dist/cli-bundle/chunks/chunk-GWZSYR6X.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FJNJEWU4.js → chunk-HGLC63AU.js} +14 -12
- package/dist/cli-bundle/chunks/chunk-HGLC63AU.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RLVI7KDW.js → chunk-HHHJ2GI3.js} +163 -11
- package/dist/cli-bundle/chunks/chunk-HHHJ2GI3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AVGOVJGV.js → chunk-HI7STVF2.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-AVGOVJGV.js.map → chunk-HI7STVF2.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-ANKG2JKL.js → chunk-I2IJY2NL.js} +12 -5
- package/dist/cli-bundle/chunks/chunk-I2IJY2NL.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZPXDD6RQ.js → chunk-I53JBTJW.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-23WNCJBA.js → chunk-I7NYDZDV.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-EQ6N6IDR.js → chunk-IGVJRZ6H.js} +13 -11
- package/dist/cli-bundle/chunks/chunk-IGVJRZ6H.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-JVMAOD54.js → chunk-IH4MBKK7.js} +14 -7
- package/dist/cli-bundle/chunks/chunk-IH4MBKK7.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BIRVSIM2.js → chunk-IKOH24GZ.js} +14 -14
- package/dist/cli-bundle/chunks/chunk-IKOH24GZ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SAUXUI6U.js → chunk-IUKD4W6Z.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3RHE76G6.js → chunk-J3GD64J2.js} +15 -15
- package/dist/cli-bundle/chunks/chunk-J3GD64J2.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-OT6XAMO5.js → chunk-KWAXVAXX.js} +7 -5
- package/dist/cli-bundle/chunks/{chunk-OT6XAMO5.js.map → chunk-KWAXVAXX.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-SD6H3RLA.js → chunk-LCSCXBGT.js} +15 -5
- package/dist/cli-bundle/chunks/{chunk-SD6H3RLA.js.map → chunk-LCSCXBGT.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RKCJ2JMA.js → chunk-OASDW5UI.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-JEGFLKSI.js → chunk-OLKBSY4N.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-4LRVXVJK.js → chunk-P2PSODAQ.js} +70 -9
- package/dist/cli-bundle/chunks/chunk-P2PSODAQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XEOO6K5J.js → chunk-P5BJOMBB.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-P2NVFE4L.js → chunk-P5U5EOMA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-AM2AXVFS.js → chunk-PSD7F7DX.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-VDVVOLR6.js → chunk-QJMGRZO2.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-7YTWXGE3.js → chunk-QKW5D45B.js} +112 -7
- package/dist/cli-bundle/chunks/chunk-QKW5D45B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-T7NWFVOA.js → chunk-QNJSITCX.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-MNXJ6YDO.js → chunk-RXAP6JL5.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-5MMLINZB.js → chunk-S26FESD4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I26E6XA7.js → chunk-S2ZLDYGS.js} +8 -6
- package/dist/cli-bundle/chunks/chunk-S2ZLDYGS.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-SXKNJPQ7.js +528 -0
- package/dist/cli-bundle/chunks/chunk-SXKNJPQ7.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OPYA2HIU.js → chunk-TK5VZFHY.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-4TJWRPIH.js → chunk-TNAP7EJX.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-I4FGL3K2.js → chunk-UOO6BYIA.js} +16 -6
- package/dist/cli-bundle/chunks/chunk-UOO6BYIA.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-5ATRWEZO.js → chunk-UUWGCWBU.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YX5LAKFJ.js → chunk-VAOUX6TK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMTI5R76.js → chunk-VFUZV5EB.js} +111 -6
- package/dist/cli-bundle/chunks/chunk-VFUZV5EB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WCWIDJII.js → chunk-VPEAS7PS.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RE2JQJZJ.js → chunk-VSRZRLG3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-PW7C262O.js → chunk-WUNFKP7M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-BACSNVWE.js → chunk-XJDGS74Y.js} +71 -69
- package/dist/cli-bundle/chunks/{chunk-BACSNVWE.js.map → chunk-XJDGS74Y.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-H37YPWLM.js → chunk-XMBI6TNW.js} +13 -7
- package/dist/cli-bundle/chunks/chunk-XMBI6TNW.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-NUGAWYEN.js → chunk-XTKJSVWH.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KDX6VC3P.js → chunk-XUC4C4PT.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-44JP4PYY.js → chunk-Y3YKK7CY.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KTVXLI54.js → chunk-YW6Q3RYZ.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-I3UILOUU.js → chunk-ZLMIWZUG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FKH7K6YP.js → chunk-ZMW77VWV.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-NJRZIJ4N.js → chunk-ZYNJNPYD.js} +14 -8
- package/dist/cli-bundle/chunks/chunk-ZYNJNPYD.js.map +1 -0
- package/dist/cli-bundle/chunks/{claim-UXFGCF3P.js → claim-2RDYMCTP.js} +10 -10
- package/dist/cli-bundle/chunks/{claim-RV6WYUF7.js → claim-MJ7DZFC3.js} +10 -10
- package/dist/cli-bundle/chunks/close-4FMAPEMY.js +13 -0
- package/dist/cli-bundle/chunks/{close-O4JK2JKD.js → close-XLEKIQSW.js} +8 -8
- package/dist/cli-bundle/chunks/{close-many-EQO4TPIE.js → close-many-AOD4HSAZ.js} +15 -15
- package/dist/cli-bundle/chunks/{close-many-SRDBV3SI.js → close-many-XKAQY5CQ.js} +15 -15
- package/dist/cli-bundle/chunks/{comments-TTZUIB2O.js → comments-B4RWWDJT.js} +10 -10
- package/dist/cli-bundle/chunks/{comments-OMB7YE27.js → comments-RN5TG4ZN.js} +10 -10
- package/dist/cli-bundle/chunks/{config-5VPR42A6.js → config-3JXJ3XZ7.js} +8 -8
- package/dist/cli-bundle/chunks/{config-NNLXVGVC.js → config-FZ4UDC4B.js} +8 -8
- package/dist/cli-bundle/chunks/{context-4QK6GRXO.js → context-L36PIN35.js} +146 -33
- package/dist/cli-bundle/chunks/{context-4QK6GRXO.js.map → context-L36PIN35.js.map} +2 -2
- package/dist/cli-bundle/chunks/{context-4N7GYTVQ.js → context-QBPO3BFM.js} +147 -34
- package/dist/cli-bundle/chunks/context-QBPO3BFM.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-DXCWXOSP.js → contracts-3NKWYKKU.js} +309 -6
- package/dist/cli-bundle/chunks/contracts-3NKWYKKU.js.map +1 -0
- package/dist/cli-bundle/chunks/{contracts-AOBNEBVT.js → contracts-MIXBWJIB.js} +315 -5
- package/dist/cli-bundle/chunks/contracts-MIXBWJIB.js.map +7 -0
- package/dist/cli-bundle/chunks/{copy-5NM3SVJA.js → copy-ALU5WMHA.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-XSYEQTLA.js → copy-FWIVTLBO.js} +7 -7
- package/dist/cli-bundle/chunks/{create-FCCAATQV.js → create-IFA26O2I.js} +13 -13
- package/dist/cli-bundle/chunks/create-JVXYHYH4.js +27 -0
- package/dist/cli-bundle/chunks/{delete-5JFP6OG7.js → delete-IYTIYAJS.js} +7 -7
- package/dist/cli-bundle/chunks/{delete-PQXJQXQ7.js → delete-Y2SGJBGY.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-S5322EOQ.js → deps-6TSPOSGU.js} +7 -7
- package/dist/cli-bundle/chunks/{deps-XXKBOQUA.js → deps-CZ4PTVXU.js} +7 -7
- package/dist/cli-bundle/chunks/{docs-C7CCVWAJ.js → docs-5WMBVQT2.js} +9 -9
- package/dist/cli-bundle/chunks/{docs-DZRPAW5S.js → docs-MB53UJAJ.js} +9 -9
- package/dist/cli-bundle/chunks/{extension-CSHP6FZX.js → extension-Q34OEWO5.js} +5 -5
- package/dist/cli-bundle/chunks/{extension-XNNVUVAY.js → extension-WH2FOIOZ.js} +5 -5
- package/dist/cli-bundle/chunks/{files-UPCNKEIZ.js → files-DLB5LJEP.js} +9 -9
- package/dist/cli-bundle/chunks/{files-OBWYYPKM.js → files-GVMNVLCB.js} +9 -9
- package/dist/cli-bundle/chunks/{gc-FA2ONELT.js → gc-2WEPW6D6.js} +3 -3
- package/dist/cli-bundle/chunks/{gc-KXK6KBRN.js → gc-4Z3IKHAZ.js} +3 -3
- package/dist/cli-bundle/chunks/{get-PNTSONGB.js → get-PCHS7RA6.js} +11 -11
- package/dist/cli-bundle/chunks/{get-FLHYTOBA.js → get-QARTE6BL.js} +11 -11
- package/dist/cli-bundle/chunks/{health-CS5RNTJX.js → health-4ZYB3IYQ.js} +47 -19
- package/dist/cli-bundle/chunks/health-4ZYB3IYQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{health-KCRVYIYY.js → health-YO5LRWN4.js} +46 -18
- package/dist/cli-bundle/chunks/health-YO5LRWN4.js.map +7 -0
- package/dist/cli-bundle/chunks/{history-COQTPBEU.js → history-7WUAEWHW.js} +10 -10
- package/dist/cli-bundle/chunks/history-L2FQFRTU.js +20 -0
- package/dist/cli-bundle/chunks/{history-compact-PVS2A3FS.js → history-compact-3EJ3L2O7.js} +11 -11
- package/dist/cli-bundle/chunks/{history-compact-66PSRYL3.js → history-compact-LW27IPFK.js} +11 -11
- package/dist/cli-bundle/chunks/{history-redact-DCXAWGTF.js → history-redact-G72A4EJ4.js} +11 -11
- package/dist/cli-bundle/chunks/history-redact-QWQCX5DZ.js +19 -0
- package/dist/cli-bundle/chunks/{history-repair-SEQDFTGW.js → history-repair-KVPFJKOS.js} +11 -11
- package/dist/cli-bundle/chunks/{history-repair-TA3NRIFO.js → history-repair-RUGKD3YR.js} +11 -11
- package/dist/cli-bundle/chunks/init-4BKRHGWW.js +17 -0
- package/dist/cli-bundle/chunks/{init-IQJE3EKJ.js → init-S5WEGUJY.js} +9 -9
- package/dist/cli-bundle/chunks/{learnings-XC6EMW5E.js → learnings-HQXSSKZ5.js} +10 -10
- package/dist/cli-bundle/chunks/{learnings-RJPGH2ME.js → learnings-XK3P4ZDR.js} +10 -10
- package/dist/cli-bundle/chunks/{list-NJV6WBT4.js → list-6CL3XFT6.js} +10 -10
- package/dist/cli-bundle/chunks/list-BYNN4ZEO.js +19 -0
- package/dist/cli-bundle/chunks/{notes-2KWHADK3.js → notes-5T6P7C5V.js} +10 -10
- package/dist/cli-bundle/chunks/{notes-FNCDMZW2.js → notes-U5FZCSBT.js} +10 -10
- package/dist/cli-bundle/chunks/{plan-CYK2P5PD.js → plan-FQLMJRLZ.js} +13 -13
- package/dist/cli-bundle/chunks/{plan-MQO5JTSV.js → plan-VNUG3WZZ.js} +13 -13
- package/dist/cli-bundle/chunks/{register-list-query-6RA24SIZ.js → register-list-query-NPE3ECJQ.js} +21 -21
- package/dist/cli-bundle/chunks/register-list-query-NPE3ECJQ.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-list-query-IO3RR5K6.js → register-list-query-VHDXWEPP.js} +20 -20
- package/dist/cli-bundle/chunks/register-list-query-VHDXWEPP.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-mutation-VV2SC2KL.js → register-mutation-DG53FCBV.js} +36 -35
- package/dist/cli-bundle/chunks/register-mutation-DG53FCBV.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-KVFUXCAZ.js → register-mutation-EAYNLGOS.js} +35 -34
- package/dist/cli-bundle/chunks/register-mutation-EAYNLGOS.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-operations-DFNVRSJ5.js → register-operations-AM6KTWB6.js} +42 -37
- package/dist/cli-bundle/chunks/register-operations-AM6KTWB6.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-TAUUTRJ4.js → register-operations-FWFE64JG.js} +41 -36
- package/dist/cli-bundle/chunks/register-operations-FWFE64JG.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-setup-X2R5CFDV.js → register-setup-G4QYI3RX.js} +15 -15
- package/dist/cli-bundle/chunks/{register-setup-GAQZZRUA.js → register-setup-IKX5524L.js} +15 -15
- package/dist/cli-bundle/chunks/restore-CHIOQAQL.js +17 -0
- package/dist/cli-bundle/chunks/{restore-E3GZKRRK.js → restore-M6AFHMV4.js} +11 -11
- package/dist/cli-bundle/chunks/{schema-3CPFLDAY.js → schema-76HDZJCC.js} +8 -8
- package/dist/cli-bundle/chunks/{schema-7EHBPNXM.js → schema-AINZ2IMM.js} +8 -8
- package/dist/cli-bundle/chunks/{search-OBZVYJJ2.js → search-JMLFQEPJ.js} +10 -10
- package/dist/cli-bundle/chunks/{search-2T3NCCUR.js → search-NL3TSCYB.js} +10 -10
- package/dist/cli-bundle/chunks/{stats-6LVK4JER.js → stats-BKXCBIGT.js} +7 -7
- package/dist/cli-bundle/chunks/{stats-ULGQACF7.js → stats-UBD56TGK.js} +7 -7
- package/dist/cli-bundle/chunks/{telemetry-HHKRTMZA.js → telemetry-N454RHG5.js} +4 -4
- package/dist/cli-bundle/chunks/{telemetry-6G27FLCP.js → telemetry-ZJXK3H7X.js} +4 -4
- package/dist/cli-bundle/chunks/{test-2PP4YBV6.js → test-BQAKIXAT.js} +14 -14
- package/dist/cli-bundle/chunks/test-O74JFUH5.js +32 -0
- package/dist/cli-bundle/chunks/{test-all-6Z272JRI.js → test-all-7LV3I6S5.js} +14 -14
- package/dist/cli-bundle/chunks/{test-all-NETGVNM6.js → test-all-TDYCCBA4.js} +14 -14
- package/dist/cli-bundle/chunks/{test-runs-M24WA6TI.js → test-runs-E64M6XS3.js} +5 -5
- package/dist/cli-bundle/chunks/{test-runs-CRPQVMMG.js → test-runs-LXZLULCI.js} +5 -5
- package/dist/cli-bundle/chunks/update-2EVXOC7V.js +21 -0
- package/dist/cli-bundle/chunks/update-5A2B6QYB.js +25 -0
- package/dist/cli-bundle/chunks/{update-many-JSRF5EH5.js → update-many-TUGU5YXQ.js} +22 -22
- package/dist/cli-bundle/chunks/{update-many-Y3HOL7WA.js → update-many-V4LA3C4H.js} +22 -22
- package/dist/cli-bundle/chunks/{upgrade-5RTQVKKE.js → upgrade-37F7JKES.js} +5 -5
- package/dist/cli-bundle/chunks/{upgrade-ECB6GH3M.js → upgrade-L32JA4TZ.js} +5 -5
- package/dist/cli-bundle/chunks/{validate-MCNMAXVA.js → validate-EQTT6WVX.js} +16 -16
- package/dist/cli-bundle/chunks/{validate-J6Q444SD.js → validate-XN4I4DPL.js} +16 -16
- package/dist/cli-bundle/main.js +276 -47
- package/dist/cli-bundle/main.js.map +2 -2
- package/dist/core/diagnostics/remediation.js +12 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/extensions/extension-policy.d.ts +14 -1
- package/dist/core/extensions/extension-policy.js +38 -3
- package/dist/core/extensions/extension-policy.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +40 -1
- package/dist/core/extensions/extension-types.js +28 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +6 -4
- package/dist/core/extensions/loader.js +67 -14
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/replay.d.ts +1 -1
- package/dist/core/history/replay.js +13 -4
- package/dist/core/history/replay.js.map +1 -1
- package/dist/core/output/mutation-projection.d.ts +2 -0
- package/dist/core/output/mutation-projection.js +9 -2
- package/dist/core/output/mutation-projection.js.map +1 -1
- package/dist/core/output/output.d.ts +2 -0
- package/dist/core/output/output.js +7 -3
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/output/query-summary.d.ts +31 -0
- package/dist/core/output/query-summary.js +62 -0
- package/dist/core/output/query-summary.js.map +1 -0
- package/dist/core/shared/command-types.d.ts +1 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/constants.js +8 -4
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/store/item-store.d.ts +1 -1
- package/dist/core/store/item-store.js +3 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/settings-read-cache.d.ts +15 -0
- package/dist/core/store/settings-read-cache.js +72 -0
- package/dist/core/store/settings-read-cache.js.map +1 -0
- package/dist/core/store/settings-validator.d.ts +4 -1
- package/dist/core/store/settings-validator.js +14 -2
- package/dist/core/store/settings-validator.js.map +1 -1
- package/dist/core/store/settings.js +166 -16
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +3 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/run-selectors.d.ts +27 -0
- package/dist/core/test/run-selectors.js +110 -0
- package/dist/core/test/run-selectors.js.map +1 -0
- package/dist/mcp/server.js +76 -262
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-definitions.d.ts +27 -0
- package/dist/mcp/tool-definitions.js +330 -0
- package/dist/mcp/tool-definitions.js.map +1 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js +3 -2
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +3 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +29 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts.js +37 -5
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/index.js +2 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +6 -0
- package/dist/sdk/runtime.js +51 -3
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types.d.ts +4 -1
- package/dist/types.js +4 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +7 -1
- package/docs/ARCHITECTURE.md +7 -0
- package/docs/CLAUDE_CODE_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +38 -3
- package/docs/CONFIGURATION.md +1 -1
- package/docs/EXTENSIONS.md +55 -53
- package/docs/SDK.md +8 -2
- package/docs/TESTING.md +60 -0
- package/docs/schemas/extension-manifest.schema.json +120 -0
- package/marketplace.json +1 -1
- package/package.json +2 -2
- package/packages/pm-beads/extensions/beads/manifest.json +10 -0
- package/packages/pm-calendar/extensions/calendar/manifest.json +10 -0
- package/packages/pm-command-kit/README.md +72 -0
- package/packages/pm-command-kit/extensions/command-kit/index.js +181 -0
- package/packages/pm-command-kit/extensions/command-kit/index.ts +176 -0
- package/packages/pm-command-kit/extensions/command-kit/manifest.json +22 -0
- package/packages/pm-command-kit/package.json +53 -0
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +10 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +10 -0
- package/packages/pm-lifecycle-hooks/extensions/lifecycle-hooks/manifest.json +10 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +10 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +6 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +6 -0
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +10 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +1 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +1 -0
- package/packages/pm-templates/extensions/templates/manifest.json +10 -0
- package/packages/pm-todos/extensions/todos/manifest.json +10 -0
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-claude/README.md +7 -3
- package/plugins/pm-claude/commands/pm-init.md +1 -1
- package/plugins/pm-codex/README.md +2 -2
- package/dist/cli-bundle/chunks/activity-HF3VJYKH.js +0 -16
- package/dist/cli-bundle/chunks/aggregate-IQ27NFBI.js.map +0 -7
- package/dist/cli-bundle/chunks/aggregate-TT7OCHHT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-3RHE76G6.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-4LRVXVJK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5JF76OJF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7YTWXGE3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ANKG2JKL.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-BIRVSIM2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-C72IQIBT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-D5D7VKIC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-EQ6N6IDR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FJNJEWU4.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GPOSGWCN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-H37YPWLM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-I26E6XA7.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-I4FGL3K2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JVMAOD54.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LU2HE272.js +0 -242
- package/dist/cli-bundle/chunks/chunk-LU2HE272.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-NJRZIJ4N.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-O4L7Z6LB.js +0 -252
- package/dist/cli-bundle/chunks/chunk-O4L7Z6LB.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RLVI7KDW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-RMTI5R76.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-T7B5VAKD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-TLD3UYGY.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-WQZCEEQN.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YSANBZAE.js.map +0 -7
- package/dist/cli-bundle/chunks/close-JTTGW7TS.js +0 -13
- package/dist/cli-bundle/chunks/context-4N7GYTVQ.js.map +0 -1
- package/dist/cli-bundle/chunks/contracts-AOBNEBVT.js.map +0 -7
- package/dist/cli-bundle/chunks/contracts-DXCWXOSP.js.map +0 -1
- package/dist/cli-bundle/chunks/create-JAPLFDGJ.js +0 -27
- package/dist/cli-bundle/chunks/health-CS5RNTJX.js.map +0 -1
- package/dist/cli-bundle/chunks/health-KCRVYIYY.js.map +0 -7
- package/dist/cli-bundle/chunks/history-6624XISO.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-ZRQTI7NB.js +0 -19
- package/dist/cli-bundle/chunks/init-ZVE2HMKK.js +0 -17
- package/dist/cli-bundle/chunks/list-OO5P472O.js +0 -19
- package/dist/cli-bundle/chunks/register-list-query-6RA24SIZ.js.map +0 -1
- package/dist/cli-bundle/chunks/register-list-query-IO3RR5K6.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-KVFUXCAZ.js.map +0 -7
- package/dist/cli-bundle/chunks/register-mutation-VV2SC2KL.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-DFNVRSJ5.js.map +0 -1
- package/dist/cli-bundle/chunks/register-operations-TAUUTRJ4.js.map +0 -7
- package/dist/cli-bundle/chunks/restore-F4ALFV4D.js +0 -17
- package/dist/cli-bundle/chunks/test-PPOLRIBA.js +0 -32
- package/dist/cli-bundle/chunks/update-MCPCPMHV.js +0 -25
- package/dist/cli-bundle/chunks/update-O7TBOUVQ.js +0 -21
- /package/dist/cli-bundle/chunks/{activity-RUJATACW.js.map → activity-XADJOG6G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{activity-HF3VJYKH.js.map → activity-XZIUPGZH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-E7AJ5RTR.js.map → append-JYWO4P7W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-CWQZBUWV.js.map → append-KG55G7S3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ENCVPOID.js.map → chunk-3SLOMKCJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-F2REA7VW.js.map → chunk-4JCSYR6F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CAXUGAAF.js.map → chunk-4YFAGDRH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-U3Z4OCZC.js.map → chunk-5SCT2JCT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NHRZSYAA.js.map → chunk-73ZPG2I3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-A5342JVL.js.map → chunk-7RIT3OCD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7CR4GAYN.js.map → chunk-ATEES5SX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FHUI7AXS.js.map → chunk-AVGHVVF7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-42IULX44.js.map → chunk-CCX4RSYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EFRHTZO4.js.map → chunk-CW6E4NAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JN3BT7UY.js.map → chunk-DY6C42S6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PUSOAQCR.js.map → chunk-E5DUIJA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E7LOIIFP.js.map → chunk-ESANVZF4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YI6W2DBN.js.map → chunk-F75JSIOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6IGTNFE3.js.map → chunk-FDH2X65L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZPXDD6RQ.js.map → chunk-I53JBTJW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-23WNCJBA.js.map → chunk-I7NYDZDV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-SAUXUI6U.js.map → chunk-IUKD4W6Z.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RKCJ2JMA.js.map → chunk-OASDW5UI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JEGFLKSI.js.map → chunk-OLKBSY4N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XEOO6K5J.js.map → chunk-P5BJOMBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P2NVFE4L.js.map → chunk-P5U5EOMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AM2AXVFS.js.map → chunk-PSD7F7DX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VDVVOLR6.js.map → chunk-QJMGRZO2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T7NWFVOA.js.map → chunk-QNJSITCX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MNXJ6YDO.js.map → chunk-RXAP6JL5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5MMLINZB.js.map → chunk-S26FESD4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OPYA2HIU.js.map → chunk-TK5VZFHY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4TJWRPIH.js.map → chunk-TNAP7EJX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5ATRWEZO.js.map → chunk-UUWGCWBU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YX5LAKFJ.js.map → chunk-VAOUX6TK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WCWIDJII.js.map → chunk-VPEAS7PS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RE2JQJZJ.js.map → chunk-VSRZRLG3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PW7C262O.js.map → chunk-WUNFKP7M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NUGAWYEN.js.map → chunk-XTKJSVWH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KDX6VC3P.js.map → chunk-XUC4C4PT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-44JP4PYY.js.map → chunk-Y3YKK7CY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KTVXLI54.js.map → chunk-YW6Q3RYZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I3UILOUU.js.map → chunk-ZLMIWZUG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FKH7K6YP.js.map → chunk-ZMW77VWV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-UXFGCF3P.js.map → claim-2RDYMCTP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{claim-RV6WYUF7.js.map → claim-MJ7DZFC3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-JTTGW7TS.js.map → close-4FMAPEMY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-O4JK2JKD.js.map → close-XLEKIQSW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-EQO4TPIE.js.map → close-many-AOD4HSAZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-SRDBV3SI.js.map → close-many-XKAQY5CQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-TTZUIB2O.js.map → comments-B4RWWDJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-OMB7YE27.js.map → comments-RN5TG4ZN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-5VPR42A6.js.map → config-3JXJ3XZ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{config-NNLXVGVC.js.map → config-FZ4UDC4B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-5NM3SVJA.js.map → copy-ALU5WMHA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-XSYEQTLA.js.map → copy-FWIVTLBO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-FCCAATQV.js.map → create-IFA26O2I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-JAPLFDGJ.js.map → create-JVXYHYH4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-5JFP6OG7.js.map → delete-IYTIYAJS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-PQXJQXQ7.js.map → delete-Y2SGJBGY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-S5322EOQ.js.map → deps-6TSPOSGU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-XXKBOQUA.js.map → deps-CZ4PTVXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-C7CCVWAJ.js.map → docs-5WMBVQT2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-DZRPAW5S.js.map → docs-MB53UJAJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-CSHP6FZX.js.map → extension-Q34OEWO5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{extension-XNNVUVAY.js.map → extension-WH2FOIOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-UPCNKEIZ.js.map → files-DLB5LJEP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-OBWYYPKM.js.map → files-GVMNVLCB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-FA2ONELT.js.map → gc-2WEPW6D6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{gc-KXK6KBRN.js.map → gc-4Z3IKHAZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-PNTSONGB.js.map → get-PCHS7RA6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{get-FLHYTOBA.js.map → get-QARTE6BL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-COQTPBEU.js.map → history-7WUAEWHW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-6624XISO.js.map → history-L2FQFRTU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-PVS2A3FS.js.map → history-compact-3EJ3L2O7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-66PSRYL3.js.map → history-compact-LW27IPFK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-DCXAWGTF.js.map → history-redact-G72A4EJ4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-ZRQTI7NB.js.map → history-redact-QWQCX5DZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-SEQDFTGW.js.map → history-repair-KVPFJKOS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-TA3NRIFO.js.map → history-repair-RUGKD3YR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-ZVE2HMKK.js.map → init-4BKRHGWW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{init-IQJE3EKJ.js.map → init-S5WEGUJY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-XC6EMW5E.js.map → learnings-HQXSSKZ5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-RJPGH2ME.js.map → learnings-XK3P4ZDR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-NJV6WBT4.js.map → list-6CL3XFT6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{list-OO5P472O.js.map → list-BYNN4ZEO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-2KWHADK3.js.map → notes-5T6P7C5V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-FNCDMZW2.js.map → notes-U5FZCSBT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-CYK2P5PD.js.map → plan-FQLMJRLZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-MQO5JTSV.js.map → plan-VNUG3WZZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-X2R5CFDV.js.map → register-setup-G4QYI3RX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-setup-GAQZZRUA.js.map → register-setup-IKX5524L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-F4ALFV4D.js.map → restore-CHIOQAQL.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-E3GZKRRK.js.map → restore-M6AFHMV4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-3CPFLDAY.js.map → schema-76HDZJCC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-7EHBPNXM.js.map → schema-AINZ2IMM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-OBZVYJJ2.js.map → search-JMLFQEPJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{search-2T3NCCUR.js.map → search-NL3TSCYB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-6LVK4JER.js.map → stats-BKXCBIGT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{stats-ULGQACF7.js.map → stats-UBD56TGK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-HHKRTMZA.js.map → telemetry-N454RHG5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{telemetry-6G27FLCP.js.map → telemetry-ZJXK3H7X.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-2PP4YBV6.js.map → test-BQAKIXAT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-PPOLRIBA.js.map → test-O74JFUH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-6Z272JRI.js.map → test-all-7LV3I6S5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-all-NETGVNM6.js.map → test-all-TDYCCBA4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-M24WA6TI.js.map → test-runs-E64M6XS3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{test-runs-CRPQVMMG.js.map → test-runs-LXZLULCI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-O7TBOUVQ.js.map → update-2EVXOC7V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-MCPCPMHV.js.map → update-5A2B6QYB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-JSRF5EH5.js.map → update-many-TUGU5YXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-Y3HOL7WA.js.map → update-many-V4LA3C4H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-5RTQVKKE.js.map → upgrade-37F7JKES.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{upgrade-ECB6GH3M.js.map → upgrade-L32JA4TZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-MCNMAXVA.js.map → validate-EQTT6WVX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{validate-J6Q444SD.js.map → validate-XN4I4DPL.js.map} +0 -0
|
@@ -21,7 +21,7 @@ export declare function replayToItemDocument(document: ReplayDocument): ItemDocu
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function toReplayDocument(document: ItemDocument): ReplayDocument;
|
|
23
23
|
export declare function normalizeReplayPatchPath(path: string): string;
|
|
24
|
-
export declare function normalizeReplayPatchOps(patch: HistoryPatchOp[]): HistoryPatchOp[];
|
|
24
|
+
export declare function normalizeReplayPatchOps(patch: HistoryPatchOp[] | unknown): HistoryPatchOp[];
|
|
25
25
|
export type ReplayApplyResult = {
|
|
26
26
|
ok: true;
|
|
27
27
|
document: ReplayDocument;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f055f3a6-ee3e-5f79-82f4-55c049f640e9")}catch(e){}}();
|
|
3
3
|
import jsonPatch from "fast-json-patch";
|
|
4
4
|
import { FRONT_MATTER_KEY_ORDER } from "../shared/constants.js";
|
|
5
5
|
import { canonicalDocument } from "../item/item-format.js";
|
|
@@ -62,11 +62,20 @@ export function normalizeReplayPatchPath(path) {
|
|
|
62
62
|
}
|
|
63
63
|
return path;
|
|
64
64
|
}
|
|
65
|
+
function isHistoryPatchOp(value) {
|
|
66
|
+
return (typeof value === "object" &&
|
|
67
|
+
value !== null &&
|
|
68
|
+
typeof value.op === "string" &&
|
|
69
|
+
typeof value.path === "string");
|
|
70
|
+
}
|
|
65
71
|
export function normalizeReplayPatchOps(patch) {
|
|
66
|
-
|
|
72
|
+
if (!Array.isArray(patch)) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
return patch.filter(isHistoryPatchOp).map((operation) => ({
|
|
67
76
|
...operation,
|
|
68
77
|
path: normalizeReplayPatchPath(operation.path),
|
|
69
|
-
from: operation.from ? normalizeReplayPatchPath(operation.from) : undefined,
|
|
78
|
+
from: typeof operation.from === "string" ? normalizeReplayPatchPath(operation.from) : undefined,
|
|
70
79
|
}));
|
|
71
80
|
}
|
|
72
81
|
function isReplayDocumentShape(value) {
|
|
@@ -247,4 +256,4 @@ export function historyEntriesToRaw(entries) {
|
|
|
247
256
|
return `${entries.map((entry) => JSON.stringify(entry)).join("\n")}\n`;
|
|
248
257
|
}
|
|
249
258
|
//# sourceMappingURL=replay.js.map
|
|
250
|
-
//# debugId=
|
|
259
|
+
//# debugId=f055f3a6-ee3e-5f79-82f4-55c049f640e9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replay.js","sources":["core/history/replay.ts"],"sourceRoot":"/","sourcesContent":["import jsonPatch from \"fast-json-patch\";\nimport { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { canonicalDocument } from \"../item/item-format.js\";\nimport { toItemRecord } from \"../item/item-record.js\";\nimport { orderObject, sha256Hex, stableStringify } from \"../shared/serialization.js\";\nimport { hashDocument } from \"./history.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Shared history replay/patch mechanics single-sourced for the history, restore,\n * history-redact, and history-repair commands plus the health/validate drift checks.\n *\n * Each command keeps its own thin error-formatting wrapper so the exact CLI error\n * contracts (restore's rich patch-failure context, redact's op tag, history's\n * generic message) are preserved; only the underlying replay/patch logic is shared.\n */\n\nexport interface ReplayDocument {\n metadata: Record<string, unknown>;\n body: string;\n}\n\nexport const EMPTY_REPLAY_DOCUMENT: ReplayDocument = {\n metadata: {},\n body: \"\",\n};\n\nexport function cloneEmptyReplayDocument(): ReplayDocument {\n return structuredClone(EMPTY_REPLAY_DOCUMENT);\n}\n\nexport function replayHash(document: ReplayDocument): string {\n try {\n return hashDocument({\n metadata: document.metadata as unknown as ItemMetadata,\n body: document.body,\n });\n } catch {\n // Legacy/malformed replay states (for example a stream whose first entry never\n // established a full `create` document, so the canonicalizer cannot normalize it)\n // cannot be canonically hashed. Fall back to a deterministic structural hash so\n // re-anchor and verification stay internally consistent for these streams. Fully\n // formed documents always take the canonical path above, so valid streams are\n // unaffected.\n return sha256Hex(stableStringify({ replay_fallback: true, metadata: document.metadata, body: document.body }));\n }\n}\n\nexport function replayToItemDocument(document: ReplayDocument): ItemDocument {\n return {\n metadata: document.metadata as unknown as ItemMetadata,\n body: document.body,\n };\n}\n\n/**\n * Canonicalize an item document into the ordered replay form used when comparing\n * a replayed chain against the on-disk item (restore + history-repair reconciliation).\n */\nexport function toReplayDocument(document: ItemDocument): ReplayDocument {\n if (!document.metadata || Object.keys(document.metadata).length === 0) {\n return {\n metadata: {},\n body: document.body ?? \"\",\n };\n }\n const canonical = canonicalDocument(document);\n return {\n metadata: orderObject(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER),\n body: canonical.body,\n };\n}\n\nexport function normalizeReplayPatchPath(path: string): string {\n if (path === \"/front_matter\") {\n return \"/metadata\";\n }\n if (path.startsWith(\"/front_matter/\")) {\n return `/metadata/${path.slice(\"/front_matter/\".length)}`;\n }\n return path;\n}\n\nexport function normalizeReplayPatchOps(patch: HistoryPatchOp[]): HistoryPatchOp[] {\n return patch.map((operation) => ({\n ...operation,\n path: normalizeReplayPatchPath(operation.path),\n from: operation.from ? normalizeReplayPatchPath(operation.from) : undefined,\n }));\n}\n\nfunction isReplayDocumentShape(value: unknown): value is { metadata: Record<string, unknown>; body: string } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"metadata\" in value &&\n \"body\" in value &&\n typeof (value as { body: unknown }).body === \"string\" &&\n typeof (value as { metadata: unknown }).metadata === \"object\" &&\n (value as { metadata: unknown }).metadata !== null\n );\n}\n\nexport type ReplayApplyResult =\n | { ok: true; document: ReplayDocument }\n | { ok: false; error: unknown };\n\n/**\n * Strictly apply a history patch (front_matter->metadata normalized) to a replay\n * document. Returns a result envelope rather than throwing so each caller can\n * format its own error contract.\n */\nexport function tryApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): ReplayApplyResult {\n try {\n const normalizedPatch = normalizeReplayPatchOps(patch);\n const applied = jsonPatch.applyPatch(\n structuredClone(current),\n normalizedPatch as jsonPatch.Operation[],\n true,\n false,\n ).newDocument as unknown;\n if (!isReplayDocumentShape(applied)) {\n return { ok: false, error: new Error(\"history_replay_invalid_document_shape\") };\n }\n return { ok: true, document: { metadata: applied.metadata, body: applied.body } };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Deterministically verify a history chain: each entry's before_hash must equal\n * the prior replayed after_hash, the patch must strictly apply, and the recorded\n * after_hash must equal the replayed result.\n */\nexport function verifyHistoryChain(entries: HistoryEntry[]): { ok: boolean; errors: string[] } {\n let replay = cloneEmptyReplayDocument();\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n return {\n ok: false,\n errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`],\n };\n }\n const applied = tryApplyReplayPatch(replay, entry.patch);\n if (!applied.ok) {\n return {\n ok: false,\n errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`],\n };\n }\n replay = applied.document;\n if (replayHash(replay) !== entry.after_hash) {\n return {\n ok: false,\n errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`],\n };\n }\n }\n return { ok: true, errors: [] };\n}\n\nexport interface LenientApplyResult {\n document: ReplayDocument;\n convertedReplaceToAdd: number;\n skippedOps: number;\n}\n\nfunction tryApplySingleOp(document: unknown, op: HistoryPatchOp): { ok: true; document: unknown } | { ok: false } {\n try {\n const applied = jsonPatch.applyPatch(\n structuredClone(document),\n [op as jsonPatch.Operation],\n true,\n false,\n ).newDocument as unknown;\n return { ok: true, document: applied };\n } catch {\n return { ok: false };\n }\n}\n\n/**\n * Apply a legacy patch op-by-op, recovering from drift that strict replay rejects:\n * a `replace` whose path no longer exists is retried as `add`, and any op that\n * still cannot apply against the current replay state is skipped. The resulting\n * document is what the repaired entry's recomputed patch should target.\n */\nexport function lenientApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): LenientApplyResult {\n let working: unknown = structuredClone(current);\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (const op of normalizeReplayPatchOps(patch)) {\n const direct = tryApplySingleOp(working, op);\n if (direct.ok) {\n working = direct.document;\n continue;\n }\n if (op.op === \"replace\") {\n const asAdd = tryApplySingleOp(working, { ...op, op: \"add\" });\n if (asAdd.ok) {\n working = asAdd.document;\n convertedReplaceToAdd += 1;\n continue;\n }\n }\n skippedOps += 1;\n }\n\n const candidate = working as { metadata?: unknown; body?: unknown };\n const document: ReplayDocument = {\n metadata:\n typeof candidate.metadata === \"object\" && candidate.metadata !== null\n ? (candidate.metadata as Record<string, unknown>)\n : {},\n body: typeof candidate.body === \"string\" ? candidate.body : current.body,\n };\n return { document, convertedReplaceToAdd, skippedOps };\n}\n\nexport interface ReanchorEntryDetail {\n index: number;\n rehashed: boolean;\n patch_repaired: boolean;\n converted_replace_to_add: number;\n skipped_ops: number;\n}\n\nexport interface ReanchorResult {\n entries: HistoryEntry[];\n finalDocument: ReplayDocument;\n entriesRehashed: number;\n entriesPatchRepaired: number;\n convertedReplaceToAdd: number;\n skippedOps: number;\n details: ReanchorEntryDetail[];\n}\n\n/**\n * Re-anchor a drifted history chain: replay every entry from empty, recompute the\n * before/after hashes, and only rewrite a patch when the original op set no longer\n * strictly applies (legacy drift). Clean entries keep their patch verbatim so the\n * on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain.\n */\nexport function reanchorHistoryEntries(entries: HistoryEntry[]): ReanchorResult {\n let replay = cloneEmptyReplayDocument();\n const rewritten: HistoryEntry[] = [];\n const details: ReanchorEntryDetail[] = [];\n let entriesRehashed = 0;\n let entriesPatchRepaired = 0;\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n const beforeHash = replayHash(replay);\n const strict = tryApplyReplayPatch(replay, entry.patch);\n\n let next: ReplayDocument;\n let outPatch: HistoryPatchOp[];\n let patchRepaired = false;\n let entryConverted = 0;\n let entrySkipped = 0;\n\n if (strict.ok) {\n next = strict.document;\n outPatch = entry.patch;\n } else {\n const lenient = lenientApplyReplayPatch(replay, entry.patch);\n next = lenient.document;\n outPatch = jsonPatch.compare(replay, next) as HistoryPatchOp[];\n patchRepaired = true;\n entryConverted = lenient.convertedReplaceToAdd;\n entrySkipped = lenient.skippedOps;\n convertedReplaceToAdd += entryConverted;\n skippedOps += entrySkipped;\n entriesPatchRepaired += 1;\n }\n\n const afterHash = replayHash(next);\n const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;\n if (rehashed) {\n entriesRehashed += 1;\n }\n\n rewritten.push({\n ...entry,\n patch: outPatch,\n before_hash: beforeHash,\n after_hash: afterHash,\n });\n details.push({\n index: index + 1,\n rehashed,\n patch_repaired: patchRepaired,\n converted_replace_to_add: entryConverted,\n skipped_ops: entrySkipped,\n });\n replay = next;\n }\n\n return {\n entries: rewritten,\n finalDocument: replay,\n entriesRehashed,\n entriesPatchRepaired,\n convertedReplaceToAdd,\n skippedOps,\n details,\n };\n}\n\nexport function historyEntriesToRaw(entries: HistoryEntry[]): string {\n if (entries.length === 0) {\n return \"\";\n }\n return `${entries.map((entry) => JSON.stringify(entry)).join(\"\\n\")}\\n`;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAiB5C,MAAM,CAAC,MAAM,qBAAqB,GAAmB;IACnD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,UAAU,wBAAwB;IACtC,OAAO,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAAwB;IACjD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC;YAClB,QAAQ,EAAE,QAAQ,CAAC,QAAmC;YACtD,IAAI,EAAE,QAAQ,CAAC,IAAI;SACpB,CAAC,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACP,+EAA+E;QAC/E,kFAAkF;QAClF,gFAAgF;QAChF,iFAAiF;QACjF,8EAA8E;QAC9E,cAAc;QACd,OAAO,SAAS,CAAC,eAAe,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACjH,CAAC;AACH,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,QAAwB;IAC3D,OAAO;QACL,QAAQ,EAAE,QAAQ,CAAC,QAAmC;QACtD,IAAI,EAAE,QAAQ,CAAC,IAAI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C,UAAU,IAAI,YAAY,CAAC;YAC3B,oBAAoB,IAAI,CAAC,CAAC;QAC5B,CAAC;QAED,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,QAAQ,GAAG,UAAU,KAAK,KAAK,CAAC,WAAW,IAAI,SAAS,KAAK,KAAK,CAAC,UAAU,CAAC;QACpF,IAAI,QAAQ,EAAE,CAAC;YACb,eAAe,IAAI,CAAC,CAAC;QACvB,CAAC;QAED,SAAS,CAAC,IAAI,CAAC;YACb,GAAG,KAAK;YACR,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE,UAAU;YACvB,UAAU,EAAE,SAAS;SACtB,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,KAAK,GAAG,CAAC;YAChB,QAAQ;YACR,cAAc,EAAE,aAAa;YAC7B,wBAAwB,EAAE,cAAc;YACxC,WAAW,EAAE,YAAY;SAC1B,CAAC,CAAC;QACH,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IAED,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,MAAM;QACrB,eAAe;QACf,oBAAoB;QACpB,qBAAqB;QACrB,UAAU;QACV,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAuB;IACzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACzE,CAAC","debugId":"a11d69ae-cb25-5c08-8722-85d4fe95b973"}
|
|
1
|
+
{"version":3,"file":"replay.js","sources":["core/history/replay.ts"],"sourceRoot":"/","sourcesContent":["import jsonPatch from \"fast-json-patch\";\nimport { FRONT_MATTER_KEY_ORDER } from \"../shared/constants.js\";\nimport { canonicalDocument } from \"../item/item-format.js\";\nimport { toItemRecord } from \"../item/item-record.js\";\nimport { orderObject, sha256Hex, stableStringify } from \"../shared/serialization.js\";\nimport { hashDocument } from \"./history.js\";\nimport type { HistoryEntry, HistoryPatchOp, ItemDocument, ItemMetadata } from \"../../types/index.js\";\n\n/**\n * Shared history replay/patch mechanics single-sourced for the history, restore,\n * history-redact, and history-repair commands plus the health/validate drift checks.\n *\n * Each command keeps its own thin error-formatting wrapper so the exact CLI error\n * contracts (restore's rich patch-failure context, redact's op tag, history's\n * generic message) are preserved; only the underlying replay/patch logic is shared.\n */\n\nexport interface ReplayDocument {\n metadata: Record<string, unknown>;\n body: string;\n}\n\nexport const EMPTY_REPLAY_DOCUMENT: ReplayDocument = {\n metadata: {},\n body: \"\",\n};\n\nexport function cloneEmptyReplayDocument(): ReplayDocument {\n return structuredClone(EMPTY_REPLAY_DOCUMENT);\n}\n\nexport function replayHash(document: ReplayDocument): string {\n try {\n return hashDocument({\n metadata: document.metadata as unknown as ItemMetadata,\n body: document.body,\n });\n } catch {\n // Legacy/malformed replay states (for example a stream whose first entry never\n // established a full `create` document, so the canonicalizer cannot normalize it)\n // cannot be canonically hashed. Fall back to a deterministic structural hash so\n // re-anchor and verification stay internally consistent for these streams. Fully\n // formed documents always take the canonical path above, so valid streams are\n // unaffected.\n return sha256Hex(stableStringify({ replay_fallback: true, metadata: document.metadata, body: document.body }));\n }\n}\n\nexport function replayToItemDocument(document: ReplayDocument): ItemDocument {\n return {\n metadata: document.metadata as unknown as ItemMetadata,\n body: document.body,\n };\n}\n\n/**\n * Canonicalize an item document into the ordered replay form used when comparing\n * a replayed chain against the on-disk item (restore + history-repair reconciliation).\n */\nexport function toReplayDocument(document: ItemDocument): ReplayDocument {\n if (!document.metadata || Object.keys(document.metadata).length === 0) {\n return {\n metadata: {},\n body: document.body ?? \"\",\n };\n }\n const canonical = canonicalDocument(document);\n return {\n metadata: orderObject(toItemRecord(canonical.metadata), FRONT_MATTER_KEY_ORDER),\n body: canonical.body,\n };\n}\n\nexport function normalizeReplayPatchPath(path: string): string {\n if (path === \"/front_matter\") {\n return \"/metadata\";\n }\n if (path.startsWith(\"/front_matter/\")) {\n return `/metadata/${path.slice(\"/front_matter/\".length)}`;\n }\n return path;\n}\n\nfunction isHistoryPatchOp(value: unknown): value is HistoryPatchOp {\n return (\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as { op?: unknown }).op === \"string\" &&\n typeof (value as { path?: unknown }).path === \"string\"\n );\n}\n\nexport function normalizeReplayPatchOps(patch: HistoryPatchOp[] | unknown): HistoryPatchOp[] {\n if (!Array.isArray(patch)) {\n return [];\n }\n return patch.filter(isHistoryPatchOp).map((operation) => ({\n ...operation,\n path: normalizeReplayPatchPath(operation.path),\n from: typeof operation.from === \"string\" ? normalizeReplayPatchPath(operation.from) : undefined,\n }));\n}\n\nfunction isReplayDocumentShape(value: unknown): value is { metadata: Record<string, unknown>; body: string } {\n return (\n typeof value === \"object\" &&\n value !== null &&\n \"metadata\" in value &&\n \"body\" in value &&\n typeof (value as { body: unknown }).body === \"string\" &&\n typeof (value as { metadata: unknown }).metadata === \"object\" &&\n (value as { metadata: unknown }).metadata !== null\n );\n}\n\nexport type ReplayApplyResult =\n | { ok: true; document: ReplayDocument }\n | { ok: false; error: unknown };\n\n/**\n * Strictly apply a history patch (front_matter->metadata normalized) to a replay\n * document. Returns a result envelope rather than throwing so each caller can\n * format its own error contract.\n */\nexport function tryApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): ReplayApplyResult {\n try {\n const normalizedPatch = normalizeReplayPatchOps(patch);\n const applied = jsonPatch.applyPatch(\n structuredClone(current),\n normalizedPatch as jsonPatch.Operation[],\n true,\n false,\n ).newDocument as unknown;\n if (!isReplayDocumentShape(applied)) {\n return { ok: false, error: new Error(\"history_replay_invalid_document_shape\") };\n }\n return { ok: true, document: { metadata: applied.metadata, body: applied.body } };\n } catch (error) {\n return { ok: false, error };\n }\n}\n\n/**\n * Deterministically verify a history chain: each entry's before_hash must equal\n * the prior replayed after_hash, the patch must strictly apply, and the recorded\n * after_hash must equal the replayed result.\n */\nexport function verifyHistoryChain(entries: HistoryEntry[]): { ok: boolean; errors: string[] } {\n let replay = cloneEmptyReplayDocument();\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n if (replayHash(replay) !== entry.before_hash) {\n return {\n ok: false,\n errors: [`verify_failed:before_hash_mismatch:entry_${index + 1}`],\n };\n }\n const applied = tryApplyReplayPatch(replay, entry.patch);\n if (!applied.ok) {\n return {\n ok: false,\n errors: [`verify_failed:patch_apply_failed:entry_${index + 1}`],\n };\n }\n replay = applied.document;\n if (replayHash(replay) !== entry.after_hash) {\n return {\n ok: false,\n errors: [`verify_failed:after_hash_mismatch:entry_${index + 1}`],\n };\n }\n }\n return { ok: true, errors: [] };\n}\n\nexport interface LenientApplyResult {\n document: ReplayDocument;\n convertedReplaceToAdd: number;\n skippedOps: number;\n}\n\nfunction tryApplySingleOp(document: unknown, op: HistoryPatchOp): { ok: true; document: unknown } | { ok: false } {\n try {\n const applied = jsonPatch.applyPatch(\n structuredClone(document),\n [op as jsonPatch.Operation],\n true,\n false,\n ).newDocument as unknown;\n return { ok: true, document: applied };\n } catch {\n return { ok: false };\n }\n}\n\n/**\n * Apply a legacy patch op-by-op, recovering from drift that strict replay rejects:\n * a `replace` whose path no longer exists is retried as `add`, and any op that\n * still cannot apply against the current replay state is skipped. The resulting\n * document is what the repaired entry's recomputed patch should target.\n */\nexport function lenientApplyReplayPatch(current: ReplayDocument, patch: HistoryPatchOp[]): LenientApplyResult {\n let working: unknown = structuredClone(current);\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (const op of normalizeReplayPatchOps(patch)) {\n const direct = tryApplySingleOp(working, op);\n if (direct.ok) {\n working = direct.document;\n continue;\n }\n if (op.op === \"replace\") {\n const asAdd = tryApplySingleOp(working, { ...op, op: \"add\" });\n if (asAdd.ok) {\n working = asAdd.document;\n convertedReplaceToAdd += 1;\n continue;\n }\n }\n skippedOps += 1;\n }\n\n const candidate = working as { metadata?: unknown; body?: unknown };\n const document: ReplayDocument = {\n metadata:\n typeof candidate.metadata === \"object\" && candidate.metadata !== null\n ? (candidate.metadata as Record<string, unknown>)\n : {},\n body: typeof candidate.body === \"string\" ? candidate.body : current.body,\n };\n return { document, convertedReplaceToAdd, skippedOps };\n}\n\nexport interface ReanchorEntryDetail {\n index: number;\n rehashed: boolean;\n patch_repaired: boolean;\n converted_replace_to_add: number;\n skipped_ops: number;\n}\n\nexport interface ReanchorResult {\n entries: HistoryEntry[];\n finalDocument: ReplayDocument;\n entriesRehashed: number;\n entriesPatchRepaired: number;\n convertedReplaceToAdd: number;\n skippedOps: number;\n details: ReanchorEntryDetail[];\n}\n\n/**\n * Re-anchor a drifted history chain: replay every entry from empty, recompute the\n * before/after hashes, and only rewrite a patch when the original op set no longer\n * strictly applies (legacy drift). Clean entries keep their patch verbatim so the\n * on-disk diff stays minimal. The returned chain verifies via verifyHistoryChain.\n */\nexport function reanchorHistoryEntries(entries: HistoryEntry[]): ReanchorResult {\n let replay = cloneEmptyReplayDocument();\n const rewritten: HistoryEntry[] = [];\n const details: ReanchorEntryDetail[] = [];\n let entriesRehashed = 0;\n let entriesPatchRepaired = 0;\n let convertedReplaceToAdd = 0;\n let skippedOps = 0;\n\n for (let index = 0; index < entries.length; index += 1) {\n const entry = entries[index];\n const beforeHash = replayHash(replay);\n const strict = tryApplyReplayPatch(replay, entry.patch);\n\n let next: ReplayDocument;\n let outPatch: HistoryPatchOp[];\n let patchRepaired = false;\n let entryConverted = 0;\n let entrySkipped = 0;\n\n if (strict.ok) {\n next = strict.document;\n outPatch = entry.patch;\n } else {\n const lenient = lenientApplyReplayPatch(replay, entry.patch);\n next = lenient.document;\n outPatch = jsonPatch.compare(replay, next) as HistoryPatchOp[];\n patchRepaired = true;\n entryConverted = lenient.convertedReplaceToAdd;\n entrySkipped = lenient.skippedOps;\n convertedReplaceToAdd += entryConverted;\n skippedOps += entrySkipped;\n entriesPatchRepaired += 1;\n }\n\n const afterHash = replayHash(next);\n const rehashed = beforeHash !== entry.before_hash || afterHash !== entry.after_hash;\n if (rehashed) {\n entriesRehashed += 1;\n }\n\n rewritten.push({\n ...entry,\n patch: outPatch,\n before_hash: beforeHash,\n after_hash: afterHash,\n });\n details.push({\n index: index + 1,\n rehashed,\n patch_repaired: patchRepaired,\n converted_replace_to_add: entryConverted,\n skipped_ops: entrySkipped,\n });\n replay = next;\n }\n\n return {\n entries: rewritten,\n finalDocument: replay,\n entriesRehashed,\n entriesPatchRepaired,\n convertedReplaceToAdd,\n skippedOps,\n details,\n };\n}\n\nexport function historyEntriesToRaw(entries: HistoryEntry[]): string {\n if (entries.length === 0) {\n return \"\";\n }\n return `${entries.map((entry) => JSON.stringify(entry)).join(\"\\n\")}\\n`;\n}\n"],"names":[],"mappings":";;AAAA,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAiB5C,MAAM,CAAC,MAAM,qBAAqB,GAAmB;IACnD,QAAQ,EAAE,EAAE;IACZ,IAAI,EAAE,EAAE;CACT,CAAC;AAEF,MAAM,UAAU,wBAAwB;IACtC,OAAO,eAAe,CAAC,qBAAqB,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAAwB;IACjD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC;YAClB,QAAQ,EAAE,QAAQ,CAAC,QAAmC;YACtD,IAAI,EAAE,QAAQ,CAAC,IAAI;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C;QACH,OAAO,CAAC,IAAI,CAAC;YACX,KAAK,EAAE,KAAK,GAAG,CAAC;YAChB,QAAQ;YACR,cAAc,EAAE,aAAa;YAC7B,wBAAwB,EAAE,cAAc;YACxC,WAAW,EAAE,YAAY;SAC1B,CAAC,CAAC;QACH,MAAM,GAAG,IAAI,CAAC;IAChB,CAAC;IAED,OAAO;QACL,OAAO,EAAE,SAAS;QAClB,aAAa,EAAE,MAAM;QACrB,eAAe;QACf,oBAAoB;QACpB,qBAAqB;QACrB,UAAU;QACV,OAAO;KACR,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAuB;IACzD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;AACzE,CAAC","debugId":"f055f3a6-ee3e-5f79-82f4-55c049f640e9"}
|
|
@@ -22,6 +22,8 @@ export type ChangedFieldsMode = "full" | "compact";
|
|
|
22
22
|
export interface MutationProjectionOptions {
|
|
23
23
|
/** Defaults to "full" (unchanged output). "compact" drops the array, keeping a count. */
|
|
24
24
|
changedFields?: ChangedFieldsMode;
|
|
25
|
+
/** Return only id/status for single-item mutation envelopes. */
|
|
26
|
+
idOnly?: boolean;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Returns a copy of a mutation result with the envelope `changed_fields` arrays
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* MCP server, and returns the original reference unchanged when nothing is compacted.
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
22
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3dd31047-1b72-59b3-a03a-50eed2c86ff3")}catch(e){}}();
|
|
23
23
|
const CHANGED_FIELDS_KEY = "changed_fields";
|
|
24
24
|
const CHANGED_FIELD_COUNT_KEY = "changed_field_count";
|
|
25
25
|
const ROWS_KEY = "rows";
|
|
@@ -66,6 +66,13 @@ function replaceRows(envelope, rows) {
|
|
|
66
66
|
* not a mutation envelope (or full mode) are returned unchanged (same reference).
|
|
67
67
|
*/
|
|
68
68
|
export function projectMutationResult(result, options = {}) {
|
|
69
|
+
if (options.idOnly === true && isPlainObject(result) && isPlainObject(result.item)) {
|
|
70
|
+
const id = typeof result.item.id === "string" ? result.item.id : undefined;
|
|
71
|
+
const status = typeof result.item.status === "string" ? result.item.status : undefined;
|
|
72
|
+
if (id) {
|
|
73
|
+
return status ? { id, status } : { id };
|
|
74
|
+
}
|
|
75
|
+
}
|
|
69
76
|
const mode = options.changedFields ?? "full";
|
|
70
77
|
if (mode === "full" || !isPlainObject(result)) {
|
|
71
78
|
return result;
|
|
@@ -100,4 +107,4 @@ export function projectMutationResult(result, options = {}) {
|
|
|
100
107
|
return changed ? projected : result;
|
|
101
108
|
}
|
|
102
109
|
//# sourceMappingURL=mutation-projection.js.map
|
|
103
|
-
//# debugId=
|
|
110
|
+
//# debugId=3dd31047-1b72-59b3-a03a-50eed2c86ff3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation-projection.js","sources":["core/output/mutation-projection.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared projection helper for mutation command results.\n *\n * Mutation commands (create/update/close/append/update-many) return a result\n * envelope that carries a `changed_fields` string array. On create this array simply\n * re-lists every field the command just set, which the item echo above it already\n * shows, so for high-volume agent loops it is ~50% redundant payload. This helper\n * lets the CLI (`--no-changed-fields`) and the MCP agent path trim that array down\n * to a deterministic `changed_field_count` without losing mutation evidence.\n *\n * Compaction is deliberately scoped to the mutation envelope only:\n * - the envelope's own top-level `changed_fields` (create/update/close/append), and\n * - `rows[*].changed_fields` (update-many reports its delta per row).\n * It does NOT recurse into arbitrary nested objects, so unrelated payloads that\n * legitimately carry `changed_fields` (for example `pm history --diff` entries, or a\n * custom runtime metadata field) are left untouched.\n *\n * The helper is pure and side-effect free, reused by both the output layer and the\n * MCP server, and returns the original reference unchanged when nothing is compacted.\n */\n\nexport type ChangedFieldsMode = \"full\" | \"compact\";\n\nexport interface MutationProjectionOptions {\n /** Defaults to \"full\" (unchanged output). \"compact\" drops the array, keeping a count. */\n changedFields?: ChangedFieldsMode;\n}\n\nconst CHANGED_FIELDS_KEY = \"changed_fields\";\nconst CHANGED_FIELD_COUNT_KEY = \"changed_field_count\";\nconst ROWS_KEY = \"rows\";\nconst UPDATE_MANY_MUTATION_MODES = new Set([\"apply\", \"rollback\"]);\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\n\n/** Replace a single envelope's own top-level `changed_fields` array with a count. */\nfunction compactOwnChangedFields(envelope: Record<string, unknown>): Record<string, unknown> | null {\n const changedFields = envelope[CHANGED_FIELDS_KEY];\n if (!Array.isArray(changedFields)) {\n return null;\n }\n const projected: Record<string, unknown> =\n Object.getPrototypeOf(envelope) === null ? Object.create(null) : {};\n for (const [key, value] of Object.entries(envelope)) {\n if (key !== CHANGED_FIELDS_KEY) {\n projected[key] = value;\n }\n }\n projected[CHANGED_FIELD_COUNT_KEY] = changedFields.length;\n return projected;\n}\n\nfunction isMutationEnvelope(value: Record<string, unknown>): boolean {\n return \"item\" in value && Array.isArray(value[CHANGED_FIELDS_KEY]);\n}\n\nfunction isUpdateManyMutationEnvelope(value: Record<string, unknown>): boolean {\n return (\n typeof value.mode === \"string\" &&\n UPDATE_MANY_MUTATION_MODES.has(value.mode) &&\n Array.isArray(value[ROWS_KEY])\n );\n}\n\nfunction replaceRows(envelope: Record<string, unknown>, rows: unknown[]): Record<string, unknown> {\n const projected: Record<string, unknown> =\n Object.getPrototypeOf(envelope) === null ? Object.create(null) : {};\n Object.assign(projected, envelope);\n projected[ROWS_KEY] = rows;\n return projected;\n}\n\n/**\n * Returns a copy of a mutation result with the envelope `changed_fields` arrays\n * replaced by `changed_field_count` when compact mode is requested. Inputs that are\n * not a mutation envelope (or full mode) are returned unchanged (same reference).\n */\nexport function projectMutationResult(result: unknown, options: MutationProjectionOptions = {}): unknown {\n const mode = options.changedFields ?? \"full\";\n if (mode === \"full\" || !isPlainObject(result)) {\n return result;\n }\n\n let changed = false;\n let projected: Record<string, unknown> = result;\n\n const compactedTop = isMutationEnvelope(result) ? compactOwnChangedFields(result) : null;\n if (compactedTop !== null) {\n projected = compactedTop;\n changed = true;\n }\n\n // update-many reports its per-item delta under rows[*].changed_fields.\n const rows = isUpdateManyMutationEnvelope(projected) ? projected[ROWS_KEY] : undefined;\n if (Array.isArray(rows)) {\n let rowsChanged = false;\n const nextRows = rows.map((row) => {\n if (!isPlainObject(row)) {\n return row;\n }\n const compactedRow = compactOwnChangedFields(row);\n if (compactedRow) {\n rowsChanged = true;\n return compactedRow;\n }\n return row;\n });\n if (rowsChanged) {\n projected = replaceRows(projected, nextRows);\n changed = true;\n }\n }\n\n return changed ? projected : result;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;
|
|
1
|
+
{"version":3,"file":"mutation-projection.js","sources":["core/output/mutation-projection.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Shared projection helper for mutation command results.\n *\n * Mutation commands (create/update/close/append/update-many) return a result\n * envelope that carries a `changed_fields` string array. On create this array simply\n * re-lists every field the command just set, which the item echo above it already\n * shows, so for high-volume agent loops it is ~50% redundant payload. This helper\n * lets the CLI (`--no-changed-fields`) and the MCP agent path trim that array down\n * to a deterministic `changed_field_count` without losing mutation evidence.\n *\n * Compaction is deliberately scoped to the mutation envelope only:\n * - the envelope's own top-level `changed_fields` (create/update/close/append), and\n * - `rows[*].changed_fields` (update-many reports its delta per row).\n * It does NOT recurse into arbitrary nested objects, so unrelated payloads that\n * legitimately carry `changed_fields` (for example `pm history --diff` entries, or a\n * custom runtime metadata field) are left untouched.\n *\n * The helper is pure and side-effect free, reused by both the output layer and the\n * MCP server, and returns the original reference unchanged when nothing is compacted.\n */\n\nexport type ChangedFieldsMode = \"full\" | \"compact\";\n\nexport interface MutationProjectionOptions {\n /** Defaults to \"full\" (unchanged output). \"compact\" drops the array, keeping a count. */\n changedFields?: ChangedFieldsMode;\n /** Return only id/status for single-item mutation envelopes. */\n idOnly?: boolean;\n}\n\nconst CHANGED_FIELDS_KEY = \"changed_fields\";\nconst CHANGED_FIELD_COUNT_KEY = \"changed_field_count\";\nconst ROWS_KEY = \"rows\";\nconst UPDATE_MANY_MUTATION_MODES = new Set([\"apply\", \"rollback\"]);\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n return false;\n }\n const proto = Object.getPrototypeOf(value);\n return proto === null || proto === Object.prototype;\n}\n\n/** Replace a single envelope's own top-level `changed_fields` array with a count. */\nfunction compactOwnChangedFields(envelope: Record<string, unknown>): Record<string, unknown> | null {\n const changedFields = envelope[CHANGED_FIELDS_KEY];\n if (!Array.isArray(changedFields)) {\n return null;\n }\n const projected: Record<string, unknown> =\n Object.getPrototypeOf(envelope) === null ? Object.create(null) : {};\n for (const [key, value] of Object.entries(envelope)) {\n if (key !== CHANGED_FIELDS_KEY) {\n projected[key] = value;\n }\n }\n projected[CHANGED_FIELD_COUNT_KEY] = changedFields.length;\n return projected;\n}\n\nfunction isMutationEnvelope(value: Record<string, unknown>): boolean {\n return \"item\" in value && Array.isArray(value[CHANGED_FIELDS_KEY]);\n}\n\nfunction isUpdateManyMutationEnvelope(value: Record<string, unknown>): boolean {\n return (\n typeof value.mode === \"string\" &&\n UPDATE_MANY_MUTATION_MODES.has(value.mode) &&\n Array.isArray(value[ROWS_KEY])\n );\n}\n\nfunction replaceRows(envelope: Record<string, unknown>, rows: unknown[]): Record<string, unknown> {\n const projected: Record<string, unknown> =\n Object.getPrototypeOf(envelope) === null ? Object.create(null) : {};\n Object.assign(projected, envelope);\n projected[ROWS_KEY] = rows;\n return projected;\n}\n\n/**\n * Returns a copy of a mutation result with the envelope `changed_fields` arrays\n * replaced by `changed_field_count` when compact mode is requested. Inputs that are\n * not a mutation envelope (or full mode) are returned unchanged (same reference).\n */\nexport function projectMutationResult(result: unknown, options: MutationProjectionOptions = {}): unknown {\n if (options.idOnly === true && isPlainObject(result) && isPlainObject(result.item)) {\n const id = typeof result.item.id === \"string\" ? result.item.id : undefined;\n const status = typeof result.item.status === \"string\" ? result.item.status : undefined;\n if (id) {\n return status ? { id, status } : { id };\n }\n }\n\n const mode = options.changedFields ?? \"full\";\n if (mode === \"full\" || !isPlainObject(result)) {\n return result;\n }\n\n let changed = false;\n let projected: Record<string, unknown> = result;\n\n const compactedTop = isMutationEnvelope(result) ? compactOwnChangedFields(result) : null;\n if (compactedTop !== null) {\n projected = compactedTop;\n changed = true;\n }\n\n // update-many reports its per-item delta under rows[*].changed_fields.\n const rows = isUpdateManyMutationEnvelope(projected) ? projected[ROWS_KEY] : undefined;\n if (Array.isArray(rows)) {\n let rowsChanged = false;\n const nextRows = rows.map((row) => {\n if (!isPlainObject(row)) {\n return row;\n }\n const compactedRow = compactOwnChangedFields(row);\n if (compactedRow) {\n rowsChanged = true;\n return compactedRow;\n }\n return row;\n });\n if (rowsChanged) {\n projected = replaceRows(projected, nextRows);\n changed = true;\n }\n }\n\n return changed ? projected : result;\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;;;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AAI,WAAW,EAAE,CAAC;YAChB,SAAS,GAAG,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YAC7C,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AACtC,CAAC","debugId":"3dd31047-1b72-59b3-a03a-50eed2c86ff3"}
|
|
@@ -3,6 +3,8 @@ export interface OutputOptions {
|
|
|
3
3
|
quiet?: boolean;
|
|
4
4
|
/** When true, mutation results drop the verbose changed_fields array (keeps changed_field_count). */
|
|
5
5
|
noChangedFields?: boolean;
|
|
6
|
+
/** When true, single-item mutation results print only id and status. */
|
|
7
|
+
idOnly?: boolean;
|
|
6
8
|
defaultOutputFormat?: "toon" | "json";
|
|
7
9
|
command?: string;
|
|
8
10
|
commandArgs?: string[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e5eeb823-9fe2-5c10-93b8-1d2ab95a411c")}catch(e){}}();
|
|
3
3
|
import { runActiveCommandOverride, runActiveRendererOverride, runActiveServiceOverrideSync, setActiveCommandResult, } from "../extensions/index.js";
|
|
4
4
|
import { EXIT_CODE } from "../shared/constants.js";
|
|
5
5
|
import { projectMutationResult } from "./mutation-projection.js";
|
|
@@ -234,7 +234,11 @@ export function formatOutput(result, options) {
|
|
|
234
234
|
return `${renderToonValue(compactedToon, 0)}\n`;
|
|
235
235
|
}
|
|
236
236
|
export function printResult(result, options) {
|
|
237
|
-
const projected = options.
|
|
237
|
+
const projected = options.idOnly
|
|
238
|
+
? projectMutationResult(result, { idOnly: true })
|
|
239
|
+
: options.noChangedFields
|
|
240
|
+
? projectMutationResult(result, { changedFields: "compact" })
|
|
241
|
+
: result;
|
|
238
242
|
const rendered = formatOutput(projected, options);
|
|
239
243
|
if (options.quiet) {
|
|
240
244
|
return;
|
|
@@ -249,4 +253,4 @@ export function printError(message) {
|
|
|
249
253
|
writeStderr(rendered.endsWith("\n") ? rendered : `${rendered}\n`);
|
|
250
254
|
}
|
|
251
255
|
//# sourceMappingURL=output.js.map
|
|
252
|
-
//# debugId=
|
|
256
|
+
//# debugId=e5eeb823-9fe2-5c10-93b8-1d2ab95a411c
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sources":["core/output/output.ts"],"sourceRoot":"/","sourcesContent":["import {\n runActiveCommandOverride,\n runActiveRendererOverride,\n runActiveServiceOverrideSync,\n setActiveCommandResult,\n} from \"../extensions/index.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { projectMutationResult } from \"./mutation-projection.js\";\n\nexport interface OutputOptions {\n json?: boolean;\n quiet?: boolean;\n /** When true, mutation results drop the verbose changed_fields array (keeps changed_field_count). */\n noChangedFields?: boolean;\n defaultOutputFormat?: \"toon\" | \"json\";\n command?: string;\n commandArgs?: string[];\n commandOptions?: Record<string, unknown>;\n pmRoot?: string;\n}\n\ninterface NodeLikeError {\n code?: string;\n}\n\nconst NATIVE_OUTPUT_MARKER = \"__pm_native_output\";\n\nlet streamErrorHandlersInstalled = false;\ntype OutputStreamTarget = \"stdout\" | \"stderr\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction shouldUseNativeOutput(result: unknown): boolean {\n return isPlainObject(result) && result[NATIVE_OUTPUT_MARKER] === true;\n}\n\nfunction stripNativeOutputMarker<T>(result: T): T {\n if (!isPlainObject(result) || result[NATIVE_OUTPUT_MARKER] !== true) {\n return result;\n }\n const { [NATIVE_OUTPUT_MARKER]: _marker, ...rest } = result;\n return rest as T;\n}\n\nfunction isBrokenPipeError(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && (error as NodeLikeError).code === \"EPIPE\";\n}\n\nfunction markStdoutBrokenPipeExitCode(): void {\n if (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS) {\n process.exitCode = EXIT_CODE.SUCCESS;\n }\n}\n\nfunction markStderrBrokenPipeExitCode(): void {\n if (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS) {\n process.exitCode = EXIT_CODE.GENERIC_FAILURE;\n }\n}\n\nfunction markBrokenPipeExitCode(target: OutputStreamTarget): void {\n if (target === \"stdout\") {\n markStdoutBrokenPipeExitCode();\n return;\n }\n markStderrBrokenPipeExitCode();\n}\n\nfunction handleUnhandledStreamError(error: unknown): void {\n const unhandled = error instanceof Error ? error : new Error(String(error));\n setImmediate(() => {\n throw unhandled;\n });\n}\n\nfunction installStreamErrorHandlers(): void {\n if (streamErrorHandlersInstalled) {\n return;\n }\n streamErrorHandlersInstalled = true;\n process.stdout.on(\"error\", (error: unknown) => {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(\"stdout\");\n return;\n }\n handleUnhandledStreamError(error);\n });\n process.stderr.on(\"error\", (error: unknown) => {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(\"stderr\");\n return;\n }\n handleUnhandledStreamError(error);\n });\n}\n\nfunction writeToStream(target: OutputStreamTarget, text: string): boolean {\n installStreamErrorHandlers();\n try {\n if (target === \"stdout\") {\n process.stdout.write(text);\n } else {\n process.stderr.write(text);\n }\n return true;\n } catch (error: unknown) {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(target);\n return false;\n }\n throw error;\n }\n}\n\nexport function writeStdout(text: string): boolean {\n return writeToStream(\"stdout\", text);\n}\n\nexport function writeStderr(text: string): boolean {\n return writeToStream(\"stderr\", text);\n}\n\nfunction renderScalar(value: unknown): string {\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n if (value === null) return \"null\";\n return JSON.stringify(value);\n}\n\nfunction compactToonValue(value: unknown): unknown | undefined {\n if (value === null || value === undefined) {\n return undefined;\n }\n\n if (Array.isArray(value)) {\n const compactedEntries = value\n .map((entry) => compactToonValue(entry))\n .filter((entry): entry is unknown => entry !== undefined);\n return compactedEntries.length > 0 ? compactedEntries : undefined;\n }\n\n if (isPlainObject(value)) {\n const compacted: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n const compactedEntry = compactToonValue(entry);\n if (compactedEntry !== undefined) {\n compacted[key] = compactedEntry;\n }\n }\n return Object.keys(compacted).length > 0 ? compacted : undefined;\n }\n\n return value;\n}\n\nfunction renderToonValue(value: unknown, depth: number): string {\n const indent = \" \".repeat(depth);\n\n if (Array.isArray(value)) {\n if (value.length === 0) return \"[]\";\n return value\n .map((entry) => {\n if (!isPlainObject(entry) && !Array.isArray(entry)) {\n return `${indent}- ${renderScalar(entry)}`;\n }\n const rendered = renderToonValue(entry, depth + 1);\n const lines = rendered.split(\"\\n\");\n const [firstLine, ...rest] = lines;\n if (rest.length === 0) {\n return `${indent}- ${firstLine.trimStart()}`;\n }\n return `${indent}- ${firstLine.trimStart()}\\n${rest.join(\"\\n\")}`;\n })\n .join(\"\\n\");\n }\n\n if (isPlainObject(value)) {\n const entries = Object.entries(value);\n if (entries.length === 0) return \"{}\";\n return entries\n .map(([key, entry]) => {\n if (!isPlainObject(entry) && !Array.isArray(entry)) {\n return `${indent}${key}: ${renderScalar(entry)}`;\n }\n if (Array.isArray(entry) && entry.length === 0) {\n return `${indent}${key}: []`;\n }\n if (isPlainObject(entry) && Object.keys(entry).length === 0) {\n return `${indent}${key}: {}`;\n }\n return `${indent}${key}:\\n${renderToonValue(entry, depth + 1)}`;\n })\n .join(\"\\n\");\n }\n\n return `${indent}${renderScalar(value)}`;\n}\n\nfunction renderDefaultMarkdownResult(value: unknown): string | null {\n if (!isPlainObject(value) || value.output_default !== \"markdown\") {\n return null;\n }\n if (typeof value.view !== \"string\" || !Array.isArray(value.events) || !Array.isArray(value.days)) {\n return null;\n }\n const lines = [`# pm calendar (${value.view})`, \"\"];\n const summary = isPlainObject(value.summary) ? value.summary : {};\n lines.push(`- events: ${String(summary.events ?? 0)}`);\n lines.push(\"\");\n if (value.events.length === 0) {\n lines.push(\"No calendar events matched the selected filters.\");\n return `${lines.join(\"\\n\")}\\n`;\n }\n for (const event of value.events) {\n if (!isPlainObject(event)) {\n continue;\n }\n const kind = typeof event.kind === \"string\" ? event.kind : \"event\";\n const title = typeof event.item_title === \"string\" ? event.item_title : \"\";\n const itemId = typeof event.item_id === \"string\" ? event.item_id : \"\";\n const reminderText = typeof event.reminder_text === \"string\" && event.reminder_text.length > 0 ? ` ${event.reminder_text}` : \"\";\n lines.push(`- [${kind}] ${itemId} ${title}${reminderText}`.trim());\n }\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport function formatOutput(result: unknown, options: OutputOptions): string {\n const commandOverride = runActiveCommandOverride(result);\n const nativeOutput = shouldUseNativeOutput(commandOverride.result);\n const effectiveResult = stripNativeOutputMarker(commandOverride.result);\n setActiveCommandResult(effectiveResult);\n const format =\n options.json === true\n ? \"json\"\n : options.json === false\n ? \"toon\"\n : options.defaultOutputFormat === \"json\"\n ? \"json\"\n : \"toon\";\n const serviceOverride = nativeOutput ? { handled: false, result: effectiveResult } : runActiveServiceOverrideSync(\"output_format\", {\n command: options.command,\n args: options.commandArgs,\n command_options: options.commandOptions,\n global: { ...options },\n pm_root: options.pmRoot,\n format,\n options: { ...options },\n result: effectiveResult,\n });\n if (serviceOverride.handled && typeof serviceOverride.result === \"string\") {\n return serviceOverride.result.endsWith(\"\\n\") ? serviceOverride.result : `${serviceOverride.result}\\n`;\n }\n const outputResult = serviceOverride.handled ? serviceOverride.result : effectiveResult;\n if (format === \"toon\") {\n const markdownDefault = renderDefaultMarkdownResult(outputResult);\n if (markdownDefault !== null) {\n return markdownDefault;\n }\n }\n const rendererOverride = nativeOutput ? { rendered: null } : runActiveRendererOverride(format, outputResult);\n if (rendererOverride.rendered !== null) {\n return rendererOverride.rendered.endsWith(\"\\n\") ? rendererOverride.rendered : `${rendererOverride.rendered}\\n`;\n }\n if (format === \"json\") {\n return `${JSON.stringify(outputResult, null, 2)}\\n`;\n }\n const compactedToon = compactToonValue(outputResult);\n if (compactedToon === undefined) {\n return \"{}\\n\";\n }\n return `${renderToonValue(compactedToon, 0)}\\n`;\n}\n\nexport function printResult(result: unknown, options: OutputOptions): void {\n const projected = options.noChangedFields ? projectMutationResult(result, { changedFields: \"compact\" }) : result;\n const rendered = formatOutput(projected, options);\n if (options.quiet) {\n return;\n }\n writeStdout(rendered);\n}\n\nexport function printError(message: string): void {\n const override = runActiveServiceOverrideSync(\"error_format\", {\n message,\n });\n const rendered = override.handled && typeof override.result === \"string\" ? override.result : message;\n writeStderr(rendered.endsWith(\"\\n\") ? rendered : `${rendered}\\n`);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAkBjE,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAElD,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAGzC,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAe;IAC5C,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,o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AAO,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IACD,MAAM,aAAa,GAAG,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACrD,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,GAAG,eAAe,CAAC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,MAAe,EAAE,OAAsB;IACjE,MAAM,SAAS,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,qBAAqB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IACjH,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IACD,WAAW,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,QAAQ,GAAG,4BAA4B,CAAC,cAAc,EAAE;QAC5D,OAAO;KACR,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACrG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,CAAC,CAAC;AACpE,CAAC","debugId":"9759da9d-e64a-537d-99ac-6e25ee5357a6"}
|
|
1
|
+
{"version":3,"file":"output.js","sources":["core/output/output.ts"],"sourceRoot":"/","sourcesContent":["import {\n runActiveCommandOverride,\n runActiveRendererOverride,\n runActiveServiceOverrideSync,\n setActiveCommandResult,\n} from \"../extensions/index.js\";\nimport { EXIT_CODE } from \"../shared/constants.js\";\nimport { projectMutationResult } from \"./mutation-projection.js\";\n\nexport interface OutputOptions {\n json?: boolean;\n quiet?: boolean;\n /** When true, mutation results drop the verbose changed_fields array (keeps changed_field_count). */\n noChangedFields?: boolean;\n /** When true, single-item mutation results print only id and status. */\n idOnly?: boolean;\n defaultOutputFormat?: \"toon\" | \"json\";\n command?: string;\n commandArgs?: string[];\n commandOptions?: Record<string, unknown>;\n pmRoot?: string;\n}\n\ninterface NodeLikeError {\n code?: string;\n}\n\nconst NATIVE_OUTPUT_MARKER = \"__pm_native_output\";\n\nlet streamErrorHandlersInstalled = false;\ntype OutputStreamTarget = \"stdout\" | \"stderr\";\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction shouldUseNativeOutput(result: unknown): boolean {\n return isPlainObject(result) && result[NATIVE_OUTPUT_MARKER] === true;\n}\n\nfunction stripNativeOutputMarker<T>(result: T): T {\n if (!isPlainObject(result) || result[NATIVE_OUTPUT_MARKER] !== true) {\n return result;\n }\n const { [NATIVE_OUTPUT_MARKER]: _marker, ...rest } = result;\n return rest as T;\n}\n\nfunction isBrokenPipeError(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && (error as NodeLikeError).code === \"EPIPE\";\n}\n\nfunction markStdoutBrokenPipeExitCode(): void {\n if (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS) {\n process.exitCode = EXIT_CODE.SUCCESS;\n }\n}\n\nfunction markStderrBrokenPipeExitCode(): void {\n if (process.exitCode === undefined || process.exitCode === EXIT_CODE.SUCCESS) {\n process.exitCode = EXIT_CODE.GENERIC_FAILURE;\n }\n}\n\nfunction markBrokenPipeExitCode(target: OutputStreamTarget): void {\n if (target === \"stdout\") {\n markStdoutBrokenPipeExitCode();\n return;\n }\n markStderrBrokenPipeExitCode();\n}\n\nfunction handleUnhandledStreamError(error: unknown): void {\n const unhandled = error instanceof Error ? error : new Error(String(error));\n setImmediate(() => {\n throw unhandled;\n });\n}\n\nfunction installStreamErrorHandlers(): void {\n if (streamErrorHandlersInstalled) {\n return;\n }\n streamErrorHandlersInstalled = true;\n process.stdout.on(\"error\", (error: unknown) => {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(\"stdout\");\n return;\n }\n handleUnhandledStreamError(error);\n });\n process.stderr.on(\"error\", (error: unknown) => {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(\"stderr\");\n return;\n }\n handleUnhandledStreamError(error);\n });\n}\n\nfunction writeToStream(target: OutputStreamTarget, text: string): boolean {\n installStreamErrorHandlers();\n try {\n if (target === \"stdout\") {\n process.stdout.write(text);\n } else {\n process.stderr.write(text);\n }\n return true;\n } catch (error: unknown) {\n if (isBrokenPipeError(error)) {\n markBrokenPipeExitCode(target);\n return false;\n }\n throw error;\n }\n}\n\nexport function writeStdout(text: string): boolean {\n return writeToStream(\"stdout\", text);\n}\n\nexport function writeStderr(text: string): boolean {\n return writeToStream(\"stderr\", text);\n}\n\nfunction renderScalar(value: unknown): string {\n if (typeof value === \"string\") return JSON.stringify(value);\n if (typeof value === \"number\" || typeof value === \"boolean\") return String(value);\n if (value === null) return \"null\";\n return JSON.stringify(value);\n}\n\nfunction compactToonValue(value: unknown): unknown | undefined {\n if (value === null || value === undefined) {\n return undefined;\n }\n\n if (Array.isArray(value)) {\n const compactedEntries = value\n .map((entry) => compactToonValue(entry))\n .filter((entry): entry is unknown => entry !== undefined);\n return compactedEntries.length > 0 ? compactedEntries : undefined;\n }\n\n if (isPlainObject(value)) {\n const compacted: Record<string, unknown> = {};\n for (const [key, entry] of Object.entries(value)) {\n const compactedEntry = compactToonValue(entry);\n if (compactedEntry !== undefined) {\n compacted[key] = compactedEntry;\n }\n }\n return Object.keys(compacted).length > 0 ? compacted : undefined;\n }\n\n return value;\n}\n\nfunction renderToonValue(value: unknown, depth: number): string {\n const indent = \" \".repeat(depth);\n\n if (Array.isArray(value)) {\n if (value.length === 0) return \"[]\";\n return value\n .map((entry) => {\n if (!isPlainObject(entry) && !Array.isArray(entry)) {\n return `${indent}- ${renderScalar(entry)}`;\n }\n const rendered = renderToonValue(entry, depth + 1);\n const lines = rendered.split(\"\\n\");\n const [firstLine, ...rest] = lines;\n if (rest.length === 0) {\n return `${indent}- ${firstLine.trimStart()}`;\n }\n return `${indent}- ${firstLine.trimStart()}\\n${rest.join(\"\\n\")}`;\n })\n .join(\"\\n\");\n }\n\n if (isPlainObject(value)) {\n const entries = Object.entries(value);\n if (entries.length === 0) return \"{}\";\n return entries\n .map(([key, entry]) => {\n if (!isPlainObject(entry) && !Array.isArray(entry)) {\n return `${indent}${key}: ${renderScalar(entry)}`;\n }\n if (Array.isArray(entry) && entry.length === 0) {\n return `${indent}${key}: []`;\n }\n if (isPlainObject(entry) && Object.keys(entry).length === 0) {\n return `${indent}${key}: {}`;\n }\n return `${indent}${key}:\\n${renderToonValue(entry, depth + 1)}`;\n })\n .join(\"\\n\");\n }\n\n return `${indent}${renderScalar(value)}`;\n}\n\nfunction renderDefaultMarkdownResult(value: unknown): string | null {\n if (!isPlainObject(value) || value.output_default !== \"markdown\") {\n return null;\n }\n if (typeof value.view !== \"string\" || !Array.isArray(value.events) || !Array.isArray(value.days)) {\n return null;\n }\n const lines = [`# pm calendar (${value.view})`, \"\"];\n const summary = isPlainObject(value.summary) ? value.summary : {};\n lines.push(`- events: ${String(summary.events ?? 0)}`);\n lines.push(\"\");\n if (value.events.length === 0) {\n lines.push(\"No calendar events matched the selected filters.\");\n return `${lines.join(\"\\n\")}\\n`;\n }\n for (const event of value.events) {\n if (!isPlainObject(event)) {\n continue;\n }\n const kind = typeof event.kind === \"string\" ? event.kind : \"event\";\n const title = typeof event.item_title === \"string\" ? event.item_title : \"\";\n const itemId = typeof event.item_id === \"string\" ? event.item_id : \"\";\n const reminderText = typeof event.reminder_text === \"string\" && event.reminder_text.length > 0 ? ` ${event.reminder_text}` : \"\";\n lines.push(`- [${kind}] ${itemId} ${title}${reminderText}`.trim());\n }\n return `${lines.join(\"\\n\")}\\n`;\n}\n\nexport function formatOutput(result: unknown, options: OutputOptions): string {\n const commandOverride = runActiveCommandOverride(result);\n const nativeOutput = shouldUseNativeOutput(commandOverride.result);\n const effectiveResult = stripNativeOutputMarker(commandOverride.result);\n setActiveCommandResult(effectiveResult);\n const format =\n options.json === true\n ? \"json\"\n : options.json === false\n ? \"toon\"\n : options.defaultOutputFormat === \"json\"\n ? \"json\"\n : \"toon\";\n const serviceOverride = nativeOutput ? { handled: false, result: effectiveResult } : runActiveServiceOverrideSync(\"output_format\", {\n command: options.command,\n args: options.commandArgs,\n command_options: options.commandOptions,\n global: { ...options },\n pm_root: options.pmRoot,\n format,\n options: { ...options },\n result: effectiveResult,\n });\n if (serviceOverride.handled && typeof serviceOverride.result === \"string\") {\n return serviceOverride.result.endsWith(\"\\n\") ? serviceOverride.result : `${serviceOverride.result}\\n`;\n }\n const outputResult = serviceOverride.handled ? serviceOverride.result : effectiveResult;\n if (format === \"toon\") {\n const markdownDefault = renderDefaultMarkdownResult(outputResult);\n if (markdownDefault !== null) {\n return markdownDefault;\n }\n }\n const rendererOverride = nativeOutput ? { rendered: null } : runActiveRendererOverride(format, outputResult);\n if (rendererOverride.rendered !== null) {\n return rendererOverride.rendered.endsWith(\"\\n\") ? rendererOverride.rendered : `${rendererOverride.rendered}\\n`;\n }\n if (format === \"json\") {\n return `${JSON.stringify(outputResult, null, 2)}\\n`;\n }\n const compactedToon = compactToonValue(outputResult);\n if (compactedToon === undefined) {\n return \"{}\\n\";\n }\n return `${renderToonValue(compactedToon, 0)}\\n`;\n}\n\nexport function printResult(result: unknown, options: OutputOptions): void {\n const projected = options.idOnly\n ? projectMutationResult(result, { idOnly: true })\n : options.noChangedFields\n ? projectMutationResult(result, { changedFields: \"compact\" })\n : result;\n const rendered = formatOutput(projected, options);\n if (options.quiet) {\n return;\n }\n writeStdout(rendered);\n}\n\nexport function printError(message: string): void {\n const override = runActiveServiceOverrideSync(\"error_format\", {\n message,\n });\n const rendered = override.handled && typeof override.result === \"string\" ? override.result : message;\n writeStderr(rendered.endsWith(\"\\n\") ? rendered : `${rendered}\\n`);\n}\n"],"names":[],"mappings":";;AAAA,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAoBjE,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAElD,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAGzC,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,SAAS,qBAAqB,CAAC,MAAe;IAC5C,OAAO,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,oBAAoB,CAAC,KAAK,IAAI,CAAC;AACxE,CAAC;AAED,SAAS,uBAAuB,CAAI,MAAS;IAC3C,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,oBAAoB,CAAC,KAAK,IAAI,EAAE,CAAC;QACpE,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,MAAM,EAAE,CAAC,oBAAoB,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC;IAC5D,OAAO,IAAS,CAAC;AACnB,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAK,KAAuB,CAAC,IAAI,KAAK,OAAO,CAAC;AAClG,CAAC;AAED,SAAS,4BAA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AAC,eAAe;YACvB,CAAC,CAAC,qBAAqB,CAAC,MAAM,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;YAC7D,CAAC,CAAC,MAAM,CAAC;IACb,MAAM,QAAQ,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO;IACT,CAAC;IACD,WAAW,CAAC,QAAQ,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,MAAM,QAAQ,GAAG,4BAA4B,CAAC,cAAc,EAAE;QAC5D,OAAO;KACR,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;IACrG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,CAAC,CAAC;AACpE,CAAC","debugId":"e5eeb823-9fe2-5c10-93b8-1d2ab95a411c"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applied-query echo for agent-facing list/search results (pm-rmjy).
|
|
3
|
+
*
|
|
4
|
+
* Narrow MCP tools accept filters nested inside `options: {}`, so an agent has
|
|
5
|
+
* no structured confirmation of which filters were actually applied or which
|
|
6
|
+
* projection mode resolved. `withQuerySummary` attaches a small `query_summary`
|
|
7
|
+
* block ({ filters, projection }) to the result so the feedback loop closes
|
|
8
|
+
* without the agent re-echoing its inputs.
|
|
9
|
+
*/
|
|
10
|
+
export interface QuerySummary {
|
|
11
|
+
filters: Record<string, unknown>;
|
|
12
|
+
projection: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Resolve the projection label implied by list/search projection options.
|
|
16
|
+
* Used when the result payload itself carries no projection metadata (the
|
|
17
|
+
* compact summary paths omit it for token efficiency).
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveQueryProjectionLabel(options: Record<string, unknown>): string;
|
|
20
|
+
/**
|
|
21
|
+
* Attach a `query_summary` to a list/search result.
|
|
22
|
+
*
|
|
23
|
+
* `brief` is the most specific requested label, so it wins outright (the list
|
|
24
|
+
* command reports brief as projection mode "compact" with narrowed fields).
|
|
25
|
+
* Otherwise the result's own `projection.mode` states the resolved mode for
|
|
26
|
+
* verbose payloads, and the options-derived label covers the compact summary
|
|
27
|
+
* paths that omit projection metadata.
|
|
28
|
+
*/
|
|
29
|
+
export declare function withQuerySummary<T extends Record<string, unknown>>(result: T, options: Record<string, unknown>): T & {
|
|
30
|
+
query_summary: QuerySummary;
|
|
31
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applied-query echo for agent-facing list/search results (pm-rmjy).
|
|
3
|
+
*
|
|
4
|
+
* Narrow MCP tools accept filters nested inside `options: {}`, so an agent has
|
|
5
|
+
* no structured confirmation of which filters were actually applied or which
|
|
6
|
+
* projection mode resolved. `withQuerySummary` attaches a small `query_summary`
|
|
7
|
+
* block ({ filters, projection }) to the result so the feedback loop closes
|
|
8
|
+
* without the agent re-echoing its inputs.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
!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]="1f071316-a968-5ca1-92c7-79931b2156c5")}catch(e){}}();
|
|
12
|
+
function isRecord(value) {
|
|
13
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Resolve the projection label implied by list/search projection options.
|
|
17
|
+
* Used when the result payload itself carries no projection metadata (the
|
|
18
|
+
* compact summary paths omit it for token efficiency).
|
|
19
|
+
*/
|
|
20
|
+
export function resolveQueryProjectionLabel(options) {
|
|
21
|
+
if (options.brief === true) {
|
|
22
|
+
return "brief";
|
|
23
|
+
}
|
|
24
|
+
if (typeof options.fields === "string" && options.fields.trim().length > 0) {
|
|
25
|
+
return "fields";
|
|
26
|
+
}
|
|
27
|
+
// The MCP boundary coerces fields arrays to CSV, but tolerate array input
|
|
28
|
+
// here too so direct callers get the same projection label.
|
|
29
|
+
if (Array.isArray(options.fields) && options.fields.length > 0) {
|
|
30
|
+
return "fields";
|
|
31
|
+
}
|
|
32
|
+
if (options.compact === true) {
|
|
33
|
+
return "compact";
|
|
34
|
+
}
|
|
35
|
+
return "full";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Attach a `query_summary` to a list/search result.
|
|
39
|
+
*
|
|
40
|
+
* `brief` is the most specific requested label, so it wins outright (the list
|
|
41
|
+
* command reports brief as projection mode "compact" with narrowed fields).
|
|
42
|
+
* Otherwise the result's own `projection.mode` states the resolved mode for
|
|
43
|
+
* verbose payloads, and the options-derived label covers the compact summary
|
|
44
|
+
* paths that omit projection metadata.
|
|
45
|
+
*/
|
|
46
|
+
export function withQuerySummary(result, options) {
|
|
47
|
+
const requestedLabel = resolveQueryProjectionLabel(options);
|
|
48
|
+
const projection = requestedLabel === "brief"
|
|
49
|
+
? requestedLabel
|
|
50
|
+
: isRecord(result.projection) && typeof result.projection.mode === "string"
|
|
51
|
+
? result.projection.mode
|
|
52
|
+
: requestedLabel;
|
|
53
|
+
return {
|
|
54
|
+
...result,
|
|
55
|
+
query_summary: {
|
|
56
|
+
filters: isRecord(result.filters) ? result.filters : {},
|
|
57
|
+
projection,
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=query-summary.js.map
|
|
62
|
+
//# debugId=1f071316-a968-5ca1-92c7-79931b2156c5
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-summary.js","sources":["core/output/query-summary.ts"],"sourceRoot":"/","sourcesContent":["/**\n * Applied-query echo for agent-facing list/search results (pm-rmjy).\n *\n * Narrow MCP tools accept filters nested inside `options: {}`, so an agent has\n * no structured confirmation of which filters were actually applied or which\n * projection mode resolved. `withQuerySummary` attaches a small `query_summary`\n * block ({ filters, projection }) to the result so the feedback loop closes\n * without the agent re-echoing its inputs.\n */\n\nexport interface QuerySummary {\n filters: Record<string, unknown>;\n projection: string;\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return value !== null && typeof value === \"object\" && !Array.isArray(value);\n}\n\n/**\n * Resolve the projection label implied by list/search projection options.\n * Used when the result payload itself carries no projection metadata (the\n * compact summary paths omit it for token efficiency).\n */\nexport function resolveQueryProjectionLabel(options: Record<string, unknown>): string {\n if (options.brief === true) {\n return \"brief\";\n }\n if (typeof options.fields === \"string\" && options.fields.trim().length > 0) {\n return \"fields\";\n }\n // The MCP boundary coerces fields arrays to CSV, but tolerate array input\n // here too so direct callers get the same projection label.\n if (Array.isArray(options.fields) && options.fields.length > 0) {\n return \"fields\";\n }\n if (options.compact === true) {\n return \"compact\";\n }\n return \"full\";\n}\n\n/**\n * Attach a `query_summary` to a list/search result.\n *\n * `brief` is the most specific requested label, so it wins outright (the list\n * command reports brief as projection mode \"compact\" with narrowed fields).\n * Otherwise the result's own `projection.mode` states the resolved mode for\n * verbose payloads, and the options-derived label covers the compact summary\n * paths that omit projection metadata.\n */\nexport function withQuerySummary<T extends Record<string, unknown>>(\n result: T,\n options: Record<string, unknown>,\n): T & { query_summary: QuerySummary } {\n const requestedLabel = resolveQueryProjectionLabel(options);\n const projection = requestedLabel === \"brief\"\n ? requestedLabel\n : isRecord(result.projection) && typeof result.projection.mode === \"string\"\n ? result.projection.mode\n : requestedLabel;\n return {\n ...result,\n query_summary: {\n filters: isRecord(result.filters) ? result.filters : {},\n projection,\n },\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;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E,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YACvD,UAAU;SACX;KACF,CAAC;AACJ,CAAC","debugId":"1f071316-a968-5ca1-92c7-79931b2156c5"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="a7bd60f6-d84d-5d48-bf68-1ba2e1dff951")}catch(e){}}();
|
|
3
3
|
export {};
|
|
4
4
|
//# sourceMappingURL=command-types.js.map
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=a7bd60f6-d84d-5d48-bf68-1ba2e1dff951
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-types.js","sources":["core/shared/command-types.ts"],"sourceRoot":"/","sourcesContent":["export interface GlobalOptions {\n json?: boolean;\n quiet?: boolean;\n noChangedFields?: boolean;\n path?: string;\n noExtensions?: boolean;\n noPager?: boolean;\n profile?: boolean;\n defaultOutputFormat?: \"toon\" | \"json\";\n}\n"],"names":[],"mappings":"","debugId":"
|
|
1
|
+
{"version":3,"file":"command-types.js","sources":["core/shared/command-types.ts"],"sourceRoot":"/","sourcesContent":["export interface GlobalOptions {\n json?: boolean;\n quiet?: boolean;\n noChangedFields?: boolean;\n idOnly?: boolean;\n path?: string;\n noExtensions?: boolean;\n noPager?: boolean;\n profile?: boolean;\n defaultOutputFormat?: \"toon\" | \"json\";\n}\n"],"names":[],"mappings":"","debugId":"a7bd60f6-d84d-5d48-bf68-1ba2e1dff951"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aaaabb17-ee0f-5c5d-8111-3406542035c3")}catch(e){}}();
|
|
3
3
|
import { createDefaultExtensionGovernancePolicy } from "../extensions/extension-types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Canonical default lifecycle status model and workflow role mapping.
|
|
@@ -142,6 +142,7 @@ export const FRONT_MATTER_KEY_ORDER = [
|
|
|
142
142
|
"test_runs",
|
|
143
143
|
"docs",
|
|
144
144
|
"close_reason",
|
|
145
|
+
"duplicate_of",
|
|
145
146
|
"plan_mode",
|
|
146
147
|
"plan_scope",
|
|
147
148
|
"plan_harness",
|
|
@@ -157,7 +158,7 @@ export const GOVERNANCE_PRESET_DEFAULTS = {
|
|
|
157
158
|
create_mode_default: "progressive",
|
|
158
159
|
close_validation_default: "off",
|
|
159
160
|
require_close_reason: true,
|
|
160
|
-
parent_reference: "
|
|
161
|
+
parent_reference: "strict_error",
|
|
161
162
|
metadata_profile: "core",
|
|
162
163
|
force_required_for_stale_lock: false,
|
|
163
164
|
},
|
|
@@ -166,7 +167,7 @@ export const GOVERNANCE_PRESET_DEFAULTS = {
|
|
|
166
167
|
create_mode_default: "progressive",
|
|
167
168
|
close_validation_default: "warn",
|
|
168
169
|
require_close_reason: true,
|
|
169
|
-
parent_reference: "
|
|
170
|
+
parent_reference: "strict_error",
|
|
170
171
|
metadata_profile: "core",
|
|
171
172
|
force_required_for_stale_lock: true,
|
|
172
173
|
},
|
|
@@ -311,6 +312,8 @@ export const SETTINGS_DEFAULTS = {
|
|
|
311
312
|
hierarchy: true,
|
|
312
313
|
activity: true,
|
|
313
314
|
progress: true,
|
|
315
|
+
recently_created: true,
|
|
316
|
+
unparented: true,
|
|
314
317
|
blockers: true,
|
|
315
318
|
files: true,
|
|
316
319
|
workload: true,
|
|
@@ -348,6 +351,7 @@ export const TELEMETRY_ERROR_CATEGORY_BY_CODE = Object.freeze({
|
|
|
348
351
|
missing_required_option: "usage",
|
|
349
352
|
missing_required_argument: "usage",
|
|
350
353
|
invalid_command_usage: "usage",
|
|
354
|
+
linked_test_value_not_quoted: "usage",
|
|
351
355
|
invalid_argument_value: "validation",
|
|
352
356
|
health_findings: "validation",
|
|
353
357
|
validation_findings: "validation",
|
|
@@ -387,4 +391,4 @@ export function resolveTelemetryErrorCategory(errorCode) {
|
|
|
387
391
|
return "unknown";
|
|
388
392
|
}
|
|
389
393
|
//# sourceMappingURL=constants.js.map
|
|
390
|
-
//# debugId=
|
|
394
|
+
//# debugId=aaaabb17-ee0f-5c5d-8111-3406542035c3
|