@palmyr/cli 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.
Files changed (47) hide show
  1. package/README.md +731 -0
  2. package/dist/admin-auth.d.ts +1 -0
  3. package/dist/admin-auth.js +52 -0
  4. package/dist/admin-auth.js.map +1 -0
  5. package/dist/app.d.ts +182 -0
  6. package/dist/app.js +218 -0
  7. package/dist/app.js.map +1 -0
  8. package/dist/cli.d.ts +2 -0
  9. package/dist/cli.js +3495 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/compute-ssh.d.ts +246 -0
  12. package/dist/compute-ssh.js +577 -0
  13. package/dist/compute-ssh.js.map +1 -0
  14. package/dist/config.d.ts +46 -0
  15. package/dist/config.js +183 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/credential-store.d.ts +4 -0
  18. package/dist/credential-store.js +180 -0
  19. package/dist/credential-store.js.map +1 -0
  20. package/dist/mascot-data.d.ts +1 -0
  21. package/dist/mascot-data.js +14 -0
  22. package/dist/mascot-data.js.map +1 -0
  23. package/dist/pay.d.ts +60 -0
  24. package/dist/pay.js +483 -0
  25. package/dist/pay.js.map +1 -0
  26. package/dist/sdk.d.ts +259 -0
  27. package/dist/sdk.js +944 -0
  28. package/dist/sdk.js.map +1 -0
  29. package/dist/social-queue.d.ts +125 -0
  30. package/dist/social-queue.js +340 -0
  31. package/dist/social-queue.js.map +1 -0
  32. package/dist/social-vault.d.ts +118 -0
  33. package/dist/social-vault.js +268 -0
  34. package/dist/social-vault.js.map +1 -0
  35. package/dist/social-worker.d.ts +43 -0
  36. package/dist/social-worker.js +155 -0
  37. package/dist/social-worker.js.map +1 -0
  38. package/dist/totp.d.ts +2 -0
  39. package/dist/totp.js +46 -0
  40. package/dist/totp.js.map +1 -0
  41. package/dist/ui.d.ts +77 -0
  42. package/dist/ui.js +441 -0
  43. package/dist/ui.js.map +1 -0
  44. package/dist/vault.d.ts +65 -0
  45. package/dist/vault.js +455 -0
  46. package/dist/vault.js.map +1 -0
  47. package/package.json +75 -0
package/dist/ui.d.ts ADDED
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Palmyr CLI UI — terminal rendering utilities
3
+ * Inspired by Claude Code's aesthetic
4
+ */
5
+ export declare function setAgentMode(v: boolean): void;
6
+ export declare function isAgentMode(): boolean;
7
+ export declare const theme: {
8
+ accent: string;
9
+ success: string;
10
+ error: string;
11
+ warn: string;
12
+ info: string;
13
+ text: string;
14
+ muted: string;
15
+ dim: string;
16
+ bold: string;
17
+ reset: string;
18
+ underline: string;
19
+ };
20
+ export declare const icon: {
21
+ success: string;
22
+ error: string;
23
+ warn: string;
24
+ info: string;
25
+ arrow: string;
26
+ dot: string;
27
+ bullet: string;
28
+ };
29
+ export declare class Spinner {
30
+ private static stack;
31
+ private interval;
32
+ private frame;
33
+ private label;
34
+ private active;
35
+ private stopped;
36
+ private render;
37
+ private terminateRender;
38
+ private pause;
39
+ private resume;
40
+ private popAndResume;
41
+ start(label: string): void;
42
+ update(label: string): void;
43
+ stop(label: string, success?: boolean): void;
44
+ cancel(): void;
45
+ }
46
+ export declare function header(title: string): void;
47
+ export declare function row(label: string, value: string, valueColor?: string): void;
48
+ export declare function ok(msg: string): void;
49
+ export declare function fail(msg: string): void;
50
+ export declare function warn(msg: string): void;
51
+ export declare function info(msg: string): void;
52
+ export declare function subtle(msg: string): void;
53
+ export declare function divider(): void;
54
+ export declare function blank(): void;
55
+ export declare function table(headers: string[], rows: string[][]): void;
56
+ export declare function box(title: string, content: string, color?: string): void;
57
+ export declare function progress(current: number, total: number, label?: string): void;
58
+ export declare function initReport(title: string, items: Array<{
59
+ name: string;
60
+ status: 'created' | 'updated' | 'skipped' | 'exists';
61
+ }>): void;
62
+ export declare function banner(): void;
63
+ export declare function kv(label: string, value: string): void;
64
+ export declare function section(title: string): void;
65
+ export declare function listItem(text: string, indent?: number): void;
66
+ export declare function statusLine(label: string, value: string, good: boolean): void;
67
+ export declare function panel(title: string, lines: string[], width: number, borderColor?: string): string[];
68
+ export declare function sideBySide(left: string[], right: string[], gap?: number): string[];
69
+ export declare function welcomeScreen(config: {
70
+ version: string;
71
+ name?: string;
72
+ model?: string;
73
+ chain?: string;
74
+ wallets?: any;
75
+ apiOk?: boolean;
76
+ }): void;
77
+ export declare function statusBar(left: string, right: string): void;
package/dist/ui.js ADDED
@@ -0,0 +1,441 @@
1
+ /**
2
+ * Palmyr CLI UI — terminal rendering utilities
3
+ * Inspired by Claude Code's aesthetic
4
+ */
5
+ // ─── Agent mode ───
6
+ //
7
+ // When the CLI is being driven by an agent (stdout isn't a TTY, or the user
8
+ // passed --json), every decorative helper in this file becomes a no-op so the
9
+ // caller gets clean machine-parseable output instead of garbled spinner frames
10
+ // and ANSI escape sequences interleaved with JSON.
11
+ //
12
+ // `cli.ts:main()` calls `setAgentMode(true)` early when the conditions match;
13
+ // helpers and the Spinner self-check via `isAgentMode()` so we never write to
14
+ // stdout. Spinners can still be used freely in command code — they just become
15
+ // invisible in agent mode.
16
+ let agentMode = !process.stdout.isTTY;
17
+ export function setAgentMode(v) { agentMode = v; }
18
+ export function isAgentMode() { return agentMode; }
19
+ // ─── Theme ───
20
+ export const theme = {
21
+ // Brand
22
+ accent: '\x1b[38;5;208m', // orange
23
+ // Semantic
24
+ success: '\x1b[38;5;78m', // soft green
25
+ error: '\x1b[38;5;203m', // soft red
26
+ warn: '\x1b[38;5;220m', // yellow
27
+ info: '\x1b[38;5;111m', // soft blue
28
+ // Text
29
+ text: '\x1b[37m', // white
30
+ muted: '\x1b[38;5;243m', // gray
31
+ dim: '\x1b[38;5;238m', // darker gray
32
+ // Formatting
33
+ bold: '\x1b[1m',
34
+ reset: '\x1b[0m',
35
+ underline: '\x1b[4m',
36
+ };
37
+ // ─── Icons ───
38
+ export const icon = {
39
+ success: `${theme.success}✔${theme.reset}`,
40
+ error: `${theme.error}✘${theme.reset}`,
41
+ warn: `${theme.warn}⚠${theme.reset}`,
42
+ info: `${theme.info}●${theme.reset}`,
43
+ arrow: `${theme.muted}→${theme.reset}`,
44
+ dot: `${theme.dim}·${theme.reset}`,
45
+ bullet: `${theme.muted}▸${theme.reset}`,
46
+ };
47
+ // ─── Spinner ───
48
+ const SPINNER_FRAMES = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
49
+ // Hide / show the terminal cursor. The blinking cursor sitting at the end of
50
+ // the spinner line otherwise looks like flicker.
51
+ const HIDE_CURSOR = '\x1b[?25l';
52
+ const SHOW_CURSOR = '\x1b[?25h';
53
+ // One-time exit hook so a Ctrl+C / unexpected exit while a spinner is active
54
+ // doesn't leave the user's terminal with a hidden cursor.
55
+ let cursorRestoreInstalled = false;
56
+ function installCursorRestoreOnce() {
57
+ if (cursorRestoreInstalled)
58
+ return;
59
+ cursorRestoreInstalled = true;
60
+ const restore = () => process.stdout.write(SHOW_CURSOR);
61
+ process.on('exit', restore);
62
+ process.on('SIGINT', () => { restore(); process.exit(130); });
63
+ process.on('SIGTERM', () => { restore(); process.exit(143); });
64
+ }
65
+ export class Spinner {
66
+ // Module-level stack of currently-running spinners. When a new spinner
67
+ // starts, it pauses whatever was on top; when it stops/cancels, the parent
68
+ // resumes. Prevents two spinners from stomping on each other's stdout
69
+ // (the classic "outer + inner spinner flashing back and forth" bug).
70
+ static stack = [];
71
+ interval = null;
72
+ frame = 0;
73
+ label = '';
74
+ active = false;
75
+ stopped = false;
76
+ render() {
77
+ if (!this.active)
78
+ return;
79
+ const f = SPINNER_FRAMES[this.frame % SPINNER_FRAMES.length];
80
+ // \r returns to col 0; \x1b[2K erases the entire line so a shorter label
81
+ // doesn't leave the previous label's tail visible.
82
+ process.stdout.write(`\r\x1b[2K ${theme.info}${f}${theme.reset} ${theme.text}${this.label}${theme.reset}`);
83
+ }
84
+ terminateRender() {
85
+ if (this.interval)
86
+ clearInterval(this.interval);
87
+ this.interval = null;
88
+ this.active = false;
89
+ process.stdout.write(`\r\x1b[2K`);
90
+ }
91
+ pause() {
92
+ // Suspend animation but stay registered as the (paused) parent that will
93
+ // resume once the child stops. Don't show the cursor — the child is
94
+ // about to take over.
95
+ if (this.interval)
96
+ clearInterval(this.interval);
97
+ this.interval = null;
98
+ this.active = false;
99
+ process.stdout.write(`\r\x1b[2K`);
100
+ }
101
+ resume() {
102
+ if (this.stopped)
103
+ return;
104
+ this.active = true;
105
+ process.stdout.write(HIDE_CURSOR);
106
+ this.render();
107
+ this.interval = setInterval(() => {
108
+ this.frame++;
109
+ this.render();
110
+ }, 80);
111
+ }
112
+ popAndResume() {
113
+ const idx = Spinner.stack.indexOf(this);
114
+ if (idx >= 0)
115
+ Spinner.stack.splice(idx, 1);
116
+ const next = Spinner.stack[Spinner.stack.length - 1];
117
+ if (next) {
118
+ next.resume();
119
+ }
120
+ else {
121
+ // No parent to resume — really done; restore the cursor.
122
+ process.stdout.write(SHOW_CURSOR);
123
+ }
124
+ }
125
+ start(label) {
126
+ // Reuse path: already-running spinner just gets a new label.
127
+ if (this.active) {
128
+ this.update(label);
129
+ return;
130
+ }
131
+ if (agentMode) {
132
+ this.label = label;
133
+ this.stopped = false;
134
+ this.active = true;
135
+ return;
136
+ }
137
+ installCursorRestoreOnce();
138
+ this.label = label;
139
+ this.frame = 0;
140
+ this.active = true;
141
+ this.stopped = false;
142
+ const parent = Spinner.stack[Spinner.stack.length - 1];
143
+ if (parent)
144
+ parent.pause();
145
+ Spinner.stack.push(this);
146
+ // Only add a leading newline if we're the topmost spinner. Nested
147
+ // spinners render in place on the line the parent just cleared.
148
+ if (Spinner.stack.length === 1)
149
+ process.stdout.write('\n');
150
+ process.stdout.write(HIDE_CURSOR);
151
+ this.render();
152
+ this.interval = setInterval(() => {
153
+ this.frame++;
154
+ this.render();
155
+ }, 80);
156
+ }
157
+ update(label) {
158
+ this.label = label;
159
+ if (agentMode)
160
+ return;
161
+ // Repaint immediately so label changes don't feel laggy waiting for the
162
+ // next tick.
163
+ this.render();
164
+ }
165
+ stop(label, success = true) {
166
+ if (this.stopped)
167
+ return;
168
+ this.stopped = true;
169
+ if (agentMode) {
170
+ this.active = false;
171
+ return;
172
+ }
173
+ this.terminateRender();
174
+ if (success) {
175
+ console.log(` ${icon.success} ${label}`);
176
+ }
177
+ else {
178
+ console.log(` ${icon.error} ${label}`);
179
+ }
180
+ this.popAndResume();
181
+ }
182
+ // Stop the animation without printing anything. Use when the caller will
183
+ // surface the error via a different channel (e.g. throwing, so the wrapper
184
+ // can format the user-facing message itself).
185
+ cancel() {
186
+ if (this.stopped)
187
+ return;
188
+ this.stopped = true;
189
+ if (agentMode) {
190
+ this.active = false;
191
+ return;
192
+ }
193
+ this.terminateRender();
194
+ this.popAndResume();
195
+ }
196
+ }
197
+ // ─── Layout ───
198
+ //
199
+ // Every helper below is decorative: ANSI-colored boxes, dividers, status icons.
200
+ // In agent mode we no-op them so JSON output isn't poisoned with leading blank
201
+ // lines, dim-grey separators, or check-mark prefixes.
202
+ export function header(title) {
203
+ if (agentMode)
204
+ return;
205
+ console.log();
206
+ console.log(` ${theme.accent}${theme.bold}${title}${theme.reset}`);
207
+ console.log(` ${theme.dim}${'─'.repeat(Math.min(title.length + 4, 50))}${theme.reset}`);
208
+ console.log();
209
+ }
210
+ export function row(label, value, valueColor = theme.text) {
211
+ if (agentMode)
212
+ return;
213
+ const padded = label.padEnd(16);
214
+ console.log(` ${theme.muted}${padded}${theme.reset} ${valueColor}${value}${theme.reset}`);
215
+ }
216
+ export function ok(msg) {
217
+ if (agentMode)
218
+ return;
219
+ console.log(` ${icon.success} ${msg}`);
220
+ }
221
+ export function fail(msg) {
222
+ if (agentMode)
223
+ return;
224
+ console.log(` ${icon.error} ${msg}`);
225
+ }
226
+ export function warn(msg) {
227
+ if (agentMode)
228
+ return;
229
+ console.log(` ${icon.warn} ${theme.warn}${msg}${theme.reset}`);
230
+ }
231
+ export function info(msg) {
232
+ if (agentMode)
233
+ return;
234
+ console.log(` ${icon.info} ${msg}`);
235
+ }
236
+ export function subtle(msg) {
237
+ if (agentMode)
238
+ return;
239
+ console.log(` ${theme.muted}${msg}${theme.reset}`);
240
+ }
241
+ export function divider() {
242
+ if (agentMode)
243
+ return;
244
+ console.log(` ${theme.dim}${'─'.repeat(50)}${theme.reset}`);
245
+ }
246
+ export function blank() {
247
+ if (agentMode)
248
+ return;
249
+ console.log();
250
+ }
251
+ // ─── Table ───
252
+ export function table(headers, rows) {
253
+ if (agentMode)
254
+ return;
255
+ // Calculate column widths
256
+ const widths = headers.map((h, i) => Math.max(h.length, ...rows.map(r => (r[i] || '').length)));
257
+ // Header
258
+ const headerRow = headers.map((h, i) => h.padEnd(widths[i])).join(' ');
259
+ console.log(` ${theme.muted}${headerRow}${theme.reset}`);
260
+ console.log(` ${theme.dim}${widths.map(w => '─'.repeat(w)).join('──')}${theme.reset}`);
261
+ // Rows
262
+ for (const r of rows) {
263
+ const line = r.map((cell, i) => {
264
+ const padded = (cell || '').padEnd(widths[i]);
265
+ return i === 0 ? `${theme.text}${padded}${theme.reset}` : `${theme.muted}${padded}${theme.reset}`;
266
+ }).join(' ');
267
+ console.log(` ${line}`);
268
+ }
269
+ }
270
+ // ─── Box ───
271
+ export function box(title, content, color = theme.muted) {
272
+ if (agentMode)
273
+ return;
274
+ const lines = content.split('\n');
275
+ const maxLen = Math.max(title.length + 2, ...lines.map(l => l.length));
276
+ const width = Math.min(maxLen + 4, 60);
277
+ console.log(` ${color}╭${'─'.repeat(width)}╮${theme.reset}`);
278
+ console.log(` ${color}│${theme.reset} ${theme.bold}${title}${theme.reset}${' '.repeat(width - title.length - 1)}${color}│${theme.reset}`);
279
+ console.log(` ${color}├${'─'.repeat(width)}┤${theme.reset}`);
280
+ for (const line of lines) {
281
+ console.log(` ${color}│${theme.reset} ${line}${' '.repeat(Math.max(0, width - line.length - 1))}${color}│${theme.reset}`);
282
+ }
283
+ console.log(` ${color}╰${'─'.repeat(width)}╯${theme.reset}`);
284
+ }
285
+ // ─── Progress ───
286
+ export function progress(current, total, label) {
287
+ if (agentMode)
288
+ return;
289
+ const width = 30;
290
+ const filled = Math.round((current / total) * width);
291
+ const bar = '█'.repeat(filled) + '░'.repeat(width - filled);
292
+ const pct = Math.round((current / total) * 100);
293
+ // \x1b[2K clears the line so a shorter label doesn't leave the previous
294
+ // label's tail visible — same fix as the spinner redraw.
295
+ process.stdout.write(`\r\x1b[2K ${theme.info}${bar}${theme.reset} ${theme.muted}${pct}%${label ? ' ' + label : ''}${theme.reset}`);
296
+ if (current >= total)
297
+ console.log();
298
+ }
299
+ // ─── Init Report (Claude Code style) ───
300
+ export function initReport(title, items) {
301
+ if (agentMode)
302
+ return;
303
+ console.log();
304
+ console.log(` ${theme.accent}${theme.bold}${title}${theme.reset}`);
305
+ console.log();
306
+ for (const item of items) {
307
+ const statusColor = item.status === 'created' ? theme.success
308
+ : item.status === 'updated' ? theme.warn
309
+ : theme.muted;
310
+ const statusLabel = item.status === 'created' ? 'created'
311
+ : item.status === 'updated' ? 'updated'
312
+ : item.status === 'exists' ? 'already exists'
313
+ : 'skipped';
314
+ console.log(` ${statusColor}${item.status === 'created' ? '✔' : item.status === 'updated' ? '↻' : '·'}${theme.reset} ${theme.text}${item.name.padEnd(24)}${theme.reset} ${theme.muted}${statusLabel}${theme.reset}`);
315
+ }
316
+ console.log();
317
+ }
318
+ // ─── Greeting / Banner ───
319
+ export function banner() {
320
+ if (agentMode)
321
+ return;
322
+ console.log();
323
+ console.log(` ${theme.accent}${theme.bold}▲ Palmyr${theme.reset} ${theme.muted}v${process.env.PALMYR_VERSION || '0.5.0'}${theme.reset}`);
324
+ console.log(` ${theme.dim}Everything your AI agent needs${theme.reset}`);
325
+ console.log();
326
+ }
327
+ // ─── Key-Value Pair (compact) ───
328
+ export function kv(label, value) {
329
+ if (agentMode)
330
+ return;
331
+ console.log(` ${theme.muted}${label}${theme.reset} ${theme.text}${value}${theme.reset}`);
332
+ }
333
+ // ─── Section ───
334
+ export function section(title) {
335
+ if (agentMode)
336
+ return;
337
+ console.log();
338
+ console.log(` ${theme.bold}${title}${theme.reset}`);
339
+ }
340
+ // ─── List Item ───
341
+ export function listItem(text, indent = 0) {
342
+ if (agentMode)
343
+ return;
344
+ const pad = ' '.repeat(indent + 1);
345
+ console.log(`${pad}${icon.bullet} ${theme.muted}${text}${theme.reset}`);
346
+ }
347
+ // ─── Compact Status Line ───
348
+ export function statusLine(label, value, good) {
349
+ if (agentMode)
350
+ return;
351
+ const dot = good ? `${theme.success}●${theme.reset}` : `${theme.error}●${theme.reset}`;
352
+ console.log(` ${dot} ${theme.muted}${label.padEnd(16)}${theme.reset} ${theme.text}${value}${theme.reset}`);
353
+ }
354
+ // ─── TUI Panels ───
355
+ function pad(str, width) {
356
+ const stripped = str.replace(/\x1b\[[0-9;]*m/g, '');
357
+ const len = stripped.length;
358
+ return str + ' '.repeat(Math.max(0, width - len));
359
+ }
360
+ function visibleLength(str) {
361
+ return str.replace(/\x1b\[[0-9;]*m/g, '').length;
362
+ }
363
+ export function panel(title, lines, width, borderColor = theme.dim) {
364
+ const out = [];
365
+ const inner = width - 4;
366
+ const titleStr = title ? ` ${title} ` : '';
367
+ const topPad = width - 2 - visibleLength(titleStr);
368
+ out.push(`${borderColor}╭─${theme.muted}${titleStr}${borderColor}${'─'.repeat(Math.max(0, topPad))}╮${theme.reset}`);
369
+ for (const line of lines) {
370
+ out.push(`${borderColor}│${theme.reset} ${pad(line, inner)} ${borderColor}│${theme.reset}`);
371
+ }
372
+ out.push(`${borderColor}╰${'─'.repeat(width - 2)}╯${theme.reset}`);
373
+ return out;
374
+ }
375
+ export function sideBySide(left, right, gap = 1) {
376
+ const maxLen = Math.max(left.length, right.length);
377
+ const out = [];
378
+ // Find width of left panel
379
+ const leftWidth = Math.max(...left.map(l => visibleLength(l)));
380
+ for (let i = 0; i < maxLen; i++) {
381
+ const l = i < left.length ? left[i] : '';
382
+ const r = i < right.length ? right[i] : '';
383
+ out.push(pad(l, leftWidth) + ' '.repeat(gap) + r);
384
+ }
385
+ return out;
386
+ }
387
+ export function welcomeScreen(config) {
388
+ if (agentMode)
389
+ return;
390
+ const termWidth = process.stdout.columns || 100;
391
+ const leftWidth = Math.min(Math.floor(termWidth * 0.45), 48);
392
+ const rightWidth = Math.min(Math.floor(termWidth * 0.45), 48);
393
+ // ASCII art logo
394
+ const logo = [
395
+ `${theme.accent} ╔═══╗${theme.reset}`,
396
+ `${theme.accent} ║ ▲ ║${theme.reset}`,
397
+ `${theme.accent} ╚═══╝${theme.reset}`,
398
+ ];
399
+ // Left panel content
400
+ const leftLines = [
401
+ '',
402
+ `${theme.bold} Welcome${config.name ? ' back ' + config.name : ''}!${theme.reset}`,
403
+ '',
404
+ ...logo,
405
+ '',
406
+ `${theme.muted} ${config.chain || 'solana'} · ${config.apiOk ? `${theme.success}connected${theme.reset}` : `${theme.error}offline${theme.reset}`}${theme.reset}`,
407
+ `${theme.dim} ~/.palmyr/${theme.reset}`,
408
+ '',
409
+ ];
410
+ // Right panel content
411
+ const hasWallets = config.wallets && (config.wallets.solana || config.wallets.base);
412
+ const rightLines = [
413
+ `${theme.accent}Quick start${theme.reset}`,
414
+ `${theme.muted}palmyr phone search --country US${theme.reset}`,
415
+ `${theme.muted}palmyr compute plans${theme.reset}`,
416
+ `${theme.muted}palmyr domain check --name my.dev${theme.reset}`,
417
+ '',
418
+ `${theme.accent}Status${theme.reset}`,
419
+ `${hasWallets ? `${theme.success}●${theme.reset}` : `${theme.error}●${theme.reset}`} ${theme.muted}Wallets: ${hasWallets ? Object.keys(config.wallets).join(', ') : 'not configured'}${theme.reset}`,
420
+ `${config.apiOk ? `${theme.success}●${theme.reset}` : `${theme.error}●${theme.reset}`} ${theme.muted}API: ${config.apiOk ? 'connected' : 'unreachable'}${theme.reset}`,
421
+ '',
422
+ ];
423
+ const leftPanel = panel(`Palmyr v${config.version}`, leftLines, leftWidth, theme.dim);
424
+ const rightPanel = panel('', rightLines, rightWidth, theme.dim);
425
+ const combined = sideBySide(leftPanel, rightPanel, 1);
426
+ for (const line of combined) {
427
+ console.log(` ${line}`);
428
+ }
429
+ }
430
+ // ─── Status Bar ───
431
+ export function statusBar(left, right) {
432
+ if (agentMode)
433
+ return;
434
+ const termWidth = process.stdout.columns || 100;
435
+ const usable = termWidth - 4;
436
+ const leftLen = visibleLength(left);
437
+ const rightLen = visibleLength(right);
438
+ const gap = Math.max(1, usable - leftLen - rightLen);
439
+ console.log(` ${left}${' '.repeat(gap)}${right}`);
440
+ }
441
+ //# sourceMappingURL=ui.js.map
package/dist/ui.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../ui.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,qBAAqB;AACrB,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,+EAA+E;AAC/E,mDAAmD;AACnD,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,2BAA2B;AAC3B,IAAI,SAAS,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAA;AACrC,MAAM,UAAU,YAAY,CAAC,CAAU,IAAU,SAAS,GAAG,CAAC,CAAA,CAAC,CAAC;AAChE,MAAM,UAAU,WAAW,KAAc,OAAO,SAAS,CAAA,CAAC,CAAC;AAE3D,gBAAgB;AAChB,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,QAAQ;IACR,MAAM,EAAE,gBAAgB,EAAM,SAAS;IAEvC,WAAW;IACX,OAAO,EAAE,eAAe,EAAM,aAAa;IAC3C,KAAK,EAAE,gBAAgB,EAAO,WAAW;IACzC,IAAI,EAAE,gBAAgB,EAAQ,SAAS;IACvC,IAAI,EAAE,gBAAgB,EAAQ,YAAY;IAE1C,OAAO;IACP,IAAI,EAAE,UAAU,EAAc,QAAQ;IACtC,KAAK,EAAE,gBAAgB,EAAO,OAAO;IACrC,GAAG,EAAE,gBAAgB,EAAS,cAAc;IAE5C,aAAa;IACb,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,SAAS;CAC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IAAI,QAAQ,EAAE,CAAC;QAC5B,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IAC1B,CAAC;AACH,CAAC;AAED,qBAAqB;AACrB,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,IAAI,SAAS;QAAE,OAAM;IACrB,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,IAAI,GAAG,CAAA;IAC/C,MAAM,MAAM,GAAG,SAAS,GAAG,CAAC,CAAA;IAC5B,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAA;IACnC,MAAM,QAAQ,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;IACrC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAA;IACpD,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,EAAE,CAAC,CAAA;AACpD,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { Keypair } from '@solana/web3.js';
2
+ export interface VaultWalletSummary {
3
+ id: string;
4
+ name: string;
5
+ mode: string;
6
+ solanaAddress: string | null;
7
+ evmAddress: string | null;
8
+ createdAt: string;
9
+ }
10
+ /**
11
+ * List all wallets in the local vault.
12
+ * Corrupted files are skipped with a warning — one bad file never breaks the whole listing.
13
+ */
14
+ export declare function listVaultWallets(): VaultWalletSummary[];
15
+ /**
16
+ * Get a raw Solana Keypair for a vault wallet.
17
+ * Tries OS credential store first, falls back to passphrase.
18
+ */
19
+ export declare function getVaultSolanaKeypair(walletId: string, passphrase?: string): Keypair;
20
+ /**
21
+ * Get an ethers Wallet (secp256k1) for a vault wallet.
22
+ * Used for signing EIP-3009 and EVM transactions.
23
+ */
24
+ export declare function getVaultEvmWallet(walletId: string, passphrase?: string): any;
25
+ /**
26
+ * Sign a message locally — no server needed.
27
+ * Decrypts via session secret from OS credential store, signs with the chain's keypair.
28
+ */
29
+ export declare function signMessageLocal(walletId: string, chain: string, message: string): {
30
+ signature: string;
31
+ recoveryId?: number;
32
+ };
33
+ /** Check if any vault wallets exist locally. */
34
+ export declare function hasVaultWallets(): boolean;
35
+ interface AccountInfo {
36
+ chainId: string;
37
+ address: string;
38
+ derivationPath: string;
39
+ }
40
+ export interface LocalWalletResult {
41
+ id: string;
42
+ name: string;
43
+ mode: 'unmanaged' | 'managed';
44
+ sessionSecret: string;
45
+ solanaAddress: string | null;
46
+ evmAddress: string | null;
47
+ accounts: AccountInfo[];
48
+ createdAt: string;
49
+ }
50
+ /**
51
+ * Create a wallet locally — no server needed.
52
+ * The session secret must be stored in the OS credential store by the caller.
53
+ */
54
+ export declare function createLocalWallet(name: string, mode?: 'unmanaged' | 'managed'): LocalWalletResult;
55
+ /**
56
+ * Import a wallet from mnemonic locally — no server needed.
57
+ */
58
+ export declare function importLocalWallet(name: string, mnemonic: string, mode?: 'unmanaged' | 'managed'): LocalWalletResult;
59
+ /**
60
+ * Export the mnemonic for a wallet. Requires the session secret
61
+ * (from OS credential store). This is the single decryption path —
62
+ * never reimplement decryption elsewhere.
63
+ */
64
+ export declare function exportMnemonic(walletId: string): string;
65
+ export {};