chore: восстановление репозитория из снапшота v0.3.1
Прежняя git-история утрачена при переносе проекта на машину владельца (снапшот без .git). Хэши коммитов в docs/reports/* относятся к утраченной истории. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
commit
1c85091186
184 changed files with 33303 additions and 0 deletions
18
apps/web/src/ai-worker.ts
Normal file
18
apps/web/src/ai-worker.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
/**
|
||||
* Точка входа Web Worker ИИ ур. 4–6 (этап 5). Подключение по комментарию
|
||||
* packages/ai/src/worker.ts: `self.onmessage = (e) => createWorkerHandler(self)(e.data)`.
|
||||
* Сборка — Vite: new Worker(new URL('./ai-worker.ts', import.meta.url), { type: 'module' })
|
||||
* (см. lib/ai-client.ts, defaultWorkerFactory).
|
||||
*/
|
||||
import { createWorkerHandler } from '@go-learn/ai';
|
||||
import type { WorkerRequest, WorkerResponse } from '@go-learn/ai';
|
||||
|
||||
/** Минимальный срез DedicatedWorkerGlobalScope, нужный обработчику. */
|
||||
interface WorkerScope {
|
||||
onmessage: ((event: { data: WorkerRequest }) => void) | null;
|
||||
postMessage(message: WorkerResponse): void;
|
||||
}
|
||||
|
||||
const scope = self as unknown as WorkerScope;
|
||||
const handle = createWorkerHandler(scope);
|
||||
scope.onmessage = (event): void => handle(event.data);
|
||||
Loading…
Add table
Add a link
Reference in a new issue