@openagents-org/agent-launcher 0.2.4 → 0.2.6
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 +3 -2
- package/src/registry.js +28 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openagents-org/agent-launcher",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "OpenAgents Launcher — install, configure, and run AI coding agents from your terminal",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"README.md"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"blessed": "^0.1.81"
|
|
40
|
+
"blessed": "^0.1.81",
|
|
41
|
+
"ws": "^8.18.0"
|
|
41
42
|
}
|
|
42
43
|
}
|
package/src/registry.js
CHANGED
|
@@ -30,17 +30,16 @@ class Registry {
|
|
|
30
30
|
// Try cache first (avoids network on every call)
|
|
31
31
|
const cached = this._loadCache();
|
|
32
32
|
if (cached) {
|
|
33
|
-
this._catalog = cached;
|
|
34
|
-
// Refresh in background if stale (but still return cached)
|
|
33
|
+
this._catalog = this._mergeBundled(cached);
|
|
35
34
|
this._refreshInBackground();
|
|
36
|
-
return
|
|
35
|
+
return this._catalog;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
// No cache — try remote
|
|
40
39
|
const remote = await this._fetchRemote();
|
|
41
40
|
if (remote) {
|
|
42
|
-
this._catalog = remote;
|
|
43
|
-
return
|
|
41
|
+
this._catalog = this._mergeBundled(remote);
|
|
42
|
+
return this._catalog;
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
// Fallback to bundled
|
|
@@ -54,22 +53,33 @@ class Registry {
|
|
|
54
53
|
getCatalogSync() {
|
|
55
54
|
if (this._catalog) return this._catalog;
|
|
56
55
|
const cached = this._loadCache();
|
|
57
|
-
const bundled = this._loadBundled();
|
|
58
56
|
if (cached) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
this._catalog = this._mergeBundled(cached);
|
|
58
|
+
return this._catalog;
|
|
59
|
+
}
|
|
60
|
+
this._catalog = this._loadBundled();
|
|
61
|
+
return this._catalog;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Merge bundled env_config/resolve_env/install into catalog entries.
|
|
66
|
+
* Remote/cached entries may lack these fields.
|
|
67
|
+
*/
|
|
68
|
+
_mergeBundled(catalog) {
|
|
69
|
+
const bundled = this._loadBundled();
|
|
70
|
+
for (const entry of catalog) {
|
|
71
|
+
const b = bundled.find(x => x.name === entry.name);
|
|
72
|
+
if (b) {
|
|
73
|
+
if ((!entry.env_config || entry.env_config.length === 0) && b.env_config && b.env_config.length > 0) entry.env_config = b.env_config;
|
|
74
|
+
if (!entry.resolve_env && b.resolve_env) entry.resolve_env = b.resolve_env;
|
|
75
|
+
if (!entry.install && b.install) entry.install = b.install;
|
|
67
76
|
}
|
|
68
|
-
this._catalog = cached;
|
|
69
|
-
return cached;
|
|
70
77
|
}
|
|
71
|
-
|
|
72
|
-
|
|
78
|
+
// Add bundled entries not in catalog
|
|
79
|
+
for (const b of bundled) {
|
|
80
|
+
if (!catalog.find(e => e.name === b.name)) catalog.push(b);
|
|
81
|
+
}
|
|
82
|
+
return catalog;
|
|
73
83
|
}
|
|
74
84
|
|
|
75
85
|
/**
|