drafted 1.12.3 → 1.12.5
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.
- package/install-mcp.sh +10 -1
- package/mcp/server.mjs +6 -3
- package/package.json +1 -1
package/install-mcp.sh
CHANGED
|
@@ -692,6 +692,13 @@ install_desktop_app() {
|
|
|
692
692
|
# Clear quarantine so Gatekeeper doesn't block a freshly downloaded bundle.
|
|
693
693
|
xattr -dr com.apple.quarantine "$app_bundle" >/dev/null 2>&1 || true
|
|
694
694
|
|
|
695
|
+
# Kill any already-running instance first — including a stray one that isn't
|
|
696
|
+
# launchd-managed (e.g. left over from a prior run of this same installer,
|
|
697
|
+
# before this pkill existed: `open` below used to spawn a second, untracked
|
|
698
|
+
# process alongside the launchd-supervised one, and `launchctl bootout` only
|
|
699
|
+
# ever stops the launchd-managed process, not that rogue one).
|
|
700
|
+
pkill -x "$exe_name" >/dev/null 2>&1 || true
|
|
701
|
+
|
|
695
702
|
# Register run-at-login for the new app (mirrors the legacy launch agent).
|
|
696
703
|
uid="$(id -u)"
|
|
697
704
|
plist="$HOME/Library/LaunchAgents/live.drafted.desktop.plist"
|
|
@@ -714,9 +721,11 @@ install_desktop_app() {
|
|
|
714
721
|
</dict>
|
|
715
722
|
</plist>
|
|
716
723
|
PLIST
|
|
724
|
+
# launchctl bootstrap + RunAtLoad is the sole launch path — it already starts
|
|
725
|
+
# the app, so a trailing `open "$app_bundle"` here would start a second,
|
|
726
|
+
# launchd-unaware process every time this function runs (that was the bug).
|
|
717
727
|
launchctl bootout "gui/$uid" "$plist" >/dev/null 2>&1 || true
|
|
718
728
|
launchctl bootstrap "gui/$uid" "$plist" >/dev/null 2>&1 || true
|
|
719
|
-
open "$app_bundle" >/dev/null 2>&1 || true
|
|
720
729
|
return 0
|
|
721
730
|
}
|
|
722
731
|
|
package/mcp/server.mjs
CHANGED
|
@@ -3113,7 +3113,7 @@ tool('skill', 'Manage the Drafted skill library. Skills are reusable prompts/gui
|
|
|
3113
3113
|
path: z.string().optional().describe('[read_file|update_file] relative path inside skill directory (e.g. "examples/react.md")'),
|
|
3114
3114
|
offset: z.number().optional().describe('[search|list] skip N results for pagination; [read_file] start reading at this byte offset (default 0) — for large files (e.g. a >90KB app-frame bundle) read in chunks using the returned nextOffset until truncated=false'),
|
|
3115
3115
|
maxBytes: z.number().optional().describe('[read_file] return at most this many bytes from offset (default: whole remaining file). Response reports totalSize/offset/truncated/nextOffset.'),
|
|
3116
|
-
org: z.string().optional().describe('[fork|push|update] resolve/fork into this Drafted org (id or name); scopes the request without switching the active org'),
|
|
3116
|
+
org: z.string().optional().describe('[add] org (id or name) to create the skill in — defaults to the bound/active org; [fork|push|update] resolve/fork into this Drafted org (id or name); scopes the request without switching the active org'),
|
|
3117
3117
|
setup: z.array(z.string()).optional().describe('[add|update] setup command(s) (in order) run on materialize to build a source-only skill, e.g. ["npm ci","npm run build"]'),
|
|
3118
3118
|
files: z.array(z.object({ path: z.string(), content: z.string() })).optional().describe('[push] source files to push (path + UTF-8 content); server strips artifacts + enforces caps'),
|
|
3119
3119
|
dir: z.string().optional().describe('[push] local directory to push instead of files[]; walked locally (heavy dirs, .skillinstall/, and .skillignore pre-filtered), server re-enforces. On push the dir\'s .gitignore is auto-updated to exclude .skillinstall/ (the rebuildable bundle).'),
|
|
@@ -3194,13 +3194,16 @@ tool('skill', 'Manage the Drafted skill library. Skills are reusable prompts/gui
|
|
|
3194
3194
|
case 'add': {
|
|
3195
3195
|
const g2 = g2Block(getSessionState().gates);
|
|
3196
3196
|
if (g2) return err(new Error(g2));
|
|
3197
|
-
const { name, description, content, tags, triggerPatterns, setup } = args;
|
|
3197
|
+
const { name, description, content, tags, triggerPatterns, setup, org } = args;
|
|
3198
3198
|
if (!name || !description || !content) throw new Error('name, description, content required for action=add');
|
|
3199
3199
|
const body = { name, description, content };
|
|
3200
3200
|
if (tags) body.tags = tags;
|
|
3201
3201
|
if (triggerPatterns) body.triggerPatterns = triggerPatterns;
|
|
3202
3202
|
if (setup !== undefined) body.setup = setup;
|
|
3203
|
-
|
|
3203
|
+
// org names where the skill is born (UUID-first model: org is explicit at
|
|
3204
|
+
// create) — without this the bound-org guard accepts org= but the write
|
|
3205
|
+
// would land in the session org anyway.
|
|
3206
|
+
return ok(await api('POST', '/api/skills', body, org ? { 'X-Drafted-Org': org } : {}));
|
|
3204
3207
|
}
|
|
3205
3208
|
case 'update': {
|
|
3206
3209
|
// Auto-fork-on-update (tool behavior): if the target is read-only (global/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drafted",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.5",
|
|
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": [
|