nooon 0.8.4 → 0.9.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.
- package/dist/index.js +65 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30522,10 +30522,26 @@ ${text}
|
|
|
30522
30522
|
case "child_database":
|
|
30523
30523
|
result = `\uD83D\uDCCA ${block.title} (${block.id})`;
|
|
30524
30524
|
break;
|
|
30525
|
+
case "table": {
|
|
30526
|
+
const rows = (block.children || []).filter((c) => c.type === "table_row");
|
|
30527
|
+
if (rows.length > 0) {
|
|
30528
|
+
const lines = [];
|
|
30529
|
+
for (let i = 0;i < rows.length; i++) {
|
|
30530
|
+
const cells = rows[i].cells || [];
|
|
30531
|
+
lines.push(`| ${cells.join(" | ")} |`);
|
|
30532
|
+
if (i === 0) {
|
|
30533
|
+
lines.push(`| ${cells.map(() => "---").join(" | ")} |`);
|
|
30534
|
+
}
|
|
30535
|
+
}
|
|
30536
|
+
result = lines.join(`
|
|
30537
|
+
`);
|
|
30538
|
+
}
|
|
30539
|
+
break;
|
|
30540
|
+
}
|
|
30525
30541
|
default:
|
|
30526
30542
|
result = text || "";
|
|
30527
30543
|
}
|
|
30528
|
-
if (block.children && block.children.length > 0) {
|
|
30544
|
+
if (block.type !== "table" && block.children && block.children.length > 0) {
|
|
30529
30545
|
const childIndent = `${indent} `;
|
|
30530
30546
|
const children = block.children.map((child) => blockToMarkdown(child, childIndent)).join(`
|
|
30531
30547
|
`);
|
|
@@ -30658,6 +30674,15 @@ function blockToToon(block) {
|
|
|
30658
30674
|
if (block.title) {
|
|
30659
30675
|
result.title = block.title;
|
|
30660
30676
|
}
|
|
30677
|
+
if (block.hasColumnHeader !== undefined) {
|
|
30678
|
+
result.hasColumnHeader = block.hasColumnHeader;
|
|
30679
|
+
}
|
|
30680
|
+
if (block.hasRowHeader !== undefined) {
|
|
30681
|
+
result.hasRowHeader = block.hasRowHeader;
|
|
30682
|
+
}
|
|
30683
|
+
if (block.cells) {
|
|
30684
|
+
result.cells = block.cells;
|
|
30685
|
+
}
|
|
30661
30686
|
if (block.children && block.children.length > 0) {
|
|
30662
30687
|
result.children = block.children.map(blockToToon);
|
|
30663
30688
|
}
|
|
@@ -31179,6 +31204,17 @@ function slimBlock(block) {
|
|
|
31179
31204
|
return { ...base, url: block.bookmark.url };
|
|
31180
31205
|
case "embed":
|
|
31181
31206
|
return { ...base, url: block.embed.url };
|
|
31207
|
+
case "table":
|
|
31208
|
+
return {
|
|
31209
|
+
...base,
|
|
31210
|
+
hasColumnHeader: block.table.has_column_header,
|
|
31211
|
+
hasRowHeader: block.table.has_row_header
|
|
31212
|
+
};
|
|
31213
|
+
case "table_row":
|
|
31214
|
+
return {
|
|
31215
|
+
...base,
|
|
31216
|
+
cells: block.table_row.cells.map((cell) => cell.map((rt) => rt.plain_text).join(""))
|
|
31217
|
+
};
|
|
31182
31218
|
case "divider":
|
|
31183
31219
|
case "table_of_contents":
|
|
31184
31220
|
case "column_list":
|
|
@@ -31291,7 +31327,7 @@ function parseSorts(json2) {
|
|
|
31291
31327
|
// src/mcp.ts
|
|
31292
31328
|
var server = new McpServer({
|
|
31293
31329
|
name: "nooon",
|
|
31294
|
-
version: "0.
|
|
31330
|
+
version: "0.9.1"
|
|
31295
31331
|
});
|
|
31296
31332
|
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.", {
|
|
31297
31333
|
query: exports_external.string().describe("Search keyword"),
|
|
@@ -31384,28 +31420,40 @@ async function handleMcp(args) {
|
|
|
31384
31420
|
const scriptPath = process.argv[1];
|
|
31385
31421
|
const isLocal = args.includes("--local");
|
|
31386
31422
|
const scope = isLocal ? "local" : "user";
|
|
31387
|
-
|
|
31423
|
+
let command;
|
|
31424
|
+
if (scriptPath.endsWith(".ts")) {
|
|
31425
|
+
command = `claude mcp add nooon --scope ${scope} -- ${execPath} run ${scriptPath} mcp`;
|
|
31426
|
+
} else if (scriptPath.endsWith(".js")) {
|
|
31427
|
+
command = `claude mcp add nooon --scope ${scope} -- bunx nooon mcp`;
|
|
31428
|
+
} else {
|
|
31429
|
+
command = `claude mcp add nooon --scope ${scope} -- ${execPath} mcp`;
|
|
31430
|
+
}
|
|
31388
31431
|
console.log(command);
|
|
31389
31432
|
break;
|
|
31390
31433
|
}
|
|
31391
31434
|
case "config": {
|
|
31392
31435
|
const execPath = process.execPath;
|
|
31393
31436
|
const scriptPath = process.argv[1];
|
|
31394
|
-
|
|
31395
|
-
|
|
31396
|
-
|
|
31397
|
-
|
|
31398
|
-
args: ["run", scriptPath, "mcp"]
|
|
31437
|
+
let config2;
|
|
31438
|
+
if (scriptPath.endsWith(".ts")) {
|
|
31439
|
+
config2 = {
|
|
31440
|
+
mcpServers: {
|
|
31441
|
+
nooon: { command: execPath, args: ["run", scriptPath, "mcp"] }
|
|
31399
31442
|
}
|
|
31400
|
-
}
|
|
31401
|
-
}
|
|
31402
|
-
|
|
31403
|
-
|
|
31404
|
-
command:
|
|
31405
|
-
args: ["mcp"]
|
|
31443
|
+
};
|
|
31444
|
+
} else if (scriptPath.endsWith(".js")) {
|
|
31445
|
+
config2 = {
|
|
31446
|
+
mcpServers: {
|
|
31447
|
+
nooon: { command: "bunx", args: ["nooon", "mcp"] }
|
|
31406
31448
|
}
|
|
31407
|
-
}
|
|
31408
|
-
}
|
|
31449
|
+
};
|
|
31450
|
+
} else {
|
|
31451
|
+
config2 = {
|
|
31452
|
+
mcpServers: {
|
|
31453
|
+
nooon: { command: execPath, args: ["mcp"] }
|
|
31454
|
+
}
|
|
31455
|
+
};
|
|
31456
|
+
}
|
|
31409
31457
|
console.log(JSON.stringify(config2, null, 2));
|
|
31410
31458
|
break;
|
|
31411
31459
|
}
|
|
@@ -31484,7 +31532,7 @@ EXAMPLES:
|
|
|
31484
31532
|
async function main() {
|
|
31485
31533
|
const args = process.argv.slice(2);
|
|
31486
31534
|
if (args.includes("--version") || args.includes("-v")) {
|
|
31487
|
-
console.log("0.
|
|
31535
|
+
console.log("0.9.1");
|
|
31488
31536
|
return;
|
|
31489
31537
|
}
|
|
31490
31538
|
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|