dsh-web-search-pro 0.2.1 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +227 -0
- package/README.en.md +117 -0
- package/README.md +72 -578
- package/assets/skills/dsh-web-search-pro/SKILL.md +13 -12
- package/assets/skills/dsh-web-search-pro/references/config.md +36 -0
- package/assets/skills/dsh-web-search-pro/references/sources.md +13 -7
- package/assets/skills/dsh-web-search-pro/references/troubleshooting.md +3 -1
- package/catalog/sources.v1.json +16 -14
- package/lib/actions/approval.js +50 -1
- package/lib/actions/approval.js.map +1 -1
- package/lib/actions/config.js +274 -0
- package/lib/actions/config.js.map +1 -0
- package/lib/actions/errors.js +8 -1
- package/lib/actions/errors.js.map +1 -1
- package/lib/actions/format.js +10 -0
- package/lib/actions/format.js.map +1 -1
- package/lib/actions/index-view.js +2 -2
- package/lib/actions/index-view.js.map +1 -1
- package/lib/actions/read.js +7 -3
- package/lib/actions/read.js.map +1 -1
- package/lib/actions/registry.js +3 -1
- package/lib/actions/registry.js.map +1 -1
- package/lib/actions/run.js +2 -2
- package/lib/actions/run.js.map +1 -1
- package/lib/actions/schema.js +18 -0
- package/lib/actions/schema.js.map +1 -1
- package/lib/actions/search.js +7 -2
- package/lib/actions/search.js.map +1 -1
- package/lib/actions/sources.js +76 -18
- package/lib/actions/sources.js.map +1 -1
- package/lib/actions/types.js +19 -1
- package/lib/actions/types.js.map +1 -1
- package/lib/browser-access.js +25 -0
- package/lib/browser-access.js.map +1 -1
- package/lib/catalog/recommend.js +11 -3
- package/lib/catalog/recommend.js.map +1 -1
- package/lib/catalog/schema.js +3 -1
- package/lib/catalog/schema.js.map +1 -1
- package/lib/cli/builtin-specs.js +57 -22
- package/lib/cli/builtin-specs.js.map +1 -1
- package/lib/cli/chain.js +13 -12
- package/lib/cli/chain.js.map +1 -1
- package/lib/cli/chains-spec.js +31 -11
- package/lib/cli/chains-spec.js.map +1 -1
- package/lib/cli/engine.js +19 -3
- package/lib/cli/engine.js.map +1 -1
- package/lib/cli/opencli-sites.js +83 -0
- package/lib/cli/opencli-sites.js.map +1 -0
- package/lib/cli/opencli.js +65 -17
- package/lib/cli/opencli.js.map +1 -1
- package/lib/cli/probe.js +1 -1
- package/lib/cli/probe.js.map +1 -1
- package/lib/cli/runner.js +217 -27
- package/lib/cli/runner.js.map +1 -1
- package/lib/cli/spec.js +100 -20
- package/lib/cli/spec.js.map +1 -1
- package/lib/cli/time-text.js +79 -0
- package/lib/cli/time-text.js.map +1 -0
- package/lib/cli/trial.js +57 -0
- package/lib/cli/trial.js.map +1 -0
- package/lib/client/SettingsCard.js +14 -32
- package/lib/client/SettingsCard.js.map +1 -1
- package/lib/client/agent-mark.js +27 -0
- package/lib/client/agent-mark.js.map +1 -0
- package/lib/client/card-frame.js +118 -0
- package/lib/client/card-frame.js.map +1 -0
- package/lib/client/cli-form.js +257 -0
- package/lib/client/cli-form.js.map +1 -0
- package/lib/client/field-docs.js +130 -0
- package/lib/client/field-docs.js.map +1 -0
- package/lib/client/field-keys.js +81 -0
- package/lib/client/field-keys.js.map +1 -0
- package/lib/client/field-rows.js +71 -0
- package/lib/client/field-rows.js.map +1 -0
- package/lib/client/fill.js +3 -0
- package/lib/client/fill.js.map +1 -0
- package/lib/client/form-specs.js +13 -1
- package/lib/client/form-specs.js.map +1 -1
- package/lib/client/form.js +282 -24
- package/lib/client/form.js.map +1 -1
- package/lib/client/group-advanced.js +23 -0
- package/lib/client/group-advanced.js.map +1 -0
- package/lib/client/group-agent.js +28 -0
- package/lib/client/group-agent.js.map +1 -0
- package/lib/client/group-cli.js +136 -0
- package/lib/client/group-cli.js.map +1 -0
- package/lib/client/group-common.js +29 -0
- package/lib/client/group-common.js.map +1 -0
- package/lib/client/group-judge.js +67 -0
- package/lib/client/group-judge.js.map +1 -0
- package/lib/client/group-order.js +201 -0
- package/lib/client/group-order.js.map +1 -0
- package/lib/client/group-runtime.js +33 -0
- package/lib/client/group-runtime.js.map +1 -0
- package/lib/client/group-sources.js +83 -0
- package/lib/client/group-sources.js.map +1 -0
- package/lib/client/groups-basic.js +36 -0
- package/lib/client/groups-basic.js.map +1 -0
- package/lib/client/index.js.map +1 -1
- package/lib/client/json-list.js +50 -0
- package/lib/client/json-list.js.map +1 -0
- package/lib/client/locales.js +666 -219
- package/lib/client/locales.js.map +1 -1
- package/lib/client/order.js +192 -0
- package/lib/client/order.js.map +1 -0
- package/lib/client/overlay-ops.js +46 -0
- package/lib/client/overlay-ops.js.map +1 -0
- package/lib/client/sources-table.js +1 -0
- package/lib/client/sources-table.js.map +1 -1
- package/lib/client/styles.js +74 -47
- package/lib/client/styles.js.map +1 -1
- package/lib/client/text-view.js +98 -0
- package/lib/client/text-view.js.map +1 -0
- package/lib/client/ui-kit.js +120 -0
- package/lib/client/ui-kit.js.map +1 -0
- package/lib/client/validators.js +8 -1
- package/lib/client/validators.js.map +1 -1
- package/lib/client.js +7313 -1571
- package/lib/client.js.map +1 -1
- package/lib/config-fillers.js +53 -0
- package/lib/config-fillers.js.map +1 -0
- package/lib/config-groups.js +49 -0
- package/lib/config-groups.js.map +1 -0
- package/lib/config.js +84 -108
- package/lib/config.js.map +1 -1
- package/lib/default-chain.js +66 -0
- package/lib/default-chain.js.map +1 -0
- package/lib/deps.js +1 -1
- package/lib/deps.js.map +1 -1
- package/lib/engines.js +3 -3
- package/lib/engines.js.map +1 -1
- package/lib/fetch.js +23 -4
- package/lib/fetch.js.map +1 -1
- package/lib/fiber-config.js +5 -0
- package/lib/fiber-config.js.map +1 -0
- package/lib/index.js +36 -7
- package/lib/index.js.map +1 -1
- package/lib/overlay-types.js +88 -0
- package/lib/overlay-types.js.map +1 -0
- package/lib/overlay.js +683 -0
- package/lib/overlay.js.map +1 -0
- package/lib/pipeline/candidates.js +27 -1
- package/lib/pipeline/candidates.js.map +1 -1
- package/lib/pipeline/compile.js +63 -0
- package/lib/pipeline/compile.js.map +1 -1
- package/lib/pipeline/confidence.js +64 -0
- package/lib/pipeline/confidence.js.map +1 -0
- package/lib/pipeline/fusion.js +50 -3
- package/lib/pipeline/fusion.js.map +1 -1
- package/lib/pipeline/plan.js +2 -2
- package/lib/pipeline/plan.js.map +1 -1
- package/lib/pipeline/render.js +20 -2
- package/lib/pipeline/render.js.map +1 -1
- package/lib/pipeline/run.js +17 -5
- package/lib/pipeline/run.js.map +1 -1
- package/lib/pipeline/sources-spec.js +19 -3
- package/lib/pipeline/sources-spec.js.map +1 -1
- package/lib/providers/builtin.js +3 -0
- package/lib/providers/builtin.js.map +1 -1
- package/lib/providers/deepseek.js +348 -0
- package/lib/providers/deepseek.js.map +1 -0
- package/lib/providers/http.js.map +1 -1
- package/lib/providers/keyed-meta.js +7 -0
- package/lib/providers/keyed-meta.js.map +1 -1
- package/lib/providers/platforms.js +18 -17
- package/lib/providers/platforms.js.map +1 -1
- package/lib/providers/registry.js.map +1 -1
- package/lib/restart.js +47 -0
- package/lib/restart.js.map +1 -0
- package/lib/router.js +145 -26
- package/lib/router.js.map +1 -1
- package/lib/rpc-types.js +15 -0
- package/lib/rpc-types.js.map +1 -0
- package/lib/rpc.js +118 -0
- package/lib/rpc.js.map +1 -0
- package/lib/tools.js +10 -4
- package/lib/tools.js.map +1 -1
- package/lib/types/actions/approval.d.ts +11 -0
- package/lib/types/actions/config.d.ts +54 -0
- package/lib/types/actions/format.d.ts +9 -2
- package/lib/types/actions/run.d.ts +1 -0
- package/lib/types/actions/schema.d.ts +7 -1
- package/lib/types/actions/sources.d.ts +29 -3
- package/lib/types/actions/types.d.ts +28 -2
- package/lib/types/browser-access.d.ts +17 -0
- package/lib/types/catalog/recommend.d.ts +4 -0
- package/lib/types/catalog/schema.d.ts +2 -0
- package/lib/types/cli/builtin-specs.d.ts +11 -3
- package/lib/types/cli/chains-spec.d.ts +12 -3
- package/lib/types/cli/engine.d.ts +10 -3
- package/lib/types/cli/opencli-sites.d.ts +24 -0
- package/lib/types/cli/opencli.d.ts +42 -3
- package/lib/types/cli/runner.d.ts +47 -8
- package/lib/types/cli/spec.d.ts +101 -8
- package/lib/types/cli/time-text.d.ts +12 -0
- package/lib/types/cli/trial.d.ts +19 -0
- package/lib/types/client/SettingsCard.d.ts +17 -1
- package/lib/types/client/agent-mark.d.ts +22 -0
- package/lib/types/client/card-frame.d.ts +35 -0
- package/lib/types/client/cli-form.d.ts +97 -0
- package/lib/types/client/field-docs.d.ts +15 -0
- package/lib/types/client/field-keys.d.ts +41 -0
- package/lib/types/client/field-rows.d.ts +70 -0
- package/lib/types/client/fill.d.ts +2 -0
- package/lib/types/client/form-specs.d.ts +12 -3
- package/lib/types/client/form.d.ts +79 -1
- package/lib/types/client/group-advanced.d.ts +9 -0
- package/lib/types/client/group-agent.d.ts +20 -0
- package/lib/types/client/group-cli.d.ts +52 -0
- package/lib/types/client/group-common.d.ts +12 -0
- package/lib/types/client/group-judge.d.ts +17 -0
- package/lib/types/client/group-order.d.ts +26 -0
- package/lib/types/client/group-runtime.d.ts +15 -0
- package/lib/types/client/group-sources.d.ts +46 -0
- package/lib/types/client/groups-basic.d.ts +18 -0
- package/lib/types/client/index.d.ts +8 -0
- package/lib/types/client/json-list.d.ts +21 -0
- package/lib/types/client/locales.d.ts +1079 -200
- package/lib/types/client/order.d.ts +102 -0
- package/lib/types/client/overlay-ops.d.ts +37 -0
- package/lib/types/client/styles.d.ts +56 -41
- package/lib/types/client/text-view.d.ts +22 -0
- package/lib/types/client/ui-kit.d.ts +200 -0
- package/lib/types/config-fillers.d.ts +9 -0
- package/lib/types/config-groups.d.ts +23 -0
- package/lib/types/config.d.ts +263 -225
- package/lib/types/default-chain.d.ts +63 -0
- package/lib/types/engines.d.ts +29 -1
- package/lib/types/fetch.d.ts +12 -3
- package/lib/types/fiber-config.d.ts +18 -0
- package/lib/types/index.d.ts +164 -150
- package/lib/types/overlay-types.d.ts +98 -0
- package/lib/types/overlay.d.ts +141 -0
- package/lib/types/pipeline/candidates.d.ts +17 -0
- package/lib/types/pipeline/compile.d.ts +11 -0
- package/lib/types/pipeline/confidence.d.ts +35 -0
- package/lib/types/pipeline/fusion.d.ts +23 -1
- package/lib/types/pipeline/render.d.ts +16 -0
- package/lib/types/pipeline/run.d.ts +2 -1
- package/lib/types/pipeline/sources-spec.d.ts +5 -2
- package/lib/types/pipeline/types.d.ts +37 -0
- package/lib/types/providers/deepseek.d.ts +130 -0
- package/lib/types/providers/http.d.ts +2 -1
- package/lib/types/providers/keyed-meta.d.ts +5 -0
- package/lib/types/providers/registry.d.ts +7 -0
- package/lib/types/restart.d.ts +52 -0
- package/lib/types/router.d.ts +57 -10
- package/lib/types/rpc-types.d.ts +79 -0
- package/lib/types/rpc.d.ts +74 -0
- package/lib/types/tools.d.ts +6 -0
- package/lib/types/util.d.ts +10 -0
- package/lib/util.js +10 -1
- package/lib/util.js.map +1 -1
- package/package.json +53 -44
- package/scripts/check-client-bundle.mjs +1 -1
- package/scripts/check-docs-links.mjs +107 -0
- package/scripts/cli-login-check.mjs +214 -0
- package/LOGIN.md +0 -161
- package/lib/client/RubricEditor.js +0 -47
- package/lib/client/RubricEditor.js.map +0 -1
- package/lib/client/fields.js +0 -31
- package/lib/client/fields.js.map +0 -1
- package/lib/types/client/RubricEditor.d.ts +0 -6
- package/lib/types/client/fields.d.ts +0 -65
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The default engine order of a plain search, as a pure function: the router uses it to decide the order, and the settings
|
|
3
|
+
* card's status summary uses the same code to show the chain a search would try first, so the two cannot disagree.
|
|
4
|
+
* No imports: the client bundle includes this file.
|
|
5
|
+
* @module web-search-pro/default-chain
|
|
6
|
+
*/
|
|
7
|
+
/** The default `engines` list. A list equal to it is "not customised": the default rule for common ("常用") sources applies to it. */
|
|
8
|
+
export declare const DEFAULT_ENGINES: readonly string[];
|
|
9
|
+
export interface ChainInput {
|
|
10
|
+
/** The configured `engines` (route ids). */
|
|
11
|
+
engines: readonly string[];
|
|
12
|
+
/** `sources.priority` (route ids). */
|
|
13
|
+
priority?: readonly string[];
|
|
14
|
+
/** `sources.disabled` (route ids). */
|
|
15
|
+
disabled?: readonly string[];
|
|
16
|
+
/** Common ("常用") sources whose key resolves, best first. */
|
|
17
|
+
commonReady?: readonly string[];
|
|
18
|
+
/** `evidence.sourcePolicy === 'anonymous-only'`: a paid common source is never added. */
|
|
19
|
+
anonymousOnly?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Order of the configured chain: `sources.disabled` removed, `sources.priority` ids that are in the list first, then the common
|
|
23
|
+
* sources whose key resolves (only while `engines` is the default list; a list the user wrote keeps its order and the position
|
|
24
|
+
* it gave a common source), then the rest. Throws when everything is disabled.
|
|
25
|
+
*/
|
|
26
|
+
export declare function effectiveChain(input: ChainInput): string[];
|
|
27
|
+
/** One reason the effective chain differs from the `engines` list as written. */
|
|
28
|
+
export type ChainReason =
|
|
29
|
+
/** `sources.disabled` removed these from the list. */
|
|
30
|
+
{
|
|
31
|
+
kind: 'disabled';
|
|
32
|
+
ids: string[];
|
|
33
|
+
}
|
|
34
|
+
/** `sources.priority` moved these to the front. */
|
|
35
|
+
| {
|
|
36
|
+
kind: 'priority';
|
|
37
|
+
ids: string[];
|
|
38
|
+
}
|
|
39
|
+
/** The default rule put these ready common ("常用") sources in front of the list. */
|
|
40
|
+
| {
|
|
41
|
+
kind: 'common';
|
|
42
|
+
ids: string[];
|
|
43
|
+
}
|
|
44
|
+
/** `evidence.sourcePolicy: anonymous-only` kept these ready common sources out (they need a key). */
|
|
45
|
+
| {
|
|
46
|
+
kind: 'anonymous-only';
|
|
47
|
+
ids: string[];
|
|
48
|
+
}
|
|
49
|
+
/** The list is the user's own, so these ready common sources are not added (they keep their place only if the list names them). */
|
|
50
|
+
| {
|
|
51
|
+
kind: 'own-list';
|
|
52
|
+
ids: string[];
|
|
53
|
+
};
|
|
54
|
+
export interface ChainExplanation {
|
|
55
|
+
/** What a plain search would try, in order ({@link effectiveChain}); undefined when everything is disabled. */
|
|
56
|
+
chain: string[] | undefined;
|
|
57
|
+
reasons: ChainReason[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* {@link effectiveChain} plus why it differs from the list: the preview of the settings card says it in one sentence per reason, so
|
|
61
|
+
* a person who sees `deepseek` first in a list that does not begin with it knows which rule did that. Same inputs, same rule.
|
|
62
|
+
*/
|
|
63
|
+
export declare function explainChain(input: ChainInput): ChainExplanation;
|
package/lib/types/engines.d.ts
CHANGED
|
@@ -11,10 +11,27 @@ import { type BrowserMethod } from './browser-access.ts';
|
|
|
11
11
|
import type { CustomPlatformSpec } from './config.ts';
|
|
12
12
|
import { type ExaSearchRequest } from './exa-client.ts';
|
|
13
13
|
import { EngineError } from './engine-error.ts';
|
|
14
|
+
/**
|
|
15
|
+
* A source row as an engine returns it: the host's `WebSearchSource` plus the provider's own quality signals, when it has any
|
|
16
|
+
* (DeepSeek Search: `rerank_score` 0..3 and `authority` 0..4). They travel with the row as source metadata and are one small
|
|
17
|
+
* fusion signal (pipeline/fusion.ts); no engine is required to set them.
|
|
18
|
+
*/
|
|
19
|
+
export interface EngineSource extends WebSearchSource {
|
|
20
|
+
/** The provider's relevance / authority / freshness rank score, 0..3 (higher is better). */
|
|
21
|
+
readonly rerankScore?: number;
|
|
22
|
+
/** The provider's source-authority grade, 0..4 (unknown = absent). */
|
|
23
|
+
readonly authority?: number;
|
|
24
|
+
/** The user-defined CLI that returned the row (`custom-cli:echo`): set by the adapter, shown with the result. */
|
|
25
|
+
readonly via?: string;
|
|
26
|
+
/** The honest label of a user-defined source ("user-defined, not verified by the plugin"). */
|
|
27
|
+
readonly tag?: string;
|
|
28
|
+
/** The source's confidence (0..1), below 1 only: set by the router from the spec / `sources.confidence`, never by an engine. */
|
|
29
|
+
readonly confidence?: number;
|
|
30
|
+
}
|
|
14
31
|
export interface SearchOutcome {
|
|
15
32
|
/** Provider-generated answer/summary text, when any. */
|
|
16
33
|
content?: string;
|
|
17
|
-
sources:
|
|
34
|
+
sources: EngineSource[];
|
|
18
35
|
/** Id of the concrete backend that answered (a platform provider with a fallback chain names the leg that ran). */
|
|
19
36
|
via?: string;
|
|
20
37
|
/** The backend id of the platform chain that answered (`bili`, `browser-opencli`), for display and history. */
|
|
@@ -29,6 +46,8 @@ export interface Engine {
|
|
|
29
46
|
backend?: string;
|
|
30
47
|
/** Cheap local availability check; must not do network I/O. */
|
|
31
48
|
available(): boolean;
|
|
49
|
+
/** Why `available()` is false, when the engine knows (a platform chain quotes it in its fall-through note instead of "unavailable"). */
|
|
50
|
+
unavailableReason?(): string | undefined;
|
|
32
51
|
/** Browser-service method this engine depends on (dsh-browser is optional). */
|
|
33
52
|
needsBrowser?: BrowserMethod;
|
|
34
53
|
search(query: string, count: number, signal?: AbortSignal, options?: EngineSearchOptions): Promise<SearchOutcome>;
|
|
@@ -41,6 +60,8 @@ export interface EngineSearchOptions {
|
|
|
41
60
|
include?: string[];
|
|
42
61
|
exclude?: string[];
|
|
43
62
|
};
|
|
63
|
+
/** The caller's original question or need (DeepSeek Search `ori_question`, cut to 128 characters by the engine); absent = none sent. */
|
|
64
|
+
originalQuestion?: string;
|
|
44
65
|
/** Lower bound of the publication date (ISO 8601), compiled from a hard time_window; the engine maps it to its native filter. */
|
|
45
66
|
since?: string;
|
|
46
67
|
/** Domain lists compiled from hard site / exclude_site constraints (keyed sources that take them as request fields). */
|
|
@@ -81,6 +102,8 @@ export interface EngineDeps {
|
|
|
81
102
|
usage?: UsageRecorder;
|
|
82
103
|
/** Test seam: replaces the global fetch of API clients that accept one. */
|
|
83
104
|
fetchImpl?: typeof fetch;
|
|
105
|
+
/** Test seam: waits between retries of the engines that retry (DeepSeek); resolves early on abort. Default: a real timer. */
|
|
106
|
+
sleep?: (ms: number, signal?: AbortSignal) => Promise<void>;
|
|
84
107
|
/** Test seam: replaces the DNS lookup of the SSRF check. */
|
|
85
108
|
lookup?: (hostname: string) => Promise<{
|
|
86
109
|
address: string;
|
|
@@ -100,6 +123,11 @@ export interface EngineDeps {
|
|
|
100
123
|
anysearchApiKey?: string;
|
|
101
124
|
/** GitHub API token (config githubToken / $GITHUB_TOKEN / $GH_TOKEN). */
|
|
102
125
|
githubToken?: string;
|
|
126
|
+
/**
|
|
127
|
+
* Credential variables of the CLI adapters by the name the tool reads (`TWITTER_AUTH_TOKEN`, `TWITTER_CT0`), resolved by the router:
|
|
128
|
+
* config literal -> credentials ref -> process environment. Handed to a command only through its environment, never in argv.
|
|
129
|
+
*/
|
|
130
|
+
cliEnv?: Readonly<Record<string, string>>;
|
|
103
131
|
enableCli: boolean;
|
|
104
132
|
opencliEnabled: boolean;
|
|
105
133
|
agentReachEnabled: boolean;
|
package/lib/types/fetch.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ import type { ResolvedConfig } from './config.ts';
|
|
|
8
8
|
import type { BrowserService } from './browser-service.ts';
|
|
9
9
|
import { type BrowserGetter } from './browser-access.ts';
|
|
10
10
|
import type { ExtractRule } from './extract.ts';
|
|
11
|
-
|
|
11
|
+
import { type DeepSeekFetchAccess } from './providers/deepseek.ts';
|
|
12
|
+
export type FetchMode = 'auto' | 'jina' | 'http' | 'playwright' | 'deepseek';
|
|
12
13
|
export interface FetchOptions {
|
|
13
14
|
mode: FetchMode;
|
|
14
15
|
signal: AbortSignal | undefined;
|
|
@@ -63,7 +64,7 @@ export declare function detectShellPage(text: string): boolean;
|
|
|
63
64
|
export type PageClass = 'content' | 'shell' | 'login_wall' | 'captcha' | 'js_shell' | 'error';
|
|
64
65
|
/** One backend attempt of a fetch, in order (recorded in the result and in the stored fetch detail). */
|
|
65
66
|
export interface FetchAttempt {
|
|
66
|
-
source: 'jina' | 'http' | 'playwright';
|
|
67
|
+
source: 'jina' | 'http' | 'playwright' | 'deepseek';
|
|
67
68
|
class: PageClass;
|
|
68
69
|
chars?: number;
|
|
69
70
|
detail?: string;
|
|
@@ -82,14 +83,20 @@ export declare function classifyPage(text: string, meta?: {
|
|
|
82
83
|
export declare function normalizeUrl(raw: string): string;
|
|
83
84
|
/** All rules: user (DB) first, then built-ins; user rules win on ties. */
|
|
84
85
|
export declare function mergedRules(store: Store): ExtractRule[];
|
|
86
|
+
/**
|
|
87
|
+
* The DeepSeek Fetch API access for a call: key, endpoint, ledger. Resolved per call by the router (settings literal -> DSH credentials ->
|
|
88
|
+
* process environment); undefined = no key. Test seams (`fetchImpl`, `lookup`, `sleep`) ride along on the returned object.
|
|
89
|
+
*/
|
|
90
|
+
export type DeepSeekFetchAccessProvider = () => Promise<Pick<DeepSeekFetchAccess, 'apiKey' | 'baseUrl' | 'usage' | 'fetchImpl' | 'lookup' | 'sleep' | 'allowProxyFakeIp'> | undefined>;
|
|
85
91
|
export declare class FetchService {
|
|
86
92
|
private readonly store;
|
|
87
93
|
private readonly config;
|
|
94
|
+
private readonly deepseek?;
|
|
88
95
|
private readonly memory;
|
|
89
96
|
/** In-flight de-duplication of identical non-fresh fetches (C3). */
|
|
90
97
|
private readonly flights;
|
|
91
98
|
private readonly getBrowser;
|
|
92
|
-
constructor(store: Store, config: ResolvedConfig | (() => ResolvedConfig), browser?: BrowserService | BrowserGetter);
|
|
99
|
+
constructor(store: Store, config: ResolvedConfig | (() => ResolvedConfig), browser?: BrowserService | BrowserGetter, deepseek?: DeepSeekFetchAccessProvider | undefined);
|
|
93
100
|
private cfg;
|
|
94
101
|
/** True when the optional browser can render right now (enabled in config and the service has render()). */
|
|
95
102
|
private canRender;
|
|
@@ -98,5 +105,7 @@ export declare class FetchService {
|
|
|
98
105
|
private runFetch;
|
|
99
106
|
private fetchJina;
|
|
100
107
|
private fetchHttp;
|
|
108
|
+
/** One page through the DeepSeek Fetch API. 403 / 404 are DeepSeek's own verdicts (see `DeepSeekFetchError`), never the target page's status. */
|
|
109
|
+
private fetchDeepSeek;
|
|
101
110
|
private fetchPlaywright;
|
|
102
111
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the live, resolved plugin configuration is read from.
|
|
3
|
+
*
|
|
4
|
+
* Cordis 4.0.x (DSH 0.2.0 / 0.2.1 lines): `fiber.config` is the RESOLVED object (schema defaults applied,
|
|
5
|
+
* `internal/config` hooks run) and there is no `effectiveConfig`. A volatile update swaps its fields in place.
|
|
6
|
+
*
|
|
7
|
+
* Cordis 4.1.x (DSH 0.2.2 line): `fiber.config` is the RAW input - no schema defaults, no hook results, and
|
|
8
|
+
* `undefined` for an entry that has no configuration. The resolved object handed to `apply` is published as
|
|
9
|
+
* `fiber.effectiveConfig` after every successful update. Reading `fiber.config` there skips defaults (nested
|
|
10
|
+
* ones included) and credential/hook resolution, which is why `?? {}` alone only fixes the crash.
|
|
11
|
+
*
|
|
12
|
+
* So: prefer `effectiveConfig`, fall back to `config` (4.0.x), and never hand `undefined` onward.
|
|
13
|
+
*/
|
|
14
|
+
export interface FiberConfigSource {
|
|
15
|
+
readonly effectiveConfig?: unknown;
|
|
16
|
+
readonly config?: unknown;
|
|
17
|
+
}
|
|
18
|
+
export declare function liveFiberConfig<T extends object>(fiber: FiberConfigSource | undefined): T;
|