feat(maestro): spawn form rerolls from a fetched name batch (#53)

This commit is contained in:
Miguel Palhas
2026-08-23 21:15:33 +01:00
parent a970ba89c2
commit 818e0cc2db
7 changed files with 207 additions and 37 deletions
+8
View File
@@ -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";