@hawkeyexl/manni 4.3.1 → 4.4.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 +9 -1
- package/dist/batch-GFNLTGOH.js +36 -0
- package/dist/build-COYIQ25L.js +31 -0
- package/dist/calibrate-MDBLJKEE.js +31 -0
- package/dist/capture-LRML2PKV.js +32 -0
- package/dist/check-ASPIHA6B.js +40 -0
- package/dist/check-ASPIHA6B.js.map +1 -0
- package/dist/check-EDLBYL5N.js +27 -0
- package/dist/check-EDLBYL5N.js.map +1 -0
- package/dist/check-HYNGXYJV.js +18 -0
- package/dist/check-HYNGXYJV.js.map +1 -0
- package/dist/chunk-2B7ZNTPV.js +230 -0
- package/dist/chunk-2B7ZNTPV.js.map +1 -0
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-37LP5HMZ.js +1042 -0
- package/dist/chunk-37LP5HMZ.js.map +1 -0
- package/dist/chunk-3VK37OR2.js +2957 -0
- package/dist/chunk-3VK37OR2.js.map +1 -0
- package/dist/chunk-4IUC2MNL.js +2165 -0
- package/dist/chunk-4IUC2MNL.js.map +1 -0
- package/dist/{chunk-3R23C5DT.js → chunk-4TSWU2SU.js} +2 -14
- package/dist/chunk-4TSWU2SU.js.map +1 -0
- package/dist/chunk-57NEQRVO.js +10921 -0
- package/dist/chunk-57NEQRVO.js.map +1 -0
- package/dist/chunk-6JSSEWBG.js +6737 -0
- package/dist/chunk-6JSSEWBG.js.map +1 -0
- package/dist/chunk-6OYEI2VV.js +88 -0
- package/dist/chunk-6OYEI2VV.js.map +1 -0
- package/dist/chunk-77AINBYM.js +19 -0
- package/dist/chunk-77AINBYM.js.map +1 -0
- package/dist/chunk-7UKO3ASZ.js +54 -0
- package/dist/chunk-7UKO3ASZ.js.map +1 -0
- package/dist/chunk-A5ULMVHQ.js +164 -0
- package/dist/chunk-A5ULMVHQ.js.map +1 -0
- package/dist/chunk-C4SQM22E.js +299 -0
- package/dist/chunk-C4SQM22E.js.map +1 -0
- package/dist/chunk-CK7SKVHR.js +1042 -0
- package/dist/chunk-CK7SKVHR.js.map +1 -0
- package/dist/{chunk-G5CM2VGQ.js → chunk-DXNZS72W.js} +8 -94
- package/dist/chunk-DXNZS72W.js.map +1 -0
- package/dist/chunk-EPH54CAY.js +374 -0
- package/dist/chunk-EPH54CAY.js.map +1 -0
- package/dist/{chunk-KJR7OVDX.js → chunk-FBEQCK47.js} +56 -137
- package/dist/chunk-FBEQCK47.js.map +1 -0
- package/dist/{chunk-IOYXPBCL.js → chunk-G3T47CFV.js} +1 -7
- package/dist/{chunk-IOYXPBCL.js.map → chunk-G3T47CFV.js.map} +1 -1
- package/dist/chunk-GCQRPUSB.js +1287 -0
- package/dist/chunk-GCQRPUSB.js.map +1 -0
- package/dist/chunk-GLP5PSXB.js +72 -0
- package/dist/chunk-GLP5PSXB.js.map +1 -0
- package/dist/chunk-I2AH3CJJ.js +1192 -0
- package/dist/chunk-I2AH3CJJ.js.map +1 -0
- package/dist/chunk-IDV6HJCB.js +388 -0
- package/dist/chunk-IDV6HJCB.js.map +1 -0
- package/dist/chunk-IKEWBMCN.js +98 -0
- package/dist/chunk-IKEWBMCN.js.map +1 -0
- package/dist/chunk-JCDXE76J.js +52 -0
- package/dist/chunk-JCDXE76J.js.map +1 -0
- package/dist/chunk-JXLTXMJ7.js +455 -0
- package/dist/chunk-JXLTXMJ7.js.map +1 -0
- package/dist/chunk-LJ2RDH3F.js +49 -0
- package/dist/chunk-LJ2RDH3F.js.map +1 -0
- package/dist/chunk-M2JCK5F6.js +805 -0
- package/dist/chunk-M2JCK5F6.js.map +1 -0
- package/dist/chunk-M3W7J6MU.js +4398 -0
- package/dist/chunk-M3W7J6MU.js.map +1 -0
- package/dist/chunk-MMTSSTG7.js +23 -0
- package/dist/chunk-MMTSSTG7.js.map +1 -0
- package/dist/chunk-MNH7QO4Z.js +15 -0
- package/dist/chunk-MNH7QO4Z.js.map +1 -0
- package/dist/chunk-MWJLZMBL.js +934 -0
- package/dist/chunk-MWJLZMBL.js.map +1 -0
- package/dist/chunk-MYMBCTDE.js +387 -0
- package/dist/chunk-MYMBCTDE.js.map +1 -0
- package/dist/chunk-NCPWXHDO.js +683 -0
- package/dist/chunk-NCPWXHDO.js.map +1 -0
- package/dist/chunk-NLXTXE5Y.js +1661 -0
- package/dist/chunk-NLXTXE5Y.js.map +1 -0
- package/dist/{chunk-CFDUZRM2.js → chunk-NXV7WE2D.js} +32 -240
- package/dist/chunk-NXV7WE2D.js.map +1 -0
- package/dist/chunk-OWBRDNRZ.js +16 -0
- package/dist/chunk-OWBRDNRZ.js.map +1 -0
- package/dist/{chunk-KTSJ2ZHA.js → chunk-PAU352SV.js} +5 -3
- package/dist/{chunk-KTSJ2ZHA.js.map → chunk-PAU352SV.js.map} +1 -1
- package/dist/chunk-PCE7QHXJ.js +68 -0
- package/dist/chunk-PCE7QHXJ.js.map +1 -0
- package/dist/chunk-PIKOVN6W.js +1651 -0
- package/dist/chunk-PIKOVN6W.js.map +1 -0
- package/dist/chunk-PNPQTHBT.js +17 -0
- package/dist/chunk-PNPQTHBT.js.map +1 -0
- package/dist/chunk-PU6DFJMY.js +1975 -0
- package/dist/chunk-PU6DFJMY.js.map +1 -0
- package/dist/chunk-Q35YIDBV.js +1202 -0
- package/dist/chunk-Q35YIDBV.js.map +1 -0
- package/dist/{chunk-5HNHEUD5.js → chunk-QQUKGCAJ.js} +3 -3
- package/dist/chunk-QRWGPQKO.js +198 -0
- package/dist/chunk-QRWGPQKO.js.map +1 -0
- package/dist/{chunk-UBMMXS2Y.js → chunk-QZ6LRSNV.js} +69 -48
- package/dist/{chunk-UBMMXS2Y.js.map → chunk-QZ6LRSNV.js.map} +1 -1
- package/dist/chunk-RL5XWQOL.js +3872 -0
- package/dist/chunk-RL5XWQOL.js.map +1 -0
- package/dist/chunk-RNVYGWIC.js +30 -0
- package/dist/chunk-RNVYGWIC.js.map +1 -0
- package/dist/chunk-SE4JN5XN.js +19 -0
- package/dist/chunk-SE4JN5XN.js.map +1 -0
- package/dist/chunk-SKSDRUUK.js +622 -0
- package/dist/chunk-SKSDRUUK.js.map +1 -0
- package/dist/chunk-TIUTIOFB.js +25 -0
- package/dist/chunk-TIUTIOFB.js.map +1 -0
- package/dist/chunk-TK3FC4RF.js +3090 -0
- package/dist/chunk-TK3FC4RF.js.map +1 -0
- package/dist/chunk-TU2WUBVZ.js +2 -0
- package/dist/chunk-TU2WUBVZ.js.map +1 -0
- package/dist/chunk-TZOYZK2E.js +98 -0
- package/dist/chunk-TZOYZK2E.js.map +1 -0
- package/dist/chunk-UJCVAWP7.js +178 -0
- package/dist/chunk-UJCVAWP7.js.map +1 -0
- package/dist/chunk-UKZNLVJW.js +17 -0
- package/dist/chunk-UKZNLVJW.js.map +1 -0
- package/dist/{chunk-HAPTXWU2.js → chunk-UQISLDAV.js} +4 -4
- package/dist/chunk-WB3QM6PP.js +5440 -0
- package/dist/chunk-WB3QM6PP.js.map +1 -0
- package/dist/chunk-YB4IBW3M.js +96 -0
- package/dist/chunk-YB4IBW3M.js.map +1 -0
- package/dist/chunk-YEUYKR62.js +72 -0
- package/dist/chunk-YEUYKR62.js.map +1 -0
- package/dist/chunk-YJOGUXGP.js +634 -0
- package/dist/chunk-YJOGUXGP.js.map +1 -0
- package/dist/chunk-YNHZHSSM.js +41 -0
- package/dist/chunk-YNHZHSSM.js.map +1 -0
- package/dist/chunk-YTURO7SI.js +979 -0
- package/dist/chunk-YTURO7SI.js.map +1 -0
- package/dist/chunk-ZXRAE55H.js +31 -0
- package/dist/chunk-ZXRAE55H.js.map +1 -0
- package/dist/cli-3BIBYHFK.js +473 -0
- package/dist/cli-3BIBYHFK.js.map +1 -0
- package/dist/cli-673OTRGE.js +28 -0
- package/dist/cli-673OTRGE.js.map +1 -0
- package/dist/cli-6HIDIFVT.js +1203 -0
- package/dist/cli-6HIDIFVT.js.map +1 -0
- package/dist/cli-6UB5N6CU.js +232 -0
- package/dist/cli-6UB5N6CU.js.map +1 -0
- package/dist/cli-LFP5ZGYS.js +346 -0
- package/dist/cli-LFP5ZGYS.js.map +1 -0
- package/dist/cli-MN7PYMBI.js +552 -0
- package/dist/cli-MN7PYMBI.js.map +1 -0
- package/dist/cli-PYPX6O6E.js +739 -0
- package/dist/cli-PYPX6O6E.js.map +1 -0
- package/dist/cli-RPM5PELX.js +626 -0
- package/dist/cli-RPM5PELX.js.map +1 -0
- package/dist/cli-VI7VHWNZ.js +423 -0
- package/dist/cli-VI7VHWNZ.js.map +1 -0
- package/dist/cli.d.ts +12 -2
- package/dist/cli.js +109 -7661
- package/dist/cli.js.map +1 -1
- package/dist/docmeta.js +15 -3
- package/dist/docmeta.js.map +1 -1
- package/dist/github-6QMYOHC3.js +27 -0
- package/dist/github-6QMYOHC3.js.map +1 -0
- package/dist/github-SXPGP5DB.js +32 -0
- package/dist/github-SXPGP5DB.js.map +1 -0
- package/dist/index.d.ts +65 -3
- package/dist/index.js +407 -337
- package/dist/index.js.map +1 -1
- package/dist/json-7WV7KL6H.js +17 -0
- package/dist/json-7WV7KL6H.js.map +1 -0
- package/dist/json-SY7KLNC7.js +35 -0
- package/dist/json-SY7KLNC7.js.map +1 -0
- package/dist/lint-ASMJLLPA.js +28 -0
- package/dist/lint-ASMJLLPA.js.map +1 -0
- package/dist/list-KZNVTNVC.js +31 -0
- package/dist/list-KZNVTNVC.js.map +1 -0
- package/dist/list-Q57YTFUQ.js +29 -0
- package/dist/list-Q57YTFUQ.js.map +1 -0
- package/dist/page-KSGV5RD4.js +41 -0
- package/dist/page-KSGV5RD4.js.map +1 -0
- package/dist/picker-3XF36MJF.js +14 -0
- package/dist/picker-3XF36MJF.js.map +1 -0
- package/dist/pretty-A5EGTN35.js +37 -0
- package/dist/pretty-A5EGTN35.js.map +1 -0
- package/dist/pretty-CXSDXNAS.js +43 -0
- package/dist/pretty-CXSDXNAS.js.map +1 -0
- package/dist/reporters-HUY7UXFS.js +42 -0
- package/dist/reporters-HUY7UXFS.js.map +1 -0
- package/dist/reporters-K2VUKSAK.js +71 -0
- package/dist/reporters-K2VUKSAK.js.map +1 -0
- package/dist/reporters-M6LJ2IYU.js +21 -0
- package/dist/reporters-M6LJ2IYU.js.map +1 -0
- package/dist/run-3DYJNRIG.js +33 -0
- package/dist/run-3DYJNRIG.js.map +1 -0
- package/dist/term-BIQUPMOR.js +1592 -0
- package/dist/term-BIQUPMOR.js.map +1 -0
- package/dist/types-Y6TXHM7M.js +10 -0
- package/dist/types-Y6TXHM7M.js.map +1 -0
- package/dist/validate-53RKM2XG.js +16 -0
- package/dist/validate-53RKM2XG.js.map +1 -0
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +9 -0
- package/plugin/manni/hooks/hooks.json +69 -0
- package/plugin/manni/hooks/manni.mjs +157 -0
- package/plugin/manni/skills/check/SKILL.md +20 -0
- package/plugin/manni/skills/evals/SKILL.md +27 -0
- package/plugin/manni/skills/fix/SKILL.md +56 -0
- package/plugin/manni/skills/setup/SKILL.md +41 -0
- package/dist/batch-A5HZKYIW.js +0 -18
- package/dist/calibrate-S5K6QHUY.js +0 -13
- package/dist/capture-OZEZDABQ.js +0 -15
- package/dist/chunk-3R23C5DT.js.map +0 -1
- package/dist/chunk-CFDUZRM2.js.map +0 -1
- package/dist/chunk-G5CM2VGQ.js.map +0 -1
- package/dist/chunk-KJR7OVDX.js.map +0 -1
- package/dist/chunk-V4KUVE47.js +0 -27170
- package/dist/chunk-V4KUVE47.js.map +0 -1
- package/dist/chunk-ZQBTK3DO.js +0 -26518
- package/dist/chunk-ZQBTK3DO.js.map +0 -1
- package/dist/picker-6HRMETE7.js +0 -12
- package/plugin/tracevals/.claude-plugin/plugin.json +0 -9
- package/plugin/tracevals/hooks/hooks.json +0 -17
- /package/dist/{batch-A5HZKYIW.js.map → batch-GFNLTGOH.js.map} +0 -0
- /package/dist/{calibrate-S5K6QHUY.js.map → build-COYIQ25L.js.map} +0 -0
- /package/dist/{capture-OZEZDABQ.js.map → calibrate-MDBLJKEE.js.map} +0 -0
- /package/dist/{picker-6HRMETE7.js.map → capture-LRML2PKV.js.map} +0 -0
- /package/dist/{chunk-5HNHEUD5.js.map → chunk-QQUKGCAJ.js.map} +0 -0
- /package/dist/{chunk-HAPTXWU2.js.map → chunk-UQISLDAV.js.map} +0 -0
|
@@ -0,0 +1,626 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
renderCheck,
|
|
4
|
+
runCheck
|
|
5
|
+
} from "./chunk-6OYEI2VV.js";
|
|
6
|
+
import {
|
|
7
|
+
EXPORT_TARGETS,
|
|
8
|
+
SEARCH_MODES,
|
|
9
|
+
renderEmbed,
|
|
10
|
+
renderFill,
|
|
11
|
+
renderQuery,
|
|
12
|
+
renderSearch,
|
|
13
|
+
renderStats,
|
|
14
|
+
renderTraverse,
|
|
15
|
+
runEmbed,
|
|
16
|
+
runExport,
|
|
17
|
+
runFill,
|
|
18
|
+
runQuery,
|
|
19
|
+
runSearch,
|
|
20
|
+
runStats,
|
|
21
|
+
runTraverse
|
|
22
|
+
} from "./chunk-RL5XWQOL.js";
|
|
23
|
+
import {
|
|
24
|
+
DEFAULT_EXTENSIONS,
|
|
25
|
+
STDIN,
|
|
26
|
+
assertInputFormat,
|
|
27
|
+
runBuild
|
|
28
|
+
} from "./chunk-NLXTXE5Y.js";
|
|
29
|
+
import "./chunk-MYMBCTDE.js";
|
|
30
|
+
import {
|
|
31
|
+
ALL_FILL_FIELDS,
|
|
32
|
+
CONFIG_SECTION,
|
|
33
|
+
DEFAULT_CONFIG_FILENAME,
|
|
34
|
+
GraphError
|
|
35
|
+
} from "./chunk-M2JCK5F6.js";
|
|
36
|
+
import "./chunk-TIUTIOFB.js";
|
|
37
|
+
import "./chunk-TU2WUBVZ.js";
|
|
38
|
+
import "./chunk-QRWGPQKO.js";
|
|
39
|
+
import "./chunk-6JSSEWBG.js";
|
|
40
|
+
import "./chunk-A5ULMVHQ.js";
|
|
41
|
+
import {
|
|
42
|
+
collect,
|
|
43
|
+
configOption,
|
|
44
|
+
readStdin,
|
|
45
|
+
splitList
|
|
46
|
+
} from "./chunk-TK3FC4RF.js";
|
|
47
|
+
import {
|
|
48
|
+
writeTextAtomic
|
|
49
|
+
} from "./chunk-M3W7J6MU.js";
|
|
50
|
+
import "./chunk-IDV6HJCB.js";
|
|
51
|
+
import "./chunk-57NEQRVO.js";
|
|
52
|
+
import {
|
|
53
|
+
fail
|
|
54
|
+
} from "./chunk-YEUYKR62.js";
|
|
55
|
+
import {
|
|
56
|
+
shouldColor
|
|
57
|
+
} from "./chunk-RNVYGWIC.js";
|
|
58
|
+
import "./chunk-MNH7QO4Z.js";
|
|
59
|
+
import {
|
|
60
|
+
LOCAL_FLAG_HELP,
|
|
61
|
+
warn
|
|
62
|
+
} from "./chunk-Q35YIDBV.js";
|
|
63
|
+
import {
|
|
64
|
+
package_default
|
|
65
|
+
} from "./chunk-UJCVAWP7.js";
|
|
66
|
+
import "./chunk-OWBRDNRZ.js";
|
|
67
|
+
import {
|
|
68
|
+
errorMessage
|
|
69
|
+
} from "./chunk-G3T47CFV.js";
|
|
70
|
+
import "./chunk-2H7UOFLK.js";
|
|
71
|
+
|
|
72
|
+
// src/graph/cli.ts
|
|
73
|
+
import { Command } from "commander";
|
|
74
|
+
|
|
75
|
+
// src/graph/reporters/index.ts
|
|
76
|
+
var GRAPH_FORMATS = ["pretty", "json"];
|
|
77
|
+
var GRAPH_FORMAT_LIST = GRAPH_FORMATS.join(" | ");
|
|
78
|
+
var CHECK_FORMATS = [...GRAPH_FORMATS, "github"];
|
|
79
|
+
var CHECK_FORMAT_LIST = CHECK_FORMATS.join(" | ");
|
|
80
|
+
|
|
81
|
+
// src/graph/commands/init.ts
|
|
82
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
83
|
+
import { resolve } from "node:path";
|
|
84
|
+
import { parse as parseYaml } from "yaml";
|
|
85
|
+
var HEADER = `# manni.config.yaml \u2014 shared configuration for the manni family of tools.
|
|
86
|
+
# Each tool reads its own top-level key; manni graph reads "graph:".
|
|
87
|
+
`;
|
|
88
|
+
var STARTER = `# Base IRI for every minted node. Set this to a namespace you control;
|
|
89
|
+
# without it, IRIs fall back to the urn:manni:graph: placeholder.
|
|
90
|
+
# baseIri: https://example.com/graph/
|
|
91
|
+
|
|
92
|
+
# There is no document set here. \`manni graph build\` and \`manni graph fill\` read the
|
|
93
|
+
# paths you name, or the collections declared once for every tool at the TOP
|
|
94
|
+
# level of this file, beside \`graph:\` rather than inside it:
|
|
95
|
+
#
|
|
96
|
+
# collections:
|
|
97
|
+
# - name: site
|
|
98
|
+
# paths: ["docs/**/*.md"]
|
|
99
|
+
#
|
|
100
|
+
# Output of \`manni graph build\`.
|
|
101
|
+
out: graph/graph.ttl
|
|
102
|
+
|
|
103
|
+
# Map published-site routes back to source files so route-style links
|
|
104
|
+
# (/docs/actions/find) become graph edges. A route may also carry the BCP-47
|
|
105
|
+
# \`language\` labelling every document under its root; a page's own \`lang\`
|
|
106
|
+
# frontmatter wins. Uncomment and adjust:
|
|
107
|
+
# routes:
|
|
108
|
+
# - basePath: /docs
|
|
109
|
+
# root: docs
|
|
110
|
+
# extensions: [.md, .mdx, .markdown]
|
|
111
|
+
# indexFiles: [index, README]
|
|
112
|
+
# - basePath: /docs/de
|
|
113
|
+
# root: docs/de
|
|
114
|
+
# language: de
|
|
115
|
+
|
|
116
|
+
# What to derive triples from. Remove entries to opt out.
|
|
117
|
+
build:
|
|
118
|
+
derive: [frontmatter, sections, links, tags, images, code, provenance]
|
|
119
|
+
|
|
120
|
+
# PROV-O settings. Git history is detected, not switched: per-file dates and
|
|
121
|
+
# author agents, rename -> prov:wasRevisionOf, and the build activity's HEAD
|
|
122
|
+
# committer date are derived wherever git can run over a repository, and a run
|
|
123
|
+
# that cannot says so once and builds the rest. Deterministic per commit;
|
|
124
|
+
# wall-clock time never enters the graph.
|
|
125
|
+
# qualified: emit prov:qualifiedAttribution/qualifiedAssociation nodes
|
|
126
|
+
# with roles alongside the direct properties.
|
|
127
|
+
provenance:
|
|
128
|
+
qualified: true
|
|
129
|
+
|
|
130
|
+
# Which fields a published graph may carry is read from x-manni-graph-output in
|
|
131
|
+
# the schema set \`manni meta validate\` resolves for each page. Set that under
|
|
132
|
+
# meta: (schemas, strict, register), not here. The default set keeps the
|
|
133
|
+
# stewardship people fields (owner, stakeholders, reviewed-by) out.
|
|
134
|
+
|
|
135
|
+
# SHACL shapes \`manni graph check\` validates the built graph against. Default:
|
|
136
|
+
# the shapes contract bundled with manni (shapes/graph/shapes-1.0.0.ttl).
|
|
137
|
+
# check:
|
|
138
|
+
# shapes: ["./my-shapes.ttl"]
|
|
139
|
+
|
|
140
|
+
# Metadata coverage gate for \`manni graph stats --check\`. A number applies to
|
|
141
|
+
# every measured field; a map gates named fields only. Unset gates nothing.
|
|
142
|
+
# stats:
|
|
143
|
+
# coverageThreshold:
|
|
144
|
+
# title: 100
|
|
145
|
+
# description: 50
|
|
146
|
+
|
|
147
|
+
# Which provider \`manni graph fill\` sends pages to. Unset, the family's
|
|
148
|
+
# top-level providers: map decides, and then \`auto\`, which detects one: an
|
|
149
|
+
# Anthropic key, then an OpenAI key, then the Claude CLI, then a local model.
|
|
150
|
+
# Connection settings (apiKeyEnv, baseUrl, command) live in that map, declared
|
|
151
|
+
# once for every manni tool. \`--provider\` wins over this, \`--local\` over both.
|
|
152
|
+
# provider: anthropic # auto | anthropic | openai | claude-cli | llama-cpp
|
|
153
|
+
# model: claude-sonnet-4-5 # the provider's default when omitted
|
|
154
|
+
|
|
155
|
+
# LLM settings for \`manni graph fill\` (SKOS frontmatter proposals).
|
|
156
|
+
fill:
|
|
157
|
+
temperature: 0
|
|
158
|
+
# Stop after this many inference calls. One page is one turn, and a cached
|
|
159
|
+
# page spends none. Unset is unbounded.
|
|
160
|
+
# maxTurns: 50
|
|
161
|
+
cacheDir: .manni/graph/cache
|
|
162
|
+
# fill proposes every field; confidence (0..1 per field) gates what is
|
|
163
|
+
# written. Fields scored below the threshold are reported, not written.
|
|
164
|
+
confidenceThreshold: 0.7
|
|
165
|
+
# fields: defaults to every fillable field \u2014 uncomment to restrict.
|
|
166
|
+
# Record meta-provenance (model + /graph/ pointers + confidence) on filled docs.
|
|
167
|
+
writeProvenance: true
|
|
168
|
+
# Reject proposals that would violate the SHACL shapes contract
|
|
169
|
+
# (broader/narrower cycles, conflicting labels).
|
|
170
|
+
validateGraph: true
|
|
171
|
+
# Also propose per-section metadata. Off by default: it costs more output per
|
|
172
|
+
# call, and section metadata is explicit-only, so review it as carefully.
|
|
173
|
+
sections: false
|
|
174
|
+
|
|
175
|
+
# Local embeddings for semantic search (\`manni graph embed\`). Needs the optional
|
|
176
|
+
# peer: npm install @huggingface/transformers
|
|
177
|
+
# embed:
|
|
178
|
+
# model: onnx-community/granite-embedding-small-english-r2-ONNX
|
|
179
|
+
# dtype: q8 # q8 keeps embedding reproducible across platforms
|
|
180
|
+
# out: graph # directory for the per-language vector sidecars
|
|
181
|
+
# cacheDir: .manni/graph/embed-cache
|
|
182
|
+
|
|
183
|
+
# Optional enrichment for \`manni graph export iirds\` (the iiRDS package).
|
|
184
|
+
# Absent, a minimal valid package is still produced.
|
|
185
|
+
# export:
|
|
186
|
+
# iirds:
|
|
187
|
+
# title: My Docs # package title (default: "manni graph export")
|
|
188
|
+
# creator: Acme Corp # Creator iirds:Party + vcard:Organization
|
|
189
|
+
# version: "1.3" # iiRDS version literal: "1.2" | "1.3"
|
|
190
|
+
`;
|
|
191
|
+
function starterSection() {
|
|
192
|
+
const body = STARTER.split("\n").map((line) => line === "" ? "" : ` ${line}`).join("\n");
|
|
193
|
+
return `${CONFIG_SECTION}:
|
|
194
|
+
${body}`;
|
|
195
|
+
}
|
|
196
|
+
async function runInit(cwd = process.cwd()) {
|
|
197
|
+
const path = resolve(cwd, DEFAULT_CONFIG_FILENAME);
|
|
198
|
+
if (!existsSync(path)) {
|
|
199
|
+
await writeTextAtomic(path, `${HEADER}${starterSection()}`);
|
|
200
|
+
return path;
|
|
201
|
+
}
|
|
202
|
+
const text = readFileSync(path, "utf8");
|
|
203
|
+
let doc;
|
|
204
|
+
try {
|
|
205
|
+
doc = parseYaml(text);
|
|
206
|
+
} catch (e) {
|
|
207
|
+
throw new GraphError(
|
|
208
|
+
`Invalid YAML in ${DEFAULT_CONFIG_FILENAME}: ${errorMessage(e)}`
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
if (doc != null && (typeof doc !== "object" || Array.isArray(doc))) {
|
|
212
|
+
throw new GraphError(
|
|
213
|
+
`${DEFAULT_CONFIG_FILENAME}: top level must be a mapping \u2014 not adding a \`${CONFIG_SECTION}:\` section to it.`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
if (doc != null && Object.hasOwn(doc, CONFIG_SECTION)) {
|
|
217
|
+
throw new GraphError(
|
|
218
|
+
`${DEFAULT_CONFIG_FILENAME} already has a \`${CONFIG_SECTION}:\` section \u2014 not overwriting.`
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
const separator = text === "" || text.endsWith("\n") ? "" : "\n";
|
|
222
|
+
const blank = text === "" ? "" : "\n";
|
|
223
|
+
await writeTextAtomic(
|
|
224
|
+
path,
|
|
225
|
+
`${text}${separator}${blank}${starterSection()}`
|
|
226
|
+
);
|
|
227
|
+
return path;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// src/graph/cli.ts
|
|
231
|
+
function colorFor(command, isTTY, env) {
|
|
232
|
+
const noColor = colorOwner(command).opts().color === false;
|
|
233
|
+
return shouldColor({ noColor, isTTY, env });
|
|
234
|
+
}
|
|
235
|
+
function colorOwner(command) {
|
|
236
|
+
for (let c = command; c !== null; c = c.parent) {
|
|
237
|
+
if (c.options.some((o) => o.long === "--no-color")) return c;
|
|
238
|
+
}
|
|
239
|
+
return command;
|
|
240
|
+
}
|
|
241
|
+
function buildProgram() {
|
|
242
|
+
const program = new Command();
|
|
243
|
+
program.name("graph").description(
|
|
244
|
+
"Deterministic knowledge graphs derived from documentation frontmatter and formatting."
|
|
245
|
+
).version(package_default.version).option("--no-color", "disable colored output").showHelpAfterError("(add --help for usage)").exitOverride();
|
|
246
|
+
function numericOption(flag, { min, max, integer }) {
|
|
247
|
+
return (raw) => {
|
|
248
|
+
const value = Number.parseFloat(raw);
|
|
249
|
+
if (!Number.isFinite(value)) {
|
|
250
|
+
throw new GraphError(`${flag} expects a number, got "${raw}".`);
|
|
251
|
+
}
|
|
252
|
+
if (integer && !Number.isInteger(value)) {
|
|
253
|
+
throw new GraphError(`${flag} expects a whole number, got ${value}.`);
|
|
254
|
+
}
|
|
255
|
+
if (value < min || max !== void 0 && value > max) {
|
|
256
|
+
const range = max === void 0 ? `>= ${min}` : `${min}..${max}`;
|
|
257
|
+
throw new GraphError(`${flag} must be ${range}, got ${value}.`);
|
|
258
|
+
}
|
|
259
|
+
return value;
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
function countOption(flag, min = 1) {
|
|
263
|
+
return numericOption(flag, { min, integer: true });
|
|
264
|
+
}
|
|
265
|
+
function enumOption(flag, allowed) {
|
|
266
|
+
return (raw) => {
|
|
267
|
+
if (!allowed.includes(raw)) {
|
|
268
|
+
throw new GraphError(
|
|
269
|
+
`${flag} must be one of ${allowed.join(" | ")}, got "${raw}".`
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
return raw;
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
function choiceOption(flag, allowed) {
|
|
276
|
+
return (raw) => {
|
|
277
|
+
if (!allowed.includes(raw)) {
|
|
278
|
+
throw new GraphError(`Unknown ${flag} "${raw}". Use ${allowed.join(" | ")}.`);
|
|
279
|
+
}
|
|
280
|
+
return raw;
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
const formatOption = choiceOption("--format", GRAPH_FORMATS);
|
|
284
|
+
const checkFormatOption = choiceOption("--format", CHECK_FORMATS);
|
|
285
|
+
const fieldsOption = (raw) => splitList(raw).map((value) => enumOption("--fields", ALL_FILL_FIELDS)(value));
|
|
286
|
+
function documentInputs(command, verb) {
|
|
287
|
+
return command.argument(
|
|
288
|
+
"[paths...]",
|
|
289
|
+
`files, directories, or globs to ${verb} (use - for stdin)`
|
|
290
|
+
).option(
|
|
291
|
+
"--collection <name>",
|
|
292
|
+
"Configured collection to read (repeatable)",
|
|
293
|
+
collect,
|
|
294
|
+
[]
|
|
295
|
+
).option("--exclude <glob>", "Glob to exclude (repeatable)", collect, []).option("--as <format>", "force an input format (markdown, mdx)").option(
|
|
296
|
+
"--ext <list>",
|
|
297
|
+
"comma-separated extensions for directory walks",
|
|
298
|
+
DEFAULT_EXTENSIONS.join(",")
|
|
299
|
+
).option("--allow-empty", "treat zero matched files as success").option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file");
|
|
300
|
+
}
|
|
301
|
+
async function inputOptions(paths, opts) {
|
|
302
|
+
assertInputFormat(paths, opts.as);
|
|
303
|
+
return {
|
|
304
|
+
...opts.as === void 0 ? {} : { as: opts.as },
|
|
305
|
+
ext: splitList(opts.ext),
|
|
306
|
+
...opts.allowEmpty === true ? { allowEmpty: true } : {},
|
|
307
|
+
...paths.includes(STDIN) ? { stdinContent: await readStdin() } : {}
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
function configInputs(command) {
|
|
311
|
+
return command.option("-c, --config <path>", "Path to manni.config.yaml").option("--no-config", "Ignore any discovered config file");
|
|
312
|
+
}
|
|
313
|
+
function rest(opts) {
|
|
314
|
+
const { config, ...others } = opts;
|
|
315
|
+
return others;
|
|
316
|
+
}
|
|
317
|
+
function documentOptions(opts) {
|
|
318
|
+
const { configPath, noConfig } = configOption(opts.config);
|
|
319
|
+
return {
|
|
320
|
+
...configPath === void 0 ? {} : { config: configPath },
|
|
321
|
+
...noConfig === true ? { noConfig } : {},
|
|
322
|
+
...opts.collection === void 0 ? {} : { collection: opts.collection },
|
|
323
|
+
...opts.exclude === void 0 ? {} : { exclude: opts.exclude }
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
program.command("init").description("Add a starter `graph:` section to manni.config.yaml in the current directory").action(async () => {
|
|
327
|
+
try {
|
|
328
|
+
console.log(`Created ${await runInit()}`);
|
|
329
|
+
} catch (e) {
|
|
330
|
+
fail(e);
|
|
331
|
+
}
|
|
332
|
+
});
|
|
333
|
+
documentInputs(
|
|
334
|
+
program.command("build").description("Derive the knowledge graph and write deterministic Turtle"),
|
|
335
|
+
"build"
|
|
336
|
+
).option("-o, --out <path>", "Output .ttl path (default: config out)").action(async (paths, opts) => {
|
|
337
|
+
try {
|
|
338
|
+
const result = await runBuild({
|
|
339
|
+
paths,
|
|
340
|
+
...documentOptions(opts),
|
|
341
|
+
...await inputOptions(paths, opts),
|
|
342
|
+
out: opts.out
|
|
343
|
+
});
|
|
344
|
+
for (const warning of result.warnings) warn(warning);
|
|
345
|
+
console.log(
|
|
346
|
+
`Wrote ${result.outPath} (${result.docs} docs, ${result.quads} triples)`
|
|
347
|
+
);
|
|
348
|
+
} catch (e) {
|
|
349
|
+
fail(e);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
configInputs(
|
|
353
|
+
program.command("check").description(
|
|
354
|
+
"Validate the built graph against the bundled SHACL shapes (errors exit 1)"
|
|
355
|
+
)
|
|
356
|
+
).option("-g, --graph <path>", "Graph .ttl path (default: config out)").option(
|
|
357
|
+
"--shapes <path>",
|
|
358
|
+
"Shapes .ttl file; repeatable (default: config check.shapes, then bundled)",
|
|
359
|
+
collect,
|
|
360
|
+
[]
|
|
361
|
+
).option(
|
|
362
|
+
"-f, --format <format>",
|
|
363
|
+
`Output: ${CHECK_FORMAT_LIST}`,
|
|
364
|
+
checkFormatOption,
|
|
365
|
+
"pretty"
|
|
366
|
+
).action(
|
|
367
|
+
async (opts) => {
|
|
368
|
+
try {
|
|
369
|
+
const report = await runCheck({ ...rest(opts), ...documentOptions(opts) });
|
|
370
|
+
console.log(renderCheck(report, opts.format));
|
|
371
|
+
process.exitCode = report.exitCode;
|
|
372
|
+
} catch (e) {
|
|
373
|
+
fail(e);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
);
|
|
377
|
+
documentInputs(
|
|
378
|
+
program.command("fill").description(
|
|
379
|
+
"Propose `graph:` frontmatter fields with an LLM, gated by confidence, and write them back"
|
|
380
|
+
),
|
|
381
|
+
"fill"
|
|
382
|
+
).option(
|
|
383
|
+
"-f, --format <format>",
|
|
384
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
385
|
+
formatOption,
|
|
386
|
+
"pretty"
|
|
387
|
+
).option("--dry-run", "Report proposals without writing files").option("--force", "Overwrite human-set graph fields").option("--no-cache", "Bypass the proposal cache").option("--no-validate-graph", "Skip the SHACL graph guardrail on proposals").option("--sections", "Also propose per-section metadata").option(
|
|
388
|
+
"--max-turns <n>",
|
|
389
|
+
"Stop after this many inference calls (a cached page costs none)",
|
|
390
|
+
countOption("--max-turns")
|
|
391
|
+
).option(
|
|
392
|
+
"--confidence <n>",
|
|
393
|
+
"Minimum model confidence (0..1) to write a field (default: config, 0.7)",
|
|
394
|
+
numericOption("--confidence", { min: 0, max: 1 })
|
|
395
|
+
).option(
|
|
396
|
+
// Comma-separated and given once: one separator per list (proposal 0034).
|
|
397
|
+
"--fields <list>",
|
|
398
|
+
`Fields to propose (comma-separated; default: config, then every field)`,
|
|
399
|
+
fieldsOption
|
|
400
|
+
).option(
|
|
401
|
+
"--provider <name>",
|
|
402
|
+
"Provider: auto (default) | anthropic | openai | claude-cli | llama-cpp"
|
|
403
|
+
).option("--model <model>", "Model override; needs a named provider, from here or config").option("--local", LOCAL_FLAG_HELP).action(async (paths, opts) => {
|
|
404
|
+
try {
|
|
405
|
+
const report = await runFill({
|
|
406
|
+
paths,
|
|
407
|
+
...documentOptions(opts),
|
|
408
|
+
...await inputOptions(paths, opts),
|
|
409
|
+
dryRun: opts.dryRun,
|
|
410
|
+
force: opts.force,
|
|
411
|
+
noCache: opts.cache === false,
|
|
412
|
+
noValidateGraph: opts.validateGraph === false,
|
|
413
|
+
sections: opts.sections,
|
|
414
|
+
maxTurns: opts.maxTurns,
|
|
415
|
+
confidence: opts.confidence,
|
|
416
|
+
fields: opts.fields,
|
|
417
|
+
provider: opts.provider,
|
|
418
|
+
model: opts.model,
|
|
419
|
+
local: opts.local
|
|
420
|
+
});
|
|
421
|
+
for (const warning of report.warnings) warn(warning);
|
|
422
|
+
const rendered = renderFill(report, opts.format);
|
|
423
|
+
if (paths.includes(STDIN)) {
|
|
424
|
+
if (report.stdinDocument !== void 0) {
|
|
425
|
+
process.stdout.write(report.stdinDocument);
|
|
426
|
+
}
|
|
427
|
+
if (rendered.length > 0) process.stderr.write(`${rendered}
|
|
428
|
+
`);
|
|
429
|
+
} else {
|
|
430
|
+
console.log(rendered);
|
|
431
|
+
}
|
|
432
|
+
process.exitCode = report.exitCode;
|
|
433
|
+
} catch (e) {
|
|
434
|
+
fail(e);
|
|
435
|
+
}
|
|
436
|
+
});
|
|
437
|
+
program.command("query").description(
|
|
438
|
+
"Match triple patterns against the built graph (omit a term for wildcard)"
|
|
439
|
+
).option("--subject <term>", "Subject IRI or prefixed name").option("--predicate <term>", "Predicate IRI or prefixed name").option("--object <term>", "Object IRI, prefixed name, or literal value").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(
|
|
440
|
+
"-f, --format <format>",
|
|
441
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
442
|
+
formatOption,
|
|
443
|
+
"pretty"
|
|
444
|
+
).action(
|
|
445
|
+
(opts) => {
|
|
446
|
+
try {
|
|
447
|
+
const { subject, predicate, object, ...others } = rest(opts);
|
|
448
|
+
const result = runQuery({
|
|
449
|
+
...others,
|
|
450
|
+
...documentOptions(opts),
|
|
451
|
+
...subject === void 0 ? {} : { s: subject },
|
|
452
|
+
...predicate === void 0 ? {} : { p: predicate },
|
|
453
|
+
...object === void 0 ? {} : { o: object }
|
|
454
|
+
});
|
|
455
|
+
console.log(renderQuery(result, opts.format));
|
|
456
|
+
} catch (e) {
|
|
457
|
+
fail(e);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
);
|
|
461
|
+
program.command("stats").description(
|
|
462
|
+
"Summarize the built graph: counts, orphans, broken links, hubs, metadata coverage"
|
|
463
|
+
).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(
|
|
464
|
+
"-f, --format <format>",
|
|
465
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
466
|
+
formatOption,
|
|
467
|
+
"pretty"
|
|
468
|
+
).option(
|
|
469
|
+
"--check",
|
|
470
|
+
"Exit 1 when broken internal links exist or coverage is below threshold"
|
|
471
|
+
).option(
|
|
472
|
+
"--top <n>",
|
|
473
|
+
"How many most-connected docs to list",
|
|
474
|
+
countOption("--top")
|
|
475
|
+
).option(
|
|
476
|
+
"--coverage-threshold <pct>",
|
|
477
|
+
"Minimum metadata coverage % (all fields); overrides config for this run",
|
|
478
|
+
// A percentage, so 0..100 rather than the 0..1 of a confidence. NaN here is
|
|
479
|
+
// worse than a wrong number: `pct < NaN` is false for every field, so the
|
|
480
|
+
// gate this flag exists to tighten would silently pass instead.
|
|
481
|
+
numericOption("--coverage-threshold", { min: 0, max: 100 })
|
|
482
|
+
).action(
|
|
483
|
+
(opts) => {
|
|
484
|
+
try {
|
|
485
|
+
const report = runStats({ ...rest(opts), ...documentOptions(opts) });
|
|
486
|
+
console.log(renderStats(report, opts.format));
|
|
487
|
+
process.exitCode = report.exitCode;
|
|
488
|
+
} catch (e) {
|
|
489
|
+
fail(e);
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
);
|
|
493
|
+
program.command("search").description("Rank graph nodes for a text query (needs `export search`)").argument("<query>", "Text query").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(
|
|
494
|
+
"-i, --index <dir>",
|
|
495
|
+
"Directory holding the indexes and manifest (default: beside the graph)"
|
|
496
|
+
).option(
|
|
497
|
+
"--lang <tag>",
|
|
498
|
+
"Which localization to search (required when the corpus has more than one)"
|
|
499
|
+
).option("--limit <n>", "Maximum results (default 10)", countOption("--limit")).option(
|
|
500
|
+
"--vectors <path>",
|
|
501
|
+
"Vector sidecar path (default: from the manifest)"
|
|
502
|
+
).option(
|
|
503
|
+
"--mode <mode>",
|
|
504
|
+
`Which legs to run: ${SEARCH_MODES.join(" | ")} (default: hybrid when vectors exist)`,
|
|
505
|
+
choiceOption("--mode", SEARCH_MODES)
|
|
506
|
+
).option(
|
|
507
|
+
"-f, --format <format>",
|
|
508
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
509
|
+
formatOption,
|
|
510
|
+
"pretty"
|
|
511
|
+
).action(
|
|
512
|
+
async (query, opts) => {
|
|
513
|
+
try {
|
|
514
|
+
const report = await runSearch({
|
|
515
|
+
...rest(opts),
|
|
516
|
+
...documentOptions(opts),
|
|
517
|
+
query
|
|
518
|
+
});
|
|
519
|
+
console.log(renderSearch(report, opts.format));
|
|
520
|
+
} catch (e) {
|
|
521
|
+
fail(e);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
program.command("traverse").description(
|
|
526
|
+
"Walk the graph from a node, honoring scope rules, with the full trace"
|
|
527
|
+
).argument("<node>", "Starting node: a full IRI or a prefix:local CURIE").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(
|
|
528
|
+
"-d, --depth <n>",
|
|
529
|
+
"Maximum hops from the node (default 1; 3 under --impact)",
|
|
530
|
+
// Zero is allowed: it means the node itself, which is a real answer.
|
|
531
|
+
countOption("--depth", 0)
|
|
532
|
+
).option(
|
|
533
|
+
"--predicates <list>",
|
|
534
|
+
"Only follow these predicates (comma-separated)"
|
|
535
|
+
).option("--reverse", "Follow inbound edges (who points at this node)").option("--impact", "Transitive inbound reach: what a change here affects").option(
|
|
536
|
+
"--variant <variant>",
|
|
537
|
+
"Scope filter: product variant IRI, title, or slug"
|
|
538
|
+
).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(
|
|
539
|
+
"-f, --format <format>",
|
|
540
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
541
|
+
formatOption,
|
|
542
|
+
"pretty"
|
|
543
|
+
).action(
|
|
544
|
+
(node, opts) => {
|
|
545
|
+
try {
|
|
546
|
+
const { softwareSubject, ...others } = rest(opts);
|
|
547
|
+
const report = runTraverse({
|
|
548
|
+
...others,
|
|
549
|
+
...documentOptions(opts),
|
|
550
|
+
...softwareSubject === void 0 ? {} : { subject: softwareSubject },
|
|
551
|
+
node,
|
|
552
|
+
predicates: opts.predicates === void 0 ? void 0 : splitList(opts.predicates)
|
|
553
|
+
});
|
|
554
|
+
console.log(renderTraverse(report, opts.format));
|
|
555
|
+
} catch (e) {
|
|
556
|
+
fail(e);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
);
|
|
560
|
+
program.command("embed").description(
|
|
561
|
+
"Compute local embeddings for the search index (needs @huggingface/transformers)"
|
|
562
|
+
).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(
|
|
563
|
+
"-i, --index <dir>",
|
|
564
|
+
"Directory holding the indexes and manifest (default: beside the graph)"
|
|
565
|
+
).option(
|
|
566
|
+
"-o, --out <dir>",
|
|
567
|
+
"Directory for the sidecars (default: the index directory)"
|
|
568
|
+
).option(
|
|
569
|
+
"--embedding-model <id>",
|
|
570
|
+
"Embedding model id (any id; `mock` for offline runs)"
|
|
571
|
+
).option("--dtype <dtype>", "Weight quantization (default q8)").option("--no-cache", "Ignore the vector cache").option(
|
|
572
|
+
"-f, --format <format>",
|
|
573
|
+
`Output: ${GRAPH_FORMAT_LIST}`,
|
|
574
|
+
formatOption,
|
|
575
|
+
"pretty"
|
|
576
|
+
).action(
|
|
577
|
+
async (opts) => {
|
|
578
|
+
try {
|
|
579
|
+
const { embeddingModel, ...others } = rest(opts);
|
|
580
|
+
const report = await runEmbed({
|
|
581
|
+
...others,
|
|
582
|
+
...documentOptions(opts),
|
|
583
|
+
...embeddingModel === void 0 ? {} : { model: embeddingModel },
|
|
584
|
+
noCache: opts.cache === false
|
|
585
|
+
});
|
|
586
|
+
console.log(renderEmbed(report, opts.format));
|
|
587
|
+
} catch (e) {
|
|
588
|
+
fail(e);
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
);
|
|
592
|
+
program.command("export").description(
|
|
593
|
+
"Reserialize the built graph into a consumer format (jsonld file, iirds package, or search index)"
|
|
594
|
+
).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(
|
|
595
|
+
"-o, --out <path>",
|
|
596
|
+
"Output path (default: the graph path with the target's extension)"
|
|
597
|
+
).action(
|
|
598
|
+
async (target, opts) => {
|
|
599
|
+
try {
|
|
600
|
+
if (!EXPORT_TARGETS.includes(target)) {
|
|
601
|
+
throw new GraphError(
|
|
602
|
+
`Unknown export target "${target}". Use ${EXPORT_TARGETS.join(" | ")}.`
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
const result = await runExport({
|
|
606
|
+
...documentOptions(opts),
|
|
607
|
+
graph: opts.graph,
|
|
608
|
+
format: target,
|
|
609
|
+
out: opts.out
|
|
610
|
+
});
|
|
611
|
+
for (const warning of result.warnings) warn(warning);
|
|
612
|
+
console.log(
|
|
613
|
+
`Wrote ${result.nodes} node${result.nodes === 1 ? "" : "s"} to ${result.outPath}`
|
|
614
|
+
);
|
|
615
|
+
} catch (e) {
|
|
616
|
+
fail(e);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
);
|
|
620
|
+
return program;
|
|
621
|
+
}
|
|
622
|
+
export {
|
|
623
|
+
buildProgram,
|
|
624
|
+
colorFor
|
|
625
|
+
};
|
|
626
|
+
//# sourceMappingURL=cli-RPM5PELX.js.map
|