drafted 1.11.3 → 1.11.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/mcp/server.mjs +29 -9
- package/package.json +6 -1
package/mcp/server.mjs
CHANGED
|
@@ -1916,24 +1916,44 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
|
|
|
1916
1916
|
title: z.string().optional().describe('[write + googleType] Title for a new native file. Defaults to filename from path.'),
|
|
1917
1917
|
url: z.string().optional().describe('[write + googleType] Existing Google file URL to attach.'),
|
|
1918
1918
|
googleId: z.string().optional().describe('[write + googleType] Existing Google file ID to attach. [Sheet/Doc/Slide actions] Native Google file ID to use when not resolving from path/frame.'),
|
|
1919
|
-
officeType: z.enum(['xlsx']).optional().describe('[create_office] native Drafted-owned Office format to author
|
|
1920
|
-
rows: z.array(z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))).optional().describe('[create_office] initial rows for a single-sheet xlsx (2D array of cell values).'),
|
|
1921
|
-
sheets: z.array(z.object({ name: z.string().optional(), rows: z.array(z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))).optional() })).optional().describe('[create_office] multiple sheets: [{ name, rows }].'),
|
|
1922
|
-
|
|
1923
|
-
|
|
1919
|
+
officeType: z.enum(['xlsx', 'docx']).optional().describe('[create_office] native Drafted-owned Office format to author: xlsx (spreadsheet) or docx (document). Real OOXML bytes — download is the file itself, no conversion.'),
|
|
1920
|
+
rows: z.array(z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))).optional().describe('[create_office xlsx] initial rows for a single-sheet xlsx (2D array of cell values).'),
|
|
1921
|
+
sheets: z.array(z.object({ name: z.string().optional(), rows: z.array(z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))).optional() })).optional().describe('[create_office xlsx] multiple sheets: [{ name, rows }].'),
|
|
1922
|
+
paragraphs: z.array(z.object({ html: z.string().optional(), text: z.string().optional(), style: z.string().optional(), align: z.string().optional(), list: z.string().optional() })).optional().describe('[create_office docx] document paragraphs: [{ html?, text?, style?, align?, list? }]. html uses the inline subset <b>,<i>,<u>,<s>,<span style="color:#c00;font-size:12pt;font-family:Arial">. style = Heading1..Heading6 or Title. align = left|center|right|justify. list = bullet|number.'),
|
|
1923
|
+
sheet: z.string().optional().describe('[read_office xlsx] limit the read to one sheet by name.'),
|
|
1924
|
+
maxCells: z.number().optional().describe('[read_office xlsx] cap non-empty cells returned (default 5000).'),
|
|
1924
1925
|
ops: z.array(z.object({
|
|
1925
1926
|
type: z.string(),
|
|
1926
1927
|
sheet: z.string().optional(),
|
|
1927
1928
|
ref: z.string().optional(),
|
|
1928
1929
|
value: z.union([z.string(), z.number(), z.boolean(), z.null()]).optional(),
|
|
1929
1930
|
formula: z.string().optional(),
|
|
1930
|
-
cells: z.array(z.object({ ref: z.string(), value: z.union([z.string(), z.number(), z.boolean(), z.null()]).optional(), formula: z.string().optional() })).optional(),
|
|
1931
|
+
cells: z.array(z.object({ ref: z.string(), value: z.union([z.string(), z.number(), z.boolean(), z.null()]).optional(), formula: z.string().optional(), cellStyle: z.object({ bold: z.boolean().optional(), italic: z.boolean().optional(), underline: z.boolean().optional(), fontSize: z.number().optional(), fontName: z.string().optional(), color: z.string().optional(), bg: z.string().optional(), align: z.string().optional(), valign: z.string().optional(), numFmt: z.string().optional(), border: z.boolean().optional() }).optional() })).optional(),
|
|
1931
1932
|
range: z.string().optional(),
|
|
1932
1933
|
name: z.string().optional(),
|
|
1933
1934
|
from: z.string().optional(),
|
|
1934
1935
|
to: z.string().optional(),
|
|
1935
1936
|
rows: z.array(z.array(z.union([z.string(), z.number(), z.boolean(), z.null()]))).optional(),
|
|
1936
|
-
|
|
1937
|
+
id: z.string().optional(),
|
|
1938
|
+
html: z.string().optional(),
|
|
1939
|
+
text: z.string().optional(),
|
|
1940
|
+
find: z.string().optional(),
|
|
1941
|
+
replace: z.string().optional(),
|
|
1942
|
+
all: z.boolean().optional(),
|
|
1943
|
+
start: z.number().optional(),
|
|
1944
|
+
end: z.number().optional(),
|
|
1945
|
+
style: z.string().optional(),
|
|
1946
|
+
align: z.string().optional(),
|
|
1947
|
+
list: z.string().optional(),
|
|
1948
|
+
header: z.boolean().optional(),
|
|
1949
|
+
col: z.string().optional(),
|
|
1950
|
+
width: z.number().optional(),
|
|
1951
|
+
columns: z.array(z.object({ col: z.string(), width: z.number() })).optional(),
|
|
1952
|
+
cellStyle: z.object({ bold: z.boolean().optional(), italic: z.boolean().optional(), underline: z.boolean().optional(), fontSize: z.number().optional(), fontName: z.string().optional(), color: z.string().optional(), bg: z.string().optional(), align: z.string().optional(), valign: z.string().optional(), numFmt: z.string().optional(), border: z.boolean().optional() }).optional(),
|
|
1953
|
+
after: z.string().optional(),
|
|
1954
|
+
before: z.string().optional(),
|
|
1955
|
+
attrs: z.object({ b: z.boolean().optional(), i: z.boolean().optional(), u: z.boolean().optional(), strike: z.boolean().optional(), color: z.string().optional(), size: z.number().optional(), font: z.string().optional() }).optional(),
|
|
1956
|
+
})).optional().describe('[edit_office] edit ops, resolved against stable addresses (no index drift). xlsx: {type:"setCell",sheet?,ref,value|formula,cellStyle?} | {type:"setCells",sheet?,cells:[{ref,value|formula,cellStyle?}]} | {type:"styleRange",sheet?,range,cellStyle} | {type:"setColumnWidth",sheet?,columns:[{col,width}]} | {type:"clearRange",sheet?,range} | {type:"addSheet",name,rows?} | {type:"renameSheet",from,to} | {type:"deleteSheet",name}. cellStyle:{bold,italic,underline,fontSize,fontName,color,bg,align,valign,numFmt,border}. docx (id = paraId from read_office): {type:"setParagraph",id,html|text,style?,align?,list?} | {type:"format",id,start,end,attrs:{b,i,u,strike,color,size,font}} (run-level char range) | {type:"replaceText",id,find,replace,all?} | {type:"setStyle",id,style?,align?,list?} | {type:"insertParagraph",after|before,html|text,style?,align?,list?} | {type:"insertTable",after|before,rows:[[...]],header?} | {type:"deleteParagraph",id}. align=left|center|right|justify; list=bullet|number.'),
|
|
1937
1957
|
format: z.enum(['plain_text', 'markdown']).optional().describe('[write_doc_content|append_doc_content] Source format hint. Currently plain_text and minimal markdown are accepted as text.'),
|
|
1938
1958
|
mode: z.enum(['replace', 'append', 'clear']).optional().describe('[Doc/Slide content actions] Optional mode hint for clients; prefer the explicit write/append/clear action names.'),
|
|
1939
1959
|
slides: z.array(z.object({
|
|
@@ -2167,7 +2187,7 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
|
|
|
2167
2187
|
case 'create_office': {
|
|
2168
2188
|
// Author a native Drafted-owned Office file (real bytes; download is the
|
|
2169
2189
|
// file itself). Populate via edit_office; read structure via read_office.
|
|
2170
|
-
const { path, title, officeType = 'xlsx', rows, sheets } = args;
|
|
2190
|
+
const { path, title, officeType = 'xlsx', rows, sheets, paragraphs } = args;
|
|
2171
2191
|
let layer = 'copy';
|
|
2172
2192
|
let lane = 'default';
|
|
2173
2193
|
let label = title;
|
|
@@ -2176,7 +2196,7 @@ tool('frame', 'Frame CRUD in the ACTIVE PROJECT. Dispatch by `action`: read (by
|
|
|
2176
2196
|
if (p.length === 3) { layer = p[0]; lane = p[1]; label = p[2]; }
|
|
2177
2197
|
}
|
|
2178
2198
|
if (!label) throw new Error('Provide title (filename) or a /{layer}/{lane}/{filename} path for the new office file');
|
|
2179
|
-
return ok(await api('POST', '/api/office/create', { projectId: getState().projectId, layer, lane, label, format: officeType, rows, sheets }));
|
|
2199
|
+
return ok(await api('POST', '/api/office/create', { projectId: getState().projectId, layer, lane, label, format: officeType, rows, sheets, paragraphs }));
|
|
2180
2200
|
}
|
|
2181
2201
|
case 'read_office': {
|
|
2182
2202
|
const id = await resolveOfficeFrameId(args.path);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drafted",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.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": [
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"postpublish": "bash scripts/sync-plugin.sh \"chore: sync plugin to v$npm_package_version\" && bash scripts/sync-web-plugin.sh \"chore: sync web-plugin to v$npm_package_version\"",
|
|
36
36
|
"deploy:check:google": "node scripts/check-google-drive-deploy.mjs",
|
|
37
37
|
"build:excalidraw": "node scripts/build-excalidraw-editor.mjs",
|
|
38
|
+
"build:office-viewer": "node scripts/build-office-viewer.mjs",
|
|
38
39
|
"prepublishOnly": "node scripts/check-npm-package.mjs"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
@@ -49,14 +50,17 @@
|
|
|
49
50
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
50
51
|
"@sentry/browser": "^10.53.1",
|
|
51
52
|
"@sentry/node": "^10.53.1",
|
|
53
|
+
"@xmldom/xmldom": "^0.9.10",
|
|
52
54
|
"commander": "^11.1.0",
|
|
53
55
|
"dagre": "^0.8.5",
|
|
56
|
+
"docx": "^9.7.1",
|
|
54
57
|
"dotenv": "^17.3.1",
|
|
55
58
|
"drizzle-orm": "^0.45.1",
|
|
56
59
|
"esbuild": "^0.28.0",
|
|
57
60
|
"exceljs": "^4.4.0",
|
|
58
61
|
"express": "^4.18.2",
|
|
59
62
|
"jsdom": "^27.0.1",
|
|
63
|
+
"jszip": "^3.10.1",
|
|
60
64
|
"lucide": "^1.16.0",
|
|
61
65
|
"mdast-util-from-markdown": "^2.0.3",
|
|
62
66
|
"multer": "^2.1.1",
|
|
@@ -88,6 +92,7 @@
|
|
|
88
92
|
"@types/express": "^5.0.6",
|
|
89
93
|
"@types/nodemailer": "^7.0.11",
|
|
90
94
|
"@types/pg": "^8.18.0",
|
|
95
|
+
"docx-preview": "^0.3.7",
|
|
91
96
|
"drizzle-kit": "^0.31.9",
|
|
92
97
|
"tsx": "^4.19.0",
|
|
93
98
|
"typescript": "^5.9.3",
|