@tangle-network/agent-knowledge 8.0.9 → 10.6.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/AGENTS.md +14 -2
- package/CHANGELOG.md +99 -0
- package/README.md +127 -5
- package/dist/benchmarks/index.d.ts +1 -1
- package/dist/benchmarks/index.js +1 -1
- package/dist/{benchmarks-B_07vX0Q.js → benchmarks-B6fCb6AD.js} +2 -2
- package/dist/{benchmarks-B_07vX0Q.js.map → benchmarks-B6fCb6AD.js.map} +1 -1
- package/dist/cli.js +53 -21
- package/dist/cli.js.map +1 -1
- package/dist/{index-DypNCZtP.d.ts → index-DZeFm-BP.d.ts} +2 -2
- package/dist/{index-DypNCZtP.d.ts.map → index-DZeFm-BP.d.ts.map} +1 -1
- package/dist/{index-Ij4giqqj.d.ts → index-eDsIXWyM.d.ts} +3 -3
- package/dist/{index-Ij4giqqj.d.ts.map → index-eDsIXWyM.d.ts.map} +1 -1
- package/dist/index.d.ts +910 -290
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1009 -382
- package/dist/index.js.map +1 -1
- package/dist/{inspect-0tmv3xV8.js → inspect-DALsvG10.js} +680 -108
- package/dist/inspect-DALsvG10.js.map +1 -0
- package/dist/memory/index.d.ts +2 -2
- package/dist/memory/index.js +2 -2
- package/dist/{memory-BPgPIEhj.js → memory-BRGsy2QN.js} +2 -2
- package/dist/{memory-BPgPIEhj.js.map → memory-BRGsy2QN.js.map} +1 -1
- package/dist/search-Cw6eYfSd.js +258 -0
- package/dist/search-Cw6eYfSd.js.map +1 -0
- package/dist/{types-CTT16XnO.d.ts → types-m2QB86fF.d.ts} +17 -3
- package/dist/types-m2QB86fF.d.ts.map +1 -0
- package/dist/viz/index.d.ts +1 -1
- package/docs/architecture.md +1 -0
- package/docs/knowledge-use-receipts.md +50 -12
- package/package.json +3 -3
- package/dist/inspect-0tmv3xV8.js.map +0 -1
- package/dist/search-CtVJ0PKX.js +0 -132
- package/dist/search-CtVJ0PKX.js.map +0 -1
- package/dist/types-CTT16XnO.d.ts.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { $ as RetrievalConfig, A as KnowledgeBenchmarkResponder, At as AgentMemoryScope, B as KnowledgeMemoryEvent, Bt as RetrievalHoldoutSessionState, C as KnowledgeBenchmarkArtifact, Ct as createInMemoryBenchmarkAdapter, D as KnowledgeBenchmarkEvaluation, Dt as AgentMemoryContext, E as KnowledgeBenchmarkDistribution, Et as AgentMemoryBranchIsolation, F as KnowledgeBenchmarkSplit, Ft as RetrievalHoldoutCallContext, G as MemoryAdapterBenchmarkCandidate, H as KnowledgeRetrievalBenchmarkCase, I as KnowledgeBenchmarkTaskKind, It as RetrievalHoldoutConfig, J as RunKnowledgeBenchmarkSuiteResult, K as MemoryAdapterBenchmarkRankingRow, L as KnowledgeClaimMatcher, Lt as RetrievalHoldoutEligibleItem, M as KnowledgeBenchmarkSliceSummary, Mt as AgentMemoryWriteInput, N as KnowledgeBenchmarkSource, Nt as AgentMemoryWriteResult, O as KnowledgeBenchmarkFamily, Ot as AgentMemoryHit, P as KnowledgeBenchmarkSpec, Pt as RetrievalHoldoutBypassReason, Q as PartitionRetrievalScenariosOptions, R as KnowledgeMemoryBenchmarkCase, Rt as RetrievalHoldoutEvent, S as KnowledgeAnswerBenchmarkTaskKind, St as acquireAgentMemoryRunLease, T as KnowledgeBenchmarkCaseBase, Tt as AgentMemoryAdapter, U as KnowledgeRetrievalBenchmarkQrel, V as KnowledgeMemoryFactMatcher, W as KnowledgeRetrievalBenchmarkQuery, X as RunMemoryAdapterBenchmarkResult, Y as RunMemoryAdapterBenchmarkOptions, Z as BuildRetrievalEvalDispatchOptions, _ as buildIndustryRagBenchmarkSmokeCases, _t as scoreRetrievalArtifact, a as runKnowledgeBenchmarkSuite, at as RetrievalGoldTarget, b as BuildRetrievalBenchmarkCasesFromQrelsOptions, bt as AgentMemoryRunLease, c as buildRetrievalBenchmarkCasesFromQrels, ct as RetrievalRecallJudgeOptions, d as summarizeKnowledgeBenchmarkCampaign, dt as RetrievedSourceSpan, et as RetrievalEvalArtifact, f as runMemoryAdapterBenchmark, ft as buildRetrievalEvalDispatch, g as buildIndustryMemoryBenchmarkSmokeCases, gt as retrievalRecallJudge, h as buildFirstPartyMemoryLifecycleBenchmarkCases, ht as retrievalConfigSurface, i as renderKnowledgeBenchmarkReportMarkdown, it as RetrievalEvalScenario, j as KnowledgeBenchmarkScenario, jt as AgentMemorySearchOptions, k as KnowledgeBenchmarkReport, kt as AgentMemoryKind, l as parseKnowledgeBenchmarkJsonl, lt as RetrievalScenarioPartitions, m as INDUSTRY_RAG_BENCHMARKS, mt as retrievalConfigFromSurface, n as buildKnowledgeBenchmarkScenarios, nt as RetrievalEvalRetrieverInput, o as scoreKnowledgeBenchmarkArtifact, ot as RetrievalMetricSummary, p as INDUSTRY_MEMORY_BENCHMARKS, pt as partitionRetrievalScenarios, q as RunKnowledgeBenchmarkSuiteOptions, r as knowledgeBenchmarkJudge, rt as RetrievalEvalRetrieverResult, s as scoreMemoryBenchmarkArtifact, st as RetrievalMetricWeights, t as isKnowledgeMemoryBenchmarkCase, tt as RetrievalEvalRetriever, u as parseKnowledgeBenchmarkQrels, ut as RetrievedKnowledgeHit, v as respondToIndustryMemoryBenchmarkSmokeCase, vt as AgentMemoryAcquireRunLease, w as KnowledgeBenchmarkCase, wt as createNoopMemoryBenchmarkAdapter, x as KnowledgeAnswerBenchmarkCase, xt as OwnedAgentMemoryRunLease, y as respondToIndustryRagBenchmarkSmokeCase, yt as AgentMemoryControllerMode, z as KnowledgeMemoryBenchmarkTaskKind, zt as RetrievalHoldoutResult } from "./index-
|
|
3
|
-
import { $ as runAgentMemoryLearningExperiment, $t as jsonObjectCandidateCodec, A as AgentMemoryFinalPair, At as BuildAgentMemorySequencesFromBenchmarkCasesOptions, B as applySessionStickyRetrievalHoldout, Bt as AgentMemorySharingPolicy, C as runBoundedMemoryLifecycle, Ct as AgentMemorySequenceArtifact, D as AgentMemoryActivationDriver, Dt as AgentMemorySequenceStep, E as AgentMemoryActivation, Et as AgentMemorySequenceScenario, F as RunAgentMemoryImprovementResult, Ft as RunAgentMemoryLearningExperimentResult, G as toOffPolicyTrajectory, Gt as forkAgentMemoryBranchSnapshot, H as emitRetrievalHoldoutBypass, Ht as CreateAgentMemoryBranchOptions, I as RetrievalHoldoutOffPolicyOptions, It as AgentMemoryBranch, J as GraphitiToolNames, Jt as RunSerializedKnowledgeOptimizationOptions, K as GraphitiMcpClientLike, Kt as defaultGetMemoryContext, L as RetrievalHoldoutOffPolicyResult, Lt as AgentMemoryBranchLifetime, M as AgentMemoryPromotionDecision, Mt as RunAgentMemoryExperimentOptions, N as MemoryConfigScenario, Nt as RunAgentMemoryExperimentResult, O as AgentMemoryDimensionComparison, Ot as AgentMemoryTransferCellComparison, P as RunAgentMemoryImprovementOptions, Pt as RunAgentMemoryLearningExperimentOptions, Q as compareAgentMemoryLearning, Qt as jsonCandidateCodec, R as RetrievalHoldoutSessionSummary, Rt as AgentMemoryBranchSnapshot, S as resolveMemoryCleanupTimeoutMs, St as AgentMemorySequence, T as runAgentMemoryImprovement, Tt as AgentMemorySequenceProbeResult, U as resetRetrievalHoldoutRegistry, Ut as ForkAgentMemoryBranchSnapshotOptions, V as deterministicRng, Vt as AgentMemoryVisibility, W as retrievalHoldoutConfigHash, Wt as createAgentMemoryBranch, X as graphitiMemoryAdapterIdentity, Xt as SerializedCandidate, Y as createGraphitiMemoryAdapter, Yt as RunSerializedKnowledgeOptimizationResult, Z as runAgentMemoryExperiment, Zt as SerializedCandidateCodec, _ as AgentMemoryLifecycleTimeoutError, _t as AgentMemoryLearningArmOrder, a as AgentMemoryScopeSchema, at as AgentMemoryExecutionContext, b as createMemoryExecutionPool, bt as AgentMemoryLearningComparison, c as createNeo4jAgentMemoryAdapter, ct as AgentMemoryExecutionPaidCallInput, d as Mem0HostedMemoryAdapterOptions, dt as AgentMemoryExperimentCandidate, en as runSerializedKnowledgeOptimization, et as agentMemorySequenceJudge, f as Mem0MemoryAdapterOptions, ft as AgentMemoryExperimentCandidateRef, g as mem0MemoryAdapterIdentity, gt as AgentMemoryForgettingComparison, h as createMem0MemoryAdapter, ht as AgentMemoryExperimentRunLease, i as AgentMemoryKindSchema, it as AgentMemoryEvidenceRef, j as AgentMemoryImprovementRunLease, jt as CompareAgentMemoryLearningOptions, k as AgentMemoryFinalEvaluation, kt as AgentMemoryTransferStepSummary, l as Mem0ClientMode, lt as AgentMemoryExecutionPaidCallResult, m as Mem0OssMemoryAdapterOptions, mt as AgentMemoryExperimentRankingRow, n as memoryWriteResultToSourceRecord, nt as buildAgentMemorySequencesFromBenchmarkCases, o as AgentMemoryWriteInputSchema, ot as AgentMemoryExecutionCostMeter, p as Mem0OssClient, pt as AgentMemoryExperimentComparisonRef, q as GraphitiMemoryAdapterOptions, qt as renderMemoryContext, r as AgentMemoryHitSchema, rt as AgentMemoryAttemptEvent, s as Neo4jAgentMemoryAdapterOptions, st as AgentMemoryExecutionCostReceipt, t as memoryHitToSourceRecord, tn as scenarioContentFingerprint, tt as buildAgentMemorySequenceScenarios, u as Mem0HostedClient, ut as AgentMemoryExecutionStep, v as AgentMemoryLifecycleUnsafeError, vt as AgentMemoryLearningCandidateSummary, w as sleepForMemoryRecovery, wt as AgentMemorySequenceProbe, x as memoryRecoveryDelayMs, xt as AgentMemoryMode, y as DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, yt as AgentMemoryLearningCellComparison, z as applyRetrievalHoldout, zt as AgentMemoryJournalEntry } from "./index-
|
|
1
|
+
import { A as SourceAnchor, C as KnowledgeUnit, D as ResearchClaimLedger, E as ResearchClaimEvidence, M as SourceRegistry, N as TrackedClaim, O as ResearchClaimRecord, S as KnowledgeSearchResult, T as KnowledgeWriteParseResult, _ as KnowledgePolicy, a as KnowledgeBaseCandidate, b as KnowledgeRelationNode, c as KnowledgeEventType, d as KnowledgeGraphNode, f as KnowledgeId, g as KnowledgePageInvalidation, h as KnowledgePage, i as KNOWLEDGE_EVENT_TYPES, j as SourceRecord, k as ResearchSourceVersion, l as KnowledgeGraph, m as KnowledgeLintFinding, n as DeepQuestion, o as KnowledgeClaim, p as KnowledgeIndex, r as DeepQuestionKind, s as KnowledgeEvent, t as ClaimRef, u as KnowledgeGraphEdge, v as KnowledgeRelation, w as KnowledgeWriteBlock, x as KnowledgeRelease, y as KnowledgeRelationGraph } from "./types-m2QB86fF.js";
|
|
2
|
+
import { $ as RetrievalConfig, A as KnowledgeBenchmarkResponder, At as AgentMemoryScope, B as KnowledgeMemoryEvent, Bt as RetrievalHoldoutSessionState, C as KnowledgeBenchmarkArtifact, Ct as createInMemoryBenchmarkAdapter, D as KnowledgeBenchmarkEvaluation, Dt as AgentMemoryContext, E as KnowledgeBenchmarkDistribution, Et as AgentMemoryBranchIsolation, F as KnowledgeBenchmarkSplit, Ft as RetrievalHoldoutCallContext, G as MemoryAdapterBenchmarkCandidate, H as KnowledgeRetrievalBenchmarkCase, I as KnowledgeBenchmarkTaskKind, It as RetrievalHoldoutConfig, J as RunKnowledgeBenchmarkSuiteResult, K as MemoryAdapterBenchmarkRankingRow, L as KnowledgeClaimMatcher, Lt as RetrievalHoldoutEligibleItem, M as KnowledgeBenchmarkSliceSummary, Mt as AgentMemoryWriteInput, N as KnowledgeBenchmarkSource, Nt as AgentMemoryWriteResult, O as KnowledgeBenchmarkFamily, Ot as AgentMemoryHit, P as KnowledgeBenchmarkSpec, Pt as RetrievalHoldoutBypassReason, Q as PartitionRetrievalScenariosOptions, R as KnowledgeMemoryBenchmarkCase, Rt as RetrievalHoldoutEvent, S as KnowledgeAnswerBenchmarkTaskKind, St as acquireAgentMemoryRunLease, T as KnowledgeBenchmarkCaseBase, Tt as AgentMemoryAdapter, U as KnowledgeRetrievalBenchmarkQrel, V as KnowledgeMemoryFactMatcher, W as KnowledgeRetrievalBenchmarkQuery, X as RunMemoryAdapterBenchmarkResult, Y as RunMemoryAdapterBenchmarkOptions, Z as BuildRetrievalEvalDispatchOptions, _ as buildIndustryRagBenchmarkSmokeCases, _t as scoreRetrievalArtifact, a as runKnowledgeBenchmarkSuite, at as RetrievalGoldTarget, b as BuildRetrievalBenchmarkCasesFromQrelsOptions, bt as AgentMemoryRunLease, c as buildRetrievalBenchmarkCasesFromQrels, ct as RetrievalRecallJudgeOptions, d as summarizeKnowledgeBenchmarkCampaign, dt as RetrievedSourceSpan, et as RetrievalEvalArtifact, f as runMemoryAdapterBenchmark, ft as buildRetrievalEvalDispatch, g as buildIndustryMemoryBenchmarkSmokeCases, gt as retrievalRecallJudge, h as buildFirstPartyMemoryLifecycleBenchmarkCases, ht as retrievalConfigSurface, i as renderKnowledgeBenchmarkReportMarkdown, it as RetrievalEvalScenario, j as KnowledgeBenchmarkScenario, jt as AgentMemorySearchOptions, k as KnowledgeBenchmarkReport, kt as AgentMemoryKind, l as parseKnowledgeBenchmarkJsonl, lt as RetrievalScenarioPartitions, m as INDUSTRY_RAG_BENCHMARKS, mt as retrievalConfigFromSurface, n as buildKnowledgeBenchmarkScenarios, nt as RetrievalEvalRetrieverInput, o as scoreKnowledgeBenchmarkArtifact, ot as RetrievalMetricSummary, p as INDUSTRY_MEMORY_BENCHMARKS, pt as partitionRetrievalScenarios, q as RunKnowledgeBenchmarkSuiteOptions, r as knowledgeBenchmarkJudge, rt as RetrievalEvalRetrieverResult, s as scoreMemoryBenchmarkArtifact, st as RetrievalMetricWeights, t as isKnowledgeMemoryBenchmarkCase, tt as RetrievalEvalRetriever, u as parseKnowledgeBenchmarkQrels, ut as RetrievedKnowledgeHit, v as respondToIndustryMemoryBenchmarkSmokeCase, vt as AgentMemoryAcquireRunLease, w as KnowledgeBenchmarkCase, wt as createNoopMemoryBenchmarkAdapter, x as KnowledgeAnswerBenchmarkCase, xt as OwnedAgentMemoryRunLease, y as respondToIndustryRagBenchmarkSmokeCase, yt as AgentMemoryControllerMode, z as KnowledgeMemoryBenchmarkTaskKind, zt as RetrievalHoldoutResult } from "./index-DZeFm-BP.js";
|
|
3
|
+
import { $ as runAgentMemoryLearningExperiment, $t as jsonObjectCandidateCodec, A as AgentMemoryFinalPair, At as BuildAgentMemorySequencesFromBenchmarkCasesOptions, B as applySessionStickyRetrievalHoldout, Bt as AgentMemorySharingPolicy, C as runBoundedMemoryLifecycle, Ct as AgentMemorySequenceArtifact, D as AgentMemoryActivationDriver, Dt as AgentMemorySequenceStep, E as AgentMemoryActivation, Et as AgentMemorySequenceScenario, F as RunAgentMemoryImprovementResult, Ft as RunAgentMemoryLearningExperimentResult, G as toOffPolicyTrajectory, Gt as forkAgentMemoryBranchSnapshot, H as emitRetrievalHoldoutBypass, Ht as CreateAgentMemoryBranchOptions, I as RetrievalHoldoutOffPolicyOptions, It as AgentMemoryBranch, J as GraphitiToolNames, Jt as RunSerializedKnowledgeOptimizationOptions, K as GraphitiMcpClientLike, Kt as defaultGetMemoryContext, L as RetrievalHoldoutOffPolicyResult, Lt as AgentMemoryBranchLifetime, M as AgentMemoryPromotionDecision, Mt as RunAgentMemoryExperimentOptions, N as MemoryConfigScenario, Nt as RunAgentMemoryExperimentResult, O as AgentMemoryDimensionComparison, Ot as AgentMemoryTransferCellComparison, P as RunAgentMemoryImprovementOptions, Pt as RunAgentMemoryLearningExperimentOptions, Q as compareAgentMemoryLearning, Qt as jsonCandidateCodec, R as RetrievalHoldoutSessionSummary, Rt as AgentMemoryBranchSnapshot, S as resolveMemoryCleanupTimeoutMs, St as AgentMemorySequence, T as runAgentMemoryImprovement, Tt as AgentMemorySequenceProbeResult, U as resetRetrievalHoldoutRegistry, Ut as ForkAgentMemoryBranchSnapshotOptions, V as deterministicRng, Vt as AgentMemoryVisibility, W as retrievalHoldoutConfigHash, Wt as createAgentMemoryBranch, X as graphitiMemoryAdapterIdentity, Xt as SerializedCandidate, Y as createGraphitiMemoryAdapter, Yt as RunSerializedKnowledgeOptimizationResult, Z as runAgentMemoryExperiment, Zt as SerializedCandidateCodec, _ as AgentMemoryLifecycleTimeoutError, _t as AgentMemoryLearningArmOrder, a as AgentMemoryScopeSchema, at as AgentMemoryExecutionContext, b as createMemoryExecutionPool, bt as AgentMemoryLearningComparison, c as createNeo4jAgentMemoryAdapter, ct as AgentMemoryExecutionPaidCallInput, d as Mem0HostedMemoryAdapterOptions, dt as AgentMemoryExperimentCandidate, en as runSerializedKnowledgeOptimization, et as agentMemorySequenceJudge, f as Mem0MemoryAdapterOptions, ft as AgentMemoryExperimentCandidateRef, g as mem0MemoryAdapterIdentity, gt as AgentMemoryForgettingComparison, h as createMem0MemoryAdapter, ht as AgentMemoryExperimentRunLease, i as AgentMemoryKindSchema, it as AgentMemoryEvidenceRef, j as AgentMemoryImprovementRunLease, jt as CompareAgentMemoryLearningOptions, k as AgentMemoryFinalEvaluation, kt as AgentMemoryTransferStepSummary, l as Mem0ClientMode, lt as AgentMemoryExecutionPaidCallResult, m as Mem0OssMemoryAdapterOptions, mt as AgentMemoryExperimentRankingRow, n as memoryWriteResultToSourceRecord, nt as buildAgentMemorySequencesFromBenchmarkCases, o as AgentMemoryWriteInputSchema, ot as AgentMemoryExecutionCostMeter, p as Mem0OssClient, pt as AgentMemoryExperimentComparisonRef, q as GraphitiMemoryAdapterOptions, qt as renderMemoryContext, r as AgentMemoryHitSchema, rt as AgentMemoryAttemptEvent, s as Neo4jAgentMemoryAdapterOptions, st as AgentMemoryExecutionCostReceipt, t as memoryHitToSourceRecord, tn as scenarioContentFingerprint, tt as buildAgentMemorySequenceScenarios, u as Mem0HostedClient, ut as AgentMemoryExecutionStep, v as AgentMemoryLifecycleUnsafeError, vt as AgentMemoryLearningCandidateSummary, w as sleepForMemoryRecovery, wt as AgentMemorySequenceProbe, x as memoryRecoveryDelayMs, xt as AgentMemoryMode, y as DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, yt as AgentMemoryLearningCellComparison, z as applyRetrievalHoldout, zt as AgentMemoryJournalEntry } from "./index-eDsIXWyM.js";
|
|
4
4
|
import { CornellLiiSelector, CornellLiiSourceOptions, FetchOpts, FragmentProvenance, IRS_DIMENSION_HINTS, IrsPublicationsSourceOptions, KnowledgeFragment, KnowledgeSource, MAX_RESPONSE_BYTES, MIN_REQUEST_GAP_MS, POLITE_USER_AGENT, PoliteFetchOptions, PoliteFetchResult, StateSosEntity, StateSosSourceConfig, __resetHttpThrottle, createCornellLiiSource, createIrsPublicationsSource, createStateSosSource, extractLinks, firstMatch, htmlToText, innerHtmlById, looksLikeBlockPage, politeFetch } from "./sources/index.js";
|
|
5
|
-
import { AgentCandidateJsonValue, AgentCandidateKnowledgeRef, AgentImprovementActivation, AgentImprovementActivationResult, Sha256Digest } from "@tangle-network/agent-interface";
|
|
5
|
+
import { AgentCandidateJsonValue, AgentCandidateKnowledgeRef, AgentImprovementActivation, AgentImprovementActivationResult, Sha256Digest, ToolDefinition } from "@tangle-network/agent-interface";
|
|
6
6
|
import { AnalystFinding, AnalystSeverity, ControlEvalResult, ControlRuntimeConfig, DataAcquisitionPlan, DatasetScenario, GateDecision, KnowledgeAcquisitionMode, KnowledgeBundle, KnowledgeFreshness, KnowledgeImportance, KnowledgeReadinessReport, KnowledgeRequirement, KnowledgeRequirementCategory, KnowledgeSensitivity, ReleaseConfidenceScorecard, ReleaseTraceEvidence, RunRecord, UserQuestion } from "@tangle-network/agent-eval";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { ComparisonCost, DispatchContext, JudgeConfig, OptimizationMethod, Scenario } from "@tangle-network/agent-eval/campaign";
|
|
@@ -600,13 +600,362 @@ interface RunRagOptimizationResult extends RunSerializedKnowledgeOptimizationRes
|
|
|
600
600
|
/** Optimizes retrieval and answer behavior together as one serialized RAG configuration. */
|
|
601
601
|
declare function runRagOptimization(options: RunRagOptimizationOptions): Promise<RunRagOptimizationResult>;
|
|
602
602
|
//#endregion
|
|
603
|
+
//#region src/pages-directory.d.ts
|
|
604
|
+
/** Root-relative directory that holds Markdown pages when a caller names none. */
|
|
605
|
+
declare const DEFAULT_PAGES_DIRECTORY = "knowledge";
|
|
606
|
+
/**
|
|
607
|
+
* Selects the root-relative directory that holds Markdown pages.
|
|
608
|
+
*
|
|
609
|
+
* The same option drives the reader, the indexer, the search provider, the
|
|
610
|
+
* run-scoped chain, and the write protocol, so a store laid out as
|
|
611
|
+
* `kb/pages/<line>/` is read and written through one value.
|
|
612
|
+
*/
|
|
613
|
+
interface KnowledgePagesOptions {
|
|
614
|
+
/** Root-relative directory that holds Markdown pages. Defaults to `knowledge`. */
|
|
615
|
+
pagesDirectory?: string;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Validate a pages directory and return its canonical root-relative form.
|
|
619
|
+
*
|
|
620
|
+
* The result is a write allowlist prefix as well as a read location, so the
|
|
621
|
+
* check refuses every value that could reach outside the pages tree: absolute
|
|
622
|
+
* paths, drive letters, `..` or `.` segments, empty segments, control
|
|
623
|
+
* characters, and the package-owned `.agent-knowledge` and `raw` trees.
|
|
624
|
+
*/
|
|
625
|
+
declare function normalizePagesDirectory(value?: string): string;
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region src/store.d.ts
|
|
628
|
+
interface KnowledgeLayout {
|
|
629
|
+
root: string;
|
|
630
|
+
knowledgeDir: string;
|
|
631
|
+
rawSourcesDir: string;
|
|
632
|
+
sourceRegistryPath: string;
|
|
633
|
+
indexPath: string;
|
|
634
|
+
logPath: string;
|
|
635
|
+
cacheDir: string;
|
|
636
|
+
}
|
|
637
|
+
declare function layoutFor(root: string): KnowledgeLayout;
|
|
638
|
+
/**
|
|
639
|
+
* Filenames that `initKnowledgeBase` writes as human-navigation scaffolding.
|
|
640
|
+
* These are excluded from the page index — they exist on disk so authors can
|
|
641
|
+
* curate their vault, but they are not searchable content.
|
|
642
|
+
*
|
|
643
|
+
* Add new scaffold filenames here (and only here) to keep lint, validate, viz,
|
|
644
|
+
* and the indexer consistent.
|
|
645
|
+
*/
|
|
646
|
+
declare const SCAFFOLD_PAGE_BASENAMES: readonly string[];
|
|
647
|
+
/**
|
|
648
|
+
* True when a knowledge-relative path points at a scaffold file rather than
|
|
649
|
+
* authored content. Accepts both repo-relative paths (`knowledge/index.md`)
|
|
650
|
+
* and any nested `<dir>/index.md` or `<dir>/log.md` (for example
|
|
651
|
+
* `knowledge/concepts/index.md`) so subdirectory README-style scaffolds are
|
|
652
|
+
* also excluded.
|
|
653
|
+
*/
|
|
654
|
+
declare function isScaffoldPath(path: string): boolean;
|
|
655
|
+
declare function initKnowledgeBase(root: string): Promise<KnowledgeLayout>;
|
|
656
|
+
declare function loadKnowledgePages(root: string, options?: KnowledgePagesOptions): Promise<KnowledgePage[]>;
|
|
657
|
+
/** True when a root-relative path names authored Markdown rather than scaffolding. */
|
|
658
|
+
declare function isKnowledgePagePath(path: string): boolean;
|
|
659
|
+
/**
|
|
660
|
+
* Build a page from the bytes of one Markdown file.
|
|
661
|
+
*
|
|
662
|
+
* The reader and every gate that inspects a page before it is written share
|
|
663
|
+
* this constructor, so what a gate judges is exactly what the store loads back.
|
|
664
|
+
*/
|
|
665
|
+
declare function knowledgePageFromMarkdown(path: string, content: string, pagesDirectory?: string): KnowledgePage;
|
|
666
|
+
declare function writeJson(path: string, value: unknown): Promise<void>;
|
|
667
|
+
//#endregion
|
|
668
|
+
//#region src/run-scoped.d.ts
|
|
669
|
+
/** Where a page in a chained read came from. */
|
|
670
|
+
type PageOrigin = 'here' | `inherited:${string}` | 'shared';
|
|
671
|
+
interface OriginatedPage {
|
|
672
|
+
page: KnowledgePage;
|
|
673
|
+
origin: PageOrigin;
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Present plain pages as a visibility chain of one origin.
|
|
677
|
+
*
|
|
678
|
+
* A store read directly is the `here` origin of a chain with no ancestry, so
|
|
679
|
+
* the chain-shaped APIs — citation resolution, the write intake gate,
|
|
680
|
+
* invalidation propagation — take one page shape whether or not the caller
|
|
681
|
+
* runs run-scoped stores.
|
|
682
|
+
*/
|
|
683
|
+
declare function originatedPages(pages: readonly KnowledgePage[], origin?: PageOrigin): OriginatedPage[];
|
|
684
|
+
interface RunLineageRecord {
|
|
685
|
+
runId: string;
|
|
686
|
+
parentRunId: string | null;
|
|
687
|
+
createdAt: string;
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Durable authority for run ancestry.
|
|
691
|
+
*
|
|
692
|
+
* A product whose run manifest already owns lineage can supply an authority
|
|
693
|
+
* backed by that manifest. `record` is optional for read-only authorities; in
|
|
694
|
+
* that case `init` verifies that the existing authority agrees with the parent
|
|
695
|
+
* requested by the caller before creating any store files.
|
|
696
|
+
*/
|
|
697
|
+
interface RunLineageAuthority {
|
|
698
|
+
parentOf(runId: string): Promise<string | null>;
|
|
699
|
+
record?(record: RunLineageRecord): Promise<void>;
|
|
700
|
+
}
|
|
701
|
+
declare const RUN_LINEAGE_BASENAME = "lineage.json";
|
|
702
|
+
interface RunScopedStoresOptions extends KnowledgePagesOptions {
|
|
703
|
+
/** The root under which per-run stores live. */
|
|
704
|
+
root: string;
|
|
705
|
+
/** Store path for a run; defaults to `<root>/<runId>/knowledge-base`. */
|
|
706
|
+
runStorePath?: (runId: string) => string;
|
|
707
|
+
/**
|
|
708
|
+
* The curated store every run may read but no run writes. Searched last and
|
|
709
|
+
* labeled `shared`.
|
|
710
|
+
*/
|
|
711
|
+
sharedRoot?: string;
|
|
712
|
+
/** External owner for run ancestry. Defaults to a record inside each run store. */
|
|
713
|
+
lineageAuthority?: RunLineageAuthority;
|
|
714
|
+
}
|
|
715
|
+
interface RunScopedStores {
|
|
716
|
+
/** Create or open a run store and bind it to one exact parent identity. */
|
|
717
|
+
init(runId: string, options?: {
|
|
718
|
+
parentRunId?: string | null;
|
|
719
|
+
}): Promise<KnowledgeLayout>;
|
|
720
|
+
/**
|
|
721
|
+
* Where one run's store lives. A caller that must read a run's bytes rather
|
|
722
|
+
* than its parsed pages — promotion carries a page unchanged — needs the
|
|
723
|
+
* root the chain read hides.
|
|
724
|
+
*/
|
|
725
|
+
storePath(runId: string): string;
|
|
726
|
+
/** The ancestor chain of a run, nearest first. */
|
|
727
|
+
lineage(runId: string): Promise<string[]>;
|
|
728
|
+
/**
|
|
729
|
+
* Every page visible to a run: current, ancestors, then shared. A repeated
|
|
730
|
+
* page id is retained at every origin so citation resolution can report the
|
|
731
|
+
* ambiguity instead of silently shadowing one page.
|
|
732
|
+
*/
|
|
733
|
+
loadChain(runId: string): Promise<OriginatedPage[]>;
|
|
734
|
+
}
|
|
735
|
+
declare function createRunScopedStores(options: RunScopedStoresOptions): RunScopedStores;
|
|
736
|
+
/** File-backed authority used when the product has no separate run manifest. */
|
|
737
|
+
declare function createFileRunLineageAuthority(runStorePath: (runId: string) => string): RunLineageAuthority;
|
|
738
|
+
//#endregion
|
|
739
|
+
//#region src/citation-resolution.d.ts
|
|
740
|
+
/**
|
|
741
|
+
* A citation into the knowledge visible to one run.
|
|
742
|
+
*
|
|
743
|
+
* An unqualified reference is accepted only when exactly one visible page has
|
|
744
|
+
* the requested id. Callers can qualify a reference by origin when a current,
|
|
745
|
+
* inherited, or shared page intentionally reuses the same stable id.
|
|
746
|
+
*/
|
|
747
|
+
interface KnowledgeCitationReference {
|
|
748
|
+
readonly pageId: KnowledgeId;
|
|
749
|
+
readonly origin?: PageOrigin;
|
|
750
|
+
}
|
|
751
|
+
interface KnowledgeCitationCandidate {
|
|
752
|
+
readonly pageId: KnowledgeId;
|
|
753
|
+
readonly origin: PageOrigin;
|
|
754
|
+
readonly page: KnowledgePage;
|
|
755
|
+
}
|
|
756
|
+
type KnowledgeCitationResolutionStatus = 'resolved' | 'missing' | 'ambiguous';
|
|
757
|
+
interface KnowledgeCitationResolution {
|
|
758
|
+
readonly reference: KnowledgeCitationReference;
|
|
759
|
+
readonly status: KnowledgeCitationResolutionStatus;
|
|
760
|
+
readonly candidates: readonly KnowledgeCitationCandidate[];
|
|
761
|
+
readonly resolved?: KnowledgeCitationCandidate;
|
|
762
|
+
}
|
|
763
|
+
type KnowledgeCitationAuditIssueKind = 'self' | 'missing' | 'ambiguous';
|
|
764
|
+
interface KnowledgeCitationAuditIssue {
|
|
765
|
+
readonly kind: KnowledgeCitationAuditIssueKind;
|
|
766
|
+
readonly sourcePageId: KnowledgeId;
|
|
767
|
+
readonly sourcePath: string;
|
|
768
|
+
readonly sourceOrigin: PageOrigin;
|
|
769
|
+
readonly persistedCitation: string;
|
|
770
|
+
readonly reference: KnowledgeCitationReference;
|
|
771
|
+
readonly candidates: readonly KnowledgeCitationCandidate[];
|
|
772
|
+
}
|
|
773
|
+
interface KnowledgeCitationAuditReport {
|
|
774
|
+
readonly ok: boolean;
|
|
775
|
+
readonly checkedPages: number;
|
|
776
|
+
readonly checkedCitations: number;
|
|
777
|
+
readonly issues: readonly KnowledgeCitationAuditIssue[];
|
|
778
|
+
}
|
|
779
|
+
interface AuditKnowledgeCitationsOptions {
|
|
780
|
+
/** Limit audited source pages to these origins. All visible origins are checked by default. */
|
|
781
|
+
readonly sourceOrigins?: readonly PageOrigin[];
|
|
782
|
+
}
|
|
783
|
+
/** A batch contains at least one citation that is missing or ambiguous. */
|
|
784
|
+
declare class KnowledgeCitationResolutionError extends Error {
|
|
785
|
+
readonly resolutions: readonly KnowledgeCitationResolution[];
|
|
786
|
+
constructor(resolutions: readonly KnowledgeCitationResolution[]);
|
|
787
|
+
}
|
|
788
|
+
/** A persisted page contains a self, missing, or ambiguous citation. */
|
|
789
|
+
declare class KnowledgeCitationAuditError extends Error {
|
|
790
|
+
readonly report: KnowledgeCitationAuditReport;
|
|
791
|
+
constructor(report: KnowledgeCitationAuditReport);
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* Parse the persisted citation form.
|
|
795
|
+
*
|
|
796
|
+
* `page-id` is unqualified. `here::page-id`, `shared::page-id`, and
|
|
797
|
+
* `inherited:<runId>::page-id` bind an intentional duplicate to one origin.
|
|
798
|
+
*/
|
|
799
|
+
declare function parseKnowledgeCitationReference(value: string): KnowledgeCitationReference;
|
|
800
|
+
/** Serialize one reference into the canonical frontmatter representation. */
|
|
801
|
+
declare function formatKnowledgeCitationReference(reference: KnowledgeCitationReference): string;
|
|
802
|
+
/** Resolve one reference against an already materialized visibility chain. */
|
|
803
|
+
declare function resolveKnowledgeCitation(visiblePages: readonly OriginatedPage[], reference: KnowledgeCitationReference): KnowledgeCitationResolution;
|
|
804
|
+
/** Resolve a batch without discarding missing or ambiguous rows. */
|
|
805
|
+
declare function resolveKnowledgeCitations(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationResolution[];
|
|
806
|
+
/**
|
|
807
|
+
* Resolve a batch and fail closed unless every reference names exactly one
|
|
808
|
+
* visible page. Returned candidates preserve the caller's reference order.
|
|
809
|
+
*/
|
|
810
|
+
declare function assertKnowledgeCitationsResolved(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationCandidate[];
|
|
811
|
+
/** Audit persisted `cites` relations against one immutable visibility snapshot. */
|
|
812
|
+
declare function auditKnowledgeCitations(visiblePages: readonly OriginatedPage[], options?: AuditKnowledgeCitationsOptions): KnowledgeCitationAuditReport;
|
|
813
|
+
/** Audit and fail closed when any persisted citation is unresolved. */
|
|
814
|
+
declare function assertKnowledgeCitationAudit(report: KnowledgeCitationAuditReport): void;
|
|
815
|
+
/** Resolve one citation using a run-scoped store's declared visibility chain. */
|
|
816
|
+
declare function resolveRunScopedCitation(stores: RunScopedStores, runId: string, reference: KnowledgeCitationReference): Promise<KnowledgeCitationResolution>;
|
|
817
|
+
/** Resolve citations using one chain read so every row sees the same snapshot. */
|
|
818
|
+
declare function resolveRunScopedCitations(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationResolution[]>;
|
|
819
|
+
/** Resolve a run-scoped batch and fail closed on any missing or ambiguous id. */
|
|
820
|
+
declare function assertRunScopedCitationsResolved(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationCandidate[]>;
|
|
821
|
+
/** Audit only pages authored in the current run against the full visible chain. */
|
|
822
|
+
declare function auditCurrentRunCitations(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
823
|
+
/** Audit current-run citations and fail closed on every unresolved relation. */
|
|
824
|
+
declare function assertCurrentRunCitationsResolved(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region src/rag-eval/near-duplicates.d.ts
|
|
827
|
+
interface NearDuplicateDetectionOptions {
|
|
828
|
+
/** Jaccard similarity at or above which a pair is reported. Defaults to 0.82. */
|
|
829
|
+
threshold?: number;
|
|
830
|
+
/** Minimum normalized characters before a page participates. Defaults to 80. */
|
|
831
|
+
minCharacters?: number;
|
|
832
|
+
/** Word-shingle width. Defaults to 5. */
|
|
833
|
+
wordShingleSize?: number;
|
|
834
|
+
/** Character-shingle width used for text with too few words. Defaults to 16. */
|
|
835
|
+
characterShingleSize?: number;
|
|
836
|
+
/** Ignore a shingle occurring in more pages than this. Defaults to 64. */
|
|
837
|
+
maxDocumentFrequency?: number;
|
|
838
|
+
/** Stop adding candidate pairs after this many. Defaults to 250,000. */
|
|
839
|
+
maxCandidatePairs?: number;
|
|
840
|
+
/** Maximum duplicate pairs retained in the report. Defaults to 1,000. */
|
|
841
|
+
maxReportedPairs?: number;
|
|
842
|
+
}
|
|
843
|
+
interface NearDuplicatePair {
|
|
844
|
+
leftPageId: string;
|
|
845
|
+
leftPath: string;
|
|
846
|
+
rightPageId: string;
|
|
847
|
+
rightPath: string;
|
|
848
|
+
similarity: number;
|
|
849
|
+
intersectionSize: number;
|
|
850
|
+
unionSize: number;
|
|
851
|
+
exact: boolean;
|
|
852
|
+
}
|
|
853
|
+
interface NearDuplicateReport {
|
|
854
|
+
algorithm: 'deterministic-shingle-jaccard-v1';
|
|
855
|
+
threshold: number;
|
|
856
|
+
pageCount: number;
|
|
857
|
+
eligiblePageCount: number;
|
|
858
|
+
candidatePairCount: number;
|
|
859
|
+
comparedPairCount: number;
|
|
860
|
+
duplicatePairCount: number;
|
|
861
|
+
duplicatePageCount: number;
|
|
862
|
+
duplicatePageRate: number;
|
|
863
|
+
truncated: boolean;
|
|
864
|
+
pairs: NearDuplicatePair[];
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Detect exact and near-duplicate pages without a model, embedding service, or clock.
|
|
868
|
+
*
|
|
869
|
+
* The detector uses word shingles when prose has enough tokens and Unicode
|
|
870
|
+
* character shingles otherwise. An inverted index proposes candidate pairs;
|
|
871
|
+
* high-document-frequency shingles are ignored so common boilerplate cannot
|
|
872
|
+
* make candidate generation quadratic. Exact normalized copies are always
|
|
873
|
+
* proposed before ordinary shingle candidates, even when every shingle is
|
|
874
|
+
* common. Every limit and sort order is explicit so the same corpus produces
|
|
875
|
+
* the same report on every run.
|
|
876
|
+
*/
|
|
877
|
+
declare function detectNearDuplicatePages(pages: readonly KnowledgePage[], options?: NearDuplicateDetectionOptions): NearDuplicateReport;
|
|
878
|
+
declare function normalizePageText(value: string): string;
|
|
879
|
+
//#endregion
|
|
880
|
+
//#region src/write-intake.d.ts
|
|
881
|
+
/** One candidate that duplicates visible knowledge without relating itself to it. */
|
|
882
|
+
interface KnowledgeDuplicateIntakePair {
|
|
883
|
+
readonly candidatePageId: KnowledgeId;
|
|
884
|
+
readonly candidatePath: string;
|
|
885
|
+
readonly matchedPageId: KnowledgeId;
|
|
886
|
+
readonly matchedPath: string;
|
|
887
|
+
readonly similarity: number;
|
|
888
|
+
readonly exact: boolean;
|
|
889
|
+
}
|
|
890
|
+
/**
|
|
891
|
+
* A write duplicates visible knowledge and declares no relation to it.
|
|
892
|
+
*
|
|
893
|
+
* Every listed pair is cleared by one authoring action: cite the matched page,
|
|
894
|
+
* name it in `contradicts`, or give the candidate the matched page's id so the
|
|
895
|
+
* write is an update of it.
|
|
896
|
+
*/
|
|
897
|
+
declare class KnowledgeDuplicateIntakeError extends Error {
|
|
898
|
+
readonly pairs: readonly KnowledgeDuplicateIntakePair[];
|
|
899
|
+
readonly threshold: number;
|
|
900
|
+
constructor(pairs: readonly KnowledgeDuplicateIntakePair[], threshold: number);
|
|
901
|
+
}
|
|
902
|
+
interface KnowledgeWriteIntakeOptions {
|
|
903
|
+
/**
|
|
904
|
+
* The chain the write lands in, as `loadChain` reports it. Candidates replace
|
|
905
|
+
* the `here` entries at the same paths; an inherited or shared page at one of
|
|
906
|
+
* those paths stays visible, so a citation into it still reports its true
|
|
907
|
+
* ambiguity.
|
|
908
|
+
*/
|
|
909
|
+
readonly visiblePages: readonly OriginatedPage[];
|
|
910
|
+
/** Near-duplicate detector settings. The detector's own defaults apply when absent. */
|
|
911
|
+
readonly nearDuplicates?: NearDuplicateDetectionOptions;
|
|
912
|
+
/** Refuse a citation that resolves to no visible page. Defaults to true. */
|
|
913
|
+
readonly citations?: boolean;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Refuse a write that duplicates visible knowledge or cites a page that exists
|
|
917
|
+
* nowhere.
|
|
918
|
+
*
|
|
919
|
+
* The candidates are part of the corpus both checks see, so a batch may cite a
|
|
920
|
+
* page it writes in the same call, and two candidates that duplicate each other
|
|
921
|
+
* are caught before either lands.
|
|
922
|
+
*
|
|
923
|
+
* Returns the resolved citation candidates in the order the candidates declare
|
|
924
|
+
* them.
|
|
925
|
+
*/
|
|
926
|
+
declare function assertKnowledgeWriteIntake(candidates: readonly KnowledgePage[], options: KnowledgeWriteIntakeOptions): readonly KnowledgeCitationCandidate[];
|
|
927
|
+
//#endregion
|
|
603
928
|
//#region src/proposals.d.ts
|
|
604
929
|
interface ApplyWriteBlocksResult {
|
|
605
930
|
written: string[];
|
|
606
931
|
warnings: string[];
|
|
607
932
|
}
|
|
608
|
-
|
|
609
|
-
|
|
933
|
+
/** Intake settings for a write, minus the pages the target root supplies itself. */
|
|
934
|
+
type KnowledgeWriteIntakeRequest = Omit<KnowledgeWriteIntakeOptions, 'visiblePages'> & {
|
|
935
|
+
/**
|
|
936
|
+
* Pages visible to the write beyond the target root, such as the inherited
|
|
937
|
+
* and shared entries of a run-scoped chain. The target root's own pages are
|
|
938
|
+
* read under the same lock and are always part of the corpus.
|
|
939
|
+
*/
|
|
940
|
+
readonly inheritedPages?: readonly OriginatedPage[];
|
|
941
|
+
};
|
|
942
|
+
interface ApplyKnowledgeWriteBlocksOptions extends KnowledgePagesOptions {
|
|
943
|
+
/**
|
|
944
|
+
* Refuse the write when a block duplicates visible knowledge without relating
|
|
945
|
+
* itself to it, or cites a page that exists nowhere. The whole proposal is
|
|
946
|
+
* refused, so a refused batch leaves no partial write behind.
|
|
947
|
+
*/
|
|
948
|
+
intake?: KnowledgeWriteIntakeRequest;
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Apply the FILE blocks of a proposal under the pages directory.
|
|
952
|
+
*
|
|
953
|
+
* A block whose path lies outside `<pagesDirectory>/` is refused by the parser
|
|
954
|
+
* and again by the file transaction, so one option value bounds the whole
|
|
955
|
+
* write.
|
|
956
|
+
*/
|
|
957
|
+
declare function applyKnowledgeWriteBlocks(root: string, proposalText: string, options?: ApplyKnowledgeWriteBlocksOptions): Promise<ApplyWriteBlocksResult>;
|
|
958
|
+
declare function applyKnowledgeWriteBlocksFile(root: string, proposalPath: string, options?: ApplyKnowledgeWriteBlocksOptions): Promise<ApplyWriteBlocksResult>;
|
|
610
959
|
//#endregion
|
|
611
960
|
//#region src/validate.d.ts
|
|
612
961
|
interface ValidateKnowledgeOptions {
|
|
@@ -858,60 +1207,6 @@ interface RunRagKnowledgeImprovementLoopResult {
|
|
|
858
1207
|
type MaybePromise$1<T> = T | Promise<T>;
|
|
859
1208
|
declare function runRagKnowledgeImprovementLoop(options: RunRagKnowledgeImprovementLoopOptions): Promise<RunRagKnowledgeImprovementLoopResult>;
|
|
860
1209
|
//#endregion
|
|
861
|
-
//#region src/rag-eval/near-duplicates.d.ts
|
|
862
|
-
interface NearDuplicateDetectionOptions {
|
|
863
|
-
/** Jaccard similarity at or above which a pair is reported. Defaults to 0.82. */
|
|
864
|
-
threshold?: number;
|
|
865
|
-
/** Minimum normalized characters before a page participates. Defaults to 80. */
|
|
866
|
-
minCharacters?: number;
|
|
867
|
-
/** Word-shingle width. Defaults to 5. */
|
|
868
|
-
wordShingleSize?: number;
|
|
869
|
-
/** Character-shingle width used for text with too few words. Defaults to 16. */
|
|
870
|
-
characterShingleSize?: number;
|
|
871
|
-
/** Ignore a shingle occurring in more pages than this. Defaults to 64. */
|
|
872
|
-
maxDocumentFrequency?: number;
|
|
873
|
-
/** Stop adding candidate pairs after this many. Defaults to 250,000. */
|
|
874
|
-
maxCandidatePairs?: number;
|
|
875
|
-
/** Maximum duplicate pairs retained in the report. Defaults to 1,000. */
|
|
876
|
-
maxReportedPairs?: number;
|
|
877
|
-
}
|
|
878
|
-
interface NearDuplicatePair {
|
|
879
|
-
leftPageId: string;
|
|
880
|
-
leftPath: string;
|
|
881
|
-
rightPageId: string;
|
|
882
|
-
rightPath: string;
|
|
883
|
-
similarity: number;
|
|
884
|
-
intersectionSize: number;
|
|
885
|
-
unionSize: number;
|
|
886
|
-
exact: boolean;
|
|
887
|
-
}
|
|
888
|
-
interface NearDuplicateReport {
|
|
889
|
-
algorithm: 'deterministic-shingle-jaccard-v1';
|
|
890
|
-
threshold: number;
|
|
891
|
-
pageCount: number;
|
|
892
|
-
eligiblePageCount: number;
|
|
893
|
-
candidatePairCount: number;
|
|
894
|
-
comparedPairCount: number;
|
|
895
|
-
duplicatePairCount: number;
|
|
896
|
-
duplicatePageCount: number;
|
|
897
|
-
duplicatePageRate: number;
|
|
898
|
-
truncated: boolean;
|
|
899
|
-
pairs: NearDuplicatePair[];
|
|
900
|
-
}
|
|
901
|
-
/**
|
|
902
|
-
* Detect exact and near-duplicate pages without a model, embedding service, or clock.
|
|
903
|
-
*
|
|
904
|
-
* The detector uses word shingles when prose has enough tokens and Unicode
|
|
905
|
-
* character shingles otherwise. An inverted index proposes candidate pairs;
|
|
906
|
-
* high-document-frequency shingles are ignored so common boilerplate cannot
|
|
907
|
-
* make candidate generation quadratic. Exact normalized copies are always
|
|
908
|
-
* proposed before ordinary shingle candidates, even when every shingle is
|
|
909
|
-
* common. Every limit and sort order is explicit so the same corpus produces
|
|
910
|
-
* the same report on every run.
|
|
911
|
-
*/
|
|
912
|
-
declare function detectNearDuplicatePages(pages: readonly KnowledgePage[], options?: NearDuplicateDetectionOptions): NearDuplicateReport;
|
|
913
|
-
declare function normalizePageText(value: string): string;
|
|
914
|
-
//#endregion
|
|
915
1210
|
//#region src/rag-eval/contracts.d.ts
|
|
916
1211
|
type RagEvalProvider = 'agent-knowledge' | 'ragas' | 'deepeval' | 'trulens' | 'ragchecker' | 'custom';
|
|
917
1212
|
type RagEvalMetricKey = 'context_precision' | 'context_recall' | 'context_relevance' | 'context_sufficiency' | 'faithfulness' | 'groundedness' | 'answer_relevance' | 'answer_correctness' | 'citation_support' | 'abstention' | 'unsupported_answer_rate';
|
|
@@ -1532,6 +1827,7 @@ declare const transactionSchema: z.ZodObject<{
|
|
|
1532
1827
|
transactionId: z.ZodString;
|
|
1533
1828
|
purpose: z.ZodString;
|
|
1534
1829
|
recoveryOwner: z.ZodOptional<z.ZodString>;
|
|
1830
|
+
pagesDirectory: z.ZodOptional<z.ZodString>;
|
|
1535
1831
|
createdAt: z.ZodString;
|
|
1536
1832
|
entries: z.ZodArray<z.ZodObject<{
|
|
1537
1833
|
index: z.ZodNumber;
|
|
@@ -1658,197 +1954,18 @@ interface ChunkingOptions {
|
|
|
1658
1954
|
overlapChars: number;
|
|
1659
1955
|
}
|
|
1660
1956
|
interface KnowledgeChunk {
|
|
1661
|
-
index: number;
|
|
1662
|
-
text: string;
|
|
1663
|
-
headingPath: string;
|
|
1664
|
-
charStart: number;
|
|
1665
|
-
charEnd: number;
|
|
1666
|
-
oversized: boolean;
|
|
1667
|
-
}
|
|
1668
|
-
declare function chunkMarkdown(content: string, options?: Partial<ChunkingOptions>): KnowledgeChunk[];
|
|
1669
|
-
declare function stripFrontmatter(content: string): {
|
|
1670
|
-
body: string;
|
|
1671
|
-
bodyOffset: number;
|
|
1672
|
-
};
|
|
1673
|
-
//#endregion
|
|
1674
|
-
//#region src/store.d.ts
|
|
1675
|
-
interface KnowledgeLayout {
|
|
1676
|
-
root: string;
|
|
1677
|
-
knowledgeDir: string;
|
|
1678
|
-
rawSourcesDir: string;
|
|
1679
|
-
sourceRegistryPath: string;
|
|
1680
|
-
indexPath: string;
|
|
1681
|
-
logPath: string;
|
|
1682
|
-
cacheDir: string;
|
|
1683
|
-
}
|
|
1684
|
-
declare function layoutFor(root: string): KnowledgeLayout;
|
|
1685
|
-
/**
|
|
1686
|
-
* Filenames that `initKnowledgeBase` writes as human-navigation scaffolding.
|
|
1687
|
-
* These are excluded from the page index — they exist on disk so authors can
|
|
1688
|
-
* curate their vault, but they are not searchable content.
|
|
1689
|
-
*
|
|
1690
|
-
* Add new scaffold filenames here (and only here) to keep lint, validate, viz,
|
|
1691
|
-
* and the indexer consistent.
|
|
1692
|
-
*/
|
|
1693
|
-
declare const SCAFFOLD_PAGE_BASENAMES: readonly string[];
|
|
1694
|
-
/**
|
|
1695
|
-
* True when a knowledge-relative path points at a scaffold file rather than
|
|
1696
|
-
* authored content. Accepts both repo-relative paths (`knowledge/index.md`)
|
|
1697
|
-
* and any nested `<dir>/index.md` or `<dir>/log.md` (for example
|
|
1698
|
-
* `knowledge/concepts/index.md`) so subdirectory README-style scaffolds are
|
|
1699
|
-
* also excluded.
|
|
1700
|
-
*/
|
|
1701
|
-
declare function isScaffoldPath(path: string): boolean;
|
|
1702
|
-
declare function initKnowledgeBase(root: string): Promise<KnowledgeLayout>;
|
|
1703
|
-
interface LoadKnowledgePagesOptions {
|
|
1704
|
-
/** Root-relative directory containing Markdown pages. Defaults to `knowledge`. */
|
|
1705
|
-
pagesDirectory?: string;
|
|
1706
|
-
}
|
|
1707
|
-
declare function loadKnowledgePages(root: string, options?: LoadKnowledgePagesOptions): Promise<KnowledgePage[]>;
|
|
1708
|
-
declare function writeJson(path: string, value: unknown): Promise<void>;
|
|
1709
|
-
//#endregion
|
|
1710
|
-
//#region src/run-scoped.d.ts
|
|
1711
|
-
/** Where a page in a chained read came from. */
|
|
1712
|
-
type PageOrigin = 'here' | `inherited:${string}` | 'shared';
|
|
1713
|
-
interface OriginatedPage {
|
|
1714
|
-
page: KnowledgePage;
|
|
1715
|
-
origin: PageOrigin;
|
|
1716
|
-
}
|
|
1717
|
-
interface RunLineageRecord {
|
|
1718
|
-
runId: string;
|
|
1719
|
-
parentRunId: string | null;
|
|
1720
|
-
createdAt: string;
|
|
1721
|
-
}
|
|
1722
|
-
/**
|
|
1723
|
-
* Durable authority for run ancestry.
|
|
1724
|
-
*
|
|
1725
|
-
* A product whose run manifest already owns lineage can supply an authority
|
|
1726
|
-
* backed by that manifest. `record` is optional for read-only authorities; in
|
|
1727
|
-
* that case `init` verifies that the existing authority agrees with the parent
|
|
1728
|
-
* requested by the caller before creating any store files.
|
|
1729
|
-
*/
|
|
1730
|
-
interface RunLineageAuthority {
|
|
1731
|
-
parentOf(runId: string): Promise<string | null>;
|
|
1732
|
-
record?(record: RunLineageRecord): Promise<void>;
|
|
1733
|
-
}
|
|
1734
|
-
declare const RUN_LINEAGE_BASENAME = "lineage.json";
|
|
1735
|
-
interface RunScopedStoresOptions {
|
|
1736
|
-
/** The root under which per-run stores live. */
|
|
1737
|
-
root: string;
|
|
1738
|
-
/** Store path for a run; defaults to `<root>/<runId>/knowledge-base`. */
|
|
1739
|
-
runStorePath?: (runId: string) => string;
|
|
1740
|
-
/**
|
|
1741
|
-
* The curated store every run may read but no run writes. Searched last and
|
|
1742
|
-
* labeled `shared`.
|
|
1743
|
-
*/
|
|
1744
|
-
sharedRoot?: string;
|
|
1745
|
-
/** External owner for run ancestry. Defaults to a record inside each run store. */
|
|
1746
|
-
lineageAuthority?: RunLineageAuthority;
|
|
1747
|
-
}
|
|
1748
|
-
interface RunScopedStores {
|
|
1749
|
-
/** Create or open a run store and bind it to one exact parent identity. */
|
|
1750
|
-
init(runId: string, options?: {
|
|
1751
|
-
parentRunId?: string | null;
|
|
1752
|
-
}): Promise<KnowledgeLayout>;
|
|
1753
|
-
/** The ancestor chain of a run, nearest first. */
|
|
1754
|
-
lineage(runId: string): Promise<string[]>;
|
|
1755
|
-
/**
|
|
1756
|
-
* Every page visible to a run: current, ancestors, then shared. A repeated
|
|
1757
|
-
* page id is retained at every origin so citation resolution can report the
|
|
1758
|
-
* ambiguity instead of silently shadowing one page.
|
|
1759
|
-
*/
|
|
1760
|
-
loadChain(runId: string): Promise<OriginatedPage[]>;
|
|
1761
|
-
}
|
|
1762
|
-
declare function createRunScopedStores(options: RunScopedStoresOptions): RunScopedStores;
|
|
1763
|
-
/** File-backed authority used when the product has no separate run manifest. */
|
|
1764
|
-
declare function createFileRunLineageAuthority(runStorePath: (runId: string) => string): RunLineageAuthority;
|
|
1765
|
-
//#endregion
|
|
1766
|
-
//#region src/citation-resolution.d.ts
|
|
1767
|
-
/**
|
|
1768
|
-
* A citation into the knowledge visible to one run.
|
|
1769
|
-
*
|
|
1770
|
-
* An unqualified reference is accepted only when exactly one visible page has
|
|
1771
|
-
* the requested id. Callers can qualify a reference by origin when a current,
|
|
1772
|
-
* inherited, or shared page intentionally reuses the same stable id.
|
|
1773
|
-
*/
|
|
1774
|
-
interface KnowledgeCitationReference {
|
|
1775
|
-
readonly pageId: KnowledgeId;
|
|
1776
|
-
readonly origin?: PageOrigin;
|
|
1777
|
-
}
|
|
1778
|
-
interface KnowledgeCitationCandidate {
|
|
1779
|
-
readonly pageId: KnowledgeId;
|
|
1780
|
-
readonly origin: PageOrigin;
|
|
1781
|
-
readonly page: KnowledgePage;
|
|
1782
|
-
}
|
|
1783
|
-
type KnowledgeCitationResolutionStatus = 'resolved' | 'missing' | 'ambiguous';
|
|
1784
|
-
interface KnowledgeCitationResolution {
|
|
1785
|
-
readonly reference: KnowledgeCitationReference;
|
|
1786
|
-
readonly status: KnowledgeCitationResolutionStatus;
|
|
1787
|
-
readonly candidates: readonly KnowledgeCitationCandidate[];
|
|
1788
|
-
readonly resolved?: KnowledgeCitationCandidate;
|
|
1789
|
-
}
|
|
1790
|
-
type KnowledgeCitationAuditIssueKind = 'self' | 'missing' | 'ambiguous';
|
|
1791
|
-
interface KnowledgeCitationAuditIssue {
|
|
1792
|
-
readonly kind: KnowledgeCitationAuditIssueKind;
|
|
1793
|
-
readonly sourcePageId: KnowledgeId;
|
|
1794
|
-
readonly sourcePath: string;
|
|
1795
|
-
readonly sourceOrigin: PageOrigin;
|
|
1796
|
-
readonly persistedCitation: string;
|
|
1797
|
-
readonly reference: KnowledgeCitationReference;
|
|
1798
|
-
readonly candidates: readonly KnowledgeCitationCandidate[];
|
|
1799
|
-
}
|
|
1800
|
-
interface KnowledgeCitationAuditReport {
|
|
1801
|
-
readonly ok: boolean;
|
|
1802
|
-
readonly checkedPages: number;
|
|
1803
|
-
readonly checkedCitations: number;
|
|
1804
|
-
readonly issues: readonly KnowledgeCitationAuditIssue[];
|
|
1805
|
-
}
|
|
1806
|
-
interface AuditKnowledgeCitationsOptions {
|
|
1807
|
-
/** Limit audited source pages to these origins. All visible origins are checked by default. */
|
|
1808
|
-
readonly sourceOrigins?: readonly PageOrigin[];
|
|
1809
|
-
}
|
|
1810
|
-
/** A batch contains at least one citation that is missing or ambiguous. */
|
|
1811
|
-
declare class KnowledgeCitationResolutionError extends Error {
|
|
1812
|
-
readonly resolutions: readonly KnowledgeCitationResolution[];
|
|
1813
|
-
constructor(resolutions: readonly KnowledgeCitationResolution[]);
|
|
1814
|
-
}
|
|
1815
|
-
/** A persisted page contains a self, missing, or ambiguous citation. */
|
|
1816
|
-
declare class KnowledgeCitationAuditError extends Error {
|
|
1817
|
-
readonly report: KnowledgeCitationAuditReport;
|
|
1818
|
-
constructor(report: KnowledgeCitationAuditReport);
|
|
1957
|
+
index: number;
|
|
1958
|
+
text: string;
|
|
1959
|
+
headingPath: string;
|
|
1960
|
+
charStart: number;
|
|
1961
|
+
charEnd: number;
|
|
1962
|
+
oversized: boolean;
|
|
1819
1963
|
}
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
*/
|
|
1826
|
-
declare function parseKnowledgeCitationReference(value: string): KnowledgeCitationReference;
|
|
1827
|
-
/** Serialize one reference into the canonical frontmatter representation. */
|
|
1828
|
-
declare function formatKnowledgeCitationReference(reference: KnowledgeCitationReference): string;
|
|
1829
|
-
/** Resolve one reference against an already materialized visibility chain. */
|
|
1830
|
-
declare function resolveKnowledgeCitation(visiblePages: readonly OriginatedPage[], reference: KnowledgeCitationReference): KnowledgeCitationResolution;
|
|
1831
|
-
/** Resolve a batch without discarding missing or ambiguous rows. */
|
|
1832
|
-
declare function resolveKnowledgeCitations(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationResolution[];
|
|
1833
|
-
/**
|
|
1834
|
-
* Resolve a batch and fail closed unless every reference names exactly one
|
|
1835
|
-
* visible page. Returned candidates preserve the caller's reference order.
|
|
1836
|
-
*/
|
|
1837
|
-
declare function assertKnowledgeCitationsResolved(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationCandidate[];
|
|
1838
|
-
/** Audit persisted `cites` relations against one immutable visibility snapshot. */
|
|
1839
|
-
declare function auditKnowledgeCitations(visiblePages: readonly OriginatedPage[], options?: AuditKnowledgeCitationsOptions): KnowledgeCitationAuditReport;
|
|
1840
|
-
/** Audit and fail closed when any persisted citation is unresolved. */
|
|
1841
|
-
declare function assertKnowledgeCitationAudit(report: KnowledgeCitationAuditReport): void;
|
|
1842
|
-
/** Resolve one citation using a run-scoped store's declared visibility chain. */
|
|
1843
|
-
declare function resolveRunScopedCitation(stores: RunScopedStores, runId: string, reference: KnowledgeCitationReference): Promise<KnowledgeCitationResolution>;
|
|
1844
|
-
/** Resolve citations using one chain read so every row sees the same snapshot. */
|
|
1845
|
-
declare function resolveRunScopedCitations(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationResolution[]>;
|
|
1846
|
-
/** Resolve a run-scoped batch and fail closed on any missing or ambiguous id. */
|
|
1847
|
-
declare function assertRunScopedCitationsResolved(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationCandidate[]>;
|
|
1848
|
-
/** Audit only pages authored in the current run against the full visible chain. */
|
|
1849
|
-
declare function auditCurrentRunCitations(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
1850
|
-
/** Audit current-run citations and fail closed on every unresolved relation. */
|
|
1851
|
-
declare function assertCurrentRunCitationsResolved(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
1964
|
+
declare function chunkMarkdown(content: string, options?: Partial<ChunkingOptions>): KnowledgeChunk[];
|
|
1965
|
+
declare function stripFrontmatter(content: string): {
|
|
1966
|
+
body: string;
|
|
1967
|
+
bodyOffset: number;
|
|
1968
|
+
};
|
|
1852
1969
|
//#endregion
|
|
1853
1970
|
//#region src/citation-lint.d.ts
|
|
1854
1971
|
/** Convert a chain-aware citation audit into the package lint vocabulary. */
|
|
@@ -2315,8 +2432,8 @@ declare function createKnowledgeEvent(input: {
|
|
|
2315
2432
|
}): KnowledgeEvent;
|
|
2316
2433
|
//#endregion
|
|
2317
2434
|
//#region src/filesystem-search-provider.d.ts
|
|
2318
|
-
interface FileSystemSearchProviderOptions {
|
|
2319
|
-
/** Knowledge-base root containing
|
|
2435
|
+
interface FileSystemSearchProviderOptions extends KnowledgePagesOptions {
|
|
2436
|
+
/** Knowledge-base root containing the pages directory and `.agent-knowledge/`. */
|
|
2320
2437
|
root: string;
|
|
2321
2438
|
/** Optional warm index, useful when the caller already built one. */
|
|
2322
2439
|
index?: KnowledgeIndex;
|
|
@@ -2340,7 +2457,10 @@ interface FileSystemSearchOptions {
|
|
|
2340
2457
|
*/
|
|
2341
2458
|
declare class FileSystemSearchProvider {
|
|
2342
2459
|
readonly root: string;
|
|
2460
|
+
/** Root-relative directory the provider indexes. */
|
|
2461
|
+
readonly pagesDirectory: string;
|
|
2343
2462
|
private index;
|
|
2463
|
+
private lexicalIndex;
|
|
2344
2464
|
private readonly defaultLimit;
|
|
2345
2465
|
private readonly refreshMode;
|
|
2346
2466
|
constructor(options: FileSystemSearchProviderOptions);
|
|
@@ -2463,6 +2583,30 @@ declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
|
2463
2583
|
declare function formatFrontmatter(frontmatter: Record<string, unknown>, body: string): string;
|
|
2464
2584
|
//#endregion
|
|
2465
2585
|
//#region src/graph.d.ts
|
|
2586
|
+
type KnowledgePageRelationPredicate = 'wikilink' | 'citation' | 'shared-source' | 'contradicts';
|
|
2587
|
+
/** One labeled relation between two pages; `weight` counts the occurrences that produced it. */
|
|
2588
|
+
interface KnowledgePageRelation extends KnowledgeRelation {
|
|
2589
|
+
predicate: KnowledgePageRelationPredicate;
|
|
2590
|
+
weight: number;
|
|
2591
|
+
}
|
|
2592
|
+
/**
|
|
2593
|
+
* The labeled relations between pages, one per `(sourceId, targetId, predicate)`.
|
|
2594
|
+
*
|
|
2595
|
+
* `wikilink`, `citation`, and `contradicts` follow an authored link, `cites`
|
|
2596
|
+
* entry, or `contradicts` entry to the one page it resolves to; a missing,
|
|
2597
|
+
* ambiguous, or self-referencing target emits nothing. `shared-source` joins
|
|
2598
|
+
* every pair of pages that registers a common source, in page order, weighted
|
|
2599
|
+
* 0.5 per shared source id, with the shared ids in `metadata.sourceIds`. It is
|
|
2600
|
+
* implicit, so it is listed after the authored relations and never counts
|
|
2601
|
+
* toward a page's degree in `buildKnowledgeGraph`.
|
|
2602
|
+
*/
|
|
2603
|
+
declare function knowledgePageRelations(pages: KnowledgePage[]): KnowledgePageRelation[];
|
|
2604
|
+
/**
|
|
2605
|
+
* The weighted page graph: `knowledgePageRelations` collapsed to one edge per
|
|
2606
|
+
* ordered page pair, with the predicates merged into `reasons` and the weights
|
|
2607
|
+
* summed. `contradicts` stays out of this projection; read it from the relation
|
|
2608
|
+
* list. Node degrees count the authored `wikilink` and `citation` occurrences.
|
|
2609
|
+
*/
|
|
2466
2610
|
declare function buildKnowledgeGraph(pages: KnowledgePage[]): KnowledgeGraph;
|
|
2467
2611
|
//#endregion
|
|
2468
2612
|
//#region src/ids.d.ts
|
|
@@ -2473,7 +2617,7 @@ declare function stableId(prefix: string, content: string): string;
|
|
|
2473
2617
|
declare function textSourceId(uri: string, contentHash: string): string;
|
|
2474
2618
|
//#endregion
|
|
2475
2619
|
//#region src/indexer.d.ts
|
|
2476
|
-
declare function buildKnowledgeIndex(root: string): Promise<KnowledgeIndex>;
|
|
2620
|
+
declare function buildKnowledgeIndex(root: string, options?: KnowledgePagesOptions): Promise<KnowledgeIndex>;
|
|
2477
2621
|
/**
|
|
2478
2622
|
* Build the index from the knowledge tree and store it.
|
|
2479
2623
|
*
|
|
@@ -2483,7 +2627,7 @@ declare function buildKnowledgeIndex(root: string): Promise<KnowledgeIndex>;
|
|
|
2483
2627
|
* a store-based reader saw none of the indexer's work. One writer now, and it
|
|
2484
2628
|
* validates through `KnowledgeIndexSchema` on the way out.
|
|
2485
2629
|
*/
|
|
2486
|
-
declare function writeKnowledgeIndex(root: string): Promise<KnowledgeIndex>;
|
|
2630
|
+
declare function writeKnowledgeIndex(root: string, options?: KnowledgePagesOptions): Promise<KnowledgeIndex>;
|
|
2487
2631
|
//#endregion
|
|
2488
2632
|
//#region src/inspect.d.ts
|
|
2489
2633
|
interface KnowledgeInspection {
|
|
@@ -2532,6 +2676,40 @@ interface KnowledgeExplanation {
|
|
|
2532
2676
|
}
|
|
2533
2677
|
declare function explainKnowledgeTarget(index: KnowledgeIndex, target: string): KnowledgeExplanation;
|
|
2534
2678
|
//#endregion
|
|
2679
|
+
//#region src/invalidation-propagation.d.ts
|
|
2680
|
+
/** Frontmatter field naming the cited pages whose evidence refuted them. */
|
|
2681
|
+
declare const CITES_INVALIDATED_FIELD = "citesInvalidated";
|
|
2682
|
+
interface KnowledgeInvalidationStamp {
|
|
2683
|
+
readonly page: KnowledgePage;
|
|
2684
|
+
/** The value the field must hold, sorted and deduplicated. Empty removes the field. */
|
|
2685
|
+
readonly citesInvalidated: readonly KnowledgeId[];
|
|
2686
|
+
/** The value the page holds now, in the order it is stored. */
|
|
2687
|
+
readonly current: readonly KnowledgeId[];
|
|
2688
|
+
}
|
|
2689
|
+
interface KnowledgeInvalidationPlan {
|
|
2690
|
+
/** Every visible page carrying an invalidation, sorted by id. */
|
|
2691
|
+
readonly invalidatedPageIds: readonly KnowledgeId[];
|
|
2692
|
+
/** Only the pages whose stamp differs from what they hold, in path order. */
|
|
2693
|
+
readonly stamps: readonly KnowledgeInvalidationStamp[];
|
|
2694
|
+
}
|
|
2695
|
+
/**
|
|
2696
|
+
* Plan the `citesInvalidated` stamp for every page authored in the target
|
|
2697
|
+
* store.
|
|
2698
|
+
*
|
|
2699
|
+
* Citations resolve over the whole chain, so a page here may be stamped for
|
|
2700
|
+
* citing a refuted inherited or shared page. Only `here` pages are stamped: a
|
|
2701
|
+
* run does not write the stores it inherits or shares.
|
|
2702
|
+
*/
|
|
2703
|
+
declare function planInvalidationPropagation(visiblePages: readonly OriginatedPage[]): KnowledgeInvalidationPlan;
|
|
2704
|
+
/**
|
|
2705
|
+
* Render one plan as a write-block proposal for `applyKnowledgeWriteBlocks`.
|
|
2706
|
+
*
|
|
2707
|
+
* Only the stamped field changes. The page is rendered through
|
|
2708
|
+
* `formatFrontmatter`, so its frontmatter is written in that writer's
|
|
2709
|
+
* normalized form.
|
|
2710
|
+
*/
|
|
2711
|
+
declare function formatKnowledgeInvalidationProposal(plan: KnowledgeInvalidationPlan): string;
|
|
2712
|
+
//#endregion
|
|
2535
2713
|
//#region src/investment-thesis-set.d.ts
|
|
2536
2714
|
/**
|
|
2537
2715
|
* HELD-OUT INVESTMENT-RESEARCH EVAL SET.
|
|
@@ -2870,7 +3048,7 @@ declare class FileSystemKbStore implements KbStore, ClaimLedgerStore {
|
|
|
2870
3048
|
}
|
|
2871
3049
|
//#endregion
|
|
2872
3050
|
//#region src/knowledge-use-receipts.d.ts
|
|
2873
|
-
declare const KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION: '
|
|
3051
|
+
declare const KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION: '2.0.0';
|
|
2874
3052
|
declare const KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM: 'rfc8785-sha256';
|
|
2875
3053
|
interface KnowledgeVisibilitySnapshotEntry {
|
|
2876
3054
|
readonly position: number;
|
|
@@ -2888,6 +3066,23 @@ interface KnowledgeVisibilitySnapshot {
|
|
|
2888
3066
|
readonly snapshotDigest: Sha256Digest;
|
|
2889
3067
|
readonly entries: readonly KnowledgeVisibilitySnapshotEntry[];
|
|
2890
3068
|
}
|
|
3069
|
+
/** Content-addressed locator of the stored bytes of one visibility snapshot. */
|
|
3070
|
+
interface KnowledgeVisibilityArtifactRef {
|
|
3071
|
+
readonly uri: string;
|
|
3072
|
+
/** Digest of the stored bytes, as `knowledgeVisibilityArtifactRef` computes it. */
|
|
3073
|
+
readonly digest: Sha256Digest;
|
|
3074
|
+
readonly byteLength: number;
|
|
3075
|
+
}
|
|
3076
|
+
/**
|
|
3077
|
+
* Compact identity of one exact visibility snapshot. The snapshot bytes live in
|
|
3078
|
+
* the artifact the reference names, or in another durable record the caller
|
|
3079
|
+
* keeps; the receipt carries only this reference.
|
|
3080
|
+
*/
|
|
3081
|
+
interface KnowledgeVisibilityRef {
|
|
3082
|
+
readonly snapshotDigest: Sha256Digest;
|
|
3083
|
+
readonly pageCount: number;
|
|
3084
|
+
readonly artifact?: KnowledgeVisibilityArtifactRef;
|
|
3085
|
+
}
|
|
2891
3086
|
interface KnowledgeRetrieverIdentity {
|
|
2892
3087
|
/** Stable implementation name, for example `token-overlap-v1`. */
|
|
2893
3088
|
readonly id: string;
|
|
@@ -2927,7 +3122,7 @@ interface KnowledgeRetrievalReceipt {
|
|
|
2927
3122
|
readonly executionRef?: Sha256Digest;
|
|
2928
3123
|
readonly query: string;
|
|
2929
3124
|
readonly retriever: KnowledgeRetrieverIdentity;
|
|
2930
|
-
readonly visibility:
|
|
3125
|
+
readonly visibility: KnowledgeVisibilityRef;
|
|
2931
3126
|
readonly results: readonly KnowledgeRetrievalResultReceipt[];
|
|
2932
3127
|
readonly evidenceRefs: readonly EvidenceRef[];
|
|
2933
3128
|
readonly attributes: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
@@ -2939,12 +3134,42 @@ interface CreateKnowledgeRetrievalReceiptInput {
|
|
|
2939
3134
|
readonly executionRef?: Sha256Digest;
|
|
2940
3135
|
readonly query: string;
|
|
2941
3136
|
readonly retriever: KnowledgeRetrieverIdentity;
|
|
2942
|
-
|
|
3137
|
+
/**
|
|
3138
|
+
* The snapshot the retriever searched, created once with
|
|
3139
|
+
* `createKnowledgeVisibilitySnapshot` and reused for every retrieval over the
|
|
3140
|
+
* same view. Results join against its entries; the receipt stores only its
|
|
3141
|
+
* reference.
|
|
3142
|
+
*/
|
|
3143
|
+
readonly visibility: KnowledgeVisibilitySnapshot;
|
|
3144
|
+
/** Where the snapshot bytes are stored, when the caller has persisted them. */
|
|
3145
|
+
readonly visibilityArtifact?: KnowledgeVisibilityArtifactRef;
|
|
2943
3146
|
readonly results: readonly OriginatedKnowledgeSearchResult[];
|
|
2944
3147
|
readonly evidenceRefs?: readonly EvidenceRef[];
|
|
2945
3148
|
readonly attributes?: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
2946
3149
|
readonly createdAt?: Date | string;
|
|
2947
3150
|
}
|
|
3151
|
+
/**
|
|
3152
|
+
* Returns the stored bytes of the artifact, or `undefined` when nothing is
|
|
3153
|
+
* stored at its uri. A thrown error is reported as a load failure.
|
|
3154
|
+
*/
|
|
3155
|
+
type KnowledgeVisibilityArtifactLoader = (artifact: KnowledgeVisibilityArtifactRef) => Promise<Uint8Array | undefined> | Uint8Array | undefined;
|
|
3156
|
+
type KnowledgeVisibilityUnavailableReason = 'no-artifact-reference' | 'missing' | 'load-failed';
|
|
3157
|
+
/**
|
|
3158
|
+
* The visibility snapshot a receipt references could not be obtained, so the
|
|
3159
|
+
* result-to-visibility join cannot be proven. This is distinct from a snapshot
|
|
3160
|
+
* that loads and fails to match.
|
|
3161
|
+
*/
|
|
3162
|
+
declare class KnowledgeVisibilityUnavailableError extends Error {
|
|
3163
|
+
readonly reason: KnowledgeVisibilityUnavailableReason;
|
|
3164
|
+
readonly snapshotDigest: Sha256Digest;
|
|
3165
|
+
readonly uri?: string;
|
|
3166
|
+
constructor(input: {
|
|
3167
|
+
reason: KnowledgeVisibilityUnavailableReason;
|
|
3168
|
+
snapshotDigest: Sha256Digest;
|
|
3169
|
+
uri?: string;
|
|
3170
|
+
cause?: unknown;
|
|
3171
|
+
});
|
|
3172
|
+
}
|
|
2948
3173
|
type KnowledgeUseRelation = 'supports' | 'contradicts' | 'extends' | 'rederives' | 'background';
|
|
2949
3174
|
type KnowledgeConsumerKind = 'decision' | 'artifact' | 'experiment' | 'candidate' | 'message' | 'other';
|
|
2950
3175
|
interface KnowledgeConsumerRef {
|
|
@@ -2990,20 +3215,291 @@ interface CreateKnowledgeUseReceiptInput {
|
|
|
2990
3215
|
readonly attributes?: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
2991
3216
|
readonly createdAt?: Date | string;
|
|
2992
3217
|
}
|
|
3218
|
+
/**
|
|
3219
|
+
* Why a retrieval influenced nothing.
|
|
3220
|
+
*
|
|
3221
|
+
* `irrelevant` means the returned pages did not bear on the question.
|
|
3222
|
+
* `no-use` means they did bear on it and the consumer still used none of them.
|
|
3223
|
+
*/
|
|
3224
|
+
type KnowledgeRetrievalDispositionRelation = 'irrelevant' | 'no-use';
|
|
3225
|
+
/**
|
|
3226
|
+
* Immutable proof that one retrieval led to no use.
|
|
3227
|
+
*
|
|
3228
|
+
* A use receipt requires a selected rank, so a retrieval that influenced
|
|
3229
|
+
* nothing would otherwise leave no record at all, and "no evidence of use" and
|
|
3230
|
+
* "evidence of no use" would look identical in the ledger.
|
|
3231
|
+
*/
|
|
3232
|
+
interface KnowledgeRetrievalDisposition {
|
|
3233
|
+
readonly schemaVersion: typeof KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION;
|
|
3234
|
+
readonly kind: 'knowledge-retrieval-disposition';
|
|
3235
|
+
readonly digestAlgorithm: typeof KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM;
|
|
3236
|
+
readonly receiptDigest: Sha256Digest;
|
|
3237
|
+
readonly createdAt: string;
|
|
3238
|
+
readonly runId: string;
|
|
3239
|
+
readonly actorId?: string;
|
|
3240
|
+
readonly profileDigest?: Sha256Digest;
|
|
3241
|
+
readonly executionRef?: Sha256Digest;
|
|
3242
|
+
readonly retrievalReceiptDigest: Sha256Digest;
|
|
3243
|
+
readonly relation: KnowledgeRetrievalDispositionRelation;
|
|
3244
|
+
readonly consumer: KnowledgeConsumerRef;
|
|
3245
|
+
readonly evidenceRefs: readonly EvidenceRef[];
|
|
3246
|
+
readonly attributes: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
3247
|
+
}
|
|
3248
|
+
interface CreateKnowledgeRetrievalDispositionInput {
|
|
3249
|
+
readonly retrieval: KnowledgeRetrievalReceipt;
|
|
3250
|
+
readonly relation: KnowledgeRetrievalDispositionRelation;
|
|
3251
|
+
readonly consumer: KnowledgeConsumerRef;
|
|
3252
|
+
readonly evidenceRefs?: readonly EvidenceRef[];
|
|
3253
|
+
readonly attributes?: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
3254
|
+
readonly createdAt?: Date | string;
|
|
3255
|
+
}
|
|
2993
3256
|
/** Stable content identity for one exact knowledge page. */
|
|
2994
3257
|
declare function knowledgePageDigest(page: KnowledgePage): Sha256Digest;
|
|
2995
3258
|
/** Snapshot the exact ordered current/ancestor/shared page view. */
|
|
2996
3259
|
declare function createKnowledgeVisibilitySnapshot(visiblePages: readonly OriginatedPage[]): KnowledgeVisibilitySnapshot;
|
|
2997
|
-
/**
|
|
3260
|
+
/**
|
|
3261
|
+
* Verify a snapshot's schema and canonical digest. The check runs once per
|
|
3262
|
+
* snapshot object; later calls with the same object are free.
|
|
3263
|
+
*/
|
|
3264
|
+
declare function verifyKnowledgeVisibilitySnapshot(snapshot: KnowledgeVisibilitySnapshot): KnowledgeVisibilitySnapshot;
|
|
3265
|
+
/** Canonical bytes of a verified snapshot, for durable storage. */
|
|
3266
|
+
declare function encodeKnowledgeVisibilitySnapshot(snapshot: KnowledgeVisibilitySnapshot): Uint8Array;
|
|
3267
|
+
/** Parse stored snapshot bytes and verify their schema and digest. */
|
|
3268
|
+
declare function decodeKnowledgeVisibilitySnapshot(bytes: Uint8Array): KnowledgeVisibilitySnapshot;
|
|
3269
|
+
/** Locator for snapshot bytes stored at `uri`. */
|
|
3270
|
+
declare function knowledgeVisibilityArtifactRef(input: {
|
|
3271
|
+
uri: string;
|
|
3272
|
+
bytes: Uint8Array;
|
|
3273
|
+
}): KnowledgeVisibilityArtifactRef;
|
|
3274
|
+
/**
|
|
3275
|
+
* Create a retrieval receipt over a precomputed snapshot. Every result must
|
|
3276
|
+
* occur in the snapshot with the same page id and bytes; the receipt stores the
|
|
3277
|
+
* snapshot's reference, not its entries.
|
|
3278
|
+
*/
|
|
2998
3279
|
declare function createKnowledgeRetrievalReceipt(input: CreateKnowledgeRetrievalReceiptInput): KnowledgeRetrievalReceipt;
|
|
2999
|
-
/**
|
|
3280
|
+
/**
|
|
3281
|
+
* Verify the receipt's schema, canonical digest, rank continuity, finite
|
|
3282
|
+
* scores, and well-formed visibility reference. This proves what the receipt
|
|
3283
|
+
* says; it does not prove that the results occur in the referenced snapshot.
|
|
3284
|
+
* Use `assertKnowledgeRetrievalMatchesVisibility` or
|
|
3285
|
+
* `assertKnowledgeRetrievalMatchesVisibilityArtifact` for that join.
|
|
3286
|
+
*/
|
|
3000
3287
|
declare function verifyKnowledgeRetrievalReceipt(receipt: KnowledgeRetrievalReceipt): KnowledgeRetrievalReceipt;
|
|
3001
|
-
/**
|
|
3002
|
-
|
|
3288
|
+
/**
|
|
3289
|
+
* Prove that the receipt references exactly this snapshot and that every
|
|
3290
|
+
* returned result occurs in it with the same page id and bytes. Pass the
|
|
3291
|
+
* snapshot itself, or the originated pages to snapshot them first.
|
|
3292
|
+
*/
|
|
3293
|
+
declare function assertKnowledgeRetrievalMatchesVisibility(receipt: KnowledgeRetrievalReceipt, visibility: KnowledgeVisibilitySnapshot | readonly OriginatedPage[]): void;
|
|
3294
|
+
/**
|
|
3295
|
+
* Load the snapshot artifact the receipt references, prove the stored bytes
|
|
3296
|
+
* match the reference, and prove every returned result occurs in the decoded
|
|
3297
|
+
* snapshot. A snapshot that cannot be obtained raises
|
|
3298
|
+
* `KnowledgeVisibilityUnavailableError`; it is never treated as empty.
|
|
3299
|
+
*/
|
|
3300
|
+
declare function assertKnowledgeRetrievalMatchesVisibilityArtifact(receipt: KnowledgeRetrievalReceipt, loadArtifact: KnowledgeVisibilityArtifactLoader): Promise<KnowledgeVisibilitySnapshot>;
|
|
3003
3301
|
/** Create a downstream-use receipt for one exact ranked result. */
|
|
3004
3302
|
declare function createKnowledgeUseReceipt(input: CreateKnowledgeUseReceiptInput): KnowledgeUseReceipt;
|
|
3005
3303
|
/** Verify one use receipt against the exact retrieval that authorized it. */
|
|
3006
3304
|
declare function verifyKnowledgeUseReceipt(receipt: KnowledgeUseReceipt, retrieval: KnowledgeRetrievalReceipt): KnowledgeUseReceipt;
|
|
3305
|
+
/** Record that one retrieval led to no use, with no rank to select. */
|
|
3306
|
+
declare function createKnowledgeRetrievalDisposition(input: CreateKnowledgeRetrievalDispositionInput): KnowledgeRetrievalDisposition;
|
|
3307
|
+
/** Verify one disposition against the exact retrieval that authorized it. */
|
|
3308
|
+
declare function verifyKnowledgeRetrievalDisposition(disposition: KnowledgeRetrievalDisposition, retrieval: KnowledgeRetrievalReceipt): KnowledgeRetrievalDisposition;
|
|
3309
|
+
//#endregion
|
|
3310
|
+
//#region src/lexical-index.d.ts
|
|
3311
|
+
/**
|
|
3312
|
+
* The token stream of one text: lower-cased, split on whitespace and
|
|
3313
|
+
* punctuation, single characters and stop words removed, and a CJK run
|
|
3314
|
+
* expanded into its bigrams and characters. Repeats are kept so a term
|
|
3315
|
+
* frequency can be counted. Indexing and querying share this function, so the
|
|
3316
|
+
* two vocabularies cannot drift.
|
|
3317
|
+
*/
|
|
3318
|
+
declare function tokenizeText(text: string): string[];
|
|
3319
|
+
/** The distinct query terms, in first-occurrence order. */
|
|
3320
|
+
declare function tokenizeQuery(query: string): string[];
|
|
3321
|
+
interface KnowledgeLexicalFieldBoosts {
|
|
3322
|
+
/** Multiplier for a term occurrence in the page title. Defaults to 3. */
|
|
3323
|
+
title?: number;
|
|
3324
|
+
/** Multiplier for a term occurrence in the page path without its extension. Defaults to 2. */
|
|
3325
|
+
path?: number;
|
|
3326
|
+
/** Multiplier for a term occurrence in the page body. Defaults to 1. */
|
|
3327
|
+
text?: number;
|
|
3328
|
+
}
|
|
3329
|
+
interface KnowledgeLexicalIndexOptions {
|
|
3330
|
+
/** Token stream of one text. Defaults to `tokenizeText`. */
|
|
3331
|
+
tokenize?: (text: string) => string[];
|
|
3332
|
+
fieldBoosts?: KnowledgeLexicalFieldBoosts;
|
|
3333
|
+
}
|
|
3334
|
+
interface KnowledgeLexicalPosting {
|
|
3335
|
+
/** Position of the page in `KnowledgeLexicalIndex.pages`. */
|
|
3336
|
+
ordinal: number;
|
|
3337
|
+
/** Field-boosted term frequency in that page. */
|
|
3338
|
+
tf: number;
|
|
3339
|
+
}
|
|
3340
|
+
/**
|
|
3341
|
+
* Inverted index over a fixed page list.
|
|
3342
|
+
*
|
|
3343
|
+
* Ordinals are positions in `pages`. `documentLengths` are field-boosted token
|
|
3344
|
+
* counts, so length normalization and term frequency use one scale.
|
|
3345
|
+
*/
|
|
3346
|
+
interface KnowledgeLexicalIndex {
|
|
3347
|
+
readonly pages: readonly KnowledgePage[];
|
|
3348
|
+
readonly postings: ReadonlyMap<string, readonly KnowledgeLexicalPosting[]>;
|
|
3349
|
+
readonly documentLengths: readonly number[];
|
|
3350
|
+
readonly averageDocumentLength: number;
|
|
3351
|
+
readonly documentCount: number;
|
|
3352
|
+
readonly tokenize: (text: string) => string[];
|
|
3353
|
+
readonly fieldBoosts: Readonly<Required<KnowledgeLexicalFieldBoosts>>;
|
|
3354
|
+
}
|
|
3355
|
+
interface Bm25Options {
|
|
3356
|
+
/** Term-frequency saturation. Defaults to 1.2. */
|
|
3357
|
+
k1?: number;
|
|
3358
|
+
/** Length-normalization strength in [0, 1]. Defaults to 0.75. */
|
|
3359
|
+
b?: number;
|
|
3360
|
+
}
|
|
3361
|
+
interface Bm25Hit {
|
|
3362
|
+
page: KnowledgePage;
|
|
3363
|
+
score: number;
|
|
3364
|
+
}
|
|
3365
|
+
declare function buildKnowledgeLexicalIndex(pages: readonly KnowledgePage[], options?: KnowledgeLexicalIndexOptions): KnowledgeLexicalIndex;
|
|
3366
|
+
/**
|
|
3367
|
+
* Okapi BM25 over the distinct query terms, with the Lucene inverse document
|
|
3368
|
+
* frequency `ln(1 + (N - df + 0.5) / (df + 0.5))`, which is positive for every
|
|
3369
|
+
* indexed term. Pages with no matching term are absent. The result is ordered
|
|
3370
|
+
* by score, then by path, so it does not depend on page order.
|
|
3371
|
+
*/
|
|
3372
|
+
declare function scoreBm25(index: KnowledgeLexicalIndex, tokens: readonly string[], options?: Bm25Options): Bm25Hit[];
|
|
3373
|
+
//#endregion
|
|
3374
|
+
//#region src/search.d.ts
|
|
3375
|
+
/**
|
|
3376
|
+
* Identity of the ranking `searchKnowledge` performs: BM25 over title, path,
|
|
3377
|
+
* and body, exact-title and phrase matches ahead of bag-of-words matches, and
|
|
3378
|
+
* reciprocal rank fusion with link and shared-source structure. Declare it as
|
|
3379
|
+
* the retriever id of a retrieval receipt minted from these results.
|
|
3380
|
+
*/
|
|
3381
|
+
declare const KNOWLEDGE_SEARCH_RETRIEVER_ID = "bm25-rrf-v1";
|
|
3382
|
+
interface SearchKnowledgeOptions {
|
|
3383
|
+
/** Maximum results returned. Defaults to 10. */
|
|
3384
|
+
limit?: number;
|
|
3385
|
+
/** Match pages whose stable id is one of these values. */
|
|
3386
|
+
pageIds?: readonly KnowledgeId[];
|
|
3387
|
+
/** Match pages carrying at least one of these tags. */
|
|
3388
|
+
tags?: readonly string[];
|
|
3389
|
+
/** Match the exact string stored in `frontmatter.kind`. */
|
|
3390
|
+
kinds?: readonly string[];
|
|
3391
|
+
/**
|
|
3392
|
+
* Drop pages whose own evidence refuted them. Defaults to false: a caller
|
|
3393
|
+
* that reads history needs them, and a silent change of what search returns
|
|
3394
|
+
* is worse than an explicit option.
|
|
3395
|
+
*/
|
|
3396
|
+
excludeInvalidated?: boolean;
|
|
3397
|
+
/** Additional caller-owned filter, applied before either ranking stage. */
|
|
3398
|
+
predicate?: (page: KnowledgePage) => boolean;
|
|
3399
|
+
/**
|
|
3400
|
+
* A lexical index built from exactly the searched pages, supplied by a caller
|
|
3401
|
+
* that searches one page set repeatedly. When absent, one is built for this
|
|
3402
|
+
* call.
|
|
3403
|
+
*/
|
|
3404
|
+
lexicalIndex?: KnowledgeLexicalIndex;
|
|
3405
|
+
}
|
|
3406
|
+
/**
|
|
3407
|
+
* A retrieval result with an explicit citation handle.
|
|
3408
|
+
*
|
|
3409
|
+
* `citationId` is exactly `page.id`; later writes should persist this value
|
|
3410
|
+
* when they cite the page. Keeping it at the result's top level prevents tool
|
|
3411
|
+
* renderers from accidentally hiding the only stable handle a model can copy.
|
|
3412
|
+
*/
|
|
3413
|
+
interface KnowledgeSearchHit extends KnowledgeSearchResult {
|
|
3414
|
+
citationId: KnowledgeId;
|
|
3415
|
+
}
|
|
3416
|
+
declare function searchKnowledge(index: KnowledgeIndex, query: string, limit?: number): KnowledgeSearchHit[];
|
|
3417
|
+
declare function searchKnowledge(index: KnowledgeIndex, query: string, options?: SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3418
|
+
/**
|
|
3419
|
+
* Rank a page set that is not a built index, such as the chain a run can see.
|
|
3420
|
+
*
|
|
3421
|
+
* `searchKnowledge` is this function over `index.pages`, so both entry points
|
|
3422
|
+
* rank identically and neither can drift from the other.
|
|
3423
|
+
*/
|
|
3424
|
+
declare function searchKnowledgePages(pages: readonly KnowledgePage[], query: string, limitOrOptions?: number | SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3425
|
+
declare function reciprocalRankFusion(rankLists: string[][], k?: number): Map<string, number>;
|
|
3426
|
+
//#endregion
|
|
3427
|
+
//#region src/knowledge-brief.d.ts
|
|
3428
|
+
/** Pages in a brief when the caller names no limit. */
|
|
3429
|
+
declare const DEFAULT_KNOWLEDGE_BRIEF_LIMIT = 5;
|
|
3430
|
+
interface KnowledgeBriefOptions {
|
|
3431
|
+
/** Maximum pages in the brief. Defaults to 5. */
|
|
3432
|
+
limit?: number;
|
|
3433
|
+
/**
|
|
3434
|
+
* Drop pages whose own evidence refuted them. Defaults to true, the opposite
|
|
3435
|
+
* of `searchKnowledge`: a brief is injected before a run's first token and
|
|
3436
|
+
* offers every page it names with an id ready to cite, so a refuted page in
|
|
3437
|
+
* it is an invitation to build on a dead claim.
|
|
3438
|
+
*/
|
|
3439
|
+
excludeInvalidated?: boolean;
|
|
3440
|
+
/** Match pages carrying at least one of these tags. */
|
|
3441
|
+
tags?: readonly string[];
|
|
3442
|
+
/** Match the exact string stored in `frontmatter.kind`. */
|
|
3443
|
+
kinds?: readonly string[];
|
|
3444
|
+
/**
|
|
3445
|
+
* Bound on the rendered brief. A page whose line does not fit is left out of
|
|
3446
|
+
* the whole brief, so `text`, `hits`, `citationIds`, and `results` always
|
|
3447
|
+
* describe one identical set of pages.
|
|
3448
|
+
*/
|
|
3449
|
+
maxChars?: number;
|
|
3450
|
+
}
|
|
3451
|
+
interface KnowledgeBrief {
|
|
3452
|
+
readonly question: string;
|
|
3453
|
+
/** Retriever id to declare in a receipt minted from `results`. */
|
|
3454
|
+
readonly retrieverId: typeof KNOWLEDGE_SEARCH_RETRIEVER_ID;
|
|
3455
|
+
/**
|
|
3456
|
+
* Digest of the retrieval settings this brief used. Pass it as the
|
|
3457
|
+
* `configDigest` of the receipt's retriever identity. The running package
|
|
3458
|
+
* version is the caller's to declare, because a bundled build cannot read it.
|
|
3459
|
+
*/
|
|
3460
|
+
readonly retrieverConfigDigest: Sha256Digest;
|
|
3461
|
+
readonly hits: readonly KnowledgeSearchHit[];
|
|
3462
|
+
/** The ids a write should persist in `cites`, in rank order. */
|
|
3463
|
+
readonly citationIds: readonly KnowledgeId[];
|
|
3464
|
+
/** Ranked results in the shape `createKnowledgeRetrievalReceipt` takes. */
|
|
3465
|
+
readonly results: readonly OriginatedKnowledgeSearchResult[];
|
|
3466
|
+
/** Deterministic Markdown: one `- [id] title — snippet` line per page, in rank order. */
|
|
3467
|
+
readonly text: string;
|
|
3468
|
+
}
|
|
3469
|
+
/**
|
|
3470
|
+
* Rank the knowledge one question can see and render it for injection.
|
|
3471
|
+
*
|
|
3472
|
+
* The same page set produces the same brief on every run: ranking, ordering,
|
|
3473
|
+
* and rendering are deterministic, and no field carries a timestamp.
|
|
3474
|
+
*/
|
|
3475
|
+
declare function buildKnowledgeBrief(visiblePages: readonly OriginatedPage[], question: string, options?: KnowledgeBriefOptions): KnowledgeBrief;
|
|
3476
|
+
//#endregion
|
|
3477
|
+
//#region src/knowledge-tools.d.ts
|
|
3478
|
+
interface CreateKnowledgeToolsOptions {
|
|
3479
|
+
readonly stores: RunScopedStores;
|
|
3480
|
+
/** The run whose store is written and whose chain is read. */
|
|
3481
|
+
readonly runId: string;
|
|
3482
|
+
/**
|
|
3483
|
+
* Version of this package the host is running. A bundled build cannot read
|
|
3484
|
+
* its own manifest, and a receipt that guessed the version would be a
|
|
3485
|
+
* receipt that lies about what ranked the results.
|
|
3486
|
+
*/
|
|
3487
|
+
readonly retrieverVersion: string;
|
|
3488
|
+
readonly actorId?: string;
|
|
3489
|
+
readonly pagesDirectory?: string;
|
|
3490
|
+
/** Intake settings for `knowledge_record`. Absent leaves the write ungated. */
|
|
3491
|
+
readonly intake?: Omit<KnowledgeWriteIntakeRequest, 'inheritedPages'>;
|
|
3492
|
+
/** Brief settings for `knowledge_search`, overridden per call by the tool input. */
|
|
3493
|
+
readonly brief?: Omit<KnowledgeBriefOptions, 'limit'>;
|
|
3494
|
+
/** Durable sink for every minted retrieval receipt. */
|
|
3495
|
+
readonly recordRetrieval?: (receipt: KnowledgeRetrievalReceipt) => Promise<void> | void;
|
|
3496
|
+
readonly now?: () => Date;
|
|
3497
|
+
}
|
|
3498
|
+
/**
|
|
3499
|
+
* The four tools an agent needs to use a knowledge store: search, read, record,
|
|
3500
|
+
* resolve.
|
|
3501
|
+
*/
|
|
3502
|
+
declare function createKnowledgeTools(options: CreateKnowledgeToolsOptions): ToolDefinition[];
|
|
3007
3503
|
//#endregion
|
|
3008
3504
|
//#region src/lint.d.ts
|
|
3009
3505
|
declare function lintKnowledgeIndex(index: KnowledgeIndex): KnowledgeLintFinding[];
|
|
@@ -3103,6 +3599,65 @@ declare function inspectPendingKnowledgeMutation(root: string): Promise<PendingK
|
|
|
3103
3599
|
declare function recoverPendingKnowledgeMutation(root: string, options: RecoverPendingKnowledgeMutationOptions): Promise<void>;
|
|
3104
3600
|
declare function withKnowledgeRead<T>(root: string, read: () => Promise<T> | T, options?: KnowledgeReadOptions): Promise<T>;
|
|
3105
3601
|
//#endregion
|
|
3602
|
+
//#region src/promotion.d.ts
|
|
3603
|
+
declare const KNOWLEDGE_PROMOTION_SCHEMA_VERSION: '1.0.0';
|
|
3604
|
+
declare const KNOWLEDGE_PROMOTION_DIGEST_ALGORITHM: 'rfc8785-sha256';
|
|
3605
|
+
/** Root-relative directory holding one JSON record per promotion. */
|
|
3606
|
+
declare const KNOWLEDGE_PROMOTIONS_DIRECTORY = ".agent-knowledge/promotions";
|
|
3607
|
+
type KnowledgePromotionErrorCode = 'unknown-page' | 'ambiguous-support' | 'id-conflict' | 'path-conflict';
|
|
3608
|
+
/** A promotion that cannot be performed exactly as asked. */
|
|
3609
|
+
declare class KnowledgePromotionError extends Error {
|
|
3610
|
+
readonly code: KnowledgePromotionErrorCode;
|
|
3611
|
+
constructor(code: KnowledgePromotionErrorCode, message: string);
|
|
3612
|
+
}
|
|
3613
|
+
interface KnowledgePromotionEntry {
|
|
3614
|
+
readonly pageId: KnowledgeId;
|
|
3615
|
+
readonly path: string;
|
|
3616
|
+
/** Where the page was read from in the source run's chain. */
|
|
3617
|
+
readonly sourceOrigin: PageOrigin;
|
|
3618
|
+
readonly pageDigest: Sha256Digest;
|
|
3619
|
+
/** False when the page travelled only because a promoted page cites it. */
|
|
3620
|
+
readonly requested: boolean;
|
|
3621
|
+
}
|
|
3622
|
+
/** Immutable record of one promotion into a shared store. */
|
|
3623
|
+
interface KnowledgePromotionRecord {
|
|
3624
|
+
readonly schemaVersion: typeof KNOWLEDGE_PROMOTION_SCHEMA_VERSION;
|
|
3625
|
+
readonly kind: 'knowledge-promotion';
|
|
3626
|
+
readonly digestAlgorithm: typeof KNOWLEDGE_PROMOTION_DIGEST_ALGORITHM;
|
|
3627
|
+
readonly recordDigest: Sha256Digest;
|
|
3628
|
+
readonly createdAt: string;
|
|
3629
|
+
readonly runId: string;
|
|
3630
|
+
readonly actor: string;
|
|
3631
|
+
readonly reason: string;
|
|
3632
|
+
/** Promoted pages first, then carried support, each group in path order. */
|
|
3633
|
+
readonly entries: readonly KnowledgePromotionEntry[];
|
|
3634
|
+
}
|
|
3635
|
+
interface PromoteRunScopedPagesOptions extends KnowledgePagesOptions {
|
|
3636
|
+
/** Stable ids of the pages this run authored and wants in shared scope. */
|
|
3637
|
+
readonly pageIds: readonly KnowledgeId[];
|
|
3638
|
+
/** The curated store every run reads and no run writes directly. */
|
|
3639
|
+
readonly sharedRoot: string;
|
|
3640
|
+
/** Who decided to promote. */
|
|
3641
|
+
readonly actor: string;
|
|
3642
|
+
/** Why this knowledge belongs in shared scope. */
|
|
3643
|
+
readonly reason: string;
|
|
3644
|
+
readonly now?: () => Date;
|
|
3645
|
+
}
|
|
3646
|
+
/**
|
|
3647
|
+
* Promote pages a run authored into the shared store, with their cited support.
|
|
3648
|
+
*
|
|
3649
|
+
* Support keeps its own evidence fields exactly as written, so a promoted claim
|
|
3650
|
+
* cannot inherit a confidence its support does not carry. Pages travel as the
|
|
3651
|
+
* bytes their store holds.
|
|
3652
|
+
*
|
|
3653
|
+
* Re-running the same promotion is safe: unchanged pages produce no file
|
|
3654
|
+
* mutation and the record is content-addressed, so it lands at the same path
|
|
3655
|
+
* with the same bytes.
|
|
3656
|
+
*/
|
|
3657
|
+
declare function promoteRunScopedPages(stores: RunScopedStores, runId: string, options: PromoteRunScopedPagesOptions): Promise<KnowledgePromotionRecord>;
|
|
3658
|
+
/** Read one promotion record written by `promoteRunScopedPages`. */
|
|
3659
|
+
declare function loadKnowledgePromotionRecord(sharedRoot: string, recordDigest: Sha256Digest): Promise<KnowledgePromotionRecord | null>;
|
|
3660
|
+
//#endregion
|
|
3106
3661
|
//#region src/propose-from-finding.d.ts
|
|
3107
3662
|
interface KnowledgeProposal {
|
|
3108
3663
|
/**
|
|
@@ -3190,6 +3745,71 @@ interface KnowledgeBaseReadinessEvaluation {
|
|
|
3190
3745
|
}
|
|
3191
3746
|
declare function evaluateKnowledgeBaseReadiness(options: EvaluateKnowledgeBaseReadinessOptions): Promise<KnowledgeBaseReadinessEvaluation>;
|
|
3192
3747
|
//#endregion
|
|
3748
|
+
//#region src/relation-graph.d.ts
|
|
3749
|
+
type KnowledgeRelationGraphErrorCode = 'invalid-node' | 'duplicate-node' | 'invalid-relation' | 'duplicate-relation' | 'undeclared-endpoint' | 'unknown-node' | 'invalid-query';
|
|
3750
|
+
/** A relation graph input or query that cannot be honored exactly. */
|
|
3751
|
+
declare class KnowledgeRelationGraphError extends Error {
|
|
3752
|
+
readonly code: KnowledgeRelationGraphErrorCode;
|
|
3753
|
+
constructor(code: KnowledgeRelationGraphErrorCode, message: string);
|
|
3754
|
+
}
|
|
3755
|
+
interface BuildKnowledgeRelationGraphInput {
|
|
3756
|
+
/**
|
|
3757
|
+
* Declared node inventory. When present, every relation endpoint must name
|
|
3758
|
+
* one declared node; an undeclared endpoint is refused rather than added.
|
|
3759
|
+
* When absent, the graph carries edges only and `nodes` is empty.
|
|
3760
|
+
*/
|
|
3761
|
+
nodes?: readonly KnowledgeRelationNode[];
|
|
3762
|
+
relations: readonly KnowledgeRelation[];
|
|
3763
|
+
}
|
|
3764
|
+
/**
|
|
3765
|
+
* `out` follows `sourceId -> targetId`, `in` follows `targetId -> sourceId`,
|
|
3766
|
+
* `both` follows a relation from either end.
|
|
3767
|
+
*/
|
|
3768
|
+
type KnowledgeRelationDirection = 'out' | 'in' | 'both';
|
|
3769
|
+
interface KnowledgeRelationQuery {
|
|
3770
|
+
/** Restrict to relations with this predicate. Every predicate when absent. */
|
|
3771
|
+
predicate?: string;
|
|
3772
|
+
direction: KnowledgeRelationDirection;
|
|
3773
|
+
}
|
|
3774
|
+
interface KnowledgeRelationWalkOptions extends KnowledgeRelationQuery {
|
|
3775
|
+
/** Most relations between the start node and a reported node. Unbounded when absent. */
|
|
3776
|
+
maxDepth?: number;
|
|
3777
|
+
}
|
|
3778
|
+
interface KnowledgeRelationNeighbor {
|
|
3779
|
+
nodeId: KnowledgeId;
|
|
3780
|
+
relation: KnowledgeRelation;
|
|
3781
|
+
}
|
|
3782
|
+
interface KnowledgeRelationWalkStep {
|
|
3783
|
+
nodeId: KnowledgeId;
|
|
3784
|
+
/** Number of relations between the start node and this node. */
|
|
3785
|
+
depth: number;
|
|
3786
|
+
/** The node the search came from when it first reached this node. */
|
|
3787
|
+
from: KnowledgeId;
|
|
3788
|
+
relation: KnowledgeRelation;
|
|
3789
|
+
}
|
|
3790
|
+
/**
|
|
3791
|
+
* Build a labeled multi-edge graph from caller relations.
|
|
3792
|
+
*
|
|
3793
|
+
* The graph keeps one edge per `(sourceId, targetId, predicate)`, in first-seen
|
|
3794
|
+
* order. A repeated triple is accepted only when its weight and metadata are
|
|
3795
|
+
* identical in canonical JSON; any other repeat is a conflict and is refused.
|
|
3796
|
+
* Node and relation metadata must be finite, acyclic JSON so the graph
|
|
3797
|
+
* round-trips through `KnowledgeRelationGraphSchema` unchanged.
|
|
3798
|
+
*/
|
|
3799
|
+
declare function buildKnowledgeRelationGraph(input: BuildKnowledgeRelationGraphInput): KnowledgeRelationGraph;
|
|
3800
|
+
/** Relations touching `id`, each with the node at the other end, in graph order. */
|
|
3801
|
+
declare function neighbors(graph: KnowledgeRelationGraph, id: KnowledgeId, query: KnowledgeRelationQuery): KnowledgeRelationNeighbor[];
|
|
3802
|
+
/**
|
|
3803
|
+
* Breadth-first traversal from `id` over matching relations. Each reachable
|
|
3804
|
+
* node is reported once, at the depth where the search first reached it; the
|
|
3805
|
+
* start node is never reported, so a cycle back to it adds no step.
|
|
3806
|
+
*/
|
|
3807
|
+
declare function walk(graph: KnowledgeRelationGraph, id: KnowledgeId, options: KnowledgeRelationWalkOptions): KnowledgeRelationWalkStep[];
|
|
3808
|
+
/**
|
|
3809
|
+
* Whether `to` is `from` or lies on a path of matching relations out of `from`.
|
|
3810
|
+
*/
|
|
3811
|
+
declare function isReachable(graph: KnowledgeRelationGraph, from: KnowledgeId, to: KnowledgeId, query: KnowledgeRelationQuery): boolean;
|
|
3812
|
+
//#endregion
|
|
3193
3813
|
//#region src/release.d.ts
|
|
3194
3814
|
interface KnowledgeReleaseReport {
|
|
3195
3815
|
release: KnowledgeRelease;
|
|
@@ -3426,6 +4046,34 @@ declare const KnowledgeGraphEdgeSchema: z.ZodObject<{
|
|
|
3426
4046
|
weight: z.ZodNumber;
|
|
3427
4047
|
reasons: z.ZodArray<z.ZodString>;
|
|
3428
4048
|
}, z.core.$strip>;
|
|
4049
|
+
declare const KnowledgeRelationSchema: z.ZodObject<{
|
|
4050
|
+
sourceId: z.ZodString;
|
|
4051
|
+
targetId: z.ZodString;
|
|
4052
|
+
predicate: z.ZodString;
|
|
4053
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
4054
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4055
|
+
}, z.core.$strip>;
|
|
4056
|
+
declare const KnowledgeRelationNodeSchema: z.ZodObject<{
|
|
4057
|
+
id: z.ZodString;
|
|
4058
|
+
kind: z.ZodString;
|
|
4059
|
+
label: z.ZodOptional<z.ZodString>;
|
|
4060
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4061
|
+
}, z.core.$strip>;
|
|
4062
|
+
declare const KnowledgeRelationGraphSchema: z.ZodObject<{
|
|
4063
|
+
nodes: z.ZodArray<z.ZodObject<{
|
|
4064
|
+
id: z.ZodString;
|
|
4065
|
+
kind: z.ZodString;
|
|
4066
|
+
label: z.ZodOptional<z.ZodString>;
|
|
4067
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4068
|
+
}, z.core.$strip>>;
|
|
4069
|
+
edges: z.ZodArray<z.ZodObject<{
|
|
4070
|
+
sourceId: z.ZodString;
|
|
4071
|
+
targetId: z.ZodString;
|
|
4072
|
+
predicate: z.ZodString;
|
|
4073
|
+
weight: z.ZodOptional<z.ZodNumber>;
|
|
4074
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4075
|
+
}, z.core.$strip>>;
|
|
4076
|
+
}, z.core.$strip>;
|
|
3429
4077
|
declare const KnowledgeIndexSchema: z.ZodObject<{
|
|
3430
4078
|
root: z.ZodString;
|
|
3431
4079
|
generatedAt: z.ZodString;
|
|
@@ -3632,34 +4280,6 @@ declare const KnowledgeBaseCandidateSchema: z.ZodObject<{
|
|
|
3632
4280
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
3633
4281
|
}, z.core.$strip>;
|
|
3634
4282
|
//#endregion
|
|
3635
|
-
//#region src/search.d.ts
|
|
3636
|
-
interface SearchKnowledgeOptions {
|
|
3637
|
-
/** Maximum results returned. Defaults to 10. */
|
|
3638
|
-
limit?: number;
|
|
3639
|
-
/** Match pages whose stable id is one of these values. */
|
|
3640
|
-
pageIds?: readonly KnowledgeId[];
|
|
3641
|
-
/** Match pages carrying at least one of these tags. */
|
|
3642
|
-
tags?: readonly string[];
|
|
3643
|
-
/** Match the exact string stored in `frontmatter.kind`. */
|
|
3644
|
-
kinds?: readonly string[];
|
|
3645
|
-
/** Additional caller-owned filter, applied before either ranking stage. */
|
|
3646
|
-
predicate?: (page: KnowledgePage) => boolean;
|
|
3647
|
-
}
|
|
3648
|
-
/**
|
|
3649
|
-
* A retrieval result with an explicit citation handle.
|
|
3650
|
-
*
|
|
3651
|
-
* `citationId` is exactly `page.id`; later writes should persist this value
|
|
3652
|
-
* when they cite the page. Keeping it at the result's top level prevents tool
|
|
3653
|
-
* renderers from accidentally hiding the only stable handle a model can copy.
|
|
3654
|
-
*/
|
|
3655
|
-
interface KnowledgeSearchHit extends KnowledgeSearchResult {
|
|
3656
|
-
citationId: KnowledgeId;
|
|
3657
|
-
}
|
|
3658
|
-
declare function searchKnowledge(index: KnowledgeIndex, query: string, limit?: number): KnowledgeSearchHit[];
|
|
3659
|
-
declare function searchKnowledge(index: KnowledgeIndex, query: string, options?: SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3660
|
-
declare function tokenizeQuery(query: string): string[];
|
|
3661
|
-
declare function reciprocalRankFusion(rankLists: string[][], k?: number): Map<string, number>;
|
|
3662
|
-
//#endregion
|
|
3663
4283
|
//#region src/wikilinks.d.ts
|
|
3664
4284
|
declare const WIKILINK_REGEX: RegExp;
|
|
3665
4285
|
declare function extractWikilinks(content: string): string[];
|
|
@@ -3669,5 +4289,5 @@ declare function normalizeLinkTarget(target: string): string;
|
|
|
3669
4289
|
declare function isSafeKnowledgePath(path: string, allowedPrefixes?: string[]): boolean;
|
|
3670
4290
|
declare function parseKnowledgeWriteBlocks(text: string, allowedPrefixes?: string[]): KnowledgeWriteParseResult;
|
|
3671
4291
|
//#endregion
|
|
3672
|
-
export { AdaptiveDecision, AdaptiveDriverOptions, AdaptiveResearchDriver, AdaptiveStats, AddSourceOptions, AddSourceTextInput, AgentMemoryAcquireRunLease, type AgentMemoryActivation, type AgentMemoryActivationDriver, AgentMemoryAdapter, type AgentMemoryAttemptEvent, AgentMemoryBranch, AgentMemoryBranchIsolation, AgentMemoryBranchLifetime, AgentMemoryBranchSnapshot, AgentMemoryContext, AgentMemoryControllerMode, type AgentMemoryDimensionComparison, type AgentMemoryEvidenceRef, type AgentMemoryExecutionContext, type AgentMemoryExecutionCostMeter, type AgentMemoryExecutionCostReceipt, type AgentMemoryExecutionPaidCallInput, type AgentMemoryExecutionPaidCallResult, type AgentMemoryExecutionStep, type AgentMemoryExperimentCandidate, type AgentMemoryExperimentCandidateRef, type AgentMemoryExperimentComparisonRef, type AgentMemoryExperimentRankingRow, type AgentMemoryExperimentRunLease, type AgentMemoryFinalEvaluation, type AgentMemoryFinalPair, type AgentMemoryForgettingComparison, AgentMemoryHit, AgentMemoryHitSchema, type AgentMemoryImprovementRunLease, AgentMemoryJournalEntry, AgentMemoryKind, AgentMemoryKindSchema, type AgentMemoryLearningArmOrder, type AgentMemoryLearningCandidateSummary, type AgentMemoryLearningCellComparison, type AgentMemoryLearningComparison, AgentMemoryLifecycleTimeoutError, AgentMemoryLifecycleUnsafeError, type AgentMemoryMode, type AgentMemoryPromotionDecision, AgentMemoryRunLease, AgentMemoryScope, AgentMemoryScopeSchema, AgentMemorySearchOptions, type AgentMemorySequence, type AgentMemorySequenceArtifact, type AgentMemorySequenceProbe, type AgentMemorySequenceProbeResult, type AgentMemorySequenceScenario, type AgentMemorySequenceStep, AgentMemorySharingPolicy, type AgentMemoryTransferCellComparison, type AgentMemoryTransferStepSummary, AgentMemoryVisibility, AgentMemoryWriteInput, AgentMemoryWriteInputSchema, AgentMemoryWriteResult, ApplyWriteBlocksResult, AuditKnowledgeCitationsOptions, type BuildAgentMemorySequencesFromBenchmarkCasesOptions, BuildEvalKnowledgeBundleOptions, type BuildRetrievalBenchmarkCasesFromQrelsOptions, BuildRetrievalEvalDispatchOptions, CHECKABLE_RUNG_THRESHOLD, CheckExecution, ChunkingOptions, ClaimEvidence, ClaimGrade, ClaimGroundingDriverOptions, ClaimLedgerGoalConflictError, ClaimLedgerMigrationRequiredError, ClaimLedgerStore, ClaimRef, ClaimVerdict, CompanyEvalCase, type CompareAgentMemoryLearningOptions, CornellLiiSelector, CornellLiiSourceOptions, CreateAgentMemoryBranchOptions, CreateKnowledgeRetrievalReceiptInput, CreateKnowledgeUseReceiptInput, D1Adapter, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, DedupReason, DeepQuestion, DeepQuestionKind, DeepQuestionSchema, DefineReadinessSpecInput, DetectChangesOptions, DetectChangesResult, DiscoveryLoopResult, DiscoveryLoopRound, DiscoveryLoopStopReason, DiscoveryResult, DiscoveryTask, DriverResearchContext, EvalKnowledgeBundleBuildResult, EvaluateKnowledgeBaseReadinessOptions, EvidenceRung, ExpectedGroup, type ExternalRagEvalScore, FactResult, FetchOpts, FileSystemFreshnessStoreOptions, FileSystemKbStore, FileSystemKbStoreOptions, FileSystemSearchOptions, FileSystemSearchProvider, FileSystemSearchProviderOptions, ForkAgentMemoryBranchSnapshotOptions, FragmentProvenance, FreshnessKey, FreshnessMark, FreshnessRecord, FreshnessTtl, GraphitiMcpClientLike, GraphitiMemoryAdapterOptions, GraphitiToolNames, GroundClaimOptions, GroundingResult, INDUSTRY_MEMORY_BENCHMARKS, INDUSTRY_RAG_BENCHMARKS, IRS_DIMENSION_HINTS, type ImproveSelectedKnowledgeCandidateOptions, type ImproveSelectedKnowledgeCandidateResult, IrsPublicationsSourceOptions, KB_CLAIM_LEDGER_DIR, KB_EVENTS_PATH, KB_INDEX_PATH, KB_STORE_DIR, KNOWLEDGE_EVENT_TYPES, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION, KbStore, type KnowledgeAnswerBenchmarkCase, type KnowledgeAnswerBenchmarkTaskKind, KnowledgeBaseCandidate, KnowledgeBaseCandidateSchema, type KnowledgeBaseQualityOptions, type KnowledgeBaseQualityReport, KnowledgeBaseReadinessEvaluation, type KnowledgeBenchmarkArtifact, type KnowledgeBenchmarkCase, type KnowledgeBenchmarkCaseBase, type KnowledgeBenchmarkDistribution, type KnowledgeBenchmarkEvaluation, type KnowledgeBenchmarkFamily, type KnowledgeBenchmarkReport, type KnowledgeBenchmarkResponder, type KnowledgeBenchmarkScenario, type KnowledgeBenchmarkSliceSummary, type KnowledgeBenchmarkSource, type KnowledgeBenchmarkSpec, type KnowledgeBenchmarkSplit, type KnowledgeBenchmarkTaskKind, KnowledgeChange, KnowledgeChangeKind, KnowledgeChunk, KnowledgeCitationAuditError, KnowledgeCitationAuditIssue, KnowledgeCitationAuditIssueKind, KnowledgeCitationAuditReport, KnowledgeCitationCandidate, KnowledgeCitationReference, KnowledgeCitationResolution, KnowledgeCitationResolutionError, KnowledgeCitationResolutionStatus, KnowledgeClaim, type KnowledgeClaimMatcher, KnowledgeConsumerKind, KnowledgeConsumerRef, KnowledgeControlLoopAction, KnowledgeControlLoopActionResult, KnowledgeControlLoopAdapter, KnowledgeControlLoopAdapterOptions, KnowledgeControlLoopState, KnowledgeDiscoveryDispatcher, KnowledgeDiscoveryWorker, type KnowledgeEvaluationPhase, KnowledgeEvent, KnowledgeEventQuery, KnowledgeEventSchema, KnowledgeEventType, KnowledgeExplanation, KnowledgeFragment, KnowledgeFreshnessStore, KnowledgeGap, KnowledgeGraph, KnowledgeGraphEdge, KnowledgeGraphEdgeSchema, KnowledgeGraphNode, KnowledgeGraphNodeSchema, KnowledgeId, type KnowledgeImprovementActivationPersistence, type KnowledgeImprovementCandidateRecord, type KnowledgeImprovementCandidateRef, KnowledgeImprovementCandidateRefSchema, type KnowledgeImprovementEvaluationInput, type KnowledgeImprovementEvaluator, type KnowledgeImprovementEvent, type KnowledgeImprovementEvidence, KnowledgeImprovementEvidenceSchema, type KnowledgeImprovementMetric, type KnowledgeImprovementMetricProvenance, type KnowledgeImprovementMutationReceipt, type KnowledgeImprovementMutationResult, type KnowledgeImprovementOptions, type KnowledgeImprovementRagOptimizationOptions, type KnowledgeImprovementRagOptimizationRunInput, type KnowledgeImprovementResult, type KnowledgeImprovementRetrievalOptions, type KnowledgeImprovementRunState, KnowledgeImprovementRunStateSchema, type KnowledgeImprovementStatus, type KnowledgeImprovementTarget, type KnowledgeImprovementUpdate, type KnowledgeImprovementUpdateInput, KnowledgeIndex, KnowledgeIndexSchema, KnowledgeInspection, KnowledgeLayout, KnowledgeLintFinding, type KnowledgeMemoryBenchmarkCase, type KnowledgeMemoryBenchmarkTaskKind, type KnowledgeMemoryEvent, type KnowledgeMemoryFactMatcher, type KnowledgeMutationLock, type KnowledgeMutationOptions, KnowledgePage, KnowledgePageInvalidation, KnowledgePageInvalidationSchema, KnowledgePageSchema, KnowledgePolicy, type KnowledgePolicyDispatch, KnowledgeProposal, KnowledgeProposalParseError, type KnowledgeReadOptions, KnowledgeReadinessSpec, KnowledgeReceiptAttributeValue, KnowledgeRelation, KnowledgeRelease, KnowledgeReleaseInput, KnowledgeReleaseReport, KnowledgeResearchLoopContext, KnowledgeResearchLoopDecision, KnowledgeResearchLoopResult, KnowledgeResearchLoopStep, type KnowledgeRetrievalBenchmarkCase, type KnowledgeRetrievalBenchmarkQrel, type KnowledgeRetrievalBenchmarkQuery, KnowledgeRetrievalReceipt, KnowledgeRetrievalResultReceipt, KnowledgeRetrieverIdentity, KnowledgeSearchHit, KnowledgeSearchResult, KnowledgeSource, KnowledgeUnit, KnowledgeUseReceipt, KnowledgeUseRelation, KnowledgeUsedResult, KnowledgeVisibilitySnapshot, KnowledgeVisibilitySnapshotEntry, KnowledgeWriteBlock, KnowledgeWriteParseResult, type LoadKnowledgeImprovementActivationResultOptions, LoadKnowledgePagesOptions, MAX_RESPONSE_BYTES, MIN_REQUEST_GAP_MS, MaterialFact, MaterialFactLens, MaterialFactsResult, type MeasuredKnowledgeSelectionReceipt, Mem0ClientMode, Mem0HostedClient, Mem0HostedMemoryAdapterOptions, Mem0MemoryAdapterOptions, Mem0OssClient, Mem0OssMemoryAdapterOptions, type MemoryAdapterBenchmarkCandidate, type MemoryAdapterBenchmarkRankingRow, type MemoryConfigScenario, MemoryKbStore, type NearDuplicateDetectionOptions, type NearDuplicatePair, type NearDuplicateReport, Neo4jAgentMemoryAdapterOptions, type OptimizeKnowledgeBasePolicyOptions, type OptimizeKnowledgeBasePolicyResult, OriginatedKnowledgeSearchResult, OriginatedPage, OwnedAgentMemoryRunLease, POLITE_USER_AGENT, PageOrigin, ParsedFrontmatter, PartitionRetrievalScenariosOptions, type PendingKnowledgeMutation, PersistentResearchDrivingDriverOptions, PoliteFetchOptions, PoliteFetchResult, type PromoteKnowledgeCandidateOptions, ProposeFromFindingsResult, READINESS_SPEC_DEFAULTS, RUN_LINEAGE_BASENAME, type RagAnswerEvalArtifact, type RagAnswerEvalCase, type RagAnswerEvalScenario, type RagAnswerMetricSummary, type RagAnswerQualityHookOptions, RagAnswerQualityInput, type RagAnswerQualityJudgeOptions, RagAnswerQualityResult, type RagCalibrationOptions, type RagCalibrationResult, RagDiagnosisInput, type RagEvalCitation, type RagEvalClaim, type RagEvalContext, type RagEvalMetricKey, type RagEvalProvider, type RagEvalSlice, RagGapFinding, RagGapKind, RagGapSeverity, RagKnowledgeAcquisitionInput, RagKnowledgeImprovementPhase, RagKnowledgeImprovementPhaseResult, RagKnowledgeImprovementPhaseStatus, RagKnowledgeResearchOptions, RagKnowledgeUpdateInput, RagKnowledgeUpdateResult, RagOptimizationConfig, RagOptimizationSelection, RagPhaseInputBase, RagPromotionInput, RagPromotionResult, type RagRequiredContext, type RecoverPendingKnowledgeMutationOptions, RegularFileSnapshot, RejectedSource, ResearchClaimEvidence, ResearchClaimEvidenceSchema, ResearchClaimLedger, ResearchClaimLedgerSchema, ResearchClaimRecord, ResearchClaimRecordSchema, ResearchContribution, ResearchDriver, ResearchDrivingDriver, ResearchDrivingDriverOptions, ResearchDrivingState, ResearchDrivingSteer, ResearchSourceProposal, ResearchSourceVersion, ResearchSourceVersionSchema, ResearchWorker, type ResolvedKnowledgeImprovementCandidate, type ResolvedKnowledgeImprovementComparison, type ResolvedKnowledgeImprovementComparisonSnapshot, type RestoreKnowledgeCandidateBaselineOptions, RetrievalConfig, RetrievalEvalArtifact, RetrievalEvalRetriever, RetrievalEvalRetrieverInput, RetrievalEvalRetrieverResult, RetrievalEvalScenario, RetrievalGoldTarget, RetrievalHoldoutBypassReason, RetrievalHoldoutCallContext, RetrievalHoldoutConfig, RetrievalHoldoutEligibleItem, RetrievalHoldoutEvent, RetrievalHoldoutOffPolicyOptions, RetrievalHoldoutOffPolicyResult, RetrievalHoldoutResult, RetrievalHoldoutSessionState, RetrievalHoldoutSessionSummary, RetrievalMetricSummary, RetrievalMetricWeights, RetrievalOptimizationSelection, RetrievalRecallJudgeOptions, RetrievalScenarioPartitions, RetrievedKnowledgeHit, RetrievedSourceSpan, RouterClient, RouterError, RouterUsage, type RunAgentMemoryExperimentOptions, type RunAgentMemoryExperimentResult, type RunAgentMemoryImprovementOptions, type RunAgentMemoryImprovementResult, type RunAgentMemoryLearningExperimentOptions, type RunAgentMemoryLearningExperimentResult, RunDiscoveryLoopOptions, type RunKnowledgeBenchmarkSuiteOptions, type RunKnowledgeBenchmarkSuiteResult, RunKnowledgeResearchLoopOptions, RunLineageAuthority, RunLineageRecord, type RunMemoryAdapterBenchmarkOptions, type RunMemoryAdapterBenchmarkResult, RunRagKnowledgeImprovementLoopOptions, RunRagKnowledgeImprovementLoopResult, RunRagOptimizationOptions, RunRagOptimizationResult, RunRetrievalImprovementLoopOptions, RunRetrievalImprovementLoopResult, RunScopedStores, RunScopedStoresOptions, RunSerializedKnowledgeOptimizationOptions, RunSerializedKnowledgeOptimizationResult, SCAFFOLD_PAGE_BASENAMES, SearchKnowledgeOptions, SerializedCandidate, SerializedCandidateCodec, SourceAdapter, SourceAdapterInput, SourceAdapterOutput, SourceAnchor, SourceAnchorSchema, SourceFreshnessInspection, SourceRecord, SourceRecordSchema, SourceRegistry, SourceVerdict, SourceVerificationContext, StateSosEntity, StateSosSourceConfig, TangleRouterOptions, ThesisRunOptions, ThesisRunResult, ThesisTaskInput, TrackedClaim, TriageClass, UncheckableClaimError, type UseKnowledgeImprovementCandidateOptions, ValidateKnowledgeOptions, ValidateKnowledgeResult, VerifiedGradeableEvidence, VerifiedResearchLoopOptions, VerifiedResearchLoopResult, VerifiedResearchRound, VerifyGradeableEvidenceOptions, VerifyingDriverOptions, WIKILINK_REGEX, WebResearchWorkerOptions, WebSearchHit, WorkerClaimDecorationOptions, WorkerResearchContext, __resetHttpThrottle, acquireAgentMemoryRunLease, addSourcePath, addSourceText, agentMemorySequenceJudge, applyKnowledgeWriteBlocks, applyKnowledgeWriteBlocksFile, applyRetrievalHoldout, applySessionStickyRetrievalHoldout, assertClaimLedgerId, assertCurrentRunCitationsResolved, assertDeepQuestionIntegrity, assertGradeableEvidence, assertKnowledgeCitationAudit, assertKnowledgeCitationsResolved, assertKnowledgeRetrievalMatchesVisibility, assertResearchClaimEvidenceIntegrity, assertResearchClaimLedgerIntegrity, assertRunScopedCitationsResolved, assertTrackedClaimIntegrity, auditCurrentRunCitations, auditKnowledgeCitations, buildAgentMemorySequenceScenarios, buildAgentMemorySequencesFromBenchmarkCases, buildEvalKnowledgeBundle, buildFirstPartyMemoryLifecycleBenchmarkCases, buildIndustryMemoryBenchmarkSmokeCases, buildIndustryRagBenchmarkSmokeCases, buildKnowledgeBenchmarkScenarios, buildKnowledgeGraph, buildKnowledgeIndex, buildRetrievalBenchmarkCasesFromQrels, buildRetrievalEvalDispatch, calibrateRagAnswerJudge, canonicalizeUrl, chunkMarkdown, citedClaimKey, citedClaimOf, claimEvidenceId, claimId, claimSourceHost, compareAgentMemoryLearning, contentKey, createAdaptiveResearchDriver, createAgentMemoryBranch, createClaimDecorator, createClaimGroundingVerifier, createCollectionResearchDriver, createCornellLiiSource, createD1FreshnessStoreStub, createFileRunLineageAuthority, createFileSystemFreshnessStore, createFileSystemSearchProvider, createGraphitiMemoryAdapter, createInMemoryBenchmarkAdapter, createIrsPublicationsSource, createKnowledgeControlLoopAdapter, createKnowledgeEvent, createKnowledgeRetrievalReceipt, createKnowledgeUseReceipt, createKnowledgeVisibilitySnapshot, createLocalDiscoveryDispatcher, createMem0MemoryAdapter, createMemoryExecutionPool, createNeo4jAgentMemoryAdapter, createNoopMemoryBenchmarkAdapter, createPersistentResearchDrivingDriver, createRagAnswerQualityHook, createResearchDrivingDriver, createRunScopedStores, createStateSosSource, createTangleRouterClient, createVerifyingResearchDriver, createWebResearchWorker, deepQuestionId, defaultGetMemoryContext, defineReadinessSpec, detectChanges, detectNearDuplicatePages, deterministicRng, diagnoseRagAnswerFailure, emitRetrievalHoldoutBypass, emptyClaimLedger, evaluateKnowledgeBaseReadiness, explainKnowledgeTarget, extractLinks, extractWikilinks, firstMatch, forkAgentMemoryBranchSnapshot, formatFrontmatter, formatKnowledgeCitationReference, fromAgentCandidateKnowledgeRef, gradeCompanyAgainstText, gradeFactAgainstText, gradeFor, graphitiMemoryAdapterIdentity, groundClaimInText, hashKnowledgeBase, htmlToText, improveKnowledgeBase, improveSelectedKnowledgeCandidate, initKnowledgeBase, innerHtmlById, inspectKnowledgeIndex, inspectPendingKnowledgeMutation, investmentThesisSet, isKernelAnchoredPath, isKnowledgeMemoryBenchmarkCase, isMissingFile, isSafeKnowledgePath, isScaffoldPath, jsonCandidateCodec, jsonObjectCandidateCodec, kbIndexToText, knowledgeBenchmarkJudge, knowledgeCitationAuditFindings, knowledgeImprovementCandidateRef, knowledgeImprovementRunDir, knowledgeImprovementRunId, knowledgePageDigest, knowledgeReleaseReport, layoutFor, lensDistribution, linkClaimContradictions, lintCurrentRunCitations, lintKnowledgeIndex, listRegularFilesWithinRoot, loadKnowledgeImprovementActivationResult, loadKnowledgeImprovementEvents, loadKnowledgeImprovementState, loadKnowledgePages, loadSourceRegistry, looksLikeBlockPage, materialFactsSurfaced, materialFactsSurfacedInText, materializeRegisteredClaimEvidence, mediaTypeFor, mem0MemoryAdapterIdentity, memoryHitToSourceRecord, memoryRecoveryDelayMs, memoryWriteResultToSourceRecord, mergeClaimLedgers, mergeTrackedClaims, normalizeClaimText, normalizeExternalRagScores, normalizeLinkTarget, normalizePageText, optimizeKnowledgeBasePolicy, parseFrontmatter, parseKnowledgeBenchmarkJsonl, parseKnowledgeBenchmarkQrels, parseKnowledgeCitationReference, parseKnowledgeWriteBlocks, partitionRetrievalScenarios, politeFetch, promoteKnowledgeCandidate, proposeFromFinding, proposeFromFindings, ragAnswerQualityJudge, readRegularFileNoFollow, readRegularFileWithinRoot, reciprocalRankFusion, recoverPendingKnowledgeMutation, removeDurable, renameDurable, renderKnowledgeBenchmarkReportMarkdown, renderMemoryContext, researchSourceVersionKey, resetRetrievalHoldoutRegistry, resolveKnowledgeCitation, resolveKnowledgeCitations, resolveMemoryCleanupTimeoutMs, resolveRunScopedCitation, resolveRunScopedCitations, respondToIndustryMemoryBenchmarkSmokeCase, respondToIndustryRagBenchmarkSmokeCase, restoreKnowledgeCandidateBaseline, retrievalConfigFromSurface, retrievalConfigSurface, retrievalHoldoutConfigHash, retrievalRecallJudge, runAgentMemoryExperiment, runAgentMemoryImprovement, runAgentMemoryLearningExperiment, runBoundedMemoryLifecycle, runDiscoveryLoop, runInvestmentThesisTask, runKnowledgeBenchmarkSuite, runKnowledgeResearchLoop, runMemoryAdapterBenchmark, runRagKnowledgeImprovementLoop, runRagOptimization, runRetrievalImprovementLoop, runSerializedKnowledgeOptimization, runVerifiedResearchLoop, scenarioContentFingerprint, scoreKnowledgeBaseIndex, scoreKnowledgeBenchmarkArtifact, scoreMemoryBenchmarkArtifact, scoreRagAnswerArtifact, scoreRetrievalArtifact, searchKnowledge, sha256, sleepForMemoryRecovery, slugify, snapshotSourceTextInput, sourceMatchesGaps, sourceRegistryPath, stableId, stripFrontmatter, summarizeKnowledgeBenchmarkCampaign, syncDirectory, textSourceAdapter, textSourceId, thesisReadinessSpecs, toAgentCandidateKnowledgeRef, toDeepEvalTestCases, toOffPolicyTrajectory, toRagCheckerRecords, toRagasEvaluationRows, toTruLensRecords, tokenizeQuery, totalMaterialFacts, triageSource, validateKnowledgeIndex, verdictFor, verifyGradeableEvidence, verifyKnowledgeRetrievalReceipt, verifyKnowledgeUseReceipt, withCitedClaim, withKnowledgeImprovementCandidate, withKnowledgeImprovementComparison, withKnowledgeMutation, withKnowledgeRead, withSafeDescendant, withSafeDirectory, writeFileDurable, writeFileDurableWithinRoot, writeJson, writeJsonDurable, writeJsonDurableWithinRoot, writeKnowledgeIndex, writeSourceRegistry };
|
|
4292
|
+
export { AdaptiveDecision, AdaptiveDriverOptions, AdaptiveResearchDriver, AdaptiveStats, AddSourceOptions, AddSourceTextInput, AgentMemoryAcquireRunLease, type AgentMemoryActivation, type AgentMemoryActivationDriver, AgentMemoryAdapter, type AgentMemoryAttemptEvent, AgentMemoryBranch, AgentMemoryBranchIsolation, AgentMemoryBranchLifetime, AgentMemoryBranchSnapshot, AgentMemoryContext, AgentMemoryControllerMode, type AgentMemoryDimensionComparison, type AgentMemoryEvidenceRef, type AgentMemoryExecutionContext, type AgentMemoryExecutionCostMeter, type AgentMemoryExecutionCostReceipt, type AgentMemoryExecutionPaidCallInput, type AgentMemoryExecutionPaidCallResult, type AgentMemoryExecutionStep, type AgentMemoryExperimentCandidate, type AgentMemoryExperimentCandidateRef, type AgentMemoryExperimentComparisonRef, type AgentMemoryExperimentRankingRow, type AgentMemoryExperimentRunLease, type AgentMemoryFinalEvaluation, type AgentMemoryFinalPair, type AgentMemoryForgettingComparison, AgentMemoryHit, AgentMemoryHitSchema, type AgentMemoryImprovementRunLease, AgentMemoryJournalEntry, AgentMemoryKind, AgentMemoryKindSchema, type AgentMemoryLearningArmOrder, type AgentMemoryLearningCandidateSummary, type AgentMemoryLearningCellComparison, type AgentMemoryLearningComparison, AgentMemoryLifecycleTimeoutError, AgentMemoryLifecycleUnsafeError, type AgentMemoryMode, type AgentMemoryPromotionDecision, AgentMemoryRunLease, AgentMemoryScope, AgentMemoryScopeSchema, AgentMemorySearchOptions, type AgentMemorySequence, type AgentMemorySequenceArtifact, type AgentMemorySequenceProbe, type AgentMemorySequenceProbeResult, type AgentMemorySequenceScenario, type AgentMemorySequenceStep, AgentMemorySharingPolicy, type AgentMemoryTransferCellComparison, type AgentMemoryTransferStepSummary, AgentMemoryVisibility, AgentMemoryWriteInput, AgentMemoryWriteInputSchema, AgentMemoryWriteResult, ApplyKnowledgeWriteBlocksOptions, ApplyWriteBlocksResult, AuditKnowledgeCitationsOptions, Bm25Hit, Bm25Options, type BuildAgentMemorySequencesFromBenchmarkCasesOptions, BuildEvalKnowledgeBundleOptions, BuildKnowledgeRelationGraphInput, type BuildRetrievalBenchmarkCasesFromQrelsOptions, BuildRetrievalEvalDispatchOptions, CHECKABLE_RUNG_THRESHOLD, CITES_INVALIDATED_FIELD, CheckExecution, ChunkingOptions, ClaimEvidence, ClaimGrade, ClaimGroundingDriverOptions, ClaimLedgerGoalConflictError, ClaimLedgerMigrationRequiredError, ClaimLedgerStore, ClaimRef, ClaimVerdict, CompanyEvalCase, type CompareAgentMemoryLearningOptions, CornellLiiSelector, CornellLiiSourceOptions, CreateAgentMemoryBranchOptions, CreateKnowledgeRetrievalDispositionInput, CreateKnowledgeRetrievalReceiptInput, CreateKnowledgeToolsOptions, CreateKnowledgeUseReceiptInput, D1Adapter, DEFAULT_KNOWLEDGE_BRIEF_LIMIT, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, DEFAULT_PAGES_DIRECTORY, DedupReason, DeepQuestion, DeepQuestionKind, DeepQuestionSchema, DefineReadinessSpecInput, DetectChangesOptions, DetectChangesResult, DiscoveryLoopResult, DiscoveryLoopRound, DiscoveryLoopStopReason, DiscoveryResult, DiscoveryTask, DriverResearchContext, EvalKnowledgeBundleBuildResult, EvaluateKnowledgeBaseReadinessOptions, EvidenceRung, ExpectedGroup, type ExternalRagEvalScore, FactResult, FetchOpts, FileSystemFreshnessStoreOptions, FileSystemKbStore, FileSystemKbStoreOptions, FileSystemSearchOptions, FileSystemSearchProvider, FileSystemSearchProviderOptions, ForkAgentMemoryBranchSnapshotOptions, FragmentProvenance, FreshnessKey, FreshnessMark, FreshnessRecord, FreshnessTtl, GraphitiMcpClientLike, GraphitiMemoryAdapterOptions, GraphitiToolNames, GroundClaimOptions, GroundingResult, INDUSTRY_MEMORY_BENCHMARKS, INDUSTRY_RAG_BENCHMARKS, IRS_DIMENSION_HINTS, type ImproveSelectedKnowledgeCandidateOptions, type ImproveSelectedKnowledgeCandidateResult, IrsPublicationsSourceOptions, KB_CLAIM_LEDGER_DIR, KB_EVENTS_PATH, KB_INDEX_PATH, KB_STORE_DIR, KNOWLEDGE_EVENT_TYPES, KNOWLEDGE_PROMOTIONS_DIRECTORY, KNOWLEDGE_PROMOTION_DIGEST_ALGORITHM, KNOWLEDGE_PROMOTION_SCHEMA_VERSION, KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM, KNOWLEDGE_SEARCH_RETRIEVER_ID, KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION, KbStore, type KnowledgeAnswerBenchmarkCase, type KnowledgeAnswerBenchmarkTaskKind, KnowledgeBaseCandidate, KnowledgeBaseCandidateSchema, type KnowledgeBaseQualityOptions, type KnowledgeBaseQualityReport, KnowledgeBaseReadinessEvaluation, type KnowledgeBenchmarkArtifact, type KnowledgeBenchmarkCase, type KnowledgeBenchmarkCaseBase, type KnowledgeBenchmarkDistribution, type KnowledgeBenchmarkEvaluation, type KnowledgeBenchmarkFamily, type KnowledgeBenchmarkReport, type KnowledgeBenchmarkResponder, type KnowledgeBenchmarkScenario, type KnowledgeBenchmarkSliceSummary, type KnowledgeBenchmarkSource, type KnowledgeBenchmarkSpec, type KnowledgeBenchmarkSplit, type KnowledgeBenchmarkTaskKind, KnowledgeBrief, KnowledgeBriefOptions, KnowledgeChange, KnowledgeChangeKind, KnowledgeChunk, KnowledgeCitationAuditError, KnowledgeCitationAuditIssue, KnowledgeCitationAuditIssueKind, KnowledgeCitationAuditReport, KnowledgeCitationCandidate, KnowledgeCitationReference, KnowledgeCitationResolution, KnowledgeCitationResolutionError, KnowledgeCitationResolutionStatus, KnowledgeClaim, type KnowledgeClaimMatcher, KnowledgeConsumerKind, KnowledgeConsumerRef, KnowledgeControlLoopAction, KnowledgeControlLoopActionResult, KnowledgeControlLoopAdapter, KnowledgeControlLoopAdapterOptions, KnowledgeControlLoopState, KnowledgeDiscoveryDispatcher, KnowledgeDiscoveryWorker, KnowledgeDuplicateIntakeError, KnowledgeDuplicateIntakePair, type KnowledgeEvaluationPhase, KnowledgeEvent, KnowledgeEventQuery, KnowledgeEventSchema, KnowledgeEventType, KnowledgeExplanation, KnowledgeFragment, KnowledgeFreshnessStore, KnowledgeGap, KnowledgeGraph, KnowledgeGraphEdge, KnowledgeGraphEdgeSchema, KnowledgeGraphNode, KnowledgeGraphNodeSchema, KnowledgeId, type KnowledgeImprovementActivationPersistence, type KnowledgeImprovementCandidateRecord, type KnowledgeImprovementCandidateRef, KnowledgeImprovementCandidateRefSchema, type KnowledgeImprovementEvaluationInput, type KnowledgeImprovementEvaluator, type KnowledgeImprovementEvent, type KnowledgeImprovementEvidence, KnowledgeImprovementEvidenceSchema, type KnowledgeImprovementMetric, type KnowledgeImprovementMetricProvenance, type KnowledgeImprovementMutationReceipt, type KnowledgeImprovementMutationResult, type KnowledgeImprovementOptions, type KnowledgeImprovementRagOptimizationOptions, type KnowledgeImprovementRagOptimizationRunInput, type KnowledgeImprovementResult, type KnowledgeImprovementRetrievalOptions, type KnowledgeImprovementRunState, KnowledgeImprovementRunStateSchema, type KnowledgeImprovementStatus, type KnowledgeImprovementTarget, type KnowledgeImprovementUpdate, type KnowledgeImprovementUpdateInput, KnowledgeIndex, KnowledgeIndexSchema, KnowledgeInspection, KnowledgeInvalidationPlan, KnowledgeInvalidationStamp, KnowledgeLayout, KnowledgeLexicalFieldBoosts, KnowledgeLexicalIndex, KnowledgeLexicalIndexOptions, KnowledgeLexicalPosting, KnowledgeLintFinding, type KnowledgeMemoryBenchmarkCase, type KnowledgeMemoryBenchmarkTaskKind, type KnowledgeMemoryEvent, type KnowledgeMemoryFactMatcher, type KnowledgeMutationLock, type KnowledgeMutationOptions, KnowledgePage, KnowledgePageInvalidation, KnowledgePageInvalidationSchema, KnowledgePageRelation, KnowledgePageRelationPredicate, KnowledgePageSchema, KnowledgePagesOptions, KnowledgePolicy, type KnowledgePolicyDispatch, KnowledgePromotionEntry, KnowledgePromotionError, KnowledgePromotionErrorCode, KnowledgePromotionRecord, KnowledgeProposal, KnowledgeProposalParseError, type KnowledgeReadOptions, KnowledgeReadinessSpec, KnowledgeReceiptAttributeValue, KnowledgeRelation, KnowledgeRelationDirection, KnowledgeRelationGraph, KnowledgeRelationGraphError, KnowledgeRelationGraphErrorCode, KnowledgeRelationGraphSchema, KnowledgeRelationNeighbor, KnowledgeRelationNode, KnowledgeRelationNodeSchema, KnowledgeRelationQuery, KnowledgeRelationSchema, KnowledgeRelationWalkOptions, KnowledgeRelationWalkStep, KnowledgeRelease, KnowledgeReleaseInput, KnowledgeReleaseReport, KnowledgeResearchLoopContext, KnowledgeResearchLoopDecision, KnowledgeResearchLoopResult, KnowledgeResearchLoopStep, type KnowledgeRetrievalBenchmarkCase, type KnowledgeRetrievalBenchmarkQrel, type KnowledgeRetrievalBenchmarkQuery, KnowledgeRetrievalDisposition, KnowledgeRetrievalDispositionRelation, KnowledgeRetrievalReceipt, KnowledgeRetrievalResultReceipt, KnowledgeRetrieverIdentity, KnowledgeSearchHit, KnowledgeSearchResult, KnowledgeSource, KnowledgeUnit, KnowledgeUseReceipt, KnowledgeUseRelation, KnowledgeUsedResult, KnowledgeVisibilityArtifactLoader, KnowledgeVisibilityArtifactRef, KnowledgeVisibilityRef, KnowledgeVisibilitySnapshot, KnowledgeVisibilitySnapshotEntry, KnowledgeVisibilityUnavailableError, KnowledgeVisibilityUnavailableReason, KnowledgeWriteBlock, KnowledgeWriteIntakeOptions, KnowledgeWriteIntakeRequest, KnowledgeWriteParseResult, type LoadKnowledgeImprovementActivationResultOptions, MAX_RESPONSE_BYTES, MIN_REQUEST_GAP_MS, MaterialFact, MaterialFactLens, MaterialFactsResult, type MeasuredKnowledgeSelectionReceipt, Mem0ClientMode, Mem0HostedClient, Mem0HostedMemoryAdapterOptions, Mem0MemoryAdapterOptions, Mem0OssClient, Mem0OssMemoryAdapterOptions, type MemoryAdapterBenchmarkCandidate, type MemoryAdapterBenchmarkRankingRow, type MemoryConfigScenario, MemoryKbStore, type NearDuplicateDetectionOptions, type NearDuplicatePair, type NearDuplicateReport, Neo4jAgentMemoryAdapterOptions, type OptimizeKnowledgeBasePolicyOptions, type OptimizeKnowledgeBasePolicyResult, OriginatedKnowledgeSearchResult, OriginatedPage, OwnedAgentMemoryRunLease, POLITE_USER_AGENT, PageOrigin, ParsedFrontmatter, PartitionRetrievalScenariosOptions, type PendingKnowledgeMutation, PersistentResearchDrivingDriverOptions, PoliteFetchOptions, PoliteFetchResult, type PromoteKnowledgeCandidateOptions, PromoteRunScopedPagesOptions, ProposeFromFindingsResult, READINESS_SPEC_DEFAULTS, RUN_LINEAGE_BASENAME, type RagAnswerEvalArtifact, type RagAnswerEvalCase, type RagAnswerEvalScenario, type RagAnswerMetricSummary, type RagAnswerQualityHookOptions, RagAnswerQualityInput, type RagAnswerQualityJudgeOptions, RagAnswerQualityResult, type RagCalibrationOptions, type RagCalibrationResult, RagDiagnosisInput, type RagEvalCitation, type RagEvalClaim, type RagEvalContext, type RagEvalMetricKey, type RagEvalProvider, type RagEvalSlice, RagGapFinding, RagGapKind, RagGapSeverity, RagKnowledgeAcquisitionInput, RagKnowledgeImprovementPhase, RagKnowledgeImprovementPhaseResult, RagKnowledgeImprovementPhaseStatus, RagKnowledgeResearchOptions, RagKnowledgeUpdateInput, RagKnowledgeUpdateResult, RagOptimizationConfig, RagOptimizationSelection, RagPhaseInputBase, RagPromotionInput, RagPromotionResult, type RagRequiredContext, type RecoverPendingKnowledgeMutationOptions, RegularFileSnapshot, RejectedSource, ResearchClaimEvidence, ResearchClaimEvidenceSchema, ResearchClaimLedger, ResearchClaimLedgerSchema, ResearchClaimRecord, ResearchClaimRecordSchema, ResearchContribution, ResearchDriver, ResearchDrivingDriver, ResearchDrivingDriverOptions, ResearchDrivingState, ResearchDrivingSteer, ResearchSourceProposal, ResearchSourceVersion, ResearchSourceVersionSchema, ResearchWorker, type ResolvedKnowledgeImprovementCandidate, type ResolvedKnowledgeImprovementComparison, type ResolvedKnowledgeImprovementComparisonSnapshot, type RestoreKnowledgeCandidateBaselineOptions, RetrievalConfig, RetrievalEvalArtifact, RetrievalEvalRetriever, RetrievalEvalRetrieverInput, RetrievalEvalRetrieverResult, RetrievalEvalScenario, RetrievalGoldTarget, RetrievalHoldoutBypassReason, RetrievalHoldoutCallContext, RetrievalHoldoutConfig, RetrievalHoldoutEligibleItem, RetrievalHoldoutEvent, RetrievalHoldoutOffPolicyOptions, RetrievalHoldoutOffPolicyResult, RetrievalHoldoutResult, RetrievalHoldoutSessionState, RetrievalHoldoutSessionSummary, RetrievalMetricSummary, RetrievalMetricWeights, RetrievalOptimizationSelection, RetrievalRecallJudgeOptions, RetrievalScenarioPartitions, RetrievedKnowledgeHit, RetrievedSourceSpan, RouterClient, RouterError, RouterUsage, type RunAgentMemoryExperimentOptions, type RunAgentMemoryExperimentResult, type RunAgentMemoryImprovementOptions, type RunAgentMemoryImprovementResult, type RunAgentMemoryLearningExperimentOptions, type RunAgentMemoryLearningExperimentResult, RunDiscoveryLoopOptions, type RunKnowledgeBenchmarkSuiteOptions, type RunKnowledgeBenchmarkSuiteResult, RunKnowledgeResearchLoopOptions, RunLineageAuthority, RunLineageRecord, type RunMemoryAdapterBenchmarkOptions, type RunMemoryAdapterBenchmarkResult, RunRagKnowledgeImprovementLoopOptions, RunRagKnowledgeImprovementLoopResult, RunRagOptimizationOptions, RunRagOptimizationResult, RunRetrievalImprovementLoopOptions, RunRetrievalImprovementLoopResult, RunScopedStores, RunScopedStoresOptions, RunSerializedKnowledgeOptimizationOptions, RunSerializedKnowledgeOptimizationResult, SCAFFOLD_PAGE_BASENAMES, SearchKnowledgeOptions, SerializedCandidate, SerializedCandidateCodec, SourceAdapter, SourceAdapterInput, SourceAdapterOutput, SourceAnchor, SourceAnchorSchema, SourceFreshnessInspection, SourceRecord, SourceRecordSchema, SourceRegistry, SourceVerdict, SourceVerificationContext, StateSosEntity, StateSosSourceConfig, TangleRouterOptions, ThesisRunOptions, ThesisRunResult, ThesisTaskInput, TrackedClaim, TriageClass, UncheckableClaimError, type UseKnowledgeImprovementCandidateOptions, ValidateKnowledgeOptions, ValidateKnowledgeResult, VerifiedGradeableEvidence, VerifiedResearchLoopOptions, VerifiedResearchLoopResult, VerifiedResearchRound, VerifyGradeableEvidenceOptions, VerifyingDriverOptions, WIKILINK_REGEX, WebResearchWorkerOptions, WebSearchHit, WorkerClaimDecorationOptions, WorkerResearchContext, __resetHttpThrottle, acquireAgentMemoryRunLease, addSourcePath, addSourceText, agentMemorySequenceJudge, applyKnowledgeWriteBlocks, applyKnowledgeWriteBlocksFile, applyRetrievalHoldout, applySessionStickyRetrievalHoldout, assertClaimLedgerId, assertCurrentRunCitationsResolved, assertDeepQuestionIntegrity, assertGradeableEvidence, assertKnowledgeCitationAudit, assertKnowledgeCitationsResolved, assertKnowledgeRetrievalMatchesVisibility, assertKnowledgeRetrievalMatchesVisibilityArtifact, assertKnowledgeWriteIntake, assertResearchClaimEvidenceIntegrity, assertResearchClaimLedgerIntegrity, assertRunScopedCitationsResolved, assertTrackedClaimIntegrity, auditCurrentRunCitations, auditKnowledgeCitations, buildAgentMemorySequenceScenarios, buildAgentMemorySequencesFromBenchmarkCases, buildEvalKnowledgeBundle, buildFirstPartyMemoryLifecycleBenchmarkCases, buildIndustryMemoryBenchmarkSmokeCases, buildIndustryRagBenchmarkSmokeCases, buildKnowledgeBenchmarkScenarios, buildKnowledgeBrief, buildKnowledgeGraph, buildKnowledgeIndex, buildKnowledgeLexicalIndex, buildKnowledgeRelationGraph, buildRetrievalBenchmarkCasesFromQrels, buildRetrievalEvalDispatch, calibrateRagAnswerJudge, canonicalizeUrl, chunkMarkdown, citedClaimKey, citedClaimOf, claimEvidenceId, claimId, claimSourceHost, compareAgentMemoryLearning, contentKey, createAdaptiveResearchDriver, createAgentMemoryBranch, createClaimDecorator, createClaimGroundingVerifier, createCollectionResearchDriver, createCornellLiiSource, createD1FreshnessStoreStub, createFileRunLineageAuthority, createFileSystemFreshnessStore, createFileSystemSearchProvider, createGraphitiMemoryAdapter, createInMemoryBenchmarkAdapter, createIrsPublicationsSource, createKnowledgeControlLoopAdapter, createKnowledgeEvent, createKnowledgeRetrievalDisposition, createKnowledgeRetrievalReceipt, createKnowledgeTools, createKnowledgeUseReceipt, createKnowledgeVisibilitySnapshot, createLocalDiscoveryDispatcher, createMem0MemoryAdapter, createMemoryExecutionPool, createNeo4jAgentMemoryAdapter, createNoopMemoryBenchmarkAdapter, createPersistentResearchDrivingDriver, createRagAnswerQualityHook, createResearchDrivingDriver, createRunScopedStores, createStateSosSource, createTangleRouterClient, createVerifyingResearchDriver, createWebResearchWorker, decodeKnowledgeVisibilitySnapshot, deepQuestionId, defaultGetMemoryContext, defineReadinessSpec, detectChanges, detectNearDuplicatePages, deterministicRng, diagnoseRagAnswerFailure, emitRetrievalHoldoutBypass, emptyClaimLedger, encodeKnowledgeVisibilitySnapshot, evaluateKnowledgeBaseReadiness, explainKnowledgeTarget, extractLinks, extractWikilinks, firstMatch, forkAgentMemoryBranchSnapshot, formatFrontmatter, formatKnowledgeCitationReference, formatKnowledgeInvalidationProposal, fromAgentCandidateKnowledgeRef, gradeCompanyAgainstText, gradeFactAgainstText, gradeFor, graphitiMemoryAdapterIdentity, groundClaimInText, hashKnowledgeBase, htmlToText, improveKnowledgeBase, improveSelectedKnowledgeCandidate, initKnowledgeBase, innerHtmlById, inspectKnowledgeIndex, inspectPendingKnowledgeMutation, investmentThesisSet, isKernelAnchoredPath, isKnowledgeMemoryBenchmarkCase, isKnowledgePagePath, isMissingFile, isReachable, isSafeKnowledgePath, isScaffoldPath, jsonCandidateCodec, jsonObjectCandidateCodec, kbIndexToText, knowledgeBenchmarkJudge, knowledgeCitationAuditFindings, knowledgeImprovementCandidateRef, knowledgeImprovementRunDir, knowledgeImprovementRunId, knowledgePageDigest, knowledgePageFromMarkdown, knowledgePageRelations, knowledgeReleaseReport, knowledgeVisibilityArtifactRef, layoutFor, lensDistribution, linkClaimContradictions, lintCurrentRunCitations, lintKnowledgeIndex, listRegularFilesWithinRoot, loadKnowledgeImprovementActivationResult, loadKnowledgeImprovementEvents, loadKnowledgeImprovementState, loadKnowledgePages, loadKnowledgePromotionRecord, loadSourceRegistry, looksLikeBlockPage, materialFactsSurfaced, materialFactsSurfacedInText, materializeRegisteredClaimEvidence, mediaTypeFor, mem0MemoryAdapterIdentity, memoryHitToSourceRecord, memoryRecoveryDelayMs, memoryWriteResultToSourceRecord, mergeClaimLedgers, mergeTrackedClaims, neighbors, normalizeClaimText, normalizeExternalRagScores, normalizeLinkTarget, normalizePageText, normalizePagesDirectory, optimizeKnowledgeBasePolicy, originatedPages, parseFrontmatter, parseKnowledgeBenchmarkJsonl, parseKnowledgeBenchmarkQrels, parseKnowledgeCitationReference, parseKnowledgeWriteBlocks, partitionRetrievalScenarios, planInvalidationPropagation, politeFetch, promoteKnowledgeCandidate, promoteRunScopedPages, proposeFromFinding, proposeFromFindings, ragAnswerQualityJudge, readRegularFileNoFollow, readRegularFileWithinRoot, reciprocalRankFusion, recoverPendingKnowledgeMutation, removeDurable, renameDurable, renderKnowledgeBenchmarkReportMarkdown, renderMemoryContext, researchSourceVersionKey, resetRetrievalHoldoutRegistry, resolveKnowledgeCitation, resolveKnowledgeCitations, resolveMemoryCleanupTimeoutMs, resolveRunScopedCitation, resolveRunScopedCitations, respondToIndustryMemoryBenchmarkSmokeCase, respondToIndustryRagBenchmarkSmokeCase, restoreKnowledgeCandidateBaseline, retrievalConfigFromSurface, retrievalConfigSurface, retrievalHoldoutConfigHash, retrievalRecallJudge, runAgentMemoryExperiment, runAgentMemoryImprovement, runAgentMemoryLearningExperiment, runBoundedMemoryLifecycle, runDiscoveryLoop, runInvestmentThesisTask, runKnowledgeBenchmarkSuite, runKnowledgeResearchLoop, runMemoryAdapterBenchmark, runRagKnowledgeImprovementLoop, runRagOptimization, runRetrievalImprovementLoop, runSerializedKnowledgeOptimization, runVerifiedResearchLoop, scenarioContentFingerprint, scoreBm25, scoreKnowledgeBaseIndex, scoreKnowledgeBenchmarkArtifact, scoreMemoryBenchmarkArtifact, scoreRagAnswerArtifact, scoreRetrievalArtifact, searchKnowledge, searchKnowledgePages, sha256, sleepForMemoryRecovery, slugify, snapshotSourceTextInput, sourceMatchesGaps, sourceRegistryPath, stableId, stripFrontmatter, summarizeKnowledgeBenchmarkCampaign, syncDirectory, textSourceAdapter, textSourceId, thesisReadinessSpecs, toAgentCandidateKnowledgeRef, toDeepEvalTestCases, toOffPolicyTrajectory, toRagCheckerRecords, toRagasEvaluationRows, toTruLensRecords, tokenizeQuery, tokenizeText, totalMaterialFacts, triageSource, validateKnowledgeIndex, verdictFor, verifyGradeableEvidence, verifyKnowledgeRetrievalDisposition, verifyKnowledgeRetrievalReceipt, verifyKnowledgeUseReceipt, verifyKnowledgeVisibilitySnapshot, walk, withCitedClaim, withKnowledgeImprovementCandidate, withKnowledgeImprovementComparison, withKnowledgeMutation, withKnowledgeRead, withSafeDescendant, withSafeDirectory, writeFileDurable, writeFileDurableWithinRoot, writeJson, writeJsonDurable, writeJsonDurableWithinRoot, writeKnowledgeIndex, writeSourceRegistry };
|
|
3673
4293
|
//# sourceMappingURL=index.d.ts.map
|