Repository navigation
feat(web): project picker uses v1 ProjectService - #61
Merged
Merged
Conversation
The sidebar project picker listed, validated and opened projects through
the tRPC agent router, which fetches http://localhost:9876 from the web
server and so cannot reach a user's agent from the Cloudflare-hosted
Studio. It now calls the agent's v1 ProjectService from the browser:
ListProjects through connect-query, and AddProject, whose
InvalidArgument message replaces the separate validate step. Projects
the agent reports invalid show the reason and cannot be opened.
AgentProvider creates one Connect transport per host, port and token
and provides it with connect-query's TransportProvider;
useAgentRpcClient reuses it instead of building its own.
@stackpanel/proto exports the v1 generated code as
@stackpanel/proto/agent/v1/*.
Switching and reading the current project stay on REST
(/api/project/open and /api/project/current) until requests select
their project (stackpanel-thq.8.1). AgentHttpClient now unwraps the
agent's { success, data } envelope for both; it returned the envelope
itself, which only the demo's bare fixtures matched, so the setup
wizard's current-project read was also empty against a real agent. The
demo keeps its badge and makes no project requests.
With its last callers gone (the picker, the unused ProjectIndicator and
the dead SecurityStatusCard), the tRPC agent router is deleted. bun.nix
is regenerated with bun2nix, which also drops 26 entries left over from
the last bun.lock change.
Refs: stackpanel-thq.8.4
Contributor
|
Preview |
Contributor
|
Docs preview |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Studio project picker now lists and adds projects through the agent's v1
ProjectService, called from the browser with connect-query over one shared transport provided inAgentProvider. Before this, it went through the tRPC agent router, which fetchedlocalhost:9876from the web server and so could not reach a user's agent from the Cloudflare-hosted Studio.security-status-cardandProjectIndicator.AgentHttpClientgetCurrentProject/openProjectnow unwrap the agent's{ success, data }envelope. They used to return it as-is.@connectrpc/connect-query^2.3.1 is added.bun.nixwas regenerated withbun2nix -o bun.nix, which also drops 26 stale entries.Verification by the implementer:
packages/apigoes from 18 errors to 16, because the deleted router held 2./api/project/open200, AddProject 400 with its message shown, and no/api/trpc/agentcalls.--frozen-lockfile.Verification after rebasing onto main (the pre-merge foundation commit dropped out as already applied, and the patch is unchanged), in the devshell:
apps/webgives the same normalized error set as origin/main.packages/apiloses only the 2 errors from the deleted router.bun run testinapps/web: 55 pass, 1 known R2 cache failure.bun install --frozen-lockfile(bun 1.4.2) leavesbun.lockunchanged.nix flake check --no-buildpasses with the regeneratedbun.nix.Refs stackpanel-thq.8.4, ADR 0004