@tomradex/web-search 0.22.0 → 0.23.0

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 (2) hide show
  1. package/dist/index.d.ts +18 -0
  2. package/package.json +6 -4
package/dist/index.d.ts CHANGED
@@ -47,6 +47,13 @@ export interface WebSearchProvider {
47
47
  /** The settings pane where the person sets it up. */
48
48
  settings?: string;
49
49
  }
50
+ /** A provider as the Web search pane in Settings lists it. */
51
+ export interface WebSearchProviderView {
52
+ id: string;
53
+ title: string;
54
+ unavailable: string | null;
55
+ settings?: string;
56
+ }
50
57
  /** Why no provider can search, and where the person fixes it. */
51
58
  export interface Unavailable {
52
59
  reason: string;
@@ -61,6 +68,16 @@ declare module "cordis" {
61
68
  "webSearch/unregistered"(id: string): void;
62
69
  }
63
70
  }
71
+ declare module "@tomradex/ipc" {
72
+ interface Channels {
73
+ /** In the order they are asked: the first one available answers. */
74
+ "webSearch.providers": () => WebSearchProviderView[];
75
+ }
76
+ interface Broadcasts {
77
+ /** A provider came or went, or a setting may have changed whether one can answer. */
78
+ "webSearch.changed": () => void;
79
+ }
80
+ }
64
81
  export declare const SEARCH_TIMEOUT_MS = 30000;
65
82
  export declare const READ_TIMEOUT_MS = 60000;
66
83
  export declare class WebSearch extends Service {
@@ -72,6 +89,7 @@ export declare class WebSearch extends Service {
72
89
  /** Reversible: the provider goes with the plugin that registered it, and the tools with the last one. */
73
90
  register(provider: WebSearchProvider): () => void;
74
91
  providers(): WebSearchProvider[];
92
+ views(): WebSearchProviderView[];
75
93
  search(request: SearchRequest, signal?: AbortSignal): Promise<SearchResponse>;
76
94
  read(request: ReadRequest, signal?: AbortSignal): Promise<ReadResponse>;
77
95
  /** Why nobody can search right now; null when a provider can. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomradex/web-search",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "type": "module",
5
5
  "author": "Haoyuan Tang",
6
6
  "engines": {
@@ -27,9 +27,11 @@
27
27
  "dist"
28
28
  ],
29
29
  "dependencies": {
30
- "@tomradex/contracts": "0.22.0",
31
- "@tomradex/domain": "0.2.29",
32
- "@tomradex/tools": "0.22.0",
30
+ "@tomradex/contracts": "0.23.0",
31
+ "@tomradex/domain": "0.2.30",
32
+ "@tomradex/ipc": "0.23.0",
33
+ "@tomradex/settings": "0.23.0",
34
+ "@tomradex/tools": "0.23.0",
33
35
  "cordis": "4.0.0-rc.8",
34
36
  "zod": "^4.4.3"
35
37
  }