@tangle-network/agent-knowledge 22.0.1 → 22.0.2
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 +7 -0
- package/README.md +3 -3
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +316 -379
- package/dist/index.js.map +1 -1
- package/dist/{inspect-DBxyQSdt.js → inspect-rnlXAb4O.js} +25 -14
- package/dist/{inspect-DBxyQSdt.js.map → inspect-rnlXAb4O.js.map} +1 -1
- package/docs/architecture.md +17 -0
- package/docs/compatibility.md +5 -4
- package/package.json +6 -6
|
@@ -3950,25 +3950,36 @@ function extractSourceRefs(text) {
|
|
|
3950
3950
|
//#endregion
|
|
3951
3951
|
//#region src/validate.ts
|
|
3952
3952
|
function validateKnowledgeIndex(index, options = {}) {
|
|
3953
|
-
|
|
3953
|
+
return prepareKnowledgeValidation(index).validate(options);
|
|
3954
|
+
}
|
|
3955
|
+
/** One observation's lint/schema findings; strictness is a caller-owned policy. */
|
|
3956
|
+
function prepareKnowledgeValidation(index) {
|
|
3957
|
+
const lintFindings = lintKnowledgeIndex(index);
|
|
3958
|
+
const findings = [...lintFindings];
|
|
3954
3959
|
const parsed = KnowledgeIndexSchema.safeParse(index);
|
|
3955
3960
|
if (!parsed.success) findings.push({
|
|
3956
3961
|
type: "missing-frontmatter",
|
|
3957
3962
|
severity: "error",
|
|
3958
3963
|
message: parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ")
|
|
3959
3964
|
});
|
|
3960
|
-
if (options.strict) for (const page of index.pages) {
|
|
3961
|
-
if (isScaffoldPath(page.path)) continue;
|
|
3962
|
-
if (!page.frontmatter.id || !page.frontmatter.title) findings.push({
|
|
3963
|
-
type: "missing-frontmatter",
|
|
3964
|
-
severity: "error",
|
|
3965
|
-
page: page.path,
|
|
3966
|
-
message: "Strict mode requires id and title frontmatter."
|
|
3967
|
-
});
|
|
3968
|
-
}
|
|
3969
3965
|
return {
|
|
3970
|
-
|
|
3971
|
-
|
|
3966
|
+
lintFindings,
|
|
3967
|
+
validate(options = {}) {
|
|
3968
|
+
const result = [...findings];
|
|
3969
|
+
if (options.strict) for (const page of index.pages) {
|
|
3970
|
+
if (isScaffoldPath(page.path)) continue;
|
|
3971
|
+
if (!page.frontmatter.id || !page.frontmatter.title) result.push({
|
|
3972
|
+
type: "missing-frontmatter",
|
|
3973
|
+
severity: "error",
|
|
3974
|
+
page: page.path,
|
|
3975
|
+
message: "Strict mode requires id and title frontmatter."
|
|
3976
|
+
});
|
|
3977
|
+
}
|
|
3978
|
+
return {
|
|
3979
|
+
ok: !result.some((finding) => finding.severity === "error"),
|
|
3980
|
+
findings: result
|
|
3981
|
+
};
|
|
3982
|
+
}
|
|
3972
3983
|
};
|
|
3973
3984
|
}
|
|
3974
3985
|
//#endregion
|
|
@@ -4994,6 +5005,6 @@ function explainKnowledgeTarget(index, target) {
|
|
|
4994
5005
|
};
|
|
4995
5006
|
}
|
|
4996
5007
|
//#endregion
|
|
4997
|
-
export {
|
|
5008
|
+
export { loadSourceRegistry as $, mediaTypeFor$1 as $n, KNOWLEDGE_EVENT_TYPES as $t, validateKnowledgePage as A, finishKnowledgeFileTransaction as An, isScaffoldPath as At, CHECKABLE_RUNG_THRESHOLD as B, listRegularFilesWithinRoot as Bn, KnowledgeEventSchema as Bt, immutablePageDigest as C, runInKnowledgeMutationScope as Cn, resolveKnowledgeCitation as Ct, normalizeVisibilityArtifact as D, applyKnowledgeFileTransaction as Dn, SCAFFOLD_PAGE_BASENAMES as Dt, nonEmpty as E, withKnowledgeRead as En, resolveRunScopedCitations as Et, detectNearDuplicatePages as F, normalizePagesDirectory as Fn, WIKILINK_REGEX as Ft, gradeClaims as G, renameDurable as Gn, KnowledgePageSchema as Gt, UncheckableClaimError as H, readRegularFileWithinRoot as Hn, KnowledgeGraphNodeSchema as Ht, normalizePageText as I, canonicalPathsEqual as In, extractWikilinks as It, verifyGradeableEvidence as J, withSafeDirectory as Jn, ResearchClaimLedgerSchema as Jt, gradeFor as K, syncDirectory as Kn, KnowledgeRelationSchema as Kt, prepareKnowledgeValidation as L, canonicalRelativeWithinRoot as Ln, normalizeLinkTarget as Lt, verifyKnowledgeVisibilitySnapshot as M, prepareKnowledgeFileTransaction as Mn, layoutFor as Mt, visibilityIdentity as N, rollbackKnowledgeFileTransaction as Nn, loadKnowledgePages as Nt, normalizeVisibilityRef as O, assertKnowledgeMutationPath as On, initKnowledgeBase as Ot, visibilityIndexOf as P, DEFAULT_PAGES_DIRECTORY as Pn, writeJson as Pt, addSourceText as Q, writeJsonDurableWithinRoot as Qn, SourceRecordSchema as Qt, validateKnowledgeIndex as R, isKernelAnchoredPath as Rn, DeepQuestionSchema as Rt, encodeKnowledgeVisibilitySnapshot as S, recoverPendingKnowledgeMutation as Sn, parseKnowledgeCitationReference as St, knowledgeVisibilityArtifactRef as T, withKnowledgeMutationLabel as Tn, resolveRunScopedCitation as Tt, assertGradeableEvidence as U, relativeWithinRoot as Un, KnowledgeIndexSchema as Ut, DEADLINE_EXIT_CODE as V, readRegularFileNoFollow as Vn, KnowledgeGraphEdgeSchema as Vt, claimCheckKey as W, removeDurable as Wn, KnowledgePageInvalidationSchema as Wt, writeKnowledgeIndex as X, writeFileDurableWithinRoot as Xn, ResearchSourceVersionSchema as Xt, buildKnowledgeIndex as Y, writeFileDurable as Yn, ResearchClaimRecordSchema as Yt, addSourcePath as Z, writeJsonDurable as Zn, SourceAnchorSchema as Zt, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION as _, parseFrontmatter as _n, assertKnowledgeCitationsResolved as _t, applyKnowledgeWriteBlocksFile as a, claimEvidenceId as an, KB_CLAIM_LEDGER_DIR as at, decodeKnowledgeVisibilitySnapshot as b, isKnowledgeMutationHeld as bn, auditKnowledgeCitations as bt, KnowledgeDuplicateIntakeError as c, deepQuestionId as cn, KB_STORE_DIR as ct, createFileRunLineageAuthority as d, materializeRegisteredClaimEvidence as dn, buildKnowledgeGraph as dt, ClaimLedgerGoalConflictError as en, textSourceAdapter as er, snapshotSourceTextInput as et, createRunScopedStores as f, mergeClaimLedgers as fn, knowledgePageRelations as ft, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM as g, formatFrontmatter as gn, assertKnowledgeCitationAudit as gt, originatedPages as h, researchSourceVersionKey as hn, assertCurrentRunCitationsResolved as ht, applyKnowledgeWriteBlocks as i, assertTrackedClaimIntegrity as in, FileSystemKbStore as it, validateOrigin as j, knowledgeFileTransactionPlanHash as jn, knowledgePageFromMarkdown as jt, snapshotImmutableVisibility as k, commitKnowledgeFileMutations as kn, isKnowledgePagePath as kt, assertKnowledgeWriteIntake as l, emptyClaimLedger as ln, MemoryKbStore as lt, loadKnowledgeToolChain as m, normalizeClaimText as mn, KnowledgeCitationResolutionError as mt, inspectKnowledgeIndex as n, assertResearchClaimEvidenceIntegrity as nn, writeSourceRegistry as nt, isSafeKnowledgePath as o, claimId as on, KB_EVENTS_PATH as ot, isKnowledgeToolChain as p, mergeTrackedClaims as pn, KnowledgeCitationAuditError as pt, verdictFor as q, withSafeDescendant as qn, ResearchClaimEvidenceSchema as qt, stringMetadata as r, assertResearchClaimLedgerIntegrity as rn, ClaimLedgerMigrationRequiredError as rt, parseKnowledgeWriteBlocks as s, claimSourceHost as sn, KB_INDEX_PATH as st, explainKnowledgeTarget as t, assertDeepQuestionIntegrity as tn, sourceRegistryPath as tt, RUN_LINEAGE_BASENAME as u, linkClaimContradictions as un, assertClaimLedgerId as ut, assertSchemaVersion as v, acquireDurableFileLock as vn, assertRunScopedCitationsResolved as vt, knowledgePageDigest as w, withKnowledgeMutation as wn, resolveKnowledgeCitations as wt, digest as x, measureKnowledgeMutation as xn, formatKnowledgeCitationReference as xt, createKnowledgeVisibilitySnapshot as y, inspectPendingKnowledgeMutation as yn, auditCurrentRunCitations as yt, lintKnowledgeIndex as z, isMissingFile as zn, KnowledgeBaseCandidateSchema as zt };
|
|
4998
5009
|
|
|
4999
|
-
//# sourceMappingURL=inspect-
|
|
5010
|
+
//# sourceMappingURL=inspect-rnlXAb4O.js.map
|