@snomiao/ws-provision
v0.1.0
Published
Provision git workspaces in the <root>/<owner>/<repo>/tree/<branch> layout: clone/refresh/fork worktrees, plus non-interactive GitHub auth probes and hints. Zero runtime dependencies; TypeScript source consumed directly (Bun-first, same convention as code
Readme
@snomiao/ws-provision
Provision git workspaces in the standard <wsRoot>/<owner>/<repo>/tree/<branch> layout —
independent clone per branch, fork as a linked worktree — plus non-interactive GitHub
credential probes (hasGitCredentials, gitAuthHint) so a private-repo failure diagnoses
itself instead of masquerading as "repository not found".
Extracted from codehost's codehost/provision
subpath (which now re-exports this package, so either import works). Zero runtime
dependencies; ships TypeScript source, consumed directly by Bun — the same convention
codehost itself uses. Consumers: codehost's daemon provisioning, agent-yes's ay ws.
import { provision, parseSource, gitAuthHint } from "@snomiao/ws-provision";
const spec = parseSource("snomiao/codehost@main");
const res = await provision(spec, { wsRoot: "~/ws" });
if (!res.ok && res.reason === "auth-missing") console.error(gitAuthHint().join("\n"));Filesystem watching (codehost/provision/watch) intentionally stays in codehost — it is
the only piece with a native dependency (@parcel/watcher).
