feat: add source aware resolver, update reset, update generator

This commit is contained in:
2026-09-25 19:01:43 +05:00
parent 5313567e70
commit 5f77c097e2
19 changed files with 361 additions and 179 deletions
+2 -2
View File
@@ -46,7 +46,7 @@ async function handle(request: WorkerRequest): Promise<void> {
try {
const tool = getTool(request.toolId);
if (!tool?.run) {
throw new Error("errors.noImageRun");
throw new ToolError("errors.noImageRun");
}
const source: PixelImage | undefined = request.source
? {
@@ -56,7 +56,7 @@ async function handle(request: WorkerRequest): Promise<void> {
}
: undefined;
const output = await tool.run({
params: sanitizeSchemaParams(tool.schema, request.params),
params: sanitizeSchemaParams(tool.schema, request.params, { source }),
source,
text: request.text,
});