drafted 1.7.9 → 1.7.11

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 +6 -3
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -980,12 +980,13 @@ tool('project', 'START HERE for project management. Dispatch by `action`: list (
980
980
  } catch (error) { return err(error); }
981
981
  });
982
982
 
983
- tool('template', 'Manage project templates in the org. Dispatch by `action`: list/create/update/delete/fork. A template bundles layer definitions that new projects can be created from.', {
983
+ tool('template', 'Manage project templates in the org. Dispatch by `action`: list/create/update/delete/fork. A template bundles layer definitions and an optional list of skill slugs that auto-attach to projects created from it.', {
984
984
  action: z.enum(['list', 'create', 'update', 'delete', 'fork']).describe('Operation to perform.'),
985
985
  templateId: z.string().optional().describe('[update|delete|fork] template ID'),
986
986
  name: z.string().optional().describe('[create|update|fork] template name (required for create; optional rename for fork)'),
987
987
  description: z.string().optional().describe('[create|update] template description'),
988
988
  layers: z.array(z.object({}).passthrough()).optional().describe('[create|update] array of layer definitions'),
989
+ skillSlugs: z.array(z.string()).optional().describe('[create|update] skill slugs to auto-attach to projects created from this template. Slugs are resolved against the org\'s skills (org-local first, built-in fallback) at project-create time; missing slugs are silently skipped. Pass an empty array on update to clear.'),
989
990
  visibility: z.string().optional().describe('[create|update] "org" or "public"'),
990
991
  }, async (args) => {
991
992
  try {
@@ -994,19 +995,21 @@ tool('template', 'Manage project templates in the org. Dispatch by `action`: lis
994
995
  case 'list':
995
996
  return ok(await api('GET', '/api/templates'));
996
997
  case 'create': {
997
- const { name, description, layers, visibility } = args;
998
+ const { name, description, layers, skillSlugs, visibility } = args;
998
999
  if (!name || !description || !layers) throw new Error('name, description, layers required for action=create');
999
1000
  const body = { name, description, layers };
1001
+ if (Array.isArray(skillSlugs)) body.skillSlugs = skillSlugs;
1000
1002
  if (visibility) body.visibility = visibility;
1001
1003
  return ok(await api('POST', '/api/templates', body));
1002
1004
  }
1003
1005
  case 'update': {
1004
- const { templateId, name, description, layers, visibility } = args;
1006
+ const { templateId, name, description, layers, skillSlugs, visibility } = args;
1005
1007
  if (!templateId) throw new Error('templateId required for action=update');
1006
1008
  const body = {};
1007
1009
  if (name) body.name = name;
1008
1010
  if (description) body.description = description;
1009
1011
  if (layers) body.layers = layers;
1012
+ if (Array.isArray(skillSlugs)) body.skillSlugs = skillSlugs;
1010
1013
  if (visibility) body.visibility = visibility;
1011
1014
  if (Object.keys(body).length === 0) throw new Error('At least one field is required for action=update');
1012
1015
  return ok(await api('PUT', `/api/templates/${templateId}`, body));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.7.9",
3
+ "version": "1.7.11",
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": [