drafted 1.19.29 → 1.19.30

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 +13 -1
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -3267,7 +3267,19 @@ tool('fs', 'Navigate Drafted like a local filesystem. A FOLDER is the single con
3267
3267
  // checkout you are sitting in. Refusing to SCOPE by that is the whole
3268
3268
  // point (it would be silent); refusing to NAME it is just unhelpful.
3269
3269
  // So lead with the likely answer and make the retry a copy-paste.
3270
- const likelyId = workingOrgId();
3270
+ let likelyId = workingOrgId();
3271
+ if (!likelyId) {
3272
+ // workingOrgId()'s repo rung is populated as a SIDE EFFECT of whoami,
3273
+ // so a session that searches before calling it gets no hint — and the
3274
+ // guard fires early, which makes that the common case, not the edge.
3275
+ // Resolve it here instead of depending on call order. getRepoAddress
3276
+ // is process-cached, so this costs nothing after the first hit.
3277
+ const addrNow = await getRepoAddress().catch(() => null);
3278
+ if (addrNow?.state === 'linked' && addrNow.orgId) {
3279
+ getSessionState().repoOrgId = addrNow.orgId; // and stop re-resolving
3280
+ likelyId = addrNow.orgId;
3281
+ }
3282
+ }
3271
3283
  const likely = likelyId ? orgs.find(o => o.id === likelyId) : null;
3272
3284
  const addr = (o) => o.slug || o.name || o.id;
3273
3285
  const others = orgs.filter(o => o.id !== likelyId).map(addr).filter(Boolean);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.19.29",
3
+ "version": "1.19.30",
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": [