@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
22 lines • 1.12 kB
JavaScript
export const PRESENTER_CONTROL_INFO_COMMAND = "mcp_presenter_control_info";
/** The presenter client records the private handler takes (`session-event-writer.ts`, `mcp-presenter-forms.ts`). */
const PRESENTER_CLIENT_RECORDS = new Set([
"mcp_presenter_context",
"mcp_form_presented",
"mcp_form_response",
"mcp_form_sync",
]);
/** A type a forwarder routes as private: its answer is always the private reply shape on a delegated connection. */
export function isPrivatePresenterType(type) {
return typeof type === "string" && (type.startsWith("mcp_form_") || type.startsWith("mcp_presenter_"));
}
export function privatePresenterVerdict(type, id, granted) {
if (type === PRESENTER_CONTROL_INFO_COMMAND)
return { kind: "private", id, error: "presenter_not_authorized" };
if (!PRESENTER_CLIENT_RECORDS.has(type))
return { kind: "private", id, error: "delegation_unclassified" };
if (!granted.has("answer"))
return { kind: "private", id, error: "delegation_not_granted" };
return { kind: "presenter", id };
}
//# sourceMappingURL=delegated-presenter-records.js.map