/** * Negotiation state DTOs extracted from negotiation/negotiation.state.ts for * consumption by shared interfaces. This shared module owns the DTO schemas; * LangGraph Annotation.Root stays in the domain file. */ import { z } from "zod"; /** * Union of every negotiation turn action across protocol versions. * * v1 vocabulary: `propose | accept | reject | counter | question`. * v2 (client-advocate seat rules) renames `propose`→`outreach` and splits * `reject` into `withdraw` (initiator seat) / `decline` (counterparty seat). * Which subset is valid for a given turn depends on the task's * `protocolVersion` and the acting user's seat — see * `negotiation/negotiation.protocol.ts` for the seat-scoped schemas. */ export declare const NEGOTIATION_ACTIONS: readonly ["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline", "ask_user"]; export type NegotiationAction = (typeof NEGOTIATION_ACTIONS)[number]; /** Negotiation seat under the v2 client-advocate protocol. */ export type NegotiationSeat = "initiator" | "counterparty"; /** Negotiation protocol version stamped on task metadata. */ export type NegotiationProtocolVersion = "v1" | "v2"; /** Closed, content-free reasons that select server-owned consultation copy. */ export declare const NEGOTIATION_CONSULTATION_REASONS: readonly ["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]; export declare const NegotiationConsultationReasonSchema: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>; export type NegotiationConsultationReason = z.infer; /** * Payload for a v2 `ask_user` action. Agents may choose only a closed reason; * disclosure subjects and question wording are always rendered by fixed * server templates and can never carry model-authored instructions. */ export declare const AskUserPayloadSchema: z.ZodObject<{ reason: z.ZodEnum<["unresolved_owner_constraint", "consequential_disclosure_permission", "repeated_non_convergence", "insufficient_commitment_authority"]>; }, "strict", z.ZodTypeAny, { reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority"; }, { reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority"; }>; export type AskUserPayload = z.infer; export declare const NegotiationTurnSchema: z.ZodObject<{ action: z.ZodEnum<["propose", "accept", "reject", "counter", "question", "outreach", "withdraw", "decline", "ask_user"]>; assessment: z.ZodObject<{ reasoning: z.ZodString; suggestedRoles: z.ZodObject<{ ownUser: z.ZodEnum<["agent", "patient", "peer"]>; otherUser: z.ZodEnum<["agent", "patient", "peer"]>; }, "strip", z.ZodTypeAny, { ownUser: "agent" | "patient" | "peer"; otherUser: "agent" | "patient" | "peer"; }, { ownUser: "agent" | "patient" | "peer"; otherUser: "agent" | "patient" | "peer"; }>; }, "strip", z.ZodTypeAny, { reasoning: string; suggestedRoles: { ownUser: "agent" | "patient" | "peer"; otherUser: "agent" | "patient" | "peer"; }; }, { reasoning: string; suggestedRoles: { ownUser: "agent" | "patient" | "peer"; otherUser: "agent" | "patient" | "peer"; }; }>; message: z.ZodOptional>; /** Present when action is `ask_user` (v2, P3.2). */ askUser: z.ZodOptional; }, "strict", z.ZodTypeAny, { reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority"; }, { reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority"; }>>>; }, "strip", z.ZodTypeAny, { action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline" | "ask_user"; assessment: { reasoning: string; suggestedRoles: { ownUser: "agent" | "patient" | "peer"; otherUser: "agent" | "patient" | "peer"; }; }; message?: string | null | undefined; askUser?: { reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority"; } | null | undefined; }, { action: "propose" | "accept" | "reject" | "counter" | "question" | "outreach" | "withdraw" | "decline" | "ask_user"; assessment: { reasoning: string; suggestedRoles: { ownUser: "agent" | "patient" | "peer"; otherUser: "agent" | "patient" | "peer"; }; }; message?: string | null | undefined; askUser?: { reason: "unresolved_owner_constraint" | "consequential_disclosure_permission" | "repeated_non_convergence" | "insufficient_commitment_authority"; } | null | undefined; }>; export type NegotiationTurn = z.infer; export declare const NegotiationOutcomeSchema: z.ZodObject<{ hasOpportunity: z.ZodBoolean; agreedRoles: z.ZodArray; }, "strip", z.ZodTypeAny, { userId: string; role: "agent" | "patient" | "peer"; }, { userId: string; role: "agent" | "patient" | "peer"; }>, "many">; reasoning: z.ZodString; turnCount: z.ZodNumber; reason: z.ZodOptional>; }, "strip", z.ZodTypeAny, { reasoning: string; hasOpportunity: boolean; agreedRoles: { userId: string; role: "agent" | "patient" | "peer"; }[]; turnCount: number; reason?: "timeout" | "turn_cap" | "screened_out" | undefined; }, { reasoning: string; hasOpportunity: boolean; agreedRoles: { userId: string; role: "agent" | "patient" | "peer"; }[]; turnCount: number; reason?: "timeout" | "turn_cap" | "screened_out" | undefined; }>; export type NegotiationOutcome = z.infer; /** Context each agent receives about its user. */ export interface UserNegotiationContext { id: string; intents: Array<{ id: string; title: string; description: string; confidence: number; }>; profile: { name?: string; bio?: string; location?: string; interests?: string[]; skills?: string[]; }; } /** Seed assessment from the evaluator pre-filter. */ export interface SeedAssessment { reasoning: string; valencyRole: string; actors?: Array<{ userId: string; role: string; }>; }