drafted 1.19.5 → 1.19.7
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 +1 -1
- package/mcp/server.mjs +79 -12
- package/package.json +1 -1
- package/plugin/skills/drafted/SKILL.md +1 -1
package/install-mcp.sh
CHANGED
|
@@ -480,7 +480,7 @@ load_global_agent_instructions() {
|
|
|
480
480
|
fi
|
|
481
481
|
cat <<'DRAFTED_GLOBAL_INSTRUCTIONS'
|
|
482
482
|
<drafted>
|
|
483
|
-
You have Drafted MCP tools — a shared surface for durable, reviewable work: produce substantive output as frames on the surface (not only in chat), put knowledge in the org wiki, and encode repeatable methods as skills. The full operating manual is the `drafted` skill installed with the plugin — follow it when working with Drafted. Before writing, verify the org/project echoed in the response is the one you intend.
|
|
483
|
+
You have Drafted MCP tools — a shared surface for durable, reviewable work: produce substantive output as frames on the surface (not only in chat), put knowledge in the org wiki, and encode repeatable methods as skills. The full operating manual is the `drafted` skill installed with the plugin — follow it when working with Drafted. Address orgs by path: `fs(ls, path="/")` lists them, and `/o/<org>/<root>/...` (root ∈ wiki, skills, projects) is the canonical path form — the org is part of the path, never a separate switch. Before writing, verify the org/project echoed in the response is the one you intend.
|
|
484
484
|
</drafted>
|
|
485
485
|
DRAFTED_GLOBAL_INSTRUCTIONS
|
|
486
486
|
}
|
package/mcp/server.mjs
CHANGED
|
@@ -384,7 +384,7 @@ const TOOL_ANNOTATIONS = {
|
|
|
384
384
|
auth: { title: 'Sign in', readOnlyHint: false, destructiveHint: false, openWorldHint: true, description: 'Sign in to Drafted. `action=get_link` returns a URL immediately and starts background approval polling; after the user opens the link, later Drafted tool calls also auto-consume the approved login. `action=login` opens a browser when needed and explicitly waits/polls for approval.' },
|
|
385
385
|
|
|
386
386
|
// Identity — read-only introspection of THIS agent's session
|
|
387
|
-
whoami: { title: 'Session identity', readOnlyHint: true, destructiveHint: false, openWorldHint: false, description: 'Return THIS agent session\'s identity: its server-assigned human-readable name (the correlation key between an agent window and its web-app session tab), sessionId, userId, orgId, active projectId, editor label, server URL, and surfaced/alive state — PLUS server health
|
|
387
|
+
whoami: { title: 'Session identity', readOnlyHint: true, destructiveHint: false, openWorldHint: false, description: 'Return THIS agent session\'s identity: its server-assigned human-readable name (the correlation key between an agent window and its web-app session tab), sessionId, userId, orgId, active projectId, editor label, server URL, and surfaced/alive state — PLUS server health, the installed MCP version/update status (cached ~5min), and `googleDrive` — whether the working org has Google Drive connected: when `googleDrive.connected` is true, strongly prefer Google Workspace frames (.google-doc/.google-sheet/.google-slide) for docs, sheets, and decks; when false they cannot be created at all. Call once per session, right after starting, so a required update surfaces before you act on stale tool behavior. Read-only. Use this — not guesses from the host environment — to report which session you are.' },
|
|
388
388
|
|
|
389
389
|
// Session naming — the name-before-work gate: every agent session must set a short
|
|
390
390
|
// name describing the work before any other tool call succeeds.
|
|
@@ -401,7 +401,7 @@ const TOOL_ANNOTATIONS = {
|
|
|
401
401
|
// Minions — checklist-driven intake surfaces bound to a project
|
|
402
402
|
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.' },
|
|
403
403
|
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.' },
|
|
404
|
-
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.' },
|
|
404
|
+
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, link, unlink, links.' },
|
|
405
405
|
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.' },
|
|
406
406
|
};
|
|
407
407
|
|
|
@@ -413,7 +413,7 @@ function isMutatingToolCall(name, args = {}) {
|
|
|
413
413
|
case 'trigger':
|
|
414
414
|
return ['create', 'update', 'rotate', 'delete'].includes(action);
|
|
415
415
|
case 'fs':
|
|
416
|
-
return !['ls', 'read', 'search'].includes(action);
|
|
416
|
+
return !['ls', 'read', 'search', 'links'].includes(action);
|
|
417
417
|
default:
|
|
418
418
|
return false;
|
|
419
419
|
}
|
|
@@ -2261,17 +2261,37 @@ async function sessionSurfaceBlock() {
|
|
|
2261
2261
|
};
|
|
2262
2262
|
}
|
|
2263
2263
|
|
|
2264
|
+
// Is the working org's Drive connected? Agents are told to prefer Google Workspace frames
|
|
2265
|
+
// when it is, so they need a way to ASK — this rode on `get_org` until that tool was retired
|
|
2266
|
+
// (DRAFT-36), leaving agents to probe by attempting a .google-doc write and reading the 400.
|
|
2267
|
+
// Rides on whoami, the once-per-session bootstrap that replaced it. Never throws: an
|
|
2268
|
+
// unreachable/erroring status is reported as not-connected, same as no connection.
|
|
2269
|
+
async function getGoogleDriveAvailability() {
|
|
2270
|
+
try {
|
|
2271
|
+
const status = await api('GET', '/api/google/status');
|
|
2272
|
+
return {
|
|
2273
|
+
connected: !!status?.connected,
|
|
2274
|
+
driveRootFolderName: status?.driveRootFolderName || null,
|
|
2275
|
+
preference: status?.connected
|
|
2276
|
+
? 'Google Drive is connected for this org — strongly prefer Google Workspace frames (.google-doc / .google-sheet / .google-slide) for docs, sheets, and decks.'
|
|
2277
|
+
: 'Google Drive is not connected for this org — use normal Drafted frames (.md / .html); Google Workspace writes will fail.',
|
|
2278
|
+
};
|
|
2279
|
+
} catch {
|
|
2280
|
+
return { connected: false, driveRootFolderName: null, preference: 'Google Drive status unavailable — use normal Drafted frames.' };
|
|
2281
|
+
}
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2264
2284
|
// Identity + server health: report THIS agent session's own surface identity, server
|
|
2265
2285
|
// reachability, and installed-MCP staleness in ONE bootstrap call. The update data is
|
|
2266
2286
|
// cached (5min), so repeat `whoami` calls are free; the server-side update gate still
|
|
2267
2287
|
// blocks mutating calls on its own, independent of this tool. Read-only — no state changed.
|
|
2268
|
-
tool('whoami', 'Return THIS agent session\'s identity: its server-assigned human-readable name (the correlation key between an agent window and its web-app session tab), sessionId, userId, orgId, active projectId, editor label, server URL, and surfaced/alive state — PLUS server health
|
|
2288
|
+
tool('whoami', 'Return THIS agent session\'s identity: its server-assigned human-readable name (the correlation key between an agent window and its web-app session tab), sessionId, userId, orgId, active projectId, editor label, server URL, and surfaced/alive state — PLUS server health, the installed MCP version/update status (cached ~5min), and `googleDrive` — whether the working org has Google Drive connected: when `googleDrive.connected` is true, strongly prefer Google Workspace frames (.google-doc/.google-sheet/.google-slide) for docs, sheets, and decks; when false they cannot be created at all. Call once per session, right after starting, so a required update surfaces before you act on stale tool behavior. Read-only.', {}, async () => {
|
|
2269
2289
|
try {
|
|
2270
2290
|
// Ensure the child clone exists BEFORE reading identity — otherwise the /auth/me
|
|
2271
2291
|
// fallback (pre-WS-ack) queries the ROOT session and reports the wrong naming state.
|
|
2272
2292
|
await ensureSession();
|
|
2273
2293
|
const block = await sessionSurfaceBlock();
|
|
2274
|
-
const mcpUpdate = await getCachedMcpUpdateMetadata();
|
|
2294
|
+
const [mcpUpdate, googleDrive] = await Promise.all([getCachedMcpUpdateMetadata(), getGoogleDriveAvailability()]);
|
|
2275
2295
|
// Tell the agent to actually surface its name to the user — returning `name` in the JSON isn't
|
|
2276
2296
|
// enough; without an explicit instruction agents rarely say which session they are, so users
|
|
2277
2297
|
// can't match them to their tab on the Drafted surface.
|
|
@@ -2287,6 +2307,7 @@ tool('whoami', 'Return THIS agent session\'s identity: its server-assigned human
|
|
|
2287
2307
|
mcpUpdate,
|
|
2288
2308
|
editor: (process.env.DRAFTED_AGENT_NAME || '').trim() || null,
|
|
2289
2309
|
agentLabel: getAgentLabel(),
|
|
2310
|
+
googleDrive,
|
|
2290
2311
|
...block,
|
|
2291
2312
|
...(instruction ? { instruction } : {}),
|
|
2292
2313
|
});
|
|
@@ -2802,10 +2823,11 @@ server.resource('info', 'drafted://info', {
|
|
|
2802
2823
|
};
|
|
2803
2824
|
});
|
|
2804
2825
|
|
|
2805
|
-
tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder: `fs(ls, path="/")` lists the orgs you can address, then `/o/<org>/<root>/...` addresses one of them — the org is part of the path, there is no org switching:\n\n- `/o/<org>/wiki/<path>` — org knowledge pages (markdown, OKF; free nesting; `index.md` at any level is synthesized and read-only)\n- `/o/<org>/skills/<slug>` — reusable procedures (flat: one dir per skill slug, `SKILL.md` + supporting files inside)\n- `/o/<org>/tasks/<lane?>/<file>` — work items. A task IS a frame: `read` renders its `drafted:status:`/`drafted:assignee:` as front matter and `write`/`edit` parse them back into columns, so they are never stored in the body. The keys are namespaced so an ordinary `status:` in your own front matter is left alone. Valid statuses: open, in_progress, scheduled, needs_review, needs_decision, done, failed (an empty `drafted:status:` clears it). Status is a column, not a location — a task moved out of /tasks stays a task.\n- `/o/<org>/projects/<folder?>/<project>/<layer>/<lane>/<file>` — producible frames (folder optional; then exactly layer → lane → file)\n\n(Bare `/wiki`, `/skills`, `/tasks`, `/projects` roots still resolve via the session\'s working org.)\n\nVerbs: `ls` (list a directory), `read` (file content — hashline-annotated for text so `edit` stays surgical), `write` (create/overwrite; extension + layer classify the type: .html design, .md document, .excalidraw diagram, .xlsx/.docx office, images/videos media, .pdf asset, .google-doc/.google-sheet/.google-slide create native Google Workspace files), `edit` (hashline ops for text, element ops for excalidraw, structured ops for office), `mv` (rename/move, cross-project), `rm` (delete), `search` (frames are searched by label AND content, with the matching line returned as a snippet; `fs(search, path="/")` or `path="/o/<org>"` fans out across wiki + skills + projects in one call). `mkdir` creates a project only: use `/projects/<project>` or `/projects/<folder>/<project>`, never a layer path. To create a layer, write its first frame at `/projects/<project>/<new-layer>/<lane>/<file>`.\n\nThe project is resolved from the path itself — no separate "open" step. Guardrails are server-side and unchanged: the org in the path must be the project\'s own org (project paths under /o/<org>/ validate it), the G1 wiki-search gate fires before project mutations, attached-skill gates fire on mutations, anchored frames must be read before editing a layer, `.skillinstall/` is stripped on skill push.', {
|
|
2806
|
-
action: z.enum(['ls', 'read', 'write', 'edit', 'mv', 'rm', 'mkdir', 'search']).describe('Filesystem verb.'),
|
|
2826
|
+
tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder: `fs(ls, path="/")` lists the orgs you can address, then `/o/<org>/<root>/...` addresses one of them — the org is part of the path, there is no org switching:\n\n- `/o/<org>/wiki/<path>` — org knowledge pages (markdown, OKF; free nesting; `index.md` at any level is synthesized and read-only)\n- `/o/<org>/skills/<slug>` — reusable procedures (flat: one dir per skill slug, `SKILL.md` + supporting files inside)\n- `/o/<org>/tasks/<lane?>/<file>` — work items. A task IS a frame: `read` renders its `drafted:status:`/`drafted:assignee:` as front matter and `write`/`edit` parse them back into columns, so they are never stored in the body. The keys are namespaced so an ordinary `status:` in your own front matter is left alone. Valid statuses: open, in_progress, scheduled, needs_review, needs_decision, done, failed (an empty `drafted:status:` clears it). Status is a column, not a location — a task moved out of /tasks stays a task.\n- `/o/<org>/projects/<folder?>/<project>/<layer>/<lane>/<file>` — producible frames (folder optional; then exactly layer → lane → file)\n\n(Bare `/wiki`, `/skills`, `/tasks`, `/projects` roots still resolve via the session\'s working org.)\n\nVerbs: `ls` (list a directory), `read` (file content — hashline-annotated for text so `edit` stays surgical), `write` (create/overwrite; extension + layer classify the type: .html design, .md document, .excalidraw diagram, .xlsx/.docx office, images/videos media, .pdf asset, .google-doc/.google-sheet/.google-slide create native Google Workspace files), `edit` (hashline ops for text, element ops for excalidraw, structured ops for office), `mv` (rename/move, cross-project), `rm` (delete), `search` (frames are searched by label AND content, with the matching line returned as a snippet; `fs(search, path="/")` or `path="/o/<org>"` fans out across wiki + skills + projects in one call), `link` / `unlink` / `links` (relate one frame to another frame, to a project, or to an external url — `links` lists a frame\'s edges plus its backlinks, and on a project path lists the tasks linked to that project; a link is stored by ID, so `mv` never breaks it). `mkdir` creates a project only: use `/projects/<project>` or `/projects/<folder>/<project>`, never a layer path. To create a layer, write its first frame at `/projects/<project>/<new-layer>/<lane>/<file>`.\n\nThe project is resolved from the path itself — no separate "open" step. Guardrails are server-side and unchanged: the org in the path must be the project\'s own org (project paths under /o/<org>/ validate it), the G1 wiki-search gate fires before project mutations, attached-skill gates fire on mutations, anchored frames must be read before editing a layer, `.skillinstall/` is stripped on skill push.', {
|
|
2827
|
+
action: z.enum(['ls', 'read', 'write', 'edit', 'mv', 'rm', 'mkdir', 'search', 'link', 'unlink', 'links']).describe('Filesystem verb.'),
|
|
2807
2828
|
path: z.string().describe('Drafted path: /o/<org>/wiki/... | /o/<org>/skills/... | /o/<org>/tasks/... | /o/<org>/projects/... (bare /wiki, /skills, /tasks, /projects also work; for mv: source)'),
|
|
2808
|
-
to: z.string().optional().describe('[mv] destination path'),
|
|
2829
|
+
to: z.string().optional().describe('[mv] destination path; [link/unlink] target path — a frame path, or a project path (/o/<org>/projects/<project>) to link a task to a project'),
|
|
2830
|
+
url: z.string().optional().describe('[link/unlink] external target URL, instead of `to` (a link is internal-by-id OR external-by-url, never both)'),
|
|
2809
2831
|
query: z.string().optional().describe('[search] term to match against names/content'),
|
|
2810
2832
|
content: z.string().optional().describe('[write] inline HTML/markdown/text'),
|
|
2811
2833
|
file_path: z.string().optional().describe('[write] absolute path to a local file to upload (stdio only). Under /projects it uploads bytes (images, PDFs, office files); under /wiki and /skills it reads the file as UTF-8 text, so a markdown file on disk can be written straight to a page or a SKILL.md without pasting it.'),
|
|
@@ -2840,10 +2862,10 @@ tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder:
|
|
|
2840
2862
|
const toScoped = splitOrgScope(stripUrlOrigin(to));
|
|
2841
2863
|
if (toScoped.error) return err(new Error(toScoped.error));
|
|
2842
2864
|
if (toScoped.org && orgFromPath && toScoped.org.toLowerCase() !== orgFromPath.toLowerCase()) {
|
|
2843
|
-
return err(new Error(
|
|
2865
|
+
return err(new Error(`${action} stays within one org — source and destination must address the same org`));
|
|
2844
2866
|
}
|
|
2845
2867
|
if (toScoped.org && !orgFromPath) {
|
|
2846
|
-
return err(new Error(
|
|
2868
|
+
return err(new Error(`${action} to an org-scoped destination needs an org-scoped source too (/o/<org>/... on both sides)`));
|
|
2847
2869
|
}
|
|
2848
2870
|
to = toScoped.path;
|
|
2849
2871
|
}
|
|
@@ -3159,7 +3181,7 @@ tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder:
|
|
|
3159
3181
|
// so a task moved out of here stays a task.
|
|
3160
3182
|
const isTasksPath = (x) => x === '/tasks' || x === '/tasks/' || String(x || '').startsWith('/tasks/');
|
|
3161
3183
|
if (isTasksPath(p) || isTasksPath(to)) {
|
|
3162
|
-
if (['write', 'edit', 'mv', 'rm'].includes(action)) {
|
|
3184
|
+
if (['write', 'edit', 'mv', 'rm', 'link', 'unlink'].includes(action)) {
|
|
3163
3185
|
// Project-less: the org cannot be guessed (same guard as /wiki and /skills).
|
|
3164
3186
|
await requireBoundOrgForProjectlessMutation(org || orgFromPath);
|
|
3165
3187
|
}
|
|
@@ -3171,7 +3193,7 @@ tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder:
|
|
|
3171
3193
|
// `fs(ls, path="/tasks")` creating one would put a real "Tasks" project in
|
|
3172
3194
|
// an org the agent never named (DRAFT-36: org is an address, not a guess).
|
|
3173
3195
|
// Writes are guarded above and may create; reads say "nothing here yet".
|
|
3174
|
-
const readOnly = !['write', 'edit', 'mv', 'rm'].includes(action);
|
|
3196
|
+
const readOnly = !['write', 'edit', 'mv', 'rm', 'link', 'unlink'].includes(action);
|
|
3175
3197
|
const sys = await api('POST', '/api/tasks/project', readOnly ? { create: false } : {}, orgHeader)
|
|
3176
3198
|
.catch((e) => (readOnly && e.status === 404 ? null : Promise.reject(e)));
|
|
3177
3199
|
if (!sys?.id) {
|
|
@@ -3458,6 +3480,51 @@ tool('fs', 'Navigate Drafted like a local filesystem. An org is the top folder:
|
|
|
3458
3480
|
const result = await api('DELETE', `/api/fs/${rmPath.replace(/^\//, '')}`, undefined, orgHeader);
|
|
3459
3481
|
return ok(result);
|
|
3460
3482
|
}
|
|
3483
|
+
case 'link':
|
|
3484
|
+
case 'unlink': {
|
|
3485
|
+
if (!filePath) return err(new Error(`${action} requires a source file path: /projects/<project>/<layer>/<lane>/<file>`));
|
|
3486
|
+
const from = lane ? `/${layer}/${lane}/${filename}` : `/${layer}/${filename}`;
|
|
3487
|
+
const body = { from };
|
|
3488
|
+
if (args.url) {
|
|
3489
|
+
body.url = args.url;
|
|
3490
|
+
} else if (to) {
|
|
3491
|
+
// Same destination grammar as mv: /projects/<ref>/<layer>/... is a
|
|
3492
|
+
// frame in another project, /projects/<ref> alone is the project
|
|
3493
|
+
// itself (the "this task belongs to that project" edge), and a bare
|
|
3494
|
+
// /<layer>/... is a frame in this one.
|
|
3495
|
+
const toClean = String(to).replace(/^\/+|\/+$/g, '');
|
|
3496
|
+
const toParts = toClean.replace(/^projects\/?/, '').split('/').filter(Boolean);
|
|
3497
|
+
if (toClean.startsWith('projects/') && toParts.length === 1) {
|
|
3498
|
+
const toMeta = await resolveProjectRef(toParts[0]).catch(() => null);
|
|
3499
|
+
if (!toMeta?.id) return err(new Error(`project not found: ${toParts[0]}`));
|
|
3500
|
+
body.toType = 'project';
|
|
3501
|
+
body.toId = toMeta.id;
|
|
3502
|
+
} else if (toClean.startsWith('projects/') && toParts.length >= 2) {
|
|
3503
|
+
const toRef = toParts[0];
|
|
3504
|
+
const sameProject = projectRef && String(toRef).toLowerCase() === String(projectRef).toLowerCase();
|
|
3505
|
+
if (!sameProject) {
|
|
3506
|
+
const toMeta = await resolveProjectRef(toRef).catch(() => null);
|
|
3507
|
+
if (!toMeta?.id) return err(new Error(`project not found: ${toRef}`));
|
|
3508
|
+
body.toProjectId = toMeta.id;
|
|
3509
|
+
}
|
|
3510
|
+
body.to = '/' + toParts.slice(1).join('/');
|
|
3511
|
+
} else {
|
|
3512
|
+
body.to = toParts.length ? '/' + toParts.join('/') : String(to);
|
|
3513
|
+
}
|
|
3514
|
+
} else {
|
|
3515
|
+
return err(new Error(`${action} needs a target: to="<frame or project path>" or url="https://..."`));
|
|
3516
|
+
}
|
|
3517
|
+
return ok(await api('POST', `/api/fs/${action}`, body, orgHeader));
|
|
3518
|
+
}
|
|
3519
|
+
case 'links': {
|
|
3520
|
+
// On a file: its edges plus its (access-filtered) backlinks. On a
|
|
3521
|
+
// project path: the tasks linked to that project.
|
|
3522
|
+
if (filePath) {
|
|
3523
|
+
const relPath = lane ? `/${layer}/${lane}/${filename}` : `/${layer}/${filename}`;
|
|
3524
|
+
return ok(await api('GET', `/api/fs/links?path=${encodeURIComponent(relPath)}`, undefined, orgHeader));
|
|
3525
|
+
}
|
|
3526
|
+
return ok(await api('GET', '/api/fs/linked-tasks', undefined, orgHeader));
|
|
3527
|
+
}
|
|
3461
3528
|
case 'search': {
|
|
3462
3529
|
// /api/fs/search has never existed — this 404'd on every call (no fs
|
|
3463
3530
|
// route matches a single `/search` segment). /api/search is the real
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drafted",
|
|
3
|
-
"version": "1.19.
|
|
3
|
+
"version": "1.19.7",
|
|
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": [
|
|
@@ -65,7 +65,7 @@ These bookend the loop. Prime/feed at the start, deposit at the end.
|
|
|
65
65
|
- **Create a project with `fs(mkdir, path="/o/<org>/projects/<name>")`** — or just `fs(write, path="/o/<org>/projects/<name>/<layer>/<lane>/<file>", content=...)` and the project + layer auto-create in the addressed org.
|
|
66
66
|
- **Default to the surface for substantive artifacts.** When asked to draft, write, plan, analyze, compare, design, document, summarize, report, spec, model, or make a deck/table, create or update frames instead of leaving the durable result only in chat. One visible frame per artifact or section.
|
|
67
67
|
- **Read before editing.** `fs(read)` returns every line hashline-annotated (`1abc|<content>`); `fs(edit, ops=[{type:"replace", lineHash:"1abc", newContent:"..."}])` targets exactly that line. For partial reads, pass `lines: "2-50"` — you get back just that range, still hash-annotated, and can edit within it.
|
|
68
|
-
- **Prefer Google Workspace when Drive is connected.**
|
|
68
|
+
- **Prefer Google Workspace when Drive is connected.** `whoami` reports it — `googleDrive.connected: true` means use `fs(write, path=".../<name>.google-doc"|".google-sheet"|".google-slide")` for docs, sheets, and decks, populated immediately with the matching native write action. False means they cannot be created at all: use `.md`/`.html` frames and don't ask the user which fallback they want.
|
|
69
69
|
- **`fs(mv, from="/o/<org>/projects/<p>/<layer>/<lane>/<file>", to="...")`** renames or moves (cross-project too). **`fs(rm, path="/o/<org>/projects/<project>")` archives** — agents never hard-delete; the archive is in the web UI.
|
|
70
70
|
- **Return a clickable link** for what you touched — the `frameUrl`/`projectUrl` in the fs response is the URL the user opens.
|
|
71
71
|
|