@hawkeyexl/manni 4.16.0 → 4.17.1
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/README.md +1 -1
- package/dist/{batch-L5W4JS7A.js → batch-SAW4E46C.js} +14 -14
- package/dist/{build-GNZUVDZX.js → build-F6S3W77I.js} +15 -14
- package/dist/{calibrate-2LYIDN6U.js → calibrate-3DW2VV7F.js} +15 -15
- package/dist/{capture-OEDMFU5Z.js → capture-PKEYY2VO.js} +14 -14
- package/dist/{check-JR2TYL2Y.js → check-7PUIHLFM.js} +15 -15
- package/dist/{check-NLLFHNWG.js → check-EZN7YNVF.js} +14 -15
- package/dist/{check-Z5VGDSDT.js → check-LRX2YFDF.js} +13 -14
- package/dist/check-NW7GHSX6.js +47 -0
- package/dist/{cli-THEU2QG2.js → chunk-245W2Q7C.js} +133 -365
- package/dist/chunk-245W2Q7C.js.map +1 -0
- package/dist/{chunk-LEOQO3S6.js → chunk-2A5OIZHT.js} +7 -7
- package/dist/{chunk-FU3OCYYH.js → chunk-2LCJNH73.js} +2 -2
- package/dist/{chunk-7UC55CAU.js → chunk-2TLNAGVJ.js} +187 -159
- package/dist/chunk-2TLNAGVJ.js.map +1 -0
- package/dist/{chunk-6ANTGYNT.js → chunk-3446DW4W.js} +2 -2
- package/dist/{chunk-7GB3KEEM.js → chunk-3UYSONT4.js} +7 -453
- package/dist/chunk-3UYSONT4.js.map +1 -0
- package/dist/{chunk-NFJGIBES.js → chunk-4GGADKTU.js} +82 -238
- package/dist/chunk-4GGADKTU.js.map +1 -0
- package/dist/{chunk-YF6IZXAC.js → chunk-5QOTR53S.js} +7 -7
- package/dist/{chunk-2XRET3ZG.js → chunk-5VNFO2RT.js} +12 -38
- package/dist/chunk-5VNFO2RT.js.map +1 -0
- package/dist/{chunk-6YFEV7CM.js → chunk-64EDFJ5S.js} +5 -5
- package/dist/chunk-6J2ED4ED.js +545 -0
- package/dist/chunk-6J2ED4ED.js.map +1 -0
- package/dist/{chunk-2AUULNIJ.js → chunk-ABAFKOQF.js} +3 -3
- package/dist/{chunk-3GLDB7MZ.js → chunk-AIZBZYQM.js} +1311 -18
- package/dist/chunk-AIZBZYQM.js.map +1 -0
- package/dist/{chunk-GQQ2AX63.js → chunk-B5R5BWMY.js} +14 -429
- package/dist/chunk-B5R5BWMY.js.map +1 -0
- package/dist/{chunk-ZT5NUSZA.js → chunk-D3AO2PMV.js} +9 -9
- package/dist/{chunk-EZCJPF72.js → chunk-DSJTYRI5.js} +3 -3
- package/dist/{chunk-OJ7FEM2G.js → chunk-DU6CXY5R.js} +47 -10
- package/dist/chunk-DU6CXY5R.js.map +1 -0
- package/dist/{chunk-WD33LE5A.js → chunk-FAS3SRQB.js} +927 -99
- package/dist/chunk-FAS3SRQB.js.map +1 -0
- package/dist/{chunk-DTG6S2UG.js → chunk-FEURGKJC.js} +2 -2
- package/dist/{chunk-EA5KKIFG.js → chunk-FPPHEHPZ.js} +3 -3
- package/dist/chunk-HEVYEI6O.js +1338 -0
- package/dist/chunk-HEVYEI6O.js.map +1 -0
- package/dist/{chunk-5OOQ3HQ3.js → chunk-IGE6CIKZ.js} +11 -2
- package/dist/chunk-IGE6CIKZ.js.map +1 -0
- package/dist/{chunk-WT3AATHC.js → chunk-JK56UPNQ.js} +252 -425
- package/dist/chunk-JK56UPNQ.js.map +1 -0
- package/dist/{chunk-B3XXCDYW.js → chunk-KAWS7H4C.js} +2385 -2061
- package/dist/chunk-KAWS7H4C.js.map +1 -0
- package/dist/{chunk-O6YTTBSN.js → chunk-KB4MNUKC.js} +2 -2
- package/dist/{chunk-GR6QQ7GM.js → chunk-KCNBM42T.js} +4 -4
- package/dist/chunk-KUXAHHDE.js +314 -0
- package/dist/chunk-KUXAHHDE.js.map +1 -0
- package/dist/{chunk-EOSQENQF.js → chunk-LDIUA4ZG.js} +2 -2
- package/dist/{chunk-L3YGGYBG.js → chunk-M6DNOHJO.js} +3 -3
- package/dist/{chunk-4L3JBAW4.js → chunk-MBLVLQWI.js} +2 -2
- package/dist/{chunk-4HEEXPVX.js → chunk-MDXDTO7E.js} +6 -6
- package/dist/{chunk-WDENIUC7.js → chunk-MDZXRHIJ.js} +1 -1
- package/dist/chunk-MDZXRHIJ.js.map +1 -0
- package/dist/{chunk-IGRXQC3H.js → chunk-N25KDXOV.js} +2 -2
- package/dist/{chunk-DW22KCLN.js → chunk-NPZWOPOH.js} +3 -3
- package/dist/chunk-OZL5M764.js +443 -0
- package/dist/chunk-OZL5M764.js.map +1 -0
- package/dist/{chunk-NDBISART.js → chunk-PS4Y7EPP.js} +3 -3
- package/dist/{chunk-F4GXZMEO.js → chunk-Q7E43SXN.js} +12 -7
- package/dist/{chunk-F4GXZMEO.js.map → chunk-Q7E43SXN.js.map} +1 -1
- package/dist/{chunk-63GILHR5.js → chunk-QIKCIREY.js} +4 -4
- package/dist/{chunk-ZJZQPOJO.js → chunk-QIWSEKA6.js} +2 -2
- package/dist/{chunk-F6B2TNXU.js → chunk-TNYIXIYV.js} +6 -6
- package/dist/{chunk-CSLJMML4.js → chunk-TUMR35B3.js} +4 -4
- package/dist/{chunk-DSTRT6YD.js → chunk-U5NSIZRS.js} +3 -3
- package/dist/chunk-UP6NBQ62.js +2 -0
- package/dist/{chunk-BMYCLTFK.js → chunk-VRMQSP7O.js} +3 -3
- package/dist/{chunk-IM67NRUW.js → chunk-W7IEP7IG.js} +2 -2
- package/dist/{chunk-5PO2BWZF.js → chunk-W7XOMNYC.js} +2 -2
- package/dist/{chunk-6NTNLKNQ.js → chunk-WBXVQW57.js} +6 -5
- package/dist/{chunk-6NTNLKNQ.js.map → chunk-WBXVQW57.js.map} +1 -1
- package/dist/{chunk-PBZZUNDV.js → chunk-WP5EKWTU.js} +7 -7
- package/dist/chunk-WRSWZEVU.js +580 -0
- package/dist/chunk-WRSWZEVU.js.map +1 -0
- package/dist/{chunk-LPBVWUKS.js → chunk-WZSL7KF2.js} +2 -2
- package/dist/{chunk-GC47NBGO.js → chunk-XCEEJEVA.js} +4 -4
- package/dist/{chunk-4LLYPDNG.js → chunk-XPGK4ECA.js} +7 -7
- package/dist/{chunk-AWAXAJ6R.js → chunk-XRWQQHBR.js} +2 -2
- package/dist/{chunk-D4ANAOY7.js → chunk-XWUIFSWK.js} +20 -6
- package/dist/chunk-XWUIFSWK.js.map +1 -0
- package/dist/{chunk-IL62WATF.js → chunk-YJHHXM5B.js} +2 -2
- package/dist/{chunk-NH6B6DDI.js → chunk-ZEYNLKOH.js} +4 -4
- package/dist/{chunk-PHNAQ4QX.js → chunk-ZIXU7A4C.js} +21 -21
- package/dist/{cli-LZW6Z33F.js → cli-5ZQXVWWC.js} +18 -19
- package/dist/{cli-LZW6Z33F.js.map → cli-5ZQXVWWC.js.map} +1 -1
- package/dist/{cli-5QTSTGTX.js → cli-D5WYQVUF.js} +18 -18
- package/dist/{cli-4Y2XY52B.js → cli-FCGGNZ5C.js} +2 -2
- package/dist/{cli-DBMPGGOV.js → cli-FNX4LXMI.js} +37 -37
- package/dist/{cli-KAUXC7EZ.js → cli-LQRHK23G.js} +9 -9
- package/dist/{cli-RWRYV5FB.js → cli-LRKBCQRS.js} +9 -9
- package/dist/{cli-2EKRURBU.js → cli-NJC3H3CW.js} +15 -15
- package/dist/{cli-2SDBEUER.js → cli-OHKWCJIJ.js} +21 -21
- package/dist/{cli-BXUZ3KEQ.js → cli-RKYIZ6KU.js} +634 -36
- package/dist/cli-RKYIZ6KU.js.map +1 -0
- package/dist/cli-TJDQ5GUW.js +379 -0
- package/dist/cli-TJDQ5GUW.js.map +1 -0
- package/dist/{cli-TZ2OHF3H.js → cli-VC3BXCVR.js} +19 -19
- package/dist/cli.js +14 -14
- package/dist/docmeta.js +8 -8
- package/dist/{github-UR6LMUMW.js → github-6PV2JTZ7.js} +13 -14
- package/dist/github-7ZT4KYQU.js +35 -0
- package/dist/graph/runtime.d.ts +633 -217
- package/dist/graph/runtime.js +1001 -370
- package/dist/graph/runtime.js.map +1 -1
- package/dist/index.d.ts +2617 -1945
- package/dist/index.js +108 -64
- package/dist/index.js.map +1 -1
- package/dist/{json-QTYN2JQB.js → json-VWXLDTXR.js} +13 -14
- package/dist/{labels-UM2AFR5S.js → labels-ZJK27RL3.js} +12 -13
- package/dist/{labels-UM2AFR5S.js.map → labels-ZJK27RL3.js.map} +1 -1
- package/dist/{lint-LOFNZZPR.js → lint-5OERIERT.js} +13 -13
- package/dist/{list-GU7S6KEX.js → list-MANBRF7Z.js} +13 -14
- package/dist/{list-EPMHOU7T.js → list-SEEANTU6.js} +15 -15
- package/dist/{page-25CN3AFY.js → page-O4M65KMJ.js} +13 -14
- package/dist/{prepare-5GYMBF4P.js → prepare-3WULLZER.js} +13 -13
- package/dist/{pretty-QW6OSYRS.js → pretty-5FRBLTXU.js} +13 -14
- package/dist/{pretty-52Z74O6F.js → pretty-D3M366JD.js} +14 -15
- package/dist/{reporters-WT53GD4P.js → reporters-4WWZRHKI.js} +4 -4
- package/dist/{reporters-FSXJ42EB.js → reporters-6TEJDXXO.js} +4 -4
- package/dist/{reporters-3FXX2W4X.js → reporters-GDCZ5P7C.js} +12 -12
- package/dist/{run-H7XJMUWK.js → run-TZDLG6EN.js} +16 -16
- package/dist/sarif-PUZAMEFQ.js +36 -0
- package/dist/{sarif-C427U3NA.js → sarif-SSSPOUCK.js} +11 -11
- package/dist/site/rehype.d.ts +33 -0
- package/dist/site/rehype.js +49 -0
- package/dist/site/rehype.js.map +1 -0
- package/dist/{term-VG65JRNR.js → term-DHWMUL5N.js} +18 -19
- package/dist/{term-VG65JRNR.js.map → term-DHWMUL5N.js.map} +1 -1
- package/dist/{types-VMOT7RAL.js → types-7N7ETP3W.js} +2 -2
- package/dist/{validate-K36F54UB.js → validate-4AW7KIIY.js} +5 -5
- package/package.json +10 -1
- package/plugin/manni/.claude-plugin/plugin.json +1 -1
- package/shapes/graph/shapes-1.2.0.ttl +1161 -0
- package/dist/check-LVO4HZ3F.js +0 -36
- package/dist/chunk-2XRET3ZG.js.map +0 -1
- package/dist/chunk-3GLDB7MZ.js.map +0 -1
- package/dist/chunk-3WZQ2FR3.js +0 -236
- package/dist/chunk-3WZQ2FR3.js.map +0 -1
- package/dist/chunk-5OOQ3HQ3.js.map +0 -1
- package/dist/chunk-7GB3KEEM.js.map +0 -1
- package/dist/chunk-7UC55CAU.js.map +0 -1
- package/dist/chunk-B3XXCDYW.js.map +0 -1
- package/dist/chunk-D4ANAOY7.js.map +0 -1
- package/dist/chunk-GQQ2AX63.js.map +0 -1
- package/dist/chunk-IKEWBMCN.js +0 -98
- package/dist/chunk-IKEWBMCN.js.map +0 -1
- package/dist/chunk-NFJGIBES.js.map +0 -1
- package/dist/chunk-OJ7FEM2G.js.map +0 -1
- package/dist/chunk-WD33LE5A.js.map +0 -1
- package/dist/chunk-WDENIUC7.js.map +0 -1
- package/dist/chunk-WT3AATHC.js.map +0 -1
- package/dist/chunk-YUTVAMWW.js +0 -2
- package/dist/cli-BXUZ3KEQ.js.map +0 -1
- package/dist/cli-THEU2QG2.js.map +0 -1
- package/dist/github-ICZ5UDGX.js +0 -36
- package/dist/sarif-UVAFWZKS.js +0 -37
- /package/dist/{batch-L5W4JS7A.js.map → batch-SAW4E46C.js.map} +0 -0
- /package/dist/{build-GNZUVDZX.js.map → build-F6S3W77I.js.map} +0 -0
- /package/dist/{calibrate-2LYIDN6U.js.map → calibrate-3DW2VV7F.js.map} +0 -0
- /package/dist/{capture-OEDMFU5Z.js.map → capture-PKEYY2VO.js.map} +0 -0
- /package/dist/{check-JR2TYL2Y.js.map → check-7PUIHLFM.js.map} +0 -0
- /package/dist/{check-LVO4HZ3F.js.map → check-EZN7YNVF.js.map} +0 -0
- /package/dist/{check-NLLFHNWG.js.map → check-LRX2YFDF.js.map} +0 -0
- /package/dist/{check-Z5VGDSDT.js.map → check-NW7GHSX6.js.map} +0 -0
- /package/dist/{chunk-LEOQO3S6.js.map → chunk-2A5OIZHT.js.map} +0 -0
- /package/dist/{chunk-FU3OCYYH.js.map → chunk-2LCJNH73.js.map} +0 -0
- /package/dist/{chunk-6ANTGYNT.js.map → chunk-3446DW4W.js.map} +0 -0
- /package/dist/{chunk-YF6IZXAC.js.map → chunk-5QOTR53S.js.map} +0 -0
- /package/dist/{chunk-6YFEV7CM.js.map → chunk-64EDFJ5S.js.map} +0 -0
- /package/dist/{chunk-2AUULNIJ.js.map → chunk-ABAFKOQF.js.map} +0 -0
- /package/dist/{chunk-ZT5NUSZA.js.map → chunk-D3AO2PMV.js.map} +0 -0
- /package/dist/{chunk-EZCJPF72.js.map → chunk-DSJTYRI5.js.map} +0 -0
- /package/dist/{chunk-DTG6S2UG.js.map → chunk-FEURGKJC.js.map} +0 -0
- /package/dist/{chunk-EA5KKIFG.js.map → chunk-FPPHEHPZ.js.map} +0 -0
- /package/dist/{chunk-O6YTTBSN.js.map → chunk-KB4MNUKC.js.map} +0 -0
- /package/dist/{chunk-GR6QQ7GM.js.map → chunk-KCNBM42T.js.map} +0 -0
- /package/dist/{chunk-EOSQENQF.js.map → chunk-LDIUA4ZG.js.map} +0 -0
- /package/dist/{chunk-L3YGGYBG.js.map → chunk-M6DNOHJO.js.map} +0 -0
- /package/dist/{chunk-4L3JBAW4.js.map → chunk-MBLVLQWI.js.map} +0 -0
- /package/dist/{chunk-4HEEXPVX.js.map → chunk-MDXDTO7E.js.map} +0 -0
- /package/dist/{chunk-IGRXQC3H.js.map → chunk-N25KDXOV.js.map} +0 -0
- /package/dist/{chunk-DW22KCLN.js.map → chunk-NPZWOPOH.js.map} +0 -0
- /package/dist/{chunk-NDBISART.js.map → chunk-PS4Y7EPP.js.map} +0 -0
- /package/dist/{chunk-63GILHR5.js.map → chunk-QIKCIREY.js.map} +0 -0
- /package/dist/{chunk-ZJZQPOJO.js.map → chunk-QIWSEKA6.js.map} +0 -0
- /package/dist/{chunk-F6B2TNXU.js.map → chunk-TNYIXIYV.js.map} +0 -0
- /package/dist/{chunk-CSLJMML4.js.map → chunk-TUMR35B3.js.map} +0 -0
- /package/dist/{chunk-DSTRT6YD.js.map → chunk-U5NSIZRS.js.map} +0 -0
- /package/dist/{chunk-YUTVAMWW.js.map → chunk-UP6NBQ62.js.map} +0 -0
- /package/dist/{chunk-BMYCLTFK.js.map → chunk-VRMQSP7O.js.map} +0 -0
- /package/dist/{chunk-IM67NRUW.js.map → chunk-W7IEP7IG.js.map} +0 -0
- /package/dist/{chunk-5PO2BWZF.js.map → chunk-W7XOMNYC.js.map} +0 -0
- /package/dist/{chunk-PBZZUNDV.js.map → chunk-WP5EKWTU.js.map} +0 -0
- /package/dist/{chunk-LPBVWUKS.js.map → chunk-WZSL7KF2.js.map} +0 -0
- /package/dist/{chunk-GC47NBGO.js.map → chunk-XCEEJEVA.js.map} +0 -0
- /package/dist/{chunk-4LLYPDNG.js.map → chunk-XPGK4ECA.js.map} +0 -0
- /package/dist/{chunk-AWAXAJ6R.js.map → chunk-XRWQQHBR.js.map} +0 -0
- /package/dist/{chunk-IL62WATF.js.map → chunk-YJHHXM5B.js.map} +0 -0
- /package/dist/{chunk-NH6B6DDI.js.map → chunk-ZEYNLKOH.js.map} +0 -0
- /package/dist/{chunk-PHNAQ4QX.js.map → chunk-ZIXU7A4C.js.map} +0 -0
- /package/dist/{cli-5QTSTGTX.js.map → cli-D5WYQVUF.js.map} +0 -0
- /package/dist/{cli-4Y2XY52B.js.map → cli-FCGGNZ5C.js.map} +0 -0
- /package/dist/{cli-DBMPGGOV.js.map → cli-FNX4LXMI.js.map} +0 -0
- /package/dist/{cli-KAUXC7EZ.js.map → cli-LQRHK23G.js.map} +0 -0
- /package/dist/{cli-RWRYV5FB.js.map → cli-LRKBCQRS.js.map} +0 -0
- /package/dist/{cli-2EKRURBU.js.map → cli-NJC3H3CW.js.map} +0 -0
- /package/dist/{cli-2SDBEUER.js.map → cli-OHKWCJIJ.js.map} +0 -0
- /package/dist/{cli-TZ2OHF3H.js.map → cli-VC3BXCVR.js.map} +0 -0
- /package/dist/{github-ICZ5UDGX.js.map → github-6PV2JTZ7.js.map} +0 -0
- /package/dist/{github-UR6LMUMW.js.map → github-7ZT4KYQU.js.map} +0 -0
- /package/dist/{json-QTYN2JQB.js.map → json-VWXLDTXR.js.map} +0 -0
- /package/dist/{lint-LOFNZZPR.js.map → lint-5OERIERT.js.map} +0 -0
- /package/dist/{list-EPMHOU7T.js.map → list-MANBRF7Z.js.map} +0 -0
- /package/dist/{list-GU7S6KEX.js.map → list-SEEANTU6.js.map} +0 -0
- /package/dist/{page-25CN3AFY.js.map → page-O4M65KMJ.js.map} +0 -0
- /package/dist/{prepare-5GYMBF4P.js.map → prepare-3WULLZER.js.map} +0 -0
- /package/dist/{pretty-52Z74O6F.js.map → pretty-5FRBLTXU.js.map} +0 -0
- /package/dist/{pretty-QW6OSYRS.js.map → pretty-D3M366JD.js.map} +0 -0
- /package/dist/{reporters-3FXX2W4X.js.map → reporters-4WWZRHKI.js.map} +0 -0
- /package/dist/{reporters-FSXJ42EB.js.map → reporters-6TEJDXXO.js.map} +0 -0
- /package/dist/{reporters-WT53GD4P.js.map → reporters-GDCZ5P7C.js.map} +0 -0
- /package/dist/{run-H7XJMUWK.js.map → run-TZDLG6EN.js.map} +0 -0
- /package/dist/{sarif-C427U3NA.js.map → sarif-PUZAMEFQ.js.map} +0 -0
- /package/dist/{sarif-UVAFWZKS.js.map → sarif-SSSPOUCK.js.map} +0 -0
- /package/dist/{types-VMOT7RAL.js.map → types-7N7ETP3W.js.map} +0 -0
- /package/dist/{validate-K36F54UB.js.map → validate-4AW7KIIY.js.map} +0 -0
|
@@ -1,22 +1,31 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
lookupIn,
|
|
4
|
+
openArtifact,
|
|
5
|
+
renderBundle,
|
|
3
6
|
renderCheck,
|
|
4
|
-
|
|
5
|
-
|
|
7
|
+
renderLookup,
|
|
8
|
+
retrieveIn,
|
|
9
|
+
runCheck,
|
|
10
|
+
runLookup,
|
|
11
|
+
runRetrieve,
|
|
12
|
+
runTraverseContext,
|
|
13
|
+
traverseIn
|
|
14
|
+
} from "./chunk-6J2ED4ED.js";
|
|
6
15
|
import {
|
|
7
16
|
EXPORT_TARGETS,
|
|
17
|
+
LLMS_FILENAME,
|
|
8
18
|
renderEmbed,
|
|
9
19
|
renderFill,
|
|
10
20
|
renderQuery,
|
|
11
21
|
renderStats,
|
|
12
|
-
renderTraverse,
|
|
13
22
|
runEmbed,
|
|
14
23
|
runExport,
|
|
15
24
|
runFill,
|
|
16
25
|
runQuery,
|
|
17
|
-
runStats
|
|
18
|
-
|
|
19
|
-
|
|
26
|
+
runStats
|
|
27
|
+
} from "./chunk-JK56UPNQ.js";
|
|
28
|
+
import "./chunk-245W2Q7C.js";
|
|
20
29
|
import {
|
|
21
30
|
SEARCH_MODES,
|
|
22
31
|
bundledShapesPath,
|
|
@@ -24,12 +33,17 @@ import {
|
|
|
24
33
|
loadShapes,
|
|
25
34
|
localName,
|
|
26
35
|
renderSearch,
|
|
36
|
+
renderTraverse,
|
|
27
37
|
runSearch,
|
|
38
|
+
runTraverse,
|
|
28
39
|
shapeText
|
|
29
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KAWS7H4C.js";
|
|
41
|
+
import "./chunk-OZL5M764.js";
|
|
42
|
+
import "./chunk-HEVYEI6O.js";
|
|
30
43
|
import {
|
|
31
44
|
runBuild
|
|
32
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-2TLNAGVJ.js";
|
|
46
|
+
import "./chunk-KUXAHHDE.js";
|
|
33
47
|
import {
|
|
34
48
|
ALL_FILL_FIELDS,
|
|
35
49
|
CONFIG_SECTION,
|
|
@@ -41,27 +55,35 @@ import {
|
|
|
41
55
|
assertInputFormat,
|
|
42
56
|
byCodeUnit,
|
|
43
57
|
loadRunConfig
|
|
44
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-4GGADKTU.js";
|
|
45
59
|
import "./chunk-GLP5PSXB.js";
|
|
60
|
+
import "./chunk-ZIXU7A4C.js";
|
|
61
|
+
import "./chunk-D3AO2PMV.js";
|
|
62
|
+
import "./chunk-5D24C6WM.js";
|
|
63
|
+
import "./chunk-VRMQSP7O.js";
|
|
64
|
+
import "./chunk-PS4Y7EPP.js";
|
|
65
|
+
import "./chunk-5VNFO2RT.js";
|
|
66
|
+
import "./chunk-3UYSONT4.js";
|
|
46
67
|
import "./chunk-TIUTIOFB.js";
|
|
47
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-3446DW4W.js";
|
|
48
69
|
import "./chunk-TKINOTVS.js";
|
|
49
|
-
import "./chunk-
|
|
50
|
-
import "./chunk-
|
|
51
|
-
import "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
55
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-UP6NBQ62.js";
|
|
71
|
+
import "./chunk-M6DNOHJO.js";
|
|
72
|
+
import "./chunk-DSJTYRI5.js";
|
|
73
|
+
import "./chunk-DU6CXY5R.js";
|
|
74
|
+
import "./chunk-KB4MNUKC.js";
|
|
75
|
+
import "./chunk-WBXVQW57.js";
|
|
76
|
+
import "./chunk-XWUIFSWK.js";
|
|
56
77
|
import {
|
|
57
78
|
collect,
|
|
58
79
|
configOption,
|
|
59
80
|
readStdin,
|
|
60
81
|
splitList,
|
|
61
82
|
writeTextAtomic
|
|
62
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-AIZBZYQM.js";
|
|
63
84
|
import "./chunk-DSWKBZWW.js";
|
|
64
|
-
import "./chunk-
|
|
85
|
+
import "./chunk-FAS3SRQB.js";
|
|
86
|
+
import "./chunk-77AINBYM.js";
|
|
65
87
|
import "./chunk-QK6VYJHV.js";
|
|
66
88
|
import {
|
|
67
89
|
shouldColor
|
|
@@ -71,6 +93,8 @@ import {
|
|
|
71
93
|
} from "./chunk-YEUYKR62.js";
|
|
72
94
|
import "./chunk-B2242FYO.js";
|
|
73
95
|
import {
|
|
96
|
+
notice,
|
|
97
|
+
noticeOnce,
|
|
74
98
|
warn
|
|
75
99
|
} from "./chunk-HX44GB4Z.js";
|
|
76
100
|
import {
|
|
@@ -78,7 +102,7 @@ import {
|
|
|
78
102
|
} from "./chunk-VM7VAFJW.js";
|
|
79
103
|
import {
|
|
80
104
|
package_default
|
|
81
|
-
} from "./chunk-
|
|
105
|
+
} from "./chunk-IGE6CIKZ.js";
|
|
82
106
|
import "./chunk-OWBRDNRZ.js";
|
|
83
107
|
import {
|
|
84
108
|
errorMessage
|
|
@@ -374,7 +398,7 @@ provenance:
|
|
|
374
398
|
# stewardship people fields (owner, stakeholders, reviewed-by) out.
|
|
375
399
|
|
|
376
400
|
# SHACL shapes \`manni graph check\` validates the built graph against. Default:
|
|
377
|
-
# the shapes contract bundled with manni (shapes/graph/shapes-1.
|
|
401
|
+
# the shapes contract bundled with manni (shapes/graph/shapes-1.2.0.ttl).
|
|
378
402
|
# check:
|
|
379
403
|
# shapes: ["./my-shapes.ttl"]
|
|
380
404
|
|
|
@@ -447,10 +471,10 @@ async function runInit(cwd = process.cwd()) {
|
|
|
447
471
|
await writeTextAtomic(path, `${HEADER}${starterSection()}`);
|
|
448
472
|
return path;
|
|
449
473
|
}
|
|
450
|
-
const
|
|
474
|
+
const text2 = readFileSync(path, "utf8");
|
|
451
475
|
let doc;
|
|
452
476
|
try {
|
|
453
|
-
doc = parseYaml(
|
|
477
|
+
doc = parseYaml(text2);
|
|
454
478
|
} catch (e) {
|
|
455
479
|
throw new GraphError(
|
|
456
480
|
`Invalid YAML in ${DEFAULT_CONFIG_FILENAME}: ${errorMessage(e)}`
|
|
@@ -466,15 +490,434 @@ async function runInit(cwd = process.cwd()) {
|
|
|
466
490
|
`${DEFAULT_CONFIG_FILENAME} already has a \`${CONFIG_SECTION}:\` section \u2014 not overwriting.`
|
|
467
491
|
);
|
|
468
492
|
}
|
|
469
|
-
const separator =
|
|
470
|
-
const blank =
|
|
493
|
+
const separator = text2 === "" || text2.endsWith("\n") ? "" : "\n";
|
|
494
|
+
const blank = text2 === "" ? "" : "\n";
|
|
471
495
|
await writeTextAtomic(
|
|
472
496
|
path,
|
|
473
|
-
`${
|
|
497
|
+
`${text2}${separator}${blank}${starterSection()}`
|
|
474
498
|
);
|
|
475
499
|
return path;
|
|
476
500
|
}
|
|
477
501
|
|
|
502
|
+
// src/graph/commands/serve.ts
|
|
503
|
+
import { Ajv2020 } from "ajv/dist/2020.js";
|
|
504
|
+
async function importSdk() {
|
|
505
|
+
const [mcp, stdio, types] = await Promise.all([
|
|
506
|
+
import("@modelcontextprotocol/sdk/server/mcp.js"),
|
|
507
|
+
import("@modelcontextprotocol/sdk/server/stdio.js"),
|
|
508
|
+
import("@modelcontextprotocol/sdk/types.js")
|
|
509
|
+
]);
|
|
510
|
+
return {
|
|
511
|
+
McpServer: mcp.McpServer,
|
|
512
|
+
StdioServerTransport: stdio.StdioServerTransport,
|
|
513
|
+
ListToolsRequestSchema: types.ListToolsRequestSchema,
|
|
514
|
+
CallToolRequestSchema: types.CallToolRequestSchema
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
var text = (description) => ({ type: "string", minLength: 1, description });
|
|
518
|
+
var count = (minimum, description) => ({ type: "integer", minimum, description });
|
|
519
|
+
var QUESTION = text("The reader's question, in their words.");
|
|
520
|
+
var NODE = text("The IRI of the node to start from, as a passage's iri gives it.");
|
|
521
|
+
var LANG = text("The localization, as a BCP-47 tag. Required when the docs have more than one.");
|
|
522
|
+
var VARIANT = text("Only passages for this product variant: its IRI, title or slug.");
|
|
523
|
+
var SUBJECT = text("Only passages about this software subject.");
|
|
524
|
+
var MAX_CHARS = count(1, "The character budget for passage text. Defaults to graph.retrieve.maxChars.");
|
|
525
|
+
var LIMIT = count(1, "Stop after this many nodes.");
|
|
526
|
+
var WHERE = {
|
|
527
|
+
type: "object",
|
|
528
|
+
description: "Only passages whose metadata holds each field's value. A list asks for every value, and a list field matches when it contains the value.",
|
|
529
|
+
additionalProperties: {
|
|
530
|
+
oneOf: [
|
|
531
|
+
{ type: "string", minLength: 1 },
|
|
532
|
+
{ type: "array", items: { type: "string", minLength: 1 }, minItems: 1 }
|
|
533
|
+
]
|
|
534
|
+
}
|
|
535
|
+
};
|
|
536
|
+
var input = (properties, requiredField) => ({
|
|
537
|
+
type: "object",
|
|
538
|
+
properties,
|
|
539
|
+
required: [requiredField],
|
|
540
|
+
additionalProperties: false
|
|
541
|
+
});
|
|
542
|
+
var REFUSAL = {
|
|
543
|
+
type: "object",
|
|
544
|
+
properties: {
|
|
545
|
+
reason: {
|
|
546
|
+
type: "string",
|
|
547
|
+
enum: ["no-route", "no-content", "withheld", "lang-required", "unknown-node", "unknown-scope"]
|
|
548
|
+
},
|
|
549
|
+
detail: { type: "string" }
|
|
550
|
+
},
|
|
551
|
+
required: ["reason", "detail"]
|
|
552
|
+
};
|
|
553
|
+
var PROOF = { type: "object", description: "The provenance record: pins, dates and eval verdicts." };
|
|
554
|
+
var TRACE = {
|
|
555
|
+
type: "object",
|
|
556
|
+
required: ["entry", "hops", "exclusions", "resolutions", "withheld", "filtered"]
|
|
557
|
+
};
|
|
558
|
+
var CITATIONS = {
|
|
559
|
+
type: "array",
|
|
560
|
+
items: { type: "object", properties: { iri: { type: "string" }, sourceUrl: { type: "string" } }, required: ["iri", "sourceUrl"] }
|
|
561
|
+
};
|
|
562
|
+
var PAGES = { type: "object", additionalProperties: { type: "object", required: ["metadata"] } };
|
|
563
|
+
var NULLABLE_TEXT = { type: ["string", "null"] };
|
|
564
|
+
var BUNDLE = {
|
|
565
|
+
type: "object",
|
|
566
|
+
properties: {
|
|
567
|
+
question: { type: "string" },
|
|
568
|
+
node: { type: "string" },
|
|
569
|
+
language: NULLABLE_TEXT,
|
|
570
|
+
context: {
|
|
571
|
+
type: "array",
|
|
572
|
+
items: {
|
|
573
|
+
type: "object",
|
|
574
|
+
properties: {
|
|
575
|
+
iri: { type: "string" },
|
|
576
|
+
title: { type: "string" },
|
|
577
|
+
text: { type: "string" },
|
|
578
|
+
page: { type: "string" },
|
|
579
|
+
depth: { type: "integer" },
|
|
580
|
+
role: { type: "string", enum: ["match", "context", "dependent"] },
|
|
581
|
+
provenance: PROOF
|
|
582
|
+
},
|
|
583
|
+
required: ["iri", "text", "page", "depth", "role", "provenance"]
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
citations: CITATIONS,
|
|
587
|
+
pages: PAGES,
|
|
588
|
+
trace: TRACE,
|
|
589
|
+
refusal: REFUSAL,
|
|
590
|
+
truncated: { type: "boolean" }
|
|
591
|
+
},
|
|
592
|
+
required: ["language", "context", "citations", "pages", "trace", "truncated"],
|
|
593
|
+
additionalProperties: false
|
|
594
|
+
};
|
|
595
|
+
var PASSAGE = (extra, required) => ({
|
|
596
|
+
type: "object",
|
|
597
|
+
properties: {
|
|
598
|
+
iri: { type: "string" },
|
|
599
|
+
title: { type: "string" },
|
|
600
|
+
page: { type: "string" },
|
|
601
|
+
lines: { type: "string" },
|
|
602
|
+
text: NULLABLE_TEXT,
|
|
603
|
+
truncated: { type: "boolean" },
|
|
604
|
+
provenance: PROOF,
|
|
605
|
+
...extra
|
|
606
|
+
},
|
|
607
|
+
required: ["iri", "page", "text", "truncated", "provenance", ...required]
|
|
608
|
+
});
|
|
609
|
+
var EDGES = {
|
|
610
|
+
type: "array",
|
|
611
|
+
items: {
|
|
612
|
+
type: "object",
|
|
613
|
+
properties: { from: { type: "string" }, predicate: { type: "string" }, to: { type: "string" } },
|
|
614
|
+
required: ["from", "predicate", "to"]
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
var WALK = {
|
|
618
|
+
type: "object",
|
|
619
|
+
properties: {
|
|
620
|
+
passages: { type: "array", items: PASSAGE({ depth: { type: "integer" } }, ["depth"]) },
|
|
621
|
+
edges: EDGES,
|
|
622
|
+
truncated: { type: "boolean" }
|
|
623
|
+
},
|
|
624
|
+
required: ["passages", "edges", "truncated"]
|
|
625
|
+
};
|
|
626
|
+
var LOOKUP_RESULT = {
|
|
627
|
+
type: "object",
|
|
628
|
+
properties: {
|
|
629
|
+
question: { type: "string" },
|
|
630
|
+
language: NULLABLE_TEXT,
|
|
631
|
+
matches: {
|
|
632
|
+
type: "object",
|
|
633
|
+
properties: {
|
|
634
|
+
passages: {
|
|
635
|
+
type: "array",
|
|
636
|
+
items: PASSAGE({ rank: { type: "integer" }, score: { type: "object", required: ["fused"] } }, ["rank", "score"])
|
|
637
|
+
},
|
|
638
|
+
truncated: { type: "boolean" }
|
|
639
|
+
},
|
|
640
|
+
required: ["passages", "truncated"]
|
|
641
|
+
},
|
|
642
|
+
traversal: WALK,
|
|
643
|
+
impact: WALK,
|
|
644
|
+
pages: PAGES,
|
|
645
|
+
citations: CITATIONS,
|
|
646
|
+
trace: TRACE,
|
|
647
|
+
refusal: REFUSAL
|
|
648
|
+
},
|
|
649
|
+
required: ["question", "language", "matches", "traversal", "impact", "pages", "citations", "trace"],
|
|
650
|
+
additionalProperties: false
|
|
651
|
+
};
|
|
652
|
+
var READ_ONLY = { readOnlyHint: true, openWorldHint: false };
|
|
653
|
+
var TOOLS = [
|
|
654
|
+
{
|
|
655
|
+
name: "lookup",
|
|
656
|
+
description: "Start here. Pass the reader's question. You get three full result sets. Every match is ranked with its scores. Every passage reached by following links outward from the matches comes back, and so does every passage that depends on the matches. Each set has its edges, and each passage has its source and proof: pin status, dates and eval verdicts. A refusal means nothing in the docs answers it.",
|
|
657
|
+
inputSchema: input({ question: QUESTION }, "question"),
|
|
658
|
+
outputSchema: LOOKUP_RESULT,
|
|
659
|
+
annotations: READ_ONLY
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
name: "retrieve",
|
|
663
|
+
description: "Like lookup, with control over language, scope, depth and budget.",
|
|
664
|
+
inputSchema: input(
|
|
665
|
+
{
|
|
666
|
+
question: QUESTION,
|
|
667
|
+
lang: LANG,
|
|
668
|
+
variant: VARIANT,
|
|
669
|
+
softwareSubject: SUBJECT,
|
|
670
|
+
depth: count(0, "Hops out from each match. Defaults to graph.retrieve.depth."),
|
|
671
|
+
maxChars: MAX_CHARS,
|
|
672
|
+
where: WHERE
|
|
673
|
+
},
|
|
674
|
+
"question"
|
|
675
|
+
),
|
|
676
|
+
outputSchema: BUNDLE,
|
|
677
|
+
annotations: READ_ONLY
|
|
678
|
+
},
|
|
679
|
+
{
|
|
680
|
+
name: "traverse",
|
|
681
|
+
description: "Walk the graph from one node and return the passages it reaches.",
|
|
682
|
+
inputSchema: input(
|
|
683
|
+
{
|
|
684
|
+
node: NODE,
|
|
685
|
+
depth: count(0, "Hops out from the node."),
|
|
686
|
+
predicates: {
|
|
687
|
+
type: "array",
|
|
688
|
+
items: { type: "string", minLength: 1 },
|
|
689
|
+
description: "Follow only these predicates, as prefixed names or IRIs."
|
|
690
|
+
},
|
|
691
|
+
reverse: { type: "boolean", description: "Follow edges into the node rather than out of it." },
|
|
692
|
+
lang: LANG,
|
|
693
|
+
variant: VARIANT,
|
|
694
|
+
softwareSubject: SUBJECT,
|
|
695
|
+
limit: LIMIT,
|
|
696
|
+
maxChars: MAX_CHARS,
|
|
697
|
+
where: WHERE
|
|
698
|
+
},
|
|
699
|
+
"node"
|
|
700
|
+
),
|
|
701
|
+
outputSchema: BUNDLE,
|
|
702
|
+
annotations: READ_ONLY
|
|
703
|
+
},
|
|
704
|
+
{
|
|
705
|
+
name: "impact",
|
|
706
|
+
description: "List the passages that depend on a node. Use it before changing a page.",
|
|
707
|
+
inputSchema: input(
|
|
708
|
+
{
|
|
709
|
+
node: NODE,
|
|
710
|
+
depth: { ...count(0, "Hops in from the node."), default: 3 },
|
|
711
|
+
lang: LANG,
|
|
712
|
+
variant: VARIANT,
|
|
713
|
+
softwareSubject: SUBJECT,
|
|
714
|
+
limit: LIMIT,
|
|
715
|
+
maxChars: MAX_CHARS,
|
|
716
|
+
where: WHERE
|
|
717
|
+
},
|
|
718
|
+
"node"
|
|
719
|
+
),
|
|
720
|
+
outputSchema: BUNDLE,
|
|
721
|
+
annotations: READ_ONLY
|
|
722
|
+
}
|
|
723
|
+
];
|
|
724
|
+
function whereOf(where) {
|
|
725
|
+
if (where === void 0) return void 0;
|
|
726
|
+
return Object.entries(where).flatMap(
|
|
727
|
+
([field, value]) => (Array.isArray(value) ? value : [value]).map((v) => ({ field, value: v }))
|
|
728
|
+
);
|
|
729
|
+
}
|
|
730
|
+
var defined = (o) => Object.fromEntries(Object.entries(o).filter(([, v]) => v !== void 0));
|
|
731
|
+
async function answer(artifact, name, args, withhold) {
|
|
732
|
+
const scope = defined({ lang: args.lang, variant: args.variant, subject: args.softwareSubject, withhold });
|
|
733
|
+
const head = name === "retrieve" || name === "lookup" ? { question: args.question ?? "" } : { node: args.node ?? "" };
|
|
734
|
+
try {
|
|
735
|
+
switch (name) {
|
|
736
|
+
case "lookup":
|
|
737
|
+
return await lookupIn(artifact, { question: args.question ?? "", ...defined({ withhold }) });
|
|
738
|
+
case "retrieve":
|
|
739
|
+
return await retrieveIn(artifact, {
|
|
740
|
+
question: args.question ?? "",
|
|
741
|
+
...scope,
|
|
742
|
+
...defined({ depth: args.depth, maxChars: args.maxChars, where: whereOf(args.where) })
|
|
743
|
+
});
|
|
744
|
+
case "traverse":
|
|
745
|
+
case "impact":
|
|
746
|
+
return await traverseIn(artifact, {
|
|
747
|
+
node: args.node ?? "",
|
|
748
|
+
...scope,
|
|
749
|
+
...name === "impact" ? { impact: true } : {},
|
|
750
|
+
...defined({
|
|
751
|
+
depth: args.depth,
|
|
752
|
+
predicates: args.predicates,
|
|
753
|
+
reverse: args.reverse,
|
|
754
|
+
limit: args.limit,
|
|
755
|
+
maxChars: args.maxChars,
|
|
756
|
+
where: whereOf(args.where)
|
|
757
|
+
})
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
} catch (e) {
|
|
761
|
+
if (!(e instanceof GraphError) || e.refusal === void 0) throw e;
|
|
762
|
+
const refused = {
|
|
763
|
+
...head,
|
|
764
|
+
language: null,
|
|
765
|
+
context: [],
|
|
766
|
+
citations: [],
|
|
767
|
+
pages: {},
|
|
768
|
+
trace: { entry: { candidates: [] }, hops: [], exclusions: [], resolutions: [], withheld: [], filtered: [] },
|
|
769
|
+
refusal: { reason: e.refusal, detail: e.message },
|
|
770
|
+
truncated: false
|
|
771
|
+
};
|
|
772
|
+
return refused;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
async function runServe(opts, seams = {}) {
|
|
776
|
+
let sdk;
|
|
777
|
+
try {
|
|
778
|
+
sdk = await (seams.loadSdk ?? importSdk)();
|
|
779
|
+
} catch {
|
|
780
|
+
throw new GraphError(
|
|
781
|
+
"graph serve needs the optional @modelcontextprotocol/sdk package; run npm install @modelcontextprotocol/sdk."
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
const artifact = openArtifact(opts);
|
|
785
|
+
const ajv = new Ajv2020({ allErrors: false, strict: false });
|
|
786
|
+
const validators = new Map(TOOLS.map((t) => [t.name, ajv.compile(t.inputSchema)]));
|
|
787
|
+
const server = new sdk.McpServer(
|
|
788
|
+
{ name: "manni-graph", version: package_default.version },
|
|
789
|
+
{ capabilities: { tools: {} } }
|
|
790
|
+
);
|
|
791
|
+
const pending = /* @__PURE__ */ new Set();
|
|
792
|
+
server.server.setRequestHandler(sdk.ListToolsRequestSchema, () => ({
|
|
793
|
+
tools: TOOLS.map((t) => ({ ...t }))
|
|
794
|
+
}));
|
|
795
|
+
server.server.setRequestHandler(sdk.CallToolRequestSchema, async (request) => {
|
|
796
|
+
const { name } = request.params;
|
|
797
|
+
const args = request.params.arguments ?? {};
|
|
798
|
+
const validate = validators.get(name);
|
|
799
|
+
const fault = (message) => ({
|
|
800
|
+
isError: true,
|
|
801
|
+
content: [{ type: "text", text: message }]
|
|
802
|
+
});
|
|
803
|
+
if (validate === void 0) return fault(`Unknown tool ${name}; this server has lookup, retrieve, traverse and impact.`);
|
|
804
|
+
if (!validate(args)) {
|
|
805
|
+
const first = validate.errors?.[0];
|
|
806
|
+
const where = first?.instancePath === "" || first === void 0 ? "arguments" : first.instancePath.slice(1);
|
|
807
|
+
const why = first?.keyword === "additionalProperties" ? `${String(first.params.additionalProperty)} is not an argument` : `${where} ${first?.message ?? "is invalid"}`;
|
|
808
|
+
return fault(`Invalid arguments for ${name}: ${why}.`);
|
|
809
|
+
}
|
|
810
|
+
const work = answer(artifact, name, args, opts.withhold);
|
|
811
|
+
pending.add(work);
|
|
812
|
+
try {
|
|
813
|
+
const result = await work;
|
|
814
|
+
return {
|
|
815
|
+
structuredContent: { ...result },
|
|
816
|
+
content: [{ type: "text", text: JSON.stringify(result) }]
|
|
817
|
+
};
|
|
818
|
+
} catch (e) {
|
|
819
|
+
return fault(errorMessage(e));
|
|
820
|
+
} finally {
|
|
821
|
+
pending.delete(work);
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
const stdin = seams.stdin ?? process.stdin;
|
|
825
|
+
const transport = new sdk.StdioServerTransport(stdin, seams.stdout ?? process.stdout);
|
|
826
|
+
const closed = new Promise((done) => {
|
|
827
|
+
stdin.once("end", done);
|
|
828
|
+
stdin.once("close", done);
|
|
829
|
+
});
|
|
830
|
+
await server.connect(transport);
|
|
831
|
+
notice(`serving lookup, retrieve, traverse and impact over stdio from ${artifact.label}.`);
|
|
832
|
+
await closed;
|
|
833
|
+
await Promise.allSettled([...pending]);
|
|
834
|
+
await new Promise((done) => setImmediate(done));
|
|
835
|
+
await server.close();
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// src/graph/commands/publish.ts
|
|
839
|
+
import { basename, dirname, join, relative, resolve as resolve3 } from "node:path";
|
|
840
|
+
var plural = (n, word) => `${String(n)} ${word}${n === 1 ? "" : "s"}`;
|
|
841
|
+
async function runPublish(opts = {}) {
|
|
842
|
+
const cwd = opts.cwd ?? process.cwd();
|
|
843
|
+
const source = {
|
|
844
|
+
...opts.config === void 0 ? {} : { config: opts.config },
|
|
845
|
+
...opts.noConfig === void 0 ? {} : { noConfig: opts.noConfig },
|
|
846
|
+
cwd
|
|
847
|
+
};
|
|
848
|
+
const config = loadRunConfig(
|
|
849
|
+
{
|
|
850
|
+
...opts.config === void 0 ? {} : { configPath: opts.config },
|
|
851
|
+
...opts.noConfig === void 0 ? {} : { noConfig: opts.noConfig }
|
|
852
|
+
},
|
|
853
|
+
cwd
|
|
854
|
+
);
|
|
855
|
+
const configured = resolve3(cwd, config.out);
|
|
856
|
+
const outDir = opts.out === void 0 ? dirname(configured) : resolve3(cwd, opts.out);
|
|
857
|
+
const graph = join(outDir, basename(configured));
|
|
858
|
+
const shown = (path) => relative(outDir, path).split("\\").join("/");
|
|
859
|
+
const say = opts.say ?? (() => void 0);
|
|
860
|
+
const steps = [];
|
|
861
|
+
const run = async (step, work) => {
|
|
862
|
+
let done;
|
|
863
|
+
try {
|
|
864
|
+
done = await work();
|
|
865
|
+
} catch (e) {
|
|
866
|
+
throw new GraphError(`graph publish stopped at ${step}: ${errorMessage(e)}`);
|
|
867
|
+
}
|
|
868
|
+
for (const w of done.warnings) say("warning", w);
|
|
869
|
+
for (const n of done.notices ?? []) say("notice", n);
|
|
870
|
+
steps.push({ step, status: "ran", detail: done.detail, files: done.files.map(shown) });
|
|
871
|
+
};
|
|
872
|
+
const skip = (step, section) => {
|
|
873
|
+
steps.push({ step, status: "skipped", detail: `no ${section} section`, files: [] });
|
|
874
|
+
};
|
|
875
|
+
const exported = (format, detail, out) => run(`export:${format}`, async () => {
|
|
876
|
+
const r = await runExport({ ...source, graph, format, ...out === void 0 ? {} : { out }, ...format === "chunks" && opts.evals !== void 0 ? { evals: opts.evals } : {} });
|
|
877
|
+
return { detail: detail(r), files: r.files, warnings: r.warnings, ...r.notices === void 0 ? {} : { notices: r.notices } };
|
|
878
|
+
});
|
|
879
|
+
const names = (r) => r.files.map(shown).join(", ");
|
|
880
|
+
await run("build", async () => {
|
|
881
|
+
const r = await runBuild({ ...source, out: graph });
|
|
882
|
+
return { detail: `${shown(r.outPath)}: ${plural(r.docs, "page")}, ${plural(r.quads, "triple")}`, files: [r.outPath], warnings: r.warnings };
|
|
883
|
+
});
|
|
884
|
+
await exported("search", (r) => `${names(r)}: ${String(r.nodes)} ${r.nodes === 1 ? "entry" : "entries"}`, outDir);
|
|
885
|
+
if (config.declared.embed) {
|
|
886
|
+
await run("embed", async () => {
|
|
887
|
+
const r = await runEmbed({ ...source, graph, index: outDir, out: outDir });
|
|
888
|
+
const models = [...new Set(r.languages.map((l) => l.model))].join(", ");
|
|
889
|
+
const files = r.languages.map((l) => l.outPath);
|
|
890
|
+
return { detail: `${files.map(shown).join(", ")}: ${plural(r.total, "vector")}, ${models}`, files, warnings: [] };
|
|
891
|
+
});
|
|
892
|
+
} else {
|
|
893
|
+
skip("embed", "graph.embed");
|
|
894
|
+
}
|
|
895
|
+
await exported("jsonld", (r) => `${names(r)}: ${plural(r.nodes, "node")}`);
|
|
896
|
+
await exported("chunks", (r) => `${names(r)}: ${plural(r.nodes, "chunk")}, ${String(r.withheld ?? 0)} withheld`, outDir);
|
|
897
|
+
if (config.export.llms !== null) {
|
|
898
|
+
await exported("llms", (r) => `${names(r)}: ${plural(r.nodes, "page")}`, join(outDir, LLMS_FILENAME));
|
|
899
|
+
} else {
|
|
900
|
+
skip("export:llms", "graph.export.llms");
|
|
901
|
+
}
|
|
902
|
+
if (config.declared.iirds) {
|
|
903
|
+
await exported("iirds", (r) => `${names(r)}: ${plural(r.nodes, "node")}`);
|
|
904
|
+
} else {
|
|
905
|
+
skip("export:iirds", "graph.export.iirds");
|
|
906
|
+
}
|
|
907
|
+
const label = relative(cwd, outDir).split("\\").join("/");
|
|
908
|
+
return { out: label === "" ? "." : label, steps };
|
|
909
|
+
}
|
|
910
|
+
function renderPublish(report, format) {
|
|
911
|
+
if (format === "json") return JSON.stringify(report, null, 2);
|
|
912
|
+
const lines = report.steps.map((s) => {
|
|
913
|
+
if (s.status === "skipped") return `skipped ${s.step.replace(/^export:/, "")}: ${s.detail}`;
|
|
914
|
+
return `${s.step.replace(/:.*$/, "").padEnd(9)} ${s.detail}`;
|
|
915
|
+
});
|
|
916
|
+
const files = new Set(report.steps.flatMap((s) => s.files)).size;
|
|
917
|
+
lines.push(`Published ${plural(files, "file")} to ${report.out}/.`);
|
|
918
|
+
return lines.join("\n");
|
|
919
|
+
}
|
|
920
|
+
|
|
478
921
|
// src/graph/cli.ts
|
|
479
922
|
function colorFor(command, isTTY, env) {
|
|
480
923
|
const noColor = colorOwner(command).opts().color === false;
|
|
@@ -532,6 +975,32 @@ function buildProgram() {
|
|
|
532
975
|
const checkFormatOption = choiceOption("--format", CHECK_FORMATS);
|
|
533
976
|
const showFormatOption = choiceOption("--format", SHAPES_SHOW_FORMATS);
|
|
534
977
|
const fieldsOption = (raw) => splitList(raw).map((value) => enumOption("--fields", ALL_FILL_FIELDS)(value));
|
|
978
|
+
const withholdOption = (raw) => splitList(raw).map((value) => {
|
|
979
|
+
if (value !== "drifted" && value !== "failing") {
|
|
980
|
+
throw new GraphError(`--withhold takes drifted or failing, and got ${value}.`);
|
|
981
|
+
}
|
|
982
|
+
return value;
|
|
983
|
+
});
|
|
984
|
+
const whereOption = (raw, prev) => {
|
|
985
|
+
const eq = raw.indexOf("=");
|
|
986
|
+
const field = eq < 0 ? "" : raw.slice(0, eq);
|
|
987
|
+
const value = eq < 0 ? "" : raw.slice(eq + 1);
|
|
988
|
+
if (field === "" || value === "") {
|
|
989
|
+
throw new GraphError(`--where takes field=value, and got ${raw}.`);
|
|
990
|
+
}
|
|
991
|
+
return [...prev, { field, value }];
|
|
992
|
+
};
|
|
993
|
+
function artifactInputs(command) {
|
|
994
|
+
return command.option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
|
|
995
|
+
"-i, --index <dir>",
|
|
996
|
+
"Directory holding chunks.json, its rows and the search index (default: beside the graph)"
|
|
997
|
+
).option(
|
|
998
|
+
"-f, --format <format>",
|
|
999
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
1000
|
+
formatOption,
|
|
1001
|
+
"pretty"
|
|
1002
|
+
);
|
|
1003
|
+
}
|
|
535
1004
|
function documentInputs(command, verb) {
|
|
536
1005
|
return command.argument(
|
|
537
1006
|
"[paths...]",
|
|
@@ -852,22 +1321,124 @@ function buildProgram() {
|
|
|
852
1321
|
"--variant <variant>",
|
|
853
1322
|
"Scope filter: product variant IRI, title, or slug"
|
|
854
1323
|
).option("--software-subject <subject>", "Scope filter: software subject").option("--lang <tag>", "Scope filter: BCP-47 language tag, matched in any case").option("--limit <n>", "Stop after this many nodes", countOption("--limit")).option(
|
|
1324
|
+
"--context",
|
|
1325
|
+
"Return the passages the walk reaches, with their text and proof, from the chunk artifact beside the graph"
|
|
1326
|
+
).option(
|
|
1327
|
+
"--max-chars <n>",
|
|
1328
|
+
"Character budget for the passages (with --context; default: config retrieve.maxChars)",
|
|
1329
|
+
countOption("--max-chars")
|
|
1330
|
+
).option(
|
|
1331
|
+
"--withhold <list>",
|
|
1332
|
+
"Also leave out passages that are drifted or failing, comma-separated (with --context)",
|
|
1333
|
+
withholdOption
|
|
1334
|
+
).option(
|
|
1335
|
+
"--where <field=value>",
|
|
1336
|
+
"Only passages whose metadata field holds the value, or a list field containing it (repeatable; all must hold; with --context)",
|
|
1337
|
+
whereOption,
|
|
1338
|
+
[]
|
|
1339
|
+
).option(
|
|
855
1340
|
"-f, --format <format>",
|
|
856
1341
|
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
857
1342
|
formatOption,
|
|
858
1343
|
"pretty"
|
|
859
1344
|
).action(
|
|
860
|
-
(node, opts) => {
|
|
1345
|
+
async (node, opts) => {
|
|
861
1346
|
try {
|
|
862
|
-
const { softwareSubject, ...others } = rest(opts);
|
|
863
|
-
const
|
|
1347
|
+
const { softwareSubject, context, maxChars, withhold, where, ...others } = rest(opts);
|
|
1348
|
+
const inputs = {
|
|
864
1349
|
...others,
|
|
865
1350
|
...documentOptions(opts),
|
|
866
1351
|
...softwareSubject === void 0 ? {} : { subject: softwareSubject },
|
|
867
1352
|
node,
|
|
868
1353
|
predicates: opts.predicates === void 0 ? void 0 : splitList(opts.predicates)
|
|
1354
|
+
};
|
|
1355
|
+
if (context !== true) {
|
|
1356
|
+
if (maxChars !== void 0) throw new GraphError("--max-chars needs --context.");
|
|
1357
|
+
if (withhold !== void 0) throw new GraphError("--withhold needs --context.");
|
|
1358
|
+
if (where.length > 0) throw new GraphError("--where needs --context.");
|
|
1359
|
+
console.log(renderTraverse(runTraverse(inputs), opts.format));
|
|
1360
|
+
return;
|
|
1361
|
+
}
|
|
1362
|
+
const bundle = await runTraverseContext({
|
|
1363
|
+
...inputs,
|
|
1364
|
+
...maxChars === void 0 ? {} : { maxChars },
|
|
1365
|
+
...withhold === void 0 ? {} : { withhold },
|
|
1366
|
+
...where.length === 0 ? {} : { where }
|
|
869
1367
|
});
|
|
870
|
-
console.log(
|
|
1368
|
+
console.log(renderBundle(bundle, opts.format));
|
|
1369
|
+
} catch (e) {
|
|
1370
|
+
fail(e);
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
);
|
|
1374
|
+
artifactInputs(
|
|
1375
|
+
program.command("lookup").description(
|
|
1376
|
+
"Answer a question from the chunk artifact: every ranked match, everything reached outward, and everything that depends on them"
|
|
1377
|
+
).argument("<question>", "The question, in quotes")
|
|
1378
|
+
).action(
|
|
1379
|
+
async (question, opts) => {
|
|
1380
|
+
try {
|
|
1381
|
+
const { format, ...others } = rest(opts);
|
|
1382
|
+
const { result, settings } = await runLookup({ ...others, ...documentOptions(opts), question });
|
|
1383
|
+
console.log(renderLookup(result, format, settings));
|
|
1384
|
+
} catch (e) {
|
|
1385
|
+
fail(e);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
);
|
|
1389
|
+
artifactInputs(
|
|
1390
|
+
program.command("retrieve").description("Retrieve passages for a question, with control over language, scope, depth and budget").argument("<question>", "The question, in quotes")
|
|
1391
|
+
).option("--lang <tag>", "The localization (required when the corpus has more than one)").option("--variant <variant>", "Scope filter: product variant IRI, title, or slug").option("--software-subject <subject>", "Scope filter: software subject").option(
|
|
1392
|
+
"--mode <mode>",
|
|
1393
|
+
`Which legs to run: ${SEARCH_MODES.join(" | ")} (default: hybrid when the rows carry vectors)`,
|
|
1394
|
+
choiceOption("--mode", SEARCH_MODES)
|
|
1395
|
+
).option("--seeds <n>", "Ranked matches the walk starts from (default: config retrieve.seeds)", countOption("--seeds")).option(
|
|
1396
|
+
"-d, --depth <n>",
|
|
1397
|
+
"Hops out from each match (default: config retrieve.depth)",
|
|
1398
|
+
countOption("--depth", 0)
|
|
1399
|
+
).option(
|
|
1400
|
+
"--max-chars <n>",
|
|
1401
|
+
"Character budget for the passages (default: config retrieve.maxChars)",
|
|
1402
|
+
countOption("--max-chars")
|
|
1403
|
+
).option(
|
|
1404
|
+
"--withhold <list>",
|
|
1405
|
+
"Also leave out passages that are drifted or failing, comma-separated",
|
|
1406
|
+
withholdOption
|
|
1407
|
+
).option(
|
|
1408
|
+
"--where <field=value>",
|
|
1409
|
+
"Only passages whose metadata field holds the value, or a list field containing it (repeatable; all must hold)",
|
|
1410
|
+
whereOption,
|
|
1411
|
+
[]
|
|
1412
|
+
).action(
|
|
1413
|
+
async (question, opts) => {
|
|
1414
|
+
try {
|
|
1415
|
+
const { softwareSubject, format, where, ...others } = rest(opts);
|
|
1416
|
+
const bundle = await runRetrieve({
|
|
1417
|
+
...others,
|
|
1418
|
+
...documentOptions(opts),
|
|
1419
|
+
...softwareSubject === void 0 ? {} : { subject: softwareSubject },
|
|
1420
|
+
...where.length === 0 ? {} : { where },
|
|
1421
|
+
question
|
|
1422
|
+
});
|
|
1423
|
+
console.log(renderBundle(bundle, format));
|
|
1424
|
+
} catch (e) {
|
|
1425
|
+
fail(e);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
);
|
|
1429
|
+
program.command("serve").description(
|
|
1430
|
+
"Serve lookup, retrieve, traverse and impact to an agent over MCP on stdio, from the chunk artifact, until stdin closes"
|
|
1431
|
+
).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
|
|
1432
|
+
"-i, --index <dir>",
|
|
1433
|
+
"Directory holding chunks.json, its rows and the search index (default: beside the graph)"
|
|
1434
|
+
).option(
|
|
1435
|
+
"--withhold <list>",
|
|
1436
|
+
"Also leave out passages that are drifted or failing, comma-separated, on every call",
|
|
1437
|
+
withholdOption
|
|
1438
|
+
).action(
|
|
1439
|
+
async (opts) => {
|
|
1440
|
+
try {
|
|
1441
|
+
await runServe({ ...rest(opts), ...documentOptions(opts) });
|
|
871
1442
|
} catch (e) {
|
|
872
1443
|
fail(e);
|
|
873
1444
|
}
|
|
@@ -906,11 +1477,11 @@ function buildProgram() {
|
|
|
906
1477
|
}
|
|
907
1478
|
);
|
|
908
1479
|
program.command("export").description(
|
|
909
|
-
"Reserialize the built graph into a consumer format (jsonld file, iirds package, search index,
|
|
1480
|
+
"Reserialize the built graph into a consumer format (jsonld file, iirds package, search index, question set, chunks with their provenance, or llms.txt)"
|
|
910
1481
|
).argument("<target>", `What to write: ${EXPORT_TARGETS.join(" | ")}`).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
|
|
911
1482
|
"-o, --out <path>",
|
|
912
|
-
"Output path (default: the graph path with the target's extension)"
|
|
913
|
-
).action(
|
|
1483
|
+
"Output path (default: the graph path with the target's extension); a directory for search and chunks"
|
|
1484
|
+
).option("--evals <path>", "A docevals JSON report for chunks (default: config export.chunks.evals)").action(
|
|
914
1485
|
async (target, opts) => {
|
|
915
1486
|
try {
|
|
916
1487
|
if (!EXPORT_TARGETS.includes(target)) {
|
|
@@ -922,10 +1493,12 @@ function buildProgram() {
|
|
|
922
1493
|
...documentOptions(opts),
|
|
923
1494
|
graph: opts.graph,
|
|
924
1495
|
format: target,
|
|
925
|
-
out: opts.out
|
|
1496
|
+
out: opts.out,
|
|
1497
|
+
...opts.evals === void 0 ? {} : { evals: opts.evals }
|
|
926
1498
|
});
|
|
927
1499
|
for (const warning of result.warnings) warn(warning);
|
|
928
|
-
const
|
|
1500
|
+
for (const said of result.notices ?? []) noticeOnce(said);
|
|
1501
|
+
const noun = result.format === "questions" ? "question" : result.format === "chunks" ? "chunk" : result.format === "llms" ? "page" : "node";
|
|
929
1502
|
console.log(
|
|
930
1503
|
`Wrote ${result.nodes} ${noun}${result.nodes === 1 ? "" : "s"} to ${result.outPath}`
|
|
931
1504
|
);
|
|
@@ -934,10 +1507,35 @@ function buildProgram() {
|
|
|
934
1507
|
}
|
|
935
1508
|
}
|
|
936
1509
|
);
|
|
1510
|
+
program.command("publish").description(
|
|
1511
|
+
"Build, embed when configured, and export everything serving needs into one directory"
|
|
1512
|
+
).option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file").option("-o, --out <dir>", "Directory for every artifact (default: the directory of config out)").option("--evals <path>", "A docevals JSON report for the chunks (default: config export.chunks.evals)").option(
|
|
1513
|
+
"-f, --format <format>",
|
|
1514
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
1515
|
+
formatOption,
|
|
1516
|
+
"pretty"
|
|
1517
|
+
).action(
|
|
1518
|
+
async (opts) => {
|
|
1519
|
+
try {
|
|
1520
|
+
const report = await runPublish({
|
|
1521
|
+
...documentOptions(opts),
|
|
1522
|
+
...opts.out === void 0 ? {} : { out: opts.out },
|
|
1523
|
+
...opts.evals === void 0 ? {} : { evals: opts.evals },
|
|
1524
|
+
say: (kind, message) => {
|
|
1525
|
+
if (kind === "notice") noticeOnce(message);
|
|
1526
|
+
else warn(message);
|
|
1527
|
+
}
|
|
1528
|
+
});
|
|
1529
|
+
console.log(renderPublish(report, opts.format));
|
|
1530
|
+
} catch (e) {
|
|
1531
|
+
fail(e);
|
|
1532
|
+
}
|
|
1533
|
+
}
|
|
1534
|
+
);
|
|
937
1535
|
return program;
|
|
938
1536
|
}
|
|
939
1537
|
export {
|
|
940
1538
|
buildProgram,
|
|
941
1539
|
colorFor
|
|
942
1540
|
};
|
|
943
|
-
//# sourceMappingURL=cli-
|
|
1541
|
+
//# sourceMappingURL=cli-RKYIZ6KU.js.map
|