feat: add text\hex conver tools

This commit is contained in:
2026-08-23 10:40:46 +05:00
parent 3b18d0c6f8
commit 17b0c68eb5
6 changed files with 281 additions and 24 deletions
+9 -7
View File
@@ -91,12 +91,17 @@
lastRunSource = source;
lastRunValuesJson = JSON.stringify(sanitized);
try {
let next: PixelImage;
if (isSourceless) {
let next: PixelImage | null = null;
let nextText: string | null = null;
if (tool.resultType === 'text') {
nextText = await tool.toText!(source!, sanitized);
} else if (isSourceless) {
next = await tool.generate!(sanitized);
} else {
next = await tool.run(source!, sanitized);
next = await tool.run!(source!, sanitized);
}
let nextPreview: PixelImage | null = null;
if (tool.preview && source) {
try {
@@ -105,10 +110,7 @@
nextPreview = null;
}
}
let nextText: string | null = null;
if (tool.toText && source) {
nextText = await tool.toText(source, sanitized);
}
if (token !== runToken) return;
result = next;
previewResult = nextPreview;