22 Commits
Author SHA1 Message Date
Tom Moor 39a0e92223 fix: Align collection checks in list endpoints (#14715)
* fix: Align collection checks in list endpoints

* test: Cover MCP list tools for private collections
2026-11-25 11:52:42 -05:00
Tom MoorandClaude Opus 5.5 00b124d03c chore: Rename APIContext to Context and flatten its fields (#14684)
* chore: Rename APIContext to Context and flatten its fields

Auth and transaction now live directly on the context instead of in
ctx.state and a nested ctx.context, and model helpers read them directly.
APIContext remains as a deprecated alias.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MJXFeUxvU46KyvKnP8sXf

* chore: Remove deprecated APIContext alias

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MJXFeUxvU46KyvKnP8sXf

* fix: Read auth from context in OAuth provider callbacks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MJXFeUxvU46KyvKnP8sXf

* chore: Add withUser and withTransaction context helpers

Replaces manual createContext rebuilds that copy fields from an existing context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MJXFeUxvU46KyvKnP8sXf

* chore: Remove arbitrary property access from Koa context types

AppContext and Context no longer inherit the any index signature from
Koa's DefaultContext, custom fields are declared explicitly, and importing
Koa's loose Context type is disallowed by lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MJXFeUxvU46KyvKnP8sXf

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-23 23:17:06 -05:00
813b0bd5d6 Validate MCP document update edit modes (#14678)
Co-authored-by: Tom Moor <380914+tommoor@users.noreply.github.com>
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
2026-11-20 14:31:40 -05:00
Tom Moor f95761dddf perf: Use FOR NO KEY UPDATE where locked rows are only updated (#14559)
* perf: Use FOR NO KEY UPDATE where locked rows are only updated

Rows that other tables reference by foreign key are now locked with
FOR NO KEY UPDATE when the transaction only updates or soft-deletes
them, so concurrent inserts that reference the row are not blocked.

* test: Collaborative save does not wait for foreign key inserts
2026-11-12 18:54:37 -05:00
Tom Moor 7a90ee5887 fix: Run MCP document updates in a transaction (#14562) 2026-11-12 18:53:24 -05:00
Tom Moor b3eeaea035 perf: Run independent awaits concurrently on hot paths (#14445) 2026-11-02 08:07:25 -05:00
Tom Moor 7b3c8fe9f4 fix: Use loaded model ids for urlId inputs in MCP tools (#14364)
* fix: Use loaded model ids for urlId inputs in MCP tools

* fix: Reload the document under the lock when anchoring an MCP comment
2026-10-27 08:57:00 -04:00
Tom Moor 19c39aef4a fix: Use loaded model ids in MCP move_document (#14360) 2026-10-26 22:42:43 -04:00
Tom Moor 3571d59576 fix: Mark move_document MCP tool as destructive (#14320) 2026-10-24 18:29:42 -04:00
Tom Moor e471d95b40 perf: Delete comment replies in one statement and index parentCommentId (#14277)
* perf: Delete comment replies in one statement and index parentCommentId

* fix: Reject replies to a reply so thread deletion removes every reply
2026-10-24 07:29:02 -04:00
Tom Moor a7287fc7e9 fix: Set every MCP tool annotation hint explicitly (#14263)
* fix: Set every MCP tool annotation hint explicitly

* fix: Mark create_document as open-world
2026-10-23 08:44:18 -04:00
79989f4660 Fix attribution of Markdown document mentions (#14123)
Co-authored-by: Tom Moor <380914+tommoor@users.noreply.github.com>
Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
2026-10-22 21:39:27 -04:00
Tom Moor cfa9e09f17 feat: Add MCP tool to show what changed in a document (#14192)
* feat: Add get_document_changes MCP tool to diff document history

* fix: Bound document changes to the loaded snapshot and diff raw markdown

* perf: Replace structuredPatch with an integer ID line diff (#14246)

* fix: Update get_document_changes for MCP SDK v2
2026-10-22 20:43:57 -04:00
Tom Moor fb7b09ad6c fix: Close MCP subscriptions/listen streams at once (#14254)
The tool and resource lists never change during a request, so do not
advertise listChanged. This stops 2026-07-28 clients from holding open
SSE streams that the router interrupts.
2026-10-23 00:05:44 +00:00
Tom Moor d98d8bdb1f chore: Upgrade MCP SDK to v2 for 2026-07-28 protocol support (#14244)
* chore: Upgrade MCP SDK to v2 for 2026-07-28 protocol support

* test: Assert JSON replies for 2026-07-28 requests
2026-10-22 19:13:56 -04:00
Tom Moor 7f1512b499 chore: Consolidate comment and restore checks into policies (#14234) 2026-10-22 08:02:44 -04:00
Tom Moor a5b8c9102c chore: Consistent email visibility checks in user search (#14227) 2026-10-22 07:56:46 -04:00
Tom Moor e64b02388a fix: Consistent collection policy checks in MCP fetch (#14231) 2026-10-22 07:55:35 -04:00
Tom Moor 4402975f57 fix: Check permissions earlier in documents.restore (#14224) 2026-10-22 07:43:28 -04:00
linear-code[bot]andTom Moor aed1e87bb1 chore: update @modelcontextprotocol/sdk to 1.32.1 (#14145)
* chore: update MCP SDK to 1.32.1

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>

* feat: Limit MCP tool argument elements to 1000

---------

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
Co-authored-by: Tom Moor <tom@getoutline.com>
2026-10-19 18:55:10 -04:00
Tom Moor f8496ea2f7 feat: Personal collections (#14062)
* feat: Personal collections backend

Adds an owner to collections. A personal collection is private, one per user
per team, created lazily through collections.personal, and only its owner can
see or manage it. Admin bypasses in policies, lists, exports, events, webhooks
and file operations exclude the personal collections of other users. Turning
off the PersonalDocs preference makes the collection read-only.

* test: Access matrix for personal collections

Checks that collection and document endpoints, list and search results, MCP
tools, collaboration and websocket rooms agree with the read policy for the
owner, collaborators, members, admins, guests and other teams.

* feat: Personal collection in the sidebar

Adds a Personal sidebar section that renders the personal collection with the
collection document tree, creates the collection on the first new document,
and keeps it out of the Collections section. Adds the workspace setting, the
personal sidebar context, and hides collection sharing and membership UI for
personal collections.

* fix: Drag and drop in shared with me trees

Anchors the reorder drop cursor inside the row, and prefetches documents on
hover so that nested rows that were never opened can be dragged.

* feat: Personal collection owner for collaborators, no collection page

Presents the owner of the personal collection on documents, so that
collaborators see the owner in the share popover. Root rows in the Personal
section show the default document icon. A personal collection has no page:
the scene shows not found, and the breadcrumb, command bar and delete redirect
no longer link to it.

* fix: Personal sidebar indent and breadcrumb items without a link

Children of rows at depth 0 skip a level so that they start beyond the row
icon. Breadcrumb items without a destination, such as the personal and deleted
collection, are shown as plain text.

* test: Reduce personal collection tests to list paths

Endpoints that authorize a single model are already covered by the policy
tests. Keeps the lists and searches, which filter in queries, and the
presenter.

* test: Move personal collection list tests into collections tests

* feat: Create documents in the personal collection by alias

documents.create, documents.import and the MCP create_document tool accept
the collectionId "personal", which refers to the personal collection of the
user and creates it when it does not exist yet.

* refactor: Remove collections.personal route

The sidebar creates its first personal document with the personal
collectionId alias, so documents.create is the only path that creates the
personal collection.

* feat: Personal collection name, starring, templates and default

Personal collections cannot be starred, renamed or hold templates, and the
PersonalDocs preference is on by default. The app shows collections through a
displayName getter, which is the translated "Personal" for a personal
collection.

* fix: Use the same policy for starring and unstarring collections

* fix: No pins or viewer insights for personal documents

* revert: Show personal collection events in the audit log

Admins with audit access should see events in personal collections, even when
they cannot open the documents.

* fix: Load collection owner in share scopes

* fix: Keep personal collections out of workspace exports and webhooks

Workspace exports skip all personal collections, while an explicit export of
a personal collection stays available to its owner. Events in personal
collections, including attachments and documents moved after queueing, are
never delivered to workspace webhooks. Personal collections cannot be
renamed or made public through any path, cannot hold pins, and are not
offered as mentions.

* Change icon to avatar

* fix: Personal documents cannot be unpublished

* feat: Personal collection context for MCP

Collections are presented with an isPersonal flag, the server instructions
explain the personal collection, and move_document and update_document accept
the personal collectionId alias.

* fix: Keep moved personal exports private and remove pins on move

Document exports record the owner of the personal collection they came from,
so they stay private after the document moves. Moving documents into a
personal collection removes their pins, including pins to home.

* fix: Only create the personal collection in MCP when it is used
2026-10-13 07:53:06 -04:00
Tom Moor c16cfd4ca8 feat: Expose skills over MCP (#13989)
* feat: Expose skills over MCP

Implements the MCP skills extension (SEP-2640) and moves MCP code into server/mcp.

* Update skills
2026-10-07 18:58:35 -04:00