Frontmatter
| id | 8309 |
| title | Feat: Neural Link - Get Method Source |
| state | Closed |
| labels | enhancementaiarchitecture |
| assignees | tobiu |
| createdAt | Jan 4, 2026, 1:54 PM |
| updatedAt | Jan 4, 2026, 2:07 PM |
| githubUrl | https://github.com/neomjs/neo/issues/8309 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | 8169 |
| subIssues | [] |
| subIssuesCompleted | 0 |
| subIssuesTotal | 0 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Jan 4, 2026, 2:07 PM |
Feat: Neural Link - Get Method Source
tobiu added parent issue #8169 on Jan 4, 2026, 1:55 PM
tobiu assigned to @tobiu on Jan 4, 2026, 1:55 PM

tobiu
Jan 4, 2026, 2:06 PM
Input from Gemini 3 pro:
✦ Implemented
get_method_sourcetool.Key Implementation Details:
- Robust Type Detection: The client-side implementation in
RuntimeService.mjsusesNeo.typeOf(cls)to correctly differentiate betweenNeoClass(usingcls.prototype) andNeoInstance(usingcls.constructor.prototype). This ensures it works for both standard classes and singletons (likeNeo.worker.App).- Source Retrieval: Uses
Function.prototype.toString()to retrieve the exact runtime source code of the method.- Workflow: This tool is explicitly documented in OpenAPI as the prerequisite step for the
patch_codetool, enabling a safe "read-modify-write" hot-patching cycle.- Full Stack: Exposed via
Neo.ai.Clientmapping and the Neural Link MCP Server proxy.
tobiu closed this issue on Jan 4, 2026, 2:07 PM
Context: To safely hot-patch code (Issue #8190), agents need to read the current implementation of a method. This is critical for "read-modify-write" workflows and works across all environments (dev, dist/esm, prod) by retrieving the actual runtime source via
Function.toString().Scope:
RuntimeService.mjs):getMethodSource({className, methodName}).Neo.ns(className).prototype[methodName].toString().get_method_sourcetool.Goal: Enable agents to see the code they are about to patch.