@juicesharp/rpiv-web-tools 2.13.7 → 2.13.9
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/index.ts +6 -6
- package/package.json +2 -2
- package/providers/brave.ts +1 -1
- package/providers/exa.ts +1 -1
- package/providers/factory.ts +11 -11
- package/providers/fetch-helpers.ts +1 -1
- package/providers/firecrawl.ts +1 -1
- package/providers/index.ts +24 -24
- package/providers/interceptors/github.ts +3 -3
- package/providers/interceptors/index.ts +4 -4
- package/providers/interceptors/types.ts +1 -1
- package/providers/jina.ts +1 -1
- package/providers/ollama.ts +1 -1
- package/providers/perplexity.ts +1 -1
- package/providers/searxng.ts +1 -1
- package/providers/serper.ts +1 -1
- package/providers/tavily.ts +1 -1
- package/providers/youcom.ts +1 -1
- package/web-tools.ts +6 -6
package/index.ts
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
12
|
-
import { buildInterceptors } from "./providers/interceptors/index.
|
|
13
|
-
import { registerWebFetchTool, registerWebSearchConfigCommand, registerWebSearchTool } from "./web-tools.
|
|
12
|
+
import { buildInterceptors } from "./providers/interceptors/index.ts";
|
|
13
|
+
import { registerWebFetchTool, registerWebSearchConfigCommand, registerWebSearchTool } from "./web-tools.ts";
|
|
14
14
|
|
|
15
|
-
export { createSearchProvider } from "./providers/factory.
|
|
15
|
+
export { createSearchProvider } from "./providers/factory.ts";
|
|
16
16
|
export {
|
|
17
17
|
GITHUB_TOKEN_ENV_VAR,
|
|
18
18
|
GitHubInterceptor,
|
|
@@ -21,7 +21,7 @@ export {
|
|
|
21
21
|
parseGitHubUrl,
|
|
22
22
|
resolveGitHubOptions,
|
|
23
23
|
type UrlInterceptor,
|
|
24
|
-
} from "./providers/interceptors/index.
|
|
24
|
+
} from "./providers/interceptors/index.ts";
|
|
25
25
|
|
|
26
26
|
export type {
|
|
27
27
|
FetchProvider,
|
|
@@ -30,7 +30,7 @@ export type {
|
|
|
30
30
|
SearchProvider,
|
|
31
31
|
SearchResponse,
|
|
32
32
|
SearchResult,
|
|
33
|
-
} from "./providers/types.
|
|
33
|
+
} from "./providers/types.ts";
|
|
34
34
|
export {
|
|
35
35
|
DEFAULT_WEB_FETCH_GUIDELINES,
|
|
36
36
|
DEFAULT_WEB_FETCH_SNIPPET,
|
|
@@ -39,7 +39,7 @@ export {
|
|
|
39
39
|
registerWebFetchTool,
|
|
40
40
|
registerWebSearchConfigCommand,
|
|
41
41
|
registerWebSearchTool,
|
|
42
|
-
} from "./web-tools.
|
|
42
|
+
} from "./web-tools.ts";
|
|
43
43
|
|
|
44
44
|
// Programmatic consumer-side opt-in for URL interceptors. Tier 2 in the
|
|
45
45
|
// resolution model: end-user config (Tier 1) still wins. Default OFF —
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juicesharp/rpiv-web-tools",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.9",
|
|
4
4
|
"description": "Pi extension. Web search and fetch for the model with pluggable providers (Brave, Tavily, Serper, Exa, You.com, Jina, Firecrawl, Perplexity, SearXNG, Ollama).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@juicesharp/rpiv-config": "^2.13.
|
|
68
|
+
"@juicesharp/rpiv-config": "^2.13.9"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@earendil-works/pi-coding-agent": "*",
|
package/providers/brave.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SearchProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { SearchProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const BRAVE_SEARCH_API_URL = "https://api.search.brave.com/res/v1/web/search";
|
|
4
4
|
export const BRAVE_API_KEY_ENV_VAR = "BRAVE_SEARCH_API_KEY";
|
package/providers/exa.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const EXA_API_URL = "https://api.exa.ai/search";
|
|
4
4
|
const EXA_CONTENTS_API_URL = "https://api.exa.ai/contents";
|
package/providers/factory.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { BraveProvider } from "./brave.
|
|
2
|
-
import { ExaProvider } from "./exa.
|
|
3
|
-
import { FirecrawlProvider } from "./firecrawl.
|
|
4
|
-
import { JinaProvider } from "./jina.
|
|
5
|
-
import { OllamaProvider } from "./ollama.
|
|
6
|
-
import { PerplexityProvider } from "./perplexity.
|
|
7
|
-
import { SearxngProvider } from "./searxng.
|
|
8
|
-
import { SerperProvider } from "./serper.
|
|
9
|
-
import { TavilyProvider } from "./tavily.
|
|
10
|
-
import type { FullProvider, SearchProvider } from "./types.
|
|
11
|
-
import { YouComProvider } from "./youcom.
|
|
1
|
+
import { BraveProvider } from "./brave.ts";
|
|
2
|
+
import { ExaProvider } from "./exa.ts";
|
|
3
|
+
import { FirecrawlProvider } from "./firecrawl.ts";
|
|
4
|
+
import { JinaProvider } from "./jina.ts";
|
|
5
|
+
import { OllamaProvider } from "./ollama.ts";
|
|
6
|
+
import { PerplexityProvider } from "./perplexity.ts";
|
|
7
|
+
import { SearxngProvider } from "./searxng.ts";
|
|
8
|
+
import { SerperProvider } from "./serper.ts";
|
|
9
|
+
import { TavilyProvider } from "./tavily.ts";
|
|
10
|
+
import type { FullProvider, SearchProvider } from "./types.ts";
|
|
11
|
+
import { YouComProvider } from "./youcom.ts";
|
|
12
12
|
|
|
13
13
|
export interface ProviderCredentials {
|
|
14
14
|
apiKey?: string;
|
package/providers/firecrawl.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const FIRECRAWL_API_URL = "https://api.firecrawl.dev/v1";
|
|
4
4
|
export const FIRECRAWL_API_KEY_ENV_VAR = "FIRECRAWL_API_KEY";
|
package/providers/index.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { BRAVE_PROVIDER_META } from "./brave.
|
|
2
|
-
import { EXA_PROVIDER_META } from "./exa.
|
|
3
|
-
import { FIRECRAWL_PROVIDER_META } from "./firecrawl.
|
|
4
|
-
import { JINA_PROVIDER_META } from "./jina.
|
|
5
|
-
import { OLLAMA_PROVIDER_META } from "./ollama.
|
|
6
|
-
import { PERPLEXITY_PROVIDER_META } from "./perplexity.
|
|
7
|
-
import { SEARXNG_PROVIDER_META } from "./searxng.
|
|
8
|
-
import { SERPER_PROVIDER_META } from "./serper.
|
|
9
|
-
import { TAVILY_PROVIDER_META } from "./tavily.
|
|
10
|
-
import type { ProviderMeta } from "./types.
|
|
11
|
-
import { YOUCOM_PROVIDER_META } from "./youcom.
|
|
1
|
+
import { BRAVE_PROVIDER_META } from "./brave.ts";
|
|
2
|
+
import { EXA_PROVIDER_META } from "./exa.ts";
|
|
3
|
+
import { FIRECRAWL_PROVIDER_META } from "./firecrawl.ts";
|
|
4
|
+
import { JINA_PROVIDER_META } from "./jina.ts";
|
|
5
|
+
import { OLLAMA_PROVIDER_META } from "./ollama.ts";
|
|
6
|
+
import { PERPLEXITY_PROVIDER_META } from "./perplexity.ts";
|
|
7
|
+
import { SEARXNG_PROVIDER_META } from "./searxng.ts";
|
|
8
|
+
import { SERPER_PROVIDER_META } from "./serper.ts";
|
|
9
|
+
import { TAVILY_PROVIDER_META } from "./tavily.ts";
|
|
10
|
+
import type { ProviderMeta } from "./types.ts";
|
|
11
|
+
import { YOUCOM_PROVIDER_META } from "./youcom.ts";
|
|
12
12
|
|
|
13
|
-
export { BRAVE_API_KEY_ENV_VAR, BRAVE_PROVIDER_META, BraveProvider } from "./brave.
|
|
14
|
-
export { EXA_API_KEY_ENV_VAR, EXA_PROVIDER_META, ExaProvider } from "./exa.
|
|
15
|
-
export { createSearchProvider, type ProviderCredentials } from "./factory.
|
|
16
|
-
export { FIRECRAWL_API_KEY_ENV_VAR, FIRECRAWL_PROVIDER_META, FirecrawlProvider } from "./firecrawl.
|
|
13
|
+
export { BRAVE_API_KEY_ENV_VAR, BRAVE_PROVIDER_META, BraveProvider } from "./brave.ts";
|
|
14
|
+
export { EXA_API_KEY_ENV_VAR, EXA_PROVIDER_META, ExaProvider } from "./exa.ts";
|
|
15
|
+
export { createSearchProvider, type ProviderCredentials } from "./factory.ts";
|
|
16
|
+
export { FIRECRAWL_API_KEY_ENV_VAR, FIRECRAWL_PROVIDER_META, FirecrawlProvider } from "./firecrawl.ts";
|
|
17
17
|
// URL interceptors live in providers/interceptors/. The github primitives
|
|
18
18
|
// (parseGitHubUrl, GitHubUrlInfo, etc.) are re-exported from there.
|
|
19
19
|
export {
|
|
@@ -24,8 +24,8 @@ export {
|
|
|
24
24
|
type GitHubUrlInfo,
|
|
25
25
|
parseGitHubUrl,
|
|
26
26
|
type UrlInterceptor,
|
|
27
|
-
} from "./interceptors/index.
|
|
28
|
-
export { JINA_API_KEY_ENV_VAR, JINA_PROVIDER_META, JinaProvider } from "./jina.
|
|
27
|
+
} from "./interceptors/index.ts";
|
|
28
|
+
export { JINA_API_KEY_ENV_VAR, JINA_PROVIDER_META, JinaProvider } from "./jina.ts";
|
|
29
29
|
export {
|
|
30
30
|
configureOllama,
|
|
31
31
|
OLLAMA_API_KEY_ENV_VAR,
|
|
@@ -33,8 +33,8 @@ export {
|
|
|
33
33
|
OLLAMA_HOST_ENV_VAR,
|
|
34
34
|
OLLAMA_PROVIDER_META,
|
|
35
35
|
OllamaProvider,
|
|
36
|
-
} from "./ollama.
|
|
37
|
-
export { PERPLEXITY_API_KEY_ENV_VAR, PERPLEXITY_PROVIDER_META, PerplexityProvider } from "./perplexity.
|
|
36
|
+
} from "./ollama.ts";
|
|
37
|
+
export { PERPLEXITY_API_KEY_ENV_VAR, PERPLEXITY_PROVIDER_META, PerplexityProvider } from "./perplexity.ts";
|
|
38
38
|
export {
|
|
39
39
|
configureSearxng,
|
|
40
40
|
SEARXNG_API_KEY_ENV_VAR,
|
|
@@ -45,9 +45,9 @@ export {
|
|
|
45
45
|
type SearxngConfigCurrent,
|
|
46
46
|
type SearxngConfigUi,
|
|
47
47
|
SearxngProvider,
|
|
48
|
-
} from "./searxng.
|
|
49
|
-
export { SERPER_API_KEY_ENV_VAR, SERPER_PROVIDER_META, SerperProvider } from "./serper.
|
|
50
|
-
export { TAVILY_API_KEY_ENV_VAR, TAVILY_PROVIDER_META, TavilyProvider } from "./tavily.
|
|
48
|
+
} from "./searxng.ts";
|
|
49
|
+
export { SERPER_API_KEY_ENV_VAR, SERPER_PROVIDER_META, SerperProvider } from "./serper.ts";
|
|
50
|
+
export { TAVILY_API_KEY_ENV_VAR, TAVILY_PROVIDER_META, TavilyProvider } from "./tavily.ts";
|
|
51
51
|
export type {
|
|
52
52
|
FetchProvider,
|
|
53
53
|
FetchResponse,
|
|
@@ -60,8 +60,8 @@ export type {
|
|
|
60
60
|
SearchProvider,
|
|
61
61
|
SearchResponse,
|
|
62
62
|
SearchResult,
|
|
63
|
-
} from "./types.
|
|
64
|
-
export { YOUCOM_API_KEY_ENV_VAR, YOUCOM_PROVIDER_META, YouComProvider } from "./youcom.
|
|
63
|
+
} from "./types.ts";
|
|
64
|
+
export { YOUCOM_API_KEY_ENV_VAR, YOUCOM_PROVIDER_META, YouComProvider } from "./youcom.ts";
|
|
65
65
|
|
|
66
66
|
// Typed as readonly ProviderMeta[] (not `as const`) so iterators can access
|
|
67
67
|
// the optional META fields (baseUrlEnvVar, defaultBaseUrl, configure) without
|
|
@@ -12,9 +12,9 @@ import {
|
|
|
12
12
|
} from "node:fs";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
14
|
import { extname, join, sep as pathSep, resolve as resolvePath } from "node:path";
|
|
15
|
-
import { readConfig } from "../config.
|
|
16
|
-
import type { FetchResponse } from "../types.
|
|
17
|
-
import type { UrlInterceptor } from "./types.
|
|
15
|
+
import { readConfig } from "../config.ts";
|
|
16
|
+
import type { FetchResponse } from "../types.ts";
|
|
17
|
+
import type { UrlInterceptor } from "./types.ts";
|
|
18
18
|
|
|
19
19
|
// ---------------------------------------------------------------------------
|
|
20
20
|
// Constants
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { GitHubInterceptor, readUserGitHubConfig, resolveGitHubOptions } from "./github.
|
|
2
|
-
import type { UrlInterceptor } from "./types.
|
|
1
|
+
import { GitHubInterceptor, readUserGitHubConfig, resolveGitHubOptions } from "./github.ts";
|
|
2
|
+
import type { UrlInterceptor } from "./types.ts";
|
|
3
3
|
|
|
4
4
|
export {
|
|
5
5
|
DEFAULTS as GITHUB_INTERCEPTOR_DEFAULTS,
|
|
@@ -11,8 +11,8 @@ export {
|
|
|
11
11
|
type ResolvedGitHubOptions,
|
|
12
12
|
readUserGitHubConfig,
|
|
13
13
|
resolveGitHubOptions,
|
|
14
|
-
} from "./github.
|
|
15
|
-
export type { UrlInterceptor } from "./types.
|
|
14
|
+
} from "./github.ts";
|
|
15
|
+
export type { UrlInterceptor } from "./types.ts";
|
|
16
16
|
|
|
17
17
|
// Package-private singletons set by registerWebTools at startup. The
|
|
18
18
|
// orchestrator reads `getInterceptors()` per-request rather than caching the
|
package/providers/jina.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const JINA_SEARCH_API_URL = "https://s.jina.ai/";
|
|
4
4
|
const JINA_READER_API_URL = "https://r.jina.ai/";
|
package/providers/ollama.ts
CHANGED
package/providers/perplexity.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SearchProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { SearchProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const PERPLEXITY_API_URL = "https://api.perplexity.ai/search";
|
|
4
4
|
export const PERPLEXITY_API_KEY_ENV_VAR = "PERPLEXITY_API_KEY";
|
package/providers/searxng.ts
CHANGED
package/providers/serper.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SearchProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { SearchProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const SERPER_API_URL = "https://google.serper.dev/search";
|
|
4
4
|
export const SERPER_API_KEY_ENV_VAR = "SERPER_API_KEY";
|
package/providers/tavily.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const TAVILY_API_URL = "https://api.tavily.com/search";
|
|
4
4
|
const TAVILY_EXTRACT_API_URL = "https://api.tavily.com/extract";
|
package/providers/youcom.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.
|
|
1
|
+
import type { FetchResponse, FullProvider, SearchResponse, SearchResult } from "./types.ts";
|
|
2
2
|
|
|
3
3
|
const YOUCOM_SEARCH_URL = "https://ydc-index.io/v1/search";
|
|
4
4
|
const YOUCOM_CONTENTS_URL = "https://ydc-index.io/v1/contents";
|
package/web-tools.ts
CHANGED
|
@@ -25,12 +25,12 @@ import {
|
|
|
25
25
|
import { Text } from "@earendil-works/pi-tui";
|
|
26
26
|
import { validateGuidanceFields } from "@juicesharp/rpiv-config";
|
|
27
27
|
import { Type } from "typebox";
|
|
28
|
-
import { getConfigPath, readConfig, type WebToolsConfig, writeConfig } from "./providers/config.
|
|
29
|
-
import { createSearchProvider } from "./providers/factory.
|
|
30
|
-
import { fetchViaGenericHtml } from "./providers/fetch-helpers.
|
|
31
|
-
import { PROVIDERS } from "./providers/index.
|
|
32
|
-
import { GITHUB_TOKEN_ENV_VAR, getActiveGitHubInterceptor, getInterceptors } from "./providers/interceptors/index.
|
|
33
|
-
import type { FetchResponse, FullProvider, ProviderMeta, SearchProvider, SearchResult } from "./providers/types.
|
|
28
|
+
import { getConfigPath, readConfig, type WebToolsConfig, writeConfig } from "./providers/config.ts";
|
|
29
|
+
import { createSearchProvider } from "./providers/factory.ts";
|
|
30
|
+
import { fetchViaGenericHtml } from "./providers/fetch-helpers.ts";
|
|
31
|
+
import { PROVIDERS } from "./providers/index.ts";
|
|
32
|
+
import { GITHUB_TOKEN_ENV_VAR, getActiveGitHubInterceptor, getInterceptors } from "./providers/interceptors/index.ts";
|
|
33
|
+
import type { FetchResponse, FullProvider, ProviderMeta, SearchProvider, SearchResult } from "./providers/types.ts";
|
|
34
34
|
|
|
35
35
|
// ---------------------------------------------------------------------------
|
|
36
36
|
// Tunables and external surface
|