| 369 | } |
| 370 | |
| 371 | function unknownMessage(token: string, context: readonly string[]): string { |
| 372 | if (context.length === 0) { |
| 373 | return `Unknown command "${token}". Type "help" for the command list.`; |
| 374 | } |
| 375 | return `Unknown command "${token}" in ${pretty( |
| 376 | context, |
| 377 | )}. Type "evals ${token} …" to run from root, "help" to see subcommands here, or ".." to leave the context.`; |
| 378 | } |
| 379 | |
| 380 | // --------------------------------------------------------------------------- |
| 381 | // Tree factory — wraps existing handlers as leaf nodes. |