@stackfactor/agent-utils 1.13.4 → 1.33.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/README.md +688 -23
- package/dist/cjs/agentProto.d.ts +13 -3
- package/dist/cjs/agentProto.d.ts.map +1 -1
- package/dist/cjs/agentProto.js +25 -4
- package/dist/cjs/backoff.d.ts +17 -0
- package/dist/cjs/backoff.d.ts.map +1 -0
- package/dist/cjs/backoff.js +26 -0
- package/dist/cjs/cancellation.d.ts +22 -0
- package/dist/cjs/cancellation.d.ts.map +1 -0
- package/dist/cjs/cancellation.js +36 -0
- package/dist/cjs/cli.d.ts +3 -0
- package/dist/cjs/cli.d.ts.map +1 -0
- package/dist/cjs/cli.js +85 -0
- package/dist/cjs/client.d.ts +11 -0
- package/dist/cjs/client.d.ts.map +1 -1
- package/dist/cjs/client.js +27 -0
- package/dist/cjs/const.d.ts +23 -0
- package/dist/cjs/const.d.ts.map +1 -1
- package/dist/cjs/const.js +23 -0
- package/dist/cjs/daemon.d.ts +94 -0
- package/dist/cjs/daemon.d.ts.map +1 -0
- package/dist/cjs/daemon.js +507 -0
- package/dist/cjs/daemonConfig.d.ts +45 -0
- package/dist/cjs/daemonConfig.d.ts.map +1 -0
- package/dist/cjs/daemonConfig.js +148 -0
- package/dist/cjs/daemonEnv.d.ts +10 -0
- package/dist/cjs/daemonEnv.d.ts.map +1 -0
- package/dist/cjs/daemonEnv.js +12 -0
- package/dist/cjs/durable/clientTool.d.ts +39 -0
- package/dist/cjs/durable/clientTool.d.ts.map +1 -0
- package/dist/cjs/durable/clientTool.js +90 -0
- package/dist/cjs/durable/index.d.ts +9 -0
- package/dist/cjs/durable/index.d.ts.map +1 -0
- package/dist/cjs/durable/index.js +16 -0
- package/dist/cjs/durable/journal.d.ts +218 -0
- package/dist/cjs/durable/journal.d.ts.map +1 -0
- package/dist/cjs/durable/journal.js +392 -0
- package/dist/cjs/durable/pause.d.ts +84 -0
- package/dist/cjs/durable/pause.d.ts.map +1 -0
- package/dist/cjs/durable/pause.js +241 -0
- package/dist/cjs/durable/resume.d.ts +27 -0
- package/dist/cjs/durable/resume.d.ts.map +1 -0
- package/dist/cjs/durable/resume.js +80 -0
- package/dist/cjs/durable/snapshotSaver.d.ts +38 -0
- package/dist/cjs/durable/snapshotSaver.d.ts.map +1 -0
- package/dist/cjs/durable/snapshotSaver.js +81 -0
- package/dist/cjs/durable/step.d.ts +28 -0
- package/dist/cjs/durable/step.d.ts.map +1 -0
- package/dist/cjs/durable/step.js +43 -0
- package/dist/cjs/index.d.ts +30 -7
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +28 -1
- package/dist/cjs/infrastructure.d.ts +50 -0
- package/dist/cjs/infrastructure.d.ts.map +1 -0
- package/dist/cjs/infrastructure.js +163 -0
- package/dist/cjs/langChain.d.ts +15 -3
- package/dist/cjs/langChain.d.ts.map +1 -1
- package/dist/cjs/langChain.js +986 -180
- package/dist/cjs/learningActivityMedia.d.ts +196 -0
- package/dist/cjs/learningActivityMedia.d.ts.map +1 -0
- package/dist/cjs/learningActivityMedia.js +861 -0
- package/dist/cjs/learningContentPlan.d.ts +117 -0
- package/dist/cjs/learningContentPlan.d.ts.map +1 -0
- package/dist/cjs/learningContentPlan.js +327 -0
- package/dist/cjs/learningContentThread.d.ts +213 -0
- package/dist/cjs/learningContentThread.d.ts.map +1 -0
- package/dist/cjs/learningContentThread.js +448 -0
- package/dist/cjs/logger.d.ts +1 -0
- package/dist/cjs/logger.d.ts.map +1 -1
- package/dist/cjs/logger.js +17 -3
- package/dist/cjs/modelRates.d.ts +40 -0
- package/dist/cjs/modelRates.d.ts.map +1 -0
- package/dist/cjs/modelRates.js +76 -0
- package/dist/cjs/referenceContext.d.ts +4 -145
- package/dist/cjs/referenceContext.d.ts.map +1 -1
- package/dist/cjs/referenceContext.js +16 -251
- package/dist/cjs/retry.d.ts +64 -0
- package/dist/cjs/retry.d.ts.map +1 -0
- package/dist/cjs/retry.js +138 -0
- package/dist/cjs/runtimeContext.d.ts +8 -1
- package/dist/cjs/runtimeContext.d.ts.map +1 -1
- package/dist/cjs/runtimeContext.js +3 -1
- package/dist/cjs/serve.d.ts +3 -2
- package/dist/cjs/serve.d.ts.map +1 -1
- package/dist/cjs/serve.js +32 -2
- package/dist/cjs/sourceStore.d.ts +378 -0
- package/dist/cjs/sourceStore.d.ts.map +1 -0
- package/dist/cjs/sourceStore.js +872 -0
- package/dist/cjs/stackfactorKnowledge.d.ts +91 -7
- package/dist/cjs/stackfactorKnowledge.d.ts.map +1 -1
- package/dist/cjs/stackfactorKnowledge.js +108 -44
- package/dist/cjs/tavily.d.ts +108 -4
- package/dist/cjs/tavily.d.ts.map +1 -1
- package/dist/cjs/tavily.js +242 -21
- package/dist/cjs/usage.d.ts.map +1 -1
- package/dist/cjs/usage.js +9 -15
- package/dist/cjs/version.d.ts +3 -0
- package/dist/cjs/version.d.ts.map +1 -0
- package/dist/cjs/version.js +5 -0
- package/dist/cjs/workflow/bookkeeping.d.ts +78 -0
- package/dist/cjs/workflow/bookkeeping.d.ts.map +1 -0
- package/dist/cjs/workflow/bookkeeping.js +75 -0
- package/dist/cjs/workflow/index.d.ts +13 -0
- package/dist/cjs/workflow/index.d.ts.map +1 -0
- package/dist/cjs/workflow/index.js +51 -0
- package/dist/cjs/workflow/limits.d.ts +52 -0
- package/dist/cjs/workflow/limits.d.ts.map +1 -0
- package/dist/cjs/workflow/limits.js +62 -0
- package/dist/cjs/workflow/platformTransport.d.ts +39 -0
- package/dist/cjs/workflow/platformTransport.d.ts.map +1 -0
- package/dist/cjs/workflow/platformTransport.js +115 -0
- package/dist/cjs/workflow/retrying.d.ts +44 -0
- package/dist/cjs/workflow/retrying.d.ts.map +1 -0
- package/dist/cjs/workflow/retrying.js +82 -0
- package/dist/cjs/workflow/run.d.ts +195 -0
- package/dist/cjs/workflow/run.d.ts.map +1 -0
- package/dist/cjs/workflow/run.js +858 -0
- package/dist/cjs/workflow/testing/index.d.ts +3 -0
- package/dist/cjs/workflow/testing/index.d.ts.map +1 -0
- package/dist/cjs/workflow/testing/index.js +6 -0
- package/dist/cjs/workflow/testing/memoryTransport.d.ts +203 -0
- package/dist/cjs/workflow/testing/memoryTransport.d.ts.map +1 -0
- package/dist/cjs/workflow/testing/memoryTransport.js +1171 -0
- package/dist/cjs/workflow/transport.d.ts +219 -0
- package/dist/cjs/workflow/transport.d.ts.map +1 -0
- package/dist/cjs/workflow/transport.js +19 -0
- package/dist/esm/agentProto.d.ts +13 -3
- package/dist/esm/agentProto.d.ts.map +1 -1
- package/dist/esm/agentProto.js +23 -3
- package/dist/esm/backoff.d.ts +17 -0
- package/dist/esm/backoff.d.ts.map +1 -0
- package/dist/esm/backoff.js +22 -0
- package/dist/esm/cancellation.d.ts +22 -0
- package/dist/esm/cancellation.d.ts.map +1 -0
- package/dist/esm/cancellation.js +27 -0
- package/dist/esm/cli.d.ts +3 -0
- package/dist/esm/cli.d.ts.map +1 -0
- package/dist/esm/cli.js +80 -0
- package/dist/esm/client.d.ts +11 -0
- package/dist/esm/client.d.ts.map +1 -1
- package/dist/esm/client.js +25 -1
- package/dist/esm/const.d.ts +23 -0
- package/dist/esm/const.d.ts.map +1 -1
- package/dist/esm/const.js +23 -0
- package/dist/esm/daemon.d.ts +94 -0
- package/dist/esm/daemon.d.ts.map +1 -0
- package/dist/esm/daemon.js +499 -0
- package/dist/esm/daemonConfig.d.ts +45 -0
- package/dist/esm/daemonConfig.d.ts.map +1 -0
- package/dist/esm/daemonConfig.js +142 -0
- package/dist/esm/daemonEnv.d.ts +10 -0
- package/dist/esm/daemonEnv.d.ts.map +1 -0
- package/dist/esm/daemonEnv.js +9 -0
- package/dist/esm/durable/clientTool.d.ts +39 -0
- package/dist/esm/durable/clientTool.d.ts.map +1 -0
- package/dist/esm/durable/clientTool.js +82 -0
- package/dist/esm/durable/index.d.ts +9 -0
- package/dist/esm/durable/index.d.ts.map +1 -0
- package/dist/esm/durable/index.js +8 -0
- package/dist/esm/durable/journal.d.ts +218 -0
- package/dist/esm/durable/journal.d.ts.map +1 -0
- package/dist/esm/durable/journal.js +374 -0
- package/dist/esm/durable/pause.d.ts +84 -0
- package/dist/esm/durable/pause.d.ts.map +1 -0
- package/dist/esm/durable/pause.js +226 -0
- package/dist/esm/durable/resume.d.ts +27 -0
- package/dist/esm/durable/resume.d.ts.map +1 -0
- package/dist/esm/durable/resume.js +72 -0
- package/dist/esm/durable/snapshotSaver.d.ts +38 -0
- package/dist/esm/durable/snapshotSaver.d.ts.map +1 -0
- package/dist/esm/durable/snapshotSaver.js +77 -0
- package/dist/esm/durable/step.d.ts +28 -0
- package/dist/esm/durable/step.d.ts.map +1 -0
- package/dist/esm/durable/step.js +36 -0
- package/dist/esm/index.d.ts +30 -7
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +20 -4
- package/dist/esm/infrastructure.d.ts +50 -0
- package/dist/esm/infrastructure.d.ts.map +1 -0
- package/dist/esm/infrastructure.js +156 -0
- package/dist/esm/langChain.d.ts +15 -3
- package/dist/esm/langChain.d.ts.map +1 -1
- package/dist/esm/langChain.js +984 -179
- package/dist/esm/learningActivityMedia.d.ts +196 -0
- package/dist/esm/learningActivityMedia.d.ts.map +1 -0
- package/dist/esm/learningActivityMedia.js +807 -0
- package/dist/esm/learningContentPlan.d.ts +117 -0
- package/dist/esm/learningContentPlan.d.ts.map +1 -0
- package/dist/esm/learningContentPlan.js +320 -0
- package/dist/esm/learningContentThread.d.ts +213 -0
- package/dist/esm/learningContentThread.d.ts.map +1 -0
- package/dist/esm/learningContentThread.js +403 -0
- package/dist/esm/logger.d.ts +1 -0
- package/dist/esm/logger.d.ts.map +1 -1
- package/dist/esm/logger.js +17 -3
- package/dist/esm/modelRates.d.ts +40 -0
- package/dist/esm/modelRates.d.ts.map +1 -0
- package/dist/esm/modelRates.js +68 -0
- package/dist/esm/referenceContext.d.ts +4 -145
- package/dist/esm/referenceContext.d.ts.map +1 -1
- package/dist/esm/referenceContext.js +16 -243
- package/dist/esm/retry.d.ts +64 -0
- package/dist/esm/retry.d.ts.map +1 -0
- package/dist/esm/retry.js +127 -0
- package/dist/esm/runtimeContext.d.ts +8 -1
- package/dist/esm/runtimeContext.d.ts.map +1 -1
- package/dist/esm/runtimeContext.js +3 -1
- package/dist/esm/serve.d.ts +3 -2
- package/dist/esm/serve.d.ts.map +1 -1
- package/dist/esm/serve.js +33 -3
- package/dist/esm/sourceStore.d.ts +378 -0
- package/dist/esm/sourceStore.d.ts.map +1 -0
- package/dist/esm/sourceStore.js +855 -0
- package/dist/esm/stackfactorKnowledge.d.ts +91 -7
- package/dist/esm/stackfactorKnowledge.d.ts.map +1 -1
- package/dist/esm/stackfactorKnowledge.js +101 -41
- package/dist/esm/tavily.d.ts +108 -4
- package/dist/esm/tavily.d.ts.map +1 -1
- package/dist/esm/tavily.js +237 -20
- package/dist/esm/usage.d.ts.map +1 -1
- package/dist/esm/usage.js +9 -15
- package/dist/esm/version.d.ts +3 -0
- package/dist/esm/version.d.ts.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/workflow/bookkeeping.d.ts +78 -0
- package/dist/esm/workflow/bookkeeping.d.ts.map +1 -0
- package/dist/esm/workflow/bookkeeping.js +67 -0
- package/dist/esm/workflow/index.d.ts +13 -0
- package/dist/esm/workflow/index.d.ts.map +1 -0
- package/dist/esm/workflow/index.js +10 -0
- package/dist/esm/workflow/limits.d.ts +52 -0
- package/dist/esm/workflow/limits.d.ts.map +1 -0
- package/dist/esm/workflow/limits.js +59 -0
- package/dist/esm/workflow/platformTransport.d.ts +39 -0
- package/dist/esm/workflow/platformTransport.d.ts.map +1 -0
- package/dist/esm/workflow/platformTransport.js +110 -0
- package/dist/esm/workflow/retrying.d.ts +44 -0
- package/dist/esm/workflow/retrying.d.ts.map +1 -0
- package/dist/esm/workflow/retrying.js +73 -0
- package/dist/esm/workflow/run.d.ts +195 -0
- package/dist/esm/workflow/run.d.ts.map +1 -0
- package/dist/esm/workflow/run.js +850 -0
- package/dist/esm/workflow/testing/index.d.ts +3 -0
- package/dist/esm/workflow/testing/index.d.ts.map +1 -0
- package/dist/esm/workflow/testing/index.js +2 -0
- package/dist/esm/workflow/testing/memoryTransport.d.ts +203 -0
- package/dist/esm/workflow/testing/memoryTransport.d.ts.map +1 -0
- package/dist/esm/workflow/testing/memoryTransport.js +1167 -0
- package/dist/esm/workflow/transport.d.ts +219 -0
- package/dist/esm/workflow/transport.d.ts.map +1 -0
- package/dist/esm/workflow/transport.js +16 -0
- package/package.json +8 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RetryOptions } from "./retry.js";
|
|
1
2
|
/** What a STACKFACTOR reference to a knowledge base document carries (backend-core REFERENCE). */
|
|
2
3
|
export declare const STACKFACTOR_REFERENCE: Readonly<{
|
|
3
4
|
KIND: "STACKFACTOR";
|
|
@@ -22,6 +23,10 @@ export interface KnowledgeChunk {
|
|
|
22
23
|
/** The document's page at its source (sent by the platform's search since backend-core #630). */
|
|
23
24
|
documentUrl?: string | null;
|
|
24
25
|
sectionTitle?: string | null;
|
|
26
|
+
/** A line written from the passage's content at ingestion (backend-core #1058); null when it has none. */
|
|
27
|
+
passageTitle?: string | null;
|
|
28
|
+
/** What the passage is for, as ingestion labelled it: "teaching" or "logistics"; null when it was never said. */
|
|
29
|
+
passageRole?: string | null;
|
|
25
30
|
pageNumber?: number | null;
|
|
26
31
|
text?: string;
|
|
27
32
|
skills?: {
|
|
@@ -29,12 +34,16 @@ export interface KnowledgeChunk {
|
|
|
29
34
|
microSkills?: string[];
|
|
30
35
|
}[];
|
|
31
36
|
score?: number | null;
|
|
37
|
+
/** Whether it is labelled with a microskill the search named (backend-core #1072); such a passage may have no score. */
|
|
38
|
+
labelled?: boolean;
|
|
32
39
|
[field: string]: unknown;
|
|
33
40
|
}
|
|
34
41
|
/** The platform's search, as client-api's `knowledgeBaseAgent.search` is called. */
|
|
35
42
|
export type KnowledgeSearch = (knowledgeBaseId: string, query: string, options: {
|
|
36
43
|
topK?: number;
|
|
37
44
|
documentIds?: string[];
|
|
45
|
+
excludePassageRoles?: PassageRole[];
|
|
46
|
+
microSkills?: string[];
|
|
38
47
|
}, token: string) => Promise<{
|
|
39
48
|
chunks: KnowledgeChunk[];
|
|
40
49
|
}>;
|
|
@@ -44,6 +53,17 @@ export interface KnowledgeSource {
|
|
|
44
53
|
/** Only these documents; omitted, the whole knowledge base. */
|
|
45
54
|
documentIds?: string[];
|
|
46
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* What a passage is for, as ingestion labels it (backend-core
|
|
58
|
+
* `KNOWLEDGE_BASE.PASSAGE_ROLE`). A logistics passage only organizes the
|
|
59
|
+
* material or the people (an agenda, a schedule, a syllabus, a title slide,
|
|
60
|
+
* introductions) and teaches nothing by itself.
|
|
61
|
+
*/
|
|
62
|
+
export type PassageRole = "teaching" | "logistics";
|
|
63
|
+
export declare const PASSAGE_ROLE: Readonly<{
|
|
64
|
+
readonly TEACHING: "teaching";
|
|
65
|
+
readonly LOGISTICS: "logistics";
|
|
66
|
+
}>;
|
|
47
67
|
/** A passage handed to the model, tagged so it can cite it. */
|
|
48
68
|
export interface GroundingPassage {
|
|
49
69
|
/** "k1", "k2"… in the order they rank. */
|
|
@@ -56,7 +76,12 @@ export interface GroundingPassage {
|
|
|
56
76
|
documentTitle?: string | null;
|
|
57
77
|
/** The document's page at its source, an http(s) address; null when the platform has none. */
|
|
58
78
|
documentUrl?: string | null;
|
|
79
|
+
/** The heading the document carries above the passage: on a slide, often a time allowance or the heading of the slide before. */
|
|
59
80
|
sectionTitle: string | null;
|
|
81
|
+
/** A line written from the passage's content at ingestion; null when the platform has none. */
|
|
82
|
+
passageTitle?: string | null;
|
|
83
|
+
/** What the passage is for: "teaching", "logistics", or null when ingestion never said. */
|
|
84
|
+
passageRole?: PassageRole | null;
|
|
60
85
|
pageNumber: number | null;
|
|
61
86
|
text: string;
|
|
62
87
|
/** The skills its passage teaches, as labelling named them. */
|
|
@@ -65,6 +90,12 @@ export interface GroundingPassage {
|
|
|
65
90
|
microSkills: string[];
|
|
66
91
|
}[];
|
|
67
92
|
score: number | null;
|
|
93
|
+
/**
|
|
94
|
+
* Whether ingestion labelled it with a microskill the search named
|
|
95
|
+
* (`retrievePassages` `microSkills`): the knowledge base itself says it
|
|
96
|
+
* teaches that microskill. Such passages rank first.
|
|
97
|
+
*/
|
|
98
|
+
labelled?: boolean;
|
|
68
99
|
}
|
|
69
100
|
/** A knowledge base that could not be searched, and why. */
|
|
70
101
|
export interface SkippedSource {
|
|
@@ -125,14 +156,41 @@ export declare const sourcesFromCoverage: (coverage: unknown) => KnowledgeSource
|
|
|
125
156
|
* model to cite. A source with documents is searched within them (in batches of
|
|
126
157
|
* SEARCH_DOCUMENT_IDS_MAX); one without, whole. A source the person may not
|
|
127
158
|
* read (401, 403, 404) is skipped: none of its passages are used and no more of
|
|
128
|
-
* its searches are made. A search that fails
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
159
|
+
* its searches are made. A search that fails for a reason that may pass (a
|
|
160
|
+
* timeout, a rate limit, a 5xx, the network) is made again (retryTransient:
|
|
161
|
+
* after 2 s, then 6 s, under `retry.breaker` when the caller shares one
|
|
162
|
+
* across its searches); one that still fails, or failed for a reason that
|
|
163
|
+
* will not pass (a 422), is reported and the passages its other searches
|
|
164
|
+
* found stand. A refusal is never tried again, and a search is not retried
|
|
165
|
+
* once its knowledge base refused the person meanwhile. Either way it is in
|
|
166
|
+
* `skipped`, once per knowledge base, and the passages of the others stand;
|
|
167
|
+
* whether a skip is an error is the caller's to say.
|
|
168
|
+
*
|
|
169
|
+
* A passage ingestion labelled as logistics is left out: an agenda or a
|
|
170
|
+
* syllabus slide matches any query on the course's subject and teaches
|
|
171
|
+
* nothing, and one was cited as the source of a micro-skill (prod,
|
|
172
|
+
* 2026-11-16). The search is asked to leave them out itself
|
|
173
|
+
* (`excludePassageRoles`, backend-core #1065), so it still answers `topK`
|
|
174
|
+
* passages: dropped only after the search, they took more than half of each
|
|
175
|
+
* answer with them, and 7 of 10 searches of 8 kept none (the same day). A
|
|
176
|
+
* platform that does not know the option answers them all the same, so any
|
|
177
|
+
* that come back are dropped here, and the count is logged. `includeLogistics`
|
|
178
|
+
* keeps them, for a reader that must see what a reference cites whatever it
|
|
179
|
+
* is. A passage with no label is kept.
|
|
180
|
+
*
|
|
181
|
+
* `microSkills` names microskills of the knowledge bases, as their microskill
|
|
182
|
+
* lists name them: every search is asked to put the passages ingestion
|
|
183
|
+
* labelled with one of them first (backend-core #1072), and they rank first
|
|
184
|
+
* here too, in the searches' own order, ahead of every other passage whatever
|
|
185
|
+
* its score. Asked for by name through the search alone, a microskill's own
|
|
186
|
+
* passages lost to ones sharing words with the skill's name, and the wrong
|
|
187
|
+
* passage was cited (prod, 2026-11-17). A platform that does not know the
|
|
188
|
+
* option answers as before, and nothing is marked.
|
|
133
189
|
* @param options `sources`, `queries`, `search` (client-api
|
|
134
190
|
* `knowledgeBaseAgent.search`), `token` (the run's AGENT token), `topK`
|
|
135
|
-
* per search (default DEFAULT_TOP_K)
|
|
191
|
+
* per search (default DEFAULT_TOP_K), `retry` (`waits`, `breaker`, `sleep`
|
|
192
|
+
* for retryTransient; default: RETRY_WAITS, no breaker), `includeLogistics`
|
|
193
|
+
* (default false), `microSkills` (default none)
|
|
136
194
|
* @returns `{ passages, skipped }`
|
|
137
195
|
*/
|
|
138
196
|
export declare const retrievePassages: (options: {
|
|
@@ -141,12 +199,26 @@ export declare const retrievePassages: (options: {
|
|
|
141
199
|
search: KnowledgeSearch;
|
|
142
200
|
token: string;
|
|
143
201
|
topK?: number;
|
|
202
|
+
retry?: Pick<RetryOptions, "waits" | "breaker" | "sleep">;
|
|
203
|
+
includeLogistics?: boolean;
|
|
204
|
+
microSkills?: string[];
|
|
144
205
|
}) => Promise<{
|
|
145
206
|
passages: GroundingPassage[];
|
|
146
207
|
skipped: SkippedSource[];
|
|
147
208
|
}>;
|
|
148
209
|
/**
|
|
149
|
-
*
|
|
210
|
+
* What a passage is headed by, for a reader: the title ingestion wrote from
|
|
211
|
+
* its content, else the heading its document carries. A slide's own heading
|
|
212
|
+
* is often a time allowance ("Total Time: 40 minutes") or the heading of the
|
|
213
|
+
* slide before, over a passage that teaches something else.
|
|
214
|
+
* @param passage A passage, as `retrievePassages` answers it
|
|
215
|
+
* @returns The heading, or null when the passage has neither
|
|
216
|
+
*/
|
|
217
|
+
export declare const passageHeading: (passage: Pick<GroundingPassage, "sectionTitle" | "passageTitle">) => string | null;
|
|
218
|
+
/**
|
|
219
|
+
* The passages as a prompt shows them: tag, where each came from, and its
|
|
220
|
+
* text. `section` is the passage's heading (`passageHeading`), which is also
|
|
221
|
+
* its reference's description, so a reader can match one to the other.
|
|
150
222
|
* @param passages From `retrievePassages`
|
|
151
223
|
* @returns `[{ tag, document, section, text }]`, for the model's input
|
|
152
224
|
*/
|
|
@@ -163,6 +235,10 @@ export declare const passagesForPrompt: (passages: GroundingPassage[]) => {
|
|
|
163
235
|
* page at the source (`url`) when the passage has one. Each is titled by its
|
|
164
236
|
* document's title, else its name, else its section; its pointer keeps the
|
|
165
237
|
* document's name (`knowledgeBase.documentName`) when the passage has one.
|
|
238
|
+
* Its `description` is the passage's heading (`passageHeading`: the title
|
|
239
|
+
* written from its content, else the document's own heading), while its
|
|
240
|
+
* pointer's `sectionTitle` stays the document's heading: that is what tells
|
|
241
|
+
* two passages of one section apart from two sections.
|
|
166
242
|
* @param passages From `retrievePassages`
|
|
167
243
|
* @param tags The tags the model cited ("k3", "K3" and " k3 " alike)
|
|
168
244
|
* @returns The references, ready for a skill's, a microskill's or a question's `references`
|
|
@@ -172,12 +248,17 @@ declare const _default: {
|
|
|
172
248
|
DEFAULT_TOP_K: number;
|
|
173
249
|
QUERY_MAX_LENGTH: number;
|
|
174
250
|
SEARCH_DOCUMENT_IDS_MAX: number;
|
|
251
|
+
PASSAGE_ROLE: Readonly<{
|
|
252
|
+
readonly TEACHING: "teaching";
|
|
253
|
+
readonly LOGISTICS: "logistics";
|
|
254
|
+
}>;
|
|
175
255
|
STACKFACTOR_REFERENCE: Readonly<{
|
|
176
256
|
KIND: "STACKFACTOR";
|
|
177
257
|
TARGET_ELEMENT_TYPE: "KNOWLEDGE_BASE_DOCUMENT";
|
|
178
258
|
ORIGIN: "KB_EXTRACTION";
|
|
179
259
|
VISIBILITY: "EDIT";
|
|
180
260
|
}>;
|
|
261
|
+
passageHeading: (passage: Pick<GroundingPassage, "sectionTitle" | "passageTitle">) => string | null;
|
|
181
262
|
passagesForPrompt: (passages: GroundingPassage[]) => {
|
|
182
263
|
tag: string;
|
|
183
264
|
document: string | null;
|
|
@@ -191,6 +272,9 @@ declare const _default: {
|
|
|
191
272
|
search: KnowledgeSearch;
|
|
192
273
|
token: string;
|
|
193
274
|
topK?: number;
|
|
275
|
+
retry?: Pick<RetryOptions, "waits" | "breaker" | "sleep">;
|
|
276
|
+
includeLogistics?: boolean;
|
|
277
|
+
microSkills?: string[];
|
|
194
278
|
}) => Promise<{
|
|
195
279
|
passages: GroundingPassage[];
|
|
196
280
|
skipped: SkippedSource[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stackfactorKnowledge.d.ts","sourceRoot":"","sources":["../../src/stackfactorKnowledge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stackfactorKnowledge.d.ts","sourceRoot":"","sources":["../../src/stackfactorKnowledge.ts"],"names":[],"mappings":"AAyCA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,kGAAkG;AAClG,eAAO,MAAM,qBAAqB;;;;;EAKhC,CAAC;AAEH,0FAA0F;AAC1F,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,0EAA0E;AAC1E,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,0EAA0E;AAC1E,eAAO,MAAM,aAAa,IAAI,CAAC;AAQ/B,iFAAiF;AACjF,MAAM,WAAW,cAAc;IAC7B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AO,CAAC,CAAC;QAC1D,gBAAgB,CAAC,EAAE,OAAO,CAAC;QAC3B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;KACxB,KAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;QAAC,OAAO,EAAE,aAAa,EAAE,CAAA;KAAE,CAAC;oCAvFzB,OAAO,KAAG,eAAe,EAAE;wCA5BvB,OAAO,KAAG,eAAe,EAAE;;AAqU7E,wBAYE"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.referencesFor = exports.passagesForPrompt = exports.passageHeading = exports.retrievePassages = exports.sourcesFromCoverage = exports.sourcesFromReferences = exports.PASSAGE_ROLE = exports.DEFAULT_TOP_K = exports.QUERY_MAX_LENGTH = exports.SEARCH_DOCUMENT_IDS_MAX = exports.STACKFACTOR_REFERENCE = void 0;
|
|
2
7
|
//
|
|
3
8
|
// StackFactor knowledge — grounding generated content in the knowledge bases
|
|
4
9
|
//
|
|
@@ -17,8 +22,8 @@
|
|
|
17
22
|
// run reads only what that person may open. A knowledge base the person
|
|
18
23
|
// cannot read is skipped and reported (`retrievePassages`): grounding from
|
|
19
24
|
// skill coverage generates without it. A knowledge base that references
|
|
20
|
-
// cite is another matter (Candin, 2026-10-13): the
|
|
21
|
-
// (
|
|
25
|
+
// cite is another matter (Candin, 2026-10-13): the source store
|
|
26
|
+
// (`sourceStore.prepareSources`) stops the run with a
|
|
22
27
|
// KnowledgeAccessError instead.
|
|
23
28
|
//
|
|
24
29
|
// A reference points at the content and never copies it: the passage is
|
|
@@ -34,10 +39,12 @@
|
|
|
34
39
|
//
|
|
35
40
|
// The search itself is the caller's (`search`: client-api
|
|
36
41
|
// `knowledgeBaseAgent.search`, 1.11 or later for `documentIds`), so this
|
|
37
|
-
// module needs no particular client-api.
|
|
42
|
+
// module needs no particular client-api. A search that fails for a reason
|
|
43
|
+
// that may pass is made again (retry.ts: 2 s, then 6 s; never a refusal);
|
|
44
|
+
// one that still fails is reported, not hidden.
|
|
38
45
|
//
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
const logger_js_1 = __importDefault(require("./logger.js"));
|
|
47
|
+
const retry_js_1 = require("./retry.js");
|
|
41
48
|
/** What a STACKFACTOR reference to a knowledge base document carries (backend-core REFERENCE). */
|
|
42
49
|
exports.STACKFACTOR_REFERENCE = Object.freeze({
|
|
43
50
|
KIND: "STACKFACTOR",
|
|
@@ -55,8 +62,7 @@ exports.DEFAULT_TOP_K = 8;
|
|
|
55
62
|
const CONCURRENCY = 4;
|
|
56
63
|
/** Statuses that mean the person may not read the knowledge base, or it is gone. */
|
|
57
64
|
const NO_ACCESS = new Set([401, 403, 404]);
|
|
58
|
-
|
|
59
|
-
const RETRY_DELAY_MS = 200;
|
|
65
|
+
exports.PASSAGE_ROLE = Object.freeze({ TEACHING: "teaching", LOGISTICS: "logistics" });
|
|
60
66
|
const text = (value) => (typeof value === "string" ? value.trim() : "");
|
|
61
67
|
/** An http(s) address, or null: a reference's url lands in an `href`. */
|
|
62
68
|
const webUrl = (value) => (/^https?:\/\//i.test(text(value)) ? text(value) : null);
|
|
@@ -133,26 +139,47 @@ const inPool = async (items, limit, worker) => {
|
|
|
133
139
|
};
|
|
134
140
|
await Promise.all(Array.from({ length: Math.min(limit, items.length) }, run));
|
|
135
141
|
};
|
|
136
|
-
/** The status of a failed platform call, from an axios error or one shaped like it. */
|
|
137
|
-
const statusOf = (error) => {
|
|
138
|
-
const status = error?.response?.status ?? error?.status;
|
|
139
|
-
return typeof status === "number" ? status : null;
|
|
140
|
-
};
|
|
141
|
-
const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
142
142
|
/**
|
|
143
143
|
* Searches every source for every query, under the person's access, and hands
|
|
144
144
|
* back the passages found, best first, each once, tagged "k1", "k2"… for the
|
|
145
145
|
* model to cite. A source with documents is searched within them (in batches of
|
|
146
146
|
* SEARCH_DOCUMENT_IDS_MAX); one without, whole. A source the person may not
|
|
147
147
|
* read (401, 403, 404) is skipped: none of its passages are used and no more of
|
|
148
|
-
* its searches are made. A search that fails
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
148
|
+
* its searches are made. A search that fails for a reason that may pass (a
|
|
149
|
+
* timeout, a rate limit, a 5xx, the network) is made again (retryTransient:
|
|
150
|
+
* after 2 s, then 6 s, under `retry.breaker` when the caller shares one
|
|
151
|
+
* across its searches); one that still fails, or failed for a reason that
|
|
152
|
+
* will not pass (a 422), is reported and the passages its other searches
|
|
153
|
+
* found stand. A refusal is never tried again, and a search is not retried
|
|
154
|
+
* once its knowledge base refused the person meanwhile. Either way it is in
|
|
155
|
+
* `skipped`, once per knowledge base, and the passages of the others stand;
|
|
156
|
+
* whether a skip is an error is the caller's to say.
|
|
157
|
+
*
|
|
158
|
+
* A passage ingestion labelled as logistics is left out: an agenda or a
|
|
159
|
+
* syllabus slide matches any query on the course's subject and teaches
|
|
160
|
+
* nothing, and one was cited as the source of a micro-skill (prod,
|
|
161
|
+
* 2026-11-16). The search is asked to leave them out itself
|
|
162
|
+
* (`excludePassageRoles`, backend-core #1065), so it still answers `topK`
|
|
163
|
+
* passages: dropped only after the search, they took more than half of each
|
|
164
|
+
* answer with them, and 7 of 10 searches of 8 kept none (the same day). A
|
|
165
|
+
* platform that does not know the option answers them all the same, so any
|
|
166
|
+
* that come back are dropped here, and the count is logged. `includeLogistics`
|
|
167
|
+
* keeps them, for a reader that must see what a reference cites whatever it
|
|
168
|
+
* is. A passage with no label is kept.
|
|
169
|
+
*
|
|
170
|
+
* `microSkills` names microskills of the knowledge bases, as their microskill
|
|
171
|
+
* lists name them: every search is asked to put the passages ingestion
|
|
172
|
+
* labelled with one of them first (backend-core #1072), and they rank first
|
|
173
|
+
* here too, in the searches' own order, ahead of every other passage whatever
|
|
174
|
+
* its score. Asked for by name through the search alone, a microskill's own
|
|
175
|
+
* passages lost to ones sharing words with the skill's name, and the wrong
|
|
176
|
+
* passage was cited (prod, 2026-11-17). A platform that does not know the
|
|
177
|
+
* option answers as before, and nothing is marked.
|
|
153
178
|
* @param options `sources`, `queries`, `search` (client-api
|
|
154
179
|
* `knowledgeBaseAgent.search`), `token` (the run's AGENT token), `topK`
|
|
155
|
-
* per search (default DEFAULT_TOP_K)
|
|
180
|
+
* per search (default DEFAULT_TOP_K), `retry` (`waits`, `breaker`, `sleep`
|
|
181
|
+
* for retryTransient; default: RETRY_WAITS, no breaker), `includeLogistics`
|
|
182
|
+
* (default false), `microSkills` (default none)
|
|
156
183
|
* @returns `{ passages, skipped }`
|
|
157
184
|
*/
|
|
158
185
|
const retrievePassages = async (options) => {
|
|
@@ -173,29 +200,30 @@ const retrievePassages = async (options) => {
|
|
|
173
200
|
}
|
|
174
201
|
}
|
|
175
202
|
}
|
|
203
|
+
// What every search is asked to leave out: nothing, for a reader of what a
|
|
204
|
+
// reference cites.
|
|
205
|
+
const leftOut = options.includeLogistics
|
|
206
|
+
? {}
|
|
207
|
+
: { excludePassageRoles: [exports.PASSAGE_ROLE.LOGISTICS] };
|
|
208
|
+
const microSkills = [
|
|
209
|
+
...new Set((Array.isArray(options.microSkills) ? options.microSkills : []).map(text).filter(Boolean)),
|
|
210
|
+
];
|
|
211
|
+
const named = microSkills.length > 0 ? { microSkills } : {};
|
|
176
212
|
const found = new Map();
|
|
177
213
|
const skipped = new Map();
|
|
178
214
|
await inPool(searches, CONCURRENCY, async ({ source, query, documentIds, order }) => {
|
|
179
215
|
if (skipped.get(source.knowledgeBaseId)?.noAccess)
|
|
180
216
|
return;
|
|
181
|
-
const searchOnce = () => options.search(source.knowledgeBaseId, query, documentIds ? {
|
|
217
|
+
const searchOnce = () => options.search(source.knowledgeBaseId, query, { topK, ...(documentIds ? { documentIds } : {}), ...leftOut, ...named }, options.token);
|
|
182
218
|
try {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
// unless the base refused the person meanwhile.
|
|
192
|
-
if (NO_ACCESS.has(statusOf(error)))
|
|
193
|
-
throw error;
|
|
194
|
-
await delay(RETRY_DELAY_MS);
|
|
195
|
-
if (skipped.get(source.knowledgeBaseId)?.noAccess)
|
|
196
|
-
return;
|
|
197
|
-
answer = await searchOnce();
|
|
198
|
-
}
|
|
219
|
+
// A refusal is the platform's answer and is not asked again (it is not
|
|
220
|
+
// transient). A failure that may pass is made again after its waits —
|
|
221
|
+
// unless the base refused the person meanwhile.
|
|
222
|
+
const answer = await (0, retry_js_1.retryTransient)(`search "${query}" in knowledge base ${source.knowledgeBaseId}`, searchOnce, {
|
|
223
|
+
...options.retry,
|
|
224
|
+
key: source.knowledgeBaseId,
|
|
225
|
+
stopWhen: () => Boolean(skipped.get(source.knowledgeBaseId)?.noAccess),
|
|
226
|
+
});
|
|
199
227
|
(Array.isArray(answer?.chunks) ? answer.chunks : []).forEach((chunk, rank) => {
|
|
200
228
|
const chunkId = id(chunk?._id);
|
|
201
229
|
if (!chunkId || !id(chunk?.documentId))
|
|
@@ -206,12 +234,14 @@ const retrievePassages = async (options) => {
|
|
|
206
234
|
found.set(chunkId, {
|
|
207
235
|
chunk: better ? chunk : known.chunk,
|
|
208
236
|
knowledgeBaseId: source.knowledgeBaseId,
|
|
237
|
+
// Labelled in any search is labelled: the mark is the passage's, not the query's.
|
|
238
|
+
labelled: chunk.labelled === true || known?.labelled === true,
|
|
209
239
|
order: known ? Math.min(known.order, order * 1000 + rank) : order * 1000 + rank,
|
|
210
240
|
});
|
|
211
241
|
});
|
|
212
242
|
}
|
|
213
243
|
catch (error) {
|
|
214
|
-
const status = statusOf(error);
|
|
244
|
+
const status = (0, retry_js_1.statusOf)(error);
|
|
215
245
|
const noAccess = status !== null && NO_ACCESS.has(status);
|
|
216
246
|
// A refusal outranks a failure reported before it.
|
|
217
247
|
if (skipped.has(source.knowledgeBaseId) && !noAccess)
|
|
@@ -224,10 +254,21 @@ const retrievePassages = async (options) => {
|
|
|
224
254
|
});
|
|
225
255
|
}
|
|
226
256
|
});
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
.
|
|
257
|
+
const readable = [...found.entries()].filter(([, entry]) => !skipped.get(entry.knowledgeBaseId)?.noAccess);
|
|
258
|
+
const kept = options.includeLogistics
|
|
259
|
+
? readable
|
|
260
|
+
: readable.filter(([, entry]) => passageRoleOf(entry.chunk.passageRole) !== exports.PASSAGE_ROLE.LOGISTICS);
|
|
261
|
+
if (kept.length < readable.length) {
|
|
262
|
+
logger_js_1.default.log(null, logger_js_1.default.levels.info, `[Knowledge Base] ${readable.length - kept.length} logistics passage(s) the search answered were left out: an agenda, a schedule or a title slide teaches nothing`);
|
|
263
|
+
}
|
|
264
|
+
const passages = kept
|
|
265
|
+
.sort(
|
|
266
|
+
// Labelled first, in the searches' own order: one the search's two legs
|
|
267
|
+
// missed has no score to rank by.
|
|
268
|
+
([, a], [, b]) => Number(b.labelled) - Number(a.labelled) ||
|
|
269
|
+
(a.labelled ? 0 : (b.chunk.score ?? 0) - (a.chunk.score ?? 0)) ||
|
|
270
|
+
a.order - b.order)
|
|
271
|
+
.map(([chunkId, { chunk, knowledgeBaseId, labelled }], index) => ({
|
|
231
272
|
chunkId,
|
|
232
273
|
documentId: id(chunk.documentId),
|
|
233
274
|
documentName: text(chunk.documentName) || null,
|
|
@@ -236,6 +277,9 @@ const retrievePassages = async (options) => {
|
|
|
236
277
|
knowledgeBaseId: id(chunk.knowledgeBaseId) || knowledgeBaseId,
|
|
237
278
|
pageNumber: typeof chunk.pageNumber === "number" ? chunk.pageNumber : null,
|
|
238
279
|
score: typeof chunk.score === "number" ? chunk.score : null,
|
|
280
|
+
...(labelled ? { labelled: true } : {}),
|
|
281
|
+
passageRole: passageRoleOf(chunk.passageRole),
|
|
282
|
+
passageTitle: text(chunk.passageTitle) || null,
|
|
239
283
|
sectionTitle: text(chunk.sectionTitle) || null,
|
|
240
284
|
skills: (Array.isArray(chunk.skills) ? chunk.skills : []).map((skill) => ({
|
|
241
285
|
microSkills: (Array.isArray(skill?.microSkills) ? skill.microSkills : []).filter((name) => typeof name === "string"),
|
|
@@ -247,14 +291,28 @@ const retrievePassages = async (options) => {
|
|
|
247
291
|
return { passages, skipped: [...skipped.values()] };
|
|
248
292
|
};
|
|
249
293
|
exports.retrievePassages = retrievePassages;
|
|
294
|
+
/** A passage's role as the platform sent it: one of PASSAGE_ROLE, else null. */
|
|
295
|
+
const passageRoleOf = (value) => value === exports.PASSAGE_ROLE.TEACHING || value === exports.PASSAGE_ROLE.LOGISTICS ? value : null;
|
|
296
|
+
/**
|
|
297
|
+
* What a passage is headed by, for a reader: the title ingestion wrote from
|
|
298
|
+
* its content, else the heading its document carries. A slide's own heading
|
|
299
|
+
* is often a time allowance ("Total Time: 40 minutes") or the heading of the
|
|
300
|
+
* slide before, over a passage that teaches something else.
|
|
301
|
+
* @param passage A passage, as `retrievePassages` answers it
|
|
302
|
+
* @returns The heading, or null when the passage has neither
|
|
303
|
+
*/
|
|
304
|
+
const passageHeading = (passage) => text(passage.passageTitle) || passage.sectionTitle || null;
|
|
305
|
+
exports.passageHeading = passageHeading;
|
|
250
306
|
/**
|
|
251
|
-
* The passages as a prompt shows them: tag, where each came from, and its
|
|
307
|
+
* The passages as a prompt shows them: tag, where each came from, and its
|
|
308
|
+
* text. `section` is the passage's heading (`passageHeading`), which is also
|
|
309
|
+
* its reference's description, so a reader can match one to the other.
|
|
252
310
|
* @param passages From `retrievePassages`
|
|
253
311
|
* @returns `[{ tag, document, section, text }]`, for the model's input
|
|
254
312
|
*/
|
|
255
313
|
const passagesForPrompt = (passages) => (Array.isArray(passages) ? passages : []).map((passage) => ({
|
|
256
314
|
document: passage.documentName,
|
|
257
|
-
section: passage
|
|
315
|
+
section: (0, exports.passageHeading)(passage),
|
|
258
316
|
tag: passage.tag,
|
|
259
317
|
text: passage.text,
|
|
260
318
|
}));
|
|
@@ -266,6 +324,10 @@ exports.passagesForPrompt = passagesForPrompt;
|
|
|
266
324
|
* page at the source (`url`) when the passage has one. Each is titled by its
|
|
267
325
|
* document's title, else its name, else its section; its pointer keeps the
|
|
268
326
|
* document's name (`knowledgeBase.documentName`) when the passage has one.
|
|
327
|
+
* Its `description` is the passage's heading (`passageHeading`: the title
|
|
328
|
+
* written from its content, else the document's own heading), while its
|
|
329
|
+
* pointer's `sectionTitle` stays the document's heading: that is what tells
|
|
330
|
+
* two passages of one section apart from two sections.
|
|
269
331
|
* @param passages From `retrievePassages`
|
|
270
332
|
* @param tags The tags the model cited ("k3", "K3" and " k3 " alike)
|
|
271
333
|
* @returns The references, ready for a skill's, a microskill's or a question's `references`
|
|
@@ -281,7 +343,7 @@ const referencesFor = (passages, tags) => {
|
|
|
281
343
|
const url = webUrl(passage.documentUrl);
|
|
282
344
|
const documentName = text(passage.documentName);
|
|
283
345
|
return {
|
|
284
|
-
description: passage
|
|
346
|
+
description: (0, exports.passageHeading)(passage),
|
|
285
347
|
kind: exports.STACKFACTOR_REFERENCE.KIND,
|
|
286
348
|
knowledgeBase: {
|
|
287
349
|
chunkId: passage.chunkId,
|
|
@@ -307,7 +369,9 @@ exports.default = {
|
|
|
307
369
|
DEFAULT_TOP_K: exports.DEFAULT_TOP_K,
|
|
308
370
|
QUERY_MAX_LENGTH: exports.QUERY_MAX_LENGTH,
|
|
309
371
|
SEARCH_DOCUMENT_IDS_MAX: exports.SEARCH_DOCUMENT_IDS_MAX,
|
|
372
|
+
PASSAGE_ROLE: exports.PASSAGE_ROLE,
|
|
310
373
|
STACKFACTOR_REFERENCE: exports.STACKFACTOR_REFERENCE,
|
|
374
|
+
passageHeading: exports.passageHeading,
|
|
311
375
|
passagesForPrompt: exports.passagesForPrompt,
|
|
312
376
|
referencesFor: exports.referencesFor,
|
|
313
377
|
retrievePassages: exports.retrievePassages,
|
package/dist/cjs/tavily.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type TavilyConfig = {
|
|
|
51
51
|
* trailing slash, and sent as listed). Any other URL is never sent to
|
|
52
52
|
* Tavily: the tool answers the model with an error line for it and never
|
|
53
53
|
* throws. Unset, any URL may be read. Only `web_extract` reads it, so a run
|
|
54
|
-
* kept to its pages enables `extract` alone
|
|
54
|
+
* kept to its pages enables `extract` alone.
|
|
55
55
|
*/
|
|
56
56
|
allowedUrls?: string[];
|
|
57
57
|
};
|
|
@@ -90,6 +90,15 @@ export declare const assertTavilyUsable: (config: any, options: TavilyConfig) =>
|
|
|
90
90
|
* @returns LangChain tool instances to append to the agent's tool list
|
|
91
91
|
*/
|
|
92
92
|
export declare const buildTavilyTools: (config: any, options: TavilyConfig, usageTracker?: UsageTracker | null) => any[];
|
|
93
|
+
/** What a link check found, each URL exactly as it was passed. */
|
|
94
|
+
export interface UrlCheck {
|
|
95
|
+
/** Tavily fetched it. */
|
|
96
|
+
reachable: Set<string>;
|
|
97
|
+
/** Tavily could not fetch it, or it is no `http:` or `https:` URL. */
|
|
98
|
+
unreachable: Set<string>;
|
|
99
|
+
/** The check itself did not run for it: nothing is known about the link. */
|
|
100
|
+
unchecked: Set<string>;
|
|
101
|
+
}
|
|
93
102
|
/**
|
|
94
103
|
* Which of these URLs resolve, judged by Tavily fetching them rather than by
|
|
95
104
|
* this process connecting to them.
|
|
@@ -111,10 +120,102 @@ export declare const buildTavilyTools: (config: any, options: TavilyConfig, usag
|
|
|
111
120
|
* fetch under `failed_results`. So a URL listed there is unreachable, and every
|
|
112
121
|
* other URL of a batch Tavily answered is reachable (the results may name a
|
|
113
122
|
* URL by its address after a redirect, which is why they are not matched). A
|
|
114
|
-
* batch whose call fails outright, or a config without `tavilyAPIKey`,
|
|
115
|
-
*
|
|
123
|
+
* batch whose call fails outright, or a config without `tavilyAPIKey`, says
|
|
124
|
+
* nothing about its URLs: they are `unchecked`, which is not `unreachable`.
|
|
125
|
+
* The caller decides what an unchecked link is worth; dropping it as dead
|
|
126
|
+
* loses every citation to one failed call.
|
|
116
127
|
*
|
|
117
|
-
* @param urls - The URLs to check; a URL given twice is checked once
|
|
128
|
+
* @param urls - The URLs to check; a URL given twice is checked once. A value
|
|
129
|
+
* that is no string is in no set
|
|
130
|
+
* @param config - The integration config; supplies `tavilyAPIKey`
|
|
131
|
+
* @param usageTracker - Optional accumulator the credits are counted into
|
|
132
|
+
* @returns The given URLs, exactly as passed, each in one of the three sets
|
|
133
|
+
*/
|
|
134
|
+
export declare const checkUrls: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null) => Promise<UrlCheck>;
|
|
135
|
+
/** What reading one URL in full gave: its text, or why there is none. */
|
|
136
|
+
export interface UrlRead {
|
|
137
|
+
/** The URL exactly as it was passed. */
|
|
138
|
+
url: string;
|
|
139
|
+
/** The page's text as markdown; absent when it could not be read. */
|
|
140
|
+
text?: string;
|
|
141
|
+
/** The page's own title, when Tavily gave one. */
|
|
142
|
+
title?: string;
|
|
143
|
+
/** Why it could not be read; absent when it was. */
|
|
144
|
+
error?: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Reads URLs in full, without a model: each page's whole text as markdown, or
|
|
148
|
+
* why it could not be read. What a run's source store holds of the pages its
|
|
149
|
+
* references point at (`sourceStore.prepareSources`).
|
|
150
|
+
*
|
|
151
|
+
* Nothing is trimmed here: Tavily returns whatever the page holds, which for a
|
|
152
|
+
* long PDF is over a million characters. The caller holds the text outside the
|
|
153
|
+
* model's context and hands it over a page at a time.
|
|
154
|
+
*
|
|
155
|
+
* They go in batches of 20, Tavily's limit, and are billed and recorded like
|
|
156
|
+
* every other Tavily call (`tavilyCredits`, `webSearchSources`,
|
|
157
|
+
* `attemptedUrls`). A URL Tavily could not fetch is asked for once more: its
|
|
158
|
+
* answer does not tell a page that is gone from one that failed for a moment.
|
|
159
|
+
* Tavily may name a result by the address it was redirected to, so a URL it
|
|
160
|
+
* neither returned under its own address nor listed as failed is asked for
|
|
161
|
+
* again on its own, where the one result is its.
|
|
162
|
+
*
|
|
163
|
+
* @param urls - The URLs to read; a URL given twice is read once. A value
|
|
164
|
+
* that is no string is left out
|
|
165
|
+
* @param config - The integration config; supplies `tavilyAPIKey`
|
|
166
|
+
* @param usageTracker - Optional accumulator the credits are counted into
|
|
167
|
+
* @returns One entry per distinct URL, in the order given
|
|
168
|
+
*/
|
|
169
|
+
export declare const readUrls: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null) => Promise<UrlRead[]>;
|
|
170
|
+
/**
|
|
171
|
+
* A cited link's check did not run, after the retries: Tavily's call for it
|
|
172
|
+
* failed, or no key was configured. Such a link is not dead, so nothing is
|
|
173
|
+
* dropped for it; the person is asked to try again. Its message is the coded
|
|
174
|
+
* JSON an agent's failure carries (`{ code, message }`, 503), so `serve`
|
|
175
|
+
* answers the person with the sentence, not a 500.
|
|
176
|
+
*/
|
|
177
|
+
export declare class LinksNotCheckedError extends Error {
|
|
178
|
+
readonly code = 503;
|
|
179
|
+
/** How many of the links went unchecked. */
|
|
180
|
+
readonly unchecked: number;
|
|
181
|
+
/** How many links were checked, each once. */
|
|
182
|
+
readonly total: number;
|
|
183
|
+
/**
|
|
184
|
+
* @param unchecked How many of the links went unchecked
|
|
185
|
+
* @param total How many links were checked, each once
|
|
186
|
+
*/
|
|
187
|
+
constructor(unchecked: number, total: number);
|
|
188
|
+
}
|
|
189
|
+
/** How `unreachableUrls` waits between its checks. */
|
|
190
|
+
export interface UnreachableUrlsOptions {
|
|
191
|
+
/** How long to wait before each check of the links still unchecked, in milliseconds. Default RETRY_WAITS. */
|
|
192
|
+
waits?: readonly number[];
|
|
193
|
+
/** How to wait; swappable in tests. */
|
|
194
|
+
sleep?: (ms: number) => Promise<void>;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* The cited links that are dead: the ones Tavily could not fetch, and any
|
|
198
|
+
* that is no web link (`checkUrls`). A link whose check did not run (one
|
|
199
|
+
* dropped connection fails the 20 links of its call) is checked again, with
|
|
200
|
+
* the others like it and no link already settled, after each of the waits.
|
|
201
|
+
* One still unchecked after them is not called dead: the call throws, so the
|
|
202
|
+
* caller drops nothing for a check that did not run.
|
|
203
|
+
*
|
|
204
|
+
* @param urls - The links; a link given twice is checked once
|
|
205
|
+
* @param config - The integration config; supplies `tavilyAPIKey`
|
|
206
|
+
* @param usageTracker - Optional accumulator the credits are counted into
|
|
207
|
+
* @param options - `waits` (default RETRY_WAITS) and `sleep`
|
|
208
|
+
* @returns The dead links, each exactly as passed
|
|
209
|
+
* @throws {LinksNotCheckedError} When a link is still unchecked after the waits
|
|
210
|
+
*/
|
|
211
|
+
export declare const unreachableUrls: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null, options?: UnreachableUrlsOptions) => Promise<Set<string>>;
|
|
212
|
+
/**
|
|
213
|
+
* The URLs of `checkUrls` that Tavily fetched, and nothing about the rest.
|
|
214
|
+
*
|
|
215
|
+
* @deprecated Use `checkUrls`. This answer cannot tell a dead link from one
|
|
216
|
+
* whose check did not run, so a caller that drops what is missing from it
|
|
217
|
+
* drops every link when one call fails.
|
|
218
|
+
* @param urls - The URLs to check
|
|
118
219
|
* @param config - The integration config; supplies `tavilyAPIKey`
|
|
119
220
|
* @param usageTracker - Optional accumulator the credits are counted into
|
|
120
221
|
* @returns The given URLs, exactly as passed, that resolve
|
|
@@ -123,7 +224,10 @@ export declare const checkUrlsReachable: (urls: readonly string[], config: any,
|
|
|
123
224
|
declare const _default: {
|
|
124
225
|
assertTavilyUsable: (config: any, options: TavilyConfig) => void;
|
|
125
226
|
buildTavilyTools: (config: any, options: TavilyConfig, usageTracker?: UsageTracker | null) => any[];
|
|
227
|
+
checkUrls: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null) => Promise<UrlCheck>;
|
|
126
228
|
checkUrlsReachable: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null) => Promise<Set<string>>;
|
|
229
|
+
readUrls: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null) => Promise<UrlRead[]>;
|
|
230
|
+
unreachableUrls: (urls: readonly string[], config: any, usageTracker?: UsageTracker | null, options?: UnreachableUrlsOptions) => Promise<Set<string>>;
|
|
127
231
|
getTavilyOptions: (config: any) => TavilyConfig | null;
|
|
128
232
|
recordTavilyUsage: (tracker: UsageTracker | null | undefined, _config: any, credits: number, sources: {
|
|
129
233
|
url: string;
|
package/dist/cjs/tavily.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tavily.d.ts","sourceRoot":"","sources":["../../src/tavily.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tavily.d.ts","sourceRoot":"","sources":["../../src/tavily.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AA0BnD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,cAAc,EAAE,CAAC;IACzB,iEAAiE;IACjE,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,MAAM,GAAG,YAAY,CAAC;IAC3D,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,GAAG,UAAU,CAAC;IACpC,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oEAAoE;IACpE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,6CAA6C;IAC7C,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,uEAAuE;IACvE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