dsh-search-enhance 0.1.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 (201) hide show
  1. package/README.md +218 -0
  2. package/client/client.js +1479 -0
  3. package/client/types/client/SearchEnhancePluginCard.d.ts +7 -0
  4. package/client/types/client/api.d.ts +12 -0
  5. package/client/types/client/index.d.ts +14 -0
  6. package/client/types/client/locales.d.ts +76 -0
  7. package/client/types/web-config/contracts.d.ts +129 -0
  8. package/cordis.patch.yml +3 -0
  9. package/lib/config.d.ts +315 -0
  10. package/lib/config.js +319 -0
  11. package/lib/contracts/index.d.ts +2 -0
  12. package/lib/contracts/index.js +2 -0
  13. package/lib/contracts/sources.d.ts +53 -0
  14. package/lib/contracts/sources.js +22 -0
  15. package/lib/diagnostics/index.d.ts +5 -0
  16. package/lib/diagnostics/index.js +5 -0
  17. package/lib/diagnostics/orchestrator.d.ts +28 -0
  18. package/lib/diagnostics/orchestrator.js +345 -0
  19. package/lib/diagnostics/probes.d.ts +36 -0
  20. package/lib/diagnostics/probes.js +75 -0
  21. package/lib/diagnostics/status.d.ts +17 -0
  22. package/lib/diagnostics/status.js +128 -0
  23. package/lib/diagnostics/types.d.ts +100 -0
  24. package/lib/diagnostics/types.js +43 -0
  25. package/lib/documentation/cache-domain.d.ts +68 -0
  26. package/lib/documentation/cache-domain.js +84 -0
  27. package/lib/documentation/cache.d.ts +109 -0
  28. package/lib/documentation/cache.js +386 -0
  29. package/lib/documentation/context7-cache.d.ts +74 -0
  30. package/lib/documentation/context7-cache.js +293 -0
  31. package/lib/documentation/index.d.ts +5 -0
  32. package/lib/documentation/index.js +5 -0
  33. package/lib/documentation/service.d.ts +179 -0
  34. package/lib/documentation/service.js +899 -0
  35. package/lib/index.d.ts +7 -0
  36. package/lib/index.js +154 -0
  37. package/lib/orchestration/index.d.ts +4 -0
  38. package/lib/orchestration/index.js +4 -0
  39. package/lib/orchestration/orchestrator.d.ts +28 -0
  40. package/lib/orchestration/orchestrator.js +645 -0
  41. package/lib/orchestration/policy.d.ts +11 -0
  42. package/lib/orchestration/policy.js +29 -0
  43. package/lib/orchestration/types.d.ts +75 -0
  44. package/lib/orchestration/types.js +12 -0
  45. package/lib/presentation/diagnostics-card.d.ts +7 -0
  46. package/lib/presentation/diagnostics-card.js +91 -0
  47. package/lib/presentation/index.d.ts +4 -0
  48. package/lib/presentation/index.js +4 -0
  49. package/lib/presentation/render.d.ts +33 -0
  50. package/lib/presentation/render.js +545 -0
  51. package/lib/presentation/research-plan-card.d.ts +9 -0
  52. package/lib/presentation/research-plan-card.js +90 -0
  53. package/lib/presentation/web-card.d.ts +43 -0
  54. package/lib/presentation/web-card.js +432 -0
  55. package/lib/prompt/tool-discovery.d.ts +5 -0
  56. package/lib/prompt/tool-discovery.js +49 -0
  57. package/lib/provider-runtime/abort.d.ts +17 -0
  58. package/lib/provider-runtime/abort.js +91 -0
  59. package/lib/provider-runtime/attempts.d.ts +31 -0
  60. package/lib/provider-runtime/attempts.js +58 -0
  61. package/lib/provider-runtime/errors.d.ts +45 -0
  62. package/lib/provider-runtime/errors.js +117 -0
  63. package/lib/provider-runtime/index.d.ts +6 -0
  64. package/lib/provider-runtime/index.js +6 -0
  65. package/lib/provider-runtime/limits.d.ts +47 -0
  66. package/lib/provider-runtime/limits.js +106 -0
  67. package/lib/provider-runtime/retry.d.ts +51 -0
  68. package/lib/provider-runtime/retry.js +134 -0
  69. package/lib/providers/bounded-result.d.ts +21 -0
  70. package/lib/providers/bounded-result.js +62 -0
  71. package/lib/providers/context7.d.ts +56 -0
  72. package/lib/providers/context7.js +405 -0
  73. package/lib/providers/direct-content.d.ts +47 -0
  74. package/lib/providers/direct-content.js +434 -0
  75. package/lib/providers/direct-fetch.d.ts +29 -0
  76. package/lib/providers/direct-fetch.js +174 -0
  77. package/lib/providers/direct-http.d.ts +47 -0
  78. package/lib/providers/direct-http.js +526 -0
  79. package/lib/providers/exa.d.ts +20 -0
  80. package/lib/providers/exa.js +121 -0
  81. package/lib/providers/firecrawl-scrape.d.ts +29 -0
  82. package/lib/providers/firecrawl-scrape.js +107 -0
  83. package/lib/providers/firecrawl.d.ts +20 -0
  84. package/lib/providers/firecrawl.js +98 -0
  85. package/lib/providers/helpers.d.ts +20 -0
  86. package/lib/providers/helpers.js +129 -0
  87. package/lib/providers/http.d.ts +39 -0
  88. package/lib/providers/http.js +165 -0
  89. package/lib/providers/index.d.ts +17 -0
  90. package/lib/providers/index.js +16 -0
  91. package/lib/providers/search-api-request.d.ts +32 -0
  92. package/lib/providers/search-api-request.js +123 -0
  93. package/lib/providers/search-api.d.ts +104 -0
  94. package/lib/providers/search-api.js +533 -0
  95. package/lib/providers/smart-direct-child.d.ts +12 -0
  96. package/lib/providers/smart-direct-child.js +404 -0
  97. package/lib/providers/smart-direct-profiles.d.ts +11 -0
  98. package/lib/providers/smart-direct-profiles.js +141 -0
  99. package/lib/providers/smart-direct-transport.d.ts +94 -0
  100. package/lib/providers/smart-direct-transport.js +338 -0
  101. package/lib/providers/smart-direct.d.ts +57 -0
  102. package/lib/providers/smart-direct.js +540 -0
  103. package/lib/providers/tavily-extract.d.ts +27 -0
  104. package/lib/providers/tavily-extract.js +86 -0
  105. package/lib/providers/tavily-map.d.ts +21 -0
  106. package/lib/providers/tavily-map.js +163 -0
  107. package/lib/providers/tavily.d.ts +20 -0
  108. package/lib/providers/tavily.js +96 -0
  109. package/lib/providers/types.d.ts +61 -0
  110. package/lib/providers/types.js +7 -0
  111. package/lib/providers/web-extract-common.d.ts +15 -0
  112. package/lib/providers/web-extract-common.js +69 -0
  113. package/lib/research-plan/index.d.ts +27 -0
  114. package/lib/research-plan/index.js +687 -0
  115. package/lib/search/index.d.ts +5 -0
  116. package/lib/search/index.js +5 -0
  117. package/lib/search/parse.d.ts +42 -0
  118. package/lib/search/parse.js +573 -0
  119. package/lib/search/profiles.d.ts +45 -0
  120. package/lib/search/profiles.js +213 -0
  121. package/lib/search/quality/index.d.ts +4 -0
  122. package/lib/search/quality/index.js +4 -0
  123. package/lib/search/quality/limits.d.ts +31 -0
  124. package/lib/search/quality/limits.js +37 -0
  125. package/lib/search/quality/pipeline.d.ts +12 -0
  126. package/lib/search/quality/pipeline.js +320 -0
  127. package/lib/search/quality/url.d.ts +18 -0
  128. package/lib/search/quality/url.js +106 -0
  129. package/lib/search/time-context.d.ts +23 -0
  130. package/lib/search/time-context.js +118 -0
  131. package/lib/site-map/index.d.ts +3 -0
  132. package/lib/site-map/index.js +3 -0
  133. package/lib/site-map/types.d.ts +35 -0
  134. package/lib/site-map/types.js +7 -0
  135. package/lib/site-map/url.d.ts +7 -0
  136. package/lib/site-map/url.js +51 -0
  137. package/lib/source-storage/authorization.d.ts +5 -0
  138. package/lib/source-storage/authorization.js +43 -0
  139. package/lib/source-storage/domain.d.ts +20 -0
  140. package/lib/source-storage/domain.js +70 -0
  141. package/lib/source-storage/index.d.ts +8 -0
  142. package/lib/source-storage/index.js +8 -0
  143. package/lib/source-storage/pagination.d.ts +58 -0
  144. package/lib/source-storage/pagination.js +113 -0
  145. package/lib/source-storage/refs.d.ts +7 -0
  146. package/lib/source-storage/refs.js +15 -0
  147. package/lib/source-storage/retention.d.ts +14 -0
  148. package/lib/source-storage/retention.js +34 -0
  149. package/lib/source-storage/service.d.ts +31 -0
  150. package/lib/source-storage/service.js +33 -0
  151. package/lib/source-storage/store.d.ts +55 -0
  152. package/lib/source-storage/store.js +144 -0
  153. package/lib/source-storage.d.ts +2 -0
  154. package/lib/source-storage.js +2 -0
  155. package/lib/tool-discovery/capabilities.d.ts +24 -0
  156. package/lib/tool-discovery/capabilities.js +120 -0
  157. package/lib/tool-discovery/fold.d.ts +44 -0
  158. package/lib/tool-discovery/fold.js +149 -0
  159. package/lib/tool-discovery/index.d.ts +4 -0
  160. package/lib/tool-discovery/index.js +4 -0
  161. package/lib/tool-discovery/manager.d.ts +47 -0
  162. package/lib/tool-discovery/manager.js +222 -0
  163. package/lib/tools/context7.d.ts +1294 -0
  164. package/lib/tools/context7.js +969 -0
  165. package/lib/tools/docs-search.d.ts +20 -0
  166. package/lib/tools/docs-search.js +214 -0
  167. package/lib/tools/index.d.ts +13 -0
  168. package/lib/tools/index.js +13 -0
  169. package/lib/tools/operations.d.ts +15 -0
  170. package/lib/tools/operations.js +51 -0
  171. package/lib/tools/research-plan.d.ts +13 -0
  172. package/lib/tools/research-plan.js +40 -0
  173. package/lib/tools/schemas.d.ts +1583 -0
  174. package/lib/tools/schemas.js +1008 -0
  175. package/lib/tools/search-diagnostics.d.ts +22 -0
  176. package/lib/tools/search-diagnostics.js +147 -0
  177. package/lib/tools/search-sources.d.ts +18 -0
  178. package/lib/tools/search-sources.js +115 -0
  179. package/lib/tools/search-tools.d.ts +127 -0
  180. package/lib/tools/search-tools.js +215 -0
  181. package/lib/tools/web-extract.d.ts +28 -0
  182. package/lib/tools/web-extract.js +182 -0
  183. package/lib/tools/web-map.d.ts +31 -0
  184. package/lib/tools/web-map.js +211 -0
  185. package/lib/tools/web-search.d.ts +25 -0
  186. package/lib/tools/web-search.js +165 -0
  187. package/lib/web-config/contracts.d.ts +129 -0
  188. package/lib/web-config/contracts.js +40 -0
  189. package/lib/web-config/host.d.ts +12 -0
  190. package/lib/web-config/host.js +632 -0
  191. package/lib/web-extract/bounds.d.ts +10 -0
  192. package/lib/web-extract/bounds.js +59 -0
  193. package/lib/web-extract/index.d.ts +12 -0
  194. package/lib/web-extract/index.js +12 -0
  195. package/lib/web-extract/orchestrator.d.ts +26 -0
  196. package/lib/web-extract/orchestrator.js +384 -0
  197. package/lib/web-extract/types.d.ts +170 -0
  198. package/lib/web-extract/types.js +69 -0
  199. package/lib/web-extract/url.d.ts +13 -0
  200. package/lib/web-extract/url.js +61 -0
  201. package/package.json +185 -0
@@ -0,0 +1,129 @@
1
+ export declare const WEB_CONFIG_PATH = "/dsh-search-enhance/config";
2
+ export declare const WEB_CREDENTIALS_PATH = "/dsh-search-enhance/credentials";
3
+ export declare const WEB_BASE_URL_MAX_CHARACTERS = 8192;
4
+ export declare const WEB_MODEL_MAX_CHARACTERS = 4096;
5
+ export declare const WEB_CREDENTIAL_REF_MAX_CHARACTERS = 256;
6
+ export declare const WEB_CREDENTIAL_VALUE_MAX_CHARACTERS: number;
7
+ export declare const WEB_CREDENTIAL_SLOTS: readonly ["searchApi", "context7", "exa", "tavily", "firecrawl"];
8
+ export type WebCredentialSlot = (typeof WEB_CREDENTIAL_SLOTS)[number];
9
+ export declare const WEB_EDITABLE_PATHS: readonly [readonly ["defaultProfile"], readonly ["defaultDepth"], readonly ["toolTimeoutMs"], readonly ["toolDiscovery", "mode"], readonly ["searchApi", "baseUrl"], readonly ["searchApi", "protocol"], readonly ["searchApi", "model"], readonly ["searchApi", "thinkingLevel"], readonly ["searchApi", "credentialRef"], readonly ["searchApi", "timeoutMs"], readonly ["providers", "context7", "baseUrl"], readonly ["providers", "context7", "credentialRef"], readonly ["providers", "context7", "timeoutMs"], readonly ["providers", "exa", "baseUrl"], readonly ["providers", "exa", "credentialRef"], readonly ["providers", "exa", "timeoutMs"], readonly ["providers", "tavily", "baseUrl"], readonly ["providers", "tavily", "credentialRef"], readonly ["providers", "tavily", "timeoutMs"], readonly ["providers", "firecrawl", "baseUrl"], readonly ["providers", "firecrawl", "credentialRef"], readonly ["providers", "firecrawl", "timeoutMs"], readonly ["webExtract", "smartDirect", "proxyUrl"], readonly ["webExtract", "direct", "proxyUrl"]];
10
+ export interface WebSearchApiConfig {
11
+ baseUrl: string;
12
+ protocol: string;
13
+ model: string;
14
+ thinkingLevel: string;
15
+ credentialRef: string;
16
+ timeoutMs: number;
17
+ }
18
+ export interface WebDiscoveryProviderConfig {
19
+ baseUrl: string;
20
+ credentialRef: string;
21
+ timeoutMs: number;
22
+ }
23
+ export interface WebProxyConfig {
24
+ proxyUrl: string;
25
+ }
26
+ export interface WebEditableConfig {
27
+ defaultProfile: string;
28
+ defaultDepth: string;
29
+ toolTimeoutMs: number;
30
+ toolDiscovery: {
31
+ mode: string;
32
+ };
33
+ searchApi: WebSearchApiConfig;
34
+ providers: {
35
+ context7: WebDiscoveryProviderConfig;
36
+ exa: WebDiscoveryProviderConfig;
37
+ tavily: WebDiscoveryProviderConfig;
38
+ firecrawl: WebDiscoveryProviderConfig;
39
+ };
40
+ webExtract: {
41
+ smartDirect: WebProxyConfig;
42
+ direct: WebProxyConfig;
43
+ };
44
+ }
45
+ export type WebConfigLayer = {
46
+ [Key in keyof WebEditableConfig]?: WebEditableConfig[Key] extends object ? {
47
+ [Nested in keyof WebEditableConfig[Key]]?: WebEditableConfig[Key][Nested] extends object ? {
48
+ [Leaf in keyof WebEditableConfig[Key][Nested]]?: WebEditableConfig[Key][Nested][Leaf];
49
+ } : WebEditableConfig[Key][Nested];
50
+ } : WebEditableConfig[Key];
51
+ };
52
+ export interface WebConfigOptions {
53
+ profiles: readonly string[];
54
+ depths: readonly string[];
55
+ protocols: readonly string[];
56
+ thinkingLevels: readonly string[];
57
+ toolDiscoveryModes: readonly string[];
58
+ proxyUrlMaxCharacters: number;
59
+ }
60
+ export interface WebCredentialState {
61
+ ref: string;
62
+ configured: boolean;
63
+ writable: boolean;
64
+ available: boolean;
65
+ source?: string;
66
+ }
67
+ export interface WebDiagnosticProviderStatus {
68
+ provider: string;
69
+ state: string;
70
+ }
71
+ export interface WebDiagnosticCapabilityStatus {
72
+ capability: string;
73
+ available: boolean;
74
+ required: boolean;
75
+ providers: readonly WebDiagnosticProviderStatus[];
76
+ }
77
+ export interface WebDiagnosticStatus {
78
+ capabilities: readonly WebDiagnosticCapabilityStatus[];
79
+ minimumProfile: {
80
+ profile: string;
81
+ satisfied: boolean;
82
+ };
83
+ missingProviders: number;
84
+ unavailableProviders: number;
85
+ }
86
+ export interface WebConfigSnapshot {
87
+ namespace: 'search-enhance';
88
+ revision: number;
89
+ applies: 'restart';
90
+ writable: boolean;
91
+ value: WebEditableConfig;
92
+ base?: WebConfigLayer;
93
+ user?: WebConfigLayer;
94
+ options: WebConfigOptions;
95
+ credentials: Record<WebCredentialSlot, WebCredentialState>;
96
+ diagnostics: WebDiagnosticStatus;
97
+ }
98
+ export type WebSettingsMutation = {
99
+ op: 'set';
100
+ path: readonly string[];
101
+ value: string | number;
102
+ } | {
103
+ op: 'unset';
104
+ path: readonly string[];
105
+ };
106
+ export interface WebSettingsMutationRequest {
107
+ expectedRevision: number;
108
+ mutations: readonly WebSettingsMutation[];
109
+ }
110
+ export interface WebCredentialWriteRequest {
111
+ credential: WebCredentialSlot;
112
+ value: string;
113
+ }
114
+ export interface WebCredentialDeleteRequest {
115
+ credential: WebCredentialSlot;
116
+ }
117
+ export interface WebCredentialWriteResult {
118
+ credential: WebCredentialSlot;
119
+ state: WebCredentialState;
120
+ changed: boolean;
121
+ }
122
+ export interface WebBridgeErrorBody {
123
+ error: {
124
+ code: string;
125
+ message: string;
126
+ actualRevision?: number;
127
+ };
128
+ }
129
+ //# sourceMappingURL=contracts.d.ts.map
@@ -0,0 +1,40 @@
1
+ export const WEB_CONFIG_PATH = '/dsh-search-enhance/config';
2
+ export const WEB_CREDENTIALS_PATH = '/dsh-search-enhance/credentials';
3
+ export const WEB_BASE_URL_MAX_CHARACTERS = 8192;
4
+ export const WEB_MODEL_MAX_CHARACTERS = 4096;
5
+ export const WEB_CREDENTIAL_REF_MAX_CHARACTERS = 256;
6
+ export const WEB_CREDENTIAL_VALUE_MAX_CHARACTERS = 16 * 1024;
7
+ export const WEB_CREDENTIAL_SLOTS = [
8
+ 'searchApi',
9
+ 'context7',
10
+ 'exa',
11
+ 'tavily',
12
+ 'firecrawl',
13
+ ];
14
+ export const WEB_EDITABLE_PATHS = [
15
+ ['defaultProfile'],
16
+ ['defaultDepth'],
17
+ ['toolTimeoutMs'],
18
+ ['toolDiscovery', 'mode'],
19
+ ['searchApi', 'baseUrl'],
20
+ ['searchApi', 'protocol'],
21
+ ['searchApi', 'model'],
22
+ ['searchApi', 'thinkingLevel'],
23
+ ['searchApi', 'credentialRef'],
24
+ ['searchApi', 'timeoutMs'],
25
+ ['providers', 'context7', 'baseUrl'],
26
+ ['providers', 'context7', 'credentialRef'],
27
+ ['providers', 'context7', 'timeoutMs'],
28
+ ['providers', 'exa', 'baseUrl'],
29
+ ['providers', 'exa', 'credentialRef'],
30
+ ['providers', 'exa', 'timeoutMs'],
31
+ ['providers', 'tavily', 'baseUrl'],
32
+ ['providers', 'tavily', 'credentialRef'],
33
+ ['providers', 'tavily', 'timeoutMs'],
34
+ ['providers', 'firecrawl', 'baseUrl'],
35
+ ['providers', 'firecrawl', 'credentialRef'],
36
+ ['providers', 'firecrawl', 'timeoutMs'],
37
+ ['webExtract', 'smartDirect', 'proxyUrl'],
38
+ ['webExtract', 'direct', 'proxyUrl'],
39
+ ];
40
+ //# sourceMappingURL=contracts.js.map
@@ -0,0 +1,12 @@
1
+ import type { IncomingMessage } from 'node:http';
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ import { type WebConfigSnapshot } from './contracts.js';
4
+ export declare const WEB_CONFIG_REQUEST_MAX_BYTES: number;
5
+ export declare const WEB_CONFIG_RESPONSE_MAX_BYTES: number;
6
+ export declare function readWebConfigSnapshot(ctx: Context, signal: AbortSignal): Promise<WebConfigSnapshot>;
7
+ export declare function isTrustedWebConfigRequest(request: Pick<IncomingMessage, 'headers' | 'socket'>, requireOrigin: boolean): boolean;
8
+ /** Register the plugin-owned Web configuration routes and return a quiescent disposer. */
9
+ export declare function mountWebConfigBridge(ctx: Context): () => Promise<void>;
10
+ /** Attach the optional Web bridge whenever the public webServer service is present. */
11
+ export declare function installWebConfigBridge(ctx: Context): void;
12
+ //# sourceMappingURL=host.d.ts.map