pi-ketch 0.1.1 → 0.1.3

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 CHANGED
@@ -73,9 +73,9 @@ You only need one working search backend to get started:
73
73
  - **Brave**: direct API search with a Brave API key.
74
74
  - **SearXNG**: self-hosted metasearch through a configured SearXNG URL.
75
75
 
76
- You can use either one as the default backend. Routine `ketch_search` calls use that single configured default, which is the recommended behavior for normal searches. Brave is the simplest direct default; SearXNG adds self-hosted metasearch.
76
+ You can use either one as the default backend. Every routine `ketch_search` call must omit `backend`, `multi`, and `allBackends`, using only that single configured default. It should not automatically combine Brave and DuckDuckGo or any other providers. Brave is the simplest direct default; SearXNG adds self-hosted metasearch.
77
77
 
78
- For contested, multi-part, or deep research, `pi-ketch` can set `allBackends: true`. Ketch then uses `--multi=all` to discover and query every search backend it currently considers usable; users and agents do not need to hardcode provider names. An explicit `multi` list remains available for targeted provider comparisons.
78
+ Federated search is reserved for deeper work. For contested, multi-part, or deep research, `pi-ketch` can set `allBackends: true`. Ketch then uses `--multi=all` to discover and query every search backend it currently considers usable; users and agents do not need to hardcode provider names. An explicit `multi` list remains available only for deeper corroboration or user-requested provider comparisons.
79
79
 
80
80
  Additional search backends—DuckDuckGo, Exa, Firecrawl, and Keenable—are optional. Firecrawl is used here only as an explicit or federated web-search backend; it does not power `ketch_scrape` or `ketch_crawl`.
81
81
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ketch",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
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",
@@ -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 will use the user's configured default backend.
37
- 3. For contested, time-sensitive, multi-part, or deep research, use `allBackends: true`; Ketch dynamically queries every backend it currently considers usable, so do not hardcode provider names.
38
- 4. Use an explicit `backend` or `multi` list only when the user requests particular providers or a targeted backend retry is needed.
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. A routine search should omit `backend`, `multi`, and `allBackends` so Ketch uses the user's configured default. For contested, multi-part, or deep research, set `allBackends: true`; Ketch translates this 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`.
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
@@ -6,6 +6,8 @@ import { registerDocsTool } from "./tools/docs.js";
6
6
  import { registerScrapeTool } from "./tools/scrape.js";
7
7
  import { registerSearchTool } from "./tools/search.js";
8
8
 
9
+ const STATUS_ID = "pi-ketch";
10
+
9
11
  export default function ketchExtension(pi: ExtensionAPI): void {
10
12
  registerSearchTool(pi);
11
13
  registerScrapeTool(pi);
@@ -13,4 +15,12 @@ export default function ketchExtension(pi: ExtensionAPI): void {
13
15
  registerDocsTool(pi);
14
16
  registerCrawlTool(pi);
15
17
  registerDiagnostics(pi);
18
+
19
+ pi.on("session_start", (_event, ctx) => {
20
+ ctx.ui.setStatus(STATUS_ID, "🌐 ketch: active");
21
+ });
22
+
23
+ pi.on("session_shutdown", (_event, ctx) => {
24
+ ctx.ui.setStatus(STATUS_ID, undefined);
25
+ });
16
26
  }
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: "Explicit search backends to query together. Cannot be combined with backend or allBackends.", maxItems: 6 })),
12
- allBackends: Type.Optional(Type.Boolean({ description: "Query every search backend Ketch currently considers usable. Intended for deep research, not routine searches." })),
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." })),
@@ -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 using configured Brave, DuckDuckGo, SearXNG, Exa, Firecrawl, or Keenable backends. Can optionally scrape bounded content from each result.",
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: Search the current external web through Ketch; cite returned URLs.",
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
- "Use ketch_search without backend options for routine searches so Ketch uses the user's configured default backend.",
35
- "Use ketch_search with allBackends for contested, multi-part, or deep research that needs results from every currently usable backend; cite returned URLs.",
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"),