/** * Multisig proposal and approval workflows. * * CLI adapters own prompts, output, and argument parsing. This module owns * proposal publishing, mailbox polling, KEL/RPY/VDR approval, and delegation * completion for command-local multisig operations. */ import { type Operation } from "effection"; import { SerderKERI } from "../../../cesr/mod.js"; import { type AgentRuntime } from "./agent-runtime.js"; import { MULTISIG_ICP_ROUTE, MULTISIG_ISS_ROUTE, MULTISIG_IXN_ROUTE, MULTISIG_ROT_ROUTE, MULTISIG_RPY_ROUTE, MULTISIG_VCP_ROUTE } from "./grouping.js"; import type { Hab, Habery } from "./habbing.js"; export type MultisigKelRoute = typeof MULTISIG_ICP_ROUTE | typeof MULTISIG_ROT_ROUTE | typeof MULTISIG_IXN_ROUTE; export type MultisigVdrRoute = typeof MULTISIG_VCP_ROUTE | typeof MULTISIG_ISS_ROUTE; export type MultisigRpyRoute = typeof MULTISIG_RPY_ROUTE; export type MultisigProposalRoute = MultisigKelRoute | MultisigVdrRoute | MultisigRpyRoute; export interface ApprovalResult { route: MultisigProposalRoute; said: string; embedded: string; group: string; accepted: boolean; deliveries: string[]; } export interface ApprovalPromptContext { route: string; group: string; embedded: string; } export interface MultisigApprovalCallbacks { approveProposal(context: ApprovalPromptContext): boolean; chooseGroupAlias(groupPre: string): string; chooseRegistryName(regk: string): string; } export interface MultisigApprovalOptions { group?: string; said?: string; pollTurns: number; pollBudgetMs: number; callbacks: MultisigApprovalCallbacks; } /** Publish one KEL-style group proposal to remote members. */ export declare function publishProposal(runtime: AgentRuntime, member: Hab, recipients: readonly string[], route: MultisigKelRoute, label: "icp" | "rot" | "ixn", payload: Record, embeddedMessage: Uint8Array): Operation; /** Publish one multisig proposal with explicit embedded attachments. */ export declare function publishProposalEmbeds(runtime: AgentRuntime, member: Hab, recipients: readonly string[], route: MultisigProposalRoute, payload: Record, embeds: Record): Operation; /** Poll until a specific group KEL event is accepted or attempts expire. */ export declare function waitForGroupAcceptance(hby: Habery, runtime: AgentRuntime, serder: SerderKERI, options: MultisigApprovalOptions): Operation; /** Poll for and approve one pending multisig notification. */ export declare function waitForOneApproval(hby: Habery, runtime: AgentRuntime, options: MultisigApprovalOptions): Operation; /** Wait for a locally authored group event to complete through stored approvals. */ export declare function waitForLocalGroupCompletion(hby: Habery, runtime: AgentRuntime, options: MultisigApprovalOptions): Operation; /** Poll for endpoint-role reply state after a group RPY proposal. */ export declare function waitForReplyAcceptance(hby: Habery, runtime: AgentRuntime, groupPre: string, role: string, eid: string, options: MultisigApprovalOptions): Operation; /** Complete the delegation workflow for an accepted delegated group event. */ export declare function completeDelegationIfNeeded(hby: Habery, runtime: AgentRuntime, pre: string, proxy?: string): Operation; /** True when a KEL event is accepted locally. */ export declare function eventAccepted(hby: Habery, serder: SerderKERI): boolean; export declare function routeForKelEvent(serder: SerderKERI): MultisigKelRoute | null; //# sourceMappingURL=multisig-workflows.d.ts.map