valta-sdk 2.0.0 → 2.1.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/bin/valta.js +9 -154
- package/dist/chunk-HGO47A3L.mjs +244 -0
- package/dist/chunk-LPBJPXJO.js +244 -0
- package/dist/cli/index.cjs +375 -0
- package/dist/cli/index.d.cts +2 -0
- package/dist/cli/index.d.mts +2 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +141 -0
- package/dist/cli/index.mjs +141 -0
- package/dist/index.cjs +276 -0
- package/dist/index.d.cts +197 -0
- package/dist/index.d.mts +161 -131
- package/dist/index.d.ts +161 -131
- package/dist/index.js +15 -353
- package/dist/index.mjs +12 -314
- package/package.json +33 -46
package/dist/index.d.mts
CHANGED
|
@@ -1,167 +1,197 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
interface RequestOptions {
|
|
2
|
+
method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
3
|
+
body?: unknown;
|
|
4
|
+
}
|
|
5
|
+
declare class Requester {
|
|
6
|
+
private apiKey;
|
|
7
|
+
private baseUrl;
|
|
8
|
+
constructor(apiKey: string, baseUrl?: string);
|
|
9
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
interface AgentConfig {
|
|
13
|
-
agentId: string;
|
|
12
|
+
interface Agent {
|
|
13
|
+
id: string;
|
|
14
14
|
name: string;
|
|
15
|
-
|
|
15
|
+
type: string;
|
|
16
|
+
status: 'active' | 'frozen' | 'paused';
|
|
17
|
+
walletAddress?: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
interface CreateAgentParams {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
16
24
|
description?: string;
|
|
17
|
-
planRequired?: PlanType;
|
|
18
|
-
isLive?: boolean;
|
|
19
25
|
}
|
|
20
|
-
interface
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
interface ListAgentsParams {
|
|
27
|
+
limit?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
status?: 'active' | 'frozen' | 'paused';
|
|
30
|
+
}
|
|
31
|
+
interface ListAgentsResponse {
|
|
32
|
+
agents: Agent[];
|
|
33
|
+
total: number;
|
|
34
|
+
limit: number;
|
|
35
|
+
offset: number;
|
|
36
|
+
}
|
|
37
|
+
declare class AgentsResource {
|
|
38
|
+
private requester;
|
|
39
|
+
constructor(requester: Requester);
|
|
40
|
+
list(params?: ListAgentsParams): Promise<ListAgentsResponse>;
|
|
41
|
+
get(agentId: string): Promise<Agent>;
|
|
42
|
+
create(params: CreateAgentParams): Promise<Agent>;
|
|
43
|
+
update(agentId: string, params: Partial<CreateAgentParams>): Promise<Agent>;
|
|
44
|
+
freeze(agentId: string): Promise<Agent>;
|
|
45
|
+
unfreeze(agentId: string): Promise<Agent>;
|
|
46
|
+
delete(agentId: string): Promise<{
|
|
47
|
+
deleted: boolean;
|
|
48
|
+
id: string;
|
|
49
|
+
}>;
|
|
23
50
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
|
|
52
|
+
interface WalletBalance {
|
|
53
|
+
usdc: string;
|
|
54
|
+
usdcPending: string;
|
|
55
|
+
lastUpdated: string;
|
|
56
|
+
}
|
|
57
|
+
interface WalletTransferParams {
|
|
58
|
+
toAgentId?: string;
|
|
59
|
+
toAddress?: string;
|
|
60
|
+
amount: string;
|
|
61
|
+
currency: 'USDC';
|
|
62
|
+
note?: string;
|
|
63
|
+
}
|
|
64
|
+
interface WalletTransfer {
|
|
65
|
+
id: string;
|
|
66
|
+
fromAgentId: string;
|
|
67
|
+
toAgentId?: string;
|
|
68
|
+
toAddress?: string;
|
|
69
|
+
amount: string;
|
|
70
|
+
currency: string;
|
|
71
|
+
status: 'pending' | 'completed' | 'failed';
|
|
72
|
+
createdAt: string;
|
|
29
73
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
enabled?: boolean;
|
|
74
|
+
declare class WalletsResource {
|
|
75
|
+
private requester;
|
|
76
|
+
constructor(requester: Requester);
|
|
77
|
+
get(agentId: string): Promise<WalletBalance>;
|
|
78
|
+
transfer(agentId: string, params: WalletTransferParams): Promise<WalletTransfer>;
|
|
36
79
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
80
|
+
|
|
81
|
+
interface Policy {
|
|
82
|
+
id: string;
|
|
40
83
|
agentId: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
84
|
+
name: string;
|
|
85
|
+
maxSpendPerDay?: number;
|
|
86
|
+
maxSpendPerTransaction?: number;
|
|
87
|
+
allowedRecipients?: string[];
|
|
88
|
+
currency: string;
|
|
89
|
+
active: boolean;
|
|
90
|
+
createdAt: string;
|
|
46
91
|
}
|
|
47
|
-
interface
|
|
92
|
+
interface CreatePolicyParams {
|
|
48
93
|
agentId: string;
|
|
49
|
-
task: string;
|
|
50
|
-
}
|
|
51
|
-
interface PipelineConfig {
|
|
52
94
|
name: string;
|
|
53
|
-
|
|
54
|
-
|
|
95
|
+
maxSpendPerDay?: number;
|
|
96
|
+
maxSpendPerTransaction?: number;
|
|
97
|
+
allowedRecipients?: string[];
|
|
98
|
+
currency?: string;
|
|
99
|
+
}
|
|
100
|
+
declare class PoliciesResource {
|
|
101
|
+
private requester;
|
|
102
|
+
constructor(requester: Requester);
|
|
103
|
+
list(agentId?: string): Promise<Policy[]>;
|
|
104
|
+
create(params: CreatePolicyParams): Promise<Policy>;
|
|
105
|
+
update(policyId: string, params: Partial<CreatePolicyParams>): Promise<Policy>;
|
|
106
|
+
delete(policyId: string): Promise<{
|
|
107
|
+
deleted: boolean;
|
|
108
|
+
}>;
|
|
55
109
|
}
|
|
56
|
-
|
|
110
|
+
|
|
111
|
+
interface AuditLog {
|
|
112
|
+
id: string;
|
|
57
113
|
agentId: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
114
|
+
action: string;
|
|
115
|
+
amount?: string;
|
|
116
|
+
currency?: string;
|
|
117
|
+
metadata?: Record<string, unknown>;
|
|
118
|
+
hash: string;
|
|
119
|
+
previousHash: string;
|
|
120
|
+
createdAt: string;
|
|
61
121
|
}
|
|
62
|
-
interface
|
|
63
|
-
|
|
64
|
-
|
|
122
|
+
interface ListAuditParams {
|
|
123
|
+
agentId?: string;
|
|
124
|
+
limit?: number;
|
|
125
|
+
offset?: number;
|
|
126
|
+
from?: string;
|
|
127
|
+
to?: string;
|
|
65
128
|
}
|
|
66
|
-
interface
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
amount: number;
|
|
70
|
-
status: string;
|
|
71
|
-
createdAt: string;
|
|
129
|
+
interface ListAuditResponse {
|
|
130
|
+
logs: AuditLog[];
|
|
131
|
+
total: number;
|
|
72
132
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
constructor(apiKey: string, baseUrl: string);
|
|
78
|
-
getBalance(): Promise<WalletBalance>;
|
|
79
|
-
getTransactions(limit?: number): Promise<Transaction[]>;
|
|
80
|
-
getAddress(): Promise<string>;
|
|
133
|
+
declare class AuditResource {
|
|
134
|
+
private requester;
|
|
135
|
+
constructor(requester: Requester);
|
|
136
|
+
list(params?: ListAuditParams): Promise<ListAuditResponse>;
|
|
81
137
|
}
|
|
82
138
|
|
|
83
|
-
interface
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
spendByDay: Array<{
|
|
91
|
-
date: string;
|
|
92
|
-
amount: number;
|
|
93
|
-
}>;
|
|
139
|
+
interface ApiKey {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
prefix: string;
|
|
143
|
+
tier: 'free' | 'builder' | 'startup' | 'enterprise';
|
|
144
|
+
lastUsed?: string;
|
|
145
|
+
createdAt: string;
|
|
94
146
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
147
|
+
interface CreateKeyResponse {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
key: string;
|
|
151
|
+
tier: string;
|
|
152
|
+
createdAt: string;
|
|
101
153
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
154
|
+
declare class KeysResource {
|
|
155
|
+
private requester;
|
|
156
|
+
constructor(requester: Requester);
|
|
157
|
+
list(): Promise<ApiKey[]>;
|
|
158
|
+
create(name: string): Promise<CreateKeyResponse>;
|
|
159
|
+
revoke(keyId: string): Promise<{
|
|
160
|
+
deleted: boolean;
|
|
161
|
+
}>;
|
|
110
162
|
}
|
|
111
163
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
constructor(apiKey: string, baseUrl: string);
|
|
116
|
-
analyze(question: string): Promise<ChatResponse>;
|
|
117
|
-
getReport(): Promise<string>;
|
|
118
|
-
getRebalancingSuggestions(targetAllocation: Record<string, number>): Promise<string>;
|
|
164
|
+
interface ValtaConfig {
|
|
165
|
+
apiKey: string;
|
|
166
|
+
baseUrl?: string;
|
|
119
167
|
}
|
|
120
|
-
|
|
121
|
-
type Plugin = (client: ValtaClient) => void;
|
|
122
168
|
declare class ValtaClient {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
private plugins;
|
|
130
|
-
constructor(config: ValtaConfig);
|
|
131
|
-
use(plugin: Plugin): this;
|
|
132
|
-
listAgents(): Promise<AgentConfig[]>;
|
|
133
|
-
createAgent(agentId: string): AgentHandle;
|
|
134
|
-
createAutomation(config: AutomationConfig): Promise<Automation>;
|
|
135
|
-
listAutomations(): Promise<Automation[]>;
|
|
136
|
-
runAutomation(automationId: string): Promise<{
|
|
137
|
-
response: string | null;
|
|
138
|
-
}>;
|
|
139
|
-
createPipeline(config: PipelineConfig): Promise<string>;
|
|
140
|
-
runPipeline(pipelineId: string): Promise<PipelineResult[]>;
|
|
141
|
-
}
|
|
142
|
-
declare class AgentHandle {
|
|
143
|
-
private apiKey;
|
|
144
|
-
private baseUrl;
|
|
145
|
-
readonly agentId: string;
|
|
146
|
-
constructor(apiKey: string, baseUrl: string, agentId: string);
|
|
147
|
-
chat(message: string, conversationId?: string): Promise<ChatResponse>;
|
|
148
|
-
run(): this;
|
|
169
|
+
agents: AgentsResource;
|
|
170
|
+
wallets: WalletsResource;
|
|
171
|
+
policies: PoliciesResource;
|
|
172
|
+
audit: AuditResource;
|
|
173
|
+
keys: KeysResource;
|
|
174
|
+
constructor(config: ValtaConfig | string);
|
|
149
175
|
}
|
|
150
176
|
|
|
151
177
|
declare class ValtaError extends Error {
|
|
178
|
+
code: string;
|
|
152
179
|
status: number;
|
|
153
|
-
code
|
|
154
|
-
constructor(message: string, status?: number, code?: string);
|
|
180
|
+
constructor(message: string, code: string, status: number);
|
|
155
181
|
}
|
|
156
|
-
declare class
|
|
182
|
+
declare class AuthError extends ValtaError {
|
|
157
183
|
constructor(message?: string);
|
|
158
184
|
}
|
|
159
|
-
declare class
|
|
160
|
-
|
|
161
|
-
|
|
185
|
+
declare class TierError extends ValtaError {
|
|
186
|
+
requiredTier: string;
|
|
187
|
+
upgradeUrl: string;
|
|
188
|
+
constructor(message: string, requiredTier: string);
|
|
162
189
|
}
|
|
163
|
-
declare class
|
|
190
|
+
declare class RateLimitError extends ValtaError {
|
|
164
191
|
constructor(message?: string);
|
|
165
192
|
}
|
|
193
|
+
declare class NotFoundError extends ValtaError {
|
|
194
|
+
constructor(resource: string);
|
|
195
|
+
}
|
|
166
196
|
|
|
167
|
-
export { type
|
|
197
|
+
export { type Agent, type ApiKey, type AuditLog, AuthError, type CreateAgentParams, type CreateKeyResponse, type CreatePolicyParams, type ListAgentsParams, type ListAuditParams, NotFoundError, type Policy, RateLimitError, TierError, ValtaClient, ValtaError, type WalletBalance, type WalletTransfer, type WalletTransferParams, ValtaClient as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,167 +1,197 @@
|
|
|
1
|
-
interface
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
interface RequestOptions {
|
|
2
|
+
method?: 'GET' | 'POST' | 'PATCH' | 'DELETE';
|
|
3
|
+
body?: unknown;
|
|
4
|
+
}
|
|
5
|
+
declare class Requester {
|
|
6
|
+
private apiKey;
|
|
7
|
+
private baseUrl;
|
|
8
|
+
constructor(apiKey: string, baseUrl?: string);
|
|
9
|
+
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
8
10
|
}
|
|
9
11
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
interface AgentConfig {
|
|
13
|
-
agentId: string;
|
|
12
|
+
interface Agent {
|
|
13
|
+
id: string;
|
|
14
14
|
name: string;
|
|
15
|
-
|
|
15
|
+
type: string;
|
|
16
|
+
status: 'active' | 'frozen' | 'paused';
|
|
17
|
+
walletAddress?: string;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
interface CreateAgentParams {
|
|
22
|
+
name: string;
|
|
23
|
+
type: string;
|
|
16
24
|
description?: string;
|
|
17
|
-
planRequired?: PlanType;
|
|
18
|
-
isLive?: boolean;
|
|
19
25
|
}
|
|
20
|
-
interface
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
interface ListAgentsParams {
|
|
27
|
+
limit?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
status?: 'active' | 'frozen' | 'paused';
|
|
30
|
+
}
|
|
31
|
+
interface ListAgentsResponse {
|
|
32
|
+
agents: Agent[];
|
|
33
|
+
total: number;
|
|
34
|
+
limit: number;
|
|
35
|
+
offset: number;
|
|
36
|
+
}
|
|
37
|
+
declare class AgentsResource {
|
|
38
|
+
private requester;
|
|
39
|
+
constructor(requester: Requester);
|
|
40
|
+
list(params?: ListAgentsParams): Promise<ListAgentsResponse>;
|
|
41
|
+
get(agentId: string): Promise<Agent>;
|
|
42
|
+
create(params: CreateAgentParams): Promise<Agent>;
|
|
43
|
+
update(agentId: string, params: Partial<CreateAgentParams>): Promise<Agent>;
|
|
44
|
+
freeze(agentId: string): Promise<Agent>;
|
|
45
|
+
unfreeze(agentId: string): Promise<Agent>;
|
|
46
|
+
delete(agentId: string): Promise<{
|
|
47
|
+
deleted: boolean;
|
|
48
|
+
id: string;
|
|
49
|
+
}>;
|
|
23
50
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
51
|
+
|
|
52
|
+
interface WalletBalance {
|
|
53
|
+
usdc: string;
|
|
54
|
+
usdcPending: string;
|
|
55
|
+
lastUpdated: string;
|
|
56
|
+
}
|
|
57
|
+
interface WalletTransferParams {
|
|
58
|
+
toAgentId?: string;
|
|
59
|
+
toAddress?: string;
|
|
60
|
+
amount: string;
|
|
61
|
+
currency: 'USDC';
|
|
62
|
+
note?: string;
|
|
63
|
+
}
|
|
64
|
+
interface WalletTransfer {
|
|
65
|
+
id: string;
|
|
66
|
+
fromAgentId: string;
|
|
67
|
+
toAgentId?: string;
|
|
68
|
+
toAddress?: string;
|
|
69
|
+
amount: string;
|
|
70
|
+
currency: string;
|
|
71
|
+
status: 'pending' | 'completed' | 'failed';
|
|
72
|
+
createdAt: string;
|
|
29
73
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
enabled?: boolean;
|
|
74
|
+
declare class WalletsResource {
|
|
75
|
+
private requester;
|
|
76
|
+
constructor(requester: Requester);
|
|
77
|
+
get(agentId: string): Promise<WalletBalance>;
|
|
78
|
+
transfer(agentId: string, params: WalletTransferParams): Promise<WalletTransfer>;
|
|
36
79
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
80
|
+
|
|
81
|
+
interface Policy {
|
|
82
|
+
id: string;
|
|
40
83
|
agentId: string;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
84
|
+
name: string;
|
|
85
|
+
maxSpendPerDay?: number;
|
|
86
|
+
maxSpendPerTransaction?: number;
|
|
87
|
+
allowedRecipients?: string[];
|
|
88
|
+
currency: string;
|
|
89
|
+
active: boolean;
|
|
90
|
+
createdAt: string;
|
|
46
91
|
}
|
|
47
|
-
interface
|
|
92
|
+
interface CreatePolicyParams {
|
|
48
93
|
agentId: string;
|
|
49
|
-
task: string;
|
|
50
|
-
}
|
|
51
|
-
interface PipelineConfig {
|
|
52
94
|
name: string;
|
|
53
|
-
|
|
54
|
-
|
|
95
|
+
maxSpendPerDay?: number;
|
|
96
|
+
maxSpendPerTransaction?: number;
|
|
97
|
+
allowedRecipients?: string[];
|
|
98
|
+
currency?: string;
|
|
99
|
+
}
|
|
100
|
+
declare class PoliciesResource {
|
|
101
|
+
private requester;
|
|
102
|
+
constructor(requester: Requester);
|
|
103
|
+
list(agentId?: string): Promise<Policy[]>;
|
|
104
|
+
create(params: CreatePolicyParams): Promise<Policy>;
|
|
105
|
+
update(policyId: string, params: Partial<CreatePolicyParams>): Promise<Policy>;
|
|
106
|
+
delete(policyId: string): Promise<{
|
|
107
|
+
deleted: boolean;
|
|
108
|
+
}>;
|
|
55
109
|
}
|
|
56
|
-
|
|
110
|
+
|
|
111
|
+
interface AuditLog {
|
|
112
|
+
id: string;
|
|
57
113
|
agentId: string;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
114
|
+
action: string;
|
|
115
|
+
amount?: string;
|
|
116
|
+
currency?: string;
|
|
117
|
+
metadata?: Record<string, unknown>;
|
|
118
|
+
hash: string;
|
|
119
|
+
previousHash: string;
|
|
120
|
+
createdAt: string;
|
|
61
121
|
}
|
|
62
|
-
interface
|
|
63
|
-
|
|
64
|
-
|
|
122
|
+
interface ListAuditParams {
|
|
123
|
+
agentId?: string;
|
|
124
|
+
limit?: number;
|
|
125
|
+
offset?: number;
|
|
126
|
+
from?: string;
|
|
127
|
+
to?: string;
|
|
65
128
|
}
|
|
66
|
-
interface
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
amount: number;
|
|
70
|
-
status: string;
|
|
71
|
-
createdAt: string;
|
|
129
|
+
interface ListAuditResponse {
|
|
130
|
+
logs: AuditLog[];
|
|
131
|
+
total: number;
|
|
72
132
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
constructor(apiKey: string, baseUrl: string);
|
|
78
|
-
getBalance(): Promise<WalletBalance>;
|
|
79
|
-
getTransactions(limit?: number): Promise<Transaction[]>;
|
|
80
|
-
getAddress(): Promise<string>;
|
|
133
|
+
declare class AuditResource {
|
|
134
|
+
private requester;
|
|
135
|
+
constructor(requester: Requester);
|
|
136
|
+
list(params?: ListAuditParams): Promise<ListAuditResponse>;
|
|
81
137
|
}
|
|
82
138
|
|
|
83
|
-
interface
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
spendByDay: Array<{
|
|
91
|
-
date: string;
|
|
92
|
-
amount: number;
|
|
93
|
-
}>;
|
|
139
|
+
interface ApiKey {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
prefix: string;
|
|
143
|
+
tier: 'free' | 'builder' | 'startup' | 'enterprise';
|
|
144
|
+
lastUsed?: string;
|
|
145
|
+
createdAt: string;
|
|
94
146
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
147
|
+
interface CreateKeyResponse {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
key: string;
|
|
151
|
+
tier: string;
|
|
152
|
+
createdAt: string;
|
|
101
153
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
154
|
+
declare class KeysResource {
|
|
155
|
+
private requester;
|
|
156
|
+
constructor(requester: Requester);
|
|
157
|
+
list(): Promise<ApiKey[]>;
|
|
158
|
+
create(name: string): Promise<CreateKeyResponse>;
|
|
159
|
+
revoke(keyId: string): Promise<{
|
|
160
|
+
deleted: boolean;
|
|
161
|
+
}>;
|
|
110
162
|
}
|
|
111
163
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
constructor(apiKey: string, baseUrl: string);
|
|
116
|
-
analyze(question: string): Promise<ChatResponse>;
|
|
117
|
-
getReport(): Promise<string>;
|
|
118
|
-
getRebalancingSuggestions(targetAllocation: Record<string, number>): Promise<string>;
|
|
164
|
+
interface ValtaConfig {
|
|
165
|
+
apiKey: string;
|
|
166
|
+
baseUrl?: string;
|
|
119
167
|
}
|
|
120
|
-
|
|
121
|
-
type Plugin = (client: ValtaClient) => void;
|
|
122
168
|
declare class ValtaClient {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
private plugins;
|
|
130
|
-
constructor(config: ValtaConfig);
|
|
131
|
-
use(plugin: Plugin): this;
|
|
132
|
-
listAgents(): Promise<AgentConfig[]>;
|
|
133
|
-
createAgent(agentId: string): AgentHandle;
|
|
134
|
-
createAutomation(config: AutomationConfig): Promise<Automation>;
|
|
135
|
-
listAutomations(): Promise<Automation[]>;
|
|
136
|
-
runAutomation(automationId: string): Promise<{
|
|
137
|
-
response: string | null;
|
|
138
|
-
}>;
|
|
139
|
-
createPipeline(config: PipelineConfig): Promise<string>;
|
|
140
|
-
runPipeline(pipelineId: string): Promise<PipelineResult[]>;
|
|
141
|
-
}
|
|
142
|
-
declare class AgentHandle {
|
|
143
|
-
private apiKey;
|
|
144
|
-
private baseUrl;
|
|
145
|
-
readonly agentId: string;
|
|
146
|
-
constructor(apiKey: string, baseUrl: string, agentId: string);
|
|
147
|
-
chat(message: string, conversationId?: string): Promise<ChatResponse>;
|
|
148
|
-
run(): this;
|
|
169
|
+
agents: AgentsResource;
|
|
170
|
+
wallets: WalletsResource;
|
|
171
|
+
policies: PoliciesResource;
|
|
172
|
+
audit: AuditResource;
|
|
173
|
+
keys: KeysResource;
|
|
174
|
+
constructor(config: ValtaConfig | string);
|
|
149
175
|
}
|
|
150
176
|
|
|
151
177
|
declare class ValtaError extends Error {
|
|
178
|
+
code: string;
|
|
152
179
|
status: number;
|
|
153
|
-
code
|
|
154
|
-
constructor(message: string, status?: number, code?: string);
|
|
180
|
+
constructor(message: string, code: string, status: number);
|
|
155
181
|
}
|
|
156
|
-
declare class
|
|
182
|
+
declare class AuthError extends ValtaError {
|
|
157
183
|
constructor(message?: string);
|
|
158
184
|
}
|
|
159
|
-
declare class
|
|
160
|
-
|
|
161
|
-
|
|
185
|
+
declare class TierError extends ValtaError {
|
|
186
|
+
requiredTier: string;
|
|
187
|
+
upgradeUrl: string;
|
|
188
|
+
constructor(message: string, requiredTier: string);
|
|
162
189
|
}
|
|
163
|
-
declare class
|
|
190
|
+
declare class RateLimitError extends ValtaError {
|
|
164
191
|
constructor(message?: string);
|
|
165
192
|
}
|
|
193
|
+
declare class NotFoundError extends ValtaError {
|
|
194
|
+
constructor(resource: string);
|
|
195
|
+
}
|
|
166
196
|
|
|
167
|
-
export { type
|
|
197
|
+
export { type Agent, type ApiKey, type AuditLog, AuthError, type CreateAgentParams, type CreateKeyResponse, type CreatePolicyParams, type ListAgentsParams, type ListAuditParams, NotFoundError, type Policy, RateLimitError, TierError, ValtaClient, ValtaError, type WalletBalance, type WalletTransfer, type WalletTransferParams, ValtaClient as default };
|