AI/MCP Ability to create notebooks #89

Merged
jfro merged 2 commits from fix-69-create-notebook into main 2026-11-13 12:42:30 +00:00
Owner

What changed

create_notebook now works from the in-app chat too: Chat.Tools has it (one shared definition with agents' keys), the chat prompt mentions it, and the chat's MCP token can call it for My files or a folder (C34). In chat it makes the notebook straight away rather than as a draft, since an empty notebook has nothing to preview. Full precommit passes (C35).

Fixes #69

Red, then green

  • A writing key gets create_notebook, which makes an empty one-page notebook in the cloud (library has it, add_page works on it), only in My files or a folder the key reaches.: bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; MIX_ENV=test mix test test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs 2>&1 | tail -3'
    • fails on the base (60213ac): exit 1
    • passes on the branch (19dddce): exit 0
  • The chat's MCP token lists create_notebook and can call it for My files or a folder; on main it has no such tool.: bash -lc 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix test test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/chat/backends/claude_test.exs'
    • fails on the base (60213ac): exit 1
    • passes on the branch (83980b8): exit 0

Checks

  • mix precommit (compile --warnings-as-errors, deps.unlock --unused, format, full suite) passes on the #69 branch. (Upper Wolfjaw): bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit 2>&1 | tail -3', exit 0
  • Re-ran the C17 tests in a fresh clone at 19dddce (27 pass) and checked write-gating, folder scoping, name cleanup and retry idempotence in the diff; untested on a real tablet or cloud. (Prover): bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; cd /tmp/pv69 && MIX_ENV=test mix test test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs 2>&1 | tail -3', exit 0
  • Reviewed #69 at 19dddce: create_notebook is write-only (needs can_write), scopes through Remarkable.folder_path + Chat.Notes.reaches_folder? like make_pdf (D3), refuses My files, trash and out-of-scope folders for a limited key, and its .content mirrors NewPdf's working cPages shape; the notebook, MCP agent, API key, NewPdf and agent tools suites pass (42 tests). (Nye): /home/peak/work/rm-analyzer-1-6-1/run-tests.sh /home/peak/work/rm-analyzer-1-6-1/rm-analyzer test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs test/rm_analyzer/remarkable/new_pdf_test.exs test/rm_analyzer/agent_tools_test.exs, exit 0
  • mix precommit (compile --warnings-as-errors, deps.unlock --unused, format check, full test suite) passes at 83980b8. (Upper Wolfjaw): bash -lc 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit', exit 0
  • Read the diff against main and re-ran the notebook, MCP agent, API key and chat backend tests in my own worktree at 83980b8 (34 pass); checked write-gating, folder scoping, name cleanup and the chat path. Untested on a real paired tablet or cloud. The chat makes notebooks without a draft, so an injected note could make an empty one, which is low impact. (Prover): bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; cd /tmp/pv69b && MIX_ENV=test mix test test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs test/rm_analyzer/chat/backends/claude_test.exs 2>&1 | tail -3', exit 0

Risks

Not run against a real paired reMarkable from the chat (tests stop at "No reMarkable is paired"); the cloud write path is the same Notebooks.make the MCP side already uses. Making it immediately instead of as an approve/discard draft is my call; easy to change if Jeremy wants a draft card. No screenshots: the only UI change is the tool line text "Made a notebook, ".

Prover

Passed (Sonnet): Read the diff against main and re-ran the notebook, MCP agent, API key and chat backend tests in my own worktree at 83980b8 (34 pass); checked write-gating, folder scoping, name cleanup and the chat path. Untested on a real paired tablet or cloud. The chat makes notebooks without a draft, so an injected note could make an empty one, which is low impact.

Every command above was run by Fortysix's Basecamp itself, on the branch named.

## What changed create_notebook now works from the in-app chat too: Chat.Tools has it (one shared definition with agents' keys), the chat prompt mentions it, and the chat's MCP token can call it for My files or a folder (C34). In chat it makes the notebook straight away rather than as a draft, since an empty notebook has nothing to preview. Full precommit passes (C35). Fixes #69 ## Red, then green - A writing key gets create_notebook, which makes an empty one-page notebook in the cloud (library has it, add_page works on it), only in My files or a folder the key reaches.: `bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; MIX_ENV=test mix test test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs 2>&1 | tail -3'` - fails on the base (60213ac): exit 1 - passes on the branch (19dddce): exit 0 - The chat's MCP token lists create_notebook and can call it for My files or a folder; on main it has no such tool.: `bash -lc 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix test test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/chat/backends/claude_test.exs'` - fails on the base (60213ac): exit 1 - passes on the branch (83980b8): exit 0 ## Checks - mix precommit (compile --warnings-as-errors, deps.unlock --unused, format, full suite) passes on the #69 branch. (Upper Wolfjaw): `bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit 2>&1 | tail -3'`, exit 0 - Re-ran the C17 tests in a fresh clone at 19dddce (27 pass) and checked write-gating, folder scoping, name cleanup and retry idempotence in the diff; untested on a real tablet or cloud. (Prover): `bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; cd /tmp/pv69 && MIX_ENV=test mix test test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs 2>&1 | tail -3'`, exit 0 - Reviewed #69 at 19dddce: create_notebook is write-only (needs can_write), scopes through Remarkable.folder_path + Chat.Notes.reaches_folder? like make_pdf (D3), refuses My files, trash and out-of-scope folders for a limited key, and its .content mirrors NewPdf's working cPages shape; the notebook, MCP agent, API key, NewPdf and agent tools suites pass (42 tests). (Nye): `/home/peak/work/rm-analyzer-1-6-1/run-tests.sh /home/peak/work/rm-analyzer-1-6-1/rm-analyzer test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs test/rm_analyzer/remarkable/new_pdf_test.exs test/rm_analyzer/agent_tools_test.exs`, exit 0 - mix precommit (compile --warnings-as-errors, deps.unlock --unused, format check, full test suite) passes at 83980b8. (Upper Wolfjaw): `bash -lc 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; mix precommit'`, exit 0 - Read the diff against main and re-ran the notebook, MCP agent, API key and chat backend tests in my own worktree at 83980b8 (34 pass); checked write-gating, folder scoping, name cleanup and the chat path. Untested on a real paired tablet or cloud. The chat makes notebooks without a draft, so an injected note could make an empty one, which is low impact. (Prover): `bash -o pipefail -c 'export PATH=$HOME/.local/bin:$PATH; eval "$(mise activate bash --shims)"; cd /tmp/pv69b && MIX_ENV=test mix test test/rm_analyzer/remarkable/new_notebook_test.exs test/rm_analyzer_web/notes_mcp_agent_test.exs test/rm_analyzer/api_keys_test.exs test/rm_analyzer/chat/backends/claude_test.exs 2>&1 | tail -3'`, exit 0 ## Risks Not run against a real paired reMarkable from the chat (tests stop at "No reMarkable is paired"); the cloud write path is the same Notebooks.make the MCP side already uses. Making it immediately instead of as an approve/discard draft is my call; easy to change if Jeremy wants a draft card. No screenshots: the only UI change is the tool line text "Made a notebook, <name>". ## Prover Passed (Sonnet): Read the diff against main and re-ran the notebook, MCP agent, API key and chat backend tests in my own worktree at 83980b8 (34 pass); checked write-gating, folder scoping, name cleanup and the chat path. Untested on a real paired tablet or cloud. The chat makes notebooks without a draft, so an injected note could make an empty one, which is low impact. Every command above was run by Fortysix's Basecamp itself, on the branch named.
jfro added this to the v1.6.1 milestone 2026-11-13 03:08:36 +00:00
feat(mcp): create_notebook makes an empty notebook
All checks were successful
CI / test (pull_request) Successful in 2m17s
19dddcee6f
A key that may write can make a new notebook with one blank page, in My
files or a folder it reaches (through Chat.Notes, as make_pdf), written
straight to the cloud as the tablet keeps a notebook it made.

Closes #69
feat(chat): create_notebook in the chat too
All checks were successful
CI / test (pull_request) Successful in 1m45s
83980b86f3
The chat's assistant gets create_notebook, shared with agents' keys. It
makes the notebook straight away, as an empty notebook has nothing to
preview as a draft.

Closes #69
jfro merged commit 7203992acd into main 2026-11-13 12:42:30 +00:00
jfro deleted branch fix-69-create-notebook 2026-11-13 12:42:30 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jfro/rm-analyzer!89
No description provided.