drafted 1.11.0 → 1.11.2

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 +11 -3
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -565,10 +565,15 @@ 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
+ // Canonical org-scoped URL: /o/<org>/wiki/<path>. Portable across the viewer's
571
+ // orgs (wiki paths collide across orgs). `org` is the org id; the
572
+ // /o/<org>/wiki route resolves it id-first then slug. Falls back to bare /wiki
573
+ // (which 302s to the canonical form) when org is unknown.
574
+ const base = org ? `${getServerUrl()}/o/${encodeURIComponent(org)}/wiki` : `${getServerUrl()}/wiki`;
575
+ if (!normalized) return base;
576
+ return `${base}/${normalized.split('/').map(encodeURIComponent).join('/')}`;
572
577
  }
573
578
 
574
579
  function getBootstrapSessionId() {
@@ -2946,6 +2951,9 @@ tool('wiki', 'Per-org wiki. Markdown pages with paths as hierarchy. You and othe
2946
2951
  // Mutation responses include `org` so the agent always sees where the
2947
2952
  // write landed — eliminates silent cross-org confusion.
2948
2953
  const withOrg = (result) => ({ ...result, org: orgCtx });
2954
+ // Org-qualify every browser URL this tool emits (shadows the module fn for
2955
+ // all call sites below) so links are portable across the viewer's orgs.
2956
+ const wikiBrowserUrl = (p) => wikiPageUrl(p, orgId);
2949
2957
 
2950
2958
  // ── Skill gate: all mutation actions ──────────────────────────
2951
2959
  // 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.2",
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": [