@oh-my-pi/pi-coding-agent 17.3.3 → 17.3.5
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 +81 -0
- package/dist/{CHANGELOG-s5t1xdmy.md → CHANGELOG-tt9k4jpr.md} +81 -0
- package/dist/cli.js +3724 -3705
- package/dist/docs-index.generated.txt +1 -1
- package/dist/types/config/model-discovery.d.ts +2 -0
- package/dist/types/config/model-registry.d.ts +6 -1
- package/dist/types/config/settings-schema.d.ts +10 -0
- package/dist/types/debug/report-bundle.d.ts +7 -2
- package/dist/types/extensibility/extensions/loader.d.ts +2 -0
- package/dist/types/extensibility/extensions/runner.d.ts +3 -3
- package/dist/types/extensibility/extensions/types.d.ts +2 -0
- package/dist/types/extensibility/legacy-pi-ai-shim.d.ts +4 -0
- package/dist/types/launch/presence.d.ts +11 -0
- package/dist/types/lsp/client.d.ts +22 -0
- package/dist/types/lsp/workspace-diagnostics.d.ts +2 -0
- package/dist/types/markit/converters/pdf/index.d.ts +2 -1
- package/dist/types/mcp/config.d.ts +3 -1
- package/dist/types/modes/components/tool-execution.d.ts +3 -1
- package/dist/types/registry/agent-lifecycle.d.ts +11 -0
- package/dist/types/registry/agent-registry.d.ts +4 -0
- package/dist/types/session/agent-session-types.d.ts +0 -2
- package/dist/types/session/agent-session.d.ts +20 -0
- package/dist/types/session/date-cwd-reminder.d.ts +22 -0
- package/dist/types/session/irc-bridge.d.ts +2 -0
- package/dist/types/session/messages.d.ts +4 -0
- package/dist/types/session/session-loader.d.ts +18 -11
- package/dist/types/session/session-maintenance.d.ts +6 -2
- package/dist/types/session/session-manager.d.ts +19 -3
- package/dist/types/session/session-tools.d.ts +0 -1
- package/dist/types/session/turn-recovery.d.ts +7 -7
- package/dist/types/tools/browser/attach.d.ts +16 -0
- package/dist/types/tools/browser/launch.d.ts +2 -2
- package/dist/types/tools/browser.d.ts +1 -1
- package/dist/types/tools/builtin-names.d.ts +1 -1
- package/dist/types/tools/hub/jobs.d.ts +6 -0
- package/dist/types/tools/hub/types.d.ts +6 -0
- package/dist/types/tools/read-pdf.d.ts +15 -0
- package/dist/types/utils/external-editor.d.ts +7 -0
- package/dist/types/utils/markit.d.ts +3 -4
- package/dist/types/vibe/runtime.d.ts +3 -3
- package/package.json +13 -16
- package/scripts/build-binary.ts +0 -2
- package/scripts/bundle-dist.ts +0 -1
- package/src/auto-thinking/classifier.ts +37 -23
- package/src/cli/models-cli.ts +1 -1
- package/src/cli/read-cli.ts +2 -0
- package/src/commit/analysis/conventional.ts +15 -9
- package/src/commit/analysis/summary.ts +15 -9
- package/src/commit/changelog/generate.ts +15 -9
- package/src/commit/map-reduce/map-phase.ts +3 -19
- package/src/commit/map-reduce/reduce-phase.ts +15 -9
- package/src/config/model-discovery.ts +3 -3
- package/src/config/model-registry.ts +29 -16
- package/src/config/settings-schema.ts +13 -0
- package/src/debug/report-bundle.ts +25 -59
- package/src/discovery/claude-plugins.ts +2 -1
- package/src/discovery/claude.ts +4 -2
- package/src/discovery/helpers.ts +5 -0
- package/src/edit/renderer.ts +48 -19
- package/src/extensibility/extensions/loader.ts +9 -5
- package/src/extensibility/extensions/runner.ts +124 -21
- package/src/extensibility/extensions/types.ts +2 -0
- package/src/extensibility/extensions/wrapper.ts +16 -10
- package/src/extensibility/legacy-pi-ai-shim.ts +4 -0
- package/src/extensibility/plugins/marketplace/manager.ts +15 -18
- package/src/irc/bus.ts +1 -1
- package/src/launch/broker.ts +8 -1
- package/src/launch/presence.ts +77 -1
- package/src/lsp/client.ts +35 -3
- package/src/lsp/clients/biome-client.ts +47 -93
- package/src/lsp/servers.ts +17 -11
- package/src/lsp/tool.ts +2 -4
- package/src/lsp/workspace-diagnostics.ts +24 -2
- package/src/markit/NOTICE +8 -8
- package/src/markit/converters/pdf/index.ts +14 -126
- package/src/mcp/client.ts +8 -9
- package/src/mcp/config.ts +50 -6
- package/src/memories/index.ts +29 -25
- package/src/mnemopi/backend.ts +13 -11
- package/src/modes/components/ask-dialog.ts +25 -5
- package/src/modes/components/tool-execution.ts +10 -6
- package/src/modes/components/welcome.ts +4 -1
- package/src/modes/controllers/extension-ui-controller.ts +52 -32
- package/src/modes/controllers/selector-controller.ts +6 -0
- package/src/modes/controllers/tan-command-controller.ts +1 -0
- package/src/modes/interactive-mode.ts +49 -10
- package/src/modes/rpc/rpc-client.ts +7 -0
- package/src/modes/theme/defaults/birch.json +2 -2
- package/src/modes/utils/hotkeys-markdown.ts +1 -1
- package/src/prompts/system/checkpoint-active-notice.md +5 -0
- package/src/prompts/system/date-cwd-reminder.md +3 -0
- package/src/prompts/system/project-prompt.md +0 -1
- package/src/prompts/system/rewind-report.md +1 -3
- package/src/prompts/tools/browser.md +1 -0
- package/src/prompts/tools/rewind.md +1 -13
- package/src/registry/agent-lifecycle.ts +34 -0
- package/src/registry/agent-registry.ts +27 -2
- package/src/registry/persisted-agents.ts +40 -20
- package/src/sdk.ts +32 -2
- package/src/session/agent-session-types.ts +0 -2
- package/src/session/agent-session.ts +178 -46
- package/src/session/date-cwd-reminder.ts +77 -0
- package/src/session/irc-bridge.ts +5 -0
- package/src/session/messages.ts +5 -1
- package/src/session/session-loader.ts +106 -64
- package/src/session/session-maintenance.ts +189 -115
- package/src/session/session-manager.ts +142 -35
- package/src/session/session-persistence.ts +4 -4
- package/src/session/session-storage.ts +18 -5
- package/src/session/session-tools.ts +5 -10
- package/src/session/turn-recovery.ts +102 -20
- package/src/session/unexpected-stop-classifier.ts +33 -21
- package/src/system-prompt.ts +0 -5
- package/src/task/executor.ts +4 -15
- package/src/task/persisted-revive.ts +3 -6
- package/src/tools/ask.ts +10 -3
- package/src/tools/browser/attach.ts +80 -25
- package/src/tools/browser/launch.ts +44 -15
- package/src/tools/browser/relay/daemon.ts +3 -7
- package/src/tools/browser/render.ts +1 -1
- package/src/tools/browser/shared-daemon.ts +3 -7
- package/src/tools/browser.ts +5 -5
- package/src/tools/builtin-names.ts +7 -3
- package/src/tools/checkpoint.ts +1 -7
- package/src/tools/hub/index.ts +1 -1
- package/src/tools/hub/jobs.ts +20 -3
- package/src/tools/hub/types.ts +6 -0
- package/src/tools/read-pdf.ts +135 -0
- package/src/tools/read.ts +63 -37
- package/src/tools/render-utils.ts +53 -21
- package/src/tools/think.ts +15 -3
- package/src/tts/speech-enhancer.ts +19 -14
- package/src/utils/commit-message-generator.ts +14 -12
- package/src/utils/external-editor.ts +24 -5
- package/src/utils/markit.ts +6 -44
- package/src/utils/title-generator.ts +23 -19
- package/src/vibe/runtime.ts +32 -17
- package/dist/types/markit/converters/pdf/columns.d.ts +0 -35
- package/dist/types/markit/converters/pdf/extract.d.ts +0 -10
- package/dist/types/markit/converters/pdf/grid.d.ts +0 -25
- package/dist/types/markit/converters/pdf/headers.d.ts +0 -24
- package/dist/types/markit/converters/pdf/render.d.ts +0 -24
- package/dist/types/markit/converters/pdf/types.d.ts +0 -75
- package/dist/types/tools/read-pdf-images.d.ts +0 -12
- package/dist/types/utils/mupdf-wasm-embed.d.ts +0 -1
- package/scripts/embed-mupdf-wasm.ts +0 -67
- package/src/markit/converters/pdf/columns.ts +0 -103
- package/src/markit/converters/pdf/extract.ts +0 -598
- package/src/markit/converters/pdf/grid.ts +0 -780
- package/src/markit/converters/pdf/headers.ts +0 -106
- package/src/markit/converters/pdf/render.ts +0 -501
- package/src/markit/converters/pdf/types.ts +0 -84
- package/src/tools/read-pdf-images.ts +0 -250
- package/src/utils/mupdf-wasm-embed.ts +0 -12
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import * as fs from "node:fs/promises";
|
|
2
|
-
import * as os from "node:os";
|
|
3
|
-
import * as path from "node:path";
|
|
4
|
-
import type { AgentToolResult } from "@oh-my-pi/pi-agent-core";
|
|
5
|
-
import { isEexist, isEnotempty, readImageMetadata, untilAborted } from "@oh-my-pi/pi-utils";
|
|
6
|
-
import type { ToolSession } from "../sdk";
|
|
7
|
-
import { loadImageInput, MAX_IMAGE_INPUT_BYTES, webpExclusionForModel } from "../utils/image-loading";
|
|
8
|
-
import { convertFileWithMarkit } from "../utils/markit";
|
|
9
|
-
import type { ReadToolDetails } from "./read";
|
|
10
|
-
import { prependSuffixResolutionNotice } from "./read-format";
|
|
11
|
-
import { isNotFoundError } from "./read-path-resolution";
|
|
12
|
-
import { formatBytes } from "./render-utils";
|
|
13
|
-
import { ToolError } from "./tool-errors";
|
|
14
|
-
import { toolResult } from "./tool-result";
|
|
15
|
-
|
|
16
|
-
const MAX_IMAGE_SIZE = MAX_IMAGE_INPUT_BYTES;
|
|
17
|
-
|
|
18
|
-
const PDF_IMAGE_PLACEHOLDER_RE = /<!--\s*image:\s*([^\s<>]+)(.*?)-->/g;
|
|
19
|
-
const PDF_IMAGE_MEMBER_RE = /^(.*\.pdf):(.*)$/i;
|
|
20
|
-
const PDF_IMAGE_MEMBER_EXTENSION_RE = /\.png$/i;
|
|
21
|
-
const PDF_IMAGE_CACHE_BASENAME_MAX_LENGTH = 96;
|
|
22
|
-
|
|
23
|
-
interface PdfImageSnapshot {
|
|
24
|
-
directory: string;
|
|
25
|
-
filePath: string;
|
|
26
|
-
digest: string;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface PdfImageExtraction {
|
|
30
|
-
controller: AbortController;
|
|
31
|
-
promise: Promise<string>;
|
|
32
|
-
settled: boolean;
|
|
33
|
-
waiters: number;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const pdfImageExtractions = new Map<string, PdfImageExtraction>();
|
|
37
|
-
|
|
38
|
-
function pdfImageMemberPath(pdfPath: string, imageId: string): string {
|
|
39
|
-
const member = PDF_IMAGE_MEMBER_EXTENSION_RE.test(imageId) ? imageId : `${imageId}.png`;
|
|
40
|
-
return `${pdfPath}:${member}`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function rewritePdfImagePlaceholders(markdown: string, pdfPath: string): string {
|
|
44
|
-
return markdown.replace(PDF_IMAGE_PLACEHOLDER_RE, (_match: string, imageId: string, metadataText: string) => {
|
|
45
|
-
const metadata = metadataText.trim();
|
|
46
|
-
const suffix = metadata.length > 0 ? ` (${metadata})` : "";
|
|
47
|
-
return `Image ${imageId}${suffix}: read \`${pdfImageMemberPath(pdfPath, imageId)}\``;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function splitPdfImageMemberReadPath(readPath: string): { pdfPath: string; member: string } | null {
|
|
52
|
-
const match = PDF_IMAGE_MEMBER_RE.exec(readPath);
|
|
53
|
-
if (!match) return null;
|
|
54
|
-
const pdfPath = match[1];
|
|
55
|
-
const member = match[2];
|
|
56
|
-
if (pdfPath === undefined || member === undefined) return null;
|
|
57
|
-
if (member.length !== 0 && !PDF_IMAGE_MEMBER_EXTENSION_RE.test(member)) return null;
|
|
58
|
-
return { pdfPath, member };
|
|
59
|
-
}
|
|
60
|
-
function pdfImageCacheDir(session: ToolSession, absolutePdfPath: string, contentDigest: string): string {
|
|
61
|
-
const artifactsDir = session.getArtifactsDir?.();
|
|
62
|
-
let root = artifactsDir ?? undefined;
|
|
63
|
-
if (root === undefined) {
|
|
64
|
-
const sessionFile = session.getSessionFile();
|
|
65
|
-
root = sessionFile?.endsWith(".jsonl") ? sessionFile.slice(0, -6) : path.join(os.tmpdir(), "omp-read-pdf-images");
|
|
66
|
-
}
|
|
67
|
-
const basename = path
|
|
68
|
-
.basename(absolutePdfPath)
|
|
69
|
-
.replace(/[^A-Za-z0-9._-]/g, "_")
|
|
70
|
-
.slice(0, PDF_IMAGE_CACHE_BASENAME_MAX_LENGTH);
|
|
71
|
-
const pathDigest = Bun.hash(absolutePdfPath).toString(36);
|
|
72
|
-
return path.join(root, "read-pdf-images", `${basename}-${pathDigest}-${contentDigest}`);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
async function snapshotPdfSource(absolutePdfPath: string, signal?: AbortSignal): Promise<PdfImageSnapshot> {
|
|
76
|
-
const directory = await fs.mkdtemp(path.join(os.tmpdir(), "omp-read-pdf-"));
|
|
77
|
-
try {
|
|
78
|
-
const bytes = await untilAborted(signal, () => Bun.file(absolutePdfPath).bytes());
|
|
79
|
-
signal?.throwIfAborted();
|
|
80
|
-
const digest = new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
81
|
-
const filePath = path.join(directory, "source.pdf");
|
|
82
|
-
await Bun.write(filePath, bytes);
|
|
83
|
-
signal?.throwIfAborted();
|
|
84
|
-
return { directory, filePath, digest };
|
|
85
|
-
} catch (error) {
|
|
86
|
-
await fs.rm(directory, { recursive: true, force: true });
|
|
87
|
-
throw error;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
async function listPdfImageMembers(imageDir: string): Promise<string[]> {
|
|
92
|
-
try {
|
|
93
|
-
const entries = await fs.readdir(imageDir, { withFileTypes: true });
|
|
94
|
-
const members: string[] = [];
|
|
95
|
-
for (const entry of entries) {
|
|
96
|
-
if (entry.isFile() && PDF_IMAGE_MEMBER_EXTENSION_RE.test(entry.name)) members.push(entry.name);
|
|
97
|
-
}
|
|
98
|
-
return members.sort();
|
|
99
|
-
} catch (error) {
|
|
100
|
-
if (isNotFoundError(error)) return [];
|
|
101
|
-
throw error;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
async function extractPdfImages(snapshot: PdfImageSnapshot, imageDir: string, signal: AbortSignal): Promise<string> {
|
|
106
|
-
const markerPath = path.join(imageDir, ".extracted");
|
|
107
|
-
try {
|
|
108
|
-
await fs.stat(markerPath);
|
|
109
|
-
return imageDir;
|
|
110
|
-
} catch (error) {
|
|
111
|
-
if (!isNotFoundError(error)) throw error;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
await fs.mkdir(path.dirname(imageDir), { recursive: true });
|
|
115
|
-
const stagingDir = await fs.mkdtemp(`${imageDir}.tmp-`);
|
|
116
|
-
let published = false;
|
|
117
|
-
try {
|
|
118
|
-
const result = await convertFileWithMarkit(snapshot.filePath, signal, { imageDir: stagingDir });
|
|
119
|
-
if (!result.ok) {
|
|
120
|
-
throw new ToolError(`Cannot extract images from PDF: ${result.error ?? "conversion failed"}`);
|
|
121
|
-
}
|
|
122
|
-
await Bun.write(path.join(stagingDir, ".extracted"), "ok");
|
|
123
|
-
try {
|
|
124
|
-
await fs.rename(stagingDir, imageDir);
|
|
125
|
-
published = true;
|
|
126
|
-
} catch (error) {
|
|
127
|
-
if (!isEexist(error) && !isEnotempty(error)) throw error;
|
|
128
|
-
try {
|
|
129
|
-
await fs.stat(markerPath);
|
|
130
|
-
} catch (markerError) {
|
|
131
|
-
if (isNotFoundError(markerError)) throw error;
|
|
132
|
-
throw markerError;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
return imageDir;
|
|
136
|
-
} finally {
|
|
137
|
-
if (!published) await fs.rm(stagingDir, { recursive: true, force: true });
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
function createPdfImageExtraction(snapshot: PdfImageSnapshot, imageDir: string): PdfImageExtraction {
|
|
142
|
-
const controller = new AbortController();
|
|
143
|
-
const promise = extractPdfImages(snapshot, imageDir, controller.signal).finally(() =>
|
|
144
|
-
fs.rm(snapshot.directory, { recursive: true, force: true }),
|
|
145
|
-
);
|
|
146
|
-
const extraction: PdfImageExtraction = { controller, promise, settled: false, waiters: 0 };
|
|
147
|
-
const settle = () => {
|
|
148
|
-
extraction.settled = true;
|
|
149
|
-
if (pdfImageExtractions.get(imageDir) === extraction) pdfImageExtractions.delete(imageDir);
|
|
150
|
-
};
|
|
151
|
-
void promise.then(settle, settle);
|
|
152
|
-
return extraction;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
async function waitForPdfImageExtraction(
|
|
156
|
-
extraction: PdfImageExtraction,
|
|
157
|
-
signal: AbortSignal | undefined,
|
|
158
|
-
): Promise<string> {
|
|
159
|
-
extraction.waiters++;
|
|
160
|
-
try {
|
|
161
|
-
return await untilAborted(signal, extraction.promise);
|
|
162
|
-
} finally {
|
|
163
|
-
extraction.waiters--;
|
|
164
|
-
if (extraction.waiters === 0 && !extraction.settled) {
|
|
165
|
-
extraction.controller.abort();
|
|
166
|
-
try {
|
|
167
|
-
await extraction.promise;
|
|
168
|
-
} catch {}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
async function ensurePdfImageCache(
|
|
174
|
-
session: ToolSession,
|
|
175
|
-
absolutePdfPath: string,
|
|
176
|
-
signal?: AbortSignal,
|
|
177
|
-
): Promise<string> {
|
|
178
|
-
const snapshot = await snapshotPdfSource(absolutePdfPath, signal);
|
|
179
|
-
const imageDir = pdfImageCacheDir(session, absolutePdfPath, snapshot.digest);
|
|
180
|
-
const existing = pdfImageExtractions.get(imageDir);
|
|
181
|
-
if (existing && !existing.settled && !existing.controller.signal.aborted) {
|
|
182
|
-
await fs.rm(snapshot.directory, { recursive: true, force: true });
|
|
183
|
-
return waitForPdfImageExtraction(existing, signal);
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
const extraction = createPdfImageExtraction(snapshot, imageDir);
|
|
187
|
-
pdfImageExtractions.set(imageDir, extraction);
|
|
188
|
-
return waitForPdfImageExtraction(extraction, signal);
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
export async function readPdfImageMember(
|
|
192
|
-
session: ToolSession,
|
|
193
|
-
autoResizeImages: boolean,
|
|
194
|
-
absolutePdfPath: string,
|
|
195
|
-
pdfDisplayPath: string,
|
|
196
|
-
member: string,
|
|
197
|
-
suffixResolution: { from: string; to: string } | undefined,
|
|
198
|
-
signal?: AbortSignal,
|
|
199
|
-
): Promise<AgentToolResult<ReadToolDetails>> {
|
|
200
|
-
const imageDir = await ensurePdfImageCache(session, absolutePdfPath, signal);
|
|
201
|
-
const members = await listPdfImageMembers(imageDir);
|
|
202
|
-
if (member.length === 0) {
|
|
203
|
-
const text =
|
|
204
|
-
members.length === 0
|
|
205
|
-
? "No extractable PDF image members found."
|
|
206
|
-
: `Extractable PDF image members:\n${members
|
|
207
|
-
.map(imageMember => `- read \`${pdfDisplayPath}:${imageMember}\``)
|
|
208
|
-
.join("\n")}`;
|
|
209
|
-
return toolResult<ReadToolDetails>({ resolvedPath: absolutePdfPath, suffixResolution })
|
|
210
|
-
.text(prependSuffixResolutionNotice(text, suffixResolution))
|
|
211
|
-
.sourcePath(absolutePdfPath)
|
|
212
|
-
.done();
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if (!members.includes(member)) {
|
|
216
|
-
const available = members.length === 0 ? "(none)" : members.join(", ");
|
|
217
|
-
throw new ToolError(`PDF image member '${member}' not found. Available members: ${available}`);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
const imagePath = path.join(imageDir, member);
|
|
221
|
-
const imageStat = await Bun.file(imagePath).stat();
|
|
222
|
-
if (imageStat.size > MAX_IMAGE_SIZE) {
|
|
223
|
-
const sizeStr = formatBytes(imageStat.size);
|
|
224
|
-
const maxStr = formatBytes(MAX_IMAGE_SIZE);
|
|
225
|
-
throw new ToolError(`Image file too large: ${sizeStr} exceeds ${maxStr} limit.`);
|
|
226
|
-
}
|
|
227
|
-
const metadata = await readImageMetadata(imagePath);
|
|
228
|
-
const mimeType = metadata?.mimeType;
|
|
229
|
-
if (!mimeType) throw new ToolError(`PDF image member '${member}' is not a supported image.`);
|
|
230
|
-
const imageInput = await loadImageInput({
|
|
231
|
-
path: `${pdfDisplayPath}:${member}`,
|
|
232
|
-
cwd: session.cwd,
|
|
233
|
-
autoResize: autoResizeImages,
|
|
234
|
-
maxBytes: MAX_IMAGE_SIZE,
|
|
235
|
-
resolvedPath: imagePath,
|
|
236
|
-
detectedMimeType: mimeType,
|
|
237
|
-
excludeWebP: webpExclusionForModel(session.getActiveModel?.()),
|
|
238
|
-
});
|
|
239
|
-
if (!imageInput) {
|
|
240
|
-
throw new ToolError(`Read image file [${mimeType}] failed: unsupported image format.`);
|
|
241
|
-
}
|
|
242
|
-
const textNote = prependSuffixResolutionNotice(imageInput.textNote, suffixResolution);
|
|
243
|
-
return toolResult<ReadToolDetails>({ resolvedPath: absolutePdfPath, suffixResolution })
|
|
244
|
-
.content([
|
|
245
|
-
{ type: "text", text: textNote },
|
|
246
|
-
{ type: "image", data: imageInput.data, mimeType: imageInput.mimeType },
|
|
247
|
-
])
|
|
248
|
-
.sourcePath(imageInput.resolvedPath)
|
|
249
|
-
.done();
|
|
250
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// AUTOGENERATED -- managed by scripts/embed-mupdf-wasm.ts. Do not edit by hand.
|
|
2
|
-
//
|
|
3
|
-
// Compiled single-file binaries cannot let mupdf resolve its `mupdf-wasm.wasm`
|
|
4
|
-
// sibling from the read-only bunfs, so the binary build (scripts/build-binary.ts
|
|
5
|
-
// and scripts/ci-release-build-binaries.ts) regenerates this module to embed the
|
|
6
|
-
// wasm bytes via `with { type: "file" }` and copies the wasm next to it. Source
|
|
7
|
-
// checkouts, `bun test`, and the npm `dist/cli.js` bundle keep mupdf external and
|
|
8
|
-
// load the wasm from node_modules, so this placeholder returns undefined and the
|
|
9
|
-
// build resets back to it afterward.
|
|
10
|
-
export function loadEmbeddedMupdfWasm(): Uint8Array | undefined {
|
|
11
|
-
return undefined;
|
|
12
|
-
}
|