feat(maestro): spawn form rerolls from a fetched name batch (#53)
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
DaemonInfo,
|
||||
DirListing,
|
||||
GitRoot,
|
||||
NameBatch,
|
||||
Projects,
|
||||
RecentDirs,
|
||||
Session,
|
||||
@@ -81,4 +82,11 @@ export async function gitRoot(path: string): Promise<GitRoot> {
|
||||
return jsonOrError(await fetch(url, { credentials: "same-origin" }));
|
||||
}
|
||||
|
||||
/** A batch of fresh session handles for the spawn form's instant reroll (#53).
|
||||
* Rerolls consume the batch locally; only exhaustion goes back to the daemon. */
|
||||
export async function fetchNames(count: number): Promise<NameBatch> {
|
||||
const url = `${routes.NAMES}?${routes.COUNT_QUERY}=${encodeURIComponent(count)}`;
|
||||
return jsonOrError(await fetch(url, { credentials: "same-origin" }));
|
||||
}
|
||||
|
||||
export { eventsWsUrl } from "./routes.js";
|
||||
|
||||
Reference in New Issue
Block a user