nooon 0.8.0 → 0.8.2
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/index.js +30 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30534,8 +30534,32 @@ ${children}`;
|
|
|
30534
30534
|
}
|
|
30535
30535
|
return result;
|
|
30536
30536
|
}
|
|
30537
|
+
var LIST_BLOCK_TYPES = new Set([
|
|
30538
|
+
"bulleted_list_item",
|
|
30539
|
+
"numbered_list_item",
|
|
30540
|
+
"to_do",
|
|
30541
|
+
"toggle"
|
|
30542
|
+
]);
|
|
30537
30543
|
function blocksToMarkdown(blocks) {
|
|
30538
|
-
|
|
30544
|
+
if (blocks.length === 0)
|
|
30545
|
+
return "";
|
|
30546
|
+
const parts = [];
|
|
30547
|
+
for (let i = 0;i < blocks.length; i++) {
|
|
30548
|
+
if (i > 0) {
|
|
30549
|
+
const prev = blocks[i - 1];
|
|
30550
|
+
const curr = blocks[i];
|
|
30551
|
+
const sep = LIST_BLOCK_TYPES.has(prev.type) && LIST_BLOCK_TYPES.has(curr.type) ? `
|
|
30552
|
+
` : `
|
|
30553
|
+
|
|
30554
|
+
`;
|
|
30555
|
+
parts.push(sep);
|
|
30556
|
+
}
|
|
30557
|
+
parts.push(blockToMarkdown(blocks[i]));
|
|
30558
|
+
}
|
|
30559
|
+
return parts.join("");
|
|
30560
|
+
}
|
|
30561
|
+
function trimExcessiveBlankLines(text) {
|
|
30562
|
+
return text.replace(/\n{3,}/g, `
|
|
30539
30563
|
|
|
30540
30564
|
`);
|
|
30541
30565
|
}
|
|
@@ -30589,16 +30613,14 @@ var markdownFormatter = {
|
|
|
30589
30613
|
const frontmatter = propertiesToFrontmatter(data.page.properties);
|
|
30590
30614
|
const title = `# ${data.page.title}`;
|
|
30591
30615
|
const content = blocksToMarkdown(data.blocks);
|
|
30592
|
-
|
|
30593
|
-
return `${frontmatter}
|
|
30616
|
+
const result = frontmatter ? `${frontmatter}
|
|
30594
30617
|
|
|
30595
30618
|
${title}
|
|
30596
30619
|
|
|
30597
|
-
${content}
|
|
30598
|
-
}
|
|
30599
|
-
return `${title}
|
|
30620
|
+
${content}` : `${title}
|
|
30600
30621
|
|
|
30601
30622
|
${content}`;
|
|
30623
|
+
return trimExcessiveBlankLines(result);
|
|
30602
30624
|
}
|
|
30603
30625
|
};
|
|
30604
30626
|
// src/formatters/toon.ts
|
|
@@ -31269,7 +31291,7 @@ function parseSorts(json2) {
|
|
|
31269
31291
|
// src/mcp.ts
|
|
31270
31292
|
var server = new McpServer({
|
|
31271
31293
|
name: "nooon",
|
|
31272
|
-
version: "0.8.
|
|
31294
|
+
version: "0.8.2"
|
|
31273
31295
|
});
|
|
31274
31296
|
server.tool("nooon_search", "Search Notion pages and databases by keyword. Returns a list of matching items with their IDs and titles. For data_source objects, use nooon_data_source or nooon_query.", {
|
|
31275
31297
|
query: exports_external.string().describe("Search keyword"),
|
|
@@ -31462,7 +31484,7 @@ EXAMPLES:
|
|
|
31462
31484
|
async function main() {
|
|
31463
31485
|
const args = process.argv.slice(2);
|
|
31464
31486
|
if (args.includes("--version") || args.includes("-v")) {
|
|
31465
|
-
console.log("0.8.
|
|
31487
|
+
console.log("0.8.2");
|
|
31466
31488
|
return;
|
|
31467
31489
|
}
|
|
31468
31490
|
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|