@mosadd/mcp 3.0.0-alpha.47 → 3.0.0-alpha.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/mcp.js +1 -1
- package/dist/{chunk-XTQMZ6K7.js → chunk-MGF7BV3M.js} +41 -23
- package/dist/index.js +1 -1
- package/package.json +73 -73
- package/src/__tests__/knowledge-ingest.test.ts +114 -114
- package/src/__tests__/presence.test.ts +190 -190
- package/src/__tests__/serverJsonVersion.test.ts +45 -45
- package/src/providers/supabase.ts +231 -231
- package/src/server.ts +162 -162
- package/src/tools/__tests__/ragDeleteFoldsSourceId.test.ts +67 -67
- package/src/tools/knowledge-graph.ts +186 -186
- package/src/tools/mail-agentbox.ts +155 -155
- package/src/tools/mcall.ts +216 -216
- package/src/tools/mdm-as-agent.ts +126 -126
- package/src/tools/mdm-voice.ts +220 -220
- package/src/tools/mdm.ts +495 -494
- package/src/tools/mirc-messages.ts +186 -185
- package/src/tools/murl.ts +314 -314
- package/src/tools/presence.ts +442 -414
- package/src/tools/ptt-ingest.ts +99 -99
- package/src/tools/threat.ts +123 -123
- package/src/tools/voice-format.ts +28 -0
- package/src/version.ts +8 -8
- package/LICENSE +0 -201
- package/dist/bin/login.d.ts +0 -13
- package/dist/bin/mcp.d.ts +0 -1
- package/dist/index.d.ts +0 -310
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mRAG_graph — the KNOWLEDGE GRAPH over the user's own mosadd data.
|
|
3
|
-
*
|
|
4
|
-
* mRAG_search recalls WHAT was said; this surface walks WHO/WHAT is connected to whom, and WHEN.
|
|
5
|
-
* The engine already runs inside the mosadd backend as a set of Postgres functions built from the
|
|
6
|
-
* SAME per-user embeddings mRAG_search reads (metadata only — sender/recipient/thread — NEVER the
|
|
7
|
-
* message body, so it does not weaken the E2EE posture). Until now those functions had no MCP door,
|
|
8
|
-
* so an agent could search the corpus but not traverse it. These four tools are that door.
|
|
9
|
-
*
|
|
10
|
-
* ⚠ TRANSPORT: unlike the other mRAG tools (which call Edge Functions via invokeFunction), the
|
|
11
|
-
* graph lives in Postgres RPCs (kg_*), so these call `getSupabase().rpc(...)` directly. The RPCs
|
|
12
|
-
* are `grant execute … to authenticated`, and the graph-building one is SECURITY DEFINER keyed on
|
|
13
|
-
* `auth.uid()`, so under the caller's hub-session JWT every result is scoped to the caller's own
|
|
14
|
-
* account — there is no cross-tenant path.
|
|
15
|
-
*
|
|
16
|
-
* Typical flow for an agent: mRAG_graph_refresh (build/update from the latest ingested data) →
|
|
17
|
-
* mRAG_graph_overview (see the top parties + their ids) → mRAG_graph_neighbors / _timeline on a
|
|
18
|
-
* party id from the overview.
|
|
19
|
-
*
|
|
20
|
-
* Plan note: gated by plan at the hub (the knowledge graph is a paid capability — matches the
|
|
21
|
-
* app's `knowledgeGraph` flag). BYOK/self-host runs it against the user's own backend.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
import { z } from "zod";
|
|
25
|
-
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
26
|
-
import { getSupabase, readSupabaseEnv } from "../providers/supabase.js";
|
|
27
|
-
|
|
28
|
-
/** One authenticated RPC round-trip with normalized errors an agent can reason about. */
|
|
29
|
-
async function callRpc<T>(fn: string, args: Record<string, unknown>, ctx: MosaddToolContext): Promise<T> {
|
|
30
|
-
readSupabaseEnv();
|
|
31
|
-
ctx.log("debug", `mRAG_graph via ${fn}`, args);
|
|
32
|
-
const { data, error } = await getSupabase().rpc(fn, args);
|
|
33
|
-
if (error) {
|
|
34
|
-
// PostgREST surfaces RLS denials, auth failures and function errors here; hand the agent the
|
|
35
|
-
// real message + code rather than a generic sentence, so it can self-correct.
|
|
36
|
-
throw new Error(`${fn} failed: ${error.message}${error.code ? ` (${error.code})` : ""}`);
|
|
37
|
-
}
|
|
38
|
-
return data as T;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
// ── mRAG_graph_refresh ───────────────────────────────────────────────────────
|
|
42
|
-
const mRAG_graph_refresh_input = z.object({
|
|
43
|
-
max_docs: z
|
|
44
|
-
.number()
|
|
45
|
-
.int()
|
|
46
|
-
.min(1)
|
|
47
|
-
.max(20_000)
|
|
48
|
-
.optional()
|
|
49
|
-
.describe("Cap on source documents scanned when (re)building the graph. Default 20000 (the max)."),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
async function mRAG_graph_refresh(
|
|
53
|
-
input: z.infer<typeof mRAG_graph_refresh_input>,
|
|
54
|
-
ctx: MosaddToolContext,
|
|
55
|
-
): Promise<unknown> {
|
|
56
|
-
// kg_refresh_me rebuilds parties/mentions/edges from the caller's embeddings METADATA only
|
|
57
|
-
// (sender/recipient/thread), never content_text. Returns counts {parties, mentions, edges, …}.
|
|
58
|
-
return await callRpc("kg_refresh_me", { p_max_docs: input.max_docs ?? 20_000 }, ctx);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// ── mRAG_graph_overview ──────────────────────────────────────────────────────
|
|
62
|
-
const mRAG_graph_overview_input = z.object({
|
|
63
|
-
limit: z.number().int().min(1).max(200).optional().describe("Max parties to return (busiest first). Default 40, max 200."),
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
interface GraphParty {
|
|
67
|
-
party_id: string;
|
|
68
|
-
display_name: string;
|
|
69
|
-
kind: string;
|
|
70
|
-
aliases: string[];
|
|
71
|
-
appearances: number;
|
|
72
|
-
connections: number;
|
|
73
|
-
first_seen_at: string | null;
|
|
74
|
-
last_seen_at: string | null;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function mRAG_graph_overview(
|
|
78
|
-
input: z.infer<typeof mRAG_graph_overview_input>,
|
|
79
|
-
ctx: MosaddToolContext,
|
|
80
|
-
): Promise<{ parties: GraphParty[]; count: number }> {
|
|
81
|
-
const rows = await callRpc<GraphParty[]>("kg_overview", { p_limit: input.limit ?? 40 }, ctx);
|
|
82
|
-
const parties = rows ?? [];
|
|
83
|
-
return { parties, count: parties.length };
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// ── mRAG_graph_neighbors ─────────────────────────────────────────────────────
|
|
87
|
-
const mRAG_graph_neighbors_input = z.object({
|
|
88
|
-
party_id: z.string().uuid().describe("The party whose connections to walk (a party_id from mRAG_graph_overview)."),
|
|
89
|
-
depth: z.number().int().min(1).max(2).optional().describe("Hops to walk. Hard-clamped to 2 server-side. Default 1."),
|
|
90
|
-
limit: z.number().int().min(1).max(200).optional().describe("Max neighbours to return. Clamped to 200. Default 50."),
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
interface GraphNeighbor {
|
|
94
|
-
party_id: string;
|
|
95
|
-
display_name: string;
|
|
96
|
-
kind: string;
|
|
97
|
-
depth: number;
|
|
98
|
-
edge_type: string;
|
|
99
|
-
observations: number;
|
|
100
|
-
valid_from: string | null;
|
|
101
|
-
last_seen_at: string | null;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async function mRAG_graph_neighbors(
|
|
105
|
-
input: z.infer<typeof mRAG_graph_neighbors_input>,
|
|
106
|
-
ctx: MosaddToolContext,
|
|
107
|
-
): Promise<{ neighbors: GraphNeighbor[]; count: number }> {
|
|
108
|
-
const rows = await callRpc<GraphNeighbor[]>(
|
|
109
|
-
"kg_neighbors",
|
|
110
|
-
{ p_party_id: input.party_id, p_depth: input.depth ?? 1, p_limit: input.limit ?? 50 },
|
|
111
|
-
ctx,
|
|
112
|
-
);
|
|
113
|
-
const neighbors = rows ?? [];
|
|
114
|
-
return { neighbors, count: neighbors.length };
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// ── mRAG_graph_timeline ──────────────────────────────────────────────────────
|
|
118
|
-
const mRAG_graph_timeline_input = z.object({
|
|
119
|
-
party_id: z.string().uuid().describe("The party whose dated appearance timeline to return (a party_id from mRAG_graph_overview)."),
|
|
120
|
-
limit: z.number().int().min(1).max(200).optional().describe("Max timeline entries (newest first). Clamped to 200. Default 50."),
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
interface GraphTimelineEntry {
|
|
124
|
-
source_type: string;
|
|
125
|
-
source_id: string;
|
|
126
|
-
thread_id: string | null;
|
|
127
|
-
role: string | null;
|
|
128
|
-
occurred_at: string | null;
|
|
129
|
-
evidence_chunk_id: string | null;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
async function mRAG_graph_timeline(
|
|
133
|
-
input: z.infer<typeof mRAG_graph_timeline_input>,
|
|
134
|
-
ctx: MosaddToolContext,
|
|
135
|
-
): Promise<{ timeline: GraphTimelineEntry[]; count: number }> {
|
|
136
|
-
const rows = await callRpc<GraphTimelineEntry[]>(
|
|
137
|
-
"kg_party_timeline",
|
|
138
|
-
{ p_party_id: input.party_id, p_limit: input.limit ?? 50 },
|
|
139
|
-
ctx,
|
|
140
|
-
);
|
|
141
|
-
const timeline = rows ?? [];
|
|
142
|
-
return { timeline, count: timeline.length };
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
export const knowledgeGraphTools: MosaddTool[] = [
|
|
146
|
-
{
|
|
147
|
-
name: "mRAG_graph_refresh",
|
|
148
|
-
title: "Rebuild knowledge graph",
|
|
149
|
-
annotations: { readOnlyHint: false },
|
|
150
|
-
requires: "network",
|
|
151
|
-
description:
|
|
152
|
-
"(Re)build the USER'S OWN knowledge graph from their indexed data, then return what it found (counts of parties/mentions/edges). Run this first, or after new data has been ingested, so mRAG_graph_overview/neighbors/timeline reflect the latest. Built from METADATA only (who-sent-to-whom, thread membership) — never message bodies, so it does not weaken E2EE. Owner-scoped.",
|
|
153
|
-
inputSchema: mRAG_graph_refresh_input,
|
|
154
|
-
handler: mRAG_graph_refresh as MosaddTool["handler"],
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: "mRAG_graph_overview",
|
|
158
|
-
title: "Knowledge graph overview",
|
|
159
|
-
annotations: { readOnlyHint: true },
|
|
160
|
-
requires: "network",
|
|
161
|
-
description:
|
|
162
|
-
"List the parties (people / companies / services) in the user's knowledge graph, busiest first, each with its party_id, kind, aliases, appearance count, connection count and first/last-seen dates. This is the entry point: use a returned party_id with mRAG_graph_neighbors or mRAG_graph_timeline. Owner-scoped.",
|
|
163
|
-
inputSchema: mRAG_graph_overview_input,
|
|
164
|
-
handler: mRAG_graph_overview as MosaddTool["handler"],
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: "mRAG_graph_neighbors",
|
|
168
|
-
title: "Explore graph neighbors",
|
|
169
|
-
annotations: { readOnlyHint: true },
|
|
170
|
-
requires: "network",
|
|
171
|
-
description:
|
|
172
|
-
"Walk the connections of one party (from mRAG_graph_overview) — who/what it is linked to, with the edge type, how many times observed, and when. Answers 'who is connected to X, and how'. Depth is hard-clamped to 2 hops and breadth to 200 server-side. Owner-scoped.",
|
|
173
|
-
inputSchema: mRAG_graph_neighbors_input,
|
|
174
|
-
handler: mRAG_graph_neighbors as MosaddTool["handler"],
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
name: "mRAG_graph_timeline",
|
|
178
|
-
title: "Knowledge graph timeline",
|
|
179
|
-
annotations: { readOnlyHint: true },
|
|
180
|
-
requires: "network",
|
|
181
|
-
description:
|
|
182
|
-
"Return the dated appearance timeline of one party (from mRAG_graph_overview) — each source (email/message/call/…), its thread, the party's role, and when it occurred, newest first. Answers 'when and where did X show up'. Owner-scoped.",
|
|
183
|
-
inputSchema: mRAG_graph_timeline_input,
|
|
184
|
-
handler: mRAG_graph_timeline as MosaddTool["handler"],
|
|
185
|
-
},
|
|
186
|
-
];
|
|
1
|
+
/**
|
|
2
|
+
* mRAG_graph — the KNOWLEDGE GRAPH over the user's own mosadd data.
|
|
3
|
+
*
|
|
4
|
+
* mRAG_search recalls WHAT was said; this surface walks WHO/WHAT is connected to whom, and WHEN.
|
|
5
|
+
* The engine already runs inside the mosadd backend as a set of Postgres functions built from the
|
|
6
|
+
* SAME per-user embeddings mRAG_search reads (metadata only — sender/recipient/thread — NEVER the
|
|
7
|
+
* message body, so it does not weaken the E2EE posture). Until now those functions had no MCP door,
|
|
8
|
+
* so an agent could search the corpus but not traverse it. These four tools are that door.
|
|
9
|
+
*
|
|
10
|
+
* ⚠ TRANSPORT: unlike the other mRAG tools (which call Edge Functions via invokeFunction), the
|
|
11
|
+
* graph lives in Postgres RPCs (kg_*), so these call `getSupabase().rpc(...)` directly. The RPCs
|
|
12
|
+
* are `grant execute … to authenticated`, and the graph-building one is SECURITY DEFINER keyed on
|
|
13
|
+
* `auth.uid()`, so under the caller's hub-session JWT every result is scoped to the caller's own
|
|
14
|
+
* account — there is no cross-tenant path.
|
|
15
|
+
*
|
|
16
|
+
* Typical flow for an agent: mRAG_graph_refresh (build/update from the latest ingested data) →
|
|
17
|
+
* mRAG_graph_overview (see the top parties + their ids) → mRAG_graph_neighbors / _timeline on a
|
|
18
|
+
* party id from the overview.
|
|
19
|
+
*
|
|
20
|
+
* Plan note: gated by plan at the hub (the knowledge graph is a paid capability — matches the
|
|
21
|
+
* app's `knowledgeGraph` flag). BYOK/self-host runs it against the user's own backend.
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { z } from "zod";
|
|
25
|
+
import type { MosaddTool, MosaddToolContext } from "../types.js";
|
|
26
|
+
import { getSupabase, readSupabaseEnv } from "../providers/supabase.js";
|
|
27
|
+
|
|
28
|
+
/** One authenticated RPC round-trip with normalized errors an agent can reason about. */
|
|
29
|
+
async function callRpc<T>(fn: string, args: Record<string, unknown>, ctx: MosaddToolContext): Promise<T> {
|
|
30
|
+
readSupabaseEnv();
|
|
31
|
+
ctx.log("debug", `mRAG_graph via ${fn}`, args);
|
|
32
|
+
const { data, error } = await getSupabase().rpc(fn, args);
|
|
33
|
+
if (error) {
|
|
34
|
+
// PostgREST surfaces RLS denials, auth failures and function errors here; hand the agent the
|
|
35
|
+
// real message + code rather than a generic sentence, so it can self-correct.
|
|
36
|
+
throw new Error(`${fn} failed: ${error.message}${error.code ? ` (${error.code})` : ""}`);
|
|
37
|
+
}
|
|
38
|
+
return data as T;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// ── mRAG_graph_refresh ───────────────────────────────────────────────────────
|
|
42
|
+
const mRAG_graph_refresh_input = z.object({
|
|
43
|
+
max_docs: z
|
|
44
|
+
.number()
|
|
45
|
+
.int()
|
|
46
|
+
.min(1)
|
|
47
|
+
.max(20_000)
|
|
48
|
+
.optional()
|
|
49
|
+
.describe("Cap on source documents scanned when (re)building the graph. Default 20000 (the max)."),
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
async function mRAG_graph_refresh(
|
|
53
|
+
input: z.infer<typeof mRAG_graph_refresh_input>,
|
|
54
|
+
ctx: MosaddToolContext,
|
|
55
|
+
): Promise<unknown> {
|
|
56
|
+
// kg_refresh_me rebuilds parties/mentions/edges from the caller's embeddings METADATA only
|
|
57
|
+
// (sender/recipient/thread), never content_text. Returns counts {parties, mentions, edges, …}.
|
|
58
|
+
return await callRpc("kg_refresh_me", { p_max_docs: input.max_docs ?? 20_000 }, ctx);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// ── mRAG_graph_overview ──────────────────────────────────────────────────────
|
|
62
|
+
const mRAG_graph_overview_input = z.object({
|
|
63
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max parties to return (busiest first). Default 40, max 200."),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
interface GraphParty {
|
|
67
|
+
party_id: string;
|
|
68
|
+
display_name: string;
|
|
69
|
+
kind: string;
|
|
70
|
+
aliases: string[];
|
|
71
|
+
appearances: number;
|
|
72
|
+
connections: number;
|
|
73
|
+
first_seen_at: string | null;
|
|
74
|
+
last_seen_at: string | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function mRAG_graph_overview(
|
|
78
|
+
input: z.infer<typeof mRAG_graph_overview_input>,
|
|
79
|
+
ctx: MosaddToolContext,
|
|
80
|
+
): Promise<{ parties: GraphParty[]; count: number }> {
|
|
81
|
+
const rows = await callRpc<GraphParty[]>("kg_overview", { p_limit: input.limit ?? 40 }, ctx);
|
|
82
|
+
const parties = rows ?? [];
|
|
83
|
+
return { parties, count: parties.length };
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ── mRAG_graph_neighbors ─────────────────────────────────────────────────────
|
|
87
|
+
const mRAG_graph_neighbors_input = z.object({
|
|
88
|
+
party_id: z.string().uuid().describe("The party whose connections to walk (a party_id from mRAG_graph_overview)."),
|
|
89
|
+
depth: z.number().int().min(1).max(2).optional().describe("Hops to walk. Hard-clamped to 2 server-side. Default 1."),
|
|
90
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max neighbours to return. Clamped to 200. Default 50."),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
interface GraphNeighbor {
|
|
94
|
+
party_id: string;
|
|
95
|
+
display_name: string;
|
|
96
|
+
kind: string;
|
|
97
|
+
depth: number;
|
|
98
|
+
edge_type: string;
|
|
99
|
+
observations: number;
|
|
100
|
+
valid_from: string | null;
|
|
101
|
+
last_seen_at: string | null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async function mRAG_graph_neighbors(
|
|
105
|
+
input: z.infer<typeof mRAG_graph_neighbors_input>,
|
|
106
|
+
ctx: MosaddToolContext,
|
|
107
|
+
): Promise<{ neighbors: GraphNeighbor[]; count: number }> {
|
|
108
|
+
const rows = await callRpc<GraphNeighbor[]>(
|
|
109
|
+
"kg_neighbors",
|
|
110
|
+
{ p_party_id: input.party_id, p_depth: input.depth ?? 1, p_limit: input.limit ?? 50 },
|
|
111
|
+
ctx,
|
|
112
|
+
);
|
|
113
|
+
const neighbors = rows ?? [];
|
|
114
|
+
return { neighbors, count: neighbors.length };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// ── mRAG_graph_timeline ──────────────────────────────────────────────────────
|
|
118
|
+
const mRAG_graph_timeline_input = z.object({
|
|
119
|
+
party_id: z.string().uuid().describe("The party whose dated appearance timeline to return (a party_id from mRAG_graph_overview)."),
|
|
120
|
+
limit: z.number().int().min(1).max(200).optional().describe("Max timeline entries (newest first). Clamped to 200. Default 50."),
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
interface GraphTimelineEntry {
|
|
124
|
+
source_type: string;
|
|
125
|
+
source_id: string;
|
|
126
|
+
thread_id: string | null;
|
|
127
|
+
role: string | null;
|
|
128
|
+
occurred_at: string | null;
|
|
129
|
+
evidence_chunk_id: string | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
async function mRAG_graph_timeline(
|
|
133
|
+
input: z.infer<typeof mRAG_graph_timeline_input>,
|
|
134
|
+
ctx: MosaddToolContext,
|
|
135
|
+
): Promise<{ timeline: GraphTimelineEntry[]; count: number }> {
|
|
136
|
+
const rows = await callRpc<GraphTimelineEntry[]>(
|
|
137
|
+
"kg_party_timeline",
|
|
138
|
+
{ p_party_id: input.party_id, p_limit: input.limit ?? 50 },
|
|
139
|
+
ctx,
|
|
140
|
+
);
|
|
141
|
+
const timeline = rows ?? [];
|
|
142
|
+
return { timeline, count: timeline.length };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export const knowledgeGraphTools: MosaddTool[] = [
|
|
146
|
+
{
|
|
147
|
+
name: "mRAG_graph_refresh",
|
|
148
|
+
title: "Rebuild knowledge graph",
|
|
149
|
+
annotations: { readOnlyHint: false },
|
|
150
|
+
requires: "network",
|
|
151
|
+
description:
|
|
152
|
+
"(Re)build the USER'S OWN knowledge graph from their indexed data, then return what it found (counts of parties/mentions/edges). Run this first, or after new data has been ingested, so mRAG_graph_overview/neighbors/timeline reflect the latest. Built from METADATA only (who-sent-to-whom, thread membership) — never message bodies, so it does not weaken E2EE. Owner-scoped.",
|
|
153
|
+
inputSchema: mRAG_graph_refresh_input,
|
|
154
|
+
handler: mRAG_graph_refresh as MosaddTool["handler"],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "mRAG_graph_overview",
|
|
158
|
+
title: "Knowledge graph overview",
|
|
159
|
+
annotations: { readOnlyHint: true },
|
|
160
|
+
requires: "network",
|
|
161
|
+
description:
|
|
162
|
+
"List the parties (people / companies / services) in the user's knowledge graph, busiest first, each with its party_id, kind, aliases, appearance count, connection count and first/last-seen dates. This is the entry point: use a returned party_id with mRAG_graph_neighbors or mRAG_graph_timeline. Owner-scoped.",
|
|
163
|
+
inputSchema: mRAG_graph_overview_input,
|
|
164
|
+
handler: mRAG_graph_overview as MosaddTool["handler"],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "mRAG_graph_neighbors",
|
|
168
|
+
title: "Explore graph neighbors",
|
|
169
|
+
annotations: { readOnlyHint: true },
|
|
170
|
+
requires: "network",
|
|
171
|
+
description:
|
|
172
|
+
"Walk the connections of one party (from mRAG_graph_overview) — who/what it is linked to, with the edge type, how many times observed, and when. Answers 'who is connected to X, and how'. Depth is hard-clamped to 2 hops and breadth to 200 server-side. Owner-scoped.",
|
|
173
|
+
inputSchema: mRAG_graph_neighbors_input,
|
|
174
|
+
handler: mRAG_graph_neighbors as MosaddTool["handler"],
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: "mRAG_graph_timeline",
|
|
178
|
+
title: "Knowledge graph timeline",
|
|
179
|
+
annotations: { readOnlyHint: true },
|
|
180
|
+
requires: "network",
|
|
181
|
+
description:
|
|
182
|
+
"Return the dated appearance timeline of one party (from mRAG_graph_overview) — each source (email/message/call/…), its thread, the party's role, and when it occurred, newest first. Answers 'when and where did X show up'. Owner-scoped.",
|
|
183
|
+
inputSchema: mRAG_graph_timeline_input,
|
|
184
|
+
handler: mRAG_graph_timeline as MosaddTool["handler"],
|
|
185
|
+
},
|
|
186
|
+
];
|