drafted 1.7.1 → 1.7.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/mcp/server.mjs +12 -1
- package/package.json +2 -2
package/mcp/server.mjs
CHANGED
|
@@ -22,6 +22,15 @@ import { LAYERS } from '../src/shared/constants.mjs';
|
|
|
22
22
|
|
|
23
23
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
24
24
|
|
|
25
|
+
// Read the npm package version once so the MCP server, get_org, and the
|
|
26
|
+
// `drafted://info` resource all report the same number — and it stays in
|
|
27
|
+
// sync with package.json automatically (no hardcoded duplicate).
|
|
28
|
+
const PACKAGE_VERSION = (() => {
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8')).version || 'unknown';
|
|
31
|
+
} catch { return 'unknown'; }
|
|
32
|
+
})();
|
|
33
|
+
|
|
25
34
|
// ── Per-instance session ──────────────────────────────────────────
|
|
26
35
|
// State is per-request via AsyncLocalStorage. Standalone modes (stdio, --http)
|
|
27
36
|
// share a process-wide default frame so the existing single-tenant behaviour
|
|
@@ -92,7 +101,7 @@ export function runWithRequestState(initial, fn) {
|
|
|
92
101
|
export function createMcpServer() {
|
|
93
102
|
const server = new McpServer({
|
|
94
103
|
name: 'drafted',
|
|
95
|
-
version:
|
|
104
|
+
version: PACKAGE_VERSION,
|
|
96
105
|
description: `Multi-tenant design workspace. Structure: Organization → Projects → Layers → Lanes → Frames.
|
|
97
106
|
|
|
98
107
|
An org contains projects. Each project has a zoomable canvas with frames (HTML files) organized as /{layer}/{lane}/{filename}. Layers are predefined categories (wireframes, designs, brand-assets, etc.), lanes are groups within a layer, and frames are the individual design files.
|
|
@@ -1201,6 +1210,7 @@ tool('get_org', {
|
|
|
1201
1210
|
activeOrg,
|
|
1202
1211
|
orgs,
|
|
1203
1212
|
members: members.map(m => ({ id: m.userId, name: m.username, email: m.email, role: m.role })),
|
|
1213
|
+
mcpVersion: PACKAGE_VERSION,
|
|
1204
1214
|
note: "activeOrg is the org bound to THIS MCP session — what mutations will actually target. To switch orgs without creating a project, call get_org(action=\"switch\", orgId=\"...\"). Browser tabs and other MCP sessions for the same user can be on different orgs.",
|
|
1205
1215
|
});
|
|
1206
1216
|
} catch (error) { return err(error); }
|
|
@@ -2264,6 +2274,7 @@ server.resource('info', 'drafted://info', {
|
|
|
2264
2274
|
uri: uri.href,
|
|
2265
2275
|
mimeType: 'application/json',
|
|
2266
2276
|
text: JSON.stringify({
|
|
2277
|
+
version: PACKAGE_VERSION,
|
|
2267
2278
|
layers: LAYERS,
|
|
2268
2279
|
pathFormat: '/{layer}/{lane}/{filename}',
|
|
2269
2280
|
tools: ['write', 'read', 'edit', 'ls', 'rm', 'mv'],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drafted",
|
|
3
|
-
"version": "1.7.
|
|
4
|
-
"description": "Drafted
|
|
3
|
+
"version": "1.7.2",
|
|
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": [
|
|
7
7
|
"cli/",
|