@joai/warps 4.14.0 → 4.15.0
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/index.d.cts +30 -34
- package/dist/index.d.ts +30 -34
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -436,9 +436,6 @@ declare const WarpConstants: {
|
|
|
436
436
|
Position: {
|
|
437
437
|
Payload: string;
|
|
438
438
|
};
|
|
439
|
-
Alerts: {
|
|
440
|
-
TriggerEventPrefix: string;
|
|
441
|
-
};
|
|
442
439
|
};
|
|
443
440
|
declare const WarpInputTypes: {
|
|
444
441
|
Option: string;
|
|
@@ -460,16 +457,6 @@ declare const WarpInputTypes: {
|
|
|
460
457
|
};
|
|
461
458
|
declare const safeWindow: Window;
|
|
462
459
|
|
|
463
|
-
type WarpAlertName = string;
|
|
464
|
-
type WarpAlert = {
|
|
465
|
-
label: WarpText;
|
|
466
|
-
trigger: string;
|
|
467
|
-
subject: WarpText;
|
|
468
|
-
body: WarpText;
|
|
469
|
-
action?: string;
|
|
470
|
-
};
|
|
471
|
-
type WarpAlerts = Record<WarpAlertName, WarpAlert>;
|
|
472
|
-
|
|
473
460
|
type WarpPlatformValue<T> = T | Partial<Record<WarpPlatformName, T>>;
|
|
474
461
|
type WarpExplorerName = string;
|
|
475
462
|
type WarpChainInfoLogoThemed = Record<WarpTheme, string>;
|
|
@@ -510,7 +497,6 @@ type Warp = {
|
|
|
510
497
|
output?: Record<WarpOutputName, WarpResulutionPath>;
|
|
511
498
|
messages?: Record<WarpMessageName, WarpText>;
|
|
512
499
|
ui?: string;
|
|
513
|
-
alerts?: WarpAlerts;
|
|
514
500
|
related?: string[];
|
|
515
501
|
schedule?: WarpSchedule;
|
|
516
502
|
meta?: WarpMeta;
|
|
@@ -534,6 +520,9 @@ type WarpTrigger = {
|
|
|
534
520
|
source: string;
|
|
535
521
|
match?: Record<string, string | number | boolean>;
|
|
536
522
|
inputs?: Record<string, string>;
|
|
523
|
+
label?: WarpText;
|
|
524
|
+
subject?: WarpText;
|
|
525
|
+
body?: WarpText;
|
|
537
526
|
};
|
|
538
527
|
type WarpStateAction = {
|
|
539
528
|
type: 'state';
|
|
@@ -544,7 +533,6 @@ type WarpStateAction = {
|
|
|
544
533
|
keys?: string[];
|
|
545
534
|
data?: Record<string, any>;
|
|
546
535
|
inputs?: WarpActionInput[];
|
|
547
|
-
primary?: boolean;
|
|
548
536
|
auto?: boolean;
|
|
549
537
|
next?: WarpNextConfig;
|
|
550
538
|
when?: string;
|
|
@@ -555,7 +543,6 @@ type WarpMountAction = {
|
|
|
555
543
|
description?: WarpText | null;
|
|
556
544
|
warp: string;
|
|
557
545
|
inputs?: WarpActionInput[];
|
|
558
|
-
primary?: boolean;
|
|
559
546
|
auto?: boolean;
|
|
560
547
|
next?: WarpNextConfig;
|
|
561
548
|
when?: string;
|
|
@@ -566,7 +553,6 @@ type WarpUnmountAction = {
|
|
|
566
553
|
description?: WarpText | null;
|
|
567
554
|
warp: string;
|
|
568
555
|
inputs?: WarpActionInput[];
|
|
569
|
-
primary?: boolean;
|
|
570
556
|
auto?: boolean;
|
|
571
557
|
next?: WarpNextConfig;
|
|
572
558
|
when?: string;
|
|
@@ -576,7 +562,6 @@ type WarpLoopAction = {
|
|
|
576
562
|
label: WarpText;
|
|
577
563
|
description?: WarpText | null;
|
|
578
564
|
inputs?: WarpActionInput[];
|
|
579
|
-
primary?: boolean;
|
|
580
565
|
auto?: boolean;
|
|
581
566
|
next?: WarpNextConfig;
|
|
582
567
|
when?: string;
|
|
@@ -592,7 +577,6 @@ type WarpTransferAction = {
|
|
|
592
577
|
value?: string;
|
|
593
578
|
transfers?: string[];
|
|
594
579
|
inputs?: WarpActionInput[];
|
|
595
|
-
primary?: boolean;
|
|
596
580
|
auto?: boolean;
|
|
597
581
|
next?: WarpNextConfig;
|
|
598
582
|
when?: string;
|
|
@@ -609,7 +593,6 @@ type WarpContractAction = {
|
|
|
609
593
|
transfers?: string[];
|
|
610
594
|
abi?: string;
|
|
611
595
|
inputs?: WarpActionInput[];
|
|
612
|
-
primary?: boolean;
|
|
613
596
|
auto?: boolean;
|
|
614
597
|
next?: WarpNextConfig;
|
|
615
598
|
when?: string;
|
|
@@ -623,7 +606,6 @@ type WarpQueryAction = {
|
|
|
623
606
|
args?: string[];
|
|
624
607
|
abi?: string;
|
|
625
608
|
inputs?: WarpActionInput[];
|
|
626
|
-
primary?: boolean;
|
|
627
609
|
auto?: boolean;
|
|
628
610
|
next?: WarpNextConfig;
|
|
629
611
|
when?: string;
|
|
@@ -634,7 +616,6 @@ type WarpCollectAction = {
|
|
|
634
616
|
description?: WarpText | null;
|
|
635
617
|
destination?: WarpCollectDestination;
|
|
636
618
|
inputs?: WarpActionInput[];
|
|
637
|
-
primary?: boolean;
|
|
638
619
|
auto?: boolean;
|
|
639
620
|
next?: WarpNextConfig;
|
|
640
621
|
when?: string;
|
|
@@ -644,7 +625,6 @@ type WarpComputeAction = {
|
|
|
644
625
|
label: WarpText;
|
|
645
626
|
description?: WarpText | null;
|
|
646
627
|
inputs?: WarpActionInput[];
|
|
647
|
-
primary?: boolean;
|
|
648
628
|
auto?: boolean;
|
|
649
629
|
next?: WarpNextConfig;
|
|
650
630
|
when?: string;
|
|
@@ -661,7 +641,6 @@ type WarpLinkAction = {
|
|
|
661
641
|
description?: WarpText | null;
|
|
662
642
|
url: string;
|
|
663
643
|
inputs?: WarpActionInput[];
|
|
664
|
-
primary?: boolean;
|
|
665
644
|
auto?: boolean;
|
|
666
645
|
when?: string;
|
|
667
646
|
};
|
|
@@ -671,7 +650,6 @@ type WarpMcpAction = {
|
|
|
671
650
|
description?: WarpText | null;
|
|
672
651
|
destination?: WarpMcpDestination;
|
|
673
652
|
inputs?: WarpActionInput[];
|
|
674
|
-
primary?: boolean;
|
|
675
653
|
auto?: boolean;
|
|
676
654
|
next?: WarpNextConfig;
|
|
677
655
|
when?: string;
|
|
@@ -687,7 +665,6 @@ type WarpPromptAction = {
|
|
|
687
665
|
description?: WarpText | null;
|
|
688
666
|
prompt: WarpPlatformValue<string>;
|
|
689
667
|
inputs?: WarpActionInput[];
|
|
690
|
-
primary?: boolean;
|
|
691
668
|
auto?: boolean;
|
|
692
669
|
next?: WarpNextConfig;
|
|
693
670
|
when?: string;
|
|
@@ -831,8 +808,6 @@ declare const WarpChainLogos: Record<WarpChainName, WarpChainInfoLogo>;
|
|
|
831
808
|
*/
|
|
832
809
|
declare const getChainLogo: (chain: WarpChainName, variant?: "light" | "dark") => string;
|
|
833
810
|
|
|
834
|
-
declare const getEventNameFromWarp: (warp: Warp, alertName: string) => string | null;
|
|
835
|
-
|
|
836
811
|
declare const getWarpBrandLogoUrl: (brand: WarpBrand, config?: WarpClientConfig) => string;
|
|
837
812
|
declare const getWarpChainAssetLogoUrl: (asset: WarpChainAsset, config?: WarpClientConfig) => string | null;
|
|
838
813
|
declare const getWarpChainInfoLogoUrl: (chainInfo: WarpChainInfo, config?: WarpClientConfig) => string;
|
|
@@ -863,11 +838,11 @@ declare const extractWarpSecrets: (warp: Warp) => WarpSecret[];
|
|
|
863
838
|
declare const findWarpAdapterForChain: (chain: WarpChainName, adapters: ChainAdapter[]) => ChainAdapter;
|
|
864
839
|
declare const getLatestProtocolIdentifier: (name: ProtocolName) => string;
|
|
865
840
|
declare const getWarpActionByIndex: (warp: Warp, index: number) => WarpAction;
|
|
866
|
-
declare const
|
|
841
|
+
declare const getWarpInputAction: (warp: Warp) => {
|
|
867
842
|
action: WarpAction;
|
|
868
843
|
index: number;
|
|
869
844
|
};
|
|
870
|
-
declare const isWarpActionAutoExecute: (action: WarpAction
|
|
845
|
+
declare const isWarpActionAutoExecute: (action: WarpAction) => boolean;
|
|
871
846
|
declare const shiftBigintBy: (value: bigint | string | number, decimals: number) => bigint;
|
|
872
847
|
declare const toPreviewText: (text: string, maxChars?: number) => string;
|
|
873
848
|
declare const replacePlaceholders: (message: string, bag: Record<string, any>) => string;
|
|
@@ -1225,6 +1200,18 @@ type ExecutionHandlers = {
|
|
|
1225
1200
|
message: string;
|
|
1226
1201
|
chain: WarpChainInfo;
|
|
1227
1202
|
}) => string | Promise<string>;
|
|
1203
|
+
onPromptGenerate?: (prompt: string) => string | null | Promise<string | null>;
|
|
1204
|
+
onMountAction?: (params: {
|
|
1205
|
+
action: WarpAction;
|
|
1206
|
+
actionIndex: WarpActionIndex;
|
|
1207
|
+
warp: Warp;
|
|
1208
|
+
}) => void | Promise<void>;
|
|
1209
|
+
onLoop?: (params: {
|
|
1210
|
+
warp: Warp;
|
|
1211
|
+
inputs: string[];
|
|
1212
|
+
meta: Record<string, any>;
|
|
1213
|
+
delay: number;
|
|
1214
|
+
}) => void;
|
|
1228
1215
|
onActionExecuted?: (params: {
|
|
1229
1216
|
action: WarpActionIndex;
|
|
1230
1217
|
chain: WarpChainInfo | null;
|
|
@@ -1243,10 +1230,15 @@ declare class WarpExecutor {
|
|
|
1243
1230
|
private adapters;
|
|
1244
1231
|
private handlers?;
|
|
1245
1232
|
private factory;
|
|
1233
|
+
private loopIterations;
|
|
1234
|
+
private active;
|
|
1246
1235
|
constructor(config: WarpClientConfig, adapters: ChainAdapter[], handlers?: ExecutionHandlers | undefined);
|
|
1236
|
+
/** Stops any scheduled loop re-executions. */
|
|
1237
|
+
stop(): void;
|
|
1247
1238
|
execute(warp: Warp, inputs: string[], meta?: {
|
|
1248
1239
|
envs?: Record<string, any>;
|
|
1249
1240
|
queries?: Record<string, any>;
|
|
1241
|
+
scope?: string;
|
|
1250
1242
|
}): Promise<{
|
|
1251
1243
|
txs: WarpAdapterGenericTransaction[];
|
|
1252
1244
|
chain: WarpChainInfo | null;
|
|
@@ -1256,6 +1248,7 @@ declare class WarpExecutor {
|
|
|
1256
1248
|
executeAction(warp: Warp, actionIndex: WarpActionIndex, inputs: string[], meta?: {
|
|
1257
1249
|
envs?: Record<string, any>;
|
|
1258
1250
|
queries?: Record<string, any>;
|
|
1251
|
+
scope?: string;
|
|
1259
1252
|
}): Promise<{
|
|
1260
1253
|
tx: WarpAdapterGenericTransaction | null;
|
|
1261
1254
|
chain: WarpChainInfo | null;
|
|
@@ -1270,6 +1263,8 @@ declare class WarpExecutor {
|
|
|
1270
1263
|
private executeMcp;
|
|
1271
1264
|
private buildCollectResult;
|
|
1272
1265
|
private callHandler;
|
|
1266
|
+
private scheduleLoops;
|
|
1267
|
+
private executeState;
|
|
1273
1268
|
private executePrompt;
|
|
1274
1269
|
private evaluateWhenCondition;
|
|
1275
1270
|
}
|
|
@@ -1297,10 +1292,10 @@ declare class WarpInterpolator {
|
|
|
1297
1292
|
}): Warp;
|
|
1298
1293
|
private applyRootGlobals;
|
|
1299
1294
|
private applyActionGlobals;
|
|
1300
|
-
applyInputs(text: string, resolvedInputs: ResolvedInput[], serializer: WarpSerializer
|
|
1295
|
+
applyInputs(text: string, resolvedInputs: ResolvedInput[], serializer: WarpSerializer): string;
|
|
1301
1296
|
private applyGlobalsToText;
|
|
1302
1297
|
private replacePlaceholdersWithChain;
|
|
1303
|
-
buildInputBag(resolvedInputs: ResolvedInput[], serializer: WarpSerializer
|
|
1298
|
+
buildInputBag(resolvedInputs: ResolvedInput[], serializer: WarpSerializer): Record<string, string>;
|
|
1304
1299
|
}
|
|
1305
1300
|
|
|
1306
1301
|
declare class WarpFactory {
|
|
@@ -1311,6 +1306,7 @@ declare class WarpFactory {
|
|
|
1311
1306
|
private cache;
|
|
1312
1307
|
constructor(config: WarpClientConfig, adapters: ChainAdapter[]);
|
|
1313
1308
|
getSerializer(): WarpSerializer;
|
|
1309
|
+
getCache(): WarpCache;
|
|
1314
1310
|
getResolvedInputsFromCache(env: WarpChainEnv, warpHash: string | undefined, actionIndex: number): Promise<string[]>;
|
|
1315
1311
|
getRawResolvedInputsFromCache(env: WarpChainEnv, warpHash: string | undefined, actionIndex: number): Promise<ResolvedInput[]>;
|
|
1316
1312
|
createExecutable(warp: Warp, actionIndex: number, inputs: string[], meta?: {
|
|
@@ -1451,7 +1447,7 @@ declare class WarpValidator {
|
|
|
1451
1447
|
private config;
|
|
1452
1448
|
constructor(config: WarpClientConfig);
|
|
1453
1449
|
validate(warp: Warp): Promise<ValidationResult>;
|
|
1454
|
-
private
|
|
1450
|
+
private validateHasActions;
|
|
1455
1451
|
private validateMaxOneValuePosition;
|
|
1456
1452
|
private validateVariableNamesAndResultNamesUppercase;
|
|
1457
1453
|
private validateAbiIsSetIfApplicable;
|
|
@@ -1477,4 +1473,4 @@ declare function resolveInputs(trigger: WebhookTrigger, payload: unknown): Recor
|
|
|
1477
1473
|
*/
|
|
1478
1474
|
declare function resolvePath(obj: unknown, path: string): unknown;
|
|
1479
1475
|
|
|
1480
|
-
export { type AdapterTypeRegistry, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpOutput, type AdapterWarpRegistry, type AdapterWarpSerializer, type AdapterWarpWallet, type BaseWarpActionInputType, type BaseWarpBuilder, BrowserCryptoProvider, type BuiltInWarpWalletProvider, CLOUD_WALLET_PROVIDERS, CacheTtl, type ChainAdapter, type ChainAdapterFactory, type ClientCacheConfig, type ClientIndexConfig, type ClientTransformConfig, type CodecFunc, type CombinedWarpBuilder, type CryptoProvider, type DetectionResult, type DetectionResultFromHtml, EvmWalletChainNames, type ExecutionHandlers, type GeneratedSourceInfo, type GeneratedSourceType, type HttpAuthHeaders, type InterpolationBag, MultiversxWalletChainNames, NodeCryptoProvider, type ProtocolName, type ResolvedInput, type SignableMessage, type TransformRunner, WARP_LANGUAGES, type WalletCache, type WalletProvider, type WalletProviderFactory, type Warp, type WarpAbi, type WarpAbiContents, type WarpAction, type WarpActionExecutionResult, type WarpActionExecutionStatus, type WarpActionIndex, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputPositionAssetObject, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, type WarpAdapterGenericRemoteTransaction, type WarpAdapterGenericTransaction, type WarpAdapterGenericType, type WarpAdapterGenericValue,
|
|
1476
|
+
export { type AdapterTypeRegistry, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpOutput, type AdapterWarpRegistry, type AdapterWarpSerializer, type AdapterWarpWallet, type BaseWarpActionInputType, type BaseWarpBuilder, BrowserCryptoProvider, type BuiltInWarpWalletProvider, CLOUD_WALLET_PROVIDERS, CacheTtl, type ChainAdapter, type ChainAdapterFactory, type ClientCacheConfig, type ClientIndexConfig, type ClientTransformConfig, type CodecFunc, type CombinedWarpBuilder, type CryptoProvider, type DetectionResult, type DetectionResultFromHtml, EvmWalletChainNames, type ExecutionHandlers, type GeneratedSourceInfo, type GeneratedSourceType, type HttpAuthHeaders, type InterpolationBag, MultiversxWalletChainNames, NodeCryptoProvider, type ProtocolName, type ResolvedInput, type SignableMessage, type TransformRunner, WARP_LANGUAGES, type WalletCache, type WalletProvider, type WalletProviderFactory, type Warp, type WarpAbi, type WarpAbiContents, type WarpAction, type WarpActionExecutionResult, type WarpActionExecutionStatus, type WarpActionIndex, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputPositionAssetObject, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, type WarpAdapterGenericRemoteTransaction, type WarpAdapterGenericTransaction, type WarpAdapterGenericType, type WarpAdapterGenericValue, WarpAssets, type WarpBrand, WarpBrandBuilder, type WarpBrandColors, type WarpBrandCta, type WarpBrandLogo, type WarpBrandLogoThemed, type WarpBrandUrls, WarpBuilder, WarpCache, type WarpCacheAdapter, type WarpCacheConfig, WarpCacheKey, type WarpChainAccount, type WarpChainAction, type WarpChainActionStatus, type WarpChainAsset, type WarpChainAssetLogo, type WarpChainAssetLogoThemed, type WarpChainAssetNftMetadata, type WarpChainAssetType, type WarpChainAssetValue, WarpChainDisplayNames, type WarpChainEnv, type WarpChainInfo, type WarpChainInfoLogo, type WarpChainInfoLogoThemed, WarpChainLogos, WarpChainName, WarpChainResolver, WarpClient, type WarpClientConfig, type WarpCollectAction, type WarpCollectDestination, type WarpCollectDestinationHttp, WarpCompositeResolver, type WarpComputeAction, WarpConfig, WarpConstants, type WarpContract, type WarpContractAction, type WarpContractVerification, type WarpDataLoaderOptions, type WarpExecutable, type WarpExecutionMessages, type WarpExecutionNextInfo, type WarpExecutionOutput, WarpExecutor, type WarpExplorerName, WarpFactory, type WarpI18nText, type WarpIdentifierType, WarpIndex, WarpInputTypes, WarpInterpolator, type WarpLinkAction, WarpLinkBuilder, WarpLinkDetecter, type WarpLocale, WarpLogger, type WarpLoopAction, type WarpMcpAction, type WarpMcpDestination, type WarpMessageName, type WarpMeta, type WarpMountAction, type WarpNativeValue, type WarpNextConfig, type WarpOutputName, WarpPlatformName, type WarpPlatformValue, WarpPlatforms, type WarpPromptAction, WarpProtocolVersions, type WarpProviderConfig, type WarpProviderPreferences, type WarpQueryAction, type WarpRegistryConfigInfo, type WarpRegistryInfo, type WarpResolver, type WarpResolverResult, type WarpResulutionPath, type WarpSchedule, type WarpSearchHit, type WarpSearchResult, type WarpSecret, WarpSerializer, type WarpStateAction, type WarpStructValue, type WarpText, type WarpTheme, type WarpTransferAction, type WarpTrigger, type WarpTrustStatus, type WarpTypeHandler, WarpTypeRegistry, type WarpUnmountAction, type WarpUser, type WarpUserWallets, WarpValidator, type WarpVarPlaceholder, type WarpWalletDetails, type WarpWalletProvider, address, applyOutputToMessages, asset, biguint, bool, buildGeneratedFallbackWarpIdentifier, buildGeneratedSourceWarpIdentifier, buildInputsContext, buildMappedOutput, buildNestedPayload, bytesToBase64, bytesToHex, checkWarpAssetBalance, cleanWarpIdentifier, createAuthHeaders, createAuthMessage, createCryptoProvider, createDefaultWalletProvider, createHttpAuthHeaders, createSignableMessage, createWarpI18nText, createWarpIdentifier, doesWarpRequireWallet, evaluateOutputCommon, evaluateWhenCondition, extractCollectOutput, extractIdentifierInfoFromUrl, extractPromptOutput, extractQueryStringFromIdentifier, extractQueryStringFromUrl, extractResolvedInputValues, extractWarpSecrets, findWarpAdapterForChain, getChainDisplayName, getChainLogo, getCryptoProvider, getGeneratedSourceWarpName, getLatestProtocolIdentifier, getMppFetch, getNextInfo, getNextInfoForStatus, getProviderConfig, getRandomBytes, getRandomHex, getRequiredAssetIds, getWalletFromConfigOrFail, getWarpActionByIndex, getWarpBrandLogoUrl, getWarpChainAssetLogoUrl, getWarpChainInfoLogoUrl, getWarpIdentifierWithQuery, getWarpInfoFromIdentifier, getWarpInputAction, getWarpWalletAddress, getWarpWalletAddressFromConfig, getWarpWalletExternalId, getWarpWalletExternalIdFromConfig, getWarpWalletExternalIdFromConfigOrFail, getWarpWalletMnemonic, getWarpWalletMnemonicFromConfig, getWarpWalletPrivateKey, getWarpWalletPrivateKeyFromConfig, hasInputPrefix, hex, initializeWalletCache, isEqualWarpIdentifier, isGeneratedSourcePrivateIdentifier, isPlatformValue, isWarpActionAutoExecute, isWarpI18nText, isWarpWalletReadOnly, matchesTrigger, mergeNestedPayload, normalizeAndValidateMnemonic, normalizeMnemonic, option, parseOutputOutIndex, parseSignedMessage, parseWarpQueryStringToObject, removeWarpChainPrefix, removeWarpWalletFromConfig, replacePlaceholders, replacePlaceholdersInWhenExpression, resolveInputs, resolveNextString, resolvePath, resolvePlatformValue, resolveWarpText, safeWindow, setCryptoProvider, setWarpWalletInConfig, shiftBigintBy, splitInput, stampGeneratedWarpMeta, string, struct, testCryptoAvailability, toInputPayloadValue, toPreviewText, tuple, uint16, uint32, uint64, uint8, validateMnemonicLength, validateSignedMessage, vector, withAdapterFallback };
|
package/dist/index.d.ts
CHANGED
|
@@ -436,9 +436,6 @@ declare const WarpConstants: {
|
|
|
436
436
|
Position: {
|
|
437
437
|
Payload: string;
|
|
438
438
|
};
|
|
439
|
-
Alerts: {
|
|
440
|
-
TriggerEventPrefix: string;
|
|
441
|
-
};
|
|
442
439
|
};
|
|
443
440
|
declare const WarpInputTypes: {
|
|
444
441
|
Option: string;
|
|
@@ -460,16 +457,6 @@ declare const WarpInputTypes: {
|
|
|
460
457
|
};
|
|
461
458
|
declare const safeWindow: Window;
|
|
462
459
|
|
|
463
|
-
type WarpAlertName = string;
|
|
464
|
-
type WarpAlert = {
|
|
465
|
-
label: WarpText;
|
|
466
|
-
trigger: string;
|
|
467
|
-
subject: WarpText;
|
|
468
|
-
body: WarpText;
|
|
469
|
-
action?: string;
|
|
470
|
-
};
|
|
471
|
-
type WarpAlerts = Record<WarpAlertName, WarpAlert>;
|
|
472
|
-
|
|
473
460
|
type WarpPlatformValue<T> = T | Partial<Record<WarpPlatformName, T>>;
|
|
474
461
|
type WarpExplorerName = string;
|
|
475
462
|
type WarpChainInfoLogoThemed = Record<WarpTheme, string>;
|
|
@@ -510,7 +497,6 @@ type Warp = {
|
|
|
510
497
|
output?: Record<WarpOutputName, WarpResulutionPath>;
|
|
511
498
|
messages?: Record<WarpMessageName, WarpText>;
|
|
512
499
|
ui?: string;
|
|
513
|
-
alerts?: WarpAlerts;
|
|
514
500
|
related?: string[];
|
|
515
501
|
schedule?: WarpSchedule;
|
|
516
502
|
meta?: WarpMeta;
|
|
@@ -534,6 +520,9 @@ type WarpTrigger = {
|
|
|
534
520
|
source: string;
|
|
535
521
|
match?: Record<string, string | number | boolean>;
|
|
536
522
|
inputs?: Record<string, string>;
|
|
523
|
+
label?: WarpText;
|
|
524
|
+
subject?: WarpText;
|
|
525
|
+
body?: WarpText;
|
|
537
526
|
};
|
|
538
527
|
type WarpStateAction = {
|
|
539
528
|
type: 'state';
|
|
@@ -544,7 +533,6 @@ type WarpStateAction = {
|
|
|
544
533
|
keys?: string[];
|
|
545
534
|
data?: Record<string, any>;
|
|
546
535
|
inputs?: WarpActionInput[];
|
|
547
|
-
primary?: boolean;
|
|
548
536
|
auto?: boolean;
|
|
549
537
|
next?: WarpNextConfig;
|
|
550
538
|
when?: string;
|
|
@@ -555,7 +543,6 @@ type WarpMountAction = {
|
|
|
555
543
|
description?: WarpText | null;
|
|
556
544
|
warp: string;
|
|
557
545
|
inputs?: WarpActionInput[];
|
|
558
|
-
primary?: boolean;
|
|
559
546
|
auto?: boolean;
|
|
560
547
|
next?: WarpNextConfig;
|
|
561
548
|
when?: string;
|
|
@@ -566,7 +553,6 @@ type WarpUnmountAction = {
|
|
|
566
553
|
description?: WarpText | null;
|
|
567
554
|
warp: string;
|
|
568
555
|
inputs?: WarpActionInput[];
|
|
569
|
-
primary?: boolean;
|
|
570
556
|
auto?: boolean;
|
|
571
557
|
next?: WarpNextConfig;
|
|
572
558
|
when?: string;
|
|
@@ -576,7 +562,6 @@ type WarpLoopAction = {
|
|
|
576
562
|
label: WarpText;
|
|
577
563
|
description?: WarpText | null;
|
|
578
564
|
inputs?: WarpActionInput[];
|
|
579
|
-
primary?: boolean;
|
|
580
565
|
auto?: boolean;
|
|
581
566
|
next?: WarpNextConfig;
|
|
582
567
|
when?: string;
|
|
@@ -592,7 +577,6 @@ type WarpTransferAction = {
|
|
|
592
577
|
value?: string;
|
|
593
578
|
transfers?: string[];
|
|
594
579
|
inputs?: WarpActionInput[];
|
|
595
|
-
primary?: boolean;
|
|
596
580
|
auto?: boolean;
|
|
597
581
|
next?: WarpNextConfig;
|
|
598
582
|
when?: string;
|
|
@@ -609,7 +593,6 @@ type WarpContractAction = {
|
|
|
609
593
|
transfers?: string[];
|
|
610
594
|
abi?: string;
|
|
611
595
|
inputs?: WarpActionInput[];
|
|
612
|
-
primary?: boolean;
|
|
613
596
|
auto?: boolean;
|
|
614
597
|
next?: WarpNextConfig;
|
|
615
598
|
when?: string;
|
|
@@ -623,7 +606,6 @@ type WarpQueryAction = {
|
|
|
623
606
|
args?: string[];
|
|
624
607
|
abi?: string;
|
|
625
608
|
inputs?: WarpActionInput[];
|
|
626
|
-
primary?: boolean;
|
|
627
609
|
auto?: boolean;
|
|
628
610
|
next?: WarpNextConfig;
|
|
629
611
|
when?: string;
|
|
@@ -634,7 +616,6 @@ type WarpCollectAction = {
|
|
|
634
616
|
description?: WarpText | null;
|
|
635
617
|
destination?: WarpCollectDestination;
|
|
636
618
|
inputs?: WarpActionInput[];
|
|
637
|
-
primary?: boolean;
|
|
638
619
|
auto?: boolean;
|
|
639
620
|
next?: WarpNextConfig;
|
|
640
621
|
when?: string;
|
|
@@ -644,7 +625,6 @@ type WarpComputeAction = {
|
|
|
644
625
|
label: WarpText;
|
|
645
626
|
description?: WarpText | null;
|
|
646
627
|
inputs?: WarpActionInput[];
|
|
647
|
-
primary?: boolean;
|
|
648
628
|
auto?: boolean;
|
|
649
629
|
next?: WarpNextConfig;
|
|
650
630
|
when?: string;
|
|
@@ -661,7 +641,6 @@ type WarpLinkAction = {
|
|
|
661
641
|
description?: WarpText | null;
|
|
662
642
|
url: string;
|
|
663
643
|
inputs?: WarpActionInput[];
|
|
664
|
-
primary?: boolean;
|
|
665
644
|
auto?: boolean;
|
|
666
645
|
when?: string;
|
|
667
646
|
};
|
|
@@ -671,7 +650,6 @@ type WarpMcpAction = {
|
|
|
671
650
|
description?: WarpText | null;
|
|
672
651
|
destination?: WarpMcpDestination;
|
|
673
652
|
inputs?: WarpActionInput[];
|
|
674
|
-
primary?: boolean;
|
|
675
653
|
auto?: boolean;
|
|
676
654
|
next?: WarpNextConfig;
|
|
677
655
|
when?: string;
|
|
@@ -687,7 +665,6 @@ type WarpPromptAction = {
|
|
|
687
665
|
description?: WarpText | null;
|
|
688
666
|
prompt: WarpPlatformValue<string>;
|
|
689
667
|
inputs?: WarpActionInput[];
|
|
690
|
-
primary?: boolean;
|
|
691
668
|
auto?: boolean;
|
|
692
669
|
next?: WarpNextConfig;
|
|
693
670
|
when?: string;
|
|
@@ -831,8 +808,6 @@ declare const WarpChainLogos: Record<WarpChainName, WarpChainInfoLogo>;
|
|
|
831
808
|
*/
|
|
832
809
|
declare const getChainLogo: (chain: WarpChainName, variant?: "light" | "dark") => string;
|
|
833
810
|
|
|
834
|
-
declare const getEventNameFromWarp: (warp: Warp, alertName: string) => string | null;
|
|
835
|
-
|
|
836
811
|
declare const getWarpBrandLogoUrl: (brand: WarpBrand, config?: WarpClientConfig) => string;
|
|
837
812
|
declare const getWarpChainAssetLogoUrl: (asset: WarpChainAsset, config?: WarpClientConfig) => string | null;
|
|
838
813
|
declare const getWarpChainInfoLogoUrl: (chainInfo: WarpChainInfo, config?: WarpClientConfig) => string;
|
|
@@ -863,11 +838,11 @@ declare const extractWarpSecrets: (warp: Warp) => WarpSecret[];
|
|
|
863
838
|
declare const findWarpAdapterForChain: (chain: WarpChainName, adapters: ChainAdapter[]) => ChainAdapter;
|
|
864
839
|
declare const getLatestProtocolIdentifier: (name: ProtocolName) => string;
|
|
865
840
|
declare const getWarpActionByIndex: (warp: Warp, index: number) => WarpAction;
|
|
866
|
-
declare const
|
|
841
|
+
declare const getWarpInputAction: (warp: Warp) => {
|
|
867
842
|
action: WarpAction;
|
|
868
843
|
index: number;
|
|
869
844
|
};
|
|
870
|
-
declare const isWarpActionAutoExecute: (action: WarpAction
|
|
845
|
+
declare const isWarpActionAutoExecute: (action: WarpAction) => boolean;
|
|
871
846
|
declare const shiftBigintBy: (value: bigint | string | number, decimals: number) => bigint;
|
|
872
847
|
declare const toPreviewText: (text: string, maxChars?: number) => string;
|
|
873
848
|
declare const replacePlaceholders: (message: string, bag: Record<string, any>) => string;
|
|
@@ -1225,6 +1200,18 @@ type ExecutionHandlers = {
|
|
|
1225
1200
|
message: string;
|
|
1226
1201
|
chain: WarpChainInfo;
|
|
1227
1202
|
}) => string | Promise<string>;
|
|
1203
|
+
onPromptGenerate?: (prompt: string) => string | null | Promise<string | null>;
|
|
1204
|
+
onMountAction?: (params: {
|
|
1205
|
+
action: WarpAction;
|
|
1206
|
+
actionIndex: WarpActionIndex;
|
|
1207
|
+
warp: Warp;
|
|
1208
|
+
}) => void | Promise<void>;
|
|
1209
|
+
onLoop?: (params: {
|
|
1210
|
+
warp: Warp;
|
|
1211
|
+
inputs: string[];
|
|
1212
|
+
meta: Record<string, any>;
|
|
1213
|
+
delay: number;
|
|
1214
|
+
}) => void;
|
|
1228
1215
|
onActionExecuted?: (params: {
|
|
1229
1216
|
action: WarpActionIndex;
|
|
1230
1217
|
chain: WarpChainInfo | null;
|
|
@@ -1243,10 +1230,15 @@ declare class WarpExecutor {
|
|
|
1243
1230
|
private adapters;
|
|
1244
1231
|
private handlers?;
|
|
1245
1232
|
private factory;
|
|
1233
|
+
private loopIterations;
|
|
1234
|
+
private active;
|
|
1246
1235
|
constructor(config: WarpClientConfig, adapters: ChainAdapter[], handlers?: ExecutionHandlers | undefined);
|
|
1236
|
+
/** Stops any scheduled loop re-executions. */
|
|
1237
|
+
stop(): void;
|
|
1247
1238
|
execute(warp: Warp, inputs: string[], meta?: {
|
|
1248
1239
|
envs?: Record<string, any>;
|
|
1249
1240
|
queries?: Record<string, any>;
|
|
1241
|
+
scope?: string;
|
|
1250
1242
|
}): Promise<{
|
|
1251
1243
|
txs: WarpAdapterGenericTransaction[];
|
|
1252
1244
|
chain: WarpChainInfo | null;
|
|
@@ -1256,6 +1248,7 @@ declare class WarpExecutor {
|
|
|
1256
1248
|
executeAction(warp: Warp, actionIndex: WarpActionIndex, inputs: string[], meta?: {
|
|
1257
1249
|
envs?: Record<string, any>;
|
|
1258
1250
|
queries?: Record<string, any>;
|
|
1251
|
+
scope?: string;
|
|
1259
1252
|
}): Promise<{
|
|
1260
1253
|
tx: WarpAdapterGenericTransaction | null;
|
|
1261
1254
|
chain: WarpChainInfo | null;
|
|
@@ -1270,6 +1263,8 @@ declare class WarpExecutor {
|
|
|
1270
1263
|
private executeMcp;
|
|
1271
1264
|
private buildCollectResult;
|
|
1272
1265
|
private callHandler;
|
|
1266
|
+
private scheduleLoops;
|
|
1267
|
+
private executeState;
|
|
1273
1268
|
private executePrompt;
|
|
1274
1269
|
private evaluateWhenCondition;
|
|
1275
1270
|
}
|
|
@@ -1297,10 +1292,10 @@ declare class WarpInterpolator {
|
|
|
1297
1292
|
}): Warp;
|
|
1298
1293
|
private applyRootGlobals;
|
|
1299
1294
|
private applyActionGlobals;
|
|
1300
|
-
applyInputs(text: string, resolvedInputs: ResolvedInput[], serializer: WarpSerializer
|
|
1295
|
+
applyInputs(text: string, resolvedInputs: ResolvedInput[], serializer: WarpSerializer): string;
|
|
1301
1296
|
private applyGlobalsToText;
|
|
1302
1297
|
private replacePlaceholdersWithChain;
|
|
1303
|
-
buildInputBag(resolvedInputs: ResolvedInput[], serializer: WarpSerializer
|
|
1298
|
+
buildInputBag(resolvedInputs: ResolvedInput[], serializer: WarpSerializer): Record<string, string>;
|
|
1304
1299
|
}
|
|
1305
1300
|
|
|
1306
1301
|
declare class WarpFactory {
|
|
@@ -1311,6 +1306,7 @@ declare class WarpFactory {
|
|
|
1311
1306
|
private cache;
|
|
1312
1307
|
constructor(config: WarpClientConfig, adapters: ChainAdapter[]);
|
|
1313
1308
|
getSerializer(): WarpSerializer;
|
|
1309
|
+
getCache(): WarpCache;
|
|
1314
1310
|
getResolvedInputsFromCache(env: WarpChainEnv, warpHash: string | undefined, actionIndex: number): Promise<string[]>;
|
|
1315
1311
|
getRawResolvedInputsFromCache(env: WarpChainEnv, warpHash: string | undefined, actionIndex: number): Promise<ResolvedInput[]>;
|
|
1316
1312
|
createExecutable(warp: Warp, actionIndex: number, inputs: string[], meta?: {
|
|
@@ -1451,7 +1447,7 @@ declare class WarpValidator {
|
|
|
1451
1447
|
private config;
|
|
1452
1448
|
constructor(config: WarpClientConfig);
|
|
1453
1449
|
validate(warp: Warp): Promise<ValidationResult>;
|
|
1454
|
-
private
|
|
1450
|
+
private validateHasActions;
|
|
1455
1451
|
private validateMaxOneValuePosition;
|
|
1456
1452
|
private validateVariableNamesAndResultNamesUppercase;
|
|
1457
1453
|
private validateAbiIsSetIfApplicable;
|
|
@@ -1477,4 +1473,4 @@ declare function resolveInputs(trigger: WebhookTrigger, payload: unknown): Recor
|
|
|
1477
1473
|
*/
|
|
1478
1474
|
declare function resolvePath(obj: unknown, path: string): unknown;
|
|
1479
1475
|
|
|
1480
|
-
export { type AdapterTypeRegistry, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpOutput, type AdapterWarpRegistry, type AdapterWarpSerializer, type AdapterWarpWallet, type BaseWarpActionInputType, type BaseWarpBuilder, BrowserCryptoProvider, type BuiltInWarpWalletProvider, CLOUD_WALLET_PROVIDERS, CacheTtl, type ChainAdapter, type ChainAdapterFactory, type ClientCacheConfig, type ClientIndexConfig, type ClientTransformConfig, type CodecFunc, type CombinedWarpBuilder, type CryptoProvider, type DetectionResult, type DetectionResultFromHtml, EvmWalletChainNames, type ExecutionHandlers, type GeneratedSourceInfo, type GeneratedSourceType, type HttpAuthHeaders, type InterpolationBag, MultiversxWalletChainNames, NodeCryptoProvider, type ProtocolName, type ResolvedInput, type SignableMessage, type TransformRunner, WARP_LANGUAGES, type WalletCache, type WalletProvider, type WalletProviderFactory, type Warp, type WarpAbi, type WarpAbiContents, type WarpAction, type WarpActionExecutionResult, type WarpActionExecutionStatus, type WarpActionIndex, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputPositionAssetObject, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, type WarpAdapterGenericRemoteTransaction, type WarpAdapterGenericTransaction, type WarpAdapterGenericType, type WarpAdapterGenericValue,
|
|
1476
|
+
export { type AdapterTypeRegistry, type AdapterWarpAbiBuilder, type AdapterWarpBrandBuilder, type AdapterWarpBuilder, type AdapterWarpDataLoader, type AdapterWarpExecutor, type AdapterWarpExplorer, type AdapterWarpOutput, type AdapterWarpRegistry, type AdapterWarpSerializer, type AdapterWarpWallet, type BaseWarpActionInputType, type BaseWarpBuilder, BrowserCryptoProvider, type BuiltInWarpWalletProvider, CLOUD_WALLET_PROVIDERS, CacheTtl, type ChainAdapter, type ChainAdapterFactory, type ClientCacheConfig, type ClientIndexConfig, type ClientTransformConfig, type CodecFunc, type CombinedWarpBuilder, type CryptoProvider, type DetectionResult, type DetectionResultFromHtml, EvmWalletChainNames, type ExecutionHandlers, type GeneratedSourceInfo, type GeneratedSourceType, type HttpAuthHeaders, type InterpolationBag, MultiversxWalletChainNames, NodeCryptoProvider, type ProtocolName, type ResolvedInput, type SignableMessage, type TransformRunner, WARP_LANGUAGES, type WalletCache, type WalletProvider, type WalletProviderFactory, type Warp, type WarpAbi, type WarpAbiContents, type WarpAction, type WarpActionExecutionResult, type WarpActionExecutionStatus, type WarpActionIndex, type WarpActionInput, type WarpActionInputModifier, type WarpActionInputPosition, type WarpActionInputPositionAssetObject, type WarpActionInputSource, type WarpActionInputType, type WarpActionType, type WarpAdapterGenericRemoteTransaction, type WarpAdapterGenericTransaction, type WarpAdapterGenericType, type WarpAdapterGenericValue, WarpAssets, type WarpBrand, WarpBrandBuilder, type WarpBrandColors, type WarpBrandCta, type WarpBrandLogo, type WarpBrandLogoThemed, type WarpBrandUrls, WarpBuilder, WarpCache, type WarpCacheAdapter, type WarpCacheConfig, WarpCacheKey, type WarpChainAccount, type WarpChainAction, type WarpChainActionStatus, type WarpChainAsset, type WarpChainAssetLogo, type WarpChainAssetLogoThemed, type WarpChainAssetNftMetadata, type WarpChainAssetType, type WarpChainAssetValue, WarpChainDisplayNames, type WarpChainEnv, type WarpChainInfo, type WarpChainInfoLogo, type WarpChainInfoLogoThemed, WarpChainLogos, WarpChainName, WarpChainResolver, WarpClient, type WarpClientConfig, type WarpCollectAction, type WarpCollectDestination, type WarpCollectDestinationHttp, WarpCompositeResolver, type WarpComputeAction, WarpConfig, WarpConstants, type WarpContract, type WarpContractAction, type WarpContractVerification, type WarpDataLoaderOptions, type WarpExecutable, type WarpExecutionMessages, type WarpExecutionNextInfo, type WarpExecutionOutput, WarpExecutor, type WarpExplorerName, WarpFactory, type WarpI18nText, type WarpIdentifierType, WarpIndex, WarpInputTypes, WarpInterpolator, type WarpLinkAction, WarpLinkBuilder, WarpLinkDetecter, type WarpLocale, WarpLogger, type WarpLoopAction, type WarpMcpAction, type WarpMcpDestination, type WarpMessageName, type WarpMeta, type WarpMountAction, type WarpNativeValue, type WarpNextConfig, type WarpOutputName, WarpPlatformName, type WarpPlatformValue, WarpPlatforms, type WarpPromptAction, WarpProtocolVersions, type WarpProviderConfig, type WarpProviderPreferences, type WarpQueryAction, type WarpRegistryConfigInfo, type WarpRegistryInfo, type WarpResolver, type WarpResolverResult, type WarpResulutionPath, type WarpSchedule, type WarpSearchHit, type WarpSearchResult, type WarpSecret, WarpSerializer, type WarpStateAction, type WarpStructValue, type WarpText, type WarpTheme, type WarpTransferAction, type WarpTrigger, type WarpTrustStatus, type WarpTypeHandler, WarpTypeRegistry, type WarpUnmountAction, type WarpUser, type WarpUserWallets, WarpValidator, type WarpVarPlaceholder, type WarpWalletDetails, type WarpWalletProvider, address, applyOutputToMessages, asset, biguint, bool, buildGeneratedFallbackWarpIdentifier, buildGeneratedSourceWarpIdentifier, buildInputsContext, buildMappedOutput, buildNestedPayload, bytesToBase64, bytesToHex, checkWarpAssetBalance, cleanWarpIdentifier, createAuthHeaders, createAuthMessage, createCryptoProvider, createDefaultWalletProvider, createHttpAuthHeaders, createSignableMessage, createWarpI18nText, createWarpIdentifier, doesWarpRequireWallet, evaluateOutputCommon, evaluateWhenCondition, extractCollectOutput, extractIdentifierInfoFromUrl, extractPromptOutput, extractQueryStringFromIdentifier, extractQueryStringFromUrl, extractResolvedInputValues, extractWarpSecrets, findWarpAdapterForChain, getChainDisplayName, getChainLogo, getCryptoProvider, getGeneratedSourceWarpName, getLatestProtocolIdentifier, getMppFetch, getNextInfo, getNextInfoForStatus, getProviderConfig, getRandomBytes, getRandomHex, getRequiredAssetIds, getWalletFromConfigOrFail, getWarpActionByIndex, getWarpBrandLogoUrl, getWarpChainAssetLogoUrl, getWarpChainInfoLogoUrl, getWarpIdentifierWithQuery, getWarpInfoFromIdentifier, getWarpInputAction, getWarpWalletAddress, getWarpWalletAddressFromConfig, getWarpWalletExternalId, getWarpWalletExternalIdFromConfig, getWarpWalletExternalIdFromConfigOrFail, getWarpWalletMnemonic, getWarpWalletMnemonicFromConfig, getWarpWalletPrivateKey, getWarpWalletPrivateKeyFromConfig, hasInputPrefix, hex, initializeWalletCache, isEqualWarpIdentifier, isGeneratedSourcePrivateIdentifier, isPlatformValue, isWarpActionAutoExecute, isWarpI18nText, isWarpWalletReadOnly, matchesTrigger, mergeNestedPayload, normalizeAndValidateMnemonic, normalizeMnemonic, option, parseOutputOutIndex, parseSignedMessage, parseWarpQueryStringToObject, removeWarpChainPrefix, removeWarpWalletFromConfig, replacePlaceholders, replacePlaceholdersInWhenExpression, resolveInputs, resolveNextString, resolvePath, resolvePlatformValue, resolveWarpText, safeWindow, setCryptoProvider, setWarpWalletInConfig, shiftBigintBy, splitInput, stampGeneratedWarpMeta, string, struct, testCryptoAvailability, toInputPayloadValue, toPreviewText, tuple, uint16, uint32, uint64, uint8, validateMnemonicLength, validateSignedMessage, vector, withAdapterFallback };
|