valta-sdk 2.0.1 → 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.
@@ -0,0 +1,375 @@
1
+ "use strict";
2
+
3
+ // src/cli/commands/login.ts
4
+ var import_readline = require("readline");
5
+
6
+ // src/cli/config.ts
7
+ var import_os = require("os");
8
+ var import_path = require("path");
9
+ var import_fs = require("fs");
10
+ var CONFIG_DIR = (0, import_path.join)((0, import_os.homedir)(), ".valta");
11
+ var CONFIG_FILE = (0, import_path.join)(CONFIG_DIR, "config.json");
12
+ function saveConfig(config) {
13
+ if (!(0, import_fs.existsSync)(CONFIG_DIR)) (0, import_fs.mkdirSync)(CONFIG_DIR, { recursive: true });
14
+ (0, import_fs.writeFileSync)(CONFIG_FILE, JSON.stringify(config, null, 2));
15
+ }
16
+ function loadConfig() {
17
+ if (!(0, import_fs.existsSync)(CONFIG_FILE)) return null;
18
+ try {
19
+ return JSON.parse((0, import_fs.readFileSync)(CONFIG_FILE, "utf-8"));
20
+ } catch {
21
+ return null;
22
+ }
23
+ }
24
+ function clearConfig() {
25
+ if ((0, import_fs.existsSync)(CONFIG_FILE)) (0, import_fs.writeFileSync)(CONFIG_FILE, "{}");
26
+ }
27
+ function getApiKey() {
28
+ return loadConfig()?.apiKey ?? null;
29
+ }
30
+
31
+ // src/cli/commands/login.ts
32
+ function prompt(question) {
33
+ const rl = (0, import_readline.createInterface)({ input: process.stdin, output: process.stdout });
34
+ return new Promise((resolve) => {
35
+ rl.question(question, (answer) => {
36
+ rl.close();
37
+ resolve(answer.trim());
38
+ });
39
+ });
40
+ }
41
+ async function loginCommand() {
42
+ console.log("\n Valta Login\n");
43
+ const apiKey = await prompt(" API Key: ");
44
+ if (!apiKey || !apiKey.startsWith("vk_")) {
45
+ console.error("\n \u2716 Invalid API key. Keys start with vk_\n");
46
+ process.exit(1);
47
+ }
48
+ saveConfig({ apiKey });
49
+ console.log("\n \u2714 API key saved to ~/.valta/config.json");
50
+ console.log(" You can now use the Valta SDK.\n");
51
+ }
52
+
53
+ // src/errors/index.ts
54
+ var ValtaError = class extends Error {
55
+ constructor(message, code, status) {
56
+ super(message);
57
+ this.name = "ValtaError";
58
+ this.code = code;
59
+ this.status = status;
60
+ }
61
+ };
62
+ var AuthError = class extends ValtaError {
63
+ constructor(message = "Invalid or missing API key") {
64
+ super(message, "UNAUTHORIZED", 401);
65
+ this.name = "AuthError";
66
+ }
67
+ };
68
+ var TierError = class extends ValtaError {
69
+ constructor(message, requiredTier) {
70
+ super(message, "TIER_LIMIT", 403);
71
+ this.name = "TierError";
72
+ this.requiredTier = requiredTier;
73
+ this.upgradeUrl = "https://valta.co/upgrade";
74
+ }
75
+ };
76
+ var RateLimitError = class extends ValtaError {
77
+ constructor(message = "Rate limit exceeded. Slow down your requests.") {
78
+ super(message, "RATE_LIMIT", 429);
79
+ this.name = "RateLimitError";
80
+ }
81
+ };
82
+ var NotFoundError = class extends ValtaError {
83
+ constructor(resource) {
84
+ super(`${resource} not found`, "NOT_FOUND", 404);
85
+ this.name = "NotFoundError";
86
+ }
87
+ };
88
+
89
+ // src/http/requester.ts
90
+ var DEFAULT_BASE_URL = "https://valta.co/api/v1";
91
+ var Requester = class {
92
+ constructor(apiKey, baseUrl) {
93
+ if (!apiKey || typeof apiKey !== "string") {
94
+ throw new AuthError("An API key is required. Get one at https://valta.co/dashboard/api-keys");
95
+ }
96
+ this.apiKey = apiKey;
97
+ this.baseUrl = baseUrl ?? DEFAULT_BASE_URL;
98
+ }
99
+ async request(path, options = {}) {
100
+ const { method = "GET", body } = options;
101
+ const res = await fetch(`${this.baseUrl}${path}`, {
102
+ method,
103
+ headers: {
104
+ "Authorization": `Bearer ${this.apiKey}`,
105
+ "Content-Type": "application/json",
106
+ "X-Valta-SDK": "0.2.0"
107
+ },
108
+ body: body ? JSON.stringify(body) : void 0
109
+ });
110
+ if (!res.ok) {
111
+ let errorData = {};
112
+ try {
113
+ errorData = await res.json();
114
+ } catch {
115
+ }
116
+ const message = errorData.message ?? "An unknown error occurred";
117
+ switch (res.status) {
118
+ case 401:
119
+ throw new AuthError(message);
120
+ case 403:
121
+ throw new TierError(message, errorData.requiredTier ?? "builder");
122
+ case 404:
123
+ throw new NotFoundError(path);
124
+ case 429:
125
+ throw new RateLimitError(message);
126
+ default:
127
+ throw new ValtaError(message, "SERVER_ERROR", res.status);
128
+ }
129
+ }
130
+ return res.json();
131
+ }
132
+ };
133
+
134
+ // src/resources/agents.ts
135
+ var AgentsResource = class {
136
+ constructor(requester) {
137
+ this.requester = requester;
138
+ }
139
+ // Get all agents
140
+ async list(params = {}) {
141
+ const query = new URLSearchParams();
142
+ if (params.limit) query.set("limit", String(params.limit));
143
+ if (params.offset) query.set("offset", String(params.offset));
144
+ if (params.status) query.set("status", params.status);
145
+ const qs = query.toString();
146
+ return this.requester.request(
147
+ `/agents${qs ? `?${qs}` : ""}`
148
+ );
149
+ }
150
+ // Get one agent by ID
151
+ async get(agentId) {
152
+ return this.requester.request(`/agents/${agentId}`);
153
+ }
154
+ // Create a new agent
155
+ async create(params) {
156
+ return this.requester.request("/agents", {
157
+ method: "POST",
158
+ body: params
159
+ });
160
+ }
161
+ // Update an agent
162
+ async update(agentId, params) {
163
+ return this.requester.request(`/agents/${agentId}`, {
164
+ method: "PATCH",
165
+ body: params
166
+ });
167
+ }
168
+ // Freeze an agent (stops it from spending)
169
+ async freeze(agentId) {
170
+ return this.requester.request(`/agents/${agentId}/freeze`, {
171
+ method: "POST"
172
+ });
173
+ }
174
+ // Unfreeze an agent
175
+ async unfreeze(agentId) {
176
+ return this.requester.request(`/agents/${agentId}/unfreeze`, {
177
+ method: "POST"
178
+ });
179
+ }
180
+ // Delete an agent
181
+ async delete(agentId) {
182
+ return this.requester.request(
183
+ `/agents/${agentId}`,
184
+ { method: "DELETE" }
185
+ );
186
+ }
187
+ };
188
+
189
+ // src/resources/wallets.ts
190
+ var WalletsResource = class {
191
+ constructor(requester) {
192
+ this.requester = requester;
193
+ }
194
+ // Get wallet balance for an agent
195
+ async get(agentId) {
196
+ return this.requester.request(
197
+ `/agents/${agentId}/wallet`
198
+ );
199
+ }
200
+ // Transfer funds from one agent wallet to another
201
+ async transfer(agentId, params) {
202
+ return this.requester.request(
203
+ `/agents/${agentId}/wallet/transfer`,
204
+ { method: "POST", body: params }
205
+ );
206
+ }
207
+ };
208
+
209
+ // src/resources/policies.ts
210
+ var PoliciesResource = class {
211
+ constructor(requester) {
212
+ this.requester = requester;
213
+ }
214
+ async list(agentId) {
215
+ const qs = agentId ? `?agentId=${agentId}` : "";
216
+ return this.requester.request(`/policies${qs}`);
217
+ }
218
+ async create(params) {
219
+ return this.requester.request("/policies", {
220
+ method: "POST",
221
+ body: params
222
+ });
223
+ }
224
+ async update(policyId, params) {
225
+ return this.requester.request(`/policies/${policyId}`, {
226
+ method: "PATCH",
227
+ body: params
228
+ });
229
+ }
230
+ async delete(policyId) {
231
+ return this.requester.request(`/policies/${policyId}`, {
232
+ method: "DELETE"
233
+ });
234
+ }
235
+ };
236
+
237
+ // src/resources/audit.ts
238
+ var AuditResource = class {
239
+ constructor(requester) {
240
+ this.requester = requester;
241
+ }
242
+ async list(params = {}) {
243
+ const query = new URLSearchParams();
244
+ if (params.agentId) query.set("agentId", params.agentId);
245
+ if (params.limit) query.set("limit", String(params.limit));
246
+ if (params.offset) query.set("offset", String(params.offset));
247
+ if (params.from) query.set("from", params.from);
248
+ if (params.to) query.set("to", params.to);
249
+ const qs = query.toString();
250
+ return this.requester.request(`/audit${qs ? `?${qs}` : ""}`);
251
+ }
252
+ };
253
+
254
+ // src/resources/keys.ts
255
+ var KeysResource = class {
256
+ constructor(requester) {
257
+ this.requester = requester;
258
+ }
259
+ async list() {
260
+ return this.requester.request("/keys");
261
+ }
262
+ async create(name) {
263
+ return this.requester.request("/keys", {
264
+ method: "POST",
265
+ body: { name }
266
+ });
267
+ }
268
+ async revoke(keyId) {
269
+ return this.requester.request(`/keys/${keyId}`, {
270
+ method: "DELETE"
271
+ });
272
+ }
273
+ };
274
+
275
+ // src/client.ts
276
+ var ValtaClient = class {
277
+ constructor(config) {
278
+ const apiKey = typeof config === "string" ? config : config.apiKey;
279
+ const baseUrl = typeof config === "object" ? config.baseUrl : void 0;
280
+ const requester = new Requester(apiKey, baseUrl);
281
+ this.agents = new AgentsResource(requester);
282
+ this.wallets = new WalletsResource(requester);
283
+ this.policies = new PoliciesResource(requester);
284
+ this.audit = new AuditResource(requester);
285
+ this.keys = new KeysResource(requester);
286
+ }
287
+ };
288
+
289
+ // src/cli/commands/agents.ts
290
+ function getClient() {
291
+ const apiKey = getApiKey();
292
+ if (!apiKey) {
293
+ console.error("\n \u2716 Not logged in. Run: valta login\n");
294
+ process.exit(1);
295
+ }
296
+ return new ValtaClient(apiKey);
297
+ }
298
+ async function agentsListCommand() {
299
+ const client = getClient();
300
+ try {
301
+ const result = await client.agents.list();
302
+ const agents = result.agents;
303
+ if (agents.length === 0) {
304
+ console.log("\n No agents found. Create one at https://valta.co/dashboard\n");
305
+ return;
306
+ }
307
+ console.log("\n ID NAME STATUS");
308
+ console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
309
+ for (const agent of agents) {
310
+ const id = agent.id.padEnd(16);
311
+ const name = agent.name.padEnd(23);
312
+ const status = agent.status;
313
+ console.log(` ${id} ${name} ${status}`);
314
+ }
315
+ console.log();
316
+ } catch (err) {
317
+ console.error(`
318
+ \u2716 ${err instanceof Error ? err.message : "Unknown error"}
319
+ `);
320
+ process.exit(1);
321
+ }
322
+ }
323
+ async function agentsFreezeCommand(agentId) {
324
+ const client = getClient();
325
+ try {
326
+ await client.agents.freeze(agentId);
327
+ console.log(`
328
+ \u2714 Agent ${agentId} frozen.
329
+ `);
330
+ } catch (err) {
331
+ console.error(`
332
+ \u2716 ${err instanceof Error ? err.message : "Unknown error"}
333
+ `);
334
+ process.exit(1);
335
+ }
336
+ }
337
+
338
+ // src/cli/index.ts
339
+ var [, , command, sub, ...args] = process.argv;
340
+ async function main() {
341
+ switch (command) {
342
+ case "login":
343
+ await loginCommand();
344
+ break;
345
+ case "logout":
346
+ clearConfig();
347
+ console.log("\n \u2714 Logged out. Config cleared.\n");
348
+ break;
349
+ case "agents":
350
+ if (sub === "list" || !sub) {
351
+ await agentsListCommand();
352
+ } else if (sub === "freeze" && args[0]) {
353
+ await agentsFreezeCommand(args[0]);
354
+ } else {
355
+ console.log("\n Usage:");
356
+ console.log(" valta agents list");
357
+ console.log(" valta agents freeze [id]\n");
358
+ }
359
+ break;
360
+ default:
361
+ console.log(`
362
+ Valta CLI
363
+
364
+ Commands:
365
+ valta login Save your API key
366
+ valta logout Clear credentials
367
+ valta agents list List all agents
368
+ valta agents freeze [id] Freeze an agent
369
+ `);
370
+ }
371
+ }
372
+ main().catch((err) => {
373
+ console.error("\n \u2716 Unexpected error:", err.message, "\n");
374
+ process.exit(1);
375
+ });
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,141 @@
1
+ import {
2
+ ValtaClient
3
+ } from "../chunk-LPBJPXJO.js";
4
+
5
+ // src/cli/commands/login.ts
6
+ import { createInterface } from "readline";
7
+
8
+ // src/cli/config.ts
9
+ import { homedir } from "os";
10
+ import { join } from "path";
11
+ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
12
+ var CONFIG_DIR = join(homedir(), ".valta");
13
+ var CONFIG_FILE = join(CONFIG_DIR, "config.json");
14
+ function saveConfig(config) {
15
+ if (!existsSync(CONFIG_DIR)) mkdirSync(CONFIG_DIR, { recursive: true });
16
+ writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
17
+ }
18
+ function loadConfig() {
19
+ if (!existsSync(CONFIG_FILE)) return null;
20
+ try {
21
+ return JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+ function clearConfig() {
27
+ if (existsSync(CONFIG_FILE)) writeFileSync(CONFIG_FILE, "{}");
28
+ }
29
+ function getApiKey() {
30
+ return loadConfig()?.apiKey ?? null;
31
+ }
32
+
33
+ // src/cli/commands/login.ts
34
+ function prompt(question) {
35
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
36
+ return new Promise((resolve) => {
37
+ rl.question(question, (answer) => {
38
+ rl.close();
39
+ resolve(answer.trim());
40
+ });
41
+ });
42
+ }
43
+ async function loginCommand() {
44
+ console.log("\n Valta Login\n");
45
+ const apiKey = await prompt(" API Key: ");
46
+ if (!apiKey || !apiKey.startsWith("vk_")) {
47
+ console.error("\n \u2716 Invalid API key. Keys start with vk_\n");
48
+ process.exit(1);
49
+ }
50
+ saveConfig({ apiKey });
51
+ console.log("\n \u2714 API key saved to ~/.valta/config.json");
52
+ console.log(" You can now use the Valta SDK.\n");
53
+ }
54
+
55
+ // src/cli/commands/agents.ts
56
+ function getClient() {
57
+ const apiKey = getApiKey();
58
+ if (!apiKey) {
59
+ console.error("\n \u2716 Not logged in. Run: valta login\n");
60
+ process.exit(1);
61
+ }
62
+ return new ValtaClient(apiKey);
63
+ }
64
+ async function agentsListCommand() {
65
+ const client = getClient();
66
+ try {
67
+ const result = await client.agents.list();
68
+ const agents = result.agents;
69
+ if (agents.length === 0) {
70
+ console.log("\n No agents found. Create one at https://valta.co/dashboard\n");
71
+ return;
72
+ }
73
+ console.log("\n ID NAME STATUS");
74
+ console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
75
+ for (const agent of agents) {
76
+ const id = agent.id.padEnd(16);
77
+ const name = agent.name.padEnd(23);
78
+ const status = agent.status;
79
+ console.log(` ${id} ${name} ${status}`);
80
+ }
81
+ console.log();
82
+ } catch (err) {
83
+ console.error(`
84
+ \u2716 ${err instanceof Error ? err.message : "Unknown error"}
85
+ `);
86
+ process.exit(1);
87
+ }
88
+ }
89
+ async function agentsFreezeCommand(agentId) {
90
+ const client = getClient();
91
+ try {
92
+ await client.agents.freeze(agentId);
93
+ console.log(`
94
+ \u2714 Agent ${agentId} frozen.
95
+ `);
96
+ } catch (err) {
97
+ console.error(`
98
+ \u2716 ${err instanceof Error ? err.message : "Unknown error"}
99
+ `);
100
+ process.exit(1);
101
+ }
102
+ }
103
+
104
+ // src/cli/index.ts
105
+ var [, , command, sub, ...args] = process.argv;
106
+ async function main() {
107
+ switch (command) {
108
+ case "login":
109
+ await loginCommand();
110
+ break;
111
+ case "logout":
112
+ clearConfig();
113
+ console.log("\n \u2714 Logged out. Config cleared.\n");
114
+ break;
115
+ case "agents":
116
+ if (sub === "list" || !sub) {
117
+ await agentsListCommand();
118
+ } else if (sub === "freeze" && args[0]) {
119
+ await agentsFreezeCommand(args[0]);
120
+ } else {
121
+ console.log("\n Usage:");
122
+ console.log(" valta agents list");
123
+ console.log(" valta agents freeze [id]\n");
124
+ }
125
+ break;
126
+ default:
127
+ console.log(`
128
+ Valta CLI
129
+
130
+ Commands:
131
+ valta login Save your API key
132
+ valta logout Clear credentials
133
+ valta agents list List all agents
134
+ valta agents freeze [id] Freeze an agent
135
+ `);
136
+ }
137
+ }
138
+ main().catch((err) => {
139
+ console.error("\n \u2716 Unexpected error:", err.message, "\n");
140
+ process.exit(1);
141
+ });
@@ -0,0 +1,141 @@
1
+ import {
2
+ ValtaClient
3
+ } from "../chunk-HGO47A3L.mjs";
4
+
5
+ // src/cli/commands/login.ts
6
+ import { createInterface } from "readline";
7
+
8
+ // src/cli/config.ts
9
+ import { homedir } from "os";
10
+ import { join } from "path";
11
+ import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
12
+ var CONFIG_DIR = join(homedir(), ".valta");
13
+ var CONFIG_FILE = join(CONFIG_DIR, "config.json");
14
+ function saveConfig(config) {
15
+ if (!existsSync(CONFIG_DIR)) mkdirSync(CONFIG_DIR, { recursive: true });
16
+ writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2));
17
+ }
18
+ function loadConfig() {
19
+ if (!existsSync(CONFIG_FILE)) return null;
20
+ try {
21
+ return JSON.parse(readFileSync(CONFIG_FILE, "utf-8"));
22
+ } catch {
23
+ return null;
24
+ }
25
+ }
26
+ function clearConfig() {
27
+ if (existsSync(CONFIG_FILE)) writeFileSync(CONFIG_FILE, "{}");
28
+ }
29
+ function getApiKey() {
30
+ return loadConfig()?.apiKey ?? null;
31
+ }
32
+
33
+ // src/cli/commands/login.ts
34
+ function prompt(question) {
35
+ const rl = createInterface({ input: process.stdin, output: process.stdout });
36
+ return new Promise((resolve) => {
37
+ rl.question(question, (answer) => {
38
+ rl.close();
39
+ resolve(answer.trim());
40
+ });
41
+ });
42
+ }
43
+ async function loginCommand() {
44
+ console.log("\n Valta Login\n");
45
+ const apiKey = await prompt(" API Key: ");
46
+ if (!apiKey || !apiKey.startsWith("vk_")) {
47
+ console.error("\n \u2716 Invalid API key. Keys start with vk_\n");
48
+ process.exit(1);
49
+ }
50
+ saveConfig({ apiKey });
51
+ console.log("\n \u2714 API key saved to ~/.valta/config.json");
52
+ console.log(" You can now use the Valta SDK.\n");
53
+ }
54
+
55
+ // src/cli/commands/agents.ts
56
+ function getClient() {
57
+ const apiKey = getApiKey();
58
+ if (!apiKey) {
59
+ console.error("\n \u2716 Not logged in. Run: valta login\n");
60
+ process.exit(1);
61
+ }
62
+ return new ValtaClient(apiKey);
63
+ }
64
+ async function agentsListCommand() {
65
+ const client = getClient();
66
+ try {
67
+ const result = await client.agents.list();
68
+ const agents = result.agents;
69
+ if (agents.length === 0) {
70
+ console.log("\n No agents found. Create one at https://valta.co/dashboard\n");
71
+ return;
72
+ }
73
+ console.log("\n ID NAME STATUS");
74
+ console.log(" \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
75
+ for (const agent of agents) {
76
+ const id = agent.id.padEnd(16);
77
+ const name = agent.name.padEnd(23);
78
+ const status = agent.status;
79
+ console.log(` ${id} ${name} ${status}`);
80
+ }
81
+ console.log();
82
+ } catch (err) {
83
+ console.error(`
84
+ \u2716 ${err instanceof Error ? err.message : "Unknown error"}
85
+ `);
86
+ process.exit(1);
87
+ }
88
+ }
89
+ async function agentsFreezeCommand(agentId) {
90
+ const client = getClient();
91
+ try {
92
+ await client.agents.freeze(agentId);
93
+ console.log(`
94
+ \u2714 Agent ${agentId} frozen.
95
+ `);
96
+ } catch (err) {
97
+ console.error(`
98
+ \u2716 ${err instanceof Error ? err.message : "Unknown error"}
99
+ `);
100
+ process.exit(1);
101
+ }
102
+ }
103
+
104
+ // src/cli/index.ts
105
+ var [, , command, sub, ...args] = process.argv;
106
+ async function main() {
107
+ switch (command) {
108
+ case "login":
109
+ await loginCommand();
110
+ break;
111
+ case "logout":
112
+ clearConfig();
113
+ console.log("\n \u2714 Logged out. Config cleared.\n");
114
+ break;
115
+ case "agents":
116
+ if (sub === "list" || !sub) {
117
+ await agentsListCommand();
118
+ } else if (sub === "freeze" && args[0]) {
119
+ await agentsFreezeCommand(args[0]);
120
+ } else {
121
+ console.log("\n Usage:");
122
+ console.log(" valta agents list");
123
+ console.log(" valta agents freeze [id]\n");
124
+ }
125
+ break;
126
+ default:
127
+ console.log(`
128
+ Valta CLI
129
+
130
+ Commands:
131
+ valta login Save your API key
132
+ valta logout Clear credentials
133
+ valta agents list List all agents
134
+ valta agents freeze [id] Freeze an agent
135
+ `);
136
+ }
137
+ }
138
+ main().catch((err) => {
139
+ console.error("\n \u2716 Unexpected error:", err.message, "\n");
140
+ process.exit(1);
141
+ });