drafted 1.12.6 → 1.12.7

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 +14 -2
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -200,7 +200,9 @@ IMPORTANT: Any URL containing /f/{uuid} is a Drafted frame link — ALWAYS use r
200
200
  }, {
201
201
  // Initialize instructions: the agent-identity contract, so an agent learns its own
202
202
  // tab name + the right way to read it WITHOUT having to "think to" call a tool.
203
- instructions: `SESSION IDENTITY — read this first: you run as a NAMED session tab visible to the user on their Drafted surface. Your session has a human-readable name (a Greek term, e.g. "Nous") — that name is how the user matches YOUR window to the tab they see, so identify yourself by it when it matters which agent you are. Read it from get_org (response field "session.name") or from the whoami tool; call whoami to refresh after a reconnect.`,
203
+ instructions: `SESSION IDENTITY — read this first: you run as a NAMED session tab visible to the user on their Drafted surface. Your session has a human-readable name (a Greek term, e.g. "Nous") — that name is how the user matches YOUR window to the tab they see, so identify yourself by it when it matters which agent you are. Read it from get_org (response field "session.name") or from the whoami tool; call whoami to refresh after a reconnect.
204
+
205
+ DUAL REGISTRATION IS NORMAL: a separate "Drafted" remote connector (https://drafted.live/mcp, managed by claude.ai) may appear alongside this local stdio server in MCP listings. It is NOT a duplicate and NOT broken — it serves claude.ai web/mobile/Cowork, where a local stdio process cannot run. Never advise removing it; a "needs authentication" state on it is fixed by signing in from claude.ai and does not affect this stdio session.`,
204
206
  });
205
207
 
206
208
  const layerKeys = Object.keys(LAYERS);
@@ -1540,11 +1542,17 @@ async function sessionSurfaceBlock() {
1540
1542
  // No WS ack yet — best-effort identity from /auth/me so callers still get a userId/org.
1541
1543
  const cookieSid = sessionId || getBootstrapSessionId();
1542
1544
  let me = null;
1545
+ let unreachable = false;
1543
1546
  if (cookieSid) {
1544
1547
  try {
1545
1548
  const res = await fetch(`${getServerUrl()}/auth/me`, { headers: { Cookie: `gc_session=${cookieSid}` } });
1546
1549
  if (res.ok) me = await res.json();
1547
- } catch { /* not yet authenticated */ }
1550
+ } catch {
1551
+ // Transport failure, NOT a sign-out. Conflating the two made agents tell
1552
+ // users "you're signed out" during a network blip and start needless
1553
+ // re-logins — surface the distinction instead.
1554
+ unreachable = true;
1555
+ }
1548
1556
  }
1549
1557
  return {
1550
1558
  sessionId: cookieSid,
@@ -1556,6 +1564,10 @@ async function sessionSurfaceBlock() {
1556
1564
  color: null,
1557
1565
  surfaced: false,
1558
1566
  alive: false,
1567
+ ...(unreachable ? {
1568
+ serverUnreachable: true,
1569
+ note: `Could not reach ${getServerUrl()} — identity UNKNOWN, not signed out. This is a network/transport failure: do not tell the user they are logged out and do not start a new login; retry when connectivity is back.`,
1570
+ } : {}),
1559
1571
  };
1560
1572
  }
1561
1573
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.12.6",
3
+ "version": "1.12.7",
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": [