drafted 1.7.0 → 1.7.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 +13 -2
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -1756,6 +1756,7 @@ tool('skill', 'Manage the Drafted skill library. Skills are reusable prompts/gui
1756
1756
  limit: z.number().optional().describe('[search] max results (default 25, max 100)'),
1757
1757
  skill: z.string().optional().describe('[load] skill ID (UUID) or slug'),
1758
1758
  skillId: z.string().optional().describe('[update|remove|attach|detach|favorite|unfavorite|read_file|update_file] skill ID'),
1759
+ projectId: z.string().optional().describe('[list] project to list skills for (defaults to active project; falls back to org-attached skills if no project)'),
1759
1760
  name: z.string().optional().describe('[add|update] skill name'),
1760
1761
  description: z.string().optional().describe('[add|update] one-line description'),
1761
1762
  content: z.string().optional().describe('[add|update] root SKILL.md content; [update_file] file content'),
@@ -1792,8 +1793,18 @@ tool('skill', 'Manage the Drafted skill library. Skills are reusable prompts/gui
1792
1793
  return ok(result);
1793
1794
  }
1794
1795
  case 'list': {
1795
- if (!getState().projectId) throw new Error('No active project. Call project(action="open") first.');
1796
- return ok(await api('GET', `/api/projects/${getState().projectId}/skills`));
1796
+ // Prefer the explicit projectId param; otherwise the active project;
1797
+ // otherwise fall back to org-attached skills so list works in
1798
+ // empty-org / wiki-only sessions where there's no project to bind to.
1799
+ const explicit = args.projectId;
1800
+ const active = getState().projectId;
1801
+ if (explicit || active) {
1802
+ const pid = explicit || active;
1803
+ return ok(await api('GET', `/api/projects/${pid}/skills`));
1804
+ }
1805
+ const orgId = await getCurrentOrgId();
1806
+ if (!orgId) throw new Error('No active org. Call get_org first or pass projectId.');
1807
+ return ok(await api('GET', `/api/orgs/${orgId}/skills`));
1797
1808
  }
1798
1809
  case 'add': {
1799
1810
  const { name, description, content, tags, triggerPatterns } = args;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Drafted CLI - Design preview server for Claude agents",
5
5
  "type": "module",
6
6
  "files": [