diff --git a/.changeset/diagnostics-startup-banner.md b/.changeset/diagnostics-startup-banner.md new file mode 100644 index 0000000..0c908c6 --- /dev/null +++ b/.changeset/diagnostics-startup-banner.md @@ -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. diff --git a/src/diagnostics/index.ts b/src/diagnostics/index.ts index 96400d7..67d4d9d 100644 --- a/src/diagnostics/index.ts +++ b/src/diagnostics/index.ts @@ -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;