drafted 1.11.34 → 1.11.35

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/mcp/server.mjs +4 -2
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -1056,8 +1056,10 @@ async function connectAgentWs() {
1056
1056
  agentWs.on('close', () => {
1057
1057
  console.error('[MCP-WS] Disconnected, reconnecting in 5s...');
1058
1058
  agentWs = null;
1059
- // Server may have restarted invalidate session so ensureSession re-clones
1060
- getState().sessionId = null;
1059
+ // KEEP the cloned sessionId across disconnects/reconnects. Sessions live in Postgres
1060
+ // and survive server restarts, so reusing the clone keeps this agent's surface (and
1061
+ // its playful tab name) stable across blips — otherwise every reconnect re-clones a
1062
+ // fresh session → a NEW greyed tab with a NEW name. A real 401 still triggers re-clone.
1061
1063
  clearTimeout(agentWsReconnectTimer);
1062
1064
  agentWsReconnectTimer = setTimeout(() => {
1063
1065
  connectAgentWs().catch((e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.11.34",
3
+ "version": "1.11.35",
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": [