mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 23:21:08 +02:00
When mana-ai plans a mission tick in the background, it writes an iteration with source='server' and plan[].status='planned' — the server itself has no Dexie access, so those planned tool_calls have to run on the user's device. This commit adds the missing half. - server-iteration-executor.ts subscribes via Dexie liveQuery to server-sourced iterations with planned steps. For each one it reconstructs the AI actor (mission + agent + iteration), runs every step through executeTool, and writes the result status (approved / failed) back into the iteration. - Idempotency: a new local-only Dexie table `_serverIterationExecutions` (v30) marks iterations we've already run, so sync replays and page reloads don't re-execute. Also guarded by an in-flight Set because liveQuery fires rapidly during the execution's own writes. - Wired into (app)/+layout.svelte alongside startMissionTick — lives for the whole session, stops on teardown. This is the mirror of the old server-iteration-staging.ts but direct- execute instead of proposal-stage — no manual approval step. Same user-facing behaviour as foreground mission runs: they show up in the Workbench Timeline, revertable per iteration. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| calc/packages/shared | ||
| calendar | ||
| cards | ||
| chat | ||
| citycorners | ||
| contacts | ||
| context | ||
| docs | ||
| food | ||
| guides | ||
| inventory | ||
| mana | ||
| manavoxel | ||
| memoro | ||
| moodlit | ||
| mukke | ||
| news | ||
| photos | ||
| picture | ||
| plants | ||
| presi | ||
| questions | ||
| quotes/packages/content | ||
| skilltree | ||
| storage | ||
| times | ||
| todo | ||
| traces | ||
| uload | ||