@ebowwa/crm 0.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/README.md +174 -0
- package/dist/cli/commands/activities.d.ts +11 -0
- package/dist/cli/commands/activities.d.ts.map +1 -0
- package/dist/cli/commands/activities.js +427 -0
- package/dist/cli/commands/activities.js.map +1 -0
- package/dist/cli/commands/contacts.d.ts +11 -0
- package/dist/cli/commands/contacts.d.ts.map +1 -0
- package/dist/cli/commands/contacts.js +458 -0
- package/dist/cli/commands/contacts.js.map +1 -0
- package/dist/cli/commands/deals.d.ts +11 -0
- package/dist/cli/commands/deals.d.ts.map +1 -0
- package/dist/cli/commands/deals.js +498 -0
- package/dist/cli/commands/deals.js.map +1 -0
- package/dist/cli/commands/media.d.ts +11 -0
- package/dist/cli/commands/media.d.ts.map +1 -0
- package/dist/cli/commands/media.js +417 -0
- package/dist/cli/commands/media.js.map +1 -0
- package/dist/cli/commands/search.d.ts +11 -0
- package/dist/cli/commands/search.d.ts.map +1 -0
- package/dist/cli/commands/search.js +346 -0
- package/dist/cli/commands/search.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +173 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/repl.d.ts +15 -0
- package/dist/cli/repl.d.ts.map +1 -0
- package/dist/cli/repl.js +318 -0
- package/dist/cli/repl.js.map +1 -0
- package/dist/cli/utils/config.d.ts +91 -0
- package/dist/cli/utils/config.d.ts.map +1 -0
- package/dist/cli/utils/config.js +212 -0
- package/dist/cli/utils/config.js.map +1 -0
- package/dist/cli/utils/output.d.ts +136 -0
- package/dist/cli/utils/output.d.ts.map +1 -0
- package/dist/cli/utils/output.js +323 -0
- package/dist/cli/utils/output.js.map +1 -0
- package/dist/cli/utils/prompt.d.ts +81 -0
- package/dist/cli/utils/prompt.d.ts.map +1 -0
- package/dist/cli/utils/prompt.js +341 -0
- package/dist/cli/utils/prompt.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +8 -0
- package/dist/cli.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +32 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/schemas.d.ts +3050 -0
- package/dist/core/schemas.d.ts.map +1 -0
- package/dist/core/schemas.js +667 -0
- package/dist/core/schemas.js.map +1 -0
- package/dist/core/types.d.ts +597 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +14 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +11 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/server.d.ts +13 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +18 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/storage/client.d.ts +109 -0
- package/dist/mcp/storage/client.d.ts.map +1 -0
- package/dist/mcp/storage/client.js +355 -0
- package/dist/mcp/storage/client.js.map +1 -0
- package/dist/mcp/storage/index.d.ts +7 -0
- package/dist/mcp/storage/index.d.ts.map +1 -0
- package/dist/mcp/storage/index.js +6 -0
- package/dist/mcp/storage/index.js.map +1 -0
- package/dist/mcp/storage/types.d.ts +44 -0
- package/dist/mcp/storage/types.d.ts.map +1 -0
- package/dist/mcp/storage/types.js +35 -0
- package/dist/mcp/storage/types.js.map +1 -0
- package/dist/mcp/tools/definitions.d.ts +16 -0
- package/dist/mcp/tools/definitions.d.ts.map +1 -0
- package/dist/mcp/tools/definitions.js +914 -0
- package/dist/mcp/tools/definitions.js.map +1 -0
- package/dist/mcp/tools/handlers.d.ts +50 -0
- package/dist/mcp/tools/handlers.d.ts.map +1 -0
- package/dist/mcp/tools/handlers.js +760 -0
- package/dist/mcp/tools/handlers.js.map +1 -0
- package/dist/mcp/tools/index.d.ts +7 -0
- package/dist/mcp/tools/index.d.ts.map +1 -0
- package/dist/mcp/tools/index.js +6 -0
- package/dist/mcp/tools/index.js.map +1 -0
- package/dist/mcp/tools/types.d.ts +314 -0
- package/dist/mcp/tools/types.d.ts.map +1 -0
- package/dist/mcp/tools/types.js +5 -0
- package/dist/mcp/tools/types.js.map +1 -0
- package/dist/mcp/transports/stdio.d.ts +27 -0
- package/dist/mcp/transports/stdio.d.ts.map +1 -0
- package/dist/mcp/transports/stdio.js +237 -0
- package/dist/mcp/transports/stdio.js.map +1 -0
- package/dist/telemetry/index.d.ts +58 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +109 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/logger.d.ts +116 -0
- package/dist/telemetry/logger.d.ts.map +1 -0
- package/dist/telemetry/logger.js +256 -0
- package/dist/telemetry/logger.js.map +1 -0
- package/dist/telemetry/metrics.d.ts +115 -0
- package/dist/telemetry/metrics.d.ts.map +1 -0
- package/dist/telemetry/metrics.js +292 -0
- package/dist/telemetry/metrics.js.map +1 -0
- package/dist/telemetry/tracer.d.ts +227 -0
- package/dist/telemetry/tracer.d.ts.map +1 -0
- package/dist/telemetry/tracer.js +355 -0
- package/dist/telemetry/tracer.js.map +1 -0
- package/dist/web/app.d.ts +2 -0
- package/dist/web/app.d.ts.map +1 -0
- package/dist/web/app.js +115 -0
- package/dist/web/app.js.map +1 -0
- package/dist/web/components/ContactList.d.ts +3 -0
- package/dist/web/components/ContactList.d.ts.map +1 -0
- package/dist/web/components/ContactList.js +262 -0
- package/dist/web/components/ContactList.js.map +1 -0
- package/dist/web/components/Dashboard.d.ts +3 -0
- package/dist/web/components/Dashboard.d.ts.map +1 -0
- package/dist/web/components/Dashboard.js +158 -0
- package/dist/web/components/Dashboard.js.map +1 -0
- package/dist/web/components/DealPipeline.d.ts +3 -0
- package/dist/web/components/DealPipeline.d.ts.map +1 -0
- package/dist/web/components/DealPipeline.js +306 -0
- package/dist/web/components/DealPipeline.js.map +1 -0
- package/dist/web/index.d.ts +2 -0
- package/dist/web/index.d.ts.map +1 -0
- package/dist/web/index.js +269 -0
- package/dist/web/index.js.map +1 -0
- package/dist/web/types.d.ts +75 -0
- package/dist/web/types.d.ts.map +1 -0
- package/dist/web/types.js +3 -0
- package/dist/web/types.js.map +1 -0
- package/native/index.d.ts +571 -0
- package/native/index.js +687 -0
- package/package.json +105 -0
- package/src/cli/commands/activities.ts +543 -0
- package/src/cli/commands/contacts.ts +563 -0
- package/src/cli/commands/deals.ts +637 -0
- package/src/cli/commands/media.ts +521 -0
- package/src/cli/commands/search.ts +426 -0
- package/src/cli/index.ts +203 -0
- package/src/cli/repl.ts +379 -0
- package/src/cli/utils/config.ts +299 -0
- package/src/cli/utils/output.ts +386 -0
- package/src/cli/utils/prompt.ts +444 -0
- package/src/cli.ts +11 -0
- package/src/core/index.ts +184 -0
- package/src/core/schemas.ts +770 -0
- package/src/core/types.ts +969 -0
- package/src/index.ts +8 -0
- package/src/mcp/index.ts +17 -0
- package/src/mcp/server.ts +26 -0
- package/src/mcp/storage/client.ts +408 -0
- package/src/mcp/storage/index.ts +7 -0
- package/src/mcp/storage/types.ts +72 -0
- package/src/mcp/tools/definitions.ts +961 -0
- package/src/mcp/tools/handlers.ts +805 -0
- package/src/mcp/tools/index.ts +7 -0
- package/src/mcp/tools/types.ts +390 -0
- package/src/mcp/transports/stdio.ts +225 -0
- package/src/telemetry/index.ts +131 -0
- package/src/telemetry/logger.ts +318 -0
- package/src/telemetry/metrics.ts +393 -0
- package/src/telemetry/tracer.ts +487 -0
- package/src/web/api/activities.ts +41 -0
- package/src/web/api/contacts.ts +114 -0
- package/src/web/api/deals.ts +108 -0
- package/src/web/api/media.ts +98 -0
- package/src/web/app.tsx +143 -0
- package/src/web/components/ActivityFeed.tsx +195 -0
- package/src/web/components/ContactList.tsx +340 -0
- package/src/web/components/Dashboard.tsx +214 -0
- package/src/web/components/DealPipeline.tsx +405 -0
- package/src/web/components/MediaGallery.tsx +334 -0
- package/src/web/index.html +14 -0
- package/src/web/index.ts +326 -0
- package/src/web/styles/main.css +180 -0
- package/src/web/types.ts +311 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Output Formatting Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides colorized output, table formatting, and display helpers.
|
|
5
|
+
*/
|
|
6
|
+
declare const colors: {
|
|
7
|
+
readonly reset: "\u001B[0m";
|
|
8
|
+
readonly bold: "\u001B[1m";
|
|
9
|
+
readonly dim: "\u001B[2m";
|
|
10
|
+
readonly italic: "\u001B[3m";
|
|
11
|
+
readonly underline: "\u001B[4m";
|
|
12
|
+
readonly black: "\u001B[30m";
|
|
13
|
+
readonly red: "\u001B[31m";
|
|
14
|
+
readonly green: "\u001B[32m";
|
|
15
|
+
readonly yellow: "\u001B[33m";
|
|
16
|
+
readonly blue: "\u001B[34m";
|
|
17
|
+
readonly magenta: "\u001B[35m";
|
|
18
|
+
readonly cyan: "\u001B[36m";
|
|
19
|
+
readonly white: "\u001B[37m";
|
|
20
|
+
readonly bgBlack: "\u001B[40m";
|
|
21
|
+
readonly bgRed: "\u001B[41m";
|
|
22
|
+
readonly bgGreen: "\u001B[42m";
|
|
23
|
+
readonly bgYellow: "\u001B[43m";
|
|
24
|
+
readonly bgBlue: "\u001B[44m";
|
|
25
|
+
readonly bgMagenta: "\u001B[45m";
|
|
26
|
+
readonly bgCyan: "\u001B[46m";
|
|
27
|
+
readonly bgWhite: "\u001B[47m";
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Colorize text with ANSI codes
|
|
31
|
+
*/
|
|
32
|
+
export declare function colorize(text: string, color: keyof typeof colors): string;
|
|
33
|
+
/**
|
|
34
|
+
* Semantic color helpers
|
|
35
|
+
*/
|
|
36
|
+
export declare const output: {
|
|
37
|
+
success: (text: string) => string;
|
|
38
|
+
error: (text: string) => string;
|
|
39
|
+
warning: (text: string) => string;
|
|
40
|
+
info: (text: string) => string;
|
|
41
|
+
dim: (text: string) => string;
|
|
42
|
+
bold: (text: string) => string;
|
|
43
|
+
underline: (text: string) => string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Print a success message with checkmark
|
|
47
|
+
*/
|
|
48
|
+
export declare function printSuccess(message: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Print an error message with X
|
|
51
|
+
*/
|
|
52
|
+
export declare function printError(message: string): void;
|
|
53
|
+
/**
|
|
54
|
+
* Print a warning message with triangle
|
|
55
|
+
*/
|
|
56
|
+
export declare function printWarning(message: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Print an info message with bullet
|
|
59
|
+
*/
|
|
60
|
+
export declare function printInfo(message: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Print a header with styling
|
|
63
|
+
*/
|
|
64
|
+
export declare function printHeader(title: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* Print a section header
|
|
67
|
+
*/
|
|
68
|
+
export declare function printSection(title: string): void;
|
|
69
|
+
/**
|
|
70
|
+
* Format a key-value pair for display
|
|
71
|
+
*/
|
|
72
|
+
export declare function formatKeyValue(key: string, value: unknown): string;
|
|
73
|
+
/**
|
|
74
|
+
* Print key-value pairs
|
|
75
|
+
*/
|
|
76
|
+
export declare function printKeyValue(pairs: Record<string, unknown>, indent?: number): void;
|
|
77
|
+
/**
|
|
78
|
+
* Format currency value
|
|
79
|
+
*/
|
|
80
|
+
export declare function formatCurrency(value: number, currency?: string): string;
|
|
81
|
+
/**
|
|
82
|
+
* Format date for display
|
|
83
|
+
*/
|
|
84
|
+
export declare function formatDate(date: string | Date): string;
|
|
85
|
+
/**
|
|
86
|
+
* Format datetime for display
|
|
87
|
+
*/
|
|
88
|
+
export declare function formatDateTime(date: string | Date): string;
|
|
89
|
+
/**
|
|
90
|
+
* Format relative time (e.g., "2 hours ago")
|
|
91
|
+
*/
|
|
92
|
+
export declare function formatRelativeTime(date: string | Date): string;
|
|
93
|
+
/**
|
|
94
|
+
* Format file size
|
|
95
|
+
*/
|
|
96
|
+
export declare function formatFileSize(bytes: number): string;
|
|
97
|
+
/**
|
|
98
|
+
* Truncate string with ellipsis
|
|
99
|
+
*/
|
|
100
|
+
export declare function truncate(str: string, maxLength: number): string;
|
|
101
|
+
/**
|
|
102
|
+
* Pad string to fixed width
|
|
103
|
+
*/
|
|
104
|
+
export declare function padRight(str: string, width: number): string;
|
|
105
|
+
/**
|
|
106
|
+
* Create a simple table
|
|
107
|
+
*/
|
|
108
|
+
export interface TableColumn<T> {
|
|
109
|
+
key: keyof T | string;
|
|
110
|
+
header: string;
|
|
111
|
+
width?: number;
|
|
112
|
+
format?: (value: unknown, row: T) => string;
|
|
113
|
+
}
|
|
114
|
+
export declare function formatTable<T>(data: T[], columns: TableColumn<T>[]): string;
|
|
115
|
+
/**
|
|
116
|
+
* Print a table to console
|
|
117
|
+
*/
|
|
118
|
+
export declare function printTable<T>(data: T[], columns: TableColumn<T>[]): void;
|
|
119
|
+
/**
|
|
120
|
+
* Print JSON with syntax highlighting
|
|
121
|
+
*/
|
|
122
|
+
export declare function printJSON(data: unknown): void;
|
|
123
|
+
/**
|
|
124
|
+
* Print a divider line
|
|
125
|
+
*/
|
|
126
|
+
export declare function printDivider(char?: string, length?: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Print a box with content
|
|
129
|
+
*/
|
|
130
|
+
export declare function printBox(content: string, title?: string): void;
|
|
131
|
+
/**
|
|
132
|
+
* Status badge formatter
|
|
133
|
+
*/
|
|
134
|
+
export declare function formatStatus(status: string): string;
|
|
135
|
+
export {};
|
|
136
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;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,CA0CnD"}
|
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Output Formatting Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides colorized output, table formatting, and display helpers.
|
|
5
|
+
*/
|
|
6
|
+
// ANSI color codes
|
|
7
|
+
const colors = {
|
|
8
|
+
reset: '\x1b[0m',
|
|
9
|
+
bold: '\x1b[1m',
|
|
10
|
+
dim: '\x1b[2m',
|
|
11
|
+
italic: '\x1b[3m',
|
|
12
|
+
underline: '\x1b[4m',
|
|
13
|
+
// Foreground colors
|
|
14
|
+
black: '\x1b[30m',
|
|
15
|
+
red: '\x1b[31m',
|
|
16
|
+
green: '\x1b[32m',
|
|
17
|
+
yellow: '\x1b[33m',
|
|
18
|
+
blue: '\x1b[34m',
|
|
19
|
+
magenta: '\x1b[35m',
|
|
20
|
+
cyan: '\x1b[36m',
|
|
21
|
+
white: '\x1b[37m',
|
|
22
|
+
// Background colors
|
|
23
|
+
bgBlack: '\x1b[40m',
|
|
24
|
+
bgRed: '\x1b[41m',
|
|
25
|
+
bgGreen: '\x1b[42m',
|
|
26
|
+
bgYellow: '\x1b[43m',
|
|
27
|
+
bgBlue: '\x1b[44m',
|
|
28
|
+
bgMagenta: '\x1b[45m',
|
|
29
|
+
bgCyan: '\x1b[46m',
|
|
30
|
+
bgWhite: '\x1b[47m',
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Colorize text with ANSI codes
|
|
34
|
+
*/
|
|
35
|
+
export function colorize(text, color) {
|
|
36
|
+
return `${colors[color]}${text}${colors.reset}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Semantic color helpers
|
|
40
|
+
*/
|
|
41
|
+
export const output = {
|
|
42
|
+
success: (text) => colorize(text, 'green'),
|
|
43
|
+
error: (text) => colorize(text, 'red'),
|
|
44
|
+
warning: (text) => colorize(text, 'yellow'),
|
|
45
|
+
info: (text) => colorize(text, 'cyan'),
|
|
46
|
+
dim: (text) => colorize(text, 'dim'),
|
|
47
|
+
bold: (text) => colorize(text, 'bold'),
|
|
48
|
+
underline: (text) => colorize(text, 'underline'),
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Print a success message with checkmark
|
|
52
|
+
*/
|
|
53
|
+
export function printSuccess(message) {
|
|
54
|
+
console.log(`${output.success('\u2713')} ${message}`);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Print an error message with X
|
|
58
|
+
*/
|
|
59
|
+
export function printError(message) {
|
|
60
|
+
console.error(`${output.error('\u2717')} ${message}`);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Print a warning message with triangle
|
|
64
|
+
*/
|
|
65
|
+
export function printWarning(message) {
|
|
66
|
+
console.log(`${output.warning('\u26a0')} ${message}`);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Print an info message with bullet
|
|
70
|
+
*/
|
|
71
|
+
export function printInfo(message) {
|
|
72
|
+
console.log(`${output.info('\u2022')} ${message}`);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Print a header with styling
|
|
76
|
+
*/
|
|
77
|
+
export function printHeader(title) {
|
|
78
|
+
const line = '\u2500'.repeat(title.length + 4);
|
|
79
|
+
console.log();
|
|
80
|
+
console.log(output.bold(`\u250c${line}\u2510`));
|
|
81
|
+
console.log(output.bold(`\u2502 ${title} \u2502`));
|
|
82
|
+
console.log(output.bold(`\u2514${line}\u2518`));
|
|
83
|
+
console.log();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Print a section header
|
|
87
|
+
*/
|
|
88
|
+
export function printSection(title) {
|
|
89
|
+
console.log();
|
|
90
|
+
console.log(output.bold(output.underline(title)));
|
|
91
|
+
console.log();
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Format a key-value pair for display
|
|
95
|
+
*/
|
|
96
|
+
export function formatKeyValue(key, value) {
|
|
97
|
+
const formattedValue = value === null || value === undefined
|
|
98
|
+
? output.dim('(none)')
|
|
99
|
+
: String(value);
|
|
100
|
+
return `${output.dim(key)}: ${formattedValue}`;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Print key-value pairs
|
|
104
|
+
*/
|
|
105
|
+
export function printKeyValue(pairs, indent = 0) {
|
|
106
|
+
const prefix = ' '.repeat(indent);
|
|
107
|
+
for (const [key, value] of Object.entries(pairs)) {
|
|
108
|
+
if (value !== undefined) {
|
|
109
|
+
console.log(`${prefix}${formatKeyValue(key, value)}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Format currency value
|
|
115
|
+
*/
|
|
116
|
+
export function formatCurrency(value, currency = 'USD') {
|
|
117
|
+
return new Intl.NumberFormat('en-US', {
|
|
118
|
+
style: 'currency',
|
|
119
|
+
currency,
|
|
120
|
+
}).format(value);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Format date for display
|
|
124
|
+
*/
|
|
125
|
+
export function formatDate(date) {
|
|
126
|
+
const d = typeof date === 'string' ? new Date(date) : date;
|
|
127
|
+
return d.toLocaleDateString('en-US', {
|
|
128
|
+
year: 'numeric',
|
|
129
|
+
month: 'short',
|
|
130
|
+
day: 'numeric',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Format datetime for display
|
|
135
|
+
*/
|
|
136
|
+
export function formatDateTime(date) {
|
|
137
|
+
const d = typeof date === 'string' ? new Date(date) : date;
|
|
138
|
+
return d.toLocaleString('en-US', {
|
|
139
|
+
year: 'numeric',
|
|
140
|
+
month: 'short',
|
|
141
|
+
day: 'numeric',
|
|
142
|
+
hour: '2-digit',
|
|
143
|
+
minute: '2-digit',
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Format relative time (e.g., "2 hours ago")
|
|
148
|
+
*/
|
|
149
|
+
export function formatRelativeTime(date) {
|
|
150
|
+
const d = typeof date === 'string' ? new Date(date) : date;
|
|
151
|
+
const now = new Date();
|
|
152
|
+
const diffMs = now.getTime() - d.getTime();
|
|
153
|
+
const diffSecs = Math.floor(diffMs / 1000);
|
|
154
|
+
const diffMins = Math.floor(diffSecs / 60);
|
|
155
|
+
const diffHours = Math.floor(diffMins / 60);
|
|
156
|
+
const diffDays = Math.floor(diffHours / 24);
|
|
157
|
+
if (diffSecs < 60)
|
|
158
|
+
return 'just now';
|
|
159
|
+
if (diffMins < 60)
|
|
160
|
+
return `${diffMins}m ago`;
|
|
161
|
+
if (diffHours < 24)
|
|
162
|
+
return `${diffHours}h ago`;
|
|
163
|
+
if (diffDays < 7)
|
|
164
|
+
return `${diffDays}d ago`;
|
|
165
|
+
return formatDate(d);
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Format file size
|
|
169
|
+
*/
|
|
170
|
+
export function formatFileSize(bytes) {
|
|
171
|
+
const units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
|
172
|
+
let size = bytes;
|
|
173
|
+
let unitIndex = 0;
|
|
174
|
+
while (size >= 1024 && unitIndex < units.length - 1) {
|
|
175
|
+
size /= 1024;
|
|
176
|
+
unitIndex++;
|
|
177
|
+
}
|
|
178
|
+
return `${size.toFixed(unitIndex === 0 ? 0 : 1)} ${units[unitIndex]}`;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Truncate string with ellipsis
|
|
182
|
+
*/
|
|
183
|
+
export function truncate(str, maxLength) {
|
|
184
|
+
if (str.length <= maxLength)
|
|
185
|
+
return str;
|
|
186
|
+
return str.slice(0, maxLength - 1) + '\u2026';
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Pad string to fixed width
|
|
190
|
+
*/
|
|
191
|
+
export function padRight(str, width) {
|
|
192
|
+
return str.padEnd(width, ' ');
|
|
193
|
+
}
|
|
194
|
+
export function formatTable(data, columns) {
|
|
195
|
+
if (data.length === 0) {
|
|
196
|
+
return output.dim('No results');
|
|
197
|
+
}
|
|
198
|
+
// Calculate column widths
|
|
199
|
+
const widths = columns.map((col) => {
|
|
200
|
+
const headerWidth = col.header.length;
|
|
201
|
+
const keyStr = String(col.key);
|
|
202
|
+
const dataWidth = Math.max(...data.map((row) => {
|
|
203
|
+
const value = keyStr.includes('.')
|
|
204
|
+
? getNestedValue(row, keyStr)
|
|
205
|
+
: row[keyStr];
|
|
206
|
+
const formatted = col.format ? col.format(value, row) : String(value ?? '');
|
|
207
|
+
return formatted.length;
|
|
208
|
+
}));
|
|
209
|
+
return Math.max(headerWidth, col.width ?? dataWidth);
|
|
210
|
+
});
|
|
211
|
+
// Build header
|
|
212
|
+
const headerRow = columns
|
|
213
|
+
.map((col, i) => output.bold(padRight(col.header, widths[i] ?? 10)))
|
|
214
|
+
.join(' ');
|
|
215
|
+
// Build separator
|
|
216
|
+
const separator = widths.map((w) => '\u2500'.repeat(w ?? 10)).join(' ');
|
|
217
|
+
// Build data rows
|
|
218
|
+
const dataRows = data.map((row) => columns
|
|
219
|
+
.map((col, i) => {
|
|
220
|
+
const keyStr = String(col.key);
|
|
221
|
+
const value = keyStr.includes('.')
|
|
222
|
+
? getNestedValue(row, keyStr)
|
|
223
|
+
: row[keyStr];
|
|
224
|
+
const formatted = col.format ? col.format(value, row) : String(value ?? '');
|
|
225
|
+
return padRight(formatted, widths[i] ?? 10);
|
|
226
|
+
})
|
|
227
|
+
.join(' '));
|
|
228
|
+
return [headerRow, separator, ...dataRows].join('\n');
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Print a table to console
|
|
232
|
+
*/
|
|
233
|
+
export function printTable(data, columns) {
|
|
234
|
+
console.log(formatTable(data, columns));
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Get nested value from object using dot notation
|
|
238
|
+
*/
|
|
239
|
+
function getNestedValue(obj, path) {
|
|
240
|
+
return path.split('.').reduce((acc, part) => {
|
|
241
|
+
if (acc && typeof acc === 'object') {
|
|
242
|
+
return acc[part];
|
|
243
|
+
}
|
|
244
|
+
return undefined;
|
|
245
|
+
}, obj);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Print JSON with syntax highlighting
|
|
249
|
+
*/
|
|
250
|
+
export function printJSON(data) {
|
|
251
|
+
const json = JSON.stringify(data, null, 2);
|
|
252
|
+
// Simple syntax highlighting
|
|
253
|
+
const highlighted = json
|
|
254
|
+
.replace(/"([^"]+)":/g, output.dim('"$1":'))
|
|
255
|
+
.replace(/: "([^"]+)"/g, `: ${output.success('"$1"')}`)
|
|
256
|
+
.replace(/: (\d+)/g, `: ${output.info('$1')}`)
|
|
257
|
+
.replace(/: (true|false)/g, `: ${output.warning('$1')}`)
|
|
258
|
+
.replace(/: (null)/g, `: ${output.dim('$1')}`);
|
|
259
|
+
console.log(highlighted);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Print a divider line
|
|
263
|
+
*/
|
|
264
|
+
export function printDivider(char = '\u2500', length = 60) {
|
|
265
|
+
console.log(output.dim(char.repeat(length)));
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Print a box with content
|
|
269
|
+
*/
|
|
270
|
+
export function printBox(content, title) {
|
|
271
|
+
const lines = content.split('\n');
|
|
272
|
+
const maxWidth = Math.max(...lines.map((l) => l.length), title?.length ?? 0);
|
|
273
|
+
const top = title
|
|
274
|
+
? `\u250c\u2500 ${output.bold(title)} ${'\u2500'.repeat(maxWidth - title.length - 1)}\u2510`
|
|
275
|
+
: `\u250c${'\u2500'.repeat(maxWidth + 2)}\u2510`;
|
|
276
|
+
console.log(top);
|
|
277
|
+
for (const line of lines) {
|
|
278
|
+
console.log(`\u2502 ${padRight(line, maxWidth)} \u2502`);
|
|
279
|
+
}
|
|
280
|
+
console.log(`\u2514${'\u2500'.repeat(maxWidth + 2)}\u2518`);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Status badge formatter
|
|
284
|
+
*/
|
|
285
|
+
export function formatStatus(status) {
|
|
286
|
+
const statusColors = {
|
|
287
|
+
// Contact status
|
|
288
|
+
lead: 'cyan',
|
|
289
|
+
prospect: 'blue',
|
|
290
|
+
qualified: 'yellow',
|
|
291
|
+
customer: 'green',
|
|
292
|
+
churned: 'red',
|
|
293
|
+
archived: 'dim',
|
|
294
|
+
// Deal stages
|
|
295
|
+
prospecting: 'cyan',
|
|
296
|
+
qualification: 'blue',
|
|
297
|
+
needs_analysis: 'yellow',
|
|
298
|
+
proposal: 'magenta',
|
|
299
|
+
negotiation: 'yellow',
|
|
300
|
+
closed_won: 'green',
|
|
301
|
+
closed_lost: 'red',
|
|
302
|
+
// Activity types
|
|
303
|
+
call: 'cyan',
|
|
304
|
+
email: 'blue',
|
|
305
|
+
meeting: 'magenta',
|
|
306
|
+
task: 'yellow',
|
|
307
|
+
note: 'dim',
|
|
308
|
+
// Priority
|
|
309
|
+
low: 'dim',
|
|
310
|
+
medium: 'yellow',
|
|
311
|
+
high: 'red',
|
|
312
|
+
urgent: 'bgRed',
|
|
313
|
+
// General
|
|
314
|
+
active: 'green',
|
|
315
|
+
inactive: 'dim',
|
|
316
|
+
pending: 'yellow',
|
|
317
|
+
completed: 'green',
|
|
318
|
+
cancelled: 'red',
|
|
319
|
+
};
|
|
320
|
+
const color = statusColors[status.toLowerCase()] || 'white';
|
|
321
|
+
return colorize(`[${status.toUpperCase()}]`, color);
|
|
322
|
+
}
|
|
323
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../../src/cli/utils/output.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mBAAmB;AACnB,MAAM,MAAM,GAAG;IACb,KAAK,EAAE,SAAS;IAChB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,SAAS;IAEpB,oBAAoB;IACpB,KAAK,EAAE,UAAU;IACjB,GAAG,EAAE,UAAU;IACf,KAAK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AAM;QACb,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,KAAK;QAEX,WAAW;QACX,GAAG,EAAE,KAAK;QACV,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,KAAK;QACX,MAAM,EAAE,OAAO;QAEf,UAAU;QACV,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,OAAO;QAClB,SAAS,EAAE,KAAK;KACjB,CAAC;IAEF,MAAM,KAAK,GAAG,YAAY,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,IAAI,OAAO,CAAC;IAC5D,OAAO,QAAQ,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AACtD,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive Prompt Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides user-friendly prompts for CLI interactions.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Prompt for text input
|
|
8
|
+
*/
|
|
9
|
+
export declare function prompt(message: string, defaultValue?: string): Promise<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Prompt for required text input (keeps asking until provided)
|
|
12
|
+
*/
|
|
13
|
+
export declare function promptRequired(message: string, validate?: (value: string) => boolean | string): Promise<string>;
|
|
14
|
+
/**
|
|
15
|
+
* Prompt for email input with validation
|
|
16
|
+
*/
|
|
17
|
+
export declare function promptEmail(message?: string): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Prompt for phone input
|
|
20
|
+
*/
|
|
21
|
+
export declare function promptPhone(message?: string): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Prompt for number input
|
|
24
|
+
*/
|
|
25
|
+
export declare function promptNumber(message: string, defaultValue?: number, min?: number, max?: number): Promise<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Prompt for integer input
|
|
28
|
+
*/
|
|
29
|
+
export declare function promptInt(message: string, defaultValue?: number, min?: number, max?: number): Promise<number>;
|
|
30
|
+
/**
|
|
31
|
+
* Prompt for yes/no confirmation
|
|
32
|
+
*/
|
|
33
|
+
export declare function confirm(message: string, defaultValue?: boolean): Promise<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Prompt to select from a list of options
|
|
36
|
+
*/
|
|
37
|
+
export declare function select<T extends string>(message: string, options: T[], defaultValue?: T): Promise<T>;
|
|
38
|
+
/**
|
|
39
|
+
* Prompt to select multiple options from a list
|
|
40
|
+
*/
|
|
41
|
+
export declare function multiSelect<T extends string>(message: string, options: T[], defaultValues?: T[]): Promise<T[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Prompt for tags (comma-separated)
|
|
44
|
+
*/
|
|
45
|
+
export declare function promptTags(message?: string): Promise<string[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Prompt for multiline text
|
|
48
|
+
*/
|
|
49
|
+
export declare function promptMultiline(message: string, defaultValue?: string): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Prompt with auto-complete suggestions
|
|
52
|
+
*/
|
|
53
|
+
export declare function promptWithSuggestions(message: string, suggestions: string[], defaultValue?: string): Promise<string>;
|
|
54
|
+
/**
|
|
55
|
+
* Display a preview and ask for confirmation
|
|
56
|
+
*/
|
|
57
|
+
export declare function previewAndConfirm(title: string, data: Record<string, unknown>): Promise<boolean>;
|
|
58
|
+
/**
|
|
59
|
+
* Progress indicator for async operations
|
|
60
|
+
*/
|
|
61
|
+
export declare function withProgress<T>(message: string, fn: () => Promise<T>): Promise<T>;
|
|
62
|
+
/**
|
|
63
|
+
* Display a spinner
|
|
64
|
+
*/
|
|
65
|
+
export declare class Spinner {
|
|
66
|
+
private message;
|
|
67
|
+
private frames;
|
|
68
|
+
private i;
|
|
69
|
+
private interval?;
|
|
70
|
+
constructor(message: string);
|
|
71
|
+
start(): this;
|
|
72
|
+
succeed(message?: string): void;
|
|
73
|
+
fail(message?: string): void;
|
|
74
|
+
update(message: string): void;
|
|
75
|
+
private stop;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Password input (hidden)
|
|
79
|
+
*/
|
|
80
|
+
export declare function promptPassword(message?: string): Promise<string>;
|
|
81
|
+
//# sourceMappingURL=prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/prompt.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;GAEG;AACH,wBAAsB,MAAM,CAC1B,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,MAAM,CAAC,CAajB;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,MAAM,GAC7C,OAAO,CAAC,MAAM,CAAC,CAmBjB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,SAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CASpE;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,OAAO,SAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpE;AAED;;GAEG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAED;;GAEG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,CAAC,EAAE,MAAM,EACZ,GAAG,CAAC,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAQjB;AAED;;GAEG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,YAAY,UAAQ,GACnB,OAAO,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