@bitefoundry/onenote 0.2.2 → 0.3.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.
- package/README.md +7 -1
- package/docs/API.md +3 -3
- package/docs/MCP.md +12 -6
- package/docs/NPM.md +2 -2
- package/docs/openapi.yaml +1 -4
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -64,6 +64,8 @@ onenote whoami --json
|
|
|
64
64
|
|
|
65
65
|
For persistent environment configuration, set `ONENOTE_CLIENT_ID` and `ONENOTE_TENANT_ID`.
|
|
66
66
|
|
|
67
|
+
When supplying a token without an embedded user ID (for example an opaque `ONENOTE_ACCESS_TOKEN` or `ONENOTE_TOKEN_FILE`), run `onenote whoami` once while online to record only the token fingerprint and user ID under `identity-map/`. Running local `search` (without `--refresh`) or `--offline` with an unrecorded token returns an `Unknown identity` error instead of falling back to an empty `default` cache. Running `onenote search <query> --refresh` also records the identity binding. Whenever the token rotates or changes, run `onenote whoami` once again for the new token.
|
|
68
|
+
|
|
67
69
|
---
|
|
68
70
|
|
|
69
71
|
## Keybindings Cheat Sheet
|
|
@@ -97,7 +99,7 @@ onenote pages "Acme Engineering/Architecture" --json
|
|
|
97
99
|
onenote rename-section 'me|SECTION_ID' --name 'Architecture Notes' --json
|
|
98
100
|
onenote rename-notebook --drive-id DRIVE_ID --item-id ITEM_ID --name 'Engineering Notes' --json
|
|
99
101
|
onenote read "Q4 Architecture RFC" --json
|
|
100
|
-
onenote read "Q4 Architecture RFC" --json --
|
|
102
|
+
onenote read "Q4 Architecture RFC" --json --full
|
|
101
103
|
onenote copy-page 'me|PAGE_ID' --section 'me|SECTION_ID' --json
|
|
102
104
|
onenote create "Architecture" --title "Release Notes" '## Shipped
|
|
103
105
|
- [x] WAL pool' --json
|
|
@@ -105,6 +107,10 @@ onenote check "Migration Cutover" --block-id 'p:m3' --done --json
|
|
|
105
107
|
onenote search "canary" --json
|
|
106
108
|
```
|
|
107
109
|
|
|
110
|
+
`onenote read PAGE --json` returns compact Markdown and identifiers by default; pass `--full` for parsed blocks, raw XHTML, and resources. Passing an explicit `--format <fmt> --json` returns the full JSON page, and adding `--compact` selects the compact shape.
|
|
111
|
+
|
|
112
|
+
`onenote notebooks --json` and `onenote sections --json` return 50 items by default (text output stays unbounded unless `--limit` is passed); `pages` defaults to 50 and `search` defaults to 30. All four JSON list responses include `returned`, `has_more`, and `next_cursor`, which can be passed back with `--limit` and `--cursor` to page through results.
|
|
113
|
+
|
|
108
114
|
Use `onenote read PAGE --format blocks` to find a checkbox or text block's current element ID. Use `--done` or `--undone` to set a checkbox state. Omit both flags to toggle it.
|
|
109
115
|
|
|
110
116
|
`copy-page` uses Microsoft Graph to create a new page in the destination section and preserves the original page and its links. If the copy is still pending, pass its `operation_url` with `--operation` to check the same copy. [Copy a page](docs/API.md#copy-a-page)
|
package/docs/API.md
CHANGED
|
@@ -33,12 +33,12 @@ All OneNote endpoints are served under both `/v1/onenote/...` and the shorter `/
|
|
|
33
33
|
| `POST` | `/v1/onenote/sections` | Create section (`{ notebook, name }`) |
|
|
34
34
|
| `GET` | `/v1/onenote/pages` | List pages in a section (`?section=...&limit=50&refresh=false&offline=false`) |
|
|
35
35
|
| `POST` | `/v1/onenote/pages` | Create a top-level page (`{ section, title, markdown?, level?, image_paths? }`). `level` defaults to 0. |
|
|
36
|
-
| `GET` | `/v1/onenote/pages/{page}` | Get structured page detail (`?section=...&
|
|
36
|
+
| `GET` | `/v1/onenote/pages/{page}` | Get structured page detail (`?section=...&offline=false`) |
|
|
37
37
|
| `PATCH` | `/v1/onenote/pages/{page}` | Update block or page (`{ block_id?, title?, markdown?, section? }`) |
|
|
38
38
|
| `DELETE` | `/v1/onenote/pages/{page}` | Delete page (`?section=...`) |
|
|
39
39
|
| `POST` | `/v1/onenote/pages/{page}/append` | Append Markdown/images (`{ markdown, images? \| image_paths?, section? }`) |
|
|
40
40
|
| `POST` | `/v1/onenote/pages/{page}/todo` | Set or toggle checkbox (`{ block_id?, index?, completed?, expected_content?, force?, section? }`; alias: `/pages/{page}/toggle-todo`) |
|
|
41
|
-
| `GET` | `/v1/onenote/search` | Search local FTS5 cache (`?q=...§ion=...&limit=
|
|
41
|
+
| `GET` | `/v1/onenote/search` | Search local FTS5 cache (`?q=...§ion=...&limit=30&refresh=false`) |
|
|
42
42
|
| `POST` | `/v1/onenote/resources/download` | Download embedded resource (`{ page, index?, url?, out? \| out_dir?, section? }`; alias: `/pages/{page}/resources/download`) |
|
|
43
43
|
|
|
44
44
|
### Resource Download Response
|
|
@@ -111,4 +111,4 @@ onenote desktop-rename-section 'FULL_DESKTOP_SECTION_ID' --name 'Engineering Not
|
|
|
111
111
|
|
|
112
112
|
Use levels 0, 1 and 2 for top-level pages and the two levels of subpages. A level update sends the page's ID and level and verifies the resulting level and original parent section. A section rename verifies the section ID, parent and name. The desktop Move workflow provides no documented Graph page-ID guarantee. [OneNote COM application interface](https://learn.microsoft.com/en-us/office/client-developer/onenote/application-interface-onenote) · [Hierarchy and XML schema enumerations](https://learn.microsoft.com/en-us/office/client-developer/onenote/enumerations-onenote-developer-reference)
|
|
113
113
|
|
|
114
|
-
After a native hierarchy edit, wait for OneNote to sync. Use `onenote read PAGE --json` or MCP `get_page` to compare `summary.id`, `section_id`, `notebook_id`, `level`, and `raw_xhtml` with a previous read. Refresh hierarchy lists with `--refresh` and re-download referenced resources when binary preservation matters.
|
|
114
|
+
After a native hierarchy edit, wait for OneNote to sync. Use `onenote read PAGE --json --full` or MCP `get_page` with `compact: false` to compare `summary.id`, `section_id`, `notebook_id`, `level`, and `raw_xhtml` with a previous read. Refresh hierarchy lists with `--refresh` and re-download referenced resources when binary preservation matters.
|
package/docs/MCP.md
CHANGED
|
@@ -35,10 +35,10 @@ If installed via `npx`:
|
|
|
35
35
|
| Tool | Description | Key Parameters |
|
|
36
36
|
| --- | --- | --- |
|
|
37
37
|
| `whoami` | Return signed-in Microsoft 365 profile & auth mode | _(none)_ |
|
|
38
|
-
| `list_notebooks` | List accessible OneNote notebooks (personal, Teams/Group, SharePoint) | `include_teams?`, `refresh?`, `offline?` |
|
|
39
|
-
| `list_sections` | List sections in a notebook or across all notebooks | `notebook?`, `refresh?`, `offline?` |
|
|
40
|
-
| `list_pages` | List pages in a section (supports `Notebook/Section`, name, or ID) | `section` (required), `limit?`, `refresh?`, `offline?` |
|
|
41
|
-
| `get_page` | Read Markdown and
|
|
38
|
+
| `list_notebooks` | List accessible OneNote notebooks (personal, Teams/Group, SharePoint) | `include_teams?`, `limit?`, `cursor?`, `refresh?`, `offline?` |
|
|
39
|
+
| `list_sections` | List sections in a notebook or across all notebooks | `notebook?`, `limit?`, `cursor?`, `refresh?`, `offline?` |
|
|
40
|
+
| `list_pages` | List pages in a section (supports `Notebook/Section`, name, or ID) | `section` (required), `limit?`, `cursor?`, `refresh?`, `offline?` |
|
|
41
|
+
| `get_page` | Read compact Markdown and identifiers; pass compact: false for XHTML, blocks and resources | `page` (required), `compact?`, `offline?` |
|
|
42
42
|
| `create_notebook` | Create a new OneNote notebook | `name` (required), `group_id?`, `site_id?` |
|
|
43
43
|
| `rename_notebook` | Rename a OneNote notebook package by explicit storage IDs | `drive_id`, `item_id`, `name` (all required) |
|
|
44
44
|
| `create_section` | Create a new section inside a notebook | `notebook` (required), `name` (required) |
|
|
@@ -51,12 +51,18 @@ If installed via `npx`:
|
|
|
51
51
|
| `update_block`, `update_page` | Replace a block, edit its text, or update the page title/body | `page` (required), `block_id?`, `title?`, `markdown?`, `replace_text?`, `with_text?`, `expected_content?`, `force?` |
|
|
52
52
|
| `toggle_todo` | Set or toggle a checkbox by element ID or zero-based index | `page` (required), `block_id?`, `todo_index?`, `completed?`, `expected_content?`, `force?` |
|
|
53
53
|
| `delete_page` | Permanently delete a OneNote page | `page` (required), `confirm: true` (required) |
|
|
54
|
-
| `search_pages` | Full-text search across locally cached OneNote pages (SQLite FTS5) | `query` (required), `section?`, `limit?`, `refresh?` |
|
|
54
|
+
| `search_pages` | Full-text search across locally cached OneNote pages (SQLite FTS5) | `query` (required), `section?`, `limit?`, `cursor?`, `refresh?` |
|
|
55
55
|
| `download_resource` | Download an embedded OneNote image or file attachment to disk | `page` (required), `index?`, `out_dir?` |
|
|
56
56
|
|
|
57
|
+
The server resolves the signed-in account and local cache on the first `tools/call`; `initialize`, `ping`, and `tools/list` respond without contacting Graph or selecting a cache.
|
|
58
|
+
|
|
57
59
|
### Page reads and writes
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
`get_page` returns the compact page by default, including `page.page_key`, `page.scope`, `page.omitted`, and `page.hint`. Pass `compact: false` to read `page.blocks[].element_id`, `page.raw_xhtml`, and `page.resources`. Write tools (`append_page`, `update_block`, `update_page`, `toggle_todo`) always return the full `page` object. Use current element IDs for block writes. Both `update_block` and its `update_page` alias appear in `tools/list`.
|
|
62
|
+
|
|
63
|
+
### List paging
|
|
64
|
+
|
|
65
|
+
`list_notebooks` and `list_sections` return up to 50 items by default (`limit` range `1`–`1000`); `list_pages` defaults to 50 and `search_pages` defaults to 30. All four responses include `returned`, `has_more`, and `next_cursor` (pass `next_cursor` back as `cursor` to read the next page). When called with `offline: true`, `list_notebooks`, `list_sections`, and `list_pages` also include `cache_synced_at` (an RFC 3339 timestamp string, or `null` when the cache has never been synced). `search_pages` includes `cache: { pages, pages_with_body }` to show how many cached pages exist and how many have hydrated bodies.
|
|
60
66
|
|
|
61
67
|
`rename_section` takes the section's current ID from `list_sections`. `rename_notebook` takes the current DriveItem ID and requires a delegated file-write token. The desktop tools use the Windows app's object IDs from `GetHierarchy`. [Hierarchy operations and permissions](API.md#hierarchy-operations)
|
|
62
68
|
|
package/docs/NPM.md
CHANGED
|
@@ -32,7 +32,7 @@ terminal image preview (`Kitty` / `iTerm2` / `Sixel` / `Halfblock` via `onenote
|
|
|
32
32
|
and the interactive TUI).
|
|
33
33
|
|
|
34
34
|
- `onenote login`, `onenote logout`, `onenote whoami`, `onenote doctor --online`
|
|
35
|
-
- `onenote notebooks`, `onenote sections [notebook]`, `onenote pages <section
|
|
35
|
+
- `onenote notebooks [--limit N] [--cursor N]`, `onenote sections [notebook] [--limit N] [--cursor N]`, `onenote pages <section> [--limit N] [--cursor N]`, `onenote read <page> [--json [--full]]`
|
|
36
36
|
- `onenote create-notebook <name>`, `onenote create-section <notebook> <name>`
|
|
37
37
|
- `onenote rename-section <section-id> --name <new-name> [--json]`
|
|
38
38
|
- `onenote rename-notebook --drive-id <drive-id> --item-id <item-id> --name <name> [--json]`
|
|
@@ -41,7 +41,7 @@ and the interactive TUI).
|
|
|
41
41
|
- `onenote append <page> [markdown] [--file <file>] [--image <path>]`
|
|
42
42
|
- `onenote update <page> [--title <title>] [--body <markdown> | --file <file>] [--block-id <id>]`
|
|
43
43
|
- `onenote check <page> [--block-id <id> | --index <n>] [--done | --undone]`, `onenote delete <page> --yes`
|
|
44
|
-
- `onenote search <query
|
|
44
|
+
- `onenote search <query> [--limit N] [--cursor N]`, `onenote resource <page> [--index <n>] [--out <directory>]`
|
|
45
45
|
- `onenote sync`, `onenote daemon <start|status|stop|restart|run>`, `onenote tui`, `onenote serve`, `onenote mcp`, `onenote preview-file <path>`, `onenote self-update`
|
|
46
46
|
|
|
47
47
|
```sh
|
package/docs/openapi.yaml
CHANGED
|
@@ -168,9 +168,6 @@ paths:
|
|
|
168
168
|
- name: section
|
|
169
169
|
in: query
|
|
170
170
|
schema: { type: string }
|
|
171
|
-
- name: refresh
|
|
172
|
-
in: query
|
|
173
|
-
schema: { type: boolean, default: false }
|
|
174
171
|
- name: offline
|
|
175
172
|
in: query
|
|
176
173
|
schema: { type: boolean, default: false }
|
|
@@ -288,7 +285,7 @@ paths:
|
|
|
288
285
|
schema: { type: string }
|
|
289
286
|
- name: limit
|
|
290
287
|
in: query
|
|
291
|
-
schema: { type: integer, default:
|
|
288
|
+
schema: { type: integer, default: 30 }
|
|
292
289
|
- name: refresh
|
|
293
290
|
in: query
|
|
294
291
|
schema: { type: boolean, default: false }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitefoundry/onenote",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Microsoft OneNote terminal client & AI agent toolkit — Notebooks, Sections, Pages, XHTML/Markdown & Resources (CLI, TUI, HTTP API, MCP)",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"build:npm": "node scripts/build-npm.mjs"
|
|
41
41
|
},
|
|
42
42
|
"optionalDependencies": {
|
|
43
|
-
"@bitefoundry/onenote-win32-x64": "0.
|
|
44
|
-
"@bitefoundry/onenote-win32-arm64": "0.
|
|
45
|
-
"@bitefoundry/onenote-darwin-x64": "0.
|
|
46
|
-
"@bitefoundry/onenote-darwin-arm64": "0.
|
|
47
|
-
"@bitefoundry/onenote-linux-x64": "0.
|
|
48
|
-
"@bitefoundry/onenote-linux-arm64": "0.
|
|
43
|
+
"@bitefoundry/onenote-win32-x64": "0.3.0",
|
|
44
|
+
"@bitefoundry/onenote-win32-arm64": "0.3.0",
|
|
45
|
+
"@bitefoundry/onenote-darwin-x64": "0.3.0",
|
|
46
|
+
"@bitefoundry/onenote-darwin-arm64": "0.3.0",
|
|
47
|
+
"@bitefoundry/onenote-linux-x64": "0.3.0",
|
|
48
|
+
"@bitefoundry/onenote-linux-arm64": "0.3.0"
|
|
49
49
|
}
|
|
50
50
|
}
|