drafted 1.14.7 → 1.14.8

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/cli/drafted.mjs +10 -4
  2. package/package.json +1 -1
package/cli/drafted.mjs CHANGED
@@ -1591,9 +1591,12 @@ async function syncOneSkill(ref, outDir, org) {
1591
1591
  mkdirSync(dirname(full), { recursive: true });
1592
1592
  writeFileSync(full, content);
1593
1593
  }
1594
- // createdBy lets the caller decide whether to auto-run this skill's setup: shell authored
1595
- // by someone else must not run unattended on sync (RCE via a teammate's/forked skill).
1596
- return { ref, slug, hash, status: 'ok', createdBy: skill.createdBy ?? null };
1594
+ // createdBy + forkedFrom decide whether this skill's setup may auto-run: shell authored by
1595
+ // someone else must not run unattended on sync. forkedFrom is load-bearing — the CLI/MCP
1596
+ // AUTO-forks a global/other-org skill on use, which copies the source author's setup but
1597
+ // stamps createdBy = the forking (victim) user, so createdBy alone would mislabel foreign
1598
+ // setup as self-authored. A forked skill is never treated as self-authored.
1599
+ return { ref, slug, hash, status: 'ok', createdBy: skill.createdBy ?? null, forkedFrom: skill.forkedFrom ?? null };
1597
1600
  }
1598
1601
 
1599
1602
  const skillCmd = program.command('skill').description('Skill library operations');
@@ -1626,7 +1629,10 @@ skillCmd
1626
1629
  // authored by another org member, a fork, or an imported bundle must NOT run their
1627
1630
  // shell unattended (Causeway auto-syncs pinned skills), or a teammate's skill is
1628
1631
  // RCE on this host. `--allow-untrusted-setup` is the explicit opt-in.
1629
- const selfAuthored = r.createdBy && auth?.userId && r.createdBy === auth.userId;
1632
+ // Self-authored = created by me AND not a fork (a fork carries another author's
1633
+ // setup under my createdBy — see syncOneSkill). Forks/other-authored require the
1634
+ // explicit opt-in.
1635
+ const selfAuthored = r.createdBy && auth?.userId && r.createdBy === auth.userId && !r.forkedFrom;
1630
1636
  if (selfAuthored || opts.allowUntrustedSetup) {
1631
1637
  const s = runSkillSetup(join(opts.out, r.slug));
1632
1638
  r.setup = s.skipped ? 'none' : (s.ok ? 'ok' : 'failed');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.14.7",
3
+ "version": "1.14.8",
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": [