feat(mcp): agents can list, read and create notes
New scopes notes:read (list_notes, get_note, notes in search) and notes:create (create_note from Markdown). MCP only, REST stays closed; new notes go into shared folders only with write access. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c6f28aa816
commit
a8f6c1b97b
12 files changed
+312
-23
No files matched your search
@@ -85,7 +85,7 @@ export const OAuthConsentView: React.FC<OAuthConsentViewProps> = ({ user, instan
|
||||
<h2 className="text-sm font-bold text-main">{info.clientName} möchte auf dein MindSift zugreifen</h2>
|
||||
<p className="text-xs text-muted mt-0.5">
|
||||
Angemeldet als <span className="text-main">{user.displayName || user.email}</span>. Freigaben gelten wie
|
||||
für dich selbst; Notizen und Einstellungen bleiben gesperrt.
|
||||
für dich selbst; Einstellungen bleiben gesperrt.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -100,9 +100,9 @@ export const ApiKeysPanel: React.FC<ApiKeysPanelProps> = ({ onIngested }) => {
|
||||
}
|
||||
};
|
||||
|
||||
// Switches grouped by tasks, lists and inbox (same layout for a new and an existing key)
|
||||
// Switches grouped by tasks, lists, notes and inbox (same layout for a new and an existing key)
|
||||
const renderScopeSwitches = (selected: ApiKeyScope[], toggle: (id: ApiKeyScope) => void, label: string) => (
|
||||
<div className="grid grid-cols-1 lg:grid-cols-3 gap-3" role="group" aria-label={label}>
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-3" role="group" aria-label={label}>
|
||||
{SCOPE_GROUPS.map(([group, heading]) => (
|
||||
<div key={group} className="border border-border rounded-card bg-panel px-3 py-1.5">
|
||||
<p className="text-[11px] text-muted pt-1 pb-0.5 font-semibold">{heading}</p>
|
||||
@@ -237,9 +237,9 @@ http_headers = { "X-API-Key" = "${exampleToken}" }`
|
||||
<h3 className="text-sm font-bold text-main">API-Schlüssel</h3>
|
||||
<p className="text-xs text-muted">
|
||||
Ein Schlüssel verbindet Home Assistant, n8n, eigene Skripte oder KI-Agenten (Claude Code, Codex …) mit
|
||||
MindSift. Was er darf, legst du mit den Schaltern fest; das gilt per curl und per MCP gleich. Notizen und
|
||||
Einstellungen bleiben für Schlüssel gesperrt. Was ein Schlüssel anlegt oder ändert, trägt seinen Namen als
|
||||
Badge.
|
||||
MindSift. Was er darf, legst du mit den Schaltern fest; das gilt per curl und per MCP gleich, nur Notizen
|
||||
gibt es ausschließlich über MCP. Einstellungen bleiben für Schlüssel gesperrt. Was ein Schlüssel bei Aufgaben
|
||||
und Listen anlegt oder ändert, trägt seinen Namen als Badge.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -636,7 +636,9 @@ http_headers = { "X-API-Key" = "${exampleToken}" }`
|
||||
<code className="font-mono">list_lists</code>, <code className="font-mono">create_list</code>,{' '}
|
||||
<code className="font-mono">get_list</code>, <code className="font-mono">add_list_item</code>,{' '}
|
||||
<code className="font-mono">check_list_item</code>, <code className="font-mono">update_list_item</code>,{' '}
|
||||
<code className="font-mono">search</code>, <code className="font-mono">capture_to_inbox</code>. Der Agent sieht
|
||||
<code className="font-mono">list_notes</code>, <code className="font-mono">get_note</code>,{' '}
|
||||
<code className="font-mono">create_note</code>, <code className="font-mono">search</code>,{' '}
|
||||
<code className="font-mono">capture_to_inbox</code>. Der Agent sieht
|
||||
nur die Werkzeuge, für die der Schlüssel bzw. die Verbindung berechtigt ist; Freigaben gelten wie für dich selbst.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { ApiKeyScope } from './types';
|
||||
|
||||
// What a key may do. The rights hold for every access alike: curl/REST and MCP for AI agents. The ids of
|
||||
// the delivering rights (webhook:…) stay from the time keys could only deliver data.
|
||||
export type ScopeGroup = 'tasks' | 'lists' | 'inbox';
|
||||
// the delivering rights (webhook:…) stay from the time keys could only deliver data. Notes are reachable
|
||||
// over MCP only.
|
||||
export type ScopeGroup = 'tasks' | 'lists' | 'notes' | 'inbox';
|
||||
export const SCOPES: { id: ApiKeyScope; label: string; chip: string; hint: string; group: ScopeGroup }[] = [
|
||||
{ id: 'tasks:read', label: 'Lesen', chip: 'Aufgaben lesen', hint: 'Aufgabenlisten und Aufgaben lesen, suchen', group: 'tasks' },
|
||||
{ id: 'webhook:task', label: 'Anlegen', chip: 'Aufgaben anlegen', hint: 'Nur neue Aufgaben anlegen', group: 'tasks' },
|
||||
@@ -10,11 +11,14 @@ export const SCOPES: { id: ApiKeyScope; label: string; chip: string; hint: strin
|
||||
{ id: 'lists:read', label: 'Lesen', chip: 'Listen lesen', hint: 'Listen und ihre Einträge lesen', group: 'lists' },
|
||||
{ id: 'webhook:list', label: 'Einträge hinzufügen', chip: 'Listeneinträge hinzufügen', hint: 'Nur neue Einträge hinzufügen', group: 'lists' },
|
||||
{ id: 'lists:write', label: 'Ändern', chip: 'Listen ändern', hint: 'Einträge hinzufügen, ändern und abhaken', group: 'lists' },
|
||||
{ id: 'notes:read', label: 'Lesen', chip: 'Notizen lesen', hint: 'Notizen auflisten, lesen, suchen (nur MCP)', group: 'notes' },
|
||||
{ id: 'notes:create', label: 'Anlegen', chip: 'Notizen anlegen', hint: 'Nur neue Notizen anlegen (nur MCP)', group: 'notes' },
|
||||
{ id: 'webhook:triage', label: 'Inbox füllen', chip: 'Inbox', hint: 'Gedanken in die Inbox einliefern', group: 'inbox' },
|
||||
];
|
||||
export const SCOPE_GROUPS: [ScopeGroup, string][] = [
|
||||
['tasks', '📋 Aufgaben'],
|
||||
['lists', '🛒 Listen'],
|
||||
['notes', '🗒️ Notizen'],
|
||||
['inbox', '📥 Inbox'],
|
||||
];
|
||||
export const scopeChip = (id: string) => SCOPES.find((s) => s.id === id)?.chip || id;
|
||||
@@ -662,7 +662,7 @@ export interface UserTheme {
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
/** What an API key may do: webhook:* delivers data, the agent scopes read and change tasks/lists over MCP. */
|
||||
/** What an API key may do: webhook:* delivers data, the agent scopes read and change tasks/lists; notes only over MCP. */
|
||||
export type ApiKeyScope =
|
||||
| 'webhook:triage'
|
||||
| 'webhook:task'
|
||||
@@ -670,7 +670,9 @@ export type ApiKeyScope =
|
||||
| 'tasks:read'
|
||||
| 'tasks:write'
|
||||
| 'lists:read'
|
||||
| 'lists:write';
|
||||
| 'lists:write'
|
||||
| 'notes:read'
|
||||
| 'notes:create';
|
||||
|
||||
export interface APIKey {
|
||||
id: string;
|
||||
|
||||
Reference in new issue
Block a user