@oh-my-pi/pi-coding-agent 17.2.9 → 17.2.11
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/CHANGELOG.md +83 -0
- package/dist/{CHANGELOG-8yy8h3bc.md → CHANGELOG-d9xenpn9.md} +83 -0
- package/dist/cli.js +10208 -12596
- package/dist/types/capability/mcp.d.ts +11 -0
- package/dist/types/capability/skill.d.ts +6 -0
- package/dist/types/cli/args.d.ts +1 -0
- package/dist/types/cli/command-help.d.ts +3 -0
- package/dist/types/commands/share.d.ts +25 -0
- package/dist/types/commit/agentic/index.d.ts +3 -1
- package/dist/types/commit/execute.d.ts +32 -0
- package/dist/types/commit/index.d.ts +2 -1
- package/dist/types/commit/pipeline.d.ts +7 -1
- package/dist/types/config/model-registry.d.ts +4 -0
- package/dist/types/config/model-resolver.d.ts +13 -0
- package/dist/types/config/settings-schema.d.ts +1 -34
- package/dist/types/discovery/agent-plugin-format.d.ts +143 -0
- package/dist/types/discovery/agent-plugins.d.ts +1 -0
- package/dist/types/discovery/contained-path.d.ts +34 -0
- package/dist/types/discovery/index.d.ts +1 -0
- package/dist/types/extensibility/custom-commands/types.d.ts +5 -5
- package/dist/types/extensibility/custom-tools/types.d.ts +3 -3
- package/dist/types/extensibility/extensions/loader.d.ts +9 -2
- package/dist/types/extensibility/extensions/types.d.ts +45 -8
- package/dist/types/extensibility/hooks/types.d.ts +5 -5
- package/dist/types/extensibility/shared-events.d.ts +3 -2
- package/dist/types/extensibility/skills.d.ts +5 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/main.d.ts +1 -1
- package/dist/types/mcp/transports/header-policy.d.ts +45 -0
- package/dist/types/mcp/types.d.ts +15 -0
- package/dist/types/modes/acp/acp-agent.d.ts +1 -1
- package/dist/types/modes/acp/acp-client-bridge.d.ts +1 -1
- package/dist/types/modes/acp/acp-event-mapper.d.ts +1 -1
- package/dist/types/modes/acp/acp-mode.d.ts +1 -1
- package/dist/types/modes/components/agent-hub-projection.d.ts +38 -0
- package/dist/types/modes/components/agent-hub-renderer.d.ts +41 -0
- package/dist/types/modes/components/agent-hub.d.ts +14 -5
- package/dist/types/modes/components/agent-transcript-viewer.d.ts +2 -0
- package/dist/types/modes/components/chat-transcript-builder.d.ts +2 -0
- package/dist/types/modes/components/custom-editor.d.ts +1 -2
- package/dist/types/modes/components/model-browser.d.ts +9 -1
- package/dist/types/modes/components/status-line/types.d.ts +2 -0
- package/dist/types/modes/components/tool-execution.d.ts +2 -0
- package/dist/types/modes/interactive-mode.d.ts +8 -1
- package/dist/types/modes/utils/transcript-render-helpers.d.ts +3 -2
- package/dist/types/registry/agent-registry.d.ts +47 -0
- package/dist/types/registry/persisted-agents.d.ts +3 -1
- package/dist/types/secrets/index.d.ts +23 -1
- package/dist/types/session/agent-session-events.d.ts +2 -2
- package/dist/types/session/agent-session.d.ts +4 -2
- package/dist/types/session/messages.d.ts +1 -0
- package/dist/types/session/prewalk.d.ts +3 -1
- package/dist/types/session/session-entries.d.ts +10 -0
- package/dist/types/session/session-loader.d.ts +11 -1
- package/dist/types/session/session-manager.d.ts +9 -1
- package/dist/types/session/session-tools.d.ts +18 -1
- package/dist/types/session/turn-recovery.d.ts +7 -2
- package/dist/types/slash-commands/acp-builtins.d.ts +1 -1
- package/dist/types/slash-commands/available-commands.d.ts +1 -1
- package/dist/types/task/executor.d.ts +6 -0
- package/dist/types/task/index.d.ts +4 -3
- package/dist/types/task/read-only-policy.d.ts +3 -0
- package/dist/types/task/structured-subagent.d.ts +2 -0
- package/dist/types/task/types.d.ts +4 -0
- package/dist/types/tools/bash.d.ts +3 -3
- package/dist/types/tools/browser/launch.d.ts +2 -1
- package/dist/types/tools/browser/tab-worker.d.ts +2 -2
- package/dist/types/tools/path-utils.d.ts +1 -0
- package/dist/types/tools/read.d.ts +1 -5
- package/dist/types/tools/run-scope.d.ts +27 -1
- package/dist/types/tools/shell-tokenize.d.ts +16 -0
- package/dist/types/tools/terminal-output.d.ts +1 -1
- package/dist/types/utils/turndown.d.ts +1 -1
- package/dist/types/vibe/runtime.d.ts +2 -3
- package/dist/types/web/scrapers/readthedocs.d.ts +0 -3
- package/dist/types/web/search/providers/browser-headers.d.ts +2 -3
- package/examples/custom-tools/README.md +1 -1
- package/examples/extensions/README.md +1 -1
- package/examples/extensions/api-demo.ts +5 -6
- package/examples/extensions/chalk-logger.ts +1 -1
- package/examples/extensions/hello.ts +2 -2
- package/examples/extensions/reload-runtime.ts +1 -1
- package/examples/extensions/tools.ts +2 -2
- package/examples/extensions/with-deps/index.ts +1 -1
- package/examples/sdk/06-extensions.ts +1 -1
- package/package.json +15 -31
- package/scripts/bundle-dist.ts +1 -11
- package/scripts/legacy-pi-virtual-module.ts +4 -1
- package/src/advisor/runtime.ts +54 -0
- package/src/capability/mcp.ts +11 -0
- package/src/capability/skill.ts +6 -0
- package/src/cli/agents-cli.ts +1 -1
- package/src/cli/args.ts +24 -2
- package/src/cli/auth-broker-cli.ts +1 -1
- package/src/cli/auth-gateway-cli.ts +1 -1
- package/src/cli/bench-cli.ts +1 -1
- package/src/cli/claude-trace-cli.ts +1 -1
- package/src/cli/command-help.ts +4 -0
- package/src/cli/config-cli.ts +1 -1
- package/src/cli/dry-balance-cli.ts +1 -1
- package/src/cli/file-processor.ts +1 -1
- package/src/cli/flag-tables.ts +4 -0
- package/src/cli/gallery-cli.ts +1 -1
- package/src/cli/grep-cli.ts +1 -1
- package/src/cli/grievances-cli.ts +1 -1
- package/src/cli/help-extra.ts +1 -1
- package/src/cli/models-cli.ts +1 -1
- package/src/cli/plugin-cli.ts +1 -1
- package/src/cli/read-cli.ts +1 -1
- package/src/cli/setup-cli.ts +1 -1
- package/src/cli/shell-cli.ts +1 -1
- package/src/cli/ssh-cli.ts +1 -1
- package/src/cli/stats-cli.ts +1 -1
- package/src/cli/tiny-models-cli.ts +1 -1
- package/src/cli/ttsr-cli.ts +1 -1
- package/src/cli/update-cli.ts +1 -1
- package/src/cli/usage-cli.ts +1 -1
- package/src/cli/web-search-cli.ts +1 -1
- package/src/cli/worktree-cli.ts +1 -1
- package/src/cli-commands.ts +5 -0
- package/src/commands/commit.ts +16 -3
- package/src/commands/say.ts +1 -1
- package/src/commands/share.ts +71 -0
- package/src/commands/token.ts +1 -1
- package/src/commit/agentic/agent.ts +1 -1
- package/src/commit/agentic/index.ts +39 -21
- package/src/commit/cli.ts +1 -1
- package/src/commit/execute.ts +56 -0
- package/src/commit/index.ts +2 -1
- package/src/commit/pipeline.ts +20 -7
- package/src/config/model-discovery.ts +1 -1
- package/src/config/model-registry.ts +21 -1
- package/src/config/model-resolver.ts +54 -7
- package/src/config/settings-schema.ts +2 -33
- package/src/config/settings.ts +46 -0
- package/src/discovery/agent-plugin-format.ts +551 -0
- package/src/discovery/agent-plugins.ts +341 -0
- package/src/discovery/agents.ts +4 -2
- package/src/discovery/builtin-rules/ts-no-inline-cast-access.md +5 -4
- package/src/discovery/builtin-rules/ts-no-tiny-functions.md +1 -1
- package/src/discovery/claude-plugins.ts +21 -5
- package/src/discovery/contained-path.ts +78 -0
- package/src/discovery/helpers.ts +23 -9
- package/src/discovery/index.ts +1 -0
- package/src/discovery/omp-plugins.ts +20 -7
- package/src/eval/py/runner.py +38 -1
- package/src/exec/non-interactive-env.ts +1 -0
- package/src/extensibility/custom-commands/loader.ts +4 -4
- package/src/extensibility/custom-commands/types.ts +5 -5
- package/src/extensibility/custom-tools/loader.ts +4 -4
- package/src/extensibility/custom-tools/types.ts +3 -3
- package/src/extensibility/extensions/loader.ts +85 -20
- package/src/extensibility/extensions/runner.ts +6 -0
- package/src/extensibility/extensions/types.ts +51 -8
- package/src/extensibility/hooks/loader.ts +4 -5
- package/src/extensibility/hooks/types.ts +5 -5
- package/src/extensibility/plugins/legacy-pi-compat.ts +53 -0
- package/src/extensibility/plugins/marketplace/manager.ts +2 -1
- package/src/extensibility/shared-events.ts +3 -2
- package/src/extensibility/skills.ts +9 -0
- package/src/index.ts +2 -2
- package/src/internal-urls/memory-protocol.ts +5 -1
- package/src/internal-urls/skill-protocol.ts +14 -0
- package/src/internal-urls/vault-protocol.ts +2 -2
- package/src/launch/client.ts +11 -1
- package/src/launch/protocol.ts +7 -2
- package/src/launch/terminal-output.ts +1 -1
- package/src/main.ts +88 -23
- package/src/markit/converters/docx.ts +1 -1
- package/src/markit/converters/epub.ts +1 -1
- package/src/markit/converters/pptx.ts +1 -1
- package/src/markit/converters/xlsx.ts +1 -1
- package/src/mcp/config.ts +3 -0
- package/src/mcp/manager.ts +12 -9
- package/src/mcp/transports/header-policy.ts +95 -0
- package/src/mcp/transports/http.ts +35 -52
- package/src/mcp/transports/sse.ts +20 -27
- package/src/mcp/types.ts +15 -0
- package/src/modes/acp/acp-agent.ts +20 -9
- package/src/modes/acp/acp-client-bridge.ts +1 -1
- package/src/modes/acp/acp-event-mapper.ts +1 -1
- package/src/modes/acp/acp-mode.ts +1 -1
- package/src/modes/components/agent-dashboard.ts +2 -0
- package/src/modes/components/agent-hub-projection.ts +248 -0
- package/src/modes/components/agent-hub-renderer.ts +194 -0
- package/src/modes/components/agent-hub.ts +674 -207
- package/src/modes/components/agent-transcript-viewer.ts +3 -0
- package/src/modes/components/assistant-message.ts +1 -1
- package/src/modes/components/chat-transcript-builder.ts +3 -0
- package/src/modes/components/custom-editor.ts +0 -9
- package/src/modes/components/extensions/inspector-panel.ts +11 -6
- package/src/modes/components/footer.ts +1 -3
- package/src/modes/components/model-browser.ts +11 -3
- package/src/modes/components/model-hub.ts +4 -1
- package/src/modes/components/status-line/component.ts +1 -0
- package/src/modes/components/status-line/segments.ts +10 -7
- package/src/modes/components/status-line/types.ts +2 -0
- package/src/modes/components/tool-execution.ts +13 -16
- package/src/modes/components/tree-selector.ts +62 -3
- package/src/modes/controllers/command-controller.ts +4 -1
- package/src/modes/controllers/event-controller.ts +44 -20
- package/src/modes/controllers/extension-ui-controller.ts +2 -2
- package/src/modes/controllers/input-controller.ts +20 -2
- package/src/modes/controllers/mcp-command-controller.ts +81 -20
- package/src/modes/controllers/selector-controller.ts +41 -49
- package/src/modes/controllers/streaming-reveal.ts +1 -1
- package/src/modes/interactive-mode.ts +13 -2
- package/src/modes/rpc/rpc-mode.ts +2 -2
- package/src/modes/runtime-init.ts +1 -1
- package/src/modes/theme/theme.ts +2 -2
- package/src/modes/utils/transcript-render-helpers.ts +4 -2
- package/src/modes/utils/ui-helpers.ts +1 -0
- package/src/prompts/tools/computer.md +1 -1
- package/src/registry/agent-lifecycle.ts +14 -7
- package/src/registry/agent-registry.ts +65 -2
- package/src/registry/persisted-agents.ts +341 -16
- package/src/sdk.ts +6 -49
- package/src/secrets/index.ts +52 -1
- package/src/session/agent-session-events.ts +2 -2
- package/src/session/agent-session.ts +54 -16
- package/src/session/messages.ts +1 -0
- package/src/session/prewalk.ts +57 -17
- package/src/session/session-context.ts +3 -5
- package/src/session/session-entries.ts +10 -0
- package/src/session/session-handoff.ts +5 -1
- package/src/session/session-listing.ts +1 -1
- package/src/session/session-loader.ts +74 -8
- package/src/session/session-manager.ts +22 -2
- package/src/session/session-paths.ts +57 -9
- package/src/session/session-tools.ts +65 -4
- package/src/session/todo-tracker.ts +11 -1
- package/src/session/turn-recovery.ts +96 -74
- package/src/slash-commands/acp-builtins.ts +1 -1
- package/src/slash-commands/available-commands.ts +1 -1
- package/src/slash-commands/builtin-registry.ts +12 -8
- package/src/task/executor.ts +70 -20
- package/src/task/index.ts +30 -34
- package/src/task/isolation-runner.ts +24 -11
- package/src/task/persisted-revive.ts +12 -5
- package/src/task/read-only-policy.ts +27 -0
- package/src/task/structured-subagent.ts +14 -4
- package/src/task/types.ts +4 -0
- package/src/tools/auto-generated-guard.ts +1 -1
- package/src/tools/bash-interactive.ts +4 -4
- package/src/tools/bash-skill-urls.ts +15 -0
- package/src/tools/bash.ts +16 -17
- package/src/tools/browser/cmux/cmux-tab.ts +66 -18
- package/src/tools/browser/launch.ts +41 -12
- package/src/tools/browser/readable.ts +9 -9
- package/src/tools/browser/tab-supervisor.ts +12 -3
- package/src/tools/browser/tab-worker-entry.ts +1 -1
- package/src/tools/browser/tab-worker.ts +101 -12
- package/src/tools/debug.ts +1 -1
- package/src/tools/fetch.ts +1 -1
- package/src/tools/jtd-to-json-schema.ts +123 -21
- package/src/tools/path-utils.ts +9 -2
- package/src/tools/read.ts +21 -9
- package/src/tools/run-scope.ts +290 -4
- package/src/tools/shell-tokenize.ts +98 -0
- package/src/tools/terminal-output.ts +1 -1
- package/src/tools/todo.ts +1 -1
- package/src/utils/clipboard.ts +10 -2
- package/src/utils/external-editor.ts +4 -2
- package/src/utils/jj.ts +1 -1
- package/src/utils/turndown.ts +1 -2
- package/src/vibe/runtime.ts +5 -5
- package/src/web/scrapers/arxiv.ts +1 -1
- package/src/web/scrapers/go-pkg.ts +1 -1
- package/src/web/scrapers/iacr.ts +1 -1
- package/src/web/scrapers/readthedocs.ts +2 -1
- package/src/web/scrapers/twitter.ts +2 -2
- package/src/web/scrapers/types.ts +1 -1
- package/src/web/scrapers/wikipedia.ts +1 -1
- package/src/web/search/providers/browser-headers.ts +12 -39
- package/src/web/search/providers/codex.ts +3 -26
- package/src/web/search/providers/ecosia.ts +1 -1
- package/src/web/search/providers/exa.ts +1 -1
- package/src/web/search/providers/google.ts +1 -1
- package/src/web/search/providers/mojeek.ts +1 -1
- package/src/web/search/providers/startpage.ts +1 -1
- package/src/markit/converters/mammoth.d.ts +0 -24
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import { HeaderGenerator } from "
|
|
1
|
+
import { HeaderGenerator } from "@oh-my-pi/pi-utils/headers";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
generator ??= new HeaderGenerator({
|
|
13
|
-
browserListQuery: "last 3 versions",
|
|
14
|
-
devices: ["desktop"],
|
|
15
|
-
operatingSystems: ["windows", "macos", "linux"],
|
|
16
|
-
locales: ["en-US", "en"],
|
|
17
|
-
httpVersion: "2",
|
|
18
|
-
strict: false,
|
|
19
|
-
});
|
|
20
|
-
return generator;
|
|
21
|
-
} catch {
|
|
22
|
-
generatorUnavailable = true;
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
3
|
+
const generator = new HeaderGenerator({
|
|
4
|
+
browserListQuery: "last 3 versions",
|
|
5
|
+
devices: ["desktop"],
|
|
6
|
+
operatingSystems: ["windows", "macos", "linux"],
|
|
7
|
+
locales: ["en-US", "en"],
|
|
8
|
+
httpVersion: "2",
|
|
9
|
+
strict: false,
|
|
10
|
+
});
|
|
26
11
|
|
|
27
12
|
// A fallback desktop Mac Chrome navigation fingerprint matching
|
|
28
13
|
// the previous static default setup for deterministic or non-randomized calls.
|
|
@@ -84,9 +69,8 @@ function canonicalizeHeaderNames(headers: Record<string, string>): Record<string
|
|
|
84
69
|
|
|
85
70
|
/**
|
|
86
71
|
* Build a fresh, internally consistent desktop navigation fingerprint for one HTTP request.
|
|
87
|
-
* By default, this randomizes across
|
|
88
|
-
*
|
|
89
|
-
* stable Mac Chrome identity.
|
|
72
|
+
* By default, this randomizes across coherent modern Chrome, Firefox, and Safari profiles.
|
|
73
|
+
* Set `randomized` to `false` when a fetch must preserve a stable Mac Chrome identity.
|
|
90
74
|
*/
|
|
91
75
|
export function buildBrowserNavigationHeaders(options?: { randomized?: boolean }): Record<string, string> {
|
|
92
76
|
const randomized = options?.randomized !== false;
|
|
@@ -94,16 +78,5 @@ export function buildBrowserNavigationHeaders(options?: { randomized?: boolean }
|
|
|
94
78
|
return { ...CHROME_FALLBACK_HEADERS };
|
|
95
79
|
}
|
|
96
80
|
|
|
97
|
-
|
|
98
|
-
if (!generator) {
|
|
99
|
-
return { ...CHROME_FALLBACK_HEADERS };
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
try {
|
|
103
|
-
// Generate realistic, consistent headers with the Bayesian generator
|
|
104
|
-
return canonicalizeHeaderNames(generator.getHeaders());
|
|
105
|
-
} catch {
|
|
106
|
-
// Gracefully recover to the robust default profile on unexpected generator errors
|
|
107
|
-
return { ...CHROME_FALLBACK_HEADERS };
|
|
108
|
-
}
|
|
81
|
+
return canonicalizeHeaderNames(generator.getHeaders());
|
|
109
82
|
}
|
|
@@ -13,11 +13,7 @@ import {
|
|
|
13
13
|
withAuth,
|
|
14
14
|
withOAuthAccess,
|
|
15
15
|
} from "@oh-my-pi/pi-ai";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
createOpenAICodexCompatibilityMetadata,
|
|
19
|
-
resolveCodexResponsesUrl,
|
|
20
|
-
} from "@oh-my-pi/pi-ai/providers/openai-codex-responses";
|
|
16
|
+
import { resolveCodexResponsesUrl } from "@oh-my-pi/pi-ai/providers/openai-codex-responses";
|
|
21
17
|
import { getBundledModels } from "@oh-my-pi/pi-catalog/models";
|
|
22
18
|
import {
|
|
23
19
|
CODEX_BASE_URL,
|
|
@@ -447,7 +443,6 @@ async function callCodexSearch(
|
|
|
447
443
|
systemPrompt?: string;
|
|
448
444
|
searchContextSize?: "low" | "medium" | "high";
|
|
449
445
|
model: CodexModelCandidate;
|
|
450
|
-
sessionId?: string;
|
|
451
446
|
fetch?: FetchImpl;
|
|
452
447
|
transport: CodexSearchTransport;
|
|
453
448
|
},
|
|
@@ -455,7 +450,6 @@ async function callCodexSearch(
|
|
|
455
450
|
const headers = buildCodexHeaders(auth.accessToken, auth.accountId, options.transport.headers);
|
|
456
451
|
|
|
457
452
|
const requestedModel = options.model.modelId;
|
|
458
|
-
const usesResponsesLite = options.model.catalogModel?.useResponsesLite === true;
|
|
459
453
|
|
|
460
454
|
const body: Record<string, unknown> = {
|
|
461
455
|
model: requestedModel,
|
|
@@ -477,21 +471,6 @@ async function callCodexSearch(
|
|
|
477
471
|
tool_choice: { type: "web_search" },
|
|
478
472
|
instructions: options.systemPrompt ?? DEFAULT_INSTRUCTIONS,
|
|
479
473
|
};
|
|
480
|
-
if (usesResponsesLite) {
|
|
481
|
-
const metadata = createOpenAICodexCompatibilityMetadata({
|
|
482
|
-
sessionId: options.sessionId,
|
|
483
|
-
requestKind: "turn",
|
|
484
|
-
startNewTurn: true,
|
|
485
|
-
});
|
|
486
|
-
for (const name in metadata.headers) {
|
|
487
|
-
const value = metadata.headers[name];
|
|
488
|
-
if (value !== undefined) headers.set(name, value);
|
|
489
|
-
}
|
|
490
|
-
headers.set(OPENAI_HEADERS.RESPONSES_LITE, "true");
|
|
491
|
-
body.client_metadata = metadata.clientMetadata;
|
|
492
|
-
body.reasoning = { context: "all_turns" };
|
|
493
|
-
applyCodexResponsesLiteShape(body);
|
|
494
|
-
}
|
|
495
474
|
|
|
496
475
|
const fetchImpl = options.fetch ?? fetch;
|
|
497
476
|
const response = await fetchImpl(options.transport.url, {
|
|
@@ -519,9 +498,8 @@ async function callCodexSearch(
|
|
|
519
498
|
let model = requestedModel;
|
|
520
499
|
let requestId = "";
|
|
521
500
|
let usage: { inputTokens: number; outputTokens: number; totalTokens: number } | undefined;
|
|
522
|
-
//
|
|
523
|
-
//
|
|
524
|
-
// command must reject that rather than return a non-search completion.
|
|
501
|
+
// A search command must reject a completion that did not invoke the hosted
|
|
502
|
+
// tool rather than returning an answer from the model's own knowledge (#6988).
|
|
525
503
|
let webSearchInvoked = false;
|
|
526
504
|
|
|
527
505
|
for await (const rawEvent of readSseJson<Record<string, unknown>>(response.body, options.signal)) {
|
|
@@ -651,7 +629,6 @@ async function runCodexSearchCandidates(options: {
|
|
|
651
629
|
systemPrompt: options.params.systemPrompt,
|
|
652
630
|
searchContextSize: "high",
|
|
653
631
|
model: candidate,
|
|
654
|
-
sessionId: options.params.sessionId,
|
|
655
632
|
fetch: options.params.fetch,
|
|
656
633
|
transport: options.transport,
|
|
657
634
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
2
|
-
import { parseHTML } from "
|
|
2
|
+
import { parseHTML } from "@oh-my-pi/pi-utils/dom";
|
|
3
3
|
import type { SearchResponse, SearchSource } from "../../../web/search/types";
|
|
4
4
|
import { SearchProviderError } from "../../../web/search/types";
|
|
5
5
|
import { formatScraperQuery } from "../query";
|
|
@@ -464,7 +464,7 @@ export class ExaProvider extends SearchProvider {
|
|
|
464
464
|
|
|
465
465
|
#settingsAllowSearch(): boolean {
|
|
466
466
|
try {
|
|
467
|
-
if (settings.get("exa.enabled") === false
|
|
467
|
+
if (settings.get("exa.enabled") === false) {
|
|
468
468
|
return false;
|
|
469
469
|
}
|
|
470
470
|
} catch {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
2
|
-
import { parseHTML } from "
|
|
2
|
+
import { type Element, parseHTML } from "@oh-my-pi/pi-utils/dom";
|
|
3
3
|
import type { SearchResponse, SearchSource } from "../../../web/search/types";
|
|
4
4
|
import { SearchProviderError } from "../../../web/search/types";
|
|
5
5
|
import { formatScraperQuery } from "../query";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthStorage } from "@oh-my-pi/pi-ai";
|
|
2
2
|
import { untilAborted } from "@oh-my-pi/pi-utils";
|
|
3
|
-
import { parseHTML } from "
|
|
3
|
+
import { parseHTML } from "@oh-my-pi/pi-utils/dom";
|
|
4
4
|
import type { Page } from "puppeteer-core";
|
|
5
5
|
import type { SearchResponse, SearchSource } from "../../../web/search/types";
|
|
6
6
|
import { SearchProviderError } from "../../../web/search/types";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthStorage, FetchImpl } from "@oh-my-pi/pi-ai";
|
|
2
|
-
import { parseHTML } from "
|
|
2
|
+
import { parseHTML } from "@oh-my-pi/pi-utils/dom";
|
|
3
3
|
import type { SearchResponse, SearchSource } from "../../../web/search/types";
|
|
4
4
|
import { SearchProviderError } from "../../../web/search/types";
|
|
5
5
|
import { formatScraperQuery } from "../query";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Minimal ambient types for `mammoth` (ships no types). Declares only what
|
|
2
|
-
// DocxConverter uses. See ../NOTICE.
|
|
3
|
-
declare module "mammoth" {
|
|
4
|
-
interface MammothImage {
|
|
5
|
-
contentType?: string;
|
|
6
|
-
read(encoding: "base64"): Promise<string>;
|
|
7
|
-
}
|
|
8
|
-
interface ImgAttributes {
|
|
9
|
-
src: string;
|
|
10
|
-
alt?: string;
|
|
11
|
-
}
|
|
12
|
-
type ConvertImageHandler = (image: MammothImage) => Promise<ImgAttributes>;
|
|
13
|
-
interface ConvertOptions {
|
|
14
|
-
convertImage?: ConvertImageHandler;
|
|
15
|
-
}
|
|
16
|
-
interface ConvertResult {
|
|
17
|
-
value: string;
|
|
18
|
-
messages: unknown[];
|
|
19
|
-
}
|
|
20
|
-
export const images: { imgElement(fn: ConvertImageHandler): ConvertImageHandler };
|
|
21
|
-
export function convertToHtml(input: { buffer: Buffer }, options?: ConvertOptions): Promise<ConvertResult>;
|
|
22
|
-
const _default: { convertToHtml: typeof convertToHtml; images: typeof images };
|
|
23
|
-
export default _default;
|
|
24
|
-
}
|