@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,179 @@
|
|
|
1
|
+
import { KnowledgeContext } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Chat request payload
|
|
5
|
+
*/
|
|
6
|
+
export interface ChatRequest {
|
|
7
|
+
sessionId?: string;
|
|
8
|
+
aiConfigId: string;
|
|
9
|
+
messages: Array<{
|
|
10
|
+
role: string;
|
|
11
|
+
content: string;
|
|
12
|
+
}>;
|
|
13
|
+
includeContext: boolean;
|
|
14
|
+
executeTools: boolean;
|
|
15
|
+
knowledgeContext?: KnowledgeContext[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Chat response from server
|
|
19
|
+
*/
|
|
20
|
+
export interface ChatResponse {
|
|
21
|
+
message: {
|
|
22
|
+
content: string;
|
|
23
|
+
toolCalls?: any[];
|
|
24
|
+
};
|
|
25
|
+
sessionId: string;
|
|
26
|
+
usage?: {
|
|
27
|
+
promptTokens?: number;
|
|
28
|
+
completionTokens?: number;
|
|
29
|
+
totalTokens?: number;
|
|
30
|
+
cost: number;
|
|
31
|
+
};
|
|
32
|
+
context?: {
|
|
33
|
+
knowledgeItems?: any[];
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Chat stream callbacks
|
|
38
|
+
*/
|
|
39
|
+
export interface ChatStreamCallbacks {
|
|
40
|
+
onMessage: (data: string) => void;
|
|
41
|
+
onError?: (error: Error) => void;
|
|
42
|
+
onComplete?: (sessionId?: string) => void;
|
|
43
|
+
onToolCall?: (toolCalls: any[]) => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* AP2 payment signature data
|
|
47
|
+
*/
|
|
48
|
+
export interface PaymentSignatureData {
|
|
49
|
+
sessionId: string;
|
|
50
|
+
signature: string;
|
|
51
|
+
mandateType: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* AP2 tool execution data
|
|
55
|
+
*/
|
|
56
|
+
export interface AP2ToolExecutionData {
|
|
57
|
+
toolName: string;
|
|
58
|
+
params: any;
|
|
59
|
+
sessionId?: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Base interface for API client services
|
|
63
|
+
*/
|
|
64
|
+
export interface IAPIClient {
|
|
65
|
+
/**
|
|
66
|
+
* Send a chat message and get response (non-streaming)
|
|
67
|
+
*
|
|
68
|
+
* @param projectId - Project identifier
|
|
69
|
+
* @param data - Chat request payload
|
|
70
|
+
* @returns Chat response with message and usage
|
|
71
|
+
*/
|
|
72
|
+
chat(projectId: string, data: ChatRequest): Promise<ChatResponse>;
|
|
73
|
+
/**
|
|
74
|
+
* Send a chat message and stream response (SSE)
|
|
75
|
+
*
|
|
76
|
+
* @param projectId - Project identifier
|
|
77
|
+
* @param data - Chat request payload
|
|
78
|
+
* @param callbacks - Stream event callbacks
|
|
79
|
+
* @returns Cleanup function to abort the stream
|
|
80
|
+
*/
|
|
81
|
+
chatStream(projectId: string, data: ChatRequest, onMessage: (data: string) => void, onError?: (error: Error) => void, onComplete?: (sessionId?: string) => void, onToolCall?: (toolCalls: any[]) => void): Promise<() => void>;
|
|
82
|
+
/**
|
|
83
|
+
* Search knowledge base
|
|
84
|
+
*
|
|
85
|
+
* @param projectId - Project identifier
|
|
86
|
+
* @param query - Search query
|
|
87
|
+
* @returns Array of matching knowledge entries
|
|
88
|
+
*/
|
|
89
|
+
searchKnowledge(projectId: string, query: string): Promise<KnowledgeContext[]>;
|
|
90
|
+
/**
|
|
91
|
+
* Get all knowledge base entries
|
|
92
|
+
*
|
|
93
|
+
* @param projectId - Project identifier
|
|
94
|
+
* @returns Array of all knowledge entries
|
|
95
|
+
*/
|
|
96
|
+
getAllKnowledge(projectId: string): Promise<any>;
|
|
97
|
+
/**
|
|
98
|
+
* Get parsed API endpoints for project
|
|
99
|
+
*
|
|
100
|
+
* @param projectId - Project identifier
|
|
101
|
+
* @returns Array of parsed endpoint definitions
|
|
102
|
+
*/
|
|
103
|
+
getParsedEndpoints(projectId: string): Promise<any[]>;
|
|
104
|
+
/**
|
|
105
|
+
* Get parsed smart contracts for project
|
|
106
|
+
*
|
|
107
|
+
* @param projectId - Project identifier
|
|
108
|
+
* @returns Object containing array of parsed contract method definitions
|
|
109
|
+
*/
|
|
110
|
+
getParsedContracts(projectId: string): Promise<{
|
|
111
|
+
methods: any[];
|
|
112
|
+
}>;
|
|
113
|
+
/**
|
|
114
|
+
* Get AP2 (merchant) tools for project
|
|
115
|
+
*
|
|
116
|
+
* @param projectId - Project identifier
|
|
117
|
+
* @returns Array of AP2 tool definitions
|
|
118
|
+
*/
|
|
119
|
+
getAP2Tools(projectId: string): Promise<any[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Get AP2 configuration for project
|
|
122
|
+
*
|
|
123
|
+
* @param projectId - Project identifier
|
|
124
|
+
* @returns AP2 configuration object
|
|
125
|
+
*/
|
|
126
|
+
getAP2Config(projectId: string): Promise<any>;
|
|
127
|
+
/**
|
|
128
|
+
* Get AI configuration for project
|
|
129
|
+
*
|
|
130
|
+
* @param projectId - Project identifier
|
|
131
|
+
* @param configId - Config identifier
|
|
132
|
+
* @returns AI config object or null
|
|
133
|
+
*/
|
|
134
|
+
getAIConfig(projectId: string, configId: string): Promise<any | null>;
|
|
135
|
+
/**
|
|
136
|
+
* Submit payment signature for AP2 payment
|
|
137
|
+
*
|
|
138
|
+
* @param projectId - Project identifier
|
|
139
|
+
* @param sessionId - Payment session ID
|
|
140
|
+
* @param data - Signature data
|
|
141
|
+
* @returns Payment submission result
|
|
142
|
+
*/
|
|
143
|
+
submitPaymentSignature(projectId: string, sessionId: string, data: PaymentSignatureData): Promise<any>;
|
|
144
|
+
/**
|
|
145
|
+
* Submit transaction hash for AP2 payment
|
|
146
|
+
*
|
|
147
|
+
* @param projectId - Project identifier
|
|
148
|
+
* @param sessionId - Payment session ID
|
|
149
|
+
* @param txHash - Transaction hash
|
|
150
|
+
* @returns Payment submission result
|
|
151
|
+
*/
|
|
152
|
+
submitPaymentTxHash(projectId: string, sessionId: string, txHash: string): Promise<any>;
|
|
153
|
+
/**
|
|
154
|
+
* Execute an AP2 tool
|
|
155
|
+
*
|
|
156
|
+
* @param projectId - Project identifier
|
|
157
|
+
* @param data - Tool execution data
|
|
158
|
+
* @returns Tool execution result
|
|
159
|
+
*/
|
|
160
|
+
executeAP2Tool(projectId: string, data: AP2ToolExecutionData): Promise<any>;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Extended interface with request interceptors
|
|
164
|
+
*/
|
|
165
|
+
export interface IAPIClientWithInterceptors extends IAPIClient {
|
|
166
|
+
/**
|
|
167
|
+
* Add a request interceptor
|
|
168
|
+
*/
|
|
169
|
+
addRequestInterceptor(onFulfilled: (config: any) => any, onRejected?: (error: any) => any): number;
|
|
170
|
+
/**
|
|
171
|
+
* Add a response interceptor
|
|
172
|
+
*/
|
|
173
|
+
addResponseInterceptor(onFulfilled: (response: any) => any, onRejected?: (error: any) => any): number;
|
|
174
|
+
/**
|
|
175
|
+
* Remove an interceptor
|
|
176
|
+
*/
|
|
177
|
+
removeInterceptor(interceptorId: number, type: 'request' | 'response'): void;
|
|
178
|
+
}
|
|
179
|
+
//# sourceMappingURL=IAPIClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAPIClient.d.ts","sourceRoot":"","sources":["../../src/interfaces/IAPIClient.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,cAAc,EAAE,OAAO,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;CACvC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,GAAG,EAAE,CAAC;KACnB,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,YAAY,CAAC,EAAE,MAAM,CAAC;QACt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G;AACH,MAAM,WAAW,0BAA2B,SAAQ,UAAU;IAC5D;;OAEG;IACH,qBAAqB,CACnB,WAAW,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,GAAG,EACjC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,GAC/B,MAAM,CAAC;IAEV;;OAEG;IACH,sBAAsB,CACpB,WAAW,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,GAAG,EACnC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,GAC/B,MAAM,CAAC;IAEV;;OAEG;IACH,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;CAC9E"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ethers Adapter Interface
|
|
3
|
+
*
|
|
4
|
+
* Provides a unified interface for ethers.js operations that works across v5 and v6.
|
|
5
|
+
* Implementations handle version-specific API differences transparently.
|
|
6
|
+
*
|
|
7
|
+
* This interface follows the Dependency Inversion Principle:
|
|
8
|
+
* - High-level modules depend on this abstraction, not concrete implementations
|
|
9
|
+
* - Different versions (v5/v6) implement this same interface
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Provider type - abstracts BrowserProvider (v6) and Web3Provider (v5)
|
|
13
|
+
*/
|
|
14
|
+
export type EthersProvider = any;
|
|
15
|
+
/**
|
|
16
|
+
* Signer type - abstracts JsonRpcSigner for both versions
|
|
17
|
+
*/
|
|
18
|
+
export type EthersSigner = any;
|
|
19
|
+
/**
|
|
20
|
+
* Contract type - works the same in both versions
|
|
21
|
+
*/
|
|
22
|
+
export type EthersContract = any;
|
|
23
|
+
/**
|
|
24
|
+
* Interface type - abstracts Interface (v6) and utils.Interface (v5)
|
|
25
|
+
*/
|
|
26
|
+
export type EthersInterface = any;
|
|
27
|
+
/**
|
|
28
|
+
* Transaction response type
|
|
29
|
+
*/
|
|
30
|
+
export type EthersTransactionResponse = any;
|
|
31
|
+
/**
|
|
32
|
+
* Transaction receipt type
|
|
33
|
+
*/
|
|
34
|
+
export type EthersTransactionReceipt = any;
|
|
35
|
+
/**
|
|
36
|
+
* Network information type
|
|
37
|
+
*/
|
|
38
|
+
export type EthersNetwork = any;
|
|
39
|
+
/**
|
|
40
|
+
* Decoded function result type
|
|
41
|
+
*/
|
|
42
|
+
export type EthersResult = any;
|
|
43
|
+
/**
|
|
44
|
+
* Main Ethers Adapter Interface
|
|
45
|
+
*
|
|
46
|
+
* All methods are defined to work identically regardless of the underlying ethers version.
|
|
47
|
+
*/
|
|
48
|
+
export interface IEthersAdapter {
|
|
49
|
+
/**
|
|
50
|
+
* Get the detected ethers version (5 or 6)
|
|
51
|
+
*/
|
|
52
|
+
getVersion(): number;
|
|
53
|
+
/**
|
|
54
|
+
* Check if using ethers v6
|
|
55
|
+
*/
|
|
56
|
+
isV6(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Check if using ethers v5
|
|
59
|
+
*/
|
|
60
|
+
isV5(): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Create a BrowserProvider (v6) or Web3Provider (v5) from window.ethereum
|
|
63
|
+
*/
|
|
64
|
+
createBrowserProvider(ethereum: any): EthersProvider;
|
|
65
|
+
/**
|
|
66
|
+
* Get signer from provider
|
|
67
|
+
*/
|
|
68
|
+
getSigner(provider: EthersProvider): Promise<EthersSigner>;
|
|
69
|
+
/**
|
|
70
|
+
* Create a contract instance
|
|
71
|
+
*/
|
|
72
|
+
createContract(address: string, abi: any[], signerOrProvider: EthersSigner | EthersProvider): EthersContract;
|
|
73
|
+
/**
|
|
74
|
+
* Create an Interface instance for encoding/decoding
|
|
75
|
+
*/
|
|
76
|
+
createInterface(abi: any[]): EthersInterface;
|
|
77
|
+
/**
|
|
78
|
+
* Get checksummed address (validates and normalizes address)
|
|
79
|
+
*/
|
|
80
|
+
getAddress(address: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Check if string is a valid Ethereum address
|
|
83
|
+
*/
|
|
84
|
+
isAddress(address: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Format units (e.g., wei to ether)
|
|
87
|
+
* @param value - Value in wei (as bigint or string)
|
|
88
|
+
* @param decimals - Number of decimals (default 18 for ether)
|
|
89
|
+
* @returns Formatted string
|
|
90
|
+
*/
|
|
91
|
+
formatUnits(value: bigint | string, decimals?: number): string;
|
|
92
|
+
/**
|
|
93
|
+
* Parse units (e.g., ether to wei)
|
|
94
|
+
* @param value - Value as string (e.g., "1.5")
|
|
95
|
+
* @param decimals - Number of decimals (default 18 for ether)
|
|
96
|
+
* @returns Value in wei as bigint
|
|
97
|
+
*/
|
|
98
|
+
parseUnits(value: string, decimals?: number): bigint;
|
|
99
|
+
/**
|
|
100
|
+
* Format ether (shorthand for formatUnits with 18 decimals)
|
|
101
|
+
*/
|
|
102
|
+
formatEther(wei: bigint | string): string;
|
|
103
|
+
/**
|
|
104
|
+
* Parse ether (shorthand for parseUnits with 18 decimals)
|
|
105
|
+
*/
|
|
106
|
+
parseEther(ether: string): bigint;
|
|
107
|
+
/**
|
|
108
|
+
* Get default ABI coder instance
|
|
109
|
+
*/
|
|
110
|
+
getAbiCoder(): any;
|
|
111
|
+
/**
|
|
112
|
+
* Convert value to BigInt (handles both v5 BigNumber and v6 bigint)
|
|
113
|
+
*/
|
|
114
|
+
toBigInt(value: any): bigint;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=IEthersAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IEthersAdapter.d.ts","sourceRoot":"","sources":["../../src/interfaces/IEthersAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,GAAG,CAAC;AAEjC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,GAAG,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,cAAc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AAG,MAAM,GAAG,MAAM,CAAC;IAE1C;;OAEG;IACH,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IAElC;;OAEG;IACH,WAAW,IAAI,GAAG,CAAC;IAEnB;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,GAAG,GAAG,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { FunctionCall, ExecutionResult } from '../types';
|
|
2
|
+
import { ExecutionContext } from '../core/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Base interface for all executors
|
|
6
|
+
*/
|
|
7
|
+
export interface IExecutor {
|
|
8
|
+
/**
|
|
9
|
+
* The type of function this executor handles (e.g., 'api', 'contract', 'fiat', 'ap2')
|
|
10
|
+
*/
|
|
11
|
+
readonly type: string;
|
|
12
|
+
/**
|
|
13
|
+
* Determines if this executor can handle the given function call
|
|
14
|
+
*
|
|
15
|
+
* @param functionCall - The function call to check
|
|
16
|
+
* @returns True if this executor can handle the call
|
|
17
|
+
*/
|
|
18
|
+
canHandle(functionCall: FunctionCall): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Executes the function call
|
|
21
|
+
*
|
|
22
|
+
* @param functionCall - The function call to execute
|
|
23
|
+
* @param context - Execution context including auth, headers, callbacks
|
|
24
|
+
* @returns Execution result with success status and data/error
|
|
25
|
+
*/
|
|
26
|
+
execute(functionCall: FunctionCall, context: ExecutionContext): Promise<ExecutionResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Validates if the function call has all required parameters
|
|
29
|
+
*
|
|
30
|
+
* @param functionCall - The function call to validate
|
|
31
|
+
* @returns Validation result with isValid flag and error messages
|
|
32
|
+
*/
|
|
33
|
+
validate(functionCall: FunctionCall): ValidationResult;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Validation result structure
|
|
37
|
+
*/
|
|
38
|
+
export interface ValidationResult {
|
|
39
|
+
isValid: boolean;
|
|
40
|
+
errors?: string[];
|
|
41
|
+
warnings?: string[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Extended executor interface with lifecycle hooks
|
|
45
|
+
*/
|
|
46
|
+
export interface IExecutorWithLifecycle extends IExecutor {
|
|
47
|
+
/**
|
|
48
|
+
* Called when the executor is initialized
|
|
49
|
+
*/
|
|
50
|
+
onInit?(): Promise<void> | void;
|
|
51
|
+
/**
|
|
52
|
+
* Called before execution starts
|
|
53
|
+
*/
|
|
54
|
+
onBeforeExecute?(functionCall: FunctionCall, context: ExecutionContext): Promise<void> | void;
|
|
55
|
+
/**
|
|
56
|
+
* Called after execution completes (success or failure)
|
|
57
|
+
*/
|
|
58
|
+
onAfterExecute?(functionCall: FunctionCall, result: ExecutionResult, context: ExecutionContext): Promise<void> | void;
|
|
59
|
+
/**
|
|
60
|
+
* Called when the executor is disposed
|
|
61
|
+
*/
|
|
62
|
+
onDispose?(): Promise<void> | void;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=IExecutor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IExecutor.d.ts","sourceRoot":"","sources":["../../src/interfaces/IExecutor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,SAAS,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC;IAE/C;;;;;;OAMG;IACH,OAAO,CACL,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,eAAe,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,EAAE,YAAY,GAAG,gBAAgB,CAAC;CACxD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD;;OAEG;IACH,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,eAAe,CAAC,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAE9F;;OAEG;IACH,cAAc,CAAC,CACb,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,eAAe,EACvB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,SAAS,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACpC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { VNode, CSSProperties } from 'vue';
|
|
2
|
+
import { FunctionCall, ExecutionResult } from '../types';
|
|
3
|
+
import { RenderContext } from '../core/types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props passed to renderer components
|
|
7
|
+
*/
|
|
8
|
+
export interface RendererProps {
|
|
9
|
+
functionCall: FunctionCall;
|
|
10
|
+
context: RenderContext;
|
|
11
|
+
executionResult?: ExecutionResult;
|
|
12
|
+
isExecuting?: boolean;
|
|
13
|
+
isExpanded?: boolean;
|
|
14
|
+
onToggleExpand?: () => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Base interface for all renderers
|
|
18
|
+
*/
|
|
19
|
+
export interface IRenderer {
|
|
20
|
+
/**
|
|
21
|
+
* The type of function this renderer handles (e.g., 'api', 'contract', 'fiat', 'ap2')
|
|
22
|
+
*/
|
|
23
|
+
readonly type: string;
|
|
24
|
+
/**
|
|
25
|
+
* Display name for the renderer (used in logs/debugging)
|
|
26
|
+
*/
|
|
27
|
+
readonly name: string;
|
|
28
|
+
/**
|
|
29
|
+
* Determines if this renderer can render the given function call
|
|
30
|
+
*
|
|
31
|
+
* @param functionCall - The function call to check
|
|
32
|
+
* @returns True if this renderer can handle the call
|
|
33
|
+
*/
|
|
34
|
+
canRender(functionCall: FunctionCall): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Renders the function call UI
|
|
37
|
+
*
|
|
38
|
+
* @param props - Renderer props including function call and context
|
|
39
|
+
* @returns VNode to display
|
|
40
|
+
*/
|
|
41
|
+
render(props: RendererProps): VNode;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Extended renderer interface with lifecycle hooks
|
|
45
|
+
*/
|
|
46
|
+
export interface IRendererWithLifecycle extends IRenderer {
|
|
47
|
+
/**
|
|
48
|
+
* Called before rendering
|
|
49
|
+
*/
|
|
50
|
+
onBeforeRender?(props: RendererProps): void;
|
|
51
|
+
/**
|
|
52
|
+
* Called after rendering
|
|
53
|
+
*/
|
|
54
|
+
onAfterRender?(props: RendererProps): void;
|
|
55
|
+
/**
|
|
56
|
+
* Called when execution starts
|
|
57
|
+
*/
|
|
58
|
+
onExecutionStart?(functionCall: FunctionCall): void;
|
|
59
|
+
/**
|
|
60
|
+
* Called when execution completes
|
|
61
|
+
*/
|
|
62
|
+
onExecutionComplete?(functionCall: FunctionCall, result: ExecutionResult): void;
|
|
63
|
+
/**
|
|
64
|
+
* Called when execution errors
|
|
65
|
+
*/
|
|
66
|
+
onExecutionError?(functionCall: FunctionCall, error: Error): void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Renderer with custom styling support
|
|
70
|
+
*/
|
|
71
|
+
export interface IStyledRenderer extends IRenderer {
|
|
72
|
+
/**
|
|
73
|
+
* Default CSS classes for this renderer
|
|
74
|
+
*/
|
|
75
|
+
readonly defaultClasses?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Default inline styles for this renderer
|
|
78
|
+
*/
|
|
79
|
+
readonly defaultStyles?: CSSProperties;
|
|
80
|
+
/**
|
|
81
|
+
* Allow custom className override
|
|
82
|
+
*/
|
|
83
|
+
withClassName?(className: string): this;
|
|
84
|
+
/**
|
|
85
|
+
* Allow custom style override
|
|
86
|
+
*/
|
|
87
|
+
withStyle?(style: CSSProperties): this;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Result renderer interface for displaying execution results
|
|
91
|
+
*/
|
|
92
|
+
export interface IResultRenderer {
|
|
93
|
+
/**
|
|
94
|
+
* Render execution result
|
|
95
|
+
*
|
|
96
|
+
* @param result - Execution result
|
|
97
|
+
* @param functionCall - Original function call
|
|
98
|
+
* @returns VNode displaying the result
|
|
99
|
+
*/
|
|
100
|
+
renderResult(result: ExecutionResult, functionCall: FunctionCall): VNode;
|
|
101
|
+
/**
|
|
102
|
+
* Render error state
|
|
103
|
+
*
|
|
104
|
+
* @param error - Error that occurred
|
|
105
|
+
* @param functionCall - Original function call
|
|
106
|
+
* @returns VNode displaying the error
|
|
107
|
+
*/
|
|
108
|
+
renderError(error: string | Error, functionCall: FunctionCall): VNode;
|
|
109
|
+
/**
|
|
110
|
+
* Render loading state
|
|
111
|
+
*
|
|
112
|
+
* @param functionCall - Function call being executed
|
|
113
|
+
* @returns VNode displaying loading state
|
|
114
|
+
*/
|
|
115
|
+
renderLoading(functionCall: FunctionCall): VNode;
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=IRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IRenderer.d.ts","sourceRoot":"","sources":["../../src/interfaces/IRenderer.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU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a,CAAC,EAAE,aAAa,CAAC;IAEvC;;OAEG;IACH,aAAa,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC;;OAEG;IACH,SAAS,CAAC,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAG,KAAK,CAAC;IAEzE;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,YAAY,EAAE,YAAY,GAAG,KAAK,CAAC;IAEtE;;;;;OAKG;IACH,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown renderer utility using marked + DOMPurify
|
|
3
|
+
* Provides secure markdown-to-HTML rendering for chat messages
|
|
4
|
+
*/
|
|
5
|
+
declare function escapeHtml(text: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Renders markdown string to sanitized HTML
|
|
8
|
+
* @param markdown - The markdown string to render
|
|
9
|
+
* @returns Sanitized HTML string
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderMarkdown(markdown: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Processes message content for display
|
|
14
|
+
* Removes function call JSON blocks and renders remaining content as markdown
|
|
15
|
+
* @param content - The message content
|
|
16
|
+
* @param role - The message role (user, assistant, system)
|
|
17
|
+
* @returns Processed HTML string
|
|
18
|
+
*/
|
|
19
|
+
export declare function processMessageContent(content: string, role: string): string;
|
|
20
|
+
export { escapeHtml };
|
|
21
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/lib/markdown.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiHH,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CASxC;AAqBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAgBvD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkC3E;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ClassValue } from 'clsx';
|
|
2
|
+
|
|
3
|
+
export declare function cn(...inputs: ClassValue[]): string;
|
|
4
|
+
/**
|
|
5
|
+
* API Configuration
|
|
6
|
+
*/
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
__TERMIX_API_LOCAL__?: boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get the API base URL
|
|
14
|
+
* In production: Uses https://dashboard.termix.ai
|
|
15
|
+
* In development with window.__TERMIX_API_LOCAL__=true: Uses http://127.0.0.1:3000
|
|
16
|
+
* Otherwise: Uses https://dashboard.termix.ai
|
|
17
|
+
*/
|
|
18
|
+
export declare const getApiBaseUrl: () => string;
|
|
19
|
+
/**
|
|
20
|
+
* Export the base URL constant for direct usage
|
|
21
|
+
*/
|
|
22
|
+
export declare const API_BASE_URL: string;
|
|
23
|
+
export declare function extractFunctionCalls(text: string): Array<{
|
|
24
|
+
name: string;
|
|
25
|
+
parameters: Record<string, any>;
|
|
26
|
+
metadata?: Record<string, any>;
|
|
27
|
+
}>;
|
|
28
|
+
/**
|
|
29
|
+
* HMAC (Hash-based Message Authentication Code) utility functions
|
|
30
|
+
* Uses Web Crypto API for browser-compatible cryptographic operations
|
|
31
|
+
*/
|
|
32
|
+
export type HmacAlgorithm = 'SHA-256' | 'SHA-384' | 'SHA-512';
|
|
33
|
+
/**
|
|
34
|
+
* Generate HMAC signature for a message
|
|
35
|
+
*
|
|
36
|
+
* @param secret - The secret key for HMAC
|
|
37
|
+
* @param message - The message to sign
|
|
38
|
+
* @param algorithm - Hash algorithm to use (default: SHA-256)
|
|
39
|
+
* @returns Promise<string> - Hex-encoded HMAC signature
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const signature = await hmacSign('my-secret-key', 'message to sign');
|
|
44
|
+
* console.log(signature); // hex string like "a1b2c3..."
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function hmacSign(secret: string, message: string, algorithm?: HmacAlgorithm): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Verify HMAC signature
|
|
50
|
+
*
|
|
51
|
+
* @param secret - The secret key for HMAC
|
|
52
|
+
* @param message - The original message
|
|
53
|
+
* @param signature - The HMAC signature to verify (hex string)
|
|
54
|
+
* @param algorithm - Hash algorithm to use (default: SHA-256)
|
|
55
|
+
* @returns Promise<boolean> - True if signature is valid
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const isValid = await hmacVerify('my-secret-key', 'message', 'a1b2c3...');
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function hmacVerify(secret: string, message: string, signature: string, algorithm?: HmacAlgorithm): Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* Generate HMAC signature and return as Base64
|
|
65
|
+
*
|
|
66
|
+
* @param secret - The secret key for HMAC
|
|
67
|
+
* @param message - The message to sign
|
|
68
|
+
* @param algorithm - Hash algorithm to use (default: SHA-256)
|
|
69
|
+
* @returns Promise<string> - Base64-encoded HMAC signature
|
|
70
|
+
*/
|
|
71
|
+
export declare function hmacSignBase64(secret: string, message: string, algorithm?: HmacAlgorithm): Promise<string>;
|
|
72
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAQ,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC;AAED;;GAEG;AACH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAChC;CACF;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,QAAO,MAOhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,QAAkB,CAAC;AAG5C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC,CAAC,CAqDD;AAED;;;GAGG;AAEH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAE9D;;;;;;;;;;;;;GAaG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,aAAyB,GACnC,OAAO,CAAC,MAAM,CAAC,CAejB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,aAAyB,GACnC,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,GAAE,aAAyB,GACnC,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
|
@@ -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 AP2Renderer extends BaseRenderer {
|
|
7
|
+
readonly type = "ap2";
|
|
8
|
+
readonly name = "AP2 Renderer";
|
|
9
|
+
protected renderContent(props: RendererProps): VNode;
|
|
10
|
+
renderResult(result: ExecutionResult, _functionCall: FunctionCall): VNode;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AP2Renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AP2Renderer.d.ts","sourceRoot":"","sources":["../../src/renderers/AP2Renderer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,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,WAAY,SAAQ,YAAY;IAC3C,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,IAAI,kBAAkB;IAE/B,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IA4BpD,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,GAAG,KAAK;CAY1E"}
|
|
@@ -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 APIRenderer extends BaseRenderer {
|
|
7
|
+
readonly type = "api";
|
|
8
|
+
readonly name = "APIRenderer";
|
|
9
|
+
protected renderContent(props: RendererProps): VNode;
|
|
10
|
+
renderResult(result: ExecutionResult, functionCall: FunctionCall): VNode;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=APIRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"APIRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/APIRenderer.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,WAAY,SAAQ,YAAY;IAC3C,QAAQ,CAAC,IAAI,SAAS;IACtB,QAAQ,CAAC,IAAI,iBAAiB;IAE9B,SAAS,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IAmBpD,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,GAAG,KAAK;CAwBzE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { FunctionCall, ExecutionResult } from '../types';
|
|
3
|
+
import { IRenderer, IResultRenderer, RendererProps } from '../interfaces/IRenderer';
|
|
4
|
+
|
|
5
|
+
export declare abstract class BaseRenderer implements IRenderer, IResultRenderer {
|
|
6
|
+
abstract readonly type: string;
|
|
7
|
+
abstract readonly name: string;
|
|
8
|
+
canRender(functionCall: FunctionCall): boolean;
|
|
9
|
+
render(props: RendererProps): VNode;
|
|
10
|
+
protected abstract renderContent(props: RendererProps): VNode;
|
|
11
|
+
renderLoading(functionCall: FunctionCall): VNode;
|
|
12
|
+
renderResult(result: ExecutionResult, _functionCall: FunctionCall): VNode;
|
|
13
|
+
renderError(error: string | Error, functionCall: FunctionCall, executionResult?: ExecutionResult): VNode;
|
|
14
|
+
protected renderParameterPreview(parameters: Record<string, any>, isExpanded?: boolean, onToggleExpand?: () => void): VNode | null;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=BaseRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseRenderer.d.ts","sourceRoot":"","sources":["../../src/renderers/BaseRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,EAAE,MAAM,KAAK,CAAC;AAE/B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAEpF,8BACsB,YAAa,YAAW,SAAS,EAAE,eAAe;IACtE,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAE/B,SAAS,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAI9C,MAAM,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IAanC,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,KAAK;IAE7D,aAAa,CAAC,YAAY,EAAE,YAAY,GAAG,KAAK;IAOhD,YAAY,CAAC,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,GAAG,KAAK;IAMzE,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,eAAe,GAAG,KAAK;IA2DxG,SAAS,CAAC,sBAAsB,CAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC/B,UAAU,CAAC,EAAE,OAAO,EACpB,cAAc,CAAC,EAAE,MAAM,IAAI,GAC1B,KAAK,GAAG,IAAI;CAuEhB"}
|