import { $Fetch } from 'ofetch'; /** Copilot lanes (registry `_LANE_AUTHORING_SCOPES`). */ export type PeopleCopilotLane = 'request-type' | 'process-type' | 'policy' | 'machine-face-kind'; /** Assist modes per lane (context_assembly — BE vocabulary; comprehend is * read-only). */ export type PeopleCopilotMode = 'draft' | 'precheck' | 'explain-fix' | 'comprehend' | (string & {}); /** `op=start` request body. */ export interface PeopleCopilotStartParams { op: 'start'; lane: PeopleCopilotLane; mode: PeopleCopilotMode; /** Content uuid of the T1 target row (request_type / process_type / * policy). EMPTY/omitted in mode=draft — a brand-new definition has * no row yet; the session starts against the lane itself (PIP-005 * WS-B draft intake). */ targetRef?: string; } /** Grounding bundle returned by `op=start` (advisory context only). */ export interface PeopleCopilotBundle { lane: string; mode: string; targetRef: string; renderedGrounding: string; cataloguePin: string; schemaRef?: string | null; exampleRefs: string[]; dryRun?: Record | null; validationErrors: string[]; statusWarning?: string | null; promptHash: string; } /** `op=start` response. */ export interface PeopleCopilotStartResult { conversationId: string; bundle: PeopleCopilotBundle; promptHash: string; transport: string; advisory: string; } /** A pending/confirmed/discarded proposal on the ledger (D2 contract). */ export interface PeopleCopilotProposal { id: string; kind: string; summary: string; proposal_hash: string; status: 'pending' | 'confirmed' | 'discarded' | (string & {}); confirm_actor?: string | null; execution_ref?: string | null; commit_sha?: string | null; } /** `op=record` request body — mirror one user turn and/or transition a * proposal and/or end the session (pending ⇒ discarded on end). */ export interface PeopleCopilotRecordParams { op: 'record'; conversationId: number | string; /** Only user-authored turns accepted without a gateway receipt. */ turn?: { role: 'user'; content: string; }; proposal?: { id: string; kind?: 'edit'; summary?: string; /** The authored tree — `diff.after` is hashed into `proposal_hash`. */ diff?: { after: Record; }; status: 'pending' | 'confirmed' | 'discarded'; /** Required when status=confirmed — the HUMAN edit execution uuid * (host ran the real action; the route verifies provenance). */ execution_ref?: string; commit_sha?: string; }; end?: boolean; } /** `op=record` response. */ export interface PeopleCopilotRecordResult { conversationId: string; status: 'active' | 'completed'; metadataUpdateMode: 'metadata' | 'none'; message: boolean; proposal: { id: string; status: string; ok: boolean; } | null; ended: boolean; } /** One assist session row (E4a projection). */ export interface PeopleCopilotSession { conversationId: string; userId: number; status: 'active' | 'completed' | (string & {}); lane: string; targetRef: string; mode: string; contextRefs: Record; proposals: PeopleCopilotProposal[]; totalTokens: number; totalCostUsd: number; createdAt: string | null; completedAt: string | null; } /** `GET /sessions` response. */ export interface PeopleCopilotSessionsResult { items: PeopleCopilotSession[]; count: number; cursor: string | null; hasMore: boolean; } export interface IPeopleCopilotService { /** `op=start` — lane permission + spend-cap + context assembly; creates * the assist ledger row on engine `llm_conversations`. */ start(params: PeopleCopilotStartParams): Promise; /** `op=record` — mirror a user turn / transition a proposal / end. */ record(params: PeopleCopilotRecordParams): Promise; /** Lane/target/status projection over the caller's assist ledger. */ sessions(query?: { lane?: string; targetRef?: string; status?: string; limit?: number; cursor?: string; }): Promise; } export interface IPeopleCopilotServiceOptions { /** The CMS `$Fetch` instance (one of `sdk.apis`). */ api: $Fetch; } export declare const PEOPLE_COPILOT_ENDPOINT: { readonly ASSIST: "/api/v1/people/copilot/assist"; readonly SESSIONS: "/api/v1/people/copilot/sessions"; }; export declare function createPeopleCopilotService(opts: IPeopleCopilotServiceOptions): IPeopleCopilotService; //# sourceMappingURL=index.d.ts.map