From 6edf110a8866a5e9fa40a00d47e51a82aa8ace83 Mon Sep 17 00:00:00 2001 From: Victor Garcia Date: Fri, 2 Oct 2026 16:38:44 -0600 Subject: [PATCH 1/4] feat: jig start launcher, Tasks view, and run outcomes in the web UI - `jig start` brings up the server and worker together and opens the browser; `Start Jig.command` builds and runs it from Finder - Tasks view with starter definitions; run outcomes summarized in RunDetail - engine/protocol phase changes with tests, and a rebuilt web/dist --- README.md | 2 +- Start Jig.command | 14 ++ cmd/jig/definitions_test.go | 9 +- cmd/jig/main.go | 3 + cmd/jig/start.go | 150 +++++++++++++ cmd/jig/start_test.go | 47 +++++ docs/quickstart.md | 31 +++ examples/definitions/plan-build-test.yaml | 17 +- internal/engine/phase.go | 39 +++- internal/engine/phase_test.go | 63 ++++++ internal/protocol/definition.go | 26 ++- internal/protocol/repair_chain_test.go | 28 +++ web/dist/assets/index-CHcG2FfK.js | 9 - web/dist/assets/index-CZKUce6A.js | 167 +++++++++++++++ web/dist/assets/index-DvXXKdOR.css | 1 + web/dist/assets/index-cy4ZRQX4.css | 1 - web/dist/index.html | 4 +- web/src/App.tsx | 19 +- web/src/Fleet.test.tsx | 4 +- web/src/Fleet.tsx | 7 +- web/src/Queue.tsx | 54 +++-- web/src/RunDetail.test.tsx | 89 +++++++- web/src/RunDetail.tsx | 177 +++++++++++++--- web/src/SwimLane.tsx | 3 + web/src/Tasks.test.tsx | 104 +++++++++ web/src/Tasks.tsx | 100 +++++++++ web/src/api.ts | 32 ++- web/src/format.ts | 30 ++- web/src/lanes.test.ts | 13 ++ web/src/lanes.ts | 3 + web/src/outcomes.test.ts | 44 ++++ web/src/outcomes.ts | 72 +++++++ web/src/raw.d.ts | 4 + web/src/router.ts | 4 +- web/src/starters.ts | 23 ++ web/src/styles.css | 246 ++++++++++++++++++---- web/src/types.ts | 15 +- web/src/ui.tsx | 3 +- web/vite.config.ts | 2 + 39 files changed, 1511 insertions(+), 148 deletions(-) create mode 100755 Start Jig.command create mode 100644 cmd/jig/start.go create mode 100644 cmd/jig/start_test.go create mode 100644 internal/protocol/repair_chain_test.go delete mode 100644 web/dist/assets/index-CHcG2FfK.js create mode 100644 web/dist/assets/index-CZKUce6A.js create mode 100644 web/dist/assets/index-DvXXKdOR.css delete mode 100644 web/dist/assets/index-cy4ZRQX4.css create mode 100644 web/src/Tasks.test.tsx create mode 100644 web/src/Tasks.tsx create mode 100644 web/src/outcomes.test.ts create mode 100644 web/src/outcomes.ts create mode 100644 web/src/raw.d.ts create mode 100644 web/src/starters.ts diff --git a/README.md b/README.md index 9c47fb5..fc5c541 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ A definition is data, not a script. Five stock ones ship in | `smoke.yaml` | the install check: one read-only phase, repo-independent | | `scout.yaml` | read-only recon: two agent phases and the hand-off between them | | `two-phase.yaml` | an agent phase that writes, verified by a code phase | -| `plan-build-test.yaml` | a **code-phase repair edge**: a red suite routes back to the builder | +| `plan-build-test.yaml` | a **code-phase repair edge**: a red suite returns to planning, rebuilds, and retests | | `simple-sdlc.yaml` | an **agent-phase repair edge** (review → revise → re-review), a conditional retest, and per-phase commit messages | | `factory.yaml` | the **software factory**: plan → build → commit → test → a panel of specialist reviewers looping the builder until they approve, then a deterministic **risk gate** that holds high-risk work for a person | diff --git a/Start Jig.command b/Start Jig.command new file mode 100755 index 0000000..1ff5264 --- /dev/null +++ b/Start Jig.command @@ -0,0 +1,14 @@ +#!/bin/bash +set -euo pipefail +cd "$(dirname "$0")" +echo "Opening Jig…" +if ! go build -o bin/jig ./cmd/jig; then + echo "Jig could not build. Read the message above, then press Enter to close." + read -r + exit 1 +fi +if ! ./bin/jig start; then + echo "Jig could not start. Read the message above, then press Enter to close." + read -r + exit 1 +fi diff --git a/cmd/jig/definitions_test.go b/cmd/jig/definitions_test.go index 7066b63..310f43e 100644 --- a/cmd/jig/definitions_test.go +++ b/cmd/jig/definitions_test.go @@ -128,7 +128,7 @@ func TestPlanBuildTestPassesWhenTheBuildSatisfiesTheTestCommand(t *testing.T) { assertPhasesRan(t, traceEvents(t, report.TracePath), "plan", "build", "test") } -func TestPlanBuildTestRoutesAFailingSuiteBackToTheBuilderAndRerunsIt(t *testing.T) { +func TestPlanBuildTestReplansThenBuildsAndRetestsAFailingSuite(t *testing.T) { repo := makeFixture(t) scriptRuntime(t, map[string]any{"text": envelopeJSON(t, map[string]any{ @@ -145,6 +145,10 @@ func TestPlanBuildTestRoutesAFailingSuiteBackToTheBuilderAndRerunsIt(t *testing. }), }, // Dispatched by the edge with the failing adapter envelope in hand. + map[string]any{"text": envelopeJSON(t, map[string]any{ + "status": "success", "summary": "revised plan: create the missing marker", + "notes_for_next_agent": "create built.txt and preserve notes.txt", + })}, map[string]any{ "files": map[string]any{"built.txt": "ok\n"}, "text": envelopeJSON(t, map[string]any{ @@ -166,6 +170,9 @@ func TestPlanBuildTestRoutesAFailingSuiteBackToTheBuilderAndRerunsIt(t *testing. if entries := phaseStarts(events, "build"); entries != 2 { t.Fatalf("build ran %d time(s), want 2 (the original and the repair)", entries) } + if entries := phaseStarts(events, "plan"); entries != 2 { + t.Fatalf("plan ran %d time(s), want initial plan and repair plan", entries) + } if entries := phaseStarts(events, "test"); entries != 2 { t.Fatalf("test ran %d time(s), want 2 (the failure and the rerun)", entries) } diff --git a/cmd/jig/main.go b/cmd/jig/main.go index 7b2ddcf..68065af 100644 --- a/cmd/jig/main.go +++ b/cmd/jig/main.go @@ -24,6 +24,7 @@ var version = "dev" const usage = `jig — a local-first software factory Usage: + jig start Start the UI and Codex together and open your browser jig serve Start the control plane (loopback HTTP + embedded UI) jig worker Start the single implicit worker jig run Run a definition directly against a local repository @@ -51,6 +52,8 @@ func run(ctx context.Context, args []string) int { return 2 } switch args[0] { + case "start": + return startCommand(ctx, args[1:], os.Stdout, os.Stderr) case "run": return runCommand(ctx, args[1:], os.Stdout, os.Stderr) case "serve": diff --git a/cmd/jig/start.go b/cmd/jig/start.go new file mode 100644 index 0000000..e172c95 --- /dev/null +++ b/cmd/jig/start.go @@ -0,0 +1,150 @@ +package main + +import ( + "context" + "encoding/json" + "flag" + "fmt" + "io" + "net/http" + "os/exec" + "runtime" + "time" +) + +// Use the existing commands so startup preserves their cancellation and +// worker-drain behavior. Stop the worker before stopping an owned server. +func startCommand(ctx context.Context, args []string, stdout, stderr io.Writer) int { + flags := flag.NewFlagSet("jig start", flag.ContinueOnError) + flags.SetOutput(stderr) + noOpen := flags.Bool("no-open", false, "do not open the browser") + if err := flags.Parse(args); err != nil { + return exitUsage + } + if flags.NArg() != 0 { + fmt.Fprintln(stderr, "Usage: jig start [--no-open]") + return exitUsage + } + url := "http://" + defaultServerAuthority + client := &http.Client{Timeout: time.Second} + var heartbeatAfter time.Time + running, ready, err := localCodexReady(ctx, client, url, heartbeatAfter) + if err != nil { + fmt.Fprintln(stderr, "jig start:", err) + return exitInfraFailed + } + serverCtx, stopServer := context.WithCancel(context.WithoutCancel(ctx)) + defer stopServer() + var serverDone chan int + if !running { + // A restarted server retains recent heartbeats from stopped workers. + heartbeatAfter = time.Now() + fmt.Fprintln(stdout, "Starting Jig…") + serverDone = make(chan int, 1) + go func() { serverDone <- serveCommand(serverCtx, []string{"--no-github-poll"}, stdout, stderr) }() + defer func() { stopServer(); <-serverDone }() + } + workerCtx, stopWorker := context.WithCancel(context.WithoutCancel(ctx)) + defer stopWorker() + var workerDone chan int + defer func() { + if workerDone != nil { + stopWorker() + <-workerDone + } + }() + ticker := time.NewTicker(200 * time.Millisecond) + defer ticker.Stop() + deadline := time.NewTimer(30 * time.Second) + defer deadline.Stop() + for !ready { + if running && workerDone == nil { + fmt.Fprintln(stdout, "Starting your signed-in Codex worker…") + workerDone = make(chan int, 1) + go func() { workerDone <- workerCommand(workerCtx, []string{"--runtime", "codex"}, stdout, stderr) }() + } + select { + case <-ctx.Done(): + return exitAccepted + case code := <-serverDone: + serverDone <- code + return exitInfraFailed + case code := <-workerDone: + workerDone <- code + return exitInfraFailed + case <-deadline.C: + fmt.Fprintln(stderr, "Jig could not become ready in 30 seconds. Check the startup messages above.") + return exitInfraFailed + case <-ticker.C: + running, ready, err = localCodexReady(ctx, client, url, heartbeatAfter) + if err != nil { + fmt.Fprintln(stderr, "jig start:", err) + return exitInfraFailed + } + } + } + fmt.Fprintf(stdout, "Jig is ready: %s\nChoose a project, describe your task, and press Start task.\n", url) + if !*noOpen { + var command string + switch runtime.GOOS { + case "darwin": + command = "open" + case "linux": + command = "xdg-open" + } + if command != "" { + if err := exec.Command(command, url).Run(); err != nil { + fmt.Fprintln(stderr, "Open this address in your browser:", url) + } + } + } + if workerDone == nil && serverDone == nil { + return exitAccepted + } + fmt.Fprintln(stdout, "Leave this window open while using Jig. Press Ctrl+C to stop.") + select { + case <-ctx.Done(): + return exitAccepted + case code := <-workerDone: + workerDone <- code + return exitInfraFailed + case code := <-serverDone: + serverDone <- code + return exitInfraFailed + } +} + +func localCodexReady(ctx context.Context, client *http.Client, url string, heartbeatAfter time.Time) (running, ready bool, err error) { + req, err := http.NewRequestWithContext(ctx, http.MethodGet, url+"/api/workers", nil) + if err != nil { + return false, false, err + } + response, err := client.Do(req) + if err != nil { + return false, false, nil + } + defer response.Body.Close() + var fleet struct { + Workers []struct { + Live bool `json:"live"` + Heartbeat time.Time `json:"last_heartbeat"` + Runtimes []struct { + Name string `json:"name"` + } `json:"runtimes"` + } `json:"workers"` + } + if response.StatusCode != http.StatusOK { + return true, false, fmt.Errorf("port 8383 did not return Jig's worker status (%s)", response.Status) + } + if err := json.NewDecoder(io.LimitReader(response.Body, 1<<20)).Decode(&fleet); err != nil { + return true, false, fmt.Errorf("cannot read Jig worker status: %w", err) + } + for _, worker := range fleet.Workers { + for _, capability := range worker.Runtimes { + if worker.Live && capability.Name == "codex" && (heartbeatAfter.IsZero() || !worker.Heartbeat.Before(heartbeatAfter)) { + return true, true, nil + } + } + } + return true, false, nil +} diff --git a/cmd/jig/start_test.go b/cmd/jig/start_test.go new file mode 100644 index 0000000..753ae3a --- /dev/null +++ b/cmd/jig/start_test.go @@ -0,0 +1,47 @@ +package main + +import ( + "context" + "io" + "net/http" + "net/http/httptest" + "testing" + "time" +) + +func TestLocalCodexReady(t *testing.T) { + for _, test := range []struct { + name, body string + ready, bad bool + }{ + {"ready", `{"workers":[{"live":true,"runtimes":[{"name":"codex"}]}]}`, true, false}, + {"stale", `{"workers":[{"live":false,"runtimes":[{"name":"codex"}]}]}`, false, false}, + {"other runtime", `{"workers":[{"live":true,"runtimes":[{"name":"claude-code"}]}]}`, false, false}, + {"malformed", `another application`, false, true}, + } { + t.Run(test.name, func(t *testing.T) { + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Path != "/api/workers" { + t.Errorf("unexpected path %s", r.URL.Path) + } + io.WriteString(w, test.body) + })) + defer server.Close() + running, ready, err := localCodexReady(context.Background(), server.Client(), server.URL, time.Time{}) + if !running || ready != test.ready || (err != nil) != test.bad { + t.Fatalf("running=%t ready=%t err=%v", running, ready, err) + } + if test.ready { + _, ready, _ := localCodexReady(context.Background(), server.Client(), server.URL, time.Now()) + if ready { + t.Fatal("old worker heartbeat must not count after server restart") + } + } + }) + } + server := httptest.NewServer(http.NotFoundHandler()) + server.Close() + if running, _, err := localCodexReady(context.Background(), server.Client(), server.URL, time.Time{}); running || err != nil { + t.Fatalf("stopped server: running=%t err=%v", running, err) + } +} diff --git a/docs/quickstart.md b/docs/quickstart.md index 66b844c..50585a1 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -23,6 +23,37 @@ If that printed a version, the whole toolchain requirement is satisfied. The UI is committed and embedded, and the SQLite driver is pure Go, so there is no second build step and no native dependency to install. +## Use the UI with Codex + +On a Mac, double-click **Start Jig.command** in the project folder. It builds +Jig, starts the UI and your signed-in Codex worker, and opens the browser. +Leave its terminal window open while you work. Press Ctrl+C to stop the +services it started. Opening it again reuses an already-ready session. + +From a terminal, the equivalent is: + +```sh +./bin/jig start +``` + +Open . Choose a Git project folder or repository, +use **Let agents improve it**, and press **Start task**. The goal box is optional: +agents inspect the project, choose one useful improvement, and write the directive +and plan themselves. Choose **Get an answer** for read-only research or +**Make changes** when you already have a specific directive. +The UI creates the workflow for you; no YAML or run command is needed. + +Ask reads the project and returns an answer. Make a change runs +plan → build → test. Failed tests go back to planning, followed by another +build and test, for up to three repair rounds without waiting for human input. +Its results stay +in a separate working folder for review, with no automatic push or PR. +Work starts at the selected project's latest commit, so commit any changes +you want included before starting. **Options** lets you choose your Codex +model and a test command when automatic detection does not fit your project. +Codex uses its existing login; a ChatGPT login remains subject to your plan's +usage limits. + --- ## 2. The smoke run diff --git a/examples/definitions/plan-build-test.yaml b/examples/definitions/plan-build-test.yaml index ba86ac3..edd2f7a 100644 --- a/examples/definitions/plan-build-test.yaml +++ b/examples/definitions/plan-build-test.yaml @@ -1,7 +1,7 @@ # plan-build-test.yaml — the code-phase repair edge (U9, KTD2). Plan the # change, build it, then run the repository's own test command; a failing -# test suite routes its adapter envelope back to the builder and re-runs the -# suite, bounded by the edge's budget. +# test suite routes its adapter envelope back to the planner, runs the +# builder with the revised plan, and re-runs the suite, budget bounded. # # jig run --def examples/definitions/plan-build-test.yaml "add a --version flag" # @@ -9,8 +9,8 @@ # (R8), and the adapter envelope that carries the exit status and output tail # enters the repair loop through exactly the same door an agent's failing # report would — so "the tests broke" is a workflow state, not an incident. -# `budget: 2` bounds it and `exhausted: fail-job` means a suite that is still -# red after two repair rounds fails the job rather than shipping. +# `budget: 3` bounds it and `exhausted: fail-job` means a suite that is still +# red after three repair rounds fails the job rather than shipping. # # TWO THINGS TO EDIT before using this on your own repository: # @@ -43,6 +43,11 @@ roster: touch, in what order, and how the result will be verified by the repository's own test command. + If the previous report contains failed tests, diagnose that failure + and revise the plan before the builder runs again. Pass the failure + evidence and a concrete repair directive in notes_for_next_agent. + Preserve the user's scope. Never weaken tests to make them pass. + Your final JSON must also include: - "notes_for_next_agent": the plan itself, concrete enough to execute without re-deriving it @@ -63,6 +68,8 @@ roster: The plan and any previous phase's report are above. Make the change, then stop — the test suite runs as its own phase. + On repairs, report all paths changed relative to the original commit, + including changes already present from the previous build. Your final JSON must also include: - "changed_files": the repo-relative paths of every file you @@ -89,5 +96,5 @@ phases: elif [ -f go.mod ]; then go test ./...; elif [ -f package.json ]; then npm test --silent; else echo "plan-build-test: no test command detected — edit the test phase"; exit 1; fi - on_fail: {run: build, then: rerun-self, budget: 2, exhausted: fail-job} + on_fail: {run: plan, then: rerun-chain, budget: 3, exhausted: fail-job} acceptance: [all_phases_passed, artifacts_exist, diff_matches_claims] diff --git a/internal/engine/phase.go b/internal/engine/phase.go index 4160be7..f71900c 100644 --- a/internal/engine/phase.go +++ b/internal/engine/phase.go @@ -616,15 +616,40 @@ func (e *execution) runPhaseWithEdge( return &chainEnd{endFailed, fmt.Sprintf( "phase %q: repair target %q missing from frozen snapshot", phase.Name, edge.Run)}, nil } - repairRun := e.runPhaseOnce(ctx, repairPhase, run.envelopeRef()) - if end := repairRun.attemptEnd(); end != nil { - return end, nil + repairPhases := []protocol.PhaseSpec{repairPhase} + if edge.Then == protocol.RepairThenRerunChain { + repairPhases = nil + collect := false + for _, candidate := range e.spec.Phases { + if candidate.Name == phase.Name { + break + } + if candidate.Name == edge.Run { + collect = true + } + if collect { + repairPhases = append(repairPhases, candidate) + } + } } - if repairRun.outcome == phaseFailed { - return &chainEnd{endFailed, fmt.Sprintf( - "repair phase %q: %s", repairPhase.Name, repairRun.failure)}, nil + previous = run.envelopeRef() + for _, repairPhase := range repairPhases { + if edge.Then == protocol.RepairThenRerunChain && repairPhase.If != "" && !guardHolds(repairPhase.If, e.fieldView) { + e.recordResult(protocol.PhaseResult{Phase: repairPhase.Name, Kind: repairPhase.Kind, Status: phaseStatusSkipped}) + continue + } + e.freshenLease(ctx) + repairRun := e.runPhaseOnce(ctx, repairPhase, previous) + if end := repairRun.attemptEnd(); end != nil { + return end, nil + } + if repairRun.outcome == phaseFailed { + return &chainEnd{endFailed, fmt.Sprintf("repair phase %q: %s", repairPhase.Name, repairRun.failure)}, nil + } + if repairRun.hasEnvelope { + previous = repairRun.envelopeRef() + } } - previous = repairRun.envelopeRef() // then: rerun-self. } } diff --git a/internal/engine/phase_test.go b/internal/engine/phase_test.go index 3832d6f..764288d 100644 --- a/internal/engine/phase_test.go +++ b/internal/engine/phase_test.go @@ -299,6 +299,69 @@ roster: writes: ["src/"] ` +func TestFailedTestsReplanBuildAndRetestWithoutHumanInput(t *testing.T) { + for _, fixed := range []bool{true, false} { + t.Run(fmt.Sprintf("fixed=%t", fixed), func(t *testing.T) { + repo := initRepo(t) + files := map[string]string{} + if fixed { + files["src/fixed.txt"] = "ok" + } + fake := enginetest.New( + enginetest.Step{Text: envelope(map[string]any{"status": "success", "summary": "initial plan"})}, + enginetest.Step{Text: envelope(map[string]any{"status": "success", "summary": "initial build"})}, + enginetest.Step{Text: envelope(map[string]any{"status": "success", "summary": "revised plan", "notes_for_next_agent": "Create src/fixed.txt to repair the failed test."})}, + enginetest.Step{Files: files, Text: envelope(map[string]any{"status": "success", "summary": "repair build"})}, + ) + runner := newTestRunner(t, fake, &recordingSink{}, nil) + snapshot := "name: t\n" + repairRoster + ` +phases: + - {name: plan, kind: agent, owner: builder} + - {name: build, kind: agent, owner: builder} + - name: test + kind: code + command: "test -f src/fixed.txt" + on_fail: {run: plan, then: rerun-chain, budget: 1, exhausted: fail-job} +acceptance: [all_phases_passed] +` + outcome := runner.Execute(context.Background(), testAttempt(snapshot, nil, repo)) + want := protocol.AttemptFailed + if fixed { + want = protocol.AttemptAcceptedUnpublished + } + if outcome.State != want { + t.Fatalf("state=%s error=%s", outcome.State, outcome.Error) + } + calls := fake.Calls() + if len(calls) != 4 { + t.Fatalf("agent calls=%d, want plan/build/plan/build", len(calls)) + } + if !strings.Contains(calls[2].Prompt, `"exit_code":1`) && !strings.Contains(calls[2].Prompt, `"exit_code": 1`) { + t.Fatal("planner did not receive failing test evidence") + } + if !strings.Contains(calls[3].Prompt, "Create src/fixed.txt") { + t.Fatal("builder did not receive revised plan") + } + var result struct { + Phases []protocol.PhaseResult `json:"phases"` + } + if err := json.Unmarshal([]byte(outcome.Result), &result); err != nil { + t.Fatal(err) + } + var phases []string + for _, phase := range result.Phases { + phases = append(phases, phase.Phase) + } + if strings.Join(phases, ",") != "plan,build,test,plan,build,test" { + t.Fatalf("wrong execution order: %v", phases) + } + if !fixed && !strings.Contains(outcome.Error, "repair budget") { + t.Fatalf("missing exhaustion reason: %s", outcome.Error) + } + }) + } +} + func TestCodePhaseFailureRoutesAdapterEnvelopeThroughItsRepairEdge(t *testing.T) { repo := initRepo(t) fake := enginetest.New( diff --git a/internal/protocol/definition.go b/internal/protocol/definition.go index d749a06..6772ecd 100644 --- a/internal/protocol/definition.go +++ b/internal/protocol/definition.go @@ -36,7 +36,8 @@ var builtinGates = map[string]bool{ // Repair-edge continuation and exhaustion policies (KTD2). const ( - RepairThenRerunSelf = "rerun-self" + RepairThenRerunSelf = "rerun-self" + RepairThenRerunChain = "rerun-chain" RepairExhaustedFailJob = "fail-job" RepairExhaustedProceed = "proceed" @@ -194,6 +195,8 @@ type GateSpec struct { // Failure that triggers the edge is nonzero exit for code phases and the // declared When envelope predicate for agent phases. Budget bounds the loop; // an edge without a positive budget is rejected at save time. +// then: rerun-chain runs the target and every intervening phase before +// retesting the failed phase; its target must precede the failed phase. type RepairEdge struct { When string `yaml:"when"` Run string `yaml:"run"` @@ -435,9 +438,24 @@ func (spec *DefinitionSpec) validateRepairEdge(phase PhaseSpec, phases map[strin "phase %q: repair edge targets itself — rerun-self already reruns the failed phase", phase.Name) } - if edge.Then != RepairThenRerunSelf { - return fmt.Errorf("phase %q: repair edge \"then\" must be %q, got %q", - phase.Name, RepairThenRerunSelf, edge.Then) + if edge.Then != RepairThenRerunSelf && edge.Then != RepairThenRerunChain { + return fmt.Errorf("phase %q: repair edge \"then\" must be %q or %q, got %q", + phase.Name, RepairThenRerunSelf, RepairThenRerunChain, edge.Then) + } + if edge.Then == RepairThenRerunChain { + found := false + for _, candidate := range spec.Phases { + if candidate.Name == phase.Name { + break + } + if candidate.Name == edge.Run { + found = true + break + } + } + if !found { + return fmt.Errorf("phase %q: rerun-chain target %q must precede the failed phase", phase.Name, edge.Run) + } } if edge.Budget <= 0 { return fmt.Errorf( diff --git a/internal/protocol/repair_chain_test.go b/internal/protocol/repair_chain_test.go new file mode 100644 index 0000000..4fb0ec1 --- /dev/null +++ b/internal/protocol/repair_chain_test.go @@ -0,0 +1,28 @@ +package protocol + +import ( + "strings" + "testing" +) + +func TestRepairChainRequiresAnEarlierTargetAndPositiveBudget(t *testing.T) { + source := `name: repair-chain +phases: + - {name: plan, kind: code, command: "true"} + - {name: build, kind: code, command: "true"} + - name: test + kind: code + command: "false" + on_fail: {run: plan, then: rerun-chain, budget: 1, exhausted: fail-job} + - {name: later, kind: code, command: "true"} +acceptance: [all_phases_passed] +` + if _, err := ParseDefinition([]byte(source)); err != nil { + t.Fatal(err) + } + for _, invalid := range []string{strings.Replace(source, "run: plan", "run: later", 1), strings.Replace(source, "budget: 1", "budget: 0", 1)} { + if _, err := ParseDefinition([]byte(invalid)); err == nil { + t.Fatal("invalid repair chain accepted") + } + } +} diff --git a/web/dist/assets/index-CHcG2FfK.js b/web/dist/assets/index-CHcG2FfK.js deleted file mode 100644 index 1d4934b..0000000 --- a/web/dist/assets/index-CHcG2FfK.js +++ /dev/null @@ -1,9 +0,0 @@ -(function(){const v=document.createElement("link").relList;if(v&&v.supports&&v.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))o(M);new MutationObserver(M=>{for(const N of M)if(N.type==="childList")for(const U of N.addedNodes)U.tagName==="LINK"&&U.rel==="modulepreload"&&o(U)}).observe(document,{childList:!0,subtree:!0});function p(M){const N={};return M.integrity&&(N.integrity=M.integrity),M.referrerPolicy&&(N.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?N.credentials="include":M.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function o(M){if(M.ep)return;M.ep=!0;const N=p(M);fetch(M.href,N)}})();var Sf={exports:{}},Nu={};var Oh;function v0(){if(Oh)return Nu;Oh=1;var f=Symbol.for("react.transitional.element"),v=Symbol.for("react.fragment");function p(o,M,N){var U=null;if(N!==void 0&&(U=""+N),M.key!==void 0&&(U=""+M.key),"key"in M){N={};for(var w in M)w!=="key"&&(N[w]=M[w])}else N=M;return M=N.ref,{$$typeof:f,type:o,key:U,ref:M!==void 0?M:null,props:N}}return Nu.Fragment=v,Nu.jsx=p,Nu.jsxs=p,Nu}var Nh;function y0(){return Nh||(Nh=1,Sf.exports=v0()),Sf.exports}var s=y0(),bf={exports:{}},L={};var Dh;function g0(){if(Dh)return L;Dh=1;var f=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),U=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),T=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),Z=Symbol.iterator;function gl(r){return r===null||typeof r!="object"?null:(r=Z&&r[Z]||r["@@iterator"],typeof r=="function"?r:null)}var Y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},el=Object.assign,dl={};function cl(r,A,R){this.props=r,this.context=A,this.refs=dl,this.updater=R||Y}cl.prototype.isReactComponent={},cl.prototype.setState=function(r,A){if(typeof r!="object"&&typeof r!="function"&&r!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,r,A,"setState")},cl.prototype.forceUpdate=function(r){this.updater.enqueueForceUpdate(this,r,"forceUpdate")};function Et(){}Et.prototype=cl.prototype;function Dl(r,A,R){this.props=r,this.context=A,this.refs=dl,this.updater=R||Y}var dt=Dl.prototype=new Et;dt.constructor=Dl,el(dt,cl.prototype),dt.isPureReactComponent=!0;var Mt=Array.isArray;function Zl(){}var ll={H:null,A:null,T:null,S:null},Ll=Object.prototype.hasOwnProperty;function xt(r,A,R){var C=R.ref;return{$$typeof:f,type:r,key:A,ref:C!==void 0?C:null,props:R}}function ke(r,A){return xt(r.type,A,r.props)}function Ot(r){return typeof r=="object"&&r!==null&&r.$$typeof===f}function Vl(r){var A={"=":"=0",":":"=2"};return"$"+r.replace(/[=:]/g,function(R){return A[R]})}var Ae=/\/+/g;function qt(r,A){return typeof r=="object"&&r!==null&&r.key!=null?Vl(""+r.key):A.toString(36)}function Tt(r){switch(r.status){case"fulfilled":return r.value;case"rejected":throw r.reason;default:switch(typeof r.status=="string"?r.then(Zl,Zl):(r.status="pending",r.then(function(A){r.status==="pending"&&(r.status="fulfilled",r.value=A)},function(A){r.status==="pending"&&(r.status="rejected",r.reason=A)})),r.status){case"fulfilled":return r.value;case"rejected":throw r.reason}}throw r}function E(r,A,R,C,V){var $=typeof r;($==="undefined"||$==="boolean")&&(r=null);var il=!1;if(r===null)il=!0;else switch($){case"bigint":case"string":case"number":il=!0;break;case"object":switch(r.$$typeof){case f:case v:il=!0;break;case H:return il=r._init,E(il(r._payload),A,R,C,V)}}if(il)return V=V(r),il=C===""?"."+qt(r,0):C,Mt(V)?(R="",il!=null&&(R=il.replace(Ae,"$&/")+"/"),E(V,A,R,"",function(Ba){return Ba})):V!=null&&(Ot(V)&&(V=ke(V,R+(V.key==null||r&&r.key===V.key?"":(""+V.key).replace(Ae,"$&/")+"/")+il)),A.push(V)),1;il=0;var Ql=C===""?".":C+":";if(Mt(r))for(var Tl=0;Tl>>1,vl=E[ol];if(0>>1;olM(R,X))CM(V,R)?(E[ol]=V,E[C]=X,ol=C):(E[ol]=R,E[A]=X,ol=A);else if(CM(V,X))E[ol]=V,E[C]=X,ol=C;else break l}}return D}function M(E,D){var X=E.sortIndex-D.sortIndex;return X!==0?X:E.id-D.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;f.unstable_now=function(){return N.now()}}else{var U=Date,w=U.now();f.unstable_now=function(){return U.now()-w}}var O=[],T=[],H=1,x=null,Z=3,gl=!1,Y=!1,el=!1,dl=!1,cl=typeof setTimeout=="function"?setTimeout:null,Et=typeof clearTimeout=="function"?clearTimeout:null,Dl=typeof setImmediate<"u"?setImmediate:null;function dt(E){for(var D=p(T);D!==null;){if(D.callback===null)o(T);else if(D.startTime<=E)o(T),D.sortIndex=D.expirationTime,v(O,D);else break;D=p(T)}}function Mt(E){if(el=!1,dt(E),!Y)if(p(O)!==null)Y=!0,Zl||(Zl=!0,Vl());else{var D=p(T);D!==null&&Tt(Mt,D.startTime-E)}}var Zl=!1,ll=-1,Ll=5,xt=-1;function ke(){return dl?!0:!(f.unstable_now()-xtE&&ke());){var ol=x.callback;if(typeof ol=="function"){x.callback=null,Z=x.priorityLevel;var vl=ol(x.expirationTime<=E);if(E=f.unstable_now(),typeof vl=="function"){x.callback=vl,dt(E),D=!0;break t}x===p(O)&&o(O),dt(E)}else o(O);x=p(O)}if(x!==null)D=!0;else{var r=p(T);r!==null&&Tt(Mt,r.startTime-E),D=!1}}break l}finally{x=null,Z=X,gl=!1}D=void 0}}finally{D?Vl():Zl=!1}}}var Vl;if(typeof Dl=="function")Vl=function(){Dl(Ot)};else if(typeof MessageChannel<"u"){var Ae=new MessageChannel,qt=Ae.port2;Ae.port1.onmessage=Ot,Vl=function(){qt.postMessage(null)}}else Vl=function(){cl(Ot,0)};function Tt(E,D){ll=cl(function(){E(f.unstable_now())},D)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(E){E.callback=null},f.unstable_forceFrameRate=function(E){0>E||125ol?(E.sortIndex=X,v(T,E),p(O)===null&&E===p(T)&&(el?(Et(ll),ll=-1):el=!0,Tt(Mt,X-ol))):(E.sortIndex=vl,v(O,E),Y||gl||(Y=!0,Zl||(Zl=!0,Vl()))),E},f.unstable_shouldYield=ke,f.unstable_wrapCallback=function(E){var D=Z;return function(){var X=Z;Z=D;try{return E.apply(this,arguments)}finally{Z=X}}}})(Ef)),Ef}var Hh;function b0(){return Hh||(Hh=1,zf.exports=S0()),zf.exports}var Tf={exports:{}},Gl={};var qh;function p0(){if(qh)return Gl;qh=1;var f=jf();function v(O){var T="https://react.dev/errors/"+O;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(v){console.error(v)}}return f(),Tf.exports=p0(),Tf.exports}var Bh;function E0(){if(Bh)return Du;Bh=1;var f=b0(),v=jf(),p=z0();function o(l){var t="https://react.dev/errors/"+l;if(1vl||(l.current=ol[vl],ol[vl]=null,vl--)}function R(l,t){vl++,ol[vl]=l.current,l.current=t}var C=r(null),V=r(null),$=r(null),il=r(null);function Ql(l,t){switch(R($,t),R(V,l),R(C,null),t.nodeType){case 9:case 11:l=(l=t.documentElement)&&(l=l.namespaceURI)?Io(l):0;break;default:if(l=t.tagName,t=t.namespaceURI)t=Io(t),l=Po(t,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}A(C),R(C,l)}function Tl(){A(C),A(V),A($)}function Ba(l){l.memoizedState!==null&&R(il,l);var t=C.current,e=Po(t,l.type);t!==e&&(R(V,l),R(C,e))}function Hu(l){V.current===l&&(A(C),A(V)),il.current===l&&(A(il),Au._currentValue=X)}var Pn,Mf;function Me(l){if(Pn===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Pn=t&&t[1]||"",Mf=-1)":-1u||d[a]!==g[u]){var z=` -`+d[a].replace(" at new "," at ");return l.displayName&&z.includes("")&&(z=z.replace("",l.displayName)),z}while(1<=a&&0<=u);break}}}finally{lc=!1,Error.prepareStackTrace=e}return(e=l?l.displayName||l.name:"")?Me(e):""}function Jh(l,t){switch(l.tag){case 26:case 27:case 5:return Me(l.type);case 16:return Me("Lazy");case 13:return l.child!==t&&t!==null?Me("Suspense Fallback"):Me("Suspense");case 19:return Me("SuspenseList");case 0:case 15:return tc(l.type,!1);case 11:return tc(l.type.render,!1);case 1:return tc(l.type,!0);case 31:return Me("Activity");default:return""}}function xf(l){try{var t="",e=null;do t+=Jh(l,e),e=l,l=l.return;while(l);return t}catch(a){return` -Error generating stack: `+a.message+` -`+a.stack}}var ec=Object.prototype.hasOwnProperty,ac=f.unstable_scheduleCallback,uc=f.unstable_cancelCallback,wh=f.unstable_shouldYield,$h=f.unstable_requestPaint,Pl=f.unstable_now,Wh=f.unstable_getCurrentPriorityLevel,Of=f.unstable_ImmediatePriority,Nf=f.unstable_UserBlockingPriority,qu=f.unstable_NormalPriority,kh=f.unstable_LowPriority,Df=f.unstable_IdlePriority,Fh=f.log,Ih=f.unstable_setDisableYieldValue,Ya=null,lt=null;function le(l){if(typeof Fh=="function"&&Ih(l),lt&&typeof lt.setStrictMode=="function")try{lt.setStrictMode(Ya,l)}catch{}}var tt=Math.clz32?Math.clz32:tr,Ph=Math.log,lr=Math.LN2;function tr(l){return l>>>=0,l===0?32:31-(Ph(l)/lr|0)|0}var Cu=256,Bu=262144,Yu=4194304;function xe(l){var t=l&42;if(t!==0)return t;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Gu(l,t,e){var a=l.pendingLanes;if(a===0)return 0;var u=0,n=l.suspendedLanes,c=l.pingedLanes;l=l.warmLanes;var i=a&134217727;return i!==0?(a=i&~n,a!==0?u=xe(a):(c&=i,c!==0?u=xe(c):e||(e=i&~l,e!==0&&(u=xe(e))))):(i=a&~n,i!==0?u=xe(i):c!==0?u=xe(c):e||(e=a&~l,e!==0&&(u=xe(e)))),u===0?0:t!==0&&t!==u&&(t&n)===0&&(n=u&-u,e=t&-t,n>=e||n===32&&(e&4194048)!==0)?t:u}function Ga(l,t){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&t)===0}function er(l,t){switch(l){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Uf(){var l=Yu;return Yu<<=1,(Yu&62914560)===0&&(Yu=4194304),l}function nc(l){for(var t=[],e=0;31>e;e++)t.push(l);return t}function Qa(l,t){l.pendingLanes|=t,t!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function ar(l,t,e,a,u,n){var c=l.pendingLanes;l.pendingLanes=e,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=e,l.entangledLanes&=e,l.errorRecoveryDisabledLanes&=e,l.shellSuspendCounter=0;var i=l.entanglements,d=l.expirationTimes,g=l.hiddenUpdates;for(e=c&~e;0"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var sr=/[\n"\\]/g;function ht(l){return l.replace(sr,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function oc(l,t,e,a,u,n,c,i){l.name="",c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"?l.type=c:l.removeAttribute("type"),t!=null?c==="number"?(t===0&&l.value===""||l.value!=t)&&(l.value=""+ot(t)):l.value!==""+ot(t)&&(l.value=""+ot(t)):c!=="submit"&&c!=="reset"||l.removeAttribute("value"),t!=null?hc(l,c,ot(t)):e!=null?hc(l,c,ot(e)):a!=null&&l.removeAttribute("value"),u==null&&n!=null&&(l.defaultChecked=!!n),u!=null&&(l.checked=u&&typeof u!="function"&&typeof u!="symbol"),i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?l.name=""+ot(i):l.removeAttribute("name")}function Kf(l,t,e,a,u,n,c,i){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(l.type=n),t!=null||e!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){dc(l);return}e=e!=null?""+ot(e):"",t=t!=null?""+ot(t):e,i||t===l.value||(l.value=t),l.defaultValue=t}a=a??u,a=typeof a!="function"&&typeof a!="symbol"&&!!a,l.checked=i?l.checked:!!a,l.defaultChecked=!!a,c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(l.name=c),dc(l)}function hc(l,t,e){t==="number"&&Zu(l.ownerDocument)===l||l.defaultValue===""+e||(l.defaultValue=""+e)}function ea(l,t,e,a){if(l=l.options,t){t={};for(var u=0;u"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gc=!1;if(Yt)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){gc=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{gc=!1}var ee=null,Sc=null,Vu=null;function If(){if(Vu)return Vu;var l,t=Sc,e=t.length,a,u="value"in ee?ee.value:ee.textContent,n=u.length;for(l=0;l=wa),us=" ",ns=!1;function cs(l,t){switch(l){case"keyup":return Br.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function is(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var ca=!1;function Gr(l,t){switch(l){case"compositionend":return is(t);case"keypress":return t.which!==32?null:(ns=!0,us);case"textInput":return l=t.data,l===us&&ns?null:l;default:return null}}function Qr(l,t){if(ca)return l==="compositionend"||!Tc&&cs(l,t)?(l=If(),Vu=Sc=ee=null,ca=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:e,offset:t-l};l=a}l:{for(;e;){if(e.nextSibling){e=e.nextSibling;break l}e=e.parentNode}e=void 0}e=vs(e)}}function gs(l,t){return l&&t?l===t?!0:l&&l.nodeType===3?!1:t&&t.nodeType===3?gs(l,t.parentNode):"contains"in l?l.contains(t):l.compareDocumentPosition?!!(l.compareDocumentPosition(t)&16):!1:!1}function Ss(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var t=Zu(l.document);t instanceof l.HTMLIFrameElement;){try{var e=typeof t.contentWindow.location.href=="string"}catch{e=!1}if(e)l=t.contentWindow;else break;t=Zu(l.document)}return t}function Ac(l){var t=l&&l.nodeName&&l.nodeName.toLowerCase();return t&&(t==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||t==="textarea"||l.contentEditable==="true")}var $r=Yt&&"documentMode"in document&&11>=document.documentMode,ia=null,Mc=null,Fa=null,xc=!1;function bs(l,t,e){var a=e.window===e?e.document:e.nodeType===9?e:e.ownerDocument;xc||ia==null||ia!==Zu(a)||(a=ia,"selectionStart"in a&&Ac(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Fa&&ka(Fa,a)||(Fa=a,a=Yn(Mc,"onSelect"),0>=c,u-=c,Nt=1<<32-tt(t)+u|e<J?(I=B,B=null):I=B.sibling;var ul=S(m,B,y[J],j);if(ul===null){B===null&&(B=I);break}l&&B&&ul.alternate===null&&t(m,B),h=n(ul,h,J),al===null?G=ul:al.sibling=ul,al=ul,B=I}if(J===y.length)return e(m,B),tl&&Qt(m,J),G;if(B===null){for(;JJ?(I=B,B=null):I=B.sibling;var je=S(m,B,ul.value,j);if(je===null){B===null&&(B=I);break}l&&B&&je.alternate===null&&t(m,B),h=n(je,h,J),al===null?G=je:al.sibling=je,al=je,B=I}if(ul.done)return e(m,B),tl&&Qt(m,J),G;if(B===null){for(;!ul.done;J++,ul=y.next())ul=_(m,ul.value,j),ul!==null&&(h=n(ul,h,J),al===null?G=ul:al.sibling=ul,al=ul);return tl&&Qt(m,J),G}for(B=a(B);!ul.done;J++,ul=y.next())ul=b(B,m,J,ul.value,j),ul!==null&&(l&&ul.alternate!==null&&B.delete(ul.key===null?J:ul.key),h=n(ul,h,J),al===null?G=ul:al.sibling=ul,al=ul);return l&&B.forEach(function(m0){return t(m,m0)}),tl&&Qt(m,J),G}function ml(m,h,y,j){if(typeof y=="object"&&y!==null&&y.type===el&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case gl:l:{for(var G=y.key;h!==null;){if(h.key===G){if(G=y.type,G===el){if(h.tag===7){e(m,h.sibling),j=u(h,y.props.children),j.return=m,m=j;break l}}else if(h.elementType===G||typeof G=="object"&&G!==null&&G.$$typeof===Ll&&Ge(G)===h.type){e(m,h.sibling),j=u(h,y.props),au(j,y),j.return=m,m=j;break l}e(m,h);break}else t(m,h);h=h.sibling}y.type===el?(j=He(y.props.children,m.mode,j,y.key),j.return=m,m=j):(j=ln(y.type,y.key,y.props,null,m.mode,j),au(j,y),j.return=m,m=j)}return c(m);case Y:l:{for(G=y.key;h!==null;){if(h.key===G)if(h.tag===4&&h.stateNode.containerInfo===y.containerInfo&&h.stateNode.implementation===y.implementation){e(m,h.sibling),j=u(h,y.children||[]),j.return=m,m=j;break l}else{e(m,h);break}else t(m,h);h=h.sibling}j=qc(y,m.mode,j),j.return=m,m=j}return c(m);case Ll:return y=Ge(y),ml(m,h,y,j)}if(Tt(y))return q(m,h,y,j);if(Vl(y)){if(G=Vl(y),typeof G!="function")throw Error(o(150));return y=G.call(y),Q(m,h,y,j)}if(typeof y.then=="function")return ml(m,h,fn(y),j);if(y.$$typeof===Dl)return ml(m,h,an(m,y),j);sn(m,y)}return typeof y=="string"&&y!==""||typeof y=="number"||typeof y=="bigint"?(y=""+y,h!==null&&h.tag===6?(e(m,h.sibling),j=u(h,y),j.return=m,m=j):(e(m,h),j=Hc(y,m.mode,j),j.return=m,m=j),c(m)):e(m,h)}return function(m,h,y,j){try{eu=0;var G=ml(m,h,y,j);return Sa=null,G}catch(B){if(B===ga||B===nn)throw B;var al=at(29,B,null,m.mode);return al.lanes=j,al.return=m,al}}}var Xe=Zs(!0),Ls=Zs(!1),ie=!1;function wc(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $c(l,t){l=l.updateQueue,t.updateQueue===l&&(t.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function fe(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function se(l,t,e){var a=l.updateQueue;if(a===null)return null;if(a=a.shared,(nl&2)!==0){var u=a.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),a.pending=t,t=Pu(l),As(l,null,e),t}return Iu(l,a,t,e),Pu(l)}function uu(l,t,e){if(t=t.updateQueue,t!==null&&(t=t.shared,(e&4194048)!==0)){var a=t.lanes;a&=l.pendingLanes,e|=a,t.lanes=e,Hf(l,e)}}function Wc(l,t){var e=l.updateQueue,a=l.alternate;if(a!==null&&(a=a.updateQueue,e===a)){var u=null,n=null;if(e=e.firstBaseUpdate,e!==null){do{var c={lane:e.lane,tag:e.tag,payload:e.payload,callback:null,next:null};n===null?u=n=c:n=n.next=c,e=e.next}while(e!==null);n===null?u=n=t:n=n.next=t}else u=n=t;e={baseState:a.baseState,firstBaseUpdate:u,lastBaseUpdate:n,shared:a.shared,callbacks:a.callbacks},l.updateQueue=e;return}l=e.lastBaseUpdate,l===null?e.firstBaseUpdate=t:l.next=t,e.lastBaseUpdate=t}var kc=!1;function nu(){if(kc){var l=ya;if(l!==null)throw l}}function cu(l,t,e,a){kc=!1;var u=l.updateQueue;ie=!1;var n=u.firstBaseUpdate,c=u.lastBaseUpdate,i=u.shared.pending;if(i!==null){u.shared.pending=null;var d=i,g=d.next;d.next=null,c===null?n=g:c.next=g,c=d;var z=l.alternate;z!==null&&(z=z.updateQueue,i=z.lastBaseUpdate,i!==c&&(i===null?z.firstBaseUpdate=g:i.next=g,z.lastBaseUpdate=d))}if(n!==null){var _=u.baseState;c=0,z=g=d=null,i=n;do{var S=i.lane&-536870913,b=S!==i.lane;if(b?(F&S)===S:(a&S)===S){S!==0&&S===va&&(kc=!0),z!==null&&(z=z.next={lane:0,tag:i.tag,payload:i.payload,callback:null,next:null});l:{var q=l,Q=i;S=t;var ml=e;switch(Q.tag){case 1:if(q=Q.payload,typeof q=="function"){_=q.call(ml,_,S);break l}_=q;break l;case 3:q.flags=q.flags&-65537|128;case 0:if(q=Q.payload,S=typeof q=="function"?q.call(ml,_,S):q,S==null)break l;_=x({},_,S);break l;case 2:ie=!0}}S=i.callback,S!==null&&(l.flags|=64,b&&(l.flags|=8192),b=u.callbacks,b===null?u.callbacks=[S]:b.push(S))}else b={lane:S,tag:i.tag,payload:i.payload,callback:i.callback,next:null},z===null?(g=z=b,d=_):z=z.next=b,c|=S;if(i=i.next,i===null){if(i=u.shared.pending,i===null)break;b=i,i=b.next,b.next=null,u.lastBaseUpdate=b,u.shared.pending=null}}while(!0);z===null&&(d=_),u.baseState=d,u.firstBaseUpdate=g,u.lastBaseUpdate=z,n===null&&(u.shared.lanes=0),me|=c,l.lanes=c,l.memoizedState=_}}function Vs(l,t){if(typeof l!="function")throw Error(o(191,l));l.call(t)}function Ks(l,t){var e=l.callbacks;if(e!==null)for(l.callbacks=null,l=0;ln?n:8;var c=E.T,i={};E.T=i,vi(l,!1,t,e);try{var d=u(),g=E.S;if(g!==null&&g(i,d),d!==null&&typeof d=="object"&&typeof d.then=="function"){var z=am(d,a);su(l,t,z,ft(l))}else su(l,t,a,ft(l))}catch(_){su(l,t,{then:function(){},status:"rejected",reason:_},ft())}finally{D.p=n,c!==null&&i.types!==null&&(c.types=i.types),E.T=c}}function sm(){}function ri(l,t,e,a){if(l.tag!==5)throw Error(o(476));var u=Td(l).queue;Ed(l,u,t,X,e===null?sm:function(){return jd(l),e(a)})}function Td(l){var t=l.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vt,lastRenderedState:X},next:null};var e={};return t.next={memoizedState:e,baseState:e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vt,lastRenderedState:e},next:null},l.memoizedState=t,l=l.alternate,l!==null&&(l.memoizedState=t),t}function jd(l){var t=Td(l);t.next===null&&(t=l.alternate.memoizedState),su(l,t.next.queue,{},ft())}function mi(){return Cl(Au)}function _d(){return _l().memoizedState}function Ad(){return _l().memoizedState}function dm(l){for(var t=l.return;t!==null;){switch(t.tag){case 24:case 3:var e=ft();l=fe(e);var a=se(t,l,e);a!==null&&(Fl(a,t,e),uu(a,t,e)),t={cache:Lc()},l.payload=t;return}t=t.return}}function om(l,t,e){var a=ft();e={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null},bn(l)?xd(t,e):(e=Uc(l,t,e,a),e!==null&&(Fl(e,l,a),Od(e,t,a)))}function Md(l,t,e){var a=ft();su(l,t,e,a)}function su(l,t,e,a){var u={lane:a,revertLane:0,gesture:null,action:e,hasEagerState:!1,eagerState:null,next:null};if(bn(l))xd(t,u);else{var n=l.alternate;if(l.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var c=t.lastRenderedState,i=n(c,e);if(u.hasEagerState=!0,u.eagerState=i,et(i,c))return Iu(l,t,u,0),yl===null&&Fu(),!1}catch{}if(e=Uc(l,t,u,a),e!==null)return Fl(e,l,a),Od(e,t,a),!0}return!1}function vi(l,t,e,a){if(a={lane:2,revertLane:wi(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bn(l)){if(t)throw Error(o(479))}else t=Uc(l,e,a,2),t!==null&&Fl(t,l,2)}function bn(l){var t=l.alternate;return l===K||t!==null&&t===K}function xd(l,t){pa=hn=!0;var e=l.pending;e===null?t.next=t:(t.next=e.next,e.next=t),l.pending=t}function Od(l,t,e){if((e&4194048)!==0){var a=t.lanes;a&=l.pendingLanes,e|=a,t.lanes=e,Hf(l,e)}}var du={readContext:Cl,use:vn,useCallback:zl,useContext:zl,useEffect:zl,useImperativeHandle:zl,useLayoutEffect:zl,useInsertionEffect:zl,useMemo:zl,useReducer:zl,useRef:zl,useState:zl,useDebugValue:zl,useDeferredValue:zl,useTransition:zl,useSyncExternalStore:zl,useId:zl,useHostTransitionStatus:zl,useFormState:zl,useActionState:zl,useOptimistic:zl,useMemoCache:zl,useCacheRefresh:zl};du.useEffectEvent=zl;var Nd={readContext:Cl,use:vn,useCallback:function(l,t){return Xl().memoizedState=[l,t===void 0?null:t],l},useContext:Cl,useEffect:rd,useImperativeHandle:function(l,t,e){e=e!=null?e.concat([l]):null,gn(4194308,4,gd.bind(null,t,l),e)},useLayoutEffect:function(l,t){return gn(4194308,4,l,t)},useInsertionEffect:function(l,t){gn(4,2,l,t)},useMemo:function(l,t){var e=Xl();t=t===void 0?null:t;var a=l();if(Ze){le(!0);try{l()}finally{le(!1)}}return e.memoizedState=[a,t],a},useReducer:function(l,t,e){var a=Xl();if(e!==void 0){var u=e(t);if(Ze){le(!0);try{e(t)}finally{le(!1)}}}else u=t;return a.memoizedState=a.baseState=u,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:u},a.queue=l,l=l.dispatch=om.bind(null,K,l),[a.memoizedState,l]},useRef:function(l){var t=Xl();return l={current:l},t.memoizedState=l},useState:function(l){l=fi(l);var t=l.queue,e=Md.bind(null,K,t);return t.dispatch=e,[l.memoizedState,e]},useDebugValue:oi,useDeferredValue:function(l,t){var e=Xl();return hi(e,l,t)},useTransition:function(){var l=fi(!1);return l=Ed.bind(null,K,l.queue,!0,!1),Xl().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,t,e){var a=K,u=Xl();if(tl){if(e===void 0)throw Error(o(407));e=e()}else{if(e=t(),yl===null)throw Error(o(349));(F&127)!==0||Fs(a,t,e)}u.memoizedState=e;var n={value:e,getSnapshot:t};return u.queue=n,rd(Ps.bind(null,a,n,l),[l]),a.flags|=2048,Ea(9,{destroy:void 0},Is.bind(null,a,n,e,t),null),e},useId:function(){var l=Xl(),t=yl.identifierPrefix;if(tl){var e=Dt,a=Nt;e=(a&~(1<<32-tt(a)-1)).toString(32)+e,t="_"+t+"R_"+e,e=rn++,0<\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof a.is=="string"?c.createElement("select",{is:a.is}):c.createElement("select"),a.multiple?n.multiple=!0:a.size&&(n.size=a.size);break;default:n=typeof a.is=="string"?c.createElement(u,{is:a.is}):c.createElement(u)}}n[Hl]=t,n[Kl]=a;l:for(c=t.child;c!==null;){if(c.tag===5||c.tag===6)n.appendChild(c.stateNode);else if(c.tag!==4&&c.tag!==27&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===t)break l;for(;c.sibling===null;){if(c.return===null||c.return===t)break l;c=c.return}c.sibling.return=c.return,c=c.sibling}t.stateNode=n;l:switch(Yl(n,u,a),u){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break l;case"img":a=!0;break l;default:a=!1}a&&Jt(t)}}return bl(t),Oi(t,t.type,l===null?null:l.memoizedProps,t.pendingProps,e),null;case 6:if(l&&t.stateNode!=null)l.memoizedProps!==a&&Jt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(o(166));if(l=$.current,ra(t)){if(l=t.stateNode,e=t.memoizedProps,a=null,u=ql,u!==null)switch(u.tag){case 27:case 5:a=u.memoizedProps}l[Hl]=t,l=!!(l.nodeValue===e||a!==null&&a.suppressHydrationWarning===!0||ko(l.nodeValue,e)),l||ne(t,!0)}else l=Gn(l).createTextNode(a),l[Hl]=t,t.stateNode=l}return bl(t),null;case 31:if(e=t.memoizedState,l===null||l.memoizedState!==null){if(a=ra(t),e!==null){if(l===null){if(!a)throw Error(o(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(o(557));l[Hl]=t}else qe(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bl(t),l=!1}else e=Gc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=e),l=!0;if(!l)return t.flags&256?(nt(t),t):(nt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return bl(t),null;case 13:if(a=t.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(u=ra(t),a!==null&&a.dehydrated!==null){if(l===null){if(!u)throw Error(o(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(o(317));u[Hl]=t}else qe(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;bl(t),u=!1}else u=Gc(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(nt(t),t):(nt(t),null)}return nt(t),(t.flags&128)!==0?(t.lanes=e,t):(e=a!==null,l=l!==null&&l.memoizedState!==null,e&&(a=t.child,u=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(u=a.alternate.memoizedState.cachePool.pool),n=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(n=a.memoizedState.cachePool.pool),n!==u&&(a.flags|=2048)),e!==l&&e&&(t.child.flags|=8192),jn(t,t.updateQueue),bl(t),null);case 4:return Tl(),l===null&&Fi(t.stateNode.containerInfo),bl(t),null;case 10:return Zt(t.type),bl(t),null;case 19:if(A(jl),a=t.memoizedState,a===null)return bl(t),null;if(u=(t.flags&128)!==0,n=a.rendering,n===null)if(u)hu(a,!1);else{if(El!==0||l!==null&&(l.flags&128)!==0)for(l=t.child;l!==null;){if(n=on(l),n!==null){for(t.flags|=128,hu(a,!1),l=n.updateQueue,t.updateQueue=l,jn(t,l),t.subtreeFlags=0,l=e,e=t.child;e!==null;)Ms(e,l),e=e.sibling;return R(jl,jl.current&1|2),tl&&Qt(t,a.treeForkCount),t.child}l=l.sibling}a.tail!==null&&Pl()>On&&(t.flags|=128,u=!0,hu(a,!1),t.lanes=4194304)}else{if(!u)if(l=on(n),l!==null){if(t.flags|=128,u=!0,l=l.updateQueue,t.updateQueue=l,jn(t,l),hu(a,!0),a.tail===null&&a.tailMode==="hidden"&&!n.alternate&&!tl)return bl(t),null}else 2*Pl()-a.renderingStartTime>On&&e!==536870912&&(t.flags|=128,u=!0,hu(a,!1),t.lanes=4194304);a.isBackwards?(n.sibling=t.child,t.child=n):(l=a.last,l!==null?l.sibling=n:t.child=n,a.last=n)}return a.tail!==null?(l=a.tail,a.rendering=l,a.tail=l.sibling,a.renderingStartTime=Pl(),l.sibling=null,e=jl.current,R(jl,u?e&1|2:e&1),tl&&Qt(t,a.treeForkCount),l):(bl(t),null);case 22:case 23:return nt(t),Ic(),a=t.memoizedState!==null,l!==null?l.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(e&536870912)!==0&&(t.flags&128)===0&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),e=t.updateQueue,e!==null&&jn(t,e.retryQueue),e=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(e=l.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==e&&(t.flags|=2048),l!==null&&A(Ye),null;case 24:return e=null,l!==null&&(e=l.memoizedState.cache),t.memoizedState.cache!==e&&(t.flags|=2048),Zt(Al),bl(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function ym(l,t){switch(Bc(t),t.tag){case 1:return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 3:return Zt(Al),Tl(),l=t.flags,(l&65536)!==0&&(l&128)===0?(t.flags=l&-65537|128,t):null;case 26:case 27:case 5:return Hu(t),null;case 31:if(t.memoizedState!==null){if(nt(t),t.alternate===null)throw Error(o(340));qe()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 13:if(nt(t),l=t.memoizedState,l!==null&&l.dehydrated!==null){if(t.alternate===null)throw Error(o(340));qe()}return l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 19:return A(jl),null;case 4:return Tl(),null;case 10:return Zt(t.type),null;case 22:case 23:return nt(t),Ic(),l!==null&&A(Ye),l=t.flags,l&65536?(t.flags=l&-65537|128,t):null;case 24:return Zt(Al),null;case 25:return null;default:return null}}function lo(l,t){switch(Bc(t),t.tag){case 3:Zt(Al),Tl();break;case 26:case 27:case 5:Hu(t);break;case 4:Tl();break;case 31:t.memoizedState!==null&&nt(t);break;case 13:nt(t);break;case 19:A(jl);break;case 10:Zt(t.type);break;case 22:case 23:nt(t),Ic(),l!==null&&A(Ye);break;case 24:Zt(Al)}}function ru(l,t){try{var e=t.updateQueue,a=e!==null?e.lastEffect:null;if(a!==null){var u=a.next;e=u;do{if((e.tag&l)===l){a=void 0;var n=e.create,c=e.inst;a=n(),c.destroy=a}e=e.next}while(e!==u)}}catch(i){sl(t,t.return,i)}}function he(l,t,e){try{var a=t.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var n=u.next;a=n;do{if((a.tag&l)===l){var c=a.inst,i=c.destroy;if(i!==void 0){c.destroy=void 0,u=t;var d=e,g=i;try{g()}catch(z){sl(u,d,z)}}}a=a.next}while(a!==n)}}catch(z){sl(t,t.return,z)}}function to(l){var t=l.updateQueue;if(t!==null){var e=l.stateNode;try{Ks(t,e)}catch(a){sl(l,l.return,a)}}}function eo(l,t,e){e.props=Le(l.type,l.memoizedProps),e.state=l.memoizedState;try{e.componentWillUnmount()}catch(a){sl(l,t,a)}}function mu(l,t){try{var e=l.ref;if(e!==null){switch(l.tag){case 26:case 27:case 5:var a=l.stateNode;break;case 30:a=l.stateNode;break;default:a=l.stateNode}typeof e=="function"?l.refCleanup=e(a):e.current=a}}catch(u){sl(l,t,u)}}function Ut(l,t){var e=l.ref,a=l.refCleanup;if(e!==null)if(typeof a=="function")try{a()}catch(u){sl(l,t,u)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof e=="function")try{e(null)}catch(u){sl(l,t,u)}else e.current=null}function ao(l){var t=l.type,e=l.memoizedProps,a=l.stateNode;try{l:switch(t){case"button":case"input":case"select":case"textarea":e.autoFocus&&a.focus();break l;case"img":e.src?a.src=e.src:e.srcSet&&(a.srcset=e.srcSet)}}catch(u){sl(l,l.return,u)}}function Ni(l,t,e){try{var a=l.stateNode;Ym(a,l.type,e,t),a[Kl]=t}catch(u){sl(l,l.return,u)}}function uo(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&be(l.type)||l.tag===4}function Di(l){l:for(;;){for(;l.sibling===null;){if(l.return===null||uo(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&be(l.type)||l.flags&2||l.child===null||l.tag===4)continue l;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Ui(l,t,e){var a=l.tag;if(a===5||a===6)l=l.stateNode,t?(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e).insertBefore(l,t):(t=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,t.appendChild(l),e=e._reactRootContainer,e!=null||t.onclick!==null||(t.onclick=Bt));else if(a!==4&&(a===27&&be(l.type)&&(e=l.stateNode,t=null),l=l.child,l!==null))for(Ui(l,t,e),l=l.sibling;l!==null;)Ui(l,t,e),l=l.sibling}function _n(l,t,e){var a=l.tag;if(a===5||a===6)l=l.stateNode,t?e.insertBefore(l,t):e.appendChild(l);else if(a!==4&&(a===27&&be(l.type)&&(e=l.stateNode),l=l.child,l!==null))for(_n(l,t,e),l=l.sibling;l!==null;)_n(l,t,e),l=l.sibling}function no(l){var t=l.stateNode,e=l.memoizedProps;try{for(var a=l.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Yl(t,a,e),t[Hl]=l,t[Kl]=e}catch(n){sl(l,l.return,n)}}var wt=!1,Ol=!1,Ri=!1,co=typeof WeakSet=="function"?WeakSet:Set,Rl=null;function gm(l,t){if(l=l.containerInfo,lf=Jn,l=Ss(l),Ac(l)){if("selectionStart"in l)var e={start:l.selectionStart,end:l.selectionEnd};else l:{e=(e=l.ownerDocument)&&e.defaultView||window;var a=e.getSelection&&e.getSelection();if(a&&a.rangeCount!==0){e=a.anchorNode;var u=a.anchorOffset,n=a.focusNode;a=a.focusOffset;try{e.nodeType,n.nodeType}catch{e=null;break l}var c=0,i=-1,d=-1,g=0,z=0,_=l,S=null;t:for(;;){for(var b;_!==e||u!==0&&_.nodeType!==3||(i=c+u),_!==n||a!==0&&_.nodeType!==3||(d=c+a),_.nodeType===3&&(c+=_.nodeValue.length),(b=_.firstChild)!==null;)S=_,_=b;for(;;){if(_===l)break t;if(S===e&&++g===u&&(i=c),S===n&&++z===a&&(d=c),(b=_.nextSibling)!==null)break;_=S,S=_.parentNode}_=b}e=i===-1||d===-1?null:{start:i,end:d}}else e=null}e=e||{start:0,end:0}}else e=null;for(tf={focusedElem:l,selectionRange:e},Jn=!1,Rl=t;Rl!==null;)if(t=Rl,l=t.child,(t.subtreeFlags&1028)!==0&&l!==null)l.return=t,Rl=l;else for(;Rl!==null;){switch(t=Rl,n=t.alternate,l=t.flags,t.tag){case 0:if((l&4)!==0&&(l=t.updateQueue,l=l!==null?l.events:null,l!==null))for(e=0;e title"))),Yl(n,a,e),n[Hl]=l,Ul(n),a=n;break l;case"link":var c=rh("link","href",u).get(a+(e.href||""));if(c){for(var i=0;iml&&(c=ml,ml=Q,Q=c);var m=ys(i,Q),h=ys(i,ml);if(m&&h&&(b.rangeCount!==1||b.anchorNode!==m.node||b.anchorOffset!==m.offset||b.focusNode!==h.node||b.focusOffset!==h.offset)){var y=_.createRange();y.setStart(m.node,m.offset),b.removeAllRanges(),Q>ml?(b.addRange(y),b.extend(h.node,h.offset)):(y.setEnd(h.node,h.offset),b.addRange(y))}}}}for(_=[],b=i;b=b.parentNode;)b.nodeType===1&&_.push({element:b,left:b.scrollLeft,top:b.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<_.length;i++){var j=_[i];j.element.scrollLeft=j.left,j.element.scrollTop=j.top}}Jn=!!lf,tf=lf=null}finally{nl=u,D.p=a,E.T=e}}l.current=t,Nl=2}}function Ho(){if(Nl===2){Nl=0;var l=ye,t=Ma,e=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||e){e=E.T,E.T=null;var a=D.p;D.p=2;var u=nl;nl|=4;try{io(l,t.alternate,t)}finally{nl=u,D.p=a,E.T=e}}Nl=3}}function qo(){if(Nl===4||Nl===3){Nl=0,$h();var l=ye,t=Ma,e=It,a=zo;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nl=5:(Nl=0,Ma=ye=null,Co(l,l.pendingLanes));var u=l.pendingLanes;if(u===0&&(ve=null),ic(e),t=t.stateNode,lt&&typeof lt.onCommitFiberRoot=="function")try{lt.onCommitFiberRoot(Ya,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=E.T,u=D.p,D.p=2,E.T=null;try{for(var n=l.onRecoverableError,c=0;ce?32:e,E.T=null,e=Qi,Qi=null;var n=ye,c=It;if(Nl=0,Ma=ye=null,It=0,(nl&6)!==0)throw Error(o(331));var i=nl;if(nl|=4,So(n.current),vo(n,n.current,c,e),nl=i,pu(0,!1),lt&&typeof lt.onPostCommitFiberRoot=="function")try{lt.onPostCommitFiberRoot(Ya,n)}catch{}return!0}finally{D.p=u,E.T=a,Co(l,t)}}function Yo(l,t,e){t=mt(e,t),t=bi(l.stateNode,t,2),l=se(l,t,2),l!==null&&(Qa(l,2),Rt(l))}function sl(l,t,e){if(l.tag===3)Yo(l,l,e);else for(;t!==null;){if(t.tag===3){Yo(t,l,e);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(ve===null||!ve.has(a))){l=mt(e,l),e=Yd(2),a=se(t,e,2),a!==null&&(Gd(e,a,t,l),Qa(a,2),Rt(a));break}}t=t.return}}function Vi(l,t,e){var a=l.pingCache;if(a===null){a=l.pingCache=new pm;var u=new Set;a.set(t,u)}else u=a.get(t),u===void 0&&(u=new Set,a.set(t,u));u.has(e)||(Ci=!0,u.add(e),l=_m.bind(null,l,t,e),t.then(l,l))}function _m(l,t,e){var a=l.pingCache;a!==null&&a.delete(t),l.pingedLanes|=l.suspendedLanes&e,l.warmLanes&=~e,yl===l&&(F&e)===e&&(El===4||El===3&&(F&62914560)===F&&300>Pl()-xn?(nl&2)===0&&xa(l,0):Bi|=e,Aa===F&&(Aa=0)),Rt(l)}function Go(l,t){t===0&&(t=Uf()),l=Re(l,t),l!==null&&(Qa(l,t),Rt(l))}function Am(l){var t=l.memoizedState,e=0;t!==null&&(e=t.retryLane),Go(l,e)}function Mm(l,t){var e=0;switch(l.tag){case 31:case 13:var a=l.stateNode,u=l.memoizedState;u!==null&&(e=u.retryLane);break;case 19:a=l.stateNode;break;case 22:a=l.stateNode._retryCache;break;default:throw Error(o(314))}a!==null&&a.delete(t),Go(l,e)}function xm(l,t){return ac(l,t)}var qn=null,Na=null,Ki=!1,Cn=!1,Ji=!1,Se=0;function Rt(l){l!==Na&&l.next===null&&(Na===null?qn=Na=l:Na=Na.next=l),Cn=!0,Ki||(Ki=!0,Nm())}function pu(l,t){if(!Ji&&Cn){Ji=!0;do for(var e=!1,a=qn;a!==null;){if(l!==0){var u=a.pendingLanes;if(u===0)var n=0;else{var c=a.suspendedLanes,i=a.pingedLanes;n=(1<<31-tt(42|l)+1)-1,n&=u&~(c&~i),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(e=!0,Lo(a,n))}else n=F,n=Gu(a,a===yl?n:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(n&3)===0||Ga(a,n)||(e=!0,Lo(a,n));a=a.next}while(e);Ji=!1}}function Om(){Qo()}function Qo(){Cn=Ki=!1;var l=0;Se!==0&&Qm()&&(l=Se);for(var t=Pl(),e=null,a=qn;a!==null;){var u=a.next,n=Xo(a,t);n===0?(a.next=null,e===null?qn=u:e.next=u,u===null&&(Na=e)):(e=a,(l!==0||(n&3)!==0)&&(Cn=!0)),a=u}Nl!==0&&Nl!==5||pu(l),Se!==0&&(Se=0)}function Xo(l,t){for(var e=l.suspendedLanes,a=l.pingedLanes,u=l.expirationTimes,n=l.pendingLanes&-62914561;0i)break;var z=d.transferSize,_=d.initiatorType;z&&Fo(_)&&(d=d.responseEnd,c+=z*(d"u"?null:document;function sh(l,t,e){var a=Da;if(a&&typeof t=="string"&&t){var u=ht(t);u='link[rel="'+l+'"][href="'+u+'"]',typeof e=="string"&&(u+='[crossorigin="'+e+'"]'),fh.has(u)||(fh.add(u),l={rel:l,crossOrigin:e,href:t},a.querySelector(u)===null&&(t=a.createElement("link"),Yl(t,"link",l),Ul(t),a.head.appendChild(t)))}}function Wm(l){Pt.D(l),sh("dns-prefetch",l,null)}function km(l,t){Pt.C(l,t),sh("preconnect",l,t)}function Fm(l,t,e){Pt.L(l,t,e);var a=Da;if(a&&l&&t){var u='link[rel="preload"][as="'+ht(t)+'"]';t==="image"&&e&&e.imageSrcSet?(u+='[imagesrcset="'+ht(e.imageSrcSet)+'"]',typeof e.imageSizes=="string"&&(u+='[imagesizes="'+ht(e.imageSizes)+'"]')):u+='[href="'+ht(l)+'"]';var n=u;switch(t){case"style":n=Ua(l);break;case"script":n=Ra(l)}pt.has(n)||(l=x({rel:"preload",href:t==="image"&&e&&e.imageSrcSet?void 0:l,as:t},e),pt.set(n,l),a.querySelector(u)!==null||t==="style"&&a.querySelector(ju(n))||t==="script"&&a.querySelector(_u(n))||(t=a.createElement("link"),Yl(t,"link",l),Ul(t),a.head.appendChild(t)))}}function Im(l,t){Pt.m(l,t);var e=Da;if(e&&l){var a=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+ht(a)+'"][href="'+ht(l)+'"]',n=u;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ra(l)}if(!pt.has(n)&&(l=x({rel:"modulepreload",href:l},t),pt.set(n,l),e.querySelector(u)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(e.querySelector(_u(n)))return}a=e.createElement("link"),Yl(a,"link",l),Ul(a),e.head.appendChild(a)}}}function Pm(l,t,e){Pt.S(l,t,e);var a=Da;if(a&&l){var u=la(a).hoistableStyles,n=Ua(l);t=t||"default";var c=u.get(n);if(!c){var i={loading:0,preload:null};if(c=a.querySelector(ju(n)))i.loading=5;else{l=x({rel:"stylesheet",href:l,"data-precedence":t},e),(e=pt.get(n))&&sf(l,e);var d=c=a.createElement("link");Ul(d),Yl(d,"link",l),d._p=new Promise(function(g,z){d.onload=g,d.onerror=z}),d.addEventListener("load",function(){i.loading|=1}),d.addEventListener("error",function(){i.loading|=2}),i.loading|=4,Xn(c,t,a)}c={type:"stylesheet",instance:c,count:1,state:i},u.set(n,c)}}}function l0(l,t){Pt.X(l,t);var e=Da;if(e&&l){var a=la(e).hoistableScripts,u=Ra(l),n=a.get(u);n||(n=e.querySelector(_u(u)),n||(l=x({src:l,async:!0},t),(t=pt.get(u))&&df(l,t),n=e.createElement("script"),Ul(n),Yl(n,"link",l),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function t0(l,t){Pt.M(l,t);var e=Da;if(e&&l){var a=la(e).hoistableScripts,u=Ra(l),n=a.get(u);n||(n=e.querySelector(_u(u)),n||(l=x({src:l,async:!0,type:"module"},t),(t=pt.get(u))&&df(l,t),n=e.createElement("script"),Ul(n),Yl(n,"link",l),e.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},a.set(u,n))}}function dh(l,t,e,a){var u=(u=$.current)?Qn(u):null;if(!u)throw Error(o(446));switch(l){case"meta":case"title":return null;case"style":return typeof e.precedence=="string"&&typeof e.href=="string"?(t=Ua(e.href),e=la(u).hoistableStyles,a=e.get(t),a||(a={type:"style",instance:null,count:0,state:null},e.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(e.rel==="stylesheet"&&typeof e.href=="string"&&typeof e.precedence=="string"){l=Ua(e.href);var n=la(u).hoistableStyles,c=n.get(l);if(c||(u=u.ownerDocument||u,c={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(l,c),(n=u.querySelector(ju(l)))&&!n._p&&(c.instance=n,c.state.loading=5),pt.has(l)||(e={rel:"preload",as:"style",href:e.href,crossOrigin:e.crossOrigin,integrity:e.integrity,media:e.media,hrefLang:e.hrefLang,referrerPolicy:e.referrerPolicy},pt.set(l,e),n||e0(u,l,e,c.state))),t&&a===null)throw Error(o(528,""));return c}if(t&&a!==null)throw Error(o(529,""));return null;case"script":return t=e.async,e=e.src,typeof e=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ra(e),e=la(u).hoistableScripts,a=e.get(t),a||(a={type:"script",instance:null,count:0,state:null},e.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,l))}}function Ua(l){return'href="'+ht(l)+'"'}function ju(l){return'link[rel="stylesheet"]['+l+"]"}function oh(l){return x({},l,{"data-precedence":l.precedence,precedence:null})}function e0(l,t,e,a){l.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=l.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Yl(t,"link",e),Ul(t),l.head.appendChild(t))}function Ra(l){return'[src="'+ht(l)+'"]'}function _u(l){return"script[async]"+l}function hh(l,t,e){if(t.count++,t.instance===null)switch(t.type){case"style":var a=l.querySelector('style[data-href~="'+ht(e.href)+'"]');if(a)return t.instance=a,Ul(a),a;var u=x({},e,{"data-href":e.href,"data-precedence":e.precedence,href:null,precedence:null});return a=(l.ownerDocument||l).createElement("style"),Ul(a),Yl(a,"style",u),Xn(a,e.precedence,l),t.instance=a;case"stylesheet":u=Ua(e.href);var n=l.querySelector(ju(u));if(n)return t.state.loading|=4,t.instance=n,Ul(n),n;a=oh(e),(u=pt.get(u))&&sf(a,u),n=(l.ownerDocument||l).createElement("link"),Ul(n);var c=n;return c._p=new Promise(function(i,d){c.onload=i,c.onerror=d}),Yl(n,"link",a),t.state.loading|=4,Xn(n,e.precedence,l),t.instance=n;case"script":return n=Ra(e.src),(u=l.querySelector(_u(n)))?(t.instance=u,Ul(u),u):(a=e,(u=pt.get(n))&&(a=x({},e),df(a,u)),l=l.ownerDocument||l,u=l.createElement("script"),Ul(u),Yl(u,"link",a),l.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,Xn(a,e.precedence,l));return t.instance}function Xn(l,t,e){for(var a=e.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=a.length?a[a.length-1]:null,n=u,c=0;c title"):null)}function a0(l,t,e){if(e===1||t.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(l=t.disabled,typeof t.precedence=="string"&&l==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function vh(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function u0(l,t,e,a){if(e.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(e.state.loading&4)===0){if(e.instance===null){var u=Ua(a.href),n=t.querySelector(ju(u));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(l.count++,l=Ln.bind(l),t.then(l,l)),e.state.loading|=4,e.instance=n,Ul(n);return}n=t.ownerDocument||t,a=oh(a),(u=pt.get(u))&&sf(a,u),n=n.createElement("link"),Ul(n);var c=n;c._p=new Promise(function(i,d){c.onload=i,c.onerror=d}),Yl(n,"link",a),e.instance=n}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(e,t),(t=e.state.preload)&&(e.state.loading&3)===0&&(l.count++,e=Ln.bind(l),t.addEventListener("load",e),t.addEventListener("error",e))}}var of=0;function n0(l,t){return l.stylesheets&&l.count===0&&Kn(l,l.stylesheets),0of?50:800)+t);return l.unsuspend=e,function(){l.unsuspend=null,clearTimeout(a),clearTimeout(u)}}:null}function Ln(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kn(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var Vn=null;function Kn(l,t){l.stylesheets=null,l.unsuspend!==null&&(l.count++,Vn=new Map,t.forEach(c0,l),Vn=null,Ln.call(l))}function c0(l,t){if(!(t.state.loading&4)){var e=Vn.get(l);if(e)var a=e.get(null);else{e=new Map,Vn.set(l,e);for(var u=l.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(v){console.error(v)}}return f(),pf.exports=E0(),pf.exports}var j0=T0();class Qh extends Error{constructor(v,p,o){super(p),this.code=v,this.status=o,this.name="APIError"}code;status}async function st(f,v){const p=await fetch(f,{...v,headers:v?.body?{"Content-Type":"application/json",...v.headers}:v?.headers});if(!p.ok){let o;try{o=await p.json()}catch{}throw new Qh(o?.error?.code??"request_failed",o?.error?.message??`Request failed with status ${p.status}`,p.status)}if(p.status!==204)return await p.json()}const zt={queue:()=>st("/api/queue"),runs:()=>st("/api/runs").then(f=>f??[]),run:f=>st(`/api/runs/${encodeURIComponent(f)}`),job:f=>st(`/api/jobs/${encodeURIComponent(f)}`),attempt:f=>st(`/api/attempts/${encodeURIComponent(f)}`),attemptEvents:(f,v,p=200)=>st(`/api/attempts/${encodeURIComponent(f)}/events?after=${v}&limit=${p}`),attemptGates:f=>st(`/api/attempts/${encodeURIComponent(f)}/gates`).then(v=>v??[]),attemptEnvelopes:f=>st(`/api/attempts/${encodeURIComponent(f)}/envelopes`).then(v=>v??[]),fleet:()=>st("/api/workers"),worktrees:()=>st("/api/worktrees").then(f=>f??[]),releaseWorktree:f=>st(`/api/worktrees/${encodeURIComponent(f)}/release`,{method:"POST",body:JSON.stringify({confirm:!0})}),retryJob:f=>st(`/api/jobs/${encodeURIComponent(f)}/retry`,{method:"POST"}),cancelJob:f=>st(`/api/jobs/${encodeURIComponent(f)}/cancel`,{method:"POST"})};function _0(f){if(!f)return null;try{const v=JSON.parse(f);return typeof v=="object"&&v!==null?v:null}catch{return null}}function Je(f){if(!f)return null;const v=Date.parse(f);return Number.isNaN(v)?null:v}function Ru(f){if(!Number.isFinite(f)||f<0)return"—";if(f<1e3)return`${Math.round(f)}ms`;const v=f/1e3;if(v<60)return`${v.toFixed(v<10?1:0)}s`;const p=Math.floor(v/60),o=Math.round(v-p*60);if(p<60)return`${p}m ${o}s`;const M=Math.floor(p/60);return`${M}h ${p-M*60}m`}function we(f){const v=Je(f);return v===null?"—":new Date(v).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Uu(f){return f.length>12?`${f.slice(0,8)}…`:f}const A0=new Set(["accepted","accepted_unpublished","failed","cancelled","lost"]);function Xh(f){return A0.has(f)}function M0(f){return f.replace(/_/g," ")}function _f(){const[f,v]=P.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return P.useEffect(()=>{const p=()=>v(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",p),()=>document.removeEventListener("visibilitychange",p)},[]),f}function Zh(f=1e3){const[v,p]=P.useState(()=>Date.now()),o=_f();return P.useEffect(()=>{if(!o||f<=0)return;const M=setInterval(()=>p(Date.now()),f);return()=>clearInterval(M)},[f,o]),v}function _e(f,v,p){const[o,M]=P.useState(null),[N,U]=P.useState(null),[w,O]=P.useState(!0),[T,H]=P.useState(0),x=_f(),Z=P.useRef(f);Z.current=f,P.useEffect(()=>{M(null),O(!0),U(null)},[p]),P.useEffect(()=>{let Y=!1;const el=async()=>{try{const cl=await Z.current();if(Y)return;M(cl),U(null)}catch(cl){Y||U(cl)}finally{Y||O(!1)}};if(el(),!x||v<=0)return()=>{Y=!0};const dl=setInterval(el,v);return()=>{Y=!0,clearInterval(dl)}},[p,v,x,T]);const gl=P.useCallback(()=>H(Y=>Y+1),[]);return{data:o,error:N,loading:w,refresh:gl}}function x0(f,v,p=1e3){const[o,M]=P.useState([]),[N,U]=P.useState(null),w=P.useRef(0),O=P.useRef(0),[T,H]=P.useState(0),x=_f(),Z=Xh(v);return P.useEffect(()=>{w.current=0,O.current=0,H(0),M([]),U(null)},[f]),P.useEffect(()=>{let gl=!1,Y=null;const el=async()=>{try{const dl=await zt.attemptEvents(f,w.current);if(gl)return;const cl=dl.events??[];if(U(null),cl.length===0){O.current+=1,Z&&O.current>=2&&Y&&(clearInterval(Y),Y=null);return}O.current=0;const Et=Math.max(w.current,dl.next_cursor);w.current=Et,H(Et),M(Dl=>O0(Dl,cl))}catch(dl){gl||U(dl)}};return el(),x&&p>0&&(Y=setInterval(()=>{el()},p)),()=>{gl=!0,Y&&clearInterval(Y)}},[f,Z,p,x]),{events:o,cursor:T,error:N}}function O0(f,v){if(v.length===0)return f;const p=new Map;for(const o of f)p.set(o.seq,o);for(const o of v)p.has(o.seq)||p.set(o.seq,o);return[...p.values()].sort((o,M)=>o.seq-M.seq)}function N0(f){const v=f.split("/").filter(Boolean);return v.length===0?{name:"queue"}:v[0]==="runs"&&v.length===1?{name:"runs"}:v[0]==="runs"&&v.length===2?{name:"run",id:decodeURIComponent(v[1])}:v[0]==="jobs"&&v.length===2?{name:"job",id:decodeURIComponent(v[1])}:v[0]==="worktrees"&&v.length===1?{name:"worktrees"}:v[0]==="fleet"&&v.length===1?{name:"fleet"}:{name:"unknown",path:f}}function D0(f){window.history.pushState({},"",f),window.dispatchEvent(new PopStateEvent("popstate"))}function U0(){const[f,v]=P.useState(()=>window.location.pathname);return P.useEffect(()=>{const p=()=>v(window.location.pathname);return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[]),N0(f)}function $e({state:f}){return s.jsxs("span",{className:`badge badge-${f}`,children:[s.jsx("span",{className:"dot"}),M0(f)]})}function Ht({href:f,children:v}){return s.jsx("a",{href:f,onClick:p=>{p.metaKey||p.ctrlKey||p.shiftKey||(p.preventDefault(),D0(f))},children:v})}function Il({error:f}){if(!f)return null;const v=f instanceof Qh?f.code:"request_failed";return s.jsxs("div",{className:"error-banner",role:"alert",children:[s.jsx("strong",{children:v})," ",f.message]})}function We({title:f,detail:v}){return s.jsxs("div",{className:"empty",children:[s.jsx("h2",{children:f}),s.jsx("p",{children:v})]})}function Ca({label:f}){return s.jsx("div",{className:"loading",role:"status",children:f})}function R0(f,v){const p=Je(v),o=Je(f.last_heartbeat);return p===null||o===null?"—":`${Ru(Math.max(p-o,0))} ago`}function H0(f){const v=f.runtimes??[];return v.length===0?"—":v.map(p=>`${p.name} ${p.version}`).join(", ")}function q0(){const f=P.useCallback(()=>zt.fleet(),[]),{data:v,error:p,loading:o}=_e(f,3e3,"fleet");if(o&&!v)return s.jsx(Ca,{label:"Loading fleet…"});if(!v)return s.jsx(Il,{error:p});const M=v.workers??[],N=M.filter(U=>!U.live).reduce((U,w)=>U+w.active_count,0);return s.jsxs("div",{className:"view",children:[s.jsxs("header",{className:"view-header",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Worker fleet"}),s.jsxs("p",{className:"subtle",children:["Observed ",we(v.observed_at)]})]}),s.jsxs("div",{className:"counters",children:[s.jsxs("div",{className:"counter",children:[s.jsx("span",{className:"counter-value",children:v.live_count}),s.jsx("span",{className:"counter-label",children:"live"})]}),s.jsxs("div",{className:"counter",children:[s.jsx("span",{className:"counter-value",children:v.stale_count}),s.jsx("span",{className:"counter-label",children:"stale"})]}),s.jsxs("div",{className:"counter",children:[s.jsx("span",{className:"counter-value",children:v.available_slots}),s.jsx("span",{className:"counter-label",children:"free slots"})]})]})]}),s.jsx(Il,{error:p}),M.length===0?s.jsx(We,{title:"No workers registered",detail:"Nothing can claim queued work until a worker registers. Start one with `jig worker`."}):s.jsxs(s.Fragment,{children:[s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Worker"}),s.jsx("th",{children:"State"}),s.jsx("th",{children:"Runtime"}),s.jsx("th",{children:"Slots"}),s.jsx("th",{children:"Env"}),s.jsx("th",{children:"Last heartbeat"})]})}),s.jsx("tbody",{children:M.map(U=>s.jsxs("tr",{children:[s.jsxs("td",{children:[U.name,s.jsxs("p",{className:"subtle",children:[s.jsx("code",{children:U.id})," · ",U.worker_version]})]}),s.jsx("td",{children:s.jsx($e,{state:U.live?"live":"stale"})}),s.jsx("td",{children:H0(U)}),s.jsxs("td",{children:[U.active_count," / ",U.capacity]}),s.jsxs("td",{title:(U.env_names??[]).join(" "),children:[(U.env_names??[]).length," names"]}),s.jsx("td",{children:R0(U,v.observed_at)})]},U.id))})]}),N>0&&s.jsxs("p",{className:"subtle",children:[N," attempt",N===1?" is":"s are"," leased to a worker that stopped heartbeating. The sweeper marks them lost after three missed beats of server uptime, and their jobs are then retryable."]})]})]})}function C0(){const f=P.useCallback(()=>zt.queue(),[]),{data:v,error:p,loading:o}=_e(f,2e3,"queue");if(o&&!v)return s.jsx(Ca,{label:"Loading queue…"});if(!v)return s.jsx(Il,{error:p});const M=v.entries??[];return s.jsxs("div",{className:"view",children:[s.jsxs("header",{className:"view-header",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Work queue"}),s.jsxs("p",{className:"subtle",children:["Observed ",we(v.observed_at)]})]}),s.jsxs("div",{className:"counters",children:[s.jsxs("div",{className:"counter",children:[s.jsx("span",{className:"counter-value",children:v.depth}),s.jsx("span",{className:"counter-label",children:"queued"})]}),s.jsxs("div",{className:"counter",children:[s.jsx("span",{className:"counter-value",children:v.active_count}),s.jsx("span",{className:"counter-label",children:"running"})]})]})]}),s.jsx(Il,{error:p}),M.length===0?s.jsx(We,{title:"Nothing queued",detail:"No job is waiting or running right now."}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"#"}),s.jsx("th",{children:"Repository"}),s.jsx("th",{children:"Definition"}),s.jsx("th",{children:"State"}),s.jsx("th",{children:"Attempt"}),s.jsx("th",{children:"Enqueued"})]})}),s.jsx("tbody",{children:M.map(N=>s.jsxs("tr",{children:[s.jsx("td",{children:N.position??"—"}),s.jsx("td",{children:s.jsx(Ht,{href:`/jobs/${N.job_id}`,children:N.repository})}),s.jsx("td",{children:N.definition??"—"}),s.jsx("td",{children:s.jsx($e,{state:N.state})}),s.jsx("td",{children:N.attempt?s.jsxs(s.Fragment,{children:["#",N.attempt.attempt_number," ",s.jsx($e,{state:N.attempt.state})]}):"—"}),s.jsx("td",{children:we(N.enqueued_at)})]},N.job_id))})]})]})}function B0(){const f=P.useCallback(()=>zt.runs(),[]),{data:v,error:p,loading:o}=_e(f,4e3,"runs");return o&&!v?s.jsx(Ca,{label:"Loading runs…"}):v?s.jsxs("div",{className:"view",children:[s.jsx("header",{className:"view-header",children:s.jsx("h1",{children:"Runs"})}),s.jsx(Il,{error:p}),v.length===0?s.jsx(We,{title:"No runs",detail:"Invoke a definition to admit one."}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Run"}),s.jsx("th",{children:"Targets"}),s.jsx("th",{children:"State"}),s.jsx("th",{children:"Created"})]})}),s.jsx("tbody",{children:v.map(M=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Ht,{href:`/runs/${M.id}`,children:Uu(M.id)})}),s.jsx("td",{children:M.targets.map(N=>N.repository).join(", ")}),s.jsx("td",{children:s.jsx($e,{state:M.state})}),s.jsx("td",{children:we(M.created_at)})]},M.id))})]})]}):s.jsx(Il,{error:p})}function Gh(f,v){return Je(f.started_at)??v}function qa(f,v){const p=f.payload;if(!p||typeof p!="object")return;const o=p[v];return typeof o=="string"?o:void 0}function Y0(f,v){const p=[...v].sort((Y,el)=>Y.seq-el.seq),o=Je(f.started_at)??Je(f.created_at)??0,M=p.length?Gh(p[0],o):o,N=Math.min(o||M,M),U=[],w=[],O=[],T=new Map;let H=null,x=N;const Z=Y=>{H&&H.endMs===null&&(H.endMs=Math.max(Y,H.startMs)),H=null};for(const Y of p){const el=Gh(Y,x);x=Math.max(x,el);const dl=Y.phase??"";switch(H&&(H.phase===dl||Y.type==="phase_end")&&Z(el),Y.type){case"phase_start":{const cl={key:`phase-${Y.seq}`,label:dl,phase:dl,startMs:el,endMs:null,kind:"phase"};U.push(cl),T.set(dl,cl);break}case"phase_end":case"phase_death":{const cl=T.get(dl);cl&&(cl.endMs=el,cl.status=Y.type==="phase_death"?"death":qa(Y,"status")??"unknown",T.delete(dl)),Y.type==="phase_death"&&O.push({key:`mark-${Y.seq}`,label:"phase death",phase:dl,atMs:el,kind:"error",detail:qa(Y,"cause")??qa(Y,"error")});break}case"tool_call":{const cl={key:`tool-${Y.seq}`,label:Y.name??"tool",phase:dl,startMs:el,endMs:null,kind:"tool"};w.push(cl),H=cl;break}case"gate_pass":case"gate_fail":O.push({key:`mark-${Y.seq}`,label:Y.name??"gate",phase:dl,atMs:el,kind:Y.type});break;case"handoff":O.push({key:`mark-${Y.seq}`,label:"handoff",phase:dl,atMs:el,kind:"handoff",detail:qa(Y,"summary")});break;case"error":O.push({key:`mark-${Y.seq}`,label:Y.name??"error",phase:dl,atMs:el,kind:"error",detail:qa(Y,"error")??qa(Y,"reason")});break}}const gl=Je(f.completed_at);if(gl!==null){Z(Math.max(gl,x));for(const Y of T.values())Y.endMs===null&&(Y.endMs=Math.max(gl,x))}return{attemptId:f.id,attemptNumber:f.attempt_number,state:f.state,startMs:N,endMs:gl,phases:U,tools:w,marks:O,eventCount:p.length}}function G0(f,v){if(f.endMs!==null)return Math.max(f.endMs,f.startMs+1);const p=Math.max(f.startMs,...f.phases.map(o=>o.endMs??o.startMs),...f.tools.map(o=>o.endMs??o.startMs),...f.marks.map(o=>o.atMs));return Math.max(v,p,f.startMs+1)}function Af(f,v){return Math.max(0,(f.endMs??v)-f.startMs)}function Lh(f,v,p){const o=Math.max(1,p-v);return Math.min(100,Math.max(0,(f.startMs-v)/o*100))}function Vh(f,v,p,o){const M=Math.max(1,p-v),N=Af(f,o)/M*100;return Math.min(100,Math.max(1.5,N))}function Q0({lane:f,nowMs:v,onSelectPhase:p}){const o=G0(f,v),M=Math.max(1,o-f.startMs),N=f.endMs===null;return s.jsxs("section",{className:"lane","aria-label":`attempt ${f.attemptNumber} swim lane`,children:[s.jsxs("header",{className:"lane-header",children:[s.jsxs("h3",{children:["Attempt ",f.attemptNumber]}),s.jsx($e,{state:f.state}),s.jsxs("span",{className:"lane-meta",children:[Ru(M)," · ",f.eventCount," events",N?" · live":""]})]}),f.phases.length===0&&f.tools.length===0?s.jsx("p",{className:"lane-empty",children:"No trace events for this attempt yet."}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"lane-track",role:"list","aria-label":"phases",children:[f.phases.map(U=>s.jsx(X0,{span:U,startMs:f.startMs,endMs:o,nowMs:v,onSelect:p},U.key)),f.marks.map(U=>s.jsx(Z0,{mark:U,startMs:f.startMs,endMs:o},U.key))]}),f.tools.length>0&&s.jsx("ol",{className:"tool-list","aria-label":`attempt ${f.attemptNumber} tool calls`,children:f.tools.map(U=>s.jsx(L0,{span:U,startMs:f.startMs,endMs:o,nowMs:v},U.key))})]})]})}function X0({span:f,startMs:v,endMs:p,nowMs:o,onSelect:M}){const N=Ru(Af(f,o)),U=f.status??"running";return s.jsxs("button",{type:"button",role:"listitem",className:`phase-block phase-${U}`,style:{left:`${Lh(f,v,p)}%`,width:`${Vh(f,v,p,o)}%`},"aria-label":`phase ${f.label}, ${U}, ${N}`,onClick:()=>M?.(f.phase),children:[s.jsx("span",{className:"phase-name",children:f.label}),s.jsx("span",{className:"phase-duration",children:N})]})}function Z0({mark:f,startMs:v,endMs:p}){const o=Math.max(1,p-v),M=Math.min(100,Math.max(0,(f.atMs-v)/o*100));return s.jsx("span",{className:`mark mark-${f.kind}`,style:{left:`${M}%`},title:`${f.label}${f.detail?`: ${f.detail}`:""} (${we(new Date(f.atMs).toISOString())})`,"aria-label":`${f.kind.replace("_"," ")} ${f.label}`})}function L0({span:f,startMs:v,endMs:p,nowMs:o}){const M=f.endMs===null,N=Ru(Af(f,o));return s.jsxs("li",{className:"tool-row",children:[s.jsx("span",{className:"tool-name",children:f.label}),s.jsx("span",{className:"tool-track",children:s.jsx("span",{className:M?"tool-span tool-running":"tool-span",style:{marginLeft:`${Lh(f,v,p)}%`,width:`${Vh(f,v,p,o)}%`}})}),s.jsxs("span",{className:"tool-duration",children:[N,M?" (running)":""]})]})}function V0({runID:f}){const v=P.useCallback(()=>zt.run(f),[f]),{data:p,error:o,loading:M}=_e(v,3e3,`run:${f}`),N=Zh();if(M&&!p)return s.jsx(Ca,{label:"Loading run…"});if(!p)return s.jsx(Il,{error:o});const U=Object.entries(p.run.parameters??{});return s.jsxs("div",{className:"view",children:[s.jsxs("header",{className:"view-header",children:[s.jsxs("div",{children:[s.jsxs("h1",{children:["Run ",Uu(p.run.id)]}),s.jsxs("p",{className:"subtle",children:[p.run.targets.length," target",p.run.targets.length===1?"":"s"," · pinned at admission · created ",we(p.run.created_at)]})]}),s.jsx($e,{state:p.run.state})]}),s.jsx(Il,{error:o}),U.length>0&&s.jsx("dl",{className:"parameters",children:U.map(([w,O])=>s.jsxs("div",{children:[s.jsx("dt",{children:w}),s.jsx("dd",{children:O})]},w))}),p.jobs.length===0?s.jsx(We,{title:"No jobs",detail:"This run admitted no targets."}):p.jobs.map(w=>s.jsx(Kh,{jobID:w.id,nowMs:N},w.id))]})}function K0({jobID:f}){const v=Zh();return s.jsx("div",{className:"view",children:s.jsx(Kh,{jobID:f,nowMs:v,standalone:!0})})}function Kh({jobID:f,nowMs:v,standalone:p=!1}){const o=P.useCallback(()=>zt.job(f),[f]),{data:M,error:N,loading:U,refresh:w}=_e(o,3e3,`job:${f}`),[O,T]=P.useState(null),H=async Z=>{try{Z==="retry"?await zt.retryJob(f):await zt.cancelJob(f),T(null),w()}catch(gl){T(gl)}};if(U&&!M)return s.jsx(Ca,{label:"Loading job…"});if(!M)return s.jsx(Il,{error:N});const x=M.attempts??[];return s.jsxs("section",{className:"panel",children:[s.jsxs("header",{className:"panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:M.job.repository}),s.jsxs("p",{className:"subtle",children:[M.definition?`${M.definition} · `:"","base ",M.job.base_sha.slice(0,12)," ·"," ",p?s.jsxs(Ht,{href:`/runs/${M.run_id}`,children:["run ",Uu(M.run_id)]}):s.jsxs(Ht,{href:`/jobs/${M.job.id}`,children:["job ",Uu(M.job.id)]})]})]}),s.jsxs("div",{className:"panel-actions",children:[s.jsx($e,{state:M.job.state}),s.jsx("button",{type:"button",onClick:()=>{H("retry")},children:"Retry"}),s.jsx("button",{type:"button",onClick:()=>{H("cancel")},children:"Cancel"})]})]}),s.jsx(Il,{error:O}),M.worktree&&s.jsxs("p",{className:"notice",children:["Worktree retained at ",s.jsx("code",{children:M.worktree.path})," — ",M.worktree.reason," ",s.jsx(Ht,{href:"/worktrees",children:"release it"})]}),(M.publish??[]).length>0&&s.jsx("ul",{className:"publish",children:(M.publish??[]).map(Z=>s.jsxs("li",{children:[s.jsx("strong",{children:Z.step})," ",Z.branch,Z.pr_url?s.jsxs(s.Fragment,{children:[" ",s.jsx("a",{href:Z.pr_url,rel:"noreferrer noopener",target:"_blank",children:"pull request"})]}):null]},`${Z.attempt_id}-${Z.step}`))}),x.length===0?s.jsx(We,{title:"No attempts yet",detail:"This job is waiting for a worker to claim it."}):x.map(Z=>s.jsx(J0,{attempt:Z,nowMs:v},Z.id))]})}function J0({attempt:f,nowMs:v}){const{events:p,error:o}=x0(f.id,f.state),M=P.useMemo(()=>Y0(f,p),[f,p]),[N,U]=P.useState(null);return s.jsxs("div",{className:"attempt",children:[s.jsx(Q0,{lane:M,nowMs:v,onSelectPhase:U}),s.jsx(Il,{error:o}),s.jsx(w0,{attempt:f,openPhase:N})]})}function w0({attempt:f,openPhase:v}){const p=Xh(f.state),o=P.useCallback(()=>zt.attemptGates(f.id),[f.id]),M=P.useCallback(()=>zt.attemptEnvelopes(f.id),[f.id]),N=_e(o,p?0:5e3,`gates:${f.id}:${f.state}`),U=_e(M,p?0:5e3,`envelopes:${f.id}:${f.state}`),O=P.useMemo(()=>_0(f.result),[f.result])?.phases??[],T=(N.data??[]).filter(x=>!v||x.phase===v),H=(U.data??[]).filter(x=>!v||x.phase===v);return!f.result&&T.length===0&&H.length===0&&!f.error?null:s.jsxs("details",{className:"evidence",children:[s.jsxs("summary",{children:["Evidence",v?` · ${v}`:""," — ",T.length," gate check",T.length===1?"":"s",H.length>0?`, ${H.length} invalid emission`:""]}),f.error&&s.jsx("p",{className:"attempt-error",children:f.error}),O.filter(x=>!v||x.phase===v).map(x=>s.jsx($0,{phase:x},`${x.phase}-${x.phase_attempt}`)),T.length>0&&s.jsxs("table",{className:"gates",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Phase"}),s.jsx("th",{children:"Gate"}),s.jsx("th",{children:"Item"}),s.jsx("th",{children:"Result"}),s.jsx("th",{children:"Note"})]})}),s.jsx("tbody",{children:T.map((x,Z)=>s.jsxs("tr",{children:[s.jsx("td",{children:x.phase}),s.jsx("td",{children:x.gate}),s.jsx("td",{children:x.item}),s.jsx("td",{className:x.ok?"ok":"not-ok",children:x.ok?"pass":"fail"}),s.jsx("td",{children:x.note})]},`${x.phase}-${x.gate}-${x.item}-${Z}`))})]}),H.map(x=>s.jsxs("div",{className:"invalid-envelope",children:[s.jsxs("h4",{children:["Invalid emission · ",x.phase," · seq ",x.emission]}),s.jsx("p",{className:"subtle",children:x.parse_error}),s.jsx("pre",{children:x.body}),s.jsx("p",{className:"subtle",children:"Stored capped; the complete emission is in this attempt's JSONL trace."})]},`${x.phase}-${x.emission}`))]})}function $0({phase:f}){const v=f.started_at?Date.parse(f.started_at):null,p=f.ended_at?Date.parse(f.ended_at):null;return s.jsxs("div",{className:"envelope",children:[s.jsxs("h4",{children:[f.phase," ",s.jsx("span",{className:`badge badge-${f.status}`,children:f.status}),v&&p?s.jsxs("span",{className:"subtle",children:[" · ",Ru(p-v)]}):null]}),f.envelope?s.jsx("pre",{children:JSON.stringify(f.envelope,null,2)}):s.jsx("p",{className:"subtle",children:"No envelope recorded for this phase."}),(f.gates?.checks??[]).length>0&&s.jsx("ul",{className:"checks",children:(f.gates?.checks??[]).map((o,M)=>s.jsxs("li",{className:o.ok?"ok":"not-ok",children:[o.item,": ",o.note??(o.ok?"ok":"failed")]},`${o.item}-${M}`))})]})}function W0(){const f=P.useCallback(()=>zt.worktrees(),[]),{data:v,error:p,loading:o,refresh:M}=_e(f,5e3,"worktrees"),[N,U]=P.useState(null),[w,O]=P.useState(null),T=async H=>{try{await zt.releaseWorktree(H),O(null),U(null),M()}catch(x){O(x)}};return o&&!v?s.jsx(Ca,{label:"Loading worktrees…"}):v?s.jsxs("div",{className:"view",children:[s.jsxs("header",{className:"view-header",children:[s.jsxs("div",{children:[s.jsx("h1",{children:"Retained worktrees"}),s.jsx("p",{className:"subtle",children:"Kept because publish could not be proven. Inspect the path, then release."})]}),s.jsx("div",{className:"counters",children:s.jsxs("div",{className:"counter",children:[s.jsx("span",{className:"counter-value",children:v.length}),s.jsx("span",{className:"counter-label",children:"retained"})]})})]}),s.jsx(Il,{error:p}),s.jsx(Il,{error:w}),v.length===0?s.jsx(We,{title:"Nothing retained",detail:"Every attempt's worktree was disposed cleanly."}):s.jsxs("table",{className:"table",children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Repository"}),s.jsx("th",{children:"Path"}),s.jsx("th",{children:"Reason"}),s.jsx("th",{children:"Attempt"}),s.jsx("th",{children:"Since"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:v.map(H=>s.jsxs("tr",{children:[s.jsx("td",{children:H.repository}),s.jsx("td",{children:s.jsx("code",{children:H.path})}),s.jsx("td",{children:H.reason}),s.jsx("td",{children:s.jsx(Ht,{href:`/jobs/${H.attempt_id}`,children:Uu(H.attempt_id)})}),s.jsx("td",{children:we(H.created_at)}),s.jsx("td",{children:N===H.attempt_id?s.jsxs("span",{className:"confirm",children:[s.jsx("button",{type:"button",onClick:()=>{T(H.attempt_id)},children:"Confirm release"}),s.jsx("button",{type:"button",onClick:()=>U(null),children:"Keep"})]}):s.jsx("button",{type:"button",onClick:()=>U(H.attempt_id),children:"Release…"})})]},H.attempt_id))})]})]}):s.jsx(Il,{error:p})}function k0(){const f=U0();return s.jsxs("div",{className:"app",children:[s.jsxs("nav",{className:"nav",children:[s.jsx("span",{className:"brand",children:"jig"}),s.jsx(Ht,{href:"/",children:"Queue"}),s.jsx(Ht,{href:"/fleet",children:"Fleet"}),s.jsx(Ht,{href:"/runs",children:"Runs"}),s.jsx(Ht,{href:"/worktrees",children:"Worktrees"})]}),s.jsxs("main",{children:[f.name==="queue"&&s.jsx(C0,{}),f.name==="runs"&&s.jsx(B0,{}),f.name==="run"&&s.jsx(V0,{runID:f.id}),f.name==="job"&&s.jsx(K0,{jobID:f.id}),f.name==="worktrees"&&s.jsx(W0,{}),f.name==="fleet"&&s.jsx(q0,{}),f.name==="unknown"&&s.jsx(We,{title:"No such view",detail:`Nothing is served at ${f.path}.`})]})]})}j0.createRoot(document.getElementById("root")).render(s.jsx(P.StrictMode,{children:s.jsx(k0,{})})); diff --git a/web/dist/assets/index-CZKUce6A.js b/web/dist/assets/index-CZKUce6A.js new file mode 100644 index 0000000..c3956da --- /dev/null +++ b/web/dist/assets/index-CZKUce6A.js @@ -0,0 +1,167 @@ +(function(){const h=document.createElement("link").relList;if(h&&h.supports&&h.supports("modulepreload"))return;for(const M of document.querySelectorAll('link[rel="modulepreload"]'))r(M);new MutationObserver(M=>{for(const R of M)if(R.type==="childList")for(const z of R.addedNodes)z.tagName==="LINK"&&z.rel==="modulepreload"&&r(z)}).observe(document,{childList:!0,subtree:!0});function y(M){const R={};return M.integrity&&(R.integrity=M.integrity),M.referrerPolicy&&(R.referrerPolicy=M.referrerPolicy),M.crossOrigin==="use-credentials"?R.credentials="include":M.crossOrigin==="anonymous"?R.credentials="omit":R.credentials="same-origin",R}function r(M){if(M.ep)return;M.ep=!0;const R=y(M);fetch(M.href,R)}})();var js={exports:{}},Rn={};var Yd;function Ty(){if(Yd)return Rn;Yd=1;var s=Symbol.for("react.transitional.element"),h=Symbol.for("react.fragment");function y(r,M,R){var z=null;if(R!==void 0&&(z=""+R),M.key!==void 0&&(z=""+M.key),"key"in M){R={};for(var U in M)U!=="key"&&(R[U]=M[U])}else R=M;return M=R.ref,{$$typeof:s,type:r,key:z,ref:M!==void 0?M:null,props:R}}return Rn.Fragment=h,Rn.jsx=y,Rn.jsxs=y,Rn}var Bd;function Ey(){return Bd||(Bd=1,js.exports=Ty()),js.exports}var c=Ey(),xs={exports:{}},W={};var Gd;function zy(){if(Gd)return W;Gd=1;var s=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),z=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),j=Symbol.for("react.memo"),Y=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),J=Symbol.iterator;function O(m){return m===null||typeof m!="object"?null:(m=J&&m[J]||m["@@iterator"],typeof m=="function"?m:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},X=Object.assign,L={};function P(m,N,H){this.props=m,this.context=N,this.refs=L,this.updater=H||D}P.prototype.isReactComponent={},P.prototype.setState=function(m,N){if(typeof m!="object"&&typeof m!="function"&&m!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,m,N,"setState")},P.prototype.forceUpdate=function(m){this.updater.enqueueForceUpdate(this,m,"forceUpdate")};function $(){}$.prototype=P.prototype;function he(m,N,H){this.props=m,this.context=N,this.refs=L,this.updater=H||D}var Z=he.prototype=new $;Z.constructor=he,X(Z,P.prototype),Z.isPureReactComponent=!0;var ee=Array.isArray;function Ee(){}var le={H:null,A:null,T:null,S:null},Xe=Object.prototype.hasOwnProperty;function Ke(m,N,H){var G=H.ref;return{$$typeof:s,type:m,key:N,ref:G!==void 0?G:null,props:H}}function Wl(m,N){return Ke(m.type,N,m.props)}function Dt(m){return typeof m=="object"&&m!==null&&m.$$typeof===s}function Ie(m){var N={"=":"=0",":":"=2"};return"$"+m.replace(/[=:]/g,function(H){return N[H]})}var Ml=/\/+/g;function Yt(m,N){return typeof m=="object"&&m!==null&&m.key!=null?Ie(""+m.key):N.toString(36)}function zt(m){switch(m.status){case"fulfilled":return m.value;case"rejected":throw m.reason;default:switch(typeof m.status=="string"?m.then(Ee,Ee):(m.status="pending",m.then(function(N){m.status==="pending"&&(m.status="fulfilled",m.value=N)},function(N){m.status==="pending"&&(m.status="rejected",m.reason=N)})),m.status){case"fulfilled":return m.value;case"rejected":throw m.reason}}throw m}function _(m,N,H,G,F){var ae=typeof m;(ae==="undefined"||ae==="boolean")&&(m=null);var de=!1;if(m===null)de=!0;else switch(ae){case"bigint":case"string":case"number":de=!0;break;case"object":switch(m.$$typeof){case s:case h:de=!0;break;case Y:return de=m._init,_(de(m._payload),N,H,G,F)}}if(de)return F=F(m),de=G===""?"."+Yt(m,0):G,ee(F)?(H="",de!=null&&(H=de.replace(Ml,"$&/")+"/"),_(F,N,H,"",function(Ga){return Ga})):F!=null&&(Dt(F)&&(F=Wl(F,H+(F.key==null||m&&m.key===F.key?"":(""+F.key).replace(Ml,"$&/")+"/")+de)),N.push(F)),1;de=0;var We=G===""?".":G+":";if(ee(m))for(var Ne=0;Ne>>1,Se=_[ve];if(0>>1;veM(H,V))GM(F,H)?(_[ve]=F,_[G]=V,ve=G):(_[ve]=H,_[N]=V,ve=N);else if(GM(F,V))_[ve]=F,_[G]=V,ve=G;else break e}}return q}function M(_,q){var V=_.sortIndex-q.sortIndex;return V!==0?V:_.id-q.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var R=performance;s.unstable_now=function(){return R.now()}}else{var z=Date,U=z.now();s.unstable_now=function(){return z.now()-U}}var A=[],j=[],Y=1,C=null,J=3,O=!1,D=!1,X=!1,L=!1,P=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,he=typeof setImmediate<"u"?setImmediate:null;function Z(_){for(var q=y(j);q!==null;){if(q.callback===null)r(j);else if(q.startTime<=_)r(j),q.sortIndex=q.expirationTime,h(A,q);else break;q=y(j)}}function ee(_){if(X=!1,Z(_),!D)if(y(A)!==null)D=!0,Ee||(Ee=!0,Ie());else{var q=y(j);q!==null&&zt(ee,q.startTime-_)}}var Ee=!1,le=-1,Xe=5,Ke=-1;function Wl(){return L?!0:!(s.unstable_now()-Ke_&&Wl());){var ve=C.callback;if(typeof ve=="function"){C.callback=null,J=C.priorityLevel;var Se=ve(C.expirationTime<=_);if(_=s.unstable_now(),typeof Se=="function"){C.callback=Se,Z(_),q=!0;break t}C===y(A)&&r(A),Z(_)}else r(A);C=y(A)}if(C!==null)q=!0;else{var m=y(j);m!==null&&zt(ee,m.startTime-_),q=!1}}break e}finally{C=null,J=V,O=!1}q=void 0}}finally{q?Ie():Ee=!1}}}var Ie;if(typeof he=="function")Ie=function(){he(Dt)};else if(typeof MessageChannel<"u"){var Ml=new MessageChannel,Yt=Ml.port2;Ml.port1.onmessage=Dt,Ie=function(){Yt.postMessage(null)}}else Ie=function(){P(Dt,0)};function zt(_,q){le=P(function(){_(s.unstable_now())},q)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(_){_.callback=null},s.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Xe=0<_?Math.floor(1e3/_):5},s.unstable_getCurrentPriorityLevel=function(){return J},s.unstable_next=function(_){switch(J){case 1:case 2:case 3:var q=3;break;default:q=J}var V=J;J=q;try{return _()}finally{J=V}},s.unstable_requestPaint=function(){L=!0},s.unstable_runWithPriority=function(_,q){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var V=J;J=_;try{return q()}finally{J=V}},s.unstable_scheduleCallback=function(_,q,V){var ve=s.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0ve?(_.sortIndex=V,h(j,_),y(A)===null&&_===y(j)&&(X?($(le),le=-1):X=!0,zt(ee,V-ve))):(_.sortIndex=Se,h(A,_),D||O||(D=!0,Ee||(Ee=!0,Ie()))),_},s.unstable_shouldYield=Wl,s.unstable_wrapCallback=function(_){var q=J;return function(){var V=J;J=q;try{return _.apply(this,arguments)}finally{J=V}}}})(Es)),Es}var wd;function Ny(){return wd||(wd=1,Ts.exports=Ay()),Ts.exports}var zs={exports:{}},Je={};var Zd;function My(){if(Zd)return Je;Zd=1;var s=Os();function h(A){var j="https://react.dev/errors/"+A;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(h){console.error(h)}}return s(),zs.exports=My(),zs.exports}var kd;function Dy(){if(kd)return Cn;kd=1;var s=Ny(),h=Os(),y=Oy();function r(e){var t="https://react.dev/errors/"+e;if(1Se||(e.current=ve[Se],ve[Se]=null,Se--)}function H(e,t){Se++,ve[Se]=e.current,e.current=t}var G=m(null),F=m(null),ae=m(null),de=m(null);function We(e,t){switch(H(ae,t),H(F,e),H(G,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?id(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=id(t),e=cd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}N(G),H(G,e)}function Ne(){N(G),N(F),N(ae)}function Ga(e){e.memoizedState!==null&&H(de,e);var t=G.current,l=cd(t,e.type);t!==l&&(H(F,e),H(G,l))}function Hn(e){F.current===e&&(N(G),N(F)),de.current===e&&(N(de),Mn._currentValue=V)}var ai,Cs;function Ol(e){if(ai===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);ai=t&&t[1]||"",Cs=-1)":-1n||o[a]!==g[n]){var x=` +`+o[a].replace(" at new "," at ");return e.displayName&&x.includes("")&&(x=x.replace("",e.displayName)),x}while(1<=a&&0<=n);break}}}finally{ni=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ol(l):""}function th(e,t){switch(e.tag){case 26:case 27:case 5:return Ol(e.type);case 16:return Ol("Lazy");case 13:return e.child!==t&&t!==null?Ol("Suspense Fallback"):Ol("Suspense");case 19:return Ol("SuspenseList");case 0:case 15:return ui(e.type,!1);case 11:return ui(e.type.render,!1);case 1:return ui(e.type,!0);case 31:return Ol("Activity");default:return""}}function qs(e){try{var t="",l=null;do t+=th(e,l),l=e,e=e.return;while(e);return t}catch(a){return` +Error generating stack: `+a.message+` +`+a.stack}}var ii=Object.prototype.hasOwnProperty,ci=s.unstable_scheduleCallback,si=s.unstable_cancelCallback,lh=s.unstable_shouldYield,ah=s.unstable_requestPaint,it=s.unstable_now,nh=s.unstable_getCurrentPriorityLevel,Hs=s.unstable_ImmediatePriority,Ys=s.unstable_UserBlockingPriority,Yn=s.unstable_NormalPriority,uh=s.unstable_LowPriority,Bs=s.unstable_IdlePriority,ih=s.log,ch=s.unstable_setDisableYieldValue,Qa=null,ct=null;function al(e){if(typeof ih=="function"&&ch(e),ct&&typeof ct.setStrictMode=="function")try{ct.setStrictMode(Qa,e)}catch{}}var st=Math.clz32?Math.clz32:rh,sh=Math.log,fh=Math.LN2;function rh(e){return e>>>=0,e===0?32:31-(sh(e)/fh|0)|0}var Bn=256,Gn=262144,Qn=4194304;function Dl(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Xn(e,t,l){var a=e.pendingLanes;if(a===0)return 0;var n=0,u=e.suspendedLanes,i=e.pingedLanes;e=e.warmLanes;var f=a&134217727;return f!==0?(a=f&~u,a!==0?n=Dl(a):(i&=f,i!==0?n=Dl(i):l||(l=f&~e,l!==0&&(n=Dl(l))))):(f=a&~u,f!==0?n=Dl(f):i!==0?n=Dl(i):l||(l=a&~e,l!==0&&(n=Dl(l)))),n===0?0:t!==0&&t!==n&&(t&u)===0&&(u=n&-n,l=t&-t,u>=l||u===32&&(l&4194048)!==0)?t:n}function Xa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function oh(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gs(){var e=Qn;return Qn<<=1,(Qn&62914560)===0&&(Qn=4194304),e}function fi(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function wa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dh(e,t,l,a,n,u){var i=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var f=e.entanglements,o=e.expirationTimes,g=e.hiddenUpdates;for(l=i&~l;0"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var gh=/[\n"\\]/g;function pt(e){return e.replace(gh,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function yi(e,t,l,a,n,u,i,f){e.name="",i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"?e.type=i:e.removeAttribute("type"),t!=null?i==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+vt(t)):e.value!==""+vt(t)&&(e.value=""+vt(t)):i!=="submit"&&i!=="reset"||e.removeAttribute("value"),t!=null?vi(e,i,vt(t)):l!=null?vi(e,i,vt(l)):a!=null&&e.removeAttribute("value"),n==null&&u!=null&&(e.defaultChecked=!!u),n!=null&&(e.checked=n&&typeof n!="function"&&typeof n!="symbol"),f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.name=""+vt(f):e.removeAttribute("name")}function Is(e,t,l,a,n,u,i,f){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||l!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){mi(e);return}l=l!=null?""+vt(l):"",t=t!=null?""+vt(t):l,f||t===e.value||(e.value=t),e.defaultValue=t}a=a??n,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=f?e.checked:!!a,e.defaultChecked=!!a,i!=null&&typeof i!="function"&&typeof i!="symbol"&&typeof i!="boolean"&&(e.name=i),mi(e)}function vi(e,t,l){t==="number"&&Ln(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function la(e,t,l,a){if(e=e.options,t){t={};for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ji=!1;if(Qt)try{var Va={};Object.defineProperty(Va,"passive",{get:function(){ji=!0}}),window.addEventListener("test",Va,Va),window.removeEventListener("test",Va,Va)}catch{ji=!1}var ul=null,xi=null,Vn=null;function uf(){if(Vn)return Vn;var e,t=xi,l=t.length,a,n="value"in ul?ul.value:ul.textContent,u=n.length;for(e=0;e=$a),df=" ",hf=!1;function mf(e,t){switch(e){case"keyup":return Vh.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function yf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ia=!1;function Jh(e,t){switch(e){case"compositionend":return yf(t);case"keypress":return t.which!==32?null:(hf=!0,df);case"textInput":return e=t.data,e===df&&hf?null:e;default:return null}}function $h(e,t){if(ia)return e==="compositionend"||!Ai&&mf(e,t)?(e=uf(),Vn=xi=ul=null,ia=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:l,offset:t-e};e=a}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=_f(l)}}function Ef(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ef(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ln(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=Ln(e.document)}return t}function Oi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var am=Qt&&"documentMode"in document&&11>=document.documentMode,ca=null,Di=null,Pa=null,Ui=!1;function Af(e,t,l){var a=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Ui||ca==null||ca!==Ln(a)||(a=ca,"selectionStart"in a&&Oi(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),Pa&&Ia(Pa,a)||(Pa=a,a=Gu(Di,"onSelect"),0>=i,n-=i,Ut=1<<32-st(t)+n|l<te?(ce=Q,Q=null):ce=Q.sibling;var re=b(v,Q,p[te],T);if(re===null){Q===null&&(Q=ce);break}e&&Q&&re.alternate===null&&t(v,Q),d=u(re,d,te),fe===null?w=re:fe.sibling=re,fe=re,Q=ce}if(te===p.length)return l(v,Q),se&&wt(v,te),w;if(Q===null){for(;tete?(ce=Q,Q=null):ce=Q.sibling;var Al=b(v,Q,re.value,T);if(Al===null){Q===null&&(Q=ce);break}e&&Q&&Al.alternate===null&&t(v,Q),d=u(Al,d,te),fe===null?w=Al:fe.sibling=Al,fe=Al,Q=ce}if(re.done)return l(v,Q),se&&wt(v,te),w;if(Q===null){for(;!re.done;te++,re=p.next())re=E(v,re.value,T),re!==null&&(d=u(re,d,te),fe===null?w=re:fe.sibling=re,fe=re);return se&&wt(v,te),w}for(Q=a(Q);!re.done;te++,re=p.next())re=S(Q,v,te,re.value,T),re!==null&&(e&&re.alternate!==null&&Q.delete(re.key===null?te:re.key),d=u(re,d,te),fe===null?w=re:fe.sibling=re,fe=re);return e&&Q.forEach(function(_y){return t(v,_y)}),se&&wt(v,te),w}function be(v,d,p,T){if(typeof p=="object"&&p!==null&&p.type===X&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case O:e:{for(var w=p.key;d!==null;){if(d.key===w){if(w=p.type,w===X){if(d.tag===7){l(v,d.sibling),T=n(d,p.props.children),T.return=v,v=T;break e}}else if(d.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===Xe&&wl(w)===d.type){l(v,d.sibling),T=n(d,p.props),un(T,p),T.return=v,v=T;break e}l(v,d);break}else t(v,d);d=d.sibling}p.type===X?(T=Yl(p.props.children,v.mode,T,p.key),T.return=v,v=T):(T=lu(p.type,p.key,p.props,null,v.mode,T),un(T,p),T.return=v,v=T)}return i(v);case D:e:{for(w=p.key;d!==null;){if(d.key===w)if(d.tag===4&&d.stateNode.containerInfo===p.containerInfo&&d.stateNode.implementation===p.implementation){l(v,d.sibling),T=n(d,p.children||[]),T.return=v,v=T;break e}else{l(v,d);break}else t(v,d);d=d.sibling}T=Gi(p,v.mode,T),T.return=v,v=T}return i(v);case Xe:return p=wl(p),be(v,d,p,T)}if(zt(p))return B(v,d,p,T);if(Ie(p)){if(w=Ie(p),typeof w!="function")throw Error(r(150));return p=w.call(p),k(v,d,p,T)}if(typeof p.then=="function")return be(v,d,fu(p),T);if(p.$$typeof===he)return be(v,d,uu(v,p),T);ru(v,p)}return typeof p=="string"&&p!==""||typeof p=="number"||typeof p=="bigint"?(p=""+p,d!==null&&d.tag===6?(l(v,d.sibling),T=n(d,p),T.return=v,v=T):(l(v,d),T=Bi(p,v.mode,T),T.return=v,v=T),i(v)):l(v,d)}return function(v,d,p,T){try{nn=0;var w=be(v,d,p,T);return ga=null,w}catch(Q){if(Q===pa||Q===cu)throw Q;var fe=rt(29,Q,null,v.mode);return fe.lanes=T,fe.return=v,fe}}}var Ll=Wf(!0),Ff=Wf(!1),rl=!1;function Fi(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ii(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ol(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function dl(e,t,l){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(oe&2)!==0){var n=a.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),a.pending=t,t=tu(e),Cf(e,null,l),t}return eu(e,a,t,l),tu(e)}function cn(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Xs(e,l)}}function Pi(e,t){var l=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,l===a)){var n=null,u=null;if(l=l.firstBaseUpdate,l!==null){do{var i={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};u===null?n=u=i:u=u.next=i,l=l.next}while(l!==null);u===null?n=u=t:u=u.next=t}else n=u=t;l={baseState:a.baseState,firstBaseUpdate:n,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var ec=!1;function sn(){if(ec){var e=va;if(e!==null)throw e}}function fn(e,t,l,a){ec=!1;var n=e.updateQueue;rl=!1;var u=n.firstBaseUpdate,i=n.lastBaseUpdate,f=n.shared.pending;if(f!==null){n.shared.pending=null;var o=f,g=o.next;o.next=null,i===null?u=g:i.next=g,i=o;var x=e.alternate;x!==null&&(x=x.updateQueue,f=x.lastBaseUpdate,f!==i&&(f===null?x.firstBaseUpdate=g:f.next=g,x.lastBaseUpdate=o))}if(u!==null){var E=n.baseState;i=0,x=g=o=null,f=u;do{var b=f.lane&-536870913,S=b!==f.lane;if(S?(ie&b)===b:(a&b)===b){b!==0&&b===ya&&(ec=!0),x!==null&&(x=x.next={lane:0,tag:f.tag,payload:f.payload,callback:null,next:null});e:{var B=e,k=f;b=t;var be=l;switch(k.tag){case 1:if(B=k.payload,typeof B=="function"){E=B.call(be,E,b);break e}E=B;break e;case 3:B.flags=B.flags&-65537|128;case 0:if(B=k.payload,b=typeof B=="function"?B.call(be,E,b):B,b==null)break e;E=C({},E,b);break e;case 2:rl=!0}}b=f.callback,b!==null&&(e.flags|=64,S&&(e.flags|=8192),S=n.callbacks,S===null?n.callbacks=[b]:S.push(b))}else S={lane:b,tag:f.tag,payload:f.payload,callback:f.callback,next:null},x===null?(g=x=S,o=E):x=x.next=S,i|=b;if(f=f.next,f===null){if(f=n.shared.pending,f===null)break;S=f,f=S.next,S.next=null,n.lastBaseUpdate=S,n.shared.pending=null}}while(!0);x===null&&(o=E),n.baseState=o,n.firstBaseUpdate=g,n.lastBaseUpdate=x,u===null&&(n.shared.lanes=0),pl|=i,e.lanes=i,e.memoizedState=E}}function If(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function Pf(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;eu?u:8;var i=_.T,f={};_.T=f,bc(e,!1,t,l);try{var o=n(),g=_.S;if(g!==null&&g(f,o),o!==null&&typeof o=="object"&&typeof o.then=="function"){var x=dm(o,a);dn(e,t,x,yt(e))}else dn(e,t,a,yt(e))}catch(E){dn(e,t,{then:function(){},status:"rejected",reason:E},yt())}finally{q.p=u,i!==null&&f.types!==null&&(i.types=f.types),_.T=i}}function gm(){}function pc(e,t,l,a){if(e.tag!==5)throw Error(r(476));var n=Dr(e).queue;Or(e,n,t,V,l===null?gm:function(){return Ur(e),l(a)})}function Dr(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vt,lastRenderedState:V},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vt,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ur(e){var t=Dr(e);t.next===null&&(t=e.alternate.memoizedState),dn(e,t.next.queue,{},yt())}function gc(){return Le(Mn)}function Rr(){return Oe().memoizedState}function Cr(){return Oe().memoizedState}function bm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=yt();e=ol(l);var a=dl(t,e,l);a!==null&&(ut(a,t,l),cn(a,t,l)),t={cache:Ki()},e.payload=t;return}t=t.return}}function Sm(e,t,l){var a=yt();l={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Su(e)?Hr(t,l):(l=Hi(e,t,l,a),l!==null&&(ut(l,e,a),Yr(l,t,a)))}function qr(e,t,l){var a=yt();dn(e,t,l,a)}function dn(e,t,l,a){var n={lane:a,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Su(e))Hr(t,n);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var i=t.lastRenderedState,f=u(i,l);if(n.hasEagerState=!0,n.eagerState=f,ft(f,i))return eu(e,t,n,0),je===null&&Pn(),!1}catch{}if(l=Hi(e,t,n,a),l!==null)return ut(l,e,a),Yr(l,t,a),!0}return!1}function bc(e,t,l,a){if(a={lane:2,revertLane:Fc(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Su(e)){if(t)throw Error(r(479))}else t=Hi(e,l,a,2),t!==null&&ut(t,e,2)}function Su(e){var t=e.alternate;return e===I||t!==null&&t===I}function Hr(e,t){Sa=hu=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function Yr(e,t,l){if((l&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,l|=a,t.lanes=l,Xs(e,l)}}var hn={readContext:Le,use:vu,useCallback:ze,useContext:ze,useEffect:ze,useImperativeHandle:ze,useLayoutEffect:ze,useInsertionEffect:ze,useMemo:ze,useReducer:ze,useRef:ze,useState:ze,useDebugValue:ze,useDeferredValue:ze,useTransition:ze,useSyncExternalStore:ze,useId:ze,useHostTransitionStatus:ze,useFormState:ze,useActionState:ze,useOptimistic:ze,useMemoCache:ze,useCacheRefresh:ze};hn.useEffectEvent=ze;var Br={readContext:Le,use:vu,useCallback:function(e,t){return Fe().memoizedState=[e,t===void 0?null:t],e},useContext:Le,useEffect:jr,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,gu(4194308,4,Er.bind(null,t,e),l)},useLayoutEffect:function(e,t){return gu(4194308,4,e,t)},useInsertionEffect:function(e,t){gu(4,2,e,t)},useMemo:function(e,t){var l=Fe();t=t===void 0?null:t;var a=e();if(kl){al(!0);try{e()}finally{al(!1)}}return l.memoizedState=[a,t],a},useReducer:function(e,t,l){var a=Fe();if(l!==void 0){var n=l(t);if(kl){al(!0);try{l(t)}finally{al(!1)}}}else n=t;return a.memoizedState=a.baseState=n,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n},a.queue=e,e=e.dispatch=Sm.bind(null,I,e),[a.memoizedState,e]},useRef:function(e){var t=Fe();return e={current:e},t.memoizedState=e},useState:function(e){e=dc(e);var t=e.queue,l=qr.bind(null,I,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:yc,useDeferredValue:function(e,t){var l=Fe();return vc(l,e,t)},useTransition:function(){var e=dc(!1);return e=Or.bind(null,I,e.queue,!0,!1),Fe().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var a=I,n=Fe();if(se){if(l===void 0)throw Error(r(407));l=l()}else{if(l=t(),je===null)throw Error(r(349));(ie&127)!==0||ur(a,t,l)}n.memoizedState=l;var u={value:l,getSnapshot:t};return n.queue=u,jr(cr.bind(null,a,u,e),[e]),a.flags|=2048,xa(9,{destroy:void 0},ir.bind(null,a,u,l,t),null),l},useId:function(){var e=Fe(),t=je.identifierPrefix;if(se){var l=Rt,a=Ut;l=(a&~(1<<32-st(a)-1)).toString(32)+l,t="_"+t+"R_"+l,l=mu++,0<\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?i.createElement("select",{is:a.is}):i.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?i.createElement(n,{is:a.is}):i.createElement(n)}}u[we]=t,u[Pe]=a;e:for(i=t.child;i!==null;){if(i.tag===5||i.tag===6)u.appendChild(i.stateNode);else if(i.tag!==4&&i.tag!==27&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}t.stateNode=u;e:switch(Ve(u,n,a),n){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Jt(t)}}return _e(t),Rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&Jt(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(r(166));if(e=ae.current,ha(t)){if(e=t.stateNode,l=t.memoizedProps,a=null,n=Ze,n!==null)switch(n.tag){case 27:case 5:a=n.memoizedProps}e[we]=t,e=!!(e.nodeValue===l||a!==null&&a.suppressHydrationWarning===!0||nd(e.nodeValue,l)),e||sl(t,!0)}else e=Qu(e).createTextNode(a),e[we]=t,t.stateNode=e}return _e(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(a=ha(t),l!==null){if(e===null){if(!a)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[we]=t}else Bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_e(t),e=!1}else l=Zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(dt(t),t):(dt(t),null);if((t.flags&128)!==0)throw Error(r(558))}return _e(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(n=ha(t),a!==null&&a.dehydrated!==null){if(e===null){if(!n)throw Error(r(318));if(n=t.memoizedState,n=n!==null?n.dehydrated:null,!n)throw Error(r(317));n[we]=t}else Bl(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;_e(t),n=!1}else n=Zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),n=!0;if(!n)return t.flags&256?(dt(t),t):(dt(t),null)}return dt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=a!==null,e=e!==null&&e.memoizedState!==null,l&&(a=t.child,n=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(n=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==n&&(a.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),Eu(t,t.updateQueue),_e(t),null);case 4:return Ne(),e===null&&ts(t.stateNode.containerInfo),_e(t),null;case 10:return Lt(t.type),_e(t),null;case 19:if(N(Me),a=t.memoizedState,a===null)return _e(t),null;if(n=(t.flags&128)!==0,u=a.rendering,u===null)if(n)yn(a,!1);else{if(Ae!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=du(e),u!==null){for(t.flags|=128,yn(a,!1),e=u.updateQueue,t.updateQueue=e,Eu(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)qf(l,e),l=l.sibling;return H(Me,Me.current&1|2),se&&wt(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&it()>Ou&&(t.flags|=128,n=!0,yn(a,!1),t.lanes=4194304)}else{if(!n)if(e=du(u),e!==null){if(t.flags|=128,n=!0,e=e.updateQueue,t.updateQueue=e,Eu(t,e),yn(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!se)return _e(t),null}else 2*it()-a.renderingStartTime>Ou&&l!==536870912&&(t.flags|=128,n=!0,yn(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=it(),e.sibling=null,l=Me.current,H(Me,n?l&1|2:l&1),se&&wt(t,a.treeForkCount),e):(_e(t),null);case 22:case 23:return dt(t),lc(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(l&536870912)!==0&&(t.flags&128)===0&&(_e(t),t.subtreeFlags&6&&(t.flags|=8192)):_e(t),l=t.updateQueue,l!==null&&Eu(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==l&&(t.flags|=2048),e!==null&&N(Xl),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Lt(Re),_e(t),null;case 25:return null;case 30:return null}throw Error(r(156,t.tag))}function Em(e,t){switch(Xi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Lt(Re),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Hn(t),null;case 31:if(t.memoizedState!==null){if(dt(t),t.alternate===null)throw Error(r(340));Bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(dt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));Bl()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return N(Me),null;case 4:return Ne(),null;case 10:return Lt(t.type),null;case 22:case 23:return dt(t),lc(),e!==null&&N(Xl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Lt(Re),null;case 25:return null;default:return null}}function so(e,t){switch(Xi(t),t.tag){case 3:Lt(Re),Ne();break;case 26:case 27:case 5:Hn(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&dt(t);break;case 13:dt(t);break;case 19:N(Me);break;case 10:Lt(t.type);break;case 22:case 23:dt(t),lc(),e!==null&&N(Xl);break;case 24:Lt(Re)}}function vn(e,t){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var n=a.next;l=n;do{if((l.tag&e)===e){a=void 0;var u=l.create,i=l.inst;a=u(),i.destroy=a}l=l.next}while(l!==n)}}catch(f){ye(t,t.return,f)}}function yl(e,t,l){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var u=n.next;a=u;do{if((a.tag&e)===e){var i=a.inst,f=i.destroy;if(f!==void 0){i.destroy=void 0,n=t;var o=l,g=f;try{g()}catch(x){ye(n,o,x)}}}a=a.next}while(a!==u)}}catch(x){ye(t,t.return,x)}}function fo(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{Pf(t,l)}catch(a){ye(e,e.return,a)}}}function ro(e,t,l){l.props=Vl(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(a){ye(e,t,a)}}function pn(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof l=="function"?e.refCleanup=l(a):l.current=a}}catch(n){ye(e,t,n)}}function Ct(e,t){var l=e.ref,a=e.refCleanup;if(l!==null)if(typeof a=="function")try{a()}catch(n){ye(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(n){ye(e,t,n)}else l.current=null}function oo(e){var t=e.type,l=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&a.focus();break e;case"img":l.src?a.src=l.src:l.srcSet&&(a.srcset=l.srcSet)}}catch(n){ye(e,e.return,n)}}function Cc(e,t,l){try{var a=e.stateNode;Km(a,e.type,l,t),a[Pe]=t}catch(n){ye(e,e.return,n)}}function ho(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&xl(e.type)||e.tag===4}function qc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ho(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&xl(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hc(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Gt));else if(a!==4&&(a===27&&xl(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,l),e=e.sibling;e!==null;)Hc(e,t,l),e=e.sibling}function zu(e,t,l){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(a!==4&&(a===27&&xl(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(zu(e,t,l),e=e.sibling;e!==null;)zu(e,t,l),e=e.sibling}function mo(e){var t=e.stateNode,l=e.memoizedProps;try{for(var a=e.type,n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Ve(t,a,l),t[we]=e,t[Pe]=l}catch(u){ye(e,e.return,u)}}var $t=!1,He=!1,Yc=!1,yo=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function zm(e,t){if(e=e.containerInfo,ns=Ku,e=zf(e),Oi(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var a=l.getSelection&&l.getSelection();if(a&&a.rangeCount!==0){l=a.anchorNode;var n=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{l.nodeType,u.nodeType}catch{l=null;break e}var i=0,f=-1,o=-1,g=0,x=0,E=e,b=null;t:for(;;){for(var S;E!==l||n!==0&&E.nodeType!==3||(f=i+n),E!==u||a!==0&&E.nodeType!==3||(o=i+a),E.nodeType===3&&(i+=E.nodeValue.length),(S=E.firstChild)!==null;)b=E,E=S;for(;;){if(E===e)break t;if(b===l&&++g===n&&(f=i),b===u&&++x===a&&(o=i),(S=E.nextSibling)!==null)break;E=b,b=E.parentNode}E=S}l=f===-1||o===-1?null:{start:f,end:o}}else l=null}l=l||{start:0,end:0}}else l=null;for(us={focusedElem:e,selectionRange:l},Ku=!1,Qe=t;Qe!==null;)if(t=Qe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Qe=e;else for(;Qe!==null;){switch(t=Qe,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l title"))),Ve(u,a,l),u[we]=e,Ge(u),a=u;break e;case"link":var i=jd("link","href",n).get(a+(l.href||""));if(i){for(var f=0;fbe&&(i=be,be=k,k=i);var v=Tf(f,k),d=Tf(f,be);if(v&&d&&(S.rangeCount!==1||S.anchorNode!==v.node||S.anchorOffset!==v.offset||S.focusNode!==d.node||S.focusOffset!==d.offset)){var p=E.createRange();p.setStart(v.node,v.offset),S.removeAllRanges(),k>be?(S.addRange(p),S.extend(d.node,d.offset)):(p.setEnd(d.node,d.offset),S.addRange(p))}}}}for(E=[],S=f;S=S.parentNode;)S.nodeType===1&&E.push({element:S,left:S.scrollLeft,top:S.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;fl?32:l,_.T=null,l=Lc,Lc=null;var u=bl,i=el;if(Ye=0,Aa=bl=null,el=0,(oe&6)!==0)throw Error(r(331));var f=oe;if(oe|=4,zo(u.current),_o(u,u.current,i,l),oe=f,_n(0,!1),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(Qa,u)}catch{}return!0}finally{q.p=n,_.T=a,Lo(e,t)}}function Vo(e,t,l){t=bt(l,t),t=_c(e.stateNode,t,2),e=dl(e,t,2),e!==null&&(wa(e,2),qt(e))}function ye(e,t,l){if(e.tag===3)Vo(e,e,l);else for(;t!==null;){if(t.tag===3){Vo(t,e,l);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(gl===null||!gl.has(a))){e=bt(l,e),l=Vr(2),a=dl(t,l,2),a!==null&&(Kr(l,a,t,e),wa(a,2),qt(a));break}}t=t.return}}function Jc(e,t,l){var a=e.pingCache;if(a===null){a=e.pingCache=new Mm;var n=new Set;a.set(t,n)}else n=a.get(t),n===void 0&&(n=new Set,a.set(t,n));n.has(l)||(Qc=!0,n.add(l),e=Cm.bind(null,e,t,l),t.then(e,e))}function Cm(e,t,l){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,je===e&&(ie&l)===l&&(Ae===4||Ae===3&&(ie&62914560)===ie&&300>it()-Mu?(oe&2)===0&&Na(e,0):Xc|=l,za===ie&&(za=0)),qt(e)}function Ko(e,t){t===0&&(t=Gs()),e=Hl(e,t),e!==null&&(wa(e,t),qt(e))}function qm(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Ko(e,l)}function Hm(e,t){var l=0;switch(e.tag){case 31:case 13:var a=e.stateNode,n=e.memoizedState;n!==null&&(l=n.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(r(314))}a!==null&&a.delete(t),Ko(e,l)}function Ym(e,t){return ci(e,t)}var Hu=null,Oa=null,$c=!1,Yu=!1,Wc=!1,jl=0;function qt(e){e!==Oa&&e.next===null&&(Oa===null?Hu=Oa=e:Oa=Oa.next=e),Yu=!0,$c||($c=!0,Gm())}function _n(e,t){if(!Wc&&Yu){Wc=!0;do for(var l=!1,a=Hu;a!==null;){if(e!==0){var n=a.pendingLanes;if(n===0)var u=0;else{var i=a.suspendedLanes,f=a.pingedLanes;u=(1<<31-st(42|e)+1)-1,u&=n&~(i&~f),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(l=!0,Fo(a,u))}else u=ie,u=Xn(a,a===je?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||Xa(a,u)||(l=!0,Fo(a,u));a=a.next}while(l);Wc=!1}}function Bm(){Jo()}function Jo(){Yu=$c=!1;var e=0;jl!==0&&$m()&&(e=jl);for(var t=it(),l=null,a=Hu;a!==null;){var n=a.next,u=$o(a,t);u===0?(a.next=null,l===null?Hu=n:l.next=n,n===null&&(Oa=l)):(l=a,(e!==0||(u&3)!==0)&&(Yu=!0)),a=n}Ye!==0&&Ye!==5||_n(e),jl!==0&&(jl=0)}function $o(e,t){for(var l=e.suspendedLanes,a=e.pingedLanes,n=e.expirationTimes,u=e.pendingLanes&-62914561;0f)break;var x=o.transferSize,E=o.initiatorType;x&&ud(E)&&(o=o.responseEnd,i+=x*(o"u"?null:document;function pd(e,t,l){var a=Da;if(a&&typeof t=="string"&&t){var n=pt(t);n='link[rel="'+e+'"][href="'+n+'"]',typeof l=="string"&&(n+='[crossorigin="'+l+'"]'),vd.has(n)||(vd.add(n),e={rel:e,crossOrigin:l,href:t},a.querySelector(n)===null&&(t=a.createElement("link"),Ve(t,"link",e),Ge(t),a.head.appendChild(t)))}}function ny(e){tl.D(e),pd("dns-prefetch",e,null)}function uy(e,t){tl.C(e,t),pd("preconnect",e,t)}function iy(e,t,l){tl.L(e,t,l);var a=Da;if(a&&e&&t){var n='link[rel="preload"][as="'+pt(t)+'"]';t==="image"&&l&&l.imageSrcSet?(n+='[imagesrcset="'+pt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(n+='[imagesizes="'+pt(l.imageSizes)+'"]')):n+='[href="'+pt(e)+'"]';var u=n;switch(t){case"style":u=Ua(e);break;case"script":u=Ra(e)}Et.has(u)||(e=C({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),Et.set(u,e),a.querySelector(n)!==null||t==="style"&&a.querySelector(An(u))||t==="script"&&a.querySelector(Nn(u))||(t=a.createElement("link"),Ve(t,"link",e),Ge(t),a.head.appendChild(t)))}}function cy(e,t){tl.m(e,t);var l=Da;if(l&&e){var a=t&&typeof t.as=="string"?t.as:"script",n='link[rel="modulepreload"][as="'+pt(a)+'"][href="'+pt(e)+'"]',u=n;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Ra(e)}if(!Et.has(u)&&(e=C({rel:"modulepreload",href:e},t),Et.set(u,e),l.querySelector(n)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Nn(u)))return}a=l.createElement("link"),Ve(a,"link",e),Ge(a),l.head.appendChild(a)}}}function sy(e,t,l){tl.S(e,t,l);var a=Da;if(a&&e){var n=ea(a).hoistableStyles,u=Ua(e);t=t||"default";var i=n.get(u);if(!i){var f={loading:0,preload:null};if(i=a.querySelector(An(u)))f.loading=5;else{e=C({rel:"stylesheet",href:e,"data-precedence":t},l),(l=Et.get(u))&&ds(e,l);var o=i=a.createElement("link");Ge(o),Ve(o,"link",e),o._p=new Promise(function(g,x){o.onload=g,o.onerror=x}),o.addEventListener("load",function(){f.loading|=1}),o.addEventListener("error",function(){f.loading|=2}),f.loading|=4,wu(i,t,a)}i={type:"stylesheet",instance:i,count:1,state:f},n.set(u,i)}}}function fy(e,t){tl.X(e,t);var l=Da;if(l&&e){var a=ea(l).hoistableScripts,n=Ra(e),u=a.get(n);u||(u=l.querySelector(Nn(n)),u||(e=C({src:e,async:!0},t),(t=Et.get(n))&&hs(e,t),u=l.createElement("script"),Ge(u),Ve(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function ry(e,t){tl.M(e,t);var l=Da;if(l&&e){var a=ea(l).hoistableScripts,n=Ra(e),u=a.get(n);u||(u=l.querySelector(Nn(n)),u||(e=C({src:e,async:!0,type:"module"},t),(t=Et.get(n))&&hs(e,t),u=l.createElement("script"),Ge(u),Ve(u,"link",e),l.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(n,u))}}function gd(e,t,l,a){var n=(n=ae.current)?Xu(n):null;if(!n)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=Ua(l.href),l=ea(n).hoistableStyles,a=l.get(t),a||(a={type:"style",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Ua(l.href);var u=ea(n).hoistableStyles,i=u.get(e);if(i||(n=n.ownerDocument||n,i={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,i),(u=n.querySelector(An(e)))&&!u._p&&(i.instance=u,i.state.loading=5),Et.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Et.set(e,l),u||oy(n,e,l,i.state))),t&&a===null)throw Error(r(528,""));return i}if(t&&a!==null)throw Error(r(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ra(l),l=ea(n).hoistableScripts,a=l.get(t),a||(a={type:"script",instance:null,count:0,state:null},l.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function Ua(e){return'href="'+pt(e)+'"'}function An(e){return'link[rel="stylesheet"]['+e+"]"}function bd(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function oy(e,t,l,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),Ve(t,"link",l),Ge(t),e.head.appendChild(t))}function Ra(e){return'[src="'+pt(e)+'"]'}function Nn(e){return"script[async]"+e}function Sd(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+pt(l.href)+'"]');if(a)return t.instance=a,Ge(a),a;var n=C({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),Ge(a),Ve(a,"style",n),wu(a,l.precedence,e),t.instance=a;case"stylesheet":n=Ua(l.href);var u=e.querySelector(An(n));if(u)return t.state.loading|=4,t.instance=u,Ge(u),u;a=bd(l),(n=Et.get(n))&&ds(a,n),u=(e.ownerDocument||e).createElement("link"),Ge(u);var i=u;return i._p=new Promise(function(f,o){i.onload=f,i.onerror=o}),Ve(u,"link",a),t.state.loading|=4,wu(u,l.precedence,e),t.instance=u;case"script":return u=Ra(l.src),(n=e.querySelector(Nn(u)))?(t.instance=n,Ge(n),n):(a=l,(n=Et.get(u))&&(a=C({},l),hs(a,n)),e=e.ownerDocument||e,n=e.createElement("script"),Ge(n),Ve(n,"link",a),e.head.appendChild(n),t.instance=n);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,wu(a,l.precedence,e));return t.instance}function wu(e,t,l){for(var a=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),n=a.length?a[a.length-1]:null,u=n,i=0;i title"):null)}function dy(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function _d(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function hy(e,t,l,a){if(l.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var n=Ua(a.href),u=t.querySelector(An(n));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Lu.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=u,Ge(u);return}u=t.ownerDocument||t,a=bd(a),(n=Et.get(n))&&ds(a,n),u=u.createElement("link"),Ge(u);var i=u;i._p=new Promise(function(f,o){i.onload=f,i.onerror=o}),Ve(u,"link",a),l.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Lu.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var ms=0;function my(e,t){return e.stylesheets&&e.count===0&&Vu(e,e.stylesheets),0ms?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(n)}}:null}function Lu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ku=null;function Vu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ku=new Map,t.forEach(yy,e),ku=null,Lu.call(e))}function yy(e,t){if(!(t.state.loading&4)){var l=ku.get(e);if(l)var a=l.get(null);else{l=new Map,ku.set(e,l);for(var n=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(h){console.error(h)}}return s(),_s.exports=Dy(),_s.exports}var Ry=Uy();class Ds extends Error{constructor(h,y,r){super(y),this.code=h,this.status=r,this.name="APIError"}code;status}async function $e(s,h){const y=await fetch(s,{...h,headers:h?.body?{"Content-Type":"application/json",...h.headers}:h?.headers});if(!y.ok){let r;try{r=await y.json()}catch{}throw new Ds(r?.error?.code??"request_failed",r?.error?.message??`Request failed with status ${y.status}`,y.status)}if(y.status!==204)return await y.json()}const Be={definitions:()=>$e("/api/definitions"),createDefinition:s=>$e("/api/definitions",{method:"POST",body:JSON.stringify({source:s})}),startTask:(s,h,y,r)=>$e("/api/runs",{method:"POST",body:JSON.stringify({definition_id:s,instructions:y,parameters:{task_title:y,task_mode:r},targets:[{repository:h}]})}),queue:()=>$e("/api/queue"),runs:()=>$e("/api/runs").then(s=>s??[]),run:s=>$e(`/api/runs/${encodeURIComponent(s)}`),job:s=>$e(`/api/jobs/${encodeURIComponent(s)}`),attempt:s=>$e(`/api/attempts/${encodeURIComponent(s)}`),attemptEvents:(s,h,y=200)=>$e(`/api/attempts/${encodeURIComponent(s)}/events?after=${h}&limit=${y}`),attemptGates:s=>$e(`/api/attempts/${encodeURIComponent(s)}/gates`).then(h=>h??[]),attemptEnvelopes:s=>$e(`/api/attempts/${encodeURIComponent(s)}/envelopes`).then(h=>h??[]),fleet:()=>$e("/api/workers"),worktrees:()=>$e("/api/worktrees").then(s=>s??[]),releaseWorktree:s=>$e(`/api/worktrees/${encodeURIComponent(s)}/release`,{method:"POST",body:JSON.stringify({confirm:!0})}),retryJob:s=>$e(`/api/jobs/${encodeURIComponent(s)}/retry`,{method:"POST"}),cancelJob:s=>$e(`/api/jobs/${encodeURIComponent(s)}/cancel`,{method:"POST"})};async function Cy(s){const h=(await Be.definitions()).find(y=>y.source===s);if(h)return h;try{return await Be.createDefinition(s)}catch(y){if(!(y instanceof Ds)||y.code!=="definition_exists")throw y;const r=(await Be.definitions()).find(M=>M.source===s);if(!r)throw y;return r}}function ti(s){if(!s)return null;try{const h=JSON.parse(s);return typeof h!="object"||h===null||Array.isArray(h)||h.phases!=null&&(!Array.isArray(h.phases)||h.phases.some(r=>!r||typeof r!="object"||typeof r.phase!="string"||typeof r.status!="string"))||[h.acceptance?.checks,...(h.phases??[]).map(r=>r.gates?.checks)].some(r=>r!=null&&(!Array.isArray(r)||r.some(M=>!M||typeof M!="object"||typeof M.item!="string"||typeof M.ok!="boolean")))?null:h}catch{return null}}function ei(s){return s.parameters?.task_title??s.parameters?.prompt?.replace(/^Trusted instructions:\s*/,"").split(` + +Untrusted context:`)[0].trim()??"Previous task"}function qn(s){return s.replace(/\/$/,"").split("/").pop()||s}function As(s){return s.state==="mixed"&&s.targets.length===1&&s.snapshot.includes('hold_when: "jig_ui_delivery != publish"')?s.parameters?.task_mode==="ask"?"complete":"ready":s.state}function Nl(s){if(!s)return null;const h=Date.parse(s);return Number.isNaN(h)?null:h}function $l(s){if(!Number.isFinite(s)||s<0)return"—";if(s<1e3)return`${Math.round(s)}ms`;const h=s/1e3;if(h<60)return`${h.toFixed(h<10?1:0)}s`;const y=Math.floor(h/60),r=Math.round(h-y*60);if(y<60)return`${y}m ${r}s`;const M=Math.floor(y/60);return`${M}h ${y-M*60}m`}function Ha(s){const h=Nl(s);return h===null?"—":new Date(h).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ns(s){return s.length>12?`${s.slice(0,8)}…`:s}function li(s){const h=Nl(s);return h===null?"—":new Date(h).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}const qy=new Set(["accepted","accepted_unpublished","failed","cancelled","lost"]);function ll(s){return qy.has(s)}function Hy(s){return{accepted:"Accepted",accepted_unpublished:"Accepted · not published",mixed:"Mixed results",live:"Online",stale:"Offline",active:"In progress",ready:"Ready to review",complete:"Complete"}[s]??s.replace(/_/g," ")}function Us(){const[s,h]=K.useState(()=>typeof document>"u"||document.visibilityState!=="hidden");return K.useEffect(()=>{const y=()=>h(document.visibilityState!=="hidden");return document.addEventListener("visibilitychange",y),()=>document.removeEventListener("visibilitychange",y)},[]),s}function Jd(s=1e3){const[h,y]=K.useState(()=>Date.now()),r=Us();return K.useEffect(()=>{if(!r||s<=0)return;const M=setInterval(()=>y(Date.now()),s);return()=>clearInterval(M)},[s,r]),h}function Ot(s,h,y){const[r,M]=K.useState(null),[R,z]=K.useState(null),[U,A]=K.useState(!0),[j,Y]=K.useState(0),C=Us(),J=K.useRef(s);J.current=s,K.useEffect(()=>{M(null),A(!0),z(null)},[y]),K.useEffect(()=>{let D=!1;const X=async()=>{try{const P=await J.current();if(D)return;M(P),z(null)}catch(P){D||z(P)}finally{D||A(!1)}};if(X(),!C||h<=0)return()=>{D=!0};const L=setInterval(X,h);return()=>{D=!0,clearInterval(L)}},[y,h,C,j]);const O=K.useCallback(()=>Y(D=>D+1),[]);return{data:r,error:R,loading:U,refresh:O}}function Yy(s,h,y=1e3){const[r,M]=K.useState([]),[R,z]=K.useState(null),U=K.useRef(0),A=K.useRef(0),[j,Y]=K.useState(0),C=Us(),J=ll(h);return K.useEffect(()=>{U.current=0,A.current=0,Y(0),M([]),z(null)},[s]),K.useEffect(()=>{let O=!1,D=null;const X=async()=>{try{const L=await Be.attemptEvents(s,U.current);if(O)return;const P=L.events??[];if(z(null),P.length===0){A.current+=1,J&&A.current>=2&&D&&(clearInterval(D),D=null);return}A.current=0;const $=Math.max(U.current,L.next_cursor);U.current=$,Y($),M(he=>By(he,P))}catch(L){O||z(L)}};return X(),C&&y>0&&(D=setInterval(()=>{X()},y)),()=>{O=!0,D&&clearInterval(D)}},[s,J,y,C]),{events:r,cursor:j,error:R}}function By(s,h){if(h.length===0)return s;const y=new Map;for(const r of s)y.set(r.seq,r);for(const r of h)y.has(r.seq)||y.set(r.seq,r);return[...y.values()].sort((r,M)=>r.seq-M.seq)}function Gy(s){const h=s.split("/").filter(Boolean);return h.length===0?{name:"tasks"}:h[0]==="queue"&&h.length===1?{name:"queue"}:h[0]==="runs"&&h.length===1?{name:"runs"}:h[0]==="runs"&&h.length===2?{name:"run",id:decodeURIComponent(h[1])}:h[0]==="jobs"&&h.length===2?{name:"job",id:decodeURIComponent(h[1])}:h[0]==="worktrees"&&h.length===1?{name:"worktrees"}:h[0]==="fleet"&&h.length===1?{name:"fleet"}:{name:"unknown",path:s}}function $d(s){window.history.pushState({},"",s),window.dispatchEvent(new PopStateEvent("popstate"))}function Qy(){const[s,h]=K.useState(()=>window.location.pathname);return K.useEffect(()=>{const y=()=>h(window.location.pathname);return window.addEventListener("popstate",y),()=>window.removeEventListener("popstate",y)},[]),Gy(s)}function Ht({state:s}){return c.jsxs("span",{className:`badge badge-${s}`,children:[c.jsx("span",{className:"dot"}),Hy(s)]})}function De({href:s,children:h,current:y=!1}){return c.jsx("a",{href:s,"aria-current":y?"page":void 0,onClick:r=>{r.metaKey||r.ctrlKey||r.shiftKey||(r.preventDefault(),$d(s))},children:h})}function Ue({error:s}){if(!s)return null;const h=s instanceof Ds?s.code:"request_failed";return c.jsxs("div",{className:"error-banner",role:"alert",children:[c.jsx("strong",{children:h})," ",s.message]})}function Ya({title:s,detail:h}){return c.jsxs("div",{className:"empty",children:[c.jsx("h2",{children:s}),c.jsx("p",{children:h})]})}function Ba({label:s}){return c.jsx("div",{className:"loading",role:"status",children:s})}function Xy(s,h){const y=Nl(h),r=Nl(s.last_heartbeat);return y===null||r===null?"—":`${$l(Math.max(y-r,0))} ago`}function wy(s){const h=s.runtimes??[];return h.length===0?"—":h.map(y=>`${y.name} ${y.version}`).join(", ")}function Zy(){const s=K.useCallback(()=>Be.fleet(),[]),{data:h,error:y,loading:r}=Ot(s,3e3,"fleet");if(r&&!h)return c.jsx(Ba,{label:"Loading fleet…"});if(!h)return c.jsx(Ue,{error:y});const M=h.workers??[],R=M.filter(z=>!z.live).reduce((z,U)=>z+U.active_count,0);return c.jsxs("div",{className:"view",children:[c.jsxs("header",{className:"view-header",children:[c.jsxs("div",{children:[c.jsx("h1",{children:"Workers"}),c.jsx("p",{className:"subtle",children:"Online workers execute queued jobs. Offline workers are saved records of previous sessions."}),c.jsxs("p",{className:"subtle",children:["Observed ",Ha(h.observed_at)]})]}),c.jsxs("div",{className:"counters",children:[c.jsxs("div",{className:"counter",children:[c.jsx("span",{className:"counter-value",children:h.live_count}),c.jsx("span",{className:"counter-label",children:"online"})]}),c.jsxs("div",{className:"counter",children:[c.jsx("span",{className:"counter-value",children:h.stale_count}),c.jsx("span",{className:"counter-label",children:"offline"})]}),c.jsxs("div",{className:"counter",children:[c.jsx("span",{className:"counter-value",children:h.available_slots}),c.jsx("span",{className:"counter-label",children:"free slots"})]})]})]}),c.jsx(Ue,{error:y}),M.length===0?c.jsx(Ya,{title:"No workers registered",detail:"Nothing can claim queued work until a worker registers. Start one with `jig worker`."}):c.jsxs(c.Fragment,{children:[c.jsxs("table",{className:"table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Worker"}),c.jsx("th",{children:"State"}),c.jsx("th",{children:"Runtime"}),c.jsx("th",{children:"Slots"}),c.jsx("th",{children:"Env"}),c.jsx("th",{children:"Last heartbeat"})]})}),c.jsx("tbody",{children:M.map(z=>c.jsxs("tr",{children:[c.jsxs("td",{children:[z.name,c.jsxs("p",{className:"subtle",children:[c.jsx("code",{children:z.id})," · ",z.worker_version]})]}),c.jsx("td",{children:c.jsx(Ht,{state:z.live?"live":"stale"})}),c.jsx("td",{children:wy(z)}),c.jsxs("td",{children:[z.active_count," / ",z.capacity]}),c.jsxs("td",{title:(z.env_names??[]).join(" "),children:[(z.env_names??[]).length," names"]}),c.jsx("td",{children:Xy(z,h.observed_at)})]},z.id))})]}),R>0&&c.jsxs("p",{className:"subtle",children:[R," attempt",R===1?" is":"s are"," leased to a worker that stopped heartbeating. The sweeper marks them lost after three missed beats of server uptime, and their jobs are then retryable."]})]})]})}const Ly=`# smoke.yaml — the install check (U11): one genuinely read-only agent phase +# that validates and passes on any repository. +# +# jig run --def examples/definitions/smoke.yaml . "what is this repo?" +# +# Read-only is enforced, not requested: the scout's write allowlist is +# empty, so any repository write rolls back and aborts the attempt (R10). +# The report travels in the envelope alone — no file artifacts, so no file +# gates; the verdict_consistent gate checks the envelope against ITSELF +# (an approval shipping blocking items, or a rejection naming no problem, +# is refuted without reading the repo), which makes it repo-independent. +name: smoke +roster: + scout: + model: haiku + system_prompt: | + You are a read-only scout examining a git repository. You never + create, modify, or delete any file in the repository — you only read, + and you report exclusively through your final JSON envelope. + user_prompt: | + Task: {{prompt}} + + Explore this repository (its layout, languages, build files, and + purpose) and answer the task in your report's "summary" field, in a + few sentences. + + Your final JSON must also include: + - "approved": true if you were able to read the repository and + complete the task, false otherwise + - "blocking": a list of strings naming anything that prevented you + (an empty list when nothing did) + env: [PATH] + writes: [] +phases: + - name: scout + kind: agent + owner: scout + gates: + - {name: verdict_consistent} +acceptance: [all_phases_passed, verdict_consistent] +`,ky=`# plan-build-test.yaml — the code-phase repair edge (U9, KTD2). Plan the +# change, build it, then run the repository's own test command; a failing +# test suite routes its adapter envelope back to the planner, runs the +# builder with the revised plan, and re-runs the suite, budget bounded. +# +# jig run --def examples/definitions/plan-build-test.yaml "add a --version flag" +# +# The repair edge is the whole point. A code phase's failure is nonzero exit +# (R8), and the adapter envelope that carries the exit status and output tail +# enters the repair loop through exactly the same door an agent's failing +# report would — so "the tests broke" is a workflow state, not an incident. +# \`budget: 3\` bounds it and \`exhausted: fail-job\` means a suite that is still +# red after three repair rounds fails the job rather than shipping. +# +# TWO THINGS TO EDIT before using this on your own repository: +# +# 1. The test phase's command. It detects the common entry points, and +# fails loudly when it finds none — an undetected test command must +# never look like a green run. Replace it with your repository's real +# command. +# 2. The builder's \`writes\` allowlist. \`**\` permits every path in the +# worktree, which is the honest default for an open-ended build but the +# weakest write boundary jig can enforce (R10). Narrow it to the +# directories the work belongs in. +# +# THE ROSTER. The builder writes the code, so it runs on \`opus\`; the planner +# only reads and plans, on \`sonnet\`. \`effort: medium\` sets how much the +# builder thinks and verifies while building to a plan — the test phase is +# its check. Leave \`effort\` out to take the CLI's default for the model. +name: plan-build-test +roster: + planner: + model: sonnet + system_prompt: | + You are a read-only planner working in a git repository. You never + create, modify, or delete any file; you produce a plan the builder + will execute, and you report exclusively through your final JSON + envelope. + user_prompt: | + Task: {{prompt}} + + Read enough of this repository to plan the change: which files to + touch, in what order, and how the result will be verified by the + repository's own test command. + + If the previous report contains failed tests, diagnose that failure + and revise the plan before the builder runs again. Pass the failure + evidence and a concrete repair directive in notes_for_next_agent. + Preserve the user's scope. Never weaken tests to make them pass. + + Your final JSON must also include: + - "notes_for_next_agent": the plan itself, concrete enough to + execute without re-deriving it + env: [PATH] + writes: [] + builder: + model: opus + effort: medium + system_prompt: | + You are a builder working in a git repository. You execute the plan + you are handed, you write only what the task requires, and you report + honestly: claim only files you actually created or modified. + + When you are handed a failing test result, fix the cause the failure + names. Do not weaken, skip, or delete a test to make it pass. + user_prompt: | + Task: {{prompt}} + + The plan and any previous phase's report are above. Make the change, + then stop — the test suite runs as its own phase. + On repairs, report all paths changed relative to the original commit, + including changes already present from the previous build. + + Your final JSON must also include: + - "changed_files": the repo-relative paths of every file you + created or modified + - "artifacts": the same paths, for existence verification + env: [PATH] + writes: ["**"] +phases: + - name: plan + kind: agent + owner: planner + - name: build + kind: agent + owner: builder + gates: + - {name: artifacts_exist} + - {name: diff_matches_claims} + - name: test + kind: code + owner: builder + command: > + if [ -f Justfile ] || [ -f justfile ]; then just test; + elif [ -f Makefile ]; then make test; + elif [ -f go.mod ]; then go test ./...; + elif [ -f package.json ]; then npm test --silent; + else echo "plan-build-test: no test command detected — edit the test phase"; exit 1; fi + on_fail: {run: plan, then: rerun-chain, budget: 3, exhausted: fail-job} +acceptance: [all_phases_passed, artifacts_exist, diff_matches_claims] +`,Wd="Inspect this project, choose one useful improvement supported by the code, write a concrete directive and implementation plan, build it, and verify it with the existing tests. Keep the change focused. Do not add paid services or change deployment, authentication, secrets, or security policy. Do not weaken tests. Report the chosen improvement, changes, and verification.",Vy="gpt-6.1-sol",Ky={ask:["scout"],build:["plan","build","test"],auto:["plan","build","test"]};async function Jy(s,h,y=""){let r=(s==="ask"?Ly:ky).replace(/^(\s*)model: .+$/gm,(R,z)=>`${z}model: ${JSON.stringify(h.trim())}`);s==="auto"&&(r=r.replace(" Task: {{prompt}}",` Goal or limits: {{prompt}} + + Inspect the project and choose one focused, useful improvement that + fits this goal. You own the directive: do not ask the user to write it. + Put the chosen directive in summary, and the concrete implementation + plan and failure evidence in notes_for_next_agent. The builder will + execute your plan automatically. Avoid paid services and changes to + deployment, authentication, secrets, or security policy.`)),s!=="ask"&&y.trim()&&(r=r.replace(/ command: >\n(?: .*\n)+/,()=>` command: ${JSON.stringify(y.trim())} +`)),r=r.replace(/^acceptance:/m,` - name: keep-local + kind: code + reports_fields: true + command: "printf '%s\\n' '{\\"jig_ui_delivery\\":\\"local\\"}'" +acceptance:`),r+=` +publish: + hold_when: "jig_ui_delivery != publish" +`;const M=Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(r)))).map(R=>R.toString(16).padStart(2,"0")).join("").slice(0,16);return r.replace(/^name: .+$/m,`name: jig-task-${s}-${M}`)}function $y(){const s=K.useCallback(()=>Be.runs(),[]),h=Ot(s,3e3,"tasks"),y=K.useCallback(()=>Be.fleet(),[]),r=Ot(y,3e3,"task-workers"),[M,R]=K.useState(()=>new URLSearchParams(window.location.search).get("project")??localStorage.getItem("jig-project")??""),[z,U]=K.useState(""),[A,j]=K.useState(()=>{const ee=new URLSearchParams(window.location.search).get("mode");return ee==="ask"||ee==="build"?ee:"auto"}),[Y,C]=K.useState(Vy),[J,O]=K.useState(""),[D,X]=K.useState(!1),[L,P]=K.useState(null),$=(r.data?.workers??[]).some(ee=>ee.live&&ee.runtimes?.some(Ee=>Ee.name==="codex")),he=[...new Set((h.data??[]).flatMap(ee=>ee.targets.map(Ee=>Ee.repository)))],Z=async ee=>{if(ee.preventDefault(),!(D||!M.trim()||A!=="auto"&&!z.trim()||!Y.trim()||!$||r.error)){X(!0),P(null);try{const Ee=await Cy(await Jy(A,Y,J)),le=await Be.startTask(Ee.id,M.trim(),z.trim()||Wd,A);try{localStorage.setItem("jig-project",M.trim())}catch{}$d(`/runs/${le.run.id}`)}catch(Ee){P(Ee)}finally{X(!1)}}};return c.jsxs("div",{className:"view workspace",children:[c.jsxs("header",{className:"view-header workspace-hero",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"IDEA IN. WORKING SOFTWARE OUT."}),c.jsxs("h1",{children:["Make your ",c.jsx("span",{children:"next move."})]}),c.jsx("p",{className:"subtle",children:"Give agents a project. They find the work, build it, and prove it."})]}),c.jsxs("div",{className:"runtime-status",children:[c.jsx(Ht,{state:$&&!r.error?"live":"stale"}),c.jsx("span",{children:"Codex connection"})]})]}),c.jsxs("div",{className:"workspace-grid",children:[c.jsxs("form",{className:"panel task-form",onSubmit:ee=>{Z(ee)},children:[c.jsxs("div",{className:"composer-heading",children:[c.jsx("span",{className:"eyebrow",children:"THE WORKBENCH"}),c.jsx("h2",{children:"Let’s build something."}),c.jsx("span",{className:"composer-mark","aria-hidden":"true",children:"↗"})]}),c.jsxs("fieldset",{disabled:D,children:[c.jsx("label",{htmlFor:"project",children:"1. Project"}),c.jsx("input",{id:"project",list:"projects",placeholder:"Paste a local folder path or GitHub repository",required:!0,value:M,onChange:ee=>R(ee.target.value)}),c.jsx("datalist",{id:"projects",children:he.map(ee=>c.jsx("option",{value:ee,children:qn(ee)},ee))}),c.jsx("p",{className:"subtle",children:"Use a Git project. Work starts from its latest commit; uncommitted edits are not included."}),c.jsxs("fieldset",{className:"mode-choice",children:[c.jsx("legend",{children:"2. What result do you want?"}),c.jsxs("label",{className:A==="auto"?"selected":"",children:[c.jsx("input",{type:"radio",name:"mode",value:"auto",checked:A==="auto",onChange:()=>j("auto")}),c.jsxs("span",{children:[c.jsx("strong",{children:"Let agents improve it"}),c.jsx("small",{children:"Agents choose the directive, plan, build, and test. No task-writing required."})]})]}),c.jsxs("label",{className:A==="ask"?"selected":"",children:[c.jsx("input",{type:"radio",name:"mode",value:"ask",checked:A==="ask",onChange:()=>j("ask")}),c.jsxs("span",{children:[c.jsx("strong",{children:"Get an answer"}),c.jsx("small",{children:"Research and recommendations. No files changed."})]})]}),c.jsxs("label",{className:A==="build"?"selected":"",children:[c.jsx("input",{type:"radio",name:"mode",value:"build",checked:A==="build",onChange:()=>j("build")}),c.jsxs("span",{children:[c.jsx("strong",{children:"Make changes"}),c.jsx("small",{children:"Edit files, run tests, and prepare work for review."})]})]})]}),c.jsx("p",{className:"subtle",children:A==="ask"?"Read-only. Codex reads the project and gives you an answer.":"Plan → build → test. Failed tests restart the loop automatically, up to three repair rounds. Changes stay local."}),c.jsxs("details",{className:"goal-options",open:A!=="auto",children:[c.jsx("summary",{children:A==="auto"?"Add a goal or limits (optional)":"Your directive"}),c.jsx("label",{htmlFor:"task",children:A==="auto"?"3. Goal or limits (optional)":"3. What should Codex do?"}),c.jsx("textarea",{id:"task",required:A!=="auto",rows:5,maxLength:2e4,placeholder:A==="auto"?"Leave blank: agents inspect the project and choose one useful improvement. Or give a goal, such as make installation easier.":A==="ask"?"Explain what this project does and how I can use it.":"Describe the change you want and what a working result looks like.",value:z,onChange:ee=>U(ee.target.value)})]}),c.jsxs("details",{className:"evidence",children:[c.jsx("summary",{children:"Options"}),c.jsx("label",{htmlFor:"model",children:"Codex model"}),c.jsx("input",{id:"model",required:!0,value:Y,onChange:ee=>C(ee.target.value)}),A!=="ask"&&c.jsxs(c.Fragment,{children:[c.jsx("label",{htmlFor:"test-command",children:"Test command"}),c.jsx("input",{id:"test-command",placeholder:"Leave blank to detect the project's test command",value:J,onChange:ee=>O(ee.target.value)})]})]}),c.jsx(Ue,{error:L}),c.jsx(Ue,{error:r.error}),c.jsxs("div",{className:"start-row",children:[c.jsx("button",{className:"primary",type:"submit",disabled:D||!$||!!r.error||!M.trim()||A!=="auto"&&!z.trim()||!Y.trim(),children:D?"Starting…":"Start task"}),c.jsx("span",{className:"subtle",children:$?"Uses your signed-in Codex. Results stay local.":r.loading?"Checking Codex…":"Codex is offline. Check Workers before starting."})]}),c.jsxs("p",{className:"task-intent",children:[c.jsx("strong",{children:A==="ask"?"This task will return an answer.":"This task will change files in a separate working folder."})," ",A==="ask"?"Choose Make changes if you want Codex to implement something.":"Your original project stays untouched until you review and apply the changes."]})]})]}),c.jsxs("aside",{className:"recent-work","aria-label":"Recent work",children:[c.jsxs("header",{className:"view-header",children:[c.jsxs("div",{children:[c.jsx("span",{className:"eyebrow",children:"IN THE FACTORY"}),c.jsx("h2",{children:"Recent tasks"})]}),c.jsx(De,{href:"/runs",children:"View all →"})]}),c.jsx(Ue,{error:h.error}),c.jsx("div",{className:"task-cards",children:(h.data??[]).slice(0,6).map(ee=>c.jsx(Fd,{run:ee},ee.id))}),!h.loading&&h.data?.length===0&&c.jsx("p",{className:"subtle",children:"Your first task will appear here when you press Start."}),c.jsxs("div",{className:"loop-guide",children:[c.jsx("span",{className:"eyebrow",children:"THE AGENT LOOP"}),c.jsxs("div",{children:[c.jsx("span",{children:"01"}),c.jsx("strong",{children:"Plan"}),c.jsx("p",{children:"Find a useful change. Write the directive."})]}),c.jsxs("div",{children:[c.jsx("span",{children:"02"}),c.jsx("strong",{children:"Build"}),c.jsx("p",{children:"Turn the plan into working code."})]}),c.jsxs("div",{children:[c.jsx("span",{children:"03"}),c.jsx("strong",{children:"Verify"}),c.jsx("p",{children:"Run tests. Replan and repair if they fail."})]}),c.jsx("p",{className:"subtle",children:"Up to three repair rounds. Results stay local."})]})]})]})]})}function Fd({run:s}){const h=ei(s)===Wd?"Agent-led improvement":ei(s).split(` +`)[0].replace(/^>\s*/,"");return c.jsxs("article",{className:`panel task-card task-card-${As(s)}`,children:[c.jsxs("div",{className:"task-card-meta",children:[c.jsx("span",{className:"task-project",children:s.targets.map(y=>qn(y.repository)).join(", ")}),c.jsx(Ht,{state:As(s)})]}),c.jsx("h3",{children:c.jsx(De,{href:`/runs/${s.id}`,children:h})}),c.jsx("p",{className:"subtle",children:li(s.created_at)}),c.jsx(De,{href:`/runs/${s.id}`,children:"Open task →"})]})}function Wy(){const s=K.useCallback(()=>Be.queue(),[]),{data:h,error:y,loading:r}=Ot(s,2e3,"queue"),M=K.useCallback(()=>Be.fleet(),[]),R=Ot(M,3e3,"queue-workers");if(r&&!h)return c.jsx(Ba,{label:"Loading queue…"});if(!h)return c.jsx(Ue,{error:y});const z=h.entries??[];return c.jsxs("div",{className:"view",children:[c.jsxs("header",{className:"view-header",children:[c.jsxs("div",{children:[c.jsx("h1",{children:"Work queue"}),c.jsx("p",{className:"subtle",children:"Live work appears here. Completed and older runs are in Run history."}),c.jsxs("p",{className:"subtle",children:["Observed ",Ha(h.observed_at)]})]}),c.jsxs("div",{className:"counters",children:[c.jsxs("div",{className:"counter",children:[c.jsx("span",{className:"counter-value",children:h.depth}),c.jsx("span",{className:"counter-label",children:"queued"})]}),c.jsxs("div",{className:"counter",children:[c.jsx("span",{className:"counter-value",children:h.active_count}),c.jsx("span",{className:"counter-label",children:"running"})]})]})]}),c.jsx(Ue,{error:y}),c.jsxs("section",{className:"panel readiness","aria-label":"Worker readiness",children:[c.jsx("h2",{children:R.data?`${R.data.live_count} worker${R.data.live_count===1?"":"s"} online`:"Checking workers…"}),c.jsx("p",{children:R.data?.live_count?`Ready runtimes: ${(R.data.workers??[]).filter(U=>U.live).flatMap(U=>(U.runtimes??[]).map(A=>A.name)).join(", ")}. Jobs start when a compatible worker has a free slot.`:"Jobs need an online worker before they can start."}),c.jsx(De,{href:"/fleet",children:"View workers →"}),c.jsx(Ue,{error:R.error})]}),z.length===0?c.jsxs("section",{className:"panel",children:[c.jsx("h2",{children:"No work is running"}),c.jsx("p",{children:"The queue is empty. Opening an old run does not restart it."}),c.jsx("p",{children:c.jsx(De,{href:"/",children:"Start a new task →"})}),c.jsx(De,{href:"/runs",children:"Browse previous results →"})]}):c.jsxs("table",{className:"table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"#"}),c.jsx("th",{children:"Repository"}),c.jsx("th",{children:"Definition"}),c.jsx("th",{children:"State"}),c.jsx("th",{children:"Attempt"}),c.jsx("th",{children:"Enqueued"})]})}),c.jsx("tbody",{children:z.map(U=>c.jsxs("tr",{children:[c.jsx("td",{children:U.position??"—"}),c.jsx("td",{children:c.jsx(De,{href:`/jobs/${U.job_id}`,children:U.repository})}),c.jsx("td",{children:U.definition??"—"}),c.jsx("td",{children:c.jsx(Ht,{state:U.state})}),c.jsx("td",{children:U.attempt?c.jsxs(c.Fragment,{children:["#",U.attempt.attempt_number," ",c.jsx(Ht,{state:U.attempt.state})]}):"—"}),c.jsx("td",{children:Ha(U.enqueued_at)})]},U.job_id))})]})]})}function Fy(){const s=K.useCallback(()=>Be.runs(),[]),{data:h,error:y,loading:r}=Ot(s,4e3,"runs");return r&&!h?c.jsx(Ba,{label:"Loading runs…"}):h?c.jsxs("div",{className:"view",children:[c.jsx("header",{className:"view-header",children:c.jsxs("div",{children:[c.jsx("h1",{children:"My tasks"}),c.jsx("p",{className:"subtle",children:"Open a task to follow its progress or read the result."})]})}),c.jsx(Ue,{error:y}),h.length===0?c.jsx(Ya,{title:"No tasks yet",detail:"Start a task from the New task page."}):c.jsx("div",{className:"task-cards",children:h.map(M=>c.jsx(Fd,{run:M},M.id))})]}):c.jsx(Ue,{error:y})}function Kd(s,h){return Nl(s.started_at)??h}function qa(s,h){const y=s.payload;if(!y||typeof y!="object")return;const r=y[h];return typeof r=="string"?r:void 0}function Iy(s,h){const y=[...h].sort((D,X)=>D.seq-X.seq),r=Nl(s.started_at)??Nl(s.created_at)??0,M=y.length?Kd(y[0],r):r,R=Math.min(r||M,M),z=[],U=[],A=[],j=new Map;let Y=null,C=R;const J=D=>{Y&&Y.endMs===null&&(Y.endMs=Math.max(D,Y.startMs)),Y=null};for(const D of y){const X=Kd(D,C);C=Math.max(C,X);const L=D.phase??"";switch(Y&&(Y.phase===L||D.type==="phase_end")&&J(X),D.type){case"phase_start":{const P={key:`phase-${D.seq}`,label:L,phase:L,startMs:X,endMs:null,kind:"phase"};z.push(P),j.set(L,P);break}case"phase_end":case"phase_death":{const P=j.get(L);P&&(P.endMs=X,P.status=D.type==="phase_death"?"death":qa(D,"status")??"unknown",j.delete(L)),D.type==="phase_death"&&A.push({key:`mark-${D.seq}`,label:"phase death",phase:L,atMs:X,kind:"error",detail:qa(D,"cause")??qa(D,"error")});break}case"tool_call":{const P={key:`tool-${D.seq}`,label:D.name??"tool",phase:L,startMs:X,endMs:null,kind:"tool"};U.push(P),Y=P;break}case"gate_pass":case"gate_fail":A.push({key:`mark-${D.seq}`,label:D.name??"gate",phase:L,atMs:X,kind:D.type});break;case"handoff":A.push({key:`mark-${D.seq}`,label:"handoff",phase:L,atMs:X,kind:"handoff",detail:qa(D,"summary")});break;case"error":A.push({key:`mark-${D.seq}`,label:D.name??"error",phase:L,atMs:X,kind:"error",detail:qa(D,"error")??qa(D,"reason")});break}}const O=Nl(s.completed_at);if(O!==null){const D=ti(s.result)?.phases?.slice().reverse()??[];J(Math.max(O,C));for(const X of j.values())X.endMs===null&&(X.endMs=Math.max(O,C)),X.status=D.find(L=>L.phase===X.phase)?.status??"stopped"}return{attemptId:s.id,attemptNumber:s.attempt_number,state:s.state,startMs:R,endMs:O,phases:z,tools:U,marks:A,eventCount:y.length}}function Py(s,h){if(s.endMs!==null)return Math.max(s.endMs,s.startMs+1);const y=Math.max(s.startMs,...s.phases.map(r=>r.endMs??r.startMs),...s.tools.map(r=>r.endMs??r.startMs),...s.marks.map(r=>r.atMs));return Math.max(h,y,s.startMs+1)}function Rs(s,h){return Math.max(0,(s.endMs??h)-s.startMs)}function Id(s,h,y){const r=Math.max(1,y-h);return Math.min(100,Math.max(0,(s.startMs-h)/r*100))}function Pd(s,h,y,r){const M=Math.max(1,y-h),R=Rs(s,r)/M*100;return Math.min(100,Math.max(1.5,R))}function Ms(s){const h=ti(s.result),y=h?.publish,r=y&&typeof y=="object"?y.code:void 0;if(s.state==="queued")return{title:"Waiting for a worker",detail:"This attempt has not started.",next:"Check Workers for an online worker with the workflow's runtime and a free slot."};if(s.state==="preparing")return{title:"Preparing the repository",detail:"The worker is setting up an isolated worktree.",next:"Wait for the first phase to start; the page updates automatically."};if(s.state==="running")return{title:"Work is running",detail:"The worker is executing the workflow and its checks.",next:"Follow the current phase below. Failed checks can trigger the workflow's bounded repair loop."};if(s.state==="accepted")return{title:"Work accepted",detail:"This attempt passed Jig's acceptance checks.",next:"Review the agent's result and any published pull request below."};if(s.state==="accepted_unpublished")return h?.publish_hold?.startsWith('publish.hold_when "jig_ui_delivery != publish" held')&&(y==="held"||typeof y=="object"&&y?.state==="held")?{title:"Task complete · kept local",detail:"The task passed its checks. Your result is ready, and any changes remain in the separate working folder.",next:"Read the result below. For a build task, review the saved changes before applying them to your project."}:r==="publish_empty_changeset"||s.error?.includes("(publish_empty_changeset)")?{title:"Checks passed · nothing to publish",detail:"The workflow passed its acceptance checks, but the worktree had no new commit to publish. Read-only assessments can legitimately produce no changes.",next:"Read the assessment below. If the task required edits, review why the builder produced no changes; retrying publication alone will not fix that."}:y==="held"||typeof y=="object"&&y?.state==="held"?{title:"Checks passed · awaiting review",detail:"The workflow deliberately held publication for human review.",next:"Review the result and retained worktree before releasing the publication hold."}:y==="not_attempted"&&!s.error?{title:"Checks passed · publication not attempted",detail:"The recorded result does not include a completed publication step.",next:"Read the result below; a direct run does not publish a branch or pull request."}:{title:"Checks passed · publication incomplete",detail:"The coding workflow passed, but delivery did not finish. The diagnostic below records where it stopped.",next:"Resolve the publication or CI problem before retrying publication; rerunning the coding workflow is a separate action."};if(s.state==="cancelled")return{title:"Work cancelled",detail:"This attempt stopped without an accepted result.",next:"Inspect the recorded work before submitting a new task."};if(s.state==="lost")return{title:"Worker connection lost",detail:"Jig stopped receiving the worker's heartbeat.",next:"Check Workers and the retained worktree. Retry the failed job once the worker is available."};if(s.error?.includes("outside its write allowlist"))return{title:"Stopped at the write boundary",detail:"The agent modified a path the workflow did not allow. Jig stopped the attempt; the diagnostic records its rollback result.",next:"For a read-only task, remove commands that write caches or files. For an editing task, check the permitted paths before submitting a revised workflow."};const M=h?.phases?.slice().reverse().find(R=>R.status==="fail");return{title:M?`Stopped in ${M.phase}`:"Work did not pass",detail:"The attempt did not meet Jig's acceptance requirements. Inspect the diagnostic and failed checks below.",next:"Fix the cause before retrying. A retry uses the same frozen workflow; prompt, model, or workflow changes require a new run."}}function ev({lane:s,nowMs:h,onSelectPhase:y}){const r=Py(s,h),M=Math.max(1,r-s.startMs),R=s.endMs===null;return c.jsxs("section",{className:"lane","aria-label":`attempt ${s.attemptNumber} swim lane`,children:[c.jsxs("header",{className:"lane-header",children:[c.jsxs("h3",{children:["Attempt ",s.attemptNumber]}),c.jsx(Ht,{state:s.state}),c.jsxs("span",{className:"lane-meta",children:[$l(M)," · ",s.eventCount," events",R?" · live":""]})]}),s.phases.length===0&&s.tools.length===0?c.jsx("p",{className:"lane-empty",children:"No trace events for this attempt yet."}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"lane-track",role:"list","aria-label":"phases",children:[s.phases.map(z=>c.jsx(tv,{span:z,startMs:s.startMs,endMs:r,nowMs:h,onSelect:y},z.key)),s.marks.map(z=>c.jsx(lv,{mark:z,startMs:s.startMs,endMs:r},z.key))]}),s.tools.length>0&&c.jsxs("details",{className:"evidence",open:R,children:[c.jsxs("summary",{children:["Tool activity · ",s.tools.length," calls"]}),c.jsx("ol",{className:"tool-list","aria-label":`attempt ${s.attemptNumber} tool calls`,children:s.tools.map(z=>c.jsx(av,{span:z,startMs:s.startMs,endMs:r,nowMs:h},z.key))})]})]})]})}function tv({span:s,startMs:h,endMs:y,nowMs:r,onSelect:M}){const R=$l(Rs(s,r)),z=s.status??"running";return c.jsxs("button",{type:"button",role:"listitem",className:`phase-block phase-${z}`,style:{left:`${Id(s,h,y)}%`,width:`${Pd(s,h,y,r)}%`},"aria-label":`phase ${s.label}, ${z}, ${R}`,onClick:()=>M?.(s.phase),children:[c.jsx("span",{className:"phase-name",children:s.label}),c.jsx("span",{className:"phase-duration",children:R})]})}function lv({mark:s,startMs:h,endMs:y}){const r=Math.max(1,y-h),M=Math.min(100,Math.max(0,(s.atMs-h)/r*100));return c.jsx("span",{className:`mark mark-${s.kind}`,style:{left:`${M}%`},title:`${s.label}${s.detail?`: ${s.detail}`:""} (${Ha(new Date(s.atMs).toISOString())})`,"aria-label":`${s.kind.replace("_"," ")} ${s.label}`})}function av({span:s,startMs:h,endMs:y,nowMs:r}){const M=s.endMs===null,R=$l(Rs(s,r));return c.jsxs("li",{className:"tool-row",children:[c.jsx("span",{className:"tool-name",children:s.label}),c.jsx("span",{className:"tool-track",children:c.jsx("span",{className:M?"tool-span tool-running":"tool-span",style:{marginLeft:`${Id(s,h,y)}%`,width:`${Pd(s,h,y,r)}%`}})}),c.jsxs("span",{className:"tool-duration",children:[R,M?" (running)":""]})]})}function nv({runID:s}){const h=K.useCallback(()=>Be.run(s),[s]),{data:y,error:r,loading:M}=Ot(h,3e3,`run:${s}`),R=Jd();if(M&&!y)return c.jsx(Ba,{label:"Loading run…"});if(!y)return c.jsx(Ue,{error:r});const z=Object.entries(y.run.parameters??{});return c.jsxs("div",{className:"view",children:[c.jsxs("p",{children:[c.jsx(De,{href:"/",children:"← New task"})," · ",c.jsx(De,{href:"/runs",children:"My tasks"})]}),c.jsxs("header",{className:"view-header",children:[c.jsxs("div",{children:[c.jsx("h1",{children:y.run.targets.map(U=>qn(U.repository)).join(", ")}),c.jsxs("p",{className:"subtle",children:[y.run.targets.map(U=>qn(U.repository)).join(", ")," · ",li(y.run.created_at)]})]}),c.jsx(Ht,{state:As(y.run)})]}),c.jsx(Ue,{error:r}),c.jsxs("section",{className:"panel directive",children:[c.jsx("h2",{children:y.run.parameters?.task_mode==="auto"?"Agents choose the directive":y.run.parameters?.task_mode==="build"?"Directive · make changes":"Question · get an answer"}),c.jsxs("details",{open:ei(y.run).length<=250,children:[c.jsx("summary",{children:"View your instructions"}),c.jsx("p",{children:ei(y.run)})]}),c.jsx("p",{className:"subtle",children:y.run.parameters?.task_mode==="auto"||y.run.parameters?.task_mode==="build"?"Agents plan, build, and test automatically. Failed tests return to planning for up to three repair rounds. Changes stay in the saved working folder.":"Codex reads this project and returns an answer. This task does not implement the recommendations."})]}),z.length>0&&c.jsxs("details",{className:"evidence",children:[c.jsx("summary",{children:"Task settings"}),c.jsx("dl",{className:"parameters",children:z.map(([U,A])=>c.jsxs("div",{children:[c.jsx("dt",{children:U}),c.jsx("dd",{children:A})]},U))})]}),y.jobs.length>1&&c.jsxs("section",{className:"panel","aria-label":"Run overview",children:[c.jsxs("h2",{children:[y.jobs.length," repositories"]}),c.jsxs("p",{children:[y.jobs.filter(U=>U.state==="active").length," running · ",y.jobs.filter(U=>U.state==="queued").length," waiting · ",y.jobs.filter(U=>U.state==="failed").length," failed · ",y.jobs.filter(U=>U.state==="accepted_unpublished").length," unpublished"]}),c.jsx("p",{className:"subtle",children:"Acceptance checks verify the workflow. Read each agent's assessment to see its conclusion about the repository."}),c.jsx("ul",{className:"repository-list",children:y.jobs.map(U=>c.jsxs("li",{children:[c.jsx("a",{href:`#job-${U.id}`,children:U.repository})," · ",c.jsx(Ht,{state:U.state})]},U.id))})]}),y.jobs.length===0?c.jsx(Ya,{title:"No jobs",detail:"This run admitted no targets."}):y.jobs.map(U=>c.jsx(eh,{jobID:U.id,nowMs:R,compact:!0,taskMode:y.run.parameters?.task_mode==="auto"?"auto":y.run.parameters?.task_mode==="build"?"build":y.run.parameters?.task_mode==="ask"?"ask":void 0},U.id))]})}function uv({jobID:s}){const h=Jd();return c.jsx("div",{className:"view",children:c.jsx(eh,{jobID:s,nowMs:h,standalone:!0,compact:!0})})}function eh({jobID:s,nowMs:h,standalone:y=!1,compact:r=!1,taskMode:M}){const R=K.useCallback(()=>Be.job(s),[s]),{data:z,error:U,loading:A,refresh:j}=Ot(R,3e3,`job:${s}`),[Y,C]=K.useState(null),[J,O]=K.useState(!1),D=async $=>{O(!0);try{$==="retry"?await Be.retryJob(s):await Be.cancelJob(s),C(null),j()}catch(he){C(he)}finally{O(!1)}};if(A&&!z)return c.jsx(Ba,{label:"Loading job…"});if(!z)return c.jsx(Ue,{error:U});const X=z.attempts??[],L=X.at(-1),P=L&&Ms(L).title==="Task complete · kept local";return c.jsxs("section",{className:"panel",id:`job-${s}`,children:[c.jsxs("header",{className:"panel-header",children:[c.jsxs("div",{children:[c.jsx("h2",{children:r?qn(z.job.repository):z.job.repository}),r&&c.jsx("p",{className:"subtle",children:z.job.repository}),!r&&c.jsxs("p",{className:"subtle",children:[z.definition?`${z.definition} · `:"","base ",z.job.base_sha.slice(0,12)," ·"," ",y?c.jsxs(De,{href:`/runs/${z.run_id}`,children:["run ",Ns(z.run_id)]}):c.jsxs(De,{href:`/jobs/${z.job.id}`,children:["job ",Ns(z.job.id)]})]})]}),c.jsxs("div",{className:"panel-actions",children:[c.jsx(Ht,{state:P?M==="ask"?"complete":"ready":z.job.state}),z.job.state==="failed"&&c.jsx("button",{type:"button",disabled:J,onClick:()=>{D("retry")},children:"Retry same workflow"}),["queued","active"].includes(z.job.state)&&c.jsx("button",{type:"button",disabled:J||z.job.cancellation_requested,onClick:()=>{D("cancel")},children:z.job.cancellation_requested?"Cancellation requested":"Cancel"})]})]}),c.jsx(Ue,{error:Y}),c.jsx(Ue,{error:U}),X.length>1&&c.jsxs("details",{className:"evidence",children:[c.jsxs("summary",{children:["Compare ",X.length," attempts"]}),c.jsxs("table",{className:"table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Attempt"}),c.jsx("th",{children:"Runtime"}),c.jsx("th",{children:"Outcome"}),c.jsx("th",{children:"Started"})]})}),c.jsx("tbody",{children:X.map($=>c.jsxs("tr",{children:[c.jsxs("td",{children:["#",$.attempt_number]}),c.jsx("td",{children:$.runtime_name??"Not recorded"}),c.jsx("td",{children:Ms($).title}),c.jsx("td",{children:li($.started_at??$.created_at)})]},$.id))})]}),c.jsx("p",{className:"subtle",children:"A different outcome is evidence to inspect, not proof of better quality. Each attempt's checks and results remain below."})]}),z.worktree&&c.jsxs("p",{className:"notice",children:[r?"Saved working folder: ":"Worktree retained at ",c.jsx("code",{children:z.worktree.path}),!r&&c.jsxs(c.Fragment,{children:[" — ",z.worktree.reason," ",c.jsx(De,{href:"/worktrees",children:"release it"})]})]}),(z.publish??[]).length>0&&c.jsx("ul",{className:"publish",children:(z.publish??[]).map($=>c.jsxs("li",{children:[c.jsx("strong",{children:$.step})," ",$.branch,$.pr_url?c.jsxs(c.Fragment,{children:[" ",c.jsx("a",{href:$.pr_url,rel:"noreferrer noopener",target:"_blank",children:"pull request"})]}):null]},`${$.attempt_id}-${$.step}`))}),X.length===0?c.jsx(Ya,{title:"No attempts yet",detail:"This job is waiting for a worker to claim it."}):X.map($=>c.jsx(iv,{attempt:$,nowMs:h,compact:r,taskMode:M},$.id)),r&&L&&ll(L.state)&&c.jsxs("section",{className:"next-action",children:[c.jsx("h3",{children:"What next?"}),c.jsx("p",{children:M==="ask"?"Turn a recommendation into work. Write one clear change you want Codex to make.":"Review the result and saved working folder above. You can also give Codex a new directive."}),c.jsx(De,{href:`/?project=${encodeURIComponent(z.job.repository)}&mode=build`,children:"Make changes to this project →"}),c.jsx("span",{children:" · "}),c.jsx(De,{href:`/?project=${encodeURIComponent(z.job.repository)}&mode=ask`,children:"Ask another question →"}),c.jsx("p",{children:c.jsx(De,{href:`/?project=${encodeURIComponent(z.job.repository)}&mode=auto`,children:"Let agents choose the next improvement →"})})]})]})}function iv({attempt:s,nowMs:h,compact:y=!1,taskMode:r}){const{events:M,error:R}=Yy(s.id,s.state),z=K.useMemo(()=>Iy(s,M),[s,M]),[U,A]=K.useState(null),j=Ms(s),Y=ll(s.state)?void 0:z.phases.slice().reverse().find(Z=>Z.endMs===null),C=ti(s.result)?.phases??[],J=r?Ky[r]:[...new Set(z.phases.map(Z=>Z.phase))],O=c.jsx(ev,{lane:z,nowMs:h,onSelectPhase:A}),D=M.filter(Z=>Z.phase!=="keep-local"&&(Z.type==="tool_call"||Z.type==="log"&&["agent_text","repair_edge","repair_exhausted"].includes(Z.name??"")||["phase_start","phase_end","gate_fail","error"].includes(Z.type))).slice(-6),X=M.at(-1),L=M.slice().reverse().find(Z=>Z.type==="handoff"&&Z.phase==="plan"),P=L?.payload&&typeof L.payload=="object"&&"summary"in L.payload&&typeof L.payload.summary=="string"?L.payload.summary:null,$=M.slice().reverse().find(Z=>Z.type==="log"&&Z.name==="agent_text"),he=$?.payload&&typeof $.payload=="object"&&"text"in $.payload&&typeof $.payload.text=="string"?$.payload.text:null;return c.jsxs("div",{className:"attempt",children:[c.jsxs("section",{className:`outcome outcome-${s.state}`,"aria-label":`Attempt ${s.attempt_number} outcome`,children:[c.jsx("h3",{children:y&&j.title==="Task complete · kept local"?r==="ask"?"Your answer is ready":"Changes are ready to review":j.title}),c.jsxs("p",{children:[Y?`Current phase: ${Y.label}. `:"",j.detail]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Next step:"})," ",j.next]}),c.jsxs("p",{className:"subtle",children:["Attempt ",s.attempt_number," · ",s.runtime_name??"Runtime not recorded"," · ",li(s.started_at??s.created_at)]}),y&&c.jsxs("p",{className:"subtle",children:[$l((s.completed_at?Date.parse(s.completed_at):h)-Date.parse(s.started_at??s.created_at))," elapsed",X?.started_at&&!ll(s.state)?` · Last activity ${$l(Math.max(0,h-Date.parse(X.started_at)))} ago`:""]}),y&&!ll(s.state)&&he&&c.jsx("p",{className:"agent-message",children:he})]}),y?c.jsxs(c.Fragment,{children:[r==="auto"&&P&&c.jsxs("section",{className:"directive",children:[c.jsx("h3",{children:"Agent's directive"}),c.jsx("p",{children:P}),c.jsx("p",{className:"subtle",children:"The builder receives the full plan automatically. No input is needed here."})]}),c.jsx("ol",{className:"task-steps","aria-label":"Task progress",children:J.map(Z=>{const ee=z.phases.slice().reverse().find(Ke=>Ke.phase===Z),le=C.slice().reverse().find(Ke=>Ke.phase===Z)?.status??ee?.status??(ee?.endMs===null?"running":ll(s.state)?"not run":"waiting"),Xe=z.phases.filter(Ke=>Ke.phase===Z).length;return c.jsxs("li",{children:[c.jsxs("span",{children:[Z==="scout"?"Read project":Z,Xe>1?` · round ${Xe}`:""]}),c.jsx(Ht,{state:le})]},Z)})}),c.jsxs("details",{className:"activity","aria-label":"Recent activity",open:!ll(s.state),children:[c.jsx("summary",{children:ll(s.state)?"Activity history":"Live activity"}),D.length===0?c.jsx("p",{className:"subtle",children:"Waiting for the worker's first activity. This page checks for updates automatically."}):c.jsx("ol",{children:D.map(Z=>c.jsxs("li",{children:[c.jsx("time",{children:Ha(Z.started_at)}),c.jsx("span",{children:Z.type==="tool_call"?`Codex used ${Z.name??"a tool"}`:Z.type==="phase_start"?`Started ${Z.phase==="scout"?"reading the project":Z.phase}`:Z.type==="phase_end"?`Finished ${Z.phase==="scout"?"reading the project":Z.phase}`:Z.name==="agent_text"?"Codex sent a progress update":Z.name==="repair_edge"?"Check failed → agents are repairing and retesting automatically":Z.name==="repair_exhausted"?"Repair limit reached; see the diagnostic":Z.type==="gate_fail"?"A check failed; inspect the workflow's repair activity":"Worker reported an error"})]},Z.seq))})]}),c.jsxs("details",{className:"evidence",children:[c.jsx("summary",{children:"Technical activity"}),O]})]}):O,U&&c.jsx("button",{type:"button",onClick:()=>A(null),children:"Clear phase filter"}),c.jsx(Ue,{error:R}),c.jsx(cv,{attempt:s,openPhase:U,compact:y})]})}function cv({attempt:s,openPhase:h,compact:y=!1}){const r=ll(s.state),M=K.useCallback(()=>Be.attemptGates(s.id),[s.id]),R=K.useCallback(()=>Be.attemptEnvelopes(s.id),[s.id]),z=Ot(M,r?0:5e3,`gates:${s.id}:${s.state}`),U=Ot(R,r?0:5e3,`envelopes:${s.id}:${s.state}`),A=K.useMemo(()=>ti(s.result),[s.result]),j=A?.phases??[],Y=j.map(O=>{const D=O.envelope;return O.kind!=="code"&&D!==null&&typeof D=="object"&&"summary"in D&&typeof D.summary=="string"}).lastIndexOf(!0),C=(z.data??[]).filter(O=>!h||O.phase===h),J=(U.data??[]).filter(O=>!h||O.phase===h);return!s.result&&C.length===0&&J.length===0&&!s.error&&!z.error&&!U.error?null:c.jsxs(c.Fragment,{children:[y&&A&&c.jsxs("section",{className:"result-facts","aria-label":"Result facts",children:[c.jsx("h3",{children:A.changed_paths?.length?"Changed files":"Files changed"}),A.changed_paths?.length?c.jsx("ul",{children:A.changed_paths.map(O=>c.jsx("li",{children:c.jsx("code",{children:O})},O))}):c.jsx("p",{children:"No file changes recorded."}),c.jsx("h3",{children:"Verification"}),c.jsxs("p",{children:[j.some(O=>O.phase==="test"&&O.status==="success")?"Test command passed.":j.some(O=>O.phase==="test"&&O.status==="fail")?"Test command failed. Review the diagnostic below.":"No test command result recorded."," ",A.acceptance?.passed===!0?"Workflow checks passed.":A.acceptance?.passed===!1?"Workflow checks did not pass.":""]})]}),j.map((O,D)=>{const X=O.envelope,L=X&&typeof X=="object"?X:{},P="summary"in L?L.summary:null;if(typeof P!="string")return null;const $=c.jsxs("section",{className:"report",children:[c.jsx("h4",{children:y&&D===Y?"Result":`${O.phase} · result`}),"approved"in L&&typeof L.approved=="boolean"&&c.jsx("p",{children:c.jsxs("strong",{children:["Agent assessment: ",L.approved?"Approved":"Not approved"]})}),c.jsx("p",{className:"report-text",children:P}),"blocking"in L&&Array.isArray(L.blocking)&&L.blocking.length>0&&c.jsx("ul",{className:"checks",children:L.blocking.filter(he=>typeof he=="string").map((he,Z)=>c.jsx("li",{children:he},Z))})]},`${O.phase}-${O.phase_attempt}`);return y&&D!==Y?c.jsxs("details",{className:"evidence",children:[c.jsxs("summary",{children:[O.kind==="code"?"Check":"Earlier step",": ",O.phase]}),$]},`${O.phase}-${O.phase_attempt}`):$}),s.error&&c.jsx("p",{className:"attempt-error",role:"alert",children:s.error}),c.jsx(Ue,{error:z.error}),c.jsx(Ue,{error:U.error}),s.result&&!A&&c.jsxs("details",{className:"evidence",children:[c.jsx("summary",{children:"Unrecognized result · view original record"}),c.jsx("pre",{children:s.result})]}),c.jsxs("details",{className:"evidence",open:h!==null,children:[c.jsxs("summary",{children:["Evidence",h?` · ${h}`:""," — ",C.length," gate check",C.length===1?"":"s",J.length>0?`, ${J.length} invalid emission`:""]}),(A?.acceptance?.checks??[]).length>0&&c.jsxs(c.Fragment,{children:[c.jsx("h4",{children:"Acceptance checks"}),c.jsx("ul",{className:"checks",children:A?.acceptance?.checks?.map((O,D)=>c.jsxs("li",{className:O.ok?"ok":"not-ok",children:[O.ok?"Pass":"Fail"," · ",O.item,": ",O.note]},D))})]}),j.filter(O=>!h||O.phase===h).map(O=>c.jsx(sv,{phase:O},`${O.phase}-${O.phase_attempt}`)),C.length>0&&c.jsxs("table",{className:"gates",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Phase"}),c.jsx("th",{children:"Gate"}),c.jsx("th",{children:"Item"}),c.jsx("th",{children:"Result"}),c.jsx("th",{children:"Note"})]})}),c.jsx("tbody",{children:C.map((O,D)=>c.jsxs("tr",{children:[c.jsx("td",{children:O.phase}),c.jsx("td",{children:O.gate}),c.jsx("td",{children:O.item}),c.jsx("td",{className:O.ok?"ok":"not-ok",children:O.ok?"pass":"fail"}),c.jsx("td",{children:O.note})]},`${O.phase}-${O.gate}-${O.item}-${D}`))})]}),J.map(O=>c.jsxs("div",{className:"invalid-envelope",children:[c.jsxs("h4",{children:["Invalid emission · ",O.phase," · seq ",O.emission]}),c.jsx("p",{className:"subtle",children:O.parse_error}),c.jsx("pre",{children:O.body}),c.jsx("p",{className:"subtle",children:"Stored capped; the complete emission is in this attempt's JSONL trace."})]},`${O.phase}-${O.emission}`))]})]})}function sv({phase:s}){const h=s.started_at?Date.parse(s.started_at):null,y=s.ended_at?Date.parse(s.ended_at):null;return c.jsxs("div",{className:"envelope",children:[c.jsxs("h4",{children:[s.phase," ",c.jsx("span",{className:`badge badge-${s.status}`,children:s.status}),h&&y?c.jsxs("span",{className:"subtle",children:[" · ",$l(y-h)]}):null]}),s.envelope?c.jsx("pre",{children:JSON.stringify(s.envelope,null,2)}):c.jsx("p",{className:"subtle",children:"No envelope recorded for this phase."}),(s.gates?.checks??[]).length>0&&c.jsx("ul",{className:"checks",children:(s.gates?.checks??[]).map((r,M)=>c.jsxs("li",{className:r.ok?"ok":"not-ok",children:[r.item,": ",r.note??(r.ok?"ok":"failed")]},`${r.item}-${M}`))})]})}function fv(){const s=K.useCallback(()=>Be.worktrees(),[]),{data:h,error:y,loading:r,refresh:M}=Ot(s,5e3,"worktrees"),[R,z]=K.useState(null),[U,A]=K.useState(null),j=async Y=>{try{await Be.releaseWorktree(Y),A(null),z(null),M()}catch(C){A(C)}};return r&&!h?c.jsx(Ba,{label:"Loading worktrees…"}):h?c.jsxs("div",{className:"view",children:[c.jsxs("header",{className:"view-header",children:[c.jsxs("div",{children:[c.jsx("h1",{children:"Retained worktrees"}),c.jsx("p",{className:"subtle",children:"Kept because publish could not be proven. Inspect the path, then release."})]}),c.jsx("div",{className:"counters",children:c.jsxs("div",{className:"counter",children:[c.jsx("span",{className:"counter-value",children:h.length}),c.jsx("span",{className:"counter-label",children:"retained"})]})})]}),c.jsx(Ue,{error:y}),c.jsx(Ue,{error:U}),h.length===0?c.jsx(Ya,{title:"Nothing retained",detail:"Every attempt's worktree was disposed cleanly."}):c.jsxs("table",{className:"table",children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Repository"}),c.jsx("th",{children:"Path"}),c.jsx("th",{children:"Reason"}),c.jsx("th",{children:"Attempt"}),c.jsx("th",{children:"Since"}),c.jsx("th",{})]})}),c.jsx("tbody",{children:h.map(Y=>c.jsxs("tr",{children:[c.jsx("td",{children:Y.repository}),c.jsx("td",{children:c.jsx("code",{children:Y.path})}),c.jsx("td",{children:Y.reason}),c.jsx("td",{children:c.jsx(De,{href:`/jobs/${Y.attempt_id}`,children:Ns(Y.attempt_id)})}),c.jsx("td",{children:Ha(Y.created_at)}),c.jsx("td",{children:R===Y.attempt_id?c.jsxs("span",{className:"confirm",children:[c.jsx("button",{type:"button",onClick:()=>{j(Y.attempt_id)},children:"Confirm release"}),c.jsx("button",{type:"button",onClick:()=>z(null),children:"Keep"})]}):c.jsx("button",{type:"button",onClick:()=>z(Y.attempt_id),children:"Release…"})})]},Y.attempt_id))})]})]}):c.jsx(Ue,{error:y})}function rv(){const s=Qy();return c.jsxs("div",{className:"app",children:[c.jsxs("nav",{className:"nav","aria-label":"Main navigation",children:[c.jsxs("span",{className:"brand",children:["jig",c.jsx("span",{className:"brand-caption",children:"software factory"})]}),c.jsx("span",{className:"nav-caption",children:"WORKSPACE"}),c.jsxs(De,{href:"/",current:s.name==="tasks",children:[c.jsx("span",{"aria-hidden":"true",children:"+"})," New task"]}),c.jsxs(De,{href:"/runs",current:["runs","run","job"].includes(s.name),children:[c.jsx("span",{"aria-hidden":"true",children:"▦"})," My tasks"]}),c.jsxs("details",{className:"nav-tools",children:[c.jsx("summary",{children:"Tools"}),c.jsx(De,{href:"/queue",current:s.name==="queue",children:"Work queue"}),c.jsx(De,{href:"/fleet",current:s.name==="fleet",children:"Workers"}),c.jsx(De,{href:"/worktrees",current:s.name==="worktrees",children:"Saved worktrees"})]}),c.jsxs("div",{className:"nav-footer",children:[c.jsx("span",{className:"nav-caption",children:"LOCAL BY DESIGN"}),c.jsxs("p",{children:["Your projects.",c.jsx("br",{}),"Your Codex.",c.jsx("br",{}),"Your next move."]})]})]}),c.jsxs("main",{children:[s.name==="tasks"&&c.jsx($y,{}),s.name==="queue"&&c.jsx(Wy,{}),s.name==="runs"&&c.jsx(Fy,{}),s.name==="run"&&c.jsx(nv,{runID:s.id}),s.name==="job"&&c.jsx(uv,{jobID:s.id}),s.name==="worktrees"&&c.jsx(fv,{}),s.name==="fleet"&&c.jsx(Zy,{}),s.name==="unknown"&&c.jsx(Ya,{title:"No such view",detail:`Nothing is served at ${s.path}.`})]})]})}Ry.createRoot(document.getElementById("root")).render(c.jsx(K.StrictMode,{children:c.jsx(rv,{})})); diff --git a/web/dist/assets/index-DvXXKdOR.css b/web/dist/assets/index-DvXXKdOR.css new file mode 100644 index 0000000..d71b40d --- /dev/null +++ b/web/dist/assets/index-DvXXKdOR.css @@ -0,0 +1 @@ +:root{color-scheme:dark;--bg: #101311;--panel: #191e1a;--panel-2: #222923;--line: #39433b;--text: #f0f1e9;--muted: #b2bdb3;--accent: #d5fa79;--ok: #a7e5a3;--warn: #f4c574;--bad: #ff9690;--tool: #7c8cf8;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:16px;line-height:1.6}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:14px}pre{background:#0a0c11;border:1px solid var(--line);border-radius:6px;padding:10px;overflow:auto;max-height:320px}button{background:var(--panel-2);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:8px 14px;font:inherit;cursor:pointer}button:hover{border-color:var(--accent)}.app{display:grid;grid-template-columns:210px minmax(0,1fr);min-height:100dvh}main{width:100%;max-width:1460px;min-width:0;margin:0 auto;padding:40px 48px 64px}.nav{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:30px 18px;border-right:1px solid var(--line);background:#151a16;position:sticky;top:0;height:100dvh}.nav a{padding:10px 14px;border-radius:8px}.nav a{color:var(--muted)}.nav a[aria-current=page]{background:#293323;color:var(--accent);font-weight:650;box-shadow:inset 3px 0 var(--accent)}:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.brand{font:italic 700 54px/1 Georgia,serif;letter-spacing:-.07em;color:var(--accent);padding:0 14px 32px}.brand-caption{display:block;margin-top:10px;font:12px/1.4 ui-monospace,monospace;letter-spacing:0;color:var(--muted)}.nav-caption{font:10px/1.5 ui-monospace,monospace;letter-spacing:.15em;color:var(--muted);padding:0 14px}.nav-footer{margin-top:auto;padding-top:24px;border-top:1px solid var(--line)}.nav-footer p{padding:0 14px;color:var(--muted);font-size:13px}.view-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}h1{font-size:40px;letter-spacing:-.04em;margin:0}h2{font-size:20px;margin:0}h3{font-size:17px;margin:0}h4{font-size:15px;margin:12px 0 6px}.subtle{color:var(--muted);margin:4px 0 0;font-size:14px}.counters{display:flex;gap:18px}.counter{display:flex;flex-direction:column;align-items:flex-end}.counter-value{font-size:28px;font-weight:700;line-height:1}.counter-label{color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:.08em}.table{width:100%;border-collapse:collapse;background:var(--panel);border:1px solid var(--line);border-radius:8px;overflow-wrap:anywhere}.table th,.table td{text-align:left;padding:16px;border-bottom:1px solid var(--line);vertical-align:top}.table th{color:var(--muted);font-size:13px;text-transform:uppercase;letter-spacing:.06em}.table tr:last-child td{border-bottom:none}.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;border:1px solid var(--line);background:var(--panel-2);font-size:13px;white-space:nowrap;text-transform:capitalize}.badge .dot{width:6px;height:6px;border-radius:50%;background:var(--muted)}.badge-accepted .dot,.badge-ready .dot,.badge-complete .dot,.badge-success .dot,.badge-live .dot,.badge-running .dot{background:var(--ok)}.badge-running .dot{animation:pulse 1.4s ease-in-out infinite}.badge-failed .dot,.badge-lost .dot,.badge-fail .dot{background:var(--bad)}.badge-queued .dot,.badge-preparing .dot,.badge-mixed .dot,.badge-stale .dot,.badge-accepted_unpublished .dot{background:var(--warn)}@keyframes pulse{50%{opacity:.25}}.panel{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:24px;margin-bottom:24px}.panel-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px}.panel-actions{display:flex;align-items:center;gap:8px}.notice{overflow-wrap:anywhere;background:#222a1e;border:1px solid #49563b;border-radius:6px;padding:8px 10px;font-size:12px}.publish{list-style:none;padding:0;margin:0 0 12px;font-size:12px;color:var(--muted)}.attempt{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}.lane-header{display:flex;align-items:center;gap:10px;margin-bottom:8px}.lane-meta,.lane-empty{color:var(--muted);font-size:12px}.lane-track{position:relative;height:34px;background:var(--panel-2);border:1px solid var(--line);border-radius:6px}.phase-block{position:absolute;top:3px;height:26px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 8px;overflow:hidden;white-space:nowrap;border-radius:4px;border:1px solid var(--line);background:#24304a;font-size:12px}.phase-success{background:#1d3b2a;border-color:#2e6b46}.phase-fail,.phase-death{background:#3d1f22;border-color:#7a3236}.phase-running{background:#23324d;border-color:var(--accent)}.phase-duration{color:var(--muted)}.mark{position:absolute;top:-4px;width:2px;height:42px;background:var(--muted)}.mark-gate_pass{background:var(--ok)}.mark-gate_fail,.mark-error{background:var(--bad)}.mark-handoff{background:var(--accent)}.tool-list{list-style:none;margin:8px 0 0;padding:0}.tool-row{display:grid;grid-template-columns:140px 1fr 110px;gap:10px;align-items:center;font-size:12px;padding:1px 0}.tool-name{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool-track{display:block;height:8px;background:var(--panel-2);border-radius:4px}.tool-span{display:block;height:8px;border-radius:4px;background:var(--tool)}.tool-running{background:repeating-linear-gradient(90deg,var(--accent) 0 6px,#2a3550 6px 12px)}.tool-duration{color:var(--muted);text-align:right}.evidence{margin-top:10px;background:var(--panel-2);border:1px solid var(--line);border-radius:8px;padding:8px 12px}.evidence summary{cursor:pointer;color:var(--muted);font-size:12px}.gates{width:100%;border-collapse:collapse;font-size:12px;margin-top:8px}.gates th,.gates td{text-align:left;padding:4px 8px;border-bottom:1px solid var(--line)}.ok{color:var(--ok)}.not-ok{color:var(--bad)}.checks{margin:6px 0;padding-left:18px;font-size:12px}.attempt-error{color:var(--bad);font-size:12px}.invalid-envelope{margin-top:10px}.parameters{display:flex;flex-wrap:wrap;gap:18px;margin:0 0 18px;font-size:12px}.parameters dt{color:var(--muted)}.parameters dd{margin:2px 0 0;white-space:pre-wrap}.error-banner{background:#2a1416;border:1px solid #7a3236;border-radius:6px;padding:8px 10px;margin:10px 0;font-size:12px}.empty,.loading{border:1px dashed var(--line);border-radius:8px;padding:28px;text-align:center;color:var(--muted)}.confirm{display:inline-flex;gap:6px}.repository-list{padding-left:20px;margin-bottom:0}summary{cursor:pointer}.report{border-left:3px solid var(--accent);padding:0 18px;margin:20px 0}.report p{white-space:pre-wrap;overflow-wrap:anywhere;margin:8px 0}.readiness p{margin:8px 0}.outcome{background:var(--panel-2);border:1px solid var(--line);border-radius:8px;padding:16px;margin-bottom:20px}.outcome p{margin:8px 0 0}section[id]{scroll-margin-top:20px}button:disabled{cursor:wait;opacity:.6}.task-form fieldset{border:0;padding:0;margin:0;min-width:0}.task-form label{display:block;font-weight:650;margin:20px 0 8px}.task-form label:first-child{margin-top:0}.task-form input,.task-form select,.task-form textarea{display:block;width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--text);font:inherit}.task-form textarea{resize:vertical}.task-form .mode-choice{margin-top:24px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.mode-choice legend{font-weight:650;margin-bottom:10px}.task-form .mode-choice label{display:flex;align-items:flex-start;gap:12px;margin:0;padding:16px;border:2px solid var(--line);border-radius:8px;cursor:pointer}.mode-choice label.selected{border-color:var(--accent);background:var(--panel-2)}.task-form .mode-choice input{width:18px;height:18px;padding:0;margin:3px 0;flex-shrink:0;accent-color:var(--accent)}.mode-choice small{display:block;font-weight:400;margin-top:6px;color:var(--muted)}.task-intent,.next-action{padding:16px;border-left:3px solid var(--accent);background:var(--panel-2)}.directive p,.agent-message{white-space:pre-wrap;overflow-wrap:anywhere}.activity{margin:20px 0}.activity ol{list-style:none;margin:0;padding:0}.activity li{display:flex;gap:16px;padding:8px 0;border-bottom:1px solid var(--line)}.activity time{color:var(--muted);min-width:95px;font-variant-numeric:tabular-nums}.next-action h3{margin-top:0}.task-form .evidence{margin-top:20px}.primary{background:var(--accent);color:#18200e;border-color:var(--accent);font-weight:750;padding:14px 28px;border-radius:9px;box-shadow:0 4px 20px #d5fa7910}.primary:hover:not(:disabled){background:#e1ffa0;box-shadow:0 6px 28px #d5fa7920}.start-row{display:flex;flex-wrap:wrap;align-items:center;gap:16px}.task-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:20px}.task-card{margin-bottom:0;overflow-wrap:anywhere}.task-card h3{margin-top:14px;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.nav-tools{position:relative}.nav-tools summary{padding:10px 14px}.nav-tools[open]{background:var(--panel-2);border-radius:8px}.nav-tools a{display:block}.task-steps{display:flex;flex-wrap:wrap;gap:12px;list-style:none;padding:0;margin:20px 0}.task-steps li{display:flex;gap:12px;align-items:center;background:var(--panel-2);border:1px solid var(--line);padding:12px 16px;border-radius:8px;text-transform:capitalize}.panel h2,.parameters dd,.attempt-error{overflow-wrap:anywhere}.evidence summary,.gates,.checks,.attempt-error,.lane-meta,.lane-empty,.publish{font-size:14px}.evidence{margin-bottom:16px}.tool-row{font-size:14px}.eyebrow{display:block;font:11px/1.5 ui-monospace,monospace;letter-spacing:.13em;color:var(--muted);margin-bottom:12px}.workspace-hero{align-items:center;padding:12px 0 32px;margin-bottom:26px;border-bottom:1px solid var(--line)}.workspace-hero h1{font-size:clamp(48px,5.6vw,78px);line-height:1.02;letter-spacing:-.055em}.goal-options{margin-top:20px}.goal-options>summary{font-size:14px;color:var(--muted);padding:8px 0}.workspace-hero h1 span{color:var(--accent);font-family:Georgia,serif;font-style:italic;font-weight:500}.workspace-hero .subtle{margin-top:20px;max-width:480px;font-size:16px}.runtime-status{align-self:flex-end;display:flex;flex-direction:column;align-items:flex-end;gap:8px;padding-bottom:4px}.runtime-status>span:last-child{font:11px ui-monospace,monospace;color:var(--muted)}.workspace-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:30px;align-items:start}.composer-heading{position:relative;padding-bottom:22px;margin-bottom:24px;border-bottom:1px solid var(--line)}.composer-heading .eyebrow{color:var(--accent)}.composer-heading h2{font-size:26px;letter-spacing:-.035em;padding-right:40px}.composer-mark{position:absolute;right:0;top:-8px;color:var(--accent);font-size:44px;line-height:1.3}.task-form{padding:28px}.task-form input,.task-form textarea{background:#111612;border-radius:9px}.task-form input:focus,.task-form textarea:focus{border-color:var(--accent)}.task-form .mode-choice{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.task-form .mode-choice label{padding:14px 16px;border-width:1px;transition:border-color .15s,background .15s}.mode-choice label:hover{border-color:#829575}.mode-choice label.selected{background:#293323;border-color:var(--accent)}.mode-choice label.selected strong{color:var(--accent)}.mode-choice small{margin-top:3px;font-size:13px;line-height:1.45}.task-intent{font-size:13px;line-height:1.6;color:var(--muted);background:transparent;border:0;padding:0;margin:16px 0 0}.task-intent strong{color:var(--text)}.recent-work>.view-header{align-items:center}.recent-work h2{font-size:22px;letter-spacing:-.03em}.recent-work .eyebrow{margin-bottom:5px}.recent-work .view-header>a{font-size:12px;white-space:nowrap}.recent-work .task-cards{display:flex;flex-direction:column;gap:10px}.task-card{border-radius:12px;padding:18px}.task-card:hover{border-color:#6c7d60}.task-card-meta{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.task-project{font:12px ui-monospace,monospace;color:var(--muted);overflow-wrap:anywhere}.task-card h3{font-size:15px;font-weight:550;line-height:1.5;margin:12px 0}.task-card h3 a{color:var(--text)}.task-card>.subtle{font-size:11px}.task-card>a{display:inline-block;margin-top:10px;font-size:12px}.task-card-ready,.task-card-complete{border-left:2px solid #82965e}.task-card-failed{border-left:2px solid var(--bad)}.task-card .badge{font-size:10px;padding:2px 7px}.loop-guide{padding:26px 0 0;margin-top:26px;border-top:1px solid var(--line)}.loop-guide>div{position:relative;padding:0 0 20px 38px}.loop-guide>div>span{position:absolute;left:0;top:2px;color:var(--accent);font:12px ui-monospace,monospace}.loop-guide strong{font-size:14px}.loop-guide p{margin:3px 0 0;color:var(--muted);font-size:12px}.outcome{border-radius:12px;background:linear-gradient(120deg,#293323,#1e2720);border-color:#50613d;padding:24px}.outcome h3{font-size:25px;letter-spacing:-.035em}.outcome-failed,.outcome-lost{background:#30201f;border-color:#88534d}.outcome-cancelled,.outcome-queued{background:var(--panel-2);border-color:var(--line)}.task-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));counter-reset:stage}.task-steps li{counter-increment:stage;flex-wrap:wrap;padding:18px;border-radius:12px}.task-steps li:before{content:"0" counter(stage);font:12px ui-monospace,monospace;color:var(--accent);width:100%}.task-steps li>span:first-child{font-size:17px;font-weight:650}.report{padding:16px 22px;background:#20281f;border-radius:0 10px 10px 0}.report h4{color:var(--accent);margin-top:0}.result-facts{display:grid;grid-template-columns:1fr 1fr;gap:8px 24px;margin:24px 0}.result-facts h3{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted)}.result-facts h3:first-child{grid-column:1;grid-row:1}.result-facts ul,.result-facts h3:first-child+p{grid-column:1;grid-row:2;margin:0;padding-left:18px}.result-facts h3:nth-last-child(2){grid-column:2;grid-row:1}.result-facts>p:last-child{grid-column:2;grid-row:2;margin:0;font-size:14px}.next-action{border-radius:0 12px 12px 0}@media(max-width:1180px){main{padding:32px}.workspace-grid{grid-template-columns:minmax(0,1fr) 290px;gap:20px}.app{grid-template-columns:180px minmax(0,1fr)}}@media(max-width:1000px){.workspace-grid{grid-template-columns:1fr}.recent-work .task-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.loop-guide{display:none}}@media(max-width:700px){.task-form .mode-choice{grid-template-columns:1fr}.app{display:block}main{padding:24px 16px 40px}.nav{position:relative;flex-direction:row;align-items:center;height:auto;gap:4px;padding:14px 16px;border-right:0;border-bottom:1px solid var(--line);flex-wrap:wrap}.brand{font-size:36px;padding:0 14px 0 0}.brand-caption,.nav>.nav-caption,.nav-footer{display:none}.nav a{padding:8px}.view-header,.panel-header{flex-direction:column;gap:14px}.panel{padding:16px}.panel-actions,.lane-header{flex-wrap:wrap}.table,.gates{display:block;overflow-x:auto}.table th,.table td{padding:12px;min-width:100px}.tool-row{grid-template-columns:90px 1fr 90px}.parameters{display:block}.workspace-hero{padding-top:6px;gap:22px}.workspace-hero h1{font-size:56px}.runtime-status{align-self:flex-start;flex-direction:row;align-items:center}.composer-heading h2{font-size:24px}.recent-work .task-cards,.task-steps{grid-template-columns:1fr}.task-steps li{padding:14px 16px}.task-steps li:before{width:auto}.outcome h3{font-size:23px}.result-facts{display:block}.result-facts>h3{margin:16px 0 8px}}@media(prefers-reduced-motion:reduce){.badge-running .dot{animation:none}} diff --git a/web/dist/assets/index-cy4ZRQX4.css b/web/dist/assets/index-cy4ZRQX4.css deleted file mode 100644 index d54f5c8..0000000 --- a/web/dist/assets/index-cy4ZRQX4.css +++ /dev/null @@ -1 +0,0 @@ -:root{color-scheme:dark light;--bg: #0b0d12;--panel: #12151d;--panel-2: #171b25;--line: #232838;--text: #e6e9f0;--muted: #99a1b3;--accent: #6ea8fe;--ok: #4ade80;--warn: #fbbf24;--bad: #f87171;--tool: #7c8cf8;font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font-size:14px;line-height:1.5}a{color:var(--accent);text-decoration:none}a:hover{text-decoration:underline}code,pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}pre{background:#0a0c11;border:1px solid var(--line);border-radius:6px;padding:10px;overflow:auto;max-height:320px}button{background:var(--panel-2);color:var(--text);border:1px solid var(--line);border-radius:6px;padding:4px 10px;font:inherit;cursor:pointer}button:hover{border-color:var(--accent)}.app{max-width:1180px;margin:0 auto;padding:0 20px 60px}.nav{display:flex;align-items:center;gap:18px;padding:16px 0;border-bottom:1px solid var(--line);margin-bottom:24px}.brand{font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.view-header{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:18px}h1{font-size:20px;margin:0}h2{font-size:16px;margin:0}h3{font-size:14px;margin:0}h4{font-size:13px;margin:12px 0 6px}.subtle{color:var(--muted);margin:4px 0 0;font-size:12px}.counters{display:flex;gap:18px}.counter{display:flex;flex-direction:column;align-items:flex-end}.counter-value{font-size:28px;font-weight:700;line-height:1}.counter-label{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}.table{width:100%;border-collapse:collapse;background:var(--panel);border:1px solid var(--line);border-radius:8px;overflow:hidden}.table th,.table td{text-align:left;padding:8px 12px;border-bottom:1px solid var(--line);vertical-align:top}.table th{color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.06em}.table tr:last-child td{border-bottom:none}.badge{display:inline-flex;align-items:center;gap:6px;padding:1px 8px;border-radius:999px;border:1px solid var(--line);background:var(--panel-2);font-size:11px;text-transform:capitalize}.badge .dot{width:6px;height:6px;border-radius:50%;background:var(--muted)}.badge-accepted .dot,.badge-success .dot,.badge-live .dot,.badge-running .dot{background:var(--ok)}.badge-running .dot{animation:pulse 1.4s ease-in-out infinite}.badge-failed .dot,.badge-lost .dot,.badge-fail .dot{background:var(--bad)}.badge-queued .dot,.badge-preparing .dot,.badge-mixed .dot,.badge-stale .dot,.badge-accepted_unpublished .dot{background:var(--warn)}@keyframes pulse{50%{opacity:.25}}.panel{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:16px;margin-bottom:18px}.panel-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:12px}.panel-actions{display:flex;align-items:center;gap:8px}.notice{background:#1d1a10;border:1px solid #4a3c14;border-radius:6px;padding:8px 10px;font-size:12px}.publish{list-style:none;padding:0;margin:0 0 12px;font-size:12px;color:var(--muted)}.attempt{border-top:1px solid var(--line);padding-top:12px;margin-top:12px}.lane-header{display:flex;align-items:center;gap:10px;margin-bottom:8px}.lane-meta,.lane-empty{color:var(--muted);font-size:12px}.lane-track{position:relative;height:34px;background:var(--panel-2);border:1px solid var(--line);border-radius:6px}.phase-block{position:absolute;top:3px;height:26px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 8px;overflow:hidden;white-space:nowrap;border-radius:4px;border:1px solid var(--line);background:#24304a;font-size:12px}.phase-success{background:#1d3b2a;border-color:#2e6b46}.phase-fail,.phase-death{background:#3d1f22;border-color:#7a3236}.phase-running{background:#23324d;border-color:var(--accent)}.phase-duration{color:var(--muted)}.mark{position:absolute;top:-4px;width:2px;height:42px;background:var(--muted)}.mark-gate_pass{background:var(--ok)}.mark-gate_fail,.mark-error{background:var(--bad)}.mark-handoff{background:var(--accent)}.tool-list{list-style:none;margin:8px 0 0;padding:0}.tool-row{display:grid;grid-template-columns:140px 1fr 110px;gap:10px;align-items:center;font-size:12px;padding:1px 0}.tool-name{color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tool-track{display:block;height:8px;background:var(--panel-2);border-radius:4px}.tool-span{display:block;height:8px;border-radius:4px;background:var(--tool)}.tool-running{background:repeating-linear-gradient(90deg,var(--accent) 0 6px,#2a3550 6px 12px)}.tool-duration{color:var(--muted);text-align:right}.evidence{margin-top:10px;background:var(--panel-2);border:1px solid var(--line);border-radius:8px;padding:8px 12px}.evidence summary{cursor:pointer;color:var(--muted);font-size:12px}.gates{width:100%;border-collapse:collapse;font-size:12px;margin-top:8px}.gates th,.gates td{text-align:left;padding:4px 8px;border-bottom:1px solid var(--line)}.ok{color:var(--ok)}.not-ok{color:var(--bad)}.checks{margin:6px 0;padding-left:18px;font-size:12px}.attempt-error{color:var(--bad);font-size:12px}.invalid-envelope{margin-top:10px}.parameters{display:flex;flex-wrap:wrap;gap:18px;margin:0 0 18px;font-size:12px}.parameters dt{color:var(--muted)}.parameters dd{margin:2px 0 0}.error-banner{background:#2a1416;border:1px solid #7a3236;border-radius:6px;padding:8px 10px;margin:10px 0;font-size:12px}.empty,.loading{border:1px dashed var(--line);border-radius:8px;padding:28px;text-align:center;color:var(--muted)}.confirm{display:inline-flex;gap:6px} diff --git a/web/dist/index.html b/web/dist/index.html index 0d6d0d5..d46c2e7 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -6,8 +6,8 @@ jig - - + +
diff --git a/web/src/App.tsx b/web/src/App.tsx index bc4c45a..bf28067 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -12,19 +12,26 @@ import { JobDetail, RunDetail } from "./RunDetail"; import { useRoute } from "./router"; import { Empty, Link } from "./ui"; import { Worktrees } from "./Worktrees"; +import { Tasks } from "./Tasks"; export function App() { const route = useRoute(); return (
-