drafted 1.21.1 → 1.21.2
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/install-mcp.sh +8 -0
- package/mcp/server.mjs +8 -0
- package/package.json +1 -1
package/install-mcp.sh
CHANGED
|
@@ -333,6 +333,14 @@ fi
|
|
|
333
333
|
if [ "$INSTALL_MODE" = "local" ] && [ -f "$SCRIPT_DIR/mcp/server.mjs" ]; then
|
|
334
334
|
DRAFTED_MCP_COMMAND="$(command -v node)"
|
|
335
335
|
DRAFTED_MCP_ARGS_JSON="$(node -e 'console.log(JSON.stringify([process.argv[1]]))' "$SCRIPT_DIR/mcp/server.mjs")"
|
|
336
|
+
elif [ -n "${NPM_ROOT:-}" ] && [ -f "$MCP_SERVER_MODULE" ]; then
|
|
337
|
+
# Absolute node + server file, NOT the drafted-mcp shebang (#!/usr/bin/env node):
|
|
338
|
+
# GUI clients build their own PATH, and Claude Desktop put an old nvm Node (v16,
|
|
339
|
+
# no fetch) first, so every tool call failed as "unreachable" (2026-10-06). This
|
|
340
|
+
# is the node checked >= 22 above; the auto-updater re-runs this script, so the
|
|
341
|
+
# registration follows it if it moves.
|
|
342
|
+
DRAFTED_MCP_COMMAND="$(command -v node)"
|
|
343
|
+
DRAFTED_MCP_ARGS_JSON="$(node -e 'console.log(JSON.stringify([process.argv[1]]))' "$MCP_SERVER_MODULE")"
|
|
336
344
|
else
|
|
337
345
|
DRAFTED_MCP_COMMAND="$(command -v drafted-mcp)"
|
|
338
346
|
DRAFTED_MCP_ARGS_JSON="[]"
|
package/mcp/server.mjs
CHANGED
|
@@ -27,6 +27,14 @@ import { createGateState, markSearched, g1Block, g2Block, g3Block, selectWithinB
|
|
|
27
27
|
import { loadPersistedProject, savePersistedProject } from './active-project-store.mjs';
|
|
28
28
|
import { probeRepo, resolveAddress, addressNote } from './repo-address.mjs';
|
|
29
29
|
|
|
30
|
+
// Node 18+ only (global fetch). A GUI client that resolves an old Node (Claude
|
|
31
|
+
// Desktop put nvm v16 first on its PATH, 2026-10-06) otherwise fails every tool call
|
|
32
|
+
// as "unreachable" instead of saying why.
|
|
33
|
+
if (typeof fetch !== 'function') {
|
|
34
|
+
console.error(`Drafted MCP needs Node.js 18 or newer, but is running on ${process.version}. Re-run the Drafted installer, or point your MCP client at a newer node.`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
// Frame actions that mutate content — gated by G1 (wiki search before editing).
|
|
31
39
|
// Read-style actions (read, search, versions, get_*/read_*) are exempt.
|
|
32
40
|
const G1_MUTATING_FRAME_ACTIONS = new Set([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drafted",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.2",
|
|
4
4
|
"description": "Drafted — visual thinking surface for humans and AI agents. Renders HTML, markdown, images, and code as frames on a zoomable canvas, with MCP tools for AI agents and real-time sync for humans.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|