feat: add ctx.diagnostics host; rename ctx.logs to ctx.messages#302
Merged
feat: add ctx.diagnostics host; rename ctx.logs to ctx.messages#302
Conversation
Introduce `ctx.diagnostics` — a `DevToolsDiagnosticsHost` that wraps
logs-sdk and lets integrations register their own coded errors / warnings
into a shared logger via `register()` / `defineDiagnostics` / `createLogger`,
without taking a direct logs-sdk dependency.
Rename the user-facing message subsystem from `logs` → `messages` end-to-end:
the `ctx.logs` field, host class, types, RPC wire names
(`devtoolskit:internal:logs:*` → `:messages:*`), event names
(`log:added/...` → `message:added/...`), file names, and the dock panel
("Logs & Notifications" → "Messages & Notifications", id `~logs` → `~messages`).
Deprecated `DevToolsLogs*` type aliases and a `ctx.logs` getter that emits
DF0018 on first access keep the old surface working for one cycle.
Wire-protocol break: clients on `:logs:*` will not connect to a server on
`:messages:*`. The Vue components and webcomponents UI ship updated
together; external consumers must update RPC method strings if they call
the internals directly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
commit: |
antfu
added a commit
that referenced
this pull request
May 1, 2026
Resolves a numbering conflict: main's #302 introduced DF0018 for the `ctx.logs` deprecation warning, so my jsonSerializable diagnostics shift up by one. New numbering on this branch: - DF0018 (main) — `ctx.logs` deprecated. - DF0019 — Agent Requires JSON-Serializable RPC. - DF0020 — Non-JSON Value in JSON-Serializable RPC. - DF0021..DF0028 — migrated from DTK0001..DTK0008. Updates code, callsites, docs pages, sidebar count (28), error index table, and skill / guide references to the new numbers. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Description
Two coordinated changes on the
DevToolsNodeContext:ctx.diagnostics— aDevToolsDiagnosticsHostthat wrapslogs-sdk. Plugins can register their own coded errors / warnings viactx.diagnostics.register(defineDiagnostics({ codes: { … } }))and emit them through the sharedctx.diagnostics.logger— without taking a directlogs-sdkdependency. The host also re-exportsdefineDiagnosticsandcreateLoggerfor plugins that want their own typed logger reference.ctx.logs→ctx.messagesend-to-end: field, host class (DevToolsLogsHost→DevToolsMessagesHost), allDevToolsLog*types, RPC wire names (devtoolskit:internal:logs:*→:messages:*), event names (log:added→message:addedetc.), file names, and the dock panel ("Logs & Notifications" → "Messages & Notifications", id~logs→~messages). DeprecatedDevToolsLogs*type aliases and actx.logsgetter that emits a newDF0018warning on first access keep the old surface working for one release cycle.Includes guides at
/kit/diagnosticsand/devframe/guide/diagnostics, an agent skill reference atskills/vite-devtools-kit/references/diagnostics-patterns.md, and the renamedmessagesdoc/skill counterparts.Linked Issues
None — refactor + new API.
Additional context
This is a wire-protocol break for any external consumer that calls the internal
devtoolskit:internal:logs:*RPCs directly: the shipped Vue UI and webcomponents are migrated together, but third-party clients on the old method names will not connect. The deprecatedctx.logsgetter logsDF0018once per process, so source-level migration can happen at the consumer's pace within one release cycle.🤖 Generated with Claude Code