opentool 0.8.15 → 0.8.18

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { M as Metadata, I as InternalToolDefinition } from '../validate-DTnps_0I.js';
3
- export { G as GenerateMetadataOptions, a as GenerateMetadataResult, V as ValidateOptions, b as generateMetadata, g as generateMetadataCommand, l as loadAndValidateTools, v as validateCommand, c as validateFullCommand } from '../validate-DTnps_0I.js';
2
+ import { M as Metadata, I as InternalToolDefinition } from '../validate-DsvADI66.js';
3
+ export { G as GenerateMetadataOptions, a as GenerateMetadataResult, V as ValidateOptions, b as generateMetadata, g as generateMetadataCommand, l as loadAndValidateTools, v as validateCommand, c as validateFullCommand } from '../validate-DsvADI66.js';
4
4
  import 'zod';
5
5
  import '../x402/index.js';
6
6
  import 'viem';
package/dist/cli/index.js CHANGED
@@ -1171,8 +1171,39 @@ async function loadAndValidateTools(toolsDir, options = {}) {
1171
1171
  `${file}: profile.assets[${index}].pair must be a non-empty string when provided.`
1172
1172
  );
1173
1173
  }
1174
+ const leverage = record.leverage;
1175
+ if (leverage !== void 0 && (typeof leverage !== "number" || !Number.isFinite(leverage) || leverage <= 0)) {
1176
+ throw new Error(
1177
+ `${file}: profile.assets[${index}].leverage must be a positive number when provided.`
1178
+ );
1179
+ }
1174
1180
  });
1175
1181
  }
1182
+ const templateConfigRaw = toolModule?.profile?.templateConfig;
1183
+ if (templateConfigRaw !== void 0) {
1184
+ if (!templateConfigRaw || typeof templateConfigRaw !== "object") {
1185
+ throw new Error(`${file}: profile.templateConfig must be an object.`);
1186
+ }
1187
+ const record = templateConfigRaw;
1188
+ const version = record.version;
1189
+ if (typeof version !== "string" && typeof version !== "number") {
1190
+ throw new Error(
1191
+ `${file}: profile.templateConfig.version must be a string or number.`
1192
+ );
1193
+ }
1194
+ const schema2 = record.schema;
1195
+ if (schema2 !== void 0 && (!schema2 || typeof schema2 !== "object" || Array.isArray(schema2))) {
1196
+ throw new Error(
1197
+ `${file}: profile.templateConfig.schema must be an object when provided.`
1198
+ );
1199
+ }
1200
+ const defaults = record.defaults;
1201
+ if (defaults !== void 0 && (!defaults || typeof defaults !== "object" || Array.isArray(defaults))) {
1202
+ throw new Error(
1203
+ `${file}: profile.templateConfig.defaults must be an object when provided.`
1204
+ );
1205
+ }
1206
+ }
1176
1207
  if (hasGET && schedule && typeof schedule.cron === "string" && schedule.cron.trim().length > 0) {
1177
1208
  normalizedSchedule = normalizeScheduleExpression(schedule.cron, file);
1178
1209
  if (typeof schedule.enabled === "boolean") {