dsh-web-search-pro 0.2.0 → 0.2.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/CHANGELOG.md +179 -0
- package/README.md +197 -32
- package/assets/skills/dsh-web-search-pro/SKILL.md +14 -13
- package/assets/skills/dsh-web-search-pro/references/config.md +36 -0
- package/assets/skills/dsh-web-search-pro/references/sources.md +19 -4
- package/assets/skills/dsh-web-search-pro/references/troubleshooting.md +3 -1
- package/catalog/sources.v1.json +22 -12
- 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 +12 -6
- package/lib/actions/search.js.map +1 -1
- package/lib/actions/sources.js +116 -41
- 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 +341 -0
- package/lib/cli/builtin-specs.js.map +1 -0
- package/lib/cli/chain.js +193 -0
- package/lib/cli/chain.js.map +1 -0
- package/lib/cli/chains-spec.js +118 -0
- package/lib/cli/chains-spec.js.map +1 -0
- package/lib/cli/engine.js +99 -0
- package/lib/cli/engine.js.map +1 -0
- package/lib/cli/opencli-sites.js +83 -0
- package/lib/cli/opencli-sites.js.map +1 -0
- package/lib/cli/opencli.js +153 -0
- package/lib/cli/opencli.js.map +1 -0
- package/lib/cli/probe.js +128 -0
- package/lib/cli/probe.js.map +1 -0
- package/lib/cli/runner.js +564 -0
- package/lib/cli/runner.js.map +1 -0
- package/lib/cli/spec.js +496 -0
- package/lib/cli/spec.js.map +1 -0
- 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 +15 -1
- package/lib/client/form-specs.js.map +1 -1
- package/lib/client/form.js +296 -27
- 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 -215
- 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 +22 -0
- package/lib/client/validators.js.map +1 -1
- package/lib/client.js +9151 -1987
- 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 +87 -107
- 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 +109 -102
- package/lib/deps.js.map +1 -1
- package/lib/engine-error.js +19 -0
- package/lib/engine-error.js.map +1 -0
- package/lib/engines.js +32 -115
- package/lib/engines.js.map +1 -1
- package/lib/fetch.js +23 -4
- package/lib/fetch.js.map +1 -1
- package/lib/index.js +30 -5
- 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 +21 -7
- 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 +13 -14
- 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 +118 -58
- 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 +203 -27
- 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 +85 -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 +38 -0
- package/lib/types/cli/chain.d.ts +83 -0
- package/lib/types/cli/chains-spec.d.ts +48 -0
- package/lib/types/cli/engine.d.ts +50 -0
- package/lib/types/cli/opencli-sites.d.ts +24 -0
- package/lib/types/cli/opencli.d.ts +77 -0
- package/lib/types/cli/probe.d.ts +53 -0
- package/lib/types/cli/runner.d.ts +126 -0
- package/lib/types/cli/spec.d.ts +269 -0
- 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 -196
- 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/client/validators.d.ts +6 -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 +265 -216
- package/lib/types/default-chain.d.ts +63 -0
- package/lib/types/deps.d.ts +25 -23
- package/lib/types/engine-error.d.ts +12 -0
- package/lib/types/engines.d.ts +45 -10
- package/lib/types/fetch.d.ts +12 -3
- package/lib/types/index.d.ts +164 -146
- package/lib/types/overlay-types.d.ts +98 -0
- package/lib/types/overlay.d.ts +141 -0
- package/lib/types/pipeline/candidates.d.ts +19 -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 +3 -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/platforms.d.ts +15 -3
- package/lib/types/providers/registry.d.ts +10 -0
- package/lib/types/restart.d.ts +52 -0
- package/lib/types/router.d.ts +69 -9
- package/lib/types/rpc-types.d.ts +79 -0
- package/lib/types/rpc.d.ts +41 -0
- package/lib/types/tools.d.ts +6 -0
- package/lib/types/util.d.ts +16 -1
- package/lib/util.js +17 -4
- package/lib/util.js.map +1 -1
- package/package.json +51 -43
- package/scripts/check-client-bundle.mjs +1 -1
- package/scripts/cli-login-check.mjs +214 -0
- 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
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export type Json = Record<string, unknown>;
|
|
14
14
|
/** Top-level config fields (one Host write each). */
|
|
15
|
-
export type TopField = 'engines' | 'parallelEngines' | 'searchMaxResults' | 'timeoutMs' | 'fetchDefaultChars' | 'exaContentsPerUrlChars' | 'exaContentsTotalChars' | 'exaApiKeyEnv' | 'jinaApiKeyEnv' | 'githubTokenEnv' | 'bochaApiKeyEnv' | 'bochaBaseUrl' | 'bochaSummary' | 'searxngUrl' | 'openalexMailto' | 'enableCliBackends' | 'opencliEnabled' | 'agentReachEnabled' | 'providerId' | 'registerProvider' | 'toolSurface' | 'playwright' | 'ttlSeconds' | 'memoryCacheEntries' | 'rrfConstant' | 'freshnessBoost' | 'freshnessDays' | 'authorityBoost' | 'authorityDomains' | 'dbPath' | 'allowProxyFakeIp' | 'platformRules' | 'customPlatforms' | 'browserBindings' | 'verbose';
|
|
15
|
+
export type TopField = 'engines' | 'parallelEngines' | 'searchMaxResults' | 'timeoutMs' | 'fetchDefaultChars' | 'exaContentsPerUrlChars' | 'exaContentsTotalChars' | 'exaApiKeyEnv' | 'jinaApiKeyEnv' | 'githubTokenEnv' | 'twitterAuthTokenEnv' | 'twitterCt0Env' | 'bochaApiKeyEnv' | 'bochaBaseUrl' | 'bochaSummary' | 'deepseekFetch' | 'searxngUrl' | 'openalexMailto' | 'enableCliBackends' | 'opencliEnabled' | 'agentReachEnabled' | 'providerId' | 'registerProvider' | 'toolSurface' | 'playwright' | 'ttlSeconds' | 'memoryCacheEntries' | 'rrfConstant' | 'freshnessBoost' | 'freshnessDays' | 'authorityBoost' | 'authorityDomains' | 'dbPath' | 'allowProxyFakeIp' | 'platformRules' | 'customPlatforms' | 'browserBindings' | 'platformBackends' | 'cliAdapters' | 'verbose';
|
|
16
16
|
/** Options inside `evidence` / `provider`, addressed by their dotted config path. */
|
|
17
17
|
export type PathField = 'evidence.autoProviders' | 'evidence.sourcePolicy' | 'evidence.maxRounds' | 'evidence.maxQueries' | 'evidence.judge.mode' | 'evidence.hybridBorderline' | 'evidence.judge.provider' | 'evidence.maxJevQuestions' | 'evidence.judge.allowLlm' | 'evidence.judge.providers' | 'evidence.coverage.mode' | 'evidence.coverage.provider' | 'evidence.coverage.thresholds.weak' | 'evidence.coverage.thresholds.covered' | 'evidence.budget.perSearchInputTokens' | 'evidence.budget.dailyInputTokens' | 'evidence.budget.timezone' | 'evidence.budget.providers' | 'provider.evidence' | 'provider.deadlineMs' | 'sources.priority' | 'sources.disabled';
|
|
18
18
|
/** One rubric override entry (`evidence.rubrics.<id>`) and one keyed-source field. */
|
|
@@ -20,7 +20,9 @@ export type RubricField = `evidence.rubrics.${string}`;
|
|
|
20
20
|
export type KeyedField = `keyedSources.${string}.apiKeyEnv` | `keyedSources.${string}.baseUrl`;
|
|
21
21
|
/** One axis of one source's request budget (`sources.budget.<id>.total|daily`). */
|
|
22
22
|
export type BudgetField = `sources.budget.${string}.${'total' | 'daily'}`;
|
|
23
|
-
|
|
23
|
+
/** The confidence of one source or platform backend (`sources.confidence.<id>`): the ids are open, so these fields are made on demand. */
|
|
24
|
+
export type ConfidenceField = `sources.confidence.${string}`;
|
|
25
|
+
export type SettingField = TopField | PathField | RubricField | KeyedField | BudgetField | ConfidenceField;
|
|
24
26
|
export type RootKey = 'evidence' | 'provider' | 'keyedSources' | 'sources';
|
|
25
27
|
export type FieldWrite = {
|
|
26
28
|
kind: 'set';
|
|
@@ -89,8 +91,11 @@ export declare const DEFAULTS: {
|
|
|
89
91
|
};
|
|
90
92
|
readonly toolSurface: "indexed";
|
|
91
93
|
readonly bochaApiKeyEnv: "BOCHA_SEARCH_API_KEY";
|
|
94
|
+
readonly twitterAuthTokenEnv: "TWITTER_AUTH_TOKEN";
|
|
95
|
+
readonly twitterCt0Env: "TWITTER_CT0";
|
|
92
96
|
readonly bochaBaseUrl: "https://api.bocha.cn";
|
|
93
97
|
readonly bochaSummary: true;
|
|
98
|
+
readonly deepseekFetch: false;
|
|
94
99
|
};
|
|
95
100
|
/** Top-level fields, in display order. */
|
|
96
101
|
export declare const FIELD_SPECS: readonly FieldSpec[];
|
|
@@ -105,11 +110,15 @@ export declare const KEYED_SPECS: readonly PathSpec[];
|
|
|
105
110
|
/** The sources the card has a request budget for: Bocha and the keyed sources (any registered id works in settings.yaml). */
|
|
106
111
|
export declare const BUDGETED_SOURCES: readonly string[];
|
|
107
112
|
export declare const BUDGET_SPECS: readonly PathSpec[];
|
|
113
|
+
/** `sources.confidence.<id>`: a number 0..1; empty = the default (1 for a built-in source, the spec's own for a custom CLI). */
|
|
114
|
+
export declare const confidenceSpec: (id: string) => PathSpec;
|
|
115
|
+
export declare const confidenceField: (id: string) => ConfidenceField;
|
|
116
|
+
export declare const CONFIDENCE_PREFIX = "sources.confidence.";
|
|
108
117
|
/** The spec of a rubric override entry: the whole object as one JSON draft, which the rubric editor builds field by field. */
|
|
109
118
|
export declare const rubricSpec: (id: string) => PathSpec;
|
|
110
119
|
export declare const rubricField: (id: string) => RubricField;
|
|
111
120
|
/** Fields that a Host write can never take as text (credentials go through the credentials remote). */
|
|
112
|
-
export declare const CREDENTIAL_IDS: readonly ["exa", "jina", "github", "bocha", ...`keyed:${string}`[]];
|
|
121
|
+
export declare const CREDENTIAL_IDS: readonly ["exa", "jina", "github", "bocha", "twitter-auth-token", "twitter-ct0", ...`keyed:${string}`[]];
|
|
113
122
|
export type CredentialId = typeof CREDENTIAL_IDS[number];
|
|
114
123
|
/** The settings field holding the credentials ref / environment variable name of each credential, and its default name. */
|
|
115
124
|
export declare function credentialRef(id: CredentialId): {
|
|
@@ -2,7 +2,8 @@ import type { SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
|
2
2
|
import type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client';
|
|
3
3
|
import { type RubricKind } from '../pipeline/rubrics-spec.ts';
|
|
4
4
|
import type { Context } from './context-types.ts';
|
|
5
|
-
import { BUDGET_SPECS, CREDENTIAL_IDS, FIELD_SPECS, KEYED_SPECS, PATH_SPECS, type CredentialId, type SettingField } from './form-specs.ts';
|
|
5
|
+
import { BUDGET_SPECS, CREDENTIAL_IDS, FIELD_SPECS, KEYED_SPECS, PATH_SPECS, type CredentialId, type FieldSpec, type SettingField } from './form-specs.ts';
|
|
6
|
+
import { type OverlayView, type StatusView, type TrialRequest, type TrialResult } from '../rpc-types.ts';
|
|
6
7
|
export { BUDGET_SPECS, CREDENTIAL_IDS, FIELD_SPECS, KEYED_SPECS, PATH_SPECS };
|
|
7
8
|
export type { CredentialId, SettingField };
|
|
8
9
|
export interface CardFieldState {
|
|
@@ -45,10 +46,42 @@ export interface RubricCardState {
|
|
|
45
46
|
invalid: boolean;
|
|
46
47
|
problems: string[];
|
|
47
48
|
}
|
|
49
|
+
/** What the card knows of the agent overlay (the settings an agent changed with `config.*`), read over the RPC channel. */
|
|
50
|
+
export interface OverlayCardState {
|
|
51
|
+
loading: boolean;
|
|
52
|
+
/** The channel answered with an error, or there is none. */
|
|
53
|
+
failed: boolean;
|
|
54
|
+
/** An adopt or revoke is running: the buttons wait. */
|
|
55
|
+
busy: boolean;
|
|
56
|
+
/** The last adopt / revoke that did not go through, as a dictionary key with its `{why}`. */
|
|
57
|
+
error?: {
|
|
58
|
+
key: 'agentAdoptFailed' | 'agentAdoptHalf' | 'agentRevokeFailed';
|
|
59
|
+
why?: string;
|
|
60
|
+
};
|
|
61
|
+
view?: OverlayView;
|
|
62
|
+
}
|
|
63
|
+
/** What the card knows from the running plugin over its private RPC channel (rpc-types.ts); empty where the Host has no transport. */
|
|
64
|
+
export interface ServerState {
|
|
65
|
+
/** The Host has the transport: live readiness and "Try it" are possible. */
|
|
66
|
+
available: boolean;
|
|
67
|
+
loading: boolean;
|
|
68
|
+
failed: boolean;
|
|
69
|
+
status?: StatusView;
|
|
70
|
+
/** The trial run of a custom CLI draft: idle, running, or the last outcome. */
|
|
71
|
+
trial: {
|
|
72
|
+
state: 'idle' | 'running' | 'done' | 'failed';
|
|
73
|
+
id?: string;
|
|
74
|
+
result?: TrialResult;
|
|
75
|
+
error?: string;
|
|
76
|
+
};
|
|
77
|
+
overlay: OverlayCardState;
|
|
78
|
+
}
|
|
48
79
|
export interface WebSearchCardState {
|
|
49
80
|
available: boolean;
|
|
50
81
|
writable: boolean;
|
|
51
82
|
dirty: boolean;
|
|
83
|
+
/** How many staged edits a save would write: fields whose draft differs from what is stored, plus pending secrets. */
|
|
84
|
+
changes: number;
|
|
52
85
|
invalid: boolean;
|
|
53
86
|
saving: boolean;
|
|
54
87
|
failed: boolean;
|
|
@@ -57,9 +90,16 @@ export interface WebSearchCardState {
|
|
|
57
90
|
/** Ids the judge / coverage provider controls offer: the presets plus the valid custom entries of the draft. */
|
|
58
91
|
providerChoices: string[];
|
|
59
92
|
rubrics: RubricCardState[];
|
|
93
|
+
/** Settings read only when the plugin starts (restart.ts) that have an edit waiting to be saved: a save would not take effect until a restart. */
|
|
94
|
+
restartTouched: string[];
|
|
60
95
|
/** Overrides in settings that name no built-in rubric. */
|
|
61
96
|
unknownRubrics: string[];
|
|
97
|
+
server: ServerState;
|
|
62
98
|
}
|
|
99
|
+
/** Every field spec of the form model, in display order. */
|
|
100
|
+
export declare const ALL_SPECS: readonly FieldSpec[];
|
|
101
|
+
/** The specs of the dynamic fields among `fields` (the text view prints them next to the fixed ones). */
|
|
102
|
+
export declare function dynamicSpecsOf(fields: Readonly<Record<string, unknown>>): FieldSpec[];
|
|
63
103
|
export declare class WebSearchSettingsController {
|
|
64
104
|
private readonly scope;
|
|
65
105
|
private readonly ctx;
|
|
@@ -75,7 +115,26 @@ export declare class WebSearchSettingsController {
|
|
|
75
115
|
private credentialGeneration;
|
|
76
116
|
private credentialRefSignature;
|
|
77
117
|
private credentialStates;
|
|
118
|
+
private server;
|
|
119
|
+
private trialGeneration;
|
|
78
120
|
constructor(scope: ConfigForm<Record<string, unknown>>, ctx: Context);
|
|
121
|
+
/** The Host's RPC client, read when it is used (the service may arrive after the card was registered); undefined where there is none. */
|
|
122
|
+
private rpc;
|
|
123
|
+
/** Ask the plugin what is ready now (the same local probes as `sources.status`). Silent when the Host has no transport. */
|
|
124
|
+
refreshStatus(): Promise<void>;
|
|
125
|
+
private setOverlay;
|
|
126
|
+
/** Read what the agent overlay holds (once when the panel opens, and on the refresh button). Silent where the Host has no transport. */
|
|
127
|
+
refreshOverlay(): Promise<void>;
|
|
128
|
+
/** Drop overlay entries (keys, or `'all'`) as the user. The plugin audits it; the card shows the overlay as it is afterwards. */
|
|
129
|
+
revokeOverlay(keys: readonly string[] | 'all', adopted?: boolean): Promise<boolean>;
|
|
130
|
+
/**
|
|
131
|
+
* "Adopt into configuration": write the overlay item's value into the profile with the Host's atomic `mutate` (the same call the save bar
|
|
132
|
+
* makes, at the leaf the item is about), and only when that landed ask the plugin to drop the entry. A failed write leaves both as they were.
|
|
133
|
+
*/
|
|
134
|
+
adoptOverlay(key: string): Promise<boolean>;
|
|
135
|
+
/** Run one search of a custom CLI draft (rpc-types.ts `trial`). The outcome lands in `server.trial`. */
|
|
136
|
+
runTrial(request: TrialRequest): Promise<void>;
|
|
137
|
+
clearTrial(): void;
|
|
79
138
|
inject(): {
|
|
80
139
|
hooks: {
|
|
81
140
|
webSearchPro: SnapshotStore<WebSearchCardState>;
|
|
@@ -89,6 +148,12 @@ export declare class WebSearchSettingsController {
|
|
|
89
148
|
save: () => void;
|
|
90
149
|
discard: () => void;
|
|
91
150
|
refreshCredentials: () => void;
|
|
151
|
+
refreshStatus: () => void;
|
|
152
|
+
refreshOverlay: () => void;
|
|
153
|
+
revokeOverlay: (keys: readonly string[] | "all") => void;
|
|
154
|
+
adoptOverlay: (key: string) => void;
|
|
155
|
+
runTrial: (request: TrialRequest) => void;
|
|
156
|
+
clearTrial: () => void;
|
|
92
157
|
};
|
|
93
158
|
snapshot(): WebSearchCardState;
|
|
94
159
|
edit(field: SettingField, text: string): void;
|
|
@@ -107,6 +172,12 @@ export declare class WebSearchSettingsController {
|
|
|
107
172
|
refreshCredentials(): Promise<void>;
|
|
108
173
|
dispose(): void;
|
|
109
174
|
private project;
|
|
175
|
+
/** The start-up-only settings (restart.ts) whose staged edit differs from what is stored. */
|
|
176
|
+
private restartTouched;
|
|
177
|
+
/** `playwright` is one JSON field; only its `snapshotDir` is a start-up setting (`enabled` is live). */
|
|
178
|
+
private snapshotDirTouched;
|
|
179
|
+
/** Staged fields that differ from what is stored (a pending reset counts only when something is stored). */
|
|
180
|
+
private changedFields;
|
|
110
181
|
private decorate;
|
|
111
182
|
private projectRubrics;
|
|
112
183
|
/** The state of one control from the staged draft, else from the Host section. */
|
|
@@ -117,11 +188,18 @@ export declare class WebSearchSettingsController {
|
|
|
117
188
|
* evidence settings the draft would produce are then checked with the server's own validators.
|
|
118
189
|
*/
|
|
119
190
|
private analyze;
|
|
191
|
+
/**
|
|
192
|
+
* The Host ops of a top-level field. A container the schema does not declare volatile as a whole (`playwright`: its keys are)
|
|
193
|
+
* is written key by key; every other field is one `set` or one `unset`.
|
|
194
|
+
*/
|
|
195
|
+
private topOps;
|
|
120
196
|
private opsOf;
|
|
121
197
|
private credentialPlan;
|
|
122
198
|
private writeCredential;
|
|
123
199
|
/** The credentials ref / environment variable name each key is read from, from the saved settings (else the default). */
|
|
124
200
|
private credentialRefs;
|
|
201
|
+
/** The `sources.confidence.<id>` fields that hold a value now or in the draft: the card shows these ids with their values. */
|
|
202
|
+
private dynamicFields;
|
|
125
203
|
private spec;
|
|
126
204
|
private resolvedRoot;
|
|
127
205
|
private sectionValue;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Advanced: text mode": the settings as one commented YAML text, to read or copy. It is a view of the controls (it prints
|
|
3
|
+
* the staged state, secrets excluded), not a second place the settings live. Every key has a comment in front of it.
|
|
4
|
+
* @module web-search-pro/client/group-advanced
|
|
5
|
+
*/
|
|
6
|
+
import { type Card } from './field-rows.tsx';
|
|
7
|
+
export declare function AdvancedGroup({ card }: {
|
|
8
|
+
card: Card;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Agent changes": what an agent changed with the `config.*` actions, kept apart from the user's configuration. The plugin keeps those
|
|
3
|
+
* changes in a managed overlay file that takes effect at once and never edits the profile; this group lists every entry with the reason
|
|
4
|
+
* and time the agent gave, the newest audit records, and for each entry two buttons: "Adopt into configuration" (write the value into
|
|
5
|
+
* the profile with the card's atomic write, then drop the overlay entry) and "Revoke" (drop it). "Revoke all" empties the overlay, which
|
|
6
|
+
* also repairs a file the plugin had to ignore. The card reads the overlay once when it opens and on the refresh button.
|
|
7
|
+
* @module web-search-pro/client/group-agent
|
|
8
|
+
*/
|
|
9
|
+
import type { OverlayItem } from '../overlay-types.ts';
|
|
10
|
+
import { type Card } from './field-rows.tsx';
|
|
11
|
+
/** One overlay entry: what it is, the value the agent set against the one in the configuration, why and when, and the two buttons. */
|
|
12
|
+
export declare function AgentItem({ card, item, busy, items }: {
|
|
13
|
+
card: Card;
|
|
14
|
+
item: OverlayItem;
|
|
15
|
+
busy: boolean;
|
|
16
|
+
items: readonly OverlayItem[];
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
export declare function AgentGroup({ card }: {
|
|
19
|
+
card: Card;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Custom CLI": the command-line tools the user adds, as a list (id, command, purpose, confidence, whether the spec is valid) and one
|
|
3
|
+
* edit dialog per tool. The dialog is a form over the same spec the JSON box holds ("View JSON" at the bottom): editing either side
|
|
4
|
+
* rewrites the other, every problem is the server's own message shown by the control it is about, "Done" puts the spec into the
|
|
5
|
+
* draft (only when it is valid), and "Try it" runs the draft once through the plugin. The entries live inside `cliAdapters`.
|
|
6
|
+
* @module web-search-pro/client/group-cli
|
|
7
|
+
*/
|
|
8
|
+
import { type CliCheck, type CliForm } from './cli-form.ts';
|
|
9
|
+
import { type Card } from './field-rows.tsx';
|
|
10
|
+
type Json = Record<string, unknown>;
|
|
11
|
+
/** What the dialog holds: the spec (the source of truth), the form fields read from it, the JSON box text, and the trial's sample query. */
|
|
12
|
+
export interface CliDraft {
|
|
13
|
+
mode: 'new' | 'edit';
|
|
14
|
+
id: string;
|
|
15
|
+
spec: Json;
|
|
16
|
+
form: CliForm;
|
|
17
|
+
jsonText: string;
|
|
18
|
+
jsonError?: string;
|
|
19
|
+
query: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function draftOf(mode: 'new' | 'edit', id: string, spec: Json): CliDraft;
|
|
22
|
+
/** The draft after a form edit: the spec is rebuilt from the fields on top of the spec as it was, the JSON text follows. */
|
|
23
|
+
export declare function editForm(draft: CliDraft, patch: Partial<CliForm>): CliDraft;
|
|
24
|
+
/** A new entry's id; an existing one cannot be renamed (copy it instead). */
|
|
25
|
+
export declare function editId(draft: CliDraft, id: string): CliDraft;
|
|
26
|
+
/** The draft after the JSON box changed: a text that parses becomes the spec and the form is read from it; one that does not leaves both alone. */
|
|
27
|
+
export declare function editJson(draft: CliDraft, text: string): CliDraft;
|
|
28
|
+
/** What the form of one custom CLI shows and edits; presentational (the dialog and the render test both mount it). */
|
|
29
|
+
export declare function CliBody({ card, draft, check, disabled, onForm, onId, onJson, onQuery, onTrial }: {
|
|
30
|
+
card: Card;
|
|
31
|
+
draft: CliDraft;
|
|
32
|
+
check: CliCheck;
|
|
33
|
+
disabled: boolean;
|
|
34
|
+
onForm: (patch: Partial<CliForm>) => void;
|
|
35
|
+
onId: (id: string) => void;
|
|
36
|
+
onJson: (text: string) => void;
|
|
37
|
+
onQuery: (text: string) => void;
|
|
38
|
+
onTrial: () => void;
|
|
39
|
+
}): import("react").JSX.Element;
|
|
40
|
+
export declare function CliDialog({ card, initial, taken, onClose }: {
|
|
41
|
+
card: Card;
|
|
42
|
+
initial: CliDraft;
|
|
43
|
+
taken: readonly string[];
|
|
44
|
+
onClose: () => void;
|
|
45
|
+
}): import("react").JSX.Element;
|
|
46
|
+
export declare function CliList({ card }: {
|
|
47
|
+
card: Card;
|
|
48
|
+
}): import("react").JSX.Element;
|
|
49
|
+
export declare function CliGroup({ card }: {
|
|
50
|
+
card: Card;
|
|
51
|
+
}): import("react").JSX.Element;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Common": what nearly everyone touches, open by default (every other group starts closed): the default engine chain with the
|
|
3
|
+
* order a search would really try, the result count, parallel fusion, the tool surface, the proxy fake-IP switch, and the
|
|
4
|
+
* DeepSeek Search source (常用) with its page-reading switch.
|
|
5
|
+
* @module web-search-pro/client/group-common
|
|
6
|
+
*/
|
|
7
|
+
import { type Card } from './field-rows.tsx';
|
|
8
|
+
/** The names of the common group's fields, in order. */
|
|
9
|
+
export declare const COMMON_FIELDS: readonly ["searchMaxResults", "parallelEngines", "toolSurface", "allowProxyFakeIp", "deepseekFetch"];
|
|
10
|
+
export declare function CommonGroup({ card }: {
|
|
11
|
+
card: Card;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Scoring model": the optional model judge (mode, provider, coverage judge, usage caps), its custom providers as a JSON list,
|
|
3
|
+
* and the judge prompts (rubrics) as a list: a row each (name, active version, default or overridden) and an edit dialog that
|
|
4
|
+
* puts the built-in text beside your override. The dialog edits the same staged entry the rest of the card writes on save.
|
|
5
|
+
* @module web-search-pro/client/group-judge
|
|
6
|
+
*/
|
|
7
|
+
import { BUILTIN_RUBRIC_IDS } from '../pipeline/rubrics-spec.ts';
|
|
8
|
+
import { type Card } from './field-rows.tsx';
|
|
9
|
+
/** The controls of one rubric override: each is a view of the one staged entry; the built-in text sits beside it. */
|
|
10
|
+
export declare function RubricForm({ card, id }: {
|
|
11
|
+
card: Card;
|
|
12
|
+
id: string;
|
|
13
|
+
}): import("react").JSX.Element;
|
|
14
|
+
export { BUILTIN_RUBRIC_IDS };
|
|
15
|
+
export declare function JudgeGroup({ card }: {
|
|
16
|
+
card: Card;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Search order": the order a plain search tries its engines, and the order each platform tries its backends, as lists one
|
|
3
|
+
* moves, adds to and removes from (not as a comma text). Below the engine list sits the order a search would really use, with a
|
|
4
|
+
* sentence on why it differs from the list; the platforms are rows with a dialog. Everything stages into the same draft the sticky
|
|
5
|
+
* save bar writes: `engines` and `platformBackends` as they are, `sources.confidence.<id>` for the confidence box of a row.
|
|
6
|
+
* @module web-search-pro/client/group-order
|
|
7
|
+
*/
|
|
8
|
+
import { type Card } from './field-rows.tsx';
|
|
9
|
+
/** The chain a plain search would try, from the draft, and one sentence on why it is not the list as written. */
|
|
10
|
+
export declare function EffectiveChain({ card }: {
|
|
11
|
+
card: Card;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export declare function EngineOrder({ card }: {
|
|
14
|
+
card: Card;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
/** The body of the platform dialog: the chain as a list with its buttons, the backends that can still be added, and "Restore default". */
|
|
17
|
+
export declare function PlatformForm({ card, platform }: {
|
|
18
|
+
card: Card;
|
|
19
|
+
platform: string;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
21
|
+
export declare function PlatformList({ card }: {
|
|
22
|
+
card: Card;
|
|
23
|
+
}): import("react").JSX.Element;
|
|
24
|
+
export declare function OrderGroup({ card }: {
|
|
25
|
+
card: Card;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Runtime and backends": the CLI / OpenCLI / Agent Reach switches, the Twitter / X login values (a dialog), the JSON objects
|
|
3
|
+
* that shape backends (Playwright, platform backend chains, CLI adapters) and the platform settings (custom platforms,
|
|
4
|
+
* selectors, browser bindings), each as a list with its own dialog. The backend order of the platforms and the custom CLIs have their own
|
|
5
|
+
* groups ("Search order", "Custom CLI"); their raw JSON is under "Advanced".
|
|
6
|
+
* @module web-search-pro/client/group-runtime
|
|
7
|
+
*/
|
|
8
|
+
import { type Card } from './field-rows.tsx';
|
|
9
|
+
/** The two values twitter-cli needs: the controls of the dialog. */
|
|
10
|
+
export declare function TwitterForm({ card }: {
|
|
11
|
+
card: Card;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export declare function RuntimeGroup({ card }: {
|
|
14
|
+
card: Card;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "Sources": how sources are ranked (policy, priority, disabled) and a list of the sources that need a key or an address: a
|
|
3
|
+
* row per source (name, tier, whether its key is set, and the "常用" mark), and one edit dialog per source holding its key
|
|
4
|
+
* reference, write-only key, endpoint and request budget. The anonymous sources are a folded reference table. Edits stage into
|
|
5
|
+
* the same draft the sticky save bar writes; a dialog has no save button of its own.
|
|
6
|
+
* @module web-search-pro/client/group-sources
|
|
7
|
+
*/
|
|
8
|
+
import { type Card } from './field-rows.tsx';
|
|
9
|
+
import { type SourceDef } from './field-keys.ts';
|
|
10
|
+
import type { CredentialId } from './form.ts';
|
|
11
|
+
/** The write-only key of a source. It shows whether a key is stored, never the key. */
|
|
12
|
+
export declare function SecretRow({ card, id, label }: {
|
|
13
|
+
card: Card;
|
|
14
|
+
id: CredentialId;
|
|
15
|
+
label: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
/** Whether a source is usable as far as the card can tell: its key is stored, or (SearXNG) its address is set. */
|
|
18
|
+
export declare function useSourceReady(card: Card, def: SourceDef): {
|
|
19
|
+
ready: boolean;
|
|
20
|
+
loading: boolean;
|
|
21
|
+
};
|
|
22
|
+
/** The controls of one source: reference name, write-only key, endpoint, extras and request budget. */
|
|
23
|
+
export declare function SourceForm({ card, def }: {
|
|
24
|
+
card: Card;
|
|
25
|
+
def: SourceDef;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
/** One source's edit dialog. */
|
|
28
|
+
export declare function SourceDialog({ card, def, onClose }: {
|
|
29
|
+
card: Card;
|
|
30
|
+
def: SourceDef;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
/** One row of the sources list. */
|
|
34
|
+
export declare function SourceItem({ card, def, onEdit }: {
|
|
35
|
+
card: Card;
|
|
36
|
+
def: SourceDef;
|
|
37
|
+
onEdit: () => void;
|
|
38
|
+
}): import("react").JSX.Element;
|
|
39
|
+
/** Open dialog state shared by the Common and Sources groups: one source at a time. */
|
|
40
|
+
export declare function SourceList({ card, only }: {
|
|
41
|
+
card: Card;
|
|
42
|
+
only?: readonly string[];
|
|
43
|
+
}): import("react").JSX.Element;
|
|
44
|
+
export declare function SourcesGroup({ card }: {
|
|
45
|
+
card: Card;
|
|
46
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The small groups: "Reading and evidence", "Network and cache", "Ranking weights" (advanced) and the built-in web tool
|
|
3
|
+
* "Route". Each is a handful of rows built from the same controls; the long explanations sit behind the `?`.
|
|
4
|
+
* @module web-search-pro/client/groups-basic
|
|
5
|
+
*/
|
|
6
|
+
import { type Card } from './field-rows.tsx';
|
|
7
|
+
export declare function ReadingGroup({ card }: {
|
|
8
|
+
card: Card;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
10
|
+
export declare function NetworkGroup({ card }: {
|
|
11
|
+
card: Card;
|
|
12
|
+
}): import("react").JSX.Element;
|
|
13
|
+
export declare function RankingGroup({ card }: {
|
|
14
|
+
card: Card;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function RouteGroup({ card }: {
|
|
17
|
+
card: Card;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots';
|
|
2
2
|
import type { Context } from './context-types.ts';
|
|
3
3
|
import { type CredentialId, type RubricTextKey, type SettingField, type WebSearchCardState } from './form.ts';
|
|
4
|
+
import type { TrialRequest } from '../rpc-types.ts';
|
|
4
5
|
export declare const name = "web-search-pro-client";
|
|
5
6
|
export declare const inject: string[];
|
|
6
7
|
export declare const NS = "web-search-pro.card";
|
|
@@ -16,5 +17,12 @@ export type SettingsCardProps = PropsLocale<typeof NS> & {
|
|
|
16
17
|
save: () => void;
|
|
17
18
|
discard: () => void;
|
|
18
19
|
refreshCredentials: () => void;
|
|
20
|
+
refreshStatus: () => void;
|
|
21
|
+
/** The agent overlay: read it again, drop entries (keys, or `'all'`), write one into the configuration and drop it. */
|
|
22
|
+
refreshOverlay: () => void;
|
|
23
|
+
revokeOverlay: (keys: readonly string[] | 'all') => void;
|
|
24
|
+
adoptOverlay: (key: string) => void;
|
|
25
|
+
runTrial: (request: TrialRequest) => void;
|
|
26
|
+
clearTrial: () => void;
|
|
19
27
|
};
|
|
20
28
|
export declare function apply(ctx: Context): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The settings that are whole JSON objects (custom providers, platform backend chains, CLI adapters, custom platforms, ...) as a
|
|
3
|
+
* list: a row each (name, how many entries it holds, "default" while it is empty) and one dialog with a code box and the
|
|
4
|
+
* server's own validation message. Nothing here is a second place the data lives: the box edits the same staged field.
|
|
5
|
+
* @module web-search-pro/client/json-list
|
|
6
|
+
*/
|
|
7
|
+
import { type Card } from './field-rows.tsx';
|
|
8
|
+
/** How many entries a JSON object text holds; undefined when it is not an object. */
|
|
9
|
+
export declare function entryCount(text: string): number | undefined;
|
|
10
|
+
/** The code box of one JSON field. */
|
|
11
|
+
export declare function JsonForm({ card, field }: {
|
|
12
|
+
card: Card;
|
|
13
|
+
field: string;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** A list of JSON-object settings with its dialog. `fields` names which ones (see JSON_FIELDS). */
|
|
16
|
+
export declare function JsonList({ card, fields }: {
|
|
17
|
+
card: Card;
|
|
18
|
+
fields: readonly string[];
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
/** The fields of one group of JSON settings. */
|
|
21
|
+
export declare const jsonFieldsOf: (group: "judge" | "runtime" | "platform" | "advanced") => string[];
|