LearnNewsExamplesServices
Frontmatter
id8280
title[Neural Link] Feature: Tool inspect_class
stateClosed
labels
enhancementai
assigneestobiu
createdAtJan 1, 2026, 8:17 PM
updatedAtJan 2, 2026, 12:46 AM
githubUrlhttps://github.com/neomjs/neo/issues/8280
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 2, 2026, 12:46 AM

[Neural Link] Feature: Tool inspect_class

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Jan 1, 2026, 8:17 PM

Implement inspect_class to allow AI agents to introspect the schema of a class at runtime.

Requirements:

  • Input: className (string).
  • Output: JSON schema including configs (reactive and non-reactive), field definitions (for Models), and public methods.
  • Logic:
    • Load the class via Neo.ns().
    • Traverse prototype chain to gather all configs.
    • Identify mixins.
    • Format output for AI consumption (clear, type-aware).

Why: This allows the agent to "read the manual" for the specific app instance it is connected to, ensuring it sends valid data and understands the capabilities of custom components not in its training data.

tobiu added the enhancement label on Jan 1, 2026, 8:17 PM
tobiu added the ai label on Jan 1, 2026, 8:17 PM
tobiu assigned to @tobiu on Jan 1, 2026, 8:18 PM
tobiu added parent issue #8169 on Jan 1, 2026, 8:19 PM
tobiu
tobiu Jan 2, 2026, 12:45 AM

Input from Gemini 3 pro:

✦ Implemented inspect_class tool for Neural Link.

Scope & Architecture Refinement

We refined the goal from a simple "JSON schema" to a "Rich Class Blueprint". Instead of parsing source files (which misses inherited logic), we leverage the runtime knowledge:

  • ctor.config: The authoritative source for merged default values and config existence (after Neo.setupClass has run).
  • ctor.configDescriptors: The source for config metadata (e.g., merge: 'shallow', isEqual).
  • prototype: The source for active methods and mixins.

Implementation Details

The tool provides a "God Mode" view of a class, answering "What can this do?" and "How does it react?".

1. Rich Config Schema

Configs are not just values. The output now includes:

  • Value: The resolved default value.
  • Meta: Descriptor properties (if present).
  • Hooks: Explicitly lists active reactive hooks (beforeSet, afterSet, beforeGet) found on the prototype. This reveals the reactivity map of the component.

2. Cleaned Public API

The methods list is filtered to reduce noise:

  • Excluded: Internal lifecycle hooks (construct, init, onConstructed), constructors, and reactive config hooks (which are now categorized under configs).
  • Included: Actionable public methods (destroy, toJSON, set, etc.).

3. Hierarchy & Mixins

  • Returns the full ntypeChain and resolved mixins list.

This distinguishes inspect_class (Blueprint/Manual) from toJSON (Runtime State), providing agents with the deep understanding needed for complex tasks.

tobiu closed this issue on Jan 2, 2026, 12:46 AM
tobiu referenced in commit 2d83f4b - "#8280 missing file" on Jan 2, 2026, 12:48 AM