@openagents-org/agent-launcher 0.2.215 → 0.2.216
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/icons/kiro.svg +11 -0
- package/package.json +1 -1
- package/registry.json +103 -3
- package/src/adapters/acp-client.js +217 -0
- package/src/adapters/claude.js +64 -8
- package/src/adapters/codex.js +126 -33
- package/src/adapters/hermes.js +164 -87
- package/src/adapters/index.js +4 -1
- package/src/adapters/kiro-runtime.js +318 -0
- package/src/adapters/kiro.js +813 -0
- package/src/adapters/opencode.js +7 -0
- package/src/daemon.js +7 -8
- package/src/index.js +7 -13
- package/src/install-preflight.js +20 -1
- package/src/paths.js +6 -0
- package/src/utils.js +12 -0
package/src/adapters/opencode.js
CHANGED
|
@@ -1339,6 +1339,13 @@ class OpenCodeAdapter extends BaseAdapter {
|
|
|
1339
1339
|
let category;
|
|
1340
1340
|
if (isPostinstallStubOutput(hay)) {
|
|
1341
1341
|
category = 'install_incomplete';
|
|
1342
|
+
} else if (has(/(?:unrecognized|unknown) (?:flag|option|argument)s?:?\s*['"`]?--?[a-z]/)) {
|
|
1343
|
+
// The CLI refused a flag this adapter always passes, so it is not a
|
|
1344
|
+
// build we support (one whose version string we could not read gets
|
|
1345
|
+
// through the preflight). It printed its usage too, and that came out
|
|
1346
|
+
// as "produced output this version could not parse", which said nothing
|
|
1347
|
+
// about reinstalling.
|
|
1348
|
+
category = 'unsupported_version';
|
|
1342
1349
|
} else if (has(/\b(401|403)\b/) || has(/unauthor|invalid api key|invalid_api_key|authentication|auth(entication)? failed|forbidden|invalid token|no api key|missing api key|permission denied/)) {
|
|
1343
1350
|
category = 'auth_failed';
|
|
1344
1351
|
} else if (has(/\b429\b/) || has(/rate.?limit|too many requests|quota|overloaded/)) {
|
package/src/daemon.js
CHANGED
|
@@ -22,9 +22,10 @@ const { LogWriter } = require('./log-writer');
|
|
|
22
22
|
const { redactDiagnostic } = require('./adapters/health-status');
|
|
23
23
|
const { installCommandFor } = require('./probe');
|
|
24
24
|
|
|
25
|
-
/** Types whose endpoint is one device-wide config file of their own.
|
|
26
|
-
* left
|
|
27
|
-
|
|
25
|
+
/** Types whose endpoint is one device-wide config file of their own. None
|
|
26
|
+
* left: OpenClaw gives each keyed agent a private store (adapters/openclaw.js)
|
|
27
|
+
* and Hermes a provider of its own in its config.yaml (adapters/hermes.js). */
|
|
28
|
+
const SHARED_NATIVE_CONFIG = new Set();
|
|
28
29
|
|
|
29
30
|
// A signed-in agent's model list is asked for again after this long. What a
|
|
30
31
|
// CLI is offered changes when the CLI is upgraded (a vendor holds new models
|
|
@@ -751,11 +752,9 @@ class Daemon {
|
|
|
751
752
|
* set up in the launcher onto another one's key, endpoint and model: add a
|
|
752
753
|
* second DeepSeek or CodeArts agent from the workspace, and the first one
|
|
753
754
|
* ran on the new one's settings from its next restart.
|
|
754
|
-
*
|
|
755
|
-
*
|
|
756
|
-
*
|
|
757
|
-
* OpenClaw writes each keyed agent's private openclaw.json from the agent's
|
|
758
|
-
* own env when it starts, so it keeps its key on the agent like the rest.
|
|
755
|
+
* OpenClaw writes each keyed agent's private openclaw.json, and Hermes each
|
|
756
|
+
* keyed agent's own provider, from the agent's own env when it runs, so
|
|
757
|
+
* both keep their keys on the agent like the rest.
|
|
759
758
|
*/
|
|
760
759
|
_keepsKeysPerAgent(type) {
|
|
761
760
|
return !SHARED_NATIVE_CONFIG.has(type);
|
package/src/index.js
CHANGED
|
@@ -115,10 +115,9 @@ class AgentConnector {
|
|
|
115
115
|
const agentType = type || 'openclaw';
|
|
116
116
|
this.config.addAgent({ name, type: agentType, role: role || 'worker', path, env });
|
|
117
117
|
// A key entered while ADDING the agent needs the same native side effects
|
|
118
|
-
// as one saved later: OpenClaw
|
|
119
|
-
//
|
|
120
|
-
//
|
|
121
|
-
// (Hermes falling back to OpenRouter: "401 Missing Authentication header").
|
|
118
|
+
// as one saved later: OpenClaw reads a custom endpoint only from its own
|
|
119
|
+
// config. Without this a new agent's test passed on the form's key while
|
|
120
|
+
// the run used a stale one ("401 Invalid token").
|
|
122
121
|
if (env && Object.keys(env).length) {
|
|
123
122
|
this._configureAgentNativeAuth(agentType, env, name);
|
|
124
123
|
}
|
|
@@ -129,14 +128,15 @@ class AgentConnector {
|
|
|
129
128
|
* _configureNativeAuth for one agent, on the env it actually runs with: the
|
|
130
129
|
* type's keys and endpoint only when it has none of its own and does not
|
|
131
130
|
* sign in through its CLI (typeEnvFor). Merging all of <type>.env pushed a
|
|
132
|
-
* key saved there earlier into
|
|
133
|
-
*
|
|
131
|
+
* key saved there earlier into the CLI's config for an agent created on the
|
|
132
|
+
* sign-in tab, which then ran on that key (401).
|
|
134
133
|
*/
|
|
135
134
|
_configureAgentNativeAuth(agentType, agentEnv, agentName) {
|
|
136
135
|
const typeEnv = typeEnvFor(agentType, this.env.load(agentType), this.registry, agentEnv);
|
|
137
136
|
this._configureNativeAuth(agentType, { ...typeEnv, ...agentEnv }, agentName);
|
|
138
137
|
// A Hermes agent moved to the `hermes setup` sign-in gets back the
|
|
139
|
-
// provider
|
|
138
|
+
// provider an earlier version's custom endpoint replaced. (A keyed Hermes
|
|
139
|
+
// agent writes its own provider when it runs: HermesAdapter._endpoint.)
|
|
140
140
|
if (agentType === 'hermes' && isCliLogin(agentEnv)) {
|
|
141
141
|
try { require('./adapters/hermes').restoreNativeAuth(); } catch {}
|
|
142
142
|
}
|
|
@@ -151,12 +151,6 @@ class AgentConnector {
|
|
|
151
151
|
? OpenClawAdapter.instanceEnv(agentName, env, this._configDir)
|
|
152
152
|
: env);
|
|
153
153
|
}
|
|
154
|
-
// Hermes reads a custom endpoint only from its own config.yaml, so the
|
|
155
|
-
// saved LLM_* values must be pushed through `hermes config set` — the
|
|
156
|
-
// env file alone leaves it "No inference provider configured".
|
|
157
|
-
if (agentType === 'hermes') {
|
|
158
|
-
require('./adapters/hermes').configureNativeAuth(env);
|
|
159
|
-
}
|
|
160
154
|
} catch {}
|
|
161
155
|
}
|
|
162
156
|
|
package/src/install-preflight.js
CHANGED
|
@@ -255,16 +255,35 @@ const PROBES = {
|
|
|
255
255
|
uv: { probe: probeUv, remedy: uvRemedy },
|
|
256
256
|
};
|
|
257
257
|
|
|
258
|
+
/** Registry platform names, as the `install` commands are keyed. */
|
|
259
|
+
const REGISTRY_PLATFORM = { darwin: 'macos', linux: 'linux', win32: 'windows' };
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Whether `install.requires_on` limits a dependency to other platforms.
|
|
263
|
+
* Claude Code needs git only on Windows (it runs its shell through Git Bash);
|
|
264
|
+
* the npm install on macOS and Linux never touches git, yet a mac without the
|
|
265
|
+
* Command Line Tools was told to install them before it could get Claude.
|
|
266
|
+
* A separate field rather than a suffix inside `requires`, so an older core
|
|
267
|
+
* reading the same catalog keeps checking git everywhere instead of nowhere.
|
|
268
|
+
*/
|
|
269
|
+
function requiredHere(entry, name, platform) {
|
|
270
|
+
const only = entry.install.requires_on && entry.install.requires_on[name];
|
|
271
|
+
if (!Array.isArray(only)) return true;
|
|
272
|
+
return only.includes(REGISTRY_PLATFORM[platform] || platform);
|
|
273
|
+
}
|
|
274
|
+
|
|
258
275
|
/**
|
|
259
276
|
* Check a registry entry's `install.requires` against the machine.
|
|
277
|
+
* @param {string} [platform] - seam for tests; production passes nothing.
|
|
260
278
|
* @returns {{ ok: boolean, missing: Array<{name: string, action: string|null, summary: string, command: string, alternative: string|null}> }}
|
|
261
279
|
*/
|
|
262
|
-
function checkInstallPrereqs(entry) {
|
|
280
|
+
function checkInstallPrereqs(entry, platform = process.platform) {
|
|
263
281
|
const requires = entry && entry.install ? entry.install.requires : null;
|
|
264
282
|
if (!Array.isArray(requires) || requires.length === 0) return { ok: true, missing: [] };
|
|
265
283
|
|
|
266
284
|
const missing = [];
|
|
267
285
|
for (const name of requires) {
|
|
286
|
+
if (!requiredHere(entry, name, platform)) continue;
|
|
268
287
|
const spec = PROBES[String(name || '').toLowerCase()];
|
|
269
288
|
if (!spec) continue; // no probe → the installer's problem, not ours
|
|
270
289
|
let result;
|
package/src/paths.js
CHANGED
|
@@ -869,6 +869,12 @@ function _addWindowsPaths(dirs) {
|
|
|
869
869
|
// Node.js install
|
|
870
870
|
_push(dirs, path.join(programFiles, 'nodejs'));
|
|
871
871
|
|
|
872
|
+
// Kiro CLI — install.ps1 runs an MSI that installs kiro-cli.exe into
|
|
873
|
+
// %ProgramFiles%\Kiro-Cli and edits the machine PATH, which an
|
|
874
|
+
// already-running daemon never sees. (install.sh uses ~/.local/bin, or
|
|
875
|
+
// /usr/local/bin for a system-wide install — both searched already.)
|
|
876
|
+
_push(dirs, path.join(programFiles, 'Kiro-Cli'));
|
|
877
|
+
|
|
872
878
|
// nvm for Windows
|
|
873
879
|
const nvmHome = process.env.NVM_HOME;
|
|
874
880
|
if (nvmHome) {
|
package/src/utils.js
CHANGED
|
@@ -82,10 +82,22 @@ async function servedModels(apiBase, headers) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/**
|
|
86
|
+
* The test asks for a few tokens to stay cheap. A reasoning model can spend
|
|
87
|
+
* them all thinking, and OpenAI then refuses with "Could not finish the message
|
|
88
|
+
* because max_tokens or model output limit was reached". The key and the model
|
|
89
|
+
* were both accepted, which is everything this test checks, and reporting it as
|
|
90
|
+
* a failure marked an agent that works as broken.
|
|
91
|
+
*/
|
|
92
|
+
const OUTPUT_LIMIT_REACHED = /max_tokens or model output limit was reached/i;
|
|
93
|
+
|
|
85
94
|
/** Read one completion response into the result shape. */
|
|
86
95
|
function completionResult(res, { isAnthropic, model }) {
|
|
87
96
|
if (res.error) return { success: false, error: res.error };
|
|
88
97
|
const { status, data } = res;
|
|
98
|
+
if (status >= 400 && OUTPUT_LIMIT_REACHED.test(data || '')) {
|
|
99
|
+
return { success: true, model: model || '?', response: '' };
|
|
100
|
+
}
|
|
89
101
|
try {
|
|
90
102
|
const parsed = JSON.parse(data);
|
|
91
103
|
let text, usedModel;
|