@unbrained/pm-cli 2026.7.14 → 2026.7.15
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 +2 -2
- package/CHANGELOG.md +48 -0
- package/README.md +14 -11
- package/dist/cli/argv-utils.d.ts +1 -4
- package/dist/cli/argv-utils.js +3 -13
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.d.ts +6 -4
- package/dist/cli/bootstrap-args.js +51 -16
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/bundle-integrity.d.ts +49 -0
- package/dist/cli/bundle-integrity.js +111 -0
- package/dist/cli/bundle-integrity.js.map +1 -0
- package/dist/cli/commands/completion.js +7 -2
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.d.ts +6 -163
- package/dist/cli/commands/config.js +4 -1133
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.d.ts +2 -4
- package/dist/cli/commands/context.js +10 -85
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/create.d.ts +1 -0
- package/dist/cli/commands/create.js +3 -2
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/extension/describe.d.ts +2 -91
- package/dist/cli/commands/extension/describe.js +4 -142
- package/dist/cli/commands/extension/describe.js.map +1 -1
- package/dist/cli/commands/extension/scaffold.d.ts +2 -36
- package/dist/cli/commands/extension/scaffold.js +4 -2435
- package/dist/cli/commands/extension/scaffold.js.map +1 -1
- package/dist/cli/commands/extension/shared.d.ts +2 -28
- package/dist/cli/commands/extension/shared.js +4 -130
- package/dist/cli/commands/extension/shared.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +3 -400
- package/dist/cli/commands/extension.js +4 -2183
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/gc.d.ts +6 -56
- package/dist/cli/commands/gc.js +4 -270
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +18 -5
- package/dist/cli/commands/get.js +117 -58
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/health.d.ts +6 -184
- package/dist/cli/commands/health.js +4 -1747
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-compact.d.ts +4 -139
- package/dist/cli/commands/history-compact.js +5 -510
- package/dist/cli/commands/history-compact.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +8 -120
- package/dist/cli/commands/history-redact.js +6 -581
- package/dist/cli/commands/history-redact.js.map +1 -1
- package/dist/cli/commands/history-repair.d.ts +7 -89
- package/dist/cli/commands/history-repair.js +5 -257
- package/dist/cli/commands/history-repair.js.map +1 -1
- package/dist/cli/commands/history.d.ts +1 -2
- package/dist/cli/commands/history.js +6 -48
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +3 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +6 -113
- package/dist/cli/commands/init-agent-guidance.js +4 -431
- package/dist/cli/commands/init-agent-guidance.js.map +1 -1
- package/dist/cli/commands/init.d.ts +6 -181
- package/dist/cli/commands/init.js +4 -690
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/next.js +3 -3
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/profile.d.ts +4 -174
- package/dist/cli/commands/profile.js +4 -425
- package/dist/cli/commands/profile.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +4 -19
- package/dist/cli/commands/restore.js +9 -158
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +7 -507
- package/dist/cli/commands/schema.js +5 -1254
- package/dist/cli/commands/schema.js.map +1 -1
- package/dist/cli/commands/test.d.ts +2 -4
- package/dist/cli/commands/test.js +7 -97
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +9 -249
- package/dist/cli/commands/validate.js +9 -2150
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/extension-command-help.js +18 -4
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.js +3 -3
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/help-content.js +7 -3
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/main.js +20 -30
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +4 -2
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +11 -3
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +4 -2
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.js +3 -2
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +782 -0
- package/dist/cli-bundle/chunks/{append-PVZJDM6J.js → append-OJQFUQ4T.js} +5 -5
- package/dist/cli-bundle/chunks/append-UZVHUO74.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js → chunk-2IFFUZLC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js → chunk-2JKGO6QX.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js → chunk-2NCIPMQP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js → chunk-2VPAVL7O.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js → chunk-2WSE6PO2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js → chunk-34L5OT3Y.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js → chunk-3AUGG2DP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js → chunk-3CLU2XZO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-N3CMP4NI.js → chunk-3S5QVM5H.js} +43 -7
- package/dist/cli-bundle/chunks/chunk-3S5QVM5H.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js +64 -0
- package/dist/cli-bundle/chunks/chunk-3U7ZR6M4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js → chunk-3WM75PWC.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-4223PVZT.js +121 -0
- package/dist/cli-bundle/chunks/chunk-4223PVZT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-5URI7TPJ.js → chunk-4XQ3BDV4.js} +281 -164
- package/dist/cli-bundle/chunks/chunk-4XQ3BDV4.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js → chunk-5JLUII3O.js} +13 -13
- package/dist/cli-bundle/chunks/{chunk-MKL4CP2I.js → chunk-5ZSLZLDN.js} +631 -246
- package/dist/cli-bundle/chunks/chunk-5ZSLZLDN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-Q37E63AM.js → chunk-6CFNAVTF.js} +21 -141
- package/dist/cli-bundle/chunks/chunk-6CFNAVTF.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js → chunk-6N2VXVTQ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js → chunk-6S3YSUYG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-ZUKSZVBW.js → chunk-7B67ZL4N.js} +8 -7
- package/dist/cli-bundle/chunks/chunk-7B67ZL4N.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-IA3YFTXT.js → chunk-7PIWCHTW.js} +11 -13
- package/dist/cli-bundle/chunks/chunk-7PIWCHTW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-BPD26E3P.js → chunk-7Z4LKRS4.js} +291 -81
- package/dist/cli-bundle/chunks/chunk-7Z4LKRS4.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js → chunk-AHVTB5I5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js → chunk-APRVSW2O.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js → chunk-B7PE22W6.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js → chunk-BCOFWYW4.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js → chunk-BEP7WJA2.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js +1114 -0
- package/dist/cli-bundle/chunks/chunk-BKVG6XOA.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js → chunk-BSEQUTQP.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-AFWZRL7M.js.map → chunk-BSEQUTQP.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js → chunk-CRVF2JDM.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js → chunk-DM4H7FP4.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-DUT67M43.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-44LNIULG.js → chunk-DYH63FX7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-LWTIRS3Y.js → chunk-E2OJMKML.js} +306 -82
- package/dist/cli-bundle/chunks/chunk-E2OJMKML.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js → chunk-EAB64KLB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js → chunk-EACOH7AU.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js → chunk-EH2OPHBI.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-HL7V2PHX.js.map → chunk-EH2OPHBI.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js → chunk-EJEXHTY5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js → chunk-EYLCSJAI.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-655STMGA.js → chunk-FMBNM2EN.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js → chunk-FNSPG7MU.js} +12 -12
- package/dist/cli-bundle/chunks/{chunk-5CT5BW6E.js → chunk-GM5QHQU6.js} +46 -40
- package/dist/cli-bundle/chunks/chunk-GM5QHQU6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FTQLW4JD.js → chunk-GOSLKLFE.js} +418 -24
- package/dist/cli-bundle/chunks/chunk-GOSLKLFE.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KB726FMH.js → chunk-H2Z3FYXQ.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js +162 -0
- package/dist/cli-bundle/chunks/chunk-H3EIEWGR.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2QIQGYPW.js → chunk-H5APFTHZ.js} +53 -10
- package/dist/cli-bundle/chunks/chunk-H5APFTHZ.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js +118 -0
- package/dist/cli-bundle/chunks/chunk-HDH3JUGG.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZAYYDNB3.js → chunk-HO4KXD6I.js} +22 -142
- package/dist/cli-bundle/chunks/chunk-HO4KXD6I.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js → chunk-HYB5AZ63.js} +203 -62
- package/dist/cli-bundle/chunks/{chunk-ILLUE5DI.js.map → chunk-HYB5AZ63.js.map} +3 -3
- package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js → chunk-IA5FKNII.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JL7WZ4O2.js → chunk-IG3SWA4A.js} +33 -9
- package/dist/cli-bundle/chunks/chunk-IG3SWA4A.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js → chunk-IJIICKVW.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IGED7NH2.js → chunk-ILX33QXL.js} +668 -251
- package/dist/cli-bundle/chunks/chunk-ILX33QXL.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UGTVWL3E.js → chunk-INU6DKT5.js} +47 -41
- package/dist/cli-bundle/chunks/chunk-INU6DKT5.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-UB2QYSTO.js → chunk-J5AOEGDC.js} +26 -18
- package/dist/cli-bundle/chunks/chunk-J5AOEGDC.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4DY4KPQI.js → chunk-J6364LFM.js} +1330 -937
- package/dist/cli-bundle/chunks/chunk-J6364LFM.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-DVOLZJ3C.js → chunk-J6EY5V4N.js} +1295 -939
- package/dist/cli-bundle/chunks/chunk-J6EY5V4N.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js +1097 -0
- package/dist/cli-bundle/chunks/chunk-JFTKLTEF.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js → chunk-JOUQZENX.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-J4NZOP3I.js → chunk-JXQUXVMI.js} +9 -8
- package/dist/cli-bundle/chunks/chunk-JXQUXVMI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js → chunk-JYFOV7FC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js → chunk-K2X6U4UA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6OTZMORS.js → chunk-K3WII2ME.js} +27 -27
- package/dist/cli-bundle/chunks/chunk-K3WII2ME.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js → chunk-KG44YSKD.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js → chunk-KPMKHGEA.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QASRVKUQ.js → chunk-LPYWLWDS.js} +257 -163
- package/dist/cli-bundle/chunks/chunk-LPYWLWDS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-RGXD5JJR.js → chunk-LSG2U345.js} +19 -12
- package/dist/cli-bundle/chunks/chunk-LSG2U345.js.map +7 -0
- package/dist/cli-bundle/chunks/chunk-MIQDDLB5.js +5 -0
- package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js → chunk-NLDFBC6J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js → chunk-NP22ERDF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js → chunk-NU3IMIEA.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js → chunk-NVPZIJVR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js → chunk-ODALILG3.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-CDJYP7OQ.js → chunk-ONG5V5CI.js} +190 -63
- package/dist/cli-bundle/chunks/chunk-ONG5V5CI.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js → chunk-ONREO4ST.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js +61 -0
- package/dist/cli-bundle/chunks/chunk-OW4JWD5M.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js → chunk-P74IZQ7A.js} +12 -12
- package/dist/cli-bundle/chunks/chunk-PENXZX3U.js +172 -0
- package/dist/cli-bundle/chunks/chunk-PENXZX3U.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js → chunk-PGY23YTC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js → chunk-PMOSXADO.js} +3 -3
- package/dist/cli-bundle/chunks/chunk-PNTULOGU.js +9 -0
- package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js → chunk-Q7A43DS4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js → chunk-QEHQ2GVG.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js → chunk-QIPLHNP7.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js → chunk-QKECXBBG.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-GXXC7QSK.js.map → chunk-QKECXBBG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js → chunk-QKJGPFAF.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-F7PSHRNO.js → chunk-QKXHFPYM.js} +27 -10
- package/dist/cli-bundle/chunks/chunk-QKXHFPYM.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js → chunk-RLCHOOHC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js → chunk-RMLWNPH2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js → chunk-RRM5JYJC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js → chunk-S6MQESFR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js → chunk-SDQLJWBO.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js → chunk-SELVXEZK.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-DYEX6NFH.js → chunk-TD3LVC7D.js} +438 -23
- package/dist/cli-bundle/chunks/chunk-TD3LVC7D.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js → chunk-TKOVBP6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js → chunk-TQSZFPIS.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js → chunk-TSMHDIW4.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js → chunk-UFXU44HV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js → chunk-ULTHRDBP.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js → chunk-UMOPHQSU.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-OI4S4KCI.js.map → chunk-UMOPHQSU.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js → chunk-UOHFKBUV.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-PHKP3AGR.js → chunk-UWQHLMEB.js} +35 -18
- package/dist/cli-bundle/chunks/chunk-UWQHLMEB.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6TTOHMTB.js → chunk-UXONS674.js} +45 -112
- package/dist/cli-bundle/chunks/chunk-UXONS674.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js → chunk-UY2ACEMF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-6PKA3SJQ.js → chunk-WQPUU7XD.js} +19 -28
- package/dist/cli-bundle/chunks/chunk-WQPUU7XD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7TQMR6LK.js → chunk-WT3ZEOGH.js} +70 -20
- package/dist/cli-bundle/chunks/chunk-WT3ZEOGH.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js → chunk-WUJQK4YV.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js → chunk-XSJUSQAE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6MHSBDGD.js → chunk-XXXF6PAQ.js} +50 -117
- package/dist/cli-bundle/chunks/chunk-XXXF6PAQ.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js → chunk-YAQEBNY7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-7QDSYUMF.js → chunk-YAROI3PD.js} +44 -21
- package/dist/cli-bundle/chunks/chunk-YAROI3PD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js → chunk-YBLZ2VE7.js} +13 -13
- package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js → chunk-YCQET3OT.js} +2 -2
- package/dist/cli-bundle/chunks/chunk-YUSOJDWM.js +9 -0
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js +58 -0
- package/dist/cli-bundle/chunks/chunk-YXSHIAUJ.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js → chunk-ZI6VQWQ7.js} +4 -4
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js +68 -0
- package/dist/cli-bundle/chunks/chunk-ZKRZY773.js.map +7 -0
- package/dist/cli-bundle/chunks/{close-LZECOMHO.js → close-CWODTPKG.js} +5 -5
- package/dist/cli-bundle/chunks/close-W6LI2PKM.js +12 -0
- package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js → close-many-CQFUY7MR.js} +15 -13
- package/dist/cli-bundle/chunks/close-many-DLDDVSH5.js +23 -0
- package/dist/cli-bundle/chunks/comments-E3TNTK24.js +13 -0
- package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js → comments-WGLHR7LB.js} +7 -7
- package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js → copy-LXVDXH7B.js} +4 -4
- package/dist/cli-bundle/chunks/copy-Q5ZJPUKR.js +9 -0
- package/dist/cli-bundle/chunks/{create-F53OBTOU.js → create-J5U6ND4K.js} +9 -9
- package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js → create-LBVCYMEG.js} +9 -9
- package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js → delete-PMJBNY5G.js} +4 -4
- package/dist/cli-bundle/chunks/delete-WNHB3LYW.js +10 -0
- package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js → deps-JZ7TMVCB.js} +7 -4
- package/dist/cli-bundle/chunks/{deps-U57I7EAK.js → deps-OA26IS25.js} +7 -4
- package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js → docs-FEWB2DQB.js} +6 -6
- package/dist/cli-bundle/chunks/docs-HA2AIDBB.js +14 -0
- package/dist/cli-bundle/chunks/{files-TBZD7V6H.js → files-6YFBJRBG.js} +6 -6
- package/dist/cli-bundle/chunks/{files-TTY6N2AV.js → files-EFIWKFTM.js} +6 -6
- package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js → focus-4QJR7FOQ.js} +5 -5
- package/dist/cli-bundle/chunks/focus-POIW5LTJ.js +10 -0
- package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js → history-compact-CKRPDTJN.js} +6 -10
- package/dist/cli-bundle/chunks/history-compact-FWG2C7FZ.js +16 -0
- package/dist/cli-bundle/chunks/history-redact-BB3TGDAE.js +15 -0
- package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js → history-redact-D225BHOZ.js} +5 -6
- package/dist/cli-bundle/chunks/history-repair-6GEAM7HE.js +16 -0
- package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js → history-repair-RQXKQHL4.js} +6 -8
- package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js → learnings-JLNLCOL5.js} +7 -7
- package/dist/cli-bundle/chunks/learnings-RSNLSWDC.js +13 -0
- package/dist/cli-bundle/chunks/notes-2WDH6DXU.js +13 -0
- package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js → notes-GB47XXQQ.js} +7 -7
- package/dist/cli-bundle/chunks/plan-DOVI2VMW.js +24 -0
- package/dist/cli-bundle/chunks/{plan-2NNEO46V.js → plan-VDCJ2PCN.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js → profile-FAU7NZML.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-U725ATWZ.js → profile-IVXQEL3D.js} +10 -10
- package/dist/cli-bundle/chunks/{register-list-query-BUWCYHBT.js → register-list-query-DKA3EH5D.js} +22 -19
- package/dist/cli-bundle/chunks/register-list-query-DKA3EH5D.js.map +7 -0
- package/dist/cli-bundle/chunks/{register-list-query-KTZ6AGE7.js → register-list-query-UL4UKBBN.js} +23 -20
- package/dist/cli-bundle/chunks/register-list-query-UL4UKBBN.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js → register-mutation-ARFHRW55.js} +36 -32
- package/dist/cli-bundle/chunks/{register-mutation-UELYYOR7.js.map → register-mutation-ARFHRW55.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-mutation-4FMGJJF7.js → register-mutation-RBBJ52DK.js} +37 -33
- package/dist/cli-bundle/chunks/register-mutation-RBBJ52DK.js.map +1 -0
- package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js → register-operations-ZIBBRSED.js} +41 -39
- package/dist/cli-bundle/chunks/{register-operations-JVW24J2Y.js.map → register-operations-ZIBBRSED.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js → register-operations-ZUJ5JWPE.js} +39 -37
- package/dist/cli-bundle/chunks/{register-operations-ISUX6LY5.js.map → register-operations-ZUJ5JWPE.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js → register-setup-BCVLFEYS.js} +29 -17
- package/dist/cli-bundle/chunks/{register-setup-5XNGKJ22.js.map → register-setup-BCVLFEYS.js.map} +2 -2
- package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js → register-setup-TDCGWIOS.js} +19 -18
- package/dist/cli-bundle/chunks/{register-setup-ZTNY6S7R.js.map → register-setup-TDCGWIOS.js.map} +1 -1
- package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js → restore-25DLT2Q2.js} +6 -6
- package/dist/cli-bundle/chunks/restore-YPMVUUEX.js +14 -0
- package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js → schema-FNU3WE4O.js} +7 -6
- package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js → schema-NBCM3RAD.js} +7 -6
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js +21 -0
- package/dist/cli-bundle/chunks/update-WWBYOPXO.js.map +7 -0
- package/dist/cli-bundle/chunks/{update-Q3UCILNR.js → update-XHSIAIXE.js} +12 -12
- package/dist/cli-bundle/chunks/update-XHSIAIXE.js.map +1 -0
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js +32 -0
- package/dist/cli-bundle/chunks/update-many-OUGIU5SF.js.map +7 -0
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js +36 -0
- package/dist/cli-bundle/chunks/update-many-TA7NGQBO.js.map +1 -0
- package/dist/cli-bundle/main.js +826 -43
- package/dist/cli-bundle/main.js.map +4 -4
- package/dist/cli-bundle/sdk-runtime.js +70 -57
- package/dist/cli-bundle/sdk-testing.js +6 -6
- package/dist/cli-bundle/sdk.js +876 -74
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/cli.js +5 -4
- package/dist/cli.js.map +1 -1
- package/dist/core/diagnostics/remediation.js +12 -2
- package/dist/core/diagnostics/remediation.js.map +1 -1
- package/dist/core/history/projection.d.ts +39 -0
- package/dist/core/history/projection.js +164 -0
- package/dist/core/history/projection.js.map +1 -0
- package/dist/core/history/read.d.ts +3 -0
- package/dist/core/history/read.js +55 -0
- package/dist/core/history/read.js.map +1 -0
- package/dist/core/output/output-control.d.ts +18 -0
- package/dist/core/output/output-control.js +26 -0
- package/dist/core/output/output-control.js.map +1 -0
- package/dist/core/output/output.js +20 -8
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/sentry/helpers.js +10 -2
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/shared/command-types.d.ts +2 -0
- package/dist/core/shared/command-types.js +2 -2
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/errors.d.ts +11 -0
- package/dist/core/shared/errors.js +2 -2
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/tool-definitions.js +5 -5
- package/dist/mcp/tool-definitions.js.map +1 -1
- package/dist/sdk/author-attribution.d.ts +35 -0
- package/dist/sdk/author-attribution.js +118 -0
- package/dist/sdk/author-attribution.js.map +1 -0
- package/dist/sdk/cli-contracts/command-aliases.d.ts +7 -0
- package/dist/sdk/cli-contracts/command-aliases.js +17 -0
- package/dist/sdk/cli-contracts/command-aliases.js.map +1 -0
- package/dist/sdk/cli-contracts/flag-contracts.js +5 -2
- package/dist/sdk/cli-contracts/flag-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-option-contracts.js +6 -2
- package/dist/sdk/cli-contracts/tool-option-contracts.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-parameter-tables.js +21 -2
- package/dist/sdk/cli-contracts/tool-parameter-tables.js.map +1 -1
- package/dist/sdk/cli-contracts/tool-schema.js +3 -3
- package/dist/sdk/cli-contracts/tool-schema.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +1 -0
- package/dist/sdk/cli-contracts.js +3 -2
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/cli-program.d.ts +8 -0
- package/dist/sdk/cli-program.js +39 -0
- package/dist/sdk/cli-program.js.map +1 -0
- package/dist/sdk/command-line.d.ts +11 -0
- package/dist/sdk/command-line.js +40 -0
- package/dist/sdk/command-line.js.map +1 -0
- package/dist/sdk/config.d.ts +163 -0
- package/dist/sdk/config.js +1087 -0
- package/dist/sdk/config.js.map +1 -0
- package/dist/sdk/context-relevance.d.ts +21 -0
- package/dist/sdk/context-relevance.js +70 -2
- package/dist/sdk/context-relevance.js.map +1 -1
- package/dist/sdk/dependencies.d.ts +15 -2
- package/dist/sdk/dependencies.js +97 -8
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/{cli/commands → sdk}/extension/bundled-catalog.d.ts +1 -1
- package/dist/{cli/commands → sdk}/extension/bundled-catalog.js +12 -12
- package/dist/sdk/extension/bundled-catalog.js.map +1 -0
- package/dist/sdk/extension/concurrency.d.ts +7 -0
- package/dist/sdk/extension/concurrency.js +26 -0
- package/dist/sdk/extension/concurrency.js.map +1 -0
- package/dist/sdk/extension/describe.d.ts +91 -0
- package/dist/sdk/extension/describe.js +144 -0
- package/dist/sdk/extension/describe.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/doctor.d.ts +3 -3
- package/dist/{cli/commands → sdk}/extension/doctor.js +7 -7
- package/dist/sdk/extension/doctor.js.map +1 -0
- package/dist/sdk/extension/install-runtime.d.ts +26 -0
- package/dist/sdk/extension/install-runtime.js +269 -0
- package/dist/sdk/extension/install-runtime.js.map +1 -0
- package/dist/sdk/extension/install-snapshot.d.ts +23 -0
- package/dist/sdk/extension/install-snapshot.js +66 -0
- package/dist/sdk/extension/install-snapshot.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/install-sources.d.ts +3 -3
- package/dist/{cli/commands → sdk}/extension/install-sources.js +15 -12
- package/dist/sdk/extension/install-sources.js.map +1 -0
- package/dist/{cli/commands → sdk}/extension/managed-state.js +6 -6
- package/dist/sdk/extension/managed-state.js.map +1 -0
- package/dist/sdk/extension/scaffold.d.ts +36 -0
- package/dist/sdk/extension/scaffold.js +2436 -0
- package/dist/sdk/extension/scaffold.js.map +1 -0
- package/dist/sdk/extension/shared.d.ts +28 -0
- package/dist/sdk/extension/shared.js +140 -0
- package/dist/sdk/extension/shared.js.map +1 -0
- package/dist/sdk/extension/update-check.d.ts +15 -0
- package/dist/sdk/extension/update-check.js +68 -0
- package/dist/sdk/extension/update-check.js.map +1 -0
- package/dist/sdk/extension.d.ts +367 -0
- package/dist/sdk/extension.js +2174 -0
- package/dist/sdk/extension.js.map +1 -0
- package/dist/sdk/governance/gc.d.ts +56 -0
- package/dist/sdk/governance/gc.js +276 -0
- package/dist/sdk/governance/gc.js.map +1 -0
- package/dist/sdk/governance/health.d.ts +187 -0
- package/dist/sdk/governance/health.js +1796 -0
- package/dist/sdk/governance/health.js.map +1 -0
- package/dist/sdk/governance/validate.d.ts +255 -0
- package/dist/sdk/governance/validate.js +2175 -0
- package/dist/sdk/governance/validate.js.map +1 -0
- package/dist/sdk/history-compact.d.ts +142 -0
- package/dist/sdk/history-compact.js +508 -0
- package/dist/sdk/history-compact.js.map +1 -0
- package/dist/sdk/history-mcp.d.ts +17 -0
- package/dist/sdk/history-mcp.js +68 -0
- package/dist/sdk/history-mcp.js.map +1 -0
- package/dist/sdk/history-read.d.ts +31 -0
- package/dist/sdk/history-read.js +58 -0
- package/dist/sdk/history-read.js.map +1 -0
- package/dist/sdk/history-redact.d.ts +120 -0
- package/dist/sdk/history-redact.js +577 -0
- package/dist/sdk/history-redact.js.map +1 -0
- package/dist/sdk/history-repair.d.ts +89 -0
- package/dist/sdk/history-repair.js +263 -0
- package/dist/sdk/history-repair.js.map +1 -0
- package/dist/sdk/index.d.ts +25 -1
- package/dist/sdk/index.js +27 -3
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/init-agent-guidance.d.ts +113 -0
- package/dist/sdk/init-agent-guidance.js +437 -0
- package/dist/sdk/init-agent-guidance.js.map +1 -0
- package/dist/sdk/init.d.ts +186 -0
- package/dist/sdk/init.js +733 -0
- package/dist/sdk/init.js.map +1 -0
- package/dist/sdk/invocation-author.d.ts +2 -0
- package/dist/sdk/invocation-author.js +39 -0
- package/dist/sdk/invocation-author.js.map +1 -0
- package/dist/sdk/item-children.d.ts +45 -0
- package/dist/sdk/item-children.js +75 -0
- package/dist/sdk/item-children.js.map +1 -0
- package/dist/sdk/item-schedule.d.ts +26 -0
- package/dist/sdk/item-schedule.js +28 -0
- package/dist/sdk/item-schedule.js.map +1 -0
- package/dist/sdk/output.d.ts +7 -0
- package/dist/sdk/output.js +11 -0
- package/dist/sdk/output.js.map +1 -0
- package/dist/sdk/pagination.d.ts +4 -1
- package/dist/sdk/pagination.js +13 -5
- package/dist/sdk/pagination.js.map +1 -1
- package/dist/sdk/profile.d.ts +176 -0
- package/dist/sdk/profile.js +431 -0
- package/dist/sdk/profile.js.map +1 -0
- package/dist/sdk/relationship-analytics.d.ts +108 -0
- package/dist/sdk/relationship-analytics.js +292 -0
- package/dist/sdk/relationship-analytics.js.map +1 -0
- package/dist/sdk/relationship-context.d.ts +67 -0
- package/dist/sdk/relationship-context.js +207 -0
- package/dist/sdk/relationship-context.js.map +1 -0
- package/dist/sdk/relationship-history.d.ts +109 -0
- package/dist/sdk/relationship-history.js +401 -0
- package/dist/sdk/relationship-history.js.map +1 -0
- package/dist/sdk/relationships.d.ts +145 -0
- package/dist/sdk/relationships.js +551 -0
- package/dist/sdk/relationships.js.map +1 -0
- package/dist/sdk/runtime-input.d.ts +10 -0
- package/dist/sdk/runtime-input.js +60 -0
- package/dist/sdk/runtime-input.js.map +1 -0
- package/dist/sdk/runtime.d.ts +31 -8
- package/dist/sdk/runtime.js +61 -57
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/schema.d.ts +507 -0
- package/dist/sdk/schema.js +1269 -0
- package/dist/sdk/schema.js.map +1 -0
- package/dist/{cli/commands → sdk}/templates.d.ts +1 -1
- package/dist/{cli/commands → sdk}/templates.js +9 -9
- package/dist/sdk/templates.js.map +1 -0
- package/dist/{cli/commands → sdk}/test/linked-command-detection.d.ts +10 -2
- package/dist/sdk/test/linked-command-detection.js +525 -0
- package/dist/sdk/test/linked-command-detection.js.map +1 -0
- package/docs/COMMANDS.md +58 -40
- package/docs/EXTENSIONS.md +10 -1
- package/docs/RELATIONSHIP_GRAPH.md +113 -0
- package/docs/RELEASING.md +2 -0
- package/docs/SDK.md +156 -9
- package/docs/SDK_CUSTOMIZATION_PRIMITIVES.md +79 -0
- package/marketplace.json +2 -2
- package/package.json +3 -2
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-command-kit/package.json +1 -1
- package/packages/pm-governance-audit/extensions/governance-audit/runtime-utils.ts +76 -16
- package/packages/pm-governance-audit/extensions/governance-audit/sdk.ts +8 -0
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-kanban/package.json +1 -1
- package/packages/pm-lifecycle-hooks/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/scripts/bundle-cli.mjs +66 -23
- package/dist/cli/commands/extension/bundled-catalog.js.map +0 -1
- package/dist/cli/commands/extension/doctor.js.map +0 -1
- package/dist/cli/commands/extension/install-sources.js.map +0 -1
- package/dist/cli/commands/extension/managed-state.js.map +0 -1
- package/dist/cli/commands/templates.js.map +0 -1
- package/dist/cli/commands/test/linked-command-detection.js +0 -248
- package/dist/cli/commands/test/linked-command-detection.js.map +0 -1
- package/dist/cli-bundle/chunks/append-DYQWQK2J.js +0 -11
- package/dist/cli-bundle/chunks/chunk-2GA3NK35.js +0 -530
- package/dist/cli-bundle/chunks/chunk-2GA3NK35.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-2QIQGYPW.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4DY4KPQI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-4WREH7RT.js +0 -554
- package/dist/cli-bundle/chunks/chunk-4WREH7RT.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5CT5BW6E.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5URI7TPJ.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6MHSBDGD.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6OTZMORS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-6PKA3SJQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6TTOHMTB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7QDSYUMF.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-7TQMR6LK.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js +0 -312
- package/dist/cli-bundle/chunks/chunk-B5DZYTT3.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BPD26E3P.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-CDJYP7OQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js +0 -858
- package/dist/cli-bundle/chunks/chunk-DBZVUJTK.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DVOLZJ3C.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-DYEX6NFH.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-F7PSHRNO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js +0 -875
- package/dist/cli-bundle/chunks/chunk-FO7GMJKG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FTQLW4JD.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IA3YFTXT.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-IGED7NH2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-J4NZOP3I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-JL7WZ4O2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js +0 -309
- package/dist/cli-bundle/chunks/chunk-L24HCJFC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-LWTIRS3Y.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-MKL4CP2I.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-N3CMP4NI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-PHKP3AGR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-Q37E63AM.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QASRVKUQ.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RGXD5JJR.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-UB2QYSTO.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-UGTVWL3E.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZAYYDNB3.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-ZUKSZVBW.js.map +0 -7
- package/dist/cli-bundle/chunks/close-RI4JQQHU.js +0 -12
- package/dist/cli-bundle/chunks/close-many-LY2XJ52M.js +0 -21
- package/dist/cli-bundle/chunks/comments-35M273DN.js +0 -13
- package/dist/cli-bundle/chunks/copy-NPYM7M7U.js +0 -9
- package/dist/cli-bundle/chunks/delete-ODRWJWAM.js +0 -10
- package/dist/cli-bundle/chunks/docs-G7N4E2JO.js +0 -14
- package/dist/cli-bundle/chunks/focus-U5TRVCRS.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-M7GHYVFN.js +0 -20
- package/dist/cli-bundle/chunks/history-redact-JIHZLHDP.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-NAFCHLH7.js +0 -18
- package/dist/cli-bundle/chunks/learnings-SONGPSHI.js +0 -13
- package/dist/cli-bundle/chunks/notes-BSD53H2W.js +0 -13
- package/dist/cli-bundle/chunks/plan-AWLYGBNV.js +0 -24
- package/dist/cli-bundle/chunks/register-list-query-BUWCYHBT.js.map +0 -7
- package/dist/cli-bundle/chunks/register-list-query-KTZ6AGE7.js.map +0 -1
- package/dist/cli-bundle/chunks/register-mutation-4FMGJJF7.js.map +0 -1
- package/dist/cli-bundle/chunks/restore-66GLMHIX.js +0 -14
- package/dist/cli-bundle/chunks/update-2XGHIVQ2.js +0 -21
- package/dist/cli-bundle/chunks/update-many-75K57FS3.js +0 -34
- package/dist/cli-bundle/chunks/update-many-U42YA445.js +0 -30
- /package/dist/cli-bundle/chunks/{append-PVZJDM6J.js.map → append-OJQFUQ4T.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-DYQWQK2J.js.map → append-UZVHUO74.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MQZ3PLCF.js.map → chunk-2IFFUZLC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-P6MYFH6K.js.map → chunk-2JKGO6QX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X3GYR4P2.js.map → chunk-2NCIPMQP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Q7E6OYZK.js.map → chunk-2VPAVL7O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DRNJPEPQ.js.map → chunk-2WSE6PO2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FDSBDNYE.js.map → chunk-34L5OT3Y.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TH7U4KLY.js.map → chunk-3AUGG2DP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NKW36AMT.js.map → chunk-3CLU2XZO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ABRCOSDC.js.map → chunk-3WM75PWC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X6BVXQ52.js.map → chunk-5JLUII3O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3TL7WOEF.js.map → chunk-6N2VXVTQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ERL2YFJ2.js.map → chunk-6S3YSUYG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IFZA4VB5.js.map → chunk-AHVTB5I5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DO5RGJXT.js.map → chunk-APRVSW2O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NAQYVWSQ.js.map → chunk-B7PE22W6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-MD6ULIPJ.js.map → chunk-BCOFWYW4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KADLSPIU.js.map → chunk-BEP7WJA2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OBDLEQG5.js.map → chunk-CRVF2JDM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FJZDA6MS.js.map → chunk-DM4H7FP4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-LZECOMHO.js.map → chunk-DUT67M43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-44LNIULG.js.map → chunk-DYH63FX7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HAMLIWAF.js.map → chunk-EAB64KLB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CIOZ376P.js.map → chunk-EACOH7AU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QK2ZN6UL.js.map → chunk-EJEXHTY5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQUEHPZB.js.map → chunk-EYLCSJAI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-655STMGA.js.map → chunk-FMBNM2EN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RMF3IOYQ.js.map → chunk-FNSPG7MU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KB726FMH.js.map → chunk-H2Z3FYXQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BN62TO2S.js.map → chunk-IA5FKNII.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W6HZ55JO.js.map → chunk-IJIICKVW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M7EWN4TF.js.map → chunk-JOUQZENX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2FNWQXZ2.js.map → chunk-JYFOV7FC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HLHSQ5CA.js.map → chunk-K2X6U4UA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M6ASXYCU.js.map → chunk-KG44YSKD.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YVKE5ZDM.js.map → chunk-KPMKHGEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-ZHI6A5TN.js.map → chunk-MIQDDLB5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UJ4HJYWL.js.map → chunk-NLDFBC6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WRKB56FC.js.map → chunk-NP22ERDF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YQYG2V23.js.map → chunk-NU3IMIEA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3I3LRT2G.js.map → chunk-NVPZIJVR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-JAF4TUQ7.js.map → chunk-ODALILG3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QZ7LT3XE.js.map → chunk-ONREO4ST.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-3CMRNVTO.js.map → chunk-P74IZQ7A.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZTRBSABY.js.map → chunk-PGY23YTC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H2QBAKLQ.js.map → chunk-PMOSXADO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-RI4JQQHU.js.map → chunk-PNTULOGU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GSEADLRH.js.map → chunk-Q7A43DS4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QSPARJWF.js.map → chunk-QEHQ2GVG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VJTAEIPC.js.map → chunk-QIPLHNP7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-K7WNZ7KD.js.map → chunk-QKJGPFAF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ZNP64HOW.js.map → chunk-RLCHOOHC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IAPHYPRL.js.map → chunk-RMLWNPH2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UVBA6F5A.js.map → chunk-RRM5JYJC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6IIVBC56.js.map → chunk-S6MQESFR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QABYZYLU.js.map → chunk-SDQLJWBO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ANSJHDOZ.js.map → chunk-SELVXEZK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WD6MSYMP.js.map → chunk-TKOVBP6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZ2PSLLT.js.map → chunk-TQSZFPIS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WPAWZW7S.js.map → chunk-TSMHDIW4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZRTLMWM.js.map → chunk-UFXU44HV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TWLDBKQU.js.map → chunk-ULTHRDBP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RA5AIAMP.js.map → chunk-UOHFKBUV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-4RXTMU57.js.map → chunk-UY2ACEMF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FIGXOCEQ.js.map → chunk-WUJQK4YV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-T4BRCB6Z.js.map → chunk-XSJUSQAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-UKUIIBDW.js.map → chunk-YAQEBNY7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E2WC6S4P.js.map → chunk-YBLZ2VE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-Y72FV7RM.js.map → chunk-YCQET3OT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-LY2XJ52M.js.map → chunk-YUSOJDWM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FS6UM5WH.js.map → chunk-ZI6VQWQ7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-AJWRTFZ5.js.map → close-CWODTPKG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-35M273DN.js.map → close-W6LI2PKM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-GMXYKBXT.js.map → close-many-CQFUY7MR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-NPYM7M7U.js.map → close-many-DLDDVSH5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-F53OBTOU.js.map → comments-E3TNTK24.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-HU4Q7RJX.js.map → comments-WGLHR7LB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-GSDZLTRC.js.map → copy-LXVDXH7B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-ODRWJWAM.js.map → copy-Q5ZJPUKR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-U57I7EAK.js.map → create-J5U6ND4K.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-WWB7P2GT.js.map → create-LBVCYMEG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-MQIY2ZQS.js.map → delete-PMJBNY5G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-G7N4E2JO.js.map → delete-WNHB3LYW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-TTY6N2AV.js.map → deps-JZ7TMVCB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-TBZD7V6H.js.map → deps-OA26IS25.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-XT6YVFFX.js.map → docs-FEWB2DQB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-U5TRVCRS.js.map → docs-HA2AIDBB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-M7GHYVFN.js.map → files-6YFBJRBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-KKVUWB4V.js.map → files-EFIWKFTM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-3DVZOILD.js.map → focus-4QJR7FOQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-JIHZLHDP.js.map → focus-POIW5LTJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-ITDUMK4N.js.map → history-compact-CKRPDTJN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-NAFCHLH7.js.map → history-compact-FWG2C7FZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-SONGPSHI.js.map → history-redact-BB3TGDAE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-FGO3NSFW.js.map → history-redact-D225BHOZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-BSD53H2W.js.map → history-repair-6GEAM7HE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-NQ6RXVW6.js.map → history-repair-RQXKQHL4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-2NNEO46V.js.map → learnings-JLNLCOL5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-AWLYGBNV.js.map → learnings-RSNLSWDC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-U725ATWZ.js.map → notes-2WDH6DXU.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-AAQUU6T3.js.map → notes-GB47XXQQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-66GLMHIX.js.map → plan-DOVI2VMW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-B3BAB6X2.js.map → plan-VDCJ2PCN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-U7IM2DXV.js.map → profile-FAU7NZML.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-LZNUYHDB.js.map → profile-IVXQEL3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-Q3UCILNR.js.map → restore-25DLT2Q2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-2XGHIVQ2.js.map → restore-YPMVUUEX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-75K57FS3.js.map → schema-FNU3WE4O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-U42YA445.js.map → schema-NBCM3RAD.js.map} +0 -0
- /package/dist/{cli/commands → sdk}/extension/managed-state.d.ts +0 -0
|
@@ -0,0 +1,1097 @@
|
|
|
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]="fd394844-de95-5cab-9dd6-7c4ef4e52320")}catch(e){}}();
|
|
3
|
+
import {
|
|
4
|
+
createQueryFingerprint,
|
|
5
|
+
encodeQueryCursor,
|
|
6
|
+
resolveQueryCursorStart
|
|
7
|
+
} from "./chunk-HDH3JUGG.js";
|
|
8
|
+
import {
|
|
9
|
+
getActiveExtensionRegistrations,
|
|
10
|
+
isTerminalStatus,
|
|
11
|
+
listAllItemMetadataLight,
|
|
12
|
+
readSettings
|
|
13
|
+
} from "./chunk-Q7A43DS4.js";
|
|
14
|
+
import {
|
|
15
|
+
EXIT_CODE,
|
|
16
|
+
PmCliError,
|
|
17
|
+
getSettingsPath,
|
|
18
|
+
pathExists,
|
|
19
|
+
resolveItemTypeRegistry,
|
|
20
|
+
resolvePmRoot,
|
|
21
|
+
resolveRuntimeStatusRegistry
|
|
22
|
+
} from "./chunk-QKECXBBG.js";
|
|
23
|
+
|
|
24
|
+
// dist/sdk/relationships.js
|
|
25
|
+
var BUILTIN_RELATIONSHIP_KINDS = [
|
|
26
|
+
{
|
|
27
|
+
kind: "blocked_by",
|
|
28
|
+
direction: "directed",
|
|
29
|
+
inverse: "blocks",
|
|
30
|
+
ordering: true,
|
|
31
|
+
precedence: "target_before_source",
|
|
32
|
+
hierarchy: false,
|
|
33
|
+
outgoing: "many",
|
|
34
|
+
incoming: "many",
|
|
35
|
+
lifecycle: "persistent",
|
|
36
|
+
aliases: ["depends_on"],
|
|
37
|
+
compatibilityVersion: 1,
|
|
38
|
+
allowSelf: false
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
kind: "blocks",
|
|
42
|
+
direction: "directed",
|
|
43
|
+
inverse: "blocked_by",
|
|
44
|
+
ordering: true,
|
|
45
|
+
precedence: "source_before_target",
|
|
46
|
+
hierarchy: false,
|
|
47
|
+
outgoing: "many",
|
|
48
|
+
incoming: "many",
|
|
49
|
+
lifecycle: "persistent",
|
|
50
|
+
compatibilityVersion: 1,
|
|
51
|
+
allowSelf: false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
kind: "parent",
|
|
55
|
+
direction: "directed",
|
|
56
|
+
inverse: "child",
|
|
57
|
+
ordering: false,
|
|
58
|
+
hierarchy: true,
|
|
59
|
+
hierarchyDirection: "target_parent",
|
|
60
|
+
outgoing: "one",
|
|
61
|
+
incoming: "many",
|
|
62
|
+
lifecycle: "supersedable",
|
|
63
|
+
aliases: ["child_of", "epic"],
|
|
64
|
+
compatibilityVersion: 1,
|
|
65
|
+
allowSelf: false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
kind: "child",
|
|
69
|
+
direction: "directed",
|
|
70
|
+
inverse: "parent",
|
|
71
|
+
ordering: false,
|
|
72
|
+
hierarchy: true,
|
|
73
|
+
hierarchyDirection: "source_parent",
|
|
74
|
+
outgoing: "many",
|
|
75
|
+
incoming: "one",
|
|
76
|
+
lifecycle: "supersedable",
|
|
77
|
+
aliases: ["parent_child", "task"],
|
|
78
|
+
compatibilityVersion: 1,
|
|
79
|
+
allowSelf: false
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
kind: "related",
|
|
83
|
+
direction: "undirected",
|
|
84
|
+
ordering: false,
|
|
85
|
+
hierarchy: false,
|
|
86
|
+
outgoing: "many",
|
|
87
|
+
incoming: "many",
|
|
88
|
+
lifecycle: "persistent",
|
|
89
|
+
aliases: ["related_to"],
|
|
90
|
+
compatibilityVersion: 1,
|
|
91
|
+
allowSelf: false
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
kind: "discovered_from",
|
|
95
|
+
direction: "directed",
|
|
96
|
+
ordering: false,
|
|
97
|
+
hierarchy: false,
|
|
98
|
+
outgoing: "many",
|
|
99
|
+
incoming: "many",
|
|
100
|
+
lifecycle: "persistent",
|
|
101
|
+
compatibilityVersion: 1,
|
|
102
|
+
allowSelf: false
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
kind: "incident_from",
|
|
106
|
+
direction: "directed",
|
|
107
|
+
ordering: false,
|
|
108
|
+
hierarchy: false,
|
|
109
|
+
outgoing: "many",
|
|
110
|
+
incoming: "many",
|
|
111
|
+
lifecycle: "persistent",
|
|
112
|
+
compatibilityVersion: 1,
|
|
113
|
+
allowSelf: false
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
kind: "supersedes",
|
|
117
|
+
direction: "directed",
|
|
118
|
+
ordering: false,
|
|
119
|
+
hierarchy: false,
|
|
120
|
+
outgoing: "many",
|
|
121
|
+
incoming: "many",
|
|
122
|
+
lifecycle: "supersedable",
|
|
123
|
+
compatibilityVersion: 1,
|
|
124
|
+
allowSelf: false
|
|
125
|
+
}
|
|
126
|
+
];
|
|
127
|
+
function normalizeKind(kind) {
|
|
128
|
+
return kind.trim().toLowerCase().replaceAll("-", "_");
|
|
129
|
+
}
|
|
130
|
+
function normalizeInverseKind(inverse) {
|
|
131
|
+
if (inverse === void 0)
|
|
132
|
+
return void 0;
|
|
133
|
+
const normalized = normalizeKind(inverse);
|
|
134
|
+
if (!/^[a-z][a-z0-9_]*$/.test(normalized))
|
|
135
|
+
throw new TypeError(`Invalid inverse relationship kind: ${inverse}`);
|
|
136
|
+
return normalized;
|
|
137
|
+
}
|
|
138
|
+
function freezeValue(value, visited = /* @__PURE__ */ new Set()) {
|
|
139
|
+
if (value === null || typeof value !== "object")
|
|
140
|
+
return value;
|
|
141
|
+
if (visited.has(value))
|
|
142
|
+
return value;
|
|
143
|
+
visited.add(value);
|
|
144
|
+
if (Array.isArray(value)) {
|
|
145
|
+
for (const entry of value)
|
|
146
|
+
freezeValue(entry, visited);
|
|
147
|
+
return Object.freeze(value);
|
|
148
|
+
}
|
|
149
|
+
for (const entry of Object.values(value))
|
|
150
|
+
freezeValue(entry, visited);
|
|
151
|
+
return Object.freeze(value);
|
|
152
|
+
}
|
|
153
|
+
function assertRelationshipPrecedence(definition, kind) {
|
|
154
|
+
if (definition.precedence !== void 0 && definition.precedence !== "source_before_target" && definition.precedence !== "target_before_source")
|
|
155
|
+
throw new TypeError(`Invalid relationship precedence for ${kind}`);
|
|
156
|
+
if (!definition.ordering && definition.precedence !== void 0)
|
|
157
|
+
throw new TypeError(`Non-ordering relationship kind cannot declare precedence: ${kind}`);
|
|
158
|
+
}
|
|
159
|
+
function assertRelationshipHierarchyDirection(definition, kind) {
|
|
160
|
+
if (definition.hierarchyDirection !== void 0 && definition.hierarchyDirection !== "source_parent" && definition.hierarchyDirection !== "target_parent")
|
|
161
|
+
throw new TypeError(`Invalid relationship hierarchy direction for ${kind}`);
|
|
162
|
+
if (!definition.hierarchy && definition.hierarchyDirection !== void 0)
|
|
163
|
+
throw new TypeError(`Non-hierarchy relationship kind cannot declare hierarchy direction: ${kind}`);
|
|
164
|
+
}
|
|
165
|
+
var RelationshipKindRegistry = class {
|
|
166
|
+
#definitions = /* @__PURE__ */ new Map();
|
|
167
|
+
#aliases = /* @__PURE__ */ new Map();
|
|
168
|
+
/** Create a registry initialized with the stable built-in ontology by default. */
|
|
169
|
+
constructor(definitions = BUILTIN_RELATIONSHIP_KINDS) {
|
|
170
|
+
for (const definition of definitions)
|
|
171
|
+
this.register(definition);
|
|
172
|
+
}
|
|
173
|
+
/** Register one definition after validating its identifier, version, and aliases. */
|
|
174
|
+
register(definition) {
|
|
175
|
+
const kind = normalizeKind(definition.kind);
|
|
176
|
+
if (!/^[a-z][a-z0-9_]*$/.test(kind))
|
|
177
|
+
throw new TypeError(`Invalid relationship kind: ${definition.kind}`);
|
|
178
|
+
if (!Number.isInteger(definition.compatibilityVersion) || definition.compatibilityVersion < 1)
|
|
179
|
+
throw new TypeError(`Invalid compatibility version for ${kind}`);
|
|
180
|
+
assertRelationshipPrecedence(definition, kind);
|
|
181
|
+
assertRelationshipHierarchyDirection(definition, kind);
|
|
182
|
+
if (this.#definitions.has(kind) || this.#aliases.has(kind))
|
|
183
|
+
throw new TypeError(`Relationship kind already registered: ${kind}`);
|
|
184
|
+
const inverse = normalizeInverseKind(definition.inverse);
|
|
185
|
+
const aliases = [
|
|
186
|
+
...new Set((definition.aliases ?? []).map(normalizeKind))
|
|
187
|
+
].sort();
|
|
188
|
+
for (const alias of aliases) {
|
|
189
|
+
if (!/^[a-z][a-z0-9_]*$/.test(alias))
|
|
190
|
+
throw new TypeError(`Invalid relationship alias: ${alias}`);
|
|
191
|
+
if (alias === kind || this.#definitions.has(alias) || this.#aliases.has(alias))
|
|
192
|
+
throw new TypeError(`Relationship alias already registered: ${alias}`);
|
|
193
|
+
}
|
|
194
|
+
const normalized = Object.freeze({
|
|
195
|
+
...definition,
|
|
196
|
+
kind,
|
|
197
|
+
inverse,
|
|
198
|
+
aliases: Object.freeze(aliases),
|
|
199
|
+
payloadSchema: definition.payloadSchema ? freezeValue(structuredClone(definition.payloadSchema)) : void 0
|
|
200
|
+
});
|
|
201
|
+
this.#definitions.set(kind, normalized);
|
|
202
|
+
for (const alias of aliases)
|
|
203
|
+
this.#aliases.set(alias, kind);
|
|
204
|
+
return this;
|
|
205
|
+
}
|
|
206
|
+
/** Resolve a canonical kind or compatibility alias. */
|
|
207
|
+
resolve(kind) {
|
|
208
|
+
if (typeof kind !== "string")
|
|
209
|
+
return void 0;
|
|
210
|
+
const normalized = normalizeKind(kind);
|
|
211
|
+
return this.#definitions.get(this.#aliases.get(normalized) ?? normalized);
|
|
212
|
+
}
|
|
213
|
+
/** Resolve a kind or throw a precise error suitable for command adapters. */
|
|
214
|
+
require(kind) {
|
|
215
|
+
const definition = this.resolve(kind);
|
|
216
|
+
if (!definition)
|
|
217
|
+
throw new TypeError(`Unknown relationship kind: ${kind}`);
|
|
218
|
+
return definition;
|
|
219
|
+
}
|
|
220
|
+
/** Return a deterministic immutable registry snapshot. */
|
|
221
|
+
list() {
|
|
222
|
+
return Object.freeze([...this.#definitions.values()].sort((left, right) => left.kind.localeCompare(right.kind)));
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
function createRelationshipKindRegistry() {
|
|
226
|
+
return new RelationshipKindRegistry();
|
|
227
|
+
}
|
|
228
|
+
var defaultRegistry = createRelationshipKindRegistry();
|
|
229
|
+
function isOrderingRelationshipKind(kind, registry = defaultRegistry) {
|
|
230
|
+
return registry.resolve(kind)?.ordering === true;
|
|
231
|
+
}
|
|
232
|
+
function compareEdges(left, right) {
|
|
233
|
+
return left.source.localeCompare(right.source) || left.target.localeCompare(right.target) || left.kind.localeCompare(right.kind);
|
|
234
|
+
}
|
|
235
|
+
function normalizeRelationshipEdge(candidate, nodes, registry) {
|
|
236
|
+
const source = typeof candidate.source === "string" ? candidate.source.trim() : "";
|
|
237
|
+
const target = typeof candidate.target === "string" ? candidate.target.trim() : "";
|
|
238
|
+
const definition = registry.require(candidate.kind);
|
|
239
|
+
if (!nodes.has(source) || !nodes.has(target))
|
|
240
|
+
throw new TypeError(`Relationship endpoint not found: ${source} -> ${target}`);
|
|
241
|
+
if (source === target && !definition.allowSelf)
|
|
242
|
+
throw new TypeError(`Self relationship is not allowed for ${definition.kind}`);
|
|
243
|
+
const edge = Object.freeze({
|
|
244
|
+
...candidate,
|
|
245
|
+
source,
|
|
246
|
+
target,
|
|
247
|
+
kind: definition.kind
|
|
248
|
+
});
|
|
249
|
+
const endpoints = definition.direction === "undirected" ? [source, target].sort().join("\0") : `${source}\0${target}`;
|
|
250
|
+
return { edge, identity: `${definition.kind}\0${endpoints}` };
|
|
251
|
+
}
|
|
252
|
+
function appendIndexedEdge(index, node, edge) {
|
|
253
|
+
const indexed = index.get(node);
|
|
254
|
+
if (indexed)
|
|
255
|
+
indexed.push(edge);
|
|
256
|
+
else
|
|
257
|
+
index.set(node, [edge]);
|
|
258
|
+
}
|
|
259
|
+
function normalizeNodeId(value) {
|
|
260
|
+
return typeof value === "string" ? value.trim() : "";
|
|
261
|
+
}
|
|
262
|
+
function resolveExistingNodeId(value, ids) {
|
|
263
|
+
const id = normalizeNodeId(value);
|
|
264
|
+
return id && ids.has(id) ? id : void 0;
|
|
265
|
+
}
|
|
266
|
+
function reconstructPath(source, target, parents) {
|
|
267
|
+
const path = [target];
|
|
268
|
+
let cursor = target;
|
|
269
|
+
while (cursor !== source) {
|
|
270
|
+
cursor = parents.get(cursor);
|
|
271
|
+
path.push(cursor);
|
|
272
|
+
}
|
|
273
|
+
return path.reverse();
|
|
274
|
+
}
|
|
275
|
+
var RelationshipGraph = class _RelationshipGraph {
|
|
276
|
+
#registry;
|
|
277
|
+
#nodes;
|
|
278
|
+
#nodeSnapshot;
|
|
279
|
+
#edges;
|
|
280
|
+
#outgoing = /* @__PURE__ */ new Map();
|
|
281
|
+
#incoming = /* @__PURE__ */ new Map();
|
|
282
|
+
/** Validate and index nodes and edges without reading tracker storage. */
|
|
283
|
+
constructor(nodes, edges, registry = defaultRegistry) {
|
|
284
|
+
this.#registry = registry;
|
|
285
|
+
this.#nodes = new Set([...nodes].filter((id) => typeof id === "string").map((id) => id.trim()).filter(Boolean));
|
|
286
|
+
this.#nodeSnapshot = Object.freeze([...this.#nodes].sort());
|
|
287
|
+
const deduped = /* @__PURE__ */ new Map();
|
|
288
|
+
for (const candidate of edges) {
|
|
289
|
+
const { edge, identity } = normalizeRelationshipEdge(candidate, this.#nodes, registry);
|
|
290
|
+
deduped.set(identity, edge);
|
|
291
|
+
}
|
|
292
|
+
this.#edges = Object.freeze([...deduped.values()].sort(compareEdges));
|
|
293
|
+
for (const edge of this.#edges) {
|
|
294
|
+
appendIndexedEdge(this.#outgoing, edge.source, edge);
|
|
295
|
+
appendIndexedEdge(this.#incoming, edge.target, edge);
|
|
296
|
+
if (registry.require(edge.kind).direction === "undirected") {
|
|
297
|
+
appendIndexedEdge(this.#outgoing, edge.target, edge);
|
|
298
|
+
appendIndexedEdge(this.#incoming, edge.source, edge);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/** Build the graph directly from item metadata, including hierarchy and legacy blocker fields. */
|
|
303
|
+
static fromItems(items, registry = defaultRegistry) {
|
|
304
|
+
const ids = new Set(items.map((item) => normalizeNodeId(item.id)).filter(Boolean));
|
|
305
|
+
const edges = [];
|
|
306
|
+
for (const item of items) {
|
|
307
|
+
const source = normalizeNodeId(item.id);
|
|
308
|
+
if (!source)
|
|
309
|
+
continue;
|
|
310
|
+
const parent = resolveExistingNodeId(item.parent, ids);
|
|
311
|
+
if (parent)
|
|
312
|
+
edges.push({ source, target: parent, kind: "parent" });
|
|
313
|
+
const blockedBy = resolveExistingNodeId(item.blocked_by, ids);
|
|
314
|
+
if (blockedBy)
|
|
315
|
+
edges.push({
|
|
316
|
+
source,
|
|
317
|
+
target: blockedBy,
|
|
318
|
+
kind: "blocked_by"
|
|
319
|
+
});
|
|
320
|
+
for (const dependency of item.dependencies ?? []) {
|
|
321
|
+
const dependencyId = resolveExistingNodeId(dependency.id, ids);
|
|
322
|
+
if (dependencyId && registry.resolve(dependency.kind))
|
|
323
|
+
edges.push({
|
|
324
|
+
source,
|
|
325
|
+
target: dependencyId,
|
|
326
|
+
kind: dependency.kind,
|
|
327
|
+
createdAt: dependency.created_at,
|
|
328
|
+
author: dependency.author
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
return new _RelationshipGraph(ids, edges, registry);
|
|
333
|
+
}
|
|
334
|
+
/** Return the deterministic immutable edge snapshot. */
|
|
335
|
+
edges() {
|
|
336
|
+
return this.#edges;
|
|
337
|
+
}
|
|
338
|
+
/** Return the deterministic immutable edges incident to one node. */
|
|
339
|
+
incidentEdges(id) {
|
|
340
|
+
this.#assertNode(id);
|
|
341
|
+
const outgoing = this.#outgoing.get(id) ?? [];
|
|
342
|
+
const incoming = this.#incoming.get(id) ?? [];
|
|
343
|
+
if (outgoing.length === 0)
|
|
344
|
+
return Object.freeze([...incoming]);
|
|
345
|
+
if (incoming.length === 0)
|
|
346
|
+
return Object.freeze([...outgoing]);
|
|
347
|
+
const edges = [];
|
|
348
|
+
let outgoingIndex = 0;
|
|
349
|
+
let incomingIndex = 0;
|
|
350
|
+
while (outgoingIndex < outgoing.length || incomingIndex < incoming.length) {
|
|
351
|
+
const outgoingEdge = outgoing[outgoingIndex];
|
|
352
|
+
const incomingEdge = incoming[incomingIndex];
|
|
353
|
+
const edge = outgoingEdge === void 0 ? incomingEdge : incomingEdge === void 0 || compareEdges(outgoingEdge, incomingEdge) <= 0 ? outgoingEdge : incomingEdge;
|
|
354
|
+
if (edges.at(-1) !== edge)
|
|
355
|
+
edges.push(edge);
|
|
356
|
+
if (outgoingEdge === edge)
|
|
357
|
+
outgoingIndex += 1;
|
|
358
|
+
if (incomingEdge === edge)
|
|
359
|
+
incomingIndex += 1;
|
|
360
|
+
}
|
|
361
|
+
return Object.freeze(edges);
|
|
362
|
+
}
|
|
363
|
+
/** Return the deterministic immutable node snapshot. */
|
|
364
|
+
nodes() {
|
|
365
|
+
return this.#nodeSnapshot;
|
|
366
|
+
}
|
|
367
|
+
#assertNode(id) {
|
|
368
|
+
if (!this.#nodes.has(id))
|
|
369
|
+
throw new TypeError(`Relationship node not found: ${id}`);
|
|
370
|
+
}
|
|
371
|
+
#matchesKinds(edge, kinds) {
|
|
372
|
+
if (!kinds)
|
|
373
|
+
return true;
|
|
374
|
+
const definition = this.#registry.require(edge.kind);
|
|
375
|
+
return kinds.has(edge.kind) || definition.inverse !== void 0 && kinds.has(definition.inverse);
|
|
376
|
+
}
|
|
377
|
+
#neighbors(id, direction, kinds) {
|
|
378
|
+
const candidates = [
|
|
379
|
+
...direction === "incoming" ? [] : this.#outgoing.get(id) ?? [],
|
|
380
|
+
...direction === "outgoing" ? [] : this.#incoming.get(id) ?? []
|
|
381
|
+
];
|
|
382
|
+
return [...new Set(candidates)].filter((edge) => this.#matchesKinds(edge, kinds)).map((edge) => ({
|
|
383
|
+
id: edge.source === id ? edge.target : edge.source,
|
|
384
|
+
edge
|
|
385
|
+
})).sort((left, right) => left.id.localeCompare(right.id) || compareEdges(left.edge, right.edge));
|
|
386
|
+
}
|
|
387
|
+
/** Return one-hop adjacent node identifiers. */
|
|
388
|
+
adjacency(id, options = {}) {
|
|
389
|
+
this.#assertNode(id);
|
|
390
|
+
options.signal?.throwIfAborted();
|
|
391
|
+
const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
|
|
392
|
+
const rows = this.#neighbors(id, options.direction ?? "outgoing", kinds);
|
|
393
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
394
|
+
const uniqueNeighbors = [...new Set(rows.map((row) => row.id))];
|
|
395
|
+
const value = uniqueNeighbors.slice(0, limit);
|
|
396
|
+
return {
|
|
397
|
+
value,
|
|
398
|
+
meta: {
|
|
399
|
+
visitedNodes: 1,
|
|
400
|
+
inspectedEdges: rows.length,
|
|
401
|
+
truncated: value.length < uniqueNeighbors.length,
|
|
402
|
+
nextCursor: value.at(-1)
|
|
403
|
+
}
|
|
404
|
+
};
|
|
405
|
+
}
|
|
406
|
+
/** Return bounded transitive closure in breadth-first discovery order. */
|
|
407
|
+
closure(id, options = {}) {
|
|
408
|
+
this.#assertNode(id);
|
|
409
|
+
const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
|
|
410
|
+
const direction = options.direction ?? "outgoing";
|
|
411
|
+
const limit = options.limit ?? Number.POSITIVE_INFINITY;
|
|
412
|
+
const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
|
|
413
|
+
const seen = /* @__PURE__ */ new Set([id]);
|
|
414
|
+
const value = [];
|
|
415
|
+
const queue = [{ id, depth: 0 }];
|
|
416
|
+
let visitedNodes = 0;
|
|
417
|
+
let inspectedEdges = 0;
|
|
418
|
+
let truncated = false;
|
|
419
|
+
traversal: for (let index = 0; index < queue.length; index += 1) {
|
|
420
|
+
options.signal?.throwIfAborted();
|
|
421
|
+
const current = queue[index];
|
|
422
|
+
visitedNodes += 1;
|
|
423
|
+
const neighbors = this.#neighbors(current.id, direction, kinds);
|
|
424
|
+
inspectedEdges += neighbors.length;
|
|
425
|
+
if (current.depth >= maxDepth) {
|
|
426
|
+
if (neighbors.some((neighbor) => !seen.has(neighbor.id)))
|
|
427
|
+
truncated = true;
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
for (const neighbor of neighbors) {
|
|
431
|
+
if (seen.has(neighbor.id))
|
|
432
|
+
continue;
|
|
433
|
+
if (value.length >= limit) {
|
|
434
|
+
truncated = true;
|
|
435
|
+
break traversal;
|
|
436
|
+
}
|
|
437
|
+
seen.add(neighbor.id);
|
|
438
|
+
value.push(neighbor.id);
|
|
439
|
+
queue.push({ id: neighbor.id, depth: current.depth + 1 });
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return {
|
|
443
|
+
value,
|
|
444
|
+
meta: {
|
|
445
|
+
visitedNodes,
|
|
446
|
+
inspectedEdges,
|
|
447
|
+
truncated,
|
|
448
|
+
nextCursor: value.at(-1)
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
}
|
|
452
|
+
/** Return a deterministic shortest path, or an empty array when disconnected. */
|
|
453
|
+
shortestPath(source, target, options = {}) {
|
|
454
|
+
this.#assertNode(source);
|
|
455
|
+
this.#assertNode(target);
|
|
456
|
+
if (source === target)
|
|
457
|
+
return {
|
|
458
|
+
value: [source],
|
|
459
|
+
meta: { visitedNodes: 1, inspectedEdges: 0, truncated: false }
|
|
460
|
+
};
|
|
461
|
+
const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
|
|
462
|
+
const direction = options.direction ?? "outgoing";
|
|
463
|
+
const maxDepth = options.maxDepth ?? Number.POSITIVE_INFINITY;
|
|
464
|
+
const queue = [{ id: source, depth: 0 }];
|
|
465
|
+
const parents = /* @__PURE__ */ new Map();
|
|
466
|
+
const seen = /* @__PURE__ */ new Set([source]);
|
|
467
|
+
let visitedNodes = 0;
|
|
468
|
+
let inspectedEdges = 0;
|
|
469
|
+
let truncated = false;
|
|
470
|
+
for (let index = 0; index < queue.length; index += 1) {
|
|
471
|
+
options.signal?.throwIfAborted();
|
|
472
|
+
const current = queue[index];
|
|
473
|
+
visitedNodes += 1;
|
|
474
|
+
const neighbors = this.#neighbors(current.id, direction, kinds);
|
|
475
|
+
inspectedEdges += neighbors.length;
|
|
476
|
+
if (current.depth >= maxDepth) {
|
|
477
|
+
if (neighbors.some((neighbor) => !seen.has(neighbor.id)))
|
|
478
|
+
truncated = true;
|
|
479
|
+
continue;
|
|
480
|
+
}
|
|
481
|
+
for (const neighbor of neighbors) {
|
|
482
|
+
if (seen.has(neighbor.id))
|
|
483
|
+
continue;
|
|
484
|
+
parents.set(neighbor.id, current.id);
|
|
485
|
+
if (neighbor.id === target)
|
|
486
|
+
return {
|
|
487
|
+
value: reconstructPath(source, target, parents),
|
|
488
|
+
meta: { visitedNodes, inspectedEdges, truncated: false }
|
|
489
|
+
};
|
|
490
|
+
seen.add(neighbor.id);
|
|
491
|
+
queue.push({ id: neighbor.id, depth: current.depth + 1 });
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
value: [],
|
|
496
|
+
meta: { visitedNodes, inspectedEdges, truncated }
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
/** Return the induced subgraph over a bounded closure including the root. */
|
|
500
|
+
subgraph(id, options = {}) {
|
|
501
|
+
const closure = this.closure(id, options);
|
|
502
|
+
const nodes = [id, ...closure.value].sort();
|
|
503
|
+
const included = new Set(nodes);
|
|
504
|
+
const kinds = options.kinds ? new Set(options.kinds.map((kind) => this.#registry.require(kind).kind)) : void 0;
|
|
505
|
+
const edges = /* @__PURE__ */ new Set();
|
|
506
|
+
for (const node of nodes) {
|
|
507
|
+
for (const edge of this.#outgoing.get(node) ?? []) {
|
|
508
|
+
if (included.has(edge.source) && included.has(edge.target) && this.#matchesKinds(edge, kinds))
|
|
509
|
+
edges.add(edge);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
return {
|
|
513
|
+
value: {
|
|
514
|
+
nodes,
|
|
515
|
+
edges: [...edges].sort(compareEdges)
|
|
516
|
+
},
|
|
517
|
+
meta: closure.meta
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
function dependencyToRelationship(source, dependency, registry = defaultRegistry) {
|
|
522
|
+
return {
|
|
523
|
+
source,
|
|
524
|
+
target: dependency.id,
|
|
525
|
+
kind: registry.require(dependency.kind).kind,
|
|
526
|
+
createdAt: dependency.created_at,
|
|
527
|
+
author: dependency.author
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
// dist/sdk/relationship-context.js
|
|
532
|
+
var tokenEncoder = new TextEncoder();
|
|
533
|
+
function positiveInteger(value, fallback, field) {
|
|
534
|
+
const resolved = value ?? fallback;
|
|
535
|
+
if (!Number.isInteger(resolved) || resolved < 1)
|
|
536
|
+
throw new TypeError(`Relationship context ${field} must be positive`);
|
|
537
|
+
return resolved;
|
|
538
|
+
}
|
|
539
|
+
function estimateTokens(value) {
|
|
540
|
+
return Math.max(1, Math.ceil(tokenEncoder.encode(JSON.stringify(value)).byteLength / 4));
|
|
541
|
+
}
|
|
542
|
+
function explainDirectEdge(edge, root, node, registry) {
|
|
543
|
+
const definition = registry.require(edge.kind);
|
|
544
|
+
if (definition.ordering) {
|
|
545
|
+
const sourceFirst = (definition.precedence ?? "source_before_target") === "source_before_target";
|
|
546
|
+
const before = sourceFirst ? edge.source : edge.target;
|
|
547
|
+
return node === before ? "prerequisite" : "dependent";
|
|
548
|
+
}
|
|
549
|
+
if (definition.hierarchy) {
|
|
550
|
+
const sourceIsParent = (definition.hierarchyDirection ?? "source_parent") === "source_parent";
|
|
551
|
+
const parent = sourceIsParent ? edge.source : edge.target;
|
|
552
|
+
return node === parent ? "ancestor" : "descendant";
|
|
553
|
+
}
|
|
554
|
+
if (edge.kind === "discovered_from" || edge.kind === "incident_from")
|
|
555
|
+
return "provenance";
|
|
556
|
+
return "related";
|
|
557
|
+
}
|
|
558
|
+
function directReasons(rootEdges, root, node, registry) {
|
|
559
|
+
const reasons = rootEdges.filter((edge) => edge.source === root && edge.target === node || edge.target === root && edge.source === node).map((edge) => explainDirectEdge(edge, root, node, registry));
|
|
560
|
+
return [...new Set(reasons)].sort();
|
|
561
|
+
}
|
|
562
|
+
function discoverNodes(graph, root, options) {
|
|
563
|
+
const direction = options.direction ?? "both";
|
|
564
|
+
const maxDepth = options.maxDepth ?? 3;
|
|
565
|
+
if (!Number.isInteger(maxDepth) || maxDepth < 0)
|
|
566
|
+
throw new TypeError("Relationship context maxDepth must be non-negative");
|
|
567
|
+
const seen = /* @__PURE__ */ new Set([root]);
|
|
568
|
+
const queue = [{ id: root, distance: 0 }];
|
|
569
|
+
const rows = [];
|
|
570
|
+
let inspectedEdges = 0;
|
|
571
|
+
let depthTruncated = false;
|
|
572
|
+
for (let index = 0; index < queue.length; index += 1) {
|
|
573
|
+
options.signal?.throwIfAborted();
|
|
574
|
+
const current = queue[index];
|
|
575
|
+
if (current.distance >= maxDepth && depthTruncated)
|
|
576
|
+
continue;
|
|
577
|
+
const adjacent = graph.adjacency(current.id, {
|
|
578
|
+
direction,
|
|
579
|
+
kinds: options.kinds,
|
|
580
|
+
signal: options.signal
|
|
581
|
+
});
|
|
582
|
+
inspectedEdges += adjacent.meta.inspectedEdges;
|
|
583
|
+
if (current.distance >= maxDepth) {
|
|
584
|
+
if (adjacent.value.some((id) => !seen.has(id)))
|
|
585
|
+
depthTruncated = true;
|
|
586
|
+
continue;
|
|
587
|
+
}
|
|
588
|
+
for (const id of adjacent.value) {
|
|
589
|
+
if (seen.has(id))
|
|
590
|
+
continue;
|
|
591
|
+
seen.add(id);
|
|
592
|
+
const row = { id, distance: current.distance + 1 };
|
|
593
|
+
rows.push(row);
|
|
594
|
+
queue.push(row);
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
rows.sort((left, right) => left.distance - right.distance || left.id.localeCompare(right.id));
|
|
598
|
+
return {
|
|
599
|
+
rows,
|
|
600
|
+
visitedNodes: queue.length,
|
|
601
|
+
inspectedEdges,
|
|
602
|
+
depthTruncated
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
function selectContextNodes(params) {
|
|
606
|
+
const nodes = [];
|
|
607
|
+
let usedTokens = params.initialTokens;
|
|
608
|
+
const rootEdges = params.graph.incidentEdges(params.rootId);
|
|
609
|
+
for (const candidate of params.candidates) {
|
|
610
|
+
if (nodes.length >= params.nodeLimit)
|
|
611
|
+
break;
|
|
612
|
+
const node = {
|
|
613
|
+
...params.details.get(candidate.id) ?? { id: candidate.id },
|
|
614
|
+
distance: candidate.distance,
|
|
615
|
+
reasons: candidate.distance === 1 ? directReasons(rootEdges, params.rootId, candidate.id, params.registry) : [`reachable at depth ${candidate.distance}`]
|
|
616
|
+
};
|
|
617
|
+
const cost = estimateTokens(node);
|
|
618
|
+
if (usedTokens + cost > params.tokenBudget)
|
|
619
|
+
break;
|
|
620
|
+
nodes.push(node);
|
|
621
|
+
usedTokens += cost;
|
|
622
|
+
}
|
|
623
|
+
if (params.candidates.length > 0 && nodes.length === 0)
|
|
624
|
+
throw new TypeError("Relationship context tokenBudget cannot fit one node");
|
|
625
|
+
return { nodes, usedTokens };
|
|
626
|
+
}
|
|
627
|
+
function selectContextEdges(params) {
|
|
628
|
+
const candidates = params.graph.edges().filter((edge) => params.included.has(edge.source) && params.included.has(edge.target));
|
|
629
|
+
const edges = [];
|
|
630
|
+
let usedTokens = params.initialTokens;
|
|
631
|
+
for (const edge of candidates) {
|
|
632
|
+
if (edges.length >= params.edgeLimit)
|
|
633
|
+
break;
|
|
634
|
+
const cost = estimateTokens(edge);
|
|
635
|
+
if (usedTokens + cost > params.tokenBudget)
|
|
636
|
+
break;
|
|
637
|
+
edges.push(edge);
|
|
638
|
+
usedTokens += cost;
|
|
639
|
+
}
|
|
640
|
+
return { edges, usedTokens, candidateCount: candidates.length };
|
|
641
|
+
}
|
|
642
|
+
function buildRelationshipContext(graph, rootId, details, options = {}) {
|
|
643
|
+
if (!graph.nodes().includes(rootId))
|
|
644
|
+
throw new TypeError(`Relationship node not found: ${rootId}`);
|
|
645
|
+
const nodeLimit = positiveInteger(options.nodeLimit, 20, "nodeLimit");
|
|
646
|
+
const edgeLimit = positiveInteger(options.edgeLimit, 40, "edgeLimit");
|
|
647
|
+
const tokenBudget = positiveInteger(options.tokenBudget, 1200, "tokenBudget");
|
|
648
|
+
const registry = options.registry ?? createRelationshipKindRegistry();
|
|
649
|
+
const byId = new Map(details.map((detail) => [detail.id, detail]));
|
|
650
|
+
const rootDetails = byId.get(rootId) ?? {
|
|
651
|
+
id: rootId
|
|
652
|
+
};
|
|
653
|
+
const { evidence: rootEvidence = [], ...root } = rootDetails;
|
|
654
|
+
const evidence = [...rootEvidence];
|
|
655
|
+
const discovery = discoverNodes(graph, rootId, options);
|
|
656
|
+
const fingerprint = createQueryFingerprint("relationship-context", {
|
|
657
|
+
rootId,
|
|
658
|
+
direction: options.direction ?? "both",
|
|
659
|
+
kinds: [...options.kinds ?? []].sort(),
|
|
660
|
+
maxDepth: options.maxDepth ?? 3
|
|
661
|
+
});
|
|
662
|
+
const pageStart = resolveQueryCursorStart(discovery.rows, options.cursor, fingerprint, ({ id }) => id);
|
|
663
|
+
const candidates = discovery.rows.slice(pageStart);
|
|
664
|
+
const initialTokens = estimateTokens(root) + estimateTokens(evidence);
|
|
665
|
+
if (initialTokens > tokenBudget)
|
|
666
|
+
throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");
|
|
667
|
+
const nodeSelection = selectContextNodes({
|
|
668
|
+
candidates,
|
|
669
|
+
details: byId,
|
|
670
|
+
graph,
|
|
671
|
+
rootId,
|
|
672
|
+
registry,
|
|
673
|
+
nodeLimit,
|
|
674
|
+
tokenBudget,
|
|
675
|
+
initialTokens
|
|
676
|
+
});
|
|
677
|
+
const { nodes } = nodeSelection;
|
|
678
|
+
const included = /* @__PURE__ */ new Set([rootId, ...nodes.map(({ id }) => id)]);
|
|
679
|
+
const edgeSelection = selectContextEdges({
|
|
680
|
+
graph,
|
|
681
|
+
included,
|
|
682
|
+
edgeLimit,
|
|
683
|
+
tokenBudget,
|
|
684
|
+
initialTokens: nodeSelection.usedTokens
|
|
685
|
+
});
|
|
686
|
+
const { edges, usedTokens } = edgeSelection;
|
|
687
|
+
const consumed = pageStart + nodes.length;
|
|
688
|
+
const hasMoreNodes = consumed < discovery.rows.length;
|
|
689
|
+
const lastNode = nodes.at(-1);
|
|
690
|
+
const omittedEdges = edgeSelection.candidateCount - edges.length;
|
|
691
|
+
const truncated = discovery.depthTruncated || hasMoreNodes || omittedEdges > 0;
|
|
692
|
+
return {
|
|
693
|
+
root,
|
|
694
|
+
nodes,
|
|
695
|
+
edges,
|
|
696
|
+
evidence,
|
|
697
|
+
meta: {
|
|
698
|
+
exact: true,
|
|
699
|
+
truncated,
|
|
700
|
+
nodeLimit,
|
|
701
|
+
edgeLimit,
|
|
702
|
+
tokenBudget,
|
|
703
|
+
usedTokens,
|
|
704
|
+
visitedNodes: discovery.visitedNodes,
|
|
705
|
+
inspectedEdges: discovery.inspectedEdges,
|
|
706
|
+
omittedNodes: discovery.rows.length - consumed,
|
|
707
|
+
omittedEdges,
|
|
708
|
+
...hasMoreNodes && lastNode ? {
|
|
709
|
+
nextCursor: encodeQueryCursor(fingerprint, lastNode.id, consumed - 1)
|
|
710
|
+
} : {}
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// dist/sdk/dependencies.js
|
|
716
|
+
var DEPS_FORMAT_VALUES = ["tree", "graph", "context"];
|
|
717
|
+
var DEPS_COLLAPSE_VALUES = ["none", "repeated"];
|
|
718
|
+
function normalizeDependencyReferenceTarget(target) {
|
|
719
|
+
if (typeof target !== "string")
|
|
720
|
+
return void 0;
|
|
721
|
+
const normalized = target.trim();
|
|
722
|
+
if (!normalized || ["none", "null", "n/a", "na"].includes(normalized.toLowerCase()))
|
|
723
|
+
return void 0;
|
|
724
|
+
return normalized;
|
|
725
|
+
}
|
|
726
|
+
function normalizeDependencyGraphTarget(target) {
|
|
727
|
+
const normalized = normalizeDependencyReferenceTarget(target);
|
|
728
|
+
return normalized?.toLowerCase() === "no-active-blocker" ? void 0 : normalized;
|
|
729
|
+
}
|
|
730
|
+
function collectDanglingDependencyReferences(items, isTerminal = (status) => status === "closed" || status === "canceled") {
|
|
731
|
+
const knownIds = new Set(items.map((item) => item.id.trim().toLowerCase()));
|
|
732
|
+
const rows = /* @__PURE__ */ new Map();
|
|
733
|
+
const addReference = (item, target, kind, source) => {
|
|
734
|
+
const normalized = normalizeDependencyReferenceTarget(target);
|
|
735
|
+
if (!normalized || knownIds.has(normalized.toLowerCase())) {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
const row = {
|
|
739
|
+
holder_id: item.id,
|
|
740
|
+
target_id: normalized,
|
|
741
|
+
kind,
|
|
742
|
+
source,
|
|
743
|
+
holder_status: item.status,
|
|
744
|
+
legacy_terminal: isTerminal(item.status),
|
|
745
|
+
no_active_blocker_sentinel: normalized.toLowerCase() === "no-active-blocker"
|
|
746
|
+
};
|
|
747
|
+
rows.set(`${row.holder_id}::${row.target_id}::${row.kind}::${row.source}`, row);
|
|
748
|
+
};
|
|
749
|
+
for (const item of items) {
|
|
750
|
+
addReference(item, item.parent, "parent", "parent");
|
|
751
|
+
addReference(item, item.blocked_by, "blocked_by", "blocked_by");
|
|
752
|
+
for (const dependency of item.dependencies ?? []) {
|
|
753
|
+
if (typeof dependency !== "object" || dependency === null) {
|
|
754
|
+
continue;
|
|
755
|
+
}
|
|
756
|
+
const legacyDependency = dependency;
|
|
757
|
+
addReference(item, legacyDependency.id, typeof legacyDependency.kind === "string" ? legacyDependency.kind : "related", "dependency");
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
const sorted = [...rows.values()].sort((left, right) => left.holder_id.localeCompare(right.holder_id) || left.target_id.localeCompare(right.target_id) || left.kind.localeCompare(right.kind) || left.source.localeCompare(right.source));
|
|
761
|
+
const legacyTerminal = sorted.filter((row) => row.legacy_terminal);
|
|
762
|
+
return {
|
|
763
|
+
active: sorted.filter((row) => !row.legacy_terminal),
|
|
764
|
+
legacy_terminal: legacyTerminal,
|
|
765
|
+
no_active_blocker_sentinels: sorted.filter((row) => row.no_active_blocker_sentinel)
|
|
766
|
+
};
|
|
767
|
+
}
|
|
768
|
+
function collectMissingDependencyTargetIds(dangling) {
|
|
769
|
+
const targets = /* @__PURE__ */ new Map();
|
|
770
|
+
for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {
|
|
771
|
+
if (reference.no_active_blocker_sentinel)
|
|
772
|
+
continue;
|
|
773
|
+
const target = reference.target_id.trim();
|
|
774
|
+
const key = target.toLowerCase();
|
|
775
|
+
if (!targets.has(key))
|
|
776
|
+
targets.set(key, target);
|
|
777
|
+
}
|
|
778
|
+
return [...targets.values()].sort((left, right) => left.localeCompare(right));
|
|
779
|
+
}
|
|
780
|
+
function parseFormat(raw) {
|
|
781
|
+
const candidate = raw?.trim().toLowerCase() ?? "tree";
|
|
782
|
+
if (DEPS_FORMAT_VALUES.includes(candidate)) {
|
|
783
|
+
return candidate;
|
|
784
|
+
}
|
|
785
|
+
throw new PmCliError(`Invalid --format value "${raw}". Use "tree", "graph", or "context".`, EXIT_CODE.USAGE);
|
|
786
|
+
}
|
|
787
|
+
function parsePositiveInteger(raw, flag) {
|
|
788
|
+
if (raw === void 0)
|
|
789
|
+
return void 0;
|
|
790
|
+
const value = typeof raw === "number" ? raw : Number(raw.trim());
|
|
791
|
+
if (!Number.isInteger(value) || value < 1)
|
|
792
|
+
throw new PmCliError(`Invalid --${flag} value "${raw}". Use a positive integer.`, EXIT_CODE.USAGE);
|
|
793
|
+
return value;
|
|
794
|
+
}
|
|
795
|
+
function parseMaxDepth(raw) {
|
|
796
|
+
if (raw === void 0) {
|
|
797
|
+
return void 0;
|
|
798
|
+
}
|
|
799
|
+
const normalized = typeof raw === "number" ? raw : Number(raw.trim());
|
|
800
|
+
if (!Number.isInteger(normalized) || normalized < 0) {
|
|
801
|
+
throw new PmCliError(`Invalid --max-depth value "${raw}". Use a non-negative integer.`, EXIT_CODE.USAGE);
|
|
802
|
+
}
|
|
803
|
+
return normalized;
|
|
804
|
+
}
|
|
805
|
+
function parseCollapse(raw) {
|
|
806
|
+
const candidate = raw?.trim().toLowerCase() ?? "none";
|
|
807
|
+
if (DEPS_COLLAPSE_VALUES.includes(candidate)) {
|
|
808
|
+
return candidate;
|
|
809
|
+
}
|
|
810
|
+
throw new PmCliError(`Invalid --collapse value "${raw}". Use "none" or "repeated".`, EXIT_CODE.USAGE);
|
|
811
|
+
}
|
|
812
|
+
function normalizeDependencies(dependencies) {
|
|
813
|
+
if (!dependencies || dependencies.length === 0) {
|
|
814
|
+
return [];
|
|
815
|
+
}
|
|
816
|
+
const sorted = dependencies.map(({ id, kind }) => ({
|
|
817
|
+
id: id.trim(),
|
|
818
|
+
kind: kind.trim().toLowerCase()
|
|
819
|
+
})).sort((left, right) => {
|
|
820
|
+
const byKind = left.kind.localeCompare(right.kind);
|
|
821
|
+
if (byKind !== 0)
|
|
822
|
+
return byKind;
|
|
823
|
+
return left.id.localeCompare(right.id);
|
|
824
|
+
});
|
|
825
|
+
const deduped = /* @__PURE__ */ new Map();
|
|
826
|
+
for (const dependency of sorted) {
|
|
827
|
+
const key = `${dependency.kind.toLowerCase()}::${dependency.id.toLowerCase()}`;
|
|
828
|
+
if (!deduped.has(key)) {
|
|
829
|
+
deduped.set(key, { id: dependency.id, kind: dependency.kind });
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
return [...deduped.values()];
|
|
833
|
+
}
|
|
834
|
+
function toIndexedItem(item) {
|
|
835
|
+
return {
|
|
836
|
+
id: item.id,
|
|
837
|
+
title: item.title,
|
|
838
|
+
type: item.type,
|
|
839
|
+
status: item.status,
|
|
840
|
+
dependencies: normalizeDependencies(item.dependencies)
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
function toTreeNode(id, index, lineage, maxDepth, collapse, expanded, depth = 0, via) {
|
|
844
|
+
const lookupId = id.trim().toLowerCase();
|
|
845
|
+
const item = index.get(lookupId);
|
|
846
|
+
const baseNode = {
|
|
847
|
+
id: item?.id ?? id,
|
|
848
|
+
title: item?.title,
|
|
849
|
+
type: item?.type,
|
|
850
|
+
status: item?.status,
|
|
851
|
+
via,
|
|
852
|
+
missing: !item,
|
|
853
|
+
cycle: lineage.has(lookupId),
|
|
854
|
+
dependencies: []
|
|
855
|
+
};
|
|
856
|
+
if (!item || baseNode.cycle) {
|
|
857
|
+
return baseNode;
|
|
858
|
+
}
|
|
859
|
+
if (maxDepth !== void 0 && depth >= maxDepth) {
|
|
860
|
+
if (item.dependencies.length > 0) {
|
|
861
|
+
baseNode.truncated = true;
|
|
862
|
+
}
|
|
863
|
+
return baseNode;
|
|
864
|
+
}
|
|
865
|
+
if (collapse === "repeated" && expanded.has(lookupId)) {
|
|
866
|
+
baseNode.collapsed = true;
|
|
867
|
+
return baseNode;
|
|
868
|
+
}
|
|
869
|
+
if (collapse === "repeated") {
|
|
870
|
+
expanded.add(lookupId);
|
|
871
|
+
}
|
|
872
|
+
const nextLineage = new Set(lineage);
|
|
873
|
+
nextLineage.add(lookupId);
|
|
874
|
+
baseNode.dependencies = item.dependencies.map((dependency) => toTreeNode(dependency.id, index, nextLineage, maxDepth, collapse, expanded, depth + 1, dependency.kind));
|
|
875
|
+
return baseNode;
|
|
876
|
+
}
|
|
877
|
+
function mergeGraphNode(existing, candidate) {
|
|
878
|
+
if (!existing) {
|
|
879
|
+
return candidate;
|
|
880
|
+
}
|
|
881
|
+
if (existing.missing && !candidate.missing)
|
|
882
|
+
return candidate;
|
|
883
|
+
return {
|
|
884
|
+
...existing,
|
|
885
|
+
title: existing.title ?? candidate.title,
|
|
886
|
+
type: existing.type ?? candidate.type,
|
|
887
|
+
status: existing.status ?? candidate.status
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
function toGraph(root) {
|
|
891
|
+
const nodesById = /* @__PURE__ */ new Map();
|
|
892
|
+
const edgesByKey = /* @__PURE__ */ new Map();
|
|
893
|
+
const visit = (node) => {
|
|
894
|
+
nodesById.set(node.id, mergeGraphNode(nodesById.get(node.id), {
|
|
895
|
+
id: node.id,
|
|
896
|
+
title: node.title,
|
|
897
|
+
type: node.type,
|
|
898
|
+
status: node.status,
|
|
899
|
+
missing: node.missing
|
|
900
|
+
}));
|
|
901
|
+
for (const child of node.dependencies) {
|
|
902
|
+
nodesById.set(child.id, mergeGraphNode(nodesById.get(child.id), {
|
|
903
|
+
id: child.id,
|
|
904
|
+
title: child.title,
|
|
905
|
+
type: child.type,
|
|
906
|
+
status: child.status,
|
|
907
|
+
missing: child.missing
|
|
908
|
+
}));
|
|
909
|
+
const relationKind = child.via ?? "related";
|
|
910
|
+
const edgeKey = `${node.id}::${child.id}::${relationKind}`;
|
|
911
|
+
if (!edgesByKey.has(edgeKey)) {
|
|
912
|
+
edgesByKey.set(edgeKey, {
|
|
913
|
+
from: node.id,
|
|
914
|
+
to: child.id,
|
|
915
|
+
kind: relationKind
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
if (!child.cycle) {
|
|
919
|
+
visit(child);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
visit(root);
|
|
924
|
+
const nodes = [...nodesById.values()].sort((left, right) => left.id.localeCompare(right.id));
|
|
925
|
+
const edges = [...edgesByKey.values()].sort((left, right) => {
|
|
926
|
+
const byFrom = left.from.localeCompare(right.from);
|
|
927
|
+
if (byFrom !== 0)
|
|
928
|
+
return byFrom;
|
|
929
|
+
const byTo = left.to.localeCompare(right.to);
|
|
930
|
+
if (byTo !== 0)
|
|
931
|
+
return byTo;
|
|
932
|
+
return left.kind.localeCompare(right.kind);
|
|
933
|
+
});
|
|
934
|
+
const missingIds = nodes.filter((node) => node.missing).map((node) => node.id);
|
|
935
|
+
return {
|
|
936
|
+
root_id: root.id,
|
|
937
|
+
nodes,
|
|
938
|
+
edges,
|
|
939
|
+
missing_ids: missingIds
|
|
940
|
+
};
|
|
941
|
+
}
|
|
942
|
+
function countDependencyGraph(rootId, index, maxDepth) {
|
|
943
|
+
const nodeIds = /* @__PURE__ */ new Set();
|
|
944
|
+
const edgeKeys = /* @__PURE__ */ new Set();
|
|
945
|
+
const missingIds = /* @__PURE__ */ new Set();
|
|
946
|
+
const expanded = /* @__PURE__ */ new Set();
|
|
947
|
+
const pending = [{ id: rootId, depth: 0 }];
|
|
948
|
+
let pendingIndex = 0;
|
|
949
|
+
while (pendingIndex < pending.length) {
|
|
950
|
+
const current = pending[pendingIndex++];
|
|
951
|
+
const lookupId = current.id.trim().toLowerCase();
|
|
952
|
+
nodeIds.add(lookupId);
|
|
953
|
+
const item = index.get(lookupId);
|
|
954
|
+
if (!item) {
|
|
955
|
+
missingIds.add(lookupId);
|
|
956
|
+
continue;
|
|
957
|
+
}
|
|
958
|
+
if (maxDepth !== void 0 && current.depth >= maxDepth) {
|
|
959
|
+
continue;
|
|
960
|
+
}
|
|
961
|
+
if (expanded.has(lookupId)) {
|
|
962
|
+
continue;
|
|
963
|
+
}
|
|
964
|
+
expanded.add(lookupId);
|
|
965
|
+
for (const dependency of item.dependencies) {
|
|
966
|
+
edgeKeys.add(`${lookupId}::${dependency.id.trim().toLowerCase()}::${dependency.kind}`);
|
|
967
|
+
pending.push({ id: dependency.id, depth: current.depth + 1 });
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
return {
|
|
971
|
+
node_count: nodeIds.size,
|
|
972
|
+
edge_count: edgeKeys.size,
|
|
973
|
+
missing_count: missingIds.size
|
|
974
|
+
};
|
|
975
|
+
}
|
|
976
|
+
function buildDepsRelationshipContext(rootId, items, options) {
|
|
977
|
+
const maxDepth = parseMaxDepth(options.maxDepth);
|
|
978
|
+
const nodeLimit = parsePositiveInteger(options.nodeLimit, "node-limit");
|
|
979
|
+
const edgeLimit = parsePositiveInteger(options.edgeLimit, "edge-limit");
|
|
980
|
+
const tokenBudget = parsePositiveInteger(options.tokenBudget, "token-budget");
|
|
981
|
+
const canonicalIds = new Map(items.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
|
|
982
|
+
const dangling = collectDanglingDependencyReferences(items);
|
|
983
|
+
const missingIds = collectMissingDependencyTargetIds(dangling);
|
|
984
|
+
const graphItems = items.map((item) => {
|
|
985
|
+
const parent = normalizeDependencyGraphTarget(item.parent);
|
|
986
|
+
const blocker = normalizeDependencyGraphTarget(item.blocked_by);
|
|
987
|
+
const dependencies = (item.dependencies ?? []).flatMap((rawDependency) => {
|
|
988
|
+
if (typeof rawDependency !== "object" || rawDependency === null)
|
|
989
|
+
return [];
|
|
990
|
+
const dependency = rawDependency;
|
|
991
|
+
const target = normalizeDependencyGraphTarget(dependency.id);
|
|
992
|
+
if (!target)
|
|
993
|
+
return [];
|
|
994
|
+
return [{
|
|
995
|
+
id: canonicalIds.get(target.toLowerCase()) ?? target,
|
|
996
|
+
kind: typeof dependency.kind === "string" ? dependency.kind : "related"
|
|
997
|
+
}];
|
|
998
|
+
});
|
|
999
|
+
return {
|
|
1000
|
+
id: item.id,
|
|
1001
|
+
...parent ? { parent: canonicalIds.get(parent.toLowerCase()) ?? parent } : {},
|
|
1002
|
+
...blocker ? { blocked_by: canonicalIds.get(blocker.toLowerCase()) ?? blocker } : {},
|
|
1003
|
+
dependencies
|
|
1004
|
+
};
|
|
1005
|
+
});
|
|
1006
|
+
return buildRelationshipContext(RelationshipGraph.fromItems([...graphItems, ...missingIds.map((id) => ({ id }))]), rootId, [
|
|
1007
|
+
...items.map((item) => ({ id: item.id, title: item.title, status: item.status })),
|
|
1008
|
+
...missingIds.map((id) => ({ id, title: `[missing] ${id}`, status: "missing" }))
|
|
1009
|
+
], {
|
|
1010
|
+
...maxDepth === void 0 ? {} : { maxDepth },
|
|
1011
|
+
...nodeLimit === void 0 ? {} : { nodeLimit },
|
|
1012
|
+
...edgeLimit === void 0 ? {} : { edgeLimit },
|
|
1013
|
+
...tokenBudget === void 0 ? {} : { tokenBudget },
|
|
1014
|
+
...options.cursor?.trim() ? { cursor: options.cursor.trim() } : {}
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
async function runDeps(id, options, global) {
|
|
1018
|
+
const pmRoot = resolvePmRoot(process.cwd(), global.path);
|
|
1019
|
+
if (!await pathExists(getSettingsPath(pmRoot))) {
|
|
1020
|
+
throw new PmCliError(`Tracker is not initialized at ${pmRoot}. Run pm init first.`, EXIT_CODE.NOT_FOUND);
|
|
1021
|
+
}
|
|
1022
|
+
const format = parseFormat(options.format);
|
|
1023
|
+
const maxDepth = parseMaxDepth(options.maxDepth);
|
|
1024
|
+
const collapse = parseCollapse(options.collapse);
|
|
1025
|
+
const summaryOnly = options.summary === true;
|
|
1026
|
+
const settings = await readSettings(pmRoot);
|
|
1027
|
+
const typeRegistry = resolveItemTypeRegistry(settings, getActiveExtensionRegistrations());
|
|
1028
|
+
const items = await listAllItemMetadataLight(pmRoot, settings.item_format, typeRegistry.type_to_folder, void 0, settings.schema);
|
|
1029
|
+
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
1030
|
+
const index = new Map(items.map((item) => [item.id.trim().toLowerCase(), toIndexedItem(item)]));
|
|
1031
|
+
const dangling = collectDanglingDependencyReferences(items, (status) => isTerminalStatus(status, statusRegistry));
|
|
1032
|
+
for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {
|
|
1033
|
+
const holder = index.get(reference.holder_id.trim().toLowerCase());
|
|
1034
|
+
const referenceKind = reference.kind.trim().toLowerCase();
|
|
1035
|
+
if (holder && !holder.dependencies.some((dependency) => dependency.id.trim().toLowerCase() === reference.target_id.trim().toLowerCase() && dependency.kind === referenceKind)) {
|
|
1036
|
+
holder.dependencies.push({ id: reference.target_id, kind: referenceKind });
|
|
1037
|
+
}
|
|
1038
|
+
}
|
|
1039
|
+
if (!index.has(id.trim().toLowerCase())) {
|
|
1040
|
+
throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);
|
|
1041
|
+
}
|
|
1042
|
+
if (format === "context") {
|
|
1043
|
+
const canonicalId = index.get(id.trim().toLowerCase()).id;
|
|
1044
|
+
const context = buildDepsRelationshipContext(canonicalId, items, options);
|
|
1045
|
+
return {
|
|
1046
|
+
id: canonicalId,
|
|
1047
|
+
format,
|
|
1048
|
+
node_count: context.nodes.length + 1,
|
|
1049
|
+
edge_count: context.edges.length,
|
|
1050
|
+
missing_count: collectMissingDependencyTargetIds(dangling).length,
|
|
1051
|
+
...summaryOnly ? {} : { context }
|
|
1052
|
+
};
|
|
1053
|
+
}
|
|
1054
|
+
if (summaryOnly) {
|
|
1055
|
+
return {
|
|
1056
|
+
id,
|
|
1057
|
+
format,
|
|
1058
|
+
...countDependencyGraph(id, index, maxDepth)
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
const tree = toTreeNode(id, index, /* @__PURE__ */ new Set(), maxDepth, collapse, /* @__PURE__ */ new Set());
|
|
1062
|
+
const graph = toGraph(tree);
|
|
1063
|
+
const baseResult = {
|
|
1064
|
+
id,
|
|
1065
|
+
format,
|
|
1066
|
+
node_count: graph.nodes.length,
|
|
1067
|
+
edge_count: graph.edges.length,
|
|
1068
|
+
missing_count: graph.missing_ids.length
|
|
1069
|
+
};
|
|
1070
|
+
if (format === "tree") {
|
|
1071
|
+
return {
|
|
1072
|
+
...baseResult,
|
|
1073
|
+
tree
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
return {
|
|
1077
|
+
...baseResult,
|
|
1078
|
+
graph
|
|
1079
|
+
};
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
export {
|
|
1083
|
+
RelationshipKindRegistry,
|
|
1084
|
+
createRelationshipKindRegistry,
|
|
1085
|
+
isOrderingRelationshipKind,
|
|
1086
|
+
RelationshipGraph,
|
|
1087
|
+
dependencyToRelationship,
|
|
1088
|
+
buildRelationshipContext,
|
|
1089
|
+
DEPS_FORMAT_VALUES,
|
|
1090
|
+
DEPS_COLLAPSE_VALUES,
|
|
1091
|
+
collectDanglingDependencyReferences,
|
|
1092
|
+
buildDepsRelationshipContext,
|
|
1093
|
+
runDeps
|
|
1094
|
+
};
|
|
1095
|
+
//# sourceMappingURL=chunk-JFTKLTEF.js.map
|
|
1096
|
+
|
|
1097
|
+
//# debugId=fd394844-de95-5cab-9dd6-7c4ef4e52320
|