@unbrained/pm-cli 2026.7.18 → 2026.7.19
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 +17 -0
- package/dist/cli/commands/claim.js +6 -4
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/comments.js +5 -2
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/context.d.ts +10 -1
- package/dist/cli/commands/context.js +44 -6
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/create.js +15 -4
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/next.js +13 -3
- package/dist/cli/commands/next.js.map +1 -1
- package/dist/cli/commands/update.js +14 -3
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/error-guidance.js +23 -4
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +11 -0
- package/dist/cli/extension-command-help.js +62 -2
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/main.d.ts +1 -0
- package/dist/cli/main.js +16 -11
- package/dist/cli/main.js.map +1 -1
- package/dist/cli-bundle/bundle-manifest.json +326 -350
- package/dist/cli-bundle/chunks/{append-5YF3TO7I.js → append-MBXHNWSX.js} +5 -5
- package/dist/cli-bundle/chunks/append-XUYF7NON.js +11 -0
- package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js → chunk-2UCG5H6B.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js → chunk-2XPDCXK5.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-I3INI567.js → chunk-3EZZTFL2.js} +909 -124
- package/dist/cli-bundle/chunks/chunk-3EZZTFL2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js → chunk-3HSRP6T2.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js → chunk-3KPNOZOH.js} +23 -23
- package/dist/cli-bundle/chunks/{chunk-MR4SHYR4.js → chunk-3QNUDDY2.js} +104 -23
- package/dist/cli-bundle/chunks/chunk-3QNUDDY2.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-SIPOACV5.js → chunk-46Z6FAVP.js} +888 -124
- package/dist/cli-bundle/chunks/chunk-46Z6FAVP.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js → chunk-4M6RZJXF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js → chunk-4PSJVGRE.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-ADXDCAKP.js → chunk-5S6IZXK7.js} +146 -32
- package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js.map → chunk-5S6IZXK7.js.map} +7 -1
- package/dist/cli-bundle/chunks/chunk-66SRNEBK.js +143 -0
- package/dist/cli-bundle/chunks/chunk-66SRNEBK.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js → chunk-6BNV3G6C.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js → chunk-6V4T4RD3.js} +23 -23
- package/dist/cli-bundle/chunks/chunk-77XFQRTD.js +140 -0
- package/dist/cli-bundle/chunks/chunk-77XFQRTD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js → chunk-7B7IHMLH.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js → chunk-7CHWLT2J.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js → chunk-A3GAQLBH.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js → chunk-A4FVWFZY.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js → chunk-A5EQPNV7.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js → chunk-AGEBQRBG.js} +15 -15
- package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js → chunk-AQUNTB7G.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-OGVTB5VO.js → chunk-AR24KW26.js} +237 -36
- package/dist/cli-bundle/chunks/chunk-AR24KW26.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js → chunk-BBGR4FKQ.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-HTXXXF45.js → chunk-BDC4TW4B.js} +98 -24
- package/dist/cli-bundle/chunks/chunk-BDC4TW4B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js → chunk-BFJP4VYC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-633PKXLT.js → chunk-BZKE2O5V.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-XPUTSGJU.js → chunk-CZA2DXCV.js} +230 -36
- package/dist/cli-bundle/chunks/chunk-CZA2DXCV.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-KX62NMZC.js → chunk-D35WYXWC.js} +626 -5
- package/dist/cli-bundle/chunks/chunk-D35WYXWC.js.map +1 -0
- package/dist/cli-bundle/chunks/chunk-DOASIOQR.js +289 -0
- package/dist/cli-bundle/chunks/chunk-DOASIOQR.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js → chunk-DUDLSQFG.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js → chunk-E7KBMWEF.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js → chunk-EAV3P54W.js} +9 -9
- package/dist/cli-bundle/chunks/{chunk-3QDR6ZLU.js.map → chunk-EAV3P54W.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js → chunk-EEECAV5M.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js → chunk-EI3UIMZM.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js → chunk-EVAN5VJA.js} +8 -5
- package/dist/cli-bundle/chunks/{chunk-RGMWJLXF.js.map → chunk-EVAN5VJA.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js → chunk-FIUTBFC6.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js → chunk-FQF6VVPH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js → chunk-FQO5THHM.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js → chunk-FQODDTE7.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js → chunk-G33XIMRT.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-D53RTYVI.js → chunk-GFZB5CLP.js} +20 -10
- package/dist/cli-bundle/chunks/chunk-GFZB5CLP.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js → chunk-GKCEEXMA.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js → chunk-GRDK25BN.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js → chunk-H3YKUVDR.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-IL5SPRMH.js → chunk-IEMXESIS.js} +123 -16
- package/dist/cli-bundle/chunks/chunk-IEMXESIS.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js → chunk-IGBBTPM5.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-QPGQNLPI.js → chunk-IR3GOO6E.js} +3842 -4109
- package/dist/cli-bundle/chunks/chunk-IR3GOO6E.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js → chunk-IRJ6F23W.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js → chunk-IXG5CMBR.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-F3VC3GOV.js → chunk-JBW2S2C6.js} +2090 -253
- package/dist/cli-bundle/chunks/chunk-JBW2S2C6.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js → chunk-JPWUZOMR.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js → chunk-K2L6FZBX.js} +8 -8
- package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js +286 -0
- package/dist/cli-bundle/chunks/chunk-KGPLSHJD.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-YQEZWI3R.js → chunk-KZ5AC6B5.js} +5 -3
- package/dist/cli-bundle/chunks/chunk-KZ5AC6B5.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js → chunk-LT5UWU7H.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js → chunk-M4B4RK4J.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-QRZNCRNA.js → chunk-MI3346YW.js} +377 -240
- package/dist/cli-bundle/chunks/chunk-MI3346YW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js → chunk-MQOSMBWV.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-YIIIAKCE.js → chunk-MRXAHR4B.js} +28 -22
- package/dist/cli-bundle/chunks/chunk-MRXAHR4B.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js → chunk-N2TEEOXJ.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js → chunk-N7FCFJ76.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js → chunk-NPEYH6CE.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-GKPCTQYG.js → chunk-NTS2RKHN.js} +3942 -4216
- package/dist/cli-bundle/chunks/chunk-NTS2RKHN.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-6VHUGVNP.js → chunk-ODEIDKGW.js} +2062 -246
- package/dist/cli-bundle/chunks/chunk-ODEIDKGW.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-2CXL335K.js → chunk-OK7VSX3N.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js → chunk-OKPZDH43.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js → chunk-OKWJUL6F.js} +6 -6
- package/dist/cli-bundle/chunks/{chunk-HPAYDSR2.js → chunk-P24ZU5QV.js} +27 -21
- package/dist/cli-bundle/chunks/chunk-P24ZU5QV.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js → chunk-Q4PSG2GV.js} +13 -4
- package/dist/cli-bundle/chunks/{chunk-TGBTLGPX.js.map → chunk-Q4PSG2GV.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-5UKQLQM2.js → chunk-Q5NHJ6RO.js} +6 -4
- package/dist/cli-bundle/chunks/chunk-Q5NHJ6RO.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js → chunk-Q6JPYR7I.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js → chunk-QFG4MB7P.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-P22HGFFI.js.map → chunk-QFG4MB7P.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js → chunk-QQ77W23U.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js → chunk-QYGK2XQ3.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-646MQXFW.js → chunk-RLLOZAM2.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-646MQXFW.js.map → chunk-RLLOZAM2.js.map} +2 -2
- package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js → chunk-RWAIRGBC.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js → chunk-RX53WHFI.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js → chunk-SBW7EQC4.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js → chunk-SGJB6PXA.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js → chunk-STBCBDKF.js} +7 -7
- package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js → chunk-SUNZKVAH.js} +10 -10
- package/dist/cli-bundle/chunks/{chunk-EX7OQT3Y.js.map → chunk-SUNZKVAH.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js → chunk-SVAWG7EE.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-6O44IN44.js → chunk-T6MOTLOJ.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js → chunk-TELI67UP.js} +9 -6
- package/dist/cli-bundle/chunks/{chunk-HSYV4ZYT.js.map → chunk-TELI67UP.js.map} +1 -1
- package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js → chunk-U6RYD446.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js → chunk-UE7LK3RE.js} +5 -5
- package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js → chunk-UNNCT5QY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js → chunk-UOIFZ66L.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js → chunk-UU6EP25G.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js → chunk-UW6HCMP2.js} +15 -15
- package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js → chunk-UWAQI3B7.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js → chunk-V4QHAMI5.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js → chunk-VA3H7VVC.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-XC2HEEOV.js → chunk-VFA5EIEN.js} +21 -11
- package/dist/cli-bundle/chunks/chunk-VFA5EIEN.js.map +1 -0
- package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js → chunk-VQOG2ETB.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js → chunk-VSQE43NO.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js → chunk-W6IEJXNC.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WACRQ26A.js → chunk-WCBB6VI3.js} +637 -9
- package/dist/cli-bundle/chunks/chunk-WCBB6VI3.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js → chunk-XDWXPG2E.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js → chunk-XKVHL3MB.js} +2 -2
- package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js → chunk-XVB6BATY.js} +3 -3
- package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js → chunk-XXWDEQ6O.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js → chunk-Y2VSGFT4.js} +8 -8
- package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js → chunk-YG56M3NE.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js → chunk-YGEA4CLH.js} +4 -4
- package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js → chunk-YIC5NGXF.js} +11 -11
- package/dist/cli-bundle/chunks/{chunk-DHNG452T.js → chunk-ZF52NVRT.js} +396 -245
- package/dist/cli-bundle/chunks/chunk-ZF52NVRT.js.map +7 -0
- package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js → chunk-ZUCBPXNA.js} +4 -4
- package/dist/cli-bundle/chunks/{close-X3CF6FQP.js → close-7NWA3GLA.js} +5 -5
- package/dist/cli-bundle/chunks/close-ZZCDDWJT.js +12 -0
- package/dist/cli-bundle/chunks/close-many-QCZHFCON.js +23 -0
- package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js → close-many-YALQ7AXS.js} +14 -14
- package/dist/cli-bundle/chunks/comments-FMQNYPSZ.js +13 -0
- package/dist/cli-bundle/chunks/{comments-TMHMALA5.js → comments-SQIQ5WYR.js} +7 -7
- package/dist/cli-bundle/chunks/copy-GI3RCVZP.js +9 -0
- package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js → copy-YDAMENCP.js} +4 -4
- package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js → create-JSL6CXU3.js} +11 -9
- package/dist/cli-bundle/chunks/create-LXMLYJNM.js +29 -0
- package/dist/cli-bundle/chunks/delete-5DFAXJNI.js +10 -0
- package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js → delete-IGVOZEU2.js} +4 -4
- package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js → deps-BQAXUQAK.js} +6 -6
- package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js → deps-CBPPSS6J.js} +6 -6
- package/dist/cli-bundle/chunks/docs-KCWPLQOV.js +14 -0
- package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js → docs-NS2AZWCN.js} +7 -7
- package/dist/cli-bundle/chunks/{files-3PXGXYDB.js → files-PVWEPT5J.js} +7 -7
- package/dist/cli-bundle/chunks/{files-EGLKHD7O.js → files-XUUBQ76I.js} +7 -7
- package/dist/cli-bundle/chunks/focus-3EJVFI3D.js +10 -0
- package/dist/cli-bundle/chunks/{focus-SRPASFTN.js → focus-DHBHKK3E.js} +5 -5
- package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js → history-compact-3TNPYVFG.js} +6 -6
- package/dist/cli-bundle/chunks/history-compact-JHYVDYLW.js +16 -0
- package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js → history-redact-ELRL73XN.js} +4 -4
- package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js → history-redact-KKFDICCF.js} +4 -4
- package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js → history-repair-J7WKZFAG.js} +6 -6
- package/dist/cli-bundle/chunks/history-repair-REMI7DDI.js +16 -0
- package/dist/cli-bundle/chunks/learnings-O6V5WDCV.js +13 -0
- package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js → learnings-X4D6JCCG.js} +7 -7
- package/dist/cli-bundle/chunks/{notes-73JWKWUD.js → notes-UQC6VS6N.js} +7 -7
- package/dist/cli-bundle/chunks/notes-ZSZREWZA.js +13 -0
- package/dist/cli-bundle/chunks/{plan-AZPMCG37.js → plan-5GKRBJJO.js} +12 -10
- package/dist/cli-bundle/chunks/plan-EZW2YDDY.js +26 -0
- package/dist/cli-bundle/chunks/{profile-AVCIIZID.js → profile-5PQAPCLF.js} +10 -10
- package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js → profile-CW4BD3FO.js} +10 -10
- package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js → register-list-query-HTDQE6VI.js} +24 -24
- package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js → register-list-query-PHIPDFP2.js} +24 -24
- package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js → register-mutation-BLEWM5I6.js} +32 -32
- package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js → register-mutation-OTYHR7J6.js} +32 -32
- package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js → register-operations-AMCUFYEW.js} +38 -40
- package/dist/cli-bundle/chunks/{register-operations-KHZYR6MG.js.map → register-operations-AMCUFYEW.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js → register-operations-MRLHOZYR.js} +36 -38
- package/dist/cli-bundle/chunks/{register-operations-WPQ2LWZJ.js.map → register-operations-MRLHOZYR.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js → register-setup-N2FOSWAG.js} +15 -17
- package/dist/cli-bundle/chunks/{register-setup-PGDNOXDQ.js.map → register-setup-N2FOSWAG.js.map} +1 -1
- package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js → register-setup-ZVKTDL4G.js} +17 -19
- package/dist/cli-bundle/chunks/{register-setup-TDN7WAO6.js.map → register-setup-ZVKTDL4G.js.map} +1 -1
- package/dist/cli-bundle/chunks/restore-A55MLFAI.js +14 -0
- package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js → restore-HEQAG6EK.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js → schema-MAXAIHEC.js} +6 -6
- package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js → schema-Q5DAWJ2S.js} +6 -6
- package/dist/cli-bundle/chunks/update-5DTSCWVF.js +23 -0
- package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js → update-DWFXXJKP.js} +15 -13
- package/dist/cli-bundle/chunks/update-many-6T4ZLZS7.js +34 -0
- package/dist/cli-bundle/chunks/update-many-MYRK6VBJ.js +38 -0
- package/dist/cli-bundle/main.js +152 -29
- package/dist/cli-bundle/main.js.map +3 -3
- package/dist/cli-bundle/sdk-runtime.js +72 -75
- package/dist/cli-bundle/sdk-testing.js +8 -8
- package/dist/cli-bundle/sdk.js +288 -642
- package/dist/cli-bundle/sdk.js.map +4 -4
- package/dist/core/extensions/activation-summary.d.ts +2 -0
- package/dist/core/extensions/activation-summary.js +7 -2
- package/dist/core/extensions/activation-summary.js.map +1 -1
- package/dist/core/extensions/capability-usage.d.ts +1 -1
- package/dist/core/extensions/capability-usage.js +5 -2
- package/dist/core/extensions/capability-usage.js.map +1 -1
- package/dist/core/extensions/extension-hook-runtime.js +3 -2
- package/dist/core/extensions/extension-hook-runtime.js.map +1 -1
- package/dist/core/extensions/extension-registries.js +3 -2
- package/dist/core/extensions/extension-registries.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +38 -1
- package/dist/core/extensions/extension-types.js +3 -2
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.js +36 -2
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/store/item-store.d.ts +4 -1
- package/dist/core/store/item-store.js +3 -3
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.d.ts +2 -0
- package/dist/core/store/paths.js +26 -3
- package/dist/core/store/paths.js.map +1 -1
- package/dist/sdk/cli-contracts/enum-contracts.d.ts +1 -1
- package/dist/sdk/compose.d.ts +3 -0
- package/dist/sdk/compose.js +14 -2
- package/dist/sdk/compose.js.map +1 -1
- package/dist/sdk/dependencies.js +3 -3
- package/dist/sdk/dependencies.js.map +1 -1
- package/dist/sdk/extension-command-context.d.ts +10 -0
- package/dist/sdk/extension-command-context.js +30 -0
- package/dist/sdk/extension-command-context.js.map +1 -0
- package/dist/sdk/graph/assembly.js +14 -4
- package/dist/sdk/graph/assembly.js.map +1 -1
- package/dist/sdk/graph/index.d.ts +1 -0
- package/dist/sdk/graph/index.js +3 -2
- package/dist/sdk/graph/index.js.map +1 -1
- package/dist/sdk/graph/mutation-advisory.d.ts +20 -0
- package/dist/sdk/graph/mutation-advisory.js +80 -0
- package/dist/sdk/graph/mutation-advisory.js.map +1 -0
- package/dist/sdk/graph/run.d.ts +5 -1
- package/dist/sdk/graph/run.js +11 -3
- package/dist/sdk/graph/run.js.map +1 -1
- package/dist/sdk/index.d.ts +4 -1
- package/dist/sdk/index.js +5 -2
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/ownership-source.d.ts +2 -0
- package/dist/sdk/ownership-source.js +22 -0
- package/dist/sdk/ownership-source.js.map +1 -0
- package/dist/sdk/relationship-history.d.ts +38 -0
- package/dist/sdk/relationship-history.js +60 -2
- package/dist/sdk/relationship-history.js.map +1 -1
- package/dist/sdk/relationships.js +49 -8
- package/dist/sdk/relationships.js.map +1 -1
- package/dist/sdk/runtime-input.js +3 -2
- package/dist/sdk/runtime-input.js.map +1 -1
- package/dist/sdk/runtime.d.ts +2 -0
- package/dist/sdk/runtime.js +19 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/sdk/tracker-root-discovery.d.ts +6 -0
- package/dist/sdk/tracker-root-discovery.js +10 -0
- package/dist/sdk/tracker-root-discovery.js.map +1 -0
- package/dist/sdk/workspace-transaction.d.ts +83 -0
- package/dist/sdk/workspace-transaction.js +364 -0
- package/dist/sdk/workspace-transaction.js.map +1 -0
- package/docs/AGENT_UX_CONTRACTS.md +41 -0
- package/docs/EXTENSIONS.md +4 -4
- package/docs/README.md +1 -0
- package/docs/SDK.md +102 -1
- package/marketplace.json +2 -2
- package/package.json +1 -1
- 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/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/packages/pm-vcs/GAP_REPORT.md +31 -0
- package/packages/pm-vcs/README.md +62 -0
- package/packages/pm-vcs/extensions/vcs/index.ts +745 -0
- package/packages/pm-vcs/extensions/vcs/manifest.json +19 -0
- package/packages/pm-vcs/extensions/vcs/package.json +3 -0
- package/packages/pm-vcs/package.json +55 -0
- package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
- package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
- package/dist/cli-bundle/chunks/append-JHO5K6RP.js +0 -11
- package/dist/cli-bundle/chunks/chunk-2BX74BAS.js +0 -125
- package/dist/cli-bundle/chunks/chunk-2BX74BAS.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js +0 -672
- package/dist/cli-bundle/chunks/chunk-3CUQZNQ6.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-5UKQLQM2.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-6VHUGVNP.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-74FKFFXO.js +0 -172
- package/dist/cli-bundle/chunks/chunk-74FKFFXO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-ADXDCAKP.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js +0 -178
- package/dist/cli-bundle/chunks/chunk-BAP7G3N2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-D53RTYVI.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-DHNG452T.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js +0 -1831
- package/dist/cli-bundle/chunks/chunk-EY7ZE3TG.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-F3VC3GOV.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-FL4D53ND.js +0 -162
- package/dist/cli-bundle/chunks/chunk-FL4D53ND.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-GKPCTQYG.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HPAYDSR2.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-HTXXXF45.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-I3INI567.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-KX62NMZC.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js +0 -662
- package/dist/cli-bundle/chunks/chunk-L5BTTDU5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-MR4SHYR4.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-OGVTB5VO.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-QPGQNLPI.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-QRZNCRNA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js +0 -122
- package/dist/cli-bundle/chunks/chunk-RC4UOUXA.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js +0 -1841
- package/dist/cli-bundle/chunks/chunk-RTBX3C4C.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-SIPOACV5.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-WACRQ26A.js.map +0 -7
- package/dist/cli-bundle/chunks/chunk-XC2HEEOV.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-XPUTSGJU.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YIIIAKCE.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YJSURTBB.js +0 -175
- package/dist/cli-bundle/chunks/chunk-YJSURTBB.js.map +0 -1
- package/dist/cli-bundle/chunks/chunk-YQEZWI3R.js.map +0 -7
- package/dist/cli-bundle/chunks/close-GPD7DTJV.js +0 -12
- package/dist/cli-bundle/chunks/close-many-NQLYGPYW.js +0 -23
- package/dist/cli-bundle/chunks/comments-2AOZQ5D2.js +0 -13
- package/dist/cli-bundle/chunks/copy-N3LCQBMC.js +0 -9
- package/dist/cli-bundle/chunks/create-KOGQ3JKD.js +0 -27
- package/dist/cli-bundle/chunks/delete-6G3MBZ6S.js +0 -10
- package/dist/cli-bundle/chunks/docs-OWRGDMNY.js +0 -14
- package/dist/cli-bundle/chunks/focus-KZLIA6WS.js +0 -10
- package/dist/cli-bundle/chunks/history-compact-HHIUOMZ7.js +0 -16
- package/dist/cli-bundle/chunks/history-repair-KG7SWXI6.js +0 -16
- package/dist/cli-bundle/chunks/learnings-ZVHSALJY.js +0 -13
- package/dist/cli-bundle/chunks/notes-BAKUL5DJ.js +0 -13
- package/dist/cli-bundle/chunks/plan-LEAGLPGP.js +0 -24
- package/dist/cli-bundle/chunks/restore-KIUYTAEJ.js +0 -14
- package/dist/cli-bundle/chunks/update-XZJYS5X7.js +0 -21
- package/dist/cli-bundle/chunks/update-many-R24B3GBK.js +0 -36
- package/dist/cli-bundle/chunks/update-many-WQ3R3J6N.js +0 -32
- /package/dist/cli-bundle/chunks/{append-5YF3TO7I.js.map → append-MBXHNWSX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{append-JHO5K6RP.js.map → append-XUYF7NON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BIRYX32V.js.map → chunk-2UCG5H6B.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VE6ZSTQW.js.map → chunk-2XPDCXK5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-GLZKZON6.js.map → chunk-3HSRP6T2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XWBD6DSR.js.map → chunk-3KPNOZOH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HO4DLBNK.js.map → chunk-4M6RZJXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-RXPQ5Q23.js.map → chunk-4PSJVGRE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YFE7JHX3.js.map → chunk-6BNV3G6C.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-43UMFKCK.js.map → chunk-6V4T4RD3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EHJFUOXL.js.map → chunk-7B7IHMLH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-I7DIDUSP.js.map → chunk-7CHWLT2J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L6FVNR7X.js.map → chunk-A3GAQLBH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-B57RJHBZ.js.map → chunk-A4FVWFZY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D52ZN3BF.js.map → chunk-A5EQPNV7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TZAE66GQ.js.map → chunk-AGEBQRBG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WU3KAN6A.js.map → chunk-AQUNTB7G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XWYQ2LT4.js.map → chunk-BBGR4FKQ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2FUOXSRN.js.map → chunk-BFJP4VYC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-633PKXLT.js.map → chunk-BZKE2O5V.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-L337QKWJ.js.map → chunk-DUDLSQFG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BVLOMU6O.js.map → chunk-E7KBMWEF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WQXRZMFN.js.map → chunk-EEECAV5M.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-35FHWD4C.js.map → chunk-EI3UIMZM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-PT7MCCGD.js.map → chunk-FIUTBFC6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7H5NNCJ5.js.map → chunk-FQF6VVPH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6DYOZS6C.js.map → chunk-FQO5THHM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-5HGZKQUL.js.map → chunk-FQODDTE7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-67RO3H4N.js.map → chunk-G33XIMRT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-QWBKN3QC.js.map → chunk-GKCEEXMA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DG2EQRIH.js.map → chunk-GRDK25BN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FXFCFL73.js.map → chunk-H3YKUVDR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ARGDWQ4J.js.map → chunk-IGBBTPM5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FY4RLHSC.js.map → chunk-IRJ6F23W.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-66MKH7SZ.js.map → chunk-IXG5CMBR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7UCY6DR5.js.map → chunk-JPWUZOMR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FVNWHUME.js.map → chunk-K2L6FZBX.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X2MGQMZO.js.map → chunk-LT5UWU7H.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-KH6QAHME.js.map → chunk-M4B4RK4J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2XOSFSTH.js.map → chunk-MQOSMBWV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-7R6UIHYY.js.map → chunk-N2TEEOXJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NTRQLE2R.js.map → chunk-N7FCFJ76.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-37DRDP2B.js.map → chunk-NPEYH6CE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2CXL335K.js.map → chunk-OK7VSX3N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NNANAWFH.js.map → chunk-OKPZDH43.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-G6MYGULG.js.map → chunk-OKWJUL6F.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-D5XHO4Q7.js.map → chunk-Q6JPYR7I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-IE5KRAKN.js.map → chunk-QQ77W23U.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-M7MVOKVV.js.map → chunk-QYGK2XQ3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-X5YCTFKT.js.map → chunk-RWAIRGBC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-W5E2UUSH.js.map → chunk-RX53WHFI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-R5XTTZSJ.js.map → chunk-SBW7EQC4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TM5CIO3F.js.map → chunk-SGJB6PXA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-DDFGYUCQ.js.map → chunk-STBCBDKF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-FHOBCGQO.js.map → chunk-SVAWG7EE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-6O44IN44.js.map → chunk-T6MOTLOJ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-EWIT5WIC.js.map → chunk-U6RYD446.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-E4FXM2XB.js.map → chunk-UE7LK3RE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-N33FD2UI.js.map → chunk-UNNCT5QY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-2IPNL3DR.js.map → chunk-UOIFZ66L.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-LSOWTLEM.js.map → chunk-UU6EP25G.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-HYTOJW2Q.js.map → chunk-UW6HCMP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-47HXN6RX.js.map → chunk-UWAQI3B7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-YKFHF37B.js.map → chunk-V4QHAMI5.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-VAHZIPWS.js.map → chunk-VA3H7VVC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-TLWJP5BF.js.map → chunk-VQOG2ETB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-H5IOT54C.js.map → chunk-VSQE43NO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-BDA35QG5.js.map → chunk-W6IEJXNC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-OWP6QFBV.js.map → chunk-XDWXPG2E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-CKX4WOPC.js.map → chunk-XKVHL3MB.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-WL3SS45P.js.map → chunk-XVB6BATY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NVZ6NVHJ.js.map → chunk-XXWDEQ6O.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-ILVOOAT4.js.map → chunk-Y2VSGFT4.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-NCVT6XEL.js.map → chunk-YG56M3NE.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AFGKSHAM.js.map → chunk-YGEA4CLH.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-AXRT7K5V.js.map → chunk-YIC5NGXF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{chunk-XXLXJL7V.js.map → chunk-ZUCBPXNA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-X3CF6FQP.js.map → close-7NWA3GLA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-GPD7DTJV.js.map → close-ZZCDDWJT.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-NQLYGPYW.js.map → close-many-QCZHFCON.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{close-many-J7A5EHOQ.js.map → close-many-YALQ7AXS.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-2AOZQ5D2.js.map → comments-FMQNYPSZ.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{comments-TMHMALA5.js.map → comments-SQIQ5WYR.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-N3LCQBMC.js.map → copy-GI3RCVZP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{copy-FWQA5OU4.js.map → copy-YDAMENCP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-AQ5SIGZC.js.map → create-JSL6CXU3.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{create-KOGQ3JKD.js.map → create-LXMLYJNM.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-6G3MBZ6S.js.map → delete-5DFAXJNI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{delete-YYYFOSEA.js.map → delete-IGVOZEU2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-NIIKXLPB.js.map → deps-BQAXUQAK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{deps-MQ4ZIGZB.js.map → deps-CBPPSS6J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-OWRGDMNY.js.map → docs-KCWPLQOV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{docs-53NUGMIQ.js.map → docs-NS2AZWCN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-3PXGXYDB.js.map → files-PVWEPT5J.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{files-EGLKHD7O.js.map → files-XUUBQ76I.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-KZLIA6WS.js.map → focus-3EJVFI3D.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{focus-SRPASFTN.js.map → focus-DHBHKK3E.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-G4DULDCX.js.map → history-compact-3TNPYVFG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-compact-HHIUOMZ7.js.map → history-compact-JHYVDYLW.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-IUSJ6X3E.js.map → history-redact-ELRL73XN.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-redact-THHGRQXV.js.map → history-redact-KKFDICCF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-LUQWRS7X.js.map → history-repair-J7WKZFAG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{history-repair-KG7SWXI6.js.map → history-repair-REMI7DDI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-ZVHSALJY.js.map → learnings-O6V5WDCV.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{learnings-2MRNBFJF.js.map → learnings-X4D6JCCG.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-73JWKWUD.js.map → notes-UQC6VS6N.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{notes-BAKUL5DJ.js.map → notes-ZSZREWZA.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-AZPMCG37.js.map → plan-5GKRBJJO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{plan-LEAGLPGP.js.map → plan-EZW2YDDY.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-AVCIIZID.js.map → profile-5PQAPCLF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{profile-LFYO3HHX.js.map → profile-CW4BD3FO.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-UKMF55FT.js.map → register-list-query-HTDQE6VI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-list-query-MZUF2EEC.js.map → register-list-query-PHIPDFP2.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-T6RVNJC4.js.map → register-mutation-BLEWM5I6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{register-mutation-2PBW2GEX.js.map → register-mutation-OTYHR7J6.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-KIUYTAEJ.js.map → restore-A55MLFAI.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{restore-E3PRGDN3.js.map → restore-HEQAG6EK.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-5JNFQFUW.js.map → schema-MAXAIHEC.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{schema-TMIW4XZC.js.map → schema-Q5DAWJ2S.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-XZJYS5X7.js.map → update-5DTSCWVF.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-SQYZA3ZW.js.map → update-DWFXXJKP.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-WQ3R3J6N.js.map → update-many-6T4ZLZS7.js.map} +0 -0
- /package/dist/cli-bundle/chunks/{update-many-R24B3GBK.js.map → update-many-MYRK6VBJ.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies.js","sources":["sdk/dependencies.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/dependencies\n *\n * Implements the pm deps command surface and its agent-facing runtime behavior.\n */\nimport { getActiveExtensionRegistrations } from \"../core/extensions/index.js\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { isTerminalStatus } from \"../core/item/status.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport {\n listAllItemMetadataLight,\n locateItem,\n readLocatedItem,\n} from \"../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport type {\n Dependency,\n ItemMetadata,\n ItemStatus,\n ItemType,\n} from \"../types/index.js\";\nimport {\n assembleWorkspaceRelationshipGraph,\n collectDanglingDependencyReferences,\n type DanglingDependencyReference,\n type WorkspaceRelationshipAssembly,\n} from \"./graph/assembly.js\";\nimport {\n computeWorkspaceGraphFingerprint,\n workspaceGraphCache,\n} from \"./graph/cache.js\";\nimport {\n buildRelationshipContext,\n type RelationshipContextOptions,\n type RelationshipContextResult,\n} from \"./relationship-context.js\";\nimport { createRelationshipKindRegistry } from \"./relationships.js\";\n\n/** Supported values accepted by the deps format contract. */\nexport const DEPS_FORMAT_VALUES = [\"tree\", \"graph\", \"context\"] as const;\n/** Restricts deps format values accepted by command, SDK, and storage contracts. */\nexport type DepsFormat = (typeof DEPS_FORMAT_VALUES)[number];\n/** Supported values accepted by the deps collapse contract. */\nexport const DEPS_COLLAPSE_VALUES = [\"none\", \"repeated\"] as const;\n/** Restricts deps collapse mode values accepted by command, SDK, and storage contracts. */\nexport type DepsCollapseMode = (typeof DEPS_COLLAPSE_VALUES)[number];\n/** Supported values accepted by the deps graph-context direction contract. */\nexport const DEPS_DIRECTION_VALUES = [\"outgoing\", \"incoming\", \"both\"] as const;\n/** Restricts deps traversal-direction values accepted by command, SDK, and storage contracts. */\nexport type DepsDirection = (typeof DEPS_DIRECTION_VALUES)[number];\n\n/** Documents the deps command options payload exchanged by command, SDK, and package integrations. */\nexport interface DepsCommandOptions {\n /** Value that configures or reports format for this contract. */\n format?: string;\n /** Value that configures or reports max depth for this contract. */\n maxDepth?: string | number;\n /** Value that configures or reports collapse for this contract. */\n collapse?: string;\n /** Value that configures or reports summary for this contract. */\n summary?: boolean;\n /** Maximum graph-context nodes returned. */\n nodeLimit?: string | number;\n /** Maximum graph-context edges and enumerated missing-reference rows returned. */\n edgeLimit?: string | number;\n /** Maximum estimated graph-context output tokens. */\n tokenBudget?: string | number;\n /** Opaque continuation cursor for graph-context output. */\n cursor?: string;\n /** Graph-context traversal direction relative to each visited node. */\n direction?: string;\n /** Registered relationship kinds narrowing graph-context traversal. */\n kind?: string | string[];\n}\n\ninterface IndexedItem {\n id: string;\n title: string;\n type: ItemType;\n status: ItemStatus;\n dependencies: IndexedDependency[];\n}\n\ninterface IndexedDependency {\n id: string;\n kind: string;\n}\n\n/** Documents the deps tree node payload exchanged by command, SDK, and package integrations. */\nexport interface DepsTreeNode {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: ItemType;\n /** Lifecycle state reported for status. */\n status?: ItemStatus;\n /** Value that configures or reports via for this contract. */\n via?: string;\n /** Value that configures or reports missing for this contract. */\n missing: boolean;\n /** Value that configures or reports cycle for this contract. */\n cycle: boolean;\n /** Value that configures or reports truncated for this contract. */\n truncated?: boolean;\n /** Value that configures or reports collapsed for this contract. */\n collapsed?: boolean;\n /** Value that configures or reports dependencies for this contract. */\n dependencies: DepsTreeNode[];\n}\n\n/** Documents the deps graph node payload exchanged by command, SDK, and package integrations. */\nexport interface DepsGraphNode {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: ItemType;\n /** Lifecycle state reported for status. */\n status?: ItemStatus;\n /** Value that configures or reports missing for this contract. */\n missing: boolean;\n}\n\n/** Documents the deps graph edge payload exchanged by command, SDK, and package integrations. */\nexport interface DepsGraphEdge {\n /** Value that configures or reports from for this contract. */\n from: string;\n /** Value that configures or reports to for this contract. */\n to: string;\n /** Value that configures or reports kind for this contract. */\n kind: string;\n}\n\n/** Documents the deps graph result payload exchanged by command, SDK, and package integrations. */\nexport interface DepsGraphResult {\n /** Value that configures or reports root id for this contract. */\n root_id: string;\n /** Value that configures or reports nodes for this contract. */\n nodes: DepsGraphNode[];\n /** Value that configures or reports edges for this contract. */\n edges: DepsGraphEdge[];\n /** Value that configures or reports missing ids for this contract. */\n missing_ids: string[];\n}\n\n/** Documents the deps result payload exchanged by command, SDK, and package integrations. */\nexport interface DepsResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports format for this contract. */\n format: DepsFormat;\n /** Number of node entries represented by this result. */\n node_count: number;\n /** Number of edge entries represented by this result. */\n edge_count: number;\n /**\n * Number of missing entries represented by this result.\n *\n * Tree and graph formats count missing nodes encountered while walking\n * dependency edges; context format counts missing nodes reachable within the\n * same bounded traversal (direction, kinds, and depth) that produced the\n * packet, independent of node or token pagination, so the two formats agree\n * for equal traversal parameters over the dependency edge family.\n */\n missing_count: number;\n /** Traversal scope documenting the missing_count semantics for context format. */\n missing_scope?: \"traversal\";\n /** Total dangling references declared into the traversed missing nodes. */\n missing_reference_count?: number;\n /** Bounded enumeration of dangling references, capped by the context edge limit. */\n missing_references?: DanglingDependencyReference[];\n /** Value that configures or reports tree for this contract. */\n tree?: DepsTreeNode;\n /** Value that configures or reports graph for this contract. */\n graph?: DepsGraphResult;\n /** Explainable bounded graph-context projection. */\n context?: RelationshipContextResult;\n}\n\nfunction parseFormat(raw: string | undefined): DepsFormat {\n const candidate = raw?.trim().toLowerCase() ?? \"tree\";\n if ((DEPS_FORMAT_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsFormat;\n }\n throw new PmCliError(\n `Invalid --format value \"${raw}\". Use \"tree\", \"graph\", or \"context\".`,\n EXIT_CODE.USAGE,\n );\n}\n\n/** Parse one positive-integer graph bound, failing fast with the offending flag name. */\nexport function parsePositiveInteger(raw: string | number | undefined, flag: string): number | undefined {\n if (raw === undefined) return undefined;\n const value = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(value) || value < 1)\n throw new PmCliError(`Invalid --${flag} value \"${raw}\". Use a positive integer.`, EXIT_CODE.USAGE);\n return value;\n}\n\n/** Parse the shared non-negative --max-depth traversal bound. */\nexport function parseMaxDepth(raw: string | number | undefined): number | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(normalized) || normalized < 0) {\n throw new PmCliError(\n `Invalid --max-depth value \"${raw}\". Use a non-negative integer.`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\nfunction parseCollapse(raw: string | undefined): DepsCollapseMode {\n const candidate = raw?.trim().toLowerCase() ?? \"none\";\n if ((DEPS_COLLAPSE_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsCollapseMode;\n }\n throw new PmCliError(\n `Invalid --collapse value \"${raw}\". Use \"none\" or \"repeated\".`,\n EXIT_CODE.USAGE,\n );\n}\n\n/** Parse the shared graph traversal --direction value, defaulting to \"both\". */\nexport function parseDirection(raw: string | undefined): DepsDirection {\n const candidate = raw?.trim().toLowerCase() ?? \"both\";\n if ((DEPS_DIRECTION_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsDirection;\n }\n throw new PmCliError(\n `Invalid --direction value \"${raw}\". Use \"outgoing\", \"incoming\", or \"both\".`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Normalize repeatable and comma-separated --kind values against the built-in\n * relationship ontology, failing fast on unknown kinds instead of silently\n * matching nothing (the multi-value filter-grammar trap tracked by pm-gknu).\n */\nexport function parseKinds(raw: string | string[] | undefined): string[] | undefined {\n if (raw === undefined) return undefined;\n const registry = createRelationshipKindRegistry();\n const values = (Array.isArray(raw) ? raw : [raw])\n .flatMap((value) => value.split(\",\"))\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n if (values.length === 0) return undefined;\n const kinds = new Set<string>();\n for (const value of values) {\n const definition = registry.resolve(value);\n if (!definition) {\n const known = registry\n .list()\n .map((entry) => entry.kind)\n .join(\", \");\n throw new PmCliError(\n `Invalid --kind value \"${value}\". Registered kinds: ${known}.`,\n EXIT_CODE.USAGE,\n );\n }\n kinds.add(definition.kind);\n }\n return [...kinds].sort();\n}\n\nfunction normalizeDependencies(\n dependencies: Dependency[] | undefined,\n): IndexedDependency[] {\n if (!dependencies || dependencies.length === 0) {\n return [];\n }\n const sorted = dependencies.map(({ id, kind }) => ({\n id: id.trim(),\n kind: kind.trim().toLowerCase(),\n })).sort((left, right) => {\n const byKind = left.kind.localeCompare(right.kind);\n if (byKind !== 0) return byKind;\n return left.id.localeCompare(right.id);\n });\n const deduped = new Map<string, IndexedDependency>();\n for (const dependency of sorted) {\n const key = `${dependency.kind.toLowerCase()}::${dependency.id.toLowerCase()}`;\n if (!deduped.has(key)) {\n deduped.set(key, { id: dependency.id, kind: dependency.kind });\n }\n }\n return [...deduped.values()];\n}\n\nfunction toIndexedItem(item: ItemMetadata): IndexedItem {\n return {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n dependencies: normalizeDependencies(item.dependencies),\n };\n}\n\nfunction toTreeNode(\n id: string,\n index: Map<string, IndexedItem>,\n lineage: Set<string>,\n maxDepth: number | undefined,\n collapse: DepsCollapseMode,\n expanded: Set<string>,\n depth = 0,\n via?: string,\n): DepsTreeNode {\n const lookupId = id.trim().toLowerCase();\n const item = index.get(lookupId);\n const baseNode: DepsTreeNode = {\n id: item?.id ?? id,\n title: item?.title,\n type: item?.type,\n status: item?.status,\n via,\n missing: !item,\n cycle: lineage.has(lookupId),\n dependencies: [],\n };\n if (!item || baseNode.cycle) {\n return baseNode;\n }\n if (maxDepth !== undefined && depth >= maxDepth) {\n if (item.dependencies.length > 0) {\n baseNode.truncated = true;\n }\n return baseNode;\n }\n if (collapse === \"repeated\" && expanded.has(lookupId)) {\n baseNode.collapsed = true;\n return baseNode;\n }\n if (collapse === \"repeated\") {\n expanded.add(lookupId);\n }\n const nextLineage = new Set(lineage);\n nextLineage.add(lookupId);\n baseNode.dependencies = item.dependencies.map((dependency) =>\n toTreeNode(\n dependency.id,\n index,\n nextLineage,\n maxDepth,\n collapse,\n expanded,\n depth + 1,\n dependency.kind,\n ),\n );\n return baseNode;\n}\n\nfunction mergeGraphNode(\n existing: DepsGraphNode | undefined,\n candidate: DepsGraphNode,\n): DepsGraphNode {\n if (!existing) {\n return candidate;\n }\n /* c8 ignore start -- defensive: mixed missing/non-missing duplicates only occur in malformed synthetic trees. */\n if (existing.missing && !candidate.missing) return candidate;\n /* c8 ignore stop */\n return {\n ...existing,\n title: existing.title ?? candidate.title,\n type: existing.type ?? candidate.type,\n status: existing.status ?? candidate.status,\n };\n}\n\nfunction toGraph(root: DepsTreeNode): DepsGraphResult {\n const nodesById = new Map<string, DepsGraphNode>();\n const edgesByKey = new Map<string, DepsGraphEdge>();\n\n const visit = (node: DepsTreeNode): void => {\n nodesById.set(\n node.id,\n mergeGraphNode(nodesById.get(node.id), {\n id: node.id,\n title: node.title,\n type: node.type,\n status: node.status,\n missing: node.missing,\n }),\n );\n for (const child of node.dependencies) {\n nodesById.set(\n child.id,\n mergeGraphNode(nodesById.get(child.id), {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n missing: child.missing,\n }),\n );\n /* c8 ignore start -- legacy malformed dependency payloads may omit kind/via. */\n const relationKind = child.via ?? \"related\";\n const edgeKey = `${node.id}::${child.id}::${relationKind}`;\n if (!edgesByKey.has(edgeKey)) {\n edgesByKey.set(edgeKey, {\n from: node.id,\n to: child.id,\n kind: relationKind,\n });\n }\n /* c8 ignore stop */\n if (!child.cycle) {\n visit(child);\n }\n }\n };\n\n visit(root);\n\n const nodes = [...nodesById.values()].sort((left, right) =>\n left.id.localeCompare(right.id),\n );\n const edges = [...edgesByKey.values()].sort((left, right) => {\n const byFrom = left.from.localeCompare(right.from);\n if (byFrom !== 0) return byFrom;\n const byTo = left.to.localeCompare(right.to);\n if (byTo !== 0) return byTo;\n return left.kind.localeCompare(right.kind);\n });\n const missingIds = nodes\n .filter((node) => node.missing)\n .map((node) => node.id);\n return {\n root_id: root.id,\n nodes,\n edges,\n missing_ids: missingIds,\n };\n}\n\n/** Count a dependency result without allocating its potentially exponential tree payload. */\nfunction countDependencyGraph(\n rootId: string,\n index: Map<string, IndexedItem>,\n maxDepth: number | undefined,\n): Pick<DepsResult, \"node_count\" | \"edge_count\" | \"missing_count\"> {\n const nodeIds = new Set<string>();\n const edgeKeys = new Set<string>();\n const missingIds = new Set<string>();\n const expanded = new Set<string>();\n const pending = [{ id: rootId, depth: 0 }];\n let pendingIndex = 0;\n while (pendingIndex < pending.length) {\n const current = pending[pendingIndex++]!;\n const lookupId = current.id.trim().toLowerCase();\n nodeIds.add(lookupId);\n const item = index.get(lookupId);\n if (!item) {\n missingIds.add(lookupId);\n continue;\n }\n if (maxDepth !== undefined && current.depth >= maxDepth) {\n continue;\n }\n if (expanded.has(lookupId)) {\n continue;\n }\n expanded.add(lookupId);\n for (const dependency of item.dependencies) {\n edgeKeys.add(\n `${lookupId}::${dependency.id.trim().toLowerCase()}::${dependency.kind}`,\n );\n pending.push({ id: dependency.id, depth: current.depth + 1 });\n }\n }\n return {\n node_count: nodeIds.size,\n edge_count: edgeKeys.size,\n missing_count: missingIds.size,\n };\n}\n\n/** Options subset consumed by the deps graph-context projection. */\ntype DepsContextOptions = Pick<\n DepsCommandOptions,\n | \"maxDepth\"\n | \"nodeLimit\"\n | \"edgeLimit\"\n | \"tokenBudget\"\n | \"cursor\"\n | \"direction\"\n | \"kind\"\n>;\n\n/** Parse CLI-compatible deps context options once for packet and closure parity. */\nfunction parseDepsContextOptions(\n options: DepsContextOptions,\n): RelationshipContextOptions {\n const maxDepth = parseMaxDepth(options.maxDepth);\n const nodeLimit = parsePositiveInteger(options.nodeLimit, \"node-limit\");\n const edgeLimit = parsePositiveInteger(options.edgeLimit, \"edge-limit\");\n const tokenBudget = parsePositiveInteger(options.tokenBudget, \"token-budget\");\n const kinds = parseKinds(options.kind);\n return {\n direction: parseDirection(options.direction),\n ...(kinds === undefined ? {} : { kinds }),\n ...(maxDepth === undefined ? {} : { maxDepth }),\n ...(nodeLimit === undefined ? {} : { nodeLimit }),\n ...(edgeLimit === undefined ? {} : { edgeLimit }),\n ...(tokenBudget === undefined ? {} : { tokenBudget }),\n ...(options.cursor?.trim() ? { cursor: options.cursor.trim() } : {}),\n };\n}\n\n/** Build one bounded context packet from an assembled deps relationship graph. */\nfunction buildContextFromAssembly(\n assembly: WorkspaceRelationshipAssembly,\n rootId: string,\n options: RelationshipContextOptions,\n rootEvidence: readonly string[],\n): RelationshipContextResult {\n return buildRelationshipContext(\n assembly.graph,\n rootId,\n assembly.details.map((detail) =>\n detail.id === rootId && rootEvidence.length > 0\n ? { ...detail, evidence: rootEvidence }\n : detail,\n ),\n options,\n );\n}\n\n/** Build the SDK-backed bounded relationship-context projection for deps. */\nexport function buildDepsRelationshipContext(\n rootId: string,\n items: readonly ItemMetadata[],\n options: DepsContextOptions,\n rootEvidence: readonly string[] = [],\n): RelationshipContextResult {\n return buildContextFromAssembly(\n assembleWorkspaceRelationshipGraph(items),\n rootId,\n parseDepsContextOptions(options),\n rootEvidence,\n );\n}\n\n/** Append up to `limit` labeled pointers from one linked collection. */\nfunction appendEvidencePointers(\n evidence: string[],\n label: string,\n values: readonly (string | undefined)[],\n limit: number,\n): void {\n for (const value of values.slice(0, limit)) {\n const trimmed = value?.trim();\n if (trimmed) evidence.push(`${label}:${trimmed}`);\n }\n}\n\n/**\n * Load bounded root evidence pointers (linked files, tests, docs, and\n * annotation counts) so the context packet answers \"where is the proof\"\n * without a follow-up item read.\n */\nasync function collectRootEvidence(\n pmRoot: string,\n id: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n typeToFolder: Record<string, string>,\n): Promise<string[]> {\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeToFolder,\n );\n // The caller already resolved the root against the light index, so a miss\n // can only happen when storage mutates mid-read; degrade to no evidence.\n /* c8 ignore start -- defensive: unreachable without a concurrent delete between the index scan and this read. */\n if (!located) return [];\n /* c8 ignore stop */\n const { document } = await readLocatedItem(located, {\n schema: settings.schema,\n });\n const metadata = document.metadata;\n const files = metadata.files ?? [];\n const tests = metadata.tests ?? [];\n const docs = metadata.docs ?? [];\n const counts = [\n [\"files\", files.length],\n [\"tests\", tests.length],\n [\"docs\", docs.length],\n [\"comments\", (metadata.comments ?? []).length],\n [\"notes\", (metadata.notes ?? []).length],\n [\"learnings\", (metadata.learnings ?? []).length],\n ] as const;\n if (counts.every(([, count]) => count === 0)) return [];\n const evidence = [\n `linked:${counts.map(([key, count]) => `${key}=${count}`).join(\",\")}`,\n ];\n appendEvidencePointers(evidence, \"file\", files.map((file) => file.path), 3);\n appendEvidencePointers(\n evidence,\n \"test\",\n tests.map((test) => test.command ?? test.path),\n 2,\n );\n appendEvidencePointers(evidence, \"doc\", docs.map((doc) => doc.path), 2);\n return evidence;\n}\n\n/** Assemble the context-format deps result with traversal-scoped missing enumeration. */\nfunction buildContextDepsResult(params: {\n assembly: WorkspaceRelationshipAssembly;\n canonicalId: string;\n options: DepsCommandOptions;\n rootEvidence: readonly string[];\n summaryOnly: boolean;\n}): DepsResult {\n const { assembly, canonicalId, options, rootEvidence, summaryOnly } = params;\n const contextOptions = parseDepsContextOptions(options);\n const context = buildContextFromAssembly(\n assembly,\n canonicalId,\n contextOptions,\n rootEvidence,\n );\n const reachable = assembly.graph.closure(canonicalId, {\n direction: contextOptions.direction,\n ...(contextOptions.kinds === undefined\n ? {}\n : { kinds: contextOptions.kinds }),\n maxDepth: contextOptions.maxDepth ?? 3,\n });\n const missingReachable = reachable.value.filter((nodeId) =>\n assembly.missingIdSet.has(nodeId.toLowerCase()),\n );\n const missingReachableSet = new Set(\n missingReachable.map((nodeId) => nodeId.toLowerCase()),\n );\n const relationshipRegistry = createRelationshipKindRegistry();\n const filteredKinds = contextOptions.kinds\n ? new Set(\n contextOptions.kinds.map(\n (kind) => relationshipRegistry.require(kind).kind,\n ),\n )\n : undefined;\n const packetIds = new Set([canonicalId, ...reachable.value]);\n const missingReferences = [\n ...assembly.dangling.active,\n ...assembly.dangling.legacy_terminal,\n ].filter((row) => {\n if (\n row.no_active_blocker_sentinel ||\n !missingReachableSet.has(row.target_id.trim().toLowerCase()) ||\n !packetIds.has(row.holder_id)\n )\n return false;\n if (filteredKinds === undefined) return true;\n const definition = relationshipRegistry.resolve(row.kind);\n return (\n definition !== undefined &&\n (filteredKinds.has(definition.kind) ||\n (definition.inverse !== undefined &&\n filteredKinds.has(definition.inverse)))\n );\n });\n const referenceLimit = contextOptions.edgeLimit ?? 40;\n return {\n id: canonicalId,\n format: \"context\",\n node_count: context.nodes.length + 1,\n edge_count: context.edges.length,\n missing_count: missingReachable.length,\n missing_scope: \"traversal\",\n missing_reference_count: missingReferences.length,\n ...(summaryOnly\n ? {}\n : {\n missing_references: missingReferences.slice(0, referenceLimit),\n context,\n }),\n };\n}\n\n/** Implements run deps for the public runtime surface of this module. */\nexport async function runDeps(\n id: string,\n options: DepsCommandOptions,\n global: GlobalOptions,\n): Promise<DepsResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const format = parseFormat(options.format);\n const maxDepth = parseMaxDepth(options.maxDepth);\n const collapse = parseCollapse(options.collapse);\n const summaryOnly = options.summary === true;\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const items = await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const index = new Map(\n items.map((item) => [item.id.trim().toLowerCase(), toIndexedItem(item)]),\n );\n const dangling = collectDanglingDependencyReferences(\n items,\n (status) => isTerminalStatus(status, statusRegistry),\n );\n for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {\n const holder = index.get(reference.holder_id.trim().toLowerCase());\n const referenceKind = reference.kind.trim().toLowerCase();\n if (\n holder &&\n !holder.dependencies.some(\n (dependency) =>\n dependency.id.trim().toLowerCase() === reference.target_id.trim().toLowerCase() &&\n dependency.kind === referenceKind,\n )\n ) {\n holder.dependencies.push({ id: reference.target_id, kind: referenceKind });\n }\n }\n if (!index.has(id.trim().toLowerCase())) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n\n if (format === \"context\") {\n const canonicalId = index.get(id.trim().toLowerCase())!.id;\n const rootEvidence = summaryOnly\n ? []\n : await collectRootEvidence(\n pmRoot,\n canonicalId,\n settings,\n typeRegistry.type_to_folder,\n );\n const isTerminal = (status: ItemStatus): boolean =>\n isTerminalStatus(status, statusRegistry);\n // Reuse the fingerprint-keyed shared cache so bounded context packets in\n // long-lived hosts stop paying full-workspace assembly on every call.\n const lookup = workspaceGraphCache().lookup(\n pmRoot,\n computeWorkspaceGraphFingerprint(items, isTerminal),\n () => assembleWorkspaceRelationshipGraph(items, isTerminal),\n );\n return buildContextDepsResult({\n assembly: lookup.assembly,\n canonicalId,\n options,\n rootEvidence,\n summaryOnly,\n });\n }\n\n if (summaryOnly) {\n return {\n id,\n format,\n ...countDependencyGraph(id, index, maxDepth),\n };\n }\n\n const tree = toTreeNode(\n id,\n index,\n new Set<string>(),\n maxDepth,\n collapse,\n new Set<string>(),\n );\n const graph = toGraph(tree);\n const baseResult = {\n id,\n format,\n node_count: graph.nodes.length,\n edge_count: graph.edges.length,\n missing_count: graph.missing_ids.length,\n };\n if (format === \"tree\") {\n return {\n ...baseResult,\n tree,\n };\n }\n return {\n ...baseResult,\n graph,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AA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U;QACb,KAAK;KACN,CAAC;AACJ,CAAC","debugId":"1f69c8aa-b089-5f6e-8b5a-63695f1e6bbf"}
|
|
1
|
+
{"version":3,"file":"dependencies.js","sources":["sdk/dependencies.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/dependencies\n *\n * Implements the pm deps command surface and its agent-facing runtime behavior.\n */\nimport { getActiveExtensionRegistrations } from \"../core/extensions/index.js\";\nimport { pathExists } from \"../core/fs/fs-utils.js\";\nimport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nimport { isTerminalStatus } from \"../core/item/status.js\";\nimport { resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nimport { EXIT_CODE } from \"../core/shared/constants.js\";\nimport type { GlobalOptions } from \"../core/shared/command-types.js\";\nimport { PmCliError } from \"../core/shared/errors.js\";\nimport {\n listAllItemMetadataLight,\n locateItem,\n readLocatedItem,\n} from \"../core/store/item-store.js\";\nimport { getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nimport { readSettings } from \"../core/store/settings.js\";\nimport type {\n Dependency,\n ItemMetadata,\n ItemStatus,\n ItemType,\n} from \"../types/index.js\";\nimport {\n assembleWorkspaceRelationshipGraph,\n collectDanglingDependencyReferences,\n type DanglingDependencyReference,\n type WorkspaceRelationshipAssembly,\n} from \"./graph/assembly.js\";\nimport {\n computeWorkspaceGraphFingerprint,\n workspaceGraphCache,\n} from \"./graph/cache.js\";\nimport {\n buildRelationshipContext,\n type RelationshipContextOptions,\n type RelationshipContextResult,\n} from \"./relationship-context.js\";\nimport { createRelationshipKindRegistry } from \"./relationships.js\";\n\n/** Supported values accepted by the deps format contract. */\nexport const DEPS_FORMAT_VALUES = [\"tree\", \"graph\", \"context\"] as const;\n/** Restricts deps format values accepted by command, SDK, and storage contracts. */\nexport type DepsFormat = (typeof DEPS_FORMAT_VALUES)[number];\n/** Supported values accepted by the deps collapse contract. */\nexport const DEPS_COLLAPSE_VALUES = [\"none\", \"repeated\"] as const;\n/** Restricts deps collapse mode values accepted by command, SDK, and storage contracts. */\nexport type DepsCollapseMode = (typeof DEPS_COLLAPSE_VALUES)[number];\n/** Supported values accepted by the deps graph-context direction contract. */\nexport const DEPS_DIRECTION_VALUES = [\"outgoing\", \"incoming\", \"both\"] as const;\n/** Restricts deps traversal-direction values accepted by command, SDK, and storage contracts. */\nexport type DepsDirection = (typeof DEPS_DIRECTION_VALUES)[number];\n\n/** Documents the deps command options payload exchanged by command, SDK, and package integrations. */\nexport interface DepsCommandOptions {\n /** Value that configures or reports format for this contract. */\n format?: string;\n /** Value that configures or reports max depth for this contract. */\n maxDepth?: string | number;\n /** Value that configures or reports collapse for this contract. */\n collapse?: string;\n /** Value that configures or reports summary for this contract. */\n summary?: boolean;\n /** Maximum graph-context nodes returned. */\n nodeLimit?: string | number;\n /** Maximum graph-context edges and enumerated missing-reference rows returned. */\n edgeLimit?: string | number;\n /** Maximum estimated graph-context output tokens. */\n tokenBudget?: string | number;\n /** Opaque continuation cursor for graph-context output. */\n cursor?: string;\n /** Graph-context traversal direction relative to each visited node. */\n direction?: string;\n /** Registered relationship kinds narrowing graph-context traversal. */\n kind?: string | string[];\n}\n\ninterface IndexedItem {\n id: string;\n title: string;\n type: ItemType;\n status: ItemStatus;\n dependencies: IndexedDependency[];\n}\n\ninterface IndexedDependency {\n id: string;\n kind: string;\n}\n\n/** Documents the deps tree node payload exchanged by command, SDK, and package integrations. */\nexport interface DepsTreeNode {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: ItemType;\n /** Lifecycle state reported for status. */\n status?: ItemStatus;\n /** Value that configures or reports via for this contract. */\n via?: string;\n /** Value that configures or reports missing for this contract. */\n missing: boolean;\n /** Value that configures or reports cycle for this contract. */\n cycle: boolean;\n /** Value that configures or reports truncated for this contract. */\n truncated?: boolean;\n /** Value that configures or reports collapsed for this contract. */\n collapsed?: boolean;\n /** Value that configures or reports dependencies for this contract. */\n dependencies: DepsTreeNode[];\n}\n\n/** Documents the deps graph node payload exchanged by command, SDK, and package integrations. */\nexport interface DepsGraphNode {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports title for this contract. */\n title?: string;\n /** Schema type that determines the shape and validation rules for this value. */\n type?: ItemType;\n /** Lifecycle state reported for status. */\n status?: ItemStatus;\n /** Value that configures or reports missing for this contract. */\n missing: boolean;\n}\n\n/** Documents the deps graph edge payload exchanged by command, SDK, and package integrations. */\nexport interface DepsGraphEdge {\n /** Value that configures or reports from for this contract. */\n from: string;\n /** Value that configures or reports to for this contract. */\n to: string;\n /** Value that configures or reports kind for this contract. */\n kind: string;\n}\n\n/** Documents the deps graph result payload exchanged by command, SDK, and package integrations. */\nexport interface DepsGraphResult {\n /** Value that configures or reports root id for this contract. */\n root_id: string;\n /** Value that configures or reports nodes for this contract. */\n nodes: DepsGraphNode[];\n /** Value that configures or reports edges for this contract. */\n edges: DepsGraphEdge[];\n /** Value that configures or reports missing ids for this contract. */\n missing_ids: string[];\n}\n\n/** Documents the deps result payload exchanged by command, SDK, and package integrations. */\nexport interface DepsResult {\n /** Stable identifier used to reference this record across commands and storage. */\n id: string;\n /** Value that configures or reports format for this contract. */\n format: DepsFormat;\n /** Number of node entries represented by this result. */\n node_count: number;\n /** Number of edge entries represented by this result. */\n edge_count: number;\n /**\n * Number of missing entries represented by this result.\n *\n * Tree and graph formats count missing nodes encountered while walking\n * dependency edges; context format counts missing nodes reachable within the\n * same bounded traversal (direction, kinds, and depth) that produced the\n * packet, independent of node or token pagination, so the two formats agree\n * for equal traversal parameters over the dependency edge family.\n */\n missing_count: number;\n /** Traversal scope documenting the missing_count semantics for context format. */\n missing_scope?: \"traversal\";\n /** Total dangling references declared into the traversed missing nodes. */\n missing_reference_count?: number;\n /** Bounded enumeration of dangling references, capped by the context edge limit. */\n missing_references?: DanglingDependencyReference[];\n /** Value that configures or reports tree for this contract. */\n tree?: DepsTreeNode;\n /** Value that configures or reports graph for this contract. */\n graph?: DepsGraphResult;\n /** Explainable bounded graph-context projection. */\n context?: RelationshipContextResult;\n}\n\nfunction parseFormat(raw: string | undefined): DepsFormat {\n const candidate = raw?.trim().toLowerCase() ?? \"tree\";\n if ((DEPS_FORMAT_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsFormat;\n }\n throw new PmCliError(\n `Invalid --format value \"${raw}\". Use \"tree\", \"graph\", or \"context\".`,\n EXIT_CODE.USAGE,\n );\n}\n\n/** Parse one positive-integer graph bound, failing fast with the offending flag name. */\nexport function parsePositiveInteger(raw: string | number | undefined, flag: string): number | undefined {\n if (raw === undefined) return undefined;\n const value = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(value) || value < 1)\n throw new PmCliError(`Invalid --${flag} value \"${raw}\". Use a positive integer.`, EXIT_CODE.USAGE);\n return value;\n}\n\n/** Parse the shared non-negative --max-depth traversal bound. */\nexport function parseMaxDepth(raw: string | number | undefined): number | undefined {\n if (raw === undefined) {\n return undefined;\n }\n const normalized = typeof raw === \"number\" ? raw : Number(raw.trim());\n if (!Number.isInteger(normalized) || normalized < 0) {\n throw new PmCliError(\n `Invalid --max-depth value \"${raw}\". Use a non-negative integer.`,\n EXIT_CODE.USAGE,\n );\n }\n return normalized;\n}\n\nfunction parseCollapse(raw: string | undefined): DepsCollapseMode {\n const candidate = raw?.trim().toLowerCase() ?? \"none\";\n if ((DEPS_COLLAPSE_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsCollapseMode;\n }\n throw new PmCliError(\n `Invalid --collapse value \"${raw}\". Use \"none\" or \"repeated\".`,\n EXIT_CODE.USAGE,\n );\n}\n\n/** Parse the shared graph traversal --direction value, defaulting to \"both\". */\nexport function parseDirection(raw: string | undefined): DepsDirection {\n const candidate = raw?.trim().toLowerCase() ?? \"both\";\n if ((DEPS_DIRECTION_VALUES as readonly string[]).includes(candidate)) {\n return candidate as DepsDirection;\n }\n throw new PmCliError(\n `Invalid --direction value \"${raw}\". Use \"outgoing\", \"incoming\", or \"both\".`,\n EXIT_CODE.USAGE,\n );\n}\n\n/**\n * Normalize repeatable and comma-separated --kind values against the built-in\n * relationship ontology, failing fast on unknown kinds instead of silently\n * matching nothing (the multi-value filter-grammar trap tracked by pm-gknu).\n */\nexport function parseKinds(raw: string | string[] | undefined): string[] | undefined {\n if (raw === undefined) return undefined;\n const registry = createRelationshipKindRegistry();\n const values = (Array.isArray(raw) ? raw : [raw])\n .flatMap((value) => value.split(\",\"))\n .map((value) => value.trim())\n .filter((value) => value.length > 0);\n if (values.length === 0) return undefined;\n const kinds = new Set<string>();\n for (const value of values) {\n const definition = registry.resolve(value);\n if (!definition) {\n const known = registry\n .list()\n .map((entry) => entry.kind)\n .join(\", \");\n throw new PmCliError(\n `Invalid --kind value \"${value}\". Registered kinds: ${known}.`,\n EXIT_CODE.USAGE,\n );\n }\n kinds.add(definition.kind);\n }\n return [...kinds].sort();\n}\n\nfunction normalizeDependencies(\n dependencies: Dependency[] | undefined,\n): IndexedDependency[] {\n if (!dependencies || dependencies.length === 0) {\n return [];\n }\n const sorted = dependencies.map(({ id, kind }) => ({\n id: id.trim(),\n kind: kind.trim().toLowerCase(),\n })).sort((left, right) => {\n const byKind = left.kind.localeCompare(right.kind);\n if (byKind !== 0) return byKind;\n return left.id.localeCompare(right.id);\n });\n const deduped = new Map<string, IndexedDependency>();\n for (const dependency of sorted) {\n const key = `${dependency.kind.toLowerCase()}::${dependency.id.toLowerCase()}`;\n if (!deduped.has(key)) {\n deduped.set(key, { id: dependency.id, kind: dependency.kind });\n }\n }\n return [...deduped.values()];\n}\n\nfunction toIndexedItem(item: ItemMetadata): IndexedItem {\n return {\n id: item.id,\n title: item.title,\n type: item.type,\n status: item.status,\n dependencies: normalizeDependencies(item.dependencies),\n };\n}\n\nfunction toTreeNode(\n id: string,\n index: Map<string, IndexedItem>,\n lineage: Set<string>,\n maxDepth: number | undefined,\n collapse: DepsCollapseMode,\n expanded: Set<string>,\n depth = 0,\n via?: string,\n): DepsTreeNode {\n const lookupId = id.trim().toLowerCase();\n const item = index.get(lookupId);\n const baseNode: DepsTreeNode = {\n id: item?.id ?? id,\n title: item?.title,\n type: item?.type,\n status: item?.status,\n via,\n missing: !item,\n cycle: lineage.has(lookupId),\n dependencies: [],\n };\n if (!item || baseNode.cycle) {\n return baseNode;\n }\n if (maxDepth !== undefined && depth >= maxDepth) {\n if (item.dependencies.length > 0) {\n baseNode.truncated = true;\n }\n return baseNode;\n }\n if (collapse === \"repeated\" && expanded.has(lookupId)) {\n baseNode.collapsed = true;\n return baseNode;\n }\n if (collapse === \"repeated\") {\n expanded.add(lookupId);\n }\n const nextLineage = new Set(lineage);\n nextLineage.add(lookupId);\n baseNode.dependencies = item.dependencies.map((dependency) =>\n toTreeNode(\n dependency.id,\n index,\n nextLineage,\n maxDepth,\n collapse,\n expanded,\n depth + 1,\n dependency.kind,\n ),\n );\n return baseNode;\n}\n\nfunction mergeGraphNode(\n existing: DepsGraphNode | undefined,\n candidate: DepsGraphNode,\n): DepsGraphNode {\n if (!existing) {\n return candidate;\n }\n /* c8 ignore start -- defensive: mixed missing/non-missing duplicates only occur in malformed synthetic trees. */\n if (existing.missing && !candidate.missing) return candidate;\n /* c8 ignore stop */\n return {\n ...existing,\n title: existing.title ?? candidate.title,\n type: existing.type ?? candidate.type,\n status: existing.status ?? candidate.status,\n };\n}\n\nfunction toGraph(root: DepsTreeNode): DepsGraphResult {\n const nodesById = new Map<string, DepsGraphNode>();\n const edgesByKey = new Map<string, DepsGraphEdge>();\n\n const visit = (node: DepsTreeNode): void => {\n nodesById.set(\n node.id,\n mergeGraphNode(nodesById.get(node.id), {\n id: node.id,\n title: node.title,\n type: node.type,\n status: node.status,\n missing: node.missing,\n }),\n );\n for (const child of node.dependencies) {\n nodesById.set(\n child.id,\n mergeGraphNode(nodesById.get(child.id), {\n id: child.id,\n title: child.title,\n type: child.type,\n status: child.status,\n missing: child.missing,\n }),\n );\n /* c8 ignore start -- legacy malformed dependency payloads may omit kind/via. */\n const relationKind = child.via ?? \"related\";\n const edgeKey = `${node.id}::${child.id}::${relationKind}`;\n if (!edgesByKey.has(edgeKey)) {\n edgesByKey.set(edgeKey, {\n from: node.id,\n to: child.id,\n kind: relationKind,\n });\n }\n /* c8 ignore stop */\n if (!child.cycle) {\n visit(child);\n }\n }\n };\n\n visit(root);\n\n const nodes = [...nodesById.values()].sort((left, right) =>\n left.id.localeCompare(right.id),\n );\n const edges = [...edgesByKey.values()].sort((left, right) => {\n const byFrom = left.from.localeCompare(right.from);\n if (byFrom !== 0) return byFrom;\n const byTo = left.to.localeCompare(right.to);\n if (byTo !== 0) return byTo;\n return left.kind.localeCompare(right.kind);\n });\n const missingIds = nodes\n .filter((node) => node.missing)\n .map((node) => node.id);\n return {\n root_id: root.id,\n nodes,\n edges,\n missing_ids: missingIds,\n };\n}\n\n/** Count a dependency result without allocating its potentially exponential tree payload. */\nfunction countDependencyGraph(\n rootId: string,\n index: Map<string, IndexedItem>,\n maxDepth: number | undefined,\n): Pick<DepsResult, \"node_count\" | \"edge_count\" | \"missing_count\"> {\n const nodeIds = new Set<string>();\n const edgeKeys = new Set<string>();\n const missingIds = new Set<string>();\n const expanded = new Set<string>();\n const pending = [{ id: rootId, depth: 0 }];\n let pendingIndex = 0;\n while (pendingIndex < pending.length) {\n const current = pending[pendingIndex++]!;\n const lookupId = current.id.trim().toLowerCase();\n nodeIds.add(lookupId);\n const item = index.get(lookupId);\n if (!item) {\n missingIds.add(lookupId);\n continue;\n }\n if (maxDepth !== undefined && current.depth >= maxDepth) {\n continue;\n }\n if (expanded.has(lookupId)) {\n continue;\n }\n expanded.add(lookupId);\n for (const dependency of item.dependencies) {\n edgeKeys.add(\n `${lookupId}::${dependency.id.trim().toLowerCase()}::${dependency.kind}`,\n );\n pending.push({ id: dependency.id, depth: current.depth + 1 });\n }\n }\n return {\n node_count: nodeIds.size,\n edge_count: edgeKeys.size,\n missing_count: missingIds.size,\n };\n}\n\n/** Options subset consumed by the deps graph-context projection. */\ntype DepsContextOptions = Pick<\n DepsCommandOptions,\n | \"maxDepth\"\n | \"nodeLimit\"\n | \"edgeLimit\"\n | \"tokenBudget\"\n | \"cursor\"\n | \"direction\"\n | \"kind\"\n>;\n\n/** Parse CLI-compatible deps context options once for packet and closure parity. */\nfunction parseDepsContextOptions(\n options: DepsContextOptions,\n): RelationshipContextOptions {\n const maxDepth = parseMaxDepth(options.maxDepth);\n const nodeLimit = parsePositiveInteger(options.nodeLimit, \"node-limit\");\n const edgeLimit = parsePositiveInteger(options.edgeLimit, \"edge-limit\");\n const tokenBudget = parsePositiveInteger(options.tokenBudget, \"token-budget\");\n const kinds = parseKinds(options.kind);\n return {\n direction: parseDirection(options.direction),\n ...(kinds === undefined ? {} : { kinds }),\n ...(maxDepth === undefined ? {} : { maxDepth }),\n ...(nodeLimit === undefined ? {} : { nodeLimit }),\n ...(edgeLimit === undefined ? {} : { edgeLimit }),\n ...(tokenBudget === undefined ? {} : { tokenBudget }),\n ...(options.cursor?.trim() ? { cursor: options.cursor.trim() } : {}),\n };\n}\n\n/** Build one bounded context packet from an assembled deps relationship graph. */\nfunction buildContextFromAssembly(\n assembly: WorkspaceRelationshipAssembly,\n rootId: string,\n options: RelationshipContextOptions,\n rootEvidence: readonly string[],\n): RelationshipContextResult {\n return buildRelationshipContext(\n assembly.graph,\n rootId,\n assembly.details.map((detail) =>\n detail.id === rootId && rootEvidence.length > 0\n ? { ...detail, evidence: rootEvidence }\n : detail,\n ),\n options,\n );\n}\n\n/** Build the SDK-backed bounded relationship-context projection for deps. */\nexport function buildDepsRelationshipContext(\n rootId: string,\n items: readonly ItemMetadata[],\n options: DepsContextOptions,\n rootEvidence: readonly string[] = [],\n): RelationshipContextResult {\n return buildContextFromAssembly(\n assembleWorkspaceRelationshipGraph(items),\n rootId,\n parseDepsContextOptions(options),\n rootEvidence,\n );\n}\n\n/** Append up to `limit` labeled pointers from one linked collection. */\nfunction appendEvidencePointers(\n evidence: string[],\n label: string,\n values: readonly (string | undefined)[],\n limit: number,\n): void {\n for (const value of values.slice(0, limit)) {\n const trimmed = value?.trim();\n if (trimmed) evidence.push(`${label}:${trimmed}`);\n }\n}\n\n/**\n * Load bounded root evidence pointers (linked files, tests, docs, and\n * annotation counts) so the context packet answers \"where is the proof\"\n * without a follow-up item read.\n */\nasync function collectRootEvidence(\n pmRoot: string,\n id: string,\n settings: Awaited<ReturnType<typeof readSettings>>,\n typeToFolder: Record<string, string>,\n): Promise<string[]> {\n const located = await locateItem(\n pmRoot,\n id,\n settings.id_prefix,\n settings.item_format,\n typeToFolder,\n );\n // The caller already resolved the root against the light index, so a miss\n // can only happen when storage mutates mid-read; degrade to no evidence.\n /* c8 ignore start -- defensive: unreachable without a concurrent delete between the index scan and this read. */\n if (!located) return [];\n /* c8 ignore stop */\n const { document } = await readLocatedItem(located, {\n schema: settings.schema,\n });\n const metadata = document.metadata;\n const files = metadata.files ?? [];\n const tests = metadata.tests ?? [];\n const docs = metadata.docs ?? [];\n const counts = [\n [\"files\", files.length],\n [\"tests\", tests.length],\n [\"docs\", docs.length],\n [\"comments\", (metadata.comments ?? []).length],\n [\"notes\", (metadata.notes ?? []).length],\n [\"learnings\", (metadata.learnings ?? []).length],\n ] as const;\n if (counts.every(([, count]) => count === 0)) return [];\n const evidence = [\n `linked:${counts.map(([key, count]) => `${key}=${count}`).join(\",\")}`,\n ];\n appendEvidencePointers(evidence, \"file\", files.map((file) => file.path), 3);\n appendEvidencePointers(\n evidence,\n \"test\",\n tests.map((test) => test.command ?? test.path),\n 2,\n );\n appendEvidencePointers(evidence, \"doc\", docs.map((doc) => doc.path), 2);\n return evidence;\n}\n\n/** Assemble the context-format deps result with traversal-scoped missing enumeration. */\nfunction buildContextDepsResult(params: {\n assembly: WorkspaceRelationshipAssembly;\n canonicalId: string;\n options: DepsCommandOptions;\n rootEvidence: readonly string[];\n summaryOnly: boolean;\n}): DepsResult {\n const { assembly, canonicalId, options, rootEvidence, summaryOnly } = params;\n const contextOptions = parseDepsContextOptions(options);\n const context = buildContextFromAssembly(\n assembly,\n canonicalId,\n contextOptions,\n rootEvidence,\n );\n const reachable = assembly.graph.closure(canonicalId, {\n direction: contextOptions.direction,\n ...(contextOptions.kinds === undefined\n ? {}\n : { kinds: contextOptions.kinds }),\n maxDepth: contextOptions.maxDepth ?? 3,\n });\n const missingReachable = reachable.value.filter((nodeId) =>\n assembly.missingIdSet.has(nodeId.toLowerCase()),\n );\n const missingReachableSet = new Set(\n missingReachable.map((nodeId) => nodeId.toLowerCase()),\n );\n const relationshipRegistry = assembly.graph.registry();\n const filteredKinds = contextOptions.kinds\n ? new Set(\n contextOptions.kinds.map(\n (kind) => relationshipRegistry.require(kind).kind,\n ),\n )\n : undefined;\n const packetIds = new Set([canonicalId, ...reachable.value]);\n const missingReferences = [\n ...assembly.dangling.active,\n ...assembly.dangling.legacy_terminal,\n ].filter((row) => {\n if (\n row.no_active_blocker_sentinel ||\n !missingReachableSet.has(row.target_id.trim().toLowerCase()) ||\n !packetIds.has(row.holder_id)\n )\n return false;\n if (filteredKinds === undefined) return true;\n const definition = relationshipRegistry.resolve(row.kind);\n return (\n definition !== undefined &&\n (filteredKinds.has(definition.kind) ||\n (definition.inverse !== undefined &&\n filteredKinds.has(definition.inverse)))\n );\n });\n const referenceLimit = contextOptions.edgeLimit ?? 40;\n return {\n id: canonicalId,\n format: \"context\",\n node_count: context.nodes.length + 1,\n edge_count: context.edges.length,\n missing_count: missingReachable.length,\n missing_scope: \"traversal\",\n missing_reference_count: missingReferences.length,\n ...(summaryOnly\n ? {}\n : {\n missing_references: missingReferences.slice(0, referenceLimit),\n context,\n }),\n };\n}\n\n/** Implements run deps for the public runtime surface of this module. */\nexport async function runDeps(\n id: string,\n options: DepsCommandOptions,\n global: GlobalOptions,\n): Promise<DepsResult> {\n const pmRoot = resolvePmRoot(process.cwd(), global.path);\n if (!(await pathExists(getSettingsPath(pmRoot)))) {\n throw new PmCliError(\n `Tracker is not initialized at ${pmRoot}. Run pm init first.`,\n EXIT_CODE.NOT_FOUND,\n );\n }\n const format = parseFormat(options.format);\n const maxDepth = parseMaxDepth(options.maxDepth);\n const collapse = parseCollapse(options.collapse);\n const summaryOnly = options.summary === true;\n const settings = await readSettings(pmRoot);\n const typeRegistry = resolveItemTypeRegistry(\n settings,\n getActiveExtensionRegistrations(),\n );\n const items = await listAllItemMetadataLight(\n pmRoot,\n settings.item_format,\n typeRegistry.type_to_folder,\n undefined,\n settings.schema,\n );\n const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);\n const index = new Map(\n items.map((item) => [item.id.trim().toLowerCase(), toIndexedItem(item)]),\n );\n const dangling = collectDanglingDependencyReferences(\n items,\n (status) => isTerminalStatus(status, statusRegistry),\n );\n for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {\n const holder = index.get(reference.holder_id.trim().toLowerCase());\n const referenceKind = reference.kind.trim().toLowerCase();\n if (\n holder &&\n !holder.dependencies.some(\n (dependency) =>\n dependency.id.trim().toLowerCase() === reference.target_id.trim().toLowerCase() &&\n dependency.kind === referenceKind,\n )\n ) {\n holder.dependencies.push({ id: reference.target_id, kind: referenceKind });\n }\n }\n if (!index.has(id.trim().toLowerCase())) {\n throw new PmCliError(`Item ${id} not found`, EXIT_CODE.NOT_FOUND);\n }\n\n if (format === \"context\") {\n const canonicalId = index.get(id.trim().toLowerCase())!.id;\n const rootEvidence = summaryOnly\n ? []\n : await collectRootEvidence(\n pmRoot,\n canonicalId,\n settings,\n typeRegistry.type_to_folder,\n );\n const isTerminal = (status: ItemStatus): boolean =>\n isTerminalStatus(status, statusRegistry);\n // Reuse the fingerprint-keyed shared cache so bounded context packets in\n // long-lived hosts stop paying full-workspace assembly on every call.\n const lookup = workspaceGraphCache().lookup(\n pmRoot,\n computeWorkspaceGraphFingerprint(items, isTerminal),\n () => assembleWorkspaceRelationshipGraph(items, isTerminal),\n );\n return buildContextDepsResult({\n assembly: lookup.assembly,\n canonicalId,\n options,\n rootEvidence,\n summaryOnly,\n });\n }\n\n if (summaryOnly) {\n return {\n id,\n format,\n ...countDependencyGraph(id, index, maxDepth),\n };\n }\n\n const tree = toTreeNode(\n id,\n index,\n new Set<string>(),\n maxDepth,\n collapse,\n new Set<string>(),\n );\n const graph = toGraph(tree);\n const baseResult = {\n id,\n format,\n node_count: graph.nodes.length,\n edge_count: graph.edges.length,\n missing_count: graph.missing_ids.length,\n };\n if (format === \"tree\") {\n return {\n ...baseResult,\n tree,\n };\n }\n return {\n ...baseResult,\n graph,\n };\n}\n"],"names":[],"mappings":"AAAA;;;;GAIG;;;AACH,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACL,wBAAwB,EACxB,UAAU,EACV,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAOzD,OAAO,EACL,kCAAkC,EAClC,mCAAmC,GAGpC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gCAAgC,EAChC,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,GAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,6DAA6D;AAC7D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE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QAAQ,EACR,IAAI,GAAG,EAAU,CAClB,CAAC;IACF,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,MAAM,UAAU,GAAG;QACjB,EAAE;QACF,MAAM;QACN,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;QAC9B,UAAU,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM;QAC9B,aAAa,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM;KACxC,CAAC;IACF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,OAAO;YACL,GAAG,UAAU;YACb,IAAI;SACL,CAAC;IACJ,CAAC;IACD,OAAO;QACL,GAAG,UAAU;QACb,KAAK;KACN,CAAC;AACJ,CAAC","debugId":"cff20670-d01b-574d-a2e6-c5da03fd21e5"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/extension-command-context
|
|
3
|
+
*
|
|
4
|
+
* Builds the host-owned SDK services injected into extension commands so
|
|
5
|
+
* package runtimes never need private imports or runtime package resolution.
|
|
6
|
+
*/
|
|
7
|
+
import type { ExtensionCommandSdk } from "../core/extensions/extension-types.js";
|
|
8
|
+
import type { PmClient } from "./runtime.js";
|
|
9
|
+
/** Bind public SDK services to one tracker and one caller-owned client. */
|
|
10
|
+
export declare function createExtensionCommandSdk(pmRoot: string, client: PmClient): ExtensionCommandSdk;
|
|
@@ -0,0 +1,30 @@
|
|
|
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]="585e7742-2560-53a5-96a2-c1374b583b98")}catch(e){}}();
|
|
3
|
+
import { getItemAt } from "./history-read.js";
|
|
4
|
+
import { RelationshipEventStore } from "./relationship-history.js";
|
|
5
|
+
import { createRelationshipKindRegistry } from "./relationships.js";
|
|
6
|
+
import { commitWorkspaceTransaction } from "./workspace-transaction.js";
|
|
7
|
+
/** Bind public SDK services to one tracker and one caller-owned client. */
|
|
8
|
+
export function createExtensionCommandSdk(pmRoot, client) {
|
|
9
|
+
return {
|
|
10
|
+
client,
|
|
11
|
+
getItemAt: (id, target) => getItemAt(id, target, { pmRoot }),
|
|
12
|
+
openRelationshipEventStore: (options) => {
|
|
13
|
+
const registry = createRelationshipKindRegistry();
|
|
14
|
+
for (const definition of options.definitions) {
|
|
15
|
+
registry.register(definition);
|
|
16
|
+
}
|
|
17
|
+
return RelationshipEventStore.open({
|
|
18
|
+
pmRoot,
|
|
19
|
+
nodes: options.nodes,
|
|
20
|
+
registry,
|
|
21
|
+
...(options.relativePath === undefined
|
|
22
|
+
? {}
|
|
23
|
+
: { relativePath: options.relativePath }),
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
commitWorkspaceTransaction: (options) => commitWorkspaceTransaction({ ...options, pmRoot }),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=extension-command-context.js.map
|
|
30
|
+
//# debugId=585e7742-2560-53a5-96a2-c1374b583b98
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-command-context.js","sources":["sdk/extension-command-context.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/extension-command-context\n *\n * Builds the host-owned SDK services injected into extension commands so\n * package runtimes never need private imports or runtime package resolution.\n */\nimport type {\n ExtensionCommandSdk,\n} from \"../core/extensions/extension-types.js\";\nimport { getItemAt } from \"./history-read.js\";\nimport { RelationshipEventStore } from \"./relationship-history.js\";\nimport { createRelationshipKindRegistry } from \"./relationships.js\";\nimport type { PmClient } from \"./runtime.js\";\nimport { commitWorkspaceTransaction } from \"./workspace-transaction.js\";\n\n/** Bind public SDK services to one tracker and one caller-owned client. */\nexport function createExtensionCommandSdk(\n pmRoot: string,\n client: PmClient,\n): ExtensionCommandSdk {\n return {\n client,\n getItemAt: (id, target) => getItemAt(id, target, { pmRoot }),\n openRelationshipEventStore: (options) => {\n const registry = createRelationshipKindRegistry();\n for (const definition of options.definitions) {\n registry.register(definition);\n }\n return RelationshipEventStore.open({\n pmRoot,\n nodes: options.nodes,\n registry,\n ...(options.relativePath === undefined\n ? {}\n : { relativePath: options.relativePath }),\n });\n },\n commitWorkspaceTransaction: (options) =>\n commitWorkspaceTransaction({ ...options, pmRoot }),\n };\n}\n"],"names":[],"mappings":";;AASA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAExE,2EAA2E;AAC3E,MAAM,UAAU,yBAAyB,CACvC,MAAc,EACd,MAAgB;IAEhB,OAAO;QACL,MAAM;QACN,SAAS,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC;QAC5D,0BAA0B,EAAE,CAAC,OAAO,EAAE,EAAE;YACtC,MAAM,QAAQ,GAAG,8BAA8B,EAAE,CAAC;YAClD,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;gBAC7C,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;YAChC,CAAC;YACD,OAAO,sBAAsB,CAAC,IAAI,CAAC;gBACjC,MAAM;gBACN,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,QAAQ;gBACR,GAAG,CAAC,OAAO,CAAC,YAAY,KAAK,SAAS;oBACpC,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,YAAY,EAAE,CAAC;aAC5C,CAAC,CAAC;QACL,CAAC;QACD,0BAA0B,EAAE,CAAC,OAAO,EAAE,EAAE,CACtC,0BAA0B,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,CAAC;KACrD,CAAC;AACJ,CAAC","debugId":"585e7742-2560-53a5-96a2-c1374b583b98"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import {
|
|
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]="987f91a5-6f98-55f4-b39b-5fb8b816c95a")}catch(e){}}();
|
|
3
|
+
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
4
|
+
import { RelationshipGraph, createRelationshipKindRegistry, } from "../relationships.js";
|
|
4
5
|
/** Normalize a decoded reference target and reject empty legacy placeholders. */
|
|
5
6
|
function normalizeDependencyReferenceTarget(target) {
|
|
6
7
|
if (typeof target !== "string")
|
|
@@ -92,6 +93,15 @@ export function collectMissingDependencyTargetIds(dangling) {
|
|
|
92
93
|
* once per query surface.
|
|
93
94
|
*/
|
|
94
95
|
export function assembleWorkspaceRelationshipGraph(items, isTerminal, registry) {
|
|
96
|
+
const relationshipRegistry = registry ?? createRelationshipKindRegistry();
|
|
97
|
+
if (registry === undefined) {
|
|
98
|
+
// Preserve compatibility with activation payloads produced before this registry existed.
|
|
99
|
+
for (const registration of getActiveExtensionRegistrations()?.relationship_kinds ?? []) {
|
|
100
|
+
for (const definition of registration.definitions) {
|
|
101
|
+
relationshipRegistry.register(definition);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
95
105
|
const safeItems = items.filter((item) => typeof item?.id === "string" && item.id.trim().length > 0);
|
|
96
106
|
const canonicalIds = new Map(safeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]));
|
|
97
107
|
const dangling = collectDanglingDependencyReferences(safeItems, isTerminal);
|
|
@@ -125,7 +135,7 @@ export function assembleWorkspaceRelationshipGraph(items, isTerminal, registry)
|
|
|
125
135
|
};
|
|
126
136
|
});
|
|
127
137
|
return {
|
|
128
|
-
graph: RelationshipGraph.fromItems([...graphItems, ...missingIds.map((id) => ({ id }))],
|
|
138
|
+
graph: RelationshipGraph.fromItems([...graphItems, ...missingIds.map((id) => ({ id }))], relationshipRegistry),
|
|
129
139
|
details: [
|
|
130
140
|
...safeItems.map((item) => ({
|
|
131
141
|
id: item.id.trim(),
|
|
@@ -143,4 +153,4 @@ export function assembleWorkspaceRelationshipGraph(items, isTerminal, registry)
|
|
|
143
153
|
};
|
|
144
154
|
}
|
|
145
155
|
//# sourceMappingURL=assembly.js.map
|
|
146
|
-
//# debugId=
|
|
156
|
+
//# debugId=987f91a5-6f98-55f4-b39b-5fb8b816c95a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assembly.js","sources":["sdk/graph/assembly.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/assembly\n *\n * Builds the shared workspace relationship graph consumed by dependency\n * queries, bounded context packets, impact analysis, and governance audits.\n * Assembly normalizes hierarchy, legacy scalar blockers, and structured\n * dependency edges into one deterministic {@link RelationshipGraph}, classifies\n * dangling references without mutating their holders, and materializes missing\n * endpoints as placeholder nodes so bounded traversals can explain absent work\n * instead of silently dropping it.\n */\nimport type { Dependency, ItemStatus } from \"../../types/index.js\";\nimport {\n RelationshipGraph,\n type RelationshipKindRegistry,\n} from \"../relationships.js\";\n\n/** Minimal item shape inspected by dependency-reference governance. */\nexport interface DependencyReferenceHolder {\n /** Stable item identifier. */\n id: string;\n /** Lifecycle status used to separate actionable work from historical debt. */\n status: ItemStatus;\n /** Optional hierarchy parent reference. */\n parent?: string;\n /** Optional legacy scalar blocker reference. */\n blocked_by?: string;\n /** Structured dependency edges. */\n dependencies?: Dependency[];\n}\n\n/** Storage surface that contributed a normalized dependency reference. */\nexport type DependencyReferenceSource = \"parent\" | \"blocked_by\" | \"dependency\";\n\n/** One normalized dependency reference whose target is absent from the tracker. */\nexport interface DanglingDependencyReference {\n /** Item that owns the reference. */\n holder_id: string;\n /** Missing referenced item id or legacy sentinel. */\n target_id: string;\n /** Relationship field or dependency kind. */\n kind: string;\n /** Storage surface that owns the reference and determines its remediation. */\n source: DependencyReferenceSource;\n /** Current lifecycle status of the holder. */\n holder_status: ItemStatus;\n /** Whether the holder is terminal and therefore historical, non-actionable debt. */\n legacy_terminal: boolean;\n /** Whether the target is the pre-structured-dependency `no-active-blocker` sentinel. */\n no_active_blocker_sentinel: boolean;\n}\n\n/** Actionable and historical partitions returned by dependency-reference governance. */\nexport interface DanglingDependencyReferenceSummary {\n /** Missing references held by active items; these may affect scheduling and should gate validation. */\n active: DanglingDependencyReference[];\n /** Missing references held only by terminal items; retained as informational history debt. */\n legacy_terminal: DanglingDependencyReference[];\n /** Legacy sentinel rows across active and terminal holders, called out separately from typo-like ids. */\n no_active_blocker_sentinels: DanglingDependencyReference[];\n}\n\n/** Normalize a decoded reference target and reject empty legacy placeholders. */\nfunction normalizeDependencyReferenceTarget(\n target: unknown,\n): string | undefined {\n if (typeof target !== \"string\") return undefined;\n const normalized = target.trim();\n if (\n !normalized ||\n [\"none\", \"null\", \"n/a\", \"na\"].includes(normalized.toLowerCase())\n )\n return undefined;\n return normalized;\n}\n\n/** Normalize a graph target while removing the historical no-blocker marker. */\nfunction normalizeDependencyGraphTarget(target: unknown): string | undefined {\n const normalized = normalizeDependencyReferenceTarget(target);\n return normalized?.toLowerCase() === \"no-active-blocker\"\n ? undefined\n : normalized;\n}\n\n/**\n * Classify missing hierarchy and dependency targets without mutating their holders.\n *\n * Consumers provide the workspace's terminal-status predicate so custom lifecycle\n * schemas receive the same active-versus-historical behavior as the built-in\n * closed/canceled statuses.\n */\nexport function collectDanglingDependencyReferences(\n items: readonly DependencyReferenceHolder[],\n isTerminal: (status: ItemStatus) => boolean = (status) =>\n status === \"closed\" || status === \"canceled\",\n): DanglingDependencyReferenceSummary {\n const safeItems = items.filter(\n (item) => typeof item?.id === \"string\" && item.id.trim().length > 0,\n );\n const knownIds = new Set(\n safeItems.map((item) => item.id.trim().toLowerCase()),\n );\n const rows = new Map<string, DanglingDependencyReference>();\n const addReference = (\n item: DependencyReferenceHolder,\n target: unknown,\n kind: string,\n source: DependencyReferenceSource,\n ): void => {\n const normalized = normalizeDependencyReferenceTarget(target);\n if (!normalized || knownIds.has(normalized.toLowerCase())) {\n return;\n }\n const row: DanglingDependencyReference = {\n holder_id: item.id.trim(),\n target_id: normalized,\n kind,\n source,\n holder_status: item.status,\n legacy_terminal: isTerminal(item.status),\n no_active_blocker_sentinel:\n normalized.toLowerCase() === \"no-active-blocker\",\n };\n rows.set(\n `${row.holder_id}::${row.target_id}::${row.kind}::${row.source}`,\n row,\n );\n };\n for (const item of safeItems) {\n addReference(item, item.parent, \"parent\", \"parent\");\n addReference(item, item.blocked_by, \"blocked_by\", \"blocked_by\");\n for (const dependency of item.dependencies ?? []) {\n // Public SDK callers may supply legacy or JSON-decoded payloads that do\n // not yet satisfy the current structured dependency contract.\n if (typeof dependency !== \"object\" || dependency === null) {\n continue;\n }\n const legacyDependency = dependency as Partial<Dependency>;\n addReference(\n item,\n legacyDependency.id,\n typeof legacyDependency.kind === \"string\"\n ? legacyDependency.kind\n : \"related\",\n \"dependency\",\n );\n }\n }\n const sorted = [...rows.values()].sort(\n (left, right) =>\n left.holder_id.localeCompare(right.holder_id) ||\n left.target_id.localeCompare(right.target_id) ||\n left.kind.localeCompare(right.kind) ||\n left.source.localeCompare(right.source),\n );\n const legacyTerminal = sorted.filter((row) => row.legacy_terminal);\n return {\n active: sorted.filter((row) => !row.legacy_terminal),\n legacy_terminal: legacyTerminal,\n no_active_blocker_sentinels: sorted.filter(\n (row) => row.no_active_blocker_sentinel,\n ),\n };\n}\n\n/** Return unique real missing targets while excluding the legacy no-blocker sentinel. */\nexport function collectMissingDependencyTargetIds(\n dangling: DanglingDependencyReferenceSummary,\n): string[] {\n const targets = new Map<string, string>();\n for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {\n if (reference.no_active_blocker_sentinel) continue;\n const target = reference.target_id.trim();\n const key = target.toLowerCase();\n if (!targets.has(key)) targets.set(key, target);\n }\n return [...targets.values()].sort((left, right) => left.localeCompare(right));\n}\n\n/** Item shape accepted by workspace relationship-graph assembly. */\nexport interface WorkspaceRelationshipItem extends DependencyReferenceHolder {\n /** Human-readable title projected into per-node details. */\n title: string;\n}\n\n/** Compact node projection paired with the assembled graph. */\nexport interface WorkspaceRelationshipNodeDetails {\n /** Stable node identifier. */\n id: string;\n /** Human-readable node title, or a `[missing]` marker for absent endpoints. */\n title: string;\n /** Lifecycle status, or the `missing` marker status for absent endpoints. */\n status: string;\n}\n\n/** Assembled workspace relationship graph with governance side-products. */\nexport interface WorkspaceRelationshipAssembly {\n /** Deterministic relationship graph including missing placeholder nodes. */\n graph: RelationshipGraph;\n /** Per-node compact details covering real and missing nodes. */\n details: WorkspaceRelationshipNodeDetails[];\n /** Lowercased identifiers of materialized missing endpoints. */\n missingIdSet: Set<string>;\n /** Dangling-reference classification computed during assembly. */\n dangling: DanglingDependencyReferenceSummary;\n}\n\n/**\n * Build the shared workspace relationship graph including missing placeholder\n * nodes. One assembly serves every bounded query in an invocation — dependency\n * trees, context packets, impact analysis, path enumeration, and governance\n * audits — so the full-workspace normalization cost is paid once instead of\n * once per query surface.\n */\nexport function assembleWorkspaceRelationshipGraph(\n items: readonly WorkspaceRelationshipItem[],\n isTerminal?: (status: ItemStatus) => boolean,\n registry?: RelationshipKindRegistry,\n): WorkspaceRelationshipAssembly {\n const safeItems = items.filter(\n (item) => typeof item?.id === \"string\" && item.id.trim().length > 0,\n );\n const canonicalIds = new Map(\n safeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]),\n );\n const dangling = collectDanglingDependencyReferences(safeItems, isTerminal);\n const missingIds = collectMissingDependencyTargetIds(dangling);\n for (const id of missingIds) canonicalIds.set(id.toLowerCase(), id);\n const graphItems = safeItems.map((item) => {\n const parent = normalizeDependencyGraphTarget(item.parent);\n const blocker = normalizeDependencyGraphTarget(item.blocked_by);\n const dependencies = (item.dependencies ?? []).flatMap((rawDependency) => {\n if (typeof rawDependency !== \"object\" || rawDependency === null)\n return [];\n const dependency = rawDependency as Partial<Dependency>;\n const target = normalizeDependencyGraphTarget(dependency.id);\n if (!target) return [];\n return [\n {\n id: canonicalIds.get(target.toLowerCase())!,\n kind:\n typeof dependency.kind === \"string\" ? dependency.kind : \"related\",\n },\n ];\n });\n return {\n id: item.id.trim(),\n ...(parent ? { parent: canonicalIds.get(parent.toLowerCase())! } : {}),\n ...(blocker\n ? { blocked_by: canonicalIds.get(blocker.toLowerCase())! }\n : {}),\n dependencies,\n };\n });\n return {\n graph: RelationshipGraph.fromItems(\n [...graphItems, ...missingIds.map((id) => ({ id }))],\n registry,\n ),\n details: [\n ...safeItems.map((item) => ({\n id: item.id.trim(),\n title: item.title,\n status: item.status,\n })),\n ...missingIds.map((id) => ({\n id,\n title: `[missing] ${id}`,\n status: \"missing\",\n })),\n ],\n missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),\n dangling,\n };\n}\n"],"names":[],"mappings":";;AAYA,OAAO,EACL,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AA+C7B,iFAAiF;AACjF,SAAS,kCAAkC,CACzC,MAAe;IAEf,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IACjC,IACE,CAAC,UAAU;QACX,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,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AC;gBACzB,EAAE;gBACF,KAAK,EAAE,aAAa,EAAE,EAAE;gBACxB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;SACJ;QACD,YAAY,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAC/D,QAAQ;KACT,CAAC;AACJ,CAAC","debugId":"6d8ff34a-789b-5b49-8304-9a7d53f8365d"}
|
|
1
|
+
{"version":3,"file":"assembly.js","sources":["sdk/graph/assembly.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/assembly\n *\n * Builds the shared workspace relationship graph consumed by dependency\n * queries, bounded context packets, impact analysis, and governance audits.\n * Assembly normalizes hierarchy, legacy scalar blockers, and structured\n * dependency edges into one deterministic {@link RelationshipGraph}, classifies\n * dangling references without mutating their holders, and materializes missing\n * endpoints as placeholder nodes so bounded traversals can explain absent work\n * instead of silently dropping it.\n */\nimport type { Dependency, ItemStatus } from \"../../types/index.js\";\nimport { getActiveExtensionRegistrations } from \"../../core/extensions/index.js\";\nimport {\n RelationshipGraph,\n createRelationshipKindRegistry,\n type RelationshipKindRegistry,\n} from \"../relationships.js\";\n\n/** Minimal item shape inspected by dependency-reference governance. */\nexport interface DependencyReferenceHolder {\n /** Stable item identifier. */\n id: string;\n /** Lifecycle status used to separate actionable work from historical debt. */\n status: ItemStatus;\n /** Optional hierarchy parent reference. */\n parent?: string;\n /** Optional legacy scalar blocker reference. */\n blocked_by?: string;\n /** Structured dependency edges. */\n dependencies?: Dependency[];\n}\n\n/** Storage surface that contributed a normalized dependency reference. */\nexport type DependencyReferenceSource = \"parent\" | \"blocked_by\" | \"dependency\";\n\n/** One normalized dependency reference whose target is absent from the tracker. */\nexport interface DanglingDependencyReference {\n /** Item that owns the reference. */\n holder_id: string;\n /** Missing referenced item id or legacy sentinel. */\n target_id: string;\n /** Relationship field or dependency kind. */\n kind: string;\n /** Storage surface that owns the reference and determines its remediation. */\n source: DependencyReferenceSource;\n /** Current lifecycle status of the holder. */\n holder_status: ItemStatus;\n /** Whether the holder is terminal and therefore historical, non-actionable debt. */\n legacy_terminal: boolean;\n /** Whether the target is the pre-structured-dependency `no-active-blocker` sentinel. */\n no_active_blocker_sentinel: boolean;\n}\n\n/** Actionable and historical partitions returned by dependency-reference governance. */\nexport interface DanglingDependencyReferenceSummary {\n /** Missing references held by active items; these may affect scheduling and should gate validation. */\n active: DanglingDependencyReference[];\n /** Missing references held only by terminal items; retained as informational history debt. */\n legacy_terminal: DanglingDependencyReference[];\n /** Legacy sentinel rows across active and terminal holders, called out separately from typo-like ids. */\n no_active_blocker_sentinels: DanglingDependencyReference[];\n}\n\n/** Normalize a decoded reference target and reject empty legacy placeholders. */\nfunction normalizeDependencyReferenceTarget(\n target: unknown,\n): string | undefined {\n if (typeof target !== \"string\") return undefined;\n const normalized = target.trim();\n if (\n !normalized ||\n [\"none\", \"null\", \"n/a\", \"na\"].includes(normalized.toLowerCase())\n )\n return undefined;\n return normalized;\n}\n\n/** Normalize a graph target while removing the historical no-blocker marker. */\nfunction normalizeDependencyGraphTarget(target: unknown): string | undefined {\n const normalized = normalizeDependencyReferenceTarget(target);\n return normalized?.toLowerCase() === \"no-active-blocker\"\n ? undefined\n : normalized;\n}\n\n/**\n * Classify missing hierarchy and dependency targets without mutating their holders.\n *\n * Consumers provide the workspace's terminal-status predicate so custom lifecycle\n * schemas receive the same active-versus-historical behavior as the built-in\n * closed/canceled statuses.\n */\nexport function collectDanglingDependencyReferences(\n items: readonly DependencyReferenceHolder[],\n isTerminal: (status: ItemStatus) => boolean = (status) =>\n status === \"closed\" || status === \"canceled\",\n): DanglingDependencyReferenceSummary {\n const safeItems = items.filter(\n (item) => typeof item?.id === \"string\" && item.id.trim().length > 0,\n );\n const knownIds = new Set(\n safeItems.map((item) => item.id.trim().toLowerCase()),\n );\n const rows = new Map<string, DanglingDependencyReference>();\n const addReference = (\n item: DependencyReferenceHolder,\n target: unknown,\n kind: string,\n source: DependencyReferenceSource,\n ): void => {\n const normalized = normalizeDependencyReferenceTarget(target);\n if (!normalized || knownIds.has(normalized.toLowerCase())) {\n return;\n }\n const row: DanglingDependencyReference = {\n holder_id: item.id.trim(),\n target_id: normalized,\n kind,\n source,\n holder_status: item.status,\n legacy_terminal: isTerminal(item.status),\n no_active_blocker_sentinel:\n normalized.toLowerCase() === \"no-active-blocker\",\n };\n rows.set(\n `${row.holder_id}::${row.target_id}::${row.kind}::${row.source}`,\n row,\n );\n };\n for (const item of safeItems) {\n addReference(item, item.parent, \"parent\", \"parent\");\n addReference(item, item.blocked_by, \"blocked_by\", \"blocked_by\");\n for (const dependency of item.dependencies ?? []) {\n // Public SDK callers may supply legacy or JSON-decoded payloads that do\n // not yet satisfy the current structured dependency contract.\n if (typeof dependency !== \"object\" || dependency === null) {\n continue;\n }\n const legacyDependency = dependency as Partial<Dependency>;\n addReference(\n item,\n legacyDependency.id,\n typeof legacyDependency.kind === \"string\"\n ? legacyDependency.kind\n : \"related\",\n \"dependency\",\n );\n }\n }\n const sorted = [...rows.values()].sort(\n (left, right) =>\n left.holder_id.localeCompare(right.holder_id) ||\n left.target_id.localeCompare(right.target_id) ||\n left.kind.localeCompare(right.kind) ||\n left.source.localeCompare(right.source),\n );\n const legacyTerminal = sorted.filter((row) => row.legacy_terminal);\n return {\n active: sorted.filter((row) => !row.legacy_terminal),\n legacy_terminal: legacyTerminal,\n no_active_blocker_sentinels: sorted.filter(\n (row) => row.no_active_blocker_sentinel,\n ),\n };\n}\n\n/** Return unique real missing targets while excluding the legacy no-blocker sentinel. */\nexport function collectMissingDependencyTargetIds(\n dangling: DanglingDependencyReferenceSummary,\n): string[] {\n const targets = new Map<string, string>();\n for (const reference of [...dangling.active, ...dangling.legacy_terminal]) {\n if (reference.no_active_blocker_sentinel) continue;\n const target = reference.target_id.trim();\n const key = target.toLowerCase();\n if (!targets.has(key)) targets.set(key, target);\n }\n return [...targets.values()].sort((left, right) => left.localeCompare(right));\n}\n\n/** Item shape accepted by workspace relationship-graph assembly. */\nexport interface WorkspaceRelationshipItem extends DependencyReferenceHolder {\n /** Human-readable title projected into per-node details. */\n title: string;\n}\n\n/** Compact node projection paired with the assembled graph. */\nexport interface WorkspaceRelationshipNodeDetails {\n /** Stable node identifier. */\n id: string;\n /** Human-readable node title, or a `[missing]` marker for absent endpoints. */\n title: string;\n /** Lifecycle status, or the `missing` marker status for absent endpoints. */\n status: string;\n}\n\n/** Assembled workspace relationship graph with governance side-products. */\nexport interface WorkspaceRelationshipAssembly {\n /** Deterministic relationship graph including missing placeholder nodes. */\n graph: RelationshipGraph;\n /** Per-node compact details covering real and missing nodes. */\n details: WorkspaceRelationshipNodeDetails[];\n /** Lowercased identifiers of materialized missing endpoints. */\n missingIdSet: Set<string>;\n /** Dangling-reference classification computed during assembly. */\n dangling: DanglingDependencyReferenceSummary;\n}\n\n/**\n * Build the shared workspace relationship graph including missing placeholder\n * nodes. One assembly serves every bounded query in an invocation — dependency\n * trees, context packets, impact analysis, path enumeration, and governance\n * audits — so the full-workspace normalization cost is paid once instead of\n * once per query surface.\n */\nexport function assembleWorkspaceRelationshipGraph(\n items: readonly WorkspaceRelationshipItem[],\n isTerminal?: (status: ItemStatus) => boolean,\n registry?: RelationshipKindRegistry,\n): WorkspaceRelationshipAssembly {\n const relationshipRegistry = registry ?? createRelationshipKindRegistry();\n if (registry === undefined) {\n // Preserve compatibility with activation payloads produced before this registry existed.\n for (const registration of\n getActiveExtensionRegistrations()?.relationship_kinds ?? []) {\n for (const definition of registration.definitions) {\n relationshipRegistry.register(definition);\n }\n }\n }\n const safeItems = items.filter(\n (item) => typeof item?.id === \"string\" && item.id.trim().length > 0,\n );\n const canonicalIds = new Map(\n safeItems.map((item) => [item.id.trim().toLowerCase(), item.id.trim()]),\n );\n const dangling = collectDanglingDependencyReferences(safeItems, isTerminal);\n const missingIds = collectMissingDependencyTargetIds(dangling);\n for (const id of missingIds) canonicalIds.set(id.toLowerCase(), id);\n const graphItems = safeItems.map((item) => {\n const parent = normalizeDependencyGraphTarget(item.parent);\n const blocker = normalizeDependencyGraphTarget(item.blocked_by);\n const dependencies = (item.dependencies ?? []).flatMap((rawDependency) => {\n if (typeof rawDependency !== \"object\" || rawDependency === null)\n return [];\n const dependency = rawDependency as Partial<Dependency>;\n const target = normalizeDependencyGraphTarget(dependency.id);\n if (!target) return [];\n return [\n {\n id: canonicalIds.get(target.toLowerCase())!,\n kind:\n typeof dependency.kind === \"string\" ? dependency.kind : \"related\",\n },\n ];\n });\n return {\n id: item.id.trim(),\n ...(parent ? { parent: canonicalIds.get(parent.toLowerCase())! } : {}),\n ...(blocker\n ? { blocked_by: canonicalIds.get(blocker.toLowerCase())! }\n : {}),\n dependencies,\n };\n });\n return {\n graph: RelationshipGraph.fromItems(\n [...graphItems, ...missingIds.map((id) => ({ id }))],\n relationshipRegistry,\n ),\n details: [\n ...safeItems.map((item) => ({\n id: item.id.trim(),\n title: item.title,\n status: item.status,\n })),\n ...missingIds.map((id) => ({\n id,\n title: `[missing] ${id}`,\n status: \"missing\",\n })),\n ],\n missingIdSet: new Set(missingIds.map((id) => id.toLowerCase())),\n dangling,\n };\n}\n"],"names":[],"mappings":";;AAYA,OAAO,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AACjF,OAAO,EACL,iBAAiB,EACjB,8BAA8B,GAE/B,MAAM,qBAAqB,CAAC;AA+C7B,iFAAiF;AACjF,SAAS,kCAAkC,CACzC,MAAe;IAEf,IAAI,OAAO,MAAM,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACjD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IACjC,IACE,CAAC,UAAU;QACX,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;QAEhE,OAAO,SAAS,CAAC;IACnB,OAAO,UAAU,CAAC;AACpB,CA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E;YACP,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBAC1B,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE;gBAClB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,MAAM,EAAE,IAAI,CAAC,MAAM;aACpB,CAAC,CAAC;YACH,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;gBACzB,EAAE;gBACF,KAAK,EAAE,aAAa,EAAE,EAAE;gBACxB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;SACJ;QACD,YAAY,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;QAC/D,QAAQ;KACT,CAAC;AACJ,CAAC","debugId":"987f91a5-6f98-55f4-b39b-5fb8b816c95a"}
|
|
@@ -13,4 +13,5 @@ export { auditWorkspaceRelationshipGraph, collectDuplicateRelationshipEdgeGroups
|
|
|
13
13
|
export { enumerateRelationshipPaths, hierarchyAncestors, hierarchyDescendants, orderingPredecessors, orderingSuccessors, type GraphPathOptions, type GraphTraversalOptions, type RelationshipPath, } from "./traversal.js";
|
|
14
14
|
export { computeWorkspaceGraphFingerprint, resetWorkspaceGraphCache, workspaceGraphCache, WorkspaceGraphCache, type GraphCacheMetadata, type WorkspaceGraphCacheLookup, } from "./cache.js";
|
|
15
15
|
export { planRelationshipRemediation, type RelationshipRemediationCode, type RelationshipRemediationConfidence, type RelationshipRemediationOperation, type RelationshipRemediationPlan, type RelationshipRemediationPlanOptions, type RelationshipRemediationStep, } from "./remediation.js";
|
|
16
|
+
export { collectNewOrderingCycleWarnings } from "./mutation-advisory.js";
|
|
16
17
|
export { GRAPH_SUBCOMMAND_VALUES, parseGraphSubcommand, runGraph, type GraphAnalyzeResult, type GraphAuditResult, type GraphCommandOptions, type GraphCommunitiesResult, type GraphCommunityRow, type GraphDominatorRow, type GraphDominatorsResult, type GraphExecutionSummary, type GraphImpactResult, type GraphImpactRow, type GraphKnowledgeSummary, type GraphPathRow, type GraphPathsResult, type GraphPlanResult, type GraphQueryCost, type GraphRedundancyResult, type GraphRedundancyRow, type GraphResult, type GraphSubcommand, type GraphTraversalResult, } from "./run.js";
|
package/dist/sdk/graph/index.js
CHANGED
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
* `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
11
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d123a5fc-d172-5644-8cce-abf975f187d8")}catch(e){}}();
|
|
12
12
|
export { computeRelationshipDominators, detectRelationshipCommunities, findRedundantRelationshipEdges, } from "./analytics.js";
|
|
13
13
|
export { assembleWorkspaceRelationshipGraph, collectDanglingDependencyReferences, collectMissingDependencyTargetIds, } from "./assembly.js";
|
|
14
14
|
export { auditWorkspaceRelationshipGraph, collectDuplicateRelationshipEdgeGroups, formatDuplicateEdgeGroup, } from "./governance.js";
|
|
15
15
|
export { enumerateRelationshipPaths, hierarchyAncestors, hierarchyDescendants, orderingPredecessors, orderingSuccessors, } from "./traversal.js";
|
|
16
16
|
export { computeWorkspaceGraphFingerprint, resetWorkspaceGraphCache, workspaceGraphCache, WorkspaceGraphCache, } from "./cache.js";
|
|
17
17
|
export { planRelationshipRemediation, } from "./remediation.js";
|
|
18
|
+
export { collectNewOrderingCycleWarnings } from "./mutation-advisory.js";
|
|
18
19
|
export { GRAPH_SUBCOMMAND_VALUES, parseGraphSubcommand, runGraph, } from "./run.js";
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
20
|
-
//# debugId=
|
|
21
|
+
//# debugId=d123a5fc-d172-5644-8cce-abf975f187d8
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["sdk/graph/index.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph\n *\n * Public workspace graph toolkit: one-pass relationship assembly with\n * missing-reference governance, registry-semantics traversal (hierarchy,\n * execution order, bounded path enumeration), and the policy-aware\n * relationship audit. Everything here layers on the dependency-free kernel in\n * `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.\n */\nexport {\n computeRelationshipDominators,\n detectRelationshipCommunities,\n findRedundantRelationshipEdges,\n type GraphCommunityOptions,\n type GraphDominatorOptions,\n type GraphRedundancyOptions,\n type RedundantRelationshipEdge,\n type RelationshipCommunity,\n type RelationshipCommunityAnalysis,\n type RelationshipDominatorAnalysis,\n type RelationshipDominatorRow,\n} from \"./analytics.js\";\nexport {\n assembleWorkspaceRelationshipGraph,\n collectDanglingDependencyReferences,\n collectMissingDependencyTargetIds,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DependencyReferenceSource,\n type WorkspaceRelationshipAssembly,\n type WorkspaceRelationshipItem,\n type WorkspaceRelationshipNodeDetails,\n} from \"./assembly.js\";\nexport {\n auditWorkspaceRelationshipGraph,\n collectDuplicateRelationshipEdgeGroups,\n formatDuplicateEdgeGroup,\n type DuplicateRelationshipEdgeGroup,\n type RelationshipAuditFinding,\n type RelationshipAuditFindingCode,\n type RelationshipAuditOptions,\n type RelationshipAuditReport,\n type RelationshipAuditSeverity,\n type RelationshipCoverageProfile,\n} from \"./governance.js\";\nexport {\n enumerateRelationshipPaths,\n hierarchyAncestors,\n hierarchyDescendants,\n orderingPredecessors,\n orderingSuccessors,\n type GraphPathOptions,\n type GraphTraversalOptions,\n type RelationshipPath,\n} from \"./traversal.js\";\nexport {\n computeWorkspaceGraphFingerprint,\n resetWorkspaceGraphCache,\n workspaceGraphCache,\n WorkspaceGraphCache,\n type GraphCacheMetadata,\n type WorkspaceGraphCacheLookup,\n} from \"./cache.js\";\nexport {\n planRelationshipRemediation,\n type RelationshipRemediationCode,\n type RelationshipRemediationConfidence,\n type RelationshipRemediationOperation,\n type RelationshipRemediationPlan,\n type RelationshipRemediationPlanOptions,\n type RelationshipRemediationStep,\n} from \"./remediation.js\";\nexport {\n GRAPH_SUBCOMMAND_VALUES,\n parseGraphSubcommand,\n runGraph,\n type GraphAnalyzeResult,\n type GraphAuditResult,\n type GraphCommandOptions,\n type GraphCommunitiesResult,\n type GraphCommunityRow,\n type GraphDominatorRow,\n type GraphDominatorsResult,\n type GraphExecutionSummary,\n type GraphImpactResult,\n type GraphImpactRow,\n type GraphKnowledgeSummary,\n type GraphPathRow,\n type GraphPathsResult,\n type GraphPlanResult,\n type GraphQueryCost,\n type GraphRedundancyResult,\n type GraphRedundancyRow,\n type GraphResult,\n type GraphSubcommand,\n type GraphTraversalResult,\n} from \"./run.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;AACH,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,GAS/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,iCAAiC,GAQlC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,wBAAwB,GAQzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,GAO5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,GAqBT,MAAM,UAAU,CAAC","debugId":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["sdk/graph/index.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph\n *\n * Public workspace graph toolkit: one-pass relationship assembly with\n * missing-reference governance, registry-semantics traversal (hierarchy,\n * execution order, bounded path enumeration), and the policy-aware\n * relationship audit. Everything here layers on the dependency-free kernel in\n * `sdk/relationships` and is safe for CLI, MCP, extension, and non-PM callers.\n */\nexport {\n computeRelationshipDominators,\n detectRelationshipCommunities,\n findRedundantRelationshipEdges,\n type GraphCommunityOptions,\n type GraphDominatorOptions,\n type GraphRedundancyOptions,\n type RedundantRelationshipEdge,\n type RelationshipCommunity,\n type RelationshipCommunityAnalysis,\n type RelationshipDominatorAnalysis,\n type RelationshipDominatorRow,\n} from \"./analytics.js\";\nexport {\n assembleWorkspaceRelationshipGraph,\n collectDanglingDependencyReferences,\n collectMissingDependencyTargetIds,\n type DanglingDependencyReference,\n type DanglingDependencyReferenceSummary,\n type DependencyReferenceHolder,\n type DependencyReferenceSource,\n type WorkspaceRelationshipAssembly,\n type WorkspaceRelationshipItem,\n type WorkspaceRelationshipNodeDetails,\n} from \"./assembly.js\";\nexport {\n auditWorkspaceRelationshipGraph,\n collectDuplicateRelationshipEdgeGroups,\n formatDuplicateEdgeGroup,\n type DuplicateRelationshipEdgeGroup,\n type RelationshipAuditFinding,\n type RelationshipAuditFindingCode,\n type RelationshipAuditOptions,\n type RelationshipAuditReport,\n type RelationshipAuditSeverity,\n type RelationshipCoverageProfile,\n} from \"./governance.js\";\nexport {\n enumerateRelationshipPaths,\n hierarchyAncestors,\n hierarchyDescendants,\n orderingPredecessors,\n orderingSuccessors,\n type GraphPathOptions,\n type GraphTraversalOptions,\n type RelationshipPath,\n} from \"./traversal.js\";\nexport {\n computeWorkspaceGraphFingerprint,\n resetWorkspaceGraphCache,\n workspaceGraphCache,\n WorkspaceGraphCache,\n type GraphCacheMetadata,\n type WorkspaceGraphCacheLookup,\n} from \"./cache.js\";\nexport {\n planRelationshipRemediation,\n type RelationshipRemediationCode,\n type RelationshipRemediationConfidence,\n type RelationshipRemediationOperation,\n type RelationshipRemediationPlan,\n type RelationshipRemediationPlanOptions,\n type RelationshipRemediationStep,\n} from \"./remediation.js\";\nexport { collectNewOrderingCycleWarnings } from \"./mutation-advisory.js\";\nexport {\n GRAPH_SUBCOMMAND_VALUES,\n parseGraphSubcommand,\n runGraph,\n type GraphAnalyzeResult,\n type GraphAuditResult,\n type GraphCommandOptions,\n type GraphCommunitiesResult,\n type GraphCommunityRow,\n type GraphDominatorRow,\n type GraphDominatorsResult,\n type GraphExecutionSummary,\n type GraphImpactResult,\n type GraphImpactRow,\n type GraphKnowledgeSummary,\n type GraphPathRow,\n type GraphPathsResult,\n type GraphPlanResult,\n type GraphQueryCost,\n type GraphRedundancyResult,\n type GraphRedundancyRow,\n type GraphResult,\n type GraphSubcommand,\n type GraphTraversalResult,\n} from \"./run.js\";\n"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;;;AACH,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,GAS/B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,iCAAiC,GAQlC,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,+BAA+B,EAC/B,sCAAsC,EACtC,wBAAwB,GAQzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,EAClB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,GAInB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,gCAAgC,EAChC,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,GAGpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,2BAA2B,GAO5B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,+BAA+B,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,QAAQ,GAqBT,MAAM,UAAU,CAAC","debugId":"d123a5fc-d172-5644-8cce-abf975f187d8"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module sdk/graph/mutation-advisory
|
|
3
|
+
*
|
|
4
|
+
* Detects newly introduced execution-order cycles across immutable workspace
|
|
5
|
+
* snapshots so mutation clients can warn without rejecting legacy graph debt.
|
|
6
|
+
*/
|
|
7
|
+
import type { ItemMetadata } from "../../types/index.js";
|
|
8
|
+
import type { RelationshipGraph } from "../relationships.js";
|
|
9
|
+
declare function buildOrderingAdjacency(graph: RelationshipGraph): Map<string, string[]>;
|
|
10
|
+
declare function findCyclePath(graph: RelationshipGraph, component: readonly string[], changedItemId: string): string[];
|
|
11
|
+
declare function findPathBackToStart(adjacency: ReadonlyMap<string, readonly string[]>, members: ReadonlySet<string>, start: string, first: string): string[] | undefined;
|
|
12
|
+
/** Return actionable warnings only for ordering cycles created by the later snapshot and containing the changed item. */
|
|
13
|
+
export declare function collectNewOrderingCycleWarnings(beforeItems: readonly ItemMetadata[], afterItems: readonly ItemMetadata[], changedItemId: string): string[];
|
|
14
|
+
/** White-box graph-path helpers for exhaustive SDK primitive verification. */
|
|
15
|
+
export declare const mutationAdvisoryTestOnly: {
|
|
16
|
+
buildOrderingAdjacency: typeof buildOrderingAdjacency;
|
|
17
|
+
findCyclePath: typeof findCyclePath;
|
|
18
|
+
findPathBackToStart: typeof findPathBackToStart;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,80 @@
|
|
|
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]="b116c910-3783-5ebc-8b6a-e9a64573107e")}catch(e){}}();
|
|
3
|
+
import { analyzeRelationshipExecution } from "../relationship-analytics.js";
|
|
4
|
+
import { assembleWorkspaceRelationshipGraph } from "./assembly.js";
|
|
5
|
+
function cycleKey(component) {
|
|
6
|
+
return [...component]
|
|
7
|
+
.sort((left, right) => left.localeCompare(right))
|
|
8
|
+
.join("\u0000");
|
|
9
|
+
}
|
|
10
|
+
function buildOrderingAdjacency(graph) {
|
|
11
|
+
const adjacency = new Map(graph.nodes().map((node) => [node, []]));
|
|
12
|
+
for (const edge of graph.edges()) {
|
|
13
|
+
const definition = graph.registry().require(edge.kind);
|
|
14
|
+
if (!definition.ordering)
|
|
15
|
+
continue;
|
|
16
|
+
const sourceFirst = (definition.precedence ?? "source_before_target") ===
|
|
17
|
+
"source_before_target";
|
|
18
|
+
adjacency
|
|
19
|
+
.get(sourceFirst ? edge.source : edge.target)
|
|
20
|
+
?.push(sourceFirst ? edge.target : edge.source);
|
|
21
|
+
}
|
|
22
|
+
for (const neighbors of adjacency.values()) {
|
|
23
|
+
neighbors.sort((left, right) => left.localeCompare(right));
|
|
24
|
+
}
|
|
25
|
+
return adjacency;
|
|
26
|
+
}
|
|
27
|
+
function findCyclePath(graph, component, changedItemId) {
|
|
28
|
+
const members = new Set(component);
|
|
29
|
+
const start = members.has(changedItemId) ? changedItemId : component[0];
|
|
30
|
+
const adjacency = buildOrderingAdjacency(graph);
|
|
31
|
+
if (adjacency.get(start)?.includes(start))
|
|
32
|
+
return [start, start];
|
|
33
|
+
for (const first of adjacency.get(start) ?? []) {
|
|
34
|
+
if (!members.has(first))
|
|
35
|
+
continue;
|
|
36
|
+
const path = findPathBackToStart(adjacency, members, start, first);
|
|
37
|
+
if (path)
|
|
38
|
+
return path;
|
|
39
|
+
}
|
|
40
|
+
return [...component, component[0]];
|
|
41
|
+
}
|
|
42
|
+
function findPathBackToStart(adjacency, members, start, first) {
|
|
43
|
+
const queue = [[first]];
|
|
44
|
+
const visited = new Set([start, first]);
|
|
45
|
+
while (queue.length > 0) {
|
|
46
|
+
const path = queue.shift();
|
|
47
|
+
const tail = path.at(-1);
|
|
48
|
+
for (const next of adjacency.get(tail) ?? []) {
|
|
49
|
+
if (next === start)
|
|
50
|
+
return [start, ...path, start];
|
|
51
|
+
if (!members.has(next) || visited.has(next))
|
|
52
|
+
continue;
|
|
53
|
+
visited.add(next);
|
|
54
|
+
queue.push([...path, next]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return undefined;
|
|
58
|
+
}
|
|
59
|
+
/** Return actionable warnings only for ordering cycles created by the later snapshot and containing the changed item. */
|
|
60
|
+
export function collectNewOrderingCycleWarnings(beforeItems, afterItems, changedItemId) {
|
|
61
|
+
const beforeGraph = assembleWorkspaceRelationshipGraph(beforeItems).graph;
|
|
62
|
+
const afterGraph = assembleWorkspaceRelationshipGraph(afterItems).graph;
|
|
63
|
+
const beforeCycles = new Set(analyzeRelationshipExecution(beforeGraph, {
|
|
64
|
+
registry: beforeGraph.registry(),
|
|
65
|
+
}).cycles.map(cycleKey));
|
|
66
|
+
return analyzeRelationshipExecution(afterGraph, {
|
|
67
|
+
registry: afterGraph.registry(),
|
|
68
|
+
}).cycles
|
|
69
|
+
.filter((component) => component.includes(changedItemId) &&
|
|
70
|
+
!beforeCycles.has(cycleKey(component)))
|
|
71
|
+
.map((component) => `ordering_cycle_created:${findCyclePath(afterGraph, component, changedItemId).join(" -> ")}:items_will_not_be_ready:run_pm_graph_audit`);
|
|
72
|
+
}
|
|
73
|
+
/** White-box graph-path helpers for exhaustive SDK primitive verification. */
|
|
74
|
+
export const mutationAdvisoryTestOnly = {
|
|
75
|
+
buildOrderingAdjacency,
|
|
76
|
+
findCyclePath,
|
|
77
|
+
findPathBackToStart,
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=mutation-advisory.js.map
|
|
80
|
+
//# debugId=b116c910-3783-5ebc-8b6a-e9a64573107e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mutation-advisory.js","sources":["sdk/graph/mutation-advisory.ts"],"sourceRoot":"/","sourcesContent":["/**\n * @module sdk/graph/mutation-advisory\n *\n * Detects newly introduced execution-order cycles across immutable workspace\n * snapshots so mutation clients can warn without rejecting legacy graph debt.\n */\nimport type { ItemMetadata } from \"../../types/index.js\";\nimport { analyzeRelationshipExecution } from \"../relationship-analytics.js\";\nimport type { RelationshipGraph } from \"../relationships.js\";\nimport { assembleWorkspaceRelationshipGraph } from \"./assembly.js\";\n\nfunction cycleKey(component: readonly string[]): string {\n return [...component]\n .sort((left, right) => left.localeCompare(right))\n .join(\"\\u0000\");\n}\n\nfunction buildOrderingAdjacency(graph: RelationshipGraph): Map<string, string[]> {\n const adjacency = new Map(graph.nodes().map((node) => [node, [] as string[]]));\n for (const edge of graph.edges()) {\n const definition = graph.registry().require(edge.kind);\n if (!definition.ordering) continue;\n const sourceFirst =\n (definition.precedence ?? \"source_before_target\") ===\n \"source_before_target\";\n adjacency\n .get(sourceFirst ? edge.source : edge.target)\n ?.push(sourceFirst ? edge.target : edge.source);\n }\n for (const neighbors of adjacency.values()) {\n neighbors.sort((left, right) => left.localeCompare(right));\n }\n return adjacency;\n}\n\nfunction findCyclePath(\n graph: RelationshipGraph,\n component: readonly string[],\n changedItemId: string,\n): string[] {\n const members = new Set(component);\n const start = members.has(changedItemId) ? changedItemId : component[0]!;\n const adjacency = buildOrderingAdjacency(graph);\n if (adjacency.get(start)?.includes(start)) return [start, start];\n for (const first of adjacency.get(start) ?? []) {\n if (!members.has(first)) continue;\n const path = findPathBackToStart(adjacency, members, start, first);\n if (path) return path;\n }\n return [...component, component[0]!];\n}\n\nfunction findPathBackToStart(\n adjacency: ReadonlyMap<string, readonly string[]>,\n members: ReadonlySet<string>,\n start: string,\n first: string,\n): string[] | undefined {\n const queue = [[first]];\n const visited = new Set([start, first]);\n while (queue.length > 0) {\n const path = queue.shift()!;\n const tail = path.at(-1)!;\n for (const next of adjacency.get(tail) ?? []) {\n if (next === start) return [start, ...path, start];\n if (!members.has(next) || visited.has(next)) continue;\n visited.add(next);\n queue.push([...path, next]);\n }\n }\n return undefined;\n}\n\n/** Return actionable warnings only for ordering cycles created by the later snapshot and containing the changed item. */\nexport function collectNewOrderingCycleWarnings(\n beforeItems: readonly ItemMetadata[],\n afterItems: readonly ItemMetadata[],\n changedItemId: string,\n): string[] {\n const beforeGraph = assembleWorkspaceRelationshipGraph(beforeItems).graph;\n const afterGraph = assembleWorkspaceRelationshipGraph(afterItems).graph;\n const beforeCycles = new Set(\n analyzeRelationshipExecution(beforeGraph, {\n registry: beforeGraph.registry(),\n }).cycles.map(cycleKey),\n );\n return analyzeRelationshipExecution(afterGraph, {\n registry: afterGraph.registry(),\n }).cycles\n .filter(\n (component) =>\n component.includes(changedItemId) &&\n !beforeCycles.has(cycleKey(component)),\n )\n .map(\n (component) =>\n `ordering_cycle_created:${findCyclePath(afterGraph, component, changedItemId).join(\" -> \")}:items_will_not_be_ready:run_pm_graph_audit`,\n );\n}\n\n/** White-box graph-path helpers for exhaustive SDK primitive verification. */\nexport const mutationAdvisoryTestOnly = {\n buildOrderingAdjacency,\n findCyclePath,\n findPathBackToStart,\n};\n"],"names":[],"mappings":";;AAOA,OAAO,EAAE,4BAA4B,EAAE,MAAM,8BAA8B,CAAC;AAE5E,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAC;AAEnE,SAAS,QAAQ,CAAC,SAA4B;IAC5C,OAAO,CAAC,GAAG,SAAS,CAAC;SAClB,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;SAChD,IAAI,CAAC,QAAQ,CAAC,CAAC;AACpB,CAAC;AAED,SAAS,sBAAsB,CAAC,KAAwB;IACtD,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE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,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,yHAAyH;AACzH,MAAM,UAAU,+BAA+B,CAC7C,WAAoC,EACpC,UAAmC,EACnC,aAAqB;IAErB,MAAM,WAAW,GAAG,kCAAkC,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC;IAC1E,MAAM,UAAU,GAAG,kCAAkC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC;IACxE,MAAM,YAAY,GAAG,IAAI,GAAG,CAC1B,4BAA4B,CAAC,WAAW,EAAE;QACxC,QAAQ,EAAE,WAAW,CAAC,QAAQ,EAAE;KACjC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CACxB,CAAC;IACF,OAAO,4BAA4B,CAAC,UAAU,EAAE;QAC9C,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE;KAChC,CAAC,CAAC,MAAM;SACN,MAAM,CACL,CAAC,SAAS,EAAE,EAAE,CACZ,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC;QACjC,CAAC,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CACzC;SACA,GAAG,CACF,CAAC,SAAS,EAAE,EAAE,CACZ,0BAA0B,aAAa,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,6CAA6C,CAC1I,CAAC;AACN,CAAC;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sBAAsB;IACtB,aAAa;IACb,mBAAmB;CACpB,CAAC","debugId":"b116c910-3783-5ebc-8b6a-e9a64573107e"}
|
package/dist/sdk/graph/run.d.ts
CHANGED
|
@@ -171,8 +171,12 @@ export interface GraphAuditResult {
|
|
|
171
171
|
finding_count: number;
|
|
172
172
|
/** Finding counts keyed by severity. */
|
|
173
173
|
findings_by_severity: Record<string, number>;
|
|
174
|
-
/**
|
|
174
|
+
/** Finding-row counts keyed by finding code. Before 2026.7.19 this field incorrectly accumulated affected subjects; consumers of that unit must migrate to affected_subjects_by_code. */
|
|
175
175
|
findings_by_code: Record<string, number>;
|
|
176
|
+
/** Affected-subject counts keyed by severity. */
|
|
177
|
+
affected_subjects_by_severity: Record<string, number>;
|
|
178
|
+
/** Affected-subject counts keyed by finding code. */
|
|
179
|
+
affected_subjects_by_code: Record<string, number>;
|
|
176
180
|
/** Structural coverage metrics computed during the audit. */
|
|
177
181
|
profile: RelationshipAuditReport["profile"];
|
|
178
182
|
/** Ordered findings with bounded evidence samples; absent with summary. */
|