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.
- package/LICENSE +661 -0
- package/README.md +101 -0
- package/dist/cli.d.ts +58 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +91 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/backends/custom.d.ts +15 -0
- package/dist/core/backends/custom.d.ts.map +1 -0
- package/dist/core/backends/custom.js +106 -0
- package/dist/core/backends/custom.js.map +1 -0
- package/dist/core/backends/registry.d.ts +13 -0
- package/dist/core/backends/registry.d.ts.map +1 -0
- package/dist/core/backends/registry.js +31 -0
- package/dist/core/backends/registry.js.map +1 -0
- package/dist/core/backends/searxng.d.ts +8 -0
- package/dist/core/backends/searxng.d.ts.map +1 -0
- package/dist/core/backends/searxng.js +43 -0
- package/dist/core/backends/searxng.js.map +1 -0
- package/dist/core/backends/tavily-compat.d.ts +10 -0
- package/dist/core/backends/tavily-compat.d.ts.map +1 -0
- package/dist/core/backends/tavily-compat.js +85 -0
- package/dist/core/backends/tavily-compat.js.map +1 -0
- package/dist/core/backends/types.d.ts +48 -0
- package/dist/core/backends/types.d.ts.map +1 -0
- package/dist/core/backends/types.js +5 -0
- package/dist/core/backends/types.js.map +1 -0
- package/dist/core/config.d.ts +39 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +72 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/egress.d.ts +30 -0
- package/dist/core/egress.d.ts.map +1 -0
- package/dist/core/egress.js +87 -0
- package/dist/core/egress.js.map +1 -0
- package/dist/core/extract.d.ts +45 -0
- package/dist/core/extract.d.ts.map +1 -0
- package/dist/core/extract.js +36 -0
- package/dist/core/extract.js.map +1 -0
- package/dist/core/fetch.d.ts +42 -0
- package/dist/core/fetch.d.ts.map +1 -0
- package/dist/core/fetch.js +76 -0
- package/dist/core/fetch.js.map +1 -0
- package/dist/core/http.d.ts +8 -0
- package/dist/core/http.d.ts.map +1 -0
- package/dist/core/http.js +49 -0
- package/dist/core/http.js.map +1 -0
- package/dist/core/search.d.ts +31 -0
- package/dist/core/search.d.ts.map +1 -0
- package/dist/core/search.js +65 -0
- package/dist/core/search.js.map +1 -0
- package/dist/core/security.d.ts +35 -0
- package/dist/core/security.d.ts.map +1 -0
- package/dist/core/security.js +141 -0
- package/dist/core/security.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +40 -0
- package/dist/index.js.map +1 -0
- package/package.json +62 -2
- package/src/cli.ts +106 -0
- package/src/core/backends/custom.ts +159 -0
- package/src/core/backends/registry.ts +41 -0
- package/src/core/backends/searxng.ts +70 -0
- package/src/core/backends/tavily-compat.ts +156 -0
- package/src/core/backends/types.ts +61 -0
- package/src/core/config.ts +106 -0
- package/src/core/egress.ts +106 -0
- package/src/core/extract.ts +82 -0
- package/src/core/fetch.ts +132 -0
- package/src/core/http.ts +62 -0
- package/src/core/search.ts +104 -0
- package/src/core/security.ts +141 -0
- 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';
|