Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mcp/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mcp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@paca-ai/plugin-sdk-mcp": "^0.1.0"
"@paca-ai/plugin-sdk-mcp": "^0.2.0"
},
"devDependencies": {
"typescript": "^5.8.3",
Expand Down
29 changes: 29 additions & 0 deletions mcp/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,35 @@ const entry: PluginMCPEntry = {
return errorResult(`Tool ${name} failed: ${message}`);
}
},

async getToolContext(
toolId: string,
args: Record<string, unknown>,
context: PluginMCPContext,
) {
if (toolId !== "get_task") return null;
const { projectId, taskId } = args as { projectId: string; taskId: string };

const api = new PluginAPIClient(context);
try {
const checklists = await api.pluginGet<Checklist[]>(
`projects/${projectId}/tasks/${taskId}/checklists`,
);
if (checklists.length === 0) return null;

const lines = ["## Checklists"];
for (const cl of checklists) {
const done = cl.items.filter((i) => i.is_checked).length;
lines.push("", `**${cl.title}** (${done}/${cl.items.length} done)`);
lines.push(...cl.items.map(formatItem));
}
return lines.join("\n");
} catch {
// Best-effort enrichment — a transient failure here should not
// break the get_task response for the AI client.
return null;
}
},
};

export default entry;
7 changes: 4 additions & 3 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"id": "com.paca.checklist",
"displayName": "Checklist",
"description": "Adds named checklists with checkable items to tasks.",
"version": "0.2.8",
"minCoreVersion": "v0.11.2",
"version": "0.2.9",
"minCoreVersion": "v0.12.2",
"permissions": ["db.read", "db.write", "events.subscribe"],
"backend": {
"eventSubscriptions": ["task.deleted"],
Expand Down Expand Up @@ -112,6 +112,7 @@
]
},
"mcp": {
"remoteEntryUrl": "/plugins-mcp/com.paca.checklist/mcp.js"
"remoteEntryUrl": "/plugins-mcp/com.paca.checklist/mcp.js",
"toolContextHooks": ["get_task"]
}
}
Loading