LearnNewsExamplesServices
Frontmatter
id8187
titleFeat: Neural Link - State Provider Inspection & Modification
stateClosed
labels
enhancementai
assigneestobiu
createdAtDec 28, 2025, 10:12 PM
updatedAtDec 29, 2025, 10:29 PM
githubUrlhttps://github.com/neomjs/neo/issues/8187
authortobiu
commentsCount1
parentIssue8169
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 29, 2025, 10:29 PM

Feat: Neural Link - State Provider Inspection & Modification

Closed v11.18.0 enhancementai
tobiu
tobiu commented on Dec 28, 2025, 10:12 PM

Context: For modern Neo apps using state.Provider, inspecting the global state tree is the fastest way to understand the application context. Modifying this state is a powerful way to drive the application.

Scope:

  1. Enhance ComponentService:

    • Update getComponentTree to include stateProviderId on components.
  2. Enhance DataService:

    • Add inspectStateProvider(sessionId, providerId).
      • Implementation: Neo.get(providerId).getHierarchyData().
    • Add modifyStateProvider(sessionId, providerId, data).
      • Implementation: Neo.get(providerId).setData(data).
      • data is a JSON object with keys/values (can be nested).
  3. Tools:

    • inspect_state_provider: Returns the effective state object.
    • modify_state_provider: Updates the state.

Goal: Provide full read/write access to the application's reactive state hierarchy.

tobiu added the enhancement label on Dec 28, 2025, 10:12 PM
tobiu added the ai label on Dec 28, 2025, 10:12 PM
tobiu added parent issue #8169 on Dec 28, 2025, 10:12 PM
tobiu assigned to @tobiu on Dec 29, 2025, 10:22 PM
tobiu referenced in commit dc0b535 - "feat(ai): Implement State Provider Inspection & Modification (#8187) on Dec 29, 2025, 10:23 PM
tobiu
tobiu Dec 29, 2025, 10:29 PM

Input from Gemini 3:

✦ I have implemented the State Provider Inspection & Modification features.

Changes:

  1. Component Service (src/ai/client/ComponentService.mjs):

    • Updated serializeComponent to include stateProviderId in the output only if the component explicitly defines/owns a stateProvider. This provides a clear view of state scope boundaries within the component tree without noise.
  2. Data Service (src/ai/client/DataService.mjs, ai/mcp/server/neural-link/services/DataService.mjs):

    • Implemented inspectStateProvider(providerId): Returns the hierarchical data object from the provider.
    • Implemented modifyStateProvider(providerId, data): Allows merging new data into the provider.
  3. MCP Integration:

    • Registered inspect_state_provider and modify_state_provider tools.
    • Updated src/ai/Client.mjs service mappings.
    • Updated openapi.yaml with new paths and schemas.

Agents can now discover where state providers are located (via get_component_tree) and then inspect or modify their data directly.

tobiu closed this issue on Dec 29, 2025, 10:29 PM