@unbrained/pm-cli 2026.7.14 → 2026.7.16
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 +54 -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,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/relationship-context
|
|
3
|
+
*
|
|
4
|
+
* Assembles one explainable, cursorable, token-bounded relationship context
|
|
5
|
+
* packet for agents, custom tools, and presentation-layer adapters.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
!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]="dfd47ca8-a68d-50e1-9aba-638d974a0027")}catch(e){}}();
|
|
9
|
+
import { createQueryFingerprint, encodeQueryCursor, resolveQueryCursorStart, } from "./pagination.js";
|
|
10
|
+
import { createRelationshipKindRegistry, } from "./relationships.js";
|
|
11
|
+
const tokenEncoder = new TextEncoder();
|
|
12
|
+
function positiveInteger(value, fallback, field) {
|
|
13
|
+
const resolved = value ?? fallback;
|
|
14
|
+
if (!Number.isInteger(resolved) || resolved < 1)
|
|
15
|
+
throw new TypeError(`Relationship context ${field} must be positive`);
|
|
16
|
+
return resolved;
|
|
17
|
+
}
|
|
18
|
+
function estimateTokens(value) {
|
|
19
|
+
return Math.max(1, Math.ceil(tokenEncoder.encode(JSON.stringify(value)).byteLength / 4));
|
|
20
|
+
}
|
|
21
|
+
function explainDirectEdge(edge, root, node, registry) {
|
|
22
|
+
const definition = registry.require(edge.kind);
|
|
23
|
+
if (definition.ordering) {
|
|
24
|
+
// Legacy and JSON-parsed definitions may predate explicit precedence.
|
|
25
|
+
const sourceFirst = (definition.precedence ?? "source_before_target") ===
|
|
26
|
+
"source_before_target";
|
|
27
|
+
const before = sourceFirst ? edge.source : edge.target;
|
|
28
|
+
return node === before ? "prerequisite" : "dependent";
|
|
29
|
+
}
|
|
30
|
+
if (definition.hierarchy) {
|
|
31
|
+
// Legacy and JSON-parsed definitions may predate explicit hierarchy direction.
|
|
32
|
+
const sourceIsParent = (definition.hierarchyDirection ?? "source_parent") === "source_parent";
|
|
33
|
+
const parent = sourceIsParent ? edge.source : edge.target;
|
|
34
|
+
return node === parent ? "ancestor" : "descendant";
|
|
35
|
+
}
|
|
36
|
+
if (edge.kind === "discovered_from" || edge.kind === "incident_from")
|
|
37
|
+
return "provenance";
|
|
38
|
+
return "related";
|
|
39
|
+
}
|
|
40
|
+
function directReasons(rootEdges, root, node, registry) {
|
|
41
|
+
const reasons = rootEdges
|
|
42
|
+
.filter((edge) => (edge.source === root && edge.target === node) ||
|
|
43
|
+
(edge.target === root && edge.source === node))
|
|
44
|
+
.map((edge) => explainDirectEdge(edge, root, node, registry));
|
|
45
|
+
return [...new Set(reasons)].sort();
|
|
46
|
+
}
|
|
47
|
+
function discoverNodes(graph, root, options) {
|
|
48
|
+
const direction = options.direction ?? "both";
|
|
49
|
+
const maxDepth = options.maxDepth ?? 3;
|
|
50
|
+
if (!Number.isInteger(maxDepth) || maxDepth < 0)
|
|
51
|
+
throw new TypeError("Relationship context maxDepth must be non-negative");
|
|
52
|
+
const seen = new Set([root]);
|
|
53
|
+
const queue = [{ id: root, distance: 0 }];
|
|
54
|
+
const rows = [];
|
|
55
|
+
let inspectedEdges = 0;
|
|
56
|
+
let depthTruncated = false;
|
|
57
|
+
for (let index = 0; index < queue.length; index += 1) {
|
|
58
|
+
options.signal?.throwIfAborted();
|
|
59
|
+
const current = queue[index];
|
|
60
|
+
if (current.distance >= maxDepth && depthTruncated)
|
|
61
|
+
continue;
|
|
62
|
+
const adjacent = graph.adjacency(current.id, {
|
|
63
|
+
direction,
|
|
64
|
+
kinds: options.kinds,
|
|
65
|
+
signal: options.signal,
|
|
66
|
+
});
|
|
67
|
+
inspectedEdges += adjacent.meta.inspectedEdges;
|
|
68
|
+
if (current.distance >= maxDepth) {
|
|
69
|
+
if (adjacent.value.some((id) => !seen.has(id)))
|
|
70
|
+
depthTruncated = true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
for (const id of adjacent.value) {
|
|
74
|
+
if (seen.has(id))
|
|
75
|
+
continue;
|
|
76
|
+
seen.add(id);
|
|
77
|
+
const row = { id, distance: current.distance + 1 };
|
|
78
|
+
rows.push(row);
|
|
79
|
+
queue.push(row);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
rows.sort((left, right) => left.distance - right.distance || left.id.localeCompare(right.id));
|
|
83
|
+
return {
|
|
84
|
+
rows,
|
|
85
|
+
visitedNodes: queue.length,
|
|
86
|
+
inspectedEdges,
|
|
87
|
+
depthTruncated,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function selectContextNodes(params) {
|
|
91
|
+
const nodes = [];
|
|
92
|
+
let usedTokens = params.initialTokens;
|
|
93
|
+
const rootEdges = params.graph.incidentEdges(params.rootId);
|
|
94
|
+
for (const candidate of params.candidates) {
|
|
95
|
+
if (nodes.length >= params.nodeLimit)
|
|
96
|
+
break;
|
|
97
|
+
const node = {
|
|
98
|
+
...(params.details.get(candidate.id) ?? { id: candidate.id }),
|
|
99
|
+
distance: candidate.distance,
|
|
100
|
+
reasons: candidate.distance === 1
|
|
101
|
+
? directReasons(rootEdges, params.rootId, candidate.id, params.registry)
|
|
102
|
+
: [`reachable at depth ${candidate.distance}`],
|
|
103
|
+
};
|
|
104
|
+
const cost = estimateTokens(node);
|
|
105
|
+
if (usedTokens + cost > params.tokenBudget)
|
|
106
|
+
break;
|
|
107
|
+
nodes.push(node);
|
|
108
|
+
usedTokens += cost;
|
|
109
|
+
}
|
|
110
|
+
if (params.candidates.length > 0 && nodes.length === 0)
|
|
111
|
+
throw new TypeError("Relationship context tokenBudget cannot fit one node");
|
|
112
|
+
return { nodes, usedTokens };
|
|
113
|
+
}
|
|
114
|
+
function selectContextEdges(params) {
|
|
115
|
+
const candidates = params.graph
|
|
116
|
+
.edges()
|
|
117
|
+
.filter((edge) => params.included.has(edge.source) && params.included.has(edge.target));
|
|
118
|
+
const edges = [];
|
|
119
|
+
let usedTokens = params.initialTokens;
|
|
120
|
+
for (const edge of candidates) {
|
|
121
|
+
if (edges.length >= params.edgeLimit)
|
|
122
|
+
break;
|
|
123
|
+
const cost = estimateTokens(edge);
|
|
124
|
+
if (usedTokens + cost > params.tokenBudget)
|
|
125
|
+
break;
|
|
126
|
+
edges.push(edge);
|
|
127
|
+
usedTokens += cost;
|
|
128
|
+
}
|
|
129
|
+
return { edges, usedTokens, candidateCount: candidates.length };
|
|
130
|
+
}
|
|
131
|
+
/** Build one deterministic bounded graph-context packet with continuation. */
|
|
132
|
+
export function buildRelationshipContext(graph, rootId, details, options = {}) {
|
|
133
|
+
if (!graph.nodes().includes(rootId))
|
|
134
|
+
throw new TypeError(`Relationship node not found: ${rootId}`);
|
|
135
|
+
const nodeLimit = positiveInteger(options.nodeLimit, 20, "nodeLimit");
|
|
136
|
+
const edgeLimit = positiveInteger(options.edgeLimit, 40, "edgeLimit");
|
|
137
|
+
const tokenBudget = positiveInteger(options.tokenBudget, 1200, "tokenBudget");
|
|
138
|
+
const registry = options.registry ?? createRelationshipKindRegistry();
|
|
139
|
+
const byId = new Map(details.map((detail) => [detail.id, detail]));
|
|
140
|
+
const rootDetails = byId.get(rootId) ?? {
|
|
141
|
+
id: rootId,
|
|
142
|
+
};
|
|
143
|
+
const { evidence: rootEvidence = [], ...root } = rootDetails;
|
|
144
|
+
const evidence = [...rootEvidence];
|
|
145
|
+
const discovery = discoverNodes(graph, rootId, options);
|
|
146
|
+
const fingerprint = createQueryFingerprint("relationship-context", {
|
|
147
|
+
rootId,
|
|
148
|
+
direction: options.direction ?? "both",
|
|
149
|
+
kinds: [...(options.kinds ?? [])].sort(),
|
|
150
|
+
maxDepth: options.maxDepth ?? 3,
|
|
151
|
+
});
|
|
152
|
+
const pageStart = resolveQueryCursorStart(discovery.rows, options.cursor, fingerprint, ({ id }) => id);
|
|
153
|
+
const candidates = discovery.rows.slice(pageStart);
|
|
154
|
+
const initialTokens = estimateTokens(root) + estimateTokens(evidence);
|
|
155
|
+
if (initialTokens > tokenBudget)
|
|
156
|
+
throw new TypeError("Relationship context tokenBudget cannot fit root and evidence");
|
|
157
|
+
const nodeSelection = selectContextNodes({
|
|
158
|
+
candidates,
|
|
159
|
+
details: byId,
|
|
160
|
+
graph,
|
|
161
|
+
rootId,
|
|
162
|
+
registry,
|
|
163
|
+
nodeLimit,
|
|
164
|
+
tokenBudget,
|
|
165
|
+
initialTokens,
|
|
166
|
+
});
|
|
167
|
+
const { nodes } = nodeSelection;
|
|
168
|
+
const included = new Set([rootId, ...nodes.map(({ id }) => id)]);
|
|
169
|
+
const edgeSelection = selectContextEdges({
|
|
170
|
+
graph,
|
|
171
|
+
included,
|
|
172
|
+
edgeLimit,
|
|
173
|
+
tokenBudget,
|
|
174
|
+
initialTokens: nodeSelection.usedTokens,
|
|
175
|
+
});
|
|
176
|
+
const { edges, usedTokens } = edgeSelection;
|
|
177
|
+
const consumed = pageStart + nodes.length;
|
|
178
|
+
const hasMoreNodes = consumed < discovery.rows.length;
|
|
179
|
+
const lastNode = nodes.at(-1);
|
|
180
|
+
const omittedEdges = edgeSelection.candidateCount - edges.length;
|
|
181
|
+
const truncated = discovery.depthTruncated || hasMoreNodes || omittedEdges > 0;
|
|
182
|
+
return {
|
|
183
|
+
root,
|
|
184
|
+
nodes,
|
|
185
|
+
edges,
|
|
186
|
+
evidence,
|
|
187
|
+
meta: {
|
|
188
|
+
exact: true,
|
|
189
|
+
truncated,
|
|
190
|
+
nodeLimit,
|
|
191
|
+
edgeLimit,
|
|
192
|
+
tokenBudget,
|
|
193
|
+
usedTokens,
|
|
194
|
+
visitedNodes: discovery.visitedNodes,
|
|
195
|
+
inspectedEdges: discovery.inspectedEdges,
|
|
196
|
+
omittedNodes: discovery.rows.length - consumed,
|
|
197
|
+
omittedEdges,
|
|
198
|
+
...(hasMoreNodes && lastNode
|
|
199
|
+
? {
|
|
200
|
+
nextCursor: encodeQueryCursor(fingerprint, lastNode.id, consumed - 1),
|
|
201
|
+
}
|
|
202
|
+
: {}),
|
|
203
|
+
},
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=relationship-context.js.map
|
|
207
|
+
//# debugId=dfd47ca8-a68d-50e1-9aba-638d974a0027
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relationship-context.js","sources":["sdk/relationship-context.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/relationship-context\n *\n * Assembles one explainable, cursorable, token-bounded relationship context\n * packet for agents, custom tools, and presentation-layer adapters.\n */\nimport {\n createQueryFingerprint,\n encodeQueryCursor,\n resolveQueryCursorStart,\n} from \"./pagination.js\";\nimport {\n RelationshipGraph,\n RelationshipKindRegistry,\n createRelationshipKindRegistry,\n type RelationshipEdge,\n type RelationshipTraversalDirection,\n} from \"./relationships.js\";\n\n/** Caller-owned compact node details joined into graph context. */\nexport interface RelationshipContextNodeDetails {\n /** Stable graph node identifier. */\n id: string;\n /** Optional display title. */\n title?: string;\n /** Optional lifecycle status. */\n status?: string;\n /** Optional evidence pointers such as files, tests, or history ids. */\n evidence?: readonly string[];\n}\n\n/** One selected graph-context node with explainable inclusion. */\nexport interface RelationshipContextNode extends RelationshipContextNodeDetails {\n /** Shortest bounded distance from the root. */\n distance: number;\n /** Concise deterministic reasons the node was selected. */\n reasons: string[];\n}\n\n/** Controls for bounded graph-context assembly. */\nexport interface RelationshipContextOptions {\n /** Traversal direction relative to each visited node. */\n direction?: RelationshipTraversalDirection;\n /** Optional registered kind filter. */\n kinds?: readonly string[];\n /** Maximum traversal depth. */\n maxDepth?: number;\n /** Maximum nodes returned in this page. */\n nodeLimit?: number;\n /** Maximum edges returned in this page. */\n edgeLimit?: number;\n /** Maximum estimated output tokens charged to rows and edges. */\n tokenBudget?: number;\n /** Opaque continuation from an equivalent query. */\n cursor?: string;\n /** Registry used to explain custom relationship semantics. */\n registry?: RelationshipKindRegistry;\n /** Abort signal checked during traversal. */\n signal?: AbortSignal;\n}\n\n/** Explainable graph context packet. */\nexport interface RelationshipContextResult {\n /** Root node details. */\n root: RelationshipContextNodeDetails;\n /** Bounded related-node page. */\n nodes: RelationshipContextNode[];\n /** Bounded edges whose endpoints are present in the packet. */\n edges: RelationshipEdge[];\n /** Root evidence pointers promoted for immediate consumption. */\n evidence: string[];\n /** Completeness, continuation, and cost envelope. */\n meta: {\n exact: true;\n truncated: boolean;\n nodeLimit: number;\n edgeLimit: number;\n tokenBudget: number;\n usedTokens: number;\n visitedNodes: number;\n inspectedEdges: number;\n omittedNodes: number;\n omittedEdges: number;\n nextCursor?: string;\n };\n}\n\ninterface DiscoveredNode {\n id: string;\n distance: number;\n}\n\nconst tokenEncoder = new TextEncoder();\n\nfunction positiveInteger(\n value: number | undefined,\n fallback: number,\n field: string,\n): number {\n const resolved = value ?? fallback;\n if (!Number.isInteger(resolved) || resolved < 1)\n throw new TypeError(`Relationship context ${field} must be positive`);\n return resolved;\n}\n\nfunction estimateTokens(value: unknown): number {\n return Math.max(\n 1,\n Math.ceil(tokenEncoder.encode(JSON.stringify(value)).byteLength / 4),\n );\n}\n\nfunction explainDirectEdge(\n edge: RelationshipEdge,\n root: string,\n node: string,\n registry: RelationshipKindRegistry,\n): string {\n const definition = registry.require(edge.kind);\n if (definition.ordering) {\n // Legacy and JSON-parsed definitions may predate explicit precedence.\n const sourceFirst =\n (definition.precedence ?? \"source_before_target\") ===\n \"source_before_target\";\n const before = sourceFirst ? edge.source : edge.target;\n return node === before ? \"prerequisite\" : \"dependent\";\n }\n if (definition.hierarchy) {\n // Legacy and JSON-parsed definitions may predate explicit hierarchy direction.\n const sourceIsParent =\n (definition.hierarchyDirection ?? \"source_parent\") === \"source_parent\";\n const parent = sourceIsParent ? edge.source : edge.target;\n return node === parent ? \"ancestor\" : \"descendant\";\n }\n if (edge.kind === \"discovered_from\" || edge.kind === \"incident_from\")\n return \"provenance\";\n return \"related\";\n}\n\nfunction directReasons(\n rootEdges: readonly RelationshipEdge[],\n root: string,\n node: string,\n registry: RelationshipKindRegistry,\n): string[] {\n const reasons = rootEdges\n .filter(\n (edge) =>\n (edge.source === root && edge.target === node) ||\n (edge.target === root && edge.source === node),\n )\n .map((edge) => explainDirectEdge(edge, root, node, registry));\n return [...new Set(reasons)].sort();\n}\n\nfunction discoverNodes(\n graph: RelationshipGraph,\n root: string,\n options: RelationshipContextOptions,\n): {\n rows: DiscoveredNode[];\n visitedNodes: number;\n inspectedEdges: number;\n depthTruncated: boolean;\n} {\n const direction = options.direction ?? \"both\";\n const maxDepth = options.maxDepth ?? 3;\n if (!Number.isInteger(maxDepth) || maxDepth < 0)\n throw new TypeError(\"Relationship context maxDepth must be non-negative\");\n const seen = new Set([root]);\n const queue = [{ id: root, distance: 0 }];\n const rows: DiscoveredNode[] = [];\n let inspectedEdges = 0;\n let depthTruncated = false;\n for (let index = 0; index < queue.length; index += 1) {\n options.signal?.throwIfAborted();\n const current = queue[index]!;\n if (current.distance >= maxDepth && depthTruncated) continue;\n const adjacent = graph.adjacency(current.id, {\n direction,\n kinds: options.kinds,\n signal: options.signal,\n });\n inspectedEdges += adjacent.meta.inspectedEdges;\n if (current.distance >= maxDepth) {\n if (adjacent.value.some((id) => !seen.has(id))) depthTruncated = true;\n continue;\n }\n for (const id of adjacent.value) {\n if (seen.has(id)) continue;\n seen.add(id);\n const row = { id, distance: current.distance + 1 };\n rows.push(row);\n queue.push(row);\n }\n }\n rows.sort(\n (left, right) =>\n left.distance - right.distance || left.id.localeCompare(right.id),\n );\n return {\n rows,\n visitedNodes: queue.length,\n inspectedEdges,\n depthTruncated,\n };\n}\n\nfunction selectContextNodes(params: {\n candidates: readonly DiscoveredNode[];\n details: ReadonlyMap<string, RelationshipContextNodeDetails>;\n graph: RelationshipGraph;\n rootId: string;\n registry: RelationshipKindRegistry;\n nodeLimit: number;\n tokenBudget: number;\n initialTokens: number;\n}): { nodes: RelationshipContextNode[]; usedTokens: number } {\n const nodes: RelationshipContextNode[] = [];\n let usedTokens = params.initialTokens;\n const rootEdges = params.graph.incidentEdges(params.rootId);\n for (const candidate of params.candidates) {\n if (nodes.length >= params.nodeLimit) break;\n const node: RelationshipContextNode = {\n ...(params.details.get(candidate.id) ?? { id: candidate.id }),\n distance: candidate.distance,\n reasons:\n candidate.distance === 1\n ? directReasons(\n rootEdges,\n params.rootId,\n candidate.id,\n params.registry,\n )\n : [`reachable at depth ${candidate.distance}`],\n };\n const cost = estimateTokens(node);\n if (usedTokens + cost > params.tokenBudget) break;\n nodes.push(node);\n usedTokens += cost;\n }\n if (params.candidates.length > 0 && nodes.length === 0)\n throw new TypeError(\"Relationship context tokenBudget cannot fit one node\");\n return { nodes, usedTokens };\n}\n\nfunction selectContextEdges(params: {\n graph: RelationshipGraph;\n included: ReadonlySet<string>;\n edgeLimit: number;\n tokenBudget: number;\n initialTokens: number;\n}): {\n edges: RelationshipEdge[];\n usedTokens: number;\n candidateCount: number;\n} {\n const candidates = params.graph\n .edges()\n .filter(\n (edge) =>\n params.included.has(edge.source) && params.included.has(edge.target),\n );\n const edges: RelationshipEdge[] = [];\n let usedTokens = params.initialTokens;\n for (const edge of candidates) {\n if (edges.length >= params.edgeLimit) break;\n const cost = estimateTokens(edge);\n if (usedTokens + cost > params.tokenBudget) break;\n edges.push(edge);\n usedTokens += cost;\n }\n return { edges, usedTokens, candidateCount: candidates.length };\n}\n\n/** Build one deterministic bounded graph-context packet with continuation. */\nexport function buildRelationshipContext(\n graph: RelationshipGraph,\n rootId: string,\n details: readonly RelationshipContextNodeDetails[],\n options: RelationshipContextOptions = {},\n): RelationshipContextResult {\n if (!graph.nodes().includes(rootId))\n throw new TypeError(`Relationship node not found: ${rootId}`);\n const nodeLimit = positiveInteger(options.nodeLimit, 20, \"nodeLimit\");\n const edgeLimit = positiveInteger(options.edgeLimit, 40, \"edgeLimit\");\n const tokenBudget = positiveInteger(options.tokenBudget, 1200, \"tokenBudget\");\n const registry = options.registry ?? createRelationshipKindRegistry();\n const byId = new Map(details.map((detail) => [detail.id, detail]));\n const rootDetails: RelationshipContextNodeDetails = byId.get(rootId) ?? {\n id: rootId,\n };\n const { evidence: rootEvidence = [], ...root } = rootDetails;\n const evidence = [...rootEvidence];\n const discovery = discoverNodes(graph, rootId, options);\n const fingerprint = createQueryFingerprint(\"relationship-context\", {\n rootId,\n direction: options.direction ?? \"both\",\n kinds: [...(options.kinds ?? [])].sort(),\n maxDepth: options.maxDepth ?? 3,\n });\n const pageStart = resolveQueryCursorStart(\n discovery.rows,\n options.cursor,\n fingerprint,\n ({ id }) => id,\n );\n const candidates = discovery.rows.slice(pageStart);\n const initialTokens = estimateTokens(root) + estimateTokens(evidence);\n if (initialTokens > tokenBudget)\n throw new TypeError(\n \"Relationship context tokenBudget cannot fit root and evidence\",\n );\n const nodeSelection = selectContextNodes({\n candidates,\n details: byId,\n graph,\n rootId,\n registry,\n nodeLimit,\n tokenBudget,\n initialTokens,\n });\n const { nodes } = nodeSelection;\n\n const included = new Set([rootId, ...nodes.map(({ id }) => id)]);\n const edgeSelection = selectContextEdges({\n graph,\n included,\n edgeLimit,\n tokenBudget,\n initialTokens: nodeSelection.usedTokens,\n });\n const { edges, usedTokens } = edgeSelection;\n\n const consumed = pageStart + nodes.length;\n const hasMoreNodes = consumed < discovery.rows.length;\n const lastNode = nodes.at(-1);\n const omittedEdges = edgeSelection.candidateCount - edges.length;\n const truncated =\n discovery.depthTruncated || hasMoreNodes || omittedEdges > 0;\n return {\n root,\n nodes,\n edges,\n evidence,\n meta: {\n exact: true,\n truncated,\n nodeLimit,\n edgeLimit,\n tokenBudget,\n usedTokens,\n visitedNodes: discovery.visitedNodes,\n inspectedEdges: discovery.inspectedEdges,\n omittedNodes: discovery.rows.length - consumed,\n omittedEdges,\n ...(hasMoreNodes && lastNode\n ? {\n nextCursor: encodeQueryCursor(\n fingerprint,\n lastNode.id,\n consumed - 1,\n ),\n }\n : {}),\n },\n };\n}\n"],"names":[],"mappings":"AAAA;;;;;GAKG;;;AACH,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAGL,8BAA8B,GAG/B,MAAM,oBAAoB,CAAC;AA2E5B,MAAM,YAAY,GAAG,IAAI,WAAW,EAAE,CAAC;AAEvC,SAAS,eAAe,CACtB,KAAyB,EACzB,QAAgB,EAChB,KAAa;IAEb,MAAM,QAAQ,GA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D,OAAO;QACL,IAAI;QACJ,KAAK;QACL,KAAK;QACL,QAAQ;QACR,IAAI,EAAE;YACJ,KAAK,EAAE,IAAI;YACX,SAAS;YACT,SAAS;YACT,SAAS;YACT,WAAW;YACX,UAAU;YACV,YAAY,EAAE,SAAS,CAAC,YAAY;YACpC,cAAc,EAAE,SAAS,CAAC,cAAc;YACxC,YAAY,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ;YAC9C,YAAY;YACZ,GAAG,CAAC,YAAY,IAAI,QAAQ;gBAC1B,CAAC,CAAC;oBACE,UAAU,EAAE,iBAAiB,CAC3B,WAAW,EACX,QAAQ,CAAC,EAAE,EACX,QAAQ,GAAG,CAAC,CACb;iBACF;gBACH,CAAC,CAAC,EAAE,CAAC;SACR;KACF,CAAC;AACJ,CAAC","debugId":"dfd47ca8-a68d-50e1-9aba-638d974a0027"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { RelationshipGraph, RelationshipKindRegistry, type RelationshipEdge } from "./relationships.js";
|
|
2
|
+
/** Mutation kinds retained in the immutable relationship event stream. */
|
|
3
|
+
export type RelationshipEventAction = "add" | "remove" | "supersede";
|
|
4
|
+
/** Caller-authored relationship mutation before its sequence is assigned. */
|
|
5
|
+
export interface RelationshipEventInput {
|
|
6
|
+
/** Globally unique idempotency key for this event. */
|
|
7
|
+
eventId: string;
|
|
8
|
+
/** Stable logical relationship identifier across superseding events. */
|
|
9
|
+
relationshipId: string;
|
|
10
|
+
/** Append, remove, or replace the logical relationship. */
|
|
11
|
+
action: RelationshipEventAction;
|
|
12
|
+
/** Edge required for add and supersede actions. */
|
|
13
|
+
edge?: RelationshipEdge;
|
|
14
|
+
/** Attributable actor responsible for the mutation. */
|
|
15
|
+
author: string;
|
|
16
|
+
/** Valid event-time timestamp. */
|
|
17
|
+
timestamp: string;
|
|
18
|
+
/** Optional optimistic concurrency precondition. */
|
|
19
|
+
expectedVersion?: number;
|
|
20
|
+
/** Optional human-readable mutation rationale. */
|
|
21
|
+
reason?: string;
|
|
22
|
+
}
|
|
23
|
+
/** One immutable sequenced relationship mutation. */
|
|
24
|
+
export interface RelationshipEvent extends Omit<RelationshipEventInput, "expectedVersion"> {
|
|
25
|
+
/** One-based append sequence assigned by the ledger. */
|
|
26
|
+
sequence: number;
|
|
27
|
+
}
|
|
28
|
+
/** Point-in-time materialized relationship view. */
|
|
29
|
+
export interface RelationshipSnapshot {
|
|
30
|
+
/** Final event sequence included in this snapshot. */
|
|
31
|
+
version: number;
|
|
32
|
+
/** Timestamp of the final included event, when one exists. */
|
|
33
|
+
asOf?: string;
|
|
34
|
+
/** Deterministic active edge materialization. */
|
|
35
|
+
edges: readonly RelationshipEdge[];
|
|
36
|
+
/** Immutable graph query view over the active edges. */
|
|
37
|
+
graph: RelationshipGraph;
|
|
38
|
+
}
|
|
39
|
+
/** Stable cursor page over a fixed relationship event-log version. */
|
|
40
|
+
export interface RelationshipEventPage {
|
|
41
|
+
/** Log version against which this page was produced. */
|
|
42
|
+
version: number;
|
|
43
|
+
/** Events in append order. */
|
|
44
|
+
events: RelationshipEvent[];
|
|
45
|
+
/** Whether another event page exists. */
|
|
46
|
+
hasMore: boolean;
|
|
47
|
+
/** Opaque continuation cursor when another page exists. */
|
|
48
|
+
nextCursor?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Construction controls for the in-memory reference ledger. */
|
|
51
|
+
export interface RelationshipEventLogOptions {
|
|
52
|
+
/** Registry defining edge semantics and cardinality. */
|
|
53
|
+
registry?: RelationshipKindRegistry;
|
|
54
|
+
}
|
|
55
|
+
/** Filesystem controls for the durable relationship event store. */
|
|
56
|
+
export interface RelationshipEventStoreOptions extends RelationshipEventLogOptions {
|
|
57
|
+
/** Tracker root that owns the relationship history directory. */
|
|
58
|
+
pmRoot: string;
|
|
59
|
+
/** Fixed node universe validated by every replay and append. */
|
|
60
|
+
nodes: Iterable<string>;
|
|
61
|
+
/** Optional JSONL path relative to the tracker root. */
|
|
62
|
+
relativePath?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Append-only in-memory reference ledger. Durable adapters can persist the
|
|
66
|
+
* returned immutable events while reusing the same replay and validation model.
|
|
67
|
+
*/
|
|
68
|
+
export declare class RelationshipEventLog {
|
|
69
|
+
#private;
|
|
70
|
+
/** Create an empty relationship ledger for a fixed node universe. */
|
|
71
|
+
constructor(nodes: Iterable<string>, options?: RelationshipEventLogOptions);
|
|
72
|
+
/** Current append sequence. */
|
|
73
|
+
get version(): number;
|
|
74
|
+
/** Return an immutable copy of the full event stream. */
|
|
75
|
+
events(): readonly RelationshipEvent[];
|
|
76
|
+
/** Validate and append one attributable relationship mutation. */
|
|
77
|
+
append(input: RelationshipEventInput): RelationshipEvent;
|
|
78
|
+
/** Materialize an exact point-in-time graph without mutating the ledger. */
|
|
79
|
+
snapshot(options?: {
|
|
80
|
+
atVersion?: number;
|
|
81
|
+
atTimestamp?: string;
|
|
82
|
+
}): RelationshipSnapshot;
|
|
83
|
+
/** Page the immutable event stream with a cursor bound to this log version. */
|
|
84
|
+
page(options: {
|
|
85
|
+
limit: number;
|
|
86
|
+
cursor?: string;
|
|
87
|
+
}): RelationshipEventPage;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Lock-serialized durable JSONL adapter for {@link RelationshipEventLog}.
|
|
91
|
+
* Every append replays the current stream while holding the workspace lock, so
|
|
92
|
+
* independent processes share optimistic versions without lost updates.
|
|
93
|
+
*/
|
|
94
|
+
export declare class RelationshipEventStore {
|
|
95
|
+
#private;
|
|
96
|
+
private constructor();
|
|
97
|
+
/** Open and validate an existing stream or create an empty store view. */
|
|
98
|
+
static open(options: RelationshipEventStoreOptions): Promise<RelationshipEventStore>;
|
|
99
|
+
/** Absolute JSONL path, exposed for diagnostics and backup tooling. */
|
|
100
|
+
get path(): string;
|
|
101
|
+
/** Refresh from durable history and return the current validated append sequence. */
|
|
102
|
+
currentVersion(): Promise<number>;
|
|
103
|
+
/** Append one event after refreshing under the shared workspace lock. */
|
|
104
|
+
append(input: RelationshipEventInput): Promise<RelationshipEvent>;
|
|
105
|
+
/** Refresh from durable history and materialize an exact validated snapshot. */
|
|
106
|
+
snapshot(options?: Parameters<RelationshipEventLog["snapshot"]>[0]): Promise<RelationshipSnapshot>;
|
|
107
|
+
/** Refresh from durable history and page immutable events. */
|
|
108
|
+
page(options: Parameters<RelationshipEventLog["page"]>[0]): Promise<RelationshipEventPage>;
|
|
109
|
+
}
|