feat(mcp): add memory_session_context tool for opencode session recall

This commit is contained in:
Apunkt 2026-05-25 15:40:53 +02:00
parent 865d46bc78
commit ebe7ebf17a
No known key found for this signature in database

View file

@ -24,6 +24,7 @@ export const TOOL_NAMES = [
"memory_contradict",
"memory_capture",
"memory_consolidate",
"memory_session_context",
"profile_get_set",
"curiosity_pending",
"schema_list",
@ -185,6 +186,18 @@ export const toolSchemas: Record<ToolName, ToolSchema> = {
},
},
},
memory_session_context: {
name: "memory_session_context",
description:
"Retrieve the current session context payload (identity, session handle, " +
"topic cluster, rich club). Call at session start to load relevant " +
"background memory. Returns JSON with l0, l1, l2, rich_club, and " +
"compact_handle fields.",
inputSchema: {
type: "object",
properties: {},
},
},
profile_get_set: {
name: "profile_get_set",
description:
@ -348,6 +361,8 @@ export async function invokeTool(
return bridge.call("memory_capture", args);
case "memory_consolidate":
return bridge.call("memory_consolidate", args);
case "memory_session_context":
return bridge.call("session_start_payload", {});
case "profile_get_set": {
const op = args.operation as string;
if (op === "get") {