@mfdaves/okf-mcp 0.9.1 → 0.12.0-rc.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/CHANGELOG.md +69 -0
- package/README.md +172 -17
- package/bin/okf-mcp.js +6 -1
- package/okf/okf-mcp/policies/authoring-safety.md +11 -1
- package/package.json +17 -5
- package/server.json +2 -2
- package/src/assets.js +165 -73
- package/src/authoring/candidates.js +391 -0
- package/src/authoring/git-preflight.js +225 -0
- package/src/authoring/git-publish.js +776 -0
- package/src/authoring/live.js +789 -0
- package/src/authoring/paths.js +112 -0
- package/src/authoring/policy-hook.js +221 -0
- package/src/authoring/proposal-policy.js +137 -0
- package/src/authoring/receipts.js +329 -0
- package/src/authoring/render.js +38 -0
- package/src/authoring/shared.js +75 -0
- package/src/authoring/staging.js +216 -0
- package/src/authoring.js +386 -287
- package/src/cache/files.js +147 -0
- package/src/cache/lock.js +201 -0
- package/src/cache/paths.js +197 -0
- package/src/cache/store.js +703 -0
- package/src/catalog-text.js +19 -0
- package/src/cli.js +184 -151
- package/src/computation.js +99 -61
- package/src/context/assemble.js +567 -0
- package/src/context/cli-options.js +88 -0
- package/src/context/score.js +234 -0
- package/src/context/sections.js +274 -0
- package/src/embed/interface.js +160 -0
- package/src/embed/openai.js +715 -0
- package/src/embed/prepare.js +182 -0
- package/src/embed/units.js +96 -0
- package/src/git-source.js +112 -52
- package/src/graph.js +95 -37
- package/src/http-server.js +36 -17
- package/src/index.js +15 -0
- package/src/indexer/assemble.js +566 -0
- package/src/indexer/build.js +290 -0
- package/src/indexer/cache.js +81 -0
- package/src/indexer/edges.js +430 -0
- package/src/indexer/index.js +44 -0
- package/src/indexer/paths.js +178 -0
- package/src/indexer/resolve.js +282 -0
- package/src/indexer/update.js +720 -0
- package/src/indexer.js +3 -1068
- package/src/live-authoring.js +4 -2329
- package/src/markdown.js +21 -16
- package/src/mcp/registry.js +328 -0
- package/src/mcp/resources.js +45 -0
- package/src/mcp/server.js +472 -0
- package/src/mcp/tools/catalog.js +244 -0
- package/src/mcp/tools/computation.js +83 -0
- package/src/mcp/tools/context.js +133 -0
- package/src/mcp/tools/graph.js +167 -0
- package/src/mcp/tools/live-authoring.js +316 -0
- package/src/mcp/tools/migration.js +86 -0
- package/src/mcp/tools/producers.js +79 -0
- package/src/mcp/tools/proposals.js +213 -0
- package/src/mcp/tools/provenance.js +87 -0
- package/src/mcp/tools/remote.js +79 -0
- package/src/mcp/tools/search.js +242 -0
- package/src/mcp-server.js +3 -1611
- package/src/migration.js +431 -253
- package/src/parser.js +245 -130
- package/src/plugins.js +71 -48
- package/src/policy/write-policy.js +713 -0
- package/src/producer-publisher.js +195 -77
- package/src/producers.js +265 -101
- package/src/project.js +277 -93
- package/src/remote.js +96 -61
- package/src/search/cli-options.js +107 -0
- package/src/search/confidence.js +61 -0
- package/src/search/dense.js +304 -0
- package/src/search/embedding-cli.js +57 -0
- package/src/search/embedding-config.js +217 -0
- package/src/search/fusion.js +249 -0
- package/src/search/hybrid.js +526 -0
- package/src/search/languages.js +200 -0
- package/src/search/lexical.js +695 -0
- package/src/search/query.js +620 -0
- package/src/search/stem/among.js +43 -0
- package/src/search/stem/base-stemmer.js +311 -0
- package/src/search/stem/en-regions.js +456 -0
- package/src/search/stem/en-suffixes.js +664 -0
- package/src/search/stem/en-tables.js +176 -0
- package/src/search/stem/en.js +238 -0
- package/src/search/stem/it-regions.js +459 -0
- package/src/search/stem/it-suffixes.js +471 -0
- package/src/search/stem/it-tables.js +257 -0
- package/src/search/stem/it.js +155 -0
- package/src/search-index.js +2 -81
- package/src/search.js +2 -252
- package/src/store.js +134 -81
- package/src/v02.js +301 -105
- package/src/validation.js +24 -20
package/src/validation.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const CONFORMANCE_WARNING_CODES = new Set([
|
|
4
|
-
"missing_frontmatter",
|
|
5
|
-
"missing_type",
|
|
6
|
-
]);
|
|
3
|
+
const CONFORMANCE_WARNING_CODES = new Set(["missing_frontmatter", "missing_type"]);
|
|
7
4
|
|
|
8
5
|
const PROJECT_INVALID_WARNING_CODES = new Set([
|
|
9
6
|
"invalid_id",
|
|
@@ -29,12 +26,16 @@ function diagnosticKey(entry) {
|
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
function normalizeDiagnostic(entry, defaults) {
|
|
32
|
-
return Object.assign(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
return Object.assign(
|
|
30
|
+
{
|
|
31
|
+
code: "validation_diagnostic",
|
|
32
|
+
severity: "warning",
|
|
33
|
+
layer: "project",
|
|
34
|
+
message: "",
|
|
35
|
+
},
|
|
36
|
+
defaults || {},
|
|
37
|
+
entry || {},
|
|
38
|
+
);
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
function validateIndex(index, bundle) {
|
|
@@ -88,21 +89,21 @@ function validateIndex(index, bundle) {
|
|
|
88
89
|
add(entry, {
|
|
89
90
|
severity: "warning",
|
|
90
91
|
layer: "project",
|
|
91
|
-
invalidatesProject:
|
|
92
|
-
|
|
92
|
+
invalidatesProject:
|
|
93
|
+
PROJECT_INVALID_WARNING_CODES.has(entry.code) ||
|
|
94
|
+
(entry.code === "broken_link" && strictLinks),
|
|
93
95
|
});
|
|
94
96
|
});
|
|
95
97
|
|
|
96
|
-
const conformanceErrors = diagnostics.filter(
|
|
97
|
-
entry.layer === "conformance" && entry.severity === "error"
|
|
98
|
-
)
|
|
98
|
+
const conformanceErrors = diagnostics.filter(
|
|
99
|
+
(entry) => entry.layer === "conformance" && entry.severity === "error",
|
|
100
|
+
);
|
|
99
101
|
const projectDiagnostics = diagnostics.filter((entry) => entry.layer === "project");
|
|
100
102
|
const advisories = diagnostics.filter((entry) => entry.layer === "v0.2");
|
|
101
103
|
const computations = documents.filter((doc) => doc.signals && doc.signals.computation);
|
|
102
104
|
const conformant = conformanceErrors.length === 0;
|
|
103
|
-
const validForProject =
|
|
104
|
-
&& errors.length === 0
|
|
105
|
-
&& !diagnostics.some((entry) => entry.invalidatesProject);
|
|
105
|
+
const validForProject =
|
|
106
|
+
conformant && errors.length === 0 && !diagnostics.some((entry) => entry.invalidatesProject);
|
|
106
107
|
|
|
107
108
|
return {
|
|
108
109
|
conformant,
|
|
@@ -115,8 +116,11 @@ function validateIndex(index, bundle) {
|
|
|
115
116
|
advisories,
|
|
116
117
|
readiness: {
|
|
117
118
|
attestedComputations: computations.length,
|
|
118
|
-
attestationReady: computations.filter((doc) => doc.signals.computation.attestationReady)
|
|
119
|
-
|
|
119
|
+
attestationReady: computations.filter((doc) => doc.signals.computation.attestationReady)
|
|
120
|
+
.length,
|
|
121
|
+
attestationNotReady: computations
|
|
122
|
+
.filter((doc) => !doc.signals.computation.attestationReady)
|
|
123
|
+
.map((doc) => doc.uri),
|
|
120
124
|
},
|
|
121
125
|
errors,
|
|
122
126
|
warnings,
|