@openagents-org/agent-launcher 0.2.3 → 0.2.5
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/src/adapters/claude.js +2 -4
- package/src/registry.js +28 -18
package/package.json
CHANGED
package/src/adapters/claude.js
CHANGED
|
@@ -356,6 +356,7 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
356
356
|
let hasToolUseSinceLastText = false;
|
|
357
357
|
let postedThinking = false;
|
|
358
358
|
let stderrBuf = '';
|
|
359
|
+
let lineBuffer = '';
|
|
359
360
|
|
|
360
361
|
// Capture stderr for diagnostics
|
|
361
362
|
if (proc.stderr) {
|
|
@@ -450,7 +451,7 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
450
451
|
if (timeoutTimer) clearInterval(timeoutTimer);
|
|
451
452
|
|
|
452
453
|
// Process remaining buffer
|
|
453
|
-
const lines =
|
|
454
|
+
const lines = lineBuffer.split('\n');
|
|
454
455
|
for (const line of lines) {
|
|
455
456
|
try { await processLine(line); } catch {}
|
|
456
457
|
}
|
|
@@ -481,7 +482,6 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
481
482
|
});
|
|
482
483
|
|
|
483
484
|
// Process lines as they arrive
|
|
484
|
-
let lineBuffer = '';
|
|
485
485
|
proc.stdout.on('data', (chunk) => {
|
|
486
486
|
lineBuffer += chunk.toString('utf-8');
|
|
487
487
|
resetTimeout();
|
|
@@ -491,8 +491,6 @@ class ClaudeAdapter extends BaseAdapter {
|
|
|
491
491
|
processLine(line).catch(() => {});
|
|
492
492
|
}
|
|
493
493
|
});
|
|
494
|
-
// Override buffer since we're processing in real time
|
|
495
|
-
buffer = '';
|
|
496
494
|
});
|
|
497
495
|
} catch (e) {
|
|
498
496
|
this._log(`Error handling message: ${e.message}`);
|
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 && b.env_config) 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
|
/**
|