@elisym/cli 0.21.1 → 0.21.2
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/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -242,6 +242,7 @@ async function verifyKeyDeep(apiKey, model, signal) {
|
|
|
242
242
|
return {
|
|
243
243
|
ok: false,
|
|
244
244
|
reason: "unavailable",
|
|
245
|
+
status: response.status,
|
|
245
246
|
error: `HTTP ${response.status}: ${body.slice(0, 200)}`
|
|
246
247
|
};
|
|
247
248
|
} catch (error) {
|
|
@@ -490,6 +491,7 @@ function createOpenAICompatibleProvider(config) {
|
|
|
490
491
|
return {
|
|
491
492
|
ok: false,
|
|
492
493
|
reason: "unavailable",
|
|
494
|
+
status: response.status,
|
|
493
495
|
error: `HTTP ${response.status}: ${body.slice(0, 200)}`
|
|
494
496
|
};
|
|
495
497
|
} catch (error) {
|
|
@@ -790,6 +792,7 @@ async function verifyKeyDeep2(apiKey, model, signal) {
|
|
|
790
792
|
return {
|
|
791
793
|
ok: false,
|
|
792
794
|
reason: "unavailable",
|
|
795
|
+
status: response.status,
|
|
793
796
|
error: `HTTP ${response.status}: ${body.slice(0, 200)}`
|
|
794
797
|
};
|
|
795
798
|
} catch (error) {
|
|
@@ -3974,6 +3977,7 @@ async function cmdStart(nameArg, options = {}) {
|
|
|
3974
3977
|
(skill) => skill.mode !== "llm" && skill.llmOverride?.provider && skill.llmOverride?.model
|
|
3975
3978
|
);
|
|
3976
3979
|
const monitorPairs = /* @__PURE__ */ new Map();
|
|
3980
|
+
const retiredModels = /* @__PURE__ */ new Set();
|
|
3977
3981
|
const triplesByKey = /* @__PURE__ */ new Map();
|
|
3978
3982
|
const dependentSkillsByProvider = /* @__PURE__ */ new Map();
|
|
3979
3983
|
let agentDefaultCacheKey;
|
|
@@ -4070,7 +4074,10 @@ async function cmdStart(nameArg, options = {}) {
|
|
|
4070
4074
|
model: pair.model,
|
|
4071
4075
|
verifyFn
|
|
4072
4076
|
});
|
|
4073
|
-
|
|
4077
|
+
const modelRetired = !verification.ok && verification.reason === "unavailable" && verification.status === 404;
|
|
4078
|
+
if (!modelRetired) {
|
|
4079
|
+
healthMonitor.seed(pair.provider, pair.model, verification);
|
|
4080
|
+
}
|
|
4074
4081
|
if (verification.ok) {
|
|
4075
4082
|
console.log("ok");
|
|
4076
4083
|
} else if (verification.reason === "invalid") {
|
|
@@ -4092,6 +4099,13 @@ async function cmdStart(nameArg, options = {}) {
|
|
|
4092
4099
|
`
|
|
4093
4100
|
);
|
|
4094
4101
|
process.exit(1);
|
|
4102
|
+
} else if (verification.status === 404) {
|
|
4103
|
+
console.log("retired");
|
|
4104
|
+
console.error(
|
|
4105
|
+
` ! ${pair.provider} model "${pair.model}" no longer exists (HTTP 404). Update its model: in the SKILL.md / elisym.yaml. Skills using it will not be advertised.
|
|
4106
|
+
`
|
|
4107
|
+
);
|
|
4108
|
+
retiredModels.add(`${pair.provider}::${pair.model}`);
|
|
4095
4109
|
} else {
|
|
4096
4110
|
console.log("unavailable");
|
|
4097
4111
|
console.warn(
|
|
@@ -4282,8 +4296,26 @@ async function cmdStart(nameArg, options = {}) {
|
|
|
4282
4296
|
} : void 0
|
|
4283
4297
|
};
|
|
4284
4298
|
}
|
|
4299
|
+
function retiredModelKeyForSkill(skill) {
|
|
4300
|
+
if (skill.resolvedTriple) {
|
|
4301
|
+
return `${skill.resolvedTriple.provider}::${skill.resolvedTriple.model}`;
|
|
4302
|
+
}
|
|
4303
|
+
if (skill.llmOverride?.provider && skill.llmOverride?.model) {
|
|
4304
|
+
return `${skill.llmOverride.provider}::${skill.llmOverride.model}`;
|
|
4305
|
+
}
|
|
4306
|
+
return void 0;
|
|
4307
|
+
}
|
|
4285
4308
|
let cardsPublished = 0;
|
|
4286
4309
|
for (const skill of allSkills) {
|
|
4310
|
+
const modelKey = retiredModelKeyForSkill(skill);
|
|
4311
|
+
if (modelKey && retiredModels.has(modelKey)) {
|
|
4312
|
+
console.warn(` ! Not advertising "${skill.name}" - its model was retired (HTTP 404).`);
|
|
4313
|
+
logger.warn(
|
|
4314
|
+
{ event: "publish_skipped_retired", kind: 31990, skill: skill.name, model: modelKey },
|
|
4315
|
+
"capability not advertised - model retired"
|
|
4316
|
+
);
|
|
4317
|
+
continue;
|
|
4318
|
+
}
|
|
4287
4319
|
try {
|
|
4288
4320
|
await client.discovery.publishCapability(identity, buildCard(skill), kinds);
|
|
4289
4321
|
cardsPublished += 1;
|