@wirecat/notion-cli 0.3.0 → 0.4.0

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -0
  3. package/contracts/wirecat.json +49 -0
  4. package/dist/bin/notion.js +2 -2
  5. package/dist/bundle/{chunk-CBGBFAYJ.js → chunk-FIHXADRF.js} +3 -1
  6. package/dist/bundle/notion.js +2 -2
  7. package/dist/bundle/{program-QC5MX4ZJ.js → program-7K34KI27.js} +510 -173
  8. package/dist/commands/comments.d.ts +4 -0
  9. package/dist/commands/comments.d.ts.map +1 -0
  10. package/dist/commands/comments.js +80 -0
  11. package/dist/commands/comments.js.map +1 -0
  12. package/dist/commands/documents.d.ts.map +1 -1
  13. package/dist/commands/documents.js +5 -102
  14. package/dist/commands/documents.js.map +1 -1
  15. package/dist/commands/files.d.ts +4 -0
  16. package/dist/commands/files.d.ts.map +1 -0
  17. package/dist/commands/files.js +57 -0
  18. package/dist/commands/files.js.map +1 -0
  19. package/dist/commands/library.d.ts.map +1 -1
  20. package/dist/commands/library.js +47 -8
  21. package/dist/commands/library.js.map +1 -1
  22. package/dist/commands/writing.d.ts +32 -0
  23. package/dist/commands/writing.d.ts.map +1 -0
  24. package/dist/commands/writing.js +126 -0
  25. package/dist/commands/writing.js.map +1 -0
  26. package/dist/config.d.ts.map +1 -1
  27. package/dist/config.js +3 -0
  28. package/dist/config.js.map +1 -1
  29. package/dist/notion/errors.d.ts.map +1 -1
  30. package/dist/notion/errors.js +2 -0
  31. package/dist/notion/errors.js.map +1 -1
  32. package/dist/notion/notion.d.ts +38 -0
  33. package/dist/notion/notion.d.ts.map +1 -1
  34. package/dist/notion/notion.js +43 -0
  35. package/dist/notion/notion.js.map +1 -1
  36. package/dist/notion/writes.d.ts +38 -0
  37. package/dist/notion/writes.d.ts.map +1 -1
  38. package/dist/notion/writes.js +73 -0
  39. package/dist/notion/writes.js.map +1 -1
  40. package/dist/program.d.ts.map +1 -1
  41. package/dist/program.js +4 -0
  42. package/dist/program.js.map +1 -1
  43. package/dist/sync/browse.d.ts +30 -0
  44. package/dist/sync/browse.d.ts.map +1 -0
  45. package/dist/sync/browse.js +67 -0
  46. package/dist/sync/browse.js.map +1 -0
  47. package/dist/sync/cursor.d.ts +17 -0
  48. package/dist/sync/cursor.d.ts.map +1 -1
  49. package/dist/sync/cursor.js +28 -0
  50. package/dist/sync/cursor.js.map +1 -1
  51. package/dist/sync/files.d.ts +1 -0
  52. package/dist/sync/files.d.ts.map +1 -1
  53. package/dist/sync/files.js +10 -0
  54. package/dist/sync/files.js.map +1 -1
  55. package/dist/sync/source.d.ts +3 -3
  56. package/dist/sync/source.d.ts.map +1 -1
  57. package/dist/sync/source.js +39 -39
  58. package/dist/sync/source.js.map +1 -1
  59. package/dist/version.d.ts +1 -1
  60. package/dist/version.js +1 -1
  61. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  Notable changes to `@wirecat/notion-cli`. One section per version, newest first.
4
4
 
5
+ ## 0.4.0 — 16.11.2026
6
+
7
+ ### Added
8
+
9
+ - `comments list`, `comments create` and `comments reply` read and write the comments on a Notion page, live.
10
+ `comments list` shows only unresolved comments, as Notion's API gives no others. A comment's text never reaches a
11
+ run record. See [Comments and files](docs/dev/DESIGN.md#comments-and-files).
12
+ - `files upload <file> --parent <page>` uploads a file and adds it to the end of a page as an image, video, audio, PDF
13
+ or file block. A file over 20 MB goes in parts of 10 MB. Only a regular file is sent, as with `--file`.
14
+ - Each write checks its own permission (`comments.create`, `files.upload`) and the `api` operations it sends, and
15
+ takes `--dry-run`.
16
+
17
+ ### Changed — may break callers
18
+
19
+ - `folders browse` pages: `--limit` (100 by default) and `--cursor` from `page.next_cursor`. At the top of the
20
+ workspace it reads Notion's search one page at a time instead of all of it, so a large workspace answers within a
21
+ minute. Each item now says where it sits (`parent`, null at the top) and whether sync already copies it as `added`,
22
+ the field drive's `folders browse` uses, in place of `chosen`. A database lists nothing inside, as its rows are not
23
+ folders. When Notion's search was cut at 10,000 results, the answer says so in `missing`.
24
+
25
+ ### Fixed
26
+
27
+ - On Windows, `files upload` and `--file` refuse a link to a file too. Windows has no `O_NOFOLLOW`, so the link was
28
+ followed there.
29
+
5
30
  ## 0.3.0 — 16.11.2026
6
31
 
7
32
  ### Added
package/README.md CHANGED
@@ -24,6 +24,9 @@ their properties, and later keeps a folder of Markdown files in step with a Noti
24
24
  <page> --file page.md` replaces a page's text, `documents delete <page>` moves it to Notion's trash after asking, and
25
25
  `documents restore <page>` brings it back. An update that would delete a child page or database needs
26
26
  `--allow-deleting-content`; `--dry-run` shows what a write would do and sends nothing.
27
+ - `notion personal comments list <page>` shows a page's open comments (Notion's API gives no resolved ones), `comments
28
+ create <page> --text …` starts a discussion and `comments reply <discussion> --text …` answers in one.
29
+ `files upload <file> --parent <page>` adds a file to the end of a page.
27
30
  - `notion personal databases list` lists the databases the token sees; `databases show <id or link>` gives each data
28
31
  source's id and its properties.
29
32
  - `notion doctor`, `notion personal mcp serve` and the other commands every WireCat CLI shares.
@@ -715,6 +715,55 @@
715
715
  "permission": "databases.show",
716
716
  "entity": "database"
717
717
  },
718
+ {
719
+ "path": [
720
+ "comments",
721
+ "list"
722
+ ],
723
+ "summary": "list the open comments on a Notion page or block, live",
724
+ "effects": {
725
+ "remote": "read",
726
+ "local": "read"
727
+ },
728
+ "permission": "comments.list",
729
+ "entity": "notion_comment"
730
+ },
731
+ {
732
+ "path": [
733
+ "comments",
734
+ "create"
735
+ ],
736
+ "summary": "comment on a Notion page",
737
+ "effects": {
738
+ "remote": "write",
739
+ "local": "write"
740
+ },
741
+ "permission": "comments.create"
742
+ },
743
+ {
744
+ "path": [
745
+ "comments",
746
+ "reply"
747
+ ],
748
+ "summary": "reply in a Notion discussion",
749
+ "effects": {
750
+ "remote": "write",
751
+ "local": "write"
752
+ },
753
+ "permission": "comments.reply"
754
+ },
755
+ {
756
+ "path": [
757
+ "files",
758
+ "upload"
759
+ ],
760
+ "summary": "upload a file to the end of a Notion page",
761
+ "effects": {
762
+ "remote": "write",
763
+ "local": "write"
764
+ },
765
+ "permission": "files.upload"
766
+ },
718
767
  {
719
768
  "path": [
720
769
  "api",
@@ -9,7 +9,7 @@ if (
9
9
  (words[0] === "--version" || words[0] === "-V") &&
10
10
  !Object.keys(process.env).some((key) => key.endsWith("_TEST_ARGV_LOG"))
11
11
  ) {
12
- process.stdout.write("0.3.0\n")
12
+ process.stdout.write("0.4.0\n")
13
13
  } else {
14
14
  // Before the bundle compiles: the bundle's own call comes after its chunks.
15
15
  module.enableCompileCache()
@@ -28,7 +28,7 @@ if (
28
28
  : next(specifier, context),
29
29
  })
30
30
  }
31
- const chunks = ["../bundle/all-profiles-4IONYZB6.js","../bundle/anthropic-OXF74J4P.js","../bundle/app-server-M2VF6ABM.js","../bundle/bun-DLA6QRLL.js","../bundle/bun-sqlite-F4BYLW3F.js","../bundle/decode-5O7IEFPN.js","../bundle/definitions-M3U4UYHN.js","../bundle/dispatch-YHQX6FEJ.js","../bundle/dist-ILNOLGYN.js","../bundle/echarts-ARLMVQC7.js","../bundle/embed-FUDUKQ3K.js","../bundle/embedder-HDRV7GX3.js","../bundle/failure-JHXICWIL.js","../bundle/first-screen-F5F3VS6Y.js","../bundle/instructions-MEFIKCDI.js","../bundle/mcp-VMS6PBCU.js","../bundle/meeting-combined-HNSS3FQY.js","../bundle/meeting-model-REZVYGQW.js","../bundle/meeting-semantic-R4CSLVRG.js","../bundle/node-KM3CUABH.js","../bundle/node-MAQALPLA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-J7IJYNBO.js","../bundle/oauth-AMV4YGJD.js","../bundle/open-AB27MTGR.js","../bundle/openai-D77MU5XV.js","../bundle/process-SIOWTRJ6.js","../bundle/program-QC5MX4ZJ.js","../bundle/prompt-W77YDHA6.js","../bundle/recognize-3JAXQQ36.js","../bundle/remote-PSOJXCXO.js","../bundle/rerank-EE44ZTGL.js","../bundle/schemas-LBYUMBC6.js","../bundle/serve-XJMGAMFW.js","../bundle/server-ASU6CP5R.js","../bundle/server-WSPQ5EOA.js","../bundle/services-PT4PA4J6.js","../bundle/sqlite-runtime-YHXRTVXE.js","../bundle/state-T6ZKFWGD.js","../bundle/store-3MUCZEI3.js","../bundle/store-E5EE25FY.js","../bundle/store-maintenance-command-ZZ55BBBG.js"]
31
+ const chunks = ["../bundle/all-profiles-4IONYZB6.js","../bundle/anthropic-OXF74J4P.js","../bundle/app-server-M2VF6ABM.js","../bundle/bun-DLA6QRLL.js","../bundle/bun-sqlite-F4BYLW3F.js","../bundle/decode-5O7IEFPN.js","../bundle/definitions-M3U4UYHN.js","../bundle/dispatch-YHQX6FEJ.js","../bundle/dist-ILNOLGYN.js","../bundle/echarts-ARLMVQC7.js","../bundle/embed-FUDUKQ3K.js","../bundle/embedder-HDRV7GX3.js","../bundle/failure-JHXICWIL.js","../bundle/first-screen-F5F3VS6Y.js","../bundle/instructions-MEFIKCDI.js","../bundle/mcp-VMS6PBCU.js","../bundle/meeting-combined-HNSS3FQY.js","../bundle/meeting-model-REZVYGQW.js","../bundle/meeting-semantic-R4CSLVRG.js","../bundle/node-KM3CUABH.js","../bundle/node-MAQALPLA.js","../bundle/node-TLZSIHIJ.js","../bundle/node-sqlite-J7IJYNBO.js","../bundle/oauth-AMV4YGJD.js","../bundle/open-AB27MTGR.js","../bundle/openai-D77MU5XV.js","../bundle/process-SIOWTRJ6.js","../bundle/program-7K34KI27.js","../bundle/prompt-W77YDHA6.js","../bundle/recognize-3JAXQQ36.js","../bundle/remote-PSOJXCXO.js","../bundle/rerank-EE44ZTGL.js","../bundle/schemas-LBYUMBC6.js","../bundle/serve-XJMGAMFW.js","../bundle/server-ASU6CP5R.js","../bundle/server-WSPQ5EOA.js","../bundle/services-PT4PA4J6.js","../bundle/sqlite-runtime-YHXRTVXE.js","../bundle/state-T6ZKFWGD.js","../bundle/store-3MUCZEI3.js","../bundle/store-E5EE25FY.js","../bundle/store-maintenance-command-ZZ55BBBG.js"]
32
32
  if (((words) => words
33
33
  .filter((word) => !word.startsWith("-"))
34
34
  .slice(0, 2)
@@ -3009,6 +3009,7 @@ var REASONS = defineReasons([
3009
3009
  ["notion.listing-restarted", "validation_error", "Notion no longer took a saved list position; it started over"],
3010
3010
  ["notion.listing-stale", "not_found", "Notion no longer takes a folder's saved position; it is listed again"],
3011
3011
  ["notion.timeout-too-short", "timeout", "the time left was too short for one step of the sync"],
3012
+ ["notion.upload-unfinished", "invalid_response", "Notion did not mark the file upload as uploaded"],
3012
3013
  ["source.text-limit", "validation_error", "the page is longer than the text the store keeps"],
3013
3014
  ["profile.not-synced", "not_found", "the profile has no local copy yet; sync first"],
3014
3015
  ["profile.busy", "provider_unavailable", "another sync or write holds the profile's local copy"],
@@ -3016,6 +3017,7 @@ var REASONS = defineReasons([
3016
3017
  ["folder.not-a-folder", "validation_error", "only a page or a database can be chosen as a folder"],
3017
3018
  ["folder.not-chosen", "not_found", "that page or database is not a chosen folder"],
3018
3019
  ["folder.workspace", "validation_error", "the whole workspace is the scope when no folder is chosen"],
3020
+ ["folder.cursor-invalid", "validation_error", "the cursor is not one folders browse gave for this parent"],
3019
3021
  ["identity.not-seen", "not_found", "this Notion user was not seen on the document"],
3020
3022
  ["identity.target", "validation_error", "the target must be a person: reference"],
3021
3023
  ["identity.no-person", "not_found", "the target person has no known identity"],
@@ -3100,7 +3102,7 @@ var isItemError = /* @__PURE__ */ __name((error) => isCliError(error) && (error.
3100
3102
  var isRefused = /* @__PURE__ */ __name((error) => isCliError(error) && error.code === "validation_error" && error.details.status === 400, "isRefused");
3101
3103
 
3102
3104
  // dist/version.js
3103
- var VERSION = "0.3.0";
3105
+ var VERSION = "0.4.0";
3104
3106
 
3105
3107
  // dist/identity.js
3106
3108
  var PACKAGE = "@wirecat/notion-cli";
@@ -3,7 +3,7 @@ import { createRequire as __bundleRequire } from "node:module";
3
3
  const require = __bundleRequire(import.meta.url);
4
4
  import {
5
5
  DESKTOP
6
- } from "./chunk-CBGBFAYJ.js";
6
+ } from "./chunk-FIHXADRF.js";
7
7
  import {
8
8
  installerOf
9
9
  } from "./chunk-YAPDU3SV.js";
@@ -179,7 +179,7 @@ var wcat = await wcatStart(DESKTOP);
179
179
  if (wcat.code !== void 0) {
180
180
  process.exitCode = wcat.code;
181
181
  } else {
182
- const { run } = await import("./program-QC5MX4ZJ.js");
182
+ const { run } = await import("./program-7K34KI27.js");
183
183
  process.exitCode = await run(process.argv.slice(2));
184
184
  }
185
185
  stopCatching();