mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
SnapOtter spans five modalities now, but several code paths still assumed image input. - dropzone: default to accept-all when no fileFilter is given (image tools still pass one); neutral "supported file types" error text instead of "image files" - automate (pipelines): accept any modality in the file pickers and dropzones; render modality-aware previews (video player, audio waveform, document/data card) instead of always using ImageViewer/BeforeAfterSlider - filename sanitizer: extend the double-extension allowlist beyond image extensions to video/audio/document/data so e.g. "report.csv.php" becomes "report.csv"; add tests - thumbnail route: return 422 for non-rasterisable files (audio, data, non-PDF docs) instead of attempting a doomed Sharp decode - pool: unknown tools fall back to the "system" pool, not the image pool - a11y labels: "Previous/Next image", "Image viewer/area/controls/drop zone" are now modality-neutral, across all 21 locales - copy: bulk-rename default, find-duplicates ZIP name, SSRF user-agent, fetch-urls fallback name, file-details MIME label, URL-import placeholder, help dialog
17 lines
761 B
TypeScript
17 lines
761 B
TypeScript
import { MODALITY_POOL, TOOL_BUNDLE_MAP, TOOLS } from "@snapotter/shared";
|
|
import { hasAiJobHandler } from "../jobs/ai-handlers.js";
|
|
import type { Pool } from "../jobs/types.js";
|
|
|
|
/** ai handler/bundle wins; else the tool's modality decides (spec 4.5). */
|
|
export function resolveToolPool(toolId: string): Pool {
|
|
if (hasAiJobHandler(toolId) || TOOL_BUNDLE_MAP[toolId]) return "ai";
|
|
const tool = TOOLS.find((t) => t.id === toolId);
|
|
// Unknown tools fall back to the general-purpose "system" pool rather than
|
|
// assuming the image pool (a legacy image-only default).
|
|
return tool ? MODALITY_POOL[tool.modality] : "system";
|
|
}
|
|
|
|
export function shouldSkipSyncWindow(executionHint: "fast" | "long" | undefined): boolean {
|
|
return executionHint === "long";
|
|
}
|