From 37997ca5dcdd0f32024ac8de9a10954c2cb73042 Mon Sep 17 00:00:00 2001 From: Dylan Trotter Date: Tue, 6 Oct 2026 17:47:37 +0000 Subject: [PATCH] team-setup: first-run checklist with headless GitHub sign-in A bb-gate server has no terminal, so the gh login that bb core forwards to every machine as GH_TOKEN had to be replaced by a token pasted into machine environment. This plugin runs `gh auth login --web` on the server, shows the device code in bb, and waits for approval; the login lands in gh's own file on the data volume and core picks it up on the next turn. Around it, the rest of a new server's setup from one place: Claude or Codex sign-in through Account Pool's RPCs, devbox connect, and a first machine. On the home page until every step is done, always under Settings. Co-Authored-By: Claude Fable 5.1 --- .github/workflows/plugins.yaml | 2 +- README.md | 1 + plugins/team-setup/.gitignore | 2 + plugins/team-setup/README.md | 41 + plugins/team-setup/app.tsx | 454 ++++ plugins/team-setup/components.json | 21 + plugins/team-setup/components/ui/button.tsx | 59 + plugins/team-setup/components/ui/icon.tsx | 8 + plugins/team-setup/components/ui/motion.ts | 4 + plugins/team-setup/gh.test.ts | 28 + plugins/team-setup/gh.ts | 142 ++ plugins/team-setup/lib/utils.ts | 17 + plugins/team-setup/package-lock.json | 2440 +++++++++++++++++++ plugins/team-setup/package.json | 49 + plugins/team-setup/server.test.ts | 279 +++ plugins/team-setup/server.ts | 446 ++++ plugins/team-setup/tsconfig.json | 29 + plugins/team-setup/vitest.config.ts | 8 + 18 files changed, 4029 insertions(+), 1 deletion(-) create mode 100644 plugins/team-setup/.gitignore create mode 100644 plugins/team-setup/README.md create mode 100644 plugins/team-setup/app.tsx create mode 100644 plugins/team-setup/components.json create mode 100644 plugins/team-setup/components/ui/button.tsx create mode 100644 plugins/team-setup/components/ui/icon.tsx create mode 100644 plugins/team-setup/components/ui/motion.ts create mode 100644 plugins/team-setup/gh.test.ts create mode 100644 plugins/team-setup/gh.ts create mode 100644 plugins/team-setup/lib/utils.ts create mode 100644 plugins/team-setup/package-lock.json create mode 100644 plugins/team-setup/package.json create mode 100644 plugins/team-setup/server.test.ts create mode 100644 plugins/team-setup/server.ts create mode 100644 plugins/team-setup/tsconfig.json create mode 100644 plugins/team-setup/vitest.config.ts diff --git a/.github/workflows/plugins.yaml b/.github/workflows/plugins.yaml index 57ca197a..0330772c 100644 --- a/.github/workflows/plugins.yaml +++ b/.github/workflows/plugins.yaml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - plugin: [devbox-provider, kubernetes-provider, thread-briefs, workstreams] + plugin: [devbox-provider, kubernetes-provider, team-setup, thread-briefs, workstreams] defaults: run: working-directory: plugins/${{ matrix.plugin }} diff --git a/README.md b/README.md index a5fdf3d4..d82513e1 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Plugins for [bb](https://getbb.app), maintained by Bit Complete. | [devbox-provider](plugins/devbox-provider) | Machine provider that creates devboxes in your Incus project on bertha, once you connect devbox | | [thread-briefs](plugins/thread-briefs) | Gives every thread a durable goal / current state / next step brief, summarized outside the working chat | | [multi-repo](plugins/multi-repo) | Gives a project a set of git repos and every thread a workspace holding a checkout of each | +| [team-setup](plugins/team-setup) | First-run checklist for a bb-gate server: sign in to Claude or Codex, GitHub (headless `gh auth login`) and devbox, make a machine | Install one: diff --git a/plugins/team-setup/.gitignore b/plugins/team-setup/.gitignore new file mode 100644 index 00000000..1eae0cf6 --- /dev/null +++ b/plugins/team-setup/.gitignore @@ -0,0 +1,2 @@ +dist/ +node_modules/ diff --git a/plugins/team-setup/README.md b/plugins/team-setup/README.md new file mode 100644 index 00000000..754c505b --- /dev/null +++ b/plugins/team-setup/README.md @@ -0,0 +1,41 @@ +# Team setup + +The first-run checklist for a bb server behind +[bb-gate](https://github.com/bitcomplete/bb-gate). It sits on the home page +until every step is done, and under Settings → Plugins → Team setup always. + +| Step | Owned by | Done when | What the button does | +|---|---|---|---| +| Claude or Codex | Account Pool | An enabled account exists and routing for its provider is on | Starts Account Pool's sign-in: claude.ai with a code to paste back, or ChatGPT's device code, polled from here. | +| GitHub | gh on the server host, read by bb core | The built-in GitHub row in Environment variables is "logged in" (or overridden by your own `GH_TOKEN`) | Runs `gh auth login --web` on the server, shows the device code, waits for GitHub to approve it. | +| devbox | devbox-provider | Connected | Starts devbox-provider's connect; its callback finishes it. | +| A machine | bb | Any machine exists | Links to Devbox machines. | + +The GitHub step is the point. bb core forwards the server host's gh login to +every machine as `GH_TOKEN`, a git credential helper and a commit identity, +but a bb-gate server has no terminal to run `gh auth login` in. The plugin +spawns it headless, parses the one-time code gh prints, and the login lands +in `GH_CONFIG_DIR` on the data volume where it survives restarts. After +sign-in it checks membership of the `githubOrg` setting (default +`bitcomplete`) and warns about a personal account. + +No credential passes through this plugin: Claude and Codex tokens go to +Account Pool through its RPCs, the devbox token to devbox-provider, and the +GitHub token to gh's own file. + +The checklist polls only while its page is visible, every ten seconds, or +every three while a GitHub sign-in is waiting for approval. + +## Settings + +| Setting | Default | Meaning | +|---|---|---| +| `githubOrg` | `bitcomplete` | Organization membership checked after GitHub sign-in. Empty skips it. | + +## Development + +```sh +npm install --legacy-peer-deps +npm run typecheck +npm test +``` diff --git a/plugins/team-setup/app.tsx b/plugins/team-setup/app.tsx new file mode 100644 index 00000000..fcbe4842 --- /dev/null +++ b/plugins/team-setup/app.tsx @@ -0,0 +1,454 @@ +// The checklist, on the home page until every step is done and always under +// Settings → Plugins → Team setup. Each row reads one step's state from the +// server and starts that step's flow; the plugins that own the steps finish +// them. +import { useCallback, useEffect, useRef, useState } from "react"; +import { definePluginApp, useBbNavigate, useRealtime, useRpc } from "@get-bb/plugin-sdk/app"; +import type { rpcContract } from "./server"; +import { Button } from "@/components/ui/button"; +import { Icon } from "@/components/ui/icon"; + +type Status = Awaited>["call"]>> extends infer R + ? Extract + : never; +type StepState = Status["steps"]["ai"]; + +const IDLE_POLL_MS = 10_000; +const PENDING_POLL_MS = 3_000; + +function message(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +/** Polls while the page is visible and `active`; refetches when it comes back into view. */ +function useVisiblePolling(refetch: () => void, active: boolean, intervalMs: number) { + useEffect(() => { + if (!active) return; + let timer: number | null = null; + const start = () => { + if (timer === null) timer = window.setInterval(refetch, intervalMs); + }; + const stop = () => { + if (timer !== null) { + window.clearInterval(timer); + timer = null; + } + }; + const onVisibility = () => { + if (document.visibilityState === "visible") { + refetch(); + start(); + } else { + stop(); + } + }; + if (document.visibilityState === "visible") start(); + document.addEventListener("visibilitychange", onVisibility); + return () => { + stop(); + document.removeEventListener("visibilitychange", onVisibility); + }; + }, [refetch, active, intervalMs]); +} + +function StepMark({ state }: { state: StepState }) { + const name = state === "done" ? "CircleCheck" : "Circle"; + const tone = state === "done" ? "text-success" : state === "todo" ? "text-muted-foreground" : "text-muted-foreground/60"; + return ; +} + +function Step({ + state, + title, + children, + action, +}: { + state: StepState; + title: string; + children: React.ReactNode; + action?: React.ReactNode; +}) { + return ( +
  • + +
    +
    +

    {title}

    + {action} +
    +
    {children}
    +
    +
  • + ); +} + +function CodeBlock({ code }: { code: string }) { + const [copied, setCopied] = useState(false); + return ( +
    + {code} + +
    + ); +} + +function SettingsLink({ pluginId, children }: { pluginId: string; children: React.ReactNode }) { + return ( + + {children} + + ); +} + +interface ClaudeFlow { + sessionId: string; + url: string; +} +interface CodexFlow { + sessionId: string; + url: string; + code: string; + expiresAt: number; + intervalMs: number; +} + +function Checklist({ compact }: { compact: boolean }) { + const rpc = useRpc(); + const navigate = useBbNavigate(); + const [status, setStatus] = useState(null); + const [error, setError] = useState(null); + const [busy, setBusy] = useState(null); + const [claude, setClaude] = useState(null); + const [pasted, setPasted] = useState(""); + const [codex, setCodex] = useState(null); + const [codexError, setCodexError] = useState(null); + const mounted = useRef(true); + useEffect(() => { + mounted.current = true; + return () => { + mounted.current = false; + }; + }, []); + + const refetch = useCallback(() => { + rpc.call("status").then( + (s) => { + if (!mounted.current) return; + setStatus(s); + setError(null); + }, + (e: unknown) => { + if (mounted.current) setError(message(e)); + }, + ); + }, [rpc]); + useEffect(refetch, [refetch]); + useRealtime(CHANGED_CHANNEL, refetch); + + const complete = status?.complete ?? false; + const githubPending = status?.github.pending !== null && status?.github.pending !== undefined; + useVisiblePolling(refetch, status !== null && !complete, githubPending ? PENDING_POLL_MS : IDLE_POLL_MS); + + // Codex: Account Pool holds the device-flow session; this page polls it. + useEffect(() => { + if (codex === null) return; + let stopped = false; + const tick = async () => { + if (stopped || document.visibilityState !== "visible") return; + try { + const r = await rpc.call("codexPoll", { sessionId: codex.sessionId }); + if (stopped) return; + if (r.status === "complete") { + setCodex(null); + refetch(); + } else if (r.status === "error") { + setCodexError(r.message); + setCodex(null); + } + } catch (e) { + if (!stopped) { + setCodexError(message(e)); + setCodex(null); + } + } + }; + const timer = window.setInterval(() => void tick(), Math.max(codex.intervalMs, 2000)); + return () => { + stopped = true; + window.clearInterval(timer); + }; + }, [codex, rpc, refetch]); + + const open = (url: string) => { + if (!navigate.openUrl(url)) window.open(url, "_blank", "noopener"); + }; + + const run = async (what: string, action: () => Promise) => { + setBusy(what); + try { + await action(); + setError(null); + } catch (e) { + setError(message(e)); + } finally { + setBusy(null); + } + }; + + if (status === null) { + return

    {error ?? "Checking…"}

    ; + } + + const { ai, github, devbox, machines, steps } = status; + + if (compact && complete) { + const aiLabel = ai.accounts + .filter((a) => a.enabled && ai.routing[a.provider]) + .map((a) => a.label) + .join(", "); + return ( +

    + All set: {aiLabel !== "" ? `${aiLabel}; ` : ""} + {github.login !== null ? `GitHub as ${github.login}; ` : steps.github === "done" ? "GitHub; " : ""} + {devbox.project !== null ? `devbox project ${devbox.project}; ` : steps.devbox === "done" ? "devbox; " : ""} + {machines.names.length === 1 ? "1 machine" : `${machines.names.length} machines`}.{" "} + Details +

    + ); + } + + const enabledAccounts = ai.accounts.filter((a) => a.enabled); + + return ( +
    +
      + + + +
    + ) : null + } + > + {!ai.available ? ( +

    {ai.message ?? "Account Pool is unavailable."} Account Pool settings

    + ) : steps.ai === "done" ? ( +

    + Routing through {enabledAccounts.filter((a) => ai.routing[a.provider]).map((a) => a.label).join(", ")}.{" "} + Manage accounts +

    + ) : enabledAccounts.length > 0 ? ( +

    + {enabledAccounts.map((a) => a.label).join(", ")} added, but routing is off for{" "} + {enabledAccounts.map((a) => a.provider).filter((p, i, all) => all.indexOf(p) === i).join(" and ")}.{" "} + Turn it on in Account Pool +

    + ) : ( +

    Agents run on your own Claude or ChatGPT subscription through the Account Pool. One is enough; add both to fall back.

    + )} + {claude !== null ? ( +
    { + e.preventDefault(); + if (pasted.trim() === "") return; + void run("claude-complete", async () => { + await rpc.call("claudeComplete", { sessionId: claude.sessionId, pasted: pasted.trim() }); + setClaude(null); + setPasted(""); + refetch(); + }); + }} + > +

    Sign in at claude.ai, then paste the code from its final page here.

    +
    + + setPasted(e.target.value)} + /> + + +
    +
    + ) : null} + {codex !== null ? ( +
    +

    Open the verification page, sign in to ChatGPT, and enter this code.

    + +
    + + Waiting for you to approve… + +
    +
    + ) : null} + {codexError !== null ?

    {codexError}

    : null} + + + void run("github-out", async () => { + await rpc.call("githubSignOut"); + refetch(); + })}> + Sign out + + ) : ( + + ) + ) : null + } + > + {github.status === "logged in" ? ( +

    + Signed in{github.login !== null ? ` as ${github.login}` : ""}. Every machine gets this login as GH_TOKEN and a git credential helper. + {github.orgMember === false ? ( + {github.login} is not a member of {github.org}, so its repos will not be reachable. Sign out and sign in with your work account. + ) : null} +

    + ) : github.status === "overridden" ? ( +

    Using a GH_TOKEN you set by hand in Environment variables. Sign in here to stop managing the token yourself, then delete the variable.

    + ) : github.status === "disabled" ? ( +

    Automatic GitHub credentials are turned off in Settings → Environment variables, so a sign-in here would reach no machine. Turn them back on first.

    + ) : ( +

    Machines clone and push as you. The sign-in happens on this server, once: GitHub shows you a code, you approve it, and bb forwards the login to every machine.

    + )} + {github.pending !== null ? ( +
    +

    Enter this code on GitHub.

    + +
    + + Waiting for you to approve… + +
    +
    + ) : null} + {github.lastError !== null && github.pending === null ?

    {github.lastError}

    : null} +
    + + void run("devbox", async () => { + const { url } = await rpc.call("devboxConnect"); + open(url); + })}> + Connect devbox + + ) : null + } + > + {!devbox.available ? ( +

    {devbox.message ?? "devbox is unavailable."} Devbox machines settings

    + ) : devbox.connected ? ( +

    Connected{devbox.project !== null ? ` to project ${devbox.project}` : ""}.

    + ) : ( +

    Connect your devbox project so bb can create machines in it. You approve it on devbox, which sends you back here.

    + )} +
    + + + {machines.names.length > 0 ? ( +

    + {machines.names.join(", ")}. Add another +

    + ) : ( +

    + Agents run on machines, not on this server.{" "} + {devbox.connected ? ( + Create one in Devbox machines + ) : ( + "Connect devbox first, then create one from Devbox machines." + )} +

    + )} +
    + + {error !== null ?

    {error}

    : null} + + ); +} + +const CHANGED_CHANNEL = "changed"; + +export default definePluginApp((app) => { + app.slots.homepageSection({ + id: "checklist", + title: "Team setup", + component: () => , + }); + app.slots.settingsSection({ + id: "checklist", + title: "Checklist", + description: "Everything a new server needs before agents can work here.", + component: () => , + }); +}); diff --git a/plugins/team-setup/components.json b/plugins/team-setup/components.json new file mode 100644 index 00000000..e7419fc5 --- /dev/null +++ b/plugins/team-setup/components.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "tsx": true, + "tailwind": { + "config": "", + "css": "app.css", + "baseColor": "neutral", + "cssVariables": true + }, + "aliases": { + "components": "@/components", + "ui": "@/components/ui", + "lib": "@/lib", + "utils": "@/lib/utils", + "hooks": "@/hooks" + }, + "registries": { + "@bb": "https://raw.githubusercontent.com/get-bb/bb/desktop-v0.45.0/packages/plugin-registry/r/{name}.json" + } +} diff --git a/plugins/team-setup/components/ui/button.tsx b/plugins/team-setup/components/ui/button.tsx new file mode 100644 index 00000000..1d049e67 --- /dev/null +++ b/plugins/team-setup/components/ui/button.tsx @@ -0,0 +1,59 @@ +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; + +import { cn } from "../../lib/utils"; +import { CONTROL_HOVER_TRANSITION } from "./motion.js"; + +const buttonVariants = cva( + `inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ${CONTROL_HOVER_TRANSITION} focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_[data-icon-root]]:pointer-events-none [&_[data-icon-root]]:size-4 [&_[data-icon-root]]:shrink-0`, + { + variants: { + variant: { + default: "bg-foreground text-background hover:bg-foreground/90", + destructive: + "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border border-input bg-transparent hover:bg-state-hover hover:text-foreground", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: + "hover:bg-state-hover hover:text-foreground aria-pressed:bg-state-active aria-pressed:text-foreground aria-pressed:hover:bg-state-active data-[state=open]:bg-state-active data-[state=open]:text-foreground data-[state=open]:hover:bg-state-active", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-9 px-4 py-2", + sm: "h-8 rounded-md px-3 text-xs", + lg: "h-10 rounded-md px-8", + icon: "h-9 w-9", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + }, +); + +export interface ButtonProps + extends + Omit, "title">, + VariantProps { + asChild?: boolean; +} + +const Button = React.forwardRef( + ({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : "button"; + return ( + + ); + }, +); +Button.displayName = "Button"; + +export { Button, buttonVariants }; diff --git a/plugins/team-setup/components/ui/icon.tsx b/plugins/team-setup/components/ui/icon.tsx new file mode 100644 index 00000000..1bb8fb0c --- /dev/null +++ b/plugins/team-setup/components/ui/icon.tsx @@ -0,0 +1,8 @@ +import { + experimental_Icon, + type ExperimentalIconProps, +} from "@get-bb/plugin-sdk/app"; + +export type IconName = string; +export type IconProps = ExperimentalIconProps; +export const Icon = experimental_Icon; diff --git a/plugins/team-setup/components/ui/motion.ts b/plugins/team-setup/components/ui/motion.ts new file mode 100644 index 00000000..caaa329c --- /dev/null +++ b/plugins/team-setup/components/ui/motion.ts @@ -0,0 +1,4 @@ +export const CONTROL_HOVER_TRANSITION = + "transition-colors duration-150 hover:duration-0"; + +export const LIST_HOVER_TRANSITION = "transition-none"; diff --git a/plugins/team-setup/gh.test.ts b/plugins/team-setup/gh.test.ts new file mode 100644 index 00000000..850f445e --- /dev/null +++ b/plugins/team-setup/gh.test.ts @@ -0,0 +1,28 @@ +import { describe, expect, it } from "vitest"; +import { parseLoggedInAs, parseLoginPrompt } from "./gh.js"; + +describe("parseLoginPrompt", () => { + it("reads the code and URL gh prints before it waits", () => { + const lines = [ + "! First copy your one-time code: AB12-CD34", + "Open this URL to continue in your web browser: https://github.com/login/device", + ]; + expect(parseLoginPrompt(lines)).toEqual({ code: "AB12-CD34", url: "https://github.com/login/device" }); + }); + + it("waits for both lines", () => { + expect(parseLoginPrompt(["! First copy your one-time code: AB12-CD34"])).toBeNull(); + expect(parseLoginPrompt([])).toBeNull(); + }); + + it("ignores URLs on other lines", () => { + expect(parseLoginPrompt(["see https://cli.github.com", "! First copy your one-time code: AB12-CD34"])).toBeNull(); + }); +}); + +describe("parseLoggedInAs", () => { + it("finds the login gh reports", () => { + expect(parseLoggedInAs(["✓ Authentication complete.", "✓ Logged in as octocat"])).toBe("octocat"); + expect(parseLoggedInAs(["nothing"])).toBeNull(); + }); +}); diff --git a/plugins/team-setup/gh.ts b/plugins/team-setup/gh.ts new file mode 100644 index 00000000..d0e8d045 --- /dev/null +++ b/plugins/team-setup/gh.ts @@ -0,0 +1,142 @@ +// gh on the server host. bb core turns the login gh holds here into GH_TOKEN, +// a credential helper and a commit identity on every machine, so signing gh +// in is the whole GitHub step. Nothing in this plugin reads the token. +import { execFile, spawn } from "node:child_process"; + +export interface GhResult { + exitCode: number; + stdout: string; + stderr: string; +} + +export interface GhProcess { + /** Every line gh writes to stderr, which is where its prompts go. */ + onLine(listener: (line: string) => void): void; + exited: Promise; + kill(): void; +} + +export interface GhRunner { + run(args: string[], timeoutMs: number): Promise; + start(args: string[]): GhProcess; +} + +// --web is the device flow, the one login that needs no terminal: gh prints +// a code and a URL, then polls GitHub until the code is approved. +// --insecure-storage because the container has no keyring; the file lands +// in GH_CONFIG_DIR, on the data volume. +export const LOGIN_ARGS = [ + "auth", + "login", + "--hostname", + "github.com", + "--git-protocol", + "https", + "--web", + "--insecure-storage", +]; +export const LOGOUT_ARGS = ["auth", "logout", "--hostname", "github.com"]; + +export interface LoginPrompt { + code: string; + url: string; +} + +const CODE_PATTERN = /one-time code:\s*([A-Z0-9]{4}-[A-Z0-9]{4})/iu; +const URL_PATTERN = /(https:\/\/\S+)/u; +const LOGGED_IN_PATTERN = /logged in as\s+(\S+)/iu; + +/** The device code and URL from gh's prompt, once both have been printed. */ +export function parseLoginPrompt(lines: readonly string[]): LoginPrompt | null { + let code: string | null = null; + let url: string | null = null; + for (const line of lines) { + const c = CODE_PATTERN.exec(line); + if (c !== null) code = c[1].toUpperCase(); + if (/open this url/iu.test(line)) { + const u = URL_PATTERN.exec(line); + if (u !== null) url = u[1]; + } + } + return code !== null && url !== null ? { code, url } : null; +} + +/** The login gh reports after a successful sign-in, if it said. */ +export function parseLoggedInAs(lines: readonly string[]): string | null { + for (const line of lines) { + const m = LOGGED_IN_PATTERN.exec(line); + if (m !== null) return m[1]; + } + return null; +} + +// A token in the server's own environment makes gh refuse to log in ("GH_TOKEN +// is being used"), and would be what `gh auth token` reports afterwards. The +// child never sees one. Prompts and colour are off so the output is parseable. +function ghEnvironment(): NodeJS.ProcessEnv { + const env: NodeJS.ProcessEnv = { ...process.env }; + delete env.GH_TOKEN; + delete env.GITHUB_TOKEN; + delete env.GH_ENTERPRISE_TOKEN; + delete env.GITHUB_ENTERPRISE_TOKEN; + env.GH_PROMPT_DISABLED = "1"; + env.GH_NO_UPDATE_NOTIFIER = "1"; + env.NO_COLOR = "1"; + return env; +} + +export function createGhRunner(): GhRunner { + return { + run(args, timeoutMs) { + return new Promise((resolve) => { + execFile( + "gh", + args, + { env: ghEnvironment(), timeout: timeoutMs, maxBuffer: 1024 * 1024 }, + (error, stdout, stderr) => { + const code = error === null ? 0 : typeof (error as { code?: unknown }).code === "number" ? ((error as { code: number }).code) : 1; + resolve({ exitCode: code, stdout: String(stdout), stderr: error !== null && stderr === "" ? error.message : String(stderr) }); + }, + ); + }); + }, + start(args) { + const child = spawn("gh", args, { env: ghEnvironment(), stdio: ["ignore", "pipe", "pipe"] }); + const listeners: Array<(line: string) => void> = []; + let stdout = ""; + let stderr = ""; + let partial = ""; + child.stdout.setEncoding("utf8"); + child.stdout.on("data", (chunk: string) => { + stdout += chunk; + }); + child.stderr.setEncoding("utf8"); + child.stderr.on("data", (chunk: string) => { + stderr += chunk; + partial += chunk; + const lines = partial.split("\n"); + partial = lines.pop() ?? ""; + for (const line of lines) for (const l of listeners) l(line); + }); + const exited = new Promise((resolve) => { + child.on("error", (error) => { + stderr += error.message; + resolve({ exitCode: 1, stdout, stderr }); + }); + child.on("close", (code) => { + if (partial !== "") for (const l of listeners) l(partial); + resolve({ exitCode: code ?? 1, stdout, stderr }); + }); + }); + return { + onLine: (listener) => { + listeners.push(listener); + }, + exited, + kill: () => { + child.kill("SIGTERM"); + }, + }; + }, + }; +} diff --git a/plugins/team-setup/lib/utils.ts b/plugins/team-setup/lib/utils.ts new file mode 100644 index 00000000..5863f3f3 --- /dev/null +++ b/plugins/team-setup/lib/utils.ts @@ -0,0 +1,17 @@ +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} + +export function formatHomePathForDisplay(pathValue: string): string { + const homePrefix = + pathValue.match(/^\/Users\/[^/]+(?=\/|$)/)?.[0] ?? + pathValue.match(/^\/home\/[^/]+(?=\/|$)/)?.[0] ?? + pathValue.match(/^\/root(?=\/|$)/)?.[0] ?? + pathValue.match(/^[A-Za-z]:[\\/]Users[\\/][^\\/]+(?=[\\/]|$)/i)?.[0]; + return homePrefix === undefined + ? pathValue + : `~${pathValue.slice(homePrefix.length)}`; +} diff --git a/plugins/team-setup/package-lock.json b/plugins/team-setup/package-lock.json new file mode 100644 index 00000000..b3f8f82b --- /dev/null +++ b/plugins/team-setup/package-lock.json @@ -0,0 +1,2440 @@ +{ + "name": "bb-plugin-team-setup", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "bb-plugin-team-setup", + "version": "0.1.0", + "license": "MIT", + "dependencies": { + "@radix-ui/react-slot": "^1.3.0", + "zod": "^4.3.6" + }, + "devDependencies": { + "@get-bb/plugin-sdk": "0.6.15", + "@types/better-sqlite3": "^7.6.12", + "@types/node": "^22.0.0", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "better-sqlite3": "^12.0.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cron-parser": "^5.10.1", + "hono": "^4.11.9", + "react": "^19.0.0", + "react-dom": "^19.3.0", + "tailwind-merge": "^3.4.0", + "typescript": "^5.7.0", + "vitest": "^3.2.7" + }, + "engines": { + "bb": ">=0.45", + "bbPluginSdk": ">=0.6.15" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@get-bb/plugin-sdk": { + "version": "0.6.15", + "resolved": "https://registry.npmjs.org/@get-bb/plugin-sdk/-/plugin-sdk-0.6.15.tgz", + "integrity": "sha512-S7UUC+mfY1V9wTU1NiWw+VyP1STcWm4+Cgoi/rzHhj1kfCuxnVdTozJ7XedKMeDM9vVGYU4y3+r/CpEWIdsiRg==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.6", + "zod": "^4.6.5" + }, + "peerDependencies": { + "@testing-library/react": "^16.3.2", + "@types/better-sqlite3": "^7.6.12", + "@types/react": "^19.0.0", + "better-sqlite3": ">=12", + "cron-parser": "^5.5.0", + "hono": "^4.11.9", + "react": "^19.0.0", + "react-dom": "^19.0.0" + }, + "peerDependenciesMeta": { + "@testing-library/react": { + "optional": true + }, + "@types/better-sqlite3": { + "optional": true + }, + "@types/react": { + "optional": true + }, + "better-sqlite3": { + "optional": true + }, + "cron-parser": { + "optional": true + }, + "hono": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@radix-ui/react-compose-refs": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.1.5.tgz", + "integrity": "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@radix-ui/react-slot": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.4.0.tgz", + "integrity": "sha512-IuMVHZ+Ah5fkctu3X3qeFrV/ZrBcuWuDTFUUPfS/L5hvoTjzhp/HdWGE14CsQombPdEidsa33HVlYZXi49PZ1Q==", + "license": "MIT", + "dependencies": { + "@radix-ui/react-compose-refs": "1.1.5" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.0.tgz", + "integrity": "sha512-FLLpX941CD/7aBvX3GqLGBM9OvY5PGXTryPJkG5r5/OuBpZpV5k45Uo3RxAvqd35tsyc3hH1bhtz921IKzoIzg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.0.tgz", + "integrity": "sha512-iI32XM/jnDYJsvx5ai/za/7gWO9XoSeFFtU06/ZCaRgyilfJOjaopD3nOpk2WrTCGOyeDt4hleUiGOAnd5tHNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.0.tgz", + "integrity": "sha512-dRBZlbt2sEtF8Mn4MODThze9fIPdDoOhVSlXMAKy5dQbOYK9pOOoPY4Fat3OTtr0+8zbJo5TTZwlsfxY/kDNJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.0.tgz", + "integrity": "sha512-Y3whrJOMucfkhgNkvcM93M6j8C53iEAMmPMYD99C6G1kUy4ELigLWk9ar2/4aCBSRgsql0zdlOemLgW2m5GZgQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.0.tgz", + "integrity": "sha512-S6S1GEzPjFF6IONYJX3AKt/799+8RgBgCcwRnUo+Ep1IvBxUbw5M51iU0TDdK2NWWVnSvCQ8yi6Em0fGASMOng==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.0.tgz", + "integrity": "sha512-Ed1DPoFENkXj4IGzSB12SesV40iP6LxCCrbTIkSGIQBpOOxpBM+0kj62lmaeIHfMWTDoddqTOtqc7s8LYfn+Pw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.0.tgz", + "integrity": "sha512-J/6xhutJPtFyIkmHdf4olOdHHKH5kOJNumojdWn+Elv5ICEYTVOa362Vw27TxsK0BLzb1le3EDlO3UbvFK1lnQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.0.tgz", + "integrity": "sha512-G4L/Nnx59d2LvDoV/P4S5lZ7oVLT6hodOHMacqjiq2LL2gts86KbkEBTYL53+fBt0odhf7XPIbIATGoYiJctxg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.0.tgz", + "integrity": "sha512-zF16pvJDEUksGYRbfnXne7pdklAyj2XDmJeYKgP93oq0cUyX9Y8O7lUo1R+IY1GagP/YBvCEDCe7eEcAKpw//g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.0.tgz", + "integrity": "sha512-nIggWn8n+w12+R5lsV+PYYoUY8vuObxPAQqJI7WES+9v0qspYuAHoZMfYM0yLxlipasT5BY9ht5W8t5c/rSCkg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.0.tgz", + "integrity": "sha512-WLOTiHPzszP0dxIMsHpFeDSOSB5I49Mj8K4+yKE3H1X/D0JRG5XZ5jrctJLMjnUc/LUzaKiwq6EHWNJ8pup8PA==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.0.tgz", + "integrity": "sha512-35RK9aRhh7g7Pmeu5gQ01aCvrhXzj9LoBE6xtUcEH1ns+nyTaSzxSpADmBQINu4QiTDGvmQYwo1j5hlg1rRXFw==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.0.tgz", + "integrity": "sha512-RqTfnpoTjuWfPAmqK5p2edt2AMCDJWm6oTn7sKfmyx+6tRga0ip05SJ977o6udTcIiDeF/CJMUfkaN4gtWt6Aw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.0.tgz", + "integrity": "sha512-RQjZPigjxFvFZDijG6rjlSXxhRaTf9zLYVpGK+lVcga64oMqP1GbgVqCb46eHTTceSIgp89Ja0y5aPe3GFBYHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.0.tgz", + "integrity": "sha512-tjL58mgQcTRnDRpeky+Sth1MKQeYi2Ct6r3Luq9E5aTSjnM/i/JbozqZkKqp9thM5+oDSZxo+05f9kdQedfTGA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.0.tgz", + "integrity": "sha512-ictoRyVaoZ8C67myHef+8hhCa6IplXJJ/xUCkVCxziV4zxMZh+jvhkhGsPBLqj1S72fnqD0QH5zL4lcaa4X7DQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.0.tgz", + "integrity": "sha512-8aVvZ2hfr9RLFzBQkQNmYeHLDja8fLeQAmLt757zdKN/B+8L809KlLJKctQjS22wZotptV8G6o7fVPuAs8S1tQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.0.tgz", + "integrity": "sha512-2dEF8GAcDKwshUfydD+GhosppNyBzhVUHkdFF3CXd3FpOkzj/RZzF5aoEtzklujklT5qFVRU2GK/cFeLaTNKVg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.0.tgz", + "integrity": "sha512-3XHTvoo2hKkh0MiOfS7SkhHjMaaWF7P4F3drocZZaho/Z8w7h/jpnuBHm91BOQLfvrKHs1yR+zir4E8RI3XzTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.0.tgz", + "integrity": "sha512-HKtkzodL4a3KFWDXDoO61cRynAWTR3LnAE0oGtfG9lcNFpNuVYUFOByxDgNqEvic9rvaQbAj+SFwTEWDptRaIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.0.tgz", + "integrity": "sha512-JBsxqiY16uyyCujtoC3s7zL+SrYyNElptD7K4V+KUoJ2V8/XG3hPWpheK+SuPwNh1cikJvIZmIdsrYXvD6PLJw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.0.tgz", + "integrity": "sha512-S5Qrijh37qhnUYQ0ay8WN3LuWeKjow7wTUyCOPMZtnXiBXYXdsZETI6ZLfYnQAKovltckPLBFdNeD61P2rJc7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.0.tgz", + "integrity": "sha512-zbZ6iMmLFEsCtTdc2/y1F/cDFVNNCPF7Ae8PCT/wdPE//hGwYp6r+MyCLMFX+kOeIe09Pz6ASfnnfpSTN1FJQQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.0.tgz", + "integrity": "sha512-L6Hw69oNpuYaOr1zCG30v0/DqKYCSRwodPGwIcVZ/6f8SOzq9rxtL/xNVI5MO4wjli+Ko0ErK9uHJL3mNPt8wQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.0.tgz", + "integrity": "sha512-nl+CTWIgOGszQmUz/kanfgrfFZ4qiwxKIfT/ryl3N3Ewk5tqizmYtNXiqb7Bu/fDtNgu1kyxdFiAUJNur3iysg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/better-sqlite3": { + "version": "7.6.13", + "resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.13.tgz", + "integrity": "sha512-NMv9ASNARoKksWtsq/SHakpYAYnhBrQgGD8zkLYk/jaK8jUGn08CfEdTRgYhMypUQAfzSP8W6gNLe0q19/t4VA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-5.2.3.tgz", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/deep-eql": "*", + "assertion-error": "^2.0.1" + } + }, + "node_modules/@types/deep-eql": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react/-/react-19.3.0.tgz", + "integrity": "sha512-N0rFCuH9YoxG9/m61l9MfpJKfmLOVU0em7ipIz6TRgSSkvReLB9vL85GB+yr8Bs5leqpvg96JSwF4ZS1s4viQg==", + "dev": true, + "license": "MIT", + "dependencies": { + "csstype": "^3.2.2" + } + }, + "node_modules/@types/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-ZI7bU42mZXXKHn/qNLEw2IrbiINU7X5+vfgdixBHkCNpYWXjKgfQ/P+uyGb5CjOLB9UcnTeg3rylQtV2hym44Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@types/react": "^19.3.0" + } + }, + "node_modules/@vitest/expect": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.7.tgz", + "integrity": "sha512-E8eBXaKibuvH2pSZErOjdVb5vF4PbKYcrnluBTYxEk1l/VhhwZg1kZQsdtjq+CsF5CFydf2Rdkz7jDHKSisi3w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/mocker": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.7.tgz", + "integrity": "sha512-Trr0hYO9CM3Wj6ksWHRhK9IZpIY6wTMO5u/MqXurMxT57sWBaOPEtP3Oq60ihZuh5JsiagKfz95OcxdEP6dBrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/spy": "3.2.7", + "estree-walker": "^3.0.3", + "magic-string": "^0.30.17" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "msw": "^2.4.9", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "peerDependenciesMeta": { + "msw": { + "optional": true + }, + "vite": { + "optional": true + } + } + }, + "node_modules/@vitest/pretty-format": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.7.tgz", + "integrity": "sha512-KUHlwqVu0sRlhCdyPdQ/wBoTfRahjUky1MubOmYw9fWfIZy1gNoHpuaaQBPAaMaVYdQYHJLurzj8ECCj5OwTqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/runner": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.7.tgz", + "integrity": "sha512-sB9y4ovltoQP+WaUPwmSxO9WIg9Ig694Di5PalVPsYHklAdE027mehpWF2SQSVq+k6sFgaivbTjTJwZLSHbedA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/utils": "3.2.7", + "pathe": "^2.0.3", + "strip-literal": "^3.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/snapshot": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.7.tgz", + "integrity": "sha512-7C+MwShwtBSI5Buwoyg3s/iY1eHL9PKAf+O1wVh/TdnjXUtkoL/9YQtre90i4MtNXM6edP1wJ2zOBpfCyhIS7g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.7", + "magic-string": "^0.30.17", + "pathe": "^2.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/spy": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.7.tgz", + "integrity": "sha512-Q2eQGI6d2L/hBtZ0qNuKcAGid68XK6cv1xsoaIma6PaJhHPoqcEJhYpXZ/5myCMqkNgtP6UKuBhbc0nHKnrkuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/utils": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.7.tgz", + "integrity": "sha512-x6BDOd7dyo3PFLY3I9/HJ25X/6OurhGXk2/B9gOZNPF7XDVjeBK4k01lQE5uvDpbuheErh91qYuE1E2OEjK3Rw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.7", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/better-sqlite3": { + "version": "12.11.1", + "resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-12.11.1.tgz", + "integrity": "sha512-dq9AtApgg5PGFtBzPFSBl3HZQjHok5gaQCM6zh2Yk0aSmDCs1CbnVI8/HgASQkNKsWFpseIO9beg5xxpYhbIfA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "bindings": "^1.5.0", + "prebuild-install": "^7.1.1" + }, + "engines": { + "node": "20.x || 22.x || 23.x || 24.x || 25.x || 26.x" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/cac": { + "version": "6.7.14", + "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", + "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "dev": true, + "license": "ISC" + }, + "node_modules/class-variance-authority": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/class-variance-authority/-/class-variance-authority-0.7.1.tgz", + "integrity": "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "clsx": "^2.1.1" + }, + "funding": { + "url": "https://polar.sh/cva" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cron-parser": { + "version": "5.10.1", + "resolved": "https://registry.npmjs.org/cron-parser/-/cron-parser-5.10.1.tgz", + "integrity": "sha512-pKRrRagItwk9rGIStcUyMxFX34x56zoX3KDf9HJ4ttwkXIK1qxK63EvXvEDmlxI9AdPJ+Y7TEKRftRlW5eSS7A==", + "dev": true, + "license": "MIT", + "dependencies": { + "luxon": "^3.7.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/es-module-lexer": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.7.0.tgz", + "integrity": "sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "dev": true, + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, + "node_modules/expect-type": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.4.0.tgz", + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "license": "MIT" + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "dev": true, + "license": "MIT" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "dev": true, + "license": "MIT" + }, + "node_modules/hono": { + "version": "4.13.13", + "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.13.tgz", + "integrity": "sha512-CQ46U0ZkAGmbT/4UxdzzGJpacP2IeKgY4a5/tOI9AABbpOMfK739wfDXmv1usCk+3RkKj1hQy4/fjhiwa2xlrA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=16.9.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/js-tokens": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-9.0.1.tgz", + "integrity": "sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/luxon": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/luxon/-/luxon-3.7.2.tgz", + "integrity": "sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/napi-build-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-2.0.0.tgz", + "integrity": "sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-abi": { + "version": "3.97.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.97.0.tgz", + "integrity": "sha512-6Pu8F0eXGZlyz0EepPJrWgWDcBI8rKt2Wj8exOJU1tjVbu/VyZy5ZaLYS5N+Jp/Y3IP3sIRKcIOElTu7uC6KKA==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz", + "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.29", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz", + "integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.19", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/prebuild-install": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz", + "integrity": "sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==", + "deprecated": "No longer maintained. Please contact the author of the relevant native addon; alternatives are available.", + "dev": true, + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^2.0.0", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/pump": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.4.tgz", + "integrity": "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "dev": true, + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/react": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.0.tgz", + "integrity": "sha512-E8LUcbtBWt20bbl2YoHfx4ZDBdxVTfOKtCZn9cDSJ4l6/nuoApcpIBcj47t2wZoVX8g2ZHuMHbiShgCR1T5Sog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.0.tgz", + "integrity": "sha512-JDk8dgif51OjFoDE70+OT9ICyYr+69HlmihNwp1+Nsfbna3t5sIiCa9ZJktDmQ4/1b/rn26hIAR2uYXDMr5r0Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" + }, + "peerDependencies": { + "react": "^19.3.0" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rollup": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.0.tgz", + "integrity": "sha512-gjA/kFeDfffII8COoPsvLPvE16hWDTEc1+0QKQNKUkuV8iJjqsC4xXs8/FzuL0v9EV39kuxTbAgcFoTRyy2TGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.64.0", + "@rollup/rollup-android-arm64": "4.64.0", + "@rollup/rollup-darwin-arm64": "4.64.0", + "@rollup/rollup-darwin-x64": "4.64.0", + "@rollup/rollup-freebsd-arm64": "4.64.0", + "@rollup/rollup-freebsd-x64": "4.64.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.64.0", + "@rollup/rollup-linux-arm-musleabihf": "4.64.0", + "@rollup/rollup-linux-arm64-gnu": "4.64.0", + "@rollup/rollup-linux-arm64-musl": "4.64.0", + "@rollup/rollup-linux-loong64-gnu": "4.64.0", + "@rollup/rollup-linux-loong64-musl": "4.64.0", + "@rollup/rollup-linux-ppc64-gnu": "4.64.0", + "@rollup/rollup-linux-ppc64-musl": "4.64.0", + "@rollup/rollup-linux-riscv64-gnu": "4.64.0", + "@rollup/rollup-linux-riscv64-musl": "4.64.0", + "@rollup/rollup-linux-s390x-gnu": "4.64.0", + "@rollup/rollup-linux-x64-gnu": "4.64.0", + "@rollup/rollup-linux-x64-musl": "4.64.0", + "@rollup/rollup-openbsd-x64": "4.64.0", + "@rollup/rollup-openharmony-arm64": "4.64.0", + "@rollup/rollup-win32-arm64-msvc": "4.64.0", + "@rollup/rollup-win32-ia32-msvc": "4.64.0", + "@rollup/rollup-win32-x64-gnu": "4.64.0", + "@rollup/rollup-win32-x64-msvc": "4.64.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/siginfo": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dev": true, + "license": "ISC" + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stackback": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dev": true, + "license": "MIT" + }, + "node_modules/std-env": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.10.0.tgz", + "integrity": "sha512-5GS12FdOZNliM5mAOxFRg7Ir0pWz8MdpYm6AY6VPkGpbA7ZzmbzNcBJQ0GPvvyWgcY7QAhCgf9Uy89I03faLkg==", + "dev": true, + "license": "MIT" + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-literal": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-3.1.0.tgz", + "integrity": "sha512-8r3mkIM/2+PpjHoOtiAW8Rg3jJLHaV7xPwG+YRGrv6FP0wwk/toTpATxWYOW0BKdWwl82VT2tFYi5DlROa0Mxg==", + "dev": true, + "license": "MIT", + "dependencies": { + "js-tokens": "^9.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/antfu" + } + }, + "node_modules/tailwind-merge": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.7.0.tgz", + "integrity": "sha512-XPPUyAc+cvspz3lHTcR/QgPfW2A0lv/xQNIjX3HGhLR+Nq2lHaLq5MtTesHn8GUr3W3DguT2KT5x3NVgRtYwmA==", + "dev": true, + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/dcastil" + } + }, + "node_modules/tar-fs": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.5.tgz", + "integrity": "sha512-OboTd8mmMhZDNPV+UjQcK9yKAatXu2aJ+r1w4im1Otd4M4fl2hwvdoXUxIYHFTHWK/3y3FarBP70v3vwmGlOxw==", + "dev": true, + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tinybench": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.9.0.tgz", + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyexec": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-0.3.2.tgz", + "integrity": "sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tinypool": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", + "integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tinyspy": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", + "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/vite/-/vite-7.3.7.tgz", + "integrity": "sha512-AHEzTORMbi7/7aXp7w7KZ5+DCUdSeLsJz0grY8xHpc9DHdYb0vQu6DqJfm2tOw3gDExNgPgnJTXxM6syYFHaCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.27.0 || ^0.28.0", + "fdir": "^6.5.0", + "picomatch": "^4.0.3", + "postcss": "^8.5.6", + "rollup": "^4.43.0", + "tinyglobby": "^0.2.15" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "lightningcss": "^1.21.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vite-node": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz", + "integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cac": "^6.7.14", + "debug": "^4.4.1", + "es-module-lexer": "^1.7.0", + "pathe": "^2.0.3", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0" + }, + "bin": { + "vite-node": "vite-node.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/vitest": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.7.tgz", + "integrity": "sha512-KrxIJ62Fd89gfysR4WotlgZABiz2dqFPgqGzX7s+CwsqLFomRH7777ZcrOD6+WVAh7khPQP41A+BKbpcJFrdEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/expect": "3.2.7", + "@vitest/mocker": "3.2.7", + "@vitest/pretty-format": "^3.2.7", + "@vitest/runner": "3.2.7", + "@vitest/snapshot": "3.2.7", + "@vitest/spy": "3.2.7", + "@vitest/utils": "3.2.7", + "chai": "^5.2.0", + "debug": "^4.4.1", + "expect-type": "^1.2.1", + "magic-string": "^0.30.17", + "pathe": "^2.0.3", + "picomatch": "^4.0.2", + "std-env": "^3.9.0", + "tinybench": "^2.9.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.14", + "tinypool": "^1.1.1", + "tinyrainbow": "^2.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0", + "vite-node": "3.2.4", + "why-is-node-running": "^2.3.0" + }, + "bin": { + "vitest": "vitest.mjs" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@types/debug": "^4.1.12", + "@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0", + "@vitest/browser": "3.2.7", + "@vitest/ui": "3.2.7", + "happy-dom": "*", + "jsdom": "*" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@types/debug": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + } + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/why-is-node-running": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/zod": { + "version": "4.6.5", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz", + "integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/plugins/team-setup/package.json b/plugins/team-setup/package.json new file mode 100644 index 00000000..ba3a6e4f --- /dev/null +++ b/plugins/team-setup/package.json @@ -0,0 +1,49 @@ +{ + "name": "bb-plugin-team-setup", + "version": "0.1.0", + "type": "module", + "description": "First-run checklist for a bb-gate server: Claude or Codex, GitHub, devbox, first machine", + "engines": { + "bb": ">=0.45", + "bbPluginSdk": ">=0.6.15" + }, + "bb": { + "name": "Team setup", + "description": "The steps a new server needs before agents can work: sign in to Claude or Codex, GitHub and devbox, and make a machine.", + "branding": { + "icon": "ListTodo" + }, + "server": "./server.ts", + "app": "./app.tsx" + }, + "keywords": [ + "bb-plugin" + ], + "scripts": { + "typecheck": "tsc --noEmit", + "test": "vitest run", + "build": "bb plugin build" + }, + "dependencies": { + "@radix-ui/react-slot": "^1.3.0", + "zod": "^4.3.6" + }, + "devDependencies": { + "@get-bb/plugin-sdk": "0.6.15", + "@types/better-sqlite3": "^7.6.12", + "@types/node": "^22.0.0", + "@types/react": "^19.0.0", + "@types/react-dom": "^19.0.0", + "better-sqlite3": "^12.0.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "cron-parser": "^5.10.1", + "hono": "^4.11.9", + "react": "^19.0.0", + "react-dom": "^19.3.0", + "tailwind-merge": "^3.4.0", + "typescript": "^5.7.0", + "vitest": "^3.2.7" + }, + "license": "MIT" +} diff --git a/plugins/team-setup/server.test.ts b/plugins/team-setup/server.test.ts new file mode 100644 index 00000000..25879a8f --- /dev/null +++ b/plugins/team-setup/server.test.ts @@ -0,0 +1,279 @@ +import { createFakePluginHost } from "@get-bb/plugin-sdk/testing"; +import { describe, expect, it, vi } from "vitest"; +import type { GhProcess, GhResult, GhRunner } from "./gh.js"; +import { ACCOUNT_POOL_ID, CHANGED, createTeamSetupPlugin, DEVBOX_ID, LOGIN_TTL_MS } from "./server.js"; + +// A gh whose `auth login` the test drives: print lines, then exit. +function fakeGh(runs: Record = {}) { + const started: Array<{ args: string[]; emit: (line: string) => void; exit: (result: Partial) => void; killed: boolean }> = []; + const runner: GhRunner = { + run: vi.fn(async (args: string[]) => runs[args.join(" ")] ?? { exitCode: 1, stdout: "", stderr: "not stubbed: gh " + args.join(" ") }), + start: vi.fn((args: string[]): GhProcess => { + const listeners: Array<(line: string) => void> = []; + let resolveExit!: (r: GhResult) => void; + const exited = new Promise((resolve) => { + resolveExit = resolve; + }); + const entry = { + args, + emit: (line: string) => listeners.forEach((l) => l(line)), + exit: (result: Partial) => resolveExit({ exitCode: 0, stdout: "", stderr: "", ...result }), + killed: false, + }; + started.push(entry); + return { + onLine: (l) => { + listeners.push(l); + }, + exited, + kill: () => { + entry.killed = true; + entry.exit({ exitCode: 1, stderr: "killed" }); + }, + }; + }), + }; + return { runner, started }; +} + +const PROMPT = ["! First copy your one-time code: AB12-CD34", "Open this URL to continue in your web browser: https://github.com/login/device"]; + +interface World { + plugins?: Array<{ id: string; enabled: boolean }>; + builtInGit?: { status: string; statusMessage: string }; + pool?: unknown; + devbox?: unknown; + hosts?: Array<{ name: string }>; + runs?: Record; + settings?: Record; +} + +async function setup(world: World = {}) { + const gh = fakeGh(world.runs); + const { bb, harness } = createFakePluginHost({ pluginId: "team-setup", settings: world.settings ?? {} }); + harness.sdk.stub("plugins.list", async () => ({ + plugins: (world.plugins ?? [{ id: ACCOUNT_POOL_ID, enabled: true }, { id: DEVBOX_ID, enabled: true }]).map((p) => ({ ...p, name: p.id })), + })); + harness.sdk.stub("system.machineEnvironment", async () => ({ + builtInGit: world.builtInGit ?? { status: "not logged in", statusMessage: "gh is not logged in on the server" }, + variables: [], + })); + harness.sdk.stub("hosts.list", async () => world.hosts ?? []); + const rpcCalls: Array<{ pluginId: string; method: string; input: unknown }> = []; + harness.sdk.stub("plugins.callRpc", async (args: { pluginId: string; method: string; input: unknown; outputSchema: { parse: (v: unknown) => unknown } }) => { + rpcCalls.push({ pluginId: args.pluginId, method: args.method, input: args.input }); + const key = `${args.pluginId}:${args.method}`; + const answers: Record = { + [`${ACCOUNT_POOL_ID}:status.get`]: world.pool ?? { routing: { claude: true, codex: true }, accounts: [] }, + [`${ACCOUNT_POOL_ID}:login.start`]: { sessionId: "00000000-0000-4000-8000-000000000001", authorizeUrl: "https://claude.ai/oauth/authorize?x" }, + [`${ACCOUNT_POOL_ID}:login.complete`]: { label: "me@example.com", provider: "claude" }, + [`${ACCOUNT_POOL_ID}:codexLogin.start`]: { + sessionId: "00000000-0000-4000-8000-000000000002", + verificationUri: "https://auth.openai.com/device", + userCode: "WXYZ-1234", + expiresAt: 1_700_000_000_000, + intervalMs: 5000, + }, + [`${ACCOUNT_POOL_ID}:codexLogin.poll`]: { status: "complete", account: { label: "codex@example.com" } }, + [`${ACCOUNT_POOL_ID}:codexLogin.cancel`]: { cancelled: true }, + [`${DEVBOX_ID}:status`]: world.devbox ?? { connected: false, project: null }, + [`${DEVBOX_ID}:connect`]: { url: "https://devbox.example/connect/authorize?state=s" }, + }; + if (!(key in answers)) throw new Error(`no answer for ${key}`); + return args.outputSchema.parse(answers[key]); + }); + let now = 1_000_000; + await createTeamSetupPlugin({ gh: gh.runner, now: () => now })(bb); + const status = async () => (await harness.callRpc("status", null)) as Awaited>; + return { bb, harness, gh, rpcCalls, status, advance: (ms: number) => (now += ms) }; +} +// Only for the inferred return type above. +declare function statusType(): Promise<{ + ai: { available: boolean; message: string | null; accounts: Array<{ label: string }> }; + github: { status: string; login: string | null; orgMember: boolean | null; pending: { code: string; url: string } | null; lastError: string | null }; + devbox: { available: boolean; connected: boolean; project: string | null; message: string | null }; + machines: { names: string[] }; + steps: { ai: string; github: string; devbox: string; machine: string }; + complete: boolean; +}>; + +const signedIn = { + "api --hostname github.com user --jq .login": { exitCode: 0, stdout: "octocat\n", stderr: "" }, + "api --hostname github.com user/memberships/orgs/bitcomplete --jq .state": { exitCode: 0, stdout: "active\n", stderr: "" }, +}; + +describe("status", () => { + it("starts with everything to do", async () => { + const { status } = await setup(); + const s = await status(); + expect(s.steps).toEqual({ ai: "todo", github: "todo", devbox: "todo", machine: "todo" }); + expect(s.complete).toBe(false); + expect(s.github.login).toBeNull(); + }); + + it("is complete when every step is done", async () => { + const { status, gh } = await setup({ + builtInGit: { status: "logged in", statusMessage: "ok" }, + pool: { routing: { claude: true, codex: false }, accounts: [{ id: "a", provider: "claude", label: "me", enabled: true, status: "ready" }] }, + devbox: { connected: true, project: "dylan" }, + hosts: [{ name: "box" }], + runs: signedIn, + }); + const s = await status(); + expect(s.steps).toEqual({ ai: "done", github: "done", devbox: "done", machine: "done" }); + expect(s.complete).toBe(true); + expect(s.github.login).toBe("octocat"); + expect(s.github.orgMember).toBe(true); + // Identity is cached between status calls. + await status(); + expect(gh.runner.run).toHaveBeenCalledTimes(2); + }); + + it("does not count an account whose provider routing is off", async () => { + const { status } = await setup({ + pool: { routing: { claude: false, codex: true }, accounts: [{ id: "a", provider: "claude", label: "me", enabled: true, status: "ready" }] }, + }); + expect((await status()).steps.ai).toBe("todo"); + }); + + it("marks a step unavailable when its plugin is off, and that does not block completion", async () => { + const { status } = await setup({ + plugins: [{ id: ACCOUNT_POOL_ID, enabled: true }, { id: DEVBOX_ID, enabled: false }], + builtInGit: { status: "overridden", statusMessage: "" }, + pool: { routing: { claude: true, codex: true }, accounts: [{ id: "a", provider: "codex", label: "me", enabled: true, status: "ready" }] }, + hosts: [{ name: "laptop" }], + }); + const s = await status(); + expect(s.devbox.available).toBe(false); + expect(s.devbox.message).toContain("turned off"); + expect(s.steps).toEqual({ ai: "done", github: "done", devbox: "unavailable", machine: "done" }); + expect(s.complete).toBe(true); + }); + + it("warns about an account outside the organization", async () => { + const { status } = await setup({ + builtInGit: { status: "logged in", statusMessage: "ok" }, + runs: { ...signedIn, "api --hostname github.com user/memberships/orgs/bitcomplete --jq .state": { exitCode: 1, stdout: "", stderr: "404" } }, + }); + expect((await status()).github.orgMember).toBe(false); + }); + + it("skips the organization check when the setting is empty", async () => { + const { status, gh } = await setup({ builtInGit: { status: "logged in", statusMessage: "ok" }, runs: signedIn, settings: { githubOrg: "" } }); + expect((await status()).github.orgMember).toBeNull(); + expect(gh.runner.run).toHaveBeenCalledTimes(1); + }); +}); + +describe("GitHub sign-in", () => { + it("starts gh headless and hands back the code it prints", async () => { + const { harness, gh, status } = await setup(); + const pending = harness.callRpc("githubSignIn", null); + await vi.waitFor(() => expect(gh.started).toHaveLength(1)); + expect(gh.started[0].args).toEqual(["auth", "login", "--hostname", "github.com", "--git-protocol", "https", "--web", "--insecure-storage"]); + for (const line of PROMPT) gh.started[0].emit(line); + expect(await pending).toEqual({ code: "AB12-CD34", url: "https://github.com/login/device", expiresAt: 1_000_000 + LOGIN_TTL_MS }); + expect((await status()).github.pending).toEqual({ code: "AB12-CD34", url: "https://github.com/login/device", expiresAt: 1_000_000 + LOGIN_TTL_MS }); + + // A second click returns the same code rather than a second gh. + expect(await harness.callRpc("githubSignIn", null)).toMatchObject({ code: "AB12-CD34" }); + expect(gh.started).toHaveLength(1); + + gh.started[0].emit("✓ Logged in as octocat"); + gh.started[0].exit({ exitCode: 0 }); + await vi.waitFor(() => expect(harness.realtimeSignals.map((s) => s.channel)).toContain(CHANGED)); + const s = await status(); + expect(s.github.pending).toBeNull(); + expect(s.github.lastError).toBeNull(); + }); + + it("reports why gh gave up", async () => { + const { harness, gh, status } = await setup(); + const pending = harness.callRpc("githubSignIn", null); + await vi.waitFor(() => expect(gh.started).toHaveLength(1)); + for (const line of PROMPT) gh.started[0].emit(line); + await pending; + gh.started[0].exit({ exitCode: 1, stderr: "error: The device code has expired\n" }); + await vi.waitFor(async () => expect((await status()).github.lastError).toBe("error: The device code has expired")); + expect((await status()).github.pending).toBeNull(); + }); + + it("fails the call when gh exits before printing a code", async () => { + const { harness, gh } = await setup(); + const pending = harness.callRpc("githubSignIn", null); + await vi.waitFor(() => expect(gh.started).toHaveLength(1)); + gh.started[0].exit({ exitCode: 1, stderr: "The value of the GH_TOKEN environment variable is being used for authentication.\n" }); + await expect(pending).rejects.toThrow(/GH_TOKEN environment variable/u); + }); + + it("cancel kills the waiting gh", async () => { + const { harness, gh, status } = await setup(); + const pending = harness.callRpc("githubSignIn", null); + await vi.waitFor(() => expect(gh.started).toHaveLength(1)); + for (const line of PROMPT) gh.started[0].emit(line); + await pending; + await harness.callRpc("githubCancel", null); + expect(gh.started[0].killed).toBe(true); + const s = await status(); + expect(s.github.pending).toBeNull(); + expect(s.github.lastError).toBeNull(); + }); + + it("sign out runs gh auth logout and forgets the identity", async () => { + const { harness, gh, status } = await setup({ + builtInGit: { status: "logged in", statusMessage: "ok" }, + runs: { ...signedIn, "auth logout --hostname github.com": { exitCode: 0, stdout: "", stderr: "" } }, + }); + expect((await status()).github.login).toBe("octocat"); + await harness.callRpc("githubSignOut", null); + expect(gh.runner.run).toHaveBeenCalledWith(["auth", "logout", "--hostname", "github.com"], expect.any(Number)); + expect(harness.realtimeSignals.map((s) => s.channel)).toContain(CHANGED); + }); +}); + +describe("Account Pool and devbox flows", () => { + it("proxies the Claude sign-in", async () => { + const { harness, rpcCalls } = await setup(); + expect(await harness.callRpc("claudeSignIn", null)).toEqual({ + sessionId: "00000000-0000-4000-8000-000000000001", + url: "https://claude.ai/oauth/authorize?x", + }); + expect(await harness.callRpc("claudeComplete", { sessionId: "00000000-0000-4000-8000-000000000001", pasted: "code#state" })).toEqual({ + label: "me@example.com", + }); + expect(rpcCalls.map((c) => `${c.pluginId}:${c.method}`)).toEqual([`${ACCOUNT_POOL_ID}:login.start`, `${ACCOUNT_POOL_ID}:login.complete`]); + expect(rpcCalls[1].input).toEqual({ sessionId: "00000000-0000-4000-8000-000000000001", pasted: "code#state" }); + }); + + it("proxies the Codex device flow", async () => { + const { harness } = await setup(); + expect(await harness.callRpc("codexSignIn", null)).toEqual({ + sessionId: "00000000-0000-4000-8000-000000000002", + url: "https://auth.openai.com/device", + code: "WXYZ-1234", + expiresAt: 1_700_000_000_000, + intervalMs: 5000, + }); + expect(await harness.callRpc("codexPoll", { sessionId: "00000000-0000-4000-8000-000000000002" })).toEqual({ + status: "complete", + label: "codex@example.com", + }); + expect(await harness.callRpc("codexCancel", { sessionId: "00000000-0000-4000-8000-000000000002" })).toEqual({ ok: true }); + }); + + it("starts devbox's connect", async () => { + const { harness } = await setup(); + expect(await harness.callRpc("devboxConnect", null)).toEqual({ url: "https://devbox.example/connect/authorize?state=s" }); + }); + + it("reports a plugin that does not answer", async () => { + const { harness, status } = await setup(); + harness.sdk.stub("plugins.callRpc", async () => { + throw new Error("boom"); + }); + const s = await status(); + expect(s.ai.available).toBe(false); + expect(s.ai.message).toContain("boom"); + expect(s.devbox.available).toBe(false); + }); +}); diff --git a/plugins/team-setup/server.ts b/plugins/team-setup/server.ts new file mode 100644 index 00000000..81a78450 --- /dev/null +++ b/plugins/team-setup/server.ts @@ -0,0 +1,446 @@ +// Team setup: the checklist a new bb-gate server needs before an agent can +// work. Each step belongs to something else; this plugin reads their state +// and starts their flows from one place. +// +// AI Account Pool holds the Claude or Codex sign-in. Started here +// through its RPCs; the credentials never pass through this plugin. +// GitHub gh on this server host. bb core forwards its login to every +// machine as GH_TOKEN (Settings → Environment variables, the +// built-in row), so the step is a headless `gh auth login`. +// devbox devbox-provider's connection. Started here, finished by its own +// callback. +// machine Any machine at all. Created from devbox-provider's section. +import { defineRpcContract, type BbPluginApi } from "@get-bb/plugin-sdk"; +import { z } from "zod"; +import { + createGhRunner, + LOGIN_ARGS, + LOGOUT_ARGS, + parseLoggedInAs, + parseLoginPrompt, + type GhProcess, + type GhRunner, +} from "./gh.js"; + +export const ACCOUNT_POOL_ID = "account-pool"; +export const DEVBOX_ID = "devbox-provider"; +export const CHANGED = "changed"; + +// GitHub device codes last 15 minutes; gh gives up itself around then. +export const LOGIN_TTL_MS = 15 * 60 * 1000; +// gh prints the prompt within a second or two; longer means it is stuck +// (no network, no gh) and the stderr so far is the error. +const PROMPT_TIMEOUT_MS = 20_000; +const GH_TIMEOUT_MS = 15_000; +const IDENTITY_TTL_MS = 60_000; + +const stepStateSchema = z.enum(["done", "todo", "unavailable"]); +export type StepState = z.infer; + +const providerSchema = z.enum(["claude", "codex"]); +const accountRowSchema = z.object({ + id: z.string(), + provider: providerSchema, + label: z.string(), + enabled: z.boolean(), + status: z.string(), +}); + +const githubStatusSchema = z.enum(["logged in", "not logged in", "overridden", "disabled", "unknown"]); +const pendingLoginSchema = z.object({ code: z.string(), url: z.string(), expiresAt: z.number() }); + +export const rpcContract = defineRpcContract({ + status: { + input: z.null(), + output: z.object({ + ai: z.object({ + available: z.boolean(), + message: z.string().nullable(), + routing: z.object({ claude: z.boolean(), codex: z.boolean() }), + accounts: z.array(accountRowSchema), + }), + github: z.object({ + status: githubStatusSchema, + message: z.string().nullable(), + login: z.string().nullable(), + org: z.string(), + orgMember: z.boolean().nullable(), + pending: pendingLoginSchema.nullable(), + lastError: z.string().nullable(), + }), + devbox: z.object({ + available: z.boolean(), + message: z.string().nullable(), + connected: z.boolean(), + project: z.string().nullable(), + }), + machines: z.object({ names: z.array(z.string()) }), + steps: z.object({ ai: stepStateSchema, github: stepStateSchema, devbox: stepStateSchema, machine: stepStateSchema }), + complete: z.boolean(), + }), + }, + // GitHub: the device flow. Returns the code to type and where; the login + // lands when GitHub approves it and `status` flips. Calling again while + // one is pending returns the same code. + githubSignIn: { input: z.null(), output: pendingLoginSchema }, + githubCancel: { input: z.null(), output: z.object({ ok: z.boolean() }) }, + githubSignOut: { input: z.null(), output: z.object({ ok: z.boolean() }) }, + // Claude: Account Pool's browser sign-in. Open the URL, paste the code + // from its final page back here. + claudeSignIn: { input: z.null(), output: z.object({ sessionId: z.string(), url: z.string() }) }, + claudeComplete: { + input: z.object({ sessionId: z.string(), pasted: z.string().trim().min(1) }).strict(), + output: z.object({ label: z.string() }), + }, + // Codex: Account Pool's device flow, polled from here. + codexSignIn: { + input: z.null(), + output: z.object({ sessionId: z.string(), url: z.string(), code: z.string(), expiresAt: z.number(), intervalMs: z.number() }), + }, + codexPoll: { + input: z.object({ sessionId: z.string() }).strict(), + output: z.discriminatedUnion("status", [ + z.object({ status: z.literal("pending") }), + z.object({ status: z.literal("complete"), label: z.string() }), + z.object({ status: z.literal("error"), message: z.string() }), + ]), + }, + codexCancel: { input: z.object({ sessionId: z.string() }).strict(), output: z.object({ ok: z.boolean() }) }, + // devbox: devbox-provider's connect; its callback finishes the job. + devboxConnect: { input: z.null(), output: z.object({ url: z.string() }) }, +}); + +export const SETTING_DESCRIPTORS = { + githubOrg: { + type: "string", + label: "GitHub organization", + description: "Checked after GitHub sign-in: an account outside this organization cannot reach its repos. Empty skips the check.", + default: "bitcomplete", + }, +} as const; + +export interface TeamSetupDeps { + gh: GhRunner; + now: () => number; +} + +function errorMessage(error: unknown): string { + return error instanceof Error ? error.message : String(error); +} + +function tail(text: string, lines = 3): string { + return text + .trim() + .split("\n") + .filter((l) => l.trim() !== "") + .slice(-lines) + .join(" ") + .trim(); +} + +// What the other plugins answer; only the fields read here, everything else +// passes through. +const poolStatusSchema = z + .object({ + routing: z.object({ claude: z.boolean(), codex: z.boolean() }).loose(), + accounts: z.array( + z.object({ id: z.string(), provider: providerSchema, label: z.string(), enabled: z.boolean(), status: z.string() }).loose(), + ), + }) + .loose(); +const poolLoginStartSchema = z.object({ sessionId: z.string(), authorizeUrl: z.string() }).loose(); +const poolAccountSchema = z.object({ label: z.string() }).loose(); +const poolCodexStartSchema = z + .object({ sessionId: z.string(), verificationUri: z.string(), userCode: z.string(), expiresAt: z.number(), intervalMs: z.number() }) + .loose(); +const poolCodexPollSchema = z.discriminatedUnion("status", [ + z.object({ status: z.literal("pending") }).loose(), + z.object({ status: z.literal("complete"), account: poolAccountSchema }).loose(), + z.object({ status: z.literal("error"), message: z.string() }).loose(), +]); +const poolCancelSchema = z.object({ cancelled: z.boolean() }).loose(); +const devboxStatusSchema = z.object({ connected: z.boolean(), project: z.string().nullable() }).loose(); +const devboxConnectSchema = z.object({ url: z.string() }).loose(); + +interface PendingLogin { + process: GhProcess; + code: string; + url: string; + expiresAt: number; + timer: ReturnType; + // Set before kill() so the exit it causes is not reported as a failure. + cancelled: boolean; +} + +interface Identity { + login: string | null; + orgMember: boolean | null; + org: string; + at: number; +} + +export function createTeamSetupPlugin(deps: TeamSetupDeps): (bb: BbPluginApi) => Promise { + return async (bb) => { + const settings = bb.settings.define(SETTING_DESCRIPTORS); + + // ---- other plugins ---------------------------------------------------- + + async function pluginState(id: string): Promise<{ available: boolean; message: string | null }> { + try { + const { plugins } = await bb.sdk.plugins.list(); + const p = plugins.find((entry) => entry.id === id); + if (p === undefined) return { available: false, message: `The ${id} plugin is not installed.` }; + if (!p.enabled) return { available: false, message: `The ${id} plugin is turned off.` }; + return { available: true, message: null }; + } catch (error) { + return { available: false, message: `Could not list plugins: ${errorMessage(error)}` }; + } + } + + function call(pluginId: string, method: string, input: unknown, outputSchema: z.ZodType): Promise { + return bb.sdk.plugins.callRpc({ + pluginId, + method, + input: (input ?? null) as Parameters[0]["input"], + outputSchema, + }); + } + + // ---- GitHub ----------------------------------------------------------- + + let pending: PendingLogin | null = null; + let lastError: string | null = null; + let identity: Identity | null = null; + + function clearPending(): void { + if (pending === null) return; + clearTimeout(pending.timer); + pending = null; + } + + function cancelPending(): void { + if (pending === null) return; + pending.cancelled = true; + pending.process.kill(); + clearPending(); + } + + async function githubIdentity(): Promise { + const org = (await settings.get()).githubOrg.trim(); + if (identity !== null && identity.org === org && deps.now() - identity.at < IDENTITY_TTL_MS) return identity; + let login: string | null = null; + let orgMember: boolean | null = null; + const user = await deps.gh.run(["api", "--hostname", "github.com", "user", "--jq", ".login"], GH_TIMEOUT_MS); + if (user.exitCode === 0 && user.stdout.trim() !== "") login = user.stdout.trim(); + if (login !== null && org !== "") { + const membership = await deps.gh.run( + ["api", "--hostname", "github.com", `user/memberships/orgs/${org}`, "--jq", ".state"], + GH_TIMEOUT_MS, + ); + orgMember = membership.exitCode === 0 && membership.stdout.trim() === "active"; + } + identity = { login, orgMember, org, at: deps.now() }; + return identity; + } + + async function githubStatus() { + const org = (await settings.get()).githubOrg.trim(); + let status: z.infer = "unknown"; + let message: string | null = null; + try { + const env = await bb.sdk.system.machineEnvironment(); + status = env.builtInGit.status; + message = env.builtInGit.statusMessage; + } catch (error) { + message = `Could not read the machine environment: ${errorMessage(error)}`; + } + const id = status === "logged in" ? await githubIdentity() : { login: null, orgMember: null, org, at: 0 }; + return { + status, + message, + login: id.login, + org, + orgMember: id.orgMember, + pending: pending === null ? null : { code: pending.code, url: pending.url, expiresAt: pending.expiresAt }, + lastError, + }; + } + + function startGithubLogin(): Promise<{ code: string; url: string; expiresAt: number }> { + if (pending !== null) { + return Promise.resolve({ code: pending.code, url: pending.url, expiresAt: pending.expiresAt }); + } + lastError = null; + const process = deps.gh.start(LOGIN_ARGS); + const lines: string[] = []; + return new Promise((resolve, reject) => { + let settled = false; + const promptTimer = setTimeout(() => { + if (settled) return; + settled = true; + process.kill(); + reject(new Error(`gh printed no sign-in code within ${PROMPT_TIMEOUT_MS / 1000} s: ${tail(lines.join("\n")) || "no output"}`)); + }, PROMPT_TIMEOUT_MS); + process.onLine((line) => { + lines.push(line); + if (settled) return; + const prompt = parseLoginPrompt(lines); + if (prompt === null) return; + settled = true; + clearTimeout(promptTimer); + const expiresAt = deps.now() + LOGIN_TTL_MS; + const entry: PendingLogin = { + process, + code: prompt.code, + url: prompt.url, + expiresAt, + cancelled: false, + timer: setTimeout(() => { + if (pending === entry) { + process.kill(); + lastError = "The code expired before it was approved. Start again."; + } + }, LOGIN_TTL_MS), + }; + pending = entry; + void process.exited.then((result) => { + if (pending === entry) clearPending(); + identity = null; + if (result.exitCode === 0) { + lastError = null; + bb.log.info(`GitHub signed in${parseLoggedInAs(lines) === null ? "" : ` as ${parseLoggedInAs(lines)}`}`); + } else if (entry.cancelled) { + return; + } else if (lastError === null) { + lastError = tail(result.stderr) || `gh auth login exited with ${result.exitCode}`; + bb.log.warn(`GitHub sign-in failed: ${lastError}`); + } + bb.realtime.publish(CHANGED, { github: result.exitCode === 0 ? "signed in" : "failed" }); + }); + resolve({ code: prompt.code, url: prompt.url, expiresAt }); + }); + void process.exited.then((result) => { + if (settled) return; + settled = true; + clearTimeout(promptTimer); + reject(new Error(tail(result.stderr) || `gh auth login exited with ${result.exitCode} before printing a code`)); + }); + }); + } + + // ---- the checklist ---------------------------------------------------- + + bb.rpc.register(rpcContract, { + async status() { + const [poolState, devboxState, github, hosts] = await Promise.all([ + pluginState(ACCOUNT_POOL_ID), + pluginState(DEVBOX_ID), + githubStatus(), + bb.sdk.hosts.list().then( + (list) => list.map((h) => h.name), + (error: unknown) => { + bb.log.warn(`could not list machines: ${errorMessage(error)}`); + return [] as string[]; + }, + ), + ]); + + const ai = { ...poolState, routing: { claude: false, codex: false }, accounts: [] as z.infer[] }; + if (poolState.available) { + try { + const pool = await call(ACCOUNT_POOL_ID, "status.get", null, poolStatusSchema); + ai.routing = { claude: pool.routing.claude, codex: pool.routing.codex }; + ai.accounts = pool.accounts.map((a) => ({ id: a.id, provider: a.provider, label: a.label, enabled: a.enabled, status: a.status })); + } catch (error) { + ai.available = false; + ai.message = `Account Pool did not answer: ${errorMessage(error)}`; + } + } + + const devbox = { ...devboxState, connected: false, project: null as string | null }; + if (devboxState.available) { + try { + const d = await call(DEVBOX_ID, "status", null, devboxStatusSchema); + devbox.connected = d.connected; + devbox.project = d.project; + } catch (error) { + devbox.available = false; + devbox.message = `devbox did not answer: ${errorMessage(error)}`; + } + } + + const aiReady = ai.accounts.some((a) => a.enabled && ai.routing[a.provider]); + const steps = { + ai: !ai.available ? "unavailable" : aiReady ? "done" : "todo", + github: + github.status === "logged in" || github.status === "overridden" + ? "done" + : github.status === "disabled" + ? "unavailable" + : "todo", + devbox: !devbox.available ? "unavailable" : devbox.connected ? "done" : "todo", + machine: hosts.length > 0 ? "done" : "todo", + } as const; + return { + ai, + github, + devbox, + machines: { names: hosts }, + steps, + complete: Object.values(steps).every((s) => s !== "todo"), + }; + }, + + githubSignIn: () => startGithubLogin(), + async githubCancel() { + cancelPending(); + lastError = null; + return { ok: true }; + }, + async githubSignOut() { + cancelPending(); + const result = await deps.gh.run(LOGOUT_ARGS, GH_TIMEOUT_MS); + identity = null; + lastError = null; + if (result.exitCode !== 0 && !/not logged in/iu.test(result.stderr)) { + throw new Error(tail(result.stderr) || `gh auth logout exited with ${result.exitCode}`); + } + bb.realtime.publish(CHANGED, { github: "signed out" }); + return { ok: true }; + }, + + async claudeSignIn() { + const started = await call(ACCOUNT_POOL_ID, "login.start", null, poolLoginStartSchema); + return { sessionId: started.sessionId, url: started.authorizeUrl }; + }, + async claudeComplete({ sessionId, pasted }) { + const account = await call(ACCOUNT_POOL_ID, "login.complete", { sessionId, pasted }, poolAccountSchema); + bb.realtime.publish(CHANGED, { ai: "claude" }); + return { label: account.label }; + }, + async codexSignIn() { + const s = await call(ACCOUNT_POOL_ID, "codexLogin.start", null, poolCodexStartSchema); + return { sessionId: s.sessionId, url: s.verificationUri, code: s.userCode, expiresAt: s.expiresAt, intervalMs: s.intervalMs }; + }, + async codexPoll({ sessionId }) { + const r = await call(ACCOUNT_POOL_ID, "codexLogin.poll", { sessionId }, poolCodexPollSchema); + if (r.status === "complete") { + bb.realtime.publish(CHANGED, { ai: "codex" }); + return { status: "complete" as const, label: r.account.label }; + } + return r.status === "pending" ? { status: "pending" as const } : { status: "error" as const, message: r.message }; + }, + async codexCancel({ sessionId }) { + const r = await call(ACCOUNT_POOL_ID, "codexLogin.cancel", { sessionId }, poolCancelSchema); + return { ok: r.cancelled }; + }, + + async devboxConnect() { + const { url } = await call(DEVBOX_ID, "connect", null, devboxConnectSchema); + return { url }; + }, + }); + }; +} + +export default createTeamSetupPlugin({ gh: createGhRunner(), now: () => Date.now() }); diff --git a/plugins/team-setup/tsconfig.json b/plugins/team-setup/tsconfig.json new file mode 100644 index 00000000..00228661 --- /dev/null +++ b/plugins/team-setup/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "strict": true, + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "bundler", + "jsx": "react-jsx", + "lib": [ + "ES2022", + "DOM" + ], + "types": [ + "node" + ], + "paths": { + "@/*": [ + "./*" + ] + }, + "noEmit": true, + "skipLibCheck": true + }, + "include": [ + "*.ts", + "app.tsx", + "components", + "lib" + ] +} diff --git a/plugins/team-setup/vitest.config.ts b/plugins/team-setup/vitest.config.ts new file mode 100644 index 00000000..66e60235 --- /dev/null +++ b/plugins/team-setup/vitest.config.ts @@ -0,0 +1,8 @@ +import { defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: ["**/*.test.ts"], + exclude: ["node_modules/**", "dist/**"], + }, +});