mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:41:08 +02:00
The runner now drives runPlannerLoop from @mana/shared-ai: the LLM emits native tool_calls via mana-llm's tools passthrough, we execute each call immediately under the AI actor, and feed the result back as a tool-message for the next turn. The reasoning loop still runs up to 5 rounds (same budget as before) but needs no hand-rolled re-prompting because the SDK-level tool-message exchange does that for us. Tool execution is direct — no Proposal staging. The executor's propose branch collapses into auto (proposal store calls stay in place for legacy consumers this commit doesn't touch; those go next). Agent- level deny still refuses and surfaces the refusal as a tool-message the LLM can react to. New surface: - missions/llm-client.ts — mana-llm HTTP adapter conforming to shared- ai's LlmClient. Posts /v1/chat/completions with tools + tool_choice, converts OpenAI-shape tool_calls back to our ToolCallRequest shape. - runner.ts shrinks from ~770 to ~410 lines — pre-step research, guardrails, agent scope, timeout, cancel, debug capture all kept. - debug.ts stores rawMessages[] (shared-ai ChatMessage) instead of plannerCalls[]/loopSteps. AiDebugBlock renders the chat transcript. - available-tools.ts returns ToolSchema[] directly so the runner can hand the array to runPlannerLoop unchanged. - setup.ts wires createManaLlmClient() instead of aiPlanTask + llmOrchestrator. The old aiPlanTask + planner/ re-export files remain orphaned for the next commit to delete. Test shape: MockLlmClient scriptable via enqueue-style turns. Three cases cover happy path, empty-plan stop, and tool-failure propagation. Dead-but-still-compiling afterwards: the proposals folder, the AiProposalInbox component + its 9 call-sites, server-iteration- staging.ts, ai-plan.ts, the legacy planner/ wrappers, and the old buildPlannerPrompt/parsePlannerResponse exports in shared-ai. These go in commits 5b/5c/5d. 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 | ||