@mrclrchtr/supi-web 7.1.1 → 7.2.1
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 +19 -5
- package/node_modules/@mrclrchtr/supi-core/README.md +127 -0
- package/node_modules/@mrclrchtr/supi-core/package.json +72 -0
- package/node_modules/@mrclrchtr/supi-core/src/api.ts +40 -0
- package/node_modules/@mrclrchtr/supi-core/src/config/config.ts +232 -0
- package/node_modules/@mrclrchtr/supi-core/src/config/prompt-surface.ts +363 -0
- package/node_modules/@mrclrchtr/supi-core/src/config.ts +12 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-provider-registry.ts +36 -0
- package/node_modules/@mrclrchtr/supi-core/src/context/context-tag.ts +31 -0
- package/node_modules/@mrclrchtr/supi-core/src/context.ts +8 -0
- package/node_modules/@mrclrchtr/supi-core/src/debug-identity.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/debug-registry.ts +308 -0
- package/node_modules/@mrclrchtr/supi-core/src/debug-timing.ts +120 -0
- package/node_modules/@mrclrchtr/supi-core/src/debug.ts +14 -0
- package/node_modules/@mrclrchtr/supi-core/src/evidence-badge.ts +41 -0
- package/node_modules/@mrclrchtr/supi-core/src/footer-registry.ts +64 -0
- package/node_modules/@mrclrchtr/supi-core/src/index.ts +36 -0
- package/node_modules/@mrclrchtr/supi-core/src/llm.ts +356 -0
- package/node_modules/@mrclrchtr/supi-core/src/model-selection.ts +134 -0
- package/node_modules/@mrclrchtr/supi-core/src/path-utils.ts +44 -0
- package/node_modules/@mrclrchtr/supi-core/src/path.ts +2 -0
- package/node_modules/@mrclrchtr/supi-core/src/project-roots.ts +170 -0
- package/node_modules/@mrclrchtr/supi-core/src/project.ts +15 -0
- package/node_modules/@mrclrchtr/supi-core/src/prompt-surface.ts +4 -0
- package/node_modules/@mrclrchtr/supi-core/src/registry-utils.ts +93 -0
- package/node_modules/@mrclrchtr/supi-core/src/report.ts +121 -0
- package/node_modules/@mrclrchtr/supi-core/src/session-utils.ts +71 -0
- package/node_modules/@mrclrchtr/supi-core/src/session.ts +8 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-registry.ts +105 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings/settings-schema.ts +453 -0
- package/node_modules/@mrclrchtr/supi-core/src/settings.ts +36 -0
- package/node_modules/@mrclrchtr/supi-core/src/spinner-frames.ts +11 -0
- package/node_modules/@mrclrchtr/supi-core/src/status-spinner.ts +68 -0
- package/node_modules/@mrclrchtr/supi-core/src/terminal.ts +60 -0
- package/package.json +8 -3
- package/src/api.ts +1 -0
- package/src/config.ts +29 -0
- package/src/settings-registration.ts +63 -0
- package/src/tool/tool-specs.ts +21 -0
- package/src/tool/web_search/bx.ts +178 -0
- package/src/tool/web_search/execute.ts +39 -0
- package/src/tool/web_search/guidance.ts +6 -0
- package/src/tool/web_search/input.ts +91 -0
- package/src/tool/web_search/parse.ts +92 -0
- package/src/tool/web_search/register.ts +16 -0
- package/src/tool/web_search/render.ts +95 -0
- package/src/tool/web_search/result.ts +58 -0
- package/src/tool/web_search/spec.ts +18 -0
- package/src/web.ts +26 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { runWebSearch } from "./execute.ts";
|
|
2
|
+
import { webSearchParameters } from "./input.ts";
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
type WebSearchInput,
|
|
6
|
+
webSearchParameters,
|
|
7
|
+
} from "./input.ts";
|
|
8
|
+
|
|
9
|
+
export const WEB_SEARCH_TOOL_NAME = "web_search";
|
|
10
|
+
export const WEB_SEARCH_TOOL_LABEL = "Web Search";
|
|
11
|
+
|
|
12
|
+
/** Canonical provider-facing metadata for the web_search tool. */
|
|
13
|
+
export const webSearchSpec = {
|
|
14
|
+
name: WEB_SEARCH_TOOL_NAME,
|
|
15
|
+
label: WEB_SEARCH_TOOL_LABEL,
|
|
16
|
+
parameters: webSearchParameters,
|
|
17
|
+
execute: runWebSearch,
|
|
18
|
+
} as const;
|
package/src/web.ts
CHANGED
|
@@ -1,10 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SuPi Web extension entry point — registers the `web_fetch_md` tool with pi.
|
|
3
|
-
*/
|
|
1
|
+
/** SuPi Web extension entry point for fetch and optional Web Search. */
|
|
4
2
|
|
|
5
3
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
4
|
+
import { loadWebConfig } from "./config.ts";
|
|
5
|
+
import { registerWebSettings } from "./settings-registration.ts";
|
|
6
6
|
import { registerWebFetchMdTool } from "./tool/web_fetch_md/register.ts";
|
|
7
|
+
import { isBxAvailable } from "./tool/web_search/bx.ts";
|
|
8
|
+
import { registerWebSearchTool } from "./tool/web_search/register.ts";
|
|
7
9
|
|
|
10
|
+
/** Register web tools and evaluate Web Search at the session load boundary. */
|
|
8
11
|
export default function webExtension(pi: ExtensionAPI): void {
|
|
12
|
+
registerWebSettings(pi);
|
|
9
13
|
registerWebFetchMdTool(pi);
|
|
14
|
+
|
|
15
|
+
let webSearchRegistered = false;
|
|
16
|
+
pi.on("session_start", async (_event, ctx) => {
|
|
17
|
+
if (webSearchRegistered) return;
|
|
18
|
+
|
|
19
|
+
const config = loadWebConfig(ctx.cwd);
|
|
20
|
+
if (!config.webSearchEnabled) return;
|
|
21
|
+
|
|
22
|
+
if (!isBxAvailable()) {
|
|
23
|
+
ctx.ui.notify(
|
|
24
|
+
"Web Search is enabled, but bx is not available on PATH. web_search is unavailable until bx is available.",
|
|
25
|
+
"warning",
|
|
26
|
+
);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
registerWebSearchTool(pi);
|
|
31
|
+
webSearchRegistered = true;
|
|
32
|
+
});
|
|
10
33
|
}
|