import { PostgresLayers, type PrincipalsCache } from '@nacre.work/api'; import { type AuditWriter } from '@nacre.work/core'; import type { Pool } from 'pg'; import { type AdminToolDefinition } from './admin-tools.js'; import { type ToolRunner } from './factory.js'; /** * What the administrative tools do. docs/mcp-admin.md. * * Every read goes through the adapter the REST surface uses for the same * question — the user, group, grant, workspace, skill, connection and audit * ports — so the administrative MCP holds no second idea of who may see what. * What is here is the part an agent needs and a screen does not: resolving a * person by email and a layer by slug rather than by uuid, putting a name * beside every id, and opening each result that carries somebody else's text * with a sentence saying what that text is. * * Every write **proposes**. The tool resolves what the model named, writes the * sentence a person reads, stores it, and answers with it; the change is made * by `apply` when the person presses Apply — in the panel, through the app-only * `apply_proposal` below, or on the console's Proposals screen through the API. * The core's writes and every module's are found by the same lookup and go the * same way, so a module cannot add a write that skips the person. * * Two reads are written here rather than borrowed, and both are behind * `administers` at the top of `call`: the layer listing, because the * administrative one carries what the ordinary one deliberately does not (the * model, failures, whether a skill is set), and the name lookups, because no * port resolves an email. Each names the organization in its own literal. */ export declare const APP_ROLE = "nacre_app"; export interface AdminDeps { readonly pool: Pool; readonly audit: AuditWriter; readonly principalsCache?: PrincipalsCache; /** * The vector store, for the two layer writes: creating one asks which named * vectors the collection has, and deleting one stops its points matching * before its rows go. The same port the API hands its layers adapter. */ readonly vectors: ConstructorParameters[1]; /** * The console's address, where a person applies a proposal from a client * that renders no panel — the consent URL without its route. Absent, the * answer says "the console" without a link. */ readonly consoleUrl?: string; /** * Whether the installation has a mail relay. The notification tools are * offered only where it does: a tool that queues a message nothing will send * is a tool that says it did something it did not. This process never sends — * the worker does — so it is told the fact, not handed a sender. */ readonly notifications?: boolean; } /** The runner, and the catalog it answers for — composed once, at startup. */ export interface AdminRunner extends ToolRunner { readonly catalog: readonly AdminToolDefinition[]; } export declare function adminTools(deps: AdminDeps): AdminRunner; //# sourceMappingURL=admin-services.d.ts.map