Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/diagnostics-startup-banner.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@solidjs/vite-plugin': patch
---

Announce the diagnostics surface in the dev-server startup block when `diagnostics: true` is set: two extra lines after Vite's URLs naming the `/__solid/diagnostics` endpoint (with its method vocabulary) and the agent skill documents shipped in node_modules. Startup output is the one channel agents reliably read even in projects with no AGENTS.md, making this the discovery path for existing apps and ports. Dev-serve only.
18 changes: 18 additions & 0 deletions src/diagnostics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,24 @@ export function solidDiagnostics(): Plugin {
},

configureServer(server) {
// Announce the surface in the startup block. This is a discovery
// channel: agents watching dev-server output learn the endpoint and
// the skill documents without any project-level pointer (AGENTS.md).
const originalPrintUrls = server.printUrls.bind(server);
server.printUrls = () => {
originalPrintUrls();
const local = server.resolvedUrls?.local[0];
const endpoint = local
? new URL(DIAGNOSTICS_ENDPOINT, local).href
: DIAGNOSTICS_ENDPOINT;
server.config.logger.info(
` ➜ Solid diagnostics: ${endpoint} ` +
`(GET status; POST {"method":"begin"|"end"|"whyDidRun"|"costs"})\n` +
` ➜ Agent skills: node_modules/${DIAGNOSTICS_PACKAGE}/skills/agent-loops/SKILL.md, ` +
`node_modules/solid-js/skills/reactivity-diagnostics/SKILL.md`,
);
};

interface Pending {
resolve: (response: DiagnosticsResponse) => void;
timer: ReturnType<typeof setTimeout>;
Expand Down
Loading