Ah, you want "win_game".
The standard treasure hunt mode will automatically wire up the win game, but as you chose "treasure_hunt_mode = bespoke", you have to use the win_game command yourself.
: if (treasure_deposited() == treasure_total()) {
: clear_screen hide_status_bar = "true" ;
: print {(win_msg)};
: win_game ;
}