mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 01:41:08 +02:00
Connects the existing global tag system (@mana/shared-tags, 15+ module junctions, TagSelector UI) to the AI agent model so different agents can operate on different slices of the user's data. Core additions: 1. Agent.scopeTagIds — optional array of global tag IDs. When set, the agent sees only records tagged with at least one of those tags (plus untagged records, which stay globally visible). Empty/undefined = General-Agent, sees everything. Agent-editor grows a <TagSelector> under "Bereiche (Tag-Scope)". 2. Per-agent kontext documents — new Dexie table `agentKontextDocs` (v22, encrypted, synced). Each agent can have its own markdown context doc, replacing the global singleton auto-inject. Runner tries agent kontext first, falls back to global singleton when the agent has no dedicated doc. 3. Ambient scope context — `withAgentScope(tagIds, fn)` sets a module-level scope during the reasoning loop. Auto-tools read it via `getAgentScopeTagIds()` and filter their result sets. `filterByScope(records, getTagIds)` is the reusable filter primitive (keeps untagged records, drops mismatched tagged ones). 4. Notes tag junction — `noteTags` table (v22) + `noteTagOps` via `createTagLinkOps`. Notes was the only major module without structured tag support. `list_notes` now calls `filterByScope` so a scoped agent only sees notes tagged with its scope. Flow: mission starts → runner resolves owning agent → reads agent.scopeTagIds → wraps entire reasoning loop in withAgentScope → list_notes (and future list_tasks etc.) auto-filter → planner sees only scope-relevant records → proposes scoped edits. Runner tests: 8/8. shared-ai type-check: clean. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| credits | ||
| eslint-config | ||
| feedback | ||
| help | ||
| local-llm | ||
| local-store | ||
| local-stt | ||
| notify-client | ||
| qr-export | ||
| shared-ai | ||
| shared-auth | ||
| shared-auth-ui | ||
| shared-branding | ||
| shared-drizzle-config | ||
| shared-error-tracking | ||
| shared-go | ||
| shared-hono | ||
| shared-i18n | ||
| shared-icons | ||
| shared-landing-ui | ||
| shared-links | ||
| shared-llm | ||
| shared-logger | ||
| shared-pwa | ||
| shared-python/manacore_auth | ||
| shared-rss | ||
| shared-storage | ||
| shared-stores | ||
| shared-tags | ||
| shared-tailwind | ||
| shared-theme | ||
| shared-theme-ui | ||
| shared-types | ||
| shared-ui | ||
| shared-uload | ||
| shared-utils | ||
| shared-vite-config | ||
| spiral-db | ||
| subscriptions | ||
| test-config | ||
| wallpaper-generator | ||