Files
PaperClipAI/server/src/services/muse-oauth.ts
T
DottaandPaperclip e6dcc6b095 Connect personal Muse through secure native execution and Vault OAuth (#16448)
Add company-scoped Muse native control, OAuth, wake receiver and recovery.

Recheck current authority after waits and before effects or receipt replay. Preserve task-read scope, assignment expiry, independent holds, nonblocking reassignment and truthful cleanup provenance.

Retain source trust on progress comments and verify current Muse V8 authority through real signed-JWT HTTP requests. Preserve the upstream trimmed ordinary authentication lookup.

Refs #16448.

Preserve captured canonical queue recovery and concurrent environment preparation while retaining the scoped Muse V8 exclusion. Normal migration 0354 and existing Muse SQL remain unchanged. Fresh current-head Greptile review is 5/5 with the project-write finding addressed. Required CI and independent technical review gate the merge; maintainer override is reserved for formal approval rules.

Recheck current Muse project-write authority after all receipt/task/run/admission waits, before creation or replay. Real PostgreSQL regressions reproduce four late effects/replays on the old route; the repaired three-file treatment passes 354 cases with no skips, and the scoped server typecheck passes. Ordinary/Dot behavior is preserved.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-17 22:44:36 -05:00

10 lines
503 B
TypeScript

import type { Db } from "@paperclipai/db";
import { MUSE_RESOURCE_PATH } from "@paperclipai/shared";
import { createPublicMcpOAuth } from "./public-mcp/oauth.js";
import { musePublicOrigin } from "./muse-setup.js";
/** Dedicated Muse mode reuses only OAuth lifecycle; it exposes no MCP executor. */
export function museOAuth(db:Db,publicOrigin?:string) {
const origin=musePublicOrigin(publicOrigin);
return createPublicMcpOAuth(db,{origin,resource:origin+MUSE_RESOURCE_PATH},{mode:"muse_agent"});
}