@termix-it/vue-tool 1.0.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/README.md +650 -0
- package/dist/adapters/EthersV5Adapter.d.ts +20 -0
- package/dist/adapters/EthersV5Adapter.d.ts.map +1 -0
- package/dist/adapters/EthersV6Adapter.d.ts +20 -0
- package/dist/adapters/EthersV6Adapter.d.ts.map +1 -0
- package/dist/components/AP2PaymentFlow.vue.d.ts +44 -0
- package/dist/components/AP2PaymentFlow.vue.d.ts.map +1 -0
- package/dist/components/ChatInterface.vue.d.ts +67 -0
- package/dist/components/ChatInterface.vue.d.ts.map +1 -0
- package/dist/components/ChatWidget.vue.d.ts +80 -0
- package/dist/components/ChatWidget.vue.d.ts.map +1 -0
- package/dist/components/FunctionCallDisplay.vue.d.ts +38 -0
- package/dist/components/FunctionCallDisplay.vue.d.ts.map +1 -0
- package/dist/components/PaymentApprovalModal.vue.d.ts +46 -0
- package/dist/components/PaymentApprovalModal.vue.d.ts.map +1 -0
- package/dist/components/SourcesBadge.vue.d.ts +20 -0
- package/dist/components/SourcesBadge.vue.d.ts.map +1 -0
- package/dist/components/WalletConnect.vue.d.ts +24 -0
- package/dist/components/WalletConnect.vue.d.ts.map +1 -0
- package/dist/components/WalletIndicator.vue.d.ts +33 -0
- package/dist/components/WalletIndicator.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/composables/index.d.ts +10 -0
- package/dist/composables/index.d.ts.map +1 -0
- package/dist/composables/useAP2Payment.d.ts +96 -0
- package/dist/composables/useAP2Payment.d.ts.map +1 -0
- package/dist/composables/useDI.d.ts +75 -0
- package/dist/composables/useDI.d.ts.map +1 -0
- package/dist/composables/useInternalDI.d.ts +23 -0
- package/dist/composables/useInternalDI.d.ts.map +1 -0
- package/dist/composables/useToast.d.ts +14 -0
- package/dist/composables/useToast.d.ts.map +1 -0
- package/dist/core/container.d.ts +99 -0
- package/dist/core/container.d.ts.map +1 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/internal-container.d.ts +26 -0
- package/dist/core/internal-container.d.ts.map +1 -0
- package/dist/core/tokens.d.ts +44 -0
- package/dist/core/tokens.d.ts.map +1 -0
- package/dist/core/types.d.ts +104 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/executors/AP2Executor.d.ts +20 -0
- package/dist/executors/AP2Executor.d.ts.map +1 -0
- package/dist/executors/APIExecutor.d.ts +35 -0
- package/dist/executors/APIExecutor.d.ts.map +1 -0
- package/dist/executors/ContractExecutor.d.ts +41 -0
- package/dist/executors/ContractExecutor.d.ts.map +1 -0
- package/dist/executors/ExecutorRegistry.d.ts +99 -0
- package/dist/executors/ExecutorRegistry.d.ts.map +1 -0
- package/dist/executors/FiatExecutor.d.ts +31 -0
- package/dist/executors/FiatExecutor.d.ts.map +1 -0
- package/dist/executors/base/BaseExecutor.d.ts +87 -0
- package/dist/executors/base/BaseExecutor.d.ts.map +1 -0
- package/dist/executors/base/index.d.ts +2 -0
- package/dist/executors/base/index.d.ts.map +1 -0
- package/dist/executors/index.d.ts +7 -0
- package/dist/executors/index.d.ts.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +17473 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/IAPIClient.d.ts +179 -0
- package/dist/interfaces/IAPIClient.d.ts.map +1 -0
- package/dist/interfaces/IEthersAdapter.d.ts +116 -0
- package/dist/interfaces/IEthersAdapter.d.ts.map +1 -0
- package/dist/interfaces/IExecutor.d.ts +64 -0
- package/dist/interfaces/IExecutor.d.ts.map +1 -0
- package/dist/interfaces/IRenderer.d.ts +117 -0
- package/dist/interfaces/IRenderer.d.ts.map +1 -0
- package/dist/interfaces/index.d.ts +5 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/lib/markdown.d.ts +21 -0
- package/dist/lib/markdown.d.ts.map +1 -0
- package/dist/lib/utils.d.ts +72 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/renderers/AP2Renderer.d.ts +12 -0
- package/dist/renderers/AP2Renderer.d.ts.map +1 -0
- package/dist/renderers/APIRenderer.d.ts +12 -0
- package/dist/renderers/APIRenderer.d.ts.map +1 -0
- package/dist/renderers/BaseRenderer.d.ts +16 -0
- package/dist/renderers/BaseRenderer.d.ts.map +1 -0
- package/dist/renderers/ContractRenderer.d.ts +14 -0
- package/dist/renderers/ContractRenderer.d.ts.map +1 -0
- package/dist/renderers/FiatRenderer.d.ts +12 -0
- package/dist/renderers/FiatRenderer.d.ts.map +1 -0
- package/dist/renderers/RendererRegistry.d.ts +78 -0
- package/dist/renderers/RendererRegistry.d.ts.map +1 -0
- package/dist/renderers/index.d.ts +12 -0
- package/dist/renderers/index.d.ts.map +1 -0
- package/dist/services/api.d.ts +55 -0
- package/dist/services/api.d.ts.map +1 -0
- package/dist/services/functionCallExecutor.d.ts +32 -0
- package/dist/services/functionCallExecutor.d.ts.map +1 -0
- package/dist/services/moonpayService.d.ts +82 -0
- package/dist/services/moonpayService.d.ts.map +1 -0
- package/dist/services/toolCallProcessor.d.ts +12 -0
- package/dist/services/toolCallProcessor.d.ts.map +1 -0
- package/dist/services/walletService.d.ts +250 -0
- package/dist/services/walletService.d.ts.map +1 -0
- package/dist/style.css +1 -0
- package/dist/types/index.d.ts +109 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/moonpay.d.ts +31 -0
- package/dist/types/moonpay.d.ts.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { BaseRenderer } from './BaseRenderer';
|
|
3
|
+
import { RendererProps } from '../interfaces/IRenderer';
|
|
4
|
+
import { ExecutionResult, FunctionCall } from '../types';
|
|
5
|
+
|
|
6
|
+
export declare class ContractRenderer extends BaseRenderer {
|
|
7
|
+
readonly type = "contract";
|
|
8
|
+
readonly name = "ContractRenderer";
|
|
9
|
+
protected renderContent(props: RendererProps): VNode;
|
|
10
|
+
renderResult(result: ExecutionResult, functionCall: FunctionCall): VNode;
|
|
11
|
+
private truncateAddress;
|
|
12
|
+
private truncateHash;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ContractRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContractRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/ContractRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzD,qBACa,gBAAiB,SAAQ,YAAY;IAChD,QAAQ,CAAC,IAAI,cAAc;IAC3B,QAAQ,CAAC,IAAI,sBAAsB;IAEnC,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IA6BpD,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAG,KAAK;IAyCxE,OAAO,CAAC,eAAe;IAKvB,OAAO,CAAC,YAAY;CAIrB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { BaseRenderer } from './BaseRenderer';
|
|
3
|
+
import { RendererProps } from '../interfaces/IRenderer';
|
|
4
|
+
import { ExecutionResult, FunctionCall } from '../types';
|
|
5
|
+
|
|
6
|
+
export declare class FiatRenderer extends BaseRenderer {
|
|
7
|
+
readonly type = "fiat";
|
|
8
|
+
readonly name = "FiatRenderer";
|
|
9
|
+
protected renderContent(props: RendererProps): VNode;
|
|
10
|
+
renderResult(result: ExecutionResult, functionCall: FunctionCall): VNode;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=FiatRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FiatRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/FiatRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAEzD,qBACa,YAAa,SAAQ,YAAY;IAC5C,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,IAAI,kBAAkB;IAE/B,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IA2BpD,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAG,KAAK;CAqCzE"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { IRenderer, RendererProps } from '../interfaces/IRenderer';
|
|
3
|
+
import { FunctionCall } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Renderer registry manages all registered renderers
|
|
7
|
+
* and routes function calls to the appropriate renderer for display
|
|
8
|
+
*/
|
|
9
|
+
export declare class RendererRegistry {
|
|
10
|
+
private rendererMap;
|
|
11
|
+
constructor(apiRenderer: IRenderer, contractRenderer: IRenderer, fiatRenderer: IRenderer, ap2Renderer: IRenderer);
|
|
12
|
+
/**
|
|
13
|
+
* Register a renderer
|
|
14
|
+
*
|
|
15
|
+
* @param renderer - Renderer instance to register
|
|
16
|
+
*/
|
|
17
|
+
register(renderer: IRenderer): void;
|
|
18
|
+
/**
|
|
19
|
+
* Unregister a renderer
|
|
20
|
+
*
|
|
21
|
+
* @param type - Renderer type to unregister
|
|
22
|
+
*/
|
|
23
|
+
unregister(type: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get a renderer by type
|
|
26
|
+
*
|
|
27
|
+
* @param type - Renderer type
|
|
28
|
+
* @returns Renderer instance or undefined
|
|
29
|
+
*/
|
|
30
|
+
getRenderer(type: string): IRenderer | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Check if a renderer is registered
|
|
33
|
+
*
|
|
34
|
+
* @param type - Renderer type
|
|
35
|
+
* @returns True if renderer is registered
|
|
36
|
+
*/
|
|
37
|
+
hasRenderer(type: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Get all registered renderers
|
|
40
|
+
*
|
|
41
|
+
* @returns Array of all renderer instances
|
|
42
|
+
*/
|
|
43
|
+
getAllRenderers(): IRenderer[];
|
|
44
|
+
/**
|
|
45
|
+
* Get all registered renderer types
|
|
46
|
+
*
|
|
47
|
+
* @returns Array of renderer type strings
|
|
48
|
+
*/
|
|
49
|
+
getRendererTypes(): string[];
|
|
50
|
+
/**
|
|
51
|
+
* Find the appropriate renderer for a function call
|
|
52
|
+
*
|
|
53
|
+
* Uses the renderer's canRender method to determine if it can render the call.
|
|
54
|
+
* Falls back to type-based matching if no renderer claims to handle it.
|
|
55
|
+
*
|
|
56
|
+
* @param functionCall - Function call to find renderer for
|
|
57
|
+
* @returns Renderer instance or undefined
|
|
58
|
+
*/
|
|
59
|
+
findRenderer(functionCall: FunctionCall): IRenderer | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Render a function call
|
|
62
|
+
*
|
|
63
|
+
* Automatically finds the appropriate renderer and renders the call.
|
|
64
|
+
*
|
|
65
|
+
* @param props - Renderer props including function call and context
|
|
66
|
+
* @returns VNode to render
|
|
67
|
+
*/
|
|
68
|
+
render(props: RendererProps): VNode;
|
|
69
|
+
/**
|
|
70
|
+
* Render fallback UI when no renderer is found
|
|
71
|
+
*/
|
|
72
|
+
private renderFallback;
|
|
73
|
+
/**
|
|
74
|
+
* Render error UI
|
|
75
|
+
*/
|
|
76
|
+
private renderError;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=RendererRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RendererRegistry.d.ts","sourceRoot":"","sources":["../../src/renderers/RendererRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC;;;GAGG;AACH,qBACa,gBAAgB;IAE3B,OAAO,CAAC,WAAW,CAAqC;gBAI1B,WAAW,EAAE,SAAS,EACjB,gBAAgB,EAAE,SAAS,EAC/B,YAAY,EAAE,SAAS,EACxB,WAAW,EAAE,SAAS;IAWpD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,GAAG,IAAI;IAWnC;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAQjC;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAIhD;;;;;OAKG;IACH,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIlC;;;;OAIG;IACH,eAAe,IAAI,SAAS,EAAE;IAI9B;;;;OAIG;IACH,gBAAgB,IAAI,MAAM,EAAE;IAI5B;;;;;;;;OAQG;IACH,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG,SAAS,GAAG,SAAS;IAoB/D;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IA0BnC;;OAEG;IACH,OAAO,CAAC,cAAc;IAoBtB;;OAEG;IACH,OAAO,CAAC,WAAW;CAgBpB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renderers
|
|
3
|
+
*
|
|
4
|
+
* Central export point for all renderer implementations.
|
|
5
|
+
*/
|
|
6
|
+
export * from './BaseRenderer';
|
|
7
|
+
export * from './APIRenderer';
|
|
8
|
+
export * from './ContractRenderer';
|
|
9
|
+
export * from './FiatRenderer';
|
|
10
|
+
export * from './AP2Renderer';
|
|
11
|
+
export * from './RendererRegistry';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/renderers/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { KnowledgeContext } from '../types';
|
|
2
|
+
import { IAPIClient } from '../interfaces/IAPIClient';
|
|
3
|
+
|
|
4
|
+
export declare const API_PREFIX: string;
|
|
5
|
+
export declare class APIService implements IAPIClient {
|
|
6
|
+
private client;
|
|
7
|
+
private parsedEndpointsCache;
|
|
8
|
+
private parsedContractsCache;
|
|
9
|
+
private ap2ToolsCache;
|
|
10
|
+
private pendingEndpointsRequest;
|
|
11
|
+
private pendingContractsRequest;
|
|
12
|
+
private pendingAp2ToolsRequest;
|
|
13
|
+
constructor(baseUrl?: string, authorization?: string);
|
|
14
|
+
chat(projectId: string, data: {
|
|
15
|
+
sessionId?: string;
|
|
16
|
+
aiConfigId: string;
|
|
17
|
+
messages: Array<{
|
|
18
|
+
role: string;
|
|
19
|
+
content: string;
|
|
20
|
+
}>;
|
|
21
|
+
includeContext: boolean;
|
|
22
|
+
executeTools: boolean;
|
|
23
|
+
knowledgeContext?: KnowledgeContext[];
|
|
24
|
+
}): Promise<any>;
|
|
25
|
+
chatStream(projectId: string, data: {
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
aiConfigId: string;
|
|
28
|
+
messages: Array<{
|
|
29
|
+
role: string;
|
|
30
|
+
content: string;
|
|
31
|
+
}>;
|
|
32
|
+
includeContext: boolean;
|
|
33
|
+
executeTools: boolean;
|
|
34
|
+
knowledgeContext?: KnowledgeContext[];
|
|
35
|
+
}, onMessage: (data: string) => void, onError?: (error: Error) => void, onComplete?: (sessionId?: string) => void, onToolCall?: (toolCalls: any[]) => void): Promise<() => void>;
|
|
36
|
+
searchKnowledge(projectId: string, query: string): Promise<any>;
|
|
37
|
+
getAllKnowledge(projectId: string): Promise<any>;
|
|
38
|
+
getAP2Tools(projectId: string): Promise<any>;
|
|
39
|
+
getAP2Config(projectId: string): Promise<any>;
|
|
40
|
+
getParsedEndpoints(projectId: string): Promise<any>;
|
|
41
|
+
getParsedContracts(projectId: string): Promise<any>;
|
|
42
|
+
getAIConfig(projectId: string, configId: string): Promise<any>;
|
|
43
|
+
submitPaymentSignature(projectId: string, sessionId: string, data: {
|
|
44
|
+
sessionId: string;
|
|
45
|
+
signature: string;
|
|
46
|
+
mandateType: string;
|
|
47
|
+
}): Promise<any>;
|
|
48
|
+
submitPaymentTxHash(projectId: string, sessionId: string, txHash: string): Promise<any>;
|
|
49
|
+
executeAP2Tool(projectId: string, data: {
|
|
50
|
+
toolName: string;
|
|
51
|
+
params: any;
|
|
52
|
+
sessionId?: string;
|
|
53
|
+
}): Promise<any>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/services/api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAItD,eAAO,MAAM,UAAU,QAA6C,CAAC;AAQrE,qBACa,UAAW,YAAW,UAAU;IAC3C,OAAO,CAAC,MAAM,CAAgB;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;IAsHhB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAUhD,eAAe,CAAC,SAAS,EAAE,MAAM;IAQjC,WAAW,CAAC,SAAS,EAAE,MAAM;IAkC7B,YAAY,CAAC,SAAS,EAAE,MAAM;IAQ9B,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAiCpC,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAkCpC,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IA+B/C,sBAAsB,CAC1B,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;QACJ,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB;IASG,mBAAmB,CACvB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM;IAUV,cAAc,CAClB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE;QACJ,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,GAAG,CAAC;QACZ,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB;CAQJ"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FunctionCall, ExecutionResult, DomainHeaderConfig } from '../types';
|
|
2
|
+
import { ExecutionContext } from '../core/types';
|
|
3
|
+
import { ExecutorRegistry } from '../executors/ExecutorRegistry';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Interface for FunctionCallExecutor
|
|
7
|
+
*/
|
|
8
|
+
export interface IFunctionCallExecutor {
|
|
9
|
+
execute(functionCall: FunctionCall, contextOverride?: Partial<ExecutionContext>): Promise<ExecutionResult>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* FunctionCallExecutor now acts as a lightweight orchestrator
|
|
13
|
+
* that delegates all execution to the ExecutorRegistry
|
|
14
|
+
*/
|
|
15
|
+
export declare class FunctionCallExecutor implements IFunctionCallExecutor {
|
|
16
|
+
private executorRegistry;
|
|
17
|
+
private domainHeaders?;
|
|
18
|
+
private authorization?;
|
|
19
|
+
constructor(executorRegistry: ExecutorRegistry, domainHeaders?: DomainHeaderConfig[] | undefined, authorization?: string | undefined);
|
|
20
|
+
/**
|
|
21
|
+
* Execute a function call by delegating to ExecutorRegistry
|
|
22
|
+
*
|
|
23
|
+
* This method builds the execution context and delegates to the appropriate executor.
|
|
24
|
+
* The ExecutorRegistry automatically routes the call to the correct executor based on type.
|
|
25
|
+
*
|
|
26
|
+
* @param functionCall - The function call to execute
|
|
27
|
+
* @param contextOverride - Optional context properties to override/merge with default context
|
|
28
|
+
* @returns Execution result from the executor
|
|
29
|
+
*/
|
|
30
|
+
execute(functionCall: FunctionCall, contextOverride?: Partial<ExecutionContext>): Promise<ExecutionResult>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=functionCallExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functionCallExecutor.d.ts","sourceRoot":"","sources":["../../src/services/functionCallExecutor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5G;AAED;;;GAGG;AACH,qBACa,oBAAqB,YAAW,qBAAqB;IAE7B,OAAO,CAAC,gBAAgB;IACf,OAAO,CAAC,aAAa,CAAC;IACtB,OAAO,CAAC,aAAa,CAAC;gBAFvB,gBAAgB,EAAE,gBAAgB,EACzB,aAAa,CAAC,EAAE,kBAAkB,EAAE,YAAA,EACpC,aAAa,CAAC,EAAE,MAAM,YAAA;IAK1E;;;;;;;;;OASG;IACG,OAAO,CAAC,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;CAwCjH"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MoonPay Integration Service
|
|
3
|
+
* Handles MoonPay Web SDK integration with proper event handling
|
|
4
|
+
*/
|
|
5
|
+
export interface MoonPayTransactionEvent {
|
|
6
|
+
type: string;
|
|
7
|
+
transactionId?: string;
|
|
8
|
+
transactionStatus?: string;
|
|
9
|
+
status?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
failureReason?: string;
|
|
12
|
+
data?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface MoonPayConfig {
|
|
15
|
+
apiKey?: string;
|
|
16
|
+
environment?: 'sandbox' | 'production';
|
|
17
|
+
baseUrl?: {
|
|
18
|
+
buy: string;
|
|
19
|
+
sell: string;
|
|
20
|
+
api: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Interface for MoonPay service operations
|
|
25
|
+
*/
|
|
26
|
+
export interface IMoonPayService {
|
|
27
|
+
createBuyTransaction(params: any): Promise<any>;
|
|
28
|
+
createSellTransaction(params: any): Promise<any>;
|
|
29
|
+
getTransactionStatus(transactionId: string): any;
|
|
30
|
+
cancelTransaction(transactionId: string): boolean;
|
|
31
|
+
getActiveTransactions(): string[];
|
|
32
|
+
}
|
|
33
|
+
export declare class MoonPayService implements IMoonPayService {
|
|
34
|
+
private config;
|
|
35
|
+
private activeTransactions;
|
|
36
|
+
private sdkLoaded;
|
|
37
|
+
private sdkLoadPromise;
|
|
38
|
+
constructor(sdkConfig?: any);
|
|
39
|
+
/**
|
|
40
|
+
* Load MoonPay Web SDK dynamically
|
|
41
|
+
*/
|
|
42
|
+
private loadSDK;
|
|
43
|
+
/**
|
|
44
|
+
* Get MoonPay SDK instance
|
|
45
|
+
*/
|
|
46
|
+
private getSDK;
|
|
47
|
+
/**
|
|
48
|
+
* Create a MoonPay buy transaction with proper event handling
|
|
49
|
+
*/
|
|
50
|
+
createBuyTransaction(params: {
|
|
51
|
+
currencyCode: string;
|
|
52
|
+
baseCurrencyCode: string;
|
|
53
|
+
baseCurrencyAmount: number;
|
|
54
|
+
walletAddress: string;
|
|
55
|
+
redirectURL?: string;
|
|
56
|
+
onStatusUpdate?: (status: string, data?: any) => void;
|
|
57
|
+
}): Promise<any>;
|
|
58
|
+
/**
|
|
59
|
+
* Create a MoonPay sell transaction with proper event handling
|
|
60
|
+
*/
|
|
61
|
+
createSellTransaction(params: {
|
|
62
|
+
currencyCode: string;
|
|
63
|
+
baseCurrencyCode: string;
|
|
64
|
+
quoteCurrencyAmount: number;
|
|
65
|
+
refundWalletAddress: string;
|
|
66
|
+
redirectURL?: string;
|
|
67
|
+
onStatusUpdate?: (status: string, data?: any) => void;
|
|
68
|
+
}): Promise<any>;
|
|
69
|
+
/**
|
|
70
|
+
* Get transaction status by ID
|
|
71
|
+
*/
|
|
72
|
+
getTransactionStatus(transactionId: string): any;
|
|
73
|
+
/**
|
|
74
|
+
* Cancel a transaction
|
|
75
|
+
*/
|
|
76
|
+
cancelTransaction(transactionId: string): boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Get all active transactions
|
|
79
|
+
*/
|
|
80
|
+
getActiveTransactions(): string[];
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=moonpayService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moonpayService.d.ts","sourceRoot":"","sources":["../../src/services/moonpayService.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,CAAC,EAAE,MAAM,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CAAC;QACrB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;KACvD,GAAG,OAAO,CAAC,GAAG,CAAC;IAsFhB;;OAEG;IACG,qBAAqB,CAAC,MAAM,EAAE;QAClC,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,mBAAmB,EAAE,MAAM,CAAC;QAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;KACvD,GAAG,OAAO,CAAC,GAAG,CAAC;IA4FhB;;OAEG;IACH,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG;IAIhD;;OAEG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;IAiBjD;;OAEG;IACH,qBAAqB,IAAI,MAAM,EAAE;CAGlC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FunctionCall, ToolCall } from '../types';
|
|
2
|
+
import { IAPIClient } from '../interfaces/IAPIClient';
|
|
3
|
+
|
|
4
|
+
export declare class ToolCallProcessor {
|
|
5
|
+
private apiService;
|
|
6
|
+
constructor(apiService: IAPIClient);
|
|
7
|
+
processToolCalls(projectId: string, toolCalls: ToolCall[]): Promise<FunctionCall[]>;
|
|
8
|
+
private generateNameCandidates;
|
|
9
|
+
private buildAp2Metadata;
|
|
10
|
+
private buildFallbackMetadata;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=toolCallProcessor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolCallProcessor.d.ts","sourceRoot":"","sources":["../../src/services/toolCallProcessor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBACa,iBAAiB;IAC5B,OAAO,CAAC,UAAU,CAAa;gBAEO,UAAU,EAAE,UAAU;IAItD,gBAAgB,CACpB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC;IAkO1B,OAAO,CAAC,sBAAsB;IAwB9B,OAAO,CAAC,gBAAgB;IA0BxB,OAAO,CAAC,qBAAqB;CAmF9B"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { IEthersAdapter, EthersProvider, EthersSigner, EthersContract, EthersNetwork, EthersTransactionResponse, EthersTransactionReceipt, EthersResult } from '../interfaces/IEthersAdapter';
|
|
2
|
+
|
|
3
|
+
export interface WalletState {
|
|
4
|
+
isConnected: boolean;
|
|
5
|
+
address: string | null;
|
|
6
|
+
balance: string | null;
|
|
7
|
+
network: string | null;
|
|
8
|
+
chainId: number | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Transaction parameters
|
|
12
|
+
*/
|
|
13
|
+
export interface TransactionParams {
|
|
14
|
+
to: string;
|
|
15
|
+
data?: string;
|
|
16
|
+
value?: bigint | string;
|
|
17
|
+
gasLimit?: bigint | string;
|
|
18
|
+
gasPrice?: bigint | string;
|
|
19
|
+
maxFeePerGas?: bigint | string;
|
|
20
|
+
maxPriorityFeePerGas?: bigint | string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Interface for wallet service operations
|
|
24
|
+
* Combines wallet state management with Web3 provider functionality
|
|
25
|
+
*/
|
|
26
|
+
export interface IWalletService {
|
|
27
|
+
subscribe(listener: (state: WalletState) => void): () => void;
|
|
28
|
+
getState(): WalletState;
|
|
29
|
+
isMetaMaskInstalled(): boolean;
|
|
30
|
+
connect(): Promise<WalletState>;
|
|
31
|
+
disconnect(): void;
|
|
32
|
+
executePayment(toAddress: string, amount: string, options?: any): Promise<string>;
|
|
33
|
+
signTypedData(typedData: any): Promise<string>;
|
|
34
|
+
buildPaymentMandateTypedData(mandateData: any, merchantAddress: string): any;
|
|
35
|
+
getNetworkName(): string;
|
|
36
|
+
getCurrencySymbol(): string;
|
|
37
|
+
getFormattedBalance(): string;
|
|
38
|
+
getShortAddress(): string;
|
|
39
|
+
shortenAddress(address: string | null, chars?: number): string;
|
|
40
|
+
initialize(): Promise<void>;
|
|
41
|
+
getProvider(): EthersProvider;
|
|
42
|
+
getSigner(): Promise<EthersSigner>;
|
|
43
|
+
requestAccounts(): Promise<string[]>;
|
|
44
|
+
getAddress(): Promise<string>;
|
|
45
|
+
switchChain(chainId: number): Promise<void>;
|
|
46
|
+
getNetwork(): Promise<EthersNetwork>;
|
|
47
|
+
getBalance(address: string): Promise<bigint>;
|
|
48
|
+
isAddress(address: string): boolean;
|
|
49
|
+
encodeFunctionCall(functionSignature: string, parameters: any[]): string;
|
|
50
|
+
encodeFunctionCallFromABI(abi: any[], functionName: string, parameters: any[]): string;
|
|
51
|
+
decodeFunctionResult(functionSignature: string, data: string): EthersResult;
|
|
52
|
+
decodeFunctionResultFromABI(abi: any[], functionName: string, data: string): EthersResult;
|
|
53
|
+
createContract(address: string, abi: any[]): Promise<EthersContract>;
|
|
54
|
+
call(to: string, data: string): Promise<string>;
|
|
55
|
+
sendTransaction(txParams: TransactionParams): Promise<EthersTransactionResponse>;
|
|
56
|
+
waitForTransaction(txHash: string, confirmations?: number, timeout?: number): Promise<EthersTransactionReceipt | null>;
|
|
57
|
+
formatUnits(value: bigint | string, decimals?: number): string;
|
|
58
|
+
parseUnits(value: string, decimals?: number): bigint;
|
|
59
|
+
parseEther(value: string): bigint;
|
|
60
|
+
formatEther(value: bigint): string;
|
|
61
|
+
}
|
|
62
|
+
export declare class WalletService implements IWalletService {
|
|
63
|
+
private ethersAdapter;
|
|
64
|
+
private provider;
|
|
65
|
+
private signer;
|
|
66
|
+
private walletState;
|
|
67
|
+
private networkConfigs;
|
|
68
|
+
private listeners;
|
|
69
|
+
constructor(ethersAdapter: IEthersAdapter);
|
|
70
|
+
/**
|
|
71
|
+
* Subscribe to wallet state changes
|
|
72
|
+
*/
|
|
73
|
+
subscribe(listener: (state: WalletState) => void): () => void;
|
|
74
|
+
/**
|
|
75
|
+
* Notify all listeners of state change
|
|
76
|
+
*/
|
|
77
|
+
private notifyListeners;
|
|
78
|
+
/**
|
|
79
|
+
* Get current wallet state
|
|
80
|
+
*/
|
|
81
|
+
getState(): WalletState;
|
|
82
|
+
/**
|
|
83
|
+
* Check if MetaMask is installed
|
|
84
|
+
*/
|
|
85
|
+
isMetaMaskInstalled(): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Check if wallet was previously connected
|
|
88
|
+
*/
|
|
89
|
+
checkPreviousConnection(): Promise<void>;
|
|
90
|
+
/**
|
|
91
|
+
* Connect to MetaMask
|
|
92
|
+
*/
|
|
93
|
+
connect(): Promise<WalletState>;
|
|
94
|
+
/**
|
|
95
|
+
* Handle successful connection
|
|
96
|
+
*/
|
|
97
|
+
private handleConnection;
|
|
98
|
+
/**
|
|
99
|
+
* Setup MetaMask event listeners
|
|
100
|
+
*/
|
|
101
|
+
private setupEventListeners;
|
|
102
|
+
/**
|
|
103
|
+
* Disconnect wallet
|
|
104
|
+
*/
|
|
105
|
+
disconnect(): void;
|
|
106
|
+
private getNetworkInfo;
|
|
107
|
+
/**
|
|
108
|
+
* Execute payment transaction
|
|
109
|
+
*/
|
|
110
|
+
executePayment(toAddress: string, amount: string, options?: {
|
|
111
|
+
data?: string;
|
|
112
|
+
gasLimit?: bigint | string;
|
|
113
|
+
gasPrice?: bigint | string;
|
|
114
|
+
}): Promise<string>;
|
|
115
|
+
/**
|
|
116
|
+
* Sign EIP-712 typed data (for payment mandate signatures)
|
|
117
|
+
*/
|
|
118
|
+
signTypedData(typedData: {
|
|
119
|
+
domain: any;
|
|
120
|
+
types: any;
|
|
121
|
+
primaryType: string;
|
|
122
|
+
message: any;
|
|
123
|
+
}): Promise<string>;
|
|
124
|
+
/**
|
|
125
|
+
* Build EIP-712 typed data for payment mandate
|
|
126
|
+
*/
|
|
127
|
+
buildPaymentMandateTypedData(mandateData: {
|
|
128
|
+
mandateId: string;
|
|
129
|
+
cartHash: string;
|
|
130
|
+
amount: string;
|
|
131
|
+
merchant: string;
|
|
132
|
+
expiry: number;
|
|
133
|
+
nonce: number;
|
|
134
|
+
}, merchantAddress: string): any;
|
|
135
|
+
/**
|
|
136
|
+
* Get network name
|
|
137
|
+
*/
|
|
138
|
+
getNetworkName(): string;
|
|
139
|
+
/**
|
|
140
|
+
* Get currency symbol for current network
|
|
141
|
+
*/
|
|
142
|
+
getCurrencySymbol(): string;
|
|
143
|
+
/**
|
|
144
|
+
* Get formatted balance
|
|
145
|
+
*/
|
|
146
|
+
getFormattedBalance(): string;
|
|
147
|
+
/**
|
|
148
|
+
* Get shortened address
|
|
149
|
+
*/
|
|
150
|
+
getShortAddress(): string;
|
|
151
|
+
/**
|
|
152
|
+
* Shorten address for display (e.g., 0x1234...5678)
|
|
153
|
+
*/
|
|
154
|
+
shortenAddress(address: string | null, chars?: number): string;
|
|
155
|
+
/**
|
|
156
|
+
* Initialize the provider from MetaMask or other injected wallet
|
|
157
|
+
*/
|
|
158
|
+
initialize(): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Get the provider instance
|
|
161
|
+
*/
|
|
162
|
+
getProvider(): EthersProvider;
|
|
163
|
+
/**
|
|
164
|
+
* Get the signer instance
|
|
165
|
+
*/
|
|
166
|
+
getSigner(): Promise<EthersSigner>;
|
|
167
|
+
/**
|
|
168
|
+
* Request account access from the wallet
|
|
169
|
+
*/
|
|
170
|
+
requestAccounts(): Promise<string[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Get the connected wallet address
|
|
173
|
+
*/
|
|
174
|
+
getAddress(): Promise<string>;
|
|
175
|
+
/**
|
|
176
|
+
* Switch to a specific chain
|
|
177
|
+
*/
|
|
178
|
+
switchChain(chainId: number): Promise<void>;
|
|
179
|
+
/**
|
|
180
|
+
* Get the current network
|
|
181
|
+
*/
|
|
182
|
+
getNetwork(): Promise<EthersNetwork>;
|
|
183
|
+
/**
|
|
184
|
+
* Get balance of an address
|
|
185
|
+
*/
|
|
186
|
+
getBalance(address: string): Promise<bigint>;
|
|
187
|
+
/**
|
|
188
|
+
* Check if address is valid
|
|
189
|
+
*/
|
|
190
|
+
isAddress(address: string): boolean;
|
|
191
|
+
/**
|
|
192
|
+
* Normalize address to checksummed format
|
|
193
|
+
* Handles addresses with invalid checksums by converting to lowercase first
|
|
194
|
+
*/
|
|
195
|
+
private normalizeAddress;
|
|
196
|
+
/**
|
|
197
|
+
* Encode a function call with parameters
|
|
198
|
+
*/
|
|
199
|
+
encodeFunctionCall(functionSignature: string, parameters: any[]): string;
|
|
200
|
+
/**
|
|
201
|
+
* Encode a function call from ABI
|
|
202
|
+
*/
|
|
203
|
+
encodeFunctionCallFromABI(abi: any[], functionName: string, parameters: any[]): string;
|
|
204
|
+
/**
|
|
205
|
+
* Decode function result
|
|
206
|
+
*/
|
|
207
|
+
decodeFunctionResult(functionSignature: string, data: string): EthersResult;
|
|
208
|
+
/**
|
|
209
|
+
* Decode function result from ABI
|
|
210
|
+
*/
|
|
211
|
+
decodeFunctionResultFromABI(abi: any[], functionName: string, data: string): EthersResult;
|
|
212
|
+
/**
|
|
213
|
+
* Create a contract instance
|
|
214
|
+
*/
|
|
215
|
+
createContract(address: string, abi: any[]): Promise<EthersContract>;
|
|
216
|
+
/**
|
|
217
|
+
* Execute a read-only contract call
|
|
218
|
+
*/
|
|
219
|
+
call(to: string, data: string): Promise<string>;
|
|
220
|
+
/**
|
|
221
|
+
* Send a transaction
|
|
222
|
+
*/
|
|
223
|
+
sendTransaction(txParams: TransactionParams): Promise<EthersTransactionResponse>;
|
|
224
|
+
/**
|
|
225
|
+
* Wait for transaction receipt
|
|
226
|
+
*/
|
|
227
|
+
waitForTransaction(txHash: string, confirmations?: number, timeout?: number): Promise<EthersTransactionReceipt | null>;
|
|
228
|
+
/**
|
|
229
|
+
* Format units (e.g., wei to ether)
|
|
230
|
+
*/
|
|
231
|
+
formatUnits(value: bigint | string, decimals?: number): string;
|
|
232
|
+
/**
|
|
233
|
+
* Parse units (e.g., ether to wei)
|
|
234
|
+
*/
|
|
235
|
+
parseUnits(value: string, decimals?: number): bigint;
|
|
236
|
+
/**
|
|
237
|
+
* Parse ETH value to Wei
|
|
238
|
+
*/
|
|
239
|
+
parseEther(value: string): bigint;
|
|
240
|
+
/**
|
|
241
|
+
* Format Wei to ETH
|
|
242
|
+
*/
|
|
243
|
+
formatEther(value: bigint): string;
|
|
244
|
+
}
|
|
245
|
+
declare global {
|
|
246
|
+
interface Window {
|
|
247
|
+
ethereum?: any;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=walletService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walletService.d.ts","sourceRoot":"","sources":["../../src/services/walletService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAEnM,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GA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