pi-ketch 0.1.2 → 0.1.4
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/README.md +37 -25
- package/package.json +1 -1
- package/skills/ketch/SKILL.md +3 -3
- package/skills/ketch/references/surfaces.md +1 -1
- package/src/index.ts +1 -2
- package/src/schemas.ts +2 -2
- package/src/tools/search.ts +4 -4
package/README.md
CHANGED
|
@@ -42,13 +42,7 @@ Install Chromium:
|
|
|
42
42
|
ketch browser install
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
The
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
ketch config set browser /Users/you/Library/Caches/ketch/browser/chromium-1321438/Chromium.app/Contents/MacOS/Chromium
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Verify the setup:
|
|
45
|
+
The installer prints the exact `ketch config set browser ...` command for the browser it installed. Copy and run that command, then verify the setup:
|
|
52
46
|
|
|
53
47
|
```sh
|
|
54
48
|
ketch browser status
|
|
@@ -61,36 +55,54 @@ For a known URL, start with a normal `ketch_scrape` call. Ketch fetches the page
|
|
|
61
55
|
|
|
62
56
|
### Search backend setup
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
Web search needs one default backend. Brave is Ketch's default and requires an API key:
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
ketch config set brave_api_key <key>
|
|
62
|
+
```
|
|
65
63
|
|
|
66
|
-
|
|
67
|
-
- Use `ketch_scrape` instead of another extension's overlapping page-extraction tool.
|
|
64
|
+
To use another provider by default, select it once in Ketch:
|
|
68
65
|
|
|
69
|
-
|
|
66
|
+
```sh
|
|
67
|
+
ketch config set backend ddg
|
|
68
|
+
# Other choices: searxng, exa, firecrawl, keenable
|
|
69
|
+
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
Some providers need credentials or a custom URL. Use Ketch's [configuration reference](https://1broseidon.github.io/ketch/) for the current keys and provider requirements rather than adding secrets to Pi settings.
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
- **SearXNG**: self-hosted metasearch through a configured SearXNG URL.
|
|
73
|
+
Check what Ketch can use before opening Pi:
|
|
75
74
|
|
|
76
|
-
|
|
75
|
+
```sh
|
|
76
|
+
ketch config
|
|
77
|
+
ketch doctor
|
|
78
|
+
ketch search "test query"
|
|
79
|
+
```
|
|
77
80
|
|
|
78
|
-
|
|
81
|
+
The operator chooses the backend; the agent normally does not. The bundled skill tells Pi to call `ketch_search` without `backend`, `multi`, or `allBackends`, so routine searches use your configured default. For deep or contested research, the agent may use `allBackends: true` to query every usable provider and fuse the rankings. An explicit `multi` list is reserved for a provider comparison you requested.
|
|
79
82
|
|
|
80
|
-
|
|
83
|
+
If another Pi extension exposes overlapping search or page-extraction tools, disable that extension in `~/.pi/agent/settings.json` to prevent duplicate tools and conflicting routing instructions. You can leave the package installed.
|
|
81
84
|
|
|
82
85
|
### Full capability setup
|
|
83
86
|
|
|
84
|
-
|
|
87
|
+
Configure only the surfaces you plan to use. Each row below maps an agent tool to the Ketch service behind it.
|
|
88
|
+
|
|
89
|
+
| Pi tool | Ketch capability | Starts with | Optional setup |
|
|
90
|
+
| --- | --- | --- | --- |
|
|
91
|
+
| `ketch_search` | Web search | Your configured default backend | Add more search providers for federated research. Brave and Firecrawl require API keys. |
|
|
92
|
+
| `ketch_scrape` | Page extraction | Direct HTTP fetching and the local page cache | Install Chromium for JavaScript-rendered pages. |
|
|
93
|
+
| `ketch_crawl` | Bounded site crawling | Direct HTTP fetching and the local page cache | Install Chromium for JavaScript-rendered pages. |
|
|
94
|
+
| `ketch_code` | Public OSS code search | grep.app | Sourcegraph needs no setup. GitHub can use `gh auth login`, `GITHUB_TOKEN`, or Ketch's `github_token`. |
|
|
95
|
+
| `ketch_docs` | Library documentation | Context7 | Set `context7_api_key`; this surface requires a Context7 key. |
|
|
96
|
+
|
|
97
|
+
A practical full setup is:
|
|
85
98
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- Caching: enabled automatically through Ketch's local bbolt cache.
|
|
99
|
+
1. Configure and test one default search backend.
|
|
100
|
+
2. Add a Context7 key if you want library documentation.
|
|
101
|
+
3. Authenticate GitHub if you want GitHub Code Search in addition to grep.app and Sourcegraph.
|
|
102
|
+
4. Install Chromium if you need rendered pages.
|
|
103
|
+
5. Add extra search providers only if you expect to use federated research.
|
|
92
104
|
|
|
93
|
-
Run `ketch doctor`
|
|
105
|
+
Run `ketch doctor` after changing configuration. It probes configured search providers, code search, Context7, the browser, and the cache. Optional services can remain unconfigured; the tools backed by them will report a precondition error when called.
|
|
94
106
|
|
|
95
107
|
## What it adds
|
|
96
108
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-ketch",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Agent-native web research tools for Pi: multi-backend search, public code search, library docs, scraping, crawling, and browser rendering, powered by Ketch.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/skills/ketch/SKILL.md
CHANGED
|
@@ -33,9 +33,9 @@ Do not route routine web search or URL extraction through another extension's ov
|
|
|
33
33
|
## Default workflow
|
|
34
34
|
|
|
35
35
|
1. Choose one surface using the table above.
|
|
36
|
-
2. For routine web search, call `ketch_search` without `backend`, `multi`, or `allBackends`; Ketch
|
|
37
|
-
3.
|
|
38
|
-
4. Use an explicit `
|
|
36
|
+
2. For every routine web search, call `ketch_search` without `backend`, `multi`, or `allBackends`; Ketch must use the user's single configured default backend. Never automatically send `multi: ["brave", "ddg"]` or any other provider list.
|
|
37
|
+
3. Reserve federated search for deeper work: use `allBackends: true` for contested, time-sensitive, multi-part, or deep research. Ketch dynamically queries every backend it currently considers usable, so do not hardcode provider names.
|
|
38
|
+
4. Use an explicit `multi` list only for deeper corroboration or when the user requests particular providers. Use an explicit single `backend` only for a user request or targeted retry.
|
|
39
39
|
5. Make bounded calls, cite the URL supporting every externally sourced claim, and state material retrieval failures instead of treating missing sources as evidence.
|
|
40
40
|
|
|
41
41
|
For deep research, read `references/research.md`. For detailed parameters and gotchas, read `references/surfaces.md`. For missing keys, browser setup, or backend failures, read `references/setup.md`.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## `ketch_search`
|
|
4
4
|
|
|
5
|
-
Use for the open web.
|
|
5
|
+
Use for the open web. Every routine search must omit `backend`, `multi`, and `allBackends` so Ketch uses the user's single configured default; never automatically submit `multi: ["brave", "ddg"]` or another provider list. Reserve federation for deeper work: set `allBackends: true` for contested, multi-part, or deep research, or use `multi` only for deeper corroboration or a user-requested provider comparison. Ketch translates `allBackends` to `--multi=all` and dynamically queries every backend it currently considers usable. `backend` selects one provider and `multi` selects an explicit provider list; all three modes are mutually exclusive. Set `scrape: true` only when fetched content from every result is needed. Pair it with a low `limit` and explicit `maxChars`.
|
|
6
6
|
|
|
7
7
|
## `ketch_code`
|
|
8
8
|
|
package/src/index.ts
CHANGED
|
@@ -17,8 +17,7 @@ export default function ketchExtension(pi: ExtensionAPI): void {
|
|
|
17
17
|
registerDiagnostics(pi);
|
|
18
18
|
|
|
19
19
|
pi.on("session_start", (_event, ctx) => {
|
|
20
|
-
|
|
21
|
-
ctx.ui.setStatus(STATUS_ID, `${theme.fg("accent", "🌐 ketch:")} ${theme.fg("success", "active")}`);
|
|
20
|
+
ctx.ui.setStatus(STATUS_ID, "🌐 ketch: active");
|
|
22
21
|
});
|
|
23
22
|
|
|
24
23
|
pi.on("session_shutdown", (_event, ctx) => {
|
package/src/schemas.ts
CHANGED
|
@@ -8,8 +8,8 @@ const DocsBackend = StringEnum(["context7"] as const);
|
|
|
8
8
|
export const SearchParams = Type.Object({
|
|
9
9
|
query: Type.String({ description: "Web search query." }),
|
|
10
10
|
backend: Type.Optional(SearchBackend),
|
|
11
|
-
multi: Type.Optional(Type.Array(SearchBackend, { description: "
|
|
12
|
-
allBackends: Type.Optional(Type.Boolean({ description: "Query every search backend Ketch currently considers usable.
|
|
11
|
+
multi: Type.Optional(Type.Array(SearchBackend, { description: "Query an explicit backend set only for deep research, corroboration, or a user-requested provider comparison. Never use for routine searches; omit it to use the configured default backend. Cannot be combined with backend or allBackends.", maxItems: 6 })),
|
|
12
|
+
allBackends: Type.Optional(Type.Boolean({ description: "Query every search backend Ketch currently considers usable. Use only for contested or deep research; never for routine searches." })),
|
|
13
13
|
limit: Type.Optional(Type.Integer({ description: "Maximum results. Defaults to Ketch config; capped at 20.", minimum: 1, maximum: 20 })),
|
|
14
14
|
scrape: Type.Optional(Type.Boolean({ description: "Fetch result pages and include extracted content." })),
|
|
15
15
|
trim: Type.Optional(Type.Boolean({ description: "Strip Markdown formatting from scraped content." })),
|
package/src/tools/search.ts
CHANGED
|
@@ -27,12 +27,12 @@ export function registerSearchTool(pi: ExtensionAPI): void {
|
|
|
27
27
|
defineTool({
|
|
28
28
|
name: "ketch_search",
|
|
29
29
|
label: "Ketch Web Search",
|
|
30
|
-
description: "Search the live web through Ketch
|
|
30
|
+
description: "Search the live web through Ketch. Routine searches must omit backend, multi, and allBackends so Ketch uses one configured default backend. Federated modes are reserved for deeper research. Can optionally scrape bounded content from each result.",
|
|
31
31
|
parameters: SearchParams,
|
|
32
|
-
promptSnippet: "ketch_search:
|
|
32
|
+
promptSnippet: "ketch_search: For routine web search, omit backend options and use only Ketch's configured default; cite returned URLs.",
|
|
33
33
|
promptGuidelines: [
|
|
34
|
-
"
|
|
35
|
-
"Use
|
|
34
|
+
"For every routine search, omit backend, multi, and allBackends. Do not automatically send multi: ['brave', 'ddg'] or any other provider list; Ketch must use the user's single configured default backend.",
|
|
35
|
+
"Use multi only for deeper corroboration or an explicit request to compare particular providers. Prefer allBackends for contested, multi-part, or deep research that needs every currently usable backend.",
|
|
36
36
|
"When ketch_search uses scrape, bound each fetched result with maxChars.",
|
|
37
37
|
],
|
|
38
38
|
...ketchRenderers("ketch_search"),
|