dsh-pdf-mineru 0.0.9 → 0.0.10

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.10
4
+
5
+ ### Fixed
6
+
7
+ - Guarded `shouldInline` in `read_pdf` to only activate when `focus` includes the image modality, preventing inline image emission for non-image focus modes (`toc`, `text`, `table`).
8
+ - Prevented `inlineImagesForSingleResult` from falling back to full document scanning when `ordered_images` for candidate pages is empty, adding comprehensive regression tests for per-page image isolation.
9
+
3
10
  ## 0.0.9
4
11
 
5
12
  ### Added
package/lib/index.js CHANGED
@@ -6691,7 +6691,7 @@ async function collectImageCandidates(view) {
6691
6691
  }
6692
6692
  async function inlineImagesForSingleResult(view, attachments, signal) {
6693
6693
  let candidates = [];
6694
- if (view.ordered_images && view.ordered_images.length > 0) candidates = view.ordered_images.map((img) => ({
6694
+ if (view.ordered_images !== void 0) candidates = view.ordered_images.map((img) => ({
6695
6695
  path: img.path,
6696
6696
  bytes: img.bytes,
6697
6697
  name: img.name,
@@ -6886,7 +6886,9 @@ function registerTools(ctx, getService, accessGate) {
6886
6886
  const { input, pollTimeoutMs, inline_images } = parseReadInput(args);
6887
6887
  const supportsImage = await checkCallingModelSupportsImage(exec, ctx);
6888
6888
  const attachments = ctx.get("attachments");
6889
- const shouldInline = inline_images !== false && supportsImage && attachments !== void 0;
6889
+ const focusSet = normalizeFocusSelection(input.focus);
6890
+ const focusIncludesImages = focusSet.has("all") || focusSet.has("image");
6891
+ const shouldInline = inline_images !== false && focusIncludesImages && supportsImage && attachments !== void 0;
6890
6892
  const rawResult = await withStorageAccess(() => getService().parseDocument(agent.session, input, exec.signal, pollTimeoutMs));
6891
6893
  if (shouldInline && attachments) return await processInlineImages(rawResult, attachments, exec.signal);
6892
6894
  return rawResult;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-pdf-mineru",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "Provider-independent DSH document parsing powered by MinerU, with native background jobs, immutable results, and safe request coalescing.",
5
5
  "keywords": [
6
6
  "dsh-plugin"