manabrew_protocol/prompts/
choose_from_selection.rs1use serde::{Deserialize, Serialize};
2use ts_rs::TS;
3
4use crate::prompts::common::PromptPresentation;
5
6#[derive(Debug, Clone, Serialize, Deserialize, TS)]
7#[serde(rename_all = "camelCase")]
8#[ts(export, export_to = "prompts/chooseFromSelection.ts")]
9pub struct SelectionOption {
10 pub label: String,
11 pub weight: usize,
12 pub can_repeat: bool,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize, TS)]
16#[serde(rename_all = "camelCase")]
17#[ts(export, export_to = "prompts/chooseFromSelection.ts")]
18pub struct ChooseFromSelectionInput {
19 pub presentation: PromptPresentation,
20 pub options: Vec<SelectionOption>,
21 pub min_total: usize,
22 pub max_total: usize,
23}
24
25#[derive(Debug, Clone, Serialize, Deserialize, TS)]
26#[serde(
27 tag = "type",
28 rename_all = "camelCase",
29 rename_all_fields = "camelCase"
30)]
31#[ts(export, export_to = "prompts/chooseFromSelection.ts")]
32pub enum ChooseFromSelectionOutput {
33 SelectionDecision { chosen_indices: Vec<usize> },
34}