@cerebriline/core 4.100.245 → 4.100.246
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/dist/extensions/context/capped-thinking.d.ts +5 -0
- package/dist/extensions/context/compaction.d.ts +6 -0
- package/dist/extensions/tools/code-search.d.ts +16 -0
- package/dist/extensions/tools/library-tools.d.ts +14 -0
- package/dist/extensions/tools/schemas.d.ts +2 -11
- package/dist/extensions/tools/types.d.ts +9 -1
- package/dist/extensions/tools/web-scrape-tool.d.ts +49 -0
- package/dist/extensions/tools/web-site-crawl.d.ts +96 -0
- package/dist/hub/daemon/entry.js +560 -560
- package/dist/hub/index.js +553 -553
- package/dist/index.d.ts +3 -1
- package/dist/index.js +825 -818
- package/dist/runtime/host/local-runtime-host.d.ts +2 -0
- package/dist/services/retrieval/code-index.d.ts +2 -0
- package/dist/services/retrieval/firecrawl.d.ts +15 -0
- package/dist/services/retrieval/web-mirror.d.ts +101 -0
- package/package.json +4 -4
|
@@ -59,6 +59,8 @@ export declare class LocalRuntimeHost implements RuntimeHost {
|
|
|
59
59
|
private readonly sessions;
|
|
60
60
|
private readonly manifestMutationQueues;
|
|
61
61
|
private readonly usageBySession;
|
|
62
|
+
/** Per session: the listener for its background requests' waits. */
|
|
63
|
+
private readonly sideCallUnsubscribes;
|
|
62
64
|
private readonly aggregateUsageBySession;
|
|
63
65
|
private readonly subAgentStarts;
|
|
64
66
|
private readonly pendingPromptsController;
|
|
@@ -65,6 +65,8 @@ export interface CodeSearchOptions {
|
|
|
65
65
|
reranker?: RetrievalEndpoint;
|
|
66
66
|
/** Passages returned. @default 8 */
|
|
67
67
|
limit?: number;
|
|
68
|
+
/** How the folder's files are read for line numbers. @default from disk */
|
|
69
|
+
readFile?: (absolutePath: string) => Promise<string | undefined>;
|
|
68
70
|
signal?: AbortSignal;
|
|
69
71
|
}
|
|
70
72
|
export interface CodeHit {
|
|
@@ -21,6 +21,11 @@ export interface ScrapedPage {
|
|
|
21
21
|
sha256: string;
|
|
22
22
|
/** The links on the page, when they were asked for. */
|
|
23
23
|
links?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* The whole page as the browser held it after its scripts ran, when it
|
|
26
|
+
* was asked for: every tag, nothing cleaned out.
|
|
27
|
+
*/
|
|
28
|
+
rawHtml?: string;
|
|
24
29
|
}
|
|
25
30
|
export interface ScrapeFailure {
|
|
26
31
|
url: string;
|
|
@@ -34,6 +39,15 @@ export interface CrawlOptions {
|
|
|
34
39
|
/** Only paths matching these (regular expressions), when given. */
|
|
35
40
|
includePaths?: readonly string[];
|
|
36
41
|
excludePaths?: readonly string[];
|
|
42
|
+
/**
|
|
43
|
+
* Follow links anywhere on the site. Without it a crawl stays below the
|
|
44
|
+
* address it starts from: from `/docs/intro` it never reaches `/docs/api`.
|
|
45
|
+
*/
|
|
46
|
+
entireDomain?: boolean;
|
|
47
|
+
/** Also give each page's links, to tell what a crawl left unread. */
|
|
48
|
+
links?: boolean;
|
|
49
|
+
/** Also give each page whole, as rendered (`ScrapedPage.rawHtml`). */
|
|
50
|
+
rawHtml?: boolean;
|
|
37
51
|
signal?: AbortSignal;
|
|
38
52
|
fetch?: typeof fetch;
|
|
39
53
|
/** How long to wait for the crawl. @default 20 minutes */
|
|
@@ -62,6 +76,7 @@ export declare function htmlToMarkdown(html: string): Promise<string>;
|
|
|
62
76
|
/** Read one page. */
|
|
63
77
|
export declare function scrapePage(endpoint: ScrapeEndpoint, url: string, options?: RequestOptions & {
|
|
64
78
|
links?: boolean;
|
|
79
|
+
rawHtml?: boolean;
|
|
65
80
|
}): Promise<ScrapedPage>;
|
|
66
81
|
/** Read a page and the pages it links to, as deep and as many as `options` allow. */
|
|
67
82
|
export declare function crawlSite(endpoint: ScrapeEndpoint, url: string, options: CrawlOptions): Promise<CrawlResult>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A site's pages and the files they need, saved as they are.
|
|
3
|
+
*
|
|
4
|
+
* The scraping endpoint reads pages in a browser and gives back their content;
|
|
5
|
+
* it does not give back a stylesheet, a script, a picture or a font. Those are
|
|
6
|
+
* fetched here, straight from the site, by the machine this runs on.
|
|
7
|
+
*
|
|
8
|
+
* Nothing is rewritten. A page is saved as the site served it, byte for byte,
|
|
9
|
+
* and beside it as the browser held it once its scripts had run -- on a site
|
|
10
|
+
* built by JavaScript the first is a shell of a few lines and the second is
|
|
11
|
+
* the page. Links inside them still point where they pointed.
|
|
12
|
+
*/
|
|
13
|
+
export interface MirrorPage {
|
|
14
|
+
url: string;
|
|
15
|
+
/** The page as rendered, when the scraper gave it. */
|
|
16
|
+
rawHtml?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface MirrorLimits {
|
|
19
|
+
/** Files fetched besides the pages, at most. @default 2000 */
|
|
20
|
+
maxAssets?: number;
|
|
21
|
+
/** One file's size, at most. @default 25 MB */
|
|
22
|
+
maxAssetBytes?: number;
|
|
23
|
+
/** Everything fetched, at most. @default 300 MB */
|
|
24
|
+
maxTotalBytes?: number;
|
|
25
|
+
/** How many requests run at once. @default 6 */
|
|
26
|
+
concurrency?: number;
|
|
27
|
+
/** How long one request may take. @default 30 s */
|
|
28
|
+
timeoutMs?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface MirrorOptions extends MirrorLimits {
|
|
31
|
+
/** The folder everything is written under. */
|
|
32
|
+
root: string;
|
|
33
|
+
fetch?: typeof fetch;
|
|
34
|
+
signal?: AbortSignal;
|
|
35
|
+
onProgress?: (done: number, known: number) => void;
|
|
36
|
+
/**
|
|
37
|
+
* The file already saved for an address, from an earlier crawl into the
|
|
38
|
+
* same folder: it is not fetched again.
|
|
39
|
+
*/
|
|
40
|
+
have?: (url: string) => string | undefined;
|
|
41
|
+
/** Files to fetch besides those the pages name: what an earlier crawl left. */
|
|
42
|
+
also?: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
export interface MirroredPage {
|
|
45
|
+
url: string;
|
|
46
|
+
/** As the site served it; absent when the direct request failed. */
|
|
47
|
+
served?: string;
|
|
48
|
+
/** As the browser rendered it; absent when the scraper gave none. */
|
|
49
|
+
rendered?: string;
|
|
50
|
+
/** Why there is no `served`. */
|
|
51
|
+
problem?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface MirrorReport {
|
|
54
|
+
pages: MirroredPage[];
|
|
55
|
+
/** Files saved besides the pages, by their path under the folder. */
|
|
56
|
+
assets: {
|
|
57
|
+
url: string;
|
|
58
|
+
file: string;
|
|
59
|
+
bytes: number;
|
|
60
|
+
}[];
|
|
61
|
+
failed: {
|
|
62
|
+
url: string;
|
|
63
|
+
reason: string;
|
|
64
|
+
}[];
|
|
65
|
+
/** Files left out because a limit was reached. */
|
|
66
|
+
skipped: number;
|
|
67
|
+
/** Their addresses, for a later crawl to fetch. */
|
|
68
|
+
left: string[];
|
|
69
|
+
/** How many of them the limit of files stopped, and how many the total size. */
|
|
70
|
+
leftForCount: number;
|
|
71
|
+
leftForSize: number;
|
|
72
|
+
/** Files over the size one file may have; they are in `failed` too. */
|
|
73
|
+
tooLarge: number;
|
|
74
|
+
/** Files an earlier crawl had already saved. */
|
|
75
|
+
reused: number;
|
|
76
|
+
bytes: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Where a page or a file of a site goes under the folder: its host, then its
|
|
80
|
+
* path as the site has it. A page always ends in `.html`; a path ending in `/`
|
|
81
|
+
* is that folder's `index.html`. A page's query is part of its name, since two
|
|
82
|
+
* queries are two pages; a file's is not, since it is nearly always a cache
|
|
83
|
+
* stamp on one file.
|
|
84
|
+
*/
|
|
85
|
+
export declare function mirrorPath(url: string, kind: "page" | "asset", contentType?: string): string | undefined;
|
|
86
|
+
/** `X.html` as `X.rendered.html`. */
|
|
87
|
+
export declare function renderedPath(served: string): string;
|
|
88
|
+
/** The files a stylesheet needs: what it imports, and every `url(...)`. */
|
|
89
|
+
export declare function cssLinks(css: string, base: string): string[];
|
|
90
|
+
/**
|
|
91
|
+
* The files a page needs to look and behave as it does: stylesheets, scripts,
|
|
92
|
+
* pictures, fonts, icons, media. Not the pages it links to.
|
|
93
|
+
*/
|
|
94
|
+
export declare function assetLinks(html: string, pageUrl: string): string[];
|
|
95
|
+
/**
|
|
96
|
+
* Save `pages` and every file they need under `options.root`.
|
|
97
|
+
*
|
|
98
|
+
* Never throws for a page or a file that could not be had: each is in the
|
|
99
|
+
* report with its reason. Throws only when the run is aborted.
|
|
100
|
+
*/
|
|
101
|
+
export declare function mirrorSite(pages: readonly MirrorPage[], options: MirrorOptions): Promise<MirrorReport>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cerebriline/core",
|
|
3
3
|
"description": "Cerebriline Core SDK for Node Runtime",
|
|
4
|
-
"version": "4.100.
|
|
4
|
+
"version": "4.100.246",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/mann1x/cline.git",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"ws": "^8.20.0",
|
|
70
70
|
"yaml": "^2.8.2",
|
|
71
71
|
"zod": "^4.3.6",
|
|
72
|
-
"@cerebriline/agents": "4.100.
|
|
73
|
-
"@cerebriline/llms": "4.100.
|
|
74
|
-
"@cerebriline/shared": "4.100.
|
|
72
|
+
"@cerebriline/agents": "4.100.246",
|
|
73
|
+
"@cerebriline/llms": "4.100.246",
|
|
74
|
+
"@cerebriline/shared": "4.100.246"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"posthog-node": "^5.8.0"
|