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.
Files changed (266) hide show
  1. package/CHANGELOG.md +179 -0
  2. package/README.md +197 -32
  3. package/assets/skills/dsh-web-search-pro/SKILL.md +14 -13
  4. package/assets/skills/dsh-web-search-pro/references/config.md +36 -0
  5. package/assets/skills/dsh-web-search-pro/references/sources.md +19 -4
  6. package/assets/skills/dsh-web-search-pro/references/troubleshooting.md +3 -1
  7. package/catalog/sources.v1.json +22 -12
  8. package/lib/actions/approval.js +50 -1
  9. package/lib/actions/approval.js.map +1 -1
  10. package/lib/actions/config.js +274 -0
  11. package/lib/actions/config.js.map +1 -0
  12. package/lib/actions/errors.js +8 -1
  13. package/lib/actions/errors.js.map +1 -1
  14. package/lib/actions/format.js +10 -0
  15. package/lib/actions/format.js.map +1 -1
  16. package/lib/actions/index-view.js +2 -2
  17. package/lib/actions/index-view.js.map +1 -1
  18. package/lib/actions/read.js +7 -3
  19. package/lib/actions/read.js.map +1 -1
  20. package/lib/actions/registry.js +3 -1
  21. package/lib/actions/registry.js.map +1 -1
  22. package/lib/actions/run.js +2 -2
  23. package/lib/actions/run.js.map +1 -1
  24. package/lib/actions/schema.js +18 -0
  25. package/lib/actions/schema.js.map +1 -1
  26. package/lib/actions/search.js +12 -6
  27. package/lib/actions/search.js.map +1 -1
  28. package/lib/actions/sources.js +116 -41
  29. package/lib/actions/sources.js.map +1 -1
  30. package/lib/actions/types.js +19 -1
  31. package/lib/actions/types.js.map +1 -1
  32. package/lib/browser-access.js +25 -0
  33. package/lib/browser-access.js.map +1 -1
  34. package/lib/catalog/recommend.js +11 -3
  35. package/lib/catalog/recommend.js.map +1 -1
  36. package/lib/catalog/schema.js +3 -1
  37. package/lib/catalog/schema.js.map +1 -1
  38. package/lib/cli/builtin-specs.js +341 -0
  39. package/lib/cli/builtin-specs.js.map +1 -0
  40. package/lib/cli/chain.js +193 -0
  41. package/lib/cli/chain.js.map +1 -0
  42. package/lib/cli/chains-spec.js +118 -0
  43. package/lib/cli/chains-spec.js.map +1 -0
  44. package/lib/cli/engine.js +99 -0
  45. package/lib/cli/engine.js.map +1 -0
  46. package/lib/cli/opencli-sites.js +83 -0
  47. package/lib/cli/opencli-sites.js.map +1 -0
  48. package/lib/cli/opencli.js +153 -0
  49. package/lib/cli/opencli.js.map +1 -0
  50. package/lib/cli/probe.js +128 -0
  51. package/lib/cli/probe.js.map +1 -0
  52. package/lib/cli/runner.js +564 -0
  53. package/lib/cli/runner.js.map +1 -0
  54. package/lib/cli/spec.js +496 -0
  55. package/lib/cli/spec.js.map +1 -0
  56. package/lib/cli/time-text.js +79 -0
  57. package/lib/cli/time-text.js.map +1 -0
  58. package/lib/cli/trial.js +57 -0
  59. package/lib/cli/trial.js.map +1 -0
  60. package/lib/client/SettingsCard.js +14 -32
  61. package/lib/client/SettingsCard.js.map +1 -1
  62. package/lib/client/agent-mark.js +27 -0
  63. package/lib/client/agent-mark.js.map +1 -0
  64. package/lib/client/card-frame.js +118 -0
  65. package/lib/client/card-frame.js.map +1 -0
  66. package/lib/client/cli-form.js +257 -0
  67. package/lib/client/cli-form.js.map +1 -0
  68. package/lib/client/field-docs.js +130 -0
  69. package/lib/client/field-docs.js.map +1 -0
  70. package/lib/client/field-keys.js +81 -0
  71. package/lib/client/field-keys.js.map +1 -0
  72. package/lib/client/field-rows.js +71 -0
  73. package/lib/client/field-rows.js.map +1 -0
  74. package/lib/client/fill.js +3 -0
  75. package/lib/client/fill.js.map +1 -0
  76. package/lib/client/form-specs.js +15 -1
  77. package/lib/client/form-specs.js.map +1 -1
  78. package/lib/client/form.js +296 -27
  79. package/lib/client/form.js.map +1 -1
  80. package/lib/client/group-advanced.js +23 -0
  81. package/lib/client/group-advanced.js.map +1 -0
  82. package/lib/client/group-agent.js +28 -0
  83. package/lib/client/group-agent.js.map +1 -0
  84. package/lib/client/group-cli.js +136 -0
  85. package/lib/client/group-cli.js.map +1 -0
  86. package/lib/client/group-common.js +29 -0
  87. package/lib/client/group-common.js.map +1 -0
  88. package/lib/client/group-judge.js +67 -0
  89. package/lib/client/group-judge.js.map +1 -0
  90. package/lib/client/group-order.js +201 -0
  91. package/lib/client/group-order.js.map +1 -0
  92. package/lib/client/group-runtime.js +33 -0
  93. package/lib/client/group-runtime.js.map +1 -0
  94. package/lib/client/group-sources.js +83 -0
  95. package/lib/client/group-sources.js.map +1 -0
  96. package/lib/client/groups-basic.js +36 -0
  97. package/lib/client/groups-basic.js.map +1 -0
  98. package/lib/client/index.js.map +1 -1
  99. package/lib/client/json-list.js +50 -0
  100. package/lib/client/json-list.js.map +1 -0
  101. package/lib/client/locales.js +666 -215
  102. package/lib/client/locales.js.map +1 -1
  103. package/lib/client/order.js +192 -0
  104. package/lib/client/order.js.map +1 -0
  105. package/lib/client/overlay-ops.js +46 -0
  106. package/lib/client/overlay-ops.js.map +1 -0
  107. package/lib/client/sources-table.js +1 -0
  108. package/lib/client/sources-table.js.map +1 -1
  109. package/lib/client/styles.js +74 -47
  110. package/lib/client/styles.js.map +1 -1
  111. package/lib/client/text-view.js +98 -0
  112. package/lib/client/text-view.js.map +1 -0
  113. package/lib/client/ui-kit.js +120 -0
  114. package/lib/client/ui-kit.js.map +1 -0
  115. package/lib/client/validators.js +22 -0
  116. package/lib/client/validators.js.map +1 -1
  117. package/lib/client.js +9151 -1987
  118. package/lib/client.js.map +1 -1
  119. package/lib/config-fillers.js +53 -0
  120. package/lib/config-fillers.js.map +1 -0
  121. package/lib/config-groups.js +49 -0
  122. package/lib/config-groups.js.map +1 -0
  123. package/lib/config.js +87 -107
  124. package/lib/config.js.map +1 -1
  125. package/lib/default-chain.js +66 -0
  126. package/lib/default-chain.js.map +1 -0
  127. package/lib/deps.js +109 -102
  128. package/lib/deps.js.map +1 -1
  129. package/lib/engine-error.js +19 -0
  130. package/lib/engine-error.js.map +1 -0
  131. package/lib/engines.js +32 -115
  132. package/lib/engines.js.map +1 -1
  133. package/lib/fetch.js +23 -4
  134. package/lib/fetch.js.map +1 -1
  135. package/lib/index.js +30 -5
  136. package/lib/index.js.map +1 -1
  137. package/lib/overlay-types.js +88 -0
  138. package/lib/overlay-types.js.map +1 -0
  139. package/lib/overlay.js +683 -0
  140. package/lib/overlay.js.map +1 -0
  141. package/lib/pipeline/candidates.js +27 -1
  142. package/lib/pipeline/candidates.js.map +1 -1
  143. package/lib/pipeline/compile.js +63 -0
  144. package/lib/pipeline/compile.js.map +1 -1
  145. package/lib/pipeline/confidence.js +64 -0
  146. package/lib/pipeline/confidence.js.map +1 -0
  147. package/lib/pipeline/fusion.js +50 -3
  148. package/lib/pipeline/fusion.js.map +1 -1
  149. package/lib/pipeline/plan.js +2 -2
  150. package/lib/pipeline/plan.js.map +1 -1
  151. package/lib/pipeline/render.js +20 -2
  152. package/lib/pipeline/render.js.map +1 -1
  153. package/lib/pipeline/run.js +21 -7
  154. package/lib/pipeline/run.js.map +1 -1
  155. package/lib/pipeline/sources-spec.js +19 -3
  156. package/lib/pipeline/sources-spec.js.map +1 -1
  157. package/lib/providers/builtin.js +13 -14
  158. package/lib/providers/builtin.js.map +1 -1
  159. package/lib/providers/deepseek.js +348 -0
  160. package/lib/providers/deepseek.js.map +1 -0
  161. package/lib/providers/http.js.map +1 -1
  162. package/lib/providers/keyed-meta.js +7 -0
  163. package/lib/providers/keyed-meta.js.map +1 -1
  164. package/lib/providers/platforms.js +118 -58
  165. package/lib/providers/platforms.js.map +1 -1
  166. package/lib/providers/registry.js.map +1 -1
  167. package/lib/restart.js +47 -0
  168. package/lib/restart.js.map +1 -0
  169. package/lib/router.js +203 -27
  170. package/lib/router.js.map +1 -1
  171. package/lib/rpc-types.js +15 -0
  172. package/lib/rpc-types.js.map +1 -0
  173. package/lib/rpc.js +85 -0
  174. package/lib/rpc.js.map +1 -0
  175. package/lib/tools.js +10 -4
  176. package/lib/tools.js.map +1 -1
  177. package/lib/types/actions/approval.d.ts +11 -0
  178. package/lib/types/actions/config.d.ts +54 -0
  179. package/lib/types/actions/format.d.ts +9 -2
  180. package/lib/types/actions/run.d.ts +1 -0
  181. package/lib/types/actions/schema.d.ts +7 -1
  182. package/lib/types/actions/sources.d.ts +29 -3
  183. package/lib/types/actions/types.d.ts +28 -2
  184. package/lib/types/browser-access.d.ts +17 -0
  185. package/lib/types/catalog/recommend.d.ts +4 -0
  186. package/lib/types/catalog/schema.d.ts +2 -0
  187. package/lib/types/cli/builtin-specs.d.ts +38 -0
  188. package/lib/types/cli/chain.d.ts +83 -0
  189. package/lib/types/cli/chains-spec.d.ts +48 -0
  190. package/lib/types/cli/engine.d.ts +50 -0
  191. package/lib/types/cli/opencli-sites.d.ts +24 -0
  192. package/lib/types/cli/opencli.d.ts +77 -0
  193. package/lib/types/cli/probe.d.ts +53 -0
  194. package/lib/types/cli/runner.d.ts +126 -0
  195. package/lib/types/cli/spec.d.ts +269 -0
  196. package/lib/types/cli/time-text.d.ts +12 -0
  197. package/lib/types/cli/trial.d.ts +19 -0
  198. package/lib/types/client/SettingsCard.d.ts +17 -1
  199. package/lib/types/client/agent-mark.d.ts +22 -0
  200. package/lib/types/client/card-frame.d.ts +35 -0
  201. package/lib/types/client/cli-form.d.ts +97 -0
  202. package/lib/types/client/field-docs.d.ts +15 -0
  203. package/lib/types/client/field-keys.d.ts +41 -0
  204. package/lib/types/client/field-rows.d.ts +70 -0
  205. package/lib/types/client/fill.d.ts +2 -0
  206. package/lib/types/client/form-specs.d.ts +12 -3
  207. package/lib/types/client/form.d.ts +79 -1
  208. package/lib/types/client/group-advanced.d.ts +9 -0
  209. package/lib/types/client/group-agent.d.ts +20 -0
  210. package/lib/types/client/group-cli.d.ts +52 -0
  211. package/lib/types/client/group-common.d.ts +12 -0
  212. package/lib/types/client/group-judge.d.ts +17 -0
  213. package/lib/types/client/group-order.d.ts +26 -0
  214. package/lib/types/client/group-runtime.d.ts +15 -0
  215. package/lib/types/client/group-sources.d.ts +46 -0
  216. package/lib/types/client/groups-basic.d.ts +18 -0
  217. package/lib/types/client/index.d.ts +8 -0
  218. package/lib/types/client/json-list.d.ts +21 -0
  219. package/lib/types/client/locales.d.ts +1079 -196
  220. package/lib/types/client/order.d.ts +102 -0
  221. package/lib/types/client/overlay-ops.d.ts +37 -0
  222. package/lib/types/client/styles.d.ts +56 -41
  223. package/lib/types/client/text-view.d.ts +22 -0
  224. package/lib/types/client/ui-kit.d.ts +200 -0
  225. package/lib/types/client/validators.d.ts +6 -0
  226. package/lib/types/config-fillers.d.ts +9 -0
  227. package/lib/types/config-groups.d.ts +23 -0
  228. package/lib/types/config.d.ts +265 -216
  229. package/lib/types/default-chain.d.ts +63 -0
  230. package/lib/types/deps.d.ts +25 -23
  231. package/lib/types/engine-error.d.ts +12 -0
  232. package/lib/types/engines.d.ts +45 -10
  233. package/lib/types/fetch.d.ts +12 -3
  234. package/lib/types/index.d.ts +164 -146
  235. package/lib/types/overlay-types.d.ts +98 -0
  236. package/lib/types/overlay.d.ts +141 -0
  237. package/lib/types/pipeline/candidates.d.ts +19 -0
  238. package/lib/types/pipeline/compile.d.ts +11 -0
  239. package/lib/types/pipeline/confidence.d.ts +35 -0
  240. package/lib/types/pipeline/fusion.d.ts +23 -1
  241. package/lib/types/pipeline/render.d.ts +16 -0
  242. package/lib/types/pipeline/run.d.ts +3 -1
  243. package/lib/types/pipeline/sources-spec.d.ts +5 -2
  244. package/lib/types/pipeline/types.d.ts +37 -0
  245. package/lib/types/providers/deepseek.d.ts +130 -0
  246. package/lib/types/providers/http.d.ts +2 -1
  247. package/lib/types/providers/keyed-meta.d.ts +5 -0
  248. package/lib/types/providers/platforms.d.ts +15 -3
  249. package/lib/types/providers/registry.d.ts +10 -0
  250. package/lib/types/restart.d.ts +52 -0
  251. package/lib/types/router.d.ts +69 -9
  252. package/lib/types/rpc-types.d.ts +79 -0
  253. package/lib/types/rpc.d.ts +41 -0
  254. package/lib/types/tools.d.ts +6 -0
  255. package/lib/types/util.d.ts +16 -1
  256. package/lib/util.js +17 -4
  257. package/lib/util.js.map +1 -1
  258. package/package.json +51 -43
  259. package/scripts/check-client-bundle.mjs +1 -1
  260. package/scripts/cli-login-check.mjs +214 -0
  261. package/lib/client/RubricEditor.js +0 -47
  262. package/lib/client/RubricEditor.js.map +0 -1
  263. package/lib/client/fields.js +0 -31
  264. package/lib/client/fields.js.map +0 -1
  265. package/lib/types/client/RubricEditor.d.ts +0 -6
  266. package/lib/types/client/fields.d.ts +0 -65
@@ -17,6 +17,7 @@ import type { BrowserMethod } from '../browser-access.ts';
17
17
  import type { ResolvedConfig } from '../config.ts';
18
18
  import type { CompiledQuery } from '../pipeline/compile.ts';
19
19
  import type { TaskSpec } from '../pipeline/types.ts';
20
+ import type { ChainReport } from '../cli/chain.ts';
20
21
  export type Operation = 'search';
21
22
  /** `web`: a general search engine; `platform`: one site or community (addressable as `search.run platform=<route id>`). */
22
23
  export type ProviderKind = 'web' | 'platform';
@@ -84,6 +85,13 @@ export interface ProviderDescriptor {
84
85
  costTier?: CostTier;
85
86
  /** Order among providers promoted for a language (lower first, default 100). */
86
87
  priority?: number;
88
+ /**
89
+ * "常用" (common): the source this plugin recommends first. Once its key resolves it leads the default order in every language
90
+ * (ahead of the other promoted sources and of the configured `engines`), and `sources.status`, `search.recommend` and the settings
91
+ * panel mark it. It never overrides what the user said: an explicit `engines` list, then `sources.priority` / `sources.disabled`,
92
+ * then `evidence.sourcePolicy: anonymous-only` all come first. Without a key it is not planned.
93
+ */
94
+ common?: boolean;
87
95
  /** Default `web`. A `platform` provider is never added to a plan on its own, only by an explicit source choice or a hard `site` constraint naming one of its `domains`. */
88
96
  kind?: ProviderKind;
89
97
  /** Site domains a `platform` provider covers (`zhihu.com`): a hard `site` constraint on one of them selects it. */
@@ -126,6 +134,8 @@ export interface ProviderAdapter {
126
134
  /** Local readiness: declared services, keys, commands. No network, no login, no model call. */
127
135
  probeLocal(env: ProbeEnv): Readiness | Promise<Readiness>;
128
136
  create(deps: EngineDeps, config: ResolvedConfig): Engine;
137
+ /** Platforms with an ordered backend chain (dev-plan M12): the state of every leg for `sources.status`. Local, no search. */
138
+ chain?(env: ProbeEnv): Promise<ChainReport>;
129
139
  /** Optional native query compilation (constraints -> provider options); absent = the core compiler's rules / plain query. */
130
140
  compile?(task: Pick<TaskSpec, 'goal' | 'query' | 'needs' | 'constraints'>, now: Date): CompiledQuery;
131
141
  }
@@ -0,0 +1,52 @@
1
+ /**
2
+ * The settings that are read once, when the plugin starts. Almost every field of `Config` is live (the Host updates the entry's
3
+ * configuration in place and every call reads it through `dynamic()`), but these few are applied while the plugin is mounted:
4
+ * a database opened, a tool registered, a cache sized, a deadline fixed. The Host lets them be edited (they are volatile in
5
+ * the schema), so without a marker the edit looks like it was ignored until the next restart.
6
+ *
7
+ * One constant lists them; the settings card marks them, the save bar says so when a save touches one, and `sources.status` /
8
+ * `config.inspect` report "待重启" when the configured value differs from the one the running plugin started with. Pure and
9
+ * free of imports: the client bundle includes this file.
10
+ * @module web-search-pro/restart
11
+ */
12
+ export interface PendingRestart {
13
+ field: string;
14
+ /** The value in force: what the plugin started with. */
15
+ running: string;
16
+ /** The value the configuration holds now. */
17
+ configured: string;
18
+ }
19
+ /** Why each field is read at start-up only (shown in the docs and the card's `?` text). */
20
+ export declare const RESTART_FIELDS: {
21
+ readonly toolSurface: "the tools (web_index + web_call, or one tool per action) are registered at start-up";
22
+ readonly 'playwright.snapshotDir': "the snapshot folder of read.snapshot is resolved at start-up";
23
+ readonly providerId: "the id of the ctx.web provider is given to the Host at registration";
24
+ readonly registerProvider: "the ctx.web provider is registered at start-up";
25
+ readonly timeoutMs: "the per-action deadlines and the Host tool ceiling are fixed at start-up (the cooperative time budget of a search reads it live)";
26
+ readonly memoryCacheEntries: "the in-process LRU cache is sized at start-up";
27
+ readonly dbPath: "the SQLite store and the overlay file are opened at start-up";
28
+ readonly verbose: "the load marker is written at start-up";
29
+ };
30
+ export type RestartField = keyof typeof RESTART_FIELDS;
31
+ /** The field names, in the order of the configuration groups (config-groups.ts). */
32
+ export declare const RESTART_FIELD_LIST: RestartField[];
33
+ export declare const isRestartField: (field: string) => field is RestartField;
34
+ /** The slice of the resolved configuration the restart check reads. */
35
+ export interface RestartSource {
36
+ dbPath: string;
37
+ toolSurface: string;
38
+ registerProvider: boolean;
39
+ providerId: string;
40
+ verbose: boolean;
41
+ memoryCacheEntries: number;
42
+ timeoutMs: number;
43
+ playwright: {
44
+ snapshotDir?: string;
45
+ };
46
+ }
47
+ /** The values of the restart fields as short text, from a resolved configuration. */
48
+ export declare function restartValues(config: RestartSource): Record<RestartField, string>;
49
+ /** The restart fields whose configured value differs from the one the running plugin started with. */
50
+ export declare function pendingRestart(mounted: Readonly<Record<RestartField, string>>, current: Readonly<Record<RestartField, string>>): PendingRestart[];
51
+ /** `待重启:toolSurface(当前生效 indexed,配置为 flat)`, one line per field. */
52
+ export declare function pendingRestartLine(entry: PendingRestart): string;
@@ -7,7 +7,8 @@ import type { Context } from '@deepseek-ai/cordis';
7
7
  import type { WebSearchRequest, WebSearchResult } from '@deepseek-ai/dsh-web';
8
8
  import type { Store } from './store.ts';
9
9
  import type { ResolvedConfig } from './config.ts';
10
- import { type EngineSearchOptions } from './engines.ts';
10
+ import { type EngineSearchOptions, type UsageRecorder } from './engines.ts';
11
+ import type { ChainEntryReport, ChainReport } from './cli/chain.ts';
11
12
  import { type CostTier, type ProviderDescriptor, type Readiness, type ProviderRegistry } from './providers/index.ts';
12
13
  import { type RequestBudgetState } from './pipeline/ledger.ts';
13
14
  import { LruCache } from './memory-cache.ts';
@@ -46,14 +47,19 @@ export interface PlatformRequest {
46
47
  authProfile?: string;
47
48
  rulePack?: string;
48
49
  }
50
+ /** A result row as the router returns it; `via`, `confidence` and `tag` appear for custom CLIs and for sources with a confidence below 1. */
51
+ export type RouterSource = {
52
+ url: string;
53
+ title?: string;
54
+ snippet?: string;
55
+ publishedAt?: string;
56
+ via?: string;
57
+ confidence?: number;
58
+ tag?: string;
59
+ };
49
60
  export interface RouterSearchResult {
50
61
  content?: string;
51
- sources: {
52
- url: string;
53
- title?: string;
54
- snippet?: string;
55
- publishedAt?: string;
56
- }[];
62
+ sources: RouterSource[];
57
63
  engine: string;
58
64
  enginesTried: string[];
59
65
  fromCache: boolean;
@@ -61,6 +67,8 @@ export interface RouterSearchResult {
61
67
  availableCount?: number;
62
68
  /** Human-readable explanation of why the router fell back to `engine` (P1-1). */
63
69
  fallbackNote?: string;
70
+ /** Platform search: the backend of its chain that answered (`bili`, `browser-opencli`). */
71
+ backend?: string;
64
72
  }
65
73
  /** One provider as `sources.status` reports it: the registry descriptor plus local readiness by dimension. */
66
74
  export interface ProviderReport {
@@ -92,7 +100,16 @@ export interface ProviderReport {
92
100
  budget?: RequestBudgetState;
93
101
  /** Not verified against the live service (descriptor.verification). */
94
102
  unverified?: boolean;
103
+ /** "常用": the plugin's recommended source (descriptor.common). With a resolved key it leads the default order. */
104
+ common?: boolean;
105
+ /** Confidence (0..1) of what this source returns: 1 for a built-in source unless `sources.confidence` says otherwise; a custom CLI has its spec's. */
106
+ confidence: number;
107
+ /** Platforms with an ordered backend chain: each backend, in order, with its readiness or the reason it is skipped. */
108
+ chain?: (ChainEntryReport & {
109
+ confidence: number;
110
+ })[];
95
111
  readiness: Readiness & {
112
+ state?: ChainReport['state'];
96
113
  lastLocalCheck: string;
97
114
  lastRemoteSuccess?: string;
98
115
  lastError?: string;
@@ -115,6 +132,11 @@ export declare class SearchRouter {
115
132
  private syncedRevision;
116
133
  /** Custom platforms (settings `customPlatforms`) this router registered: key -> spec signature + unregister. A key the registry refused stays here with its problem so it is not retried on every call. */
117
134
  private readonly custom;
135
+ /** User-defined CLI adapters (settings `cliAdapters`) this router registered as `custom-cli:<id>` platforms, with the diagnostics of the entries it ignored. */
136
+ private readonly customCli;
137
+ private cliAdapterDiagnostics;
138
+ /** Confidence of each registered custom CLI by route id (its spec's, default 0.5), rebuilt with the registrations. */
139
+ private customConfidence;
118
140
  /** Latest local probe per route id (read by providerStatuses for the credential dimension). */
119
141
  private readonly readiness;
120
142
  /** Last real call per route id: feeds the health dimension (never inferred from a local probe). */
@@ -128,6 +150,10 @@ export declare class SearchRouter {
128
150
  * with a provider already registered is not registered (a user platform never replaces a built-in source); see {@link customPlatformProblems}.
129
151
  */
130
152
  private syncCustomPlatforms;
153
+ /** The same for `cliAdapters`: valid specs become `custom-cli:<id>` platforms; an invalid entry is ignored and reported. */
154
+ private syncCustomCliAdapters;
155
+ /** Configuration problems of the CLI adapter layer for `sources.status`: ignored `cliAdapters` entries and `platformBackends` that name nothing usable. */
156
+ cliAdapterProblems(): string[];
131
157
  /** Custom platforms the registry could not take (key clash, bad key), for `sources.status`. */
132
158
  customPlatformProblems(): string[];
133
159
  /** Unregister what this router put into the registry (plugin unload). */
@@ -139,10 +165,27 @@ export declare class SearchRouter {
139
165
  private bindingsOf;
140
166
  private probeEnv;
141
167
  /**
142
- * The configured `engines` list with the user's `sources.*` preferences applied: disabled sources removed, `priority` ones that are
143
- * already in the list moved to the front in their listed order. An explicit `engines` of a call never goes through this.
168
+ * The default engine order for a search that names no `engines`: the configured `engines` list with the user's `sources.*`
169
+ * preferences applied, then the default rule for "常用" (common) sources.
170
+ * 1. an explicit `engines` of a call never comes through here;
171
+ * 2. `sources.disabled` ids are removed, `sources.priority` ids that are in the list move to the front in their listed order;
172
+ * 3. a common source (DeepSeek Search) whose key resolves leads what is left, while `engines` is still the default list (a
173
+ * list the user wrote is theirs: it keeps its order, and a common source in it keeps the position given). `sources.disabled`
174
+ * and `evidence.sourcePolicy: anonymous-only` switch it off.
144
175
  */
145
176
  private preferred;
177
+ /** Route ids of the common ("常用") sources that are ready to run now (key resolved), best `priority` first. */
178
+ private commonReady;
179
+ /**
180
+ * Key and endpoint of the DeepSeek Fetch API for the fetch pipeline, or undefined when no key resolves (settings literal ->
181
+ * DSH credentials ref -> process environment, the same order as the search side). Resolved per call; the key is never cached.
182
+ */
183
+ deepseekAccess(): Promise<{
184
+ apiKey: string;
185
+ baseUrl?: string;
186
+ allowProxyFakeIp: boolean;
187
+ usage: UsageRecorder;
188
+ } | undefined>;
146
189
  /** Alias / full id -> route id; ids the registry does not know are kept as written (the backend then reports them unknown). */
147
190
  private canonicalIds;
148
191
  backendDiagnostics(cliAvailability?: ReadonlyMap<string, boolean>): Promise<BackendDiagnostic[]>;
@@ -163,6 +206,13 @@ export declare class SearchRouter {
163
206
  runProvider(call: ProviderCall, opts?: {
164
207
  skipSeam?: boolean;
165
208
  }): Promise<ProviderOutcome>;
209
+ /**
210
+ * The credential variables of the CLI adapters under the names the tools read, each resolved like the plugin's other secrets:
211
+ * settings literal -> DSH credentials ref (`twitterAuthTokenEnv`) -> process environment. Values only ever reach a command's environment.
212
+ */
213
+ cliEnv(): Promise<Record<string, string>>;
214
+ /** Sync twin of {@link cliEnv} for `available()` checks: settings literal and process environment only. */
215
+ private cliEnvSync;
166
216
  /** Resolve a key through credentials first, then process env. */
167
217
  private resolveKey;
168
218
  private deps;
@@ -181,6 +231,16 @@ export declare class SearchRouter {
181
231
  requestBudgetOf(route: string): RequestBudgetState | undefined;
182
232
  /** Problems of the `sources.*` settings (unknown ids, bad numbers), for `sources.status`. */
183
233
  sourceDiagnostics(): string[];
234
+ /** The confidence of one platform backend as a leg of a chain (`xhs`, `custom-cli:echo`): its own, without the provider's. */
235
+ backendConfidenceOf(id: string): number;
236
+ /** `sources.confidence` by canonical id (a provider's route id; a platform backend id as written), valid entries only. */
237
+ private confidenceOverrides;
238
+ /**
239
+ * The confidence (0..1) of what `route` returned, through `backend` when it is a platform chain: `sources.confidence` of the
240
+ * provider times that of the backend that answered, each defaulting to the custom CLI's own (spec `confidence`, 0.5) and to 1
241
+ * for every built-in source, so the built-in ones are 1 unless the user set something.
242
+ */
243
+ confidenceOf(route: string, backend?: string): number;
184
244
  /** Counts a metered, non-model request (Bocha search) in the usage ledger; best effort, never throws into the search. */
185
245
  private usageRecorder;
186
246
  /** Whether any configured engine is currently usable. */
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The private RPC channel between the settings card and the running plugin: the shapes it carries. Free of runtime imports (the card
3
+ * bundle includes this file); the server half is src/rpc.ts. The calls:
4
+ * - `status`: what the plugin can tell about each source and backend right now (installed, ready, why not), from the same local probes
5
+ * as `sources.status`; never a search, never a login;
6
+ * - `trial`: runs ONE search of a custom CLI spec that is still a draft in the dialog, the way a real search would run it (probe, then the
7
+ * spec's command through the same runner and the same read-only guard), and reports what it parsed and what the tool said;
8
+ * - `overlay`: what the agent overlay holds (the settings an agent changed with `config.*`) and its newest audit entries;
9
+ * - `overlay.revoke`: drop overlay entries (one or several keys, or all), as the user: the card's "Revoke" and the second half of
10
+ * "Adopt" (the card writes the value into the profile first, then asks the plugin to drop the entry). Audited with actor `user`.
11
+ * @module web-search-pro/rpc-types
12
+ */
13
+ import type { OverlayView } from './overlay-types.ts';
14
+ import type { PendingRestart } from './restart.ts';
15
+ /** The channel prefix this plugin registers with the Host transport (Browser registers `/dsh-browser-assets` the same way). */
16
+ export declare const RPC_CHANNEL = "/dsh-web-search-pro";
17
+ /** `status`: readiness by source route id and by the backend legs of each platform chain (`<platform>/<backend>`). */
18
+ export interface StatusView {
19
+ sources: Record<string, {
20
+ available: boolean;
21
+ reason?: string;
22
+ confidence: number;
23
+ }>;
24
+ legs: Record<string, {
25
+ ready: boolean;
26
+ reason?: string;
27
+ confidence: number;
28
+ }>;
29
+ /** Settings the configuration holds that the running plugin only reads at start-up (the card shows "restart the plugin"). */
30
+ pendingRestart?: PendingRestart[];
31
+ /** The agent overlay in one line: how many keys it overrides and whether it is being ignored. */
32
+ overlay?: {
33
+ revision: number;
34
+ count: number;
35
+ valid: boolean;
36
+ problem?: string;
37
+ };
38
+ }
39
+ export type { OverlayView, PendingRestart };
40
+ /** `overlay.revoke`: the keys to drop (`OverlayItem.key`), or `'all'`; `adopted` says the value was first written into the configuration. */
41
+ export interface RevokeRequest {
42
+ keys: string[] | 'all';
43
+ adopted?: boolean;
44
+ }
45
+ export interface TrialRequest {
46
+ /** The key of the entry (`cliAdapters.<id>`). */
47
+ id: string;
48
+ /** The spec as the dialog has it now (validated by the server with the rule every spec goes through). */
49
+ spec: unknown;
50
+ /** The sample query; the dialog proposes one. */
51
+ query: string;
52
+ }
53
+ /** What a trial found: the first results (as the runner mapped them) and the tool's own words, or the stage it stopped at and why. */
54
+ export type TrialResult = {
55
+ ok: true;
56
+ stage: 'search';
57
+ probe: {
58
+ version?: string;
59
+ path?: string;
60
+ };
61
+ sources: {
62
+ url: string;
63
+ title?: string;
64
+ snippet?: string;
65
+ publishedAt?: string;
66
+ }[];
67
+ total: number;
68
+ raw: string;
69
+ elapsedMs: number;
70
+ } | {
71
+ ok: false;
72
+ stage: 'disabled' | 'validate' | 'probe' | 'search';
73
+ message: string;
74
+ errors?: string[];
75
+ code?: string;
76
+ hint?: string;
77
+ raw?: string;
78
+ elapsedMs?: number;
79
+ };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The server half of the private RPC channel of the settings card (see rpc-types.ts). It uses the Host's connection transport the
3
+ * way the dsh-browser plugin does for its panel (`connection.rpc.handle`, an authenticated absolute channel prefix); when the Host
4
+ * has no `connection` / `webServer` service nothing is registered and the card says that "Try it" and the live readiness are
5
+ * unavailable (everything else in the card works without them).
6
+ * @module web-search-pro/rpc
7
+ */
8
+ import type { Context } from '@deepseek-ai/cordis';
9
+ import type { ResolvedConfig } from './config.ts';
10
+ import type { SearchRouter } from './router.ts';
11
+ import type { OverlayStore } from './overlay.ts';
12
+ import type { PendingRestart } from './restart.ts';
13
+ import { type StatusView } from './rpc-types.ts';
14
+ type Handler = (endpoint: string, payload: unknown, context?: {
15
+ signal?: AbortSignal;
16
+ }) => Promise<{
17
+ ok: true;
18
+ value: unknown;
19
+ } | {
20
+ ok: false;
21
+ error: {
22
+ code: 'bad-request' | 'not-found';
23
+ message: string;
24
+ details: Record<string, unknown>;
25
+ };
26
+ }>;
27
+ export interface RpcServices {
28
+ router: Pick<SearchRouter, 'providerReport'>;
29
+ dynamic: () => ResolvedConfig;
30
+ /** The agent overlay (read and revoke endpoints); absent in tests of the older endpoints. */
31
+ overlay?: OverlayStore;
32
+ /** Settings changed in the configuration that only take effect at the next start. */
33
+ pendingRestart?: () => PendingRestart[];
34
+ }
35
+ /** Readiness for the card, from the report `sources.status` is made of (local probes; never a search). */
36
+ export declare function statusView(router: Pick<SearchRouter, 'providerReport'>, extras?: Pick<RpcServices, 'overlay' | 'pendingRestart'>): Promise<StatusView>;
37
+ /** The handler of the channel: `status` and `trial`. A failure is a value (`ok: false`), never a throw into the transport. */
38
+ export declare function createHandler(services: RpcServices): Handler;
39
+ /** Register the channel when the Host has the transport; the effect unregisters it with the plugin. */
40
+ export declare function registerRpc(ctx: Context, services: RpcServices): void;
41
+ export {};
@@ -22,6 +22,8 @@ import type { BrowserService } from './browser-service.ts';
22
22
  import type { ResolvedConfig, ToolSurface } from './config.ts';
23
23
  import { EvidenceService } from './pipeline/service.ts';
24
24
  import type { ProviderState } from './provider.ts';
25
+ import type { OverlayStore } from './overlay.ts';
26
+ import type { PendingRestart } from './restart.ts';
25
27
  export interface ToolDeps {
26
28
  ctx: Context;
27
29
  config: ResolvedConfig;
@@ -40,5 +42,9 @@ export interface ToolDeps {
40
42
  providerState?: () => ProviderState;
41
43
  /** Whether the `dsh-web-search-pro` skill is currently registered; read at call time. */
42
44
  skillAvailable?: () => boolean;
45
+ /** The agent overlay behind the `config.*` actions. */
46
+ overlay?: OverlayStore;
47
+ /** Settings changed in the configuration that only take effect at the next start. */
48
+ pendingRestart?: () => PendingRestart[];
43
49
  }
44
50
  export declare function registerTools(deps: ToolDeps): void;
@@ -76,6 +76,10 @@ export interface CliResult {
76
76
  stdout: string;
77
77
  stderr: string;
78
78
  timedOut: boolean;
79
+ /** The command could not be started at all (not on PATH, not executable). */
80
+ spawnFailed?: boolean;
81
+ /** Output went past `maxOutput` and the rest was dropped. */
82
+ truncated?: boolean;
79
83
  }
80
84
  /**
81
85
  * Run an external CLI (opencli / bili / yt-dlp / agent-reach / npm).
@@ -85,7 +89,8 @@ export interface CliResult {
85
89
  export declare function runCli(bin: string, args: string[], opts?: {
86
90
  timeoutMs?: number;
87
91
  signal: AbortSignal | undefined;
88
- env?: Record<string, string>;
92
+ env?: Record<string, string>; /** Run with exactly this environment instead of extending the process environment (credentials are not inherited). */
93
+ cleanEnv?: boolean;
89
94
  cwd?: string;
90
95
  maxOutput?: number;
91
96
  outputEncoding?: string;
@@ -106,10 +111,20 @@ export declare function shapeSources(sources: readonly {
106
111
  snippet?: string | null;
107
112
  publishedAt?: string | null;
108
113
  lowConfidence?: boolean;
114
+ rerankScore?: number | null;
115
+ authority?: number | null;
116
+ via?: string | null;
117
+ tag?: string | null;
118
+ confidence?: number | null;
109
119
  }[], count: number): {
110
120
  url: string;
111
121
  title?: string;
112
122
  snippet?: string;
113
123
  publishedAt?: string;
124
+ rerankScore?: number;
125
+ authority?: number;
114
126
  lowConfidence?: true;
127
+ via?: string;
128
+ confidence?: number;
129
+ tag?: string;
115
130
  }[];
package/lib/util.js CHANGED
@@ -11,6 +11,7 @@ import path from 'node:path';
11
11
  import crossSpawn from 'cross-spawn';
12
12
  import { load as yamlLoad } from 'js-yaml';
13
13
  import { parse as parseHtml } from 'node-html-parser';
14
+ import { WHOLE_OUTPUT_SCHEME } from "./cli/spec.js";
14
15
  import { assertResolvedPublicUrl, readBoundedBody, stripSensitiveHeadersForRedirect } from "./safe-http.js";
15
16
  /** js-yaml parser (npm dep). */
16
17
  export const jsYaml = { load: (input) => yamlLoad(input) };
@@ -199,6 +200,8 @@ export function runCli(bin, args, opts = { signal: undefined }) {
199
200
  let stderrBytes = 0;
200
201
  let child;
201
202
  let settled = false;
203
+ let spawnFailed = false;
204
+ let truncated = false;
202
205
  const finish = (code, timedOut) => {
203
206
  if (settled)
204
207
  return;
@@ -210,7 +213,7 @@ export function runCli(bin, args, opts = { signal: undefined }) {
210
213
  const encoding = opts.outputEncoding ?? 'utf-8';
211
214
  const stdout = new TextDecoder(encoding).decode(Buffer.concat(stdoutChunks, stdoutBytes));
212
215
  const stderr = new TextDecoder(encoding).decode(Buffer.concat(stderrChunks, stderrBytes));
213
- resolve({ code, stdout, stderr, timedOut });
216
+ resolve({ code, stdout, stderr, timedOut, ...spawnFailed ? { spawnFailed } : {}, ...truncated ? { truncated } : {} });
214
217
  };
215
218
  const timer = opts.timeoutMs ? setTimeout(() => finish(-1, true), opts.timeoutMs) : undefined;
216
219
  const onAbort = () => {
@@ -219,12 +222,14 @@ export function runCli(bin, args, opts = { signal: undefined }) {
219
222
  finish(-1, false);
220
223
  };
221
224
  child = crossSpawn(bin, args, {
222
- env: { ...process.env, ...opts.env },
225
+ env: opts.cleanEnv ? { ...opts.env } : { ...process.env, ...opts.env },
223
226
  cwd: opts.cwd,
224
227
  windowsHide: process.platform === 'win32',
225
228
  });
226
229
  child.stdout?.on('data', (d) => {
227
230
  const remaining = maxOutput - stdoutBytes;
231
+ if (d.length > remaining)
232
+ truncated = true;
228
233
  if (remaining <= 0)
229
234
  return;
230
235
  const chunk = d.length <= remaining ? d : d.subarray(0, remaining);
@@ -239,7 +244,7 @@ export function runCli(bin, args, opts = { signal: undefined }) {
239
244
  stderrChunks.push(chunk);
240
245
  stderrBytes += chunk.length;
241
246
  });
242
- child.on('error', () => finish(-1, false));
247
+ child.on('error', () => { spawnFailed = true; finish(-1, false); });
243
248
  child.on('close', (code) => finish(code ?? -1, false));
244
249
  if (opts.signal?.aborted)
245
250
  onAbort();
@@ -281,9 +286,17 @@ export function shapeSources(sources, count) {
281
286
  return sources.slice(0, count).map(s => ({
282
287
  url: s.url,
283
288
  ...s.title ? { title: s.title } : {},
284
- ...s.snippet ? { snippet: capText(s.snippet, SNIPPET_MAX_CHARS) } : {},
289
+ // A whole-output result (`cli://`) was already cut by the runner, with a note saying so: the generic cap would only cut it again.
290
+ ...s.snippet ? { snippet: s.url.startsWith(WHOLE_OUTPUT_SCHEME) ? s.snippet : capText(s.snippet, SNIPPET_MAX_CHARS) } : {},
285
291
  ...s.publishedAt ? { publishedAt: s.publishedAt } : {},
292
+ // The provider's own quality grade (DeepSeek Search), as source metadata.
293
+ ...typeof s.rerankScore === 'number' && Number.isFinite(s.rerankScore) ? { rerankScore: Math.round(s.rerankScore * 100) / 100 } : {},
294
+ ...typeof s.authority === 'number' && Number.isFinite(s.authority) && s.authority >= 0 ? { authority: s.authority } : {},
286
295
  ...s.lowConfidence ? { lowConfidence: true } : {},
296
+ // Which user-defined CLI returned the row, how far the source is trusted (below 1 only) and the honest label.
297
+ ...s.via ? { via: s.via } : {},
298
+ ...typeof s.confidence === 'number' && Number.isFinite(s.confidence) && s.confidence < 1 ? { confidence: Math.round(Math.max(s.confidence, 0) * 10_000) / 10_000 } : {},
299
+ ...s.tag ? { tag: s.tag } : {},
287
300
  }));
288
301
  }
289
302
  //# sourceMappingURL=util.js.map
package/lib/util.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAqB,MAAM,oBAAoB,CAAA;AACpE,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,UAAU,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC1C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,gCAAgC,EAAgC,MAAM,gBAAgB,CAAA;AAEzI,gCAAgC;AAChC,MAAM,CAAC,MAAM,MAAM,GAAqC,EAAE,IAAI,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAA;AAEpG;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IAC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