drafted 1.11.0 → 1.11.1

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 +10 -3
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -565,10 +565,14 @@ function reportMcpToolError(tool, error) {
565
565
  });
566
566
  }
567
567
 
568
- function wikiBrowserUrl(path = '') {
568
+ function wikiPageUrl(path = '', org = '') {
569
569
  const normalized = normalizeWikiPath(path || '');
570
- if (!normalized) return `${getServerUrl()}/wiki`;
571
- return `${getServerUrl()}/wiki/${normalized.split('/').map(encodeURIComponent).join('/')}`;
570
+ // Org-qualify so the link resolves to this org's wiki regardless of the
571
+ // viewer's current active org (wiki paths collide across orgs). The /wiki
572
+ // route resolves ?org id-first then slug.
573
+ const q = org ? `?org=${encodeURIComponent(org)}` : '';
574
+ if (!normalized) return `${getServerUrl()}/wiki${q}`;
575
+ return `${getServerUrl()}/wiki/${normalized.split('/').map(encodeURIComponent).join('/')}${q}`;
572
576
  }
573
577
 
574
578
  function getBootstrapSessionId() {
@@ -2946,6 +2950,9 @@ tool('wiki', 'Per-org wiki. Markdown pages with paths as hierarchy. You and othe
2946
2950
  // Mutation responses include `org` so the agent always sees where the
2947
2951
  // write landed — eliminates silent cross-org confusion.
2948
2952
  const withOrg = (result) => ({ ...result, org: orgCtx });
2953
+ // Org-qualify every browser URL this tool emits (shadows the module fn for
2954
+ // all call sites below) so links are portable across the viewer's orgs.
2955
+ const wikiBrowserUrl = (p) => wikiPageUrl(p, orgId);
2949
2956
 
2950
2957
  // ── Skill gate: all mutation actions ──────────────────────────
2951
2958
  // Ensure the wiki-maintainer skill is attached to this org BEFORE the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.11.0",
3
+ "version": "1.11.1",
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": [