LearnNewsExamplesServices
Frontmatter
id8307
titleNeural Link: Support depth in getVdomTree and getVnodeTree
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 4, 2026, 12:15 PM
updatedAtJan 4, 2026, 12:40 PM
githubUrlhttps://github.com/neomjs/neo/issues/8307
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 4, 2026, 12:40 PM

Neural Link: Support depth in getVdomTree and getVnodeTree

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Jan 4, 2026, 12:15 PM

We need to update getVdomTree and getVnodeTree in src/ai/client/ComponentService.mjs to support a configured depth.

Currently, these methods return the raw vdom or vnode property of the component, which does not expand child component references or respect a depth limit.

We will leverage src/util/vdom/TreeBuilder.mjs to generate the trees with the specified depth.

Requirements:

  • Update getVdomTree to accept depth and use TreeBuilder.getVdomTree.
  • Update getVnodeTree to accept depth and use TreeBuilder.getVnodeTree.
  • Default depth should be -1 (infinite) if not specified, matching TreeBuilder defaults.

Context: Real-world usage in src/mixin/VdomLifecycle.mjs demonstrates using TreeBuilder for scoped updates.

tobiu added the enhancement label on Jan 4, 2026, 12:15 PM
tobiu added the ai label on Jan 4, 2026, 12:15 PM
tobiu assigned to @tobiu on Jan 4, 2026, 12:16 PM
tobiu added parent issue #8169 on Jan 4, 2026, 12:16 PM
tobiu referenced in commit 77d016e - "Neural Link: Support depth in getVdomTree and getVnodeTree #8307" on Jan 4, 2026, 12:39 PM
tobiu
tobiu Jan 4, 2026, 12:39 PM

Input from Gemini 2.5 pro:

✦ I have verified the server-side implementation and the API definition:

  1. ai/mcp/server/neural-link/openapi.yaml: The get_vdom_tree and get_vnode_tree operations use GetComponentTreeRequest schema, which correctly defines the depth parameter (integer).
  2. ai/mcp/server/neural-link/services/ComponentService.mjs: The getVdomTree and getVnodeTree methods correctly forward the depth parameter to the ConnectionService.
  3. ai/mcp/server/neural-link/services/toolService.mjs: Correctly binds the methods.

The missing link was purely in the client-side src/ai/client/ComponentService.mjs, which ignored the passed depth. This has been rectified.

The full stack now supports depth for VDOM/VNode inspection.

tobiu closed this issue on Jan 4, 2026, 12:40 PM