psinetron-opencode-visualizer 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/visualizer/index.html +15 -5
package/package.json
CHANGED
package/visualizer/index.html
CHANGED
|
@@ -753,11 +753,21 @@ function connect() {
|
|
|
753
753
|
|
|
754
754
|
switch (data.type) {
|
|
755
755
|
case "state.sync":
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
756
|
+
{
|
|
757
|
+
const syncIds = new Set((data.instances || []).map(inst => inst.instanceId))
|
|
758
|
+
if (syncIds.size > 0) {
|
|
759
|
+
for (const a of [...agents]) {
|
|
760
|
+
if (!syncIds.has(a.instanceId)) {
|
|
761
|
+
removeAgent(a.instanceId)
|
|
762
|
+
}
|
|
763
|
+
}
|
|
764
|
+
for (const inst of data.instances || []) {
|
|
765
|
+
const existing = agents.find(a => a.instanceId === inst.instanceId)
|
|
766
|
+
if (!existing) {
|
|
767
|
+
createAgent(inst.instanceId, inst.cwd, inst.skin)
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
}
|
|
761
771
|
}
|
|
762
772
|
break
|
|
763
773
|
case "instance.added":
|