opentool 0.8.13 → 0.8.14

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-CilU0rkD.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-CilU0rkD.js';
2
+ import { M as Metadata, I as InternalToolDefinition } from '../validate-CQNmvjez.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-CQNmvjez.js';
4
4
  import 'zod';
5
5
  import '../x402/index.js';
6
6
  import 'viem';
package/dist/cli/index.js CHANGED
@@ -1121,6 +1121,52 @@ async function loadAndValidateTools(toolsDir, options = {}) {
1121
1121
  `${file}: profile.category must be one of ${Array.from(allowedProfileCategories).join(", ")}`
1122
1122
  );
1123
1123
  }
1124
+ const profileAssetsRaw = toolModule?.profile?.assets;
1125
+ if (profileAssetsRaw !== void 0) {
1126
+ if (!Array.isArray(profileAssetsRaw)) {
1127
+ throw new Error(`${file}: profile.assets must be an array.`);
1128
+ }
1129
+ profileAssetsRaw.forEach((entry, index) => {
1130
+ if (!entry || typeof entry !== "object") {
1131
+ throw new Error(
1132
+ `${file}: profile.assets[${index}] must be an object.`
1133
+ );
1134
+ }
1135
+ const record = entry;
1136
+ const venue = typeof record.venue === "string" ? record.venue.trim() : "";
1137
+ if (!venue) {
1138
+ throw new Error(
1139
+ `${file}: profile.assets[${index}].venue must be a non-empty string.`
1140
+ );
1141
+ }
1142
+ const chain = record.chain;
1143
+ if (typeof chain !== "string" && typeof chain !== "number") {
1144
+ throw new Error(
1145
+ `${file}: profile.assets[${index}].chain must be a string or number.`
1146
+ );
1147
+ }
1148
+ const symbols = record.assetSymbols;
1149
+ if (!Array.isArray(symbols) || symbols.length === 0) {
1150
+ throw new Error(
1151
+ `${file}: profile.assets[${index}].assetSymbols must be a non-empty array.`
1152
+ );
1153
+ }
1154
+ const invalidSymbol = symbols.find(
1155
+ (symbol) => typeof symbol !== "string" || symbol.trim().length === 0
1156
+ );
1157
+ if (invalidSymbol !== void 0) {
1158
+ throw new Error(
1159
+ `${file}: profile.assets[${index}].assetSymbols must be non-empty strings.`
1160
+ );
1161
+ }
1162
+ const walletAddress = record.walletAddress;
1163
+ if (walletAddress !== void 0 && (typeof walletAddress !== "string" || walletAddress.trim().length === 0)) {
1164
+ throw new Error(
1165
+ `${file}: profile.assets[${index}].walletAddress must be a non-empty string when provided.`
1166
+ );
1167
+ }
1168
+ });
1169
+ }
1124
1170
  if (hasGET && schedule && typeof schedule.cron === "string" && schedule.cron.trim().length > 0) {
1125
1171
  normalizedSchedule = normalizeScheduleExpression(schedule.cron, file);
1126
1172
  if (typeof schedule.enabled === "boolean") {