drafted 1.22.4 → 1.22.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.
- package/cli/drafted.mjs +3 -3
- package/mcp/server.mjs +6 -3
- package/package.json +18 -86
package/cli/drafted.mjs
CHANGED
|
@@ -483,7 +483,7 @@ program
|
|
|
483
483
|
server: serverUrl,
|
|
484
484
|
updatedAt: new Date().toISOString(),
|
|
485
485
|
});
|
|
486
|
-
jsonOut(true, 'login', {
|
|
486
|
+
jsonOut(true, 'login', { userId: data.userId || null });
|
|
487
487
|
console.log('✅ This computer is linked to your Drafted account.');
|
|
488
488
|
return;
|
|
489
489
|
}
|
|
@@ -498,7 +498,7 @@ program
|
|
|
498
498
|
});
|
|
499
499
|
if (meRes.ok) {
|
|
500
500
|
const me = await meRes.json();
|
|
501
|
-
jsonOut(true, 'login', {
|
|
501
|
+
jsonOut(true, 'login', { userId: me.userId || existing.userId || null });
|
|
502
502
|
console.log('✅ Already logged in.');
|
|
503
503
|
console.log(` User: ${me.userEmail || me.userId || 'unknown'}`);
|
|
504
504
|
console.log(' Run `drafted logout` to sign out.');
|
|
@@ -578,7 +578,7 @@ program
|
|
|
578
578
|
server: serverUrl,
|
|
579
579
|
updatedAt: new Date().toISOString(),
|
|
580
580
|
});
|
|
581
|
-
jsonOut(true, 'login', {
|
|
581
|
+
jsonOut(true, 'login', { userId: data.userId || null });
|
|
582
582
|
console.log('');
|
|
583
583
|
console.log('✅ Logged in successfully!');
|
|
584
584
|
if (data.userId) {
|
package/mcp/server.mjs
CHANGED
|
@@ -2499,7 +2499,8 @@ if (!isRemote) tool('auth', 'Sign in to Drafted.\n\n`action=get_link` ALWAYS ret
|
|
|
2499
2499
|
await cloneSession();
|
|
2500
2500
|
connectAgentWs();
|
|
2501
2501
|
|
|
2502
|
-
|
|
2502
|
+
// Never echo data.sessionId: it is the credential, and tool results land in transcripts.
|
|
2503
|
+
return ok({ status: 'logged_in', userId: data.userId });
|
|
2503
2504
|
}
|
|
2504
2505
|
|
|
2505
2506
|
if (data.status === 'expired') throw new Error('Device code expired. Try again.');
|
|
@@ -2517,7 +2518,9 @@ if (!isRemote) tool('auth', 'Sign in to Drafted.\n\n`action=get_link` ALWAYS ret
|
|
|
2517
2518
|
// Shared by `whoami` AND surfaced in `get_org`'s response so an agent learns its name
|
|
2518
2519
|
// from the tool it already calls — it must not have to "think to" ask.
|
|
2519
2520
|
async function sessionSurfaceBlock() {
|
|
2520
|
-
|
|
2521
|
+
// The surface's row id (identity). Never fall back to the state session value: that is the
|
|
2522
|
+
// CREDENTIAL, and this block is returned to the agent's transcript.
|
|
2523
|
+
const sessionId = agentSurface?.sessionId || null;
|
|
2521
2524
|
if (agentSurface) {
|
|
2522
2525
|
return {
|
|
2523
2526
|
sessionId,
|
|
@@ -2793,7 +2796,7 @@ tool('session', 'Manage THIS agent session. `action="name"` sets/renames it —
|
|
|
2793
2796
|
agentSurface.nameRequired = false;
|
|
2794
2797
|
agentSurface.capital = ((result?.name || String(name).trim())[0] || '').toUpperCase();
|
|
2795
2798
|
}
|
|
2796
|
-
return ok({ sessionId:
|
|
2799
|
+
return ok({ sessionId: agentSurface?.sessionId || null, name: result?.name || String(name).trim(), named: true });
|
|
2797
2800
|
} catch (error) { return err(error); }
|
|
2798
2801
|
});
|
|
2799
2802
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drafted",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.6",
|
|
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
|
+
"bin": {
|
|
7
|
+
"drafted": "./cli/drafted.mjs",
|
|
8
|
+
"drafted-mcp": "./mcp/server.mjs"
|
|
9
|
+
},
|
|
6
10
|
"files": [
|
|
7
11
|
"cli/",
|
|
8
12
|
"mcp/",
|
|
@@ -13,100 +17,28 @@
|
|
|
13
17
|
"plugin/commands/",
|
|
14
18
|
"install-mcp.sh"
|
|
15
19
|
],
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
"scripts": {
|
|
21
|
-
"dev": "./dev.sh",
|
|
22
|
-
"dev:server": "tsx watch --import ./server/instrument.mjs server/server.mjs",
|
|
23
|
-
"dev:local": "node server/server-local.mjs",
|
|
24
|
-
"install-global": "npm install -g .",
|
|
25
|
-
"db:migrate": "psql $DATABASE_URL -f drizzle/migrate.sql",
|
|
26
|
-
"db:push": "drizzle-kit push",
|
|
27
|
-
"db:studio": "drizzle-kit studio",
|
|
28
|
-
"migrate-fs": "tsx server/migrate-fs.ts",
|
|
29
|
-
"db:clean-sessions": "tsx src/auth/cleanup.ts",
|
|
30
|
-
"import:legacy": "tsx scripts/import-legacy.mts",
|
|
31
|
-
"test": "vitest run",
|
|
32
|
-
"test:watch": "vitest",
|
|
33
|
-
"version": "node scripts/sync-versions.mjs && git add plugin/.claude-plugin/plugin.json .claude-plugin/marketplace.json web-plugin/plugin/.claude-plugin/plugin.json web-plugin/.claude-plugin/marketplace.json",
|
|
34
|
-
"version:check": "node scripts/sync-versions.mjs",
|
|
35
|
-
"postpublish": "bash scripts/sync-plugin.sh \"chore: sync plugin to v$npm_package_version\" && bash scripts/sync-web-plugin.sh \"chore: sync web-plugin to v$npm_package_version\"",
|
|
36
|
-
"deploy:check:google": "node scripts/check-google-drive-deploy.mjs",
|
|
37
|
-
"build:excalidraw": "node scripts/build-excalidraw-editor.mjs",
|
|
38
|
-
"build:office-viewer": "node scripts/build-office-viewer.mjs",
|
|
39
|
-
"prepublishOnly": "node scripts/check-npm-package.mjs",
|
|
40
|
-
"test:marketing": "node server/lib/marketing/test-marketing.mjs"
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/ddfourtwo/drafted.git"
|
|
41
24
|
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"design",
|
|
27
|
+
"canvas",
|
|
28
|
+
"preview",
|
|
29
|
+
"html",
|
|
30
|
+
"claude"
|
|
31
|
+
],
|
|
42
32
|
"dependencies": {
|
|
43
|
-
"@aws-sdk/client-s3": "^3.1007.0",
|
|
44
|
-
"@aws-sdk/s3-request-presigner": "^3.1008.0",
|
|
45
|
-
"@clerk/backend": "^3.2.12",
|
|
46
|
-
"@clerk/express": "^2.1.4",
|
|
47
|
-
"@clerk/mcp-tools": "^0.3.1",
|
|
48
|
-
"@excalidraw/excalidraw": "^0.18.1",
|
|
49
33
|
"@modelcontextprotocol/ext-apps": "^1.6.0",
|
|
50
34
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
51
|
-
"@sentry/browser": "^10.53.1",
|
|
52
|
-
"@sentry/node": "^10.53.1",
|
|
53
|
-
"@xmldom/xmldom": "^0.9.10",
|
|
54
35
|
"commander": "^11.1.0",
|
|
55
|
-
"dagre": "^0.8.5",
|
|
56
|
-
"docx": "^9.7.1",
|
|
57
|
-
"dotenv": "^17.3.1",
|
|
58
|
-
"drizzle-orm": "^0.45.1",
|
|
59
|
-
"esbuild": "^0.28.0",
|
|
60
|
-
"exceljs": "^4.4.0",
|
|
61
|
-
"express": "^4.18.2",
|
|
62
|
-
"jszip": "^3.10.1",
|
|
63
|
-
"lucide": "^1.16.0",
|
|
64
|
-
"mdast-util-from-markdown": "^2.0.3",
|
|
65
|
-
"multer": "^2.1.1",
|
|
66
|
-
"nodemailer": "^10.0.13",
|
|
67
|
-
"parse5": "^8.0.1",
|
|
68
|
-
"pg": "^8.20.0",
|
|
69
|
-
"playwright": "^1.58.2",
|
|
70
|
-
"puppeteer": "^25.12.0",
|
|
71
36
|
"qrcode-terminal": "^0.12.0",
|
|
72
|
-
"react": "^18.3.1",
|
|
73
|
-
"react-dom": "^18.3.1",
|
|
74
|
-
"sharp": "^0.35.5",
|
|
75
37
|
"ws": "^8.21.3",
|
|
76
38
|
"yaml": "^2.8.3",
|
|
77
39
|
"zod": "^4.3.6"
|
|
78
40
|
},
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"nanoid": "^3.3.19"
|
|
82
|
-
},
|
|
83
|
-
"@excalidraw/mermaid-to-excalidraw": {
|
|
84
|
-
"nanoid": "^5.1.16"
|
|
85
|
-
},
|
|
86
|
-
"immutable": "^4.3.9",
|
|
87
|
-
"lodash-es": "^4.18.1"
|
|
88
|
-
},
|
|
89
|
-
"keywords": [
|
|
90
|
-
"design",
|
|
91
|
-
"canvas",
|
|
92
|
-
"preview",
|
|
93
|
-
"html",
|
|
94
|
-
"claude"
|
|
95
|
-
],
|
|
96
|
-
"author": "ddfourtwo",
|
|
97
|
-
"repository": {
|
|
98
|
-
"type": "git",
|
|
99
|
-
"url": "git+https://github.com/ddfourtwo/drafted.git"
|
|
100
|
-
},
|
|
101
|
-
"license": "MIT",
|
|
102
|
-
"devDependencies": {
|
|
103
|
-
"@types/express": "^5.0.6",
|
|
104
|
-
"@types/nodemailer": "^7.0.11",
|
|
105
|
-
"@types/pg": "^8.18.0",
|
|
106
|
-
"docx-preview": "^0.3.7",
|
|
107
|
-
"drizzle-kit": "^0.31.9",
|
|
108
|
-
"tsx": "^4.19.0",
|
|
109
|
-
"typescript": "^5.9.3",
|
|
110
|
-
"vitest": "^3.2.4"
|
|
41
|
+
"scripts": {
|
|
42
|
+
"postpublish": "bash ../scripts/sync-plugin.sh \"chore: sync plugin to v$npm_package_version\" && bash ../scripts/sync-web-plugin.sh \"chore: sync web-plugin to v$npm_package_version\""
|
|
111
43
|
}
|
|
112
44
|
}
|