diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55f9966e7b..ba95754024 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,6 @@ on: push: branches: [main] pull_request: - branches: [main] env: NODE_ENV: test diff --git a/.oxlintrc.json b/.oxlintrc.json index 349f3eea59..7b2243a1a5 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -125,32 +125,6 @@ "react-hooks/exhaustive-deps": "error" }, "plugins": ["eslint", "oxc", "react", "typescript", "import"] - }, - { - "files": ["shared/**/*.{js,jsx,ts,tsx}"], - "rules": { - "no-restricted-imports": [ - "error", - { - "paths": [ - { - "name": "prosemirror-tables", - "importNames": [ - "addRowBefore", - "addRowAfter", - "addColumnBefore", - "addColumnAfter" - ], - "message": "Use the wrappers from shared/editor/commands/table instead, which respect the target index and place the cursor in the inserted cell." - }, - { - "name": "sonner", - "message": "Do not import a toast library within shared; surface notifications through the onNotice callback so shared code stays decoupled from the app's toast implementation." - } - ] - } - ] - } } ] } diff --git a/LICENSE b/LICENSE index e3cc6c8ba5..3ba5896f6a 100644 --- a/LICENSE +++ b/LICENSE @@ -3,7 +3,7 @@ Business Source License 1.1 Parameters Licensor: General Outline, Inc. -Licensed Work: Outline 1.9.1 +Licensed Work: Outline 1.10.0 The Licensed Work is (c) 2026 General Outline, Inc. Additional Use Grant: You may make use of the Licensed Work, provided that you may not use the Licensed Work for a Document @@ -15,7 +15,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that Licensed Work by creating teams and documents controlled by such third parties. -Change Date: 2030-07-13 +Change Date: 2030-09-01 Change License: Apache License, Version 2.0 diff --git a/app/.oxlintrc.json b/app/.oxlintrc.json index c5e7a685e1..9857c6171f 100644 --- a/app/.oxlintrc.json +++ b/app/.oxlintrc.json @@ -16,6 +16,18 @@ "no-restricted-imports": [ "error", { + "paths": [ + { + "name": "prosemirror-tables", + "importNames": [ + "addRowBefore", + "addRowAfter", + "addColumnBefore", + "addColumnAfter" + ], + "message": "Use the wrappers from shared/editor/commands/table instead, which respect the target index and place the cursor in the inserted cell." + } + ], "patterns": [ { "group": ["mime-types"], diff --git a/app/actions/definitions/documents.tsx b/app/actions/definitions/documents.tsx index ce8b8e7031..c411207a5e 100644 --- a/app/actions/definitions/documents.tsx +++ b/app/actions/definitions/documents.tsx @@ -1364,7 +1364,8 @@ export const searchDocumentsForQueryActionFactory = (query: string) => priority: -1, icon: , to: searchPath({ query }), - visible: ({ location }) => location.pathname !== searchPath(), + visible: ({ location, isMCP }) => + !isMCP && location.pathname !== searchPath(), }); export const moveDocumentToCollection = createAction({ diff --git a/app/actions/definitions/navigation.tsx b/app/actions/definitions/navigation.tsx index 75eba2bbe7..5287365fc0 100644 --- a/app/actions/definitions/navigation.tsx +++ b/app/actions/definitions/navigation.tsx @@ -55,6 +55,7 @@ export const navigateToRecentSearchQueryActionFactory = ( name: searchQuery.query, analyticsName: "Navigate to recent search query", icon: , + visible: ({ isMCP }) => !isMCP, to: searchPath({ query: searchQuery.query }), }); diff --git a/app/actions/definitions/revisions.tsx b/app/actions/definitions/revisions.tsx index 96bff4050a..98b14fd1c8 100644 --- a/app/actions/definitions/revisions.tsx +++ b/app/actions/definitions/revisions.tsx @@ -94,7 +94,7 @@ export const deleteRevision = createAction({ dangerous: true, visible: ({ activeDocumentId }) => !!activeDocumentId && stores.policies.abilities(activeDocumentId).update, - perform: async ({ t, event, location, activeDocumentId }) => { + perform: async ({ t, event, location, activeDocumentId, sidebarContext }) => { event?.preventDefault(); if (!activeDocumentId) { return; @@ -113,7 +113,7 @@ export const deleteRevision = createAction({ const revision = stores.revisions.get(revisionId); await revision?.delete(); toast.success(t("This version of the document was deleted")); - history.push(documentHistoryPath(document)); + history.push(documentHistoryPath(document), { sidebarContext }); } }, }); diff --git a/app/actions/definitions/webmcp.ts b/app/actions/definitions/webmcp.ts new file mode 100644 index 0000000000..fad4d68214 --- /dev/null +++ b/app/actions/definitions/webmcp.ts @@ -0,0 +1,76 @@ +import { createAction } from "~/actions"; +import { DocumentsSection, NavigationSection } from "~/actions/sections"; + +/** + * Actions that are only registered as WebMCP tools, never in menus or the + * command bar. Names and descriptions are intentionally not translated as + * they are read by agents, not users. + */ +export const getCurrentContext = createAction({ + name: "Get current context", + analyticsName: "Get current context", + section: NavigationSection, + description: + "Returns the user's current location in the app as JSON, including the active document and collection if any.", + mcp: {}, + perform: ({ stores, location }) => { + const document = stores.documents.active; + const collection = stores.collections.active; + + return JSON.stringify({ + path: location.pathname, + user: stores.auth.user + ? { id: stores.auth.user.id, name: stores.auth.user.name } + : undefined, + document: document + ? { + id: document.id, + title: document.titleWithDefault, + path: document.url, + } + : undefined, + collection: collection + ? { id: collection.id, name: collection.name, path: collection.path } + : undefined, + }); + }, +}); + +export const searchWorkspace = createAction({ + name: "Search workspace", + analyticsName: "Search workspace", + section: DocumentsSection, + description: + "Searches all documents the user can access and returns the top matches as JSON, each with an id, title, path, and a snippet of matching context.", + mcp: { + inputSchema: { + type: "object", + properties: { + query: { + type: "string", + description: "The text to search for.", + }, + }, + required: ["query"], + }, + }, + perform: async ({ stores, mcpArgs }) => { + const query = typeof mcpArgs?.query === "string" ? mcpArgs.query : ""; + if (!query) { + return "A query argument is required."; + } + + const results = await stores.documents.search({ query, limit: 10 }); + + return JSON.stringify( + results.map((result) => ({ + id: result.document.id, + title: result.document.titleWithDefault, + path: result.document.url, + context: result.context, + })) + ); + }, +}); + +export const rootWebMCPActions = [getCurrentContext, searchWorkspace]; diff --git a/app/actions/index.ts b/app/actions/index.ts index 13d83120cd..46decda4fb 100644 --- a/app/actions/index.ts +++ b/app/actions/index.ts @@ -56,7 +56,9 @@ export function createAction( ? "button" : context.isCommandBar ? "commandbar" - : "contextmenu", + : context.isMCP + ? "webmcp" + : "contextmenu", }); } return definition.perform(context); @@ -355,6 +357,10 @@ export async function performAction( if (result instanceof Promise) { return result.catch((err: Error) => { + // WebMCP callers surface errors to the agent instead of a toast. + if (context.isMCP) { + throw err; + } toast.error(err.message); }); } diff --git a/app/components/ActionButton.tsx b/app/components/ActionButton.tsx index 1fbed3eee3..e42f45bfba 100644 --- a/app/components/ActionButton.tsx +++ b/app/components/ActionButton.tsx @@ -55,7 +55,7 @@ const ActionButton = React.forwardRef( const button = (