From 5675fbfd863da5bcd818197e3429dd8ff64df007 Mon Sep 17 00:00:00 2001 From: cooper Date: Wed, 23 Sep 2026 08:40:59 -0700 Subject: [PATCH] feat(web): per-tab project header, v1 ShellService Each Studio tab now names the project its Connect calls act on (ADR 0005). AgentProvider keeps the tab's selected project ID in sessionStorage, keyed by agent host and port, so a reload keeps it while other tabs stay on their own projects, and exposes it with selectProject() on the agent context. The shared transport is built per project, and an interceptor sends X-Stackpanel-Project on every call once a project is selected. Without a selection nothing is sent and the agent uses its current project, as before. No query can show the previous project's data after a switch. Connect-query keys include the transport, so every project has its own cache entries. Queries outside connect-query (the AgentService and REST hooks) are keyed without the project, so selecting a project resets them before the next render. The picker opens the project over REST first and selects it only once the agent has switched, so those refetches already read the new project. It shows the tab's selected project, or the agent's current one until the tab selects one. The header's shell indicator remounts per project, so rebuild output and live shell events don't carry over. Shell status and rebuild use v1 ShellService over the shared transport: GetShellStatus through connect-query, RebuildShell through createClient and for-await over its started/output_line/completed oneof. A ConnectError that ends the stream resolves the rebuild as failed with its message, as the old in-band error event did, instead of throwing. The demo answers GetShellStatus with the v1 field names. With their last callers gone, AgentService's GetShellStatus and RebuildShell are removed along with the four messages only they used, their Go handlers, and RebuildEvent.Timestamp, which only the old handler read. packages/proto/gen was regenerated with buf generate and formatted with nix fmt, and the JSON schemas of the removed messages were deleted. connect_entities_gen.go regenerated with only its lines reordered, so it is unchanged. Refs: stackpanel-thq.8.1.2 --- .../internal/agent/server/connect_service.go | 88 +---- .../internal/agent/server/shell_manager.go | 44 +-- .../src/components/project-selector.test.tsx | 30 +- apps/web/src/components/project-selector.tsx | 25 +- .../components/studio/dashboard-header.tsx | 6 +- .../components/studio/shell-status.test.tsx | 98 +++++ .../src/components/studio/shell-status.tsx | 14 +- apps/web/src/demo/handlers.ts | 4 +- apps/web/src/lib/agent-provider.test.tsx | 136 +++++++ apps/web/src/lib/agent-provider.tsx | 45 ++- apps/web/src/lib/connect-transport.ts | 11 +- apps/web/src/lib/use-agent.ts | 113 +++--- packages/proto/gen/gopb/agent.pb.go | 324 ++--------------- .../gen/gopb/gopbconnect/agent.connect.go | 60 ---- ...tShellStatusRequest.jsonschema.bundle.json | 14 - ...gent.GetShellStatusRequest.jsonschema.json | 8 - ...tatusRequest.jsonschema.strict.bundle.json | 14 - ...tShellStatusRequest.jsonschema.strict.json | 8 - ...t.GetShellStatusRequest.schema.bundle.json | 14 - ...el.agent.GetShellStatusRequest.schema.json | 8 - ...ellStatusRequest.schema.strict.bundle.json | 14 - ...t.GetShellStatusRequest.schema.strict.json | 8 - ...t.RebuildShellEvent.jsonschema.bundle.json | 67 ---- ...el.agent.RebuildShellEvent.jsonschema.json | 61 ---- ...ldShellEvent.jsonschema.strict.bundle.json | 44 --- ...t.RebuildShellEvent.jsonschema.strict.json | 38 -- ...agent.RebuildShellEvent.schema.bundle.json | 67 ---- ...kpanel.agent.RebuildShellEvent.schema.json | 61 ---- ...ebuildShellEvent.schema.strict.bundle.json | 44 --- ...agent.RebuildShellEvent.schema.strict.json | 38 -- ...RebuildShellRequest.jsonschema.bundle.json | 20 -- ....agent.RebuildShellRequest.jsonschema.json | 14 - ...ShellRequest.jsonschema.strict.bundle.json | 22 -- ...RebuildShellRequest.jsonschema.strict.json | 16 - ...ent.RebuildShellRequest.schema.bundle.json | 20 -- ...anel.agent.RebuildShellRequest.schema.json | 14 - ...uildShellRequest.schema.strict.bundle.json | 22 -- ...ent.RebuildShellRequest.schema.strict.json | 16 - ...ShellStatusResponse.jsonschema.bundle.json | 61 ---- ....agent.ShellStatusResponse.jsonschema.json | 55 --- ...atusResponse.jsonschema.strict.bundle.json | 44 --- ...ShellStatusResponse.jsonschema.strict.json | 38 -- ...ent.ShellStatusResponse.schema.bundle.json | 61 ---- ...anel.agent.ShellStatusResponse.schema.json | 55 --- ...llStatusResponse.schema.strict.bundle.json | 44 --- ...ent.ShellStatusResponse.schema.strict.json | 38 -- .../ts/agent-AgentService_connectquery.d.ts | 6 - .../gen/ts/agent-AgentService_connectquery.js | 7 - packages/proto/gen/ts/agent.client.ts | 31 -- packages/proto/gen/ts/agent.ts | 338 +----------------- packages/proto/gen/ts/agent_pb.d.ts | 141 -------- packages/proto/gen/ts/agent_pb.js | 30 +- packages/proto/proto/agent.proto | 42 --- 53 files changed, 443 insertions(+), 2198 deletions(-) create mode 100644 apps/web/src/components/studio/shell-status.test.tsx create mode 100644 apps/web/src/lib/agent-provider.test.tsx delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.bundle.json delete mode 100644 packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.json diff --git a/apps/stackpanel-go/internal/agent/server/connect_service.go b/apps/stackpanel-go/internal/agent/server/connect_service.go index 0bcd9e09..248e538e 100644 --- a/apps/stackpanel-go/internal/agent/server/connect_service.go +++ b/apps/stackpanel-go/internal/agent/server/connect_service.go @@ -1,5 +1,5 @@ // connect_service.go implements the core Connect-RPC AgentService handlers for -// project info, command execution, and devshell status and rebuild streaming. +// project info and command execution. package server @@ -10,7 +10,6 @@ import ( "connectrpc.com/connect" gopb "github.com/darkmatter/stackpanel/packages/proto/gen/gopb" - "github.com/rs/zerolog/log" ) // AgentServiceServer implements the Connect-RPC AgentService interface. @@ -97,88 +96,3 @@ func (s *AgentServiceServer) Exec( Stderr: res.Stderr, }), nil } - -// ============================================================================= -// Devshell Management -// ============================================================================= - -// GetShellStatus reports whether the Nix devshell is stale (nix files changed -// since last build) or currently rebuilding. The web UI uses this to show a -// "rebuild needed" banner. -func (s *AgentServiceServer) GetShellStatus( - ctx context.Context, - req *connect.Request[gopb.GetShellStatusRequest], -) (*connect.Response[gopb.ShellStatusResponse], error) { - if s.server.shellManager == nil { - return connect.NewResponse(&gopb.ShellStatusResponse{ - Stale: false, - Rebuilding: false, - }), nil - } - - status := s.server.shellManager.Status() - - var lastBuilt, lastNixChange string - if !status.LastBuilt.IsZero() { - lastBuilt = status.LastBuilt.Format("2006-01-02T15:04:05Z07:00") - } - if !status.LastNixChange.IsZero() { - lastNixChange = status.LastNixChange.Format("2006-01-02T15:04:05Z07:00") - } - - return connect.NewResponse(&gopb.ShellStatusResponse{ - Stale: status.Stale, - Rebuilding: status.Rebuilding, - LastBuilt: lastBuilt, - LastNixChange: lastNixChange, - ChangedFiles: status.ChangedFiles, - }), nil -} - -// RebuildShell triggers a devshell rebuild and streams progress events to the client. -// This is a server-streaming RPC — the client receives events as the build progresses -// (output lines, completion status, errors) rather than waiting for the full result. -func (s *AgentServiceServer) RebuildShell( - ctx context.Context, - req *connect.Request[gopb.RebuildShellRequest], - stream *connect.ServerStream[gopb.RebuildShellEvent], -) error { - if s.server.shellManager == nil { - return connect.NewError( - connect.CodeFailedPrecondition, - fmt.Errorf("no project is open"), - ) - } - - method := req.Msg.Method - if method == "" { - method = "devshell" - } - - events := make(chan RebuildEvent, 100) - - // Start rebuild in goroutine - go func() { - defer close(events) - if err := s.server.shellManager.Rebuild(ctx, method, events); err != nil { - log.Warn().Err(err).Msg("Shell rebuild error") - } - }() - - // Stream events to client - for event := range events { - pbEvent := &gopb.RebuildShellEvent{ - Type: event.Type, - Output: event.Output, - ExitCode: int32(event.ExitCode), - Error: event.Error, - Timestamp: event.Timestamp.Format("2006-01-02T15:04:05Z07:00"), - } - - if err := stream.Send(pbEvent); err != nil { - return err - } - } - - return nil -} diff --git a/apps/stackpanel-go/internal/agent/server/shell_manager.go b/apps/stackpanel-go/internal/agent/server/shell_manager.go index 33560bb8..89072cda 100644 --- a/apps/stackpanel-go/internal/agent/server/shell_manager.go +++ b/apps/stackpanel-go/internal/agent/server/shell_manager.go @@ -136,13 +136,12 @@ type ShellStatus struct { ChangedFiles []string } -// RebuildEvent represents a streaming event during shell rebuild, sent to SSE subscribers. +// RebuildEvent is one step of a shell rebuild, streamed to the Rebuild caller. type RebuildEvent struct { - Type string // "started", "output", "completed", "error" - Output string // Line of stdout/stderr (for Type="output") - ExitCode int // Set on Type="completed" - Error string // Set on Type="error" - Timestamp time.Time + Type string // "started", "output", "completed", "error" + Output string // Line of stdout/stderr (for Type="output") + ExitCode int // Set on Type="completed" + Error string // Set on Type="error" } // Rebuild starts a shell rebuild and streams output events to the caller. @@ -196,9 +195,8 @@ func (sm *ShellManager) Rebuild( stdout, err := cmd.StdoutPipe() if err != nil { events <- RebuildEvent{ - Type: "error", - Error: err.Error(), - Timestamp: time.Now(), + Type: "error", + Error: err.Error(), } return err } @@ -206,17 +204,15 @@ func (sm *ShellManager) Rebuild( stderr, err := cmd.StderrPipe() if err != nil { events <- RebuildEvent{ - Type: "error", - Error: err.Error(), - Timestamp: time.Now(), + Type: "error", + Error: err.Error(), } return err } // Broadcast start event events <- RebuildEvent{ - Type: "started", - Timestamp: time.Now(), + Type: "started", } if sm.server != nil { @@ -232,9 +228,8 @@ func (sm *ShellManager) Rebuild( // Start the command if err := cmd.Start(); err != nil { events <- RebuildEvent{ - Type: "error", - Error: err.Error(), - Timestamp: time.Now(), + Type: "error", + Error: err.Error(), } return err } @@ -247,9 +242,8 @@ func (sm *ShellManager) Rebuild( for scanner.Scan() { line := scanner.Text() events <- RebuildEvent{ - Type: "output", - Output: line, - Timestamp: time.Now(), + Type: "output", + Output: line, } } } @@ -270,9 +264,8 @@ func (sm *ShellManager) Rebuild( exitCode = exitErr.ExitCode() } else { events <- RebuildEvent{ - Type: "error", - Error: err.Error(), - Timestamp: time.Now(), + Type: "error", + Error: err.Error(), } return err } @@ -296,9 +289,8 @@ func (sm *ShellManager) Rebuild( } events <- RebuildEvent{ - Type: "completed", - ExitCode: exitCode, - Timestamp: time.Now(), + Type: "completed", + ExitCode: exitCode, } return nil diff --git a/apps/web/src/components/project-selector.test.tsx b/apps/web/src/components/project-selector.test.tsx index 448ce7fb..26939876 100644 --- a/apps/web/src/components/project-selector.test.tsx +++ b/apps/web/src/components/project-selector.test.tsx @@ -2,13 +2,14 @@ import { Code, ConnectError, createRouterTransport } from "@connectrpc/connect"; import { TransportProvider } from "@connectrpc/connect-query"; import { ProjectService } from "@stackpanel/proto/agent/v1/project"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { fireEvent, render, screen, waitFor } from "@testing-library/react"; +import { fireEvent, render, screen, waitFor, within } from "@testing-library/react"; import { beforeEach, describe, expect, it, vi } from "vitest"; import { ProjectSelector } from "./project-selector"; -const { agentClient, endpoint } = vi.hoisted(() => ({ +const { agentClient, endpoint, selection } = vi.hoisted(() => ({ agentClient: { getCurrentProject: vi.fn(), openProject: vi.fn() }, endpoint: { isDemo: false, useLocal: () => {} }, + selection: { selectedProjectId: null as string | null, selectProject: vi.fn() }, })); vi.mock("@tanstack/react-router", () => ({ useNavigate: () => () => {} })); @@ -20,6 +21,7 @@ vi.mock("@/lib/agent-provider", () => ({ token: "paired-token", healthStatus: "available", isAuthenticated: true, + ...selection, }), useAgentClient: () => agentClient, })); @@ -72,6 +74,7 @@ async function openPicker() { describe("ProjectSelector", () => { beforeEach(() => { endpoint.isDemo = false; + selection.selectedProjectId = null; agentClient.getCurrentProject.mockResolvedValue({ has_project: true, project: { id: shop.id, name: shop.name, path: shop.path }, @@ -91,16 +94,37 @@ describe("ProjectSelector", () => { expect(screen.getByRole("option", { name: /api/ }).getAttribute("aria-disabled")).toBeNull(); }); - it("switches projects over REST and refreshes the registry", async () => { + it("opens the project over REST, then selects it for this tab", async () => { + let finishOpen!: () => void; + agentClient.openProject.mockImplementation( + (path: string) => + new Promise((resolve) => { + finishOpen = () => + resolve({ success: true, project: { id: api.id, name: api.name, path } }); + }), + ); const calls = renderSelector(); await openPicker(); fireEvent.click(screen.getByRole("option", { name: /api/ })); await waitFor(() => expect(agentClient.openProject).toHaveBeenCalledWith(api.path)); + // Selecting refetches the REST reads, so it waits for the agent to switch. + expect(selection.selectProject).not.toHaveBeenCalled(); + finishOpen(); + await waitFor(() => expect(selection.selectProject).toHaveBeenCalledWith(api.id)); await waitFor(() => expect(calls.listProjects).toBe(2)); }); + it("shows the project this tab selected rather than the agent's current one", async () => { + selection.selectedProjectId = api.id; + renderSelector(); + + const trigger = await screen.findByRole("combobox"); + expect(await within(trigger).findByText("api")).toBeTruthy(); + expect(within(trigger).queryByText("shop")).toBeNull(); + }); + it("shows why AddProject rejected the path", async () => { renderSelector(); await openPicker(); diff --git a/apps/web/src/components/project-selector.tsx b/apps/web/src/components/project-selector.tsx index cfdfb04b..6c20a39c 100644 --- a/apps/web/src/components/project-selector.tsx +++ b/apps/web/src/components/project-selector.tsx @@ -43,7 +43,8 @@ interface ProjectSelectorProps { } export function ProjectSelector(_props: ProjectSelectorProps) { - const { host, port, token, healthStatus, isAuthenticated } = useAgentContext(); + const { host, port, token, healthStatus, isAuthenticated, selectedProjectId, selectProject } = + useAgentContext(); const agentClient = useAgentClient(); const transport = useTransport(); const { isDemo, useLocal } = useAgentEndpoint(); @@ -67,9 +68,9 @@ export function ProjectSelector(_props: ProjectSelectorProps) { cardinality: "finite", }); - // The rest of the Studio still runs against the agent's single current - // project, so reading and switching it stays on REST until requests select - // their project (ADR 0005, stackpanel-thq.8.1). + // Opening selects the project for this tab's Connect calls (ADR 0005) and + // also makes it the agent's current project, which the REST routes, and a + // tab that has not selected a project yet, still act on. const currentProjectKey = ["agent", "project", "current", host, port]; const currentProjectQuery = useQuery({ queryKey: currentProjectKey, @@ -79,8 +80,12 @@ export function ProjectSelector(_props: ProjectSelectorProps) { }); const openProjectMutation = useMutation({ - mutationFn: (path: string) => agentClient.openProject(path), - onSuccess: ({ project }) => { + mutationFn: ({ path }: { id?: string; path: string }) => agentClient.openProject(path), + onSuccess: ({ project }, { id }) => { + // Select only once the agent has switched, so the REST reads that + // selecting refetches already return the new project. + const projectId = id ?? project.id; + if (projectId) selectProject(projectId); toast.success(`Opened project: ${project.name}`); void queryClient.invalidateQueries({ queryKey: listProjectsKey }); void queryClient.invalidateQueries({ queryKey: currentProjectKey }); @@ -106,7 +111,9 @@ export function ProjectSelector(_props: ProjectSelectorProps) { const projects = projectsQuery.data?.projects ?? []; const defaultProjectId = projectsQuery.data?.defaultProjectId; - const currentProject = currentProjectQuery.data?.project ?? null; + const currentProject = selectedProjectId + ? (projects.find((p) => p.id === selectedProjectId) ?? null) + : (currentProjectQuery.data?.project ?? null); const isLoading = projectsQuery.isLoading || currentProjectQuery.isLoading; const isOpening = openProjectMutation.isPending; const isAdding = addProjectMutation.isPending || openProjectMutation.isPending; @@ -120,7 +127,7 @@ export function ProjectSelector(_props: ProjectSelectorProps) { const selectedProject = projects.find((p) => p.path === path); if (!selectedProject?.valid || selectedProject.path === currentProject?.path) return; - openProjectMutation.mutate(selectedProject.path); + openProjectMutation.mutate({ id: selectedProject.id, path: selectedProject.path }); }; const closeAddDialog = () => { @@ -140,7 +147,7 @@ export function ProjectSelector(_props: ProjectSelectorProps) { try { const { project } = await addProjectMutation.mutateAsync({ path }); - await openProjectMutation.mutateAsync(project?.path ?? path); + await openProjectMutation.mutateAsync({ id: project?.id, path: project?.path ?? path }); closeAddDialog(); } catch (err) { setValidationError( diff --git a/apps/web/src/components/studio/dashboard-header.tsx b/apps/web/src/components/studio/dashboard-header.tsx index 60f2f84e..62844263 100644 --- a/apps/web/src/components/studio/dashboard-header.tsx +++ b/apps/web/src/components/studio/dashboard-header.tsx @@ -12,6 +12,7 @@ import { } from "@ui/dropdown-menu"; import { Bell, LogOut, Settings, User } from "lucide-react"; import { AgentStatus } from "@/components/agent-connect"; +import { useAgentContext } from "@/lib/agent-provider"; import { ShellStatus } from "./shell-status"; import { AgentConsoleDialog } from "./agent-console-dialog"; import type { PanelType } from "./dashboard-sidebar"; @@ -71,6 +72,7 @@ const pathToPanelMap: Record = { }; export function DashboardHeader() { + const { selectedProjectId } = useAgentContext(); const routerState = useRouterState(); const pathname = routerState.location.pathname; const activePanel = pathToPanelMap[pathname] ?? "overview"; @@ -116,7 +118,9 @@ export function DashboardHeader() {
- + {/* Remounted per project so a rebuild's output and live shell + events never carry over to the next project. */} +
diff --git a/apps/web/src/components/studio/shell-status.test.tsx b/apps/web/src/components/studio/shell-status.test.tsx new file mode 100644 index 00000000..100806ee --- /dev/null +++ b/apps/web/src/components/studio/shell-status.test.tsx @@ -0,0 +1,98 @@ +import type { MessageInitShape } from "@bufbuild/protobuf"; +import { Code, ConnectError, createRouterTransport, type ServiceImpl } from "@connectrpc/connect"; +import { TransportProvider } from "@connectrpc/connect-query"; +import { + RebuildMethod, + type RebuildShellResponseSchema, + ShellService, +} from "@stackpanel/proto/agent/v1/shell"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { fireEvent, render, screen } from "@testing-library/react"; +import { describe, expect, it, vi } from "vitest"; +import { ShellStatus } from "./shell-status"; + +vi.mock("@/lib/agent-provider", () => ({ useAgentContext: () => ({ isConnected: true }) })); +// Live shell events arrive over SSE; these tests drive ShellService alone. +vi.mock("@/lib/use-sse", () => ({ + useShellStatusSSE: () => ({ isStale: false, isRebuilding: false, lastChangedFile: null }), +})); + +type RebuildEvent = MessageInitShape; + +// Serves ShellService in memory, the way the agent's v1 handler answers. +function renderShellStatus(shell: Partial>) { + const transport = createRouterTransport(({ service }) => { + service(ShellService, shell); + }); + const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + render( + + + + + , + ); +} + +async function rebuildFromStalePopover() { + fireEvent.click(await screen.findByRole("button", { name: /Shell Stale/ })); + fireEvent.click(await screen.findByRole("button", { name: /Rebuild Shell/ })); +} + +describe("ShellStatus", () => { + it("shows the stale shell and changed files ShellService reports", async () => { + renderShellStatus({ + getShellStatus: () => ({ stale: true, changedFiles: ["flake.nix", ".stack/config.nix"] }), + }); + + fireEvent.click(await screen.findByRole("button", { name: /Shell Stale/ })); + + expect(await screen.findByText("flake.nix")).toBeTruthy(); + expect(screen.getByText(".stack/config.nix")).toBeTruthy(); + }); + + it("streams the rebuild's output, then shows the refreshed status", async () => { + let stale = true; + let finish!: () => void; + const finished = new Promise((resolve) => { + finish = resolve; + }); + const methods: RebuildMethod[] = []; + renderShellStatus({ + getShellStatus: () => ({ stale }), + async *rebuildShell(req): AsyncGenerator { + methods.push(req.method); + yield { event: { case: "started", value: {} } }; + yield { event: { case: "outputLine", value: "building the devshell" } }; + await finished; + stale = false; + yield { event: { case: "completed", value: { exitCode: 0 } } }; + }, + }); + + await rebuildFromStalePopover(); + + expect(await screen.findByText("building the devshell")).toBeTruthy(); + expect(screen.getByText("Rebuilding...")).toBeTruthy(); + expect(methods).toEqual([RebuildMethod.DEVSHELL]); + + finish(); + expect(await screen.findByText("Shell OK")).toBeTruthy(); + }); + + it("shows why a rebuild could not run", async () => { + renderShellStatus({ + getShellStatus: () => ({ stale: true }), + async *rebuildShell(): AsyncGenerator { + yield { event: { case: "started", value: {} } }; + throw new ConnectError("a rebuild is already running", Code.FailedPrecondition); + }, + }); + + await rebuildFromStalePopover(); + + // The stale popover the rebuild was started from shows the reason. + expect(await screen.findByText("a rebuild is already running")).toBeTruthy(); + expect(screen.getByRole("button", { name: /Shell Stale/ })).toBeTruthy(); + }); +}); diff --git a/apps/web/src/components/studio/shell-status.tsx b/apps/web/src/components/studio/shell-status.tsx index 3c8e7b0f..2e23485b 100644 --- a/apps/web/src/components/studio/shell-status.tsx +++ b/apps/web/src/components/studio/shell-status.tsx @@ -1,5 +1,7 @@ "use client"; +import { useQuery } from "@connectrpc/connect-query"; +import { ShellService } from "@stackpanel/proto/agent/v1/shell"; import { Button } from "@ui/button"; import { Checkbox } from "@ui/checkbox"; import { Label } from "@ui/label"; @@ -13,7 +15,7 @@ import { Terminal, } from "lucide-react"; import { useState, useEffect, useRef, useCallback } from "react"; -import { useShellStatus, useRebuildShell } from "@/lib/use-agent"; +import { useRebuildShell } from "@/lib/use-agent"; import { useShellStatusSSE } from "@/lib/use-sse"; import { cn } from "@/lib/utils"; import { useAgentContext } from "@/lib/agent-provider"; @@ -42,7 +44,15 @@ function useAutoBuildPreference() { */ export function ShellStatus() { const { isConnected } = useAgentContext(); - const { data: status, isLoading, refetch } = useShellStatus(); + const { + data: status, + isLoading, + refetch, + } = useQuery( + ShellService.method.getShellStatus, + {}, + { enabled: isConnected, refetchInterval: 10_000 }, // poll as a backup to SSE + ); const { rebuild, isRebuilding, output, error, clearError } = useRebuildShell(); const [showOutput, setShowOutput] = useState(false); diff --git a/apps/web/src/demo/handlers.ts b/apps/web/src/demo/handlers.ts index f8adc689..87d9ebc3 100644 --- a/apps/web/src/demo/handlers.ts +++ b/apps/web/src/demo/handlers.ts @@ -74,8 +74,8 @@ function connectResponse(method: string) { return { stale: false, rebuilding: false, - lastBuilt: demoHealthSummary.lastUpdated, - lastNixChange: demoHealthSummary.lastUpdated, + lastBuiltAt: demoHealthSummary.lastUpdated, + lastNixChangeAt: demoHealthSummary.lastUpdated, changedFiles: [], }; case "PatchNixData": diff --git a/apps/web/src/lib/agent-provider.test.tsx b/apps/web/src/lib/agent-provider.test.tsx new file mode 100644 index 00000000..65fc67a1 --- /dev/null +++ b/apps/web/src/lib/agent-provider.test.tsx @@ -0,0 +1,136 @@ +import type { ConnectRouter, Interceptor } from "@connectrpc/connect"; +import { useQuery as useConnectQuery } from "@connectrpc/connect-query"; +import { ShellService } from "@stackpanel/proto/agent/v1/shell"; +import { QueryClient, QueryClientProvider, useQuery } from "@tanstack/react-query"; +import { fireEvent, render, screen } from "@testing-library/react"; +import { beforeEach, describe, expect, it, vi } from "vitest"; +import { AgentProvider, useAgentContext } from "./agent-provider"; + +const HEADER = "X-Stackpanel-Project"; + +// The agent, in memory. `routes` serves its v1 services; `legacy` stands in +// for the AgentService and REST reads, which act on the agent's current +// project and are cached under keys without the project. +const agent = vi.hoisted(() => ({ + routes: (_router: ConnectRouter) => {}, + legacy: { current: "shop", hold: Promise.resolve() }, +})); + +// The provider builds its real transport; only the network is replaced, by a +// router transport that keeps the provider's interceptors. +vi.mock("@connectrpc/connect-web", async () => { + const { createRouterTransport } = await import("@connectrpc/connect"); + return { + createConnectTransport: ({ interceptors }: { interceptors?: Interceptor[] }) => + createRouterTransport((router) => agent.routes(router), { transport: { interceptors } }), + }; +}); + +type Render = { selectedProjectId: string | null; shell: string; apps: string }; +const renders: Render[] = []; + +function Probe() { + const { selectedProjectId, selectProject } = useAgentContext(); + const shell = useConnectQuery(ShellService.method.getShellStatus, {}); + const apps = useQuery({ + queryKey: ["agent", "apps"], + queryFn: async () => { + await agent.legacy.hold; + return agent.legacy.current; + }, + }); + const view = { + selectedProjectId, + shell: shell.data?.changedFiles.join(",") ?? "…", + apps: apps.data ?? "…", + }; + renders.push(view); + return ( + <> +

shell: {view.shell}

+

apps: {view.apps}

+ + + ); +} + +function renderStudio() { + const queryClient = new QueryClient({ defaultOptions: { queries: { retry: false } } }); + return render( + + + + + , + ); +} + +// ShellService answers for the project the header names, or for the agent's +// current project ("shop") without one. +function serveShell(beforeReply: (project: string | null) => Promise = async () => {}) { + const seen: (string | null)[] = []; + agent.routes = (router) => + router.service(ShellService, { + getShellStatus: async (_req, ctx) => { + const project = ctx.requestHeader.get(HEADER); + seen.push(project); + await beforeReply(project); + return { changedFiles: [project ?? "shop"] }; + }, + }); + return seen; +} + +describe("AgentProvider project selection", () => { + beforeEach(() => { + sessionStorage.clear(); + renders.length = 0; + agent.legacy = { current: "shop", hold: Promise.resolve() }; + }); + + it("sends the selected project on Connect calls and keeps it across a reload", async () => { + const seen = serveShell(); + const tab = renderStudio(); + + expect(await screen.findByText("shell: shop")).toBeTruthy(); + expect(seen).toEqual([null]); + + fireEvent.click(screen.getByRole("button", { name: "Select api" })); + expect(await screen.findByText("shell: api-2")).toBeTruthy(); + expect(seen).toEqual([null, "api-2"]); + + tab.unmount(); + renderStudio(); + expect(await screen.findByText("shell: api-2")).toBeTruthy(); + expect(seen).toEqual([null, "api-2", "api-2"]); + }); + + it("never renders the previous project's data after a switch", async () => { + let release!: () => void; + const released = new Promise((resolve) => { + release = resolve; + }); + serveShell((project) => (project ? released : Promise.resolve())); + renderStudio(); + expect(await screen.findByText("shell: shop")).toBeTruthy(); + expect(await screen.findByText("apps: shop")).toBeTruthy(); + + // The picker opens the project over REST first, which moves the agent's + // current project, and then selects it. Hold the new answers so the + // in-between state can be observed. + agent.legacy = { current: "api", hold: released }; + fireEvent.click(screen.getByRole("button", { name: "Select api" })); + expect(await screen.findByText("shell: …")).toBeTruthy(); + expect(screen.getByText("apps: …")).toBeTruthy(); + + release(); + expect(await screen.findByText("shell: api-2")).toBeTruthy(); + expect(await screen.findByText("apps: api")).toBeTruthy(); + + const afterSwitch = renders.filter((r) => r.selectedProjectId === "api-2"); + expect(afterSwitch.length).toBeGreaterThan(0); + expect(afterSwitch.filter((r) => r.shell === "shop" || r.apps === "shop")).toEqual([]); + }); +}); diff --git a/apps/web/src/lib/agent-provider.tsx b/apps/web/src/lib/agent-provider.tsx index 64e263b3..15b0058b 100644 --- a/apps/web/src/lib/agent-provider.tsx +++ b/apps/web/src/lib/agent-provider.tsx @@ -1,6 +1,7 @@ "use client"; import { TransportProvider } from "@connectrpc/connect-query"; +import { useQueryClient } from "@tanstack/react-query"; import { createContext, type ReactNode, @@ -18,6 +19,7 @@ import { useAgentSSEOptional } from "@/lib/agent-sse-provider"; const STORAGE_KEY = "stackpanel.agent.token"; const REDIRECT_TOKEN_KEY = "stackpanel_agent_token"; +const PROJECT_STORAGE_KEY = "stackpanel.agent.project"; function getTokenFromURL(): string | null { if (typeof window === "undefined") return null; @@ -107,6 +109,12 @@ type AgentContextValue = { port: number; healthStatus: "checking" | "available" | "unavailable"; projectRoot: string | null; + /** + * The project this tab's Connect calls act on (ADR 0005), or null until the + * tab selects one, in which case the agent uses its current project. + */ + selectedProjectId: string | null; + selectProject: (projectId: string) => void; token: string | null; isConnected: boolean; isAuthenticated: boolean; @@ -142,6 +150,14 @@ export function AgentProvider({ const cleanupRef = useRef<(() => void) | null>(null); const effectiveToken = providedToken ?? token; + // sessionStorage keeps the tab's project across reloads without carrying it + // into other tabs, which may work on other projects. + const projectStorageKey = `${PROJECT_STORAGE_KEY}:${host}:${port}`; + const [selectedProjectId, setSelectedProjectId] = useState(() => + typeof window === "undefined" ? null : sessionStorage.getItem(projectStorageKey), + ); + const queryClient = useQueryClient(); + // Handle query token persistence and URL cleanup (runs after initial render) useEffect(() => { if (providedToken != null) { @@ -342,11 +358,28 @@ export function AgentProvider({ healthStatus === "available" && !!effectiveToken && validatedToken === effectiveToken; const isConnected = isAuthenticated; - // The one Connect transport for this agent and credential; connect-query - // hooks below pick it up from TransportProvider (ADR 0004). + // The one Connect transport for this agent, credential and project; + // connect-query hooks below pick it up from TransportProvider (ADR 0004). + // Connect-query keys include the transport, so every project gets its own + // cache entries and a switch can never serve the previous project's data. const transport = useMemo( - () => createAgentTransport(effectiveToken, host, port), - [effectiveToken, host, port], + () => createAgentTransport(effectiveToken, host, port, selectedProjectId), + [effectiveToken, host, port, selectedProjectId], + ); + + const selectProject = useCallback( + (projectId: string) => { + if (projectId === selectedProjectId) return; + sessionStorage.setItem(projectStorageKey, projectId); + setSelectedProjectId(projectId); + // Queries outside connect-query (the AgentService and REST hooks) are + // keyed without the project and act on the agent's current project, so + // drop their data rather than show the previous project's on refetch. + void queryClient.resetQueries({ + predicate: (query) => query.queryKey[0] !== "connect-query", + }); + }, + [projectStorageKey, queryClient, selectedProjectId], ); const value = useMemo( @@ -355,6 +388,8 @@ export function AgentProvider({ port, healthStatus, projectRoot, + selectedProjectId, + selectProject, token: effectiveToken, isConnected, isAuthenticated, @@ -394,6 +429,8 @@ export function AgentProvider({ pair, port, projectRoot, + selectedProjectId, + selectProject, effectiveToken, ], ); diff --git a/apps/web/src/lib/connect-transport.ts b/apps/web/src/lib/connect-transport.ts index 017091cc..4d50faee 100644 --- a/apps/web/src/lib/connect-transport.ts +++ b/apps/web/src/lib/connect-transport.ts @@ -17,11 +17,14 @@ import { AGENT_AUTH_ERROR_EVENT } from "./agent"; * procedures such as GetAgentInfo succeed * @param host - Agent host (default localhost) * @param port - Agent port (default 9876) + * @param projectId - Project that project-scoped services act on; without + * one the agent uses its current project (ADR 0005) */ export function createAgentTransport( token: string | null | undefined, host: string = "localhost", port: number = 9876, + projectId?: string | null, ) { const authInterceptor: Interceptor = (next) => async (req) => { if (token) req.header.set("Authorization", `Bearer ${token}`); @@ -38,12 +41,16 @@ export function createAgentTransport( } }; + const projectInterceptor: Interceptor = (next) => (req) => { + if (projectId) req.header.set("X-Stackpanel-Project", projectId); + return next(req); + }; + return createConnectTransport({ baseUrl: `http://${host}:${port}`, // Use JSON for easier debugging (can switch to binary for production) useBinaryFormat: false, - // Add auth header to all requests - interceptors: [authInterceptor], + interceptors: [authInterceptor, projectInterceptor], }); } diff --git a/apps/web/src/lib/use-agent.ts b/apps/web/src/lib/use-agent.ts index 13ba7bc5..9320d823 100644 --- a/apps/web/src/lib/use-agent.ts +++ b/apps/web/src/lib/use-agent.ts @@ -22,9 +22,10 @@ * ``` */ -import { createClient } from "@connectrpc/connect"; -import { useTransport } from "@connectrpc/connect-query"; +import { ConnectError, createClient } from "@connectrpc/connect"; +import { createConnectQueryKey, useTransport } from "@connectrpc/connect-query"; import { AgentService } from "@stackpanel/proto/agent-service"; +import { RebuildMethod, ShellService } from "@stackpanel/proto/agent/v1/shell"; import type { Apps, Variables, Users, Secrets } from "@stackpanel/proto"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useEffect, useMemo, useState } from "react"; @@ -76,13 +77,6 @@ export const agentQueryKeys = { rekeyWorkflow: () => [...agentQueryKeys.all, "rekeyWorkflow"] as const, } as const; -/** - * Query keys for shell status. - */ -export const shellQueryKeys = { - status: () => [...agentQueryKeys.all, "shell", "status"] as const, -} as const; - // ============================================================================= // Real-time Query Sync via SSE // ============================================================================= @@ -1057,81 +1051,71 @@ export function useServices() { } // ============================================================================= -// Shell Status (Devshell Management) +// Devshell Rebuild (v1 ShellService) // ============================================================================= /** - * Query hook for getting the devshell status. - * Returns whether the shell is stale (nix files changed since last rebuild). - */ -export function useShellStatus() { - const client = useAgentRpcClient(); - - return useQuery({ - queryKey: shellQueryKeys.status(), - queryFn: async () => { - if (!client) throw new Error("Not connected to agent"); - return client.getShellStatus({}); - }, - enabled: !!client, - refetchInterval: 10000, // Poll every 10 seconds as backup - }); -} - -/** - * Mutation hook for rebuilding the devshell. - * Returns an async iterator that streams rebuild events. + * Rebuilds the selected project's devshell over ShellService.RebuildShell and + * collects the streamed output. The promise resolves with the outcome: a + * completed event carries the exit code, and a rebuild that cannot run ends + * the stream with a ConnectError, which resolves unsuccessful and sets `error`. */ export function useRebuildShell() { - const client = useAgentRpcClient(); + const { isConnected } = useAgentContext(); + const transport = useTransport(); const queryClient = useQueryClient(); const [isRebuilding, setIsRebuilding] = useState(false); const [output, setOutput] = useState([]); const [error, setError] = useState(null); - const rebuild = async (method: "devshell" | "nix" = "devshell") => { - if (!client) throw new Error("Not connected to agent"); + const rebuild = async ( + method: "devshell" | "nix" = "devshell", + ): Promise<{ success: boolean; exitCode?: number; error?: string }> => { + if (!isConnected) throw new Error("Not connected to agent"); setIsRebuilding(true); setOutput([]); setError(null); try { - const stream = client.rebuildShell({ method }); - - for await (const event of stream) { - switch (event.type) { - case "started": - // Rebuild started - break; - case "output": - if (event.output) { - setOutput((prev) => [...prev, event.output]); - } + const stream = createClient(ShellService, transport).rebuildShell({ + method: method === "nix" ? RebuildMethod.NIX_DEVELOP : RebuildMethod.DEVSHELL, + }); + for await (const { event } of stream) { + switch (event.case) { + case "outputLine": { + const line = event.value; + setOutput((prev) => [...prev, line]); break; - case "completed": - // Invalidate shell status after successful rebuild - if (event.exitCode === 0) { - queryClient.invalidateQueries({ - queryKey: shellQueryKeys.status(), + } + case "completed": { + const { exitCode } = event.value; + if (exitCode === 0) { + void queryClient.invalidateQueries({ + queryKey: createConnectQueryKey({ + schema: ShellService.method.getShellStatus, + transport, + cardinality: "finite", + }), }); } - setIsRebuilding(false); - return { success: event.exitCode === 0, exitCode: event.exitCode }; - case "error": - setError(event.error || "Unknown error"); - setIsRebuilding(false); - return { success: false, error: event.error }; + return { success: exitCode === 0, exitCode }; + } } } + return { success: false }; } catch (err) { - setError(err instanceof Error ? err.message : "Failed to rebuild shell"); + const message = + err instanceof ConnectError + ? err.rawMessage + : err instanceof Error + ? err.message + : "Failed to rebuild shell"; + setError(message); + return { success: false, error: message }; + } finally { setIsRebuilding(false); - throw err; } - - setIsRebuilding(false); - return { success: false }; }; return { @@ -1139,7 +1123,6 @@ export function useRebuildShell() { isRebuilding, output, error, - clearOutput: () => setOutput([]), clearError: () => setError(null), }; } @@ -1311,11 +1294,15 @@ export function useAgentLiveQuerySync() { }); // Invalidate shell status when it changes + const shellStatusKey = createConnectQueryKey({ + schema: ShellService.method.getShellStatus, + cardinality: "finite", + }); useAgentSSEEvent("shell.stale", () => { - queryClient.invalidateQueries({ queryKey: shellQueryKeys.status() }); + queryClient.invalidateQueries({ queryKey: shellStatusKey }); }); useAgentSSEEvent("shell.rebuilt", () => { - queryClient.invalidateQueries({ queryKey: shellQueryKeys.status() }); + queryClient.invalidateQueries({ queryKey: shellStatusKey }); }); } diff --git a/packages/proto/gen/gopb/agent.pb.go b/packages/proto/gen/gopb/agent.pb.go index 18e2c306..47845085 100644 --- a/packages/proto/gen/gopb/agent.pb.go +++ b/packages/proto/gen/gopb/agent.pb.go @@ -1151,250 +1151,6 @@ func (x *NixConfigResponse) GetSource() string { return "" } -type GetShellStatusRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetShellStatusRequest) Reset() { - *x = GetShellStatusRequest{} - mi := &file_agent_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetShellStatusRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetShellStatusRequest) ProtoMessage() {} - -func (x *GetShellStatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_proto_msgTypes[20] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetShellStatusRequest.ProtoReflect.Descriptor instead. -func (*GetShellStatusRequest) Descriptor() ([]byte, []int) { - return file_agent_proto_rawDescGZIP(), []int{20} -} - -type ShellStatusResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Whether the shell is stale (nix files changed since last rebuild) - Stale bool `protobuf:"varint,1,opt,name=stale,proto3" json:"stale,omitempty"` - // Whether a rebuild is currently in progress - Rebuilding bool `protobuf:"varint,2,opt,name=rebuilding,proto3" json:"rebuilding,omitempty"` - // Timestamp of when the shell was last built (RFC3339) - LastBuilt string `protobuf:"bytes,3,opt,name=last_built,json=lastBuilt,proto3" json:"last_built,omitempty"` - // Timestamp of the most recent nix file change (RFC3339) - LastNixChange string `protobuf:"bytes,4,opt,name=last_nix_change,json=lastNixChange,proto3" json:"last_nix_change,omitempty"` - // List of files that changed since last build - ChangedFiles []string `protobuf:"bytes,5,rep,name=changed_files,json=changedFiles,proto3" json:"changed_files,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ShellStatusResponse) Reset() { - *x = ShellStatusResponse{} - mi := &file_agent_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ShellStatusResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ShellStatusResponse) ProtoMessage() {} - -func (x *ShellStatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_agent_proto_msgTypes[21] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ShellStatusResponse.ProtoReflect.Descriptor instead. -func (*ShellStatusResponse) Descriptor() ([]byte, []int) { - return file_agent_proto_rawDescGZIP(), []int{21} -} - -func (x *ShellStatusResponse) GetStale() bool { - if x != nil { - return x.Stale - } - return false -} - -func (x *ShellStatusResponse) GetRebuilding() bool { - if x != nil { - return x.Rebuilding - } - return false -} - -func (x *ShellStatusResponse) GetLastBuilt() string { - if x != nil { - return x.LastBuilt - } - return "" -} - -func (x *ShellStatusResponse) GetLastNixChange() string { - if x != nil { - return x.LastNixChange - } - return "" -} - -func (x *ShellStatusResponse) GetChangedFiles() []string { - if x != nil { - return x.ChangedFiles - } - return nil -} - -type RebuildShellRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Which command to use: "devshell" (./devshell) or "nix" (nix develop --impure) - // Defaults to "devshell" if not specified - Method string `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RebuildShellRequest) Reset() { - *x = RebuildShellRequest{} - mi := &file_agent_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RebuildShellRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RebuildShellRequest) ProtoMessage() {} - -func (x *RebuildShellRequest) ProtoReflect() protoreflect.Message { - mi := &file_agent_proto_msgTypes[22] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RebuildShellRequest.ProtoReflect.Descriptor instead. -func (*RebuildShellRequest) Descriptor() ([]byte, []int) { - return file_agent_proto_rawDescGZIP(), []int{22} -} - -func (x *RebuildShellRequest) GetMethod() string { - if x != nil { - return x.Method - } - return "" -} - -type RebuildShellEvent struct { - state protoimpl.MessageState `protogen:"open.v1"` - // Event type: "started", "output", "completed", "error" - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` - // Output line (for type="output") - Output string `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"` - // Exit code (for type="completed") - ExitCode int32 `protobuf:"varint,3,opt,name=exit_code,json=exitCode,proto3" json:"exit_code,omitempty"` - // Error message (for type="error") - Error string `protobuf:"bytes,4,opt,name=error,proto3" json:"error,omitempty"` - // Timestamp - Timestamp string `protobuf:"bytes,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RebuildShellEvent) Reset() { - *x = RebuildShellEvent{} - mi := &file_agent_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RebuildShellEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RebuildShellEvent) ProtoMessage() {} - -func (x *RebuildShellEvent) ProtoReflect() protoreflect.Message { - mi := &file_agent_proto_msgTypes[23] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use RebuildShellEvent.ProtoReflect.Descriptor instead. -func (*RebuildShellEvent) Descriptor() ([]byte, []int) { - return file_agent_proto_rawDescGZIP(), []int{23} -} - -func (x *RebuildShellEvent) GetType() string { - if x != nil { - return x.Type - } - return "" -} - -func (x *RebuildShellEvent) GetOutput() string { - if x != nil { - return x.Output - } - return "" -} - -func (x *RebuildShellEvent) GetExitCode() int32 { - if x != nil { - return x.ExitCode - } - return 0 -} - -func (x *RebuildShellEvent) GetError() string { - if x != nil { - return x.Error - } - return "" -} - -func (x *RebuildShellEvent) GetTimestamp() string { - if x != nil { - return x.Timestamp - } - return "" -} - var File_agent_proto protoreflect.FileDescriptor const file_agent_proto_rawDesc = "" + @@ -1475,25 +1231,7 @@ const file_agent_proto_rawDesc = "" + "configJson\x12!\n" + "\flast_updated\x18\x02 \x01(\tR\vlastUpdated\x12\x16\n" + "\x06cached\x18\x03 \x01(\bR\x06cached\x12\x16\n" + - "\x06source\x18\x04 \x01(\tR\x06source\"\x17\n" + - "\x15GetShellStatusRequest\"\xb7\x01\n" + - "\x13ShellStatusResponse\x12\x14\n" + - "\x05stale\x18\x01 \x01(\bR\x05stale\x12\x1e\n" + - "\n" + - "rebuilding\x18\x02 \x01(\bR\n" + - "rebuilding\x12\x1d\n" + - "\n" + - "last_built\x18\x03 \x01(\tR\tlastBuilt\x12&\n" + - "\x0flast_nix_change\x18\x04 \x01(\tR\rlastNixChange\x12#\n" + - "\rchanged_files\x18\x05 \x03(\tR\fchangedFiles\"-\n" + - "\x13RebuildShellRequest\x12\x16\n" + - "\x06method\x18\x01 \x01(\tR\x06method\"\x90\x01\n" + - "\x11RebuildShellEvent\x12\x12\n" + - "\x04type\x18\x01 \x01(\tR\x04type\x12\x16\n" + - "\x06output\x18\x02 \x01(\tR\x06output\x12\x1b\n" + - "\texit_code\x18\x03 \x01(\x05R\bexitCode\x12\x14\n" + - "\x05error\x18\x04 \x01(\tR\x05error\x12\x1c\n" + - "\ttimestamp\x18\x05 \x01(\tR\ttimestamp2\xf9\b\n" + + "\x06source\x18\x04 \x01(\tR\x06source2\xb9\a\n" + "\fAgentService\x12W\n" + "\n" + "GetProject\x12#.stackpanel.agent.GetProjectRequest\x1a$.stackpanel.agent.GetProjectResponse\x12I\n" + @@ -1507,9 +1245,7 @@ const file_agent_proto_rawDesc = "" + "\x14GetInstalledPackages\x12-.stackpanel.agent.GetInstalledPackagesRequest\x1a+.stackpanel.agent.InstalledPackagesResponse\x12]\n" + "\fGetProcesses\x12%.stackpanel.agent.GetProcessesRequest\x1a&.stackpanel.agent.GetProcessesResponse\x12]\n" + "\fPatchNixData\x12%.stackpanel.agent.PatchNixDataRequest\x1a&.stackpanel.agent.PatchNixDataResponse\x12Z\n" + - "\fGetNixConfig\x12%.stackpanel.agent.GetNixConfigRequest\x1a#.stackpanel.agent.NixConfigResponse\x12`\n" + - "\x0eGetShellStatus\x12'.stackpanel.agent.GetShellStatusRequest\x1a%.stackpanel.agent.ShellStatusResponse\x12\\\n" + - "\fRebuildShell\x12%.stackpanel.agent.RebuildShellRequest\x1a#.stackpanel.agent.RebuildShellEvent0\x01B:Z8github.com/darkmatter/stackpanel/packages/proto/gen/gopbb\x06proto3" + "\fGetNixConfig\x12%.stackpanel.agent.GetNixConfigRequest\x1a#.stackpanel.agent.NixConfigResponseB:Z8github.com/darkmatter/stackpanel/packages/proto/gen/gopbb\x06proto3" var ( file_agent_proto_rawDescOnce sync.Once @@ -1524,7 +1260,7 @@ func file_agent_proto_rawDescGZIP() []byte { } var ( - file_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 25) + file_agent_proto_msgTypes = make([]protoimpl.MessageInfo, 21) file_agent_proto_goTypes = []any{ (*GetProjectRequest)(nil), // 0: stackpanel.agent.GetProjectRequest (*GetProjectResponse)(nil), // 1: stackpanel.agent.GetProjectResponse @@ -1546,24 +1282,20 @@ var ( (*PatchNixDataResponse)(nil), // 17: stackpanel.agent.PatchNixDataResponse (*GetNixConfigRequest)(nil), // 18: stackpanel.agent.GetNixConfigRequest (*NixConfigResponse)(nil), // 19: stackpanel.agent.NixConfigResponse - (*GetShellStatusRequest)(nil), // 20: stackpanel.agent.GetShellStatusRequest - (*ShellStatusResponse)(nil), // 21: stackpanel.agent.ShellStatusResponse - (*RebuildShellRequest)(nil), // 22: stackpanel.agent.RebuildShellRequest - (*RebuildShellEvent)(nil), // 23: stackpanel.agent.RebuildShellEvent - nil, // 24: stackpanel.agent.ExecRequest.EnvEntry - (*GetModuleOutputsRequest)(nil), // 25: stackpanel.db.GetModuleOutputsRequest - (*Secrets)(nil), // 26: stackpanel.db.Secrets - (*Users)(nil), // 27: stackpanel.db.Users - (*Apps)(nil), // 28: stackpanel.db.Apps - (*Variables)(nil), // 29: stackpanel.db.Variables - (*ModuleOutputs)(nil), // 30: stackpanel.db.ModuleOutputs + nil, // 20: stackpanel.agent.ExecRequest.EnvEntry + (*GetModuleOutputsRequest)(nil), // 21: stackpanel.db.GetModuleOutputsRequest + (*Secrets)(nil), // 22: stackpanel.db.Secrets + (*Users)(nil), // 23: stackpanel.db.Users + (*Apps)(nil), // 24: stackpanel.db.Apps + (*Variables)(nil), // 25: stackpanel.db.Variables + (*ModuleOutputs)(nil), // 26: stackpanel.db.ModuleOutputs } ) var file_agent_proto_depIdxs = []int32{ 2, // 0: stackpanel.agent.GetProjectResponse.project:type_name -> stackpanel.agent.Project 3, // 1: stackpanel.agent.Project.dirs:type_name -> stackpanel.agent.Directories - 24, // 2: stackpanel.agent.ExecRequest.env:type_name -> stackpanel.agent.ExecRequest.EnvEntry + 20, // 2: stackpanel.agent.ExecRequest.env:type_name -> stackpanel.agent.ExecRequest.EnvEntry 11, // 3: stackpanel.agent.InstalledPackagesResponse.packages:type_name -> stackpanel.agent.InstalledPackage 14, // 4: stackpanel.agent.GetProcessesResponse.processes:type_name -> stackpanel.agent.ProcessInfo 0, // 5: stackpanel.agent.AgentService.GetProject:input_type -> stackpanel.agent.GetProjectRequest @@ -1571,29 +1303,25 @@ var file_agent_proto_depIdxs = []int32{ 5, // 7: stackpanel.agent.AgentService.GetUsers:input_type -> stackpanel.agent.GetUsersRequest 6, // 8: stackpanel.agent.AgentService.GetApps:input_type -> stackpanel.agent.GetAppsRequest 7, // 9: stackpanel.agent.AgentService.GetVariables:input_type -> stackpanel.agent.GetVariablesRequest - 25, // 10: stackpanel.agent.AgentService.GetModuleOutputs:input_type -> stackpanel.db.GetModuleOutputsRequest + 21, // 10: stackpanel.agent.AgentService.GetModuleOutputs:input_type -> stackpanel.db.GetModuleOutputsRequest 8, // 11: stackpanel.agent.AgentService.Exec:input_type -> stackpanel.agent.ExecRequest 10, // 12: stackpanel.agent.AgentService.GetInstalledPackages:input_type -> stackpanel.agent.GetInstalledPackagesRequest 13, // 13: stackpanel.agent.AgentService.GetProcesses:input_type -> stackpanel.agent.GetProcessesRequest 16, // 14: stackpanel.agent.AgentService.PatchNixData:input_type -> stackpanel.agent.PatchNixDataRequest 18, // 15: stackpanel.agent.AgentService.GetNixConfig:input_type -> stackpanel.agent.GetNixConfigRequest - 20, // 16: stackpanel.agent.AgentService.GetShellStatus:input_type -> stackpanel.agent.GetShellStatusRequest - 22, // 17: stackpanel.agent.AgentService.RebuildShell:input_type -> stackpanel.agent.RebuildShellRequest - 1, // 18: stackpanel.agent.AgentService.GetProject:output_type -> stackpanel.agent.GetProjectResponse - 26, // 19: stackpanel.agent.AgentService.GetSecrets:output_type -> stackpanel.db.Secrets - 27, // 20: stackpanel.agent.AgentService.GetUsers:output_type -> stackpanel.db.Users - 28, // 21: stackpanel.agent.AgentService.GetApps:output_type -> stackpanel.db.Apps - 29, // 22: stackpanel.agent.AgentService.GetVariables:output_type -> stackpanel.db.Variables - 30, // 23: stackpanel.agent.AgentService.GetModuleOutputs:output_type -> stackpanel.db.ModuleOutputs - 9, // 24: stackpanel.agent.AgentService.Exec:output_type -> stackpanel.agent.ExecResponse - 12, // 25: stackpanel.agent.AgentService.GetInstalledPackages:output_type -> stackpanel.agent.InstalledPackagesResponse - 15, // 26: stackpanel.agent.AgentService.GetProcesses:output_type -> stackpanel.agent.GetProcessesResponse - 17, // 27: stackpanel.agent.AgentService.PatchNixData:output_type -> stackpanel.agent.PatchNixDataResponse - 19, // 28: stackpanel.agent.AgentService.GetNixConfig:output_type -> stackpanel.agent.NixConfigResponse - 21, // 29: stackpanel.agent.AgentService.GetShellStatus:output_type -> stackpanel.agent.ShellStatusResponse - 23, // 30: stackpanel.agent.AgentService.RebuildShell:output_type -> stackpanel.agent.RebuildShellEvent - 18, // [18:31] is the sub-list for method output_type - 5, // [5:18] is the sub-list for method input_type + 1, // 16: stackpanel.agent.AgentService.GetProject:output_type -> stackpanel.agent.GetProjectResponse + 22, // 17: stackpanel.agent.AgentService.GetSecrets:output_type -> stackpanel.db.Secrets + 23, // 18: stackpanel.agent.AgentService.GetUsers:output_type -> stackpanel.db.Users + 24, // 19: stackpanel.agent.AgentService.GetApps:output_type -> stackpanel.db.Apps + 25, // 20: stackpanel.agent.AgentService.GetVariables:output_type -> stackpanel.db.Variables + 26, // 21: stackpanel.agent.AgentService.GetModuleOutputs:output_type -> stackpanel.db.ModuleOutputs + 9, // 22: stackpanel.agent.AgentService.Exec:output_type -> stackpanel.agent.ExecResponse + 12, // 23: stackpanel.agent.AgentService.GetInstalledPackages:output_type -> stackpanel.agent.InstalledPackagesResponse + 15, // 24: stackpanel.agent.AgentService.GetProcesses:output_type -> stackpanel.agent.GetProcessesResponse + 17, // 25: stackpanel.agent.AgentService.PatchNixData:output_type -> stackpanel.agent.PatchNixDataResponse + 19, // 26: stackpanel.agent.AgentService.GetNixConfig:output_type -> stackpanel.agent.NixConfigResponse + 16, // [16:27] is the sub-list for method output_type + 5, // [5:16] is the sub-list for method input_type 5, // [5:5] is the sub-list for extension type_name 5, // [5:5] is the sub-list for extension extendee 0, // [0:5] is the sub-list for field type_name @@ -1617,7 +1345,7 @@ func file_agent_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_agent_proto_rawDesc), len(file_agent_proto_rawDesc)), NumEnums: 0, - NumMessages: 25, + NumMessages: 21, NumExtensions: 0, NumServices: 1, }, diff --git a/packages/proto/gen/gopb/gopbconnect/agent.connect.go b/packages/proto/gen/gopb/gopbconnect/agent.connect.go index 09d61f6b..a17561f8 100644 --- a/packages/proto/gen/gopb/gopbconnect/agent.connect.go +++ b/packages/proto/gen/gopb/gopbconnect/agent.connect.go @@ -62,12 +62,6 @@ const ( // AgentServiceGetNixConfigProcedure is the fully-qualified name of the AgentService's GetNixConfig // RPC. AgentServiceGetNixConfigProcedure = "/stackpanel.agent.AgentService/GetNixConfig" - // AgentServiceGetShellStatusProcedure is the fully-qualified name of the AgentService's - // GetShellStatus RPC. - AgentServiceGetShellStatusProcedure = "/stackpanel.agent.AgentService/GetShellStatus" - // AgentServiceRebuildShellProcedure is the fully-qualified name of the AgentService's RebuildShell - // RPC. - AgentServiceRebuildShellProcedure = "/stackpanel.agent.AgentService/RebuildShell" ) // AgentServiceClient is a client for the stackpanel.agent.AgentService service. @@ -91,9 +85,6 @@ type AgentServiceClient interface { PatchNixData(context.Context, *connect.Request[gopb.PatchNixDataRequest]) (*connect.Response[gopb.PatchNixDataResponse], error) // Full Nix config (evaluated from flake) GetNixConfig(context.Context, *connect.Request[gopb.GetNixConfigRequest]) (*connect.Response[gopb.NixConfigResponse], error) - // Devshell management - GetShellStatus(context.Context, *connect.Request[gopb.GetShellStatusRequest]) (*connect.Response[gopb.ShellStatusResponse], error) - RebuildShell(context.Context, *connect.Request[gopb.RebuildShellRequest]) (*connect.ServerStreamForClient[gopb.RebuildShellEvent], error) } // NewAgentServiceClient constructs a client for the stackpanel.agent.AgentService service. By @@ -173,18 +164,6 @@ func NewAgentServiceClient(httpClient connect.HTTPClient, baseURL string, opts . connect.WithSchema(agentServiceMethods.ByName("GetNixConfig")), connect.WithClientOptions(opts...), ), - getShellStatus: connect.NewClient[gopb.GetShellStatusRequest, gopb.ShellStatusResponse]( - httpClient, - baseURL+AgentServiceGetShellStatusProcedure, - connect.WithSchema(agentServiceMethods.ByName("GetShellStatus")), - connect.WithClientOptions(opts...), - ), - rebuildShell: connect.NewClient[gopb.RebuildShellRequest, gopb.RebuildShellEvent]( - httpClient, - baseURL+AgentServiceRebuildShellProcedure, - connect.WithSchema(agentServiceMethods.ByName("RebuildShell")), - connect.WithClientOptions(opts...), - ), } } @@ -201,8 +180,6 @@ type agentServiceClient struct { getProcesses *connect.Client[gopb.GetProcessesRequest, gopb.GetProcessesResponse] patchNixData *connect.Client[gopb.PatchNixDataRequest, gopb.PatchNixDataResponse] getNixConfig *connect.Client[gopb.GetNixConfigRequest, gopb.NixConfigResponse] - getShellStatus *connect.Client[gopb.GetShellStatusRequest, gopb.ShellStatusResponse] - rebuildShell *connect.Client[gopb.RebuildShellRequest, gopb.RebuildShellEvent] } // GetProject calls stackpanel.agent.AgentService.GetProject. @@ -260,16 +237,6 @@ func (c *agentServiceClient) GetNixConfig(ctx context.Context, req *connect.Requ return c.getNixConfig.CallUnary(ctx, req) } -// GetShellStatus calls stackpanel.agent.AgentService.GetShellStatus. -func (c *agentServiceClient) GetShellStatus(ctx context.Context, req *connect.Request[gopb.GetShellStatusRequest]) (*connect.Response[gopb.ShellStatusResponse], error) { - return c.getShellStatus.CallUnary(ctx, req) -} - -// RebuildShell calls stackpanel.agent.AgentService.RebuildShell. -func (c *agentServiceClient) RebuildShell(ctx context.Context, req *connect.Request[gopb.RebuildShellRequest]) (*connect.ServerStreamForClient[gopb.RebuildShellEvent], error) { - return c.rebuildShell.CallServerStream(ctx, req) -} - // AgentServiceHandler is an implementation of the stackpanel.agent.AgentService service. type AgentServiceHandler interface { // Project @@ -291,9 +258,6 @@ type AgentServiceHandler interface { PatchNixData(context.Context, *connect.Request[gopb.PatchNixDataRequest]) (*connect.Response[gopb.PatchNixDataResponse], error) // Full Nix config (evaluated from flake) GetNixConfig(context.Context, *connect.Request[gopb.GetNixConfigRequest]) (*connect.Response[gopb.NixConfigResponse], error) - // Devshell management - GetShellStatus(context.Context, *connect.Request[gopb.GetShellStatusRequest]) (*connect.Response[gopb.ShellStatusResponse], error) - RebuildShell(context.Context, *connect.Request[gopb.RebuildShellRequest], *connect.ServerStream[gopb.RebuildShellEvent]) error } // NewAgentServiceHandler builds an HTTP handler from the service implementation. It returns the @@ -369,18 +333,6 @@ func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOpti connect.WithSchema(agentServiceMethods.ByName("GetNixConfig")), connect.WithHandlerOptions(opts...), ) - agentServiceGetShellStatusHandler := connect.NewUnaryHandler( - AgentServiceGetShellStatusProcedure, - svc.GetShellStatus, - connect.WithSchema(agentServiceMethods.ByName("GetShellStatus")), - connect.WithHandlerOptions(opts...), - ) - agentServiceRebuildShellHandler := connect.NewServerStreamHandler( - AgentServiceRebuildShellProcedure, - svc.RebuildShell, - connect.WithSchema(agentServiceMethods.ByName("RebuildShell")), - connect.WithHandlerOptions(opts...), - ) return "/stackpanel.agent.AgentService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { case AgentServiceGetProjectProcedure: @@ -405,10 +357,6 @@ func NewAgentServiceHandler(svc AgentServiceHandler, opts ...connect.HandlerOpti agentServicePatchNixDataHandler.ServeHTTP(w, r) case AgentServiceGetNixConfigProcedure: agentServiceGetNixConfigHandler.ServeHTTP(w, r) - case AgentServiceGetShellStatusProcedure: - agentServiceGetShellStatusHandler.ServeHTTP(w, r) - case AgentServiceRebuildShellProcedure: - agentServiceRebuildShellHandler.ServeHTTP(w, r) default: http.NotFound(w, r) } @@ -461,11 +409,3 @@ func (UnimplementedAgentServiceHandler) PatchNixData(context.Context, *connect.R func (UnimplementedAgentServiceHandler) GetNixConfig(context.Context, *connect.Request[gopb.GetNixConfigRequest]) (*connect.Response[gopb.NixConfigResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("stackpanel.agent.AgentService.GetNixConfig is not implemented")) } - -func (UnimplementedAgentServiceHandler) GetShellStatus(context.Context, *connect.Request[gopb.GetShellStatusRequest]) (*connect.Response[gopb.ShellStatusResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("stackpanel.agent.AgentService.GetShellStatus is not implemented")) -} - -func (UnimplementedAgentServiceHandler) RebuildShell(context.Context, *connect.Request[gopb.RebuildShellRequest], *connect.ServerStream[gopb.RebuildShellEvent]) error { - return connect.NewError(connect.CodeUnimplemented, errors.New("stackpanel.agent.AgentService.RebuildShell is not implemented")) -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.bundle.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.bundle.json deleted file mode 100644 index 9f8a1dff..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.bundle.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.GetShellStatusRequest.jsonschema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.GetShellStatusRequest.jsonschema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.GetShellStatusRequest.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.json deleted file mode 100644 index be7e3590..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "stackpanel.agent.GetShellStatusRequest.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.bundle.json deleted file mode 100644 index a4f9c0b1..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.bundle.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.GetShellStatusRequest.jsonschema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json deleted file mode 100644 index 32aaf06a..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "stackpanel.agent.GetShellStatusRequest.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.bundle.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.bundle.json deleted file mode 100644 index 54fa0b4c..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.bundle.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.GetShellStatusRequest.schema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.GetShellStatusRequest.schema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.GetShellStatusRequest.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.json deleted file mode 100644 index 2e876b87..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "stackpanel.agent.GetShellStatusRequest.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.bundle.json deleted file mode 100644 index 300063ec..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.bundle.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.GetShellStatusRequest.schema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.GetShellStatusRequest.schema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.GetShellStatusRequest.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.json b/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.json deleted file mode 100644 index 656a4eb1..00000000 --- a/packages/proto/gen/json/stackpanel.agent.GetShellStatusRequest.schema.strict.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "$id": "stackpanel.agent.GetShellStatusRequest.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": {}, - "title": "Get Shell Status Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.bundle.json deleted file mode 100644 index d6389b14..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.bundle.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellEvent.jsonschema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(exit_code)$": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - } - }, - "properties": { - "error": { - "default": "", - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exitCode": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - }, - "output": { - "default": "", - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "default": "", - "description": "Timestamp", - "type": "string" - }, - "type": { - "default": "", - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "title": "Rebuild Shell Event", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellEvent.jsonschema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellEvent.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.json deleted file mode 100644 index de825e3f..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellEvent.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(exit_code)$": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - } - }, - "properties": { - "error": { - "default": "", - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exitCode": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - }, - "output": { - "default": "", - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "default": "", - "description": "Timestamp", - "type": "string" - }, - "type": { - "default": "", - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "title": "Rebuild Shell Event", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.bundle.json deleted file mode 100644 index 5a6f8e4b..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.bundle.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellEvent.jsonschema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "error": { - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exitCode": { - "description": "Exit code (for type=\"completed\")", - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - "output": { - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "description": "Timestamp", - "type": "string" - }, - "type": { - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "required": [ - "type", - "output", - "exitCode", - "error", - "timestamp" - ], - "title": "Rebuild Shell Event", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellEvent.jsonschema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellEvent.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.json deleted file mode 100644 index 7dd97350..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.jsonschema.strict.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellEvent.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "error": { - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exitCode": { - "description": "Exit code (for type=\"completed\")", - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - "output": { - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "description": "Timestamp", - "type": "string" - }, - "type": { - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "required": [ - "type", - "output", - "exitCode", - "error", - "timestamp" - ], - "title": "Rebuild Shell Event", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.bundle.json deleted file mode 100644 index 8a29c957..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.bundle.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellEvent.schema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(exitCode)$": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - } - }, - "properties": { - "error": { - "default": "", - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exit_code": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - }, - "output": { - "default": "", - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "default": "", - "description": "Timestamp", - "type": "string" - }, - "type": { - "default": "", - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "title": "Rebuild Shell Event", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellEvent.schema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellEvent.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.json deleted file mode 100644 index dd6f18dd..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellEvent.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(exitCode)$": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - } - }, - "properties": { - "error": { - "default": "", - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exit_code": { - "anyOf": [ - { - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - { - "pattern": "^-?[0-9]+$", - "type": "string" - } - ], - "default": 0, - "description": "Exit code (for type=\"completed\")" - }, - "output": { - "default": "", - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "default": "", - "description": "Timestamp", - "type": "string" - }, - "type": { - "default": "", - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "title": "Rebuild Shell Event", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.bundle.json deleted file mode 100644 index 9c527224..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.bundle.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellEvent.schema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "error": { - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exit_code": { - "description": "Exit code (for type=\"completed\")", - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - "output": { - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "description": "Timestamp", - "type": "string" - }, - "type": { - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "required": [ - "type", - "output", - "exit_code", - "error", - "timestamp" - ], - "title": "Rebuild Shell Event", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellEvent.schema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellEvent.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.json deleted file mode 100644 index d38f402f..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellEvent.schema.strict.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellEvent.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "error": { - "description": "Error message (for type=\"error\")", - "type": "string" - }, - "exit_code": { - "description": "Exit code (for type=\"completed\")", - "maximum": 2147483647, - "minimum": -2147483648, - "type": "integer" - }, - "output": { - "description": "Output line (for type=\"output\")", - "type": "string" - }, - "timestamp": { - "description": "Timestamp", - "type": "string" - }, - "type": { - "description": "Event type: \"started\", \"output\", \"completed\", \"error\"", - "type": "string" - } - }, - "required": [ - "type", - "output", - "exit_code", - "error", - "timestamp" - ], - "title": "Rebuild Shell Event", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.bundle.json deleted file mode 100644 index faabbd15..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.bundle.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellRequest.jsonschema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "default": "", - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "title": "Rebuild Shell Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellRequest.jsonschema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellRequest.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.json deleted file mode 100644 index 55ba4a87..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellRequest.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "default": "", - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "title": "Rebuild Shell Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.bundle.json deleted file mode 100644 index 228f86b6..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.bundle.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellRequest.jsonschema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "required": [ - "method" - ], - "title": "Rebuild Shell Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellRequest.jsonschema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellRequest.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.json deleted file mode 100644 index 045cad9c..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.jsonschema.strict.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellRequest.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "required": [ - "method" - ], - "title": "Rebuild Shell Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.bundle.json deleted file mode 100644 index 78146285..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.bundle.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellRequest.schema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "default": "", - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "title": "Rebuild Shell Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellRequest.schema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellRequest.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.json deleted file mode 100644 index f15fd029..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellRequest.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "default": "", - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "title": "Rebuild Shell Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.bundle.json deleted file mode 100644 index 6354a67e..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.bundle.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.RebuildShellRequest.schema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "required": [ - "method" - ], - "title": "Rebuild Shell Request", - "type": "object" - } - }, - "$id": "stackpanel.agent.RebuildShellRequest.schema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.RebuildShellRequest.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.json b/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.json deleted file mode 100644 index e85d02e7..00000000 --- a/packages/proto/gen/json/stackpanel.agent.RebuildShellRequest.schema.strict.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "$id": "stackpanel.agent.RebuildShellRequest.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "method": { - "description": "Which command to use: \"devshell\" (./devshell) or \"nix\" (nix develop --impure)\n Defaults to \"devshell\" if not specified", - "type": "string" - } - }, - "required": [ - "method" - ], - "title": "Rebuild Shell Request", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.bundle.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.bundle.json deleted file mode 100644 index cbbed04b..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.bundle.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.ShellStatusResponse.jsonschema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(changed_files)$": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "^(last_built)$": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "^(last_nix_change)$": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - } - }, - "properties": { - "changedFiles": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "lastBuilt": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "lastNixChange": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "default": false, - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "default": false, - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "title": "Shell Status Response", - "type": "object" - } - }, - "$id": "stackpanel.agent.ShellStatusResponse.jsonschema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.ShellStatusResponse.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.json deleted file mode 100644 index b008de37..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$id": "stackpanel.agent.ShellStatusResponse.jsonschema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(changed_files)$": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "^(last_built)$": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "^(last_nix_change)$": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - } - }, - "properties": { - "changedFiles": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "lastBuilt": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "lastNixChange": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "default": false, - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "default": false, - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "title": "Shell Status Response", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.bundle.json deleted file mode 100644 index ae1a80b7..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.bundle.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.ShellStatusResponse.jsonschema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "changedFiles": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "lastBuilt": { - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "lastNixChange": { - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "required": [ - "stale", - "rebuilding", - "lastBuilt", - "lastNixChange" - ], - "title": "Shell Status Response", - "type": "object" - } - }, - "$id": "stackpanel.agent.ShellStatusResponse.jsonschema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.ShellStatusResponse.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.json deleted file mode 100644 index 1fe0f994..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.jsonschema.strict.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$id": "stackpanel.agent.ShellStatusResponse.jsonschema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "changedFiles": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "lastBuilt": { - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "lastNixChange": { - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "required": [ - "stale", - "rebuilding", - "lastBuilt", - "lastNixChange" - ], - "title": "Shell Status Response", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.bundle.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.bundle.json deleted file mode 100644 index 709319ff..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.bundle.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.ShellStatusResponse.schema.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(changedFiles)$": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "^(lastBuilt)$": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "^(lastNixChange)$": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - } - }, - "properties": { - "changed_files": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "last_built": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "last_nix_change": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "default": false, - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "default": false, - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "title": "Shell Status Response", - "type": "object" - } - }, - "$id": "stackpanel.agent.ShellStatusResponse.schema.bundle.json", - "$ref": "#/$defs/stackpanel.agent.ShellStatusResponse.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.json deleted file mode 100644 index 1b883a4e..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "$id": "stackpanel.agent.ShellStatusResponse.schema.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "patternProperties": { - "^(changedFiles)$": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "^(lastBuilt)$": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "^(lastNixChange)$": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - } - }, - "properties": { - "changed_files": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "last_built": { - "default": "", - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "last_nix_change": { - "default": "", - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "default": false, - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "default": false, - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "title": "Shell Status Response", - "type": "object" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.bundle.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.bundle.json deleted file mode 100644 index 2e8d7774..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.bundle.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "$defs": { - "stackpanel.agent.ShellStatusResponse.schema.strict.json": { - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "changed_files": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "last_built": { - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "last_nix_change": { - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "required": [ - "stale", - "rebuilding", - "last_built", - "last_nix_change" - ], - "title": "Shell Status Response", - "type": "object" - } - }, - "$id": "stackpanel.agent.ShellStatusResponse.schema.strict.bundle.json", - "$ref": "#/$defs/stackpanel.agent.ShellStatusResponse.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema" -} diff --git a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.json b/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.json deleted file mode 100644 index eb3bb95f..00000000 --- a/packages/proto/gen/json/stackpanel.agent.ShellStatusResponse.schema.strict.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "$id": "stackpanel.agent.ShellStatusResponse.schema.strict.json", - "$schema": "https://json-schema.org/draft/2020-12/schema", - "additionalProperties": false, - "properties": { - "changed_files": { - "description": "List of files that changed since last build", - "items": { - "type": "string" - }, - "type": "array" - }, - "last_built": { - "description": "Timestamp of when the shell was last built (RFC3339)", - "type": "string" - }, - "last_nix_change": { - "description": "Timestamp of the most recent nix file change (RFC3339)", - "type": "string" - }, - "rebuilding": { - "description": "Whether a rebuild is currently in progress", - "type": "boolean" - }, - "stale": { - "description": "Whether the shell is stale (nix files changed since last rebuild)", - "type": "boolean" - } - }, - "required": [ - "stale", - "rebuilding", - "last_built", - "last_nix_change" - ], - "title": "Shell Status Response", - "type": "object" -} diff --git a/packages/proto/gen/ts/agent-AgentService_connectquery.d.ts b/packages/proto/gen/ts/agent-AgentService_connectquery.d.ts index 846a0a84..b6c87c19 100644 --- a/packages/proto/gen/ts/agent-AgentService_connectquery.d.ts +++ b/packages/proto/gen/ts/agent-AgentService_connectquery.d.ts @@ -64,9 +64,3 @@ export const patchNixData: typeof AgentService["method"]["patchNixData"]; * @generated from rpc stackpanel.agent.AgentService.GetNixConfig */ export const getNixConfig: typeof AgentService["method"]["getNixConfig"]; -/** - * Devshell management - * - * @generated from rpc stackpanel.agent.AgentService.GetShellStatus - */ -export const getShellStatus: typeof AgentService["method"]["getShellStatus"]; diff --git a/packages/proto/gen/ts/agent-AgentService_connectquery.js b/packages/proto/gen/ts/agent-AgentService_connectquery.js index 0e023ab3..1e9719fa 100644 --- a/packages/proto/gen/ts/agent-AgentService_connectquery.js +++ b/packages/proto/gen/ts/agent-AgentService_connectquery.js @@ -74,10 +74,3 @@ export const patchNixData = AgentService.method.patchNixData; * @generated from rpc stackpanel.agent.AgentService.GetNixConfig */ export const getNixConfig = AgentService.method.getNixConfig; - -/** - * Devshell management - * - * @generated from rpc stackpanel.agent.AgentService.GetShellStatus - */ -export const getShellStatus = AgentService.method.getShellStatus; diff --git a/packages/proto/gen/ts/agent.client.ts b/packages/proto/gen/ts/agent.client.ts index 89570c27..ebb4ef1b 100644 --- a/packages/proto/gen/ts/agent.client.ts +++ b/packages/proto/gen/ts/agent.client.ts @@ -4,11 +4,6 @@ import type { RpcTransport } from "@protobuf-ts/runtime-rpc"; import type { ServiceInfo } from "@protobuf-ts/runtime-rpc"; import { AgentService } from "./agent"; -import type { RebuildShellEvent } from "./agent"; -import type { RebuildShellRequest } from "./agent"; -import type { ServerStreamingCall } from "@protobuf-ts/runtime-rpc"; -import type { ShellStatusResponse } from "./agent"; -import type { GetShellStatusRequest } from "./agent"; import type { NixConfigResponse } from "./agent"; import type { GetNixConfigRequest } from "./agent"; import type { PatchNixDataResponse } from "./agent"; @@ -105,16 +100,6 @@ export interface IAgentServiceClient { * @generated from protobuf rpc: GetNixConfig */ getNixConfig(input: GetNixConfigRequest, options?: RpcOptions): UnaryCall; - /** - * Devshell management - * - * @generated from protobuf rpc: GetShellStatus - */ - getShellStatus(input: GetShellStatusRequest, options?: RpcOptions): UnaryCall; - /** - * @generated from protobuf rpc: RebuildShell - */ - rebuildShell(input: RebuildShellRequest, options?: RpcOptions): ServerStreamingCall; } // ============================================================================= // Agent Service @@ -225,20 +210,4 @@ export class AgentServiceClient implements IAgentServiceClient, ServiceInfo { const method = this.methods[10], opt = this._transport.mergeOptions(options); return stackIntercept("unary", this._transport, method, opt, input); } - /** - * Devshell management - * - * @generated from protobuf rpc: GetShellStatus - */ - getShellStatus(input: GetShellStatusRequest, options?: RpcOptions): UnaryCall { - const method = this.methods[11], opt = this._transport.mergeOptions(options); - return stackIntercept("unary", this._transport, method, opt, input); - } - /** - * @generated from protobuf rpc: RebuildShell - */ - rebuildShell(input: RebuildShellRequest, options?: RpcOptions): ServerStreamingCall { - const method = this.methods[12], opt = this._transport.mergeOptions(options); - return stackIntercept("serverStreaming", this._transport, method, opt, input); - } } diff --git a/packages/proto/gen/ts/agent.ts b/packages/proto/gen/ts/agent.ts index 4e948c92..68a6a2aa 100644 --- a/packages/proto/gen/ts/agent.ts +++ b/packages/proto/gen/ts/agent.ts @@ -372,97 +372,6 @@ export interface NixConfigResponse { */ source: string; // "cache" or "eval" } -// ============================================================================= -// Devshell Management -// ============================================================================= - -/** - * @generated from protobuf message stackpanel.agent.GetShellStatusRequest - */ -export interface GetShellStatusRequest { -} -/** - * @generated from protobuf message stackpanel.agent.ShellStatusResponse - */ -export interface ShellStatusResponse { - /** - * Whether the shell is stale (nix files changed since last rebuild) - * - * @generated from protobuf field: bool stale = 1 - */ - stale: boolean; - /** - * Whether a rebuild is currently in progress - * - * @generated from protobuf field: bool rebuilding = 2 - */ - rebuilding: boolean; - /** - * Timestamp of when the shell was last built (RFC3339) - * - * @generated from protobuf field: string last_built = 3 - */ - last_built: string; - /** - * Timestamp of the most recent nix file change (RFC3339) - * - * @generated from protobuf field: string last_nix_change = 4 - */ - last_nix_change: string; - /** - * List of files that changed since last build - * - * @generated from protobuf field: repeated string changed_files = 5 - */ - changed_files: string[]; -} -/** - * @generated from protobuf message stackpanel.agent.RebuildShellRequest - */ -export interface RebuildShellRequest { - /** - * Which command to use: "devshell" (./devshell) or "nix" (nix develop --impure) - * Defaults to "devshell" if not specified - * - * @generated from protobuf field: string method = 1 - */ - method: string; -} -/** - * @generated from protobuf message stackpanel.agent.RebuildShellEvent - */ -export interface RebuildShellEvent { - /** - * Event type: "started", "output", "completed", "error" - * - * @generated from protobuf field: string type = 1 - */ - type: string; - /** - * Output line (for type="output") - * - * @generated from protobuf field: string output = 2 - */ - output: string; - /** - * Exit code (for type="completed") - * - * @generated from protobuf field: int32 exit_code = 3 - */ - exit_code: number; - /** - * Error message (for type="error") - * - * @generated from protobuf field: string error = 4 - */ - error: string; - /** - * Timestamp - * - * @generated from protobuf field: string timestamp = 5 - */ - timestamp: string; -} // @generated message type with reflection information, may provide speed optimized methods class GetProjectRequest$Type extends MessageType { constructor() { @@ -1634,249 +1543,6 @@ class NixConfigResponse$Type extends MessageType { * @generated MessageType for protobuf message stackpanel.agent.NixConfigResponse */ export const NixConfigResponse = new NixConfigResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class GetShellStatusRequest$Type extends MessageType { - constructor() { - super("stackpanel.agent.GetShellStatusRequest", []); - } - create(value?: PartialMessage): GetShellStatusRequest { - const message = globalThis.Object.create((this.messagePrototype!)); - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetShellStatusRequest): GetShellStatusRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: GetShellStatusRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message stackpanel.agent.GetShellStatusRequest - */ -export const GetShellStatusRequest = new GetShellStatusRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class ShellStatusResponse$Type extends MessageType { - constructor() { - super("stackpanel.agent.ShellStatusResponse", [ - { no: 1, name: "stale", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 2, name: "rebuilding", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }, - { no: 3, name: "last_built", kind: "scalar", localName: "last_built", T: 9 /*ScalarType.STRING*/ }, - { no: 4, name: "last_nix_change", kind: "scalar", localName: "last_nix_change", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "changed_files", kind: "scalar", localName: "changed_files", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): ShellStatusResponse { - const message = globalThis.Object.create((this.messagePrototype!)); - message.stale = false; - message.rebuilding = false; - message.last_built = ""; - message.last_nix_change = ""; - message.changed_files = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: ShellStatusResponse): ShellStatusResponse { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* bool stale */ 1: - message.stale = reader.bool(); - break; - case /* bool rebuilding */ 2: - message.rebuilding = reader.bool(); - break; - case /* string last_built */ 3: - message.last_built = reader.string(); - break; - case /* string last_nix_change */ 4: - message.last_nix_change = reader.string(); - break; - case /* repeated string changed_files */ 5: - message.changed_files.push(reader.string()); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: ShellStatusResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* bool stale = 1; */ - if (message.stale !== false) - writer.tag(1, WireType.Varint).bool(message.stale); - /* bool rebuilding = 2; */ - if (message.rebuilding !== false) - writer.tag(2, WireType.Varint).bool(message.rebuilding); - /* string last_built = 3; */ - if (message.last_built !== "") - writer.tag(3, WireType.LengthDelimited).string(message.last_built); - /* string last_nix_change = 4; */ - if (message.last_nix_change !== "") - writer.tag(4, WireType.LengthDelimited).string(message.last_nix_change); - /* repeated string changed_files = 5; */ - for (let i = 0; i < message.changed_files.length; i++) - writer.tag(5, WireType.LengthDelimited).string(message.changed_files[i]); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message stackpanel.agent.ShellStatusResponse - */ -export const ShellStatusResponse = new ShellStatusResponse$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RebuildShellRequest$Type extends MessageType { - constructor() { - super("stackpanel.agent.RebuildShellRequest", [ - { no: 1, name: "method", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): RebuildShellRequest { - const message = globalThis.Object.create((this.messagePrototype!)); - message.method = ""; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RebuildShellRequest): RebuildShellRequest { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string method */ 1: - message.method = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RebuildShellRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string method = 1; */ - if (message.method !== "") - writer.tag(1, WireType.LengthDelimited).string(message.method); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message stackpanel.agent.RebuildShellRequest - */ -export const RebuildShellRequest = new RebuildShellRequest$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class RebuildShellEvent$Type extends MessageType { - constructor() { - super("stackpanel.agent.RebuildShellEvent", [ - { no: 1, name: "type", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 2, name: "output", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "exit_code", kind: "scalar", localName: "exit_code", T: 5 /*ScalarType.INT32*/ }, - { no: 4, name: "error", kind: "scalar", T: 9 /*ScalarType.STRING*/ }, - { no: 5, name: "timestamp", kind: "scalar", T: 9 /*ScalarType.STRING*/ } - ]); - } - create(value?: PartialMessage): RebuildShellEvent { - const message = globalThis.Object.create((this.messagePrototype!)); - message.type = ""; - message.output = ""; - message.exit_code = 0; - message.error = ""; - message.timestamp = ""; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RebuildShellEvent): RebuildShellEvent { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string type */ 1: - message.type = reader.string(); - break; - case /* string output */ 2: - message.output = reader.string(); - break; - case /* int32 exit_code */ 3: - message.exit_code = reader.int32(); - break; - case /* string error */ 4: - message.error = reader.string(); - break; - case /* string timestamp */ 5: - message.timestamp = reader.string(); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: RebuildShellEvent, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string type = 1; */ - if (message.type !== "") - writer.tag(1, WireType.LengthDelimited).string(message.type); - /* string output = 2; */ - if (message.output !== "") - writer.tag(2, WireType.LengthDelimited).string(message.output); - /* int32 exit_code = 3; */ - if (message.exit_code !== 0) - writer.tag(3, WireType.Varint).int32(message.exit_code); - /* string error = 4; */ - if (message.error !== "") - writer.tag(4, WireType.LengthDelimited).string(message.error); - /* string timestamp = 5; */ - if (message.timestamp !== "") - writer.tag(5, WireType.LengthDelimited).string(message.timestamp); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message stackpanel.agent.RebuildShellEvent - */ -export const RebuildShellEvent = new RebuildShellEvent$Type(); /** * @generated ServiceType for protobuf service stackpanel.agent.AgentService */ @@ -1891,7 +1557,5 @@ export const AgentService = new ServiceType("stackpanel.agent.AgentService", [ { name: "GetInstalledPackages", options: {}, I: GetInstalledPackagesRequest, O: InstalledPackagesResponse }, { name: "GetProcesses", options: {}, I: GetProcessesRequest, O: GetProcessesResponse }, { name: "PatchNixData", options: {}, I: PatchNixDataRequest, O: PatchNixDataResponse }, - { name: "GetNixConfig", options: {}, I: GetNixConfigRequest, O: NixConfigResponse }, - { name: "GetShellStatus", options: {}, I: GetShellStatusRequest, O: ShellStatusResponse }, - { name: "RebuildShell", serverStreaming: true, options: {}, I: RebuildShellRequest, O: RebuildShellEvent } + { name: "GetNixConfig", options: {}, I: GetNixConfigRequest, O: NixConfigResponse } ]); diff --git a/packages/proto/gen/ts/agent_pb.d.ts b/packages/proto/gen/ts/agent_pb.d.ts index 0668d09f..3f4af103 100644 --- a/packages/proto/gen/ts/agent_pb.d.ts +++ b/packages/proto/gen/ts/agent_pb.d.ts @@ -531,129 +531,6 @@ export declare type NixConfigResponse = Message<"stackpanel.agent.NixConfigRespo */ export declare const NixConfigResponseSchema: GenMessage; -/** - * @generated from message stackpanel.agent.GetShellStatusRequest - */ -export declare type GetShellStatusRequest = Message<"stackpanel.agent.GetShellStatusRequest"> & { -}; - -/** - * Describes the message stackpanel.agent.GetShellStatusRequest. - * Use `create(GetShellStatusRequestSchema)` to create a new message. - */ -export declare const GetShellStatusRequestSchema: GenMessage; - -/** - * @generated from message stackpanel.agent.ShellStatusResponse - */ -export declare type ShellStatusResponse = Message<"stackpanel.agent.ShellStatusResponse"> & { - /** - * Whether the shell is stale (nix files changed since last rebuild) - * - * @generated from field: bool stale = 1; - */ - stale: boolean; - - /** - * Whether a rebuild is currently in progress - * - * @generated from field: bool rebuilding = 2; - */ - rebuilding: boolean; - - /** - * Timestamp of when the shell was last built (RFC3339) - * - * @generated from field: string last_built = 3; - */ - lastBuilt: string; - - /** - * Timestamp of the most recent nix file change (RFC3339) - * - * @generated from field: string last_nix_change = 4; - */ - lastNixChange: string; - - /** - * List of files that changed since last build - * - * @generated from field: repeated string changed_files = 5; - */ - changedFiles: string[]; -}; - -/** - * Describes the message stackpanel.agent.ShellStatusResponse. - * Use `create(ShellStatusResponseSchema)` to create a new message. - */ -export declare const ShellStatusResponseSchema: GenMessage; - -/** - * @generated from message stackpanel.agent.RebuildShellRequest - */ -export declare type RebuildShellRequest = Message<"stackpanel.agent.RebuildShellRequest"> & { - /** - * Which command to use: "devshell" (./devshell) or "nix" (nix develop --impure) - * Defaults to "devshell" if not specified - * - * @generated from field: string method = 1; - */ - method: string; -}; - -/** - * Describes the message stackpanel.agent.RebuildShellRequest. - * Use `create(RebuildShellRequestSchema)` to create a new message. - */ -export declare const RebuildShellRequestSchema: GenMessage; - -/** - * @generated from message stackpanel.agent.RebuildShellEvent - */ -export declare type RebuildShellEvent = Message<"stackpanel.agent.RebuildShellEvent"> & { - /** - * Event type: "started", "output", "completed", "error" - * - * @generated from field: string type = 1; - */ - type: string; - - /** - * Output line (for type="output") - * - * @generated from field: string output = 2; - */ - output: string; - - /** - * Exit code (for type="completed") - * - * @generated from field: int32 exit_code = 3; - */ - exitCode: number; - - /** - * Error message (for type="error") - * - * @generated from field: string error = 4; - */ - error: string; - - /** - * Timestamp - * - * @generated from field: string timestamp = 5; - */ - timestamp: string; -}; - -/** - * Describes the message stackpanel.agent.RebuildShellEvent. - * Use `create(RebuildShellEventSchema)` to create a new message. - */ -export declare const RebuildShellEventSchema: GenMessage; - /** * AgentService provides RPC methods for the Stackpanel agent. * This enables type-safe communication between the web UI and the local agent. @@ -765,23 +642,5 @@ export declare const AgentService: GenService<{ input: typeof GetNixConfigRequestSchema; output: typeof NixConfigResponseSchema; }, - /** - * Devshell management - * - * @generated from rpc stackpanel.agent.AgentService.GetShellStatus - */ - getShellStatus: { - methodKind: "unary"; - input: typeof GetShellStatusRequestSchema; - output: typeof ShellStatusResponseSchema; - }, - /** - * @generated from rpc stackpanel.agent.AgentService.RebuildShell - */ - rebuildShell: { - methodKind: "server_streaming"; - input: typeof RebuildShellRequestSchema; - output: typeof RebuildShellEventSchema; - }, }>; diff --git a/packages/proto/gen/ts/agent_pb.js b/packages/proto/gen/ts/agent_pb.js index 5cbc7472..2d999354 100644 --- a/packages/proto/gen/ts/agent_pb.js +++ b/packages/proto/gen/ts/agent_pb.js @@ -15,7 +15,7 @@ import { file_modules } from "./modules_pb"; * Describes the file agent.proto. */ export const file_agent = /*@__PURE__*/ - fileDesc("CgthZ2VudC5wcm90bxIQc3RhY2twYW5lbC5hZ2VudCITChFHZXRQcm9qZWN0UmVxdWVzdCJAChJHZXRQcm9qZWN0UmVzcG9uc2USKgoHcHJvamVjdBgBIAEoCzIZLnN0YWNrcGFuZWwuYWdlbnQuUHJvamVjdCJiCgdQcm9qZWN0EgwKBHBhdGgYASABKAkSDAoEbmFtZRgCIAEoCRIOCgZnaXRodWIYAyABKAkSKwoEZGlycxgEIAEoCzIdLnN0YWNrcGFuZWwuYWdlbnQuRGlyZWN0b3JpZXMiVgoLRGlyZWN0b3JpZXMSDAoEaG9tZRgBIAEoCRIMCgRkYXRhGAIgASgJEgsKA2dlbhgDIAEoCRINCgVzdGF0ZRgEIAEoCRIPCgdzZWNyZXRzGAUgASgJIhMKEUdldFNlY3JldHNSZXF1ZXN0IhEKD0dldFVzZXJzUmVxdWVzdCIQCg5HZXRBcHBzUmVxdWVzdCIVChNHZXRWYXJpYWJsZXNSZXF1ZXN0IpoBCgtFeGVjUmVxdWVzdBIPCgdjb21tYW5kGAEgASgJEgwKBGFyZ3MYAiADKAkSCwoDY3dkGAMgASgJEjMKA2VudhgEIAMoCzImLnN0YWNrcGFuZWwuYWdlbnQuRXhlY1JlcXVlc3QuRW52RW50cnkaKgoIRW52RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASJBCgxFeGVjUmVzcG9uc2USEQoJZXhpdF9jb2RlGAEgASgFEg4KBnN0ZG91dBgCIAEoCRIOCgZzdGRlcnIYAyABKAkiHQobR2V0SW5zdGFsbGVkUGFja2FnZXNSZXF1ZXN0IlQKEEluc3RhbGxlZFBhY2thZ2USDAoEbmFtZRgBIAEoCRIPCgd2ZXJzaW9uGAIgASgJEhEKCWF0dHJfcGF0aBgDIAEoCRIOCgZzb3VyY2UYBCABKAkiYAoZSW5zdGFsbGVkUGFja2FnZXNSZXNwb25zZRI0CghwYWNrYWdlcxgBIAMoCzIiLnN0YWNrcGFuZWwuYWdlbnQuSW5zdGFsbGVkUGFja2FnZRINCgVjb3VudBgCIAEoBSIVChNHZXRQcm9jZXNzZXNSZXF1ZXN0IpkBCgtQcm9jZXNzSW5mbxIMCgRuYW1lGAEgASgJEhEKCW5hbWVzcGFjZRgCIAEoCRIOCgZzdGF0dXMYAyABKAkSCwoDcGlkGAQgASgFEhEKCWV4aXRfY29kZRgFIAEoBRISCgppc19ydW5uaW5nGAYgASgIEhAKCHJlc3RhcnRzGAcgASgFEhMKC3N5c3RlbV90aW1lGAggASgJInsKFEdldFByb2Nlc3Nlc1Jlc3BvbnNlEhEKCWF2YWlsYWJsZRgBIAEoCBIPCgdydW5uaW5nGAIgASgIEjAKCXByb2Nlc3NlcxgDIAMoCzIdLnN0YWNrcGFuZWwuYWdlbnQuUHJvY2Vzc0luZm8SDQoFZXJyb3IYBCABKAkiYwoTUGF0Y2hOaXhEYXRhUmVxdWVzdBIOCgZlbnRpdHkYASABKAkSCwoDa2V5GAIgASgJEgwKBHBhdGgYAyABKAkSDQoFdmFsdWUYBCABKAkSEgoKdmFsdWVfdHlwZRgFIAEoCSJMChRQYXRjaE5peERhdGFSZXNwb25zZRIPCgdzdWNjZXNzGAEgASgIEhQKDHVwZGF0ZWRfanNvbhgCIAEoCRINCgVlcnJvchgDIAEoCSImChNHZXROaXhDb25maWdSZXF1ZXN0Eg8KB3JlZnJlc2gYASABKAgiXgoRTml4Q29uZmlnUmVzcG9uc2USEwoLY29uZmlnX2pzb24YASABKAkSFAoMbGFzdF91cGRhdGVkGAIgASgJEg4KBmNhY2hlZBgDIAEoCBIOCgZzb3VyY2UYBCABKAkiFwoVR2V0U2hlbGxTdGF0dXNSZXF1ZXN0InwKE1NoZWxsU3RhdHVzUmVzcG9uc2USDQoFc3RhbGUYASABKAgSEgoKcmVidWlsZGluZxgCIAEoCBISCgpsYXN0X2J1aWx0GAMgASgJEhcKD2xhc3Rfbml4X2NoYW5nZRgEIAEoCRIVCg1jaGFuZ2VkX2ZpbGVzGAUgAygJIiUKE1JlYnVpbGRTaGVsbFJlcXVlc3QSDgoGbWV0aG9kGAEgASgJImYKEVJlYnVpbGRTaGVsbEV2ZW50EgwKBHR5cGUYASABKAkSDgoGb3V0cHV0GAIgASgJEhEKCWV4aXRfY29kZRgDIAEoBRINCgVlcnJvchgEIAEoCRIRCgl0aW1lc3RhbXAYBSABKAky+QgKDEFnZW50U2VydmljZRJXCgpHZXRQcm9qZWN0EiMuc3RhY2twYW5lbC5hZ2VudC5HZXRQcm9qZWN0UmVxdWVzdBokLnN0YWNrcGFuZWwuYWdlbnQuR2V0UHJvamVjdFJlc3BvbnNlEkkKCkdldFNlY3JldHMSIy5zdGFja3BhbmVsLmFnZW50LkdldFNlY3JldHNSZXF1ZXN0GhYuc3RhY2twYW5lbC5kYi5TZWNyZXRzEkMKCEdldFVzZXJzEiEuc3RhY2twYW5lbC5hZ2VudC5HZXRVc2Vyc1JlcXVlc3QaFC5zdGFja3BhbmVsLmRiLlVzZXJzEkAKB0dldEFwcHMSIC5zdGFja3BhbmVsLmFnZW50LkdldEFwcHNSZXF1ZXN0GhMuc3RhY2twYW5lbC5kYi5BcHBzEk8KDEdldFZhcmlhYmxlcxIlLnN0YWNrcGFuZWwuYWdlbnQuR2V0VmFyaWFibGVzUmVxdWVzdBoYLnN0YWNrcGFuZWwuZGIuVmFyaWFibGVzElgKEEdldE1vZHVsZU91dHB1dHMSJi5zdGFja3BhbmVsLmRiLkdldE1vZHVsZU91dHB1dHNSZXF1ZXN0Ghwuc3RhY2twYW5lbC5kYi5Nb2R1bGVPdXRwdXRzEkUKBEV4ZWMSHS5zdGFja3BhbmVsLmFnZW50LkV4ZWNSZXF1ZXN0Gh4uc3RhY2twYW5lbC5hZ2VudC5FeGVjUmVzcG9uc2UScgoUR2V0SW5zdGFsbGVkUGFja2FnZXMSLS5zdGFja3BhbmVsLmFnZW50LkdldEluc3RhbGxlZFBhY2thZ2VzUmVxdWVzdBorLnN0YWNrcGFuZWwuYWdlbnQuSW5zdGFsbGVkUGFja2FnZXNSZXNwb25zZRJdCgxHZXRQcm9jZXNzZXMSJS5zdGFja3BhbmVsLmFnZW50LkdldFByb2Nlc3Nlc1JlcXVlc3QaJi5zdGFja3BhbmVsLmFnZW50LkdldFByb2Nlc3Nlc1Jlc3BvbnNlEl0KDFBhdGNoTml4RGF0YRIlLnN0YWNrcGFuZWwuYWdlbnQuUGF0Y2hOaXhEYXRhUmVxdWVzdBomLnN0YWNrcGFuZWwuYWdlbnQuUGF0Y2hOaXhEYXRhUmVzcG9uc2USWgoMR2V0Tml4Q29uZmlnEiUuc3RhY2twYW5lbC5hZ2VudC5HZXROaXhDb25maWdSZXF1ZXN0GiMuc3RhY2twYW5lbC5hZ2VudC5OaXhDb25maWdSZXNwb25zZRJgCg5HZXRTaGVsbFN0YXR1cxInLnN0YWNrcGFuZWwuYWdlbnQuR2V0U2hlbGxTdGF0dXNSZXF1ZXN0GiUuc3RhY2twYW5lbC5hZ2VudC5TaGVsbFN0YXR1c1Jlc3BvbnNlElwKDFJlYnVpbGRTaGVsbBIlLnN0YWNrcGFuZWwuYWdlbnQuUmVidWlsZFNoZWxsUmVxdWVzdBojLnN0YWNrcGFuZWwuYWdlbnQuUmVidWlsZFNoZWxsRXZlbnQwAUI6WjhnaXRodWIuY29tL2RhcmttYXR0ZXIvc3RhY2twYW5lbC9wYWNrYWdlcy9wcm90by9nZW4vZ29wYmIGcHJvdG8z", [file_secrets, file_users, file_files, file_services, file_apps, file_variables, file_modules]); + fileDesc("CgthZ2VudC5wcm90bxIQc3RhY2twYW5lbC5hZ2VudCITChFHZXRQcm9qZWN0UmVxdWVzdCJAChJHZXRQcm9qZWN0UmVzcG9uc2USKgoHcHJvamVjdBgBIAEoCzIZLnN0YWNrcGFuZWwuYWdlbnQuUHJvamVjdCJiCgdQcm9qZWN0EgwKBHBhdGgYASABKAkSDAoEbmFtZRgCIAEoCRIOCgZnaXRodWIYAyABKAkSKwoEZGlycxgEIAEoCzIdLnN0YWNrcGFuZWwuYWdlbnQuRGlyZWN0b3JpZXMiVgoLRGlyZWN0b3JpZXMSDAoEaG9tZRgBIAEoCRIMCgRkYXRhGAIgASgJEgsKA2dlbhgDIAEoCRINCgVzdGF0ZRgEIAEoCRIPCgdzZWNyZXRzGAUgASgJIhMKEUdldFNlY3JldHNSZXF1ZXN0IhEKD0dldFVzZXJzUmVxdWVzdCIQCg5HZXRBcHBzUmVxdWVzdCIVChNHZXRWYXJpYWJsZXNSZXF1ZXN0IpoBCgtFeGVjUmVxdWVzdBIPCgdjb21tYW5kGAEgASgJEgwKBGFyZ3MYAiADKAkSCwoDY3dkGAMgASgJEjMKA2VudhgEIAMoCzImLnN0YWNrcGFuZWwuYWdlbnQuRXhlY1JlcXVlc3QuRW52RW50cnkaKgoIRW52RW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4ASJBCgxFeGVjUmVzcG9uc2USEQoJZXhpdF9jb2RlGAEgASgFEg4KBnN0ZG91dBgCIAEoCRIOCgZzdGRlcnIYAyABKAkiHQobR2V0SW5zdGFsbGVkUGFja2FnZXNSZXF1ZXN0IlQKEEluc3RhbGxlZFBhY2thZ2USDAoEbmFtZRgBIAEoCRIPCgd2ZXJzaW9uGAIgASgJEhEKCWF0dHJfcGF0aBgDIAEoCRIOCgZzb3VyY2UYBCABKAkiYAoZSW5zdGFsbGVkUGFja2FnZXNSZXNwb25zZRI0CghwYWNrYWdlcxgBIAMoCzIiLnN0YWNrcGFuZWwuYWdlbnQuSW5zdGFsbGVkUGFja2FnZRINCgVjb3VudBgCIAEoBSIVChNHZXRQcm9jZXNzZXNSZXF1ZXN0IpkBCgtQcm9jZXNzSW5mbxIMCgRuYW1lGAEgASgJEhEKCW5hbWVzcGFjZRgCIAEoCRIOCgZzdGF0dXMYAyABKAkSCwoDcGlkGAQgASgFEhEKCWV4aXRfY29kZRgFIAEoBRISCgppc19ydW5uaW5nGAYgASgIEhAKCHJlc3RhcnRzGAcgASgFEhMKC3N5c3RlbV90aW1lGAggASgJInsKFEdldFByb2Nlc3Nlc1Jlc3BvbnNlEhEKCWF2YWlsYWJsZRgBIAEoCBIPCgdydW5uaW5nGAIgASgIEjAKCXByb2Nlc3NlcxgDIAMoCzIdLnN0YWNrcGFuZWwuYWdlbnQuUHJvY2Vzc0luZm8SDQoFZXJyb3IYBCABKAkiYwoTUGF0Y2hOaXhEYXRhUmVxdWVzdBIOCgZlbnRpdHkYASABKAkSCwoDa2V5GAIgASgJEgwKBHBhdGgYAyABKAkSDQoFdmFsdWUYBCABKAkSEgoKdmFsdWVfdHlwZRgFIAEoCSJMChRQYXRjaE5peERhdGFSZXNwb25zZRIPCgdzdWNjZXNzGAEgASgIEhQKDHVwZGF0ZWRfanNvbhgCIAEoCRINCgVlcnJvchgDIAEoCSImChNHZXROaXhDb25maWdSZXF1ZXN0Eg8KB3JlZnJlc2gYASABKAgiXgoRTml4Q29uZmlnUmVzcG9uc2USEwoLY29uZmlnX2pzb24YASABKAkSFAoMbGFzdF91cGRhdGVkGAIgASgJEg4KBmNhY2hlZBgDIAEoCBIOCgZzb3VyY2UYBCABKAkyuQcKDEFnZW50U2VydmljZRJXCgpHZXRQcm9qZWN0EiMuc3RhY2twYW5lbC5hZ2VudC5HZXRQcm9qZWN0UmVxdWVzdBokLnN0YWNrcGFuZWwuYWdlbnQuR2V0UHJvamVjdFJlc3BvbnNlEkkKCkdldFNlY3JldHMSIy5zdGFja3BhbmVsLmFnZW50LkdldFNlY3JldHNSZXF1ZXN0GhYuc3RhY2twYW5lbC5kYi5TZWNyZXRzEkMKCEdldFVzZXJzEiEuc3RhY2twYW5lbC5hZ2VudC5HZXRVc2Vyc1JlcXVlc3QaFC5zdGFja3BhbmVsLmRiLlVzZXJzEkAKB0dldEFwcHMSIC5zdGFja3BhbmVsLmFnZW50LkdldEFwcHNSZXF1ZXN0GhMuc3RhY2twYW5lbC5kYi5BcHBzEk8KDEdldFZhcmlhYmxlcxIlLnN0YWNrcGFuZWwuYWdlbnQuR2V0VmFyaWFibGVzUmVxdWVzdBoYLnN0YWNrcGFuZWwuZGIuVmFyaWFibGVzElgKEEdldE1vZHVsZU91dHB1dHMSJi5zdGFja3BhbmVsLmRiLkdldE1vZHVsZU91dHB1dHNSZXF1ZXN0Ghwuc3RhY2twYW5lbC5kYi5Nb2R1bGVPdXRwdXRzEkUKBEV4ZWMSHS5zdGFja3BhbmVsLmFnZW50LkV4ZWNSZXF1ZXN0Gh4uc3RhY2twYW5lbC5hZ2VudC5FeGVjUmVzcG9uc2UScgoUR2V0SW5zdGFsbGVkUGFja2FnZXMSLS5zdGFja3BhbmVsLmFnZW50LkdldEluc3RhbGxlZFBhY2thZ2VzUmVxdWVzdBorLnN0YWNrcGFuZWwuYWdlbnQuSW5zdGFsbGVkUGFja2FnZXNSZXNwb25zZRJdCgxHZXRQcm9jZXNzZXMSJS5zdGFja3BhbmVsLmFnZW50LkdldFByb2Nlc3Nlc1JlcXVlc3QaJi5zdGFja3BhbmVsLmFnZW50LkdldFByb2Nlc3Nlc1Jlc3BvbnNlEl0KDFBhdGNoTml4RGF0YRIlLnN0YWNrcGFuZWwuYWdlbnQuUGF0Y2hOaXhEYXRhUmVxdWVzdBomLnN0YWNrcGFuZWwuYWdlbnQuUGF0Y2hOaXhEYXRhUmVzcG9uc2USWgoMR2V0Tml4Q29uZmlnEiUuc3RhY2twYW5lbC5hZ2VudC5HZXROaXhDb25maWdSZXF1ZXN0GiMuc3RhY2twYW5lbC5hZ2VudC5OaXhDb25maWdSZXNwb25zZUI6WjhnaXRodWIuY29tL2RhcmttYXR0ZXIvc3RhY2twYW5lbC9wYWNrYWdlcy9wcm90by9nZW4vZ29wYmIGcHJvdG8z", [file_secrets, file_users, file_files, file_services, file_apps, file_variables, file_modules]); /** * Describes the message stackpanel.agent.GetProjectRequest. @@ -157,34 +157,6 @@ export const GetNixConfigRequestSchema = /*@__PURE__*/ export const NixConfigResponseSchema = /*@__PURE__*/ messageDesc(file_agent, 19); -/** - * Describes the message stackpanel.agent.GetShellStatusRequest. - * Use `create(GetShellStatusRequestSchema)` to create a new message. - */ -export const GetShellStatusRequestSchema = /*@__PURE__*/ - messageDesc(file_agent, 20); - -/** - * Describes the message stackpanel.agent.ShellStatusResponse. - * Use `create(ShellStatusResponseSchema)` to create a new message. - */ -export const ShellStatusResponseSchema = /*@__PURE__*/ - messageDesc(file_agent, 21); - -/** - * Describes the message stackpanel.agent.RebuildShellRequest. - * Use `create(RebuildShellRequestSchema)` to create a new message. - */ -export const RebuildShellRequestSchema = /*@__PURE__*/ - messageDesc(file_agent, 22); - -/** - * Describes the message stackpanel.agent.RebuildShellEvent. - * Use `create(RebuildShellEventSchema)` to create a new message. - */ -export const RebuildShellEventSchema = /*@__PURE__*/ - messageDesc(file_agent, 23); - /** * AgentService provides RPC methods for the Stackpanel agent. * This enables type-safe communication between the web UI and the local agent. diff --git a/packages/proto/proto/agent.proto b/packages/proto/proto/agent.proto index 9b979bbb..e7ee9fbe 100644 --- a/packages/proto/proto/agent.proto +++ b/packages/proto/proto/agent.proto @@ -44,10 +44,6 @@ service AgentService { // Full Nix config (evaluated from flake) rpc GetNixConfig(GetNixConfigRequest) returns (NixConfigResponse); - - // Devshell management - rpc GetShellStatus(GetShellStatusRequest) returns (ShellStatusResponse); - rpc RebuildShell(RebuildShellRequest) returns (stream RebuildShellEvent); } // ============================================================================= @@ -199,41 +195,3 @@ message NixConfigResponse { bool cached = 3; string source = 4; // "cache" or "eval" } - -// ============================================================================= -// Devshell Management -// ============================================================================= - -message GetShellStatusRequest {} - -message ShellStatusResponse { - // Whether the shell is stale (nix files changed since last rebuild) - bool stale = 1; - // Whether a rebuild is currently in progress - bool rebuilding = 2; - // Timestamp of when the shell was last built (RFC3339) - string last_built = 3; - // Timestamp of the most recent nix file change (RFC3339) - string last_nix_change = 4; - // List of files that changed since last build - repeated string changed_files = 5; -} - -message RebuildShellRequest { - // Which command to use: "devshell" (./devshell) or "nix" (nix develop --impure) - // Defaults to "devshell" if not specified - string method = 1; -} - -message RebuildShellEvent { - // Event type: "started", "output", "completed", "error" - string type = 1; - // Output line (for type="output") - string output = 2; - // Exit code (for type="completed") - int32 exit_code = 3; - // Error message (for type="error") - string error = 4; - // Timestamp - string timestamp = 5; -}