nexusforge-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.
- package/bin/nexusforge +2 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +367 -0
- package/dist/index.js.map +1 -0
- package/dist/services/api.d.ts +51 -0
- package/dist/services/api.d.ts.map +1 -0
- package/dist/services/api.js +143 -0
- package/dist/services/api.js.map +1 -0
- package/dist/services/auth.d.ts +30 -0
- package/dist/services/auth.d.ts.map +1 -0
- package/dist/services/auth.js +180 -0
- package/dist/services/auth.js.map +1 -0
- package/dist/services/executor.d.ts +36 -0
- package/dist/services/executor.d.ts.map +1 -0
- package/dist/services/executor.js +206 -0
- package/dist/services/executor.js.map +1 -0
- package/dist/types/index.d.ts +85 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +5 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/config.d.ts +60 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +149 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/theme.d.ts +78 -0
- package/dist/utils/theme.d.ts.map +1 -0
- package/dist/utils/theme.js +140 -0
- package/dist/utils/theme.js.map +1 -0
- package/package.json +57 -0
- package/src/index.ts +427 -0
- package/src/services/api.ts +198 -0
- package/src/services/auth.ts +222 -0
- package/src/services/executor.ts +250 -0
- package/src/types/index.ts +104 -0
- package/src/utils/config.ts +172 -0
- package/src/utils/theme.ts +163 -0
- package/tsconfig.json +23 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NexusForge CLI Configuration Manager
|
|
3
|
+
*
|
|
4
|
+
* Stores authentication tokens and settings in ~/.nexusforge/config.json
|
|
5
|
+
*/
|
|
6
|
+
import Conf from 'conf';
|
|
7
|
+
// Default configuration
|
|
8
|
+
const DEFAULT_CONFIG = {
|
|
9
|
+
apiUrl: 'https://nexusconnectbridge.automatanexus.com/api/v1/bridge',
|
|
10
|
+
defaultModel: 'NexusForge',
|
|
11
|
+
theme: 'dark',
|
|
12
|
+
autoExecute: true,
|
|
13
|
+
};
|
|
14
|
+
// Configuration schema for type safety
|
|
15
|
+
const schema = {
|
|
16
|
+
apiUrl: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
default: DEFAULT_CONFIG.apiUrl,
|
|
19
|
+
},
|
|
20
|
+
accessToken: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
},
|
|
23
|
+
refreshToken: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
},
|
|
26
|
+
userId: {
|
|
27
|
+
type: 'number',
|
|
28
|
+
},
|
|
29
|
+
username: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
},
|
|
32
|
+
email: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
},
|
|
35
|
+
defaultModel: {
|
|
36
|
+
type: 'string',
|
|
37
|
+
default: DEFAULT_CONFIG.defaultModel,
|
|
38
|
+
},
|
|
39
|
+
theme: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: ['dark', 'light'],
|
|
42
|
+
default: DEFAULT_CONFIG.theme,
|
|
43
|
+
},
|
|
44
|
+
autoExecute: {
|
|
45
|
+
type: 'boolean',
|
|
46
|
+
default: DEFAULT_CONFIG.autoExecute,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
// Create config instance
|
|
50
|
+
const config = new Conf({
|
|
51
|
+
projectName: 'nexusforge',
|
|
52
|
+
schema,
|
|
53
|
+
defaults: DEFAULT_CONFIG,
|
|
54
|
+
});
|
|
55
|
+
/**
|
|
56
|
+
* Get the full configuration
|
|
57
|
+
*/
|
|
58
|
+
export function getConfig() {
|
|
59
|
+
return {
|
|
60
|
+
apiUrl: config.get('apiUrl'),
|
|
61
|
+
accessToken: config.get('accessToken'),
|
|
62
|
+
refreshToken: config.get('refreshToken'),
|
|
63
|
+
userId: config.get('userId'),
|
|
64
|
+
username: config.get('username'),
|
|
65
|
+
email: config.get('email'),
|
|
66
|
+
defaultModel: config.get('defaultModel'),
|
|
67
|
+
theme: config.get('theme'),
|
|
68
|
+
autoExecute: config.get('autoExecute'),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get a specific config value
|
|
73
|
+
*/
|
|
74
|
+
export function get(key) {
|
|
75
|
+
return config.get(key);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Set a specific config value
|
|
79
|
+
*/
|
|
80
|
+
export function set(key, value) {
|
|
81
|
+
config.set(key, value);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Check if user is authenticated
|
|
85
|
+
*/
|
|
86
|
+
export function isAuthenticated() {
|
|
87
|
+
const token = config.get('accessToken');
|
|
88
|
+
return !!token;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Save authentication data after successful login
|
|
92
|
+
*/
|
|
93
|
+
export function saveAuth(data) {
|
|
94
|
+
config.set('accessToken', data.accessToken);
|
|
95
|
+
if (data.refreshToken) {
|
|
96
|
+
config.set('refreshToken', data.refreshToken);
|
|
97
|
+
}
|
|
98
|
+
if (data.userId) {
|
|
99
|
+
config.set('userId', data.userId);
|
|
100
|
+
}
|
|
101
|
+
if (data.username) {
|
|
102
|
+
config.set('username', data.username);
|
|
103
|
+
}
|
|
104
|
+
if (data.email) {
|
|
105
|
+
config.set('email', data.email);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Clear authentication data (logout)
|
|
110
|
+
*/
|
|
111
|
+
export function clearAuth() {
|
|
112
|
+
config.delete('accessToken');
|
|
113
|
+
config.delete('refreshToken');
|
|
114
|
+
config.delete('userId');
|
|
115
|
+
config.delete('username');
|
|
116
|
+
config.delete('email');
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Get the API URL
|
|
120
|
+
*/
|
|
121
|
+
export function getApiUrl() {
|
|
122
|
+
return config.get('apiUrl');
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Set the API URL
|
|
126
|
+
*/
|
|
127
|
+
export function setApiUrl(url) {
|
|
128
|
+
config.set('apiUrl', url);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get the access token
|
|
132
|
+
*/
|
|
133
|
+
export function getAccessToken() {
|
|
134
|
+
return config.get('accessToken');
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get the config file path (for debugging)
|
|
138
|
+
*/
|
|
139
|
+
export function getConfigPath() {
|
|
140
|
+
return config.path;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Reset config to defaults
|
|
144
|
+
*/
|
|
145
|
+
export function resetConfig() {
|
|
146
|
+
config.clear();
|
|
147
|
+
}
|
|
148
|
+
export { config };
|
|
149
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/utils/config.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,wBAAwB;AACxB,MAAM,cAAc,GAAc;IAChC,MAAM,EAAE,4DAA4D;IACpE,YAAY,EAAE,YAAY;IAC1B,KAAK,EAAE,MAAM;IACb,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,uCAAuC;AACvC,MAAM,MAAM,GAAG;IACb,MAAM,EAAE;QACN,IAAI,EAAE,QAAiB;QACvB,OAAO,EAAE,cAAc,CAAC,MAAM;KAC/B;IACD,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;KACxB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;KACxB;IACD,MAAM,EAAE;QACN,IAAI,EAAE,QAAiB;KACxB;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,QAAiB;KACxB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,QAAiB;KACxB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,QAAiB;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,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NexusForge CLI Theme
|
|
3
|
+
*
|
|
4
|
+
* Brand colors matching the NexusForge web UI.
|
|
5
|
+
* - Teal for user messages
|
|
6
|
+
* - Ultra light cream for AI responses
|
|
7
|
+
* - Terracotta accents
|
|
8
|
+
*/
|
|
9
|
+
export declare const COLORS: {
|
|
10
|
+
teal: string;
|
|
11
|
+
terracotta: string;
|
|
12
|
+
cream: string;
|
|
13
|
+
darkSlate: string;
|
|
14
|
+
warmBg: string;
|
|
15
|
+
textPrimary: string;
|
|
16
|
+
textSecondary: string;
|
|
17
|
+
textMuted: string;
|
|
18
|
+
success: string;
|
|
19
|
+
warning: string;
|
|
20
|
+
error: string;
|
|
21
|
+
info: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const NEXUSFORGE_THEME: {
|
|
24
|
+
user: {
|
|
25
|
+
label: string;
|
|
26
|
+
text: string;
|
|
27
|
+
};
|
|
28
|
+
assistant: {
|
|
29
|
+
label: string;
|
|
30
|
+
text: string;
|
|
31
|
+
};
|
|
32
|
+
system: {
|
|
33
|
+
info: string;
|
|
34
|
+
success: string;
|
|
35
|
+
warning: string;
|
|
36
|
+
error: string;
|
|
37
|
+
muted: string;
|
|
38
|
+
};
|
|
39
|
+
code: {
|
|
40
|
+
background: string;
|
|
41
|
+
text: string;
|
|
42
|
+
keyword: string;
|
|
43
|
+
};
|
|
44
|
+
prompt: string;
|
|
45
|
+
};
|
|
46
|
+
export declare const style: {
|
|
47
|
+
user: (text: string) => string;
|
|
48
|
+
userLabel: (text: string) => string;
|
|
49
|
+
assistant: (text: string) => string;
|
|
50
|
+
assistantLabel: (text: string) => string;
|
|
51
|
+
success: (text: string) => string;
|
|
52
|
+
warning: (text: string) => string;
|
|
53
|
+
error: (text: string) => string;
|
|
54
|
+
info: (text: string) => string;
|
|
55
|
+
muted: (text: string) => string;
|
|
56
|
+
prompt: (text: string) => string;
|
|
57
|
+
code: (text: string) => string;
|
|
58
|
+
keyword: (text: string) => string;
|
|
59
|
+
divider: () => string;
|
|
60
|
+
};
|
|
61
|
+
export declare const NEXUSFORGE_ASCII_LOGO = "\n \u2588\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n \u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2588\u2588\u2557\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\n \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 \u255A\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n \u2588\u2588\u2551\u255A\u2588\u2588\u2557\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2554\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2550\u2550\u2550\u2550\u2588\u2588\u2551\n \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2554\u255D \u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\n \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n\n \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\n \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2557\n \u2588\u2588\u2554\u2550\u2550\u255D \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u255D\n \u2588\u2588\u2551 \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\n \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n";
|
|
62
|
+
/**
|
|
63
|
+
* Display the welcome screen with logo and connection info
|
|
64
|
+
*/
|
|
65
|
+
export declare function displayWelcome(version: string, serverUrl: string, model: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Display a user message
|
|
68
|
+
*/
|
|
69
|
+
export declare function displayUserMessage(content: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* Display an assistant message
|
|
72
|
+
*/
|
|
73
|
+
export declare function displayAssistantMessage(content: string): void;
|
|
74
|
+
/**
|
|
75
|
+
* Display a system message
|
|
76
|
+
*/
|
|
77
|
+
export declare function displaySystemMessage(content: string, type?: 'info' | 'success' | 'warning' | 'error'): void;
|
|
78
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH,eAAO,MAAM,MAAM;;;;;;;;;;;;;CAoBlB,CAAC;AAGF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;CA+B5B,CAAC;AAGF,eAAO,MAAM,KAAK;iBAEH,MAAM;sBACD,MAAM;sBAGN,MAAM;2BACD,MAAM;oBAGb,MAAM;oBACN,MAAM;kBACR,MAAM;iBACP,MAAM;kBACL,MAAM;mBAGL,MAAM;iBACR,MAAM;oBACH,MAAM;;CAIvB,CAAC;AAGF,eAAO,MAAM,qBAAqB,srFAcjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAuBtF;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAGxD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI7D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAgB,GAAG,IAAI,CAGnH"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NexusForge CLI Theme
|
|
3
|
+
*
|
|
4
|
+
* Brand colors matching the NexusForge web UI.
|
|
5
|
+
* - Teal for user messages
|
|
6
|
+
* - Ultra light cream for AI responses
|
|
7
|
+
* - Terracotta accents
|
|
8
|
+
*/
|
|
9
|
+
import chalk from 'chalk';
|
|
10
|
+
// NexusForge brand colors
|
|
11
|
+
export const COLORS = {
|
|
12
|
+
// Primary colors
|
|
13
|
+
teal: '#14b8a6',
|
|
14
|
+
terracotta: '#c4a484',
|
|
15
|
+
cream: '#faf9f6',
|
|
16
|
+
// Backgrounds
|
|
17
|
+
darkSlate: '#1e293b',
|
|
18
|
+
warmBg: '#f5ebe0',
|
|
19
|
+
// Text
|
|
20
|
+
textPrimary: '#111827',
|
|
21
|
+
textSecondary: '#6b7280',
|
|
22
|
+
textMuted: '#9ca3af',
|
|
23
|
+
// Status
|
|
24
|
+
success: '#10b981',
|
|
25
|
+
warning: '#f59e0b',
|
|
26
|
+
error: '#ef4444',
|
|
27
|
+
info: '#64b5f6',
|
|
28
|
+
};
|
|
29
|
+
// Theme object for consistent styling
|
|
30
|
+
export const NEXUSFORGE_THEME = {
|
|
31
|
+
// User messages - Teal
|
|
32
|
+
user: {
|
|
33
|
+
label: COLORS.teal,
|
|
34
|
+
text: COLORS.teal,
|
|
35
|
+
},
|
|
36
|
+
// AI messages - Ultra light cream
|
|
37
|
+
assistant: {
|
|
38
|
+
label: COLORS.terracotta,
|
|
39
|
+
text: COLORS.cream,
|
|
40
|
+
},
|
|
41
|
+
// System/UI elements
|
|
42
|
+
system: {
|
|
43
|
+
info: COLORS.info,
|
|
44
|
+
success: COLORS.success,
|
|
45
|
+
warning: COLORS.warning,
|
|
46
|
+
error: COLORS.error,
|
|
47
|
+
muted: COLORS.textMuted,
|
|
48
|
+
},
|
|
49
|
+
// Code blocks
|
|
50
|
+
code: {
|
|
51
|
+
background: COLORS.darkSlate,
|
|
52
|
+
text: '#e2e8f0',
|
|
53
|
+
keyword: COLORS.teal,
|
|
54
|
+
},
|
|
55
|
+
// Prompt
|
|
56
|
+
prompt: COLORS.teal,
|
|
57
|
+
};
|
|
58
|
+
// Chalk helpers for consistent coloring
|
|
59
|
+
export const style = {
|
|
60
|
+
// User message styling
|
|
61
|
+
user: (text) => chalk.hex(NEXUSFORGE_THEME.user.text)(text),
|
|
62
|
+
userLabel: (text) => chalk.hex(NEXUSFORGE_THEME.user.label).bold(text),
|
|
63
|
+
// AI message styling
|
|
64
|
+
assistant: (text) => chalk.hex(NEXUSFORGE_THEME.assistant.text)(text),
|
|
65
|
+
assistantLabel: (text) => chalk.hex(NEXUSFORGE_THEME.assistant.label).bold(text),
|
|
66
|
+
// Status styling
|
|
67
|
+
success: (text) => chalk.hex(NEXUSFORGE_THEME.system.success)(text),
|
|
68
|
+
warning: (text) => chalk.hex(NEXUSFORGE_THEME.system.warning)(text),
|
|
69
|
+
error: (text) => chalk.hex(NEXUSFORGE_THEME.system.error)(text),
|
|
70
|
+
info: (text) => chalk.hex(NEXUSFORGE_THEME.system.info)(text),
|
|
71
|
+
muted: (text) => chalk.hex(NEXUSFORGE_THEME.system.muted)(text),
|
|
72
|
+
// Special styling
|
|
73
|
+
prompt: (text) => chalk.hex(NEXUSFORGE_THEME.prompt).bold(text),
|
|
74
|
+
code: (text) => chalk.bgHex(NEXUSFORGE_THEME.code.background).hex(NEXUSFORGE_THEME.code.text)(text),
|
|
75
|
+
keyword: (text) => chalk.hex(NEXUSFORGE_THEME.code.keyword)(text),
|
|
76
|
+
// Dividers
|
|
77
|
+
divider: () => chalk.hex(NEXUSFORGE_THEME.system.muted)('═'.repeat(56)),
|
|
78
|
+
};
|
|
79
|
+
// ASCII Art Logo
|
|
80
|
+
export const NEXUSFORGE_ASCII_LOGO = `
|
|
81
|
+
███╗ ██╗███████╗██╗ ██╗██╗ ██╗███████╗
|
|
82
|
+
████╗ ██║██╔════╝╚██╗██╔╝██║ ██║██╔════╝
|
|
83
|
+
██╔██╗ ██║█████╗ ╚███╔╝ ██║ ██║███████╗
|
|
84
|
+
██║╚██╗██║██╔══╝ ██╔██╗ ██║ ██║╚════██║
|
|
85
|
+
██║ ╚████║███████╗██╔╝ ██╗╚██████╔╝███████║
|
|
86
|
+
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
|
87
|
+
|
|
88
|
+
███████╗ ██████╗ ██████╗ ██████╗ ███████╗
|
|
89
|
+
██╔════╝██╔═══██╗██╔══██╗██╔════╝ ██╔════╝
|
|
90
|
+
█████╗ ██║ ██║██████╔╝██║ ███╗█████╗
|
|
91
|
+
██╔══╝ ██║ ██║██╔══██╗██║ ██║██╔══╝
|
|
92
|
+
██║ ╚██████╔╝██║ ██║╚██████╔╝███████╗
|
|
93
|
+
╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
|
94
|
+
`;
|
|
95
|
+
/**
|
|
96
|
+
* Display the welcome screen with logo and connection info
|
|
97
|
+
*/
|
|
98
|
+
export function displayWelcome(version, serverUrl, model) {
|
|
99
|
+
// Clear screen
|
|
100
|
+
console.clear();
|
|
101
|
+
// Logo in teal
|
|
102
|
+
console.log(chalk.hex(NEXUSFORGE_THEME.user.label)(NEXUSFORGE_ASCII_LOGO));
|
|
103
|
+
// Divider
|
|
104
|
+
console.log(style.divider());
|
|
105
|
+
console.log('');
|
|
106
|
+
// Welcome message in cream
|
|
107
|
+
console.log(style.assistant(` Welcome to NexusForge CLI v${version}`));
|
|
108
|
+
console.log(style.assistant(' Your AI-powered development companion'));
|
|
109
|
+
console.log('');
|
|
110
|
+
console.log(style.muted(` Connected to: ${serverUrl}`));
|
|
111
|
+
console.log(style.muted(` Model: ${model} | Session: active`));
|
|
112
|
+
console.log('');
|
|
113
|
+
console.log(style.assistant(' Type /help for commands or start chatting!'));
|
|
114
|
+
console.log('');
|
|
115
|
+
console.log(style.divider());
|
|
116
|
+
console.log('');
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Display a user message
|
|
120
|
+
*/
|
|
121
|
+
export function displayUserMessage(content) {
|
|
122
|
+
console.log(`${style.userLabel('You')} ${style.prompt('❯')} ${style.user(content)}`);
|
|
123
|
+
console.log('');
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Display an assistant message
|
|
127
|
+
*/
|
|
128
|
+
export function displayAssistantMessage(content) {
|
|
129
|
+
console.log(`${style.assistantLabel('NexusForge')} ${style.prompt('❯')}`);
|
|
130
|
+
console.log(style.assistant(content));
|
|
131
|
+
console.log('');
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Display a system message
|
|
135
|
+
*/
|
|
136
|
+
export function displaySystemMessage(content, type = 'info') {
|
|
137
|
+
const styleFunc = style[type];
|
|
138
|
+
console.log(styleFunc(`[${type.toUpperCase()}] ${content}`));
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,0BAA0B;AAC1B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,iBAAiB;IACjB,IAAI,EAAE,SAAS;IACf,UAAU,EAAE,SAAS;IACrB,KAAK,EAAE,SAAS;IAEhB,cAAc;IACd,SAAS,EAAE,SAAS;IACpB,MAAM,EAAE,SAAS;IAEjB,OAAO;IACP,WAAW,EAAE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|
|
4
|
+
"description": "NexusForge CLI - AI-powered development companion for your terminal",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"nexusforge": "./bin/nexusforge"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "ts-node src/index.ts",
|
|
13
|
+
"start": "node dist/index.js",
|
|
14
|
+
"lint": "eslint src/**/*.ts",
|
|
15
|
+
"prepublishOnly": "npm run build"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"cli",
|
|
19
|
+
"ai",
|
|
20
|
+
"nexusforge",
|
|
21
|
+
"development",
|
|
22
|
+
"assistant",
|
|
23
|
+
"terminal"
|
|
24
|
+
],
|
|
25
|
+
"author": "AutomataNexus, LLC",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/automata-nexus/nexusforge-cli"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"chalk": "^5.3.0",
|
|
36
|
+
"commander": "^12.0.0",
|
|
37
|
+
"conf": "^12.0.0",
|
|
38
|
+
"ink": "^4.4.1",
|
|
39
|
+
"ink-spinner": "^5.0.0",
|
|
40
|
+
"ink-text-input": "^5.0.1",
|
|
41
|
+
"node-fetch": "^3.3.2",
|
|
42
|
+
"open": "^10.0.0",
|
|
43
|
+
"ora": "^8.0.1",
|
|
44
|
+
"react": "^18.2.0",
|
|
45
|
+
"ws": "^8.16.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^20.10.0",
|
|
49
|
+
"@types/react": "^18.2.0",
|
|
50
|
+
"@types/ws": "^8.5.10",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
52
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
53
|
+
"eslint": "^8.0.0",
|
|
54
|
+
"ts-node": "^10.9.2",
|
|
55
|
+
"typescript": "^5.3.0"
|
|
56
|
+
}
|
|
57
|
+
}
|