@tangle-network/agent-knowledge 17.1.9 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/README.md +7 -4
- package/dist/benchmarks-B3kU-Yxz.js.map +1 -1
- package/dist/cli.js +9 -5
- package/dist/cli.js.map +1 -1
- package/dist/index-DZeFm-BP.d.ts.map +1 -1
- package/dist/index-eDsIXWyM.d.ts.map +1 -1
- package/dist/index.d.ts +473 -482
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -227
- package/dist/index.js.map +1 -1
- package/dist/{inspect-DrJnvx5Z.js → inspect-BVT9JWDL.js} +7 -5
- package/dist/{inspect-DrJnvx5Z.js.map → inspect-BVT9JWDL.js.map} +1 -1
- package/dist/memory/index.js +1 -1
- package/dist/{memory-Bn1Xs1hY.js → memory-BYWNir2t.js} +9 -6
- package/dist/{memory-Bn1Xs1hY.js.map → memory-BYWNir2t.js.map} +1 -1
- package/dist/sources/index.d.ts +25 -26
- package/dist/sources/index.d.ts.map +1 -1
- package/dist/sources/index.js +2 -2
- package/dist/sources/index.js.map +1 -1
- package/dist/viz/index.d.ts +9 -10
- package/dist/viz/index.d.ts.map +1 -1
- package/package.json +18 -43
package/dist/index.d.ts
CHANGED
|
@@ -9,29 +9,29 @@ import { ComparisonCost, DispatchContext, JudgeConfig, OptimizationMethod, Scena
|
|
|
9
9
|
import { EvidenceRef } from "@tangle-network/agent-eval/analyst";
|
|
10
10
|
import { LockOptions } from "proper-lockfile";
|
|
11
11
|
//#region src/adapters.d.ts
|
|
12
|
-
interface SourceAdapterInput {
|
|
12
|
+
export interface SourceAdapterInput {
|
|
13
13
|
uri: string;
|
|
14
14
|
bytes?: Uint8Array;
|
|
15
15
|
text?: string;
|
|
16
16
|
metadata?: Record<string, unknown>;
|
|
17
17
|
}
|
|
18
|
-
interface SourceAdapterOutput {
|
|
18
|
+
export interface SourceAdapterOutput {
|
|
19
19
|
title?: string;
|
|
20
20
|
mediaType?: string;
|
|
21
21
|
text?: string;
|
|
22
22
|
anchors?: SourceRecord['anchors'];
|
|
23
23
|
metadata?: Record<string, unknown>;
|
|
24
24
|
}
|
|
25
|
-
interface SourceAdapter {
|
|
25
|
+
export interface SourceAdapter {
|
|
26
26
|
id: string;
|
|
27
27
|
canLoad(input: SourceAdapterInput): boolean;
|
|
28
28
|
load(input: SourceAdapterInput): Promise<SourceAdapterOutput> | SourceAdapterOutput;
|
|
29
29
|
}
|
|
30
|
-
declare const textSourceAdapter: SourceAdapter;
|
|
31
|
-
declare function mediaTypeFor(uri: string): string;
|
|
30
|
+
export declare const textSourceAdapter: SourceAdapter;
|
|
31
|
+
export declare function mediaTypeFor(uri: string): string;
|
|
32
32
|
//#endregion
|
|
33
33
|
//#region src/eval-readiness.d.ts
|
|
34
|
-
interface KnowledgeReadinessSpec {
|
|
34
|
+
export interface KnowledgeReadinessSpec {
|
|
35
35
|
id: string;
|
|
36
36
|
description: string;
|
|
37
37
|
query: string;
|
|
@@ -55,7 +55,7 @@ interface KnowledgeReadinessSpec {
|
|
|
55
55
|
* source. Override any field to specialise (e.g. `freshness: 'daily'` for a
|
|
56
56
|
* topic that must reflect today's regulatory state).
|
|
57
57
|
*/
|
|
58
|
-
declare const READINESS_SPEC_DEFAULTS: {
|
|
58
|
+
export declare const READINESS_SPEC_DEFAULTS: {
|
|
59
59
|
readonly category: 'domain_specific';
|
|
60
60
|
readonly acquisitionMode: 'search_web';
|
|
61
61
|
readonly importance: 'high';
|
|
@@ -70,7 +70,7 @@ declare const READINESS_SPEC_DEFAULTS: {
|
|
|
70
70
|
* sanely default (id, description, query, requiredFor) are required; everything
|
|
71
71
|
* else is optional and pulls from `READINESS_SPEC_DEFAULTS`.
|
|
72
72
|
*/
|
|
73
|
-
type DefineReadinessSpecInput = Pick<KnowledgeReadinessSpec, 'id' | 'description' | 'query' | 'requiredFor'> & Partial<Omit<KnowledgeReadinessSpec, 'id' | 'description' | 'query' | 'requiredFor'>>;
|
|
73
|
+
export type DefineReadinessSpecInput = Pick<KnowledgeReadinessSpec, 'id' | 'description' | 'query' | 'requiredFor'> & Partial<Omit<KnowledgeReadinessSpec, 'id' | 'description' | 'query' | 'requiredFor'>>;
|
|
74
74
|
/**
|
|
75
75
|
* Builder that returns a fully-typed `KnowledgeReadinessSpec` from a slim input.
|
|
76
76
|
*
|
|
@@ -101,8 +101,8 @@ type DefineReadinessSpecInput = Pick<KnowledgeReadinessSpec, 'id' | 'description
|
|
|
101
101
|
* minSources: 3,
|
|
102
102
|
* })
|
|
103
103
|
*/
|
|
104
|
-
declare function defineReadinessSpec(input: DefineReadinessSpecInput): KnowledgeReadinessSpec;
|
|
105
|
-
interface BuildEvalKnowledgeBundleOptions {
|
|
104
|
+
export declare function defineReadinessSpec(input: DefineReadinessSpecInput): KnowledgeReadinessSpec;
|
|
105
|
+
export interface BuildEvalKnowledgeBundleOptions {
|
|
106
106
|
taskId: string;
|
|
107
107
|
index: KnowledgeIndex;
|
|
108
108
|
specs: KnowledgeReadinessSpec[];
|
|
@@ -111,7 +111,7 @@ interface BuildEvalKnowledgeBundleOptions {
|
|
|
111
111
|
metadata?: Record<string, unknown>;
|
|
112
112
|
now?: Date;
|
|
113
113
|
}
|
|
114
|
-
interface EvalKnowledgeBundleBuildResult {
|
|
114
|
+
export interface EvalKnowledgeBundleBuildResult {
|
|
115
115
|
bundle: KnowledgeBundle;
|
|
116
116
|
report: KnowledgeReadinessReport;
|
|
117
117
|
requirements: KnowledgeRequirement[];
|
|
@@ -119,15 +119,15 @@ interface EvalKnowledgeBundleBuildResult {
|
|
|
119
119
|
questions: UserQuestion[];
|
|
120
120
|
acquisitionPlans: DataAcquisitionPlan[];
|
|
121
121
|
}
|
|
122
|
-
declare function buildEvalKnowledgeBundle(options: BuildEvalKnowledgeBundleOptions): EvalKnowledgeBundleBuildResult;
|
|
122
|
+
export declare function buildEvalKnowledgeBundle(options: BuildEvalKnowledgeBundleOptions): EvalKnowledgeBundleBuildResult;
|
|
123
123
|
//#endregion
|
|
124
124
|
//#region src/sources.d.ts
|
|
125
|
-
interface AddSourceOptions {
|
|
125
|
+
export interface AddSourceOptions {
|
|
126
126
|
copyIntoRaw?: boolean;
|
|
127
127
|
adapters?: SourceAdapter[];
|
|
128
128
|
now?: () => Date;
|
|
129
129
|
}
|
|
130
|
-
interface AddSourceTextInput {
|
|
130
|
+
export interface AddSourceTextInput {
|
|
131
131
|
uri: string;
|
|
132
132
|
text: string;
|
|
133
133
|
title?: string;
|
|
@@ -137,12 +137,12 @@ interface AddSourceTextInput {
|
|
|
137
137
|
metadata?: Record<string, unknown>;
|
|
138
138
|
}
|
|
139
139
|
/** Copy and freeze an untrusted source proposal before any asynchronous work. */
|
|
140
|
-
declare function snapshotSourceTextInput(input: AddSourceTextInput): AddSourceTextInput;
|
|
141
|
-
declare function loadSourceRegistry(root: string): Promise<SourceRegistry>;
|
|
142
|
-
declare function writeSourceRegistry(root: string, registry: SourceRegistry): Promise<void>;
|
|
143
|
-
declare function addSourcePath(root: string, sourcePath: string, options?: AddSourceOptions): Promise<SourceRecord[]>;
|
|
144
|
-
declare function addSourceText(root: string, input: AddSourceTextInput, options?: Pick<AddSourceOptions, 'adapters' | 'now'>): Promise<SourceRecord>;
|
|
145
|
-
declare function sourceRegistryPath(root: string): string;
|
|
140
|
+
export declare function snapshotSourceTextInput(input: AddSourceTextInput): AddSourceTextInput;
|
|
141
|
+
export declare function loadSourceRegistry(root: string): Promise<SourceRegistry>;
|
|
142
|
+
export declare function writeSourceRegistry(root: string, registry: SourceRegistry): Promise<void>;
|
|
143
|
+
export declare function addSourcePath(root: string, sourcePath: string, options?: AddSourceOptions): Promise<SourceRecord[]>;
|
|
144
|
+
export declare function addSourceText(root: string, input: AddSourceTextInput, options?: Pick<AddSourceOptions, 'adapters' | 'now'>): Promise<SourceRecord>;
|
|
145
|
+
export declare function sourceRegistryPath(root: string): string;
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region src/verified-research-loop.d.ts
|
|
148
148
|
/**
|
|
@@ -150,7 +150,7 @@ declare function sourceRegistryPath(root: string): string;
|
|
|
150
150
|
* targets these; the driver folds the unfilled remainder into the worker's next
|
|
151
151
|
* prompt and runs its own gap-fill pass over them.
|
|
152
152
|
*/
|
|
153
|
-
interface KnowledgeGap {
|
|
153
|
+
export interface KnowledgeGap {
|
|
154
154
|
/** Readiness-spec id this gap belongs to. */
|
|
155
155
|
id: string;
|
|
156
156
|
/** Human-readable description of what's missing. */
|
|
@@ -161,7 +161,7 @@ interface KnowledgeGap {
|
|
|
161
161
|
blocking: boolean;
|
|
162
162
|
}
|
|
163
163
|
/** A new source the worker (or driver) discovered and wants to add to the KB. */
|
|
164
|
-
type ResearchSourceProposal = AddSourceTextInput;
|
|
164
|
+
export type ResearchSourceProposal = AddSourceTextInput;
|
|
165
165
|
/**
|
|
166
166
|
* What a research agent contributes in one round. Both the worker and (when
|
|
167
167
|
* `driverResearches` is on) the driver produce this shape — the worker ADDS
|
|
@@ -171,7 +171,7 @@ type ResearchSourceProposal = AddSourceTextInput;
|
|
|
171
171
|
* blocks). The loop only applies it AFTER the driver has verified the round's
|
|
172
172
|
* sources, so a rejected source never reaches the curated pages.
|
|
173
173
|
*/
|
|
174
|
-
interface ResearchContribution {
|
|
174
|
+
export interface ResearchContribution {
|
|
175
175
|
/** Immutable sources to register (the raw evidence). */
|
|
176
176
|
sources?: ResearchSourceProposal[];
|
|
177
177
|
/** Safe write-protocol text producing curated `knowledge/*.md` pages. */
|
|
@@ -190,7 +190,7 @@ interface ResearchContribution {
|
|
|
190
190
|
metadata?: Record<string, unknown>;
|
|
191
191
|
}
|
|
192
192
|
/** Context handed to the worker each round. */
|
|
193
|
-
interface WorkerResearchContext {
|
|
193
|
+
export interface WorkerResearchContext {
|
|
194
194
|
root: string;
|
|
195
195
|
goal: string;
|
|
196
196
|
round: number;
|
|
@@ -203,7 +203,7 @@ interface WorkerResearchContext {
|
|
|
203
203
|
signal?: AbortSignal;
|
|
204
204
|
}
|
|
205
205
|
/** Context handed to the driver's verifier for one candidate source. */
|
|
206
|
-
interface SourceVerificationContext {
|
|
206
|
+
export interface SourceVerificationContext {
|
|
207
207
|
root: string;
|
|
208
208
|
goal: string;
|
|
209
209
|
round: number;
|
|
@@ -214,12 +214,12 @@ interface SourceVerificationContext {
|
|
|
214
214
|
signal?: AbortSignal;
|
|
215
215
|
}
|
|
216
216
|
/** A single rejected source plus the reason the driver gave. */
|
|
217
|
-
interface RejectedSource {
|
|
217
|
+
export interface RejectedSource {
|
|
218
218
|
source: ResearchSourceProposal;
|
|
219
219
|
reason: string;
|
|
220
220
|
}
|
|
221
221
|
/** Context handed to the driver's gap-fill pass (only when `driverResearches`). */
|
|
222
|
-
interface DriverResearchContext {
|
|
222
|
+
export interface DriverResearchContext {
|
|
223
223
|
root: string;
|
|
224
224
|
goal: string;
|
|
225
225
|
round: number;
|
|
@@ -250,7 +250,7 @@ interface DriverResearchContext {
|
|
|
250
250
|
* - `commitSources` — confirm exact source records are durable after verification;
|
|
251
251
|
* drivers with pending evidence must not count it before this callback.
|
|
252
252
|
*/
|
|
253
|
-
interface ResearchDriver {
|
|
253
|
+
export interface ResearchDriver {
|
|
254
254
|
verifySource(source: ResearchSourceProposal, ctx: SourceVerificationContext): Promise<SourceVerdict> | SourceVerdict;
|
|
255
255
|
research?(ctx: DriverResearchContext): Promise<ResearchContribution> | ResearchContribution;
|
|
256
256
|
foldGaps?(gaps: KnowledgeGap[]): string;
|
|
@@ -259,15 +259,15 @@ interface ResearchDriver {
|
|
|
259
259
|
commitSources?(sources: readonly SourceRecord[]): Promise<void> | void;
|
|
260
260
|
checkpoint?(): Promise<void> | void;
|
|
261
261
|
}
|
|
262
|
-
type SourceVerdict = {
|
|
262
|
+
export type SourceVerdict = {
|
|
263
263
|
accept: true;
|
|
264
264
|
} | {
|
|
265
265
|
accept: false;
|
|
266
266
|
reason: string;
|
|
267
267
|
};
|
|
268
268
|
/** The worker: primary research targeting the round's gaps. */
|
|
269
|
-
type ResearchWorker = (ctx: WorkerResearchContext) => Promise<ResearchContribution> | ResearchContribution;
|
|
270
|
-
interface VerifiedResearchLoopOptions {
|
|
269
|
+
export type ResearchWorker = (ctx: WorkerResearchContext) => Promise<ResearchContribution> | ResearchContribution;
|
|
270
|
+
export interface VerifiedResearchLoopOptions {
|
|
271
271
|
root: string;
|
|
272
272
|
goal: string;
|
|
273
273
|
worker: ResearchWorker;
|
|
@@ -289,7 +289,7 @@ interface VerifiedResearchLoopOptions {
|
|
|
289
289
|
signal?: AbortSignal;
|
|
290
290
|
onRound?: (round: VerifiedResearchRound) => Promise<void> | void;
|
|
291
291
|
}
|
|
292
|
-
interface VerifiedResearchRound {
|
|
292
|
+
export interface VerifiedResearchRound {
|
|
293
293
|
round: number;
|
|
294
294
|
/** Gaps reported at the START of the round (what the worker targeted). */
|
|
295
295
|
gaps: KnowledgeGap[];
|
|
@@ -310,7 +310,7 @@ interface VerifiedResearchRound {
|
|
|
310
310
|
driver?: string;
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
interface VerifiedResearchLoopResult {
|
|
313
|
+
export interface VerifiedResearchLoopResult {
|
|
314
314
|
root: string;
|
|
315
315
|
goal: string;
|
|
316
316
|
rounds: number;
|
|
@@ -341,26 +341,26 @@ interface VerifiedResearchLoopResult {
|
|
|
341
341
|
* `applyKnowledgeWriteBlocks`, `buildEvalKnowledgeBundle` (the readiness gate),
|
|
342
342
|
* and `searchKnowledge` — and reinvents none of them.
|
|
343
343
|
*/
|
|
344
|
-
declare function runVerifiedResearchLoop(options: VerifiedResearchLoopOptions): Promise<VerifiedResearchLoopResult>;
|
|
344
|
+
export declare function runVerifiedResearchLoop(options: VerifiedResearchLoopOptions): Promise<VerifiedResearchLoopResult>;
|
|
345
345
|
/**
|
|
346
346
|
* Helper for verifiers: does the candidate source's text/title overlap any page
|
|
347
347
|
* the readiness search returns for a gap query? A cheap relevance heuristic the
|
|
348
348
|
* driver can compose into `verifySource` (real verifiers can do more).
|
|
349
349
|
*/
|
|
350
|
-
declare function sourceMatchesGaps(source: ResearchSourceProposal, index: KnowledgeIndex, gaps: KnowledgeGap[]): KnowledgeSearchResult[];
|
|
350
|
+
export declare function sourceMatchesGaps(source: ResearchSourceProposal, index: KnowledgeIndex, gaps: KnowledgeGap[]): KnowledgeSearchResult[];
|
|
351
351
|
//#endregion
|
|
352
352
|
//#region src/web-research-worker.d.ts
|
|
353
353
|
/** One live web result, as the router's `/v1/search` returns it. */
|
|
354
|
-
interface WebSearchHit {
|
|
354
|
+
export interface WebSearchHit {
|
|
355
355
|
title: string;
|
|
356
356
|
url: string;
|
|
357
357
|
snippet?: string;
|
|
358
358
|
}
|
|
359
359
|
/**
|
|
360
360
|
* The two router capabilities the worker/driver need. Injectable so tests can
|
|
361
|
-
*
|
|
361
|
+
* supply a client; the default uses the published TCloud SDK.
|
|
362
362
|
*/
|
|
363
|
-
interface RouterClient {
|
|
363
|
+
export interface RouterClient {
|
|
364
364
|
/** Live web search — returns title/url/snippet hits. */
|
|
365
365
|
search(query: string, opts?: {
|
|
366
366
|
maxResults?: number;
|
|
@@ -380,15 +380,16 @@ interface RouterClient {
|
|
|
380
380
|
* each call here is what surfaces that the two-agent loop spends more inference
|
|
381
381
|
* than its "equal passes" budget implies.
|
|
382
382
|
*/
|
|
383
|
-
interface RouterUsage {
|
|
383
|
+
export interface RouterUsage {
|
|
384
384
|
chatCalls: number;
|
|
385
385
|
searchCalls: number;
|
|
386
386
|
promptTokens: number;
|
|
387
387
|
completionTokens: number;
|
|
388
|
+
/** Reported cost only. NaN once a successful response omits its cost receipt. */
|
|
388
389
|
usd: number;
|
|
389
390
|
wallMs: number;
|
|
390
391
|
}
|
|
391
|
-
interface TangleRouterOptions {
|
|
392
|
+
export interface TangleRouterOptions {
|
|
392
393
|
/** Router base URL. Defaults to `https://router.tangle.tools/v1`. */
|
|
393
394
|
baseUrl?: string;
|
|
394
395
|
/** Bearer key. Defaults to `process.env.TANGLE_API_KEY`. */
|
|
@@ -397,30 +398,20 @@ interface TangleRouterOptions {
|
|
|
397
398
|
model?: string;
|
|
398
399
|
/** Optional preferred search provider (exa | you | perplexity | …). */
|
|
399
400
|
searchProvider?: string;
|
|
400
|
-
/**
|
|
401
|
-
* Retries on a TRANSIENT upstream status (502/503/504/429) with exponential
|
|
402
|
-
* backoff. Default 4. A 4xx that isn't 429, and a 401, are NOT retried — those
|
|
403
|
-
* are not transient. After the budget is exhausted the call still fails loud
|
|
404
|
-
* with the original `RouterError`, so the fail-closed contract holds; this only
|
|
405
|
-
* stops a single upstream-capacity blip from voiding a whole multi-topic run.
|
|
406
|
-
*/
|
|
401
|
+
/** SDK retries for 429/502/503/504. Default 4. Kept for API compatibility. */
|
|
407
402
|
maxRetries?: number;
|
|
408
|
-
/**
|
|
403
|
+
/** Initial SDK retry backoff in ms. Default 1500. */
|
|
409
404
|
retryBaseMs?: number;
|
|
410
405
|
signal?: AbortSignal;
|
|
411
406
|
}
|
|
412
|
-
/**
|
|
413
|
-
declare class RouterError extends Error {
|
|
407
|
+
/** Compatibility error facade. HTTP execution and classification belong to TCloud. */
|
|
408
|
+
export declare class RouterError extends Error {
|
|
414
409
|
readonly status: number;
|
|
415
410
|
constructor(status: number, message: string);
|
|
416
411
|
}
|
|
417
|
-
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
* `/v1/chat/completions` for chat) so it needs no CLI installed.
|
|
421
|
-
*/
|
|
422
|
-
declare function createTangleRouterClient(options?: TangleRouterOptions): RouterClient;
|
|
423
|
-
interface WebResearchWorkerOptions {
|
|
412
|
+
/** Adapt Knowledge's public contract to the published SDK, without a second transport. */
|
|
413
|
+
export declare function createTangleRouterClient(options?: TangleRouterOptions): RouterClient;
|
|
414
|
+
export interface WebResearchWorkerOptions {
|
|
424
415
|
/** Router client. Defaults to a live Tangle router client from env creds. */
|
|
425
416
|
router?: RouterClient;
|
|
426
417
|
router_options?: TangleRouterOptions;
|
|
@@ -442,8 +433,8 @@ interface WebResearchWorkerOptions {
|
|
|
442
433
|
* contract: given the open gaps, it returns the sources it found plus a
|
|
443
434
|
* `buildPages` that emits citing pages from the sources the driver accepted.
|
|
444
435
|
*/
|
|
445
|
-
declare function createWebResearchWorker(options?: WebResearchWorkerOptions): ResearchWorker;
|
|
446
|
-
interface VerifyingDriverOptions {
|
|
436
|
+
export declare function createWebResearchWorker(options?: WebResearchWorkerOptions): ResearchWorker;
|
|
437
|
+
export interface VerifyingDriverOptions {
|
|
447
438
|
router?: RouterClient;
|
|
448
439
|
router_options?: TangleRouterOptions;
|
|
449
440
|
/**
|
|
@@ -463,7 +454,7 @@ interface VerifyingDriverOptions {
|
|
|
463
454
|
* new candidates, so the verifier focuses on relevance + near-duplicate
|
|
464
455
|
* judgement, not bookkeeping.
|
|
465
456
|
*/
|
|
466
|
-
declare function createVerifyingResearchDriver(options?: VerifyingDriverOptions): ResearchDriver;
|
|
457
|
+
export declare function createVerifyingResearchDriver(options?: VerifyingDriverOptions): ResearchDriver;
|
|
467
458
|
//#endregion
|
|
468
459
|
//#region src/adaptive-driver.d.ts
|
|
469
460
|
/**
|
|
@@ -474,20 +465,20 @@ declare function createVerifyingResearchDriver(options?: VerifyingDriverOptions)
|
|
|
474
465
|
* as the same source. Falls back to the lowercased raw string when the input is
|
|
475
466
|
* not a parseable absolute URL (so non-http identifiers still dedup by equality).
|
|
476
467
|
*/
|
|
477
|
-
declare function canonicalizeUrl(uri: string): string;
|
|
468
|
+
export declare function canonicalizeUrl(uri: string): string;
|
|
478
469
|
/**
|
|
479
470
|
* A stable content key for a fetched page: the sha256 of its normalized text
|
|
480
471
|
* (lowercased, punctuation/whitespace collapsed). Two pages whose readable body
|
|
481
472
|
* is the same modulo formatting collide here, so the dedup stage rejects a
|
|
482
473
|
* mirror/syndication of an already-accepted source even when the URL differs.
|
|
483
474
|
*/
|
|
484
|
-
declare function contentKey(text: string): string;
|
|
475
|
+
export declare function contentKey(text: string): string;
|
|
485
476
|
/** Why the deterministic dedup stage rejected a candidate (for audit/notes). */
|
|
486
|
-
type DedupReason = 'duplicate-url' | 'duplicate-content';
|
|
477
|
+
export type DedupReason = 'duplicate-url' | 'duplicate-content';
|
|
487
478
|
/** The cheap-triage classification of a unique survivor. */
|
|
488
|
-
type TriageClass = 'keep' | 'drop' | 'ambiguous';
|
|
479
|
+
export type TriageClass = 'keep' | 'drop' | 'ambiguous';
|
|
489
480
|
/** One source's adaptive routing decision, for instrumentation and the doc. */
|
|
490
|
-
interface AdaptiveDecision {
|
|
481
|
+
export interface AdaptiveDecision {
|
|
491
482
|
uri: string;
|
|
492
483
|
/** The stage that decided this source: dedup | heuristic | llm. */
|
|
493
484
|
stage: 'dedup' | 'heuristic' | 'llm';
|
|
@@ -497,7 +488,7 @@ interface AdaptiveDecision {
|
|
|
497
488
|
reason?: string;
|
|
498
489
|
}
|
|
499
490
|
/** Running tally of where the adaptive driver spent its decisions. */
|
|
500
|
-
interface AdaptiveStats {
|
|
491
|
+
export interface AdaptiveStats {
|
|
501
492
|
total: number;
|
|
502
493
|
/** Rejected by deterministic dedup (URL or content). $0. */
|
|
503
494
|
dedupRejected: number;
|
|
@@ -511,7 +502,7 @@ interface AdaptiveStats {
|
|
|
511
502
|
llmAccepted: number;
|
|
512
503
|
decisions: AdaptiveDecision[];
|
|
513
504
|
}
|
|
514
|
-
interface AdaptiveDriverOptions {
|
|
505
|
+
export interface AdaptiveDriverOptions {
|
|
515
506
|
/** Router client for the LLM escalation. Defaults to a live client from env. */
|
|
516
507
|
router?: RouterClient;
|
|
517
508
|
router_options?: TangleRouterOptions;
|
|
@@ -548,7 +539,7 @@ interface AdaptiveDriverOptions {
|
|
|
548
539
|
* the residue the LLM is reserved for: on-topic-looking pages on unknown hosts
|
|
549
540
|
* with a plausible body, which a host/title rule cannot adjudicate.
|
|
550
541
|
*/
|
|
551
|
-
declare function triageSource(source: ResearchSourceProposal, options: {
|
|
542
|
+
export declare function triageSource(source: ResearchSourceProposal, options: {
|
|
552
543
|
authoritativeHosts: string[];
|
|
553
544
|
spamPatterns: RegExp[];
|
|
554
545
|
minBodyChars: number;
|
|
@@ -557,7 +548,7 @@ declare function triageSource(source: ResearchSourceProposal, options: {
|
|
|
557
548
|
triage: TriageClass;
|
|
558
549
|
reason: string;
|
|
559
550
|
};
|
|
560
|
-
interface AdaptiveResearchDriver {
|
|
551
|
+
export interface AdaptiveResearchDriver {
|
|
561
552
|
verifySource(source: ResearchSourceProposal, ctx: SourceVerificationContext): Promise<SourceVerdict>;
|
|
562
553
|
/** Live tally of where decisions were spent — the cost/quality instrumentation. */
|
|
563
554
|
stats(): AdaptiveStats;
|
|
@@ -572,7 +563,7 @@ interface AdaptiveResearchDriver {
|
|
|
572
563
|
* content hashes it has ACCEPTED, plus those it sees in the verification
|
|
573
564
|
* context's `acceptedThisRound` and the KB index. Use one driver per loop run.
|
|
574
565
|
*/
|
|
575
|
-
declare function createAdaptiveResearchDriver(options?: AdaptiveDriverOptions): AdaptiveResearchDriver;
|
|
566
|
+
export declare function createAdaptiveResearchDriver(options?: AdaptiveDriverOptions): AdaptiveResearchDriver;
|
|
576
567
|
//#endregion
|
|
577
568
|
//#region src/knowledge-state-scope.d.ts
|
|
578
569
|
/** Authoritative local state included in a KB improvement candidate. */
|
|
@@ -582,15 +573,15 @@ interface KnowledgeStateScope {
|
|
|
582
573
|
/** Include claim ledgers and research events. Excludes indexes, locks, and receipt artifacts. */
|
|
583
574
|
researchState?: boolean;
|
|
584
575
|
}
|
|
585
|
-
declare function normalizeKnowledgeStateScope(scope?: KnowledgeStateScope): {
|
|
576
|
+
export declare function normalizeKnowledgeStateScope(scope?: KnowledgeStateScope): {
|
|
586
577
|
pagesDirectory: string;
|
|
587
578
|
researchState: boolean;
|
|
588
579
|
};
|
|
589
580
|
//#endregion
|
|
590
581
|
//#region src/rag-optimization.d.ts
|
|
591
|
-
type RagOptimizationConfig = Record<string, AgentCandidateJsonValue>;
|
|
582
|
+
export type RagOptimizationConfig = Record<string, AgentCandidateJsonValue>;
|
|
592
583
|
type RagOptimizationBaseOptions = Omit<RunSerializedKnowledgeOptimizationOptions<RagOptimizationConfig, RagAnswerEvalScenario, RagAnswerEvalArtifact>, 'baseline' | 'method' | 'trainScenarios' | 'selectionScenarios' | 'finalScenarios' | 'dispatchCandidate' | 'judges' | 'codec' | 'scenarioFingerprint'>;
|
|
593
|
-
interface RunRagOptimizationOptions extends RagOptimizationBaseOptions {
|
|
584
|
+
export interface RunRagOptimizationOptions extends RagOptimizationBaseOptions {
|
|
594
585
|
baseline: RagOptimizationConfig;
|
|
595
586
|
method: OptimizationMethod<RagAnswerEvalScenario, RagAnswerEvalArtifact>;
|
|
596
587
|
trainScenarios: readonly RagAnswerEvalScenario[];
|
|
@@ -605,7 +596,7 @@ interface RunRagOptimizationOptions extends RagOptimizationBaseOptions {
|
|
|
605
596
|
}): Promise<RagAnswerEvalArtifact>;
|
|
606
597
|
judges?: readonly JudgeConfig<RagAnswerEvalArtifact, RagAnswerEvalScenario>[];
|
|
607
598
|
}
|
|
608
|
-
interface RunRagOptimizationResult extends RunSerializedKnowledgeOptimizationResult<RagOptimizationConfig> {
|
|
599
|
+
export interface RunRagOptimizationResult extends RunSerializedKnowledgeOptimizationResult<RagOptimizationConfig> {
|
|
609
600
|
baselineConfig: RagOptimizationConfig;
|
|
610
601
|
winnerConfig: RagOptimizationConfig;
|
|
611
602
|
trainScenarios: readonly RagAnswerEvalScenario[];
|
|
@@ -613,11 +604,11 @@ interface RunRagOptimizationResult extends RunSerializedKnowledgeOptimizationRes
|
|
|
613
604
|
finalScenarios: readonly RagAnswerEvalScenario[];
|
|
614
605
|
}
|
|
615
606
|
/** Optimizes retrieval and answer behavior together as one serialized RAG configuration. */
|
|
616
|
-
declare function runRagOptimization(options: RunRagOptimizationOptions): Promise<RunRagOptimizationResult>;
|
|
607
|
+
export declare function runRagOptimization(options: RunRagOptimizationOptions): Promise<RunRagOptimizationResult>;
|
|
617
608
|
//#endregion
|
|
618
609
|
//#region src/pages-directory.d.ts
|
|
619
610
|
/** Root-relative directory that holds Markdown pages when a caller names none. */
|
|
620
|
-
declare const DEFAULT_PAGES_DIRECTORY = "knowledge";
|
|
611
|
+
export declare const DEFAULT_PAGES_DIRECTORY = "knowledge";
|
|
621
612
|
/**
|
|
622
613
|
* Selects the root-relative directory that holds Markdown pages.
|
|
623
614
|
*
|
|
@@ -625,7 +616,7 @@ declare const DEFAULT_PAGES_DIRECTORY = "knowledge";
|
|
|
625
616
|
* run-scoped chain, and the write protocol, so a store laid out as
|
|
626
617
|
* `kb/pages/<line>/` is read and written through one value.
|
|
627
618
|
*/
|
|
628
|
-
interface KnowledgePagesOptions {
|
|
619
|
+
export interface KnowledgePagesOptions {
|
|
629
620
|
/** Root-relative directory that holds Markdown pages. Defaults to `knowledge`. */
|
|
630
621
|
pagesDirectory?: string;
|
|
631
622
|
}
|
|
@@ -637,10 +628,10 @@ interface KnowledgePagesOptions {
|
|
|
637
628
|
* paths, drive letters, `..` or `.` segments, empty segments, control
|
|
638
629
|
* characters, and the package-owned `.agent-knowledge` and `raw` trees.
|
|
639
630
|
*/
|
|
640
|
-
declare function normalizePagesDirectory(value?: string): string;
|
|
631
|
+
export declare function normalizePagesDirectory(value?: string): string;
|
|
641
632
|
//#endregion
|
|
642
633
|
//#region src/store.d.ts
|
|
643
|
-
interface KnowledgeLayout {
|
|
634
|
+
export interface KnowledgeLayout {
|
|
644
635
|
root: string;
|
|
645
636
|
knowledgeDir: string;
|
|
646
637
|
rawSourcesDir: string;
|
|
@@ -649,7 +640,7 @@ interface KnowledgeLayout {
|
|
|
649
640
|
logPath: string;
|
|
650
641
|
cacheDir: string;
|
|
651
642
|
}
|
|
652
|
-
declare function layoutFor(root: string): KnowledgeLayout;
|
|
643
|
+
export declare function layoutFor(root: string): KnowledgeLayout;
|
|
653
644
|
/**
|
|
654
645
|
* Filenames that `initKnowledgeBase` writes as human-navigation scaffolding.
|
|
655
646
|
* These are excluded from the page index — they exist on disk so authors can
|
|
@@ -658,7 +649,7 @@ declare function layoutFor(root: string): KnowledgeLayout;
|
|
|
658
649
|
* Add new scaffold filenames here (and only here) to keep lint, validate, viz,
|
|
659
650
|
* and the indexer consistent.
|
|
660
651
|
*/
|
|
661
|
-
declare const SCAFFOLD_PAGE_BASENAMES: readonly string[];
|
|
652
|
+
export declare const SCAFFOLD_PAGE_BASENAMES: readonly string[];
|
|
662
653
|
/**
|
|
663
654
|
* True when a knowledge-relative path points at a scaffold file rather than
|
|
664
655
|
* authored content. Accepts both repo-relative paths (`knowledge/index.md`)
|
|
@@ -666,24 +657,24 @@ declare const SCAFFOLD_PAGE_BASENAMES: readonly string[];
|
|
|
666
657
|
* `knowledge/concepts/index.md`) so subdirectory README-style scaffolds are
|
|
667
658
|
* also excluded.
|
|
668
659
|
*/
|
|
669
|
-
declare function isScaffoldPath(path: string): boolean;
|
|
670
|
-
declare function initKnowledgeBase(root: string): Promise<KnowledgeLayout>;
|
|
671
|
-
declare function loadKnowledgePages(root: string, options?: KnowledgePagesOptions): Promise<KnowledgePage[]>;
|
|
660
|
+
export declare function isScaffoldPath(path: string): boolean;
|
|
661
|
+
export declare function initKnowledgeBase(root: string): Promise<KnowledgeLayout>;
|
|
662
|
+
export declare function loadKnowledgePages(root: string, options?: KnowledgePagesOptions): Promise<KnowledgePage[]>;
|
|
672
663
|
/** True when a root-relative path names authored Markdown rather than scaffolding. */
|
|
673
|
-
declare function isKnowledgePagePath(path: string): boolean;
|
|
664
|
+
export declare function isKnowledgePagePath(path: string): boolean;
|
|
674
665
|
/**
|
|
675
666
|
* Build a page from the bytes of one Markdown file.
|
|
676
667
|
*
|
|
677
668
|
* The reader and every gate that inspects a page before it is written share
|
|
678
669
|
* this constructor, so what a gate judges is exactly what the store loads back.
|
|
679
670
|
*/
|
|
680
|
-
declare function knowledgePageFromMarkdown(path: string, content: string, pagesDirectory?: string): KnowledgePage;
|
|
681
|
-
declare function writeJson(path: string, value: unknown): Promise<void>;
|
|
671
|
+
export declare function knowledgePageFromMarkdown(path: string, content: string, pagesDirectory?: string): KnowledgePage;
|
|
672
|
+
export declare function writeJson(path: string, value: unknown): Promise<void>;
|
|
682
673
|
//#endregion
|
|
683
674
|
//#region src/run-scoped.d.ts
|
|
684
675
|
/** Where a page in a chained read came from. */
|
|
685
|
-
type PageOrigin = 'here' | `inherited:${string}` | 'shared';
|
|
686
|
-
interface OriginatedPage {
|
|
676
|
+
export type PageOrigin = 'here' | `inherited:${string}` | 'shared';
|
|
677
|
+
export interface OriginatedPage {
|
|
687
678
|
page: KnowledgePage;
|
|
688
679
|
origin: PageOrigin;
|
|
689
680
|
}
|
|
@@ -695,8 +686,8 @@ interface OriginatedPage {
|
|
|
695
686
|
* invalidation propagation — take one page shape whether or not the caller
|
|
696
687
|
* runs run-scoped stores.
|
|
697
688
|
*/
|
|
698
|
-
declare function originatedPages(pages: readonly KnowledgePage[], origin?: PageOrigin): OriginatedPage[];
|
|
699
|
-
interface RunLineageRecord {
|
|
689
|
+
export declare function originatedPages(pages: readonly KnowledgePage[], origin?: PageOrigin): OriginatedPage[];
|
|
690
|
+
export interface RunLineageRecord {
|
|
700
691
|
runId: string;
|
|
701
692
|
parentRunId: string | null;
|
|
702
693
|
createdAt: string;
|
|
@@ -709,12 +700,12 @@ interface RunLineageRecord {
|
|
|
709
700
|
* that case `init` verifies that the existing authority agrees with the parent
|
|
710
701
|
* requested by the caller before creating any store files.
|
|
711
702
|
*/
|
|
712
|
-
interface RunLineageAuthority {
|
|
703
|
+
export interface RunLineageAuthority {
|
|
713
704
|
parentOf(runId: string): Promise<string | null>;
|
|
714
705
|
record?(record: RunLineageRecord): Promise<void>;
|
|
715
706
|
}
|
|
716
|
-
declare const RUN_LINEAGE_BASENAME = "lineage.json";
|
|
717
|
-
interface RunScopedStoresOptions extends KnowledgePagesOptions {
|
|
707
|
+
export declare const RUN_LINEAGE_BASENAME = "lineage.json";
|
|
708
|
+
export interface RunScopedStoresOptions extends KnowledgePagesOptions {
|
|
718
709
|
/** The root under which per-run stores live. */
|
|
719
710
|
root: string;
|
|
720
711
|
/** Store path for a run; defaults to `<root>/<runId>/knowledge-base`. */
|
|
@@ -730,7 +721,7 @@ interface RunScopedStoresOptions extends KnowledgePagesOptions {
|
|
|
730
721
|
* Cycles and invalid identities are always refused; long valid history is not corruption. */
|
|
731
722
|
maxAncestors?: number;
|
|
732
723
|
}
|
|
733
|
-
interface RunScopedStores {
|
|
724
|
+
export interface RunScopedStores {
|
|
734
725
|
/** Create or open a run store and bind it to one exact parent identity. */
|
|
735
726
|
init(runId: string, options?: {
|
|
736
727
|
parentRunId?: string | null;
|
|
@@ -750,9 +741,9 @@ interface RunScopedStores {
|
|
|
750
741
|
*/
|
|
751
742
|
loadChain(runId: string): Promise<OriginatedPage[]>;
|
|
752
743
|
}
|
|
753
|
-
declare function createRunScopedStores(options: RunScopedStoresOptions): RunScopedStores;
|
|
744
|
+
export declare function createRunScopedStores(options: RunScopedStoresOptions): RunScopedStores;
|
|
754
745
|
/** File-backed authority used when the product has no separate run manifest. */
|
|
755
|
-
declare function createFileRunLineageAuthority(runStorePath: (runId: string) => string): RunLineageAuthority;
|
|
746
|
+
export declare function createFileRunLineageAuthority(runStorePath: (runId: string) => string): RunLineageAuthority;
|
|
756
747
|
//#endregion
|
|
757
748
|
//#region src/citation-resolution.d.ts
|
|
758
749
|
/**
|
|
@@ -762,24 +753,24 @@ declare function createFileRunLineageAuthority(runStorePath: (runId: string) =>
|
|
|
762
753
|
* the requested id. Callers can qualify a reference by origin when a current,
|
|
763
754
|
* inherited, or shared page intentionally reuses the same stable id.
|
|
764
755
|
*/
|
|
765
|
-
interface KnowledgeCitationReference {
|
|
756
|
+
export interface KnowledgeCitationReference {
|
|
766
757
|
readonly pageId: KnowledgeId;
|
|
767
758
|
readonly origin?: PageOrigin;
|
|
768
759
|
}
|
|
769
|
-
interface KnowledgeCitationCandidate {
|
|
760
|
+
export interface KnowledgeCitationCandidate {
|
|
770
761
|
readonly pageId: KnowledgeId;
|
|
771
762
|
readonly origin: PageOrigin;
|
|
772
763
|
readonly page: KnowledgePage;
|
|
773
764
|
}
|
|
774
|
-
type KnowledgeCitationResolutionStatus = 'resolved' | 'missing' | 'ambiguous';
|
|
775
|
-
interface KnowledgeCitationResolution {
|
|
765
|
+
export type KnowledgeCitationResolutionStatus = 'resolved' | 'missing' | 'ambiguous';
|
|
766
|
+
export interface KnowledgeCitationResolution {
|
|
776
767
|
readonly reference: KnowledgeCitationReference;
|
|
777
768
|
readonly status: KnowledgeCitationResolutionStatus;
|
|
778
769
|
readonly candidates: readonly KnowledgeCitationCandidate[];
|
|
779
770
|
readonly resolved?: KnowledgeCitationCandidate;
|
|
780
771
|
}
|
|
781
|
-
type KnowledgeCitationAuditIssueKind = 'self' | 'missing' | 'ambiguous';
|
|
782
|
-
interface KnowledgeCitationAuditIssue {
|
|
772
|
+
export type KnowledgeCitationAuditIssueKind = 'self' | 'missing' | 'ambiguous';
|
|
773
|
+
export interface KnowledgeCitationAuditIssue {
|
|
783
774
|
readonly kind: KnowledgeCitationAuditIssueKind;
|
|
784
775
|
readonly sourcePageId: KnowledgeId;
|
|
785
776
|
readonly sourcePath: string;
|
|
@@ -788,23 +779,23 @@ interface KnowledgeCitationAuditIssue {
|
|
|
788
779
|
readonly reference: KnowledgeCitationReference;
|
|
789
780
|
readonly candidates: readonly KnowledgeCitationCandidate[];
|
|
790
781
|
}
|
|
791
|
-
interface KnowledgeCitationAuditReport {
|
|
782
|
+
export interface KnowledgeCitationAuditReport {
|
|
792
783
|
readonly ok: boolean;
|
|
793
784
|
readonly checkedPages: number;
|
|
794
785
|
readonly checkedCitations: number;
|
|
795
786
|
readonly issues: readonly KnowledgeCitationAuditIssue[];
|
|
796
787
|
}
|
|
797
|
-
interface AuditKnowledgeCitationsOptions {
|
|
788
|
+
export interface AuditKnowledgeCitationsOptions {
|
|
798
789
|
/** Limit audited source pages to these origins. All visible origins are checked by default. */
|
|
799
790
|
readonly sourceOrigins?: readonly PageOrigin[];
|
|
800
791
|
}
|
|
801
792
|
/** A batch contains at least one citation that is missing or ambiguous. */
|
|
802
|
-
declare class KnowledgeCitationResolutionError extends Error {
|
|
793
|
+
export declare class KnowledgeCitationResolutionError extends Error {
|
|
803
794
|
readonly resolutions: readonly KnowledgeCitationResolution[];
|
|
804
795
|
constructor(resolutions: readonly KnowledgeCitationResolution[]);
|
|
805
796
|
}
|
|
806
797
|
/** A persisted page contains a self, missing, or ambiguous citation. */
|
|
807
|
-
declare class KnowledgeCitationAuditError extends Error {
|
|
798
|
+
export declare class KnowledgeCitationAuditError extends Error {
|
|
808
799
|
readonly report: KnowledgeCitationAuditReport;
|
|
809
800
|
constructor(report: KnowledgeCitationAuditReport);
|
|
810
801
|
}
|
|
@@ -817,32 +808,32 @@ declare class KnowledgeCitationAuditError extends Error {
|
|
|
817
808
|
* tuple (null origin means unqualified). Always use the formatter to mint handles.
|
|
818
809
|
* Legacy percent sequences are literal; old records are not silently reinterpreted.
|
|
819
810
|
*/
|
|
820
|
-
declare function parseKnowledgeCitationReference(value: string): KnowledgeCitationReference;
|
|
811
|
+
export declare function parseKnowledgeCitationReference(value: string): KnowledgeCitationReference;
|
|
821
812
|
/** Serialize one reference into the canonical frontmatter representation. */
|
|
822
|
-
declare function formatKnowledgeCitationReference(reference: KnowledgeCitationReference): string;
|
|
813
|
+
export declare function formatKnowledgeCitationReference(reference: KnowledgeCitationReference): string;
|
|
823
814
|
/** Resolve one reference against an already materialized visibility chain. */
|
|
824
|
-
declare function resolveKnowledgeCitation(visiblePages: readonly OriginatedPage[], reference: KnowledgeCitationReference): KnowledgeCitationResolution;
|
|
815
|
+
export declare function resolveKnowledgeCitation(visiblePages: readonly OriginatedPage[], reference: KnowledgeCitationReference): KnowledgeCitationResolution;
|
|
825
816
|
/** Resolve a batch without discarding missing or ambiguous rows. */
|
|
826
|
-
declare function resolveKnowledgeCitations(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationResolution[];
|
|
817
|
+
export declare function resolveKnowledgeCitations(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationResolution[];
|
|
827
818
|
/**
|
|
828
819
|
* Resolve a batch and fail closed unless every reference names exactly one
|
|
829
820
|
* visible page. Returned candidates preserve the caller's reference order.
|
|
830
821
|
*/
|
|
831
|
-
declare function assertKnowledgeCitationsResolved(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationCandidate[];
|
|
822
|
+
export declare function assertKnowledgeCitationsResolved(visiblePages: readonly OriginatedPage[], references: readonly KnowledgeCitationReference[]): readonly KnowledgeCitationCandidate[];
|
|
832
823
|
/** Audit persisted `cites` relations against one immutable visibility snapshot. */
|
|
833
|
-
declare function auditKnowledgeCitations(visiblePages: readonly OriginatedPage[], options?: AuditKnowledgeCitationsOptions): KnowledgeCitationAuditReport;
|
|
824
|
+
export declare function auditKnowledgeCitations(visiblePages: readonly OriginatedPage[], options?: AuditKnowledgeCitationsOptions): KnowledgeCitationAuditReport;
|
|
834
825
|
/** Audit and fail closed when any persisted citation is unresolved. */
|
|
835
|
-
declare function assertKnowledgeCitationAudit(report: KnowledgeCitationAuditReport): void;
|
|
826
|
+
export declare function assertKnowledgeCitationAudit(report: KnowledgeCitationAuditReport): void;
|
|
836
827
|
/** Resolve one citation using a run-scoped store's declared visibility chain. */
|
|
837
|
-
declare function resolveRunScopedCitation(stores: RunScopedStores, runId: string, reference: KnowledgeCitationReference): Promise<KnowledgeCitationResolution>;
|
|
828
|
+
export declare function resolveRunScopedCitation(stores: RunScopedStores, runId: string, reference: KnowledgeCitationReference): Promise<KnowledgeCitationResolution>;
|
|
838
829
|
/** Resolve citations using one chain read so every row sees the same snapshot. */
|
|
839
|
-
declare function resolveRunScopedCitations(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationResolution[]>;
|
|
830
|
+
export declare function resolveRunScopedCitations(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationResolution[]>;
|
|
840
831
|
/** Resolve a run-scoped batch and fail closed on any missing or ambiguous id. */
|
|
841
|
-
declare function assertRunScopedCitationsResolved(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationCandidate[]>;
|
|
832
|
+
export declare function assertRunScopedCitationsResolved(stores: RunScopedStores, runId: string, references: readonly KnowledgeCitationReference[]): Promise<readonly KnowledgeCitationCandidate[]>;
|
|
842
833
|
/** Audit only pages authored in the current run against the full visible chain. */
|
|
843
|
-
declare function auditCurrentRunCitations(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
834
|
+
export declare function auditCurrentRunCitations(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
844
835
|
/** Audit current-run citations and fail closed on every unresolved relation. */
|
|
845
|
-
declare function assertCurrentRunCitationsResolved(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
836
|
+
export declare function assertCurrentRunCitationsResolved(stores: RunScopedStores, runId: string): Promise<KnowledgeCitationAuditReport>;
|
|
846
837
|
//#endregion
|
|
847
838
|
//#region src/rag-eval/near-duplicates.d.ts
|
|
848
839
|
interface NearDuplicateDetectionOptions {
|
|
@@ -895,12 +886,12 @@ interface NearDuplicateReport {
|
|
|
895
886
|
* common. Every limit and sort order is explicit so the same corpus produces
|
|
896
887
|
* the same report on every run.
|
|
897
888
|
*/
|
|
898
|
-
declare function detectNearDuplicatePages(pages: readonly KnowledgePage[], options?: NearDuplicateDetectionOptions): NearDuplicateReport;
|
|
899
|
-
declare function normalizePageText(value: string): string;
|
|
889
|
+
export declare function detectNearDuplicatePages(pages: readonly KnowledgePage[], options?: NearDuplicateDetectionOptions): NearDuplicateReport;
|
|
890
|
+
export declare function normalizePageText(value: string): string;
|
|
900
891
|
//#endregion
|
|
901
892
|
//#region src/write-intake.d.ts
|
|
902
893
|
/** One candidate that duplicates visible knowledge without relating itself to it. */
|
|
903
|
-
interface KnowledgeDuplicateIntakePair {
|
|
894
|
+
export interface KnowledgeDuplicateIntakePair {
|
|
904
895
|
readonly candidatePageId: KnowledgeId;
|
|
905
896
|
readonly candidatePath: string;
|
|
906
897
|
readonly matchedPageId: KnowledgeId;
|
|
@@ -915,12 +906,12 @@ interface KnowledgeDuplicateIntakePair {
|
|
|
915
906
|
* name it in `contradicts`, or give the candidate the matched page's id so the
|
|
916
907
|
* write is an update of it.
|
|
917
908
|
*/
|
|
918
|
-
declare class KnowledgeDuplicateIntakeError extends Error {
|
|
909
|
+
export declare class KnowledgeDuplicateIntakeError extends Error {
|
|
919
910
|
readonly pairs: readonly KnowledgeDuplicateIntakePair[];
|
|
920
911
|
readonly threshold: number;
|
|
921
912
|
constructor(pairs: readonly KnowledgeDuplicateIntakePair[], threshold: number);
|
|
922
913
|
}
|
|
923
|
-
interface KnowledgeWriteIntakeOptions {
|
|
914
|
+
export interface KnowledgeWriteIntakeOptions {
|
|
924
915
|
/**
|
|
925
916
|
* The chain the write lands in, as `loadChain` reports it. Candidates replace
|
|
926
917
|
* the `here` entries at the same paths; an inherited or shared page at one of
|
|
@@ -944,15 +935,15 @@ interface KnowledgeWriteIntakeOptions {
|
|
|
944
935
|
* Returns the resolved citation candidates in the order the candidates declare
|
|
945
936
|
* them.
|
|
946
937
|
*/
|
|
947
|
-
declare function assertKnowledgeWriteIntake(candidates: readonly KnowledgePage[], options: KnowledgeWriteIntakeOptions): readonly KnowledgeCitationCandidate[];
|
|
938
|
+
export declare function assertKnowledgeWriteIntake(candidates: readonly KnowledgePage[], options: KnowledgeWriteIntakeOptions): readonly KnowledgeCitationCandidate[];
|
|
948
939
|
//#endregion
|
|
949
940
|
//#region src/proposals.d.ts
|
|
950
|
-
interface ApplyWriteBlocksResult {
|
|
941
|
+
export interface ApplyWriteBlocksResult {
|
|
951
942
|
written: string[];
|
|
952
943
|
warnings: string[];
|
|
953
944
|
}
|
|
954
945
|
/** Intake settings for a write, minus the pages the target root supplies itself. */
|
|
955
|
-
type KnowledgeWriteIntakeRequest = Omit<KnowledgeWriteIntakeOptions, 'visiblePages'> & {
|
|
946
|
+
export type KnowledgeWriteIntakeRequest = Omit<KnowledgeWriteIntakeOptions, 'visiblePages'> & {
|
|
956
947
|
/**
|
|
957
948
|
* Pages visible to the write beyond the target root, such as the inherited
|
|
958
949
|
* and shared entries of a run-scoped chain. The target root's own pages are
|
|
@@ -960,7 +951,7 @@ type KnowledgeWriteIntakeRequest = Omit<KnowledgeWriteIntakeOptions, 'visiblePag
|
|
|
960
951
|
*/
|
|
961
952
|
readonly inheritedPages?: readonly OriginatedPage[];
|
|
962
953
|
};
|
|
963
|
-
interface ApplyKnowledgeWriteBlocksOptions extends KnowledgePagesOptions {
|
|
954
|
+
export interface ApplyKnowledgeWriteBlocksOptions extends KnowledgePagesOptions {
|
|
964
955
|
/** Preserve terminal transactions under .agent-knowledge/history; no automatic deletion. */
|
|
965
956
|
readonly retainHistory?: boolean;
|
|
966
957
|
/**
|
|
@@ -977,21 +968,21 @@ interface ApplyKnowledgeWriteBlocksOptions extends KnowledgePagesOptions {
|
|
|
977
968
|
* and again by the file transaction, so one option value bounds the whole
|
|
978
969
|
* write.
|
|
979
970
|
*/
|
|
980
|
-
declare function applyKnowledgeWriteBlocks(root: string, proposalText: string, options?: ApplyKnowledgeWriteBlocksOptions): Promise<ApplyWriteBlocksResult>;
|
|
981
|
-
declare function applyKnowledgeWriteBlocksFile(root: string, proposalPath: string, options?: ApplyKnowledgeWriteBlocksOptions): Promise<ApplyWriteBlocksResult>;
|
|
971
|
+
export declare function applyKnowledgeWriteBlocks(root: string, proposalText: string, options?: ApplyKnowledgeWriteBlocksOptions): Promise<ApplyWriteBlocksResult>;
|
|
972
|
+
export declare function applyKnowledgeWriteBlocksFile(root: string, proposalPath: string, options?: ApplyKnowledgeWriteBlocksOptions): Promise<ApplyWriteBlocksResult>;
|
|
982
973
|
//#endregion
|
|
983
974
|
//#region src/validate.d.ts
|
|
984
|
-
interface ValidateKnowledgeOptions {
|
|
975
|
+
export interface ValidateKnowledgeOptions {
|
|
985
976
|
strict?: boolean;
|
|
986
977
|
}
|
|
987
|
-
interface ValidateKnowledgeResult {
|
|
978
|
+
export interface ValidateKnowledgeResult {
|
|
988
979
|
ok: boolean;
|
|
989
980
|
findings: KnowledgeLintFinding[];
|
|
990
981
|
}
|
|
991
|
-
declare function validateKnowledgeIndex(index: KnowledgeIndex, options?: ValidateKnowledgeOptions): ValidateKnowledgeResult;
|
|
982
|
+
export declare function validateKnowledgeIndex(index: KnowledgeIndex, options?: ValidateKnowledgeOptions): ValidateKnowledgeResult;
|
|
992
983
|
//#endregion
|
|
993
984
|
//#region src/research-loop.d.ts
|
|
994
|
-
interface KnowledgeResearchLoopContext {
|
|
985
|
+
export interface KnowledgeResearchLoopContext {
|
|
995
986
|
root: string;
|
|
996
987
|
goal: string;
|
|
997
988
|
iteration: number;
|
|
@@ -1002,7 +993,7 @@ interface KnowledgeResearchLoopContext {
|
|
|
1002
993
|
previousSteps: KnowledgeResearchLoopStep[];
|
|
1003
994
|
signal?: AbortSignal;
|
|
1004
995
|
}
|
|
1005
|
-
interface KnowledgeResearchLoopDecision {
|
|
996
|
+
export interface KnowledgeResearchLoopDecision {
|
|
1006
997
|
/**
|
|
1007
998
|
* Free-form notes from the researcher. Keep this human-readable; products can
|
|
1008
999
|
* store it as the research transcript.
|
|
@@ -1029,7 +1020,7 @@ interface KnowledgeResearchLoopDecision {
|
|
|
1029
1020
|
done?: boolean;
|
|
1030
1021
|
metadata?: Record<string, unknown>;
|
|
1031
1022
|
}
|
|
1032
|
-
interface KnowledgeResearchLoopStep {
|
|
1023
|
+
export interface KnowledgeResearchLoopStep {
|
|
1033
1024
|
iteration: number;
|
|
1034
1025
|
notes?: string;
|
|
1035
1026
|
addedSources: SourceRecord[];
|
|
@@ -1041,7 +1032,7 @@ interface KnowledgeResearchLoopStep {
|
|
|
1041
1032
|
done: boolean;
|
|
1042
1033
|
metadata?: Record<string, unknown>;
|
|
1043
1034
|
}
|
|
1044
|
-
interface RunKnowledgeResearchLoopOptions {
|
|
1035
|
+
export interface RunKnowledgeResearchLoopOptions {
|
|
1045
1036
|
pagesDirectory?: string;
|
|
1046
1037
|
root: string;
|
|
1047
1038
|
goal: string;
|
|
@@ -1056,7 +1047,7 @@ interface RunKnowledgeResearchLoopOptions {
|
|
|
1056
1047
|
step(context: KnowledgeResearchLoopContext): Promise<KnowledgeResearchLoopDecision> | KnowledgeResearchLoopDecision;
|
|
1057
1048
|
onStep?: (step: KnowledgeResearchLoopStep) => Promise<void> | void;
|
|
1058
1049
|
}
|
|
1059
|
-
interface KnowledgeResearchLoopResult {
|
|
1050
|
+
export interface KnowledgeResearchLoopResult {
|
|
1060
1051
|
root: string;
|
|
1061
1052
|
goal: string;
|
|
1062
1053
|
iterations: number;
|
|
@@ -1067,10 +1058,10 @@ interface KnowledgeResearchLoopResult {
|
|
|
1067
1058
|
readiness?: EvalKnowledgeBundleBuildResult;
|
|
1068
1059
|
steps: KnowledgeResearchLoopStep[];
|
|
1069
1060
|
}
|
|
1070
|
-
type KnowledgeControlLoopState = KnowledgeResearchLoopContext;
|
|
1071
|
-
type KnowledgeControlLoopAction = KnowledgeResearchLoopDecision;
|
|
1072
|
-
type KnowledgeControlLoopActionResult = KnowledgeResearchLoopStep;
|
|
1073
|
-
interface KnowledgeControlLoopAdapterOptions {
|
|
1061
|
+
export type KnowledgeControlLoopState = KnowledgeResearchLoopContext;
|
|
1062
|
+
export type KnowledgeControlLoopAction = KnowledgeResearchLoopDecision;
|
|
1063
|
+
export type KnowledgeControlLoopActionResult = KnowledgeResearchLoopStep;
|
|
1064
|
+
export interface KnowledgeControlLoopAdapterOptions {
|
|
1074
1065
|
pagesDirectory?: string;
|
|
1075
1066
|
root: string;
|
|
1076
1067
|
goal: string;
|
|
@@ -1081,18 +1072,18 @@ interface KnowledgeControlLoopAdapterOptions {
|
|
|
1081
1072
|
readiness?: Omit<BuildEvalKnowledgeBundleOptions, 'taskId' | 'index' | 'specs'>;
|
|
1082
1073
|
sourceOptions?: Pick<AddSourceOptions, 'adapters' | 'now'>;
|
|
1083
1074
|
}
|
|
1084
|
-
type KnowledgeControlLoopAdapter = Pick<ControlRuntimeConfig<KnowledgeControlLoopState, KnowledgeControlLoopAction, KnowledgeControlLoopActionResult, ControlEvalResult>, 'intent' | 'observe' | 'validate' | 'act' | 'shouldStop' | 'stopPolicies'>;
|
|
1075
|
+
export type KnowledgeControlLoopAdapter = Pick<ControlRuntimeConfig<KnowledgeControlLoopState, KnowledgeControlLoopAction, KnowledgeControlLoopActionResult, ControlEvalResult>, 'intent' | 'observe' | 'validate' | 'act' | 'shouldStop' | 'stopPolicies'>;
|
|
1085
1076
|
/**
|
|
1086
1077
|
* Adapter for running knowledge growth through `agent-eval`'s generic control
|
|
1087
1078
|
* runtime. The caller still owns `decide`: that can be a proposer agent,
|
|
1088
1079
|
* reviewer agent, deterministic policy, or a composition of all three.
|
|
1089
1080
|
*/
|
|
1090
|
-
declare function createKnowledgeControlLoopAdapter(options: KnowledgeControlLoopAdapterOptions): KnowledgeControlLoopAdapter;
|
|
1091
|
-
declare function runKnowledgeResearchLoop(options: RunKnowledgeResearchLoopOptions): Promise<KnowledgeResearchLoopResult>;
|
|
1081
|
+
export declare function createKnowledgeControlLoopAdapter(options: KnowledgeControlLoopAdapterOptions): KnowledgeControlLoopAdapter;
|
|
1082
|
+
export declare function runKnowledgeResearchLoop(options: RunKnowledgeResearchLoopOptions): Promise<KnowledgeResearchLoopResult>;
|
|
1092
1083
|
//#endregion
|
|
1093
1084
|
//#region src/retrieval-optimization.d.ts
|
|
1094
1085
|
type RetrievalOptimizationBaseOptions = Omit<RunSerializedKnowledgeOptimizationOptions<RetrievalConfig, RetrievalEvalScenario, RetrievalEvalArtifact>, 'baseline' | 'method' | 'trainScenarios' | 'selectionScenarios' | 'finalScenarios' | 'dispatchCandidate' | 'judges' | 'codec' | 'scenarioFingerprint'>;
|
|
1095
|
-
interface RunRetrievalImprovementLoopOptions extends RetrievalOptimizationBaseOptions {
|
|
1086
|
+
export interface RunRetrievalImprovementLoopOptions extends RetrievalOptimizationBaseOptions {
|
|
1096
1087
|
baseline: RetrievalConfig;
|
|
1097
1088
|
trainScenarios: readonly RetrievalEvalScenario[];
|
|
1098
1089
|
selectionScenarios: readonly RetrievalEvalScenario[];
|
|
@@ -1104,21 +1095,21 @@ interface RunRetrievalImprovementLoopOptions extends RetrievalOptimizationBaseOp
|
|
|
1104
1095
|
judges?: readonly JudgeConfig<RetrievalEvalArtifact, RetrievalEvalScenario>[];
|
|
1105
1096
|
metricWeights?: RetrievalMetricWeights;
|
|
1106
1097
|
}
|
|
1107
|
-
interface RunRetrievalImprovementLoopResult extends RunSerializedKnowledgeOptimizationResult<RetrievalConfig> {
|
|
1098
|
+
export interface RunRetrievalImprovementLoopResult extends RunSerializedKnowledgeOptimizationResult<RetrievalConfig> {
|
|
1108
1099
|
baselineConfig: RetrievalConfig;
|
|
1109
1100
|
winnerConfig: RetrievalConfig;
|
|
1110
1101
|
trainScenarios: readonly RetrievalEvalScenario[];
|
|
1111
1102
|
selectionScenarios: readonly RetrievalEvalScenario[];
|
|
1112
1103
|
finalScenarios: readonly RetrievalEvalScenario[];
|
|
1113
1104
|
}
|
|
1114
|
-
declare function runRetrievalImprovementLoop(options: RunRetrievalImprovementLoopOptions): Promise<RunRetrievalImprovementLoopResult>;
|
|
1105
|
+
export declare function runRetrievalImprovementLoop(options: RunRetrievalImprovementLoopOptions): Promise<RunRetrievalImprovementLoopResult>;
|
|
1115
1106
|
//#endregion
|
|
1116
1107
|
//#region src/rag-improvement-loop.d.ts
|
|
1117
|
-
type RagKnowledgeImprovementPhase = 'rag-optimization' | 'retrieval-tuning' | 'gap-diagnosis' | 'knowledge-acquisition' | 'knowledge-update' | 'answer-quality' | 'promotion';
|
|
1118
|
-
type RagKnowledgeImprovementPhaseStatus = 'completed' | 'skipped' | 'failed';
|
|
1119
|
-
type RagGapKind = 'missing-source' | 'stale-source' | 'retrieval-miss' | 'retrieval-noise' | 'chunking-mismatch' | 'missing-multihop-evidence' | 'generator-unsupported-claim' | 'citation-mismatch' | 'incorrect-abstention' | 'unknown';
|
|
1120
|
-
type RagGapSeverity = 'info' | 'warning' | 'error' | 'critical';
|
|
1121
|
-
interface RagGapFinding {
|
|
1108
|
+
export type RagKnowledgeImprovementPhase = 'rag-optimization' | 'retrieval-tuning' | 'gap-diagnosis' | 'knowledge-acquisition' | 'knowledge-update' | 'answer-quality' | 'promotion';
|
|
1109
|
+
export type RagKnowledgeImprovementPhaseStatus = 'completed' | 'skipped' | 'failed';
|
|
1110
|
+
export type RagGapKind = 'missing-source' | 'stale-source' | 'retrieval-miss' | 'retrieval-noise' | 'chunking-mismatch' | 'missing-multihop-evidence' | 'generator-unsupported-claim' | 'citation-mismatch' | 'incorrect-abstention' | 'unknown';
|
|
1111
|
+
export type RagGapSeverity = 'info' | 'warning' | 'error' | 'critical';
|
|
1112
|
+
export interface RagGapFinding {
|
|
1122
1113
|
id: string;
|
|
1123
1114
|
kind: RagGapKind;
|
|
1124
1115
|
severity: RagGapSeverity;
|
|
@@ -1126,7 +1117,7 @@ interface RagGapFinding {
|
|
|
1126
1117
|
scenarioId?: string;
|
|
1127
1118
|
evidence?: Record<string, AgentCandidateJsonValue>;
|
|
1128
1119
|
}
|
|
1129
|
-
interface RagKnowledgeImprovementPhaseResult {
|
|
1120
|
+
export interface RagKnowledgeImprovementPhaseResult {
|
|
1130
1121
|
phase: RagKnowledgeImprovementPhase;
|
|
1131
1122
|
status: RagKnowledgeImprovementPhaseStatus;
|
|
1132
1123
|
summary: string;
|
|
@@ -1134,40 +1125,40 @@ interface RagKnowledgeImprovementPhaseResult {
|
|
|
1134
1125
|
finishedAt: string;
|
|
1135
1126
|
metadata?: Record<string, AgentCandidateJsonValue>;
|
|
1136
1127
|
}
|
|
1137
|
-
type RagOptimizationSelection = Pick<RunRagOptimizationResult, 'methodName' | 'baseline' | 'winner' | 'baselineConfig' | 'winnerConfig'>;
|
|
1138
|
-
type RetrievalOptimizationSelection = Pick<RunRetrievalImprovementLoopResult, 'methodName' | 'baseline' | 'winner' | 'baselineConfig' | 'winnerConfig'>;
|
|
1139
|
-
interface RagPhaseInputBase {
|
|
1128
|
+
export type RagOptimizationSelection = Pick<RunRagOptimizationResult, 'methodName' | 'baseline' | 'winner' | 'baselineConfig' | 'winnerConfig'>;
|
|
1129
|
+
export type RetrievalOptimizationSelection = Pick<RunRetrievalImprovementLoopResult, 'methodName' | 'baseline' | 'winner' | 'baselineConfig' | 'winnerConfig'>;
|
|
1130
|
+
export interface RagPhaseInputBase {
|
|
1140
1131
|
goal: string;
|
|
1141
1132
|
phases: readonly RagKnowledgeImprovementPhaseResult[];
|
|
1142
1133
|
/** Selected candidate only. Adaptive update callbacks run before final scoring starts. */
|
|
1143
1134
|
optimization?: RagOptimizationSelection;
|
|
1144
1135
|
signal?: AbortSignal;
|
|
1145
1136
|
}
|
|
1146
|
-
interface RagDiagnosisInput extends RagPhaseInputBase {
|
|
1137
|
+
export interface RagDiagnosisInput extends RagPhaseInputBase {
|
|
1147
1138
|
retrieval?: RetrievalOptimizationSelection;
|
|
1148
1139
|
}
|
|
1149
|
-
interface RagKnowledgeAcquisitionInput extends RagPhaseInputBase {
|
|
1140
|
+
export interface RagKnowledgeAcquisitionInput extends RagPhaseInputBase {
|
|
1150
1141
|
retrieval?: RetrievalOptimizationSelection;
|
|
1151
1142
|
findings: readonly RagGapFinding[];
|
|
1152
1143
|
}
|
|
1153
|
-
interface RagKnowledgeUpdateInput extends RagPhaseInputBase {
|
|
1144
|
+
export interface RagKnowledgeUpdateInput extends RagPhaseInputBase {
|
|
1154
1145
|
retrieval?: RetrievalOptimizationSelection;
|
|
1155
1146
|
findings: readonly RagGapFinding[];
|
|
1156
1147
|
acquisition?: KnowledgeResearchLoopDecision;
|
|
1157
1148
|
}
|
|
1158
|
-
interface RagKnowledgeUpdateResult {
|
|
1149
|
+
export interface RagKnowledgeUpdateResult {
|
|
1159
1150
|
applied: boolean;
|
|
1160
1151
|
summary: string;
|
|
1161
1152
|
research?: KnowledgeResearchLoopResult;
|
|
1162
1153
|
metadata?: Record<string, AgentCandidateJsonValue>;
|
|
1163
1154
|
}
|
|
1164
|
-
interface RagAnswerQualityInput extends RagPhaseInputBase {
|
|
1155
|
+
export interface RagAnswerQualityInput extends RagPhaseInputBase {
|
|
1165
1156
|
retrieval?: RetrievalOptimizationSelection;
|
|
1166
1157
|
findings: readonly RagGapFinding[];
|
|
1167
1158
|
acquisition?: KnowledgeResearchLoopDecision;
|
|
1168
1159
|
knowledgeUpdate?: RagKnowledgeUpdateResult;
|
|
1169
1160
|
}
|
|
1170
|
-
interface RagAnswerQualityResult {
|
|
1161
|
+
export interface RagAnswerQualityResult {
|
|
1171
1162
|
passed: boolean;
|
|
1172
1163
|
metrics: Record<string, number>;
|
|
1173
1164
|
finalScenarioIds: readonly string[];
|
|
@@ -1177,7 +1168,7 @@ interface RagAnswerQualityResult {
|
|
|
1177
1168
|
findings?: readonly RagGapFinding[];
|
|
1178
1169
|
metadata?: Record<string, AgentCandidateJsonValue>;
|
|
1179
1170
|
}
|
|
1180
|
-
interface RagPromotionInput extends RagPhaseInputBase {
|
|
1171
|
+
export interface RagPromotionInput extends RagPhaseInputBase {
|
|
1181
1172
|
retrieval?: RetrievalOptimizationSelection;
|
|
1182
1173
|
/** Full final-case result available only to the terminal promotion decision. */
|
|
1183
1174
|
optimizationComparison?: RunRagOptimizationResult['comparison'];
|
|
@@ -1188,16 +1179,16 @@ interface RagPromotionInput extends RagPhaseInputBase {
|
|
|
1188
1179
|
knowledgeUpdate?: RagKnowledgeUpdateResult;
|
|
1189
1180
|
answerQuality?: RagAnswerQualityResult;
|
|
1190
1181
|
}
|
|
1191
|
-
interface RagPromotionResult {
|
|
1182
|
+
export interface RagPromotionResult {
|
|
1192
1183
|
promoted: boolean;
|
|
1193
1184
|
reason: string;
|
|
1194
1185
|
metadata?: Record<string, AgentCandidateJsonValue>;
|
|
1195
1186
|
}
|
|
1196
|
-
interface RagKnowledgeResearchOptions extends Omit<RunKnowledgeResearchLoopOptions, 'goal' | 'signal' | 'step'> {
|
|
1187
|
+
export interface RagKnowledgeResearchOptions extends Omit<RunKnowledgeResearchLoopOptions, 'goal' | 'signal' | 'step'> {
|
|
1197
1188
|
goal?: string;
|
|
1198
1189
|
step?: RunKnowledgeResearchLoopOptions['step'];
|
|
1199
1190
|
}
|
|
1200
|
-
interface RunRagKnowledgeImprovementLoopOptions {
|
|
1191
|
+
export interface RunRagKnowledgeImprovementLoopOptions {
|
|
1201
1192
|
goal: string;
|
|
1202
1193
|
optimization?: RunRagOptimizationOptions;
|
|
1203
1194
|
retrieval?: RunRetrievalImprovementLoopOptions;
|
|
@@ -1218,7 +1209,7 @@ interface RunRagKnowledgeImprovementLoopOptions {
|
|
|
1218
1209
|
signal?: AbortSignal;
|
|
1219
1210
|
now?: () => Date;
|
|
1220
1211
|
}
|
|
1221
|
-
interface RunRagKnowledgeImprovementLoopResult {
|
|
1212
|
+
export interface RunRagKnowledgeImprovementLoopResult {
|
|
1222
1213
|
goal: string;
|
|
1223
1214
|
phases: readonly RagKnowledgeImprovementPhaseResult[];
|
|
1224
1215
|
optimization?: RunRagOptimizationResult;
|
|
@@ -1230,7 +1221,7 @@ interface RunRagKnowledgeImprovementLoopResult {
|
|
|
1230
1221
|
promotion?: RagPromotionResult;
|
|
1231
1222
|
}
|
|
1232
1223
|
type MaybePromise$1<T> = T | Promise<T>;
|
|
1233
|
-
declare function runRagKnowledgeImprovementLoop(options: RunRagKnowledgeImprovementLoopOptions): Promise<RunRagKnowledgeImprovementLoopResult>;
|
|
1224
|
+
export declare function runRagKnowledgeImprovementLoop(options: RunRagKnowledgeImprovementLoopOptions): Promise<RunRagKnowledgeImprovementLoopResult>;
|
|
1234
1225
|
//#endregion
|
|
1235
1226
|
//#region src/rag-eval/contracts.d.ts
|
|
1236
1227
|
type RagEvalProvider = 'agent-knowledge' | 'ragas' | 'deepeval' | 'trulens' | 'ragchecker' | 'custom';
|
|
@@ -1382,34 +1373,34 @@ interface KnowledgeBaseQualityReport {
|
|
|
1382
1373
|
type MaybePromise<T> = T | Promise<T>;
|
|
1383
1374
|
//#endregion
|
|
1384
1375
|
//#region src/rag-eval/calibration.d.ts
|
|
1385
|
-
declare function createRagAnswerQualityHook(options: RagAnswerQualityHookOptions): () => Promise<RagAnswerQualityResult>;
|
|
1386
|
-
declare function calibrateRagAnswerJudge(options: RagCalibrationOptions): Promise<RagCalibrationResult>;
|
|
1376
|
+
export declare function createRagAnswerQualityHook(options: RagAnswerQualityHookOptions): () => Promise<RagAnswerQualityResult>;
|
|
1377
|
+
export declare function calibrateRagAnswerJudge(options: RagCalibrationOptions): Promise<RagCalibrationResult>;
|
|
1387
1378
|
//#endregion
|
|
1388
1379
|
//#region src/rag-eval/knowledge-base.d.ts
|
|
1389
|
-
declare function scoreKnowledgeBaseIndex(index: KnowledgeIndex, options?: KnowledgeBaseQualityOptions): KnowledgeBaseQualityReport;
|
|
1380
|
+
export declare function scoreKnowledgeBaseIndex(index: KnowledgeIndex, options?: KnowledgeBaseQualityOptions): KnowledgeBaseQualityReport;
|
|
1390
1381
|
//#endregion
|
|
1391
1382
|
//#region src/rag-eval/providers.d.ts
|
|
1392
|
-
declare function normalizeExternalRagScores(scores: readonly ExternalRagEvalScore[]): Record<string, Record<RagEvalMetricKey, number>>;
|
|
1393
|
-
declare function toRagasEvaluationRows(cases: readonly RagAnswerEvalCase[]): {
|
|
1383
|
+
export declare function normalizeExternalRagScores(scores: readonly ExternalRagEvalScore[]): Record<string, Record<RagEvalMetricKey, number>>;
|
|
1384
|
+
export declare function toRagasEvaluationRows(cases: readonly RagAnswerEvalCase[]): {
|
|
1394
1385
|
user_input: string;
|
|
1395
1386
|
response: string;
|
|
1396
1387
|
retrieved_contexts: string[];
|
|
1397
1388
|
reference: string | undefined;
|
|
1398
1389
|
reference_contexts: string[];
|
|
1399
1390
|
}[];
|
|
1400
|
-
declare function toDeepEvalTestCases(cases: readonly RagAnswerEvalCase[]): {
|
|
1391
|
+
export declare function toDeepEvalTestCases(cases: readonly RagAnswerEvalCase[]): {
|
|
1401
1392
|
input: string;
|
|
1402
1393
|
actual_output: string;
|
|
1403
1394
|
expected_output: string | undefined;
|
|
1404
1395
|
retrieval_context: string[];
|
|
1405
1396
|
context: string[];
|
|
1406
1397
|
}[];
|
|
1407
|
-
declare function toTruLensRecords(cases: readonly RagAnswerEvalCase[]): {
|
|
1398
|
+
export declare function toTruLensRecords(cases: readonly RagAnswerEvalCase[]): {
|
|
1408
1399
|
input: string;
|
|
1409
1400
|
output: string;
|
|
1410
1401
|
context: string;
|
|
1411
1402
|
}[];
|
|
1412
|
-
declare function toRagCheckerRecords(cases: readonly RagAnswerEvalCase[]): {
|
|
1403
|
+
export declare function toRagCheckerRecords(cases: readonly RagAnswerEvalCase[]): {
|
|
1413
1404
|
query_id: string;
|
|
1414
1405
|
query: string;
|
|
1415
1406
|
gt_answer: string | undefined;
|
|
@@ -1422,9 +1413,9 @@ declare function toRagCheckerRecords(cases: readonly RagAnswerEvalCase[]): {
|
|
|
1422
1413
|
}[];
|
|
1423
1414
|
//#endregion
|
|
1424
1415
|
//#region src/rag-eval/scoring.d.ts
|
|
1425
|
-
declare function ragAnswerQualityJudge(options?: RagAnswerQualityJudgeOptions): JudgeConfig<RagAnswerEvalArtifact, RagAnswerEvalScenario>;
|
|
1426
|
-
declare function scoreRagAnswerArtifact(artifact: RagAnswerEvalArtifact, scenario: RagAnswerEvalScenario, options?: RagAnswerQualityJudgeOptions): RagAnswerMetricSummary;
|
|
1427
|
-
declare function diagnoseRagAnswerFailure(metrics: Record<RagEvalMetricKey, number>, scenario: RagAnswerEvalScenario, thresholds?: Partial<Record<RagEvalMetricKey, number>>): RagGapFinding[];
|
|
1416
|
+
export declare function ragAnswerQualityJudge(options?: RagAnswerQualityJudgeOptions): JudgeConfig<RagAnswerEvalArtifact, RagAnswerEvalScenario>;
|
|
1417
|
+
export declare function scoreRagAnswerArtifact(artifact: RagAnswerEvalArtifact, scenario: RagAnswerEvalScenario, options?: RagAnswerQualityJudgeOptions): RagAnswerMetricSummary;
|
|
1418
|
+
export declare function diagnoseRagAnswerFailure(metrics: Record<RagEvalMetricKey, number>, scenario: RagAnswerEvalScenario, thresholds?: Partial<Record<RagEvalMetricKey, number>>): RagGapFinding[];
|
|
1428
1419
|
//#endregion
|
|
1429
1420
|
//#region src/kb-improvement/contracts.d.ts
|
|
1430
1421
|
type KnowledgeImprovementStatus = 'running' | 'candidate-ready' | 'promoted' | 'rejected' | 'blocked';
|
|
@@ -1526,7 +1517,7 @@ interface KnowledgeImprovementActivationPersistence {
|
|
|
1526
1517
|
/** May run again after interruption; keep this deterministic and free of external side effects. */
|
|
1527
1518
|
createResult(mutation: KnowledgeImprovementMutationReceipt): Promise<AgentImprovementActivationResult> | AgentImprovementActivationResult;
|
|
1528
1519
|
}
|
|
1529
|
-
declare const KnowledgeImprovementRunStateSchema: z.ZodObject<{
|
|
1520
|
+
export declare const KnowledgeImprovementRunStateSchema: z.ZodObject<{
|
|
1530
1521
|
stateScope: z.ZodOptional<z.ZodObject<{
|
|
1531
1522
|
pagesDirectory: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
1532
1523
|
researchState: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1567,7 +1558,7 @@ declare const KnowledgeImprovementRunStateSchema: z.ZodObject<{
|
|
|
1567
1558
|
promotedCandidateId: z.ZodOptional<z.ZodString>;
|
|
1568
1559
|
blockedReason: z.ZodOptional<z.ZodString>;
|
|
1569
1560
|
}, z.core.$strict>;
|
|
1570
|
-
declare const KnowledgeImprovementEvidenceSchema: z.ZodObject<{
|
|
1561
|
+
export declare const KnowledgeImprovementEvidenceSchema: z.ZodObject<{
|
|
1571
1562
|
kind: z.ZodLiteral<"knowledge-improvement-evidence">;
|
|
1572
1563
|
runId: z.ZodString;
|
|
1573
1564
|
candidateId: z.ZodString;
|
|
@@ -1611,7 +1602,7 @@ declare const KnowledgeImprovementEvidenceSchema: z.ZodObject<{
|
|
|
1611
1602
|
}, z.core.$strict>;
|
|
1612
1603
|
type KnowledgeImprovementEvidence = z.infer<typeof KnowledgeImprovementEvidenceSchema>;
|
|
1613
1604
|
/** Portable identity of one measured candidate. Paths and mutable run state are deliberately excluded. */
|
|
1614
|
-
declare const KnowledgeImprovementCandidateRefSchema: z.ZodObject<{
|
|
1605
|
+
export declare const KnowledgeImprovementCandidateRefSchema: z.ZodObject<{
|
|
1615
1606
|
kind: z.ZodLiteral<"knowledge-improvement-candidate">;
|
|
1616
1607
|
runId: z.ZodString;
|
|
1617
1608
|
candidateId: z.ZodString;
|
|
@@ -1730,7 +1721,7 @@ interface KnowledgeImprovementOptions {
|
|
|
1730
1721
|
//#endregion
|
|
1731
1722
|
//#region src/kb-improvement/activation.d.ts
|
|
1732
1723
|
/** Load the durable result for one exact activation without changing knowledge or run state. */
|
|
1733
|
-
declare function loadKnowledgeImprovementActivationResult(options: LoadKnowledgeImprovementActivationResultOptions): Promise<AgentImprovementActivationResult | null>;
|
|
1724
|
+
export declare function loadKnowledgeImprovementActivationResult(options: LoadKnowledgeImprovementActivationResultOptions): Promise<AgentImprovementActivationResult | null>;
|
|
1734
1725
|
//#endregion
|
|
1735
1726
|
//#region src/kb-improvement/optimization.d.ts
|
|
1736
1727
|
type PolicyCandidateOptions = Omit<KnowledgeImprovementOptions, 'root' | 'goal' | 'implementationRef' | 'runId' | 'maxCandidates' | 'step' | 'knowledgeResearch' | 'updateKnowledge'>;
|
|
@@ -1767,7 +1758,7 @@ interface OptimizeKnowledgeBasePolicyResult<TPolicy extends AgentCandidateJsonVa
|
|
|
1767
1758
|
* Optimizes a serialized KB-maintenance policy, then materializes the selected
|
|
1768
1759
|
* policy in one isolated knowledge candidate. Activation remains explicit.
|
|
1769
1760
|
*/
|
|
1770
|
-
declare function optimizeKnowledgeBasePolicy<TPolicy extends AgentCandidateJsonValue, TScenario extends Scenario, TArtifact>(options: OptimizeKnowledgeBasePolicyOptions<TPolicy, TScenario, TArtifact>): Promise<OptimizeKnowledgeBasePolicyResult<TPolicy>>;
|
|
1761
|
+
export declare function optimizeKnowledgeBasePolicy<TPolicy extends AgentCandidateJsonValue, TScenario extends Scenario, TArtifact>(options: OptimizeKnowledgeBasePolicyOptions<TPolicy, TScenario, TArtifact>): Promise<OptimizeKnowledgeBasePolicyResult<TPolicy>>;
|
|
1771
1762
|
type KnowledgePolicyDispatch<TPolicy extends AgentCandidateJsonValue, TScenario extends Scenario, TArtifact> = (input: {
|
|
1772
1763
|
candidate: TPolicy;
|
|
1773
1764
|
candidateSurface: string;
|
|
@@ -1777,7 +1768,7 @@ type KnowledgePolicyDispatch<TPolicy extends AgentCandidateJsonValue, TScenario
|
|
|
1777
1768
|
}) => Promise<TArtifact>;
|
|
1778
1769
|
//#endregion
|
|
1779
1770
|
//#region src/kb-improvement/run.d.ts
|
|
1780
|
-
declare function improveKnowledgeBase(options: KnowledgeImprovementOptions): Promise<KnowledgeImprovementResult>;
|
|
1771
|
+
export declare function improveKnowledgeBase(options: KnowledgeImprovementOptions): Promise<KnowledgeImprovementResult>;
|
|
1781
1772
|
//#endregion
|
|
1782
1773
|
//#region src/kb-improvement/selected-candidate.d.ts
|
|
1783
1774
|
declare const measuredSelectionReceiptSchema: z.ZodObject<{
|
|
@@ -1843,17 +1834,17 @@ interface ImproveSelectedKnowledgeCandidateResult extends KnowledgeImprovementRe
|
|
|
1843
1834
|
* evaluator, and returns the ordinary candidate reference. Promotion therefore
|
|
1844
1835
|
* remains one path and can never admit an unmeasured hybrid.
|
|
1845
1836
|
*/
|
|
1846
|
-
declare function improveSelectedKnowledgeCandidate(options: ImproveSelectedKnowledgeCandidateOptions): Promise<ImproveSelectedKnowledgeCandidateResult>;
|
|
1837
|
+
export declare function improveSelectedKnowledgeCandidate(options: ImproveSelectedKnowledgeCandidateOptions): Promise<ImproveSelectedKnowledgeCandidateResult>;
|
|
1847
1838
|
//#endregion
|
|
1848
1839
|
//#region src/kb-improvement/state.d.ts
|
|
1849
|
-
declare function knowledgeImprovementRunId(root: string, goal: string): string;
|
|
1850
|
-
declare function knowledgeImprovementRunDir(root: string, runId: string): string;
|
|
1851
|
-
declare function loadKnowledgeImprovementState(root: string, runId: string): Promise<KnowledgeImprovementRunState | null>;
|
|
1840
|
+
export declare function knowledgeImprovementRunId(root: string, goal: string): string;
|
|
1841
|
+
export declare function knowledgeImprovementRunDir(root: string, runId: string): string;
|
|
1842
|
+
export declare function loadKnowledgeImprovementState(root: string, runId: string): Promise<KnowledgeImprovementRunState | null>;
|
|
1852
1843
|
interface KnowledgeImprovementEvent extends Record<string, unknown> {
|
|
1853
1844
|
at: string;
|
|
1854
1845
|
type: string;
|
|
1855
1846
|
}
|
|
1856
|
-
declare function loadKnowledgeImprovementEvents(root: string, runId: string): Promise<KnowledgeImprovementEvent[]>;
|
|
1847
|
+
export declare function loadKnowledgeImprovementEvents(root: string, runId: string): Promise<KnowledgeImprovementEvent[]>;
|
|
1857
1848
|
//#endregion
|
|
1858
1849
|
//#region src/file-transaction.d.ts
|
|
1859
1850
|
declare const transactionSchema: z.ZodObject<{
|
|
@@ -1878,24 +1869,24 @@ type KnowledgeFileTransaction = z.infer<typeof transactionSchema>;
|
|
|
1878
1869
|
//#endregion
|
|
1879
1870
|
//#region src/kb-improvement/transition.d.ts
|
|
1880
1871
|
/** Promote one previously measured candidate without rerunning research or evaluation. */
|
|
1881
|
-
declare function promoteKnowledgeCandidate(options: PromoteKnowledgeCandidateOptions): Promise<KnowledgeImprovementMutationResult>;
|
|
1872
|
+
export declare function promoteKnowledgeCandidate(options: PromoteKnowledgeCandidateOptions): Promise<KnowledgeImprovementMutationResult>;
|
|
1882
1873
|
/** Restore the frozen baseline paired with one previously measured candidate. */
|
|
1883
|
-
declare function restoreKnowledgeCandidateBaseline(options: RestoreKnowledgeCandidateBaselineOptions): Promise<KnowledgeImprovementMutationResult>;
|
|
1874
|
+
export declare function restoreKnowledgeCandidateBaseline(options: RestoreKnowledgeCandidateBaselineOptions): Promise<KnowledgeImprovementMutationResult>;
|
|
1884
1875
|
//#endregion
|
|
1885
1876
|
//#region src/kb-improvement/workspace.d.ts
|
|
1886
1877
|
/** Freeze the exact knowledge bytes and measured evidence a later approval may promote. */
|
|
1887
|
-
declare function knowledgeImprovementCandidateRef(result: Pick<KnowledgeImprovementResult, 'runId' | 'state' | 'candidate'>): KnowledgeImprovementCandidateRef;
|
|
1878
|
+
export declare function knowledgeImprovementCandidateRef(result: Pick<KnowledgeImprovementResult, 'runId' | 'state' | 'candidate'>): KnowledgeImprovementCandidateRef;
|
|
1888
1879
|
/** Use both frozen sides of one measured comparison in isolated, integrity-checked copies. */
|
|
1889
|
-
declare function withKnowledgeImprovementComparison<T>(options: UseKnowledgeImprovementCandidateOptions, use: (comparison: ResolvedKnowledgeImprovementComparison) => Promise<T> | T): Promise<T>;
|
|
1880
|
+
export declare function withKnowledgeImprovementComparison<T>(options: UseKnowledgeImprovementCandidateOptions, use: (comparison: ResolvedKnowledgeImprovementComparison) => Promise<T> | T): Promise<T>;
|
|
1890
1881
|
/** Use the frozen candidate side of one measured comparison. */
|
|
1891
|
-
declare function withKnowledgeImprovementCandidate<T>(options: UseKnowledgeImprovementCandidateOptions, use: (candidate: ResolvedKnowledgeImprovementCandidate) => Promise<T> | T): Promise<T>;
|
|
1892
|
-
declare function hashKnowledgeBase(root: string, scope?: KnowledgeStateScope): Promise<string>;
|
|
1882
|
+
export declare function withKnowledgeImprovementCandidate<T>(options: UseKnowledgeImprovementCandidateOptions, use: (candidate: ResolvedKnowledgeImprovementCandidate) => Promise<T> | T): Promise<T>;
|
|
1883
|
+
export declare function hashKnowledgeBase(root: string, scope?: KnowledgeStateScope): Promise<string>;
|
|
1893
1884
|
//#endregion
|
|
1894
1885
|
//#region src/agent-candidate.d.ts
|
|
1895
1886
|
/** Convert a measured knowledge candidate into the shared review and execution identity. */
|
|
1896
|
-
declare function toAgentCandidateKnowledgeRef(candidate: KnowledgeImprovementCandidateRef): AgentCandidateKnowledgeRef;
|
|
1887
|
+
export declare function toAgentCandidateKnowledgeRef(candidate: KnowledgeImprovementCandidateRef): AgentCandidateKnowledgeRef;
|
|
1897
1888
|
/** Recover agent-knowledge's candidate identity from the shared contract. */
|
|
1898
|
-
declare function fromAgentCandidateKnowledgeRef(candidate: AgentCandidateKnowledgeRef): KnowledgeImprovementCandidateRef;
|
|
1889
|
+
export declare function fromAgentCandidateKnowledgeRef(candidate: AgentCandidateKnowledgeRef): KnowledgeImprovementCandidateRef;
|
|
1899
1890
|
//#endregion
|
|
1900
1891
|
//#region src/changes.d.ts
|
|
1901
1892
|
/**
|
|
@@ -1925,8 +1916,8 @@ declare function fromAgentCandidateKnowledgeRef(candidate: AgentCandidateKnowled
|
|
|
1925
1916
|
*
|
|
1926
1917
|
* @stable
|
|
1927
1918
|
*/
|
|
1928
|
-
type KnowledgeChangeKind = 'added' | 'removed' | 'modified';
|
|
1929
|
-
interface KnowledgeChange {
|
|
1919
|
+
export type KnowledgeChangeKind = 'added' | 'removed' | 'modified';
|
|
1920
|
+
export interface KnowledgeChange {
|
|
1930
1921
|
/** Source-scoped id (matches `KnowledgeFragment.id`). */
|
|
1931
1922
|
fragmentId: string;
|
|
1932
1923
|
kind: KnowledgeChangeKind;
|
|
@@ -1954,7 +1945,7 @@ interface KnowledgeChange {
|
|
|
1954
1945
|
*/
|
|
1955
1946
|
detectedAt: string;
|
|
1956
1947
|
}
|
|
1957
|
-
interface DetectChangesResult {
|
|
1948
|
+
export interface DetectChangesResult {
|
|
1958
1949
|
changes: KnowledgeChange[];
|
|
1959
1950
|
/** Counts by kind — handy for dashboards. */
|
|
1960
1951
|
summary: {
|
|
@@ -1965,7 +1956,7 @@ interface DetectChangesResult {
|
|
|
1965
1956
|
/** Non-fatal diagnostics (duplicate ids, dropped unverifiable fragments). */
|
|
1966
1957
|
warnings: string[];
|
|
1967
1958
|
}
|
|
1968
|
-
interface DetectChangesOptions {
|
|
1959
|
+
export interface DetectChangesOptions {
|
|
1969
1960
|
/**
|
|
1970
1961
|
* When true (default), unverifiable fragments are dropped from both
|
|
1971
1962
|
* sides before comparison. Set false ONLY when debugging block-page
|
|
@@ -1980,16 +1971,16 @@ interface DetectChangesOptions {
|
|
|
1980
1971
|
*/
|
|
1981
1972
|
filterDimensions?: string[];
|
|
1982
1973
|
}
|
|
1983
|
-
declare function detectChanges(prev: KnowledgeFragment[], next: KnowledgeFragment[], options?: DetectChangesOptions): DetectChangesResult;
|
|
1974
|
+
export declare function detectChanges(prev: KnowledgeFragment[], next: KnowledgeFragment[], options?: DetectChangesOptions): DetectChangesResult;
|
|
1984
1975
|
//#endregion
|
|
1985
1976
|
//#region src/chunking.d.ts
|
|
1986
|
-
interface ChunkingOptions {
|
|
1977
|
+
export interface ChunkingOptions {
|
|
1987
1978
|
targetChars: number;
|
|
1988
1979
|
maxChars: number;
|
|
1989
1980
|
minChars: number;
|
|
1990
1981
|
overlapChars: number;
|
|
1991
1982
|
}
|
|
1992
|
-
interface KnowledgeChunk {
|
|
1983
|
+
export interface KnowledgeChunk {
|
|
1993
1984
|
index: number;
|
|
1994
1985
|
text: string;
|
|
1995
1986
|
headingPath: string;
|
|
@@ -1997,17 +1988,17 @@ interface KnowledgeChunk {
|
|
|
1997
1988
|
charEnd: number;
|
|
1998
1989
|
oversized: boolean;
|
|
1999
1990
|
}
|
|
2000
|
-
declare function chunkMarkdown(content: string, options?: Partial<ChunkingOptions>): KnowledgeChunk[];
|
|
2001
|
-
declare function stripFrontmatter(content: string): {
|
|
1991
|
+
export declare function chunkMarkdown(content: string, options?: Partial<ChunkingOptions>): KnowledgeChunk[];
|
|
1992
|
+
export declare function stripFrontmatter(content: string): {
|
|
2002
1993
|
body: string;
|
|
2003
1994
|
bodyOffset: number;
|
|
2004
1995
|
};
|
|
2005
1996
|
//#endregion
|
|
2006
1997
|
//#region src/citation-lint.d.ts
|
|
2007
1998
|
/** Convert a chain-aware citation audit into the package lint vocabulary. */
|
|
2008
|
-
declare function knowledgeCitationAuditFindings(report: KnowledgeCitationAuditReport): KnowledgeLintFinding[];
|
|
1999
|
+
export declare function knowledgeCitationAuditFindings(report: KnowledgeCitationAuditReport): KnowledgeLintFinding[];
|
|
2009
2000
|
/** Lint only current-run pages against their complete declared visibility chain. */
|
|
2010
|
-
declare function lintCurrentRunCitations(stores: RunScopedStores, runId: string): Promise<KnowledgeLintFinding[]>;
|
|
2001
|
+
export declare function lintCurrentRunCitations(stores: RunScopedStores, runId: string): Promise<KnowledgeLintFinding[]>;
|
|
2011
2002
|
//#endregion
|
|
2012
2003
|
//#region src/claim-evidence.d.ts
|
|
2013
2004
|
/**
|
|
@@ -2035,10 +2026,10 @@ declare function lintCurrentRunCitations(stores: RunScopedStores, runId: string)
|
|
|
2035
2026
|
* Reporting a low rung in the vocabulary of a high one is the most expensive error available to a
|
|
2036
2027
|
* knowledge system: it is indistinguishable from success and propagates as settled provenance.
|
|
2037
2028
|
*/
|
|
2038
|
-
type EvidenceRung = 1 | 2 | 3 | 4 | 5;
|
|
2029
|
+
export type EvidenceRung = 1 | 2 | 3 | 4 | 5;
|
|
2039
2030
|
/** The rung at and above which a claim must be machine-checkable to be recorded at that rung. */
|
|
2040
|
-
declare const CHECKABLE_RUNG_THRESHOLD = 4;
|
|
2041
|
-
interface ClaimEvidence {
|
|
2031
|
+
export declare const CHECKABLE_RUNG_THRESHOLD = 4;
|
|
2032
|
+
export interface ClaimEvidence {
|
|
2042
2033
|
rung: EvidenceRung;
|
|
2043
2034
|
/**
|
|
2044
2035
|
* A shell command that re-establishes the claim when run by a grader the author cannot edit,
|
|
@@ -2065,7 +2056,7 @@ interface ClaimEvidence {
|
|
|
2065
2056
|
* all of them: `uncheckable`. `note` names which shape was refused and what to record instead, in
|
|
2066
2057
|
* the same words the grader reports, so an author reads one message wherever the claim is stopped.
|
|
2067
2058
|
*/
|
|
2068
|
-
declare class UncheckableClaimError extends Error {
|
|
2059
|
+
export declare class UncheckableClaimError extends Error {
|
|
2069
2060
|
/** The rung whose evidence rule the recorded claim failed. */
|
|
2070
2061
|
readonly rung: EvidenceRung;
|
|
2071
2062
|
/** The refused shape and the fix for it, in the grader's vocabulary. */
|
|
@@ -2086,7 +2077,7 @@ declare class UncheckableClaimError extends Error {
|
|
|
2086
2077
|
* were never executed before their authors disappeared. The dynamic half of that last rule is
|
|
2087
2078
|
* `verifyGradeableEvidence` below.
|
|
2088
2079
|
*/
|
|
2089
|
-
declare function assertGradeableEvidence(evidence: ClaimEvidence): ClaimEvidence;
|
|
2080
|
+
export declare function assertGradeableEvidence(evidence: ClaimEvidence): ClaimEvidence;
|
|
2090
2081
|
/**
|
|
2091
2082
|
* What a grader may conclude from re-executing a claim's check.
|
|
2092
2083
|
*
|
|
@@ -2099,15 +2090,15 @@ declare function assertGradeableEvidence(evidence: ClaimEvidence): ClaimEvidence
|
|
|
2099
2090
|
* deadline killed it — an environment verdict, never a claim verdict
|
|
2100
2091
|
* uncheckable the recorded evidence cannot decide the claim at this rung
|
|
2101
2092
|
*/
|
|
2102
|
-
type ClaimVerdict = 'verified' | 'silent-check' | 'contradicted' | 'unrunnable' | 'uncheckable';
|
|
2093
|
+
export type ClaimVerdict = 'verified' | 'silent-check' | 'contradicted' | 'unrunnable' | 'uncheckable';
|
|
2103
2094
|
/**
|
|
2104
2095
|
* The exit status a deadline kill reports: `timeout(1)`'s status, and the one a bounded process
|
|
2105
2096
|
* runner forces so a killed child that closes with 0 cannot read as a pass. A grader that has
|
|
2106
2097
|
* only an exit status reports this one; a grader that knows it killed the process sets
|
|
2107
2098
|
* `CheckExecution.timedOut` instead, which is unambiguous.
|
|
2108
2099
|
*/
|
|
2109
|
-
declare const DEADLINE_EXIT_CODE = 124;
|
|
2110
|
-
interface CheckExecution {
|
|
2100
|
+
export declare const DEADLINE_EXIT_CODE = 124;
|
|
2101
|
+
export interface CheckExecution {
|
|
2111
2102
|
exitCode: number;
|
|
2112
2103
|
stdout: string;
|
|
2113
2104
|
stderr: string;
|
|
@@ -2130,7 +2121,7 @@ interface CheckExecution {
|
|
|
2130
2121
|
outputTruncated?: boolean;
|
|
2131
2122
|
}
|
|
2132
2123
|
/** A verdict with the reason a grader may report to the claim's author. */
|
|
2133
|
-
interface ClaimGrade {
|
|
2124
|
+
export interface ClaimGrade {
|
|
2134
2125
|
verdict: ClaimVerdict;
|
|
2135
2126
|
/** Present when the verdict is a refusal the author can fix, absent otherwise. */
|
|
2136
2127
|
note?: string;
|
|
@@ -2155,9 +2146,9 @@ interface ClaimGrade {
|
|
|
2155
2146
|
* - a check whose output says it never reached its input is `unrunnable` whatever its exit
|
|
2156
2147
|
* status, because a pipeline hides the failing stage's status behind its last stage.
|
|
2157
2148
|
*/
|
|
2158
|
-
declare function gradeFor(evidence: Pick<ClaimEvidence, 'rung' | 'check' | 'expect'>, execution: CheckExecution | null): ClaimGrade;
|
|
2149
|
+
export declare function gradeFor(evidence: Pick<ClaimEvidence, 'rung' | 'check' | 'expect'>, execution: CheckExecution | null): ClaimGrade;
|
|
2159
2150
|
/** A claim and the observation a grader made of it, as one grading pass sees them. */
|
|
2160
|
-
interface GradeableClaim {
|
|
2151
|
+
export interface GradeableClaim {
|
|
2161
2152
|
/** Stable identity a duplicate flag can point back to, such as the page or claim id. */
|
|
2162
2153
|
id: string;
|
|
2163
2154
|
/** The claim's own sentence. Two claims that share a check but say different things differ. */
|
|
@@ -2166,7 +2157,7 @@ interface GradeableClaim {
|
|
|
2166
2157
|
execution: CheckExecution | null;
|
|
2167
2158
|
}
|
|
2168
2159
|
/** A grade with the claim it belongs to, in the order the claims were supplied. */
|
|
2169
|
-
interface GradedClaim extends ClaimGrade {
|
|
2160
|
+
export interface GradedClaim extends ClaimGrade {
|
|
2170
2161
|
id: string;
|
|
2171
2162
|
}
|
|
2172
2163
|
/**
|
|
@@ -2178,7 +2169,7 @@ interface GradedClaim extends ClaimGrade {
|
|
|
2178
2169
|
* claim with `duplicateOf`, leaving the verdict and the count untouched: the flag is for a reader
|
|
2179
2170
|
* deciding how much evidence a run really produced.
|
|
2180
2171
|
*/
|
|
2181
|
-
declare function gradeClaims(claims: readonly GradeableClaim[]): GradedClaim[];
|
|
2172
|
+
export declare function gradeClaims(claims: readonly GradeableClaim[]): GradedClaim[];
|
|
2182
2173
|
/**
|
|
2183
2174
|
* The identity two claims must share to be one verification counted twice: the same command, the
|
|
2184
2175
|
* same expectation, and the same sentence. A check shared across claims that say different things
|
|
@@ -2188,14 +2179,14 @@ declare function gradeClaims(claims: readonly GradeableClaim[]): GradedClaim[];
|
|
|
2188
2179
|
* so an unkeyable claim is never flagged as a repeat of another unkeyable one. The key is JSON
|
|
2189
2180
|
* rather than a joined string, so no separator can collide with text inside a check.
|
|
2190
2181
|
*/
|
|
2191
|
-
declare function claimCheckKey(claim: {
|
|
2182
|
+
export declare function claimCheckKey(claim: {
|
|
2192
2183
|
check?: string;
|
|
2193
2184
|
expect?: string;
|
|
2194
2185
|
title?: string;
|
|
2195
2186
|
}): string | undefined;
|
|
2196
2187
|
/** The verdict alone, for graders that report a lattice member and not a reason. */
|
|
2197
|
-
declare function verdictFor(evidence: Pick<ClaimEvidence, 'rung' | 'check' | 'expect'>, execution: CheckExecution | null): ClaimVerdict;
|
|
2198
|
-
interface VerifyGradeableEvidenceOptions {
|
|
2188
|
+
export declare function verdictFor(evidence: Pick<ClaimEvidence, 'rung' | 'check' | 'expect'>, execution: CheckExecution | null): ClaimVerdict;
|
|
2189
|
+
export interface VerifyGradeableEvidenceOptions {
|
|
2199
2190
|
/** Directory in which the later grader will execute the command. Required to avoid ambient cwd. */
|
|
2200
2191
|
cwd: string;
|
|
2201
2192
|
/** Exact environment visible to the command. Omitted variables are genuinely absent. */
|
|
@@ -2208,7 +2199,7 @@ interface VerifyGradeableEvidenceOptions {
|
|
|
2208
2199
|
maxBufferBytes?: number;
|
|
2209
2200
|
signal?: AbortSignal;
|
|
2210
2201
|
}
|
|
2211
|
-
interface VerifiedGradeableEvidence {
|
|
2202
|
+
export interface VerifiedGradeableEvidence {
|
|
2212
2203
|
evidence: ClaimEvidence;
|
|
2213
2204
|
execution: CheckExecution;
|
|
2214
2205
|
grade: ClaimGrade;
|
|
@@ -2227,7 +2218,7 @@ interface VerifiedGradeableEvidence {
|
|
|
2227
2218
|
* it remain importable. Callers must apply their own sandbox and capability policy before passing
|
|
2228
2219
|
* untrusted commands here.
|
|
2229
2220
|
*/
|
|
2230
|
-
declare function verifyGradeableEvidence(evidence: ClaimEvidence, options: VerifyGradeableEvidenceOptions): Promise<VerifiedGradeableEvidence>;
|
|
2221
|
+
export declare function verifyGradeableEvidence(evidence: ClaimEvidence, options: VerifyGradeableEvidenceOptions): Promise<VerifiedGradeableEvidence>;
|
|
2231
2222
|
//#endregion
|
|
2232
2223
|
//#region src/claim-grounding.d.ts
|
|
2233
2224
|
/**
|
|
@@ -2235,12 +2226,12 @@ declare function verifyGradeableEvidence(evidence: ClaimEvidence, options: Verif
|
|
|
2235
2226
|
* for. The worker sets `metadata[citedClaimKey] = '<the claim>'`; the
|
|
2236
2227
|
* claim-grounding driver reads it and checks it against the fetched page text.
|
|
2237
2228
|
*/
|
|
2238
|
-
declare const citedClaimKey = "citedClaim";
|
|
2229
|
+
export declare const citedClaimKey = "citedClaim";
|
|
2239
2230
|
/** Read the cited claim a proposal carries, if any. */
|
|
2240
|
-
declare function citedClaimOf(source: ResearchSourceProposal): string | undefined;
|
|
2231
|
+
export declare function citedClaimOf(source: ResearchSourceProposal): string | undefined;
|
|
2241
2232
|
/** Attach a cited claim to a proposal (immutably returns a new proposal). */
|
|
2242
|
-
declare function withCitedClaim(source: ResearchSourceProposal, claim: string): ResearchSourceProposal;
|
|
2243
|
-
interface GroundingResult {
|
|
2233
|
+
export declare function withCitedClaim(source: ResearchSourceProposal, claim: string): ResearchSourceProposal;
|
|
2234
|
+
export interface GroundingResult {
|
|
2244
2235
|
/** True when the claim is sufficiently present in the page text. */
|
|
2245
2236
|
grounded: boolean;
|
|
2246
2237
|
/** How the claim matched (or why it didn't). For audit/notes. */
|
|
@@ -2253,7 +2244,7 @@ interface GroundingResult {
|
|
|
2253
2244
|
/** Content words present in the claim but NOT in the page text. */
|
|
2254
2245
|
missingWords: string[];
|
|
2255
2246
|
}
|
|
2256
|
-
interface GroundClaimOptions {
|
|
2247
|
+
export interface GroundClaimOptions {
|
|
2257
2248
|
/**
|
|
2258
2249
|
* Minimum fraction of the claim's content words that must appear in the page
|
|
2259
2250
|
* text to count as a close paraphrase when there is no verbatim/normalized
|
|
@@ -2282,8 +2273,8 @@ interface GroundClaimOptions {
|
|
|
2282
2273
|
* enough for the driver to give a precise rejection reason and for a test/doc to
|
|
2283
2274
|
* audit WHY a claim grounded or didn't.
|
|
2284
2275
|
*/
|
|
2285
|
-
declare function groundClaimInText(claim: string, pageText: string, options?: GroundClaimOptions): GroundingResult;
|
|
2286
|
-
interface ClaimGroundingDriverOptions extends GroundClaimOptions {
|
|
2276
|
+
export declare function groundClaimInText(claim: string, pageText: string, options?: GroundClaimOptions): GroundingResult;
|
|
2277
|
+
export interface ClaimGroundingDriverOptions extends GroundClaimOptions {
|
|
2287
2278
|
/**
|
|
2288
2279
|
* Optional second verifier to compose AFTER grounding passes. When set, a
|
|
2289
2280
|
* source must BOTH ground its claim AND pass this verifier (e.g. the LLM
|
|
@@ -2309,8 +2300,8 @@ interface ClaimGroundingDriverOptions extends GroundClaimOptions {
|
|
|
2309
2300
|
* The returned function matches `ResearchDriver['verifySource']`, so it drops
|
|
2310
2301
|
* straight into `runVerifiedResearchLoop` as `{ verifySource: createClaimGroundingVerifier(...) }`.
|
|
2311
2302
|
*/
|
|
2312
|
-
declare function createClaimGroundingVerifier(options?: ClaimGroundingDriverOptions): (source: ResearchSourceProposal, ctx: SourceVerificationContext) => Promise<SourceVerdict>;
|
|
2313
|
-
interface WorkerClaimDecorationOptions {
|
|
2303
|
+
export declare function createClaimGroundingVerifier(options?: ClaimGroundingDriverOptions): (source: ResearchSourceProposal, ctx: SourceVerificationContext) => Promise<SourceVerdict>;
|
|
2304
|
+
export interface WorkerClaimDecorationOptions {
|
|
2314
2305
|
router?: RouterClient;
|
|
2315
2306
|
router_options?: TangleRouterOptions;
|
|
2316
2307
|
/** Max output tokens for the claim-extraction call. Default 1200 (glm floor). */
|
|
@@ -2329,7 +2320,7 @@ interface WorkerClaimDecorationOptions {
|
|
|
2329
2320
|
* unchanged if the model returns nothing parseable (the verifier's
|
|
2330
2321
|
* `onMissingClaim` policy then decides).
|
|
2331
2322
|
*/
|
|
2332
|
-
declare function createClaimDecorator(options?: WorkerClaimDecorationOptions): (source: ResearchSourceProposal, goal: string) => Promise<ResearchSourceProposal>;
|
|
2323
|
+
export declare function createClaimDecorator(options?: WorkerClaimDecorationOptions): (source: ResearchSourceProposal, goal: string) => Promise<ResearchSourceProposal>;
|
|
2333
2324
|
//#endregion
|
|
2334
2325
|
//#region src/claim-ledger.d.ts
|
|
2335
2326
|
/**
|
|
@@ -2338,13 +2329,13 @@ declare function createClaimDecorator(options?: WorkerClaimDecorationOptions): (
|
|
|
2338
2329
|
* sources rather than two claims with one each — which is the difference
|
|
2339
2330
|
* between corroborated and unsupported.
|
|
2340
2331
|
*/
|
|
2341
|
-
declare function claimId(text: string): string;
|
|
2332
|
+
export declare function claimId(text: string): string;
|
|
2342
2333
|
/** Stable identity for one extracted claim/source/contradiction observation. */
|
|
2343
|
-
declare function claimEvidenceId(claim: Pick<ResearchClaimEvidence, 'claimId' | 'sourceId' | 'sourceUri' | 'sourceContentHash' | 'contradictsClaimId'>): string;
|
|
2334
|
+
export declare function claimEvidenceId(claim: Pick<ResearchClaimEvidence, 'claimId' | 'sourceId' | 'sourceUri' | 'sourceContentHash' | 'contradictsClaimId'>): string;
|
|
2344
2335
|
/** Canonical key for one exact registry-id + original-URI + hash source version. */
|
|
2345
|
-
declare function researchSourceVersionKey(source: Pick<ResearchSourceVersion, 'sourceId' | 'uri' | 'contentHash'>): string;
|
|
2336
|
+
export declare function researchSourceVersionKey(source: Pick<ResearchSourceVersion, 'sourceId' | 'uri' | 'contentHash'>): string;
|
|
2346
2337
|
/** Case-, whitespace-, and stylistic-punctuation-insensitive claim identity form. */
|
|
2347
|
-
declare function normalizeClaimText(text: string): string;
|
|
2338
|
+
export declare function normalizeClaimText(text: string): string;
|
|
2348
2339
|
/**
|
|
2349
2340
|
* The canonical host a source uri counts as, which is what makes two sources
|
|
2350
2341
|
* INDEPENDENT: corroboration is "distinct hosts", so this function is the rule
|
|
@@ -2353,9 +2344,9 @@ declare function normalizeClaimText(text: string): string;
|
|
|
2353
2344
|
* consumer that counted raw uris would report two pages of one site as
|
|
2354
2345
|
* independent confirmation.
|
|
2355
2346
|
*/
|
|
2356
|
-
declare function claimSourceHost(uri: string): string;
|
|
2347
|
+
export declare function claimSourceHost(uri: string): string;
|
|
2357
2348
|
/** Stable identity for one deep question. */
|
|
2358
|
-
declare function deepQuestionId(kind: DeepQuestion['kind'], text: string): string;
|
|
2349
|
+
export declare function deepQuestionId(kind: DeepQuestion['kind'], text: string): string;
|
|
2359
2350
|
/**
|
|
2360
2351
|
* Refuse a claim record whose identity or source count disagrees with its evidence.
|
|
2361
2352
|
*
|
|
@@ -2364,15 +2355,15 @@ declare function deepQuestionId(kind: DeepQuestion['kind'], text: string): strin
|
|
|
2364
2355
|
* manufacture corroboration. Canonical ordering also makes equal records have
|
|
2365
2356
|
* equal bytes regardless of which process assembled them.
|
|
2366
2357
|
*/
|
|
2367
|
-
declare function assertTrackedClaimIntegrity(claim: ResearchClaimRecord): void;
|
|
2358
|
+
export declare function assertTrackedClaimIntegrity(claim: ResearchClaimRecord): void;
|
|
2368
2359
|
/** Refuse a deep question whose stable identity or set fields are malformed. */
|
|
2369
|
-
declare function assertDeepQuestionIntegrity(question: DeepQuestion): void;
|
|
2360
|
+
export declare function assertDeepQuestionIntegrity(question: DeepQuestion): void;
|
|
2370
2361
|
/** Refuse an extracted observation whose identity or content is malformed. */
|
|
2371
|
-
declare function assertResearchClaimEvidenceIntegrity(evidence: ResearchClaimEvidence): void;
|
|
2362
|
+
export declare function assertResearchClaimEvidenceIntegrity(evidence: ResearchClaimEvidence): void;
|
|
2372
2363
|
/** Refuse a ledger that is not one canonical, internally consistent record. */
|
|
2373
|
-
declare function assertResearchClaimLedgerIntegrity(ledger: ResearchClaimLedger): void;
|
|
2364
|
+
export declare function assertResearchClaimLedgerIntegrity(ledger: ResearchClaimLedger): void;
|
|
2374
2365
|
/** A ledger with nothing in it yet. */
|
|
2375
|
-
declare function emptyClaimLedger(id: string, goal?: string): ResearchClaimLedger;
|
|
2366
|
+
export declare function emptyClaimLedger(id: string, goal?: string): ResearchClaimLedger;
|
|
2376
2367
|
/**
|
|
2377
2368
|
* Turn only evidence backed by a confirmed source registration into support.
|
|
2378
2369
|
*
|
|
@@ -2380,14 +2371,14 @@ declare function emptyClaimLedger(id: string, goal?: string): ResearchClaimLedge
|
|
|
2380
2371
|
* it twice is a no-op. Keeping it in the ledger algebra means a source-confirming
|
|
2381
2372
|
* writer and an evidence-producing writer can arrive in either order.
|
|
2382
2373
|
*/
|
|
2383
|
-
declare function materializeRegisteredClaimEvidence(ledger: ResearchClaimLedger): ResearchClaimLedger;
|
|
2374
|
+
export declare function materializeRegisteredClaimEvidence(ledger: ResearchClaimLedger): ResearchClaimLedger;
|
|
2384
2375
|
/**
|
|
2385
2376
|
* Raised when two ledgers that accumulated evidence for DIFFERENT goals are
|
|
2386
2377
|
* combined. Merging them would pool two questions' evidence into one
|
|
2387
2378
|
* corroboration count, which reports a claim as independently confirmed when
|
|
2388
2379
|
* nobody confirmed it — strictly worse than losing the ledger, so this refuses.
|
|
2389
2380
|
*/
|
|
2390
|
-
declare class ClaimLedgerGoalConflictError extends Error {
|
|
2381
|
+
export declare class ClaimLedgerGoalConflictError extends Error {
|
|
2391
2382
|
readonly ledgerId: string;
|
|
2392
2383
|
readonly existingGoal: string;
|
|
2393
2384
|
readonly incomingGoal: string;
|
|
@@ -2402,7 +2393,7 @@ declare class ClaimLedgerGoalConflictError extends Error {
|
|
|
2402
2393
|
* seeing a contradiction is enough for the claim to be contested, and no later
|
|
2403
2394
|
* writer that simply did not see it may clear the flag.
|
|
2404
2395
|
*/
|
|
2405
|
-
declare function mergeTrackedClaims(base: ResearchClaimRecord, incoming: ResearchClaimRecord): ResearchClaimRecord;
|
|
2396
|
+
export declare function mergeTrackedClaims(base: ResearchClaimRecord, incoming: ResearchClaimRecord): ResearchClaimRecord;
|
|
2406
2397
|
/**
|
|
2407
2398
|
* Combine two ledgers for the same run.
|
|
2408
2399
|
*
|
|
@@ -2412,7 +2403,7 @@ declare function mergeTrackedClaims(base: ResearchClaimRecord, incoming: Researc
|
|
|
2412
2403
|
* is associative and idempotent — merge order cannot change the result and a
|
|
2413
2404
|
* replayed merge is a no-op.
|
|
2414
2405
|
*/
|
|
2415
|
-
declare function mergeClaimLedgers(base: ResearchClaimLedger, incoming: ResearchClaimLedger): ResearchClaimLedger;
|
|
2406
|
+
export declare function mergeClaimLedgers(base: ResearchClaimLedger, incoming: ResearchClaimLedger): ResearchClaimLedger;
|
|
2416
2407
|
/**
|
|
2417
2408
|
* Make every contradiction edge symmetric and mark both ends contested.
|
|
2418
2409
|
*
|
|
@@ -2429,7 +2420,7 @@ declare function mergeClaimLedgers(base: ResearchClaimLedger, incoming: Research
|
|
|
2429
2420
|
* only closed pairs, so it cannot report a lone weak claim as settled merely
|
|
2430
2421
|
* because its evidence named a claim that never arrived.
|
|
2431
2422
|
*/
|
|
2432
|
-
declare function linkClaimContradictions(ledger: ResearchClaimLedger): ResearchClaimLedger;
|
|
2423
|
+
export declare function linkClaimContradictions(ledger: ResearchClaimLedger): ResearchClaimLedger;
|
|
2433
2424
|
//#endregion
|
|
2434
2425
|
//#region src/collection-research-driver.d.ts
|
|
2435
2426
|
/**
|
|
@@ -2437,17 +2428,17 @@ declare function linkClaimContradictions(ledger: ResearchClaimLedger): ResearchC
|
|
|
2437
2428
|
* never researches, never steers beyond the loop's default open-gap list. The
|
|
2438
2429
|
* worker is the only agent that thinks.
|
|
2439
2430
|
*/
|
|
2440
|
-
declare function createCollectionResearchDriver(): ResearchDriver;
|
|
2431
|
+
export declare function createCollectionResearchDriver(): ResearchDriver;
|
|
2441
2432
|
//#endregion
|
|
2442
2433
|
//#region src/discovery.d.ts
|
|
2443
|
-
interface DiscoveryTask {
|
|
2434
|
+
export interface DiscoveryTask {
|
|
2444
2435
|
id: string;
|
|
2445
2436
|
goal: string;
|
|
2446
2437
|
query?: string;
|
|
2447
2438
|
sourceHints?: string[];
|
|
2448
2439
|
metadata?: Record<string, unknown>;
|
|
2449
2440
|
}
|
|
2450
|
-
interface DiscoveryResult {
|
|
2441
|
+
export interface DiscoveryResult {
|
|
2451
2442
|
taskId: string;
|
|
2452
2443
|
summary: string;
|
|
2453
2444
|
sourceUris?: string[];
|
|
@@ -2459,23 +2450,23 @@ interface DiscoveryResult {
|
|
|
2459
2450
|
followUpTasks?: DiscoveryTask[];
|
|
2460
2451
|
metadata?: Record<string, unknown>;
|
|
2461
2452
|
}
|
|
2462
|
-
interface KnowledgeDiscoveryWorker {
|
|
2453
|
+
export interface KnowledgeDiscoveryWorker {
|
|
2463
2454
|
run(task: DiscoveryTask, signal?: AbortSignal): Promise<DiscoveryResult> | DiscoveryResult;
|
|
2464
2455
|
}
|
|
2465
|
-
interface KnowledgeDiscoveryDispatcher {
|
|
2456
|
+
export interface KnowledgeDiscoveryDispatcher {
|
|
2466
2457
|
dispatch(tasks: DiscoveryTask[], options?: {
|
|
2467
2458
|
concurrency?: number;
|
|
2468
2459
|
signal?: AbortSignal;
|
|
2469
2460
|
}): Promise<DiscoveryResult[]>;
|
|
2470
2461
|
}
|
|
2471
|
-
type DiscoveryLoopStopReason = 'complete' | 'max-rounds' | 'max-tasks' | 'aborted';
|
|
2472
|
-
interface DiscoveryLoopRound {
|
|
2462
|
+
export type DiscoveryLoopStopReason = 'complete' | 'max-rounds' | 'max-tasks' | 'aborted';
|
|
2463
|
+
export interface DiscoveryLoopRound {
|
|
2473
2464
|
round: number;
|
|
2474
2465
|
tasks: DiscoveryTask[];
|
|
2475
2466
|
results: DiscoveryResult[];
|
|
2476
2467
|
queuedFollowUps: DiscoveryTask[];
|
|
2477
2468
|
}
|
|
2478
|
-
interface DiscoveryLoopResult {
|
|
2469
|
+
export interface DiscoveryLoopResult {
|
|
2479
2470
|
stopReason: DiscoveryLoopStopReason;
|
|
2480
2471
|
tasksDispatched: number;
|
|
2481
2472
|
results: DiscoveryResult[];
|
|
@@ -2485,7 +2476,7 @@ interface DiscoveryLoopResult {
|
|
|
2485
2476
|
/** Structurally identical task identities ignored to prevent cycles. */
|
|
2486
2477
|
duplicateTaskIds: string[];
|
|
2487
2478
|
}
|
|
2488
|
-
interface RunDiscoveryLoopOptions {
|
|
2479
|
+
export interface RunDiscoveryLoopOptions {
|
|
2489
2480
|
dispatcher: KnowledgeDiscoveryDispatcher;
|
|
2490
2481
|
initialTasks: readonly DiscoveryTask[];
|
|
2491
2482
|
/** Maximum follow-up depth including the initial dispatch. Default 3. */
|
|
@@ -2503,41 +2494,41 @@ interface RunDiscoveryLoopOptions {
|
|
|
2503
2494
|
* The runner owns only bounded scheduling and accounting. Workers own search,
|
|
2504
2495
|
* source verification, and domain-specific candidate shapes.
|
|
2505
2496
|
*/
|
|
2506
|
-
declare function runDiscoveryLoop(options: RunDiscoveryLoopOptions): Promise<DiscoveryLoopResult>;
|
|
2507
|
-
declare function createLocalDiscoveryDispatcher(worker: KnowledgeDiscoveryWorker): KnowledgeDiscoveryDispatcher;
|
|
2497
|
+
export declare function runDiscoveryLoop(options: RunDiscoveryLoopOptions): Promise<DiscoveryLoopResult>;
|
|
2498
|
+
export declare function createLocalDiscoveryDispatcher(worker: KnowledgeDiscoveryWorker): KnowledgeDiscoveryDispatcher;
|
|
2508
2499
|
//#endregion
|
|
2509
2500
|
//#region src/durable-fs.d.ts
|
|
2510
|
-
interface RegularFileSnapshot {
|
|
2501
|
+
export interface RegularFileSnapshot {
|
|
2511
2502
|
bytes: Buffer;
|
|
2512
2503
|
mode: number;
|
|
2513
2504
|
}
|
|
2514
|
-
declare function writeFileDurable(path: string, data: string | Buffer, options?: {
|
|
2505
|
+
export declare function writeFileDurable(path: string, data: string | Buffer, options?: {
|
|
2515
2506
|
encoding?: BufferEncoding;
|
|
2516
2507
|
mode?: number;
|
|
2517
2508
|
}): Promise<void>;
|
|
2518
|
-
declare function writeJsonDurable(path: string, value: unknown): Promise<void>;
|
|
2519
|
-
declare function writeFileDurableWithinRoot(root: string, relativePath: string, data: string | Buffer, options?: {
|
|
2509
|
+
export declare function writeJsonDurable(path: string, value: unknown): Promise<void>;
|
|
2510
|
+
export declare function writeFileDurableWithinRoot(root: string, relativePath: string, data: string | Buffer, options?: {
|
|
2520
2511
|
encoding?: BufferEncoding;
|
|
2521
2512
|
mode?: number;
|
|
2522
2513
|
}): Promise<void>;
|
|
2523
|
-
declare function writeJsonDurableWithinRoot(root: string, relativePath: string, value: unknown): Promise<void>;
|
|
2524
|
-
declare function renameDurable(source: string, target: string): Promise<void>;
|
|
2525
|
-
declare function removeDurable(path: string): Promise<void>;
|
|
2526
|
-
declare function syncDirectory(path: string): Promise<void>;
|
|
2514
|
+
export declare function writeJsonDurableWithinRoot(root: string, relativePath: string, value: unknown): Promise<void>;
|
|
2515
|
+
export declare function renameDurable(source: string, target: string): Promise<void>;
|
|
2516
|
+
export declare function removeDurable(path: string): Promise<void>;
|
|
2517
|
+
export declare function syncDirectory(path: string): Promise<void>;
|
|
2527
2518
|
/**
|
|
2528
2519
|
* Keeps the target's parent directory open while the operation runs. On Linux,
|
|
2529
2520
|
* `/proc/self/fd` anchors every lookup to that directory even if an ancestor is
|
|
2530
2521
|
* renamed concurrently.
|
|
2531
2522
|
*/
|
|
2532
|
-
declare function withSafeDescendant<T>(root: string, relativePath: string, use: (path: string) => Promise<T> | T): Promise<T>;
|
|
2533
|
-
declare function withSafeDirectory<T>(root: string, relativePath: string, create: boolean, use: (path: string) => Promise<T> | T): Promise<T>;
|
|
2534
|
-
declare function readRegularFileNoFollow(path: string): Promise<RegularFileSnapshot>;
|
|
2535
|
-
declare function readRegularFileWithinRoot(root: string, relativePath: string): Promise<RegularFileSnapshot>;
|
|
2536
|
-
declare function listRegularFilesWithinRoot(root: string, relativeDirectory: string): Promise<Array<RegularFileSnapshot & {
|
|
2523
|
+
export declare function withSafeDescendant<T>(root: string, relativePath: string, use: (path: string) => Promise<T> | T): Promise<T>;
|
|
2524
|
+
export declare function withSafeDirectory<T>(root: string, relativePath: string, create: boolean, use: (path: string) => Promise<T> | T): Promise<T>;
|
|
2525
|
+
export declare function readRegularFileNoFollow(path: string): Promise<RegularFileSnapshot>;
|
|
2526
|
+
export declare function readRegularFileWithinRoot(root: string, relativePath: string): Promise<RegularFileSnapshot>;
|
|
2527
|
+
export declare function listRegularFilesWithinRoot(root: string, relativeDirectory: string): Promise<Array<RegularFileSnapshot & {
|
|
2537
2528
|
path: string;
|
|
2538
2529
|
}>>;
|
|
2539
|
-
declare function isMissingFile(error: unknown): boolean;
|
|
2540
|
-
declare function isKernelAnchoredPath(path: string): boolean;
|
|
2530
|
+
export declare function isMissingFile(error: unknown): boolean;
|
|
2531
|
+
export declare function isKernelAnchoredPath(path: string): boolean;
|
|
2541
2532
|
/**
|
|
2542
2533
|
* The path from `root` down to `candidate`, or undefined when `candidate` is not
|
|
2543
2534
|
* strictly inside `root`.
|
|
@@ -2550,7 +2541,7 @@ declare function isKernelAnchoredPath(path: string): boolean;
|
|
|
2550
2541
|
* and a caller that treats it as a descendant would hand its own root to
|
|
2551
2542
|
* machinery that may remove the directory it is given.
|
|
2552
2543
|
*/
|
|
2553
|
-
declare function relativeWithinRoot(root: string, candidate: string): string | undefined;
|
|
2544
|
+
export declare function relativeWithinRoot(root: string, candidate: string): string | undefined;
|
|
2554
2545
|
/**
|
|
2555
2546
|
* The path from `root` down to `candidate`, with both sides canonicalized before
|
|
2556
2547
|
* they are compared.
|
|
@@ -2570,7 +2561,7 @@ declare function relativeWithinRoot(root: string, candidate: string): string | u
|
|
|
2570
2561
|
* canonicalized and the remaining segments are appended, so a directory that is
|
|
2571
2562
|
* about to be created is measured against the same root as one that already is.
|
|
2572
2563
|
*/
|
|
2573
|
-
declare function canonicalRelativeWithinRoot(root: string, candidate: string): Promise<string | undefined>;
|
|
2564
|
+
export declare function canonicalRelativeWithinRoot(root: string, candidate: string): Promise<string | undefined>;
|
|
2574
2565
|
/**
|
|
2575
2566
|
* Whether two paths name the same location, with both sides canonicalized first.
|
|
2576
2567
|
*
|
|
@@ -2579,15 +2570,15 @@ declare function canonicalRelativeWithinRoot(root: string, candidate: string): P
|
|
|
2579
2570
|
* spellings. Comparing the resolved strings reports a mismatch that does not
|
|
2580
2571
|
* exist.
|
|
2581
2572
|
*/
|
|
2582
|
-
declare function canonicalPathsEqual(left: string, right: string): Promise<boolean>;
|
|
2573
|
+
export declare function canonicalPathsEqual(left: string, right: string): Promise<boolean>;
|
|
2583
2574
|
//#endregion
|
|
2584
2575
|
//#region src/events.d.ts
|
|
2585
|
-
interface KnowledgeEventQuery {
|
|
2576
|
+
export interface KnowledgeEventQuery {
|
|
2586
2577
|
type?: KnowledgeEventType;
|
|
2587
2578
|
target?: string;
|
|
2588
2579
|
limit?: number;
|
|
2589
2580
|
}
|
|
2590
|
-
declare function createKnowledgeEvent(input: {
|
|
2581
|
+
export declare function createKnowledgeEvent(input: {
|
|
2591
2582
|
type: KnowledgeEventType;
|
|
2592
2583
|
actor?: string;
|
|
2593
2584
|
target?: string;
|
|
@@ -2596,7 +2587,7 @@ declare function createKnowledgeEvent(input: {
|
|
|
2596
2587
|
}): KnowledgeEvent;
|
|
2597
2588
|
//#endregion
|
|
2598
2589
|
//#region src/filesystem-search-provider.d.ts
|
|
2599
|
-
interface FileSystemSearchProviderOptions extends KnowledgePagesOptions {
|
|
2590
|
+
export interface FileSystemSearchProviderOptions extends KnowledgePagesOptions {
|
|
2600
2591
|
/** Knowledge-base root containing the pages directory and `.agent-knowledge/`. */
|
|
2601
2592
|
root: string;
|
|
2602
2593
|
/** Optional warm index, useful when the caller already built one. */
|
|
@@ -2609,7 +2600,7 @@ interface FileSystemSearchProviderOptions extends KnowledgePagesOptions {
|
|
|
2609
2600
|
*/
|
|
2610
2601
|
refresh?: 'manual' | 'always';
|
|
2611
2602
|
}
|
|
2612
|
-
interface FileSystemSearchOptions {
|
|
2603
|
+
export interface FileSystemSearchOptions {
|
|
2613
2604
|
limit?: number;
|
|
2614
2605
|
refresh?: boolean;
|
|
2615
2606
|
}
|
|
@@ -2619,7 +2610,7 @@ interface FileSystemSearchOptions {
|
|
|
2619
2610
|
* This is the simple backend for products that want deterministic search over
|
|
2620
2611
|
* markdown knowledge files before adding embeddings, rerankers, or a vector DB.
|
|
2621
2612
|
*/
|
|
2622
|
-
declare class FileSystemSearchProvider {
|
|
2613
|
+
export declare class FileSystemSearchProvider {
|
|
2623
2614
|
readonly root: string;
|
|
2624
2615
|
/** Root-relative directory the provider indexes. */
|
|
2625
2616
|
readonly pagesDirectory: string;
|
|
@@ -2634,7 +2625,7 @@ declare class FileSystemSearchProvider {
|
|
|
2634
2625
|
asRetrievalEvalRetriever(): RetrievalEvalRetriever;
|
|
2635
2626
|
invalidate(): void;
|
|
2636
2627
|
}
|
|
2637
|
-
declare function createFileSystemSearchProvider(options: FileSystemSearchProviderOptions): FileSystemSearchProvider;
|
|
2628
|
+
export declare function createFileSystemSearchProvider(options: FileSystemSearchProviderOptions): FileSystemSearchProvider;
|
|
2638
2629
|
//#endregion
|
|
2639
2630
|
//#region src/freshness.d.ts
|
|
2640
2631
|
/**
|
|
@@ -2666,24 +2657,24 @@ declare function createFileSystemSearchProvider(options: FileSystemSearchProvide
|
|
|
2666
2657
|
* PostgreSQL, SQLite, or another application-owned store.
|
|
2667
2658
|
*/
|
|
2668
2659
|
/** Identity for one freshness record. */
|
|
2669
|
-
interface FreshnessKey {
|
|
2660
|
+
export interface FreshnessKey {
|
|
2670
2661
|
workspaceId: string;
|
|
2671
2662
|
sourceId: string;
|
|
2672
2663
|
}
|
|
2673
2664
|
/** TTL bound for staleness checks. */
|
|
2674
|
-
interface FreshnessTtl extends FreshnessKey {
|
|
2665
|
+
export interface FreshnessTtl extends FreshnessKey {
|
|
2675
2666
|
/** Milliseconds; the record is stale when `Date.now() - last() > ttlMs`. */
|
|
2676
2667
|
ttlMs: number;
|
|
2677
2668
|
/** Injected clock for deterministic tests; defaults to system time. */
|
|
2678
2669
|
now?: Date;
|
|
2679
2670
|
}
|
|
2680
2671
|
/** Mark argument. */
|
|
2681
|
-
interface FreshnessMark extends FreshnessKey {
|
|
2672
|
+
export interface FreshnessMark extends FreshnessKey {
|
|
2682
2673
|
when: Date;
|
|
2683
2674
|
/** Optional content hash captured at refresh time; aids debugging. */
|
|
2684
2675
|
contentHash?: string;
|
|
2685
2676
|
}
|
|
2686
|
-
interface KnowledgeFreshnessStore {
|
|
2677
|
+
export interface KnowledgeFreshnessStore {
|
|
2687
2678
|
/** Last refresh time, or null if never refreshed. */
|
|
2688
2679
|
last(key: FreshnessKey): Promise<Date | null>;
|
|
2689
2680
|
/** Record a successful refresh. */
|
|
@@ -2693,13 +2684,13 @@ interface KnowledgeFreshnessStore {
|
|
|
2693
2684
|
/** All records for a workspace. */
|
|
2694
2685
|
list(workspaceId: string): Promise<FreshnessRecord[]>;
|
|
2695
2686
|
}
|
|
2696
|
-
interface FreshnessRecord {
|
|
2687
|
+
export interface FreshnessRecord {
|
|
2697
2688
|
workspaceId: string;
|
|
2698
2689
|
sourceId: string;
|
|
2699
2690
|
lastRefreshedAt: string;
|
|
2700
2691
|
contentHash?: string;
|
|
2701
2692
|
}
|
|
2702
|
-
interface FileSystemFreshnessStoreOptions {
|
|
2693
|
+
export interface FileSystemFreshnessStoreOptions {
|
|
2703
2694
|
/**
|
|
2704
2695
|
* Knowledge root. The store writes to `<root>/.agent-knowledge/freshness.json`,
|
|
2705
2696
|
* mirroring the convention used by `sources.json`.
|
|
@@ -2714,7 +2705,7 @@ interface FileSystemFreshnessStoreOptions {
|
|
|
2714
2705
|
* Writes share the package-wide filesystem lock, so multiple workers cannot
|
|
2715
2706
|
* overwrite one another or run through an interrupted knowledge promotion.
|
|
2716
2707
|
*/
|
|
2717
|
-
declare function createFileSystemFreshnessStore(options: FileSystemFreshnessStoreOptions): KnowledgeFreshnessStore;
|
|
2708
|
+
export declare function createFileSystemFreshnessStore(options: FileSystemFreshnessStoreOptions): KnowledgeFreshnessStore;
|
|
2718
2709
|
/**
|
|
2719
2710
|
* Bridge an application-owned database adapter to `KnowledgeFreshnessStore`.
|
|
2720
2711
|
* The adapter may use D1, PostgreSQL, SQLite, or another durable store.
|
|
@@ -2731,25 +2722,25 @@ declare function createFileSystemFreshnessStore(options: FileSystemFreshnessStor
|
|
|
2731
2722
|
* );
|
|
2732
2723
|
* ```
|
|
2733
2724
|
*/
|
|
2734
|
-
interface D1Adapter {
|
|
2725
|
+
export interface D1Adapter {
|
|
2735
2726
|
get(workspaceId: string, sourceId: string): Promise<FreshnessRecord | null>;
|
|
2736
2727
|
upsert(record: FreshnessRecord): Promise<void>;
|
|
2737
2728
|
listByWorkspace(workspaceId: string): Promise<FreshnessRecord[]>;
|
|
2738
2729
|
}
|
|
2739
|
-
declare function createD1FreshnessStoreStub(adapter: D1Adapter): KnowledgeFreshnessStore;
|
|
2730
|
+
export declare function createD1FreshnessStoreStub(adapter: D1Adapter): KnowledgeFreshnessStore;
|
|
2740
2731
|
//#endregion
|
|
2741
2732
|
//#region src/frontmatter.d.ts
|
|
2742
|
-
interface ParsedFrontmatter {
|
|
2733
|
+
export interface ParsedFrontmatter {
|
|
2743
2734
|
frontmatter: Record<string, unknown>;
|
|
2744
2735
|
body: string;
|
|
2745
2736
|
}
|
|
2746
|
-
declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
2747
|
-
declare function formatFrontmatter(frontmatter: Record<string, unknown>, body: string): string;
|
|
2737
|
+
export declare function parseFrontmatter(content: string): ParsedFrontmatter;
|
|
2738
|
+
export declare function formatFrontmatter(frontmatter: Record<string, unknown>, body: string): string;
|
|
2748
2739
|
//#endregion
|
|
2749
2740
|
//#region src/graph.d.ts
|
|
2750
|
-
type KnowledgePageRelationPredicate = 'wikilink' | 'citation' | 'shared-source' | 'contradicts';
|
|
2741
|
+
export type KnowledgePageRelationPredicate = 'wikilink' | 'citation' | 'shared-source' | 'contradicts';
|
|
2751
2742
|
/** One labeled relation between two pages; `weight` counts the occurrences that produced it. */
|
|
2752
|
-
interface KnowledgePageRelation extends KnowledgeRelation {
|
|
2743
|
+
export interface KnowledgePageRelation extends KnowledgeRelation {
|
|
2753
2744
|
predicate: KnowledgePageRelationPredicate;
|
|
2754
2745
|
weight: number;
|
|
2755
2746
|
}
|
|
@@ -2764,24 +2755,24 @@ interface KnowledgePageRelation extends KnowledgeRelation {
|
|
|
2764
2755
|
* implicit, so it is listed after the authored relations and never counts
|
|
2765
2756
|
* toward a page's degree in `buildKnowledgeGraph`.
|
|
2766
2757
|
*/
|
|
2767
|
-
declare function knowledgePageRelations(pages: KnowledgePage[]): KnowledgePageRelation[];
|
|
2758
|
+
export declare function knowledgePageRelations(pages: KnowledgePage[]): KnowledgePageRelation[];
|
|
2768
2759
|
/**
|
|
2769
2760
|
* The weighted page graph: `knowledgePageRelations` collapsed to one edge per
|
|
2770
2761
|
* ordered page pair, with the predicates merged into `reasons` and the weights
|
|
2771
2762
|
* summed. `contradicts` stays out of this projection; read it from the relation
|
|
2772
2763
|
* list. Node degrees count the authored `wikilink` and `citation` occurrences.
|
|
2773
2764
|
*/
|
|
2774
|
-
declare function buildKnowledgeGraph(pages: KnowledgePage[]): KnowledgeGraph;
|
|
2765
|
+
export declare function buildKnowledgeGraph(pages: KnowledgePage[]): KnowledgeGraph;
|
|
2775
2766
|
//#endregion
|
|
2776
2767
|
//#region src/ids.d.ts
|
|
2777
|
-
declare function sha256(text: string): string;
|
|
2778
|
-
declare function slugify(input: string): string;
|
|
2779
|
-
declare function stableId(prefix: string, content: string): string;
|
|
2768
|
+
export declare function sha256(text: string): string;
|
|
2769
|
+
export declare function slugify(input: string): string;
|
|
2770
|
+
export declare function stableId(prefix: string, content: string): string;
|
|
2780
2771
|
/** Canonical registry id for exact text submitted at one original URI. */
|
|
2781
|
-
declare function textSourceId(uri: string, contentHash: string): string;
|
|
2772
|
+
export declare function textSourceId(uri: string, contentHash: string): string;
|
|
2782
2773
|
//#endregion
|
|
2783
2774
|
//#region src/indexer.d.ts
|
|
2784
|
-
declare function buildKnowledgeIndex(root: string, options?: KnowledgePagesOptions): Promise<KnowledgeIndex>;
|
|
2775
|
+
export declare function buildKnowledgeIndex(root: string, options?: KnowledgePagesOptions): Promise<KnowledgeIndex>;
|
|
2785
2776
|
/**
|
|
2786
2777
|
* Build the index from the knowledge tree and store it.
|
|
2787
2778
|
*
|
|
@@ -2791,10 +2782,10 @@ declare function buildKnowledgeIndex(root: string, options?: KnowledgePagesOptio
|
|
|
2791
2782
|
* a store-based reader saw none of the indexer's work. One writer now, and it
|
|
2792
2783
|
* validates through `KnowledgeIndexSchema` on the way out.
|
|
2793
2784
|
*/
|
|
2794
|
-
declare function writeKnowledgeIndex(root: string, options?: KnowledgePagesOptions): Promise<KnowledgeIndex>;
|
|
2785
|
+
export declare function writeKnowledgeIndex(root: string, options?: KnowledgePagesOptions): Promise<KnowledgeIndex>;
|
|
2795
2786
|
//#endregion
|
|
2796
2787
|
//#region src/inspect.d.ts
|
|
2797
|
-
interface KnowledgeInspection {
|
|
2788
|
+
export interface KnowledgeInspection {
|
|
2798
2789
|
pageCount: number;
|
|
2799
2790
|
sourceCount: number;
|
|
2800
2791
|
expiredSourceCount: number;
|
|
@@ -2811,7 +2802,7 @@ interface KnowledgeInspection {
|
|
|
2811
2802
|
sourceFreshness: SourceFreshnessInspection[];
|
|
2812
2803
|
findings: KnowledgeLintFinding[];
|
|
2813
2804
|
}
|
|
2814
|
-
interface SourceFreshnessInspection {
|
|
2805
|
+
export interface SourceFreshnessInspection {
|
|
2815
2806
|
id: string;
|
|
2816
2807
|
title?: string;
|
|
2817
2808
|
uri: string;
|
|
@@ -2819,10 +2810,10 @@ interface SourceFreshnessInspection {
|
|
|
2819
2810
|
validUntil?: string;
|
|
2820
2811
|
lastVerifiedAt?: string;
|
|
2821
2812
|
}
|
|
2822
|
-
declare function inspectKnowledgeIndex(index: KnowledgeIndex, options?: {
|
|
2813
|
+
export declare function inspectKnowledgeIndex(index: KnowledgeIndex, options?: {
|
|
2823
2814
|
now?: Date;
|
|
2824
2815
|
}): KnowledgeInspection;
|
|
2825
|
-
interface KnowledgeExplanation {
|
|
2816
|
+
export interface KnowledgeExplanation {
|
|
2826
2817
|
target: string;
|
|
2827
2818
|
page?: KnowledgePage;
|
|
2828
2819
|
sources: Array<{
|
|
@@ -2838,19 +2829,19 @@ interface KnowledgeExplanation {
|
|
|
2838
2829
|
score: number;
|
|
2839
2830
|
}>;
|
|
2840
2831
|
}
|
|
2841
|
-
declare function explainKnowledgeTarget(index: KnowledgeIndex, target: string): KnowledgeExplanation;
|
|
2832
|
+
export declare function explainKnowledgeTarget(index: KnowledgeIndex, target: string): KnowledgeExplanation;
|
|
2842
2833
|
//#endregion
|
|
2843
2834
|
//#region src/invalidation-propagation.d.ts
|
|
2844
2835
|
/** Frontmatter field naming the cited pages whose evidence refuted them. */
|
|
2845
|
-
declare const CITES_INVALIDATED_FIELD = "citesInvalidated";
|
|
2846
|
-
interface KnowledgeInvalidationStamp {
|
|
2836
|
+
export declare const CITES_INVALIDATED_FIELD = "citesInvalidated";
|
|
2837
|
+
export interface KnowledgeInvalidationStamp {
|
|
2847
2838
|
readonly page: KnowledgePage;
|
|
2848
2839
|
/** The value the field must hold, sorted and deduplicated. Empty removes the field. */
|
|
2849
2840
|
readonly citesInvalidated: readonly KnowledgeId[];
|
|
2850
2841
|
/** The value the page holds now, in the order it is stored. */
|
|
2851
2842
|
readonly current: readonly KnowledgeId[];
|
|
2852
2843
|
}
|
|
2853
|
-
interface KnowledgeInvalidationPlan {
|
|
2844
|
+
export interface KnowledgeInvalidationPlan {
|
|
2854
2845
|
/** Every visible page carrying an invalidation, sorted by id. */
|
|
2855
2846
|
readonly invalidatedPageIds: readonly KnowledgeId[];
|
|
2856
2847
|
/** Only the pages whose stamp differs from what they hold, in path order. */
|
|
@@ -2864,7 +2855,7 @@ interface KnowledgeInvalidationPlan {
|
|
|
2864
2855
|
* citing a refuted inherited or shared page. Only `here` pages are stamped: a
|
|
2865
2856
|
* run does not write the stores it inherits or shares.
|
|
2866
2857
|
*/
|
|
2867
|
-
declare function planInvalidationPropagation(visiblePages: readonly OriginatedPage[]): KnowledgeInvalidationPlan;
|
|
2858
|
+
export declare function planInvalidationPropagation(visiblePages: readonly OriginatedPage[]): KnowledgeInvalidationPlan;
|
|
2868
2859
|
/**
|
|
2869
2860
|
* Render one plan as a write-block proposal for `applyKnowledgeWriteBlocks`.
|
|
2870
2861
|
*
|
|
@@ -2872,7 +2863,7 @@ declare function planInvalidationPropagation(visiblePages: readonly OriginatedPa
|
|
|
2872
2863
|
* `formatFrontmatter`, so its frontmatter is written in that writer's
|
|
2873
2864
|
* normalized form.
|
|
2874
2865
|
*/
|
|
2875
|
-
declare function formatKnowledgeInvalidationProposal(plan: KnowledgeInvalidationPlan): string;
|
|
2866
|
+
export declare function formatKnowledgeInvalidationProposal(plan: KnowledgeInvalidationPlan): string;
|
|
2876
2867
|
//#endregion
|
|
2877
2868
|
//#region src/investment-thesis-set.d.ts
|
|
2878
2869
|
/**
|
|
@@ -2923,16 +2914,16 @@ declare function formatKnowledgeInvalidationProposal(plan: KnowledgeInvalidation
|
|
|
2923
2914
|
* numbers / names.
|
|
2924
2915
|
*/
|
|
2925
2916
|
/** A required answer component: satisfied when any synonym fragment is present. */
|
|
2926
|
-
interface ExpectedGroup {
|
|
2917
|
+
export interface ExpectedGroup {
|
|
2927
2918
|
/** Human label for the component (for the doc / audit). */
|
|
2928
2919
|
label: string;
|
|
2929
2920
|
/** Case-insensitive substring fragments; any one present satisfies the group. */
|
|
2930
2921
|
anyOf: string[];
|
|
2931
2922
|
}
|
|
2932
2923
|
/** Lens the fact belongs to — so a set can be checked for category coverage. */
|
|
2933
|
-
type MaterialFactLens = 'concentration' | 'leverage' | 'margin-trend' | 'liquidity' | 'capital-return' | 'governance' | 'off-balance-sheet' | 'regulatory';
|
|
2924
|
+
export type MaterialFactLens = 'concentration' | 'leverage' | 'margin-trend' | 'liquidity' | 'capital-return' | 'governance' | 'off-balance-sheet' | 'regulatory';
|
|
2934
2925
|
/** One held-out material fact with a checkable expected answer + its provenance. */
|
|
2935
|
-
interface MaterialFact {
|
|
2926
|
+
export interface MaterialFact {
|
|
2936
2927
|
/** Stable id, `ticker/fN`. */
|
|
2937
2928
|
id: string;
|
|
2938
2929
|
/** Which analyst lens this fact exercises. For coverage + the doc. */
|
|
@@ -2967,7 +2958,7 @@ interface MaterialFact {
|
|
|
2967
2958
|
evidence: string;
|
|
2968
2959
|
}
|
|
2969
2960
|
/** A company + the cutoff a loop researches as-of + its held-out material facts. */
|
|
2970
|
-
interface CompanyEvalCase {
|
|
2961
|
+
export interface CompanyEvalCase {
|
|
2971
2962
|
/** Ticker as of the cutoff. */
|
|
2972
2963
|
ticker: string;
|
|
2973
2964
|
/** Legal name as of the cutoff (what the loop is told to research). */
|
|
@@ -3003,33 +2994,33 @@ interface CompanyEvalCase {
|
|
|
3003
2994
|
* drivers and with survivors. This set is honest about that and reports the lens
|
|
3004
2995
|
* distribution so the bias is measurable, not hidden.
|
|
3005
2996
|
*/
|
|
3006
|
-
declare const investmentThesisSet: CompanyEvalCase[];
|
|
2997
|
+
export declare const investmentThesisSet: CompanyEvalCase[];
|
|
3007
2998
|
/**
|
|
3008
2999
|
* Grade ONE material fact against an investment thesis's full text. Returns
|
|
3009
3000
|
* whether the thesis SURFACED it plus which expected groups were found. The
|
|
3010
3001
|
* check is a deterministic case-insensitive substring scan — $0, model-free,
|
|
3011
3002
|
* reproducible — so the eval never leaks into a model the loop could observe.
|
|
3012
3003
|
*/
|
|
3013
|
-
declare function gradeFactAgainstText(fact: MaterialFact, thesisText: string): {
|
|
3004
|
+
export declare function gradeFactAgainstText(fact: MaterialFact, thesisText: string): {
|
|
3014
3005
|
surfaced: boolean;
|
|
3015
3006
|
groupsFound: number;
|
|
3016
3007
|
groupsTotal: number;
|
|
3017
3008
|
foundLabels: string[];
|
|
3018
3009
|
};
|
|
3019
3010
|
/** Grade a whole company's thesis text: how many of its held-out facts it surfaces. */
|
|
3020
|
-
declare function gradeCompanyAgainstText(company: CompanyEvalCase, thesisText: string): {
|
|
3011
|
+
export declare function gradeCompanyAgainstText(company: CompanyEvalCase, thesisText: string): {
|
|
3021
3012
|
surfaced: number;
|
|
3022
3013
|
total: number;
|
|
3023
3014
|
perFact: ReturnType<typeof gradeFactAgainstText>[];
|
|
3024
3015
|
};
|
|
3025
3016
|
/** Total held-out facts across the set (the denominator the doc reports). */
|
|
3026
|
-
declare function totalMaterialFacts(set?: CompanyEvalCase[]): number;
|
|
3017
|
+
export declare function totalMaterialFacts(set?: CompanyEvalCase[]): number;
|
|
3027
3018
|
/** Count facts per lens across the set — used to report (and bound) curation bias. */
|
|
3028
|
-
declare function lensDistribution(set?: CompanyEvalCase[]): Record<MaterialFactLens, number>;
|
|
3019
|
+
export declare function lensDistribution(set?: CompanyEvalCase[]): Record<MaterialFactLens, number>;
|
|
3029
3020
|
//#endregion
|
|
3030
3021
|
//#region src/investment-thesis-task.d.ts
|
|
3031
3022
|
/** The minimal brief a thesis run is given — the firewall boundary. */
|
|
3032
|
-
interface ThesisTaskInput {
|
|
3023
|
+
export interface ThesisTaskInput {
|
|
3033
3024
|
/** Legal name as of the cutoff — what the loop researches. */
|
|
3034
3025
|
company: string;
|
|
3035
3026
|
/** Ticker as of the cutoff. */
|
|
@@ -3053,8 +3044,8 @@ interface ThesisTaskInput {
|
|
|
3053
3044
|
* fetch and the loop runs multiple rounds — the depth-driving driver needs >1
|
|
3054
3045
|
* round to steer, exactly as the ML-exam multi-round probe established.
|
|
3055
3046
|
*/
|
|
3056
|
-
declare function thesisReadinessSpecs(input: ThesisTaskInput): KnowledgeReadinessSpec[];
|
|
3057
|
-
interface ThesisRunOptions {
|
|
3047
|
+
export declare function thesisReadinessSpecs(input: ThesisTaskInput): KnowledgeReadinessSpec[];
|
|
3048
|
+
export interface ThesisRunOptions {
|
|
3058
3049
|
/** The KB root the loop writes into. */
|
|
3059
3050
|
root: string;
|
|
3060
3051
|
/** Shared router client (web search + chat). Defaults to env creds. */
|
|
@@ -3069,7 +3060,7 @@ interface ThesisRunOptions {
|
|
|
3069
3060
|
synthesisMaxTokens?: number;
|
|
3070
3061
|
signal?: AbortSignal;
|
|
3071
3062
|
}
|
|
3072
|
-
interface ThesisRunResult {
|
|
3063
|
+
export interface ThesisRunResult {
|
|
3073
3064
|
loop: VerifiedResearchLoopResult;
|
|
3074
3065
|
/** The synthesized thesis text. */
|
|
3075
3066
|
thesis: string;
|
|
@@ -3082,7 +3073,7 @@ interface ThesisRunResult {
|
|
|
3082
3073
|
* + the thesis text + the page path. The caller grades the KB with
|
|
3083
3074
|
* `materialFactsSurfaced(root, checklist)` — the checklist is never passed here.
|
|
3084
3075
|
*/
|
|
3085
|
-
declare function runInvestmentThesisTask(input: ThesisTaskInput, options: ThesisRunOptions): Promise<ThesisRunResult>;
|
|
3076
|
+
export declare function runInvestmentThesisTask(input: ThesisTaskInput, options: ThesisRunOptions): Promise<ThesisRunResult>;
|
|
3086
3077
|
//#endregion
|
|
3087
3078
|
//#region src/kb-store.d.ts
|
|
3088
3079
|
/**
|
|
@@ -3096,18 +3087,18 @@ declare function runInvestmentThesisTask(input: ThesisTaskInput, options: Thesis
|
|
|
3096
3087
|
* `FileSystemKbStore`, anchored on the knowledge-base root, which is also the
|
|
3097
3088
|
* directory `withKnowledgeMutation` locks: one file, one lock domain.
|
|
3098
3089
|
*/
|
|
3099
|
-
declare const KB_STORE_DIR = ".agent-knowledge";
|
|
3100
|
-
declare const KB_INDEX_PATH = ".agent-knowledge/index.json";
|
|
3101
|
-
declare const KB_EVENTS_PATH = ".agent-knowledge/events.json";
|
|
3102
|
-
declare const KB_CLAIM_LEDGER_DIR = ".agent-knowledge/claim-ledgers";
|
|
3103
|
-
declare function assertClaimLedgerId(id: string): string;
|
|
3090
|
+
export declare const KB_STORE_DIR = ".agent-knowledge";
|
|
3091
|
+
export declare const KB_INDEX_PATH = ".agent-knowledge/index.json";
|
|
3092
|
+
export declare const KB_EVENTS_PATH = ".agent-knowledge/events.json";
|
|
3093
|
+
export declare const KB_CLAIM_LEDGER_DIR = ".agent-knowledge/claim-ledgers";
|
|
3094
|
+
export declare function assertClaimLedgerId(id: string): string;
|
|
3104
3095
|
/** A URI-only ledger cannot be upgraded without re-verifying its source bytes. */
|
|
3105
|
-
declare class ClaimLedgerMigrationRequiredError extends Error {
|
|
3096
|
+
export declare class ClaimLedgerMigrationRequiredError extends Error {
|
|
3106
3097
|
readonly ledgerId: string;
|
|
3107
3098
|
readonly foundSchemaVersion: number | 'unversioned';
|
|
3108
3099
|
constructor(ledgerId: string, foundSchemaVersion: number | 'unversioned');
|
|
3109
3100
|
}
|
|
3110
|
-
interface KbStore {
|
|
3101
|
+
export interface KbStore {
|
|
3111
3102
|
putSource(source: SourceRecord): Promise<void>;
|
|
3112
3103
|
getSource(id: string): Promise<SourceRecord | null>;
|
|
3113
3104
|
listSources(): Promise<SourceRecord[]>;
|
|
@@ -3120,7 +3111,7 @@ interface KbStore {
|
|
|
3120
3111
|
listEvents(query?: KnowledgeEventQuery): Promise<KnowledgeEvent[]>;
|
|
3121
3112
|
}
|
|
3122
3113
|
/** Optional durable capability for stores that retain per-run research belief. */
|
|
3123
|
-
interface ClaimLedgerStore {
|
|
3114
|
+
export interface ClaimLedgerStore {
|
|
3124
3115
|
/**
|
|
3125
3116
|
* Persist one research run's claim ledger — the corroboration counts,
|
|
3126
3117
|
* contradiction edges, and open deep questions that make up its belief state.
|
|
@@ -3146,7 +3137,7 @@ interface ClaimLedgerStore {
|
|
|
3146
3137
|
*/
|
|
3147
3138
|
mergeClaimLedger(id: string, merge: (current: ResearchClaimLedger | null) => ResearchClaimLedger): Promise<ResearchClaimLedger>;
|
|
3148
3139
|
}
|
|
3149
|
-
declare class MemoryKbStore implements KbStore, ClaimLedgerStore {
|
|
3140
|
+
export declare class MemoryKbStore implements KbStore, ClaimLedgerStore {
|
|
3150
3141
|
private readonly sources;
|
|
3151
3142
|
private readonly pages;
|
|
3152
3143
|
private readonly events;
|
|
@@ -3175,11 +3166,11 @@ declare class MemoryKbStore implements KbStore, ClaimLedgerStore {
|
|
|
3175
3166
|
* `writeKnowledgeIndex`. The string constructor preserves the published direct
|
|
3176
3167
|
* record-directory layout (`<directory>/index.json`).
|
|
3177
3168
|
*/
|
|
3178
|
-
interface FileSystemKbStoreOptions {
|
|
3169
|
+
export interface FileSystemKbStoreOptions {
|
|
3179
3170
|
/** Knowledge-base root; records are stored under `<root>/.agent-knowledge/`. */
|
|
3180
3171
|
root: string;
|
|
3181
3172
|
}
|
|
3182
|
-
declare class FileSystemKbStore implements KbStore, ClaimLedgerStore {
|
|
3173
|
+
export declare class FileSystemKbStore implements KbStore, ClaimLedgerStore {
|
|
3183
3174
|
private readonly root;
|
|
3184
3175
|
private readonly indexPath;
|
|
3185
3176
|
private readonly eventsPath;
|
|
@@ -3212,29 +3203,29 @@ declare class FileSystemKbStore implements KbStore, ClaimLedgerStore {
|
|
|
3212
3203
|
}
|
|
3213
3204
|
//#endregion
|
|
3214
3205
|
//#region src/knowledge-visibility.d.ts
|
|
3215
|
-
declare const KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION: '2.0.0';
|
|
3216
|
-
declare const KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM: 'rfc8785-sha256';
|
|
3206
|
+
export declare const KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION: '2.0.0';
|
|
3207
|
+
export declare const KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM: 'rfc8785-sha256';
|
|
3217
3208
|
/** Stable content identity for one exact knowledge page. */
|
|
3218
|
-
declare function knowledgePageDigest(page: KnowledgePage): Sha256Digest;
|
|
3209
|
+
export declare function knowledgePageDigest(page: KnowledgePage): Sha256Digest;
|
|
3219
3210
|
/** Snapshot the exact ordered current/ancestor/shared page view. */
|
|
3220
|
-
declare function createKnowledgeVisibilitySnapshot(visiblePages: readonly OriginatedPage[]): KnowledgeVisibilitySnapshot;
|
|
3211
|
+
export declare function createKnowledgeVisibilitySnapshot(visiblePages: readonly OriginatedPage[]): KnowledgeVisibilitySnapshot;
|
|
3221
3212
|
/**
|
|
3222
3213
|
* Verify a snapshot's schema and canonical digest. The check runs once per
|
|
3223
3214
|
* snapshot object; later calls with the same object are free.
|
|
3224
3215
|
*/
|
|
3225
|
-
declare function verifyKnowledgeVisibilitySnapshot(snapshot: KnowledgeVisibilitySnapshot): KnowledgeVisibilitySnapshot;
|
|
3216
|
+
export declare function verifyKnowledgeVisibilitySnapshot(snapshot: KnowledgeVisibilitySnapshot): KnowledgeVisibilitySnapshot;
|
|
3226
3217
|
/** Canonical bytes of a verified snapshot, for durable storage. */
|
|
3227
|
-
declare function encodeKnowledgeVisibilitySnapshot(snapshot: KnowledgeVisibilitySnapshot): Uint8Array;
|
|
3218
|
+
export declare function encodeKnowledgeVisibilitySnapshot(snapshot: KnowledgeVisibilitySnapshot): Uint8Array;
|
|
3228
3219
|
/** Parse stored snapshot bytes and verify their schema and digest. */
|
|
3229
|
-
declare function decodeKnowledgeVisibilitySnapshot(bytes: Uint8Array): KnowledgeVisibilitySnapshot;
|
|
3220
|
+
export declare function decodeKnowledgeVisibilitySnapshot(bytes: Uint8Array): KnowledgeVisibilitySnapshot;
|
|
3230
3221
|
/** Locator for snapshot bytes stored at `uri`. */
|
|
3231
|
-
declare function knowledgeVisibilityArtifactRef(input: {
|
|
3222
|
+
export declare function knowledgeVisibilityArtifactRef(input: {
|
|
3232
3223
|
uri: string;
|
|
3233
3224
|
bytes: Uint8Array;
|
|
3234
3225
|
}): KnowledgeVisibilityArtifactRef;
|
|
3235
3226
|
//#endregion
|
|
3236
3227
|
//#region src/knowledge-use-receipts.d.ts
|
|
3237
|
-
interface KnowledgeVisibilitySnapshotEntry {
|
|
3228
|
+
export interface KnowledgeVisibilitySnapshotEntry {
|
|
3238
3229
|
readonly position: number;
|
|
3239
3230
|
readonly pageId: string;
|
|
3240
3231
|
readonly origin: PageOrigin;
|
|
@@ -3244,14 +3235,14 @@ interface KnowledgeVisibilitySnapshotEntry {
|
|
|
3244
3235
|
readonly invalidated: boolean;
|
|
3245
3236
|
}
|
|
3246
3237
|
/** Exact ordered page visibility presented to one retrieval operation. */
|
|
3247
|
-
interface KnowledgeVisibilitySnapshot {
|
|
3238
|
+
export interface KnowledgeVisibilitySnapshot {
|
|
3248
3239
|
readonly schemaVersion: typeof KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION;
|
|
3249
3240
|
readonly digestAlgorithm: typeof KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM;
|
|
3250
3241
|
readonly snapshotDigest: Sha256Digest;
|
|
3251
3242
|
readonly entries: readonly KnowledgeVisibilitySnapshotEntry[];
|
|
3252
3243
|
}
|
|
3253
3244
|
/** Content-addressed locator of the stored bytes of one visibility snapshot. */
|
|
3254
|
-
interface KnowledgeVisibilityArtifactRef {
|
|
3245
|
+
export interface KnowledgeVisibilityArtifactRef {
|
|
3255
3246
|
readonly uri: string;
|
|
3256
3247
|
/** Digest of the stored bytes, as `knowledgeVisibilityArtifactRef` computes it. */
|
|
3257
3248
|
readonly digest: Sha256Digest;
|
|
@@ -3262,12 +3253,12 @@ interface KnowledgeVisibilityArtifactRef {
|
|
|
3262
3253
|
* the artifact the reference names, or in another durable record the caller
|
|
3263
3254
|
* keeps; the receipt carries only this reference.
|
|
3264
3255
|
*/
|
|
3265
|
-
interface KnowledgeVisibilityRef {
|
|
3256
|
+
export interface KnowledgeVisibilityRef {
|
|
3266
3257
|
readonly snapshotDigest: Sha256Digest;
|
|
3267
3258
|
readonly pageCount: number;
|
|
3268
3259
|
readonly artifact?: KnowledgeVisibilityArtifactRef;
|
|
3269
3260
|
}
|
|
3270
|
-
interface KnowledgeRetrieverIdentity {
|
|
3261
|
+
export interface KnowledgeRetrieverIdentity {
|
|
3271
3262
|
/** Stable implementation name, for example `token-overlap-v1`. */
|
|
3272
3263
|
readonly id: string;
|
|
3273
3264
|
/** Published or application-defined implementation version. */
|
|
@@ -3275,10 +3266,10 @@ interface KnowledgeRetrieverIdentity {
|
|
|
3275
3266
|
/** Exact identity of every retrieval setting not represented elsewhere. */
|
|
3276
3267
|
readonly configDigest: Sha256Digest;
|
|
3277
3268
|
}
|
|
3278
|
-
interface OriginatedKnowledgeSearchResult extends KnowledgeSearchResult {
|
|
3269
|
+
export interface OriginatedKnowledgeSearchResult extends KnowledgeSearchResult {
|
|
3279
3270
|
readonly origin: PageOrigin;
|
|
3280
3271
|
}
|
|
3281
|
-
interface KnowledgeRetrievalResultReceipt {
|
|
3272
|
+
export interface KnowledgeRetrievalResultReceipt {
|
|
3282
3273
|
readonly rank: number;
|
|
3283
3274
|
readonly pageId: string;
|
|
3284
3275
|
readonly origin: PageOrigin;
|
|
@@ -3289,12 +3280,12 @@ interface KnowledgeRetrievalResultReceipt {
|
|
|
3289
3280
|
readonly snippet: string;
|
|
3290
3281
|
readonly reasons: readonly string[];
|
|
3291
3282
|
}
|
|
3292
|
-
type KnowledgeReceiptAttributeValue = string | number | boolean | null;
|
|
3283
|
+
export type KnowledgeReceiptAttributeValue = string | number | boolean | null;
|
|
3293
3284
|
/**
|
|
3294
3285
|
* Immutable proof of what one actor could see and what its retriever returned.
|
|
3295
3286
|
* Final prose is not evidence that retrieval happened; this receipt is.
|
|
3296
3287
|
*/
|
|
3297
|
-
interface KnowledgeRetrievalReceipt {
|
|
3288
|
+
export interface KnowledgeRetrievalReceipt {
|
|
3298
3289
|
readonly schemaVersion: typeof KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION;
|
|
3299
3290
|
readonly kind: 'knowledge-retrieval';
|
|
3300
3291
|
readonly digestAlgorithm: typeof KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM;
|
|
@@ -3311,7 +3302,7 @@ interface KnowledgeRetrievalReceipt {
|
|
|
3311
3302
|
readonly evidenceRefs: readonly EvidenceRef[];
|
|
3312
3303
|
readonly attributes: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
3313
3304
|
}
|
|
3314
|
-
interface CreateKnowledgeRetrievalReceiptInput {
|
|
3305
|
+
export interface CreateKnowledgeRetrievalReceiptInput {
|
|
3315
3306
|
readonly runId: string;
|
|
3316
3307
|
readonly actorId?: string;
|
|
3317
3308
|
readonly profileDigest?: Sha256Digest;
|
|
@@ -3336,14 +3327,14 @@ interface CreateKnowledgeRetrievalReceiptInput {
|
|
|
3336
3327
|
* Returns the stored bytes of the artifact, or `undefined` when nothing is
|
|
3337
3328
|
* stored at its uri. A thrown error is reported as a load failure.
|
|
3338
3329
|
*/
|
|
3339
|
-
type KnowledgeVisibilityArtifactLoader = (artifact: KnowledgeVisibilityArtifactRef) => Promise<Uint8Array | undefined> | Uint8Array | undefined;
|
|
3340
|
-
type KnowledgeVisibilityUnavailableReason = 'no-artifact-reference' | 'missing' | 'load-failed';
|
|
3330
|
+
export type KnowledgeVisibilityArtifactLoader = (artifact: KnowledgeVisibilityArtifactRef) => Promise<Uint8Array | undefined> | Uint8Array | undefined;
|
|
3331
|
+
export type KnowledgeVisibilityUnavailableReason = 'no-artifact-reference' | 'missing' | 'load-failed';
|
|
3341
3332
|
/**
|
|
3342
3333
|
* The visibility snapshot a receipt references could not be obtained, so the
|
|
3343
3334
|
* result-to-visibility join cannot be proven. This is distinct from a snapshot
|
|
3344
3335
|
* that loads and fails to match.
|
|
3345
3336
|
*/
|
|
3346
|
-
declare class KnowledgeVisibilityUnavailableError extends Error {
|
|
3337
|
+
export declare class KnowledgeVisibilityUnavailableError extends Error {
|
|
3347
3338
|
readonly reason: KnowledgeVisibilityUnavailableReason;
|
|
3348
3339
|
readonly snapshotDigest: Sha256Digest;
|
|
3349
3340
|
readonly uri?: string;
|
|
@@ -3354,14 +3345,14 @@ declare class KnowledgeVisibilityUnavailableError extends Error {
|
|
|
3354
3345
|
cause?: unknown;
|
|
3355
3346
|
});
|
|
3356
3347
|
}
|
|
3357
|
-
type KnowledgeUseRelation = 'supports' | 'contradicts' | 'extends' | 'rederives' | 'background';
|
|
3358
|
-
type KnowledgeConsumerKind = 'decision' | 'artifact' | 'experiment' | 'candidate' | 'message' | 'other';
|
|
3359
|
-
interface KnowledgeConsumerRef {
|
|
3348
|
+
export type KnowledgeUseRelation = 'supports' | 'contradicts' | 'extends' | 'rederives' | 'background';
|
|
3349
|
+
export type KnowledgeConsumerKind = 'decision' | 'artifact' | 'experiment' | 'candidate' | 'message' | 'other';
|
|
3350
|
+
export interface KnowledgeConsumerRef {
|
|
3360
3351
|
readonly kind: KnowledgeConsumerKind;
|
|
3361
3352
|
readonly uri: string;
|
|
3362
3353
|
readonly digest?: Sha256Digest;
|
|
3363
3354
|
}
|
|
3364
|
-
interface KnowledgeUsedResult {
|
|
3355
|
+
export interface KnowledgeUsedResult {
|
|
3365
3356
|
readonly rank: number;
|
|
3366
3357
|
readonly pageId: string;
|
|
3367
3358
|
readonly origin: PageOrigin;
|
|
@@ -3372,7 +3363,7 @@ interface KnowledgeUsedResult {
|
|
|
3372
3363
|
* Immutable proof that one retrieved page was selected for a downstream
|
|
3373
3364
|
* decision, artifact, experiment, candidate, or message.
|
|
3374
3365
|
*/
|
|
3375
|
-
interface KnowledgeUseReceipt {
|
|
3366
|
+
export interface KnowledgeUseReceipt {
|
|
3376
3367
|
readonly schemaVersion: typeof KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION;
|
|
3377
3368
|
readonly kind: 'knowledge-use';
|
|
3378
3369
|
readonly digestAlgorithm: typeof KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM;
|
|
@@ -3389,7 +3380,7 @@ interface KnowledgeUseReceipt {
|
|
|
3389
3380
|
readonly evidenceRefs: readonly EvidenceRef[];
|
|
3390
3381
|
readonly attributes: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
3391
3382
|
}
|
|
3392
|
-
interface CreateKnowledgeUseReceiptInput {
|
|
3383
|
+
export interface CreateKnowledgeUseReceiptInput {
|
|
3393
3384
|
readonly retrieval: KnowledgeRetrievalReceipt;
|
|
3394
3385
|
/** Exact one-based rank from the retrieval receipt. */
|
|
3395
3386
|
readonly selectedRank: number;
|
|
@@ -3405,7 +3396,7 @@ interface CreateKnowledgeUseReceiptInput {
|
|
|
3405
3396
|
* `irrelevant` means the returned pages did not bear on the question.
|
|
3406
3397
|
* `no-use` means they did bear on it and the consumer still used none of them.
|
|
3407
3398
|
*/
|
|
3408
|
-
type KnowledgeRetrievalDispositionRelation = 'irrelevant' | 'no-use';
|
|
3399
|
+
export type KnowledgeRetrievalDispositionRelation = 'irrelevant' | 'no-use';
|
|
3409
3400
|
/**
|
|
3410
3401
|
* Immutable proof that one retrieval led to no use.
|
|
3411
3402
|
*
|
|
@@ -3413,7 +3404,7 @@ type KnowledgeRetrievalDispositionRelation = 'irrelevant' | 'no-use';
|
|
|
3413
3404
|
* nothing would otherwise leave no record at all, and "no evidence of use" and
|
|
3414
3405
|
* "evidence of no use" would look identical in the ledger.
|
|
3415
3406
|
*/
|
|
3416
|
-
interface KnowledgeRetrievalDisposition {
|
|
3407
|
+
export interface KnowledgeRetrievalDisposition {
|
|
3417
3408
|
readonly schemaVersion: typeof KNOWLEDGE_USE_RECEIPT_SCHEMA_VERSION;
|
|
3418
3409
|
readonly kind: 'knowledge-retrieval-disposition';
|
|
3419
3410
|
readonly digestAlgorithm: typeof KNOWLEDGE_RECEIPT_DIGEST_ALGORITHM;
|
|
@@ -3429,7 +3420,7 @@ interface KnowledgeRetrievalDisposition {
|
|
|
3429
3420
|
readonly evidenceRefs: readonly EvidenceRef[];
|
|
3430
3421
|
readonly attributes: Readonly<Record<string, KnowledgeReceiptAttributeValue>>;
|
|
3431
3422
|
}
|
|
3432
|
-
interface CreateKnowledgeRetrievalDispositionInput {
|
|
3423
|
+
export interface CreateKnowledgeRetrievalDispositionInput {
|
|
3433
3424
|
readonly retrieval: KnowledgeRetrievalReceipt;
|
|
3434
3425
|
readonly relation: KnowledgeRetrievalDispositionRelation;
|
|
3435
3426
|
readonly consumer: KnowledgeConsumerRef;
|
|
@@ -3442,7 +3433,7 @@ interface CreateKnowledgeRetrievalDispositionInput {
|
|
|
3442
3433
|
* occur in the snapshot with the same page id and bytes; the receipt stores the
|
|
3443
3434
|
* snapshot's reference, not its entries.
|
|
3444
3435
|
*/
|
|
3445
|
-
declare function createKnowledgeRetrievalReceipt(input: CreateKnowledgeRetrievalReceiptInput): KnowledgeRetrievalReceipt;
|
|
3436
|
+
export declare function createKnowledgeRetrievalReceipt(input: CreateKnowledgeRetrievalReceiptInput): KnowledgeRetrievalReceipt;
|
|
3446
3437
|
/**
|
|
3447
3438
|
* Verify the receipt's schema, canonical digest, rank continuity, finite
|
|
3448
3439
|
* scores, and well-formed visibility reference. This proves what the receipt
|
|
@@ -3450,28 +3441,28 @@ declare function createKnowledgeRetrievalReceipt(input: CreateKnowledgeRetrieval
|
|
|
3450
3441
|
* Use `assertKnowledgeRetrievalMatchesVisibility` or
|
|
3451
3442
|
* `assertKnowledgeRetrievalMatchesVisibilityArtifact` for that join.
|
|
3452
3443
|
*/
|
|
3453
|
-
declare function verifyKnowledgeRetrievalReceipt(receipt: KnowledgeRetrievalReceipt): KnowledgeRetrievalReceipt;
|
|
3444
|
+
export declare function verifyKnowledgeRetrievalReceipt(receipt: KnowledgeRetrievalReceipt): KnowledgeRetrievalReceipt;
|
|
3454
3445
|
/**
|
|
3455
3446
|
* Prove that the receipt references exactly this snapshot and that every
|
|
3456
3447
|
* returned result occurs in it with the same page id and bytes. Pass the
|
|
3457
3448
|
* snapshot itself, or the originated pages to snapshot them first.
|
|
3458
3449
|
*/
|
|
3459
|
-
declare function assertKnowledgeRetrievalMatchesVisibility(receipt: KnowledgeRetrievalReceipt, visibility: KnowledgeVisibilitySnapshot | readonly OriginatedPage[]): void;
|
|
3450
|
+
export declare function assertKnowledgeRetrievalMatchesVisibility(receipt: KnowledgeRetrievalReceipt, visibility: KnowledgeVisibilitySnapshot | readonly OriginatedPage[]): void;
|
|
3460
3451
|
/**
|
|
3461
3452
|
* Load the snapshot artifact the receipt references, prove the stored bytes
|
|
3462
3453
|
* match the reference, and prove every returned result occurs in the decoded
|
|
3463
3454
|
* snapshot. A snapshot that cannot be obtained raises
|
|
3464
3455
|
* `KnowledgeVisibilityUnavailableError`; it is never treated as empty.
|
|
3465
3456
|
*/
|
|
3466
|
-
declare function assertKnowledgeRetrievalMatchesVisibilityArtifact(receipt: KnowledgeRetrievalReceipt, loadArtifact: KnowledgeVisibilityArtifactLoader): Promise<KnowledgeVisibilitySnapshot>;
|
|
3457
|
+
export declare function assertKnowledgeRetrievalMatchesVisibilityArtifact(receipt: KnowledgeRetrievalReceipt, loadArtifact: KnowledgeVisibilityArtifactLoader): Promise<KnowledgeVisibilitySnapshot>;
|
|
3467
3458
|
/** Create a downstream-use receipt for one exact ranked result. */
|
|
3468
|
-
declare function createKnowledgeUseReceipt(input: CreateKnowledgeUseReceiptInput): KnowledgeUseReceipt;
|
|
3459
|
+
export declare function createKnowledgeUseReceipt(input: CreateKnowledgeUseReceiptInput): KnowledgeUseReceipt;
|
|
3469
3460
|
/** Verify one use receipt against the exact retrieval that authorized it. */
|
|
3470
|
-
declare function verifyKnowledgeUseReceipt(receipt: KnowledgeUseReceipt, retrieval: KnowledgeRetrievalReceipt): KnowledgeUseReceipt;
|
|
3461
|
+
export declare function verifyKnowledgeUseReceipt(receipt: KnowledgeUseReceipt, retrieval: KnowledgeRetrievalReceipt): KnowledgeUseReceipt;
|
|
3471
3462
|
/** Record that one retrieval led to no use, with no rank to select. */
|
|
3472
|
-
declare function createKnowledgeRetrievalDisposition(input: CreateKnowledgeRetrievalDispositionInput): KnowledgeRetrievalDisposition;
|
|
3463
|
+
export declare function createKnowledgeRetrievalDisposition(input: CreateKnowledgeRetrievalDispositionInput): KnowledgeRetrievalDisposition;
|
|
3473
3464
|
/** Verify one disposition against the exact retrieval that authorized it. */
|
|
3474
|
-
declare function verifyKnowledgeRetrievalDisposition(disposition: KnowledgeRetrievalDisposition, retrieval: KnowledgeRetrievalReceipt): KnowledgeRetrievalDisposition;
|
|
3465
|
+
export declare function verifyKnowledgeRetrievalDisposition(disposition: KnowledgeRetrievalDisposition, retrieval: KnowledgeRetrievalReceipt): KnowledgeRetrievalDisposition;
|
|
3475
3466
|
//#endregion
|
|
3476
3467
|
//#region src/lexical-index.d.ts
|
|
3477
3468
|
/**
|
|
@@ -3481,10 +3472,10 @@ declare function verifyKnowledgeRetrievalDisposition(disposition: KnowledgeRetri
|
|
|
3481
3472
|
* frequency can be counted. Indexing and querying share this function, so the
|
|
3482
3473
|
* two vocabularies cannot drift.
|
|
3483
3474
|
*/
|
|
3484
|
-
declare function tokenizeText(text: string): string[];
|
|
3475
|
+
export declare function tokenizeText(text: string): string[];
|
|
3485
3476
|
/** The distinct query terms, in first-occurrence order. */
|
|
3486
|
-
declare function tokenizeQuery(query: string): string[];
|
|
3487
|
-
interface KnowledgeLexicalFieldBoosts {
|
|
3477
|
+
export declare function tokenizeQuery(query: string): string[];
|
|
3478
|
+
export interface KnowledgeLexicalFieldBoosts {
|
|
3488
3479
|
/** Multiplier for a term occurrence in the page title. Defaults to 3. */
|
|
3489
3480
|
title?: number;
|
|
3490
3481
|
/** Multiplier for a term occurrence in the page path without its extension. Defaults to 2. */
|
|
@@ -3492,12 +3483,12 @@ interface KnowledgeLexicalFieldBoosts {
|
|
|
3492
3483
|
/** Multiplier for a term occurrence in the page body. Defaults to 1. */
|
|
3493
3484
|
text?: number;
|
|
3494
3485
|
}
|
|
3495
|
-
interface KnowledgeLexicalIndexOptions {
|
|
3486
|
+
export interface KnowledgeLexicalIndexOptions {
|
|
3496
3487
|
/** Token stream of one text. Defaults to `tokenizeText`. */
|
|
3497
3488
|
tokenize?: (text: string) => string[];
|
|
3498
3489
|
fieldBoosts?: KnowledgeLexicalFieldBoosts;
|
|
3499
3490
|
}
|
|
3500
|
-
interface KnowledgeLexicalPosting {
|
|
3491
|
+
export interface KnowledgeLexicalPosting {
|
|
3501
3492
|
/** Position of the page in `KnowledgeLexicalIndex.pages`. */
|
|
3502
3493
|
ordinal: number;
|
|
3503
3494
|
/** Field-boosted term frequency in that page. */
|
|
@@ -3509,7 +3500,7 @@ interface KnowledgeLexicalPosting {
|
|
|
3509
3500
|
* Ordinals are positions in `pages`. `documentLengths` are field-boosted token
|
|
3510
3501
|
* counts, so length normalization and term frequency use one scale.
|
|
3511
3502
|
*/
|
|
3512
|
-
interface KnowledgeLexicalIndex {
|
|
3503
|
+
export interface KnowledgeLexicalIndex {
|
|
3513
3504
|
readonly pages: readonly KnowledgePage[];
|
|
3514
3505
|
readonly postings: ReadonlyMap<string, readonly KnowledgeLexicalPosting[]>;
|
|
3515
3506
|
readonly documentLengths: readonly number[];
|
|
@@ -3518,24 +3509,24 @@ interface KnowledgeLexicalIndex {
|
|
|
3518
3509
|
readonly tokenize: (text: string) => string[];
|
|
3519
3510
|
readonly fieldBoosts: Readonly<Required<KnowledgeLexicalFieldBoosts>>;
|
|
3520
3511
|
}
|
|
3521
|
-
interface Bm25Options {
|
|
3512
|
+
export interface Bm25Options {
|
|
3522
3513
|
/** Term-frequency saturation. Defaults to 1.2. */
|
|
3523
3514
|
k1?: number;
|
|
3524
3515
|
/** Length-normalization strength in [0, 1]. Defaults to 0.75. */
|
|
3525
3516
|
b?: number;
|
|
3526
3517
|
}
|
|
3527
|
-
interface Bm25Hit {
|
|
3518
|
+
export interface Bm25Hit {
|
|
3528
3519
|
page: KnowledgePage;
|
|
3529
3520
|
score: number;
|
|
3530
3521
|
}
|
|
3531
|
-
declare function buildKnowledgeLexicalIndex(pages: readonly KnowledgePage[], options?: KnowledgeLexicalIndexOptions): KnowledgeLexicalIndex;
|
|
3522
|
+
export declare function buildKnowledgeLexicalIndex(pages: readonly KnowledgePage[], options?: KnowledgeLexicalIndexOptions): KnowledgeLexicalIndex;
|
|
3532
3523
|
/**
|
|
3533
3524
|
* Okapi BM25 over the distinct query terms, with the Lucene inverse document
|
|
3534
3525
|
* frequency `ln(1 + (N - df + 0.5) / (df + 0.5))`, which is positive for every
|
|
3535
3526
|
* indexed term. Pages with no matching term are absent. The result is ordered
|
|
3536
3527
|
* by score, then by path, so it does not depend on page order.
|
|
3537
3528
|
*/
|
|
3538
|
-
declare function scoreBm25(index: KnowledgeLexicalIndex, tokens: readonly string[], options?: Bm25Options): Bm25Hit[];
|
|
3529
|
+
export declare function scoreBm25(index: KnowledgeLexicalIndex, tokens: readonly string[], options?: Bm25Options): Bm25Hit[];
|
|
3539
3530
|
//#endregion
|
|
3540
3531
|
//#region src/search.d.ts
|
|
3541
3532
|
/**
|
|
@@ -3544,8 +3535,8 @@ declare function scoreBm25(index: KnowledgeLexicalIndex, tokens: readonly string
|
|
|
3544
3535
|
* reciprocal rank fusion with link and shared-source structure. Declare it as
|
|
3545
3536
|
* the retriever id of a retrieval receipt minted from these results.
|
|
3546
3537
|
*/
|
|
3547
|
-
declare const KNOWLEDGE_SEARCH_RETRIEVER_ID = "bm25-rrf-v1";
|
|
3548
|
-
interface SearchKnowledgeOptions {
|
|
3538
|
+
export declare const KNOWLEDGE_SEARCH_RETRIEVER_ID = "bm25-rrf-v1";
|
|
3539
|
+
export interface SearchKnowledgeOptions {
|
|
3549
3540
|
/** Maximum results returned. Defaults to 10. */
|
|
3550
3541
|
limit?: number;
|
|
3551
3542
|
/** Match pages whose stable id is one of these values. */
|
|
@@ -3576,24 +3567,24 @@ interface SearchKnowledgeOptions {
|
|
|
3576
3567
|
* through the citation resolver. Later writes should persist the returned value. Keeping it at the result's top level prevents tool
|
|
3577
3568
|
* renderers from accidentally hiding the only stable handle a model can copy.
|
|
3578
3569
|
*/
|
|
3579
|
-
interface KnowledgeSearchHit extends KnowledgeSearchResult {
|
|
3570
|
+
export interface KnowledgeSearchHit extends KnowledgeSearchResult {
|
|
3580
3571
|
citationId: KnowledgeId;
|
|
3581
3572
|
}
|
|
3582
|
-
declare function searchKnowledge(index: KnowledgeIndex, query: string, limit?: number): KnowledgeSearchHit[];
|
|
3583
|
-
declare function searchKnowledge(index: KnowledgeIndex, query: string, options?: SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3573
|
+
export declare function searchKnowledge(index: KnowledgeIndex, query: string, limit?: number): KnowledgeSearchHit[];
|
|
3574
|
+
export declare function searchKnowledge(index: KnowledgeIndex, query: string, options?: SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3584
3575
|
/**
|
|
3585
3576
|
* Rank a page set that is not a built index, such as the chain a run can see.
|
|
3586
3577
|
*
|
|
3587
3578
|
* `searchKnowledge` is this function over `index.pages`, so both entry points
|
|
3588
3579
|
* rank identically and neither can drift from the other.
|
|
3589
3580
|
*/
|
|
3590
|
-
declare function searchKnowledgePages(pages: readonly KnowledgePage[], query: string, limitOrOptions?: number | SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3591
|
-
declare function reciprocalRankFusion(rankLists: string[][], k?: number): Map<string, number>;
|
|
3581
|
+
export declare function searchKnowledgePages(pages: readonly KnowledgePage[], query: string, limitOrOptions?: number | SearchKnowledgeOptions): KnowledgeSearchHit[];
|
|
3582
|
+
export declare function reciprocalRankFusion(rankLists: string[][], k?: number): Map<string, number>;
|
|
3592
3583
|
//#endregion
|
|
3593
3584
|
//#region src/knowledge-brief.d.ts
|
|
3594
3585
|
/** Pages in a brief when the caller names no limit. */
|
|
3595
|
-
declare const DEFAULT_KNOWLEDGE_BRIEF_LIMIT = 5;
|
|
3596
|
-
interface KnowledgeBriefOptions {
|
|
3586
|
+
export declare const DEFAULT_KNOWLEDGE_BRIEF_LIMIT = 5;
|
|
3587
|
+
export interface KnowledgeBriefOptions {
|
|
3597
3588
|
/** Maximum pages in the brief. Defaults to 5. */
|
|
3598
3589
|
limit?: number;
|
|
3599
3590
|
/**
|
|
@@ -3614,7 +3605,7 @@ interface KnowledgeBriefOptions {
|
|
|
3614
3605
|
*/
|
|
3615
3606
|
maxChars?: number;
|
|
3616
3607
|
}
|
|
3617
|
-
interface KnowledgeBrief {
|
|
3608
|
+
export interface KnowledgeBrief {
|
|
3618
3609
|
readonly question: string;
|
|
3619
3610
|
/** Retriever id to declare in a receipt minted from `results`. */
|
|
3620
3611
|
readonly retrieverId: typeof KNOWLEDGE_SEARCH_RETRIEVER_ID;
|
|
@@ -3638,10 +3629,10 @@ interface KnowledgeBrief {
|
|
|
3638
3629
|
* The same page set produces the same brief on every run: ranking, ordering,
|
|
3639
3630
|
* and rendering are deterministic, and no field carries a timestamp.
|
|
3640
3631
|
*/
|
|
3641
|
-
declare function buildKnowledgeBrief(visiblePages: readonly OriginatedPage[], question: string, options?: KnowledgeBriefOptions): KnowledgeBrief;
|
|
3632
|
+
export declare function buildKnowledgeBrief(visiblePages: readonly OriginatedPage[], question: string, options?: KnowledgeBriefOptions): KnowledgeBrief;
|
|
3642
3633
|
//#endregion
|
|
3643
3634
|
//#region src/knowledge-tools.d.ts
|
|
3644
|
-
interface CreateKnowledgeToolsOptions {
|
|
3635
|
+
export interface CreateKnowledgeToolsOptions {
|
|
3645
3636
|
readonly stores: RunScopedStores;
|
|
3646
3637
|
/** The run whose store is written and whose chain is read. */
|
|
3647
3638
|
readonly runId: string;
|
|
@@ -3667,14 +3658,14 @@ interface CreateKnowledgeToolsOptions {
|
|
|
3667
3658
|
* The four tools an agent needs to use a knowledge store: search, read, record,
|
|
3668
3659
|
* resolve.
|
|
3669
3660
|
*/
|
|
3670
|
-
declare function createKnowledgeTools(options: CreateKnowledgeToolsOptions): ToolDefinition[];
|
|
3661
|
+
export declare function createKnowledgeTools(options: CreateKnowledgeToolsOptions): ToolDefinition[];
|
|
3671
3662
|
//#endregion
|
|
3672
3663
|
//#region src/lint.d.ts
|
|
3673
|
-
declare function lintKnowledgeIndex(index: KnowledgeIndex): KnowledgeLintFinding[];
|
|
3664
|
+
export declare function lintKnowledgeIndex(index: KnowledgeIndex): KnowledgeLintFinding[];
|
|
3674
3665
|
//#endregion
|
|
3675
3666
|
//#region src/material-facts-metric.d.ts
|
|
3676
3667
|
/** Per-fact grade plus the fact's id/lens, for the audit trail. */
|
|
3677
|
-
interface FactResult {
|
|
3668
|
+
export interface FactResult {
|
|
3678
3669
|
id: string;
|
|
3679
3670
|
lens: CompanyEvalCase['facts'][number]['lens'];
|
|
3680
3671
|
surfaced: boolean;
|
|
@@ -3683,7 +3674,7 @@ interface FactResult {
|
|
|
3683
3674
|
foundLabels: string[];
|
|
3684
3675
|
}
|
|
3685
3676
|
/** The metric's result for one company: the surfaced fraction + the per-fact trail. */
|
|
3686
|
-
interface MaterialFactsResult {
|
|
3677
|
+
export interface MaterialFactsResult {
|
|
3687
3678
|
ticker: string;
|
|
3688
3679
|
company: string;
|
|
3689
3680
|
/** Held-out facts the KB surfaced + grounded. */
|
|
@@ -3702,14 +3693,14 @@ interface MaterialFactsResult {
|
|
|
3702
3693
|
* in spirit to `kbText` in the research-quality A/B so both metrics read a KB the
|
|
3703
3694
|
* same way.
|
|
3704
3695
|
*/
|
|
3705
|
-
declare function kbIndexToText(index: KnowledgeIndex): string;
|
|
3696
|
+
export declare function kbIndexToText(index: KnowledgeIndex): string;
|
|
3706
3697
|
/**
|
|
3707
3698
|
* Grade one company's KB against its held-out material-fact checklist, given the
|
|
3708
3699
|
* KB's already-joined text. The pure core — no I/O — so calibration can score a
|
|
3709
3700
|
* hand-written shallow/deep thesis string directly and the live path can score a
|
|
3710
3701
|
* real KB. Returns the surfaced FRACTION plus the per-fact audit trail.
|
|
3711
3702
|
*/
|
|
3712
|
-
declare function materialFactsSurfacedInText(company: CompanyEvalCase, kbText: string): MaterialFactsResult;
|
|
3703
|
+
export declare function materialFactsSurfacedInText(company: CompanyEvalCase, kbText: string): MaterialFactsResult;
|
|
3713
3704
|
/**
|
|
3714
3705
|
* `materialFactsSurfaced(kb, checklist)` — the metric in its KB-reading form.
|
|
3715
3706
|
*
|
|
@@ -3720,7 +3711,7 @@ declare function materialFactsSurfacedInText(company: CompanyEvalCase, kbText: s
|
|
|
3720
3711
|
* The checklist is HELD OUT by construction: it lives in the test eval set, is
|
|
3721
3712
|
* never passed to the loop, and is read only here, after the loop finished.
|
|
3722
3713
|
*/
|
|
3723
|
-
declare function materialFactsSurfaced(kb: string | KnowledgeIndex, checklist: CompanyEvalCase): Promise<MaterialFactsResult>;
|
|
3714
|
+
export declare function materialFactsSurfaced(kb: string | KnowledgeIndex, checklist: CompanyEvalCase): Promise<MaterialFactsResult>;
|
|
3724
3715
|
//#endregion
|
|
3725
3716
|
//#region src/mutation-lock.d.ts
|
|
3726
3717
|
interface KnowledgeMutationLock {
|
|
@@ -3796,8 +3787,8 @@ interface KnowledgeMutationHold {
|
|
|
3796
3787
|
* A caller that must decide between taking the lock and joining the one it is inside reads this
|
|
3797
3788
|
* rather than guessing; taking a held lock from inside its own scope would block against itself.
|
|
3798
3789
|
*/
|
|
3799
|
-
declare function isKnowledgeMutationHeld(root: string): boolean;
|
|
3800
|
-
declare function withKnowledgeMutation<T>(root: string, mutate: (lock: KnowledgeMutationLock) => Promise<T> | T, options?: KnowledgeMutationOptions): Promise<T>;
|
|
3790
|
+
export declare function isKnowledgeMutationHeld(root: string): boolean;
|
|
3791
|
+
export declare function withKnowledgeMutation<T>(root: string, mutate: (lock: KnowledgeMutationLock) => Promise<T> | T, options?: KnowledgeMutationOptions): Promise<T>;
|
|
3801
3792
|
/**
|
|
3802
3793
|
* Run `body` inside this package's mutation scope for `root`, on a lock the caller already holds.
|
|
3803
3794
|
*
|
|
@@ -3811,23 +3802,23 @@ declare function withKnowledgeMutation<T>(root: string, mutate: (lock: Knowledge
|
|
|
3811
3802
|
* lock the caller does not actually hold is the one way to defeat the store's single-writer rule;
|
|
3812
3803
|
* the hold is required, rather than assumed, so that is a statement the caller has to make.
|
|
3813
3804
|
*/
|
|
3814
|
-
declare function runInKnowledgeMutationScope<T>(root: string, hold: KnowledgeMutationHold, body: (lock: KnowledgeMutationLock) => Promise<T> | T, options?: KnowledgeMutationOptions): Promise<T>;
|
|
3815
|
-
declare function inspectPendingKnowledgeMutation(root: string): Promise<PendingKnowledgeMutation | null>;
|
|
3816
|
-
declare function recoverPendingKnowledgeMutation(root: string, options: RecoverPendingKnowledgeMutationOptions): Promise<void>;
|
|
3817
|
-
declare function withKnowledgeRead<T>(root: string, read: () => Promise<T> | T, options?: KnowledgeReadOptions): Promise<T>;
|
|
3805
|
+
export declare function runInKnowledgeMutationScope<T>(root: string, hold: KnowledgeMutationHold, body: (lock: KnowledgeMutationLock) => Promise<T> | T, options?: KnowledgeMutationOptions): Promise<T>;
|
|
3806
|
+
export declare function inspectPendingKnowledgeMutation(root: string): Promise<PendingKnowledgeMutation | null>;
|
|
3807
|
+
export declare function recoverPendingKnowledgeMutation(root: string, options: RecoverPendingKnowledgeMutationOptions): Promise<void>;
|
|
3808
|
+
export declare function withKnowledgeRead<T>(root: string, read: () => Promise<T> | T, options?: KnowledgeReadOptions): Promise<T>;
|
|
3818
3809
|
//#endregion
|
|
3819
3810
|
//#region src/promotion.d.ts
|
|
3820
|
-
declare const KNOWLEDGE_PROMOTION_SCHEMA_VERSION: '1.0.0';
|
|
3821
|
-
declare const KNOWLEDGE_PROMOTION_DIGEST_ALGORITHM: 'rfc8785-sha256';
|
|
3811
|
+
export declare const KNOWLEDGE_PROMOTION_SCHEMA_VERSION: '1.0.0';
|
|
3812
|
+
export declare const KNOWLEDGE_PROMOTION_DIGEST_ALGORITHM: 'rfc8785-sha256';
|
|
3822
3813
|
/** Root-relative directory holding one JSON record per promotion. */
|
|
3823
|
-
declare const KNOWLEDGE_PROMOTIONS_DIRECTORY = ".agent-knowledge/promotions";
|
|
3824
|
-
type KnowledgePromotionErrorCode = 'unknown-page' | 'ambiguous-support' | 'id-conflict' | 'path-conflict';
|
|
3814
|
+
export declare const KNOWLEDGE_PROMOTIONS_DIRECTORY = ".agent-knowledge/promotions";
|
|
3815
|
+
export type KnowledgePromotionErrorCode = 'unknown-page' | 'ambiguous-support' | 'id-conflict' | 'path-conflict';
|
|
3825
3816
|
/** A promotion that cannot be performed exactly as asked. */
|
|
3826
|
-
declare class KnowledgePromotionError extends Error {
|
|
3817
|
+
export declare class KnowledgePromotionError extends Error {
|
|
3827
3818
|
readonly code: KnowledgePromotionErrorCode;
|
|
3828
3819
|
constructor(code: KnowledgePromotionErrorCode, message: string);
|
|
3829
3820
|
}
|
|
3830
|
-
interface KnowledgePromotionEntry {
|
|
3821
|
+
export interface KnowledgePromotionEntry {
|
|
3831
3822
|
readonly pageId: KnowledgeId;
|
|
3832
3823
|
readonly path: string;
|
|
3833
3824
|
/** Where the page was read from in the source run's chain. */
|
|
@@ -3837,7 +3828,7 @@ interface KnowledgePromotionEntry {
|
|
|
3837
3828
|
readonly requested: boolean;
|
|
3838
3829
|
}
|
|
3839
3830
|
/** Immutable record of one promotion into a shared store. */
|
|
3840
|
-
interface KnowledgePromotionRecord {
|
|
3831
|
+
export interface KnowledgePromotionRecord {
|
|
3841
3832
|
readonly schemaVersion: typeof KNOWLEDGE_PROMOTION_SCHEMA_VERSION;
|
|
3842
3833
|
readonly kind: 'knowledge-promotion';
|
|
3843
3834
|
readonly digestAlgorithm: typeof KNOWLEDGE_PROMOTION_DIGEST_ALGORITHM;
|
|
@@ -3849,7 +3840,7 @@ interface KnowledgePromotionRecord {
|
|
|
3849
3840
|
/** Promoted pages first, then carried support, each group in path order. */
|
|
3850
3841
|
readonly entries: readonly KnowledgePromotionEntry[];
|
|
3851
3842
|
}
|
|
3852
|
-
interface PromoteRunScopedPagesOptions extends KnowledgePagesOptions {
|
|
3843
|
+
export interface PromoteRunScopedPagesOptions extends KnowledgePagesOptions {
|
|
3853
3844
|
/** Stable ids of the pages this run authored and wants in shared scope. */
|
|
3854
3845
|
readonly pageIds: readonly KnowledgeId[];
|
|
3855
3846
|
/** The curated store every run reads and no run writes directly. */
|
|
@@ -3871,12 +3862,12 @@ interface PromoteRunScopedPagesOptions extends KnowledgePagesOptions {
|
|
|
3871
3862
|
* mutation and the record is content-addressed, so it lands at the same path
|
|
3872
3863
|
* with the same bytes.
|
|
3873
3864
|
*/
|
|
3874
|
-
declare function promoteRunScopedPages(stores: RunScopedStores, runId: string, options: PromoteRunScopedPagesOptions): Promise<KnowledgePromotionRecord>;
|
|
3865
|
+
export declare function promoteRunScopedPages(stores: RunScopedStores, runId: string, options: PromoteRunScopedPagesOptions): Promise<KnowledgePromotionRecord>;
|
|
3875
3866
|
/** Read one promotion record written by `promoteRunScopedPages`. */
|
|
3876
|
-
declare function loadKnowledgePromotionRecord(sharedRoot: string, recordDigest: Sha256Digest): Promise<KnowledgePromotionRecord | null>;
|
|
3867
|
+
export declare function loadKnowledgePromotionRecord(sharedRoot: string, recordDigest: Sha256Digest): Promise<KnowledgePromotionRecord | null>;
|
|
3877
3868
|
//#endregion
|
|
3878
3869
|
//#region src/propose-from-finding.d.ts
|
|
3879
|
-
interface KnowledgeProposal {
|
|
3870
|
+
export interface KnowledgeProposal {
|
|
3880
3871
|
/**
|
|
3881
3872
|
* Stable id derived from the finding so cross-run diffs share an
|
|
3882
3873
|
* identity. Re-proposing the same finding produces the same id.
|
|
@@ -3907,7 +3898,7 @@ interface KnowledgeProposal {
|
|
|
3907
3898
|
analyst_id: string;
|
|
3908
3899
|
};
|
|
3909
3900
|
}
|
|
3910
|
-
declare class KnowledgeProposalParseError extends Error {
|
|
3901
|
+
export declare class KnowledgeProposalParseError extends Error {
|
|
3911
3902
|
readonly findingId: string;
|
|
3912
3903
|
readonly subject: string;
|
|
3913
3904
|
constructor(findingId: string, subject: string, message: string);
|
|
@@ -3924,21 +3915,21 @@ declare class KnowledgeProposalParseError extends Error {
|
|
|
3924
3915
|
* list and filter out the `null`s; the orchestrator passes the
|
|
3925
3916
|
* remaining proposals to the existing review / apply pipeline.
|
|
3926
3917
|
*/
|
|
3927
|
-
declare function proposeFromFinding(finding: AnalystFinding): KnowledgeProposal | null;
|
|
3918
|
+
export declare function proposeFromFinding(finding: AnalystFinding): KnowledgeProposal | null;
|
|
3928
3919
|
/**
|
|
3929
3920
|
* Plural convenience: filter + map across an entire findings batch
|
|
3930
3921
|
* with one call. Parse errors collect into `errors[]`; the loop
|
|
3931
3922
|
* decides per-error whether to abort or continue.
|
|
3932
3923
|
*/
|
|
3933
|
-
interface ProposeFromFindingsResult {
|
|
3924
|
+
export interface ProposeFromFindingsResult {
|
|
3934
3925
|
proposals: KnowledgeProposal[];
|
|
3935
3926
|
skipped: number;
|
|
3936
3927
|
errors: KnowledgeProposalParseError[];
|
|
3937
3928
|
}
|
|
3938
|
-
declare function proposeFromFindings(findings: ReadonlyArray<AnalystFinding>): ProposeFromFindingsResult;
|
|
3929
|
+
export declare function proposeFromFindings(findings: ReadonlyArray<AnalystFinding>): ProposeFromFindingsResult;
|
|
3939
3930
|
//#endregion
|
|
3940
3931
|
//#region src/readiness-check.d.ts
|
|
3941
|
-
interface EvaluateKnowledgeBaseReadinessOptions {
|
|
3932
|
+
export interface EvaluateKnowledgeBaseReadinessOptions {
|
|
3942
3933
|
root: string;
|
|
3943
3934
|
goal: string;
|
|
3944
3935
|
readinessSpecs?: readonly KnowledgeReadinessSpec[];
|
|
@@ -3947,7 +3938,7 @@ interface EvaluateKnowledgeBaseReadinessOptions {
|
|
|
3947
3938
|
strict?: ValidateKnowledgeOptions['strict'];
|
|
3948
3939
|
kbQuality?: KnowledgeBaseQualityOptions;
|
|
3949
3940
|
}
|
|
3950
|
-
interface KnowledgeBaseReadinessEvaluation {
|
|
3941
|
+
export interface KnowledgeBaseReadinessEvaluation {
|
|
3951
3942
|
ready: boolean;
|
|
3952
3943
|
summary: string;
|
|
3953
3944
|
index: KnowledgeIndex;
|
|
@@ -3960,16 +3951,16 @@ interface KnowledgeBaseReadinessEvaluation {
|
|
|
3960
3951
|
blocking_readiness: number;
|
|
3961
3952
|
};
|
|
3962
3953
|
}
|
|
3963
|
-
declare function evaluateKnowledgeBaseReadiness(options: EvaluateKnowledgeBaseReadinessOptions): Promise<KnowledgeBaseReadinessEvaluation>;
|
|
3954
|
+
export declare function evaluateKnowledgeBaseReadiness(options: EvaluateKnowledgeBaseReadinessOptions): Promise<KnowledgeBaseReadinessEvaluation>;
|
|
3964
3955
|
//#endregion
|
|
3965
3956
|
//#region src/relation-graph.d.ts
|
|
3966
|
-
type KnowledgeRelationGraphErrorCode = 'invalid-node' | 'duplicate-node' | 'invalid-relation' | 'duplicate-relation' | 'undeclared-endpoint' | 'unknown-node' | 'invalid-query';
|
|
3957
|
+
export type KnowledgeRelationGraphErrorCode = 'invalid-node' | 'duplicate-node' | 'invalid-relation' | 'duplicate-relation' | 'undeclared-endpoint' | 'unknown-node' | 'invalid-query';
|
|
3967
3958
|
/** A relation graph input or query that cannot be honored exactly. */
|
|
3968
|
-
declare class KnowledgeRelationGraphError extends Error {
|
|
3959
|
+
export declare class KnowledgeRelationGraphError extends Error {
|
|
3969
3960
|
readonly code: KnowledgeRelationGraphErrorCode;
|
|
3970
3961
|
constructor(code: KnowledgeRelationGraphErrorCode, message: string);
|
|
3971
3962
|
}
|
|
3972
|
-
interface BuildKnowledgeRelationGraphInput {
|
|
3963
|
+
export interface BuildKnowledgeRelationGraphInput {
|
|
3973
3964
|
/**
|
|
3974
3965
|
* Declared node inventory. When present, every relation endpoint must name
|
|
3975
3966
|
* one declared node; an undeclared endpoint is refused rather than added.
|
|
@@ -3982,21 +3973,21 @@ interface BuildKnowledgeRelationGraphInput {
|
|
|
3982
3973
|
* `out` follows `sourceId -> targetId`, `in` follows `targetId -> sourceId`,
|
|
3983
3974
|
* `both` follows a relation from either end.
|
|
3984
3975
|
*/
|
|
3985
|
-
type KnowledgeRelationDirection = 'out' | 'in' | 'both';
|
|
3986
|
-
interface KnowledgeRelationQuery {
|
|
3976
|
+
export type KnowledgeRelationDirection = 'out' | 'in' | 'both';
|
|
3977
|
+
export interface KnowledgeRelationQuery {
|
|
3987
3978
|
/** Restrict to relations with this predicate. Every predicate when absent. */
|
|
3988
3979
|
predicate?: string;
|
|
3989
3980
|
direction: KnowledgeRelationDirection;
|
|
3990
3981
|
}
|
|
3991
|
-
interface KnowledgeRelationWalkOptions extends KnowledgeRelationQuery {
|
|
3982
|
+
export interface KnowledgeRelationWalkOptions extends KnowledgeRelationQuery {
|
|
3992
3983
|
/** Most relations between the start node and a reported node. Unbounded when absent. */
|
|
3993
3984
|
maxDepth?: number;
|
|
3994
3985
|
}
|
|
3995
|
-
interface KnowledgeRelationNeighbor {
|
|
3986
|
+
export interface KnowledgeRelationNeighbor {
|
|
3996
3987
|
nodeId: KnowledgeId;
|
|
3997
3988
|
relation: KnowledgeRelation;
|
|
3998
3989
|
}
|
|
3999
|
-
interface KnowledgeRelationWalkStep {
|
|
3990
|
+
export interface KnowledgeRelationWalkStep {
|
|
4000
3991
|
nodeId: KnowledgeId;
|
|
4001
3992
|
/** Number of relations between the start node and this node. */
|
|
4002
3993
|
depth: number;
|
|
@@ -4013,22 +4004,22 @@ interface KnowledgeRelationWalkStep {
|
|
|
4013
4004
|
* Node and relation metadata must be finite, acyclic JSON so the graph
|
|
4014
4005
|
* round-trips through `KnowledgeRelationGraphSchema` unchanged.
|
|
4015
4006
|
*/
|
|
4016
|
-
declare function buildKnowledgeRelationGraph(input: BuildKnowledgeRelationGraphInput): KnowledgeRelationGraph;
|
|
4007
|
+
export declare function buildKnowledgeRelationGraph(input: BuildKnowledgeRelationGraphInput): KnowledgeRelationGraph;
|
|
4017
4008
|
/** Relations touching `id`, each with the node at the other end, in graph order. */
|
|
4018
|
-
declare function neighbors(graph: KnowledgeRelationGraph, id: KnowledgeId, query: KnowledgeRelationQuery): KnowledgeRelationNeighbor[];
|
|
4009
|
+
export declare function neighbors(graph: KnowledgeRelationGraph, id: KnowledgeId, query: KnowledgeRelationQuery): KnowledgeRelationNeighbor[];
|
|
4019
4010
|
/**
|
|
4020
4011
|
* Breadth-first traversal from `id` over matching relations. Each reachable
|
|
4021
4012
|
* node is reported once, at the depth where the search first reached it; the
|
|
4022
4013
|
* start node is never reported, so a cycle back to it adds no step.
|
|
4023
4014
|
*/
|
|
4024
|
-
declare function walk(graph: KnowledgeRelationGraph, id: KnowledgeId, options: KnowledgeRelationWalkOptions): KnowledgeRelationWalkStep[];
|
|
4015
|
+
export declare function walk(graph: KnowledgeRelationGraph, id: KnowledgeId, options: KnowledgeRelationWalkOptions): KnowledgeRelationWalkStep[];
|
|
4025
4016
|
/**
|
|
4026
4017
|
* Whether `to` is `from` or lies on a path of matching relations out of `from`.
|
|
4027
4018
|
*/
|
|
4028
|
-
declare function isReachable(graph: KnowledgeRelationGraph, from: KnowledgeId, to: KnowledgeId, query: KnowledgeRelationQuery): boolean;
|
|
4019
|
+
export declare function isReachable(graph: KnowledgeRelationGraph, from: KnowledgeId, to: KnowledgeId, query: KnowledgeRelationQuery): boolean;
|
|
4029
4020
|
//#endregion
|
|
4030
4021
|
//#region src/release.d.ts
|
|
4031
|
-
interface KnowledgeReleaseReport {
|
|
4022
|
+
export interface KnowledgeReleaseReport {
|
|
4032
4023
|
release: KnowledgeRelease;
|
|
4033
4024
|
scorecard: ReleaseConfidenceScorecard;
|
|
4034
4025
|
candidateRuns: RunRecord[];
|
|
@@ -4038,7 +4029,7 @@ interface KnowledgeReleaseReport {
|
|
|
4038
4029
|
* Build a knowledge release report from candidate and baseline run records,
|
|
4039
4030
|
* optional trace evidence, and an optional decision record.
|
|
4040
4031
|
*/
|
|
4041
|
-
interface KnowledgeReleaseInput {
|
|
4032
|
+
export interface KnowledgeReleaseInput {
|
|
4042
4033
|
candidateId: string;
|
|
4043
4034
|
baselineId?: string;
|
|
4044
4035
|
candidateRuns: RunRecord[];
|
|
@@ -4057,11 +4048,11 @@ interface KnowledgeReleaseInput {
|
|
|
4057
4048
|
createdAt?: string;
|
|
4058
4049
|
minScore?: number;
|
|
4059
4050
|
}
|
|
4060
|
-
declare function knowledgeReleaseReport(input: KnowledgeReleaseInput): KnowledgeReleaseReport;
|
|
4051
|
+
export declare function knowledgeReleaseReport(input: KnowledgeReleaseInput): KnowledgeReleaseReport;
|
|
4061
4052
|
//#endregion
|
|
4062
4053
|
//#region src/research-driving-driver.d.ts
|
|
4063
4054
|
/** The driver's accumulated research state — the completion oracle reads this. */
|
|
4064
|
-
interface ResearchDrivingState {
|
|
4055
|
+
export interface ResearchDrivingState {
|
|
4065
4056
|
/** Every extracted claim backed by a registered source, by id. */
|
|
4066
4057
|
claims: TrackedClaim[];
|
|
4067
4058
|
/** Every deep sub-question raised, by id. */
|
|
@@ -4077,7 +4068,7 @@ interface ResearchDrivingState {
|
|
|
4077
4068
|
/** How many rounds the driver has folded steer for. */
|
|
4078
4069
|
rounds: number;
|
|
4079
4070
|
}
|
|
4080
|
-
interface ResearchDrivingDriverOptions {
|
|
4071
|
+
export interface ResearchDrivingDriverOptions {
|
|
4081
4072
|
/** Router client for claim extraction + deep-question generation. */
|
|
4082
4073
|
router?: RouterClient;
|
|
4083
4074
|
router_options?: TangleRouterOptions;
|
|
@@ -4103,7 +4094,7 @@ interface ResearchDrivingDriverOptions {
|
|
|
4103
4094
|
* Options for the durable driver: the same driver plus a store to keep its
|
|
4104
4095
|
* belief state in.
|
|
4105
4096
|
*/
|
|
4106
|
-
interface PersistentResearchDrivingDriverOptions extends ResearchDrivingDriverOptions {
|
|
4097
|
+
export interface PersistentResearchDrivingDriverOptions extends ResearchDrivingDriverOptions {
|
|
4107
4098
|
/** Where the claim ledger is read from and written to. */
|
|
4108
4099
|
store: ClaimLedgerStore;
|
|
4109
4100
|
/**
|
|
@@ -4114,7 +4105,7 @@ interface PersistentResearchDrivingDriverOptions extends ResearchDrivingDriverOp
|
|
|
4114
4105
|
ledgerId: string;
|
|
4115
4106
|
}
|
|
4116
4107
|
/** What the driver folded into one round's worker prompt, surfaced for audit. */
|
|
4117
|
-
interface ResearchDrivingSteer {
|
|
4108
|
+
export interface ResearchDrivingSteer {
|
|
4118
4109
|
round: number;
|
|
4119
4110
|
deepQuestions: DeepQuestion[];
|
|
4120
4111
|
/** Claims it demanded corroborating/refuting evidence for this round. */
|
|
@@ -4129,7 +4120,7 @@ interface ResearchDrivingSteer {
|
|
|
4129
4120
|
* `runVerifiedResearchLoop`) PLUS a completion oracle and live state, mirroring
|
|
4130
4121
|
* how `createAdaptiveResearchDriver` exposes `stats()`.
|
|
4131
4122
|
*/
|
|
4132
|
-
interface ResearchDrivingDriver extends ResearchDriver {
|
|
4123
|
+
export interface ResearchDrivingDriver extends ResearchDriver {
|
|
4133
4124
|
/** Live snapshot of the claim ledger + deep questions. */
|
|
4134
4125
|
researchState(): ResearchDrivingState;
|
|
4135
4126
|
/**
|
|
@@ -4171,7 +4162,7 @@ interface ResearchDrivingDriver extends ResearchDriver {
|
|
|
4171
4162
|
* process does — use `createPersistentResearchDrivingDriver` when the run must
|
|
4172
4163
|
* survive a crash or resume.
|
|
4173
4164
|
*/
|
|
4174
|
-
declare function createResearchDrivingDriver(options?: ResearchDrivingDriverOptions): ResearchDrivingDriver;
|
|
4165
|
+
export declare function createResearchDrivingDriver(options?: ResearchDrivingDriverOptions): ResearchDrivingDriver;
|
|
4175
4166
|
/**
|
|
4176
4167
|
* The durable driver: same behaviour, plus its claim ledger is read from the
|
|
4177
4168
|
* store at construction and written back after every claim and every round.
|
|
@@ -4181,10 +4172,10 @@ declare function createResearchDrivingDriver(options?: ResearchDrivingDriverOpti
|
|
|
4181
4172
|
* loaded lazily would answer "nothing researched, not complete" for a run that
|
|
4182
4173
|
* had already corroborated everything.
|
|
4183
4174
|
*/
|
|
4184
|
-
declare function createPersistentResearchDrivingDriver(options: PersistentResearchDrivingDriverOptions): Promise<ResearchDrivingDriver>;
|
|
4175
|
+
export declare function createPersistentResearchDrivingDriver(options: PersistentResearchDrivingDriverOptions): Promise<ResearchDrivingDriver>;
|
|
4185
4176
|
//#endregion
|
|
4186
4177
|
//#region src/schemas.d.ts
|
|
4187
|
-
declare const SourceAnchorSchema: z.ZodObject<{
|
|
4178
|
+
export declare const SourceAnchorSchema: z.ZodObject<{
|
|
4188
4179
|
id: z.ZodString;
|
|
4189
4180
|
sourceId: z.ZodString;
|
|
4190
4181
|
label: z.ZodOptional<z.ZodString>;
|
|
@@ -4196,7 +4187,7 @@ declare const SourceAnchorSchema: z.ZodObject<{
|
|
|
4196
4187
|
timestampMs: z.ZodOptional<z.ZodNumber>;
|
|
4197
4188
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4198
4189
|
}, z.core.$strip>;
|
|
4199
|
-
declare const SourceRecordSchema: z.ZodObject<{
|
|
4190
|
+
export declare const SourceRecordSchema: z.ZodObject<{
|
|
4200
4191
|
id: z.ZodString;
|
|
4201
4192
|
uri: z.ZodString;
|
|
4202
4193
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -4220,7 +4211,7 @@ declare const SourceRecordSchema: z.ZodObject<{
|
|
|
4220
4211
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4221
4212
|
createdAt: z.ZodString;
|
|
4222
4213
|
}, z.core.$strip>;
|
|
4223
|
-
declare const KnowledgePageInvalidationSchema: z.ZodObject<{
|
|
4214
|
+
export declare const KnowledgePageInvalidationSchema: z.ZodObject<{
|
|
4224
4215
|
verdict: z.ZodLiteral<"contradicted">;
|
|
4225
4216
|
observedAt: z.ZodISODateTime;
|
|
4226
4217
|
reason: z.ZodString;
|
|
@@ -4228,7 +4219,7 @@ declare const KnowledgePageInvalidationSchema: z.ZodObject<{
|
|
|
4228
4219
|
grader: z.ZodOptional<z.ZodString>;
|
|
4229
4220
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4230
4221
|
}, z.core.$strict>;
|
|
4231
|
-
declare const KnowledgePageSchema: z.ZodObject<{
|
|
4222
|
+
export declare const KnowledgePageSchema: z.ZodObject<{
|
|
4232
4223
|
id: z.ZodString;
|
|
4233
4224
|
path: z.ZodString;
|
|
4234
4225
|
title: z.ZodString;
|
|
@@ -4248,7 +4239,7 @@ declare const KnowledgePageSchema: z.ZodObject<{
|
|
|
4248
4239
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4249
4240
|
}, z.core.$strict>>;
|
|
4250
4241
|
}, z.core.$strip>;
|
|
4251
|
-
declare const KnowledgeGraphNodeSchema: z.ZodObject<{
|
|
4242
|
+
export declare const KnowledgeGraphNodeSchema: z.ZodObject<{
|
|
4252
4243
|
id: z.ZodString;
|
|
4253
4244
|
title: z.ZodString;
|
|
4254
4245
|
path: z.ZodString;
|
|
@@ -4257,26 +4248,26 @@ declare const KnowledgeGraphNodeSchema: z.ZodObject<{
|
|
|
4257
4248
|
outDegree: z.ZodNumber;
|
|
4258
4249
|
inDegree: z.ZodNumber;
|
|
4259
4250
|
}, z.core.$strip>;
|
|
4260
|
-
declare const KnowledgeGraphEdgeSchema: z.ZodObject<{
|
|
4251
|
+
export declare const KnowledgeGraphEdgeSchema: z.ZodObject<{
|
|
4261
4252
|
source: z.ZodString;
|
|
4262
4253
|
target: z.ZodString;
|
|
4263
4254
|
weight: z.ZodNumber;
|
|
4264
4255
|
reasons: z.ZodArray<z.ZodString>;
|
|
4265
4256
|
}, z.core.$strip>;
|
|
4266
|
-
declare const KnowledgeRelationSchema: z.ZodObject<{
|
|
4257
|
+
export declare const KnowledgeRelationSchema: z.ZodObject<{
|
|
4267
4258
|
sourceId: z.ZodString;
|
|
4268
4259
|
targetId: z.ZodString;
|
|
4269
4260
|
predicate: z.ZodString;
|
|
4270
4261
|
weight: z.ZodOptional<z.ZodNumber>;
|
|
4271
4262
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4272
4263
|
}, z.core.$strip>;
|
|
4273
|
-
declare const KnowledgeRelationNodeSchema: z.ZodObject<{
|
|
4264
|
+
export declare const KnowledgeRelationNodeSchema: z.ZodObject<{
|
|
4274
4265
|
id: z.ZodString;
|
|
4275
4266
|
kind: z.ZodString;
|
|
4276
4267
|
label: z.ZodOptional<z.ZodString>;
|
|
4277
4268
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4278
4269
|
}, z.core.$strip>;
|
|
4279
|
-
declare const KnowledgeRelationGraphSchema: z.ZodObject<{
|
|
4270
|
+
export declare const KnowledgeRelationGraphSchema: z.ZodObject<{
|
|
4280
4271
|
nodes: z.ZodArray<z.ZodObject<{
|
|
4281
4272
|
id: z.ZodString;
|
|
4282
4273
|
kind: z.ZodString;
|
|
@@ -4291,7 +4282,7 @@ declare const KnowledgeRelationGraphSchema: z.ZodObject<{
|
|
|
4291
4282
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4292
4283
|
}, z.core.$strip>>;
|
|
4293
4284
|
}, z.core.$strip>;
|
|
4294
|
-
declare const KnowledgeIndexSchema: z.ZodObject<{
|
|
4285
|
+
export declare const KnowledgeIndexSchema: z.ZodObject<{
|
|
4295
4286
|
root: z.ZodString;
|
|
4296
4287
|
generatedAt: z.ZodString;
|
|
4297
4288
|
sources: z.ZodArray<z.ZodObject<{
|
|
@@ -4356,7 +4347,7 @@ declare const KnowledgeIndexSchema: z.ZodObject<{
|
|
|
4356
4347
|
}, z.core.$strip>>;
|
|
4357
4348
|
}, z.core.$strip>;
|
|
4358
4349
|
}, z.core.$strip>;
|
|
4359
|
-
declare const KnowledgeEventSchema: z.ZodObject<{
|
|
4350
|
+
export declare const KnowledgeEventSchema: z.ZodObject<{
|
|
4360
4351
|
id: z.ZodString;
|
|
4361
4352
|
type: z.ZodEnum<{
|
|
4362
4353
|
"index.built": "index.built";
|
|
@@ -4373,7 +4364,7 @@ declare const KnowledgeEventSchema: z.ZodObject<{
|
|
|
4373
4364
|
target: z.ZodOptional<z.ZodString>;
|
|
4374
4365
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
4375
4366
|
}, z.core.$strip>;
|
|
4376
|
-
declare const DeepQuestionSchema: z.ZodObject<{
|
|
4367
|
+
export declare const DeepQuestionSchema: z.ZodObject<{
|
|
4377
4368
|
kind: z.ZodEnum<{
|
|
4378
4369
|
comparative: "comparative";
|
|
4379
4370
|
contradiction: "contradiction";
|
|
@@ -4386,7 +4377,7 @@ declare const DeepQuestionSchema: z.ZodObject<{
|
|
|
4386
4377
|
addressed: z.ZodBoolean;
|
|
4387
4378
|
raisedRound: z.ZodNumber;
|
|
4388
4379
|
}, z.core.$strict>;
|
|
4389
|
-
declare const ResearchClaimRecordSchema: z.ZodObject<{
|
|
4380
|
+
export declare const ResearchClaimRecordSchema: z.ZodObject<{
|
|
4390
4381
|
id: z.ZodString;
|
|
4391
4382
|
text: z.ZodString;
|
|
4392
4383
|
supportingHosts: z.ZodArray<z.ZodString>;
|
|
@@ -4395,12 +4386,12 @@ declare const ResearchClaimRecordSchema: z.ZodObject<{
|
|
|
4395
4386
|
contested: z.ZodBoolean;
|
|
4396
4387
|
firstSeenRound: z.ZodNumber;
|
|
4397
4388
|
}, z.core.$strict>;
|
|
4398
|
-
declare const ResearchSourceVersionSchema: z.ZodObject<{
|
|
4389
|
+
export declare const ResearchSourceVersionSchema: z.ZodObject<{
|
|
4399
4390
|
sourceId: z.ZodString;
|
|
4400
4391
|
uri: z.ZodString;
|
|
4401
4392
|
contentHash: z.ZodString;
|
|
4402
4393
|
}, z.core.$strict>;
|
|
4403
|
-
declare const ResearchClaimEvidenceSchema: z.ZodObject<{
|
|
4394
|
+
export declare const ResearchClaimEvidenceSchema: z.ZodObject<{
|
|
4404
4395
|
id: z.ZodString;
|
|
4405
4396
|
claimId: z.ZodString;
|
|
4406
4397
|
text: z.ZodString;
|
|
@@ -4410,7 +4401,7 @@ declare const ResearchClaimEvidenceSchema: z.ZodObject<{
|
|
|
4410
4401
|
contradictsClaimId: z.ZodOptional<z.ZodString>;
|
|
4411
4402
|
firstSeenRound: z.ZodNumber;
|
|
4412
4403
|
}, z.core.$strict>;
|
|
4413
|
-
declare const ResearchClaimLedgerSchema: z.ZodObject<{
|
|
4404
|
+
export declare const ResearchClaimLedgerSchema: z.ZodObject<{
|
|
4414
4405
|
schemaVersion: z.ZodLiteral<2>;
|
|
4415
4406
|
id: z.ZodString;
|
|
4416
4407
|
goal: z.ZodOptional<z.ZodString>;
|
|
@@ -4455,7 +4446,7 @@ declare const ResearchClaimLedgerSchema: z.ZodObject<{
|
|
|
4455
4446
|
raisedRound: z.ZodNumber;
|
|
4456
4447
|
}, z.core.$strict>>;
|
|
4457
4448
|
}, z.core.$strict>;
|
|
4458
|
-
declare const KnowledgeBaseCandidateSchema: z.ZodObject<{
|
|
4449
|
+
export declare const KnowledgeBaseCandidateSchema: z.ZodObject<{
|
|
4459
4450
|
id: z.ZodString;
|
|
4460
4451
|
units: z.ZodArray<z.ZodObject<{
|
|
4461
4452
|
id: z.ZodString;
|
|
@@ -4498,13 +4489,13 @@ declare const KnowledgeBaseCandidateSchema: z.ZodObject<{
|
|
|
4498
4489
|
}, z.core.$strip>;
|
|
4499
4490
|
//#endregion
|
|
4500
4491
|
//#region src/wikilinks.d.ts
|
|
4501
|
-
declare const WIKILINK_REGEX: RegExp;
|
|
4502
|
-
declare function extractWikilinks(content: string): string[];
|
|
4503
|
-
declare function normalizeLinkTarget(target: string): string;
|
|
4492
|
+
export declare const WIKILINK_REGEX: RegExp;
|
|
4493
|
+
export declare function extractWikilinks(content: string): string[];
|
|
4494
|
+
export declare function normalizeLinkTarget(target: string): string;
|
|
4504
4495
|
//#endregion
|
|
4505
4496
|
//#region src/write-protocol.d.ts
|
|
4506
|
-
declare function isSafeKnowledgePath(path: string, allowedPrefixes?: string[]): boolean;
|
|
4507
|
-
declare function parseKnowledgeWriteBlocks(text: string, allowedPrefixes?: string[]): KnowledgeWriteParseResult;
|
|
4497
|
+
export declare function isSafeKnowledgePath(path: string, allowedPrefixes?: string[]): boolean;
|
|
4498
|
+
export declare function parseKnowledgeWriteBlocks(text: string, allowedPrefixes?: string[]): KnowledgeWriteParseResult;
|
|
4508
4499
|
//#endregion
|
|
4509
|
-
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, DEADLINE_EXIT_CODE, 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, GradeableClaim, GradedClaim, 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 KnowledgeMutationHold, 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, type KnowledgeStateScope, 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, canonicalPathsEqual, canonicalRelativeWithinRoot, canonicalizeUrl, chunkMarkdown, citedClaimKey, citedClaimOf, claimCheckKey, 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, gradeClaims, gradeCompanyAgainstText, gradeFactAgainstText, gradeFor, graphitiMemoryAdapterIdentity, groundClaimInText, hashKnowledgeBase, htmlToText, improveKnowledgeBase, improveSelectedKnowledgeCandidate, initKnowledgeBase, innerHtmlById, inspectKnowledgeIndex, inspectPendingKnowledgeMutation, investmentThesisSet, isKernelAnchoredPath, isKnowledgeMemoryBenchmarkCase, isKnowledgeMutationHeld, 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, normalizeKnowledgeStateScope, normalizeLinkTarget, normalizePageText, normalizePagesDirectory, optimizeKnowledgeBasePolicy, originatedPages, parseFrontmatter, parseKnowledgeBenchmarkJsonl, parseKnowledgeBenchmarkQrels, parseKnowledgeCitationReference, parseKnowledgeWriteBlocks, partitionRetrievalScenarios, planInvalidationPropagation, politeFetch, promoteKnowledgeCandidate, promoteRunScopedPages, proposeFromFinding, proposeFromFindings, ragAnswerQualityJudge, readRegularFileNoFollow, readRegularFileWithinRoot, reciprocalRankFusion, recoverPendingKnowledgeMutation, relativeWithinRoot, removeDurable, renameDurable, renderKnowledgeBenchmarkReportMarkdown, renderMemoryContext, researchSourceVersionKey, resetRetrievalHoldoutRegistry, resolveKnowledgeCitation, resolveKnowledgeCitations, resolveMemoryCleanupTimeoutMs, resolveRunScopedCitation, resolveRunScopedCitations, respondToIndustryMemoryBenchmarkSmokeCase, respondToIndustryRagBenchmarkSmokeCase, restoreKnowledgeCandidateBaseline, retrievalConfigFromSurface, retrievalConfigSurface, retrievalHoldoutConfigHash, retrievalRecallJudge, runAgentMemoryExperiment, runAgentMemoryImprovement, runAgentMemoryLearningExperiment, runBoundedMemoryLifecycle, runDiscoveryLoop, runInKnowledgeMutationScope, 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 };
|
|
4500
|
+
export { 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, type BuildAgentMemorySequencesFromBenchmarkCasesOptions, type BuildRetrievalBenchmarkCasesFromQrelsOptions, BuildRetrievalEvalDispatchOptions, ClaimRef, type CompareAgentMemoryLearningOptions, CornellLiiSelector, CornellLiiSourceOptions, CreateAgentMemoryBranchOptions, DEFAULT_MEMORY_CLEANUP_TIMEOUT_MS, DeepQuestion, DeepQuestionKind, type ExternalRagEvalScore, FetchOpts, ForkAgentMemoryBranchSnapshotOptions, FragmentProvenance, GraphitiMcpClientLike, GraphitiMemoryAdapterOptions, GraphitiToolNames, INDUSTRY_MEMORY_BENCHMARKS, INDUSTRY_RAG_BENCHMARKS, IRS_DIMENSION_HINTS, type ImproveSelectedKnowledgeCandidateOptions, type ImproveSelectedKnowledgeCandidateResult, IrsPublicationsSourceOptions, KNOWLEDGE_EVENT_TYPES, type KnowledgeAnswerBenchmarkCase, type KnowledgeAnswerBenchmarkTaskKind, KnowledgeBaseCandidate, type KnowledgeBaseQualityOptions, type KnowledgeBaseQualityReport, 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, KnowledgeClaim, type KnowledgeClaimMatcher, type KnowledgeEvaluationPhase, KnowledgeEvent, KnowledgeEventType, KnowledgeFragment, KnowledgeGraph, KnowledgeGraphEdge, KnowledgeGraphNode, KnowledgeId, type KnowledgeImprovementActivationPersistence, type KnowledgeImprovementCandidateRecord, type KnowledgeImprovementCandidateRef, type KnowledgeImprovementEvaluationInput, type KnowledgeImprovementEvaluator, type KnowledgeImprovementEvent, type KnowledgeImprovementEvidence, type KnowledgeImprovementMetric, type KnowledgeImprovementMetricProvenance, type KnowledgeImprovementMutationReceipt, type KnowledgeImprovementMutationResult, type KnowledgeImprovementOptions, type KnowledgeImprovementRagOptimizationOptions, type KnowledgeImprovementRagOptimizationRunInput, type KnowledgeImprovementResult, type KnowledgeImprovementRetrievalOptions, type KnowledgeImprovementRunState, type KnowledgeImprovementStatus, type KnowledgeImprovementTarget, type KnowledgeImprovementUpdate, type KnowledgeImprovementUpdateInput, KnowledgeIndex, KnowledgeLintFinding, type KnowledgeMemoryBenchmarkCase, type KnowledgeMemoryBenchmarkTaskKind, type KnowledgeMemoryEvent, type KnowledgeMemoryFactMatcher, type KnowledgeMutationHold, type KnowledgeMutationLock, type KnowledgeMutationOptions, KnowledgePage, KnowledgePageInvalidation, KnowledgePolicy, type KnowledgePolicyDispatch, type KnowledgeReadOptions, KnowledgeRelation, KnowledgeRelationGraph, KnowledgeRelationNode, KnowledgeRelease, type KnowledgeRetrievalBenchmarkCase, type KnowledgeRetrievalBenchmarkQrel, type KnowledgeRetrievalBenchmarkQuery, KnowledgeSearchResult, KnowledgeSource, type KnowledgeStateScope, KnowledgeUnit, KnowledgeWriteBlock, KnowledgeWriteParseResult, type LoadKnowledgeImprovementActivationResultOptions, MAX_RESPONSE_BYTES, MIN_REQUEST_GAP_MS, type MeasuredKnowledgeSelectionReceipt, Mem0ClientMode, Mem0HostedClient, Mem0HostedMemoryAdapterOptions, Mem0MemoryAdapterOptions, Mem0OssClient, Mem0OssMemoryAdapterOptions, type MemoryAdapterBenchmarkCandidate, type MemoryAdapterBenchmarkRankingRow, type MemoryConfigScenario, type NearDuplicateDetectionOptions, type NearDuplicatePair, type NearDuplicateReport, Neo4jAgentMemoryAdapterOptions, type OptimizeKnowledgeBasePolicyOptions, type OptimizeKnowledgeBasePolicyResult, OwnedAgentMemoryRunLease, POLITE_USER_AGENT, PartitionRetrievalScenariosOptions, type PendingKnowledgeMutation, PoliteFetchOptions, PoliteFetchResult, type PromoteKnowledgeCandidateOptions, type RagAnswerEvalArtifact, type RagAnswerEvalCase, type RagAnswerEvalScenario, type RagAnswerMetricSummary, type RagAnswerQualityHookOptions, type RagAnswerQualityJudgeOptions, type RagCalibrationOptions, type RagCalibrationResult, type RagEvalCitation, type RagEvalClaim, type RagEvalContext, type RagEvalMetricKey, type RagEvalProvider, type RagEvalSlice, type RagRequiredContext, type RecoverPendingKnowledgeMutationOptions, ResearchClaimEvidence, ResearchClaimLedger, ResearchClaimRecord, ResearchSourceVersion, 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, RetrievalRecallJudgeOptions, RetrievalScenarioPartitions, RetrievedKnowledgeHit, RetrievedSourceSpan, type RunAgentMemoryExperimentOptions, type RunAgentMemoryExperimentResult, type RunAgentMemoryImprovementOptions, type RunAgentMemoryImprovementResult, type RunAgentMemoryLearningExperimentOptions, type RunAgentMemoryLearningExperimentResult, type RunKnowledgeBenchmarkSuiteOptions, type RunKnowledgeBenchmarkSuiteResult, type RunMemoryAdapterBenchmarkOptions, type RunMemoryAdapterBenchmarkResult, RunSerializedKnowledgeOptimizationOptions, RunSerializedKnowledgeOptimizationResult, SerializedCandidate, SerializedCandidateCodec, SourceAnchor, SourceRecord, SourceRegistry, StateSosEntity, StateSosSourceConfig, TrackedClaim, type UseKnowledgeImprovementCandidateOptions, __resetHttpThrottle, acquireAgentMemoryRunLease, agentMemorySequenceJudge, applyRetrievalHoldout, applySessionStickyRetrievalHoldout, buildAgentMemorySequenceScenarios, buildAgentMemorySequencesFromBenchmarkCases, buildFirstPartyMemoryLifecycleBenchmarkCases, buildIndustryMemoryBenchmarkSmokeCases, buildIndustryRagBenchmarkSmokeCases, buildKnowledgeBenchmarkScenarios, buildRetrievalBenchmarkCasesFromQrels, buildRetrievalEvalDispatch, compareAgentMemoryLearning, createAgentMemoryBranch, createCornellLiiSource, createGraphitiMemoryAdapter, createInMemoryBenchmarkAdapter, createIrsPublicationsSource, createMem0MemoryAdapter, createMemoryExecutionPool, createNeo4jAgentMemoryAdapter, createNoopMemoryBenchmarkAdapter, createStateSosSource, defaultGetMemoryContext, deterministicRng, emitRetrievalHoldoutBypass, extractLinks, firstMatch, forkAgentMemoryBranchSnapshot, graphitiMemoryAdapterIdentity, htmlToText, innerHtmlById, isKnowledgeMemoryBenchmarkCase, jsonCandidateCodec, jsonObjectCandidateCodec, knowledgeBenchmarkJudge, looksLikeBlockPage, mem0MemoryAdapterIdentity, memoryHitToSourceRecord, memoryRecoveryDelayMs, memoryWriteResultToSourceRecord, parseKnowledgeBenchmarkJsonl, parseKnowledgeBenchmarkQrels, partitionRetrievalScenarios, politeFetch, renderKnowledgeBenchmarkReportMarkdown, renderMemoryContext, resetRetrievalHoldoutRegistry, resolveMemoryCleanupTimeoutMs, respondToIndustryMemoryBenchmarkSmokeCase, respondToIndustryRagBenchmarkSmokeCase, retrievalConfigFromSurface, retrievalConfigSurface, retrievalHoldoutConfigHash, retrievalRecallJudge, runAgentMemoryExperiment, runAgentMemoryImprovement, runAgentMemoryLearningExperiment, runBoundedMemoryLifecycle, runKnowledgeBenchmarkSuite, runMemoryAdapterBenchmark, runSerializedKnowledgeOptimization, scenarioContentFingerprint, scoreKnowledgeBenchmarkArtifact, scoreMemoryBenchmarkArtifact, scoreRetrievalArtifact, sleepForMemoryRecovery, summarizeKnowledgeBenchmarkCampaign, toOffPolicyTrajectory };
|
|
4510
4501
|
//# sourceMappingURL=index.d.ts.map
|