mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
fix: mask result sanitize params
This commit is contained in:
@@ -73,13 +73,11 @@ handleFiles, эффекты, workspace-разметка). Декомпозици
|
|||||||
колбэков `on*`). Нужен группирующий view-model-объект или разбиение на
|
колбэков `on*`). Нужен группирующий view-model-объект или разбиение на
|
||||||
подкомпоненты.
|
подкомпоненты.
|
||||||
|
|
||||||
### M4. `runMask` обходит санитизацию параметров
|
### M4. `runMask` обходил санитизацию параметров — СДЕЛАНО (2026-10)
|
||||||
|
|
||||||
`SchemaToolView.svelte:591`: основной путь `run()` идёт через `execute` →
|
`SchemaToolView.svelte` (derived `maskResults`): параметры шага теперь проходят
|
||||||
`sanitizeSchemaParams` (`executor/executor.ts:153`), а mask-превью передаёт
|
`sanitizeSchemaParams(stepSchema, step.params, { source: input })` — тот же
|
||||||
`step.params` как есть. Значения вне диапазона/невалидный hex дойдут до
|
контракт, что в `executor/executor.ts` (вход шага как source-контекст).
|
||||||
core-функций без клампинга. (Сам обход executor для `domOnly`-маски каноничен по
|
|
||||||
`docs/architecture.md`; рассинхрон санитизации — нет.)
|
|
||||||
|
|
||||||
### M5. UI-метаданные дропдауна скачивания в core-слое
|
### M5. UI-метаданные дропдауна скачивания в core-слое
|
||||||
|
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
import {
|
import {
|
||||||
applySourceDefaults,
|
applySourceDefaults,
|
||||||
clampSourceAwareMaxes,
|
clampSourceAwareMaxes,
|
||||||
|
sanitizeSchemaParams,
|
||||||
type ToolSchema,
|
type ToolSchema,
|
||||||
} from "$lib/registry-schema";
|
} from "$lib/registry-schema";
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
@@ -99,11 +100,14 @@
|
|||||||
if (!stepTool?.runMask) return;
|
if (!stepTool?.runMask) return;
|
||||||
const input = i === 0 ? source : stepResults[i - 1];
|
const input = i === 0 ? source : stepResults[i - 1];
|
||||||
if (!input) return;
|
if (!input) return;
|
||||||
|
// Same contract as executor.ts: params are sanitized against the
|
||||||
|
// schema with the step input as the source context.
|
||||||
|
const stepSchema = toolSchemaOf(step);
|
||||||
|
const params = stepSchema
|
||||||
|
? sanitizeSchemaParams(stepSchema, step.params, { source: input })
|
||||||
|
: step.params;
|
||||||
try {
|
try {
|
||||||
next[step.key] = stepTool.runMask({
|
next[step.key] = stepTool.runMask({ params, source: input });
|
||||||
params: step.params,
|
|
||||||
source: input,
|
|
||||||
});
|
|
||||||
} catch {
|
} catch {
|
||||||
next[step.key] = null;
|
next[step.key] = null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user