easymd-cli 0.1.4 → 0.1.5
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/package.json +1 -1
- 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.
|
|
3
|
+
"version": "0.1.5",
|
|
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
|
@@ -148,6 +148,28 @@ server.registerTool(
|
|
|
148
148
|
},
|
|
149
149
|
);
|
|
150
150
|
|
|
151
|
+
server.registerTool(
|
|
152
|
+
'propose_change',
|
|
153
|
+
{
|
|
154
|
+
title: 'Propose a change (intent before edit)',
|
|
155
|
+
description:
|
|
156
|
+
'Propose an edit to a document WITHOUT overwriting it. State your intent (e.g. "resolve contradiction in §Auth", "add acceptance criteria", "update status") and the proposed markdown. It appears in the doc as a reviewable proposal the human can Accept or Reject — collaboration becomes intentful, not a silent overwrite. Use this for substantive changes; use update_document only for direct edits the human expects.',
|
|
157
|
+
inputSchema: {
|
|
158
|
+
name: z.string().describe('Document name'),
|
|
159
|
+
intent: z.string().describe('What this change does and why (shown to the human)'),
|
|
160
|
+
content: z.string().describe('The proposed markdown'),
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
async ({ name, intent, content }) => {
|
|
164
|
+
try {
|
|
165
|
+
await api('/api/cli/documents', { method: 'POST', body: JSON.stringify({ name, op: 'propose', intent, content }) });
|
|
166
|
+
return ok(`Proposed “${intent}” on "${name}". The owner can Accept or Reject it in the editor.`);
|
|
167
|
+
} catch (e) {
|
|
168
|
+
return fail(e.message);
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
);
|
|
172
|
+
|
|
151
173
|
const transport = new StdioServerTransport();
|
|
152
174
|
await server.connect(transport);
|
|
153
175
|
console.error(`easymd MCP ready → ${BASE} ${TOKEN ? '(authenticated)' : '(NOT logged in — run `easymd login`)'}`);
|