drafted 1.14.30 → 1.16.0

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 +16 -7
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -2054,7 +2054,7 @@ tool('project', 'START HERE for project management. Dispatch by `action`: list (
2054
2054
  description: z.string().nullable().optional().describe('[create|update] project description'),
2055
2055
  templateSlug: z.string().optional().describe('[create] template slug (e.g. "web-design", "mobile-app", "landing-page")'),
2056
2056
  org: z.string().optional().describe('[create] org slug or id the project is born in. Defaults to this session\'s org (the open project\'s org, else the default org).'),
2057
- folder: z.string().nullable().optional().describe('[update] folder name (null to remove from folder)'),
2057
+ folder: z.string().nullable().optional().describe('[update] folder name (null to remove from folder). Pass "Archive" to archive: the project drops out of search and the active list but is never deleted and can be restored by a human.'),
2058
2058
  layers: z.array(z.object({}).passthrough()).optional().describe('[update] full layers array replacement. Use ls / to read current layers first.'),
2059
2059
  targetOrgId: z.string().optional().describe('[move] destination organization ID. Get org IDs from action=list (each project has an orgId field) or get_org. Both source and target org must include the current user.'),
2060
2060
  format: z.string().optional().describe('[export] "files" returns {files:[{path,content}]} paginated via limit/offset (compact=true for paths only) instead of writing a local dir (stdio) or returning a download URL (remote).'),
@@ -2201,7 +2201,14 @@ tool('project', 'START HERE for project management. Dispatch by `action`: list (
2201
2201
  if (!projectId) throw new Error('projectId required for action=update');
2202
2202
  const body = {};
2203
2203
  if (name !== undefined) body.name = name;
2204
- if (folder !== undefined) body.folder = folder;
2204
+ if (folder !== undefined) {
2205
+ // "Archive" is the agent-facing name for the reserved __archived folder:
2206
+ // archived projects drop out of search and the active list but are never
2207
+ // deleted, so an agent can safely archive a project it created in error
2208
+ // and a human can always restore it. Pass any other folder name to file,
2209
+ // or null to remove from a folder.
2210
+ body.folder = folder === 'Archive' ? '__archived' : folder;
2211
+ }
2205
2212
  if (description !== undefined) body.description = description;
2206
2213
  if (layers) body.layers = layers;
2207
2214
  if (Object.keys(body).length === 0) throw new Error('At least one field (name, folder, description, layers) is required for action=update');
@@ -2959,8 +2966,9 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
2959
2966
  lineHash: z.string().describe('The full line anchor copied verbatim from read output — line number + 3-char hash, e.g. "182vix" (the token left of the "|"). NOT the bare hash "vix": that is rejected, since the same hash can recur on multiple lines.'),
2960
2967
  newContent: z.string().optional().describe('New content (for replace, insertAfter, insertBefore)'),
2961
2968
  })).optional().describe('[edit] hashline edit operations'),
2962
- from: z.string().optional().describe('[mv] source path /{layer}/{lane}/{filename}'),
2963
- to: z.string().optional().describe('[mv] destination path /{layer}/{lane}/{filename}'),
2969
+ from: z.string().optional().describe('[mv] source path: /{layer}/{lane}/{filename} for a frame, /{layer}/{lane} for a lane, /{layer} for a whole layer (lane/layer require toProjectId)'),
2970
+ to: z.string().optional().describe('[mv] destination path /{layer}/{lane}/{filename} — the layer segment is always required and explicit'),
2971
+ toProjectId: z.string().optional().describe('[mv] move ACROSS projects: destination project UUID/slug/name. Same-org only. Frame ids and version history follow; frame-scoped shares, public links, and lane share tokens are NOT carried into the destination project. Omit for the classic in-project rename/move.'),
2964
2972
  dryRun: z.boolean().optional().describe('[mv] preview the move without applying it; returns the resolved frame and current path so you can confirm before retrying with dryRun=false.'),
2965
2973
  anchored: z.boolean().optional().describe('[anchor] true to anchor, false to unanchor. Anchored frames MUST be read before writing/editing in the same layer.'),
2966
2974
  query: z.string().optional().describe('[search] term to match against frame names'),
@@ -3320,7 +3328,7 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
3320
3328
  });
3321
3329
  }
3322
3330
  case 'mv': {
3323
- const { from, to, dryRun = false } = args;
3331
+ const { from, to, toProjectId, dryRun = false } = args;
3324
3332
  if (!from || !to) throw new Error('from and to required for action=mv');
3325
3333
  if (dryRun) {
3326
3334
  // Resolve current frame at `from`. Don't apply the rename, just
@@ -3330,11 +3338,12 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
3330
3338
  dryRun: true,
3331
3339
  from,
3332
3340
  to,
3341
+ toProjectId: toProjectId || undefined,
3333
3342
  currentFrame: current?.frame || current,
3334
- note: 'No changes applied. Re-call with dryRun=false (or omit) to perform the rename.',
3343
+ note: 'No changes applied. Re-call with dryRun=false (or omit) to perform the move.',
3335
3344
  }));
3336
3345
  }
3337
- return ok(withProject(await api('POST', '/api/fs/mv', { from, to })));
3346
+ return ok(withProject(await api('POST', '/api/fs/mv', { from, to, ...(toProjectId ? { toProjectId } : {}) })));
3338
3347
  }
3339
3348
  case 'anchor': {
3340
3349
  const { path, anchored } = args;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.14.30",
3
+ "version": "1.16.0",
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": [