opentool 0.8.25 → 0.8.28
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/README.md +14 -0
- package/dist/adapters/hyperliquid/index.d.ts +21 -1
- package/dist/adapters/hyperliquid/index.js +24 -1
- package/dist/adapters/hyperliquid/index.js.map +1 -1
- package/dist/cli/index.d.ts +2 -2
- package/dist/cli/index.js +95 -12
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +119 -13
- package/dist/index.js.map +1 -1
- package/dist/{validate-C4a9tmrQ.d.ts → validate-3WEA0Ezt.d.ts} +7 -1
- package/package.json +2 -2
- package/templates/base/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
2
|
-
import { I as InternalToolDefinition, T as ToolResponse } from './validate-
|
|
3
|
-
export { B as BuildConfig, m as BuildMetadata, p as ConnectedApp, C as CronSpec,
|
|
2
|
+
import { I as InternalToolDefinition, T as ToolResponse } from './validate-3WEA0Ezt.js';
|
|
3
|
+
export { B as BuildConfig, m as BuildMetadata, p as ConnectedApp, C as CronSpec, s as GetHandler, H as HTTP_METHODS, f as HttpHandlerDefinition, e as HttpMethod, h as McpConfig, M as Metadata, N as NormalizedSchedule, P as PaymentConfig, t as PostHandler, S as ScheduleType, i as ServerConfig, q as TemplatePreviewProfile, j as Tool, o as ToolAsset, n as ToolCategory, d as ToolContent, k as ToolMetadataOverrides, x as ToolModule, u as ToolModuleGET, w as ToolModulePOST, r as ToolProfile, b as generateMetadata, g as generateMetadataCommand, l as loadAndValidateTools, v as validateCommand } from './validate-3WEA0Ezt.js';
|
|
4
4
|
export { CurrencySpec, DEFAULT_FACILITATOR, DefineX402PaymentConfig, EIP3009Authorization, PAYMENT_HEADERS, RequireX402PaymentOptions, RequireX402PaymentOutcome, RequireX402PaymentSuccess, SUPPORTED_CURRENCIES, X402BrowserClient, X402BrowserClientConfig, X402Client, X402ClientConfig, X402FacilitatorConfig, X402PayRequest, X402PayResult, X402Payment, X402PaymentContext, X402PaymentDefinition, X402PaymentRequiredError, X402VerificationResult, defineX402Payment, getX402PaymentContext, payX402, payX402WithWallet, requireX402Payment, withX402Payment } from './x402/index.js';
|
|
5
5
|
export { DEFAULT_CHAIN, DEFAULT_TOKENS, chains, getRpcUrl, registry, tokens, wallet, walletToolkit } from './wallet/index.js';
|
|
6
|
-
export { DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, HyperliquidAbstraction, HyperliquidAccountMode, HyperliquidApiError, HyperliquidApproveBuilderFeeOptions, HyperliquidApproveBuilderFeeResponse, HyperliquidBuilderApprovalError, HyperliquidBuilderApprovalRecordInput, HyperliquidBuilderFee, HyperliquidChain, HyperliquidClearinghouseState, HyperliquidDepositResult, HyperliquidEnvironment, HyperliquidExchangeClient, HyperliquidExchangeResponse, HyperliquidGrouping, HyperliquidGuardError, HyperliquidInfoClient, HyperliquidMarketIdentityInput, HyperliquidMarketType, HyperliquidOrderIntent, HyperliquidOrderOptions, HyperliquidOrderResponse, HyperliquidOrderStatus, HyperliquidPerpMarketInfo, HyperliquidSpotMarketInfo, HyperliquidStoreNetwork, HyperliquidTermsError, HyperliquidTermsRecordInput, HyperliquidTickSize, HyperliquidTimeInForce, HyperliquidTriggerOptions, HyperliquidTriggerType, HyperliquidWithdrawResult, MarketIdentity, NonceSource, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, batchModifyHyperliquidOrders, buildHyperliquidMarketIdentity, buildHyperliquidSpotUsdPriceMap, cancelAllHyperliquidOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, computeHyperliquidMarketIocLimitPrice, createHyperliquidSubAccount, createMonotonicNonceFactory, depositToHyperliquidBridge, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, getHyperliquidMaxBuilderFee, isHyperliquidSpotSymbol, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidMetaSymbol, normalizeSpotTokenName, parseSpotPairSymbol, placeHyperliquidOrder, placeHyperliquidTwapOrder, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, reserveHyperliquidRequestWeight, resolveHyperliquidAbstractionFromMode, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidErrorDetail, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidRpcEnvVar, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolveSpotMidCandidates, resolveSpotTokenCandidates, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidDexAbstraction, setHyperliquidPortfolioMargin, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, withdrawFromHyperliquid } from './adapters/hyperliquid/index.js';
|
|
6
|
+
export { DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, HyperliquidAbstraction, HyperliquidAccountMode, HyperliquidApiError, HyperliquidApproveBuilderFeeOptions, HyperliquidApproveBuilderFeeResponse, HyperliquidBuilderApprovalError, HyperliquidBuilderApprovalRecordInput, HyperliquidBuilderFee, HyperliquidChain, HyperliquidClearinghouseState, HyperliquidDepositResult, HyperliquidEnvironment, HyperliquidExchangeClient, HyperliquidExchangeResponse, HyperliquidGrouping, HyperliquidGuardError, HyperliquidInfoClient, HyperliquidMarketIdentityInput, HyperliquidMarketType, HyperliquidOrderIntent, HyperliquidOrderOptions, HyperliquidOrderResponse, HyperliquidOrderStatus, HyperliquidPerpMarketInfo, HyperliquidProfileAsset, HyperliquidProfileAssetInput, HyperliquidProfileChain, HyperliquidSpotMarketInfo, HyperliquidStoreNetwork, HyperliquidTermsError, HyperliquidTermsRecordInput, HyperliquidTickSize, HyperliquidTimeInForce, HyperliquidTriggerOptions, HyperliquidTriggerType, HyperliquidWithdrawResult, MarketIdentity, NonceSource, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, batchModifyHyperliquidOrders, buildHyperliquidMarketIdentity, buildHyperliquidProfileAssets, buildHyperliquidSpotUsdPriceMap, cancelAllHyperliquidOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, computeHyperliquidMarketIocLimitPrice, createHyperliquidSubAccount, createMonotonicNonceFactory, depositToHyperliquidBridge, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, getHyperliquidMaxBuilderFee, isHyperliquidSpotSymbol, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidMetaSymbol, normalizeSpotTokenName, parseSpotPairSymbol, placeHyperliquidOrder, placeHyperliquidTwapOrder, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, reserveHyperliquidRequestWeight, resolveHyperliquidAbstractionFromMode, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidErrorDetail, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidProfileChain, resolveHyperliquidRpcEnvVar, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolveSpotMidCandidates, resolveSpotTokenCandidates, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidDexAbstraction, setHyperliquidPortfolioMargin, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, withdrawFromHyperliquid } from './adapters/hyperliquid/index.js';
|
|
7
7
|
import { c as WalletFullContext } from './types-BVLpaY4O.js';
|
|
8
8
|
export { C as ChainMetadata, i as ChainReference, a as ChainTokenMap, H as Hex, g as HexAddress, R as RpcProviderOptions, h as RpcUrlResolver, T as TokenMetadata, l as TurnkeyOptions, k as TurnkeySignWith, r as WalletBaseContext, s as WalletContext, n as WalletOptions, m as WalletOptionsBase, b as WalletPrivateKeyOptions, j as WalletProviderType, f as WalletReadonlyContext, e as WalletReadonlyOptions, W as WalletRegistry, o as WalletSendTransactionParams, q as WalletSignerContext, p as WalletTransferParams, d as WalletTurnkeyOptions } from './types-BVLpaY4O.js';
|
|
9
9
|
export { AIAbortError, AIClientConfig, AIError, AIFetchError, AIRequestMetadata, AIResponseError, ChatCompletionChoice, ChatCompletionLogProbs, ChatCompletionResponse, ChatCompletionUsage, ChatMessage, ChatMessageContentPart, ChatMessageContentPartImageUrl, ChatMessageContentPartText, ChatMessageRole, DEFAULT_BASE_URL, DEFAULT_MODEL, DEFAULT_TIMEOUT_MS, FunctionToolDefinition, GenerateTextOptions, GenerateTextResult, GenerationParameters, JsonSchema, ResolvedAIClientConfig, ResponseErrorDetails, StreamTextOptions, StreamTextResult, StreamingEventHandlers, ToolChoice, ToolDefinition, ToolExecutionPolicy, WEBSEARCH_TOOL_DEFINITION, WEBSEARCH_TOOL_NAME, WebSearchOptions, createAIClient, ensureTextContent, flattenMessageContent, generateText, getModelConfig, isStreamingSupported, isToolCallingSupported, listModels, normalizeModelName, resolveConfig, resolveToolset, streamText } from './ai/index.js';
|
package/dist/index.js
CHANGED
|
@@ -3505,6 +3505,29 @@ function resolveHyperliquidPair(value) {
|
|
|
3505
3505
|
}
|
|
3506
3506
|
return null;
|
|
3507
3507
|
}
|
|
3508
|
+
function resolveHyperliquidProfileChain(environment) {
|
|
3509
|
+
return environment === "testnet" ? "hyperliquid-testnet" : "hyperliquid";
|
|
3510
|
+
}
|
|
3511
|
+
function buildHyperliquidProfileAssets(params) {
|
|
3512
|
+
const chain = resolveHyperliquidProfileChain(params.environment);
|
|
3513
|
+
return params.assets.map((asset) => {
|
|
3514
|
+
const symbols = asset.assetSymbols.map((symbol) => normalizeHyperliquidBaseSymbol(symbol)).filter((symbol) => Boolean(symbol));
|
|
3515
|
+
if (symbols.length === 0) return null;
|
|
3516
|
+
const explicitPair = typeof asset.pair === "string" ? resolveHyperliquidPair(asset.pair) : null;
|
|
3517
|
+
const derivedPair = symbols.length === 1 ? resolveHyperliquidPair(asset.assetSymbols[0] ?? symbols[0]) : null;
|
|
3518
|
+
const pair = explicitPair ?? derivedPair ?? void 0;
|
|
3519
|
+
const leverage = typeof asset.leverage === "number" && Number.isFinite(asset.leverage) && asset.leverage > 0 ? asset.leverage : void 0;
|
|
3520
|
+
const walletAddress = typeof asset.walletAddress === "string" && asset.walletAddress.trim().length > 0 ? asset.walletAddress.trim() : void 0;
|
|
3521
|
+
return {
|
|
3522
|
+
venue: "hyperliquid",
|
|
3523
|
+
chain,
|
|
3524
|
+
assetSymbols: symbols,
|
|
3525
|
+
...pair ? { pair } : {},
|
|
3526
|
+
...leverage ? { leverage } : {},
|
|
3527
|
+
...walletAddress ? { walletAddress } : {}
|
|
3528
|
+
};
|
|
3529
|
+
}).filter((asset) => asset !== null);
|
|
3530
|
+
}
|
|
3508
3531
|
function parseSpotPairSymbol(symbol) {
|
|
3509
3532
|
const trimmed = symbol.trim();
|
|
3510
3533
|
if (!trimmed.includes("/")) return null;
|
|
@@ -6780,6 +6803,11 @@ var SUPPORTED_EXTENSIONS = [
|
|
|
6780
6803
|
".cjs"
|
|
6781
6804
|
];
|
|
6782
6805
|
var MIN_TEMPLATE_CONFIG_VERSION = 2;
|
|
6806
|
+
var TEMPLATE_PREVIEW_TITLE_MAX = 80;
|
|
6807
|
+
var TEMPLATE_PREVIEW_SUBTITLE_MAX = 120;
|
|
6808
|
+
var TEMPLATE_PREVIEW_DESCRIPTION_MAX = 1200;
|
|
6809
|
+
var TEMPLATE_PREVIEW_MIN_LINES = 3;
|
|
6810
|
+
var TEMPLATE_PREVIEW_MAX_LINES = 8;
|
|
6783
6811
|
function normalizeTemplateConfigVersion(value) {
|
|
6784
6812
|
if (typeof value === "number" && Number.isFinite(value)) {
|
|
6785
6813
|
return value;
|
|
@@ -6802,6 +6830,67 @@ function normalizeTemplateConfigVersion(value) {
|
|
|
6802
6830
|
const major = Number.parseInt(majorMatch[1], 10);
|
|
6803
6831
|
return Number.isFinite(major) ? major : null;
|
|
6804
6832
|
}
|
|
6833
|
+
function parseNonEmptyString(value, fieldPath, opts = {}) {
|
|
6834
|
+
const { max, required = false } = opts;
|
|
6835
|
+
if (value == null) {
|
|
6836
|
+
if (required) {
|
|
6837
|
+
throw new Error(`${fieldPath} is required and must be a non-empty string.`);
|
|
6838
|
+
}
|
|
6839
|
+
return null;
|
|
6840
|
+
}
|
|
6841
|
+
if (typeof value !== "string") {
|
|
6842
|
+
throw new Error(`${fieldPath} must be a string.`);
|
|
6843
|
+
}
|
|
6844
|
+
const trimmed = value.trim();
|
|
6845
|
+
if (!trimmed) {
|
|
6846
|
+
throw new Error(`${fieldPath} must be a non-empty string.`);
|
|
6847
|
+
}
|
|
6848
|
+
if (typeof max === "number" && trimmed.length > max) {
|
|
6849
|
+
throw new Error(`${fieldPath} must be <= ${max} characters.`);
|
|
6850
|
+
}
|
|
6851
|
+
return trimmed;
|
|
6852
|
+
}
|
|
6853
|
+
function normalizeTemplatePreview(value, file, toolName, requirePreview) {
|
|
6854
|
+
const pathPrefix = `${file}: profile.templatePreview`;
|
|
6855
|
+
if (value == null) {
|
|
6856
|
+
if (requirePreview) {
|
|
6857
|
+
throw new Error(
|
|
6858
|
+
`${pathPrefix} is required for strategy tools and must define subtitle + description.`
|
|
6859
|
+
);
|
|
6860
|
+
}
|
|
6861
|
+
return null;
|
|
6862
|
+
}
|
|
6863
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
6864
|
+
throw new Error(`${pathPrefix} must be an object.`);
|
|
6865
|
+
}
|
|
6866
|
+
const record = value;
|
|
6867
|
+
const title = parseNonEmptyString(record.title, `${pathPrefix}.title`, {
|
|
6868
|
+
max: TEMPLATE_PREVIEW_TITLE_MAX
|
|
6869
|
+
}) ?? toolName;
|
|
6870
|
+
const subtitle = parseNonEmptyString(record.subtitle, `${pathPrefix}.subtitle`, {
|
|
6871
|
+
required: true,
|
|
6872
|
+
max: TEMPLATE_PREVIEW_SUBTITLE_MAX
|
|
6873
|
+
});
|
|
6874
|
+
const description = parseNonEmptyString(
|
|
6875
|
+
record.description,
|
|
6876
|
+
`${pathPrefix}.description`,
|
|
6877
|
+
{
|
|
6878
|
+
required: true,
|
|
6879
|
+
max: TEMPLATE_PREVIEW_DESCRIPTION_MAX
|
|
6880
|
+
}
|
|
6881
|
+
);
|
|
6882
|
+
const descriptionLineCount = description.split(/\r?\n/).map((line) => line.trim()).filter((line) => line.length > 0).length;
|
|
6883
|
+
if (descriptionLineCount < TEMPLATE_PREVIEW_MIN_LINES || descriptionLineCount > TEMPLATE_PREVIEW_MAX_LINES) {
|
|
6884
|
+
throw new Error(
|
|
6885
|
+
`${pathPrefix}.description must contain ${TEMPLATE_PREVIEW_MIN_LINES}-${TEMPLATE_PREVIEW_MAX_LINES} non-empty lines (target ~5 lines).`
|
|
6886
|
+
);
|
|
6887
|
+
}
|
|
6888
|
+
return {
|
|
6889
|
+
title,
|
|
6890
|
+
subtitle,
|
|
6891
|
+
description
|
|
6892
|
+
};
|
|
6893
|
+
}
|
|
6805
6894
|
async function validateCommand(options) {
|
|
6806
6895
|
console.log("\u{1F50D} Validating OpenTool metadata...");
|
|
6807
6896
|
try {
|
|
@@ -6879,16 +6968,26 @@ async function loadAndValidateTools(toolsDir, options = {}) {
|
|
|
6879
6968
|
throw new Error(`${file}: export exactly one of GET or POST`);
|
|
6880
6969
|
}
|
|
6881
6970
|
let normalizedSchedule = null;
|
|
6882
|
-
const
|
|
6883
|
-
const
|
|
6884
|
-
const
|
|
6885
|
-
const allowedProfileCategories =
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6971
|
+
const profileRaw = toolModule?.profile && typeof toolModule.profile === "object" ? toolModule.profile : null;
|
|
6972
|
+
const schedule = profileRaw?.schedule ?? null;
|
|
6973
|
+
const profileNotifyEmail = typeof profileRaw?.notifyEmail === "boolean" ? profileRaw.notifyEmail : void 0;
|
|
6974
|
+
const allowedProfileCategories = [
|
|
6975
|
+
"strategy",
|
|
6976
|
+
"tracker",
|
|
6977
|
+
"orchestrator"
|
|
6978
|
+
];
|
|
6979
|
+
const profileCategoryCandidate = typeof profileRaw?.category === "string" ? profileRaw.category : void 0;
|
|
6980
|
+
let profileCategoryRaw;
|
|
6981
|
+
if (profileCategoryCandidate !== void 0) {
|
|
6982
|
+
const isAllowed = allowedProfileCategories.includes(profileCategoryCandidate);
|
|
6983
|
+
if (!isAllowed) {
|
|
6984
|
+
throw new Error(
|
|
6985
|
+
`${file}: profile.category must be one of ${allowedProfileCategories.join(", ")}`
|
|
6986
|
+
);
|
|
6987
|
+
}
|
|
6988
|
+
profileCategoryRaw = profileCategoryCandidate;
|
|
6890
6989
|
}
|
|
6891
|
-
const profileAssetsRaw =
|
|
6990
|
+
const profileAssetsRaw = profileRaw?.assets;
|
|
6892
6991
|
if (profileAssetsRaw !== void 0) {
|
|
6893
6992
|
if (!Array.isArray(profileAssetsRaw)) {
|
|
6894
6993
|
throw new Error(`${file}: profile.assets must be an array.`);
|
|
@@ -6946,7 +7045,7 @@ async function loadAndValidateTools(toolsDir, options = {}) {
|
|
|
6946
7045
|
}
|
|
6947
7046
|
});
|
|
6948
7047
|
}
|
|
6949
|
-
const templateConfigRaw =
|
|
7048
|
+
const templateConfigRaw = profileRaw?.templateConfig;
|
|
6950
7049
|
if (templateConfigRaw !== void 0) {
|
|
6951
7050
|
if (!templateConfigRaw || typeof templateConfigRaw !== "object") {
|
|
6952
7051
|
throw new Error(`${file}: profile.templateConfig must be an object.`);
|
|
@@ -6983,6 +7082,13 @@ async function loadAndValidateTools(toolsDir, options = {}) {
|
|
|
6983
7082
|
);
|
|
6984
7083
|
}
|
|
6985
7084
|
}
|
|
7085
|
+
const normalizedTemplatePreview = normalizeTemplatePreview(
|
|
7086
|
+
profileRaw?.templatePreview,
|
|
7087
|
+
file,
|
|
7088
|
+
toolName,
|
|
7089
|
+
profileCategoryRaw === "strategy"
|
|
7090
|
+
);
|
|
7091
|
+
const normalizedProfile = profileRaw && normalizedTemplatePreview ? { ...profileRaw, templatePreview: normalizedTemplatePreview } : profileRaw;
|
|
6986
7092
|
if (hasGET && schedule && typeof schedule.cron === "string" && schedule.cron.trim().length > 0) {
|
|
6987
7093
|
normalizedSchedule = normalizeScheduleExpression(schedule.cron, file);
|
|
6988
7094
|
if (typeof schedule.enabled === "boolean") {
|
|
@@ -7052,9 +7158,9 @@ async function loadAndValidateTools(toolsDir, options = {}) {
|
|
|
7052
7158
|
handler: async (params) => adapter(params),
|
|
7053
7159
|
payment: paymentExport ?? null,
|
|
7054
7160
|
schedule: normalizedSchedule,
|
|
7055
|
-
profile:
|
|
7161
|
+
profile: normalizedProfile,
|
|
7056
7162
|
...profileNotifyEmail !== void 0 ? { notifyEmail: profileNotifyEmail } : {},
|
|
7057
|
-
profileDescription: typeof
|
|
7163
|
+
profileDescription: typeof profileRaw?.description === "string" ? profileRaw.description : null,
|
|
7058
7164
|
...profileCategoryRaw ? { profileCategory: profileCategoryRaw } : {}
|
|
7059
7165
|
};
|
|
7060
7166
|
tools.push(tool);
|
|
@@ -7287,6 +7393,6 @@ function timestamp() {
|
|
|
7287
7393
|
return (/* @__PURE__ */ new Date()).toISOString().replace("T", " ").slice(0, 19);
|
|
7288
7394
|
}
|
|
7289
7395
|
|
|
7290
|
-
export { AIAbortError, AIError, AIFetchError, AIResponseError, DEFAULT_BASE_URL, DEFAULT_CHAIN, DEFAULT_FACILITATOR, DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, DEFAULT_MODEL, DEFAULT_TIMEOUT_MS, DEFAULT_TOKENS, HTTP_METHODS2 as HTTP_METHODS, HyperliquidApiError, HyperliquidBuilderApprovalError, HyperliquidExchangeClient, HyperliquidGuardError, HyperliquidInfoClient, HyperliquidTermsError, PAYMENT_HEADERS, POLYMARKET_CHAIN_ID, POLYMARKET_CLOB_AUTH_DOMAIN, POLYMARKET_CLOB_DOMAIN, POLYMARKET_ENDPOINTS, POLYMARKET_EXCHANGE_ADDRESSES, PolymarketApiError, PolymarketAuthError, PolymarketExchangeClient, PolymarketInfoClient, SUPPORTED_CURRENCIES, StoreError, WEBSEARCH_TOOL_DEFINITION, WEBSEARCH_TOOL_NAME, X402BrowserClient, X402Client, X402PaymentRequiredError, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, batchModifyHyperliquidOrders, buildHmacSignature, buildHyperliquidMarketIdentity, buildHyperliquidSpotUsdPriceMap, buildL1Headers, buildL2Headers, buildPolymarketOrderAmounts, buildSignedOrderPayload, cancelAllHyperliquidOrders, cancelAllPolymarketOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, cancelMarketPolymarketOrders, cancelPolymarketOrder, cancelPolymarketOrders, chains, computeHyperliquidMarketIocLimitPrice, createAIClient, createDevServer, createHyperliquidSubAccount, createMcpAdapter, createMonotonicNonceFactory, createPolymarketApiKey, createStdioServer, defineX402Payment, depositToHyperliquidBridge, derivePolymarketApiKey, ensureTextContent, executeTool, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, fetchPolymarketMarket, fetchPolymarketMarkets, fetchPolymarketMidpoint, fetchPolymarketOrderbook, fetchPolymarketPrice, fetchPolymarketPriceHistory, flattenMessageContent, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, generateMetadata, generateMetadataCommand, generateText, getHyperliquidMaxBuilderFee, getModelConfig, getMyPerformance, getMyTools, getRpcUrl, getX402PaymentContext, isHyperliquidSpotSymbol, isStreamingSupported, isToolCallingSupported, listModels, loadAndValidateTools, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidMetaSymbol, normalizeModelName, normalizeNumberArrayish, normalizeSpotTokenName2 as normalizeSpotTokenName, normalizeStringArrayish, parseSpotPairSymbol, payX402, payX402WithWallet, placeHyperliquidOrder, placeHyperliquidTwapOrder, placePolymarketOrder, postAgentDigest, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, registry, requireX402Payment, reserveHyperliquidRequestWeight, resolveConfig2 as resolveConfig, resolveExchangeAddress, resolveHyperliquidAbstractionFromMode, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidErrorDetail, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidRpcEnvVar, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolvePolymarketBaseUrl, resolveRuntimePath, resolveSpotMidCandidates, resolveSpotTokenCandidates, resolveToolset, responseToToolResponse, retrieve, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidDexAbstraction, setHyperliquidPortfolioMargin, store, streamText, tokens, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, validateCommand, wallet, walletToolkit, withX402Payment, withdrawFromHyperliquid };
|
|
7396
|
+
export { AIAbortError, AIError, AIFetchError, AIResponseError, DEFAULT_BASE_URL, DEFAULT_CHAIN, DEFAULT_FACILITATOR, DEFAULT_HYPERLIQUID_MARKET_SLIPPAGE_BPS, DEFAULT_MODEL, DEFAULT_TIMEOUT_MS, DEFAULT_TOKENS, HTTP_METHODS2 as HTTP_METHODS, HyperliquidApiError, HyperliquidBuilderApprovalError, HyperliquidExchangeClient, HyperliquidGuardError, HyperliquidInfoClient, HyperliquidTermsError, PAYMENT_HEADERS, POLYMARKET_CHAIN_ID, POLYMARKET_CLOB_AUTH_DOMAIN, POLYMARKET_CLOB_DOMAIN, POLYMARKET_ENDPOINTS, POLYMARKET_EXCHANGE_ADDRESSES, PolymarketApiError, PolymarketAuthError, PolymarketExchangeClient, PolymarketInfoClient, SUPPORTED_CURRENCIES, StoreError, WEBSEARCH_TOOL_DEFINITION, WEBSEARCH_TOOL_NAME, X402BrowserClient, X402Client, X402PaymentRequiredError, __hyperliquidInternals, __hyperliquidMarketDataInternals, approveHyperliquidBuilderFee, batchModifyHyperliquidOrders, buildHmacSignature, buildHyperliquidMarketIdentity, buildHyperliquidProfileAssets, buildHyperliquidSpotUsdPriceMap, buildL1Headers, buildL2Headers, buildPolymarketOrderAmounts, buildSignedOrderPayload, cancelAllHyperliquidOrders, cancelAllPolymarketOrders, cancelHyperliquidOrders, cancelHyperliquidOrdersByCloid, cancelHyperliquidTwapOrder, cancelMarketPolymarketOrders, cancelPolymarketOrder, cancelPolymarketOrders, chains, computeHyperliquidMarketIocLimitPrice, createAIClient, createDevServer, createHyperliquidSubAccount, createMcpAdapter, createMonotonicNonceFactory, createPolymarketApiKey, createStdioServer, defineX402Payment, depositToHyperliquidBridge, derivePolymarketApiKey, ensureTextContent, executeTool, extractHyperliquidDex, extractHyperliquidOrderIds, fetchHyperliquidAllMids, fetchHyperliquidAssetCtxs, fetchHyperliquidClearinghouseState, fetchHyperliquidFrontendOpenOrders, fetchHyperliquidHistoricalOrders, fetchHyperliquidMeta, fetchHyperliquidMetaAndAssetCtxs, fetchHyperliquidOpenOrders, fetchHyperliquidOrderStatus, fetchHyperliquidPerpMarketInfo, fetchHyperliquidPreTransferCheck, fetchHyperliquidSizeDecimals, fetchHyperliquidSpotAccountValue, fetchHyperliquidSpotAssetCtxs, fetchHyperliquidSpotClearinghouseState, fetchHyperliquidSpotMarketInfo, fetchHyperliquidSpotMeta, fetchHyperliquidSpotMetaAndAssetCtxs, fetchHyperliquidSpotTickSize, fetchHyperliquidSpotUsdPriceMap, fetchHyperliquidTickSize, fetchHyperliquidUserFills, fetchHyperliquidUserFillsByTime, fetchHyperliquidUserRateLimit, fetchPolymarketMarket, fetchPolymarketMarkets, fetchPolymarketMidpoint, fetchPolymarketOrderbook, fetchPolymarketPrice, fetchPolymarketPriceHistory, flattenMessageContent, formatHyperliquidMarketablePrice, formatHyperliquidOrderSize, formatHyperliquidPrice, formatHyperliquidSize, generateMetadata, generateMetadataCommand, generateText, getHyperliquidMaxBuilderFee, getModelConfig, getMyPerformance, getMyTools, getRpcUrl, getX402PaymentContext, isHyperliquidSpotSymbol, isStreamingSupported, isToolCallingSupported, listModels, loadAndValidateTools, modifyHyperliquidOrder, normalizeHyperliquidBaseSymbol, normalizeHyperliquidMetaSymbol, normalizeModelName, normalizeNumberArrayish, normalizeSpotTokenName2 as normalizeSpotTokenName, normalizeStringArrayish, parseSpotPairSymbol, payX402, payX402WithWallet, placeHyperliquidOrder, placeHyperliquidTwapOrder, placePolymarketOrder, postAgentDigest, readHyperliquidAccountValue, readHyperliquidNumber, readHyperliquidPerpPosition, readHyperliquidPerpPositionSize, readHyperliquidSpotAccountValue, readHyperliquidSpotBalance, readHyperliquidSpotBalanceSize, recordHyperliquidBuilderApproval, recordHyperliquidTermsAcceptance, registry, requireX402Payment, reserveHyperliquidRequestWeight, resolveConfig2 as resolveConfig, resolveExchangeAddress, resolveHyperliquidAbstractionFromMode, resolveHyperliquidChain, resolveHyperliquidChainConfig, resolveHyperliquidErrorDetail, resolveHyperliquidOrderRef, resolveHyperliquidOrderSymbol, resolveHyperliquidPair, resolveHyperliquidProfileChain, resolveHyperliquidRpcEnvVar, resolveHyperliquidStoreNetwork, resolveHyperliquidSymbol, resolvePolymarketBaseUrl, resolveRuntimePath, resolveSpotMidCandidates, resolveSpotTokenCandidates, resolveToolset, responseToToolResponse, retrieve, roundHyperliquidPriceToTick, scheduleHyperliquidCancel, sendHyperliquidSpot, setHyperliquidAccountAbstractionMode, setHyperliquidDexAbstraction, setHyperliquidPortfolioMargin, store, streamText, tokens, transferHyperliquidSubAccount, updateHyperliquidIsolatedMargin, updateHyperliquidLeverage, validateCommand, wallet, walletToolkit, withX402Payment, withdrawFromHyperliquid };
|
|
7291
7397
|
//# sourceMappingURL=index.js.map
|
|
7292
7398
|
//# sourceMappingURL=index.js.map
|