opentool 0.8.23 → 0.8.25
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/adapters/hyperliquid/index.d.ts +161 -3
- package/dist/adapters/hyperliquid/index.js +1036 -24
- package/dist/adapters/hyperliquid/index.js.map +1 -1
- package/dist/cli/index.js +31 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1067 -26
- package/dist/index.js.map +1 -1
- package/dist/store/index.d.ts +6 -2
- package/dist/store/index.js +92 -7
- package/dist/store/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/base/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1001,6 +1001,29 @@ var SUPPORTED_EXTENSIONS = [
|
|
|
1001
1001
|
".mjs",
|
|
1002
1002
|
".cjs"
|
|
1003
1003
|
];
|
|
1004
|
+
var MIN_TEMPLATE_CONFIG_VERSION = 2;
|
|
1005
|
+
function normalizeTemplateConfigVersion(value) {
|
|
1006
|
+
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1007
|
+
return value;
|
|
1008
|
+
}
|
|
1009
|
+
if (typeof value !== "string") {
|
|
1010
|
+
return null;
|
|
1011
|
+
}
|
|
1012
|
+
const trimmed = value.trim();
|
|
1013
|
+
if (!trimmed) {
|
|
1014
|
+
return null;
|
|
1015
|
+
}
|
|
1016
|
+
if (/^\d+(?:\.\d+)?$/.test(trimmed)) {
|
|
1017
|
+
const numeric = Number.parseFloat(trimmed);
|
|
1018
|
+
return Number.isFinite(numeric) ? numeric : null;
|
|
1019
|
+
}
|
|
1020
|
+
const majorMatch = /^v?(\d+)(?:\..*)?$/i.exec(trimmed);
|
|
1021
|
+
if (!majorMatch) {
|
|
1022
|
+
return null;
|
|
1023
|
+
}
|
|
1024
|
+
const major = Number.parseInt(majorMatch[1], 10);
|
|
1025
|
+
return Number.isFinite(major) ? major : null;
|
|
1026
|
+
}
|
|
1004
1027
|
async function validateCommand(options) {
|
|
1005
1028
|
console.log("\u{1F50D} Validating OpenTool metadata...");
|
|
1006
1029
|
try {
|
|
@@ -1186,9 +1209,15 @@ async function loadAndValidateTools(toolsDir, options = {}) {
|
|
|
1186
1209
|
}
|
|
1187
1210
|
const record = templateConfigRaw;
|
|
1188
1211
|
const version = record.version;
|
|
1189
|
-
|
|
1212
|
+
const normalizedTemplateConfigVersion = normalizeTemplateConfigVersion(version);
|
|
1213
|
+
if (normalizedTemplateConfigVersion === null) {
|
|
1214
|
+
throw new Error(
|
|
1215
|
+
`${file}: profile.templateConfig.version must be a numeric string or number.`
|
|
1216
|
+
);
|
|
1217
|
+
}
|
|
1218
|
+
if (normalizedTemplateConfigVersion < MIN_TEMPLATE_CONFIG_VERSION) {
|
|
1190
1219
|
throw new Error(
|
|
1191
|
-
`${file}: profile.templateConfig.version must be
|
|
1220
|
+
`${file}: profile.templateConfig.version must be >= ${MIN_TEMPLATE_CONFIG_VERSION}.`
|
|
1192
1221
|
);
|
|
1193
1222
|
}
|
|
1194
1223
|
const schema2 = record.schema;
|