@openagents-org/agent-launcher 0.2.210 → 0.2.211

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/src/probe.js CHANGED
@@ -587,7 +587,50 @@ async function probeAgentType(connector, type, opts = {}) {
587
587
 
588
588
  // ── Live tier 2: direct LLM API call for API-key agents (e.g. OpenClaw) ──
589
589
  if (canCallDirect || (entry.install && entry.install.api_only && reachable)) {
590
- const res = await callLLM(agentEnv, model, baseUrl, protocol);
590
+ let apiEnv = agentEnv;
591
+ let apiModel = model;
592
+ let apiBaseUrl = baseUrl;
593
+ if (type === 'mimo-code' && agentEnv.LLM_API_KEY) {
594
+ // The runtime owns MiMo's defaults and provider/model normalization.
595
+ // Generic API defaults would send a MiMo key/model to OpenAI instead.
596
+ const { resolveMimoRoute, parseMimoModelList, pickMimoModel } = require('./adapters/mimo-code-runtime');
597
+ let route = resolveMimoRoute(agentEnv);
598
+ if (!route.model && route.providerId === 'xiaomi' && health.binary) {
599
+ const listEnv = { ...env };
600
+ delete listEnv.LLM_API_KEY;
601
+ delete listEnv.XIAOMI_API_KEY;
602
+ const shell = shouldUseShellForBinary(health.binary);
603
+ const command = shell ? '"' + health.binary + '"' : health.binary;
604
+ const listed = await runCommand(command, ['models', 'xiaomi'], {
605
+ env: {
606
+ ...listEnv,
607
+ MIMOCODE_AUTH_CONTENT: '{}',
608
+ MIMOCODE_CONFIG_CONTENT: JSON.stringify({ enabled_providers: ['xiaomi'], disabled_providers: [] }),
609
+ MIMOCODE_DISABLE_AUTOUPDATE: '1',
610
+ },
611
+ timeoutMs,
612
+ shell,
613
+ });
614
+ if (!listed.timedOut && !listed.spawnError && listed.code === 0) {
615
+ route = resolveMimoRoute(agentEnv, null, {
616
+ fallbackModel: pickMimoModel(parseMimoModelList(listed.stdout)),
617
+ });
618
+ }
619
+ }
620
+ if (!route.model) {
621
+ return done({
622
+ ok: false, method: 'none', code: CODE.BAD_MODEL,
623
+ message: 'No model is configured and no default model could be resolved. Select a model and test again.',
624
+ guidance: buildGuidance(CODE.BAD_MODEL, entry, agentEnv),
625
+ });
626
+ }
627
+ // Match the runtime's credential choice, even if unrelated provider
628
+ // variables were saved alongside this agent's LLM_* configuration.
629
+ apiEnv = { LLM_API_KEY: route.apiKey, LLM_BASE_URL: route.baseURL, LLM_MODEL: route.model };
630
+ apiModel = route.model;
631
+ apiBaseUrl = route.baseURL;
632
+ }
633
+ const res = await callLLM(apiEnv, apiModel, apiBaseUrl, protocol);
591
634
  if (res && res.success) {
592
635
  return done({
593
636
  ok: true, method: 'llm_api', code: CODE.OK,
@@ -627,11 +627,12 @@ class WorkspaceClient {
627
627
  * Skill Hub UI can render installing / installed / failed states. Best
628
628
  * effort — returns the updated payload or throws (caller decides).
629
629
  */
630
- async reportSkillStatus(workspaceId, agentName, token, { skillId, state, path: installPath, error, partial } = {}) {
630
+ async reportSkillStatus(workspaceId, agentName, token, { skillId, state, path: installPath, error, partial, versionId } = {}) {
631
631
  const body = { skill_id: skillId, state };
632
632
  if (installPath) body.path = installPath;
633
633
  if (error) body.error = String(error).slice(0, 2000);
634
634
  if (partial) body.partial = true;
635
+ if (versionId) body.version_id = versionId;
635
636
  const data = await this._post(
636
637
  `/v1/workspaces/${workspaceId}/members/${encodeURIComponent(agentName)}/skills/status`,
637
638
  body,
@@ -815,6 +816,16 @@ class WorkspaceClient {
815
816
  return this._getRaw(`/v1/files/${fileId}?${params}`, this._wsHeaders(token), 60000);
816
817
  }
817
818
 
819
+ /** Download an immutable public registry version. */
820
+ async readRegistryVersion(versionId, token) {
821
+ if (!versionId) throw new Error('registry version id is required');
822
+ return this._getRaw(
823
+ `/v1/registry/versions/${encodeURIComponent(versionId)}/download`,
824
+ this._wsHeaders(token),
825
+ 60000,
826
+ );
827
+ }
828
+
818
829
  /**
819
830
  * Delete a file via DELETE /v1/files/{fileId}.
820
831
  */