@tangle-network/agent-knowledge 16.0.0 → 17.0.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/CHANGELOG.md +14 -0
- package/README.md +26 -1
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/{inspect-DV09hiGz.js → inspect-Dn7xCZLn.js} +5 -5
- package/dist/{inspect-DV09hiGz.js.map → inspect-Dn7xCZLn.js.map} +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/{memory-BxwOtvd7.js → memory-ce9n5O24.js} +34 -18
- package/dist/memory-ce9n5O24.js.map +1 -0
- package/docs/run-scoped-citations.md +8 -0
- package/package.json +3 -3
- package/dist/memory-BxwOtvd7.js.map +0 -1
|
@@ -3622,12 +3622,12 @@ function originatedPages(pages, origin = "here") {
|
|
|
3622
3622
|
}));
|
|
3623
3623
|
}
|
|
3624
3624
|
const RUN_LINEAGE_BASENAME = "lineage.json";
|
|
3625
|
-
/** Ancestry beyond this bound is invalid durable state. */
|
|
3626
|
-
const MAX_LINEAGE_HOPS = 64;
|
|
3627
3625
|
function createRunScopedStores(options) {
|
|
3628
3626
|
if (!options || typeof options !== "object") throw new TypeError("createRunScopedStores options are required");
|
|
3629
3627
|
if (typeof options.root !== "string" || options.root.trim().length === 0) throw new TypeError("createRunScopedStores root must be a non-empty string");
|
|
3630
3628
|
if (options.runStorePath !== void 0 && typeof options.runStorePath !== "function") throw new TypeError("createRunScopedStores runStorePath must be a function when present");
|
|
3629
|
+
const maxAncestors = options.maxAncestors;
|
|
3630
|
+
if (maxAncestors !== void 0 && (!Number.isSafeInteger(maxAncestors) || maxAncestors < 0)) throw new TypeError("createRunScopedStores maxAncestors must be a non-negative safe integer");
|
|
3631
3631
|
if (options.lineageAuthority !== void 0) validateLineageAuthority(options.lineageAuthority);
|
|
3632
3632
|
const pagesDirectory = normalizePagesDirectory(options.pagesDirectory);
|
|
3633
3633
|
const storePath = options.runStorePath ?? ((runId) => join(options.root, runId, "knowledge-base"));
|
|
@@ -3638,16 +3638,16 @@ function createRunScopedStores(options) {
|
|
|
3638
3638
|
const chain = [];
|
|
3639
3639
|
const seen = /* @__PURE__ */ new Set([runId]);
|
|
3640
3640
|
let current = runId;
|
|
3641
|
-
for (
|
|
3641
|
+
for (;;) {
|
|
3642
3642
|
const parent = await authority.parentOf(current);
|
|
3643
3643
|
if (parent === null) return chain;
|
|
3644
3644
|
assertRunId(parent, `parent of '${current}'`);
|
|
3645
3645
|
if (seen.has(parent)) throw new Error(`run lineage cycle: ${parent} is its own ancestor (via ${runId})`);
|
|
3646
|
+
if (maxAncestors !== void 0 && chain.length >= maxAncestors) throw new Error(`run lineage for '${runId}' exceeds caller maxAncestors=${maxAncestors}`);
|
|
3646
3647
|
seen.add(parent);
|
|
3647
3648
|
chain.push(parent);
|
|
3648
3649
|
current = parent;
|
|
3649
3650
|
}
|
|
3650
|
-
throw new Error(`run lineage for '${runId}' exceeds ${MAX_LINEAGE_HOPS} ancestors`);
|
|
3651
3651
|
};
|
|
3652
3652
|
return {
|
|
3653
3653
|
storePath(runId) {
|
|
@@ -4051,4 +4051,4 @@ function explainKnowledgeTarget(index, target) {
|
|
|
4051
4051
|
//#endregion
|
|
4052
4052
|
export { formatKnowledgeCitationReference as $, inspectPendingKnowledgeMutation as $t, addSourceText as A, writeJsonDurableWithinRoot as An, ResearchSourceVersionSchema as At, KB_STORE_DIR as B, claimId as Bt, gradeClaims as C, renameDurable as Cn, KnowledgePageSchema as Ct, buildKnowledgeIndex as D, writeFileDurable as Dn, ResearchClaimEvidenceSchema as Dt, verifyGradeableEvidence as E, withSafeDirectory as En, KnowledgeRelationSchema as Et, ClaimLedgerMigrationRequiredError as F, assertDeepQuestionIntegrity as Ft, KnowledgeCitationAuditError as G, materializeRegisteredClaimEvidence as Gt, assertClaimLedgerId as H, deepQuestionId as Ht, FileSystemKbStore as I, assertResearchClaimEvidenceIntegrity as It, assertKnowledgeCitationAudit as J, normalizeClaimText as Jt, KnowledgeCitationResolutionError as K, mergeClaimLedgers as Kt, KB_CLAIM_LEDGER_DIR as L, assertResearchClaimLedgerIntegrity as Lt, snapshotSourceTextInput as M, textSourceAdapter as Mn, SourceRecordSchema as Mt, sourceRegistryPath as N, KNOWLEDGE_EVENT_TYPES as Nt, writeKnowledgeIndex as O, writeFileDurableWithinRoot as On, ResearchClaimLedgerSchema as Ot, writeSourceRegistry as P, ClaimLedgerGoalConflictError as Pt, auditKnowledgeCitations as Q, acquireDurableFileLock as Qt, KB_EVENTS_PATH as R, assertTrackedClaimIntegrity as Rt, claimCheckKey as S, removeDurable as Sn, KnowledgePageInvalidationSchema as St, verdictFor as T, withSafeDescendant as Tn, KnowledgeRelationNodeSchema as Tt, buildKnowledgeGraph as U, emptyClaimLedger as Ut, MemoryKbStore as V, claimSourceHost as Vt, knowledgePageRelations as W, linkClaimContradictions as Wt, assertRunScopedCitationsResolved as X, formatFrontmatter as Xt, assertKnowledgeCitationsResolved as Y, researchSourceVersionKey as Yt, auditCurrentRunCitations as Z, parseFrontmatter as Zt, lintKnowledgeIndex as _, isMissingFile as _n, KnowledgeBaseCandidateSchema as _t, applyKnowledgeWriteBlocksFile as a, applyKnowledgeFileTransaction as an, SCAFFOLD_PAGE_BASENAMES as at, UncheckableClaimError as b, readRegularFileWithinRoot as bn, KnowledgeGraphNodeSchema as bt, KnowledgeDuplicateIntakeError as c, finishKnowledgeFileTransaction as cn, isScaffoldPath as ct, createFileRunLineageAuthority as d, rollbackKnowledgeFileTransaction as dn, loadKnowledgePages as dt, isKnowledgeMutationHeld as en, parseKnowledgeCitationReference as et, createRunScopedStores as f, DEFAULT_PAGES_DIRECTORY as fn, writeJson as ft, validateKnowledgeIndex as g, isKernelAnchoredPath as gn, DeepQuestionSchema as gt, normalizePageText as h, canonicalRelativeWithinRoot as hn, normalizeLinkTarget as ht, applyKnowledgeWriteBlocks as i, withKnowledgeRead as in, resolveRunScopedCitations as it, loadSourceRegistry as j, mediaTypeFor$1 as jn, SourceAnchorSchema as jt, addSourcePath as k, writeJsonDurable as kn, ResearchClaimRecordSchema as kt, assertKnowledgeWriteIntake as l, knowledgeFileTransactionPlanHash as ln, knowledgePageFromMarkdown as lt, detectNearDuplicatePages as m, canonicalPathsEqual as mn, extractWikilinks as mt, inspectKnowledgeIndex as n, runInKnowledgeMutationScope as nn, resolveKnowledgeCitations as nt, isSafeKnowledgePath as o, assertKnowledgeMutationPath as on, initKnowledgeBase as ot, originatedPages as p, normalizePagesDirectory as pn, WIKILINK_REGEX as pt, assertCurrentRunCitationsResolved as q, mergeTrackedClaims as qt, stringMetadata as r, withKnowledgeMutation as rn, resolveRunScopedCitation as rt, parseKnowledgeWriteBlocks as s, commitKnowledgeFileMutations as sn, isKnowledgePagePath as st, explainKnowledgeTarget as t, recoverPendingKnowledgeMutation as tn, resolveKnowledgeCitation as tt, RUN_LINEAGE_BASENAME as u, prepareKnowledgeFileTransaction as un, layoutFor as ut, CHECKABLE_RUNG_THRESHOLD as v, listRegularFilesWithinRoot as vn, KnowledgeEventSchema as vt, gradeFor as w, syncDirectory as wn, KnowledgeRelationGraphSchema as wt, assertGradeableEvidence as x, relativeWithinRoot as xn, KnowledgeIndexSchema as xt, DEADLINE_EXIT_CODE as y, readRegularFileNoFollow as yn, KnowledgeGraphEdgeSchema as yt, KB_INDEX_PATH as z, claimEvidenceId as zt };
|
|
4053
4053
|
|
|
4054
|
-
//# sourceMappingURL=inspect-
|
|
4054
|
+
//# sourceMappingURL=inspect-Dn7xCZLn.js.map
|