@tangle-network/agent-knowledge 17.1.9 → 18.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.
@@ -197,7 +197,8 @@ async function openSafeDirectoryTree(root, relativePath, create) {
197
197
  let currentHandle = await openDirectory(resolvedRoot);
198
198
  try {
199
199
  for (const part of normalized.split("/").filter(Boolean)) {
200
- const childPath = resolve(anchoredDirectoryPath(currentHandle, currentPath), part);
200
+ const anchoredParent = anchoredDirectoryPath(currentHandle, currentPath);
201
+ const childPath = resolve(anchoredParent, part);
201
202
  let childHandle;
202
203
  try {
203
204
  childHandle = await openDirectory(childPath);
@@ -234,7 +235,8 @@ async function openDirectory(path) {
234
235
  const entry = await lstat(path);
235
236
  if (entry.isSymbolicLink() || !entry.isDirectory()) throw new Error(`knowledge path has an unsafe directory: ${path}`);
236
237
  }
237
- const handle = await open(path, isKernelDescriptor ? constants.O_RDONLY | constants.O_DIRECTORY : DIRECTORY_FLAGS);
238
+ const flags = isKernelDescriptor ? constants.O_RDONLY | constants.O_DIRECTORY : DIRECTORY_FLAGS;
239
+ const handle = await open(path, flags);
238
240
  if (!(await handle.stat()).isDirectory()) {
239
241
  await handle.close();
240
242
  throw new Error(`knowledge path has an unsafe directory: ${path}`);
@@ -812,7 +814,7 @@ function fileMatches(file, hash, mode) {
812
814
  }
813
815
  //#endregion
814
816
  //#region src/mutation-lock.ts
815
- const DEFAULT_STALE_MS = 900 * 1e3;
817
+ const DEFAULT_STALE_MS = 9e5;
816
818
  const DEFAULT_READ_RETRIES = 100;
817
819
  const DEFAULT_READ_WAIT_MS = 25;
818
820
  let lockfileModule;
@@ -3207,7 +3209,7 @@ async function runCheckProcess(args, options) {
3207
3209
  env: options.env ?? {},
3208
3210
  envMode: "replace",
3209
3211
  timeoutMs: options.timeoutMs ?? 3e4,
3210
- maxOutputBytes: options.maxBufferBytes ?? 1024 * 1024,
3212
+ maxOutputBytes: options.maxBufferBytes ?? 1048576,
3211
3213
  signal: options.signal
3212
3214
  });
3213
3215
  return {
@@ -4074,4 +4076,4 @@ function explainKnowledgeTarget(index, target) {
4074
4076
  //#endregion
4075
4077
  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 };
4076
4078
 
4077
- //# sourceMappingURL=inspect-DrJnvx5Z.js.map
4079
+ //# sourceMappingURL=inspect-BVT9JWDL.js.map