Skip to content

Variable: SendAndWaitResultSchema

const SendAndWaitResultSchema: ZodObject<{
  reply: ZodNullable<ZodObject<object & object, "strip", ZodTypeAny, {
     catch_up?: {
        epoch: number;
        evicted: boolean;
        processed: number;
     };
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     decrypt_error?: string | null;
     decrypt_error_code?: string | null;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     key_changed?: {
        agent_id: string;
        current_fingerprint: string;
        previous_fingerprint: string;
     };
     metadata: Record<string, unknown>;
     plaintext?: unknown;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_kid?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
     verification_status: "verified" | "invalid" | "sender-mismatch" | "unverifiable";
     verified: boolean;
   }, {
     catch_up?: {
        epoch: number;
        evicted: boolean;
        processed: number;
     };
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     decrypt_error?: string | null;
     decrypt_error_code?: string | null;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     key_changed?: {
        agent_id: string;
        current_fingerprint: string;
        previous_fingerprint: string;
     };
     metadata?: Record<string, unknown>;
     plaintext?: unknown;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_kid?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
     verification_status?: "verified" | "invalid" | "sender-mismatch" | "unverifiable";
     verified?: boolean;
  }>>;
  sent: ZodObject<{
     content_type: ZodOptional<ZodNullable<ZodString>>;
     conversation_id: ZodString;
     created_at: ZodString;
     delivered_at: ZodOptional<ZodNullable<ZodString>>;
     direction: ZodOptional<ZodEnum<["sent", "received"]>>;
     encrypted_payload: ZodString;
     encryption_version: ZodString;
     from_agent_id: ZodOptional<ZodNullable<ZodString>>;
     group_handle: ZodOptional<ZodNullable<ZodString>>;
     group_id: ZodOptional<ZodNullable<ZodString>>;
     id: ZodString;
     metadata: ZodDefault<ZodRecord<ZodString, ZodUnknown>>;
     read_at: ZodOptional<ZodNullable<ZodString>>;
     recipient_handle: ZodOptional<ZodNullable<ZodString>>;
     self_encrypted_payload: ZodOptional<ZodNullable<ZodString>>;
     sender_handle: ZodOptional<ZodNullable<ZodString>>;
     sender_signing_kid: ZodOptional<ZodNullable<ZodString>>;
     status: ZodOptional<ZodEnum<["new", "delivered", "read"]>>;
     to_agent_id: ZodOptional<ZodNullable<ZodString>>;
     type: ZodString;
   }, "strip", ZodTypeAny, {
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     metadata: Record<string, unknown>;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
   }, {
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     metadata?: Record<string, unknown>;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
  }>;
}, "strip", ZodTypeAny, {
  reply:   | {
     catch_up?: {
        epoch: number;
        evicted: boolean;
        processed: number;
     };
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     decrypt_error?: string | null;
     decrypt_error_code?: string | null;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     key_changed?: {
        agent_id: string;
        current_fingerprint: string;
        previous_fingerprint: string;
     };
     metadata: Record<string, unknown>;
     plaintext?: unknown;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_kid?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
     verification_status: "verified" | "invalid" | "sender-mismatch" | "unverifiable";
     verified: boolean;
   }
     | null;
  sent: {
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     metadata: Record<string, unknown>;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
  };
}, {
  reply:   | {
     catch_up?: {
        epoch: number;
        evicted: boolean;
        processed: number;
     };
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     decrypt_error?: string | null;
     decrypt_error_code?: string | null;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     key_changed?: {
        agent_id: string;
        current_fingerprint: string;
        previous_fingerprint: string;
     };
     metadata?: Record<string, unknown>;
     plaintext?: unknown;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_kid?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
     verification_status?: "verified" | "invalid" | "sender-mismatch" | "unverifiable";
     verified?: boolean;
   }
     | null;
  sent: {
     content_type?: string | null;
     conversation_id: string;
     created_at: string;
     delivered_at?: string | null;
     direction?: "received" | "sent";
     encrypted_payload: string;
     encryption_version: string;
     from_agent_id?: string | null;
     group_handle?: string | null;
     group_id?: string | null;
     id: string;
     metadata?: Record<string, unknown>;
     read_at?: string | null;
     recipient_handle?: string | null;
     self_encrypted_payload?: string | null;
     sender_handle?: string | null;
     sender_signing_kid?: string | null;
     status?: "delivered" | "new" | "read";
     to_agent_id?: string | null;
     type: string;
  };
}>;

Defined in: rine-ts-sdk/src/types.ts:555

Wire-format Zod schema for { sent, reply } — retained for symmetry with the other *Schema exports even though the resource layer no longer calls parse(SendAndWaitResultSchema, …) directly (Step 19 replaced that with an explicit object literal so the generic Rep narrowing could flow through). The hand-rolled SendAndWaitResult<Rep> below is the type client.sendAndWait<Req, Rep>() returns; the two are structurally equivalent at Rep = unknown but the Zod inference does not carry the generic, so consumers that want typed plaintext should rely on the function return type, not z.infer<typeof SendAndWaitResultSchema>.