mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-22 16:06:43 +02:00
fix(goals): start GoalTracker on boot + surface AI proposals inline
startGoalTracker was only ever called from tests, so DrinkLogged / TaskCompleted / MealLogged events never incremented currentValue and GoalReached never fired — the progress bars were cosmetic. Wire it into the (app)/+layout idle boot next to startStreakTracker, with matching teardown in onDestroy. Also drop <AiProposalInbox module="goals"/> into the module ListView so create_goal / pause_goal / resume_goal / complete_goal proposals are reviewable inline (previously only visible in the mission-detail view). Refresh the tool-coverage tables while we're at it: apps/mana/CLAUDE.md now reflects the real catalog state (59 tools, 19 modules — was 37/12), and services/mana-ai/CLAUDE.md shows the correct server-side propose subset (31 tools, 16 modules). Also fixes a stale 'location_log' → 'get_current_location' typo in the places row. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c119fd7a62
commit
52d008dd34
4 changed files with 35 additions and 7 deletions
|
|
@ -206,16 +206,16 @@ The companion is a **second actor** that works alongside the human in every modu
|
|||
- **Scene lens** — workbench scenes can bind to an agent via `scene.viewingAsAgentId` (context menu → "An Agent binden…"). Pure UI lens, not a data-scope change. `SceneAppBar` shows the agent avatar on bound scene tabs.
|
||||
- **Workbench timeline** — `/ai-workbench` renders every AI-attributed event grouped by mission iteration with per-**agent** filter, per-module, per-mission. Each bucket header shows agent avatar + name + mission title. Per-bucket **Revert button** undoes the iteration's writes via `data/ai/revert/` (TaskCreated → delete, TaskCompleted → uncomplete, etc., newest-first). Separate **"Datenzugriff"** tab exposes the server-side decrypt audit (for missions with Key-Grants).
|
||||
|
||||
### Tool Coverage (37 tools, 12 modules)
|
||||
### Tool Coverage (59 tools, 19 modules)
|
||||
|
||||
Agents interact with the app through tools — each one either auto (executes silently during reasoning) or propose (creates a Proposal card the user must approve). Canonical list in `@mana/shared-ai/src/policy/proposable-tools.ts`; server-side definitions in `services/mana-ai/src/planner/tools.ts`; webapp auto-tool list in `src/lib/data/ai/policy.ts`.
|
||||
Agents interact with the app through tools — each one either auto (executes silently during reasoning) or propose (creates a Proposal card the user must approve). Source of truth: `AI_TOOL_CATALOG` in `@mana/shared-ai/src/tools/schemas.ts` — both webapp policy (`src/lib/data/ai/policy.ts`) and server-side planner (`services/mana-ai/src/planner/tools.ts`) derive from it automatically, so drift is structurally impossible.
|
||||
|
||||
| Module | Propose | Auto |
|
||||
|--------|---------|------|
|
||||
| todo | `create_task`, `complete_task`, `complete_tasks_by_title` | `get_task_stats`, `list_tasks` |
|
||||
| calendar | `create_event` | `get_todays_events` |
|
||||
| notes | `create_note`, `update_note`, `append_to_note`, `add_tag_to_note` | `list_notes` |
|
||||
| places | `create_place`, `visit_place` | `get_places`, `location_log` |
|
||||
| places | `create_place`, `visit_place` | `get_places`, `get_current_location` |
|
||||
| drink | `undo_drink` | `get_drink_progress`, `log_drink` |
|
||||
| food | — | `nutrition_summary`, `log_meal` |
|
||||
| news | `save_news_article` | — |
|
||||
|
|
@ -224,6 +224,13 @@ Agents interact with the app through tools — each one either auto (executes si
|
|||
| habits | `create_habit`, `log_habit` | `get_habits` |
|
||||
| contacts | `create_contact` | `get_contacts` |
|
||||
| quiz | `create_quiz`, `update_quiz`, `add_quiz_question`, `update_quiz_question`, `delete_quiz_question` | `list_quizzes`, `get_quiz_questions`, `get_quiz_stats` |
|
||||
| goals | `create_goal`, `pause_goal`, `resume_goal`, `complete_goal` | `list_goals`, `get_goal_progress` |
|
||||
| mood | `log_mood` | `get_mood_today`, `get_mood_insights` |
|
||||
| myday | — | `get_myday_summary` |
|
||||
| events | `suggest_event` | `discover_events` |
|
||||
| finance | `add_transaction` | `get_month_summary`, `list_transactions` |
|
||||
| times | `start_timer`, `stop_timer` | `get_time_stats`, `get_timer_status`, `list_projects` |
|
||||
| wetter | — | `get_weather`, `get_rain_forecast` |
|
||||
|
||||
**Server-side web-research**: mana-ai calls mana-api's `/api/v1/news-research/discover` + `/search` directly before the planner prompt is built (pre-planning injection). Missions with research-keyword objectives get real article URLs + excerpts injected as a synthetic ResolvedInput. See `services/mana-ai/src/planner/news-research-client.ts`.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
import { goalStore, useAllGoals, GOAL_TEMPLATES } from '$lib/companion/goals';
|
||||
import type { LocalGoal } from '$lib/companion/goals/types';
|
||||
import GoalEditor from './GoalEditor.svelte';
|
||||
import AiProposalInbox from '$lib/components/ai/AiProposalInbox.svelte';
|
||||
|
||||
const goals = useAllGoals();
|
||||
let showTemplates = $state(false);
|
||||
|
|
@ -28,6 +29,8 @@
|
|||
</script>
|
||||
|
||||
<div class="goals-page">
|
||||
<AiProposalInbox module="goals" />
|
||||
|
||||
<div class="header">
|
||||
<button class="add-btn" onclick={() => (showEditor = true)}>
|
||||
<PencilSimple size={14} weight="bold" /> Eigenes
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
import { initTools } from '$lib/data/tools/init';
|
||||
import { startEventBridge, stopEventBridge } from '$lib/triggers/event-bridge';
|
||||
import { startStreakTracker, stopStreakTracker } from '$lib/data/projections/streaks';
|
||||
import { startGoalTracker, stopGoalTracker } from '$lib/companion/goals';
|
||||
import { initByok } from '$lib/byok';
|
||||
import { bottomBarStore } from '$lib/stores/bottom-bar.svelte';
|
||||
import { locale, _ } from 'svelte-i18n';
|
||||
|
|
@ -549,6 +550,7 @@
|
|||
initTools();
|
||||
startEventBridge();
|
||||
startStreakTracker();
|
||||
startGoalTracker();
|
||||
initByok();
|
||||
startLlmQueue();
|
||||
startMemoroLlmWatcher();
|
||||
|
|
@ -667,6 +669,7 @@
|
|||
stopEventStore();
|
||||
stopEventBridge();
|
||||
stopStreakTracker();
|
||||
stopGoalTracker();
|
||||
stopMissionTick();
|
||||
stopServerIterationStaging();
|
||||
guestMode?.destroy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue