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
@@ -0,0 +1,102 @@
1
+ /**
2
+ * The pure side of the "Search order" group: the lists it edits (engines, the backend chain of a platform), the sources one can
3
+ * add to them, what a source is called and whether the card can tell it is ready, and the edits as text patches. No Host, no DOM:
4
+ * the editors call these and stage the resulting text into the form model, the tests call the same functions.
5
+ * @module web-search-pro/client/order
6
+ */
7
+ import { type SourceDef } from './field-keys.ts';
8
+ /** Dictionary-independent facts the list rows show; the names are proper names, the same in every language. */
9
+ export type SourceKind = 'keyed' | 'anonymous' | 'seam' | 'custom' | 'unknown';
10
+ export interface SourceInfo {
11
+ id: string;
12
+ name: string;
13
+ kind: SourceKind;
14
+ /** The row of the sources list this source is (key reference, request budget), when it has one. */
15
+ def?: SourceDef;
16
+ }
17
+ /** The ctx.web engine of the Host: the default `engines` list names it (`seam`). */
18
+ export declare const SEAM_SOURCE: {
19
+ readonly id: "seam";
20
+ readonly name: "ctx.web (seam)";
21
+ };
22
+ /** The route ids a general engine list may name: every keyed and anonymous source of the card, plus the ctx.web engine. */
23
+ export declare const BUILTIN_ENGINE_IDS: readonly string[];
24
+ /** Id of a custom CLI as `engines` and `platformBackends` write it. */
25
+ export declare const customId: (id: string) => string;
26
+ export declare const isCustomId: (id: string) => boolean;
27
+ /** The custom CLI entries of the (staged) `cliAdapters` value, by id, in the order they were written. */
28
+ export declare function customEntries(cliAdapters: unknown): [string, Record<string, unknown>][];
29
+ /** What the list needs to know of a source id: its name and what kind it is. `cliAdapters` is the staged value (custom ids are looked up in it). */
30
+ export declare function sourceInfo(id: string, cliAdapters?: unknown): SourceInfo;
31
+ /** The ids of a list value written as comma-separated text (`engines`), de-duplicated, in order. */
32
+ export declare const idsOf: (text: string) => string[];
33
+ /** The text form of a list of ids. */
34
+ export declare const textOf: (ids: readonly string[]) => string;
35
+ export declare function addId(ids: readonly string[], id: string): string[];
36
+ export declare function removeId(ids: readonly string[], id: string): string[];
37
+ /** Move `id` one place towards the front (`-1`) or the back (`1`); at an end, or when absent, the list comes back unchanged. */
38
+ export declare function moveId(ids: readonly string[], id: string, delta: -1 | 1): string[];
39
+ /**
40
+ * The sources that can be added to the general engine list: the built-in ones and the custom CLIs marked `engine`, those already in
41
+ * the list left out. A custom CLI whose spec is invalid is not offered (the server would not register it).
42
+ */
43
+ export declare function engineChoices(current: readonly string[], cliAdapters: unknown): string[];
44
+ /** Display names of the platforms that have a backend chain (proper names; the ids are what `platformBackends` is keyed by). */
45
+ export declare const PLATFORM_NAMES: Readonly<Record<string, string>>;
46
+ /** Display names of the fixed (non-CLI) backends. */
47
+ export declare const BACKEND_NAMES: Readonly<Record<string, string>>;
48
+ /** The platforms the card lists: every one with a backend chain. */
49
+ export declare const ORDER_PLATFORMS: readonly string[];
50
+ /** The built-in default chain of a platform. */
51
+ export declare const defaultChainOf: (platform: string) => readonly string[];
52
+ /**
53
+ * The backends that can sit in the chain of `platform`: the built-in ones that serve it (CLI specs and the fixed backends) and the
54
+ * custom CLIs whose spec declares the platform; those already in `current` are left out.
55
+ */
56
+ export declare function backendChoices(platform: string, current: readonly string[], cliAdapters: unknown): string[];
57
+ /** The name a backend row shows: the fixed backends and custom CLIs by name, a CLI spec by its command. */
58
+ export declare function backendName(id: string): string;
59
+ /** The `platformBackends` value of the staged text as an object (undefined when it is empty or not an object). */
60
+ export declare function chainsOf(text: string): Record<string, string[]> | undefined;
61
+ /**
62
+ * `platformBackends` text with the chain of `platform` set to `ids`, or the platform's key removed (`ids` undefined: back to the
63
+ * default chain). Other platforms, and keys this card does not know, are kept as they were. The empty object comes back as
64
+ * the empty text, which the form model stores as "not set".
65
+ */
66
+ export declare function withChain(text: string, platform: string, ids: readonly string[] | undefined): string | undefined;
67
+ export interface CustomRow {
68
+ id: string;
69
+ bin: string;
70
+ engine: boolean;
71
+ platforms: string[];
72
+ confidence: number;
73
+ /** The validation problems of the entry (empty = the spec is valid and the server registers it). */
74
+ problems: string[];
75
+ }
76
+ /** One row per custom CLI of the staged `cliAdapters` value: what the list shows, with the server's own validation. */
77
+ export declare function customRows(cliAdapters: unknown): CustomRow[];
78
+ /** The platforms people reach for most: listed even when nothing was changed for them. */
79
+ export declare const COMMON_PLATFORMS: readonly string[];
80
+ /**
81
+ * Which platforms the list shows up front, and which fold into "show the rest": a platform is shown when its chain was changed
82
+ * (`platformBackends` has its key), when a valid custom CLI declares it, or when it is one of the common ones. Both halves keep the
83
+ * order of `platforms`. `platformBackends` is the staged text; when it is not valid JSON nothing counts as changed.
84
+ */
85
+ export declare function splitPlatforms(platforms: readonly string[], platformBackends: string, cliAdapters: unknown): {
86
+ shown: string[];
87
+ rest: string[];
88
+ };
89
+ /** The platforms whose display name or id contains `query` (case-insensitive, surrounding spaces ignored); an empty query keeps all. */
90
+ export declare function filterPlatforms(platforms: readonly string[], query: string): string[];
91
+ export interface ConfidenceView {
92
+ /** The value the row runs with: the typed override when it is a number, else the source's default. */
93
+ effective: number;
94
+ /** The text is not a number in 0-1. */
95
+ invalid: boolean;
96
+ /** Whether the row has its own value in the draft (the box is not empty). */
97
+ typed: boolean;
98
+ /** The value changes nothing (it is 1) and is not wrong: the row shows it as a quiet "default" until someone opens it. */
99
+ quiet: boolean;
100
+ }
101
+ /** What the confidence box of a row shows, from the staged text of `sources.confidence.<id>` and the default of the source. */
102
+ export declare function confidenceView(text: string, defaultValue: number): ConfidenceView;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * What "Adopt into configuration" writes, and the small formatting the agent section needs. Pure and free of the Host: the
3
+ * controller calls these, the tests call the same functions.
4
+ *
5
+ * Adopting an overlay entry means the user takes the agent's value as their own: it is written into the profile (the baseline) with
6
+ * the same atomic `mutate` the save bar uses, at the leaf the entry is about (`sources.confidence.<id>`, `cliAdapters.<id>`,
7
+ * `platformBackends.<platform>`, `engines`, `sources.priority`, `sources.disabled`), and only then is the overlay entry dropped, so there
8
+ * is never a moment when the value is in neither place. Revoking only drops the entry.
9
+ * @module web-search-pro/client/overlay-ops
10
+ */
11
+ import type { OverlayItem } from '../overlay-types.ts';
12
+ export type SectionOp = {
13
+ op: 'set';
14
+ path: string[];
15
+ value: unknown;
16
+ } | {
17
+ op: 'unset';
18
+ path: string[];
19
+ };
20
+ export interface Adoption {
21
+ /** The Host ops that write the value into the configuration. */
22
+ ops: SectionOp[];
23
+ /** Card fields whose staged draft the adopted value replaces (the draft would otherwise be shown against a changed baseline). */
24
+ drop: string[];
25
+ }
26
+ /** The ops that write an overlay item into the configuration; undefined for a key that is none of the overridable ones. */
27
+ export declare function adoptionOf(item: Pick<OverlayItem, 'kind' | 'target' | 'value'>): Adoption | undefined;
28
+ /** The overlay key a card field is the baseline of (the row that shows it carries the "changed by the agent" mark), or undefined. */
29
+ export declare function overlayKeyOfField(field: string): string | undefined;
30
+ /** `2026-10-27 22:35` in the viewer's time zone; the text itself when it is no date. */
31
+ export declare function formatTime(iso: string): string;
32
+ /**
33
+ * The custom CLIs an overlay item leans on that only the overlay holds: an engine list or a platform chain that names `custom-cli:<id>`
34
+ * where `cliAdapters.<id>` is itself an overlay entry. Adopting such an item alone would leave the configuration naming a CLI it does not
35
+ * define, so the card says to adopt the CLI too.
36
+ */
37
+ export declare function overlayCliDependencies(item: Pick<OverlayItem, 'kind' | 'value'>, items: readonly Pick<OverlayItem, 'key'>[]): string[];
@@ -1,56 +1,71 @@
1
1
  export declare const styles: {
2
- readonly card: "wsp-card";
3
- readonly cardOpen: "wsp-card-open";
4
- readonly header: "wsp-header";
5
- readonly headText: "wsp-head-text";
6
- readonly titleRow: "wsp-title-row";
7
- readonly name: "wsp-name";
8
- readonly description: "wsp-description";
9
- readonly dirtyBadge: "wsp-dirty-badge";
10
- readonly chevron: "wsp-chevron";
11
- readonly chevronOpen: "wsp-chevron-open";
12
- readonly body: "wsp-body";
13
2
  readonly notice: "wsp-notice";
14
- readonly section: "wsp-section";
15
- readonly sectionHeading: "wsp-section-heading";
16
- readonly grid: "wsp-grid";
17
3
  readonly field: "wsp-field";
18
- readonly fieldInvalid: "wsp-field-invalid";
19
- readonly fieldHeading: "wsp-field-heading";
4
+ readonly fieldHead: "wsp-field-head";
20
5
  readonly label: "wsp-label";
21
6
  readonly hint: "wsp-hint";
22
7
  readonly input: "wsp-input";
23
8
  readonly textarea: "wsp-textarea";
24
9
  readonly code: "wsp-code";
25
- readonly reset: "wsp-reset";
26
- readonly toggleField: "wsp-toggle-field";
27
- readonly toggleLabel: "wsp-toggle-label";
28
- readonly toggleCopy: "wsp-toggle-copy";
29
- readonly checkbox: "wsp-checkbox";
30
- readonly secretRow: "wsp-secret-row";
31
- readonly credentialStatus: "wsp-credential-status";
32
- readonly advanced: "wsp-advanced";
33
- readonly advancedHint: "wsp-advanced-hint";
34
- readonly footer: "wsp-footer";
35
- readonly status: "wsp-status";
36
10
  readonly failed: "wsp-failed";
37
11
  readonly actions: "wsp-actions";
38
- readonly secondaryButton: "wsp-secondary-button";
39
- readonly primaryButton: "wsp-primary-button";
12
+ readonly root: "wsp-root";
13
+ readonly summaryBar: "wsp-summary";
14
+ readonly chips: "wsp-chips";
15
+ readonly chip: "wsp-chip";
16
+ readonly chipRemove: "wsp-chip-remove";
17
+ readonly chipInput: "wsp-chip-input";
18
+ readonly group: "wsp-group";
19
+ readonly groupHead: "wsp-group-head";
20
+ readonly groupTitle: "wsp-group-title";
21
+ readonly groupSub: "wsp-group-sub";
22
+ readonly groupBadges: "wsp-group-badges";
23
+ readonly groupBody: "wsp-group-body";
24
+ readonly row: "wsp-row";
25
+ readonly rowText: "wsp-row-text";
26
+ readonly rowLabel: "wsp-row-label";
27
+ readonly rowControl: "wsp-row-control";
28
+ readonly rowHint: "wsp-row-hint";
29
+ readonly rowMeta: "wsp-row-meta";
30
+ readonly muted: "wsp-muted";
40
31
  readonly select: "wsp-select";
41
- readonly problem: "wsp-problem";
42
- readonly warning: "wsp-warning";
43
- readonly sectionSummary: "wsp-section-summary";
44
- readonly sectionBody: "wsp-section-body";
45
- readonly subheading: "wsp-subheading";
32
+ readonly unitInput: "wsp-unit-input";
33
+ readonly unit: "wsp-unit";
34
+ readonly help: "wsp-help";
35
+ readonly link: "wsp-link";
36
+ readonly danger: "wsp-danger";
37
+ readonly list: "wsp-list";
38
+ readonly item: "wsp-item";
39
+ readonly itemMain: "wsp-item-main";
40
+ readonly itemTitle: "wsp-item-title";
41
+ readonly itemMeta: "wsp-item-meta";
42
+ readonly itemActions: "wsp-item-actions";
43
+ readonly empty: "wsp-empty";
44
+ readonly subHead: "wsp-sub-head";
45
+ readonly compare: "wsp-compare";
46
+ readonly compareCol: "wsp-compare-col";
47
+ readonly preview: "wsp-preview";
48
+ readonly savebar: "wsp-savebar";
49
+ readonly saveText: "wsp-save-text";
50
+ readonly dialogBody: "wsp-dialog-body";
51
+ readonly stack: "wsp-stack";
52
+ readonly fold: "wsp-fold";
53
+ readonly foldBody: "wsp-fold-body";
54
+ readonly foldHint: "wsp-fold-hint";
55
+ readonly invalidInput: "wsp-invalid-input";
56
+ readonly secretRow: "wsp-secret-row";
46
57
  readonly codeBlock: "wsp-code-block";
47
- readonly note: "wsp-note";
48
58
  readonly table: "wsp-table";
49
- readonly rubric: "wsp-rubric";
50
- readonly rubricHead: "wsp-rubric-head";
51
- readonly badge: "wsp-badge";
52
- readonly fullRow: "wsp-full-row";
53
- readonly keyedSource: "wsp-keyed-source";
54
- readonly linkButton: "wsp-link-button";
59
+ readonly chain: "wsp-chain";
60
+ readonly why: "wsp-why";
61
+ readonly orderBar: "wsp-order-bar";
62
+ readonly tokens: "wsp-tokens";
63
+ readonly tokenRow: "wsp-token-row";
64
+ readonly trialOut: "wsp-trial-out";
65
+ readonly trialBar: "wsp-trial-bar";
55
66
  };
67
+ /**
68
+ * Inject the card's stylesheet, or refresh it in place. A Host that hot-reloads the plugin keeps the page (and the
69
+ * `<style>` an older version injected), so an existing element gets the current CSS instead of being kept as is.
70
+ */
56
71
  export declare function ensureStyles(): void;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The "Advanced: text mode" view: the plugin's settings as one commented YAML text. It is a read-only print of the controls'
3
+ * staged state, not a second place the settings live. Every key has a comment in front of it (see field-docs.ts); keys you have
4
+ * overridden are plain lines, the others are commented `# key: value` lines showing the value in force; secrets never appear
5
+ * (only the names of the credentials that hold them). Comment lines start with `#`, so stripping them leaves exactly the
6
+ * overrides as valid YAML.
7
+ * @module web-search-pro/client/text-view
8
+ */
9
+ import { type DocLang } from './field-docs.ts';
10
+ import { type FieldSpec, type Json } from './form-specs.ts';
11
+ interface FieldView {
12
+ text: string;
13
+ overridden: boolean;
14
+ }
15
+ /**
16
+ * The text of the card's current (staged) settings in `lang`. `views` is the staged text and override flag of every field, as the
17
+ * card state carries them; `specs` are the field specs of the form model.
18
+ */
19
+ export declare function renderTextView(views: Readonly<Record<string, FieldView | undefined>>, specs: readonly FieldSpec[], lang?: DocLang | string): string;
20
+ /** The text of the lines that are data: every comment line and blank line dropped (what a YAML reader sees). */
21
+ export declare function stripComments(text: string): string;
22
+ export type { Json };
@@ -0,0 +1,200 @@
1
+ /**
2
+ * The small set of controls the settings card is made of.
3
+ *
4
+ * Switches, buttons, badges, dialogs and the click-to-read help bubble are the Host's own
5
+ * (`@deepseek-ai/dsh-client-ui-primitives`). The Host ships no select, no chip input, no accordion and no
6
+ * list-row, so those four are built here from native elements (`<select>`, `<details>`, `<input>`) and the
7
+ * `--dsw-alias-*` tokens, which makes them follow the light and dark themes without a color of their own.
8
+ * Nothing in this file knows about a configuration field: callers pass text and callbacks.
9
+ * @module web-search-pro/client/ui-kit
10
+ */
11
+ import { type ReactNode } from 'react';
12
+ export type Tone = 'neutral' | 'info' | 'success' | 'warning' | 'danger' | 'outline';
13
+ /** A read-only badge. */
14
+ export declare function Badge(props: {
15
+ tone?: Tone;
16
+ children: ReactNode;
17
+ }): import("react").JSX.Element;
18
+ /** The mark of a setting an agent changed: a warning badge whose tooltip carries the value, the reason and the time. */
19
+ export declare function AgentTag(props: {
20
+ label: string;
21
+ tip: string;
22
+ }): import("react").JSX.Element;
23
+ /** The `?` button: its text opens on click, so a long explanation costs one glyph until someone asks. */
24
+ export declare function Help(props: {
25
+ label: string;
26
+ text: string;
27
+ }): import("react").JSX.Element;
28
+ /** Labels every row shares, so a row does not need the dictionary itself. */
29
+ export interface RowLabels {
30
+ overridden: string;
31
+ reset: string;
32
+ help: string;
33
+ invalid: string;
34
+ }
35
+ export interface RowProps {
36
+ /** The configuration field this row is the entry of (one per public field; the render test counts them). */
37
+ field?: string;
38
+ /** The id of the control, so the label is tied to it. */
39
+ id?: string;
40
+ label: string;
41
+ /** One short sentence. Anything longer belongs in `help`. */
42
+ hint?: string;
43
+ help?: string;
44
+ overridden?: boolean;
45
+ invalid?: boolean;
46
+ /** Replaces the hint while the value is invalid. */
47
+ problem?: string;
48
+ /** Accepted, but unlikely to do what was meant: a second line under the hint. */
49
+ warning?: string;
50
+ /** A small grey line under the hint: a range, a default. */
51
+ meta?: string;
52
+ /** A short warning badge beside the label, for a setting that widens what an agent may do. */
53
+ risk?: string;
54
+ /** The setting is read when the plugin starts: a badge saying so, with a `?` explaining why; `touched` picks it out while an edit of it is waiting to be saved. */
55
+ restart?: {
56
+ badge: string;
57
+ why: string;
58
+ touched?: boolean;
59
+ };
60
+ /** Extra controls beside the label (the "changed by the agent" mark with its adopt / revoke buttons). */
61
+ mark?: ReactNode;
62
+ disabled?: boolean;
63
+ labels: RowLabels;
64
+ onReset?: () => void;
65
+ /** Control placement: beside the text (default) or on its own line. */
66
+ wide?: boolean;
67
+ inline?: boolean;
68
+ children: ReactNode;
69
+ }
70
+ /** One setting: label, one-line hint, an optional `?`, the "overridden" badge with its reset, and the control. */
71
+ export declare function Row(props: RowProps): import("react").JSX.Element;
72
+ /** A closed-by-default fold inside a group, for the items few people need. */
73
+ export declare function Fold(props: {
74
+ id: string;
75
+ title: string;
76
+ hint?: string;
77
+ children: ReactNode;
78
+ }): import("react").JSX.Element;
79
+ /** A small heading inside a group, for sets of rows that belong together. */
80
+ export declare function SubHead(props: {
81
+ children: ReactNode;
82
+ }): import("react").JSX.Element;
83
+ /**
84
+ * One group of the card, an accordion item. `<details>` keeps every control in the document while the group is
85
+ * closed (so a server-rendered check still sees them) and gives keyboard and screen-reader behavior for free.
86
+ */
87
+ export declare function Group(props: {
88
+ id: string;
89
+ title: string;
90
+ summary?: string;
91
+ badges?: ReactNode;
92
+ defaultOpen?: boolean;
93
+ children: ReactNode;
94
+ }): import("react").JSX.Element;
95
+ export interface SelectOption {
96
+ value: string;
97
+ label: string;
98
+ }
99
+ /**
100
+ * A native select. A stored value that is not among the options (a channel the list does not know, an older
101
+ * enum value) is shown as its own entry instead of being silently replaced by the first option.
102
+ */
103
+ export declare function Select(props: {
104
+ id?: string;
105
+ value: string;
106
+ options: readonly SelectOption[];
107
+ onChange: (value: string) => void;
108
+ disabled?: boolean;
109
+ muted?: boolean;
110
+ invalid?: boolean;
111
+ ariaLabel?: string;
112
+ }): import("react").JSX.Element;
113
+ /** A single-line text input; `muted` greys the value while it is only the inherited default. */
114
+ export declare function TextInput(props: {
115
+ id?: string;
116
+ value: string;
117
+ onChange: (value: string) => void;
118
+ placeholder?: string;
119
+ disabled?: boolean;
120
+ muted?: boolean;
121
+ invalid?: boolean;
122
+ list?: string;
123
+ numeric?: boolean;
124
+ ariaLabel?: string;
125
+ code?: boolean;
126
+ small?: boolean;
127
+ autoFocus?: boolean;
128
+ onBlur?: () => void;
129
+ }): import("react").JSX.Element;
130
+ /** A text input followed by a fixed unit. */
131
+ export declare function UnitInput(props: {
132
+ id?: string;
133
+ value: string;
134
+ unit: string;
135
+ onChange: (value: string) => void;
136
+ placeholder?: string;
137
+ disabled?: boolean;
138
+ muted?: boolean;
139
+ invalid?: boolean;
140
+ ariaLabel?: string;
141
+ }): import("react").JSX.Element;
142
+ /** The Host's switch, named by its row. */
143
+ export declare function Toggle(props: {
144
+ label: string;
145
+ checked: boolean;
146
+ onChange: (next: boolean) => void;
147
+ disabled?: boolean;
148
+ }): import("react").JSX.Element;
149
+ /** A list of short strings as removable chips with an add box (Enter or comma adds; Backspace on an empty box removes the last). */
150
+ export declare function Chips(props: {
151
+ id?: string;
152
+ values: readonly string[];
153
+ onChange: (values: string[]) => void;
154
+ placeholder?: string;
155
+ disabled?: boolean;
156
+ /** Why a new entry is refused, or undefined. */
157
+ check?: (value: string, existing: readonly string[]) => string | undefined;
158
+ removeLabel: string;
159
+ addLabel: string;
160
+ }): import("react").JSX.Element;
161
+ /** A dialog on the Host's modal: a title, a scrolling body, and a footer of actions. */
162
+ export declare function Dialog(props: {
163
+ open: boolean;
164
+ title: string;
165
+ closeLabel: string;
166
+ description?: string;
167
+ onClose: () => void;
168
+ footer?: ReactNode;
169
+ wide?: boolean;
170
+ children: ReactNode;
171
+ }): import("react").JSX.Element;
172
+ /** Primary and secondary buttons at the card's size. */
173
+ export declare function Btn(props: {
174
+ children: ReactNode;
175
+ onClick?: () => void;
176
+ primary?: boolean;
177
+ disabled?: boolean;
178
+ danger?: boolean;
179
+ title?: string;
180
+ data?: string;
181
+ ariaLabel?: string;
182
+ }): import("react").JSX.Element;
183
+ /** A list row: a title with badges, a meta line, and actions on the right. */
184
+ export declare function Item(props: {
185
+ title: ReactNode;
186
+ badges?: ReactNode;
187
+ meta?: ReactNode;
188
+ actions?: ReactNode;
189
+ data?: string;
190
+ }): import("react").JSX.Element;
191
+ /** A write-only secret input: it never shows a stored value, only whether one is configured. */
192
+ export declare function SecretInput(props: {
193
+ id: string;
194
+ value: string;
195
+ onChange: (value: string) => void;
196
+ status: string;
197
+ configured: boolean;
198
+ disabled?: boolean;
199
+ ariaLabel?: string;
200
+ }): import("react").JSX.Element;
@@ -48,3 +48,9 @@ export declare function evidenceIssues(ev: Json): Issue[];
48
48
  export declare function sourcesIssues(sources: Json): Issue[];
49
49
  /** Rubric override ids in a settings object that name no built-in rubric (the server ignores them). */
50
50
  export declare function unknownRubricIds(rubrics: unknown): string[];
51
+ /**
52
+ * Problems of the CLI adapter settings, from the server's own functions: `cliAdapters` entries the server would ignore
53
+ * (read-only guard, bad argv, secrets in env) and `platformBackends` that name an unknown platform or a backend that
54
+ * cannot serve it.
55
+ */
56
+ export declare function cliIssues(platformBackends: unknown, cliAdapters: unknown): Issue[];
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Removal of the empty containers the Host's schema parser fills in (see the comment on `withoutFillers`). Pure and free of
3
+ * imports: the server's config resolution and the settings card's validation (client bundle) use the same functions.
4
+ * @module web-search-pro/config-fillers
5
+ */
6
+ export declare function withoutFillers<T>(value: T, keys: readonly string[]): T;
7
+ export declare function normalizeJudge<T>(judge: T): T;
8
+ export declare function normalizeRubrics<T>(rubrics: T): T;
9
+ export declare function normalizeCoverage<T>(coverage: T): T;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The groups the configuration is laid out in, and the order of its fields. One definition serves four readers: the order of
3
+ * the keys of the `Config` schema (what the Host's generic configuration view and `--dump-config` print), the sections of the
4
+ * settings card's text view, the group a field belongs to in the card's tests, and the docs. A test pins the schema to this
5
+ * list, so a new field cannot be added without choosing its group.
6
+ *
7
+ * The groups follow the settings page, most used first: common, search order, sources and keys, custom CLI, reading and
8
+ * evidence, platforms and runtime, advanced and diagnostics. Only top-level `Config` keys are listed; a key that is an object
9
+ * (`sources`, `evidence`, `provider`, `keyedSources`, `playwright`) takes all of its nested options with it.
10
+ *
11
+ * Pure and free of imports: the client bundle includes this file.
12
+ * @module web-search-pro/config-groups
13
+ */
14
+ export declare const CONFIG_GROUP_IDS: readonly ["common", "order", "sources", "cli", "evidence", "runtime", "advanced"];
15
+ export type ConfigGroupId = typeof CONFIG_GROUP_IDS[number];
16
+ /** Top-level `Config` keys by group, in display order. */
17
+ export declare const CONFIG_GROUPS: Readonly<Record<ConfigGroupId, readonly string[]>>;
18
+ /** Titles of the groups, as the text view prints them (the card's own group titles live in its dictionary). */
19
+ export declare const CONFIG_GROUP_TITLES: Readonly<Record<'en' | 'zh', Readonly<Record<ConfigGroupId, string>>>>;
20
+ /** Every top-level key in display order. */
21
+ export declare const CONFIG_FIELD_ORDER: readonly string[];
22
+ /** The group of a top-level key, or of a dotted field (`sources.priority`, `evidence.judge.mode`) by its first segment. */
23
+ export declare function groupOf(field: string): ConfigGroupId | undefined;