Skip to main content

vtcode_commons/ui_protocol/
types.rs

1#![expect(
2    clippy::cast_possible_truncation,
3    reason = "Progress percentages are clamped to the documented byte-sized display range."
4)]
5
6//! Pure data types with no dependencies beyond `std` and the canonical event
7//! contract for shared status spellings.
8
9use std::str::FromStr as _;
10
11/// Message kind tag for inline transcript lines.
12#[derive(Clone, Copy, Debug, PartialEq, Eq)]
13pub enum InlineMessageKind {
14    Agent,
15    Error,
16    Info,
17    Policy,
18    Pty,
19    Tool,
20    User,
21    Warning,
22}
23
24/// A single slash-command entry for the suggestion palette.
25#[derive(Debug, Clone, PartialEq, Eq)]
26pub struct SlashCommandItem {
27    pub name: String,
28    pub description: String,
29}
30
31impl SlashCommandItem {
32    pub fn new(name: impl Into<String>, description: impl Into<String>) -> Self {
33        Self { name: name.into(), description: description.into() }
34    }
35}
36
37/// Search configuration for a list overlay.
38#[derive(Clone, Debug, Default)]
39pub struct InlineListSearchConfig {
40    pub label: String,
41    pub placeholder: Option<String>,
42    /// Match candidates by fuzzy subsequence (via nucleo) and rank results by
43    /// relevance, instead of requiring every query term to be a substring.
44    /// Opt-in: palettes that filter on enumerated values (e.g. model pickers)
45    /// keep exact-term filtering to avoid over-matching.
46    pub fuzzy: bool,
47}
48
49/// Configuration for a secure (masked) prompt input.
50#[derive(Clone, Debug)]
51pub struct SecurePromptConfig {
52    pub label: String,
53    /// Optional placeholder shown when input is empty.
54    pub placeholder: Option<String>,
55    /// Whether the input should be masked (e.g., API keys).
56    pub mask_input: bool,
57}
58
59/// Standalone surface preference for selecting inline vs alternate rendering.
60#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
61pub enum SessionSurface {
62    Auto,
63    Alternate,
64    #[default]
65    Inline,
66}
67
68/// Standalone keyboard protocol settings for terminal key event enhancements.
69#[derive(Debug, Clone, PartialEq, Eq)]
70pub struct KeyboardProtocolSettings {
71    pub enabled: bool,
72    pub mode: String,
73    pub disambiguate_escape_codes: bool,
74    pub report_event_types: bool,
75    pub report_alternate_keys: bool,
76    pub report_all_keys: bool,
77}
78
79impl Default for KeyboardProtocolSettings {
80    fn default() -> Self {
81        Self {
82            enabled: true,
83            mode: "default".to_owned(),
84            disambiguate_escape_codes: true,
85            report_event_types: true,
86            report_alternate_keys: true,
87            report_all_keys: false,
88        }
89    }
90}
91
92/// UI mode variants for quick presets.
93#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
94#[serde(rename_all = "snake_case")]
95pub enum UiMode {
96    #[default]
97    Full,
98    Minimal,
99    Focused,
100}
101
102/// Override for responsive layout detection.
103#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
104#[serde(rename_all = "snake_case")]
105pub enum LayoutModeOverride {
106    #[default]
107    Auto,
108    Compact,
109    Standard,
110    Wide,
111}
112
113/// Reasoning visibility behavior in the transcript.
114#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
115#[serde(rename_all = "snake_case")]
116pub enum ReasoningDisplayMode {
117    Always,
118    #[default]
119    Toggle,
120    Hidden,
121}
122
123/// How a busy plain-Enter submission enters the runloop while a turn runs.
124#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
125#[serde(rename_all = "snake_case")]
126#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
127pub enum BusyEnterBehavior {
128    /// Queue the message for the next turn (default; each Enter stays its own turn).
129    #[default]
130    Queue,
131    /// Steer plain-text input into the live turn via the steering channel.
132    Steer,
133}
134
135/// Default collapse state of agent thinking/reasoning blocks in the transcript.
136#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
137#[serde(rename_all = "snake_case")]
138#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
139pub enum ThinkingBlockState {
140    /// Thinking blocks render collapsed (a single summary line) by default.
141    #[default]
142    Collapsed,
143    /// Thinking blocks render fully expanded by default.
144    Extended,
145}
146
147/// How much routine agent-internal failure chatter reaches the interactive
148/// transcript. Canonical owner shared by config, the TUI renderer, and the
149/// desktop transcript so the three surfaces cannot drift.
150#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
151#[serde(rename_all = "snake_case")]
152#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
153pub enum CommunicationStyle {
154    /// Routine agent-internal failures stay in Transcript Review/logs while
155    /// user-direct command failures and user-actionable incidents stay visible.
156    #[default]
157    Balanced,
158    /// `Balanced`, plus user-direct command failures collapse to one status
159    /// line with the complete capture behind the viewer affordance.
160    Quiet,
161    /// Show every diagnostic, as before filtering existed.
162    Verbose,
163    /// Catch-all for unknown styles added by future versions.
164    #[serde(other)]
165    Unknown,
166}
167
168impl CommunicationStyle {
169    /// Parse a user- or protocol-supplied style name. Unknown values resolve
170    /// to [`CommunicationStyle::Unknown`] (never an error) so a newer service
171    /// cannot break an older client; callers map it via [`CommunicationStyle::resolve`].
172    #[must_use]
173    pub fn parse(value: &str) -> Self {
174        match value.trim().to_ascii_lowercase().as_str() {
175            "balanced" => Self::Balanced,
176            "quiet" => Self::Quiet,
177            "verbose" => Self::Verbose,
178            _ => Self::Unknown,
179        }
180    }
181
182    /// Effective style after resolving the forward-compat placeholder to the
183    /// current default. Every visibility decision must go through this so an
184    /// unknown future value degrades to `Balanced`, never to silence or noise.
185    #[must_use]
186    pub fn resolve(self) -> Self {
187        match self {
188            Self::Unknown => Self::Balanced,
189            resolved => resolved,
190        }
191    }
192
193    /// Wire name for the desktop protocol projection. Exact (including
194    /// `"unknown"`) so the desktop's [`CommunicationStyle::parse`] plus
195    /// [`CommunicationStyle::resolve`] stays the single fallback point.
196    #[must_use]
197    pub fn as_str(self) -> &'static str {
198        match self {
199            Self::Balanced => "balanced",
200            Self::Quiet => "quiet",
201            Self::Verbose => "verbose",
202            Self::Unknown => "unknown",
203        }
204    }
205}
206
207/// Wizard modal behavior variant.
208#[derive(Clone, Copy, Debug, PartialEq, Eq)]
209pub enum WizardModalMode {
210    /// Traditional multi-step wizard behavior (Enter advances/collects answers).
211    MultiStep,
212    /// Tabbed list behavior (tabs switch categories; Enter submits immediately).
213    TabbedList,
214}
215
216/// Diff preview layout for file-edit approval overlays.
217#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
218#[serde(rename_all = "kebab-case")]
219#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
220pub enum DiffPreviewMode {
221    /// Single-column unified view (default).
222    #[default]
223    Inline,
224    /// Old/new columns side by side.
225    SideBySide,
226}
227
228/// How the terminal renders East-Asian-ambiguous-width glyphs (UAX #11).
229///
230/// Every box-drawing character (U+2500–257F) is "Ambiguous": terminals
231/// configured to render the set as double width (xterm `cjkWidth`, iTerm2's
232/// ambiguous-width checkbox, some CJK-locale defaults) draw each glyph as two
233/// cells, which breaks frames and tables built from them. Not detectable at
234/// runtime, so this is a user decision (`ui.ambiguous_width`).
235#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
236#[serde(rename_all = "kebab-case")]
237#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
238pub enum AmbiguousWidthMode {
239    /// Ambiguous glyphs occupy one cell (the common default).
240    #[default]
241    Narrow,
242    /// Ambiguous glyphs occupy two cells; chrome degrades to ASCII and width
243    /// math counts the glyphs as wide.
244    Wide,
245}
246
247// ---------------------------------------------------------------------------
248// Task tracker row status
249// ---------------------------------------------------------------------------
250
251/// Display status of a single task tracker row, shared between the agent
252/// runloop (which owns checklist state) and the terminal surface (which owns
253/// styling). Keeps status typed across the panel/transcript boundary instead
254/// of re-parsing glyphs out of display strings.
255#[derive(Clone, Copy, Debug, PartialEq, Eq)]
256pub enum TaskItemStatus {
257    Pending,
258    InProgress,
259    Completed,
260    Blocked,
261}
262
263impl TaskItemStatus {
264    /// The canonical durable status this UI-facing subset projects.
265    const fn as_tracker(self) -> vtcode_exec_events::tracker::TrackerItemStatus {
266        match self {
267            Self::Pending => vtcode_exec_events::tracker::TrackerItemStatus::Pending,
268            Self::InProgress => vtcode_exec_events::tracker::TrackerItemStatus::InProgress,
269            Self::Completed => vtcode_exec_events::tracker::TrackerItemStatus::Completed,
270            Self::Blocked => vtcode_exec_events::tracker::TrackerItemStatus::Blocked,
271        }
272    }
273
274    /// Canonical wire string, sourced from the durable tracker contract.
275    #[must_use]
276    pub fn as_str(self) -> &'static str {
277        self.as_tracker().as_str()
278    }
279}
280
281impl std::str::FromStr for TaskItemStatus {
282    type Err = ();
283
284    /// Parse a canonical status string; unknown shapes fail closed to `Err`.
285    fn from_str(raw: &str) -> Result<Self, Self::Err> {
286        use vtcode_exec_events::tracker::TrackerItemStatus as Canonical;
287        match Canonical::from_str(raw)? {
288            Canonical::Pending => Ok(Self::Pending),
289            Canonical::InProgress => Ok(Self::InProgress),
290            Canonical::Completed => Ok(Self::Completed),
291            Canonical::Blocked => Ok(Self::Blocked),
292            Canonical::Unknown => Err(()),
293        }
294    }
295}
296
297// ---------------------------------------------------------------------------
298// Plan types
299// ---------------------------------------------------------------------------
300
301/// A step in an implementation plan.
302#[derive(Clone, Debug)]
303pub struct PlanStep {
304    pub number: usize,
305    pub description: String,
306    pub details: Option<String>,
307    pub files: Vec<String>,
308    pub completed: bool,
309}
310
311/// A phase in an implementation plan (groups related steps).
312#[derive(Clone, Debug)]
313pub struct PlanPhase {
314    pub name: String,
315    pub steps: Vec<PlanStep>,
316    pub completed: bool,
317}
318
319/// Structured plan content for display in the Implementation Blueprint panel.
320#[derive(Clone, Debug)]
321pub struct PlanContent {
322    pub title: String,
323    pub summary: String,
324    pub file_path: Option<String>,
325    pub phases: Vec<PlanPhase>,
326    pub open_questions: Vec<String>,
327    pub raw_content: String,
328    pub total_steps: usize,
329    pub completed_steps: usize,
330}
331
332impl PlanContent {
333    /// Parse plan content from markdown.
334    pub fn from_markdown(title: String, content: &str, file_path: Option<String>) -> Self {
335        let mut phases = Vec::new();
336        let mut open_questions = Vec::new();
337        let mut current_phase: Option<PlanPhase> = None;
338        let mut total_steps = 0;
339        let mut completed_steps = 0;
340        let mut summary = String::new();
341        let mut reading_summary = false;
342
343        for line in content.lines() {
344            let trimmed = line.trim();
345
346            // The planning prompt emits both conventional markdown headings
347            // (`## Summary`) and sparse section labels (`Summary`). Treat
348            // either form as a section marker so the label itself is not
349            // displayed as the plan summary.
350            if trimmed.eq_ignore_ascii_case("summary") || trimmed.eq_ignore_ascii_case("## summary") {
351                reading_summary = true;
352                continue;
353            }
354
355            if reading_summary {
356                if !trimmed.is_empty() {
357                    if summary.is_empty() {
358                        summary = trimmed.to_string();
359                    }
360                    reading_summary = false;
361                }
362                continue;
363            }
364
365            // Extract summary from first paragraph
366            if summary.is_empty() && !trimmed.is_empty() && !trimmed.starts_with('#') {
367                summary = trimmed.to_string();
368                continue;
369            }
370
371            // Phase headers (## Phase X: ...)
372            if let Some(phase_name) = trimmed.strip_prefix("## ") {
373                if let Some(phase) = current_phase.take() {
374                    phases.push(phase);
375                }
376                current_phase = Some(PlanPhase {
377                    name: phase_name.to_string(),
378                    steps: Vec::new(),
379                    completed: false,
380                });
381                continue;
382            }
383
384            // Open questions section
385            if trimmed == "## Open Questions" {
386                if let Some(phase) = current_phase.take() {
387                    phases.push(phase);
388                }
389                continue;
390            }
391
392            // Step items ([ ] or [x] prefixed)
393            if let Some(rest) = trimmed.strip_prefix("[ ] ") {
394                total_steps += 1;
395                if let Some(ref mut phase) = current_phase {
396                    phase.steps.push(PlanStep {
397                        number: phase.steps.len() + 1,
398                        description: rest.to_string(),
399                        details: None,
400                        files: Vec::new(),
401                        completed: false,
402                    });
403                }
404                continue;
405            }
406
407            if let Some(rest) = trimmed.strip_prefix("[x] ").or_else(|| trimmed.strip_prefix("[X] ")) {
408                total_steps += 1;
409                completed_steps += 1;
410                if let Some(ref mut phase) = current_phase {
411                    phase.steps.push(PlanStep {
412                        number: phase.steps.len() + 1,
413                        description: rest.to_string(),
414                        details: None,
415                        files: Vec::new(),
416                        completed: true,
417                    });
418                }
419                continue;
420            }
421
422            // Numbered steps (1. **Step 1** ...)
423            if trimmed.starts_with(|c: char| c.is_ascii_digit()) && trimmed.contains('.') {
424                total_steps += 1;
425                if let Some(ref mut phase) = current_phase {
426                    let desc = trimmed.split_once('.').map(|x| x.1).unwrap_or("").trim();
427                    phase.steps.push(PlanStep {
428                        number: phase.steps.len() + 1,
429                        description: desc.to_string(),
430                        details: None,
431                        files: Vec::new(),
432                        completed: false,
433                    });
434                }
435                continue;
436            }
437
438            // Question items
439            if trimmed.starts_with("- (") || trimmed.starts_with("- ?") {
440                open_questions.push(trimmed.trim_start_matches("- ").to_string());
441            }
442        }
443
444        // Save last phase
445        if let Some(mut phase) = current_phase.take() {
446            phase.completed = phase.steps.iter().all(|s| s.completed);
447            phases.push(phase);
448        }
449
450        // Update phase completion status
451        for phase in &mut phases {
452            phase.completed = !phase.steps.is_empty() && phase.steps.iter().all(|s| s.completed);
453        }
454
455        Self {
456            title,
457            summary,
458            file_path,
459            phases,
460            open_questions,
461            raw_content: content.to_string(),
462            total_steps,
463            completed_steps,
464        }
465    }
466
467    /// Get progress as a percentage.
468    #[allow(
469        clippy::cast_sign_loss,
470        reason = "Intentional compatibility, platform, or test-only suppression."
471    )]
472    pub fn progress_percent(&self) -> u8 {
473        if self.total_steps == 0 {
474            0
475        } else {
476            ((self.completed_steps as f32 / self.total_steps as f32) * 100.0) as u8
477        }
478    }
479}
480
481// ---------------------------------------------------------------------------
482// App icon preference
483// ---------------------------------------------------------------------------
484
485/// Selected application-icon artwork, shared by the desktop Dock/bundle icon
486/// picker and the CLI terminal tab icon (`ui.app_icon`).
487///
488/// `Dynamic` (default) follows the active light/dark mode, while
489/// `Light`/`Dark`/`Clear`/`Tinted` pin one artwork. `Unknown` is the serde
490/// catch-all for values added by future versions and behaves like `Dynamic`.
491#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
492#[serde(rename_all = "snake_case")]
493#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
494pub enum AppIconPreference {
495    /// Follow the active light/dark mode (default).
496    #[default]
497    Dynamic,
498    /// Always use the light-mode artwork.
499    Light,
500    /// Always use the dark-mode artwork.
501    Dark,
502    /// Always use the clear (glass V on a subtle translucent tile) artwork.
503    Clear,
504    /// Always use the tinted (monochrome slate) artwork.
505    Tinted,
506    /// Catch-all for unknown values added by future versions.
507    #[serde(other)]
508    Unknown,
509}
510
511impl AppIconPreference {
512    /// Selectable variants, in picker order. `Unknown` is never offered.
513    pub const ALL: [Self; 5] = [Self::Dynamic, Self::Light, Self::Dark, Self::Clear, Self::Tinted];
514
515    /// Canonical persisted id.
516    #[must_use]
517    pub const fn id(self) -> &'static str {
518        match self {
519            Self::Dynamic | Self::Unknown => "dynamic",
520            Self::Light => "light",
521            Self::Dark => "dark",
522            Self::Clear => "clear",
523            Self::Tinted => "tinted",
524        }
525    }
526
527    /// Parse a persisted id; missing or unknown values fall back to `Dynamic`.
528    #[must_use]
529    pub fn from_id(id: Option<&str>) -> Self {
530        match id.map(str::trim).map(str::to_ascii_lowercase).as_deref() {
531            Some("light") => Self::Light,
532            Some("dark") => Self::Dark,
533            Some("clear") => Self::Clear,
534            Some("tinted") => Self::Tinted,
535            _ => Self::Dynamic,
536        }
537    }
538
539    /// Resolve to the concrete pinned artwork: `Dynamic`/`Unknown` follow the
540    /// given UI mode, while explicit variants pin their own art.
541    #[must_use]
542    pub const fn resolve(self, dark_mode: bool) -> Self {
543        match self {
544            Self::Dynamic | Self::Unknown => {
545                if dark_mode {
546                    Self::Dark
547                } else {
548                    Self::Light
549                }
550            }
551            pinned => pinned,
552        }
553    }
554
555    /// Whether the dark-mode artwork applies under the given UI mode.
556    ///
557    /// Only meaningful for the light/dark/dynamic family: `Clear` and
558    /// `Tinted` pin their own non-flat artwork, so this is always false for
559    /// them. Prefer [`Self::resolve`] when selecting artwork bytes.
560    #[must_use]
561    pub const fn is_dark(self, dark_mode: bool) -> bool {
562        matches!(self.resolve(dark_mode), Self::Dark)
563    }
564}
565
566#[cfg(test)]
567mod tests {
568    use super::PlanContent;
569    use crate::ui_protocol::AppIconPreference;
570
571    #[test]
572    fn parses_sparse_summary_section_without_displaying_section_label() {
573        let plan = PlanContent::from_markdown(
574            "Implementation Plan".to_string(),
575            "Summary\nFocus on startup latency.\n\n1. Measure startup -> src/startup.rs\n2. Defer refresh -> src/update.rs\n\nValidation\n- cargo check --locked",
576            None,
577        );
578
579        assert_eq!(plan.summary, "Focus on startup latency.");
580        assert_eq!(plan.total_steps, 2);
581        assert_eq!(plan.raw_content.lines().next(), Some("Summary"));
582    }
583
584    #[test]
585    fn app_icon_default_is_dynamic() {
586        assert_eq!(AppIconPreference::default(), AppIconPreference::Dynamic);
587    }
588
589    #[test]
590    fn app_icon_ids_round_trip_through_from_id() {
591        for variant in AppIconPreference::ALL {
592            assert_eq!(AppIconPreference::from_id(Some(variant.id())), variant, "{}", variant.id());
593        }
594        assert_eq!(AppIconPreference::from_id(None), AppIconPreference::Dynamic);
595    }
596
597    #[test]
598    fn app_icon_from_id_is_forgiving_about_case_and_whitespace() {
599        assert_eq!(AppIconPreference::from_id(Some(" Light ")), AppIconPreference::Light);
600        assert_eq!(AppIconPreference::from_id(Some("DARK")), AppIconPreference::Dark);
601        assert_eq!(AppIconPreference::from_id(Some("DYNAMIC")), AppIconPreference::Dynamic);
602        assert_eq!(AppIconPreference::from_id(Some(" Clear ")), AppIconPreference::Clear);
603        assert_eq!(AppIconPreference::from_id(Some("TINTED")), AppIconPreference::Tinted);
604    }
605
606    #[test]
607    fn app_icon_from_id_falls_back_to_dynamic_for_unknown_or_empty() {
608        for raw in ["", "   ", "twilight", "bright", "dynamic-v2"] {
609            assert_eq!(AppIconPreference::from_id(Some(raw)), AppIconPreference::Dynamic, "{raw:?}");
610        }
611    }
612
613    #[test]
614    fn app_icon_is_dark_pins_light_and_dark_but_follows_mode_for_dynamic() {
615        for dark_mode in [false, true] {
616            assert!(!AppIconPreference::Light.is_dark(dark_mode), "light pins light art");
617            assert!(AppIconPreference::Dark.is_dark(dark_mode), "dark pins dark art");
618            assert_eq!(AppIconPreference::Dynamic.is_dark(dark_mode), dark_mode, "dynamic follows mode");
619            assert_eq!(AppIconPreference::Unknown.is_dark(dark_mode), dark_mode, "unknown follows mode");
620            assert!(
621                !AppIconPreference::Clear.is_dark(dark_mode),
622                "clear pins its own glass art, never the dark flat tile"
623            );
624            assert!(
625                !AppIconPreference::Tinted.is_dark(dark_mode),
626                "tinted pins its own slate art, never the dark flat tile"
627            );
628        }
629    }
630
631    #[test]
632    fn app_icon_resolve_pins_explicit_variants_and_follows_mode_for_dynamic() {
633        for dark_mode in [false, true] {
634            for pinned in [
635                AppIconPreference::Light,
636                AppIconPreference::Dark,
637                AppIconPreference::Clear,
638                AppIconPreference::Tinted,
639            ] {
640                assert_eq!(pinned.resolve(dark_mode), pinned, "{pinned:?}");
641            }
642            let expected = if dark_mode {
643                AppIconPreference::Dark
644            } else {
645                AppIconPreference::Light
646            };
647            assert_eq!(AppIconPreference::Dynamic.resolve(dark_mode), expected);
648            assert_eq!(AppIconPreference::Unknown.resolve(dark_mode), expected);
649        }
650    }
651
652    #[test]
653    fn app_icon_serde_uses_ids_and_catches_unknown_variants() {
654        assert_eq!(serde_json::from_str::<AppIconPreference>("\"light\"").unwrap(), AppIconPreference::Light);
655        assert_eq!(serde_json::from_str::<AppIconPreference>("\"clear\"").unwrap(), AppIconPreference::Clear);
656        assert_eq!(serde_json::from_str::<AppIconPreference>("\"tinted\"").unwrap(), AppIconPreference::Tinted);
657        assert_eq!(
658            serde_json::from_str::<AppIconPreference>("\"future-variant\"").unwrap(),
659            AppIconPreference::Unknown
660        );
661        assert_eq!(serde_json::to_string(&AppIconPreference::Dynamic).unwrap(), "\"dynamic\"");
662        assert_eq!(serde_json::to_string(&AppIconPreference::Clear).unwrap(), "\"clear\"");
663        assert_eq!(serde_json::to_string(&AppIconPreference::Tinted).unwrap(), "\"tinted\"");
664        assert_eq!(AppIconPreference::Unknown.id(), "dynamic");
665    }
666}