digdig 0.0.1 → 0.0.3
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/README.md +437 -2
- package/digdig.config.example.json +14 -0
- package/dist/claims/deterministic-checks.d.ts +48 -0
- package/dist/claims/deterministic-checks.d.ts.map +1 -0
- package/dist/claims/deterministic-checks.js +162 -0
- package/dist/claims/deterministic-checks.js.map +1 -0
- package/dist/claims/policy.d.ts +25 -0
- package/dist/claims/policy.d.ts.map +1 -0
- package/dist/claims/policy.js +168 -0
- package/dist/claims/policy.js.map +1 -0
- package/dist/claims/store.d.ts +37 -0
- package/dist/claims/store.d.ts.map +1 -0
- package/dist/claims/store.js +152 -0
- package/dist/claims/store.js.map +1 -0
- package/dist/claims/types.d.ts +98 -0
- package/dist/claims/types.d.ts.map +1 -0
- package/dist/claims/types.js +9 -0
- package/dist/claims/types.js.map +1 -0
- package/dist/commands/claim.d.ts +13 -0
- package/dist/commands/claim.d.ts.map +1 -0
- package/dist/commands/claim.js +131 -0
- package/dist/commands/claim.js.map +1 -0
- package/dist/commands/coverage.d.ts +7 -0
- package/dist/commands/coverage.d.ts.map +1 -0
- package/dist/commands/coverage.js +78 -0
- package/dist/commands/coverage.js.map +1 -0
- package/dist/commands/doc-index.d.ts +12 -0
- package/dist/commands/doc-index.d.ts.map +1 -0
- package/dist/commands/doc-index.js +49 -0
- package/dist/commands/doc-index.js.map +1 -0
- package/dist/commands/doc-search.d.ts +16 -0
- package/dist/commands/doc-search.d.ts.map +1 -0
- package/dist/commands/doc-search.js +41 -0
- package/dist/commands/doc-search.js.map +1 -0
- package/dist/commands/evidence.d.ts +20 -0
- package/dist/commands/evidence.d.ts.map +1 -0
- package/dist/commands/evidence.js +215 -0
- package/dist/commands/evidence.js.map +1 -0
- package/dist/commands/extract.d.ts +10 -0
- package/dist/commands/extract.d.ts.map +1 -0
- package/dist/commands/extract.js +77 -0
- package/dist/commands/extract.js.map +1 -0
- package/dist/commands/graph-add.d.ts +7 -0
- package/dist/commands/graph-add.d.ts.map +1 -0
- package/dist/commands/graph-add.js +93 -0
- package/dist/commands/graph-add.js.map +1 -0
- package/dist/commands/graph-drill.d.ts +11 -0
- package/dist/commands/graph-drill.d.ts.map +1 -0
- package/dist/commands/graph-drill.js +26 -0
- package/dist/commands/graph-drill.js.map +1 -0
- package/dist/commands/graph-explore.d.ts +10 -0
- package/dist/commands/graph-explore.d.ts.map +1 -0
- package/dist/commands/graph-explore.js +32 -0
- package/dist/commands/graph-explore.js.map +1 -0
- package/dist/commands/graph-obfuscate.d.ts +17 -0
- package/dist/commands/graph-obfuscate.d.ts.map +1 -0
- package/dist/commands/graph-obfuscate.js +110 -0
- package/dist/commands/graph-obfuscate.js.map +1 -0
- package/dist/commands/graph-search.d.ts +11 -0
- package/dist/commands/graph-search.d.ts.map +1 -0
- package/dist/commands/graph-search.js +19 -0
- package/dist/commands/graph-search.js.map +1 -0
- package/dist/commands/graph-traverse.d.ts +10 -0
- package/dist/commands/graph-traverse.d.ts.map +1 -0
- package/dist/commands/graph-traverse.js +39 -0
- package/dist/commands/graph-traverse.js.map +1 -0
- package/dist/commands/json-input.d.ts +18 -0
- package/dist/commands/json-input.d.ts.map +1 -0
- package/dist/commands/json-input.js +50 -0
- package/dist/commands/json-input.js.map +1 -0
- package/dist/commands/query-graph.d.ts +13 -0
- package/dist/commands/query-graph.d.ts.map +1 -0
- package/dist/commands/query-graph.js +219 -0
- package/dist/commands/query-graph.js.map +1 -0
- package/dist/commands/results-add.d.ts +10 -0
- package/dist/commands/results-add.d.ts.map +1 -0
- package/dist/commands/results-add.js +80 -0
- package/dist/commands/results-add.js.map +1 -0
- package/dist/commands/review.d.ts +12 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +119 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/session.d.ts +28 -0
- package/dist/commands/session.d.ts.map +1 -0
- package/dist/commands/session.js +149 -0
- package/dist/commands/session.js.map +1 -0
- package/dist/commands/verdict.d.ts +9 -0
- package/dist/commands/verdict.d.ts.map +1 -0
- package/dist/commands/verdict.js +40 -0
- package/dist/commands/verdict.js.map +1 -0
- package/dist/config.d.ts +28 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +148 -0
- package/dist/config.js.map +1 -0
- package/dist/deep/co-occurrence.d.ts +50 -0
- package/dist/deep/co-occurrence.d.ts.map +1 -0
- package/dist/deep/co-occurrence.js +95 -0
- package/dist/deep/co-occurrence.js.map +1 -0
- package/dist/deep/coverage.d.ts +81 -0
- package/dist/deep/coverage.d.ts.map +1 -0
- package/dist/deep/coverage.js +183 -0
- package/dist/deep/coverage.js.map +1 -0
- package/dist/deep/dedupe.d.ts +27 -0
- package/dist/deep/dedupe.d.ts.map +1 -0
- package/dist/deep/dedupe.js +115 -0
- package/dist/deep/dedupe.js.map +1 -0
- package/dist/deep/degree-utils.d.ts +39 -0
- package/dist/deep/degree-utils.d.ts.map +1 -0
- package/dist/deep/degree-utils.js +42 -0
- package/dist/deep/degree-utils.js.map +1 -0
- package/dist/deep/extractor.d.ts +42 -0
- package/dist/deep/extractor.d.ts.map +1 -0
- package/dist/deep/extractor.js +392 -0
- package/dist/deep/extractor.js.map +1 -0
- package/dist/deep/fuse.d.ts +63 -0
- package/dist/deep/fuse.d.ts.map +1 -0
- package/dist/deep/fuse.js +108 -0
- package/dist/deep/fuse.js.map +1 -0
- package/dist/deep/graph-explore.d.ts +115 -0
- package/dist/deep/graph-explore.d.ts.map +1 -0
- package/dist/deep/graph-explore.js +588 -0
- package/dist/deep/graph-explore.js.map +1 -0
- package/dist/deep/graph-obfuscate.d.ts +51 -0
- package/dist/deep/graph-obfuscate.d.ts.map +1 -0
- package/dist/deep/graph-obfuscate.js +226 -0
- package/dist/deep/graph-obfuscate.js.map +1 -0
- package/dist/deep/graph-preprocess.d.ts +48 -0
- package/dist/deep/graph-preprocess.d.ts.map +1 -0
- package/dist/deep/graph-preprocess.js +40 -0
- package/dist/deep/graph-preprocess.js.map +1 -0
- package/dist/deep/graph-sampling.d.ts +51 -0
- package/dist/deep/graph-sampling.d.ts.map +1 -0
- package/dist/deep/graph-sampling.js +410 -0
- package/dist/deep/graph-sampling.js.map +1 -0
- package/dist/deep/graph.d.ts +87 -0
- package/dist/deep/graph.d.ts.map +1 -0
- package/dist/deep/graph.js +200 -0
- package/dist/deep/graph.js.map +1 -0
- package/dist/deep/index.d.ts +10 -0
- package/dist/deep/index.d.ts.map +1 -0
- package/dist/deep/index.js +10 -0
- package/dist/deep/index.js.map +1 -0
- package/dist/deep/iteration-data.d.ts +34 -0
- package/dist/deep/iteration-data.d.ts.map +1 -0
- package/dist/deep/iteration-data.js +45 -0
- package/dist/deep/iteration-data.js.map +1 -0
- package/dist/deep/local-doc/indexer.d.ts +26 -0
- package/dist/deep/local-doc/indexer.d.ts.map +1 -0
- package/dist/deep/local-doc/indexer.js +420 -0
- package/dist/deep/local-doc/indexer.js.map +1 -0
- package/dist/deep/local-doc/scanner.d.ts +10 -0
- package/dist/deep/local-doc/scanner.d.ts.map +1 -0
- package/dist/deep/local-doc/scanner.js +165 -0
- package/dist/deep/local-doc/scanner.js.map +1 -0
- package/dist/deep/local-doc/searcher.d.ts +38 -0
- package/dist/deep/local-doc/searcher.d.ts.map +1 -0
- package/dist/deep/local-doc/searcher.js +211 -0
- package/dist/deep/local-doc/searcher.js.map +1 -0
- package/dist/deep/local-doc/types.d.ts +61 -0
- package/dist/deep/local-doc/types.d.ts.map +1 -0
- package/dist/deep/local-doc/types.js +18 -0
- package/dist/deep/local-doc/types.js.map +1 -0
- package/dist/deep/path-extraction.d.ts +53 -0
- package/dist/deep/path-extraction.d.ts.map +1 -0
- package/dist/deep/path-extraction.js +229 -0
- package/dist/deep/path-extraction.js.map +1 -0
- package/dist/deep/pending-facts.d.ts +64 -0
- package/dist/deep/pending-facts.d.ts.map +1 -0
- package/dist/deep/pending-facts.js +74 -0
- package/dist/deep/pending-facts.js.map +1 -0
- package/dist/deep/query-redundancy.d.ts +52 -0
- package/dist/deep/query-redundancy.d.ts.map +1 -0
- package/dist/deep/query-redundancy.js +122 -0
- package/dist/deep/query-redundancy.js.map +1 -0
- package/dist/deep/query-suggest.d.ts +33 -0
- package/dist/deep/query-suggest.d.ts.map +1 -0
- package/dist/deep/query-suggest.js +90 -0
- package/dist/deep/query-suggest.js.map +1 -0
- package/dist/deep/rrf.d.ts +13 -0
- package/dist/deep/rrf.d.ts.map +1 -0
- package/dist/deep/rrf.js +23 -0
- package/dist/deep/rrf.js.map +1 -0
- package/dist/deep/search-strategy.d.ts +37 -0
- package/dist/deep/search-strategy.d.ts.map +1 -0
- package/dist/deep/search-strategy.js +106 -0
- package/dist/deep/search-strategy.js.map +1 -0
- package/dist/deep/session.d.ts +182 -0
- package/dist/deep/session.d.ts.map +1 -0
- package/dist/deep/session.js +663 -0
- package/dist/deep/session.js.map +1 -0
- package/dist/deep/simhash.d.ts +17 -0
- package/dist/deep/simhash.d.ts.map +1 -0
- package/dist/deep/simhash.js +72 -0
- package/dist/deep/simhash.js.map +1 -0
- package/dist/deep/tfidf.d.ts +38 -0
- package/dist/deep/tfidf.d.ts.map +1 -0
- package/dist/deep/tfidf.js +103 -0
- package/dist/deep/tfidf.js.map +1 -0
- package/dist/deepseek-service.d.ts +22 -0
- package/dist/deepseek-service.d.ts.map +1 -0
- package/dist/deepseek-service.js +84 -0
- package/dist/deepseek-service.js.map +1 -0
- package/dist/entry.d.ts +14 -0
- package/dist/entry.d.ts.map +1 -0
- package/dist/entry.js +29 -0
- package/dist/entry.js.map +1 -0
- package/dist/errors.d.ts +76 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +117 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/init.d.ts +16 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +143 -0
- package/dist/init.js.map +1 -0
- package/dist/legacy.d.ts +60 -0
- package/dist/legacy.d.ts.map +1 -0
- package/dist/legacy.js +119 -0
- package/dist/legacy.js.map +1 -0
- package/dist/ollama-service.d.ts +22 -0
- package/dist/ollama-service.d.ts.map +1 -0
- package/dist/ollama-service.js +71 -0
- package/dist/ollama-service.js.map +1 -0
- package/dist/protocol.d.ts +23 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +26 -0
- package/dist/protocol.js.map +1 -0
- package/dist/runCli.d.ts +8 -0
- package/dist/runCli.d.ts.map +1 -0
- package/dist/runCli.js +1356 -0
- package/dist/runCli.js.map +1 -0
- package/dist/service.d.ts +73 -0
- package/dist/service.d.ts.map +1 -0
- package/dist/service.js +145 -0
- package/dist/service.js.map +1 -0
- package/dist/sxng.d.ts +11 -0
- package/dist/sxng.d.ts.map +1 -0
- package/dist/sxng.js +14 -0
- package/dist/sxng.js.map +1 -0
- package/package.json +56 -12
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pending-approval list, as countable facts.
|
|
3
|
+
*
|
|
4
|
+
* This module replaced the quality verdict. What a verdict did was answer
|
|
5
|
+
* "is this batch good", and it could not: the numbers behind it were measured
|
|
6
|
+
* against thresholds that 5 of 7 real sessions failed, one indicator compared
|
|
7
|
+
* titles while believing it compared bodies, and nothing ever acted on the
|
|
8
|
+
* answer. What is left is what a reviewer actually reads — how many results
|
|
9
|
+
* there are, how many carry a body, where they came from — plus the per-result
|
|
10
|
+
* fields needed to approve one.
|
|
11
|
+
*
|
|
12
|
+
* The judgement "is that enough" stays with the caller. It depends on what was
|
|
13
|
+
* asked, which this module does not know.
|
|
14
|
+
*/
|
|
15
|
+
import { SessionResult } from './session.js';
|
|
16
|
+
export interface PendingFact {
|
|
17
|
+
id: string;
|
|
18
|
+
revision: number;
|
|
19
|
+
title?: string;
|
|
20
|
+
url: string;
|
|
21
|
+
/** The tool that produced the result: `digdig`, `exa`, `tavily`, ... */
|
|
22
|
+
source: string;
|
|
23
|
+
/** Where it came from — hostname, or a local document's path. */
|
|
24
|
+
domain?: string;
|
|
25
|
+
/** Length of the extracted body. Zero means nothing was extracted. */
|
|
26
|
+
contentLength: number;
|
|
27
|
+
/** Whether the record carries a body at all. */
|
|
28
|
+
extracted: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the record carries everything approval requires. Stricter than
|
|
31
|
+
* `extracted`: a body without extractor metadata is readable but not
|
|
32
|
+
* approvable, and the two are worth telling apart.
|
|
33
|
+
*/
|
|
34
|
+
verified: boolean;
|
|
35
|
+
/** First round that saw it; absent on a session predating round tracking. */
|
|
36
|
+
round?: number;
|
|
37
|
+
}
|
|
38
|
+
export interface PendingReport {
|
|
39
|
+
total: number;
|
|
40
|
+
extracted: number;
|
|
41
|
+
unextracted: number;
|
|
42
|
+
/** Distinct sources across the whole session. */
|
|
43
|
+
sources: number;
|
|
44
|
+
sourceList: string[];
|
|
45
|
+
pending: PendingFact[];
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Describe one result.
|
|
49
|
+
*
|
|
50
|
+
* `contentLength` is the body length, not a display fallback: a search result
|
|
51
|
+
* keeps its snippet in `excerpt` and has no `content` until an extractor runs,
|
|
52
|
+
* so reading `content || excerpt` here would report an unextracted result as
|
|
53
|
+
* though it had been read.
|
|
54
|
+
*/
|
|
55
|
+
export declare function describeResult(result: SessionResult): PendingFact;
|
|
56
|
+
/**
|
|
57
|
+
* Build the report for a session.
|
|
58
|
+
*
|
|
59
|
+
* Counts cover every stored result, because "how much has this session
|
|
60
|
+
* gathered" is the question the counts answer. `pending` covers only the
|
|
61
|
+
* records awaiting a decision, which is what the caller can act on.
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildPendingReport(results: SessionResult[], pending: SessionResult[]): PendingReport;
|
|
64
|
+
//# sourceMappingURL=pending-facts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-facts.d.ts","sourceRoot":"","sources":["../../src/deep/pending-facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAEjE,MAAM,WAAW,WAAW;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sEAAsE;IACtE,aAAa,EAAE,MAAM,CAAC;IACtB,gDAAgD;IAChD,SAAS,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,WAAW,EAAE,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,WAAW,CAsBjE;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,aAAa,CAkBpG"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The pending-approval list, as countable facts.
|
|
3
|
+
*
|
|
4
|
+
* This module replaced the quality verdict. What a verdict did was answer
|
|
5
|
+
* "is this batch good", and it could not: the numbers behind it were measured
|
|
6
|
+
* against thresholds that 5 of 7 real sessions failed, one indicator compared
|
|
7
|
+
* titles while believing it compared bodies, and nothing ever acted on the
|
|
8
|
+
* answer. What is left is what a reviewer actually reads — how many results
|
|
9
|
+
* there are, how many carry a body, where they came from — plus the per-result
|
|
10
|
+
* fields needed to approve one.
|
|
11
|
+
*
|
|
12
|
+
* The judgement "is that enough" stays with the caller. It depends on what was
|
|
13
|
+
* asked, which this module does not know.
|
|
14
|
+
*/
|
|
15
|
+
import { sourceKey } from './dedupe.js';
|
|
16
|
+
import { firstRound } from './coverage.js';
|
|
17
|
+
import { hasVerifiedContent } from './session.js';
|
|
18
|
+
/**
|
|
19
|
+
* Describe one result.
|
|
20
|
+
*
|
|
21
|
+
* `contentLength` is the body length, not a display fallback: a search result
|
|
22
|
+
* keeps its snippet in `excerpt` and has no `content` until an extractor runs,
|
|
23
|
+
* so reading `content || excerpt` here would report an unextracted result as
|
|
24
|
+
* though it had been read.
|
|
25
|
+
*/
|
|
26
|
+
export function describeResult(result) {
|
|
27
|
+
const fact = {
|
|
28
|
+
id: result.id,
|
|
29
|
+
revision: result.revision,
|
|
30
|
+
url: result.url,
|
|
31
|
+
source: typeof result.source === 'string' && result.source ? result.source : 'digdig',
|
|
32
|
+
contentLength: result.content?.length ?? 0,
|
|
33
|
+
extracted: typeof result.content === 'string' && result.content.trim().length > 0,
|
|
34
|
+
verified: hasVerifiedContent(result),
|
|
35
|
+
};
|
|
36
|
+
if (result.title)
|
|
37
|
+
fact.title = result.title;
|
|
38
|
+
const domain = sourceKey(result.url);
|
|
39
|
+
if (domain)
|
|
40
|
+
fact.domain = domain;
|
|
41
|
+
// Absent rather than zero: a session stored before rounds existed has no
|
|
42
|
+
// round to report, and `0` would read as "round zero".
|
|
43
|
+
const round = firstRound(result);
|
|
44
|
+
if (round !== undefined)
|
|
45
|
+
fact.round = round;
|
|
46
|
+
return fact;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Build the report for a session.
|
|
50
|
+
*
|
|
51
|
+
* Counts cover every stored result, because "how much has this session
|
|
52
|
+
* gathered" is the question the counts answer. `pending` covers only the
|
|
53
|
+
* records awaiting a decision, which is what the caller can act on.
|
|
54
|
+
*/
|
|
55
|
+
export function buildPendingReport(results, pending) {
|
|
56
|
+
const sources = new Set();
|
|
57
|
+
let extracted = 0;
|
|
58
|
+
for (const result of results) {
|
|
59
|
+
const source = sourceKey(result.url);
|
|
60
|
+
if (source)
|
|
61
|
+
sources.add(source);
|
|
62
|
+
if (typeof result.content === 'string' && result.content.trim().length > 0)
|
|
63
|
+
extracted++;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
total: results.length,
|
|
67
|
+
extracted,
|
|
68
|
+
unextracted: results.length - extracted,
|
|
69
|
+
sources: sources.size,
|
|
70
|
+
sourceList: [...sources].sort(),
|
|
71
|
+
pending: pending.map(describeResult),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=pending-facts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending-facts.js","sourceRoot":"","sources":["../../src/deep/pending-facts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAiB,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAmCjE;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,MAAqB;IAChD,MAAM,IAAI,GAAgB;QACtB,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,MAAM,EAAE,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ;QACrF,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;QAC1C,SAAS,EAAE,OAAO,MAAM,CAAC,O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AE;QAC/B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC;KACvC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query redundancy detection via Jaccard similarity.
|
|
3
|
+
*
|
|
4
|
+
* Before executing a new query, compare it against all historical queries
|
|
5
|
+
* in the session. If similarity exceeds a threshold, take action:
|
|
6
|
+
* - warn: output warning, proceed with search
|
|
7
|
+
* - adjust: auto-remove overlapping terms, add differentiation
|
|
8
|
+
* - skip: skip redundant query entirely
|
|
9
|
+
*
|
|
10
|
+
* Short queries (≤2 words) use character-level bigram Jaccard to avoid
|
|
11
|
+
* low similarity from minor word differences. Longer queries use word-level Jaccard.
|
|
12
|
+
*
|
|
13
|
+
* Since bigram and word Jaccard have different sensitivity scales, each algorithm
|
|
14
|
+
* uses its own threshold (jaccardThreshold for word-level, bigramThreshold for bigram).
|
|
15
|
+
* This prevents short queries from being systematically under-detected.
|
|
16
|
+
*/
|
|
17
|
+
export interface RedundancyConfig {
|
|
18
|
+
jaccardThreshold: number;
|
|
19
|
+
bigramThreshold?: number;
|
|
20
|
+
action: 'warn' | 'adjust' | 'skip';
|
|
21
|
+
}
|
|
22
|
+
export interface JaccardResult {
|
|
23
|
+
score: number;
|
|
24
|
+
algorithm: 'bigram' | 'word';
|
|
25
|
+
}
|
|
26
|
+
export interface RedundancyResult {
|
|
27
|
+
isRedundant: boolean;
|
|
28
|
+
maxSimilarity: number;
|
|
29
|
+
similarQueries: Array<{
|
|
30
|
+
query: string;
|
|
31
|
+
similarity: number;
|
|
32
|
+
}>;
|
|
33
|
+
adjustedQuery?: string;
|
|
34
|
+
action: RedundancyConfig['action'];
|
|
35
|
+
}
|
|
36
|
+
/** Compute Jaccard similarity between two queries with algorithm metadata.
|
|
37
|
+
* - ≤2 words: character-level bigram Jaccard (case-insensitive)
|
|
38
|
+
* - >2 words: word-level Jaccard (case-insensitive) */
|
|
39
|
+
export declare function computeJaccardWithMeta(a: string, b: string): JaccardResult;
|
|
40
|
+
/** Compute Jaccard similarity between two queries (score only, backward-compatible). */
|
|
41
|
+
export declare function computeJaccard(a: string, b: string): number;
|
|
42
|
+
/** Adjust a redundant query by removing overlapping terms and adding differentiation.
|
|
43
|
+
* Returns the adjusted query string, or the original if no adjustment is possible. */
|
|
44
|
+
export declare function adjustQuery(newQuery: string, similarQueries: Array<{
|
|
45
|
+
query: string;
|
|
46
|
+
similarity: number;
|
|
47
|
+
}>): string;
|
|
48
|
+
/** Check a new query against session history for redundancy.
|
|
49
|
+
* Uses algorithm-aware thresholding: word-level comparisons use jaccardThreshold,
|
|
50
|
+
* bigram comparisons use bigramThreshold (falls back to jaccardThreshold if unset). */
|
|
51
|
+
export declare function checkQueryRedundancy(newQuery: string, sessionHistory: string[], config: RedundancyConfig): RedundancyResult;
|
|
52
|
+
//# sourceMappingURL=query-redundancy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-redundancy.d.ts","sourceRoot":"","sources":["../../src/deep/query-redundancy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,MAAM,WAAW,gBAAgB;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,QAAQ,GAAG,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;CACtC;AA6BD;;wDAEwD;AACxD,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa,CAoB1E;AAED,wFAAwF;AACxF,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3D;AAID;uFACuF;AACvF,wBAAgB,WAAW,CACvB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC,GAC7D,MAAM,CAwBR;AAID;;wFAEwF;AACxF,wBAAgB,oBAAoB,CAChC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EAAE,EACxB,MAAM,EAAE,gBAAgB,GACzB,gBAAgB,CA8BlB"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query redundancy detection via Jaccard similarity.
|
|
3
|
+
*
|
|
4
|
+
* Before executing a new query, compare it against all historical queries
|
|
5
|
+
* in the session. If similarity exceeds a threshold, take action:
|
|
6
|
+
* - warn: output warning, proceed with search
|
|
7
|
+
* - adjust: auto-remove overlapping terms, add differentiation
|
|
8
|
+
* - skip: skip redundant query entirely
|
|
9
|
+
*
|
|
10
|
+
* Short queries (≤2 words) use character-level bigram Jaccard to avoid
|
|
11
|
+
* low similarity from minor word differences. Longer queries use word-level Jaccard.
|
|
12
|
+
*
|
|
13
|
+
* Since bigram and word Jaccard have different sensitivity scales, each algorithm
|
|
14
|
+
* uses its own threshold (jaccardThreshold for word-level, bigramThreshold for bigram).
|
|
15
|
+
* This prevents short queries from being systematically under-detected.
|
|
16
|
+
*/
|
|
17
|
+
// ── Jaccard computation ───────────────────────────────────────────
|
|
18
|
+
/** Generate character-level bigrams from a string. */
|
|
19
|
+
function charBigrams(s) {
|
|
20
|
+
const bigrams = new Set();
|
|
21
|
+
for (let i = 0; i < s.length - 1; i++) {
|
|
22
|
+
bigrams.add(s.slice(i, i + 2));
|
|
23
|
+
}
|
|
24
|
+
return bigrams;
|
|
25
|
+
}
|
|
26
|
+
/** Compute Jaccard similarity between two sets. */
|
|
27
|
+
function setJaccard(a, b) {
|
|
28
|
+
if (a.size === 0 && b.size === 0)
|
|
29
|
+
return 0;
|
|
30
|
+
let intersection = 0;
|
|
31
|
+
for (const item of a) {
|
|
32
|
+
if (b.has(item))
|
|
33
|
+
intersection++;
|
|
34
|
+
}
|
|
35
|
+
const union = a.size + b.size - intersection;
|
|
36
|
+
return union === 0 ? 0 : intersection / union;
|
|
37
|
+
}
|
|
38
|
+
/** Count words in a string (split by whitespace). */
|
|
39
|
+
function wordCount(s) {
|
|
40
|
+
return s.trim().split(/\s+/).filter(Boolean).length;
|
|
41
|
+
}
|
|
42
|
+
/** Compute Jaccard similarity between two queries with algorithm metadata.
|
|
43
|
+
* - ≤2 words: character-level bigram Jaccard (case-insensitive)
|
|
44
|
+
* - >2 words: word-level Jaccard (case-insensitive) */
|
|
45
|
+
export function computeJaccardWithMeta(a, b) {
|
|
46
|
+
const aLower = a.toLowerCase().trim();
|
|
47
|
+
const bLower = b.toLowerCase().trim();
|
|
48
|
+
if (aLower === bLower) {
|
|
49
|
+
return { score: aLower.length > 0 ? 1 : 0, algorithm: 'word' };
|
|
50
|
+
}
|
|
51
|
+
if (wordCount(a) <= 2 || wordCount(b) <= 2) {
|
|
52
|
+
// Short query: character-level bigram Jaccard
|
|
53
|
+
const bgA = charBigrams(aLower);
|
|
54
|
+
const bgB = charBigrams(bLower);
|
|
55
|
+
if (bgA.size === 0 || bgB.size === 0)
|
|
56
|
+
return { score: 0, algorithm: 'bigram' };
|
|
57
|
+
return { score: setJaccard(bgA, bgB), algorithm: 'bigram' };
|
|
58
|
+
}
|
|
59
|
+
// Long query: word-level Jaccard
|
|
60
|
+
const setA = new Set(aLower.split(/\s+/).filter(Boolean));
|
|
61
|
+
const setB = new Set(bLower.split(/\s+/).filter(Boolean));
|
|
62
|
+
return { score: setJaccard(setA, setB), algorithm: 'word' };
|
|
63
|
+
}
|
|
64
|
+
/** Compute Jaccard similarity between two queries (score only, backward-compatible). */
|
|
65
|
+
export function computeJaccard(a, b) {
|
|
66
|
+
return computeJaccardWithMeta(a, b).score;
|
|
67
|
+
}
|
|
68
|
+
// ── Query adjustment ──────────────────────────────────────────────
|
|
69
|
+
/** Adjust a redundant query by removing overlapping terms and adding differentiation.
|
|
70
|
+
* Returns the adjusted query string, or the original if no adjustment is possible. */
|
|
71
|
+
export function adjustQuery(newQuery, similarQueries) {
|
|
72
|
+
const newWords = newQuery.toLowerCase().split(/\s+/).filter(Boolean);
|
|
73
|
+
// Collect all overlapping words from similar queries
|
|
74
|
+
const overlappingWords = new Set();
|
|
75
|
+
for (const sq of similarQueries) {
|
|
76
|
+
const sqWords = sq.query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
77
|
+
for (const w of sqWords) {
|
|
78
|
+
if (newWords.includes(w)) {
|
|
79
|
+
overlappingWords.add(w);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
// Keep non-overlapping words
|
|
84
|
+
const keptWords = newQuery.split(/\s+/).filter(w => !overlappingWords.has(w.toLowerCase()));
|
|
85
|
+
if (keptWords.length === 0) {
|
|
86
|
+
// All words overlap — can't adjust, return original
|
|
87
|
+
return newQuery;
|
|
88
|
+
}
|
|
89
|
+
// Add a differentiation marker to signal this is a refined query
|
|
90
|
+
return keptWords.join(' ');
|
|
91
|
+
}
|
|
92
|
+
// ── Main redundancy check ────────────────────────────────────────
|
|
93
|
+
/** Check a new query against session history for redundancy.
|
|
94
|
+
* Uses algorithm-aware thresholding: word-level comparisons use jaccardThreshold,
|
|
95
|
+
* bigram comparisons use bigramThreshold (falls back to jaccardThreshold if unset). */
|
|
96
|
+
export function checkQueryRedundancy(newQuery, sessionHistory, config) {
|
|
97
|
+
const similarQueries = [];
|
|
98
|
+
const bigramThreshold = config.bigramThreshold ?? config.jaccardThreshold;
|
|
99
|
+
let maxSimilarity = 0;
|
|
100
|
+
for (const pastQuery of sessionHistory) {
|
|
101
|
+
const { score, algorithm } = computeJaccardWithMeta(newQuery, pastQuery);
|
|
102
|
+
const threshold = algorithm === 'bigram' ? bigramThreshold : config.jaccardThreshold;
|
|
103
|
+
if (score >= threshold) {
|
|
104
|
+
similarQueries.push({ query: pastQuery, similarity: score });
|
|
105
|
+
}
|
|
106
|
+
if (score > maxSimilarity) {
|
|
107
|
+
maxSimilarity = score;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const isRedundant = similarQueries.length > 0;
|
|
111
|
+
const result = {
|
|
112
|
+
isRedundant,
|
|
113
|
+
maxSimilarity,
|
|
114
|
+
similarQueries,
|
|
115
|
+
action: config.action,
|
|
116
|
+
};
|
|
117
|
+
if (isRedundant && config.action === 'adjust') {
|
|
118
|
+
result.adjustedQuery = adjustQuery(newQuery, similarQueries);
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=query-redundancy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-redundancy.js","sourceRoot":"","sources":["../../src/deep/query-redundancy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAuBH,qEAAqE;AAErE,sDAAsD;AACtD,SAAS,WAAW,CAAC,CAAS;IAC1B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;IAClC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACpC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,mDAAmD;AACnD,SAAS,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,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;QACjE,CAAC;QACD,IAAI,KAAK,GAAG,aAAa,EAAE,CAAC;YACxB,aAAa,GAAG,KAAK,CAAC;QAC1B,CAAC;IACL,CAAC;IAED,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;IAE9C,MAAM,MAAM,GAAqB;QAC7B,WAAW;QACX,aAAa;QACb,cAAc;QACd,MAAM,EAAE,MAAM,CAAC,MAAM;KACxB,CAAC;IAEF,IAAI,WAAW,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,CAAC,aAAa,GAAG,WAAW,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IACjE,CAAC;IAED,OAAO,MAAM,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query suggestion data generation for deep search sessions.
|
|
3
|
+
*
|
|
4
|
+
* CLI outputs analysis data (entities, domains, history, quality)
|
|
5
|
+
* for Agent to use when generating follow-up queries.
|
|
6
|
+
* CLI does NOT auto-generate queries — Agent controls LLM interaction.
|
|
7
|
+
*/
|
|
8
|
+
import { DirectedGraph } from 'graphology';
|
|
9
|
+
import { GraphNodeAttrs, GraphEdgeAttrs } from './graph.js';
|
|
10
|
+
import { SessionResult } from './session.js';
|
|
11
|
+
export interface TopEntity {
|
|
12
|
+
label: string;
|
|
13
|
+
obfuscatedLabel?: string;
|
|
14
|
+
degree: number;
|
|
15
|
+
frequency: number;
|
|
16
|
+
entityType?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface RoundHistoryEntry {
|
|
19
|
+
round: number;
|
|
20
|
+
query: string;
|
|
21
|
+
resultCount: number;
|
|
22
|
+
}
|
|
23
|
+
export type SearchStage = 'broad_exploration' | 'targeted_deep_dive';
|
|
24
|
+
export interface QuerySuggestionData {
|
|
25
|
+
topEntities: TopEntity[];
|
|
26
|
+
unexploredDomains: string[];
|
|
27
|
+
currentStage: SearchStage;
|
|
28
|
+
roundHistory: RoundHistoryEntry[];
|
|
29
|
+
}
|
|
30
|
+
/** Generate query suggestion data from session context.
|
|
31
|
+
* Returns analysis for Agent — CLI does NOT auto-generate queries. */
|
|
32
|
+
export declare function generateQuerySuggestions(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>, sessionResults: SessionResult[], currentStage: SearchStage): QuerySuggestionData;
|
|
33
|
+
//# sourceMappingURL=query-suggest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-suggest.d.ts","sourceRoot":"","sources":["../../src/deep/query-suggest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAM7C,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,oBAAoB,CAAC;AAErE,MAAM,WAAW,mBAAmB;IAChC,WAAW,EAAE,SAAS,EAAE,CAAC;IACzB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,YAAY,EAAE,WAAW,CAAC;IAC1B,YAAY,EAAE,iBAAiB,EAAE,CAAC;CACrC;AAsBD;uEACuE;AACvE,wBAAgB,wBAAwB,CACpC,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC,EACpD,cAAc,EAAE,aAAa,EAAE,EAC/B,YAAY,EAAE,WAAW,GAC1B,mBAAmB,CAqBrB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Query suggestion data generation for deep search sessions.
|
|
3
|
+
*
|
|
4
|
+
* CLI outputs analysis data (entities, domains, history, quality)
|
|
5
|
+
* for Agent to use when generating follow-up queries.
|
|
6
|
+
* CLI does NOT auto-generate queries — Agent controls LLM interaction.
|
|
7
|
+
*/
|
|
8
|
+
import { getEntityDegree } from './degree-utils.js';
|
|
9
|
+
import { sourceKey } from './dedupe.js';
|
|
10
|
+
// ── Domain extraction ─────────────────────────────────────────────
|
|
11
|
+
/** Known specialized domains for deep-dive search */
|
|
12
|
+
const SPECIALIZED_DOMAINS = [
|
|
13
|
+
'arxiv.org',
|
|
14
|
+
'semanticscholar.org',
|
|
15
|
+
'github.com',
|
|
16
|
+
'stackoverflow.com',
|
|
17
|
+
'docs.rs',
|
|
18
|
+
'npmjs.com',
|
|
19
|
+
'pypi.org',
|
|
20
|
+
'crates.io',
|
|
21
|
+
'medium.com',
|
|
22
|
+
'dev.to',
|
|
23
|
+
'reddit.com',
|
|
24
|
+
'hackernews.com',
|
|
25
|
+
];
|
|
26
|
+
// ── Suggestion generation ─────────────────────────────────────────
|
|
27
|
+
/** Generate query suggestion data from session context.
|
|
28
|
+
* Returns analysis for Agent — CLI does NOT auto-generate queries. */
|
|
29
|
+
export function generateQuerySuggestions(graph, sessionResults, currentStage) {
|
|
30
|
+
// Collect top entities sorted by degree × frequency descending
|
|
31
|
+
const topEntities = collectTopEntities(graph);
|
|
32
|
+
// Detect unexplored domains
|
|
33
|
+
const exploredDomains = new Set();
|
|
34
|
+
for (const r of sessionResults) {
|
|
35
|
+
const domain = sourceKey(r.url);
|
|
36
|
+
if (domain)
|
|
37
|
+
exploredDomains.add(domain);
|
|
38
|
+
}
|
|
39
|
+
const unexploredDomains = SPECIALIZED_DOMAINS.filter(d => !exploredDomains.has(d));
|
|
40
|
+
// Build round history from query nodes in graph
|
|
41
|
+
const roundHistory = buildRoundHistory(graph, sessionResults);
|
|
42
|
+
return {
|
|
43
|
+
topEntities,
|
|
44
|
+
unexploredDomains,
|
|
45
|
+
currentStage,
|
|
46
|
+
roundHistory,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/** Collect entity nodes sorted by degree × frequency descending */
|
|
50
|
+
function collectTopEntities(graph) {
|
|
51
|
+
const entities = [];
|
|
52
|
+
graph.forEachNode((node, attrs) => {
|
|
53
|
+
if (attrs.type !== 'entity')
|
|
54
|
+
return;
|
|
55
|
+
const degree = getEntityDegree(graph, node);
|
|
56
|
+
const frequency = attrs.frequency ?? 1;
|
|
57
|
+
entities.push({
|
|
58
|
+
label: attrs.label,
|
|
59
|
+
obfuscatedLabel: attrs.obfuscatedLabel,
|
|
60
|
+
degree,
|
|
61
|
+
frequency,
|
|
62
|
+
entityType: attrs.entityType,
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
// Sort by degree × frequency descending
|
|
66
|
+
return entities.sort((a, b) => (b.degree * b.frequency) - (a.degree * a.frequency));
|
|
67
|
+
}
|
|
68
|
+
/** Build round history from query nodes in graph */
|
|
69
|
+
function buildRoundHistory(graph, sessionResults) {
|
|
70
|
+
const entries = [];
|
|
71
|
+
graph.forEachNode((node, attrs) => {
|
|
72
|
+
if (attrs.type !== 'query' || !attrs.query)
|
|
73
|
+
return;
|
|
74
|
+
// Count results yielded by this query via edges
|
|
75
|
+
let resultCount = 0;
|
|
76
|
+
graph.forEachOutNeighbor(node, (neighbor) => {
|
|
77
|
+
const nAttrs = graph.getNodeAttributes(neighbor);
|
|
78
|
+
if (nAttrs.type === 'result')
|
|
79
|
+
resultCount++;
|
|
80
|
+
});
|
|
81
|
+
entries.push({
|
|
82
|
+
round: attrs.round ?? entries.length + 1,
|
|
83
|
+
query: attrs.query,
|
|
84
|
+
resultCount,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
// Sort by round number
|
|
88
|
+
return entries.sort((a, b) => a.round - b.round);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=query-suggest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-suggest.js","sourceRoot":"","sources":["../../src/deep/query-suggest.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA2BxC,qEAAqE;AAErE,qDAAqD;AACrD,MAAM,mBAAmB,GAAG;IACxB,WAAW;IACX,qBAAqB;IACrB,YAAY;IACZ,mBAAmB;IACnB,SAAS;IACT,WAAW;IACX,UAAU;IACV,WAAW;IACX,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,gBAAgB;CACnB,CAAC;AAEF,qEAAqE;AAErE;uEACuE;AACvE,MAAM,UAAU,wBAAwB,CACpC,KAAoD,EACpD,cAA+B,EAC/B,YAAyB;IAEzB,+DAA+D;IAC/D,MAAM,WAAW,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC;IAE9C,4BAA4B;IAC5B,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;IAC1C,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,MAAM;YAAE,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IACD,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnF,gDAAgD;IAChD,MAAM,YAAY,GAAG,iBAAiB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;IAE9D,OAAO;QACH,WAAW;QACX,iBAAiB;QACjB,YA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C,QAAQ,CAAC,CAAC;YACjD,IAAI,MAAM,CAAC,IAAI,KAAK,QAAQ;gBAAE,WAAW,EAAE,CAAC;QAChD,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,IAAI,CAAC;YACT,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YACxC,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,WAAW;SACd,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,uBAAuB;IACvB,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RRF (Reciprocal Rank Fusion) - Merge multiple ranked lists
|
|
3
|
+
*/
|
|
4
|
+
export interface RrfInputItem {
|
|
5
|
+
id: string;
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface RrfOutputItem {
|
|
9
|
+
id: string;
|
|
10
|
+
score: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function rrf(rankings: Array<Array<RrfInputItem>>, k?: number): Array<RrfOutputItem>;
|
|
13
|
+
//# sourceMappingURL=rrf.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rrf.d.ts","sourceRoot":"","sources":["../../src/deep/rrf.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,GAAG,CACf,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EACpC,CAAC,GAAE,MAAW,GACf,KAAK,CAAC,aAAa,CAAC,CAkBtB"}
|
package/dist/deep/rrf.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RRF (Reciprocal Rank Fusion) - Merge multiple ranked lists
|
|
3
|
+
*/
|
|
4
|
+
export function rrf(rankings, k = 60) {
|
|
5
|
+
if (k <= 0)
|
|
6
|
+
throw new Error(`RRF parameter k must be positive, got: ${k}`);
|
|
7
|
+
if (rankings.length === 0)
|
|
8
|
+
return [];
|
|
9
|
+
const scores = new Map();
|
|
10
|
+
for (const ranking of rankings) {
|
|
11
|
+
for (let i = 0; i < ranking.length; i++) {
|
|
12
|
+
const doc = ranking[i];
|
|
13
|
+
if (!doc.id)
|
|
14
|
+
continue;
|
|
15
|
+
const score = 1 / (k + i + 1);
|
|
16
|
+
scores.set(doc.id, (scores.get(doc.id) || 0) + score);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return Array.from(scores.entries())
|
|
20
|
+
.map(([id, score]) => ({ id, score }))
|
|
21
|
+
.sort((a, b) => b.score - a.score);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=rrf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rrf.js","sourceRoot":"","sources":["../../src/deep/rrf.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,MAAM,UAAU,GAAG,CACf,QAAoC,EACpC,IAAY,EAAE;IAEd,IAAI,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,EAAE,CAAC,CAAC;IAC3E,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEzC,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACtC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,EAAE;gBAAE,SAAS;YACtB,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YAC9B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC;QAC1D,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;SAC9B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;SACrC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two-stage search strategy (GraphWalker-inspired).
|
|
3
|
+
*
|
|
4
|
+
* Stage 1 — Broad Exploration: general engines, wide scope.
|
|
5
|
+
* Stage 2 — Targeted Deep-Dive: specialized engines, obfuscated queries.
|
|
6
|
+
*
|
|
7
|
+
* Transition signal: entity richness growth rate slows below threshold.
|
|
8
|
+
* CLI only outputs stage recommendation — Agent decides whether to follow.
|
|
9
|
+
*/
|
|
10
|
+
import { DirectedGraph } from 'graphology';
|
|
11
|
+
import { GraphNodeAttrs, GraphEdgeAttrs } from './graph.js';
|
|
12
|
+
import { SearchStage } from './query-suggest.js';
|
|
13
|
+
export interface StrategyConfig {
|
|
14
|
+
broadEngines: string[];
|
|
15
|
+
deepEngines: string[];
|
|
16
|
+
broadRounds: number;
|
|
17
|
+
autoTransition: boolean;
|
|
18
|
+
transitionThreshold: number;
|
|
19
|
+
}
|
|
20
|
+
export interface StrategyInfo {
|
|
21
|
+
currentStage: SearchStage;
|
|
22
|
+
recommendedEngines: string[];
|
|
23
|
+
recommendedCategories: string[];
|
|
24
|
+
roundNumber: number;
|
|
25
|
+
growthRate: number;
|
|
26
|
+
transitionReason?: string;
|
|
27
|
+
}
|
|
28
|
+
/** Compute entity richness growth rate between last two rounds.
|
|
29
|
+
* growthRate = (newEntitiesThisRound - newEntitiesLastRound) / max(newEntitiesLastRound, 1)
|
|
30
|
+
* When growth rate slows below threshold, it signals transition to deep-dive. */
|
|
31
|
+
export declare function computeGrowthRate(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>): number;
|
|
32
|
+
/** Determine current search stage based on session state.
|
|
33
|
+
* Returns the stage recommendation — Agent may choose to ignore. */
|
|
34
|
+
export declare function determineSearchStage(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>, config?: Partial<StrategyConfig>): SearchStage;
|
|
35
|
+
/** Get full strategy info for Agent decision-making. */
|
|
36
|
+
export declare function getStrategyInfo(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>, config?: Partial<StrategyConfig>): StrategyInfo;
|
|
37
|
+
//# sourceMappingURL=search-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-strategy.d.ts","sourceRoot":"","sources":["../../src/deep/search-strategy.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAIjD,MAAM,WAAW,cAAc;IAC3B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IACzB,YAAY,EAAE,WAAW,CAAC;IAC1B,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAoDD;;kFAEkF;AAClF,wBAAgB,iBAAiB,CAC7B,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC,GACrD,MAAM,CAgBR;AAED;qEACqE;AACrE,wBAAgB,oBAAoB,CAChC,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACjC,WAAW,CAkBb;AAED,wDAAwD;AACxD,wBAAgB,eAAe,CAC3B,KAAK,EAAE,aAAa,CAAC,cAAc,EAAE,cAAc,CAAC,EACpD,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GACjC,YAAY,CAmBd"}
|