Skip to content

Commit aaeaa6e

Browse files
committed
feat(ai): Implement Neural Link toJSON protocol for Client Services and Managers
- Implement toJSON in manager.DragCoordinator - Implement toJSON in manager.Window - Refactor ComponentService to use toJSON protocol - Refactor DataService to use toJSON protocol - Refactor RuntimeService to use toJSON protocol - Update ai.client.Service.safeSerialize to prioritize toJSON Closes #8269 Closes #8270 Closes #8271 Closes #8272 Closes #8273
1 parent 42a2b14 commit aaeaa6e

14 files changed

Lines changed: 250 additions & 54 deletions

.github/.sync-metadata.json

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"lastSync": "2026-01-01T17:05:27.911Z",
3-
"releasesLastFetched": "2026-01-01T17:05:29.039Z",
2+
"lastSync": "2026-01-01T17:27:11.973Z",
3+
"releasesLastFetched": "2026-01-01T17:27:13.415Z",
44
"pushFailures": [],
55
"issues": {
66
"3789": {
@@ -13224,7 +13224,7 @@
1322413224
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8169.md",
1322513225
"closedAt": null,
1322613226
"updatedAt": "2025-12-28T13:36:59Z",
13227-
"contentHash": "333cbae3520653a989a8da40ec8b72f98cff87e7fd0d420ee188089059842ed8"
13227+
"contentHash": "1f2f782317eb13000e3acafd51eed670a22b905394b260e37fa2136b6247aeb5"
1322813228
},
1322913229
"8170": {
1323013230
"state": "CLOSED",
@@ -13441,7 +13441,7 @@
1344113441
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8200.md",
1344213442
"closedAt": null,
1344313443
"updatedAt": "2025-12-29T07:11:00Z",
13444-
"contentHash": "2cc570aea70c8dbc8ff92d57bbcb17fa8217e38b820afeed1217f89419c3e3c2"
13444+
"contentHash": "99f9ffe8c4c7f79432f53c2d0dc31fd681870e90b28b20ed51d223b298efff7b"
1344513445
},
1344613446
"8201": {
1344713447
"state": "CLOSED",
@@ -13911,6 +13911,41 @@
1391113911
"closedAt": "2026-01-01T17:04:17Z",
1391213912
"updatedAt": "2026-01-01T17:04:17Z",
1391313913
"contentHash": "73729320573de32ccd70acf7d21da6ca9416d3014d0169cc37c522683652b4a2"
13914+
},
13915+
"8269": {
13916+
"state": "OPEN",
13917+
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8269.md",
13918+
"closedAt": null,
13919+
"updatedAt": "2026-01-01T17:26:33Z",
13920+
"contentHash": "2caff4295928651a27a00efdbb69f405887e749f4c19557088d65e5515ffcf43"
13921+
},
13922+
"8270": {
13923+
"state": "OPEN",
13924+
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8270.md",
13925+
"closedAt": null,
13926+
"updatedAt": "2026-01-01T17:26:37Z",
13927+
"contentHash": "1665ec70c205bb6de8cb18629f10d3c53a5ca6ed8fa9b66e2f0175fa499491ef"
13928+
},
13929+
"8271": {
13930+
"state": "OPEN",
13931+
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8271.md",
13932+
"closedAt": null,
13933+
"updatedAt": "2026-01-01T17:26:40Z",
13934+
"contentHash": "10d78a9db31707f3a65661829314596e46b6ebe2a2be415f627967d06a9f7859"
13935+
},
13936+
"8272": {
13937+
"state": "OPEN",
13938+
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8272.md",
13939+
"closedAt": null,
13940+
"updatedAt": "2026-01-01T17:26:43Z",
13941+
"contentHash": "4c0033d8edf540dd5f2e0f8518a30b78e03b227d55d8e0ce43d109ed320b908a"
13942+
},
13943+
"8273": {
13944+
"state": "OPEN",
13945+
"path": "/Users/Shared/github/neomjs/neo/.github/ISSUE/issue-8273.md",
13946+
"closedAt": null,
13947+
"updatedAt": "2026-01-01T17:26:47Z",
13948+
"contentHash": "a84094fac4285a81f1620fc1522600439d08e55314e767cdbaca38891c1349c4"
1391413949
}
1391513950
},
1391613951
"releases": {

.github/ISSUE/issue-8169.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ subIssues:
5757
- '[x] 8216 Fix Neural Link server startup crash due to missing startServer/stopServer methods'
5858
- '[x] 8222 Fix Neural Link Recovery: Exempt server control tools from health check gate'
5959
- '[x] 8223 Investigate and Fix get_component_tree Timeout'
60+
- '[ ] 8271 [Neural Link] Refactor ComponentService to use toJSON protocol'
61+
- '[ ] 8272 [Neural Link] Refactor DataService to use toJSON protocol'
62+
- '[ ] 8273 [Neural Link] Refactor RuntimeService to use toJSON protocol'
6063
subIssuesCompleted: 36
61-
subIssuesTotal: 42
64+
subIssuesTotal: 45
6265
blockedBy: []
6366
blocking: []
6467
---
@@ -135,4 +138,7 @@ Empower AI agents to "see" and "touch" the runtime application, moving beyond st
135138
- 2025-12-30 @tobiu added sub-issue #8216
136139
- 2025-12-30 @tobiu added sub-issue #8222
137140
- 2025-12-30 @tobiu added sub-issue #8223
141+
- 2026-01-01 @tobiu added sub-issue #8271
142+
- 2026-01-01 @tobiu added sub-issue #8272
143+
- 2026-01-01 @tobiu added sub-issue #8273
138144

.github/ISSUE/issue-8200.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ subIssues:
5656
- '[x] 8266 [Neural Link] Implement toJSON in selection.table.CellColumnModel'
5757
- '[x] 8267 [Neural Link] Implement toJSON in selection.table.CellRowModel'
5858
- '[x] 8268 [Neural Link] Implement toJSON in selection.table.CellColumnRowModel'
59+
- '[ ] 8269 [Neural Link] Implement toJSON in manager.DragCoordinator'
60+
- '[ ] 8270 [Neural Link] Implement toJSON in manager.Window'
5961
subIssuesCompleted: 41
60-
subIssuesTotal: 41
62+
subIssuesTotal: 43
6163
blockedBy: []
6264
blocking: []
6365
---

.github/ISSUE/issue-8269.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
id: 8269
3+
title: '[Neural Link] Implement toJSON in manager.DragCoordinator'
4+
state: OPEN
5+
labels:
6+
- enhancement
7+
- ai
8+
assignees: []
9+
createdAt: '2026-01-01T17:26:33Z'
10+
updatedAt: '2026-01-01T17:26:33Z'
11+
githubUrl: 'https://github.com/neomjs/neo/issues/8269'
12+
author: tobiu
13+
commentsCount: 0
14+
parentIssue: 8200
15+
subIssues: []
16+
subIssuesCompleted: 0
17+
subIssuesTotal: 0
18+
blockedBy: []
19+
blocking: []
20+
---
21+
# [Neural Link] Implement toJSON in manager.DragCoordinator
22+
23+
Implement `toJSON` for the singleton `manager.DragCoordinator` to expose `activeTargetZone` and `sortZones` for AI inspection.
24+
25+
## Activity Log
26+
27+
- 2026-01-01 @tobiu added the `enhancement` label
28+
- 2026-01-01 @tobiu added the `ai` label
29+
- 2026-01-01 @tobiu added parent issue #8200
30+

.github/ISSUE/issue-8270.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
id: 8270
3+
title: '[Neural Link] Implement toJSON in manager.Window'
4+
state: OPEN
5+
labels:
6+
- enhancement
7+
- ai
8+
assignees: []
9+
createdAt: '2026-01-01T17:26:37Z'
10+
updatedAt: '2026-01-01T17:26:37Z'
11+
githubUrl: 'https://github.com/neomjs/neo/issues/8270'
12+
author: tobiu
13+
commentsCount: 0
14+
parentIssue: 8200
15+
subIssues: []
16+
subIssuesCompleted: 0
17+
subIssuesTotal: 0
18+
blockedBy: []
19+
blocking: []
20+
---
21+
# [Neural Link] Implement toJSON in manager.Window
22+
23+
Implement `toJSON` for the singleton `manager.Window`. This should serialize the collection of windows, ensuring each window object (`{appName, chrome, id, ...}`) is correctly serialized.
24+
25+
## Activity Log
26+
27+
- 2026-01-01 @tobiu added the `enhancement` label
28+
- 2026-01-01 @tobiu added the `ai` label
29+
- 2026-01-01 @tobiu added parent issue #8200
30+

.github/ISSUE/issue-8271.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
id: 8271
3+
title: '[Neural Link] Refactor ComponentService to use toJSON protocol'
4+
state: OPEN
5+
labels:
6+
- ai
7+
- refactoring
8+
assignees: []
9+
createdAt: '2026-01-01T17:26:40Z'
10+
updatedAt: '2026-01-01T17:26:40Z'
11+
githubUrl: 'https://github.com/neomjs/neo/issues/8271'
12+
author: tobiu
13+
commentsCount: 0
14+
parentIssue: 8169
15+
subIssues: []
16+
subIssuesCompleted: 0
17+
subIssuesTotal: 0
18+
blockedBy: []
19+
blocking: []
20+
---
21+
# [Neural Link] Refactor ComponentService to use toJSON protocol
22+
23+
Update `src/ai/client/ComponentService.mjs` to rely on the newly implemented `toJSON` methods for property extraction.
24+
* `serializeComponent` should use `component.toJSON()` for base properties but maintain its own recursion logic to respect `maxDepth`.
25+
* `getComponentProperty` should use `toJSON` if available.
26+
* `queryComponent` should use `toJSON` for result mapping.
27+
28+
## Activity Log
29+
30+
- 2026-01-01 @tobiu added the `ai` label
31+
- 2026-01-01 @tobiu added the `refactoring` label
32+
- 2026-01-01 @tobiu added parent issue #8169
33+

.github/ISSUE/issue-8272.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
id: 8272
3+
title: '[Neural Link] Refactor DataService to use toJSON protocol'
4+
state: OPEN
5+
labels:
6+
- ai
7+
- refactoring
8+
assignees: []
9+
createdAt: '2026-01-01T17:26:43Z'
10+
updatedAt: '2026-01-01T17:26:43Z'
11+
githubUrl: 'https://github.com/neomjs/neo/issues/8272'
12+
author: tobiu
13+
commentsCount: 0
14+
parentIssue: 8169
15+
subIssues: []
16+
subIssuesCompleted: 0
17+
subIssuesTotal: 0
18+
blockedBy: []
19+
blocking: []
20+
---
21+
# [Neural Link] Refactor DataService to use toJSON protocol
22+
23+
Update `src/ai/client/DataService.mjs` to rely on `toJSON`.
24+
* `getRecord`: Use `record.toJSON()` (already done, verify).
25+
* `inspectStateProvider`: Use `provider.toJSON()`.
26+
* `inspectStore`: Use `store.toJSON()`.
27+
28+
## Activity Log
29+
30+
- 2026-01-01 @tobiu added the `ai` label
31+
- 2026-01-01 @tobiu added the `refactoring` label
32+
- 2026-01-01 @tobiu added parent issue #8169
33+

.github/ISSUE/issue-8273.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
id: 8273
3+
title: '[Neural Link] Refactor RuntimeService to use toJSON protocol'
4+
state: OPEN
5+
labels:
6+
- ai
7+
- refactoring
8+
assignees: []
9+
createdAt: '2026-01-01T17:26:47Z'
10+
updatedAt: '2026-01-01T17:26:47Z'
11+
githubUrl: 'https://github.com/neomjs/neo/issues/8273'
12+
author: tobiu
13+
commentsCount: 0
14+
parentIssue: 8169
15+
subIssues: []
16+
subIssuesCompleted: 0
17+
subIssuesTotal: 0
18+
blockedBy: []
19+
blocking: []
20+
---
21+
# [Neural Link] Refactor RuntimeService to use toJSON protocol
22+
23+
Update `src/ai/client/RuntimeService.mjs`.
24+
* `getDragState`: Use `DragCoordinator.toJSON()`.
25+
* `getWindowInfo`: Use `WindowManager.toJSON()`.
26+
27+
## Activity Log
28+
29+
- 2026-01-01 @tobiu added the `ai` label
30+
- 2026-01-01 @tobiu added the `refactoring` label
31+
- 2026-01-01 @tobiu added parent issue #8169
32+

src/ai/client/ComponentService.mjs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -145,11 +145,7 @@ class ComponentService extends Service {
145145
}
146146

147147
return {
148-
components: matches.map(c => ({
149-
id : c.id,
150-
className: c.className,
151-
ntype : c.ntype
152-
}))
148+
components: matches.map(c => c.toJSON())
153149
}
154150
}
155151

@@ -194,15 +190,7 @@ class ComponentService extends Service {
194190
serializeComponent(component, maxDepth, currentDepth=1) {
195191
if (!component) return null;
196192

197-
const result = {
198-
id : component.id,
199-
className: component.className,
200-
ntype : component.ntype
201-
};
202-
203-
if (component.stateProvider) {
204-
result.stateProviderId = component.stateProvider.id
205-
}
193+
const result = component.toJSON();
206194

207195
if (maxDepth === -1 || currentDepth < maxDepth) {
208196
const children = Neo.manager.Component.getChildComponents(component);

src/ai/client/DataService.mjs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ class DataService extends Service {
5656
const provider = Neo.get(providerId);
5757
if (!provider) throw new Error(`StateProvider not found: ${providerId}`);
5858

59-
return {
60-
id : provider.id,
61-
data: provider.getHierarchyData()
62-
}
59+
return provider.toJSON()
6360
}
6461

6562
/**
@@ -82,11 +79,7 @@ class DataService extends Service {
8279
}
8380

8481
return {
85-
id : store.id,
86-
count : store.count,
87-
model : store.model?.className || 'N/A',
88-
filters: store.exportFilters?.() || [],
89-
sorters: store.exportSorters?.() || [],
82+
...store.toJSON(),
9083
items
9184
}
9285
}

0 commit comments

Comments
 (0)