@shop-os/modelkit 0.2.3 → 0.2.4
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/CHANGELOG.md +5 -0
- package/dist/catalog.cjs +16 -13
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.js +16 -13
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +16 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,11 @@ header in the release PR.
|
|
|
9
9
|
|
|
10
10
|
## [Unreleased]
|
|
11
11
|
|
|
12
|
+
## [0.2.4] - 2026-09-15
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
- Catalog prime and fallback log lines carry origin, row count, revision and the error in the message string. pino-style loggers dropped the trailing object argument, so services such as template-service logged no origin.
|
|
16
|
+
|
|
12
17
|
## [0.2.3] - 2026-09-15
|
|
13
18
|
|
|
14
19
|
### Changed
|
package/dist/catalog.cjs
CHANGED
|
@@ -306,7 +306,6 @@ var IMAGE_MODELS = [
|
|
|
306
306
|
pricingKind: "image_size",
|
|
307
307
|
display: {
|
|
308
308
|
provider: "openai",
|
|
309
|
-
sortOrder: 20,
|
|
310
309
|
description: "OpenAI's most capable GPT Image 2.5 tier, built for editing precision; takes text and image input and outputs images in low, medium, high, xhigh, or max quality."
|
|
311
310
|
}
|
|
312
311
|
},
|
|
@@ -341,7 +340,6 @@ var IMAGE_MODELS = [
|
|
|
341
340
|
pricingKind: "image_size",
|
|
342
341
|
display: {
|
|
343
342
|
provider: "openai",
|
|
344
|
-
sortOrder: 10,
|
|
345
343
|
description: "OpenAI's fastest GPT Image 2.5 tier for high-quality everyday image generation and editing; takes text and image input and outputs images."
|
|
346
344
|
}
|
|
347
345
|
},
|
|
@@ -2099,13 +2097,14 @@ function toEnvelope(data) {
|
|
|
2099
2097
|
if (data.revision !== void 0) envelope.revision = data.revision;
|
|
2100
2098
|
return envelope;
|
|
2101
2099
|
}
|
|
2100
|
+
function describeError(err) {
|
|
2101
|
+
return err instanceof Error ? err.message : String(err);
|
|
2102
|
+
}
|
|
2102
2103
|
function logPrimed(logger, result) {
|
|
2103
|
-
const
|
|
2104
|
-
logger.info(
|
|
2105
|
-
origin
|
|
2106
|
-
|
|
2107
|
-
revision: loggedRevision
|
|
2108
|
-
});
|
|
2104
|
+
const revision = result.revision === void 0 ? "" : ` revision=${result.revision}`;
|
|
2105
|
+
logger.info(
|
|
2106
|
+
`[modelkit] catalog primed origin=${result.origin} rowCount=${result.rowCount}${revision}`
|
|
2107
|
+
);
|
|
2109
2108
|
}
|
|
2110
2109
|
async function fetchRemote(source, logger) {
|
|
2111
2110
|
const fetchImpl = source.fetch ?? globalThis.fetch;
|
|
@@ -2129,7 +2128,7 @@ async function writeCache(source, logger, rows, rev) {
|
|
|
2129
2128
|
try {
|
|
2130
2129
|
await source.cache.set(JSON.stringify({ rows, revision: rev }));
|
|
2131
2130
|
} catch (err) {
|
|
2132
|
-
logger.warn(
|
|
2131
|
+
logger.warn(`[modelkit] catalog cache write failed: ${describeError(err)}`);
|
|
2133
2132
|
}
|
|
2134
2133
|
}
|
|
2135
2134
|
async function prime(source, logger) {
|
|
@@ -2150,8 +2149,8 @@ async function prime(source, logger) {
|
|
|
2150
2149
|
logPrimed(logger, result);
|
|
2151
2150
|
return result;
|
|
2152
2151
|
} catch (err) {
|
|
2153
|
-
logger.warn(
|
|
2154
|
-
const error =
|
|
2152
|
+
logger.warn(`[modelkit] catalog remote failed, trying cache: ${describeError(err)}`);
|
|
2153
|
+
const error = describeError(err);
|
|
2155
2154
|
try {
|
|
2156
2155
|
const cached = await source.cache?.get();
|
|
2157
2156
|
if (!cached) throw new Error("no cached catalog");
|
|
@@ -2170,7 +2169,9 @@ async function prime(source, logger) {
|
|
|
2170
2169
|
logPrimed(logger, result);
|
|
2171
2170
|
return result;
|
|
2172
2171
|
} catch (cacheErr) {
|
|
2173
|
-
logger.warn(
|
|
2172
|
+
logger.warn(
|
|
2173
|
+
`[modelkit] catalog cache failed, using snapshot: ${describeError(cacheErr)}`
|
|
2174
|
+
);
|
|
2174
2175
|
liveCatalog.replace([...MODELS]);
|
|
2175
2176
|
liveState.origin = "snapshot";
|
|
2176
2177
|
liveState.revision = void 0;
|
|
@@ -2193,7 +2194,9 @@ async function refresh(source, logger) {
|
|
|
2193
2194
|
liveState.revision = fetched.revision;
|
|
2194
2195
|
await writeCache(source, logger, fetched.rows, fetched.revision);
|
|
2195
2196
|
} catch (err) {
|
|
2196
|
-
logger.warn(
|
|
2197
|
+
logger.warn(
|
|
2198
|
+
`[modelkit] catalog refresh failed, keeping current rows: ${describeError(err)}`
|
|
2199
|
+
);
|
|
2197
2200
|
}
|
|
2198
2201
|
}
|
|
2199
2202
|
function primeCatalog(source) {
|