agent-space-manager 1.0.2 → 1.0.4
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/CHANGELOG.md +18 -0
- package/adapters.mjs +203 -1
- package/agents.mjs +37 -15
- package/index.mjs +1 -0
- package/manager.mjs +552 -42
- package/package.json +1 -1
- package/page/app.js +264 -104
- package/page/index.html +9 -3
- package/page/style.css +1 -0
package/page/app.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
return plugin.files;
|
|
19
19
|
}
|
|
20
20
|
const files = [];
|
|
21
|
-
files.push({ name: "plugin.json", relPath: "plugin.json", size: 520 });
|
|
21
|
+
files.push({ name: plugin.isApp ? "app.json" : "plugin.json", relPath: plugin.isApp ? "app.json" : "plugin.json", size: 520 });
|
|
22
22
|
|
|
23
23
|
if (Array.isArray(plugin.skills) && plugin.skills.length > 0) {
|
|
24
24
|
plugin.skills.forEach((s) => {
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
files.push({ name: a, relPath: `agents/${a}`, size: 1280 });
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
if (files.length === 1 && !plugin.hasMcp && !plugin.hasHooks && (!plugin.skills || plugin.skills.length === 0)) {
|
|
44
|
+
if (files.length === 1 && !plugin.isApp && !plugin.hasMcp && !plugin.hasHooks && (!plugin.skills || plugin.skills.length === 0)) {
|
|
45
45
|
files.push({ name: "README.md", relPath: "README.md", size: 1024 });
|
|
46
46
|
}
|
|
47
47
|
plugin.files = files;
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
const match = files.find((f) => {
|
|
69
69
|
const r = (f.relPath || f.name || "").toLowerCase();
|
|
70
70
|
return r === `skills/${skillName.toLowerCase()}/skill.md` ||
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
r.includes(`skills/${skillName.toLowerCase()}/`) ||
|
|
72
|
+
r.endsWith(`/${skillName.toLowerCase()}/skill.md`);
|
|
73
73
|
});
|
|
74
74
|
if (match) seenFiles.add(match.relPath || match.name);
|
|
75
75
|
items.push({
|
|
@@ -149,6 +149,23 @@
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
// 5b. Apps
|
|
153
|
+
if (plugin.isApp || plugin.hasApp || (Array.isArray(plugin.apps) && plugin.apps.length > 0)) {
|
|
154
|
+
const apps = (Array.isArray(plugin.apps) && plugin.apps.length > 0) ? plugin.apps : [plugin.appName || plugin.name || plugin.id];
|
|
155
|
+
for (const appName of apps) {
|
|
156
|
+
const match = files.find((f) => f.name === "app.json" || (f.relPath || "").includes(`apps/${appName}`));
|
|
157
|
+
if (match && match.name === "app.json") seenFiles.add(match.relPath || match.name);
|
|
158
|
+
items.push({
|
|
159
|
+
badge: "📦 App",
|
|
160
|
+
type: "app",
|
|
161
|
+
name: appName,
|
|
162
|
+
sub: "App Runtime / Binary",
|
|
163
|
+
relPath: plugin.isApp ? `app/${appName}/app.json` : (match ? (match.relPath || match.name) : `apps/${appName}`),
|
|
164
|
+
sizeStr: match ? formatSize(match.size) : "",
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
152
169
|
// 6. Manifest & Documentation & Other Files
|
|
153
170
|
for (const f of files) {
|
|
154
171
|
const key = f.relPath || f.name;
|
|
@@ -162,6 +179,14 @@
|
|
|
162
179
|
badge = "⚙️ Manifest";
|
|
163
180
|
type = "manifest";
|
|
164
181
|
sub = "Plugin Metadata";
|
|
182
|
+
} else if (f.name === "app.json") {
|
|
183
|
+
badge = "⚙️ Manifest";
|
|
184
|
+
type = "manifest";
|
|
185
|
+
sub = "App Metadata";
|
|
186
|
+
} else if (f.isDir || (f.name && f.name.endsWith("/"))) {
|
|
187
|
+
badge = "📁 Dir";
|
|
188
|
+
type = "dir";
|
|
189
|
+
sub = "Runtime Folder";
|
|
165
190
|
} else if (f.name.toLowerCase().startsWith("readme")) {
|
|
166
191
|
badge = "📝 Docs";
|
|
167
192
|
type = "docs";
|
|
@@ -195,10 +220,10 @@
|
|
|
195
220
|
|
|
196
221
|
function getMagpieApi() {
|
|
197
222
|
return globalThis.magpie?.api?.agentSpaceManager ||
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
223
|
+
globalThis.magpie?.api?.["agent-space-manager"] ||
|
|
224
|
+
globalThis.magpie?.api?.smartMiddleware ||
|
|
225
|
+
globalThis.magpie?.api?.["smart-middleware"] ||
|
|
226
|
+
globalThis.magpie?.api;
|
|
202
227
|
}
|
|
203
228
|
|
|
204
229
|
// Non-blocking toast notifications (Desktop WebView2 Dialog Safety Invariant)
|
|
@@ -309,11 +334,11 @@
|
|
|
309
334
|
mPlugins.forEach(ensurePluginFiles);
|
|
310
335
|
try {
|
|
311
336
|
localStorage.setItem("magpie_plugins_" + norm, JSON.stringify(mPlugins));
|
|
312
|
-
} catch {}
|
|
337
|
+
} catch { }
|
|
313
338
|
return mPlugins;
|
|
314
339
|
}
|
|
315
340
|
}
|
|
316
|
-
} catch {}
|
|
341
|
+
} catch { }
|
|
317
342
|
|
|
318
343
|
// 2. Local API server dynamically with cache-busting timestamp (when running outside CSP connect-src 'none')
|
|
319
344
|
try {
|
|
@@ -324,14 +349,14 @@
|
|
|
324
349
|
data.plugins.forEach(ensurePluginFiles);
|
|
325
350
|
try {
|
|
326
351
|
localStorage.setItem("magpie_plugins_" + norm, JSON.stringify(data.plugins));
|
|
327
|
-
} catch {}
|
|
352
|
+
} catch { }
|
|
328
353
|
if (data.categories) {
|
|
329
354
|
discoveredCategories = data.categories;
|
|
330
355
|
}
|
|
331
356
|
return data.plugins;
|
|
332
357
|
}
|
|
333
358
|
}
|
|
334
|
-
} catch {}
|
|
359
|
+
} catch { }
|
|
335
360
|
|
|
336
361
|
// 3. Dynamically reload plugins-cache.js via <script> tag (allowed by Magpie iframe CSP script-src 'self'!)
|
|
337
362
|
const currentCacheNorm = normalizePathForCompare(globalThis.__PLUGINS_CACHE__?.path);
|
|
@@ -345,7 +370,7 @@
|
|
|
345
370
|
cached.forEach(ensurePluginFiles);
|
|
346
371
|
try {
|
|
347
372
|
localStorage.setItem("magpie_plugins_" + norm, JSON.stringify(cached));
|
|
348
|
-
} catch {}
|
|
373
|
+
} catch { }
|
|
349
374
|
if (globalThis.__PLUGINS_CACHE__.categories) {
|
|
350
375
|
discoveredCategories = globalThis.__PLUGINS_CACHE__.categories;
|
|
351
376
|
}
|
|
@@ -365,7 +390,7 @@
|
|
|
365
390
|
return cData.plugins;
|
|
366
391
|
}
|
|
367
392
|
}
|
|
368
|
-
} catch {}
|
|
393
|
+
} catch { }
|
|
369
394
|
|
|
370
395
|
// 6. LocalStorage cached plugins strictly for this exact path
|
|
371
396
|
try {
|
|
@@ -377,7 +402,7 @@
|
|
|
377
402
|
return parsed;
|
|
378
403
|
}
|
|
379
404
|
}
|
|
380
|
-
} catch {}
|
|
405
|
+
} catch { }
|
|
381
406
|
|
|
382
407
|
return [];
|
|
383
408
|
},
|
|
@@ -389,7 +414,7 @@
|
|
|
389
414
|
const res = await magpieApi.saveConfig(config, options);
|
|
390
415
|
if (res) return res;
|
|
391
416
|
}
|
|
392
|
-
} catch {}
|
|
417
|
+
} catch { }
|
|
393
418
|
try {
|
|
394
419
|
const payload = { config, ...options };
|
|
395
420
|
const res = await fetch(`${API_BASE}/api/save`, {
|
|
@@ -418,7 +443,7 @@
|
|
|
418
443
|
signal: AbortSignal.timeout(5000),
|
|
419
444
|
});
|
|
420
445
|
if (res.ok) return await res.json();
|
|
421
|
-
} catch {}
|
|
446
|
+
} catch { }
|
|
422
447
|
return null;
|
|
423
448
|
},
|
|
424
449
|
|
|
@@ -435,7 +460,7 @@
|
|
|
435
460
|
signal: AbortSignal.timeout(5000),
|
|
436
461
|
});
|
|
437
462
|
if (res.ok) return await res.json();
|
|
438
|
-
} catch {}
|
|
463
|
+
} catch { }
|
|
439
464
|
return null;
|
|
440
465
|
},
|
|
441
466
|
|
|
@@ -446,7 +471,7 @@
|
|
|
446
471
|
const res = await magpieApi.resolveDroppedTarget(raw, mode);
|
|
447
472
|
if (res) return res;
|
|
448
473
|
}
|
|
449
|
-
} catch {}
|
|
474
|
+
} catch { }
|
|
450
475
|
try {
|
|
451
476
|
const res = await fetch(`${API_BASE}/api/resolve?path=${encodeURIComponent(raw || "")}&mode=${encodeURIComponent(mode || "ide")}`, { signal: AbortSignal.timeout(10000) });
|
|
452
477
|
if (res.ok) return await res.json();
|
|
@@ -463,7 +488,7 @@
|
|
|
463
488
|
const res = await magpieApi.browseFileSystem(type);
|
|
464
489
|
if (res) return res;
|
|
465
490
|
}
|
|
466
|
-
} catch {}
|
|
491
|
+
} catch { }
|
|
467
492
|
try {
|
|
468
493
|
const res = await fetch(`${API_BASE}/api/browse?type=${encodeURIComponent(type || "file")}`, { signal: AbortSignal.timeout(90000) });
|
|
469
494
|
if (res.ok) return await res.json();
|
|
@@ -480,14 +505,14 @@
|
|
|
480
505
|
const detected = await magpieApi.detectConfigPath(name, exePath);
|
|
481
506
|
if (detected) return detected;
|
|
482
507
|
}
|
|
483
|
-
} catch {}
|
|
508
|
+
} catch { }
|
|
484
509
|
try {
|
|
485
510
|
const res = await fetch(`${API_BASE}/api/detect-config?name=${encodeURIComponent(name || "")}&exePath=${encodeURIComponent(exePath || "")}`, { signal: AbortSignal.timeout(2000) });
|
|
486
511
|
if (res.ok) {
|
|
487
512
|
const data = await res.json();
|
|
488
513
|
return data.configPath;
|
|
489
514
|
}
|
|
490
|
-
} catch {}
|
|
515
|
+
} catch { }
|
|
491
516
|
return null;
|
|
492
517
|
},
|
|
493
518
|
|
|
@@ -498,11 +523,11 @@
|
|
|
498
523
|
const cfg = await magpieApi.getConfig();
|
|
499
524
|
if (cfg && Array.isArray(cfg.ides)) return cfg;
|
|
500
525
|
}
|
|
501
|
-
} catch {}
|
|
526
|
+
} catch { }
|
|
502
527
|
try {
|
|
503
528
|
const res = await fetch(`${API_BASE}/api/config`, { signal: AbortSignal.timeout(2000) });
|
|
504
529
|
if (res.ok) return await res.json();
|
|
505
|
-
} catch {}
|
|
530
|
+
} catch { }
|
|
506
531
|
return null;
|
|
507
532
|
},
|
|
508
533
|
|
|
@@ -513,14 +538,14 @@
|
|
|
513
538
|
const list = await magpieApi.getAgentProfiles();
|
|
514
539
|
if (Array.isArray(list) && list.length > 0) return list;
|
|
515
540
|
}
|
|
516
|
-
} catch {}
|
|
541
|
+
} catch { }
|
|
517
542
|
try {
|
|
518
543
|
const res = await fetch(`${API_BASE}/api/agents`, { signal: AbortSignal.timeout(2000) });
|
|
519
544
|
if (res.ok) {
|
|
520
545
|
const data = await res.json();
|
|
521
546
|
if (Array.isArray(data?.agents)) return data.agents;
|
|
522
547
|
}
|
|
523
|
-
} catch {}
|
|
548
|
+
} catch { }
|
|
524
549
|
return null;
|
|
525
550
|
},
|
|
526
551
|
|
|
@@ -531,11 +556,11 @@
|
|
|
531
556
|
const res = await magpieApi.checkModifications(customHubRoot);
|
|
532
557
|
if (res) return res;
|
|
533
558
|
}
|
|
534
|
-
} catch {}
|
|
559
|
+
} catch { }
|
|
535
560
|
try {
|
|
536
561
|
const res = await fetch(`${API_BASE}/api/check-modifications?path=${encodeURIComponent(customHubRoot || "")}&t=${Date.now()}`, { signal: AbortSignal.timeout(5000) });
|
|
537
562
|
if (res.ok) return await res.json();
|
|
538
|
-
} catch {}
|
|
563
|
+
} catch { }
|
|
539
564
|
return null;
|
|
540
565
|
},
|
|
541
566
|
|
|
@@ -546,7 +571,7 @@
|
|
|
546
571
|
const res = await magpieApi.startupSync(customConfig);
|
|
547
572
|
if (res) return res;
|
|
548
573
|
}
|
|
549
|
-
} catch {}
|
|
574
|
+
} catch { }
|
|
550
575
|
try {
|
|
551
576
|
const res = await fetch(`${API_BASE}/api/startup-sync`, {
|
|
552
577
|
method: "POST",
|
|
@@ -555,7 +580,7 @@
|
|
|
555
580
|
signal: AbortSignal.timeout(10000),
|
|
556
581
|
});
|
|
557
582
|
if (res.ok) return await res.json();
|
|
558
|
-
} catch {}
|
|
583
|
+
} catch { }
|
|
559
584
|
return null;
|
|
560
585
|
},
|
|
561
586
|
|
|
@@ -566,7 +591,7 @@
|
|
|
566
591
|
const res = await magpieApi.recheckStatus(customConfig);
|
|
567
592
|
if (res) return res;
|
|
568
593
|
}
|
|
569
|
-
} catch {}
|
|
594
|
+
} catch { }
|
|
570
595
|
try {
|
|
571
596
|
const res = await fetch(`${API_BASE}/api/recheck-status`, {
|
|
572
597
|
method: "POST",
|
|
@@ -575,7 +600,7 @@
|
|
|
575
600
|
signal: AbortSignal.timeout(8000),
|
|
576
601
|
});
|
|
577
602
|
if (res.ok) return await res.json();
|
|
578
|
-
} catch {}
|
|
603
|
+
} catch { }
|
|
579
604
|
return null;
|
|
580
605
|
},
|
|
581
606
|
|
|
@@ -587,7 +612,7 @@
|
|
|
587
612
|
const res = await magpieApi.connectAgent(target, options);
|
|
588
613
|
if (res) return res;
|
|
589
614
|
}
|
|
590
|
-
} catch {}
|
|
615
|
+
} catch { }
|
|
591
616
|
|
|
592
617
|
// Tier 2: Direct HTTP POST to local API server (if outside CSP connect-src 'none')
|
|
593
618
|
try {
|
|
@@ -629,7 +654,7 @@
|
|
|
629
654
|
if (scriptRes && scriptRes.success !== false) {
|
|
630
655
|
return scriptRes;
|
|
631
656
|
}
|
|
632
|
-
} catch {}
|
|
657
|
+
} catch { }
|
|
633
658
|
|
|
634
659
|
// Tier 4: Magpie options bridge with connect-status.js (allowed under script-src 'self')
|
|
635
660
|
try {
|
|
@@ -723,11 +748,11 @@
|
|
|
723
748
|
const res = await magpieApi.checkCentralizedUpdates(customHubRoot, { force });
|
|
724
749
|
if (res) return res;
|
|
725
750
|
}
|
|
726
|
-
} catch {}
|
|
751
|
+
} catch { }
|
|
727
752
|
try {
|
|
728
753
|
const res = await fetch(`${API_BASE}/api/central-update-check?path=${encodeURIComponent(customHubRoot || "")}&force=${force ? "true" : "false"}&t=${Date.now()}`, { signal: AbortSignal.timeout(5000) });
|
|
729
754
|
if (res.ok) return await res.json();
|
|
730
|
-
} catch {}
|
|
755
|
+
} catch { }
|
|
731
756
|
return null;
|
|
732
757
|
},
|
|
733
758
|
|
|
@@ -738,11 +763,11 @@
|
|
|
738
763
|
const res = await magpieApi.getCentralizedUpdateStatus(customHubRoot);
|
|
739
764
|
if (res) return res;
|
|
740
765
|
}
|
|
741
|
-
} catch {}
|
|
766
|
+
} catch { }
|
|
742
767
|
try {
|
|
743
768
|
const res = await fetch(`${API_BASE}/api/central-update-status?path=${encodeURIComponent(customHubRoot || "")}&t=${Date.now()}`, { signal: AbortSignal.timeout(3000) });
|
|
744
769
|
if (res.ok) return await res.json();
|
|
745
|
-
} catch {}
|
|
770
|
+
} catch { }
|
|
746
771
|
return null;
|
|
747
772
|
},
|
|
748
773
|
|
|
@@ -862,7 +887,7 @@
|
|
|
862
887
|
if (scriptStatus?.checkedAt && (Date.now() - scriptStatus.checkedAt < 12000)) {
|
|
863
888
|
return scriptStatus;
|
|
864
889
|
}
|
|
865
|
-
} catch {}
|
|
890
|
+
} catch { }
|
|
866
891
|
|
|
867
892
|
// 3. Magpie host IPC bridge
|
|
868
893
|
try {
|
|
@@ -871,14 +896,14 @@
|
|
|
871
896
|
const res = await magpieApi.getOmnirouteStatus(customPort);
|
|
872
897
|
if (res) return res;
|
|
873
898
|
}
|
|
874
|
-
} catch {}
|
|
899
|
+
} catch { }
|
|
875
900
|
|
|
876
901
|
// 4. Local API server endpoint
|
|
877
902
|
try {
|
|
878
903
|
const query = customPort ? `?port=${customPort}&t=${Date.now()}` : `?t=${Date.now()}`;
|
|
879
904
|
const res = await fetch(`${API_BASE}/api/omniroute/status${query}`, { signal: AbortSignal.timeout(2000) });
|
|
880
905
|
if (res.ok) return await res.json();
|
|
881
|
-
} catch {}
|
|
906
|
+
} catch { }
|
|
882
907
|
|
|
883
908
|
// 5. Sandboxed Magpie options watcher bridge
|
|
884
909
|
const viaOptions = await this.omnirouteViaOptions("status", customPort, 8000);
|
|
@@ -904,7 +929,7 @@
|
|
|
904
929
|
port: targetPort,
|
|
905
930
|
url: `http://localhost:${targetPort}`,
|
|
906
931
|
};
|
|
907
|
-
} catch {}
|
|
932
|
+
} catch { }
|
|
908
933
|
}
|
|
909
934
|
}
|
|
910
935
|
|
|
@@ -931,7 +956,7 @@
|
|
|
931
956
|
if (imgOk) {
|
|
932
957
|
return { installed: true, running: true, port: targetPort, url: `http://localhost:${targetPort}` };
|
|
933
958
|
}
|
|
934
|
-
} catch {}
|
|
959
|
+
} catch { }
|
|
935
960
|
|
|
936
961
|
// If omniroute-status.js has a recently verified state (< 15s), use it
|
|
937
962
|
if (globalThis.__OMNIROUTE_STATUS__?.checkedAt && (Date.now() - globalThis.__OMNIROUTE_STATUS__.checkedAt < 15000)) {
|
|
@@ -950,7 +975,7 @@
|
|
|
950
975
|
const res = await magpieApi.startOmniroute(targetPort);
|
|
951
976
|
if (res && typeof res === "object") return res;
|
|
952
977
|
}
|
|
953
|
-
} catch {}
|
|
978
|
+
} catch { }
|
|
954
979
|
|
|
955
980
|
// 2. Direct simple GET to API server (avoids CORS preflight)
|
|
956
981
|
try {
|
|
@@ -962,7 +987,7 @@
|
|
|
962
987
|
const json = await res.json();
|
|
963
988
|
if (json && (json.running || json.error)) return json;
|
|
964
989
|
}
|
|
965
|
-
} catch {}
|
|
990
|
+
} catch { }
|
|
966
991
|
|
|
967
992
|
// 3. Direct POST to API server
|
|
968
993
|
try {
|
|
@@ -976,7 +1001,7 @@
|
|
|
976
1001
|
const json = await res.json();
|
|
977
1002
|
if (json && (json.running || json.error)) return json;
|
|
978
1003
|
}
|
|
979
|
-
} catch {}
|
|
1004
|
+
} catch { }
|
|
980
1005
|
|
|
981
1006
|
// 4. Dynamic script trigger (allowed under CSP script-src)
|
|
982
1007
|
try {
|
|
@@ -1001,7 +1026,7 @@
|
|
|
1001
1026
|
document.head.appendChild(s);
|
|
1002
1027
|
});
|
|
1003
1028
|
if (scriptRes?.running) return scriptRes;
|
|
1004
|
-
} catch {}
|
|
1029
|
+
} catch { }
|
|
1005
1030
|
|
|
1006
1031
|
// 5. Sandboxed Magpie options watcher bridge
|
|
1007
1032
|
return await this.omnirouteViaOptions("start", targetPort, 28000);
|
|
@@ -1015,14 +1040,14 @@
|
|
|
1015
1040
|
const res = await magpieApi.stopOmniroute(targetPort);
|
|
1016
1041
|
if (res) return res;
|
|
1017
1042
|
}
|
|
1018
|
-
} catch {}
|
|
1043
|
+
} catch { }
|
|
1019
1044
|
try {
|
|
1020
1045
|
const res = await fetch(`${API_BASE}/api/omniroute/stop?port=${targetPort}&t=${Date.now()}`, {
|
|
1021
1046
|
method: "GET",
|
|
1022
1047
|
signal: AbortSignal.timeout(10000),
|
|
1023
1048
|
});
|
|
1024
1049
|
if (res.ok) return await res.json();
|
|
1025
|
-
} catch {}
|
|
1050
|
+
} catch { }
|
|
1026
1051
|
try {
|
|
1027
1052
|
const res = await fetch(`${API_BASE}/api/omniroute/stop`, {
|
|
1028
1053
|
method: "POST",
|
|
@@ -1032,7 +1057,7 @@
|
|
|
1032
1057
|
keepalive: true,
|
|
1033
1058
|
});
|
|
1034
1059
|
if (res.ok) return await res.json();
|
|
1035
|
-
} catch {}
|
|
1060
|
+
} catch { }
|
|
1036
1061
|
return await this.omnirouteViaOptions("stop", targetPort, 10000);
|
|
1037
1062
|
},
|
|
1038
1063
|
|
|
@@ -1046,7 +1071,7 @@
|
|
|
1046
1071
|
if (win) {
|
|
1047
1072
|
// Opened successfully in browser window
|
|
1048
1073
|
}
|
|
1049
|
-
} catch {}
|
|
1074
|
+
} catch { }
|
|
1050
1075
|
|
|
1051
1076
|
// 2. Direct fast call to local API server endpoint (GET query format avoids preflight)
|
|
1052
1077
|
try {
|
|
@@ -1055,7 +1080,7 @@
|
|
|
1055
1080
|
signal: AbortSignal.timeout(2000),
|
|
1056
1081
|
});
|
|
1057
1082
|
if (getRes.ok) return await getRes.json();
|
|
1058
|
-
} catch {}
|
|
1083
|
+
} catch { }
|
|
1059
1084
|
|
|
1060
1085
|
// 3. Wails v2 runtime Go shell open (standard in Magpie desktop host)
|
|
1061
1086
|
try {
|
|
@@ -1067,7 +1092,7 @@
|
|
|
1067
1092
|
window.wails.runtime.BrowserOpenURL(url);
|
|
1068
1093
|
return { success: true, url, method: "wails-runtime" };
|
|
1069
1094
|
}
|
|
1070
|
-
} catch {}
|
|
1095
|
+
} catch { }
|
|
1071
1096
|
|
|
1072
1097
|
// 4. Magpie host IPC bridge shell open
|
|
1073
1098
|
try {
|
|
@@ -1089,7 +1114,7 @@
|
|
|
1089
1114
|
magpie.openUrl(url);
|
|
1090
1115
|
return { success: true, url, method: "magpie-openUrl" };
|
|
1091
1116
|
}
|
|
1092
|
-
} catch {}
|
|
1117
|
+
} catch { }
|
|
1093
1118
|
|
|
1094
1119
|
// 5. Local API server POST
|
|
1095
1120
|
try {
|
|
@@ -1100,7 +1125,7 @@
|
|
|
1100
1125
|
signal: AbortSignal.timeout(3000),
|
|
1101
1126
|
});
|
|
1102
1127
|
if (res.ok) return await res.json();
|
|
1103
|
-
} catch {}
|
|
1128
|
+
} catch { }
|
|
1104
1129
|
|
|
1105
1130
|
// 6. Sandboxed Magpie frame: the plugin backend opens the OS default browser
|
|
1106
1131
|
try {
|
|
@@ -1108,7 +1133,7 @@
|
|
|
1108
1133
|
if (viaOptions && (viaOptions.opened || viaOptions.action === "open")) {
|
|
1109
1134
|
return { ...viaOptions, success: true, url };
|
|
1110
1135
|
}
|
|
1111
|
-
} catch {}
|
|
1136
|
+
} catch { }
|
|
1112
1137
|
|
|
1113
1138
|
return { success: true, url, method: "fallback" };
|
|
1114
1139
|
},
|
|
@@ -1120,7 +1145,7 @@
|
|
|
1120
1145
|
const res = await magpieApi.scanForeignComponents(agent);
|
|
1121
1146
|
if (res) return res;
|
|
1122
1147
|
}
|
|
1123
|
-
} catch {}
|
|
1148
|
+
} catch { }
|
|
1124
1149
|
try {
|
|
1125
1150
|
const res = await fetch(`${API_BASE}/api/agent/scan-foreign`, {
|
|
1126
1151
|
method: "POST",
|
|
@@ -1129,7 +1154,7 @@
|
|
|
1129
1154
|
signal: AbortSignal.timeout(6000),
|
|
1130
1155
|
});
|
|
1131
1156
|
if (res.ok) return await res.json();
|
|
1132
|
-
} catch {}
|
|
1157
|
+
} catch { }
|
|
1133
1158
|
return null;
|
|
1134
1159
|
},
|
|
1135
1160
|
|
|
@@ -1140,7 +1165,7 @@
|
|
|
1140
1165
|
const res = await magpieApi.cleanForeignComponents(components);
|
|
1141
1166
|
if (res) return res;
|
|
1142
1167
|
}
|
|
1143
|
-
} catch {}
|
|
1168
|
+
} catch { }
|
|
1144
1169
|
try {
|
|
1145
1170
|
const res = await fetch(`${API_BASE}/api/agent/clean-foreign`, {
|
|
1146
1171
|
method: "POST",
|
|
@@ -1149,7 +1174,7 @@
|
|
|
1149
1174
|
signal: AbortSignal.timeout(6000),
|
|
1150
1175
|
});
|
|
1151
1176
|
if (res.ok) return await res.json();
|
|
1152
|
-
} catch {}
|
|
1177
|
+
} catch { }
|
|
1153
1178
|
return null;
|
|
1154
1179
|
},
|
|
1155
1180
|
};
|
|
@@ -1328,7 +1353,7 @@
|
|
|
1328
1353
|
const parsed = JSON.parse(local);
|
|
1329
1354
|
if (parsed?.ides) hubConfig = parsed;
|
|
1330
1355
|
}
|
|
1331
|
-
} catch {}
|
|
1356
|
+
} catch { }
|
|
1332
1357
|
|
|
1333
1358
|
// Ensure default Antigravity IDE is present ONLY on first run if ides was never configured
|
|
1334
1359
|
if (!Array.isArray(hubConfig.ides)) {
|
|
@@ -1351,7 +1376,7 @@
|
|
|
1351
1376
|
if (Array.isArray(liveProfiles) && liveProfiles.length > 0) {
|
|
1352
1377
|
agentProfiles = liveProfiles;
|
|
1353
1378
|
}
|
|
1354
|
-
} catch {}
|
|
1379
|
+
} catch { }
|
|
1355
1380
|
await reloadPluginsFromHub();
|
|
1356
1381
|
|
|
1357
1382
|
// 4b. On startup: check for modification difference in Components Storage Path and recheck status dots for each enabled plugin in each connected agent!
|
|
@@ -1399,6 +1424,7 @@
|
|
|
1399
1424
|
if ($("cpRulesInput")) $("cpRulesInput").value = current.rules || defaults.rules || "";
|
|
1400
1425
|
if ($("cpAgentsInput")) $("cpAgentsInput").value = current.agents || defaults.agents || "";
|
|
1401
1426
|
if ($("cpHooksInput")) $("cpHooksInput").value = current.hooks || defaults.hooks || "";
|
|
1427
|
+
if ($("cpAppsInput")) $("cpAppsInput").value = current.apps || defaults.apps || "";
|
|
1402
1428
|
}
|
|
1403
1429
|
|
|
1404
1430
|
function collectComponentPathsFromInputs() {
|
|
@@ -1410,6 +1436,7 @@
|
|
|
1410
1436
|
const r = $("cpRulesInput")?.value?.trim();
|
|
1411
1437
|
const a = $("cpAgentsInput")?.value?.trim();
|
|
1412
1438
|
const h = $("cpHooksInput")?.value?.trim();
|
|
1439
|
+
const ap = $("cpAppsInput")?.value?.trim();
|
|
1413
1440
|
if (b) res.bundle = b;
|
|
1414
1441
|
if (s) res.skills = s;
|
|
1415
1442
|
if (c) res.commands = c;
|
|
@@ -1417,6 +1444,7 @@
|
|
|
1417
1444
|
if (r) res.rules = r;
|
|
1418
1445
|
if (a) res.agents = a;
|
|
1419
1446
|
if (h) res.hooks = h;
|
|
1447
|
+
if (ap) res.apps = ap;
|
|
1420
1448
|
return res;
|
|
1421
1449
|
}
|
|
1422
1450
|
|
|
@@ -1431,6 +1459,7 @@
|
|
|
1431
1459
|
{ key: "rules", label: "Rules" },
|
|
1432
1460
|
{ key: "agents", label: "Subagents" },
|
|
1433
1461
|
{ key: "hooks", label: "Hooks" },
|
|
1462
|
+
{ key: "apps", label: "Apps" },
|
|
1434
1463
|
];
|
|
1435
1464
|
chipsEl.innerHTML = caps.map((c) => {
|
|
1436
1465
|
const ok = prof.capabilities?.[c.key];
|
|
@@ -1600,11 +1629,11 @@
|
|
|
1600
1629
|
async function reloadPluginsFromHub(forceReloadScript = false) {
|
|
1601
1630
|
const effective = computeEffectiveHubPath();
|
|
1602
1631
|
const targetPath = effective.path;
|
|
1603
|
-
discoveredCategories = { plugins: [], mcps: [], hooks: [], skills: [], agents: [], rules: [] };
|
|
1632
|
+
discoveredCategories = { plugins: [], mcps: [], hooks: [], skills: [], agents: [], rules: [], apps: [] };
|
|
1604
1633
|
const plugins = await apiClient.getPlugins(targetPath, forceReloadScript);
|
|
1605
1634
|
discoveredPlugins = Array.isArray(plugins) ? plugins : [];
|
|
1606
1635
|
if (discoveredPlugins.length === 0) {
|
|
1607
|
-
discoveredCategories = { plugins: [], mcps: [], hooks: [], skills: [], agents: [], rules: [] };
|
|
1636
|
+
discoveredCategories = { plugins: [], mcps: [], hooks: [], skills: [], agents: [], rules: [], apps: [] };
|
|
1608
1637
|
} else if (!discoveredCategories.plugins || discoveredCategories.plugins.length === 0) {
|
|
1609
1638
|
discoveredCategories = buildClientCategoriesRegistry(discoveredPlugins);
|
|
1610
1639
|
}
|
|
@@ -1633,6 +1662,7 @@
|
|
|
1633
1662
|
let skills = 0;
|
|
1634
1663
|
let agents = 0;
|
|
1635
1664
|
let rules = 0;
|
|
1665
|
+
let apps = 0;
|
|
1636
1666
|
|
|
1637
1667
|
discoveredPlugins.forEach((p) => {
|
|
1638
1668
|
if (p.hasMcp) mcps += (p.mcps?.length || 1);
|
|
@@ -1640,9 +1670,11 @@
|
|
|
1640
1670
|
skills += (p.skills || []).length;
|
|
1641
1671
|
agents += (p.agents || []).length;
|
|
1642
1672
|
rules += (p.rules || []).length;
|
|
1673
|
+
if (p.isApp) apps += 1;
|
|
1674
|
+
else if (Array.isArray(p.apps)) apps += p.apps.length;
|
|
1643
1675
|
});
|
|
1644
1676
|
|
|
1645
|
-
return { plugins, mcps, hooks, skills, agents, rules };
|
|
1677
|
+
return { plugins, mcps, hooks, skills, agents, rules, apps };
|
|
1646
1678
|
}
|
|
1647
1679
|
|
|
1648
1680
|
function buildClientCategoriesRegistry(plugins = []) {
|
|
@@ -1653,12 +1685,14 @@
|
|
|
1653
1685
|
skills: [],
|
|
1654
1686
|
agents: [],
|
|
1655
1687
|
rules: [],
|
|
1688
|
+
apps: [],
|
|
1656
1689
|
};
|
|
1657
1690
|
const seenSkills = new Set();
|
|
1658
1691
|
const seenMcps = new Set();
|
|
1659
1692
|
const seenHooks = new Set();
|
|
1660
1693
|
const seenAgents = new Set();
|
|
1661
1694
|
const seenRules = new Set();
|
|
1695
|
+
const seenApps = new Set();
|
|
1662
1696
|
|
|
1663
1697
|
for (const p of plugins) {
|
|
1664
1698
|
ensurePluginFiles(p);
|
|
@@ -1668,6 +1702,9 @@
|
|
|
1668
1702
|
version: p.version,
|
|
1669
1703
|
path: p.path,
|
|
1670
1704
|
description: p.description,
|
|
1705
|
+
isApp: Boolean(p.isApp),
|
|
1706
|
+
hasApp: Boolean(p.hasApp || p.isApp),
|
|
1707
|
+
appsCount: p.isApp ? 1 : (p.apps || []).length,
|
|
1671
1708
|
skillsCount: (p.skills || []).length,
|
|
1672
1709
|
filesCount: (p.files || []).length,
|
|
1673
1710
|
files: p.files,
|
|
@@ -1675,6 +1712,36 @@
|
|
|
1675
1712
|
hasHooks: p.hasHooks,
|
|
1676
1713
|
});
|
|
1677
1714
|
|
|
1715
|
+
if (p.isApp) {
|
|
1716
|
+
const appKey = p.id || p.name;
|
|
1717
|
+
if (!seenApps.has(appKey)) {
|
|
1718
|
+
seenApps.add(appKey);
|
|
1719
|
+
categories.apps.push({
|
|
1720
|
+
id: p.id,
|
|
1721
|
+
name: p.name,
|
|
1722
|
+
version: p.version,
|
|
1723
|
+
pluginId: p.id,
|
|
1724
|
+
pluginName: p.name,
|
|
1725
|
+
description: p.description,
|
|
1726
|
+
sourcePath: p.path,
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
} else {
|
|
1730
|
+
for (const ap of (p.apps || [])) {
|
|
1731
|
+
const appKey = `${p.id}/${ap}`;
|
|
1732
|
+
if (!seenApps.has(appKey)) {
|
|
1733
|
+
seenApps.add(appKey);
|
|
1734
|
+
categories.apps.push({
|
|
1735
|
+
id: appKey,
|
|
1736
|
+
name: ap,
|
|
1737
|
+
pluginId: p.id,
|
|
1738
|
+
pluginName: p.name,
|
|
1739
|
+
sourcePath: `${p.path}\\apps\\${ap}`,
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
|
|
1678
1745
|
for (const s of (p.skills || [])) {
|
|
1679
1746
|
if (!seenSkills.has(s)) {
|
|
1680
1747
|
seenSkills.add(s);
|
|
@@ -1751,7 +1818,8 @@
|
|
|
1751
1818
|
const sLen = (cats.skills || []).length;
|
|
1752
1819
|
const aLen = (cats.agents || []).length;
|
|
1753
1820
|
const rLen = (cats.rules || []).length;
|
|
1754
|
-
const
|
|
1821
|
+
const apLen = (cats.apps || []).length;
|
|
1822
|
+
const totalCount = (pLen + mLen + hLen + sLen + aLen + rLen + apLen);
|
|
1755
1823
|
|
|
1756
1824
|
if ($("cat-cnt-total")) $("cat-cnt-total").textContent = totalCount;
|
|
1757
1825
|
if ($("cat-cnt-all")) $("cat-cnt-all").textContent = totalCount;
|
|
@@ -1761,6 +1829,7 @@
|
|
|
1761
1829
|
if ($("cat-cnt-skills")) $("cat-cnt-skills").textContent = sLen;
|
|
1762
1830
|
if ($("cat-cnt-agents")) $("cat-cnt-agents").textContent = aLen;
|
|
1763
1831
|
if ($("cat-cnt-rules")) $("cat-cnt-rules").textContent = rLen;
|
|
1832
|
+
if ($("cat-cnt-apps")) $("cat-cnt-apps").textContent = apLen;
|
|
1764
1833
|
|
|
1765
1834
|
const container = $("categoryItemsContainer");
|
|
1766
1835
|
if (!container) return;
|
|
@@ -1773,8 +1842,8 @@
|
|
|
1773
1842
|
let items = [];
|
|
1774
1843
|
if (activeCategoryTab === "all" || activeCategoryTab === "plugins") {
|
|
1775
1844
|
items.push(...cats.plugins.map(p => ({
|
|
1776
|
-
type: "plugin",
|
|
1777
|
-
badge: "🧩 Plugin",
|
|
1845
|
+
type: p.isApp ? "app" : "plugin",
|
|
1846
|
+
badge: p.isApp ? "📦 App" : "🧩 Plugin",
|
|
1778
1847
|
name: p.name,
|
|
1779
1848
|
sub: p.version ? `v${p.version}` : "",
|
|
1780
1849
|
path: p.path,
|
|
@@ -1831,6 +1900,16 @@
|
|
|
1831
1900
|
desc: "System Instruction & Rule Spec",
|
|
1832
1901
|
})));
|
|
1833
1902
|
}
|
|
1903
|
+
if (activeCategoryTab === "all" || activeCategoryTab === "apps") {
|
|
1904
|
+
items.push(...(cats.apps || []).map(ap => ({
|
|
1905
|
+
type: "app",
|
|
1906
|
+
badge: "📦 App",
|
|
1907
|
+
name: ap.name,
|
|
1908
|
+
sub: ap.version ? `v${ap.version}` : (ap.pluginName && ap.pluginName !== ap.name ? `from ${ap.pluginName}` : ""),
|
|
1909
|
+
path: ap.sourcePath,
|
|
1910
|
+
desc: ap.description || "Standalone Application Runtime",
|
|
1911
|
+
})));
|
|
1912
|
+
}
|
|
1834
1913
|
|
|
1835
1914
|
if (categorySearchFilter) {
|
|
1836
1915
|
const q = categorySearchFilter.toLowerCase();
|
|
@@ -1923,6 +2002,7 @@
|
|
|
1923
2002
|
if ($("cnt-skills")) $("cnt-skills").textContent = String(counts.skills);
|
|
1924
2003
|
if ($("cnt-agents")) $("cnt-agents").textContent = String(counts.agents);
|
|
1925
2004
|
if ($("cnt-rules")) $("cnt-rules").textContent = String(counts.rules);
|
|
2005
|
+
if ($("cnt-apps")) $("cnt-apps").textContent = String(counts.apps);
|
|
1926
2006
|
|
|
1927
2007
|
if ($("ideCount")) $("ideCount").textContent = String(hubConfig.ides?.length || 0);
|
|
1928
2008
|
if ($("projectCount")) $("projectCount").textContent = String(hubConfig.projects?.length || 0);
|
|
@@ -1952,8 +2032,8 @@
|
|
|
1952
2032
|
item.dataset.type = "ide";
|
|
1953
2033
|
|
|
1954
2034
|
const prof = agentProfiles.find((p) => p.id === ide.agentType) ||
|
|
1955
|
-
|
|
1956
|
-
|
|
2035
|
+
agentProfiles.find((p) => ide.id?.includes(p.id) || ide.name?.toLowerCase().includes(p.id)) ||
|
|
2036
|
+
agentProfiles[0];
|
|
1957
2037
|
const modeBadge = prof?.mode === "bundle"
|
|
1958
2038
|
? `<span style="font-size:9.5px; padding:1px 5px; border-radius:4px; background:rgba(16,185,129,0.15); color:#10b981; margin-left:6px;">Bundle</span>`
|
|
1959
2039
|
: `<span style="font-size:9.5px; padding:1px 5px; border-radius:4px; background:rgba(59,130,246,0.15); color:#3b82f6; margin-left:6px;">Native Adapter</span>`;
|
|
@@ -1963,7 +2043,8 @@
|
|
|
1963
2043
|
if (syncInfo?.summary) {
|
|
1964
2044
|
const s = syncInfo.summary;
|
|
1965
2045
|
if (syncInfo.mode === "bundle") {
|
|
1966
|
-
|
|
2046
|
+
const conflictSuffix = s.conflicts ? ` · <span style="color:#f59e0b;">${s.conflicts} conflicts</span>` : "";
|
|
2047
|
+
syncSubtitle = `<div style="font-size:10px; color:#10b981; margin-top:2px;">Synced: ${s.plugins || 0} plugin bundles${conflictSuffix}</div>`;
|
|
1967
2048
|
} else {
|
|
1968
2049
|
const parts = [];
|
|
1969
2050
|
if (s.skills !== undefined) parts.push(`${s.skills} skills`);
|
|
@@ -2279,14 +2360,17 @@
|
|
|
2279
2360
|
const rawHooks = Array.isArray(plugin.hooks) ? plugin.hooks : [];
|
|
2280
2361
|
const hasHooksInside = Boolean(plugin.hasHooks || rawHooks.length > 0);
|
|
2281
2362
|
|
|
2282
|
-
const
|
|
2363
|
+
const rawApps = Array.isArray(plugin.apps) ? plugin.apps : [];
|
|
2364
|
+
const hasAppInside = Boolean(plugin.isApp || plugin.hasApp || rawApps.length > 0);
|
|
2365
|
+
|
|
2366
|
+
const hasAnyFeature = hasSkillsInside || hasAgentsInside || hasMcpInside || hasRulesInside || hasHooksInside || hasAppInside || (plugin.filesCount && plugin.filesCount > 0);
|
|
2283
2367
|
if (!hasAnyFeature && !plugin.path) {
|
|
2284
2368
|
return { workable: false, color: "red", status: "failed", features: {}, summary: "Empty component", tooltip: `🔴 Connection failed: No workable components discovered in "${plugin.name || plugin.id}"` };
|
|
2285
2369
|
}
|
|
2286
2370
|
|
|
2287
2371
|
// Resolve agent profile capabilities
|
|
2288
2372
|
const agentType = String(ide.agentType || ide.id || "").toLowerCase();
|
|
2289
|
-
const profile = agentProfiles.find((p) => p.id === agentType) || { capabilities: { skills: true, mcp: true, rules: true, agents: true, hooks: true } };
|
|
2373
|
+
const profile = agentProfiles.find((p) => p.id === agentType) || { capabilities: { skills: true, mcp: true, rules: true, agents: true, hooks: true, apps: true } };
|
|
2290
2374
|
const isBundle = profile?.mode === "bundle" || agentType === "antigravity";
|
|
2291
2375
|
const customPaths = ide.componentPaths || {};
|
|
2292
2376
|
|
|
@@ -2296,6 +2380,7 @@
|
|
|
2296
2380
|
rules: isBundle || customPaths.rules ? true : (profile?.capabilities?.rules ?? true),
|
|
2297
2381
|
agents: isBundle || customPaths.agents ? true : (profile?.capabilities?.agents ?? true),
|
|
2298
2382
|
hooks: isBundle || customPaths.hooks ? true : (profile?.capabilities?.hooks ?? true),
|
|
2383
|
+
apps: isBundle || customPaths.apps ? true : (profile?.capabilities?.apps ?? true),
|
|
2299
2384
|
};
|
|
2300
2385
|
|
|
2301
2386
|
const features = {};
|
|
@@ -2414,6 +2499,27 @@
|
|
|
2414
2499
|
};
|
|
2415
2500
|
}
|
|
2416
2501
|
|
|
2502
|
+
// 6. Apps Check (only if present inside component)
|
|
2503
|
+
if (hasAppInside) {
|
|
2504
|
+
presentTypeCount++;
|
|
2505
|
+
const appNames = rawApps.length > 0 ? rawApps : [plugin.appName || plugin.name || plugin.id];
|
|
2506
|
+
const isSupported = capabilities.apps === true;
|
|
2507
|
+
if (isSupported) {
|
|
2508
|
+
workableCount++;
|
|
2509
|
+
actionParts.push(`App: ${appNames.join(", ")}`);
|
|
2510
|
+
detailedTooltipLines.push(`✓ App (${appNames.length}): ${appNames.join(", ")} active`);
|
|
2511
|
+
} else {
|
|
2512
|
+
detailedTooltipLines.push(`✗ App (${appNames.length}): Skipped (unsupported by ${ide.name || ide.id})`);
|
|
2513
|
+
}
|
|
2514
|
+
features.apps = {
|
|
2515
|
+
present: true,
|
|
2516
|
+
count: appNames.length,
|
|
2517
|
+
workable: isSupported,
|
|
2518
|
+
items: appNames,
|
|
2519
|
+
reason: isSupported ? "Active" : `Unsupported by ${ide.name || ide.id}`,
|
|
2520
|
+
};
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2417
2523
|
// If component has types present but NONE of them are supported by this agent
|
|
2418
2524
|
if (presentTypeCount > 0 && workableCount === 0) {
|
|
2419
2525
|
return {
|
|
@@ -2421,7 +2527,7 @@
|
|
|
2421
2527
|
color: "red",
|
|
2422
2528
|
status: "unsupported",
|
|
2423
2529
|
features,
|
|
2424
|
-
quickActions: { slashCommands, mentions, hasSlash: false, hasMention: false, hasMcp: false, hasRules: false, hasHooks: false },
|
|
2530
|
+
quickActions: { slashCommands, mentions, hasSlash: false, hasMention: false, hasMcp: false, hasRules: false, hasHooks: false, hasApp: false },
|
|
2425
2531
|
summary: `Incompatible with ${ide.name || ide.id}`,
|
|
2426
2532
|
tooltip: `🔴 Incompatible with ${ide.name || ide.id}: All component types in "${plugin.name || plugin.id}" are unsupported.`,
|
|
2427
2533
|
reason: `All component types in "${plugin.name || plugin.id}" are unsupported by ${ide.name || ide.id}`,
|
|
@@ -2433,6 +2539,7 @@
|
|
|
2433
2539
|
const hasMcp = hasMcpInside && capabilities.mcp === true;
|
|
2434
2540
|
const hasRules = hasRulesInside && capabilities.rules === true;
|
|
2435
2541
|
const hasHooks = hasHooksInside && capabilities.hooks === true;
|
|
2542
|
+
const hasApp = hasAppInside && capabilities.apps === true;
|
|
2436
2543
|
|
|
2437
2544
|
const summary = `Workable in ${ide.name || ide.id}${actionParts.length > 0 ? " · " + actionParts.join(" · ") : ""}`;
|
|
2438
2545
|
const baseTooltip = `🟢 Workable in ${ide.name || ide.id}: Connected & ready.${actionParts.length > 0 ? " Can be used with " + actionParts.join(" | ") : ""}`;
|
|
@@ -2451,6 +2558,7 @@
|
|
|
2451
2558
|
hasMcp,
|
|
2452
2559
|
hasRules,
|
|
2453
2560
|
hasHooks,
|
|
2561
|
+
hasApp,
|
|
2454
2562
|
},
|
|
2455
2563
|
summary,
|
|
2456
2564
|
tooltip,
|
|
@@ -2483,7 +2591,10 @@
|
|
|
2483
2591
|
const rawHooks = Array.isArray(plugin.hooks) ? plugin.hooks : [];
|
|
2484
2592
|
const hasHooksInside = Boolean(plugin.hasHooks || rawHooks.length > 0);
|
|
2485
2593
|
|
|
2486
|
-
const
|
|
2594
|
+
const rawApps = Array.isArray(plugin.apps) ? plugin.apps : [];
|
|
2595
|
+
const hasAppInside = Boolean(plugin.isApp || plugin.hasApp || rawApps.length > 0);
|
|
2596
|
+
|
|
2597
|
+
const hasAnyFeature = hasSkillsInside || hasAgentsInside || hasMcpInside || hasRulesInside || hasHooksInside || hasAppInside || (plugin.filesCount && plugin.filesCount > 0);
|
|
2487
2598
|
if (!hasAnyFeature && !plugin.path) {
|
|
2488
2599
|
return { workable: false, color: "red", status: "failed", features: {}, summary: "Empty component", tooltip: `🔴 Connection failed: No workable components discovered in "${plugin.name || plugin.id}"` };
|
|
2489
2600
|
}
|
|
@@ -2555,6 +2666,14 @@
|
|
|
2555
2666
|
features.hooks = { present: true, count: hookCount, workable: isSupported, items: rawHooks, reason: isSupported ? "Active" : "Unsupported" };
|
|
2556
2667
|
}
|
|
2557
2668
|
|
|
2669
|
+
// 6. Apps
|
|
2670
|
+
if (hasAppInside) {
|
|
2671
|
+
const appNames = rawApps.length > 0 ? rawApps : [plugin.appName || plugin.name || plugin.id];
|
|
2672
|
+
actionParts.push(`App: ${appNames.join(", ")}`);
|
|
2673
|
+
detailedTooltipLines.push(`✓ App (${appNames.length}): ${appNames.join(", ")} active`);
|
|
2674
|
+
features.apps = { present: true, count: appNames.length, workable: true, items: appNames, reason: "Active" };
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2558
2677
|
const summary = `Workable in ${project.name}${actionParts.length > 0 ? " · " + actionParts.join(" · ") : ""}`;
|
|
2559
2678
|
const baseTooltip = `🟢 Workable in Project "${project.name}": Repository linked & protected (.git/info/exclude).${actionParts.length > 0 ? " Can be used with " + actionParts.join(" | ") : ""}`;
|
|
2560
2679
|
const tooltip = detailedTooltipLines.length > 0 ? `${baseTooltip}\n${detailedTooltipLines.join("\n")}` : baseTooltip;
|
|
@@ -2637,6 +2756,9 @@
|
|
|
2637
2756
|
const row = document.createElement("tr");
|
|
2638
2757
|
|
|
2639
2758
|
let badges = "";
|
|
2759
|
+
if (plugin.isApp || plugin.hasApp || (plugin.apps && plugin.apps.length > 0)) {
|
|
2760
|
+
badges += `<span class="badge badge-app">App</span>`;
|
|
2761
|
+
}
|
|
2640
2762
|
if (plugin.hasMcp) badges += `<span class="badge badge-mcp">MCP</span>`;
|
|
2641
2763
|
if (plugin.skills?.length > 0) badges += `<span class="badge badge-skills">${plugin.skills.length} Skills</span>`;
|
|
2642
2764
|
if (plugin.rules?.length > 0) badges += `<span class="badge badge-rules">Rules</span>`;
|
|
@@ -2666,6 +2788,9 @@
|
|
|
2666
2788
|
} else if (it.type === "hook") {
|
|
2667
2789
|
badgeBg = "rgba(234,88,12,0.15)";
|
|
2668
2790
|
badgeColor = "#ea580c";
|
|
2791
|
+
} else if (it.type === "app") {
|
|
2792
|
+
badgeBg = "rgba(139,92,246,0.15)";
|
|
2793
|
+
badgeColor = "#7c3aed";
|
|
2669
2794
|
} else if (it.type === "manifest") {
|
|
2670
2795
|
badgeBg = "rgba(16,185,129,0.12)";
|
|
2671
2796
|
badgeColor = "#059669";
|
|
@@ -2701,6 +2826,11 @@
|
|
|
2701
2826
|
workabilityBadge = isW
|
|
2702
2827
|
? `<span style="font-size:9.5px; color:#10b981; font-weight:600;" title="Lifecycle hook active">✓ Workable</span>`
|
|
2703
2828
|
: `<span style="font-size:9.5px; color:#f59e0b; font-weight:600;" title="Agent does not support lifecycle hooks">⚠️ Unsupported</span>`;
|
|
2829
|
+
} else if (it.type === "app") {
|
|
2830
|
+
const isW = workability.features?.apps?.workable ?? true;
|
|
2831
|
+
workabilityBadge = isW
|
|
2832
|
+
? `<span style="font-size:9.5px; color:#10b981; font-weight:600;" title="App runtime linked and active">✓ Workable</span>`
|
|
2833
|
+
: `<span style="font-size:9.5px; color:#f59e0b; font-weight:600;" title="Agent does not support apps">⚠️ Unsupported</span>`;
|
|
2704
2834
|
}
|
|
2705
2835
|
}
|
|
2706
2836
|
|
|
@@ -2838,7 +2968,7 @@
|
|
|
2838
2968
|
try {
|
|
2839
2969
|
const detected = await apiClient.detectConfigPath(nameOrAgentType, exePath);
|
|
2840
2970
|
if (detected) return detected;
|
|
2841
|
-
} catch {}
|
|
2971
|
+
} catch { }
|
|
2842
2972
|
|
|
2843
2973
|
const prof = agentProfiles.find((p) => p.id === nameOrAgentType || p.label.toLowerCase() === String(nameOrAgentType || "").toLowerCase());
|
|
2844
2974
|
if (prof && prof.defaultConfigPath) {
|
|
@@ -2926,7 +3056,7 @@
|
|
|
2926
3056
|
try {
|
|
2927
3057
|
await navigator.clipboard.writeText(text);
|
|
2928
3058
|
return true;
|
|
2929
|
-
} catch {}
|
|
3059
|
+
} catch { }
|
|
2930
3060
|
}
|
|
2931
3061
|
try {
|
|
2932
3062
|
const ta = document.createElement("textarea");
|
|
@@ -3121,7 +3251,7 @@
|
|
|
3121
3251
|
if ($("btnPickHubFolder")) {
|
|
3122
3252
|
$("btnPickHubFolder").addEventListener("click", async () => {
|
|
3123
3253
|
if (hubFolderPicker) {
|
|
3124
|
-
try { hubFolderPicker.click(); } catch (err) {}
|
|
3254
|
+
try { hubFolderPicker.click(); } catch (err) { }
|
|
3125
3255
|
}
|
|
3126
3256
|
try {
|
|
3127
3257
|
$("btnPickHubFolder").textContent = "Opening...";
|
|
@@ -3248,7 +3378,7 @@
|
|
|
3248
3378
|
}
|
|
3249
3379
|
|
|
3250
3380
|
// Standardize Storage Structure Prompt Copy Button (with version display)
|
|
3251
|
-
const STORAGE_PROMPT_VERSION = "V1.
|
|
3381
|
+
const STORAGE_PROMPT_VERSION = "V1.7";
|
|
3252
3382
|
const btnCopyPrompt = $("btnCopyStoragePrompt");
|
|
3253
3383
|
if (btnCopyPrompt) {
|
|
3254
3384
|
const originalText = `Copy Prompt (${STORAGE_PROMPT_VERSION})`;
|
|
@@ -3260,10 +3390,10 @@
|
|
|
3260
3390
|
|
|
3261
3391
|
const promptText = `[Components Storage Specification & Upstream Rules Prompt ${STORAGE_PROMPT_VERSION}]
|
|
3262
3392
|
|
|
3263
|
-
Please organize and force our Components Storage file structure to strictly adhere to the standard plugin specification, record mandatory upstream source links, eliminate decentralized component updaters, ensure complete plugin uninstallation cleanup, enforce UTF-8 without BOM encoding, respect one-time rearrangement stability, define universal shared folder specifications, maintain dynamic Smart Middleware intent rules, and install a persistent agent rule:
|
|
3393
|
+
Please organize and force our Components Storage file structure to strictly adhere to the standard plugin and app specification, record mandatory upstream source links, eliminate decentralized component updaters, ensure complete plugin/app uninstallation cleanup, enforce UTF-8 without BOM encoding, respect one-time rearrangement stability, define universal shared and app folder specifications, maintain dynamic Smart Middleware intent rules, and install a persistent agent rule:
|
|
3264
3394
|
|
|
3265
3395
|
${targetPathHeader}1. Directory Structure Specification:
|
|
3266
|
-
Components Storage root (e.g. \`<Components Storage Path>\`) contains plugins, optional standalone skills, hub configuration, and a shared cross-agent communication/data directory:
|
|
3396
|
+
Components Storage root (e.g. \`<Components Storage Path>\`) contains plugins, standalone apps, optional standalone skills, hub configuration, and a shared cross-agent communication/data directory:
|
|
3267
3397
|
|
|
3268
3398
|
<Components Storage Path>/
|
|
3269
3399
|
├── plugins/ # Standard plugin directory
|
|
@@ -3278,48 +3408,78 @@ Components Storage root (e.g. \`<Components Storage Path>\`) contains plugins, o
|
|
|
3278
3408
|
│ │ └── <upstream GitHub name/self (if self created)-agent-name>.md # Must include upstream in frontmatter
|
|
3279
3409
|
│ └── rules/ # Optional rules directory
|
|
3280
3410
|
│ └── <upstream GitHub name/self (if self created)-rule-name>.md # Must include upstream in frontmatter
|
|
3411
|
+
├── app/ # Standalone application runtimes, browser binaries & desktop/CLI tools
|
|
3412
|
+
│ └── <app-name>/
|
|
3413
|
+
│ ├── app.json # Required app manifest ("id", "name", "version", "description", "upstream", optional "env"/"executable")
|
|
3414
|
+
│ └── <runtime-files>/ # Self-contained app binaries, browser builds (e.g. ms-playwright), or runtime assets
|
|
3281
3415
|
├── shared/ # Cross-agent IPC, discovery registry, handoff, and shared tools directory
|
|
3282
3416
|
│ ├── agent-connectors.json # Cross-agent messaging and discovery registry (active IDE agents & capabilities)
|
|
3283
3417
|
│ ├── handoff/ # Cross-agent delegation and task handoff inboxes
|
|
3284
3418
|
│ │ └── <agent-id>/ # Target agent inbox queue
|
|
3285
3419
|
│ ├── _upstream_backups/ # Pre-update backups and component snapshots
|
|
3286
3420
|
│ ├── middleware-intents.json # Dynamic user & agent Smart Middleware intent keyword registry
|
|
3287
|
-
│ └── <shared-tool-dirs>/ # Shared runtime states, engines, caches
|
|
3421
|
+
│ └── <shared-tool-dirs>/ # Shared runtime states, engines, caches; subfolders are named after their joining skills (e.g. stagehand-fastcrw joining stagehand and fastcrw, omniroute)
|
|
3288
3422
|
├── skills/ # Standalone or migrated skills
|
|
3289
3423
|
├── hub-config.json # Hub configuration
|
|
3290
3424
|
├── plugins.json # Discovered/registered plugins index
|
|
3425
|
+
├── apps.json # Discovered/registered apps index
|
|
3291
3426
|
└── skills.json # Discovered/registered skills index
|
|
3292
3427
|
|
|
3293
|
-
Duplicate Naming
|
|
3428
|
+
Duplicate Naming, Skill Collision Avoidance & No Duplicate Standalone Rule:
|
|
3429
|
+
- Skill Name Collisions Across Plugins: To avoid skill name collision across plugins, if a skill with the same name exists in two or more different plugins (e.g. a skill called "plan" in 2 different plugins called A and B), name the skill in each plugin by prefixing it with its plugin name (e.g. name the skill "plan" in A as "A-plan", and in B as "B-plan") so each skill has a distinct identifier without namespace collisions.
|
|
3430
|
+
- Other Component Duplicate Collisions: If two or more other components (plugins, apps, agents, rules, MCPs, or standalone skills) coincidentally have the same name, append \`-1\`, \`-2\`, etc. sequentially (e.g. \`<name>-1\`, \`<name>-2\`) so every component has a unique name without colliding or overwriting.
|
|
3431
|
+
- No Duplicate Standalone Copies: NEVER leave or create a standalone copy in \`<Components Storage Path>/skills/\`, \`rules/\`, \`agents/\`, or directly inside IDE native directories (e.g. \`~/.gemini/config/skills/\`, \`~/.gemini/config/rules/\`, \`~/.cursor/rules/\`, \`~/.claude/\`) when that component belongs to a plugin in \`plugins/<plugin-name>/\`. Whenever installing or migrating a plugin, check for existing standalone or unprefixed copies matching the same \`upstream\` URL or base name (e.g. \`trail-code-auto.md\` vs \`trailhq-trail-code-auto.md\`) and move or remove the standalone copy so only the plugin-scoped copy remains.
|
|
3294
3432
|
|
|
3295
|
-
2. Shared Folder
|
|
3433
|
+
2. Shared Folder & App Component Specifications (<Components Storage Path>/shared & <Components Storage Path>/app):
|
|
3434
|
+
A. Shared Folder (<Components Storage Path>/shared):
|
|
3296
3435
|
The shared directory serves as the centralized cross-agent IPC, discovery, and shared coordination layer across all supported AI coding agents (Antigravity, Cursor, Windsurf, Claude Code, OpenCode, VS Code Copilot, etc.):
|
|
3297
3436
|
- agent-connectors.json: Global discovery registry tracking connected agent profiles, capability flags, root config paths, and communication bridges.
|
|
3298
3437
|
- handoff/: Inter-agent handoff queues. Enables asynchronous task delegation and context packet transfers between agents across different IDEs.
|
|
3299
3438
|
- _upstream_backups/: Centralized safety backups created prior to weekly upstream component updates or synchronization runs.
|
|
3300
3439
|
- middleware-intents.json: Dynamic intent keyword registry for Smart Middleware. Maps tool patterns (e.g. docker, database, git) to user intent keywords so Smart Middleware dynamically surfaces domain tools without exceeding LLM context limits.
|
|
3301
|
-
- Shared Tooling & State Subfolder Naming: Shared runtime caches
|
|
3440
|
+
- Shared Tooling & State Subfolder Naming: Shared runtime caches and routing engines accessible universally across all connected agents without redundant duplication. Any subfolder created in shared/ for collaborating skills MUST be named after the joining skills (e.g. \`stagehand-fastcrw\` representing the joint operation of \`stagehand\` and \`fastcrw\`).
|
|
3302
3441
|
- Invariant: Never treat the shared/ directory or its internal files as loose components, and never delete or clear user-managed handoffs or shared configs during plugin cleanup.
|
|
3303
3442
|
|
|
3443
|
+
B. App Component Folder (<Components Storage Path>/app):
|
|
3444
|
+
The app directory stores standalone, toggleable application runtimes, browser engines, and external binaries (e.g. \`ms-playwright\`):
|
|
3445
|
+
- Directory Layout: Each app resides in \`<Components Storage Path>/app/<app-name>/\` and MUST contain an \`app.json\` manifest at its root (strict UTF-8 No BOM), alongside its runtime/binary files (such as \`chromium-1243/\`, \`ffmpeg-1011/\`, etc.). Never place standalone binary runtimes like \`ms-playwright\` inside \`shared/\`.
|
|
3446
|
+
- Required \`app.json\` Content:
|
|
3447
|
+
\`\`\`json
|
|
3448
|
+
{
|
|
3449
|
+
"id": "<app-name>",
|
|
3450
|
+
"name": "<app-name>",
|
|
3451
|
+
"version": "1.0.0",
|
|
3452
|
+
"description": "Concise description of the standalone application runtime",
|
|
3453
|
+
"upstream": "https://github.com/<owner>/<repo>",
|
|
3454
|
+
"env": {
|
|
3455
|
+
"OPTIONAL_ENV_VAR": "."
|
|
3456
|
+
},
|
|
3457
|
+
"executable": "optional/relative/path/to/binary"
|
|
3458
|
+
}
|
|
3459
|
+
\`\`\`
|
|
3460
|
+
- IDE Bridging & Toggling: Agent Space Manager discovers each subfolder in \`app/\` as an \`App\` component (tagged \`App\` in Components & Plugins) that can be toggled ON/OFF per connected IDE or project, linking via directory junction into \`<agent-config>/apps/<app-name>\` (e.g. \`~/.gemini/config/apps/ms-playwright\`). For tools relying on environment variables (such as \`PLAYWRIGHT_BROWSERS_PATH\` for \`ms-playwright\`), ensure the user environment variable points to \`<Components Storage Path>/app/<app-name>\`.
|
|
3461
|
+
|
|
3304
3462
|
3. Mandatory Upstream Links:
|
|
3305
|
-
For EVERY component (plugin, skill, rule, agent, MCP) installed in Components Storage Path:
|
|
3463
|
+
For EVERY component (plugin, app, skill, rule, agent, MCP) installed in Components Storage Path:
|
|
3306
3464
|
- Identify and record the upstream source link (GitHub repository URL, official documentation URL, or author registry link) where the component was saved or fetched from:
|
|
3307
3465
|
* In plugin.json: Include "upstream": "https://github.com/<owner>/<repo>" (or source repository URL).
|
|
3466
|
+
* In app.json: Include "upstream": "https://github.com/<owner>/<repo>" (or source repository URL).
|
|
3308
3467
|
* In SKILL.md: Include upstream: "https://github.com/<owner>/<repo>" in the YAML frontmatter.
|
|
3309
3468
|
* In rules (*.md): Include upstream: "https://github.com/<owner>/<repo>" in the YAML frontmatter.
|
|
3310
3469
|
* In agents (*.md): Include upstream: "https://github.com/<owner>/<repo>" in the YAML frontmatter.
|
|
3311
3470
|
|
|
3312
|
-
4. Complete Plugin Removal & Cleanup:
|
|
3313
|
-
When the user asks to remove, delete, or uninstall a plugin:
|
|
3314
|
-
- Remove the plugin directory
|
|
3315
|
-
- Concurrently remove ALL components related to that plugin across Components Storage and connected agent configs:
|
|
3471
|
+
4. Complete Plugin & App Removal & Cleanup:
|
|
3472
|
+
When the user asks to remove, delete, or uninstall a plugin or app:
|
|
3473
|
+
- Remove the plugin directory (\`plugins/<plugin-name>/\`) or app directory (\`app/<app-name>/\`).
|
|
3474
|
+
- Concurrently remove ALL components related to that plugin or app across Components Storage and connected agent configs:
|
|
3316
3475
|
* Associated skills in the plugin's skills/ directory and any bridged skill links.
|
|
3317
3476
|
* Associated subagents in agents/ and any bridged agent definitions.
|
|
3318
3477
|
* Associated rules in rules/ and any bridged rule files or managed rule sections.
|
|
3319
3478
|
* Associated MCP server definitions in mcp_config.json and their bridged entries.
|
|
3320
3479
|
* Associated hooks in hooks.json and their bridged hook entries.
|
|
3480
|
+
* Associated bridged app junctions in \`<agent-config>/apps/<app-name>\`.
|
|
3321
3481
|
* Associated Smart Middleware intent entries in <Components Storage Path>/shared/middleware-intents.json: trim and remove the plugin's registered intent keywords and tool patterns so no dead or stale intent entries remain for uninstalled tools.
|
|
3322
|
-
- Ensure no orphaned components, dangling junctions/symlinks, ghost configuration entries, or leftover intent keywords associated with the removed plugin remain.
|
|
3482
|
+
- Ensure no orphaned components, dangling junctions/symlinks, ghost configuration entries, or leftover intent keywords associated with the removed plugin or app remain.
|
|
3323
3483
|
|
|
3324
3484
|
5. Centralized Weekly Update Checking (No Decentralized Scripts):
|
|
3325
3485
|
- Remove and DO NOT create individual, local, or decentralized update scripts (such as update_checker.mjs or update_check_state.json) inside component folders.
|
|
@@ -3327,8 +3487,8 @@ When the user asks to remove, delete, or uninstall a plugin:
|
|
|
3327
3487
|
- Prune any obsolete local component update checking scripts or decentralized state files.
|
|
3328
3488
|
|
|
3329
3489
|
6. Mandatory File Encoding (Strict UTF-8 Without BOM):
|
|
3330
|
-
- ALL manifest and configuration files (plugin.json, mcp_config.json, hooks.json, SKILL.md, and *.md) MUST be written strictly in standard UTF-8 without Byte Order Mark (UTF-8 No BOM).
|
|
3331
|
-
- NEVER output or save files with a UTF-8 BOM (\\uFEFF or byte sequence 0xEF, 0xBB, 0xBF). A BOM header corrupts JSON parsing across IDEs and tools, leading to "Invalid plugin.json" errors.
|
|
3490
|
+
- ALL manifest and configuration files (plugin.json, app.json, mcp_config.json, hooks.json, SKILL.md, and *.md) MUST be written strictly in standard UTF-8 without Byte Order Mark (UTF-8 No BOM).
|
|
3491
|
+
- NEVER output or save files with a UTF-8 BOM (\\uFEFF or byte sequence 0xEF, 0xBB, 0xBF). A BOM header corrupts JSON parsing across IDEs and tools, leading to "Invalid plugin.json" or "Invalid app.json" errors.
|
|
3332
3492
|
- If executing file writes via Windows PowerShell (5.1), avoid standard Out-File or Set-Content defaults; always write without BOM using Node.js fs.writeFileSync(path, content, "utf8"), PowerShell 7 -Encoding utf8NoBOM, or [System.IO.File]::WriteAllText($path, $content, (New-Object System.Text.UTF8Encoding($false))).
|
|
3333
3493
|
|
|
3334
3494
|
7. One-Time Rearrangement Stability:
|
|
@@ -3344,23 +3504,23 @@ When the user asks to remove, delete, or uninstall a plugin:
|
|
|
3344
3504
|
9. Mandatory Persistent Agent Rule:
|
|
3345
3505
|
Install and persist a dedicated rule in your agent's rule system (e.g. .agents/rules/components-storage-upstream-rule.md or .cursor/rules/components-storage-upstream-rule.mdc) that is ALWAYS TRIGGERED whenever an addendum, creation, modification, edit, or removal of any component in the Components Storage Path (${storagePath || "Components Storage Path"}):
|
|
3346
3506
|
- Rule Trigger: Addendum, creation, edit, or removal of any component in Components Storage Path.
|
|
3347
|
-
- Rule Invariant 1: Ensure strict compliance with the plugin
|
|
3348
|
-
- Rule Invariant 2: Always add and preserve the upstream link in the component's manifest or frontmatter.
|
|
3349
|
-
- Rule Invariant 3: Complete removal cleanup — when removing a plugin, all components related to
|
|
3507
|
+
- Rule Invariant 1: Ensure strict compliance with the plugin, app/, and shared/ directory structures above; place standalone application runtimes and browser binaries (e.g. ms-playwright) in app/<app-name>/ with a valid app.json manifest (never in shared/); avoid skill name collisions across plugins by prefixing the skill with its plugin name (e.g. a skill called 'plan' in plugins A and B is named 'A-plan' and 'B-plan'), disambiguate any other coincidental duplicate component names by appending -1, -2, etc. sequentially, and never leave duplicate standalone copies in root skills/rules/agents or IDE native config directories when the component belongs to a plugin (remove or migrate any pre-existing standalone/unprefixed copy matching the same upstream URL or base name).
|
|
3508
|
+
- Rule Invariant 2: Always add and preserve the upstream link in the component's manifest (plugin.json, app.json) or frontmatter.
|
|
3509
|
+
- Rule Invariant 3: Complete removal cleanup — when removing a plugin or app, all components related to it (skills, agents, rules, MCP servers, hooks, bridged app junctions) AND its entries in shared/middleware-intents.json must be cleanly removed and trimmed with no orphaned leftovers.
|
|
3350
3510
|
- Rule Invariant 4: Never introduce decentralized or component-level update scripts; all update checking is handled centrally by the Agent Space Manager plugin on Monday startup.
|
|
3351
|
-
- Rule Invariant 5: Never write files with a UTF-8 BOM header; always enforce UTF-8 No BOM encoding.
|
|
3511
|
+
- Rule Invariant 5: Never write files with a UTF-8 BOM header; always enforce UTF-8 No BOM encoding across plugin.json, app.json, mcp_config.json, hooks.json, and markdown files.
|
|
3352
3512
|
- Rule Invariant 6: One-Time Rearrangement Stability — if file rearrangement was already performed once, never rearrange or move existing structure again on subsequent prompt runs unless explicitly requested by the user.
|
|
3353
3513
|
- Rule Invariant 7: Universal Shared Directory Preservation & Naming — preserve <Components Storage Path>/shared (agent-connectors.json, handoff/, _upstream_backups/, middleware-intents.json) as the designated cross-agent communication and data hub; never treat it as an orphaned or removable plugin; any subfolders in shared/ must be named after their joining skills (e.g. stagehand-fastcrw joining stagehand and fastcrw).
|
|
3354
3514
|
- Rule Invariant 8: Dynamic Smart Middleware Intent Lifecycle & Seeding — (a) on initial run, seed shared/middleware-intents.json based on all currently existing plugins and tools in Components Storage; (b) when adding new components with tools, register their intent keywords and tool patterns in shared/middleware-intents.json; (c) when removing components, trim and prune their intent entries from shared/middleware-intents.json so the personal layer remains trimmed and accurate.
|
|
3355
3515
|
|
|
3356
|
-
Please inspect ${storagePath || "Components Storage Path"}, clean up non-conforming or loose files, ensure all component manifests and frontmatters contain their upstream links, ensure all JSON files are valid UTF-8 without BOM, purge any decentralized update checking scripts, ensure removal rules cover all related components and trim middleware intents, preserve the shared/ cross-agent folder, seed or update tool intent keywords in shared/middleware-intents.json based on existing installed components, respect one-time rearrangement stability if already arranged, and persist the rule into your agent's rules.`;
|
|
3516
|
+
Please inspect ${storagePath || "Components Storage Path"}, clean up non-conforming or loose files, ensure all component manifests (including plugin.json and app.json) and frontmatters contain their upstream links, ensure all JSON files are valid UTF-8 without BOM, purge any decentralized update checking scripts, ensure removal rules cover all related components and trim middleware intents, resolve skill name collisions across plugins by prefixing plugin names (e.g. A-plan, B-plan), keep standalone apps in app/<app-name>/ with app.json, preserve the shared/ cross-agent folder, seed or update tool intent keywords in shared/middleware-intents.json based on existing installed components, respect one-time rearrangement stability if already arranged, and persist the rule into your agent's rules.`;
|
|
3357
3517
|
|
|
3358
3518
|
let copied = false;
|
|
3359
3519
|
if (navigator.clipboard && navigator.clipboard.writeText) {
|
|
3360
3520
|
try {
|
|
3361
3521
|
await navigator.clipboard.writeText(promptText);
|
|
3362
3522
|
copied = true;
|
|
3363
|
-
} catch {}
|
|
3523
|
+
} catch { }
|
|
3364
3524
|
}
|
|
3365
3525
|
if (!copied) {
|
|
3366
3526
|
try {
|
|
@@ -3373,7 +3533,7 @@ Please inspect ${storagePath || "Components Storage Path"}, clean up non-conform
|
|
|
3373
3533
|
document.execCommand("copy");
|
|
3374
3534
|
document.body.removeChild(ta);
|
|
3375
3535
|
copied = true;
|
|
3376
|
-
} catch {}
|
|
3536
|
+
} catch { }
|
|
3377
3537
|
}
|
|
3378
3538
|
|
|
3379
3539
|
btnCopyPrompt.textContent = copied ? "Copied!" : "Copy Failed";
|
|
@@ -3526,7 +3686,7 @@ Please inspect ${storagePath || "Components Storage Path"}, clean up non-conform
|
|
|
3526
3686
|
if ($("btnBrowseIdeExe")) {
|
|
3527
3687
|
$("btnBrowseIdeExe").addEventListener("click", async () => {
|
|
3528
3688
|
if (ideExePicker) {
|
|
3529
|
-
try { ideExePicker.click(); } catch (err) {}
|
|
3689
|
+
try { ideExePicker.click(); } catch (err) { }
|
|
3530
3690
|
}
|
|
3531
3691
|
try {
|
|
3532
3692
|
$("btnBrowseIdeExe").textContent = "Opening...";
|
|
@@ -3593,7 +3753,7 @@ Please inspect ${storagePath || "Components Storage Path"}, clean up non-conform
|
|
|
3593
3753
|
if ($("btnBrowseProjectPath")) {
|
|
3594
3754
|
$("btnBrowseProjectPath").addEventListener("click", async () => {
|
|
3595
3755
|
if (projectFolderPicker) {
|
|
3596
|
-
try { projectFolderPicker.click(); } catch (err) {}
|
|
3756
|
+
try { projectFolderPicker.click(); } catch (err) { }
|
|
3597
3757
|
}
|
|
3598
3758
|
try {
|
|
3599
3759
|
$("btnBrowseProjectPath").textContent = "Opening...";
|
|
@@ -3933,7 +4093,7 @@ Please inspect ${storagePath || "Components Storage Path"}, clean up non-conform
|
|
|
3933
4093
|
const norm = normalizePathForCompare(effectivePath);
|
|
3934
4094
|
try {
|
|
3935
4095
|
localStorage.removeItem("magpie_plugins_" + norm);
|
|
3936
|
-
} catch {}
|
|
4096
|
+
} catch { }
|
|
3937
4097
|
|
|
3938
4098
|
await new Promise((r) => setTimeout(r, 200));
|
|
3939
4099
|
if (bar) bar.style.width = "40%";
|
|
@@ -4169,7 +4329,7 @@ Please inspect ${storagePath || "Components Storage Path"}, clean up non-conform
|
|
|
4169
4329
|
async function persistConfig(forceRescan = false, options = { connect: false, sync: false }) {
|
|
4170
4330
|
try {
|
|
4171
4331
|
localStorage.setItem("magpie_agent_space_config", JSON.stringify(hubConfig));
|
|
4172
|
-
} catch {}
|
|
4332
|
+
} catch { }
|
|
4173
4333
|
|
|
4174
4334
|
// 1. Try direct API server first (works in browser / unrestricted WebView)
|
|
4175
4335
|
const saveRes = await apiClient.saveConfig(hubConfig, options);
|