This repository was archived by the owner on Jul 5, 2026. It is now read-only.
fix(security): generate agent catalog snippets client-side#277
Merged
JSONbored merged 2 commits intoJun 28, 2026
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
metagraphed-ui | b7bc71b | Commit Preview URL Branch Preview URL |
Jun 28 2026, 12:42 PM |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Generate agent-catalog copy snippets in the UI instead of trusting executable snippet strings from the backend payload.
What changed
snippetsduring agent-catalog service normalization.snippetsfrom the normalizedAgentCatalogServicetype surface.apiSnippet(service.base_url)for curl, Python, and JavaScript.Why
Backend-provided executable snippets are too risky to expose through a one-click copy affordance. The UI still gives users paste-ready examples, but now those examples are generated from the normalized service URL instead of copied verbatim from API data.
Validation
bun install --frozen-lockfilebun run test src/lib/metagraphed/queries.test.ts src/components/metagraphed/endpoint-snippet.test.tsbun run typecheckbunx eslint src/lib/metagraphed/queries.ts src/lib/metagraphed/queries.test.ts src/lib/metagraphed/types.ts src/components/metagraphed/endpoint-snippet.test.ts src/routes/subnets.$netuid.tsxbunx prettier --check src/lib/metagraphed/queries.ts src/lib/metagraphed/queries.test.ts src/lib/metagraphed/types.ts src/components/metagraphed/endpoint-snippet.test.ts src/routes/subnets.$netuid.tsxbun run buildgit diff --check