@hawkeyexl/manni 4.3.1 → 4.4.0
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-DFRCLY77.js +36 -0
- package/dist/build-Q5C6SX5J.js +31 -0
- package/dist/calibrate-XQILKXS3.js +31 -0
- package/dist/capture-JQMOC3BW.js +32 -0
- package/dist/check-HYNGXYJV.js +18 -0
- package/dist/check-HYNGXYJV.js.map +1 -0
- package/dist/check-NFZQLJKN.js +27 -0
- package/dist/check-NFZQLJKN.js.map +1 -0
- package/dist/check-U54XV6BP.js +40 -0
- package/dist/check-U54XV6BP.js.map +1 -0
- package/dist/chunk-252LNOEG.js +622 -0
- package/dist/chunk-252LNOEG.js.map +1 -0
- package/dist/chunk-2H7UOFLK.js +11 -0
- package/dist/chunk-2H7UOFLK.js.map +1 -0
- package/dist/chunk-2U3ORT6D.js +230 -0
- package/dist/chunk-2U3ORT6D.js.map +1 -0
- package/dist/chunk-3AFUD75K.js +23 -0
- package/dist/chunk-3AFUD75K.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-5KHIFVD2.js +1192 -0
- package/dist/chunk-5KHIFVD2.js.map +1 -0
- package/dist/chunk-5YXBLLAC.js +2165 -0
- package/dist/chunk-5YXBLLAC.js.map +1 -0
- package/dist/chunk-644JVKJ4.js +3872 -0
- package/dist/chunk-644JVKJ4.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-77HX34KD.js +1287 -0
- package/dist/chunk-77HX34KD.js.map +1 -0
- package/dist/{chunk-CFDUZRM2.js → chunk-7QMCHA4N.js} +32 -240
- package/dist/chunk-7QMCHA4N.js.map +1 -0
- package/dist/chunk-BUXDLRDT.js +455 -0
- package/dist/chunk-BUXDLRDT.js.map +1 -0
- package/dist/chunk-C6OH6CNF.js +388 -0
- package/dist/chunk-C6OH6CNF.js.map +1 -0
- package/dist/chunk-CK7SKVHR.js +1042 -0
- package/dist/chunk-CK7SKVHR.js.map +1 -0
- package/dist/chunk-CYWHFSRT.js +6737 -0
- package/dist/chunk-CYWHFSRT.js.map +1 -0
- package/dist/chunk-ERMSO34F.js +17 -0
- package/dist/chunk-ERMSO34F.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-G7NJSREW.js +979 -0
- package/dist/chunk-G7NJSREW.js.map +1 -0
- package/dist/chunk-GLP5PSXB.js +72 -0
- package/dist/chunk-GLP5PSXB.js.map +1 -0
- package/dist/chunk-H2DLH2JI.js +198 -0
- package/dist/chunk-H2DLH2JI.js.map +1 -0
- package/dist/chunk-H6FZ66XR.js +634 -0
- package/dist/chunk-H6FZ66XR.js.map +1 -0
- package/dist/{chunk-KJR7OVDX.js → chunk-IEQHSCZG.js} +56 -137
- package/dist/chunk-IEQHSCZG.js.map +1 -0
- package/dist/chunk-IKEWBMCN.js +98 -0
- package/dist/chunk-IKEWBMCN.js.map +1 -0
- package/dist/chunk-JOHKIAVH.js +5440 -0
- package/dist/chunk-JOHKIAVH.js.map +1 -0
- package/dist/chunk-JVTNMVYU.js +10921 -0
- package/dist/chunk-JVTNMVYU.js.map +1 -0
- package/dist/chunk-K3D6FPV6.js +164 -0
- package/dist/chunk-K3D6FPV6.js.map +1 -0
- package/dist/{chunk-UBMMXS2Y.js → chunk-KCGV52AM.js} +69 -48
- package/dist/{chunk-UBMMXS2Y.js.map → chunk-KCGV52AM.js.map} +1 -1
- package/dist/chunk-LAKAWRV5.js +1651 -0
- package/dist/chunk-LAKAWRV5.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-MNH7QO4Z.js +15 -0
- package/dist/chunk-MNH7QO4Z.js.map +1 -0
- package/dist/{chunk-HAPTXWU2.js → chunk-MYC3O5EJ.js} +4 -4
- 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-NWZ2SLYL.js +2957 -0
- package/dist/chunk-NWZ2SLYL.js.map +1 -0
- package/dist/chunk-OBFENF3U.js +934 -0
- package/dist/chunk-OBFENF3U.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-PCHZY2I7.js +299 -0
- package/dist/chunk-PCHZY2I7.js.map +1 -0
- package/dist/chunk-PHF3D7ER.js +1042 -0
- package/dist/chunk-PHF3D7ER.js.map +1 -0
- package/dist/chunk-Q35YIDBV.js +1202 -0
- package/dist/chunk-Q35YIDBV.js.map +1 -0
- package/dist/chunk-RLR4TKUZ.js +4398 -0
- package/dist/chunk-RLR4TKUZ.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-TIUTIOFB.js +25 -0
- package/dist/chunk-TIUTIOFB.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-UKZNLVJW.js +17 -0
- package/dist/chunk-UKZNLVJW.js.map +1 -0
- package/dist/chunk-UZC7LDAQ.js +178 -0
- package/dist/chunk-UZC7LDAQ.js.map +1 -0
- package/dist/chunk-V46OILVC.js +3090 -0
- package/dist/chunk-V46OILVC.js.map +1 -0
- package/dist/chunk-WQE54PNH.js +1975 -0
- package/dist/chunk-WQE54PNH.js.map +1 -0
- package/dist/chunk-X3BPBDGQ.js +52 -0
- package/dist/chunk-X3BPBDGQ.js.map +1 -0
- package/dist/chunk-XSLV76YK.js +54 -0
- package/dist/chunk-XSLV76YK.js.map +1 -0
- package/dist/{chunk-5HNHEUD5.js → chunk-XYLUCIKQ.js} +3 -3
- package/dist/chunk-YEUYKR62.js +72 -0
- package/dist/chunk-YEUYKR62.js.map +1 -0
- package/dist/{chunk-G5CM2VGQ.js → chunk-YFQBFNQS.js} +8 -94
- package/dist/chunk-YFQBFNQS.js.map +1 -0
- package/dist/chunk-YIL4XLLJ.js +1661 -0
- package/dist/chunk-YIL4XLLJ.js.map +1 -0
- package/dist/chunk-YNHZHSSM.js +41 -0
- package/dist/chunk-YNHZHSSM.js.map +1 -0
- package/dist/chunk-YTCZRLTU.js +96 -0
- package/dist/chunk-YTCZRLTU.js.map +1 -0
- package/dist/chunk-YYBFZLAJ.js +374 -0
- package/dist/chunk-YYBFZLAJ.js.map +1 -0
- package/dist/chunk-ZXRAE55H.js +31 -0
- package/dist/chunk-ZXRAE55H.js.map +1 -0
- package/dist/cli-2QPR2OZG.js +232 -0
- package/dist/cli-2QPR2OZG.js.map +1 -0
- package/dist/cli-4IOPGZHR.js +1203 -0
- package/dist/cli-4IOPGZHR.js.map +1 -0
- package/dist/cli-5FL73WHA.js +346 -0
- package/dist/cli-5FL73WHA.js.map +1 -0
- package/dist/cli-C262QOWM.js +739 -0
- package/dist/cli-C262QOWM.js.map +1 -0
- package/dist/cli-LJLLIQB2.js +423 -0
- package/dist/cli-LJLLIQB2.js.map +1 -0
- package/dist/cli-OFPZ5MAS.js +626 -0
- package/dist/cli-OFPZ5MAS.js.map +1 -0
- package/dist/cli-SHSMSRQY.js +28 -0
- package/dist/cli-SHSMSRQY.js.map +1 -0
- package/dist/cli-SRHFUZHA.js +473 -0
- package/dist/cli-SRHFUZHA.js.map +1 -0
- package/dist/cli-URZQXL4K.js +552 -0
- package/dist/cli-URZQXL4K.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-FE6KCNYJ.js +27 -0
- package/dist/github-FE6KCNYJ.js.map +1 -0
- package/dist/github-QXL3VMK2.js +32 -0
- package/dist/github-QXL3VMK2.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-SGZ6ZRFD.js +35 -0
- package/dist/json-SGZ6ZRFD.js.map +1 -0
- package/dist/lint-DL4LJRAY.js +28 -0
- package/dist/lint-DL4LJRAY.js.map +1 -0
- package/dist/list-6BAXTZUM.js +29 -0
- package/dist/list-6BAXTZUM.js.map +1 -0
- package/dist/list-7BKNYPSB.js +31 -0
- package/dist/list-7BKNYPSB.js.map +1 -0
- package/dist/page-3U2GCFNE.js +41 -0
- package/dist/page-3U2GCFNE.js.map +1 -0
- package/dist/picker-3XF36MJF.js +14 -0
- package/dist/picker-3XF36MJF.js.map +1 -0
- package/dist/pretty-2H57QVTY.js +43 -0
- package/dist/pretty-2H57QVTY.js.map +1 -0
- package/dist/pretty-N6DO4OOL.js +37 -0
- package/dist/pretty-N6DO4OOL.js.map +1 -0
- package/dist/reporters-M6LJ2IYU.js +21 -0
- package/dist/reporters-M6LJ2IYU.js.map +1 -0
- package/dist/reporters-N6GHXSS7.js +42 -0
- package/dist/reporters-N6GHXSS7.js.map +1 -0
- package/dist/reporters-UCNEV7PH.js +71 -0
- package/dist/reporters-UCNEV7PH.js.map +1 -0
- package/dist/run-XZDAREJE.js +33 -0
- package/dist/run-XZDAREJE.js.map +1 -0
- package/dist/term-5ICGKPC3.js +1592 -0
- package/dist/term-5ICGKPC3.js.map +1 -0
- package/dist/types-Y6TXHM7M.js +10 -0
- package/dist/types-Y6TXHM7M.js.map +1 -0
- package/dist/validate-GQRM77YN.js +16 -0
- package/dist/validate-GQRM77YN.js.map +1 -0
- package/package.json +1 -1
- package/plugin/manni/.claude-plugin/plugin.json +9 -0
- package/plugin/manni/hooks/hooks.json +52 -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-DFRCLY77.js.map} +0 -0
- /package/dist/{calibrate-S5K6QHUY.js.map → build-Q5C6SX5J.js.map} +0 -0
- /package/dist/{capture-OZEZDABQ.js.map → calibrate-XQILKXS3.js.map} +0 -0
- /package/dist/{picker-6HRMETE7.js.map → capture-JQMOC3BW.js.map} +0 -0
- /package/dist/{chunk-HAPTXWU2.js.map → chunk-MYC3O5EJ.js.map} +0 -0
- /package/dist/{chunk-5HNHEUD5.js.map → chunk-XYLUCIKQ.js.map} +0 -0
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
PROVIDERS_KEY,
|
|
4
|
+
assertKnownProvider,
|
|
5
|
+
findConfigFileSync,
|
|
6
|
+
parseCollections,
|
|
7
|
+
parseProviders,
|
|
8
|
+
readConfigFileSync
|
|
9
|
+
} from "./chunk-Q35YIDBV.js";
|
|
10
|
+
import {
|
|
11
|
+
ToolError,
|
|
12
|
+
errorMessage
|
|
13
|
+
} from "./chunk-G3T47CFV.js";
|
|
14
|
+
|
|
15
|
+
// src/graph/types.ts
|
|
16
|
+
var GraphError = class extends ToolError {
|
|
17
|
+
constructor(message) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "GraphError";
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/graph/core/iri.ts
|
|
24
|
+
import { slug as githubSlug } from "github-slugger";
|
|
25
|
+
var DEFAULT_BASE_IRI = "urn:manni:graph:";
|
|
26
|
+
function resolveBaseIri(base) {
|
|
27
|
+
if (!base) return DEFAULT_BASE_IRI;
|
|
28
|
+
if (base.endsWith("/") || base.endsWith(":")) return base;
|
|
29
|
+
return `${base}/`;
|
|
30
|
+
}
|
|
31
|
+
function normalizeDocPath(p) {
|
|
32
|
+
let out = p.replace(/\\/g, "/");
|
|
33
|
+
while (out.startsWith("./")) out = out.slice(2);
|
|
34
|
+
return out;
|
|
35
|
+
}
|
|
36
|
+
function encodeSegment(segment) {
|
|
37
|
+
return encodeURIComponent(segment).replace(
|
|
38
|
+
/[!'()*]/g,
|
|
39
|
+
(c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
var STDIN_PATH = "<stdin>";
|
|
43
|
+
function mintDocIri(base, relPath) {
|
|
44
|
+
if (relPath === STDIN_PATH) return `${base}stdin`;
|
|
45
|
+
const path = normalizeDocPath(relPath).split("/").map(encodeSegment).join("/");
|
|
46
|
+
return `${base}doc/${path}`;
|
|
47
|
+
}
|
|
48
|
+
function mintSectionIri(docIri, slugValue) {
|
|
49
|
+
return `${docIri}#${slugValue}`;
|
|
50
|
+
}
|
|
51
|
+
function conceptSlug(label) {
|
|
52
|
+
return githubSlug(label);
|
|
53
|
+
}
|
|
54
|
+
function mintConceptIri(base, label) {
|
|
55
|
+
return `${base}concept/${encodeSegment(conceptSlug(label))}`;
|
|
56
|
+
}
|
|
57
|
+
function mintProductIri(base, label) {
|
|
58
|
+
return `${base}product/${encodeSegment(conceptSlug(label))}`;
|
|
59
|
+
}
|
|
60
|
+
function mintSchemeIri(base) {
|
|
61
|
+
return `${base}scheme`;
|
|
62
|
+
}
|
|
63
|
+
function mintAgentIri(base, kind, name) {
|
|
64
|
+
return `${base}agent/${kind}/${encodeSegment(conceptSlug(name))}`;
|
|
65
|
+
}
|
|
66
|
+
function mintGraphIri(base) {
|
|
67
|
+
return `${base}graph`;
|
|
68
|
+
}
|
|
69
|
+
function mintBuildActivityIri(base) {
|
|
70
|
+
return `${base}activity/build`;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/graph/core/config.ts
|
|
74
|
+
import { dirname, resolve } from "node:path";
|
|
75
|
+
import { parse as parseYaml } from "yaml";
|
|
76
|
+
import { Ajv2020 } from "ajv/dist/2020.js";
|
|
77
|
+
|
|
78
|
+
// src/graph/core/config-schema.json
|
|
79
|
+
var config_schema_default = {
|
|
80
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
81
|
+
$id: "manni:graph:config",
|
|
82
|
+
title: "manni graph configuration",
|
|
83
|
+
type: "object",
|
|
84
|
+
additionalProperties: false,
|
|
85
|
+
properties: {
|
|
86
|
+
provider: {
|
|
87
|
+
type: "string",
|
|
88
|
+
minLength: 1,
|
|
89
|
+
description: "Which provider `manni graph fill` sends pages to: auto | anthropic | openai | claude-cli | llama-cpp. Unset, the family's top-level providers.provider decides, then auto, detected exactly as manni meta fill detects: an Anthropic key, then an OpenAI key, then the Claude CLI, then a local model. --provider wins over it, and --local overrides both. Connection settings live in the family's top-level providers: map."
|
|
90
|
+
},
|
|
91
|
+
model: {
|
|
92
|
+
type: "string",
|
|
93
|
+
minLength: 1,
|
|
94
|
+
description: "The model, within the provider named beside it. A model is carried only to the provider its own level names: a differing --provider or providers.provider takes its own default instead. With no provider here, it goes to whichever provider is in force, which must not be auto, because a model name does not say which provider owns it. Unset (the default) takes the provider's default model from the inference library; manni pins none. --model wins over it. This is not `embed.model`, which is a local embedding model id."
|
|
95
|
+
},
|
|
96
|
+
baseIri: {
|
|
97
|
+
type: "string",
|
|
98
|
+
minLength: 1
|
|
99
|
+
},
|
|
100
|
+
out: {
|
|
101
|
+
type: "string",
|
|
102
|
+
minLength: 1
|
|
103
|
+
},
|
|
104
|
+
routes: {
|
|
105
|
+
type: "array",
|
|
106
|
+
items: {
|
|
107
|
+
type: "object",
|
|
108
|
+
additionalProperties: false,
|
|
109
|
+
required: ["root"],
|
|
110
|
+
properties: {
|
|
111
|
+
basePath: {
|
|
112
|
+
type: "string"
|
|
113
|
+
},
|
|
114
|
+
root: {
|
|
115
|
+
type: "string"
|
|
116
|
+
},
|
|
117
|
+
extensions: {
|
|
118
|
+
type: "array",
|
|
119
|
+
items: {
|
|
120
|
+
type: "string",
|
|
121
|
+
pattern: "^\\."
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
language: {
|
|
125
|
+
type: "string",
|
|
126
|
+
pattern: "^[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*$"
|
|
127
|
+
},
|
|
128
|
+
indexFiles: {
|
|
129
|
+
type: "array",
|
|
130
|
+
items: {
|
|
131
|
+
type: "string",
|
|
132
|
+
minLength: 1
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
build: {
|
|
139
|
+
type: "object",
|
|
140
|
+
additionalProperties: false,
|
|
141
|
+
properties: {
|
|
142
|
+
derive: {
|
|
143
|
+
type: "array",
|
|
144
|
+
uniqueItems: true,
|
|
145
|
+
items: {
|
|
146
|
+
enum: [
|
|
147
|
+
"frontmatter",
|
|
148
|
+
"sections",
|
|
149
|
+
"links",
|
|
150
|
+
"tags",
|
|
151
|
+
"images",
|
|
152
|
+
"code",
|
|
153
|
+
"provenance"
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
check: {
|
|
160
|
+
type: "object",
|
|
161
|
+
additionalProperties: false,
|
|
162
|
+
properties: {
|
|
163
|
+
shapes: {
|
|
164
|
+
type: "array",
|
|
165
|
+
items: {
|
|
166
|
+
type: "string",
|
|
167
|
+
minLength: 1
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
provenance: {
|
|
173
|
+
type: "object",
|
|
174
|
+
additionalProperties: false,
|
|
175
|
+
properties: {
|
|
176
|
+
qualified: {
|
|
177
|
+
type: "boolean"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
stats: {
|
|
182
|
+
type: "object",
|
|
183
|
+
additionalProperties: false,
|
|
184
|
+
properties: {
|
|
185
|
+
coverageThreshold: {
|
|
186
|
+
anyOf: [
|
|
187
|
+
{
|
|
188
|
+
type: "number",
|
|
189
|
+
minimum: 0,
|
|
190
|
+
maximum: 100
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
type: "object",
|
|
194
|
+
additionalProperties: false,
|
|
195
|
+
properties: {
|
|
196
|
+
title: {
|
|
197
|
+
type: "number",
|
|
198
|
+
minimum: 0,
|
|
199
|
+
maximum: 100
|
|
200
|
+
},
|
|
201
|
+
description: {
|
|
202
|
+
type: "number",
|
|
203
|
+
minimum: 0,
|
|
204
|
+
maximum: 100
|
|
205
|
+
},
|
|
206
|
+
creator: {
|
|
207
|
+
type: "number",
|
|
208
|
+
minimum: 0,
|
|
209
|
+
maximum: 100
|
|
210
|
+
},
|
|
211
|
+
created: {
|
|
212
|
+
type: "number",
|
|
213
|
+
minimum: 0,
|
|
214
|
+
maximum: 100
|
|
215
|
+
},
|
|
216
|
+
modified: {
|
|
217
|
+
type: "number",
|
|
218
|
+
minimum: 0,
|
|
219
|
+
maximum: 100
|
|
220
|
+
},
|
|
221
|
+
subject: {
|
|
222
|
+
type: "number",
|
|
223
|
+
minimum: 0,
|
|
224
|
+
maximum: 100
|
|
225
|
+
},
|
|
226
|
+
label: {
|
|
227
|
+
type: "number",
|
|
228
|
+
minimum: 0,
|
|
229
|
+
maximum: 100
|
|
230
|
+
},
|
|
231
|
+
language: {
|
|
232
|
+
type: "number",
|
|
233
|
+
minimum: 0,
|
|
234
|
+
maximum: 100
|
|
235
|
+
},
|
|
236
|
+
type: {
|
|
237
|
+
type: "number",
|
|
238
|
+
minimum: 0,
|
|
239
|
+
maximum: 100
|
|
240
|
+
},
|
|
241
|
+
"applies-to": {
|
|
242
|
+
type: "number",
|
|
243
|
+
minimum: 0,
|
|
244
|
+
maximum: 100
|
|
245
|
+
},
|
|
246
|
+
"about-product-lifecycle": {
|
|
247
|
+
type: "number",
|
|
248
|
+
minimum: 0,
|
|
249
|
+
maximum: 100
|
|
250
|
+
},
|
|
251
|
+
"about-product-aspect": {
|
|
252
|
+
type: "number",
|
|
253
|
+
minimum: 0,
|
|
254
|
+
maximum: 100
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
]
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
fill: {
|
|
263
|
+
type: "object",
|
|
264
|
+
additionalProperties: false,
|
|
265
|
+
properties: {
|
|
266
|
+
temperature: {
|
|
267
|
+
type: "number",
|
|
268
|
+
minimum: 0,
|
|
269
|
+
maximum: 2
|
|
270
|
+
},
|
|
271
|
+
maxTurns: {
|
|
272
|
+
type: ["integer", "null"],
|
|
273
|
+
minimum: 1,
|
|
274
|
+
description: "Stop after this many inference calls. One page is one turn, and a cached proposal spends none. Null (the default) is unbounded. Replaces the maxCostUsd ceiling, which read as zero for every model outside the library's price table \u2014 see graph ADR 01027 and docevals ADR 01019."
|
|
275
|
+
},
|
|
276
|
+
cacheDir: {
|
|
277
|
+
type: "string",
|
|
278
|
+
minLength: 1
|
|
279
|
+
},
|
|
280
|
+
confidenceThreshold: {
|
|
281
|
+
type: "number",
|
|
282
|
+
minimum: 0,
|
|
283
|
+
maximum: 1,
|
|
284
|
+
description: "Minimum model self-confidence (0..1) to write a proposed field; below it the field is reported and not written. Default 0.7. `--confidence` wins over it."
|
|
285
|
+
},
|
|
286
|
+
writeProvenance: {
|
|
287
|
+
type: "boolean"
|
|
288
|
+
},
|
|
289
|
+
validateGraph: {
|
|
290
|
+
type: "boolean"
|
|
291
|
+
},
|
|
292
|
+
fields: {
|
|
293
|
+
type: "array",
|
|
294
|
+
uniqueItems: true,
|
|
295
|
+
items: {
|
|
296
|
+
enum: [
|
|
297
|
+
"label",
|
|
298
|
+
"alt-labels",
|
|
299
|
+
"broader",
|
|
300
|
+
"narrower",
|
|
301
|
+
"related-concepts",
|
|
302
|
+
"concepts",
|
|
303
|
+
"type",
|
|
304
|
+
"applies-to",
|
|
305
|
+
"about-product-lifecycle",
|
|
306
|
+
"about-product-aspect",
|
|
307
|
+
"not-applicable-to",
|
|
308
|
+
"not-about-product-aspect"
|
|
309
|
+
]
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
sections: {
|
|
313
|
+
type: "boolean"
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
embed: {
|
|
318
|
+
type: "object",
|
|
319
|
+
additionalProperties: false,
|
|
320
|
+
properties: {
|
|
321
|
+
model: {
|
|
322
|
+
type: "string",
|
|
323
|
+
minLength: 1
|
|
324
|
+
},
|
|
325
|
+
dtype: {
|
|
326
|
+
type: "string",
|
|
327
|
+
minLength: 1
|
|
328
|
+
},
|
|
329
|
+
out: {
|
|
330
|
+
type: "string",
|
|
331
|
+
minLength: 1
|
|
332
|
+
},
|
|
333
|
+
cacheDir: {
|
|
334
|
+
type: "string",
|
|
335
|
+
minLength: 1
|
|
336
|
+
},
|
|
337
|
+
byLanguage: {
|
|
338
|
+
type: "object",
|
|
339
|
+
additionalProperties: false,
|
|
340
|
+
patternProperties: {
|
|
341
|
+
"^[A-Za-z]{2,3}(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*$": {
|
|
342
|
+
type: "object",
|
|
343
|
+
additionalProperties: false,
|
|
344
|
+
properties: {
|
|
345
|
+
model: {
|
|
346
|
+
type: "string",
|
|
347
|
+
minLength: 1
|
|
348
|
+
},
|
|
349
|
+
dtype: {
|
|
350
|
+
type: "string",
|
|
351
|
+
minLength: 1
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
export: {
|
|
360
|
+
type: "object",
|
|
361
|
+
additionalProperties: false,
|
|
362
|
+
properties: {
|
|
363
|
+
iirds: {
|
|
364
|
+
type: "object",
|
|
365
|
+
additionalProperties: false,
|
|
366
|
+
properties: {
|
|
367
|
+
title: {
|
|
368
|
+
type: "string",
|
|
369
|
+
minLength: 1
|
|
370
|
+
},
|
|
371
|
+
creator: {
|
|
372
|
+
type: "string",
|
|
373
|
+
minLength: 1
|
|
374
|
+
},
|
|
375
|
+
version: {
|
|
376
|
+
enum: ["1.2", "1.3"]
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
// src/graph/core/vocab.ts
|
|
386
|
+
var NS = {
|
|
387
|
+
dcterms: "http://purl.org/dc/terms/",
|
|
388
|
+
foaf: "http://xmlns.com/foaf/0.1/",
|
|
389
|
+
graph: "https://hawkeyexl.github.io/manni/graph/ns#",
|
|
390
|
+
iirds: "http://iirds.tekom.de/iirds#",
|
|
391
|
+
iirdsSft: "http://iirds.tekom.de/iirds/domain/software#",
|
|
392
|
+
prov: "http://www.w3.org/ns/prov#",
|
|
393
|
+
rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
394
|
+
schema: "https://schema.org/",
|
|
395
|
+
skos: "http://www.w3.org/2004/02/skos/core#",
|
|
396
|
+
xsd: "http://www.w3.org/2001/XMLSchema#"
|
|
397
|
+
};
|
|
398
|
+
var PREFIXES = Object.entries(NS).sort(([a], [b]) => a < b ? -1 : 1);
|
|
399
|
+
var RDF_TYPE = `${NS.rdf}type`;
|
|
400
|
+
var ROLE = {
|
|
401
|
+
author: `${NS.graph}authorRole`,
|
|
402
|
+
generator: `${NS.graph}generatorRole`,
|
|
403
|
+
tool: `${NS.graph}toolRole`
|
|
404
|
+
};
|
|
405
|
+
|
|
406
|
+
// src/graph/core/iirds.ts
|
|
407
|
+
var IIRDS_HAS_TOPIC_TYPE = `${NS.iirds}has-topic-type`;
|
|
408
|
+
var IIRDS_RELATES_TO_PRODUCT_VARIANT = `${NS.iirds}relates-to-product-variant`;
|
|
409
|
+
var IIRDS_RELATES_TO_LIFECYCLE_PHASE = `${NS.iirds}relates-to-product-lifecycle-phase`;
|
|
410
|
+
var IIRDS_HAS_SUBJECT = `${NS.iirds}has-subject`;
|
|
411
|
+
var IIRDS_PRODUCT_VARIANT = `${NS.iirds}ProductVariant`;
|
|
412
|
+
var IIRDS_PACKAGE = `${NS.iirds}Package`;
|
|
413
|
+
var IIRDS_IIRDS_VERSION = `${NS.iirds}iiRDSVersion`;
|
|
414
|
+
var IIRDS_TOPIC = `${NS.iirds}Topic`;
|
|
415
|
+
var IIRDS_IS_PART_OF_PACKAGE = `${NS.iirds}is-part-of-package`;
|
|
416
|
+
var IIRDS_HAS_RENDITION = `${NS.iirds}has-rendition`;
|
|
417
|
+
var IIRDS_RENDITION = `${NS.iirds}Rendition`;
|
|
418
|
+
var IIRDS_SOURCE = `${NS.iirds}source`;
|
|
419
|
+
var IIRDS_FORMAT = `${NS.iirds}format`;
|
|
420
|
+
var IIRDS_TITLE = `${NS.iirds}title`;
|
|
421
|
+
var IIRDS_LANGUAGE = `${NS.iirds}language`;
|
|
422
|
+
var IIRDS_PARTY = `${NS.iirds}Party`;
|
|
423
|
+
var IIRDS_HAS_PARTY_ROLE = `${NS.iirds}has-party-role`;
|
|
424
|
+
var IIRDS_CREATOR = `${NS.iirds}Creator`;
|
|
425
|
+
var IIRDS_RELATES_TO_PARTY = `${NS.iirds}relates-to-party`;
|
|
426
|
+
var IIRDS_RELATES_TO_VCARD = `${NS.iirds}relates-to-vcard`;
|
|
427
|
+
var VCARD_NS = "http://www.w3.org/2006/vcard/ns#";
|
|
428
|
+
var VCARD_ORGANIZATION = `${VCARD_NS}Organization`;
|
|
429
|
+
var VCARD_ORGANIZATION_NAME = `${VCARD_NS}organization-name`;
|
|
430
|
+
var GRAPH_NOT_APPLICABLE_TO_VARIANT = `${NS.graph}notApplicableToVariant`;
|
|
431
|
+
var GRAPH_NOT_SOFTWARE_SUBJECT = `${NS.graph}notSoftwareSubject`;
|
|
432
|
+
var PAGE_TYPE_TO_TOPIC_TYPE = {
|
|
433
|
+
"how-to": "task",
|
|
434
|
+
tutorial: "learning",
|
|
435
|
+
explanation: "concept",
|
|
436
|
+
reference: "reference",
|
|
437
|
+
troubleshooting: "troubleshooting"
|
|
438
|
+
};
|
|
439
|
+
var TOPIC_TYPE_IRIS = {
|
|
440
|
+
task: `${NS.iirds}GenericTask`,
|
|
441
|
+
concept: `${NS.iirds}GenericConcept`,
|
|
442
|
+
reference: `${NS.iirds}GenericReference`,
|
|
443
|
+
learning: `${NS.iirds}GenericLearning`,
|
|
444
|
+
troubleshooting: `${NS.iirds}GenericTroubleshooting`,
|
|
445
|
+
form: `${NS.iirds}GenericForm`
|
|
446
|
+
};
|
|
447
|
+
var SOFTWARE_LIFECYCLE_IRIS = {
|
|
448
|
+
administration: `${NS.iirdsSft}Administration`,
|
|
449
|
+
customization: `${NS.iirdsSft}Customization`,
|
|
450
|
+
update: `${NS.iirdsSft}Update`,
|
|
451
|
+
deployment: `${NS.iirdsSft}Deployment`,
|
|
452
|
+
integration: `${NS.iirdsSft}Integration`,
|
|
453
|
+
deinstallation: `${NS.iirdsSft}Deinstallation`
|
|
454
|
+
};
|
|
455
|
+
var SOFTWARE_SUBJECT_IRIS = {
|
|
456
|
+
architecture: `${NS.iirdsSft}Architecture`,
|
|
457
|
+
interface: `${NS.iirdsSft}Interface`,
|
|
458
|
+
"system-requirement": `${NS.iirdsSft}SystemRequirement`
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
// src/graph/core/coverage.ts
|
|
462
|
+
var COVERAGE_FIELDS = [
|
|
463
|
+
{ field: "title", iri: `${NS.dcterms}title` },
|
|
464
|
+
{ field: "description", iri: `${NS.dcterms}description` },
|
|
465
|
+
{ field: "creator", iri: `${NS.dcterms}creator` },
|
|
466
|
+
{ field: "created", iri: `${NS.dcterms}created` },
|
|
467
|
+
{ field: "modified", iri: `${NS.dcterms}modified` },
|
|
468
|
+
{ field: "subject", iri: `${NS.dcterms}subject` },
|
|
469
|
+
{ field: "label", iri: `${NS.foaf}primaryTopic` },
|
|
470
|
+
// Dropped by ADR 01011 as "near-universally 0% noise", which was true on the
|
|
471
|
+
// monolingual corpora it was measured against and false the moment language
|
|
472
|
+
// means something. Restored by ADR 01037, which made it a scope dimension:
|
|
473
|
+
// an unlabelled document in a translated corpus cannot be filtered, indexed
|
|
474
|
+
// per locale, or counted against the right audience.
|
|
475
|
+
{ field: "language", iri: `${NS.dcterms}language` },
|
|
476
|
+
// The iiRDS typing added in Phases 2–4. Coverage predates all of it, so the
|
|
477
|
+
// measure of "what a graph-side consumer can see" was silent about the
|
|
478
|
+
// vocabulary the project spent four phases adding (ADR 01029).
|
|
479
|
+
{ field: "type", iri: IIRDS_HAS_TOPIC_TYPE },
|
|
480
|
+
{ field: "applies-to", iri: IIRDS_RELATES_TO_PRODUCT_VARIANT },
|
|
481
|
+
{
|
|
482
|
+
field: "about-product-lifecycle",
|
|
483
|
+
iri: IIRDS_RELATES_TO_LIFECYCLE_PHASE
|
|
484
|
+
},
|
|
485
|
+
{ field: "about-product-aspect", iri: IIRDS_HAS_SUBJECT }
|
|
486
|
+
];
|
|
487
|
+
var SECTION_FIELD_NAMES = [
|
|
488
|
+
"type",
|
|
489
|
+
"applies-to",
|
|
490
|
+
"about-product-lifecycle",
|
|
491
|
+
"about-product-aspect",
|
|
492
|
+
"subject"
|
|
493
|
+
];
|
|
494
|
+
var SECTION_COVERAGE_FIELDS = SECTION_FIELD_NAMES.map((name) => {
|
|
495
|
+
const field = COVERAGE_FIELDS.find((f) => f.field === name);
|
|
496
|
+
if (field === void 0) {
|
|
497
|
+
throw new Error(
|
|
498
|
+
`SECTION_FIELD_NAMES names ${name}, which COVERAGE_FIELDS does not define`
|
|
499
|
+
);
|
|
500
|
+
}
|
|
501
|
+
return field;
|
|
502
|
+
});
|
|
503
|
+
var COVERAGE_FIELD_NAMES = COVERAGE_FIELDS.map(
|
|
504
|
+
(f) => f.field
|
|
505
|
+
);
|
|
506
|
+
|
|
507
|
+
// src/graph/embed/types.ts
|
|
508
|
+
var DEFAULT_PROFILE = {
|
|
509
|
+
id: "onnx-community/granite-embedding-small-english-r2-ONNX",
|
|
510
|
+
note: "Default. 384-d, 8192-token context so sections are never truncated; no prefixes."
|
|
511
|
+
};
|
|
512
|
+
var MODEL_PROFILES = [
|
|
513
|
+
DEFAULT_PROFILE,
|
|
514
|
+
{
|
|
515
|
+
id: "Xenova/gte-small",
|
|
516
|
+
note: "Lighter (~34 MB). 384-d, 512-token context; no prefixes."
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
id: "Xenova/bge-small-en-v1.5",
|
|
520
|
+
queryPrefix: "Represent this sentence for searching relevant passages: ",
|
|
521
|
+
note: "384-d. Needs a query prefix \u2014 applied automatically here, since omitting it degrades retrieval silently."
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
id: "Xenova/all-MiniLM-L6-v2",
|
|
525
|
+
note: "Smallest (~23 MB) but truncates at 256 wordpieces (~190 words), so long sections lose their tail."
|
|
526
|
+
}
|
|
527
|
+
];
|
|
528
|
+
var DEFAULT_MODEL = DEFAULT_PROFILE.id;
|
|
529
|
+
function profileFor(id) {
|
|
530
|
+
return MODEL_PROFILES.find((p) => p.id === id) ?? { id };
|
|
531
|
+
}
|
|
532
|
+
function withPrefix(profile, role, text) {
|
|
533
|
+
const prefix = role === "query" ? profile.queryPrefix : profile.passagePrefix;
|
|
534
|
+
return prefix ? `${prefix}${text}` : text;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
// src/graph/core/config.ts
|
|
538
|
+
var ALL_FILL_FIELDS = [
|
|
539
|
+
"label",
|
|
540
|
+
"alt-labels",
|
|
541
|
+
"broader",
|
|
542
|
+
"narrower",
|
|
543
|
+
"related-concepts",
|
|
544
|
+
"concepts",
|
|
545
|
+
"type",
|
|
546
|
+
"applies-to",
|
|
547
|
+
"about-product-lifecycle",
|
|
548
|
+
"about-product-aspect",
|
|
549
|
+
"not-applicable-to",
|
|
550
|
+
"not-about-product-aspect"
|
|
551
|
+
];
|
|
552
|
+
var DEFAULT_CONFIG_FILENAME = "manni.config.yaml";
|
|
553
|
+
var CONFIG_SECTION = "graph";
|
|
554
|
+
var COLLECTIONS_KEY = "collections";
|
|
555
|
+
var CONFIG_REF = "https://hawkeyexl.github.io/manni/meta/reference/configuration/";
|
|
556
|
+
var MOVED_KEYS = ["inputs", "exclude"];
|
|
557
|
+
var ALL_DERIVE_SOURCES = [
|
|
558
|
+
"frontmatter",
|
|
559
|
+
"sections",
|
|
560
|
+
"links",
|
|
561
|
+
"tags",
|
|
562
|
+
"images",
|
|
563
|
+
"code",
|
|
564
|
+
"provenance"
|
|
565
|
+
];
|
|
566
|
+
var DEFAULT_LINK_EXTENSIONS = [".md", ".mdx", ".markdown"];
|
|
567
|
+
var DEFAULT_INDEX_FILES = ["index", "README"];
|
|
568
|
+
function normalizeBasePath(basePath) {
|
|
569
|
+
let out = basePath.trim();
|
|
570
|
+
if (!out.startsWith("/")) out = `/${out}`;
|
|
571
|
+
out = out.replace(/\/+$/, "");
|
|
572
|
+
return out;
|
|
573
|
+
}
|
|
574
|
+
var ajv = new Ajv2020({ allErrors: true, allowUnionTypes: true });
|
|
575
|
+
var validateConfig = ajv.compile(config_schema_default);
|
|
576
|
+
function configErrorLine(e) {
|
|
577
|
+
const extra = e.keyword === "additionalProperties" ? e.params.additionalProperty : void 0;
|
|
578
|
+
const where = `/${CONFIG_SECTION}${e.instancePath}`;
|
|
579
|
+
return extra === void 0 ? ` ${where}: ${e.message ?? "is invalid"}` : ` ${where}: unknown key "${extra}"`;
|
|
580
|
+
}
|
|
581
|
+
function resolveCoverageThreshold(raw) {
|
|
582
|
+
if (raw == null) return {};
|
|
583
|
+
if (typeof raw === "number")
|
|
584
|
+
return Object.fromEntries(COVERAGE_FIELD_NAMES.map((f) => [f, raw]));
|
|
585
|
+
return { ...raw };
|
|
586
|
+
}
|
|
587
|
+
function parseConfig(text, configPath) {
|
|
588
|
+
let raw;
|
|
589
|
+
try {
|
|
590
|
+
raw = parseYaml(text);
|
|
591
|
+
} catch (e) {
|
|
592
|
+
throw new GraphError(
|
|
593
|
+
`Invalid YAML in ${configPath}: ${errorMessage(e)}`
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
if (raw == null) return parseConfigSection(null, configPath);
|
|
597
|
+
if (typeof raw !== "object" || Array.isArray(raw)) {
|
|
598
|
+
throw new GraphError(`Invalid config in ${configPath}: root must be an object`);
|
|
599
|
+
}
|
|
600
|
+
const doc = raw;
|
|
601
|
+
const wrapped = Object.hasOwn(doc, CONFIG_SECTION);
|
|
602
|
+
const toError = (message) => new GraphError(message);
|
|
603
|
+
const collections = Object.hasOwn(doc, COLLECTIONS_KEY) ? parseCollections(doc[COLLECTIONS_KEY], configPath, toError) : [];
|
|
604
|
+
const providers = Object.hasOwn(doc, PROVIDERS_KEY) ? parseProviders(
|
|
605
|
+
doc[PROVIDERS_KEY],
|
|
606
|
+
configPath,
|
|
607
|
+
dirname(resolve(configPath)),
|
|
608
|
+
toError
|
|
609
|
+
) : {};
|
|
610
|
+
return parseConfigSection(wrapped ? doc[CONFIG_SECTION] : doc, configPath, {
|
|
611
|
+
source: configPath,
|
|
612
|
+
collections,
|
|
613
|
+
providers
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
function parseConfigSection(raw, configPath, file = { source: configPath, collections: [] }) {
|
|
617
|
+
if (raw == null) raw = {};
|
|
618
|
+
if (typeof raw !== "object" || Array.isArray(raw)) {
|
|
619
|
+
throw new GraphError(
|
|
620
|
+
`Invalid config in ${configPath}: root must be an object`
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
for (const key of MOVED_KEYS) {
|
|
624
|
+
if (Object.hasOwn(raw, key)) {
|
|
625
|
+
throw new GraphError(
|
|
626
|
+
`${file.source}: "${key}" is no longer a graph key. Document sets are declared once for every tool, under a top-level collections: list. See ${CONFIG_REF}#${COLLECTIONS_KEY}`
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
if (!validateConfig(raw)) {
|
|
631
|
+
const details = (validateConfig.errors ?? []).map((e) => configErrorLine(e)).join("\n");
|
|
632
|
+
throw new GraphError(`Invalid config in ${configPath}:
|
|
633
|
+
${details}`);
|
|
634
|
+
}
|
|
635
|
+
const r = raw;
|
|
636
|
+
const abs = resolve(configPath);
|
|
637
|
+
const dir = dirname(abs);
|
|
638
|
+
const provider = r.provider ?? null;
|
|
639
|
+
if (provider !== null) {
|
|
640
|
+
assertKnownProvider(provider, (message) => new GraphError(message));
|
|
641
|
+
}
|
|
642
|
+
return {
|
|
643
|
+
collections: file.collections,
|
|
644
|
+
configSource: file.source,
|
|
645
|
+
provider,
|
|
646
|
+
model: r.model ?? null,
|
|
647
|
+
providers: file.providers ?? {},
|
|
648
|
+
baseIri: resolveBaseIri(r.baseIri),
|
|
649
|
+
out: r.out ?? "graph/graph.ttl",
|
|
650
|
+
routes: (r.routes ?? []).map((m) => ({
|
|
651
|
+
basePath: normalizeBasePath(m.basePath ?? "/"),
|
|
652
|
+
root: m.root.replace(/\\/g, "/").replace(/^\.\//, "").replace(/\/+$/, ""),
|
|
653
|
+
extensions: m.extensions ?? [...DEFAULT_LINK_EXTENSIONS],
|
|
654
|
+
indexFiles: m.indexFiles ?? [...DEFAULT_INDEX_FILES],
|
|
655
|
+
...m.language === void 0 ? {} : { language: m.language }
|
|
656
|
+
})),
|
|
657
|
+
build: {
|
|
658
|
+
derive: r.build?.derive ?? [...ALL_DERIVE_SOURCES]
|
|
659
|
+
},
|
|
660
|
+
check: {
|
|
661
|
+
// Empty means: use the shapes bundled with manni (see bundledShapesPath).
|
|
662
|
+
shapes: r.check?.shapes ?? []
|
|
663
|
+
},
|
|
664
|
+
provenance: {
|
|
665
|
+
qualified: r.provenance?.qualified ?? true
|
|
666
|
+
},
|
|
667
|
+
stats: {
|
|
668
|
+
coverageThreshold: resolveCoverageThreshold(r.stats?.coverageThreshold)
|
|
669
|
+
},
|
|
670
|
+
fill: {
|
|
671
|
+
temperature: r.fill?.temperature ?? 0,
|
|
672
|
+
maxTurns: r.fill?.maxTurns ?? null,
|
|
673
|
+
cacheDir: r.fill?.cacheDir ?? ".manni/graph/cache",
|
|
674
|
+
fields: r.fill?.fields ?? [...ALL_FILL_FIELDS],
|
|
675
|
+
confidenceThreshold: r.fill?.confidenceThreshold ?? 0.7,
|
|
676
|
+
writeProvenance: r.fill?.writeProvenance ?? true,
|
|
677
|
+
validateGraph: r.fill?.validateGraph ?? true,
|
|
678
|
+
sections: r.fill?.sections ?? false
|
|
679
|
+
},
|
|
680
|
+
embed: {
|
|
681
|
+
model: r.embed?.model ?? DEFAULT_MODEL,
|
|
682
|
+
dtype: r.embed?.dtype ?? "q8",
|
|
683
|
+
out: r.embed?.out,
|
|
684
|
+
cacheDir: r.embed?.cacheDir ?? ".manni/graph/embed-cache",
|
|
685
|
+
byLanguage: r.embed?.byLanguage ?? {}
|
|
686
|
+
},
|
|
687
|
+
export: {
|
|
688
|
+
iirds: {
|
|
689
|
+
title: r.export?.iirds?.title,
|
|
690
|
+
creator: r.export?.iirds?.creator,
|
|
691
|
+
version: r.export?.iirds?.version ?? "1.3"
|
|
692
|
+
}
|
|
693
|
+
},
|
|
694
|
+
configPath: abs,
|
|
695
|
+
configDir: dir
|
|
696
|
+
};
|
|
697
|
+
}
|
|
698
|
+
var CONFIG_FILE = {
|
|
699
|
+
section: CONFIG_SECTION,
|
|
700
|
+
// The tool was `dockg` before it joined the family (proposal 0051 §7), but
|
|
701
|
+
// it published no config file under that old name, so — like cite, a11y and
|
|
702
|
+
// docevals — there is no pre-family filename to read (proposal 0051 §2).
|
|
703
|
+
legacyNames: [],
|
|
704
|
+
toError: (message) => new GraphError(message)
|
|
705
|
+
};
|
|
706
|
+
function loadConfig(path, cwd = process.cwd()) {
|
|
707
|
+
const file = path ? readConfigFileSync(path, cwd, CONFIG_FILE) : findConfigFileSync(cwd, CONFIG_FILE);
|
|
708
|
+
if (file === null) return defaultConfig(cwd);
|
|
709
|
+
return parseConfigSection(file.value, file.path, {
|
|
710
|
+
source: file.source,
|
|
711
|
+
collections: file.collections,
|
|
712
|
+
...file.providers === void 0 ? {} : { providers: file.providers }
|
|
713
|
+
});
|
|
714
|
+
}
|
|
715
|
+
function defaultConfig(cwd = process.cwd()) {
|
|
716
|
+
return {
|
|
717
|
+
...parseConfigSection(null, resolve(cwd, DEFAULT_CONFIG_FILENAME)),
|
|
718
|
+
configSource: null
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function loadRunConfig(opts, cwd = process.cwd()) {
|
|
722
|
+
assertCollectionWithoutPaths(opts.collection, opts.paths);
|
|
723
|
+
return opts.noConfig ? defaultConfig(cwd) : loadConfig(opts.configPath, cwd);
|
|
724
|
+
}
|
|
725
|
+
function assertCollectionWithoutPaths(collection, paths) {
|
|
726
|
+
if ((collection ?? []).length > 0 && (paths ?? []).length > 0) {
|
|
727
|
+
throw new GraphError(
|
|
728
|
+
"--collection selects a configured collection; it cannot be combined with paths."
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// src/graph/core/sort.ts
|
|
734
|
+
function byCodeUnit(a, b) {
|
|
735
|
+
return a < b ? -1 : a > b ? 1 : 0;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
export {
|
|
739
|
+
GraphError,
|
|
740
|
+
resolveBaseIri,
|
|
741
|
+
normalizeDocPath,
|
|
742
|
+
encodeSegment,
|
|
743
|
+
STDIN_PATH,
|
|
744
|
+
mintDocIri,
|
|
745
|
+
mintSectionIri,
|
|
746
|
+
conceptSlug,
|
|
747
|
+
mintConceptIri,
|
|
748
|
+
mintProductIri,
|
|
749
|
+
mintSchemeIri,
|
|
750
|
+
mintAgentIri,
|
|
751
|
+
mintGraphIri,
|
|
752
|
+
mintBuildActivityIri,
|
|
753
|
+
NS,
|
|
754
|
+
PREFIXES,
|
|
755
|
+
RDF_TYPE,
|
|
756
|
+
ROLE,
|
|
757
|
+
IIRDS_HAS_TOPIC_TYPE,
|
|
758
|
+
IIRDS_RELATES_TO_PRODUCT_VARIANT,
|
|
759
|
+
IIRDS_RELATES_TO_LIFECYCLE_PHASE,
|
|
760
|
+
IIRDS_HAS_SUBJECT,
|
|
761
|
+
IIRDS_PRODUCT_VARIANT,
|
|
762
|
+
IIRDS_PACKAGE,
|
|
763
|
+
IIRDS_IIRDS_VERSION,
|
|
764
|
+
IIRDS_TOPIC,
|
|
765
|
+
IIRDS_IS_PART_OF_PACKAGE,
|
|
766
|
+
IIRDS_HAS_RENDITION,
|
|
767
|
+
IIRDS_RENDITION,
|
|
768
|
+
IIRDS_SOURCE,
|
|
769
|
+
IIRDS_FORMAT,
|
|
770
|
+
IIRDS_TITLE,
|
|
771
|
+
IIRDS_LANGUAGE,
|
|
772
|
+
IIRDS_PARTY,
|
|
773
|
+
IIRDS_HAS_PARTY_ROLE,
|
|
774
|
+
IIRDS_CREATOR,
|
|
775
|
+
IIRDS_RELATES_TO_PARTY,
|
|
776
|
+
IIRDS_RELATES_TO_VCARD,
|
|
777
|
+
VCARD_NS,
|
|
778
|
+
VCARD_ORGANIZATION,
|
|
779
|
+
VCARD_ORGANIZATION_NAME,
|
|
780
|
+
GRAPH_NOT_APPLICABLE_TO_VARIANT,
|
|
781
|
+
GRAPH_NOT_SOFTWARE_SUBJECT,
|
|
782
|
+
PAGE_TYPE_TO_TOPIC_TYPE,
|
|
783
|
+
TOPIC_TYPE_IRIS,
|
|
784
|
+
SOFTWARE_LIFECYCLE_IRIS,
|
|
785
|
+
SOFTWARE_SUBJECT_IRIS,
|
|
786
|
+
COVERAGE_FIELDS,
|
|
787
|
+
SECTION_COVERAGE_FIELDS,
|
|
788
|
+
COVERAGE_FIELD_NAMES,
|
|
789
|
+
MODEL_PROFILES,
|
|
790
|
+
DEFAULT_MODEL,
|
|
791
|
+
profileFor,
|
|
792
|
+
withPrefix,
|
|
793
|
+
ALL_FILL_FIELDS,
|
|
794
|
+
DEFAULT_CONFIG_FILENAME,
|
|
795
|
+
CONFIG_SECTION,
|
|
796
|
+
DEFAULT_LINK_EXTENSIONS,
|
|
797
|
+
DEFAULT_INDEX_FILES,
|
|
798
|
+
parseConfig,
|
|
799
|
+
loadConfig,
|
|
800
|
+
defaultConfig,
|
|
801
|
+
loadRunConfig,
|
|
802
|
+
assertCollectionWithoutPaths,
|
|
803
|
+
byCodeUnit
|
|
804
|
+
};
|
|
805
|
+
//# sourceMappingURL=chunk-M2JCK5F6.js.map
|