@manudota/artist-mcp 2.3.0 → 2.3.1-staging.114
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/dist/notes.js +15 -5
- package/dist/onenote-patch.js +40 -4
- package/dist/server.js +1 -1
- package/package.json +1 -1
package/dist/notes.js
CHANGED
|
@@ -81,11 +81,21 @@ export const htmlToText = (html) => html
|
|
|
81
81
|
.replace(/<(script|style)[\s\S]*?<\/\1>/gi, '')
|
|
82
82
|
.replace(/<br\s*\/?>/gi, '\n')
|
|
83
83
|
.replace(/<\/(p|div|li|h[1-6]|tr)>/gi, '\n')
|
|
84
|
-
// A to-do tag is an attribute on the
|
|
85
|
-
//
|
|
86
|
-
//
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
// A to-do tag is an attribute on the element, so it dies with the tag strip
|
|
85
|
+
// below unless it is turned into text first. Above the <li> rule too: that
|
|
86
|
+
// rule rewrites the opening tag, attribute and all.
|
|
87
|
+
//
|
|
88
|
+
// `span` is here because OneNote moves the tag there. A cell written as
|
|
89
|
+
// `<td><p data-tag="to-do">…</p></td>` comes back as
|
|
90
|
+
// `<td><span data-tag="to-do">…</span></td>` — the paragraph is gone and
|
|
91
|
+
// the tag is on the span. Matching only p and li meant every task inside a
|
|
92
|
+
// table read as untagged, so a page whose tasks live in an Aufgaben table
|
|
93
|
+
// reported none of them done however many were ticked. Found by writing
|
|
94
|
+
// twelve tags, reading the page back, and concluding from clean text that
|
|
95
|
+
// the write had failed; the tags were there and the reader could not see
|
|
96
|
+
// them.
|
|
97
|
+
.replace(/<(p|li|span)[^>]*data-tag="[^"]*\bto-do:completed\b[^"]*"[^>]*>/gi, '$&[x] ')
|
|
98
|
+
.replace(/<(p|li|span)[^>]*data-tag="[^"]*\bto-do\b(?!:)[^"]*"[^>]*>/gi, '$&[ ] ')
|
|
89
99
|
.replace(/<li[^>]*>/gi, '- ')
|
|
90
100
|
.replace(/<[^>]+>/g, '')
|
|
91
101
|
// Numeric entities first: OneNote emits these for accented characters, so
|
package/dist/onenote-patch.js
CHANGED
|
@@ -513,10 +513,46 @@ export const inherit = (targetHtml, contentHtml) => {
|
|
|
513
513
|
// And the cells, which carry their own border in what OneNote hands back.
|
|
514
514
|
// Only when the replacement specifies none anywhere: a caller that styled
|
|
515
515
|
// one cell has decided about all of them.
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
516
|
+
//
|
|
517
|
+
// Cell by cell, in order. This used to take the FIRST cell's style and put
|
|
518
|
+
// it on every cell of the replacement, which is correct only for a table
|
|
519
|
+
// whose cells all look alike. On a table with a shaded header row the first
|
|
520
|
+
// cell IS the header, so replacing a twelve-row task table in place painted
|
|
521
|
+
// the header's `background-color:#EFEFEF` onto all 52 cells and the whole
|
|
522
|
+
// table came back grey. Nothing said so: the preview reported "keeping the
|
|
523
|
+
// style of the table it replaces", which was true and read as reassurance.
|
|
524
|
+
//
|
|
525
|
+
// Positional only when the shapes agree. A replacement with a different
|
|
526
|
+
// number of cells is a different table, and carrying styles across by index
|
|
527
|
+
// there would put a header's shading on whatever happened to land in that
|
|
528
|
+
// slot — the same bug with extra steps. The fallback is the style most of
|
|
529
|
+
// the target's cells carry, which is the body's, because being wrong about
|
|
530
|
+
// the header row is a great deal cheaper than being wrong about all of it.
|
|
531
|
+
if (!/<t[dh]\b[^>]*\bstyle="/i.test(inner)) {
|
|
532
|
+
const targetCells = target.inner.match(/<t[dh]\b[^>]*>/gi) ?? [];
|
|
533
|
+
const styles = targetCells.map((cell) => /\bstyle="([^"]*)"/i.exec(cell)?.[1]);
|
|
534
|
+
const replacementCells = inner.match(/<t[dh]\b[^>]*>/gi) ?? [];
|
|
535
|
+
if (styles.some((style) => style !== undefined)) {
|
|
536
|
+
const byIndex = replacementCells.length === targetCells.length;
|
|
537
|
+
const commonest = [...styles.filter((s) => s !== undefined)]
|
|
538
|
+
.sort((a, b) => styles.filter((s) => s === b).length - styles.filter((s) => s === a).length)[0];
|
|
539
|
+
let seen = -1;
|
|
540
|
+
inner = inner.replace(/<(t[dh])(\b[^>]*?)?>/gi, (whole, tag, rest) => {
|
|
541
|
+
seen += 1;
|
|
542
|
+
const style = byIndex ? styles[seen] : commonest;
|
|
543
|
+
return style === undefined ? whole : `<${tag}${rest ?? ''} style="${style}">`;
|
|
544
|
+
});
|
|
545
|
+
carried = true;
|
|
546
|
+
// Said separately from the borders, and said in terms of cells.
|
|
547
|
+
// "Keeping the style of the table it replaces" is what the preview
|
|
548
|
+
// reported while it was shading every cell, and it is accurate enough
|
|
549
|
+
// to be read as a promise that nothing changed. A note that names what
|
|
550
|
+
// is being copied onto what can at least be disagreed with.
|
|
551
|
+
notes.push(byIndex
|
|
552
|
+
? 'each cell keeps the styling of the cell it replaces, in order'
|
|
553
|
+
: 'every cell takes the styling most of the replaced cells carried, ' +
|
|
554
|
+
'because the replacement has a different number of them');
|
|
555
|
+
}
|
|
520
556
|
}
|
|
521
557
|
if (carried)
|
|
522
558
|
notes.push('the borders of the table it replaces');
|
package/dist/server.js
CHANGED
|
@@ -176,7 +176,7 @@ const renderChangedSections = (chosen, notebook, since) => {
|
|
|
176
176
|
* the only way OneNote allows a cell to change.
|
|
177
177
|
*/
|
|
178
178
|
const INDEX_ENTRIES = 12;
|
|
179
|
-
const serverVersion = '2.3.
|
|
179
|
+
const serverVersion = '2.3.1-staging.114'; // x-release-please-version
|
|
180
180
|
const errorResult = (err) => {
|
|
181
181
|
const message = err instanceof GraphError ? err.message : `Unexpected error: ${err}`;
|
|
182
182
|
return { content: [{ type: "text", text: message }], isError: true };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@manudota/artist-mcp",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1-staging.114",
|
|
4
4
|
"description": "MCP server that reads your OneNote notes in Claude Desktop or Codex, with optional Gmail and Calendar as supporting evidence. Signs in on your own machine; writes are opt-in per install.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|