drafted 1.2.3 → 1.2.4

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 -0
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -1804,8 +1804,12 @@ tool('wiki', 'Per-org wiki. Markdown pages with paths as hierarchy. You and othe
1804
1804
  const withOrg = (result) => ({ ...result, org: orgCtx });
1805
1805
 
1806
1806
  // ── Skill gate: all mutation actions ──────────────────────────
1807
+ // Ensure the wiki-maintainer skill is attached to this org BEFORE the
1808
+ // gate check, so the gate fires reliably on the very first wiki call —
1809
+ // not just after the org has visited /wiki in a browser. Idempotent.
1807
1810
  const MUTATING = new Set(['write', 'edit', 'mv', 'rm', 'log']);
1808
1811
  if (MUTATING.has(action)) {
1812
+ try { await api('POST', '/api/wiki/_ensure-skill'); } catch { /* non-fatal */ }
1809
1813
  const skillErr = await checkOrgSkills(orgId, action);
1810
1814
  if (skillErr) return err(new Error(skillErr));
1811
1815
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "Drafted CLI - Design preview server for Claude agents",
5
5
  "type": "module",
6
6
  "files": [