easymd-cli 0.1.5 → 0.1.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli/mcp.mjs +22 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easymd-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Google Docs for markdown — collaborate on the actual .md file in your repo, live with humans and AI agents. CLI: login, auto-sync, and open .md files for real-time editing.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/cli/mcp.mjs CHANGED
@@ -170,6 +170,28 @@ server.registerTool(
170
170
  },
171
171
  );
172
172
 
173
+ server.registerTool(
174
+ 'flag',
175
+ {
176
+ title: 'Flag a conflict or stale assumption',
177
+ description:
178
+ 'Raise a flag in the document when your understanding of the repo diverges from the spec. Use kind "conflicts-with-code" when the spec contradicts the current code, "stale-assumption" when the spec relies on something no longer true, or "needs-review". It appears as an inline callout in the doc so the human notices the divergence. Include a short note explaining it.',
179
+ inputSchema: {
180
+ name: z.string().describe('Document name'),
181
+ kind: z.enum(['conflicts-with-code', 'stale-assumption', 'needs-review']).describe('Type of flag'),
182
+ note: z.string().describe('Short explanation of the divergence (e.g. "spec says JWT; src/auth.ts uses sessions")'),
183
+ },
184
+ },
185
+ async ({ name, kind, note }) => {
186
+ try {
187
+ await api('/api/cli/documents', { method: 'POST', body: JSON.stringify({ name, op: 'flag', kind, note }) });
188
+ return ok(`Flagged “${kind}” on "${name}".`);
189
+ } catch (e) {
190
+ return fail(e.message);
191
+ }
192
+ },
193
+ );
194
+
173
195
  const transport = new StdioServerTransport();
174
196
  await server.connect(transport);
175
197
  console.error(`easymd MCP ready → ${BASE} ${TOKEN ? '(authenticated)' : '(NOT logged in — run `easymd login`)'}`);