webveil 0.0.0 → 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 (73) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +101 -0
  3. package/dist/cli.d.ts +58 -0
  4. package/dist/cli.d.ts.map +1 -0
  5. package/dist/cli.js +91 -0
  6. package/dist/cli.js.map +1 -0
  7. package/dist/core/backends/custom.d.ts +15 -0
  8. package/dist/core/backends/custom.d.ts.map +1 -0
  9. package/dist/core/backends/custom.js +106 -0
  10. package/dist/core/backends/custom.js.map +1 -0
  11. package/dist/core/backends/registry.d.ts +13 -0
  12. package/dist/core/backends/registry.d.ts.map +1 -0
  13. package/dist/core/backends/registry.js +31 -0
  14. package/dist/core/backends/registry.js.map +1 -0
  15. package/dist/core/backends/searxng.d.ts +8 -0
  16. package/dist/core/backends/searxng.d.ts.map +1 -0
  17. package/dist/core/backends/searxng.js +43 -0
  18. package/dist/core/backends/searxng.js.map +1 -0
  19. package/dist/core/backends/tavily-compat.d.ts +10 -0
  20. package/dist/core/backends/tavily-compat.d.ts.map +1 -0
  21. package/dist/core/backends/tavily-compat.js +85 -0
  22. package/dist/core/backends/tavily-compat.js.map +1 -0
  23. package/dist/core/backends/types.d.ts +48 -0
  24. package/dist/core/backends/types.d.ts.map +1 -0
  25. package/dist/core/backends/types.js +5 -0
  26. package/dist/core/backends/types.js.map +1 -0
  27. package/dist/core/config.d.ts +39 -0
  28. package/dist/core/config.d.ts.map +1 -0
  29. package/dist/core/config.js +72 -0
  30. package/dist/core/config.js.map +1 -0
  31. package/dist/core/egress.d.ts +30 -0
  32. package/dist/core/egress.d.ts.map +1 -0
  33. package/dist/core/egress.js +87 -0
  34. package/dist/core/egress.js.map +1 -0
  35. package/dist/core/extract.d.ts +45 -0
  36. package/dist/core/extract.d.ts.map +1 -0
  37. package/dist/core/extract.js +36 -0
  38. package/dist/core/extract.js.map +1 -0
  39. package/dist/core/fetch.d.ts +42 -0
  40. package/dist/core/fetch.d.ts.map +1 -0
  41. package/dist/core/fetch.js +76 -0
  42. package/dist/core/fetch.js.map +1 -0
  43. package/dist/core/http.d.ts +8 -0
  44. package/dist/core/http.d.ts.map +1 -0
  45. package/dist/core/http.js +49 -0
  46. package/dist/core/http.js.map +1 -0
  47. package/dist/core/search.d.ts +31 -0
  48. package/dist/core/search.d.ts.map +1 -0
  49. package/dist/core/search.js +65 -0
  50. package/dist/core/search.js.map +1 -0
  51. package/dist/core/security.d.ts +35 -0
  52. package/dist/core/security.d.ts.map +1 -0
  53. package/dist/core/security.js +141 -0
  54. package/dist/core/security.js.map +1 -0
  55. package/dist/index.d.ts +22 -0
  56. package/dist/index.d.ts.map +1 -0
  57. package/dist/index.js +40 -0
  58. package/dist/index.js.map +1 -0
  59. package/package.json +62 -2
  60. package/src/cli.ts +106 -0
  61. package/src/core/backends/custom.ts +159 -0
  62. package/src/core/backends/registry.ts +41 -0
  63. package/src/core/backends/searxng.ts +70 -0
  64. package/src/core/backends/tavily-compat.ts +156 -0
  65. package/src/core/backends/types.ts +61 -0
  66. package/src/core/config.ts +106 -0
  67. package/src/core/egress.ts +106 -0
  68. package/src/core/extract.ts +82 -0
  69. package/src/core/fetch.ts +132 -0
  70. package/src/core/http.ts +62 -0
  71. package/src/core/search.ts +104 -0
  72. package/src/core/security.ts +141 -0
  73. package/src/index.ts +82 -0
package/src/index.ts ADDED
@@ -0,0 +1,82 @@
1
+ // webveil — anonymous-capable, self-hosted, account-free web search + fetch for agents.
2
+ //
3
+ // This is the public surface. The framework-agnostic core lives under src/core:
4
+ // - core/config.ts : config seam (per-folder .pi/webveil.json + global + env)
5
+ // - core/egress.ts : egress seam (direct | http | socks5/Tor) — dispatcher + egress fetch
6
+ // - core/http.ts : the proxied `http` helper handed to backends
7
+ // - core/extract.ts : Extractor seam (distilly/fetch + injected egress fetch)
8
+ // - core/backends/types.ts : backend seam (the Backend interface + result shapes)
9
+ // - core/backends/registry.ts : name -> Backend dispatcher
10
+ // - core/backends/searxng.ts : the keyless self-hosted SearXNG backend
11
+ // - core/backends/tavily-compat.ts : the generic Tavily-shaped backend (/search + /extract)
12
+ // - core/search.ts : the framework-agnostic search() both frontends call
13
+ // - core/security.ts : SSRF guard wrapped around the egress fetch
14
+ // - core/fetch.ts : the framework-agnostic fetch() both frontends call
15
+ // - core/backends/custom.ts : the local-command escape hatch (JSON stdin/stdout)
16
+ // - cli.ts : the incur CLI + MCP frontend (the `webveil` bin)
17
+ // pi-webveil (sibling package) wraps the SAME core functions as registerTool
18
+ // web_search / web_fetch, in-process, as an Ollama drop-in.
19
+
20
+ // config seam
21
+ export {resolveConfig} from './core/config.js';
22
+ export type {
23
+ Config,
24
+ Egress,
25
+ FetchSize,
26
+ PartialConfig,
27
+ ResolveOptions,
28
+ } from './core/config.js';
29
+
30
+ // egress seam
31
+ export {
32
+ buildDispatcher,
33
+ createEgressFetch,
34
+ EgressError,
35
+ } from './core/egress.js';
36
+ export type {Dispatcher, EgressFetch} from './core/egress.js';
37
+
38
+ // http helper
39
+ export {createHttp} from './core/http.js';
40
+
41
+ // Extractor seam (distilly/fetch over webveil's egress)
42
+ export {extract} from './core/extract.js';
43
+ export type {ExtractOptions, ExtractDeps} from './core/extract.js';
44
+
45
+ // SSRF guard (wrapped around the egress fetch; covers distilly's requests too)
46
+ export {
47
+ assertPublicUrl,
48
+ guardEgressFetch,
49
+ isPrivateIp,
50
+ SsrfError,
51
+ } from './core/security.js';
52
+
53
+ // backend seam (the contract + result types)
54
+ export type {
55
+ Backend,
56
+ Http,
57
+ HttpRequestOptions,
58
+ SearchResult,
59
+ FetchResult,
60
+ SearchOptions,
61
+ FetchOptions,
62
+ } from './core/backends/types.js';
63
+
64
+ // backend registry + implementations
65
+ export {backendNames, getBackend} from './core/backends/registry.js';
66
+ export type {BackendFactory} from './core/backends/registry.js';
67
+ export {createSearxngBackend} from './core/backends/searxng.js';
68
+ export {createTavilyCompatBackend} from './core/backends/tavily-compat.js';
69
+ export {createCustomBackend} from './core/backends/custom.js';
70
+ export type {SpawnFn} from './core/backends/custom.js';
71
+
72
+ // core search (the framework-agnostic search() both frontends call)
73
+ export {search} from './core/search.js';
74
+ export type {SearchCoreOptions, SearchDeps} from './core/search.js';
75
+
76
+ // core fetch (the framework-agnostic fetch() + list-ready fetchAll internal)
77
+ export {fetch, fetchAll} from './core/fetch.js';
78
+ export type {FetchCoreOptions, FetchDeps} from './core/fetch.js';
79
+
80
+ // incur CLI + MCP frontend (the `webveil` bin builds and serves this)
81
+ export {createCli} from './cli.js';
82
+ export type {CliDeps} from './cli.js';