@rhinestone/sdk 1.0.0-alpha.1 → 1.0.0-alpha.3
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/src/accounts/index.d.ts +3 -3
- package/dist/src/accounts/index.d.ts.map +1 -1
- package/dist/src/accounts/index.js +10 -9
- package/dist/src/accounts/kernel.d.ts +6 -6
- package/dist/src/accounts/kernel.d.ts.map +1 -1
- package/dist/src/accounts/nexus.d.ts +3 -3
- package/dist/src/accounts/nexus.d.ts.map +1 -1
- package/dist/src/accounts/safe.d.ts +3 -3
- package/dist/src/accounts/safe.d.ts.map +1 -1
- package/dist/src/accounts/utils.d.ts +4 -3
- package/dist/src/accounts/utils.d.ts.map +1 -1
- package/dist/src/accounts/utils.js +44 -0
- package/dist/src/actions/index.d.ts +5 -5
- package/dist/src/actions/index.d.ts.map +1 -1
- package/dist/src/actions/index.js +8 -4
- package/dist/src/actions/index.test.js +18 -0
- package/dist/src/actions/registry.d.ts +1 -1
- package/dist/src/actions/registry.d.ts.map +1 -1
- package/dist/src/actions/registry.test.js +1 -2
- package/dist/src/actions/smart-session.d.ts +2 -2
- package/dist/src/actions/smart-session.d.ts.map +1 -1
- package/dist/src/execution/compact.d.ts +6 -3
- package/dist/src/execution/compact.d.ts.map +1 -1
- package/dist/src/execution/compact.js +44 -1
- package/dist/src/execution/index.d.ts +2 -2
- package/dist/src/execution/index.d.ts.map +1 -1
- package/dist/src/execution/index.js +42 -12
- package/dist/src/execution/smart-session.d.ts +1 -1
- package/dist/src/execution/smart-session.d.ts.map +1 -1
- package/dist/src/execution/smart-session.js +10 -10
- package/dist/src/execution/utils.d.ts +7 -6
- package/dist/src/execution/utils.d.ts.map +1 -1
- package/dist/src/execution/utils.js +18 -12
- package/dist/src/index.d.ts +9 -9
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +13 -11
- package/dist/src/modules/read.d.ts +5 -5
- package/dist/src/modules/read.d.ts.map +1 -1
- package/dist/src/modules/read.js +7 -6
- package/dist/src/modules/registry.d.ts +2 -2
- package/dist/src/modules/registry.d.ts.map +1 -1
- package/dist/src/modules/validators/core.d.ts +1 -1
- package/dist/src/modules/validators/core.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.d.ts +3 -3
- package/dist/src/modules/validators/smart-sessions.d.ts.map +1 -1
- package/dist/src/modules/validators/smart-sessions.js +7 -6
- package/dist/src/orchestrator/client.d.ts.map +1 -1
- package/dist/src/orchestrator/index.d.ts +2 -2
- package/dist/src/orchestrator/index.d.ts.map +1 -1
- package/dist/src/orchestrator/index.js +1 -7
- package/dist/src/orchestrator/registry.d.ts +31 -12
- package/dist/src/orchestrator/registry.d.ts.map +1 -1
- package/dist/src/orchestrator/registry.js +56 -379
- package/dist/src/orchestrator/registry.json +356 -0
- package/dist/src/orchestrator/registry.test.d.ts +2 -0
- package/dist/src/orchestrator/registry.test.d.ts.map +1 -0
- package/dist/src/orchestrator/registry.test.js +137 -0
- package/dist/src/orchestrator/types.d.ts +1 -2
- package/dist/src/orchestrator/types.d.ts.map +1 -1
- package/dist/src/orchestrator/utils.d.ts.map +1 -1
- package/dist/src/types.d.ts +20 -17
- package/dist/src/types.d.ts.map +1 -1
- package/dist/test/consts.d.ts +2 -2
- package/dist/test/consts.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/smart-sessions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"smart-sessions.d.ts","sourceRoot":"","sources":["../../../../modules/validators/smart-sessions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,KAAK,EAKV,KAAK,GAAG,EAGR,KAAK,YAAY,EAKlB,MAAM,MAAM,CAAA;AAMb,OAAO,KAAK,EACV,WA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oB,CACjC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,QAAQ,CAAC,EAAE,cAAc;;;GAmB1B;AA0GD,iBAAS,wBAAwB,CAC/B,MAAM,EAAE,uBAAuB,GAC9B,MAAM,GAAG,IAAI,CAWf;AA8KD,iBAAe,gBAAgB,CAC7B,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,GAAG,oBAiClB;AAED,iBAAS,2BAA2B,CAClC,IAAI,EAAE,oBAAoB,EAC1B,YAAY,EAAE,GAAG,EACjB,SAAS,EAAE,GAAG,EACd,iBAAiB,CAAC,EAAE,iBAAiB,iBAyBtC;AAoKD,iBAAS,eAAe,CAAC,OAAO,EAAE,OAAO,iBAyBxC;AAED,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,gCAAgC,EAChC,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,2BAA2B,EAC3B,eAAe,EACf,gBAAgB,GACjB,CAAA;AACD,YAAY,EACV,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,WAAW,EACX,oBAAoB,GACrB,CAAA"}
|
|
@@ -9,6 +9,7 @@ exports.getPermissionId = getPermissionId;
|
|
|
9
9
|
exports.isSessionEnabled = isSessionEnabled;
|
|
10
10
|
const solady_1 = require("solady");
|
|
11
11
|
const viem_1 = require("viem");
|
|
12
|
+
const utils_1 = require("../../accounts/utils");
|
|
12
13
|
const orchestrator_1 = require("../../orchestrator");
|
|
13
14
|
const smart_sessions_1 = require("../abi/smart-sessions");
|
|
14
15
|
const common_1 = require("../common");
|
|
@@ -36,8 +37,8 @@ const ACTION_CONDITION_GREATER_THAN_OR_EQUAL = 3;
|
|
|
36
37
|
const ACTION_CONDITION_LESS_THAN_OR_EQUAL = 4;
|
|
37
38
|
const ACTION_CONDITION_NOT_EQUAL = 5;
|
|
38
39
|
const ACTION_CONDITION_IN_RANGE = 6;
|
|
39
|
-
async function getSessionData(chain, session) {
|
|
40
|
-
const { appDomainSeparator, contentsType } = await getSessionAllowedERC7739Content(chain);
|
|
40
|
+
async function getSessionData(chain, session, provider) {
|
|
41
|
+
const { appDomainSeparator, contentsType } = await getSessionAllowedERC7739Content(chain, provider);
|
|
41
42
|
const allowedERC7739Content = [
|
|
42
43
|
{
|
|
43
44
|
appDomainSeparator,
|
|
@@ -46,8 +47,8 @@ async function getSessionData(chain, session) {
|
|
|
46
47
|
];
|
|
47
48
|
return getSmartSessionData(chain, session, allowedERC7739Content);
|
|
48
49
|
}
|
|
49
|
-
async function getEnableSessionCall(chain, session) {
|
|
50
|
-
const { appDomainSeparator, contentsType } = await getSessionAllowedERC7739Content(chain);
|
|
50
|
+
async function getEnableSessionCall(chain, session, provider) {
|
|
51
|
+
const { appDomainSeparator, contentsType } = await getSessionAllowedERC7739Content(chain, provider);
|
|
51
52
|
const allowedERC7739Content = [
|
|
52
53
|
{
|
|
53
54
|
appDomainSeparator,
|
|
@@ -90,10 +91,10 @@ function getOmniAccountActions(chain) {
|
|
|
90
91
|
];
|
|
91
92
|
return omniActions;
|
|
92
93
|
}
|
|
93
|
-
async function getSessionAllowedERC7739Content(chain) {
|
|
94
|
+
async function getSessionAllowedERC7739Content(chain, provider) {
|
|
94
95
|
const publicClient = (0, viem_1.createPublicClient)({
|
|
95
96
|
chain,
|
|
96
|
-
transport: (0,
|
|
97
|
+
transport: (0, utils_1.createTransport)(chain, provider),
|
|
97
98
|
});
|
|
98
99
|
const appDomainSeparator = await publicClient.readContract({
|
|
99
100
|
address: omni_account_1.HOOK_ADDRESS,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,MAAM,CAAA;AAe3C,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../orchestrator/client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,OAAO,EAAU,MAAM,MAAM,CAAA;AAe3C,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,YAAY,EACZ,WAAW,EACX,SAAS,EAET,cAAc,EACf,MAAM,SAAS,CAAA;AAGhB,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,MAAM,CAAQ;gBAEV,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAKvC,YAAY,CAChB,WAAW,EAAE,OAAO,EACpB,MAAM,CAAC,EAAE;QACP,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,MAAM,CAAC,EAAE;YACP,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;SAC7B,CAAA;KACF,GACA,OAAO,CAAC,SAAS,CAAC;IAmDf,iBAAiB,CACrB,WAAW,EAAE,OAAO,EACpB,kBAAkB,EAAE,MAAM,EAC1B,uBAAuB,EAAE,OAAO,EAChC,mBAAmB,EAAE,MAAM,GAC1B,OAAO,CAAC,MAAM,CAAC;IAmCZ,aAAa,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAqBtD,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IAgBxD,YAAY,CAAC,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAgBnE,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAalE,OAAO,CAAC,UAAU;CAwHnB"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Orchestrator } from './client';
|
|
2
2
|
import { RHINESTONE_SPOKE_POOL_ADDRESS } from './consts';
|
|
3
3
|
import { AuthenticationRequiredError, InsufficientBalanceError, IntentNotFoundError, InvalidApiKeyError, InvalidIntentSignatureError, isOrchestratorError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError } from './error';
|
|
4
|
-
import {
|
|
4
|
+
import { getSupportedTokens, getTokenAddress, getTokenSymbol, getWethAddress, isTokenAddressSupported } from './registry';
|
|
5
5
|
import type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, Portfolio, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig } from './types';
|
|
6
6
|
import { INTENT_STATUS_COMPLETED, INTENT_STATUS_EXPIRED, INTENT_STATUS_FAILED, INTENT_STATUS_FILLED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_PENDING, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN } from './types';
|
|
7
7
|
import { getIntentOpHash } from './utils';
|
|
8
8
|
declare function getOrchestrator(apiKey: string, orchestratorUrl?: string): Orchestrator;
|
|
9
9
|
export type { IntentCost, IntentInput, IntentOp, IntentOpStatus, IntentResult, IntentRoute, SettlementSystem, SignedIntentOp, SupportedChain, TokenConfig, Portfolio, };
|
|
10
|
-
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getIntentOpHash, getWethAddress,
|
|
10
|
+
export { INTENT_STATUS_PENDING, INTENT_STATUS_EXPIRED, INTENT_STATUS_PARTIALLY_COMPLETED, INTENT_STATUS_COMPLETED, INTENT_STATUS_FILLED, INTENT_STATUS_FAILED, INTENT_STATUS_PRECONFIRMED, INTENT_STATUS_UNKNOWN, RHINESTONE_SPOKE_POOL_ADDRESS, Orchestrator, AuthenticationRequiredError, InsufficientBalanceError, InvalidApiKeyError, InvalidIntentSignatureError, NoPathFoundError, OnlyOneTargetTokenAmountCanBeUnsetError, OrchestratorError, IntentNotFoundError, TokenNotSupportedError, UnsupportedChainError, UnsupportedChainIdError, UnsupportedTokenError, getOrchestrator, getIntentOpHash, getWethAddress, getTokenSymbol, getTokenAddress, getSupportedTokens, isOrchestratorError, isTokenAddressSupported, };
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../orchestrator/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAyB,6BAA6B,EAAE,MAAM,UAAU,CAAA;AAC/E,OAAO,EACL,2BAA2B,EAC3B,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,2BAA2B,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,uCAAuC,EACvC,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB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
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.
|
|
3
|
+
exports.isTokenAddressSupported = exports.isOrchestratorError = exports.getSupportedTokens = exports.getTokenAddress = exports.getTokenSymbol = exports.getWethAddress = exports.getIntentOpHash = exports.UnsupportedTokenError = exports.UnsupportedChainIdError = exports.UnsupportedChainError = exports.TokenNotSupportedError = exports.IntentNotFoundError = exports.OrchestratorError = exports.OnlyOneTargetTokenAmountCanBeUnsetError = exports.NoPathFoundError = exports.InvalidIntentSignatureError = exports.InvalidApiKeyError = exports.InsufficientBalanceError = exports.AuthenticationRequiredError = exports.Orchestrator = exports.RHINESTONE_SPOKE_POOL_ADDRESS = exports.INTENT_STATUS_UNKNOWN = exports.INTENT_STATUS_PRECONFIRMED = exports.INTENT_STATUS_FAILED = exports.INTENT_STATUS_FILLED = exports.INTENT_STATUS_COMPLETED = exports.INTENT_STATUS_PARTIALLY_COMPLETED = exports.INTENT_STATUS_EXPIRED = exports.INTENT_STATUS_PENDING = void 0;
|
|
4
4
|
exports.getOrchestrator = getOrchestrator;
|
|
5
5
|
const client_1 = require("./client");
|
|
6
6
|
Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return client_1.Orchestrator; } });
|
|
@@ -21,14 +21,8 @@ Object.defineProperty(exports, "UnsupportedChainError", { enumerable: true, get:
|
|
|
21
21
|
Object.defineProperty(exports, "UnsupportedChainIdError", { enumerable: true, get: function () { return error_1.UnsupportedChainIdError; } });
|
|
22
22
|
Object.defineProperty(exports, "UnsupportedTokenError", { enumerable: true, get: function () { return error_1.UnsupportedTokenError; } });
|
|
23
23
|
const registry_1 = require("./registry");
|
|
24
|
-
Object.defineProperty(exports, "getHookAddress", { enumerable: true, get: function () { return registry_1.getHookAddress; } });
|
|
25
|
-
Object.defineProperty(exports, "getRhinestoneSpokePoolAddress", { enumerable: true, get: function () { return registry_1.getRhinestoneSpokePoolAddress; } });
|
|
26
|
-
Object.defineProperty(exports, "getSameChainModuleAddress", { enumerable: true, get: function () { return registry_1.getSameChainModuleAddress; } });
|
|
27
24
|
Object.defineProperty(exports, "getSupportedTokens", { enumerable: true, get: function () { return registry_1.getSupportedTokens; } });
|
|
28
|
-
Object.defineProperty(exports, "getTargetModuleAddress", { enumerable: true, get: function () { return registry_1.getTargetModuleAddress; } });
|
|
29
25
|
Object.defineProperty(exports, "getTokenAddress", { enumerable: true, get: function () { return registry_1.getTokenAddress; } });
|
|
30
|
-
Object.defineProperty(exports, "getTokenBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenBalanceSlot; } });
|
|
31
|
-
Object.defineProperty(exports, "getTokenRootBalanceSlot", { enumerable: true, get: function () { return registry_1.getTokenRootBalanceSlot; } });
|
|
32
26
|
Object.defineProperty(exports, "getTokenSymbol", { enumerable: true, get: function () { return registry_1.getTokenSymbol; } });
|
|
33
27
|
Object.defineProperty(exports, "getWethAddress", { enumerable: true, get: function () { return registry_1.getWethAddress; } });
|
|
34
28
|
Object.defineProperty(exports, "isTokenAddressSupported", { enumerable: true, get: function () { return registry_1.isTokenAddressSupported; } });
|
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import { type Address, type Chain
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { type Address, type Chain } from 'viem';
|
|
2
|
+
import type { TokenSymbol } from '../types';
|
|
3
|
+
import type { TokenConfig } from './types';
|
|
4
|
+
interface TokenEntry {
|
|
5
|
+
symbol: string;
|
|
6
|
+
address: Address;
|
|
7
|
+
decimals: number;
|
|
8
|
+
balanceSlot: number | null;
|
|
9
|
+
}
|
|
10
|
+
interface ChainContracts {
|
|
11
|
+
spokepool: Address;
|
|
12
|
+
hook: Address;
|
|
13
|
+
originModule: Address;
|
|
14
|
+
targetModule: Address;
|
|
15
|
+
sameChainModule: Address;
|
|
16
|
+
}
|
|
17
|
+
interface ChainEntry {
|
|
18
|
+
name: string;
|
|
19
|
+
contracts: ChainContracts;
|
|
20
|
+
tokens: TokenEntry[];
|
|
21
|
+
}
|
|
22
|
+
interface Registry {
|
|
23
|
+
[chainId: string]: ChainEntry;
|
|
24
|
+
}
|
|
25
|
+
declare function getSupportedChainIds(): number[];
|
|
26
|
+
declare function getWethAddress(chain: Chain): Address;
|
|
10
27
|
declare function getTokenSymbol(tokenAddress: Address, chainId: number): string;
|
|
11
|
-
declare function getTokenAddress(tokenSymbol:
|
|
28
|
+
declare function getTokenAddress(tokenSymbol: TokenSymbol, chainId: number): Address;
|
|
12
29
|
declare function getChainById(chainId: number): Chain | undefined;
|
|
13
30
|
declare function isTestnet(chainId: number): boolean;
|
|
14
31
|
declare function isTokenAddressSupported(address: Address, chainId: number): boolean;
|
|
15
32
|
declare function getSupportedTokens(chainId: number): TokenConfig[];
|
|
16
33
|
declare function getDefaultAccountAccessList(onTestnets?: boolean): {
|
|
17
|
-
chainIds:
|
|
34
|
+
chainIds: number[];
|
|
18
35
|
};
|
|
19
|
-
|
|
36
|
+
declare function resolveTokenAddress(token: TokenSymbol | Address, chainId: number): Address;
|
|
37
|
+
export { getTokenSymbol, getTokenAddress, getWethAddress, getChainById, getSupportedTokens, getSupportedChainIds, isTestnet, isTokenAddressSupported, getDefaultAccountAccessList, resolveTokenAddress, };
|
|
38
|
+
export type { TokenEntry, ChainContracts, ChainEntry, Registry };
|
|
20
39
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../orchestrator/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,KAAK,EAA0B,MAAM,MA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