drafted 1.18.0 → 1.18.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 +10 -3
  2. package/package.json +1 -1
package/mcp/server.mjs CHANGED
@@ -350,7 +350,7 @@ const TOOL_ANNOTATIONS = {
350
350
  minion: { title: 'Minions', readOnlyHint: false, destructiveHint: true, openWorldHint: false, description: 'Manage Minions: checklist-driven intake surfaces that guide a consumer through a checklist (via a shareable /c/<slug> link) and write a producible into the project. Dispatch by `action`: meta, list, get, create, update, enable, disable, delete. QA your own Minions with test_start/test_say/test_resolve — drive the checklist conversation yourself (works even when disabled). Requires the agent allowlist.' },
351
351
  trigger: { title: 'Inbound triggers', readOnlyHint: false, destructiveHint: true, openWorldHint: true, description: 'Manage inbound webhook triggers for the ACTIVE PROJECT: an external system (AppSheet bot, GitHub, form tool) POSTs to the trigger URL and the server runs an agent conversation in the project from the stored prompt template + payload. Dispatch by `action`: create (returns URL + secret token ONCE — relay it to the user immediately, not retrievable later), list, update (enable/disable, edit template, daily limit, executor), rotate (new token), test (fire a synthetic delivery), deliveries (audit log), delete; for executor="queue" triggers, pending/claim/complete let a LOCAL agent poll and work queued deliveries. Requires the agent allowlist.' },
352
352
  fs: { title: 'Filesystem', readOnlyHint: false, destructiveHint: true, openWorldHint: false, description: 'Navigate Drafted like a local filesystem: /wiki/<path> pages, /skills/<slug> procedures, /projects/<folder?>/<project>/<layer>/<lane>/<file> frames. Verbs: ls, read, write, edit, mv, rm, search.' },
353
- repo: { title: 'Git repos', readOnlyHint: false, destructiveHint: true, openWorldHint: true, description: 'Registered git repos — the org index of .agents/ skills + identities. A connected repo is the source of truth for its skills; authoring a Drafted skill whose slug collides with a repo-indexed skill returns 409 repo_owned pointing at the repo. Dispatch by `action`: list (paginated, compact mode), add (link a repo to a folder, --branch optional), rescan (re-fetch the tracked branch), entries (search the index). Content stays in git; Drafted keeps a read-only index.' },
353
+ repo: { title: 'Git repos', readOnlyHint: false, destructiveHint: true, openWorldHint: true, description: 'Registered git repos — the org index of .agents/ skills + identities. A connected repo is the source of truth for its skills; EVERY repo connected to ANY folder in the org is searchable and usable org-wide (no org-level repo — the union is the library). Skills from connected repos are readable via fs(read, path="/skills/<slug>") — fetched from git at read time, always fresh. Authoring a Drafted skill whose slug collides with a repo-indexed skill returns 409 repo_owned pointing at the repo. Dispatch by `action`: list (paginated, compact mode), add (link a repo to a folder, --branch optional), rescan (re-fetch the tracked branch), entries (search the index). Content stays in git; Drafted keeps a read-only index.' },
354
354
  };
355
355
 
356
356
  function isMutatingToolCall(name, args = {}) {
@@ -2927,8 +2927,15 @@ tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder:
2927
2927
  }
2928
2928
  case 'read': {
2929
2929
  if (!slug) return err(new Error('read /skills/<slug>'));
2930
- const s = await api('GET', `/api/skills/slug/${slug}`, undefined, orgHeader);
2931
- return ok(s?.content || '');
2930
+ let s = null;
2931
+ try { s = await api('GET', `/api/skills/slug/${slug}`, undefined, orgHeader); } catch { /* not in the skills table — fall through to the repo index */ }
2932
+ if (s) return ok(s?.content || '');
2933
+ // Phase 5 resolution: any repo connected to any folder in the org is
2934
+ // readable org-wide. Content is fetched from git at read time (never
2935
+ // stored) — always fresh from the tracked branch.
2936
+ const gitSkill = await api('GET', `/api/repos/skill-content/${encodeURIComponent(slug)}`, undefined, orgHeader).catch(() => null);
2937
+ if (gitSkill?.content != null) return ok(gitSkill.content);
2938
+ return err(new Error(`skill not found: ${slug} — not in the Drafted library and not indexed from any connected repo (repo(action="entries", kind="skill") lists what is indexed)`));
2932
2939
  }
2933
2940
  case 'write': {
2934
2941
  if (!slug) return err(new Error('write /skills/<slug> requires a slug'));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drafted",
3
- "version": "1.18.0",
3
+ "version": "1.18.1",
4
4
  "description": "Shared surface for AI-human collaboration — MCP server and CLI",
5
5
  "type": "module",
6
6
  "bin": {