web-access-cli 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 (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +270 -0
  3. package/README_CN.md +268 -0
  4. package/THIRD_PARTY_NOTICES.md +48 -0
  5. package/dist/cli.js +197 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/config/config.js +463 -0
  8. package/dist/config/config.js.map +1 -0
  9. package/dist/config/edit.js +126 -0
  10. package/dist/config/edit.js.map +1 -0
  11. package/dist/core/diagnostics.js +94 -0
  12. package/dist/core/diagnostics.js.map +1 -0
  13. package/dist/core/errors.js +47 -0
  14. package/dist/core/errors.js.map +1 -0
  15. package/dist/core/router.js +320 -0
  16. package/dist/core/router.js.map +1 -0
  17. package/dist/core/schema.js +120 -0
  18. package/dist/core/schema.js.map +1 -0
  19. package/dist/core/types.js +22 -0
  20. package/dist/core/types.js.map +1 -0
  21. package/dist/providers/anysearch.js +225 -0
  22. package/dist/providers/anysearch.js.map +1 -0
  23. package/dist/providers/common.js +210 -0
  24. package/dist/providers/common.js.map +1 -0
  25. package/dist/providers/extract.js +155 -0
  26. package/dist/providers/extract.js.map +1 -0
  27. package/dist/providers/registry.js +31 -0
  28. package/dist/providers/registry.js.map +1 -0
  29. package/dist/providers/rsc.js +109 -0
  30. package/dist/providers/rsc.js.map +1 -0
  31. package/dist/providers/search.js +178 -0
  32. package/dist/providers/search.js.map +1 -0
  33. package/dist/providers/xcrawl.js +170 -0
  34. package/dist/providers/xcrawl.js.map +1 -0
  35. package/dist/transport/http.js +175 -0
  36. package/dist/transport/http.js.map +1 -0
  37. package/dist/version.js +2 -0
  38. package/dist/version.js.map +1 -0
  39. package/package.json +61 -0
  40. package/schemas/config.schema.json +210 -0
  41. package/schemas/extractRequest.schema.json +21 -0
  42. package/schemas/output.schema.json +435 -0
  43. package/schemas/searchRequest.schema.json +57 -0
@@ -0,0 +1,435 @@
1
+ {
2
+ "type": "object",
3
+ "required": [
4
+ "schemaVersion",
5
+ "ok",
6
+ "command",
7
+ "durationMs"
8
+ ],
9
+ "properties": {
10
+ "schemaVersion": {
11
+ "type": "number",
12
+ "const": 1
13
+ },
14
+ "ok": {
15
+ "type": "boolean"
16
+ },
17
+ "command": {
18
+ "anyOf": [
19
+ {
20
+ "anyOf": [
21
+ {
22
+ "type": "string",
23
+ "const": "search"
24
+ },
25
+ {
26
+ "type": "string",
27
+ "const": "extract"
28
+ },
29
+ {
30
+ "type": "string",
31
+ "const": "providers"
32
+ },
33
+ {
34
+ "type": "string",
35
+ "const": "doctor"
36
+ },
37
+ {
38
+ "type": "string",
39
+ "const": "config.edit"
40
+ }
41
+ ]
42
+ },
43
+ {
44
+ "type": "null"
45
+ }
46
+ ]
47
+ },
48
+ "durationMs": {
49
+ "type": "integer",
50
+ "minimum": 0
51
+ },
52
+ "request": {},
53
+ "provider": {
54
+ "type": "object",
55
+ "required": [
56
+ "id",
57
+ "type"
58
+ ],
59
+ "properties": {
60
+ "id": {
61
+ "type": "string"
62
+ },
63
+ "type": {
64
+ "anyOf": [
65
+ {
66
+ "type": "string",
67
+ "const": "tavily"
68
+ },
69
+ {
70
+ "type": "string",
71
+ "const": "exa"
72
+ },
73
+ {
74
+ "type": "string",
75
+ "const": "brave"
76
+ },
77
+ {
78
+ "type": "string",
79
+ "const": "searxng"
80
+ },
81
+ {
82
+ "type": "string",
83
+ "const": "firecrawl"
84
+ },
85
+ {
86
+ "type": "string",
87
+ "const": "jina"
88
+ },
89
+ {
90
+ "type": "string",
91
+ "const": "http"
92
+ },
93
+ {
94
+ "type": "string",
95
+ "const": "anysearch"
96
+ },
97
+ {
98
+ "type": "string",
99
+ "const": "xcrawl"
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ },
105
+ "attempts": {
106
+ "type": "array",
107
+ "items": {
108
+ "type": "object",
109
+ "required": [
110
+ "provider",
111
+ "status",
112
+ "durationMs"
113
+ ],
114
+ "properties": {
115
+ "provider": {
116
+ "type": "object",
117
+ "required": [
118
+ "id",
119
+ "type"
120
+ ],
121
+ "properties": {
122
+ "id": {
123
+ "type": "string"
124
+ },
125
+ "type": {
126
+ "anyOf": [
127
+ {
128
+ "type": "string",
129
+ "const": "tavily"
130
+ },
131
+ {
132
+ "type": "string",
133
+ "const": "exa"
134
+ },
135
+ {
136
+ "type": "string",
137
+ "const": "brave"
138
+ },
139
+ {
140
+ "type": "string",
141
+ "const": "searxng"
142
+ },
143
+ {
144
+ "type": "string",
145
+ "const": "firecrawl"
146
+ },
147
+ {
148
+ "type": "string",
149
+ "const": "jina"
150
+ },
151
+ {
152
+ "type": "string",
153
+ "const": "http"
154
+ },
155
+ {
156
+ "type": "string",
157
+ "const": "anysearch"
158
+ },
159
+ {
160
+ "type": "string",
161
+ "const": "xcrawl"
162
+ }
163
+ ]
164
+ }
165
+ }
166
+ },
167
+ "status": {
168
+ "anyOf": [
169
+ {
170
+ "type": "string",
171
+ "const": "success"
172
+ },
173
+ {
174
+ "type": "string",
175
+ "const": "failed"
176
+ }
177
+ ]
178
+ },
179
+ "durationMs": {
180
+ "type": "integer",
181
+ "minimum": 0
182
+ },
183
+ "error": {
184
+ "type": "object",
185
+ "required": [
186
+ "code",
187
+ "message",
188
+ "retryable"
189
+ ],
190
+ "properties": {
191
+ "code": {
192
+ "type": "string"
193
+ },
194
+ "message": {
195
+ "type": "string"
196
+ },
197
+ "retryable": {
198
+ "type": "boolean"
199
+ },
200
+ "provider": {
201
+ "type": "object",
202
+ "required": [
203
+ "id",
204
+ "type"
205
+ ],
206
+ "properties": {
207
+ "id": {
208
+ "type": "string"
209
+ },
210
+ "type": {
211
+ "anyOf": [
212
+ {
213
+ "type": "string",
214
+ "const": "tavily"
215
+ },
216
+ {
217
+ "type": "string",
218
+ "const": "exa"
219
+ },
220
+ {
221
+ "type": "string",
222
+ "const": "brave"
223
+ },
224
+ {
225
+ "type": "string",
226
+ "const": "searxng"
227
+ },
228
+ {
229
+ "type": "string",
230
+ "const": "firecrawl"
231
+ },
232
+ {
233
+ "type": "string",
234
+ "const": "jina"
235
+ },
236
+ {
237
+ "type": "string",
238
+ "const": "http"
239
+ },
240
+ {
241
+ "type": "string",
242
+ "const": "anysearch"
243
+ },
244
+ {
245
+ "type": "string",
246
+ "const": "xcrawl"
247
+ }
248
+ ]
249
+ }
250
+ }
251
+ },
252
+ "httpStatus": {
253
+ "type": "integer"
254
+ },
255
+ "details": {}
256
+ }
257
+ }
258
+ }
259
+ }
260
+ },
261
+ "data": {},
262
+ "raw": {},
263
+ "error": {
264
+ "type": "object",
265
+ "required": [
266
+ "code",
267
+ "message",
268
+ "retryable"
269
+ ],
270
+ "properties": {
271
+ "code": {
272
+ "type": "string"
273
+ },
274
+ "message": {
275
+ "type": "string"
276
+ },
277
+ "retryable": {
278
+ "type": "boolean"
279
+ },
280
+ "provider": {
281
+ "type": "object",
282
+ "required": [
283
+ "id",
284
+ "type"
285
+ ],
286
+ "properties": {
287
+ "id": {
288
+ "type": "string"
289
+ },
290
+ "type": {
291
+ "anyOf": [
292
+ {
293
+ "type": "string",
294
+ "const": "tavily"
295
+ },
296
+ {
297
+ "type": "string",
298
+ "const": "exa"
299
+ },
300
+ {
301
+ "type": "string",
302
+ "const": "brave"
303
+ },
304
+ {
305
+ "type": "string",
306
+ "const": "searxng"
307
+ },
308
+ {
309
+ "type": "string",
310
+ "const": "firecrawl"
311
+ },
312
+ {
313
+ "type": "string",
314
+ "const": "jina"
315
+ },
316
+ {
317
+ "type": "string",
318
+ "const": "http"
319
+ },
320
+ {
321
+ "type": "string",
322
+ "const": "anysearch"
323
+ },
324
+ {
325
+ "type": "string",
326
+ "const": "xcrawl"
327
+ }
328
+ ]
329
+ }
330
+ }
331
+ },
332
+ "httpStatus": {
333
+ "type": "integer"
334
+ },
335
+ "details": {}
336
+ }
337
+ },
338
+ "partial": {
339
+ "type": "object",
340
+ "required": [
341
+ "provider",
342
+ "data",
343
+ "raw"
344
+ ],
345
+ "properties": {
346
+ "provider": {
347
+ "type": "object",
348
+ "required": [
349
+ "id",
350
+ "type"
351
+ ],
352
+ "properties": {
353
+ "id": {
354
+ "type": "string"
355
+ },
356
+ "type": {
357
+ "anyOf": [
358
+ {
359
+ "type": "string",
360
+ "const": "tavily"
361
+ },
362
+ {
363
+ "type": "string",
364
+ "const": "exa"
365
+ },
366
+ {
367
+ "type": "string",
368
+ "const": "brave"
369
+ },
370
+ {
371
+ "type": "string",
372
+ "const": "searxng"
373
+ },
374
+ {
375
+ "type": "string",
376
+ "const": "firecrawl"
377
+ },
378
+ {
379
+ "type": "string",
380
+ "const": "jina"
381
+ },
382
+ {
383
+ "type": "string",
384
+ "const": "http"
385
+ },
386
+ {
387
+ "type": "string",
388
+ "const": "anysearch"
389
+ },
390
+ {
391
+ "type": "string",
392
+ "const": "xcrawl"
393
+ }
394
+ ]
395
+ }
396
+ }
397
+ },
398
+ "data": {
399
+ "type": "object",
400
+ "required": [
401
+ "document"
402
+ ],
403
+ "properties": {
404
+ "document": {
405
+ "type": "object",
406
+ "required": [
407
+ "sourceUrl",
408
+ "title",
409
+ "content",
410
+ "contentType"
411
+ ],
412
+ "properties": {
413
+ "sourceUrl": {
414
+ "type": "string",
415
+ "format": "uri"
416
+ },
417
+ "title": {
418
+ "type": "string"
419
+ },
420
+ "content": {
421
+ "type": "string"
422
+ },
423
+ "contentType": {
424
+ "type": "string",
425
+ "const": "text/markdown"
426
+ }
427
+ }
428
+ }
429
+ }
430
+ },
431
+ "raw": {}
432
+ }
433
+ }
434
+ }
435
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "type": "object",
3
+ "required": [
4
+ "query",
5
+ "provider",
6
+ "limit",
7
+ "includeDomains",
8
+ "excludeDomains"
9
+ ],
10
+ "properties": {
11
+ "query": {
12
+ "type": "string",
13
+ "minLength": 1
14
+ },
15
+ "provider": {
16
+ "type": "string",
17
+ "minLength": 1
18
+ },
19
+ "limit": {
20
+ "type": "integer",
21
+ "minimum": 1,
22
+ "maximum": 20
23
+ },
24
+ "freshness": {
25
+ "anyOf": [
26
+ {
27
+ "type": "string",
28
+ "const": "day"
29
+ },
30
+ {
31
+ "type": "string",
32
+ "const": "month"
33
+ },
34
+ {
35
+ "type": "string",
36
+ "const": "year"
37
+ }
38
+ ]
39
+ },
40
+ "includeDomains": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "string"
44
+ }
45
+ },
46
+ "excludeDomains": {
47
+ "type": "array",
48
+ "items": {
49
+ "type": "string"
50
+ }
51
+ },
52
+ "timeoutMs": {
53
+ "type": "integer",
54
+ "minimum": 1
55
+ }
56
+ }
57
+ }