1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* bevy-fairy - the guide channel
* Copyright (C) 2025 ladvien
*
* Licensed under either of MIT (LICENSE-MIT) or Apache-2.0 (LICENSE-APACHE), at your option.
*/
//! **Working *with* the person at the keyboard, rather than only on their app.**
//!
//! Every other tool in this server points at the game: query it, poke it, measure it. This one
//! points at the human. An agent posts a short script; the app renders one step at a time on the
//! window the person is already looking at; the plugin watches a named condition and records what
//! actually happened.
//!
//! It exists because the loop without it is bad in a specific way. The person hits something, writes
//! prose about it, and the agent guesses at the key sequence — five reports in one afternoon, three
//! not reproduced first time, and four occasions of the panel text being pasted back by hand because
//! an offscreen capture cannot see a UI tree.
//!
//! # The half an agent gets wrong
//!
//! **A step with no checkpoint never advances on its own, and the app cannot tell the person what to
//! do about it.** That is not a defect: "does this look right?" is not a machine question, and the
//! whole reason a person is in the loop is to answer it. But it means the agent has an obligation the
//! other tools do not carry — when a step is waiting on a person, *say so in the conversation*, in
//! words, and wait. The app says `-> yours to judge. Nothing here advances it: tell the agent.` and
//! that promise is the agent's to keep.
//!
//! An agent that posts a script and goes quiet strands somebody in front of a card that will never
//! move. That happened during this tool's own development, to the person it was built for.
use Value;
use Arc;
use RwLock;
use debug;
use crate;
use crateBrpClient;
use crate;
/// The BRP method the companion plugin registers.
const GUIDE_METHOD: &str = "bevy_fairy/guide";
/// Forward a guide request to the running app and hand back its answer.
///
/// Thin on purpose: the plugin owns the script, the transcript and the overlay, so a second copy of
/// any of that here would be a second source of truth for the state a person is looking at.
pub async