feat(mcp): add memory_session_context tool for opencode session recall
This commit is contained in:
parent
865d46bc78
commit
ebe7ebf17a
1 changed files with 15 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ export const TOOL_NAMES = [
|
||||||
"memory_contradict",
|
"memory_contradict",
|
||||||
"memory_capture",
|
"memory_capture",
|
||||||
"memory_consolidate",
|
"memory_consolidate",
|
||||||
|
"memory_session_context",
|
||||||
"profile_get_set",
|
"profile_get_set",
|
||||||
"curiosity_pending",
|
"curiosity_pending",
|
||||||
"schema_list",
|
"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: {
|
profile_get_set: {
|
||||||
name: "profile_get_set",
|
name: "profile_get_set",
|
||||||
description:
|
description:
|
||||||
|
|
@ -348,6 +361,8 @@ export async function invokeTool(
|
||||||
return bridge.call("memory_capture", args);
|
return bridge.call("memory_capture", args);
|
||||||
case "memory_consolidate":
|
case "memory_consolidate":
|
||||||
return bridge.call("memory_consolidate", args);
|
return bridge.call("memory_consolidate", args);
|
||||||
|
case "memory_session_context":
|
||||||
|
return bridge.call("session_start_payload", {});
|
||||||
case "profile_get_set": {
|
case "profile_get_set": {
|
||||||
const op = args.operation as string;
|
const op = args.operation as string;
|
||||||
if (op === "get") {
|
if (op === "get") {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue