@lanonasis/cli 3.6.5 → 3.6.7
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/dist/commands/api-keys.d.ts +2 -1
- package/dist/commands/api-keys.js +73 -78
- package/dist/commands/auth.js +160 -167
- package/dist/commands/completion.js +31 -39
- package/dist/commands/config.js +162 -201
- package/dist/commands/enhanced-memory.js +11 -17
- package/dist/commands/guide.js +79 -88
- package/dist/commands/init.js +14 -20
- package/dist/commands/mcp.d.ts +10 -0
- package/dist/commands/mcp.js +167 -156
- package/dist/commands/memory.js +77 -83
- package/dist/commands/organization.js +15 -21
- package/dist/commands/topics.js +52 -58
- package/dist/core/achievements.js +19 -26
- package/dist/core/architecture.js +42 -59
- package/dist/core/dashboard.js +71 -81
- package/dist/core/error-handler.js +30 -39
- package/dist/core/power-mode.js +46 -53
- package/dist/core/progress.js +35 -44
- package/dist/core/welcome.js +56 -64
- package/dist/enhanced-cli.js +49 -58
- package/dist/index-simple.js +75 -113
- package/dist/index.js +64 -69
- package/dist/mcp/access-control.js +13 -17
- package/dist/mcp/client/enhanced-client.js +16 -23
- package/dist/mcp/enhanced-server.js +10 -14
- package/dist/mcp/logger.js +3 -7
- package/dist/mcp/memory-state.js +13 -17
- package/dist/mcp/schemas/tool-schemas.d.ts +16 -16
- package/dist/mcp/schemas/tool-schemas.js +122 -126
- package/dist/mcp/server/lanonasis-server.js +66 -57
- package/dist/mcp/transports/transport-manager.js +18 -25
- package/dist/mcp/vector-store.js +6 -10
- package/dist/mcp-server.js +23 -27
- package/dist/utils/api.js +19 -26
- package/dist/utils/config.d.ts +2 -1
- package/dist/utils/config.js +65 -78
- package/dist/utils/formatting.js +6 -14
- package/dist/utils/mcp-client.js +76 -117
- package/package.json +36 -5
package/dist/commands/topics.js
CHANGED
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const ora_1 = __importDefault(require("ora"));
|
|
10
|
-
const table_1 = require("table");
|
|
11
|
-
const date_fns_1 = require("date-fns");
|
|
12
|
-
const api_js_1 = require("../utils/api.js");
|
|
13
|
-
const formatting_js_1 = require("../utils/formatting.js");
|
|
14
|
-
function topicCommands(program) {
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import inquirer from 'inquirer';
|
|
3
|
+
import ora from 'ora';
|
|
4
|
+
import { table } from 'table';
|
|
5
|
+
import { format } from 'date-fns';
|
|
6
|
+
import { apiClient } from '../utils/api.js';
|
|
7
|
+
import { truncateText } from '../utils/formatting.js';
|
|
8
|
+
export function topicCommands(program) {
|
|
15
9
|
// Create topic
|
|
16
10
|
program
|
|
17
11
|
.command('create')
|
|
@@ -27,7 +21,7 @@ function topicCommands(program) {
|
|
|
27
21
|
try {
|
|
28
22
|
let { name, description, color, icon, parent, interactive } = options;
|
|
29
23
|
if (interactive || !name) {
|
|
30
|
-
const answers = await
|
|
24
|
+
const answers = await inquirer.prompt([
|
|
31
25
|
{
|
|
32
26
|
type: 'input',
|
|
33
27
|
name: 'name',
|
|
@@ -64,7 +58,7 @@ function topicCommands(program) {
|
|
|
64
58
|
color = answers.color;
|
|
65
59
|
icon = answers.icon;
|
|
66
60
|
}
|
|
67
|
-
const spinner = (
|
|
61
|
+
const spinner = ora('Creating topic...').start();
|
|
68
62
|
const topicData = { name };
|
|
69
63
|
if (description)
|
|
70
64
|
topicData.description = description;
|
|
@@ -74,11 +68,11 @@ function topicCommands(program) {
|
|
|
74
68
|
topicData.icon = icon;
|
|
75
69
|
if (parent)
|
|
76
70
|
topicData.parent_topic_id = parent;
|
|
77
|
-
const topic = await
|
|
71
|
+
const topic = await apiClient.createTopic(topicData);
|
|
78
72
|
spinner.succeed('Topic created successfully');
|
|
79
73
|
console.log();
|
|
80
|
-
console.log(
|
|
81
|
-
console.log(` ID: ${
|
|
74
|
+
console.log(chalk.green('✓ Topic created:'));
|
|
75
|
+
console.log(` ID: ${chalk.cyan(topic.id)}`);
|
|
82
76
|
console.log(` Name: ${topic.name}`);
|
|
83
77
|
if (topic.description) {
|
|
84
78
|
console.log(` Description: ${topic.description}`);
|
|
@@ -89,7 +83,7 @@ function topicCommands(program) {
|
|
|
89
83
|
}
|
|
90
84
|
catch (error) {
|
|
91
85
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
92
|
-
console.error(
|
|
86
|
+
console.error(chalk.red('✖ Failed to create topic:'), errorMessage);
|
|
93
87
|
process.exit(1);
|
|
94
88
|
}
|
|
95
89
|
});
|
|
@@ -100,14 +94,14 @@ function topicCommands(program) {
|
|
|
100
94
|
.description('List topics')
|
|
101
95
|
.action(async () => {
|
|
102
96
|
try {
|
|
103
|
-
const spinner = (
|
|
104
|
-
const topics = await
|
|
97
|
+
const spinner = ora('Fetching topics...').start();
|
|
98
|
+
const topics = await apiClient.getTopics();
|
|
105
99
|
spinner.stop();
|
|
106
100
|
if (topics.length === 0) {
|
|
107
|
-
console.log(
|
|
101
|
+
console.log(chalk.yellow('No topics found'));
|
|
108
102
|
return;
|
|
109
103
|
}
|
|
110
|
-
console.log(
|
|
104
|
+
console.log(chalk.blue.bold(`\n📁 Topics (${topics.length} total)`));
|
|
111
105
|
console.log();
|
|
112
106
|
const outputFormat = process.env.CLI_OUTPUT_FORMAT || 'table';
|
|
113
107
|
if (outputFormat === 'json') {
|
|
@@ -116,10 +110,10 @@ function topicCommands(program) {
|
|
|
116
110
|
else {
|
|
117
111
|
// Table format
|
|
118
112
|
const tableData = topics.map((topic) => [
|
|
119
|
-
|
|
120
|
-
|
|
113
|
+
truncateText(topic.name, 25),
|
|
114
|
+
truncateText(topic.description || '', 40),
|
|
121
115
|
topic.color || '',
|
|
122
|
-
|
|
116
|
+
format(new Date(topic.created_at), 'MMM dd, yyyy'),
|
|
123
117
|
topic.parent_topic_id ? '✓' : ''
|
|
124
118
|
]);
|
|
125
119
|
const tableConfig = {
|
|
@@ -136,12 +130,12 @@ function topicCommands(program) {
|
|
|
136
130
|
]
|
|
137
131
|
};
|
|
138
132
|
const tableHeaders = ['Name', 'Description', 'System', 'Created'];
|
|
139
|
-
console.log(
|
|
133
|
+
console.log(table([tableHeaders, ...tableData], tableConfig));
|
|
140
134
|
}
|
|
141
135
|
}
|
|
142
136
|
catch (error) {
|
|
143
137
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
144
|
-
console.error(
|
|
138
|
+
console.error(chalk.red('✖ Failed to list topics:'), errorMessage);
|
|
145
139
|
process.exit(1);
|
|
146
140
|
}
|
|
147
141
|
});
|
|
@@ -153,37 +147,37 @@ function topicCommands(program) {
|
|
|
153
147
|
.argument('<id>', 'topic ID')
|
|
154
148
|
.action(async (id) => {
|
|
155
149
|
try {
|
|
156
|
-
const spinner = (
|
|
157
|
-
const topic = await
|
|
150
|
+
const spinner = ora('Fetching topic...').start();
|
|
151
|
+
const topic = await apiClient.getTopic(id);
|
|
158
152
|
spinner.stop();
|
|
159
|
-
console.log(
|
|
153
|
+
console.log(chalk.blue.bold('\n📁 Topic Details'));
|
|
160
154
|
console.log();
|
|
161
|
-
console.log(
|
|
162
|
-
console.log(
|
|
155
|
+
console.log(chalk.green('Name:'), topic.name);
|
|
156
|
+
console.log(chalk.green('ID:'), chalk.cyan(topic.id));
|
|
163
157
|
if (topic.description) {
|
|
164
|
-
console.log(
|
|
158
|
+
console.log(chalk.green('Description:'), topic.description);
|
|
165
159
|
}
|
|
166
160
|
if (topic.color) {
|
|
167
|
-
console.log(
|
|
161
|
+
console.log(chalk.green('Color:'), topic.color);
|
|
168
162
|
}
|
|
169
163
|
if (topic.icon) {
|
|
170
|
-
console.log(
|
|
164
|
+
console.log(chalk.green('Icon:'), topic.icon);
|
|
171
165
|
}
|
|
172
166
|
if (topic.parent_topic_id) {
|
|
173
|
-
console.log(
|
|
167
|
+
console.log(chalk.green('Parent Topic:'), topic.parent_topic_id);
|
|
174
168
|
}
|
|
175
|
-
console.log(
|
|
176
|
-
console.log(
|
|
177
|
-
console.log(
|
|
169
|
+
console.log(chalk.green('System Topic:'), topic.is_system ? 'Yes' : 'No');
|
|
170
|
+
console.log(chalk.green('Created:'), format(new Date(topic.created_at), 'PPpp'));
|
|
171
|
+
console.log(chalk.green('Updated:'), format(new Date(topic.updated_at), 'PPpp'));
|
|
178
172
|
if (topic.metadata && Object.keys(topic.metadata).length > 0) {
|
|
179
173
|
console.log();
|
|
180
|
-
console.log(
|
|
174
|
+
console.log(chalk.green('Metadata:'));
|
|
181
175
|
console.log(JSON.stringify(topic.metadata, null, 2));
|
|
182
176
|
}
|
|
183
177
|
}
|
|
184
178
|
catch (error) {
|
|
185
179
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
186
|
-
console.error(
|
|
180
|
+
console.error(chalk.red('✖ Failed to get topic:'), errorMessage);
|
|
187
181
|
process.exit(1);
|
|
188
182
|
}
|
|
189
183
|
});
|
|
@@ -202,10 +196,10 @@ function topicCommands(program) {
|
|
|
202
196
|
let updateData = {};
|
|
203
197
|
if (options.interactive) {
|
|
204
198
|
// First, get current topic data
|
|
205
|
-
const spinner = (
|
|
206
|
-
const currentTopic = await
|
|
199
|
+
const spinner = ora('Fetching current topic...').start();
|
|
200
|
+
const currentTopic = await apiClient.getTopic(id);
|
|
207
201
|
spinner.stop();
|
|
208
|
-
const answers = await
|
|
202
|
+
const answers = await inquirer.prompt([
|
|
209
203
|
{
|
|
210
204
|
type: 'input',
|
|
211
205
|
name: 'name',
|
|
@@ -254,20 +248,20 @@ function topicCommands(program) {
|
|
|
254
248
|
updateData.icon = options.icon;
|
|
255
249
|
}
|
|
256
250
|
if (Object.keys(updateData).length === 0) {
|
|
257
|
-
console.log(
|
|
251
|
+
console.log(chalk.yellow('No updates specified'));
|
|
258
252
|
return;
|
|
259
253
|
}
|
|
260
|
-
const spinner = (
|
|
261
|
-
const topic = await
|
|
254
|
+
const spinner = ora('Updating topic...').start();
|
|
255
|
+
const topic = await apiClient.updateTopic(id, updateData);
|
|
262
256
|
spinner.succeed('Topic updated successfully');
|
|
263
257
|
console.log();
|
|
264
|
-
console.log(
|
|
265
|
-
console.log(` ID: ${
|
|
258
|
+
console.log(chalk.green('✓ Topic updated:'));
|
|
259
|
+
console.log(` ID: ${chalk.cyan(topic.id)}`);
|
|
266
260
|
console.log(` Name: ${topic.name}`);
|
|
267
261
|
}
|
|
268
262
|
catch (error) {
|
|
269
263
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
270
|
-
console.error(
|
|
264
|
+
console.error(chalk.red('✖ Failed to update topic:'), errorMessage);
|
|
271
265
|
process.exit(1);
|
|
272
266
|
}
|
|
273
267
|
});
|
|
@@ -281,8 +275,8 @@ function topicCommands(program) {
|
|
|
281
275
|
.action(async (id, options) => {
|
|
282
276
|
try {
|
|
283
277
|
if (!options.force) {
|
|
284
|
-
const topic = await
|
|
285
|
-
const answer = await
|
|
278
|
+
const topic = await apiClient.getTopic(id);
|
|
279
|
+
const answer = await inquirer.prompt([
|
|
286
280
|
{
|
|
287
281
|
type: 'confirm',
|
|
288
282
|
name: 'confirm',
|
|
@@ -291,17 +285,17 @@ function topicCommands(program) {
|
|
|
291
285
|
}
|
|
292
286
|
]);
|
|
293
287
|
if (!answer.confirm) {
|
|
294
|
-
console.log(
|
|
288
|
+
console.log(chalk.yellow('Deletion cancelled'));
|
|
295
289
|
return;
|
|
296
290
|
}
|
|
297
291
|
}
|
|
298
|
-
const spinner = (
|
|
299
|
-
await
|
|
292
|
+
const spinner = ora('Deleting topic...').start();
|
|
293
|
+
await apiClient.deleteTopic(id);
|
|
300
294
|
spinner.succeed('Topic deleted successfully');
|
|
301
295
|
}
|
|
302
296
|
catch (error) {
|
|
303
297
|
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
304
|
-
console.error(
|
|
298
|
+
console.error(chalk.red('✖ Failed to delete topic:'), errorMessage);
|
|
305
299
|
process.exit(1);
|
|
306
300
|
}
|
|
307
301
|
});
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Achievement System and Engagement Features
|
|
4
3
|
* Gamification elements to enhance user engagement
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
exports.AchievementSystem = void 0;
|
|
11
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
12
|
-
const boxen_1 = __importDefault(require("boxen"));
|
|
13
|
-
const events_1 = require("events");
|
|
14
|
-
class AchievementSystem extends events_1.EventEmitter {
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import boxen from 'boxen';
|
|
7
|
+
import { EventEmitter } from 'events';
|
|
8
|
+
export class AchievementSystem extends EventEmitter {
|
|
15
9
|
stateManager;
|
|
16
10
|
achievements;
|
|
17
11
|
userStats;
|
|
@@ -271,10 +265,10 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
271
265
|
* Show achievement celebration
|
|
272
266
|
*/
|
|
273
267
|
celebrate(achievement) {
|
|
274
|
-
const celebration = (
|
|
275
|
-
`${
|
|
276
|
-
`${
|
|
277
|
-
`${
|
|
268
|
+
const celebration = boxen(`${achievement.icon} ${chalk.bold.yellow('Achievement Unlocked!')}\n\n` +
|
|
269
|
+
`${chalk.bold(achievement.name)}\n` +
|
|
270
|
+
`${chalk.gray(achievement.description)}\n\n` +
|
|
271
|
+
`${chalk.green(`+${achievement.points} points`)}`, {
|
|
278
272
|
padding: 1,
|
|
279
273
|
borderStyle: 'double',
|
|
280
274
|
borderColor: 'yellow',
|
|
@@ -287,14 +281,14 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
287
281
|
*/
|
|
288
282
|
showAchievements() {
|
|
289
283
|
console.clear();
|
|
290
|
-
console.log(
|
|
284
|
+
console.log(chalk.bold.yellow('🏆 Achievements\n'));
|
|
291
285
|
const categories = ['usage', 'milestone', 'special', 'hidden'];
|
|
292
286
|
const totalPoints = this.getTotalPoints();
|
|
293
287
|
const unlockedPoints = this.getUnlockedPoints();
|
|
294
288
|
// Summary
|
|
295
|
-
console.log((
|
|
296
|
-
`Unlocked: ${
|
|
297
|
-
`Completion: ${
|
|
289
|
+
console.log(boxen(`Points: ${chalk.bold.green(unlockedPoints)} / ${totalPoints}\n` +
|
|
290
|
+
`Unlocked: ${chalk.bold(this.unlockedAchievements.size)} / ${this.achievements.size}\n` +
|
|
291
|
+
`Completion: ${chalk.bold(Math.round((this.unlockedAchievements.size / this.achievements.size) * 100) + '%')}`, {
|
|
298
292
|
padding: 1,
|
|
299
293
|
borderStyle: 'single',
|
|
300
294
|
borderColor: 'cyan'
|
|
@@ -305,7 +299,7 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
305
299
|
.filter(a => a.category === category);
|
|
306
300
|
if (categoryAchievements.length === 0)
|
|
307
301
|
return;
|
|
308
|
-
console.log(`\n${
|
|
302
|
+
console.log(`\n${chalk.bold(this.getCategoryTitle(category))}\n`);
|
|
309
303
|
categoryAchievements.forEach(achievement => {
|
|
310
304
|
this.displayAchievement(achievement);
|
|
311
305
|
});
|
|
@@ -317,9 +311,9 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
317
311
|
displayAchievement(achievement) {
|
|
318
312
|
const unlocked = achievement.unlocked || this.unlockedAchievements.has(achievement.id);
|
|
319
313
|
const icon = unlocked ? achievement.icon : '🔒';
|
|
320
|
-
const name = unlocked ?
|
|
321
|
-
const description = unlocked ? achievement.description :
|
|
322
|
-
const points =
|
|
314
|
+
const name = unlocked ? chalk.bold(achievement.name) : chalk.dim(achievement.name);
|
|
315
|
+
const description = unlocked ? achievement.description : chalk.dim(achievement.description);
|
|
316
|
+
const points = chalk.green(`${achievement.points}pts`);
|
|
323
317
|
let progressBar = '';
|
|
324
318
|
if (achievement.maxProgress && !unlocked) {
|
|
325
319
|
const progress = achievement.progress || 0;
|
|
@@ -327,12 +321,12 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
327
321
|
const barLength = 20;
|
|
328
322
|
const filled = Math.round((progress / achievement.maxProgress) * barLength);
|
|
329
323
|
const bar = '█'.repeat(filled) + '░'.repeat(barLength - filled);
|
|
330
|
-
progressBar = `\n ${
|
|
324
|
+
progressBar = `\n ${chalk.cyan(bar)} ${percentage}% (${progress}/${achievement.maxProgress})`;
|
|
331
325
|
}
|
|
332
326
|
console.log(` ${icon} ${name} ${points}`);
|
|
333
327
|
console.log(` ${description}${progressBar}`);
|
|
334
328
|
if (unlocked && achievement.unlockedAt) {
|
|
335
|
-
console.log(
|
|
329
|
+
console.log(chalk.dim(` Unlocked: ${achievement.unlockedAt.toLocaleDateString()}`));
|
|
336
330
|
}
|
|
337
331
|
console.log();
|
|
338
332
|
}
|
|
@@ -374,7 +368,7 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
374
368
|
// Show subtle notification for new achievements
|
|
375
369
|
if (newAchievements.length > 0 && !this.stateManager.getPreferences().expertMode) {
|
|
376
370
|
newAchievements.forEach(achievement => {
|
|
377
|
-
console.log(
|
|
371
|
+
console.log(chalk.yellow(`\n🎉 Achievement unlocked: ${achievement.name}!`));
|
|
378
372
|
});
|
|
379
373
|
}
|
|
380
374
|
}
|
|
@@ -429,4 +423,3 @@ class AchievementSystem extends events_1.EventEmitter {
|
|
|
429
423
|
// Would save to storage
|
|
430
424
|
}
|
|
431
425
|
}
|
|
432
|
-
exports.AchievementSystem = AchievementSystem;
|
|
@@ -1,18 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Core Architecture for Enhanced CLI Experience
|
|
4
3
|
* Implements the layered architecture for state management, interaction, and presentation
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.SubtleAnimationController = exports.ResponsiveLayoutManager = exports.AdaptiveThemeEngine = exports.PresentationLayer = exports.InlineHelpProvider = exports.RealTimeFeedback = exports.ContextualValidator = exports.AdaptivePromptSystem = exports.InteractionEngine = exports.StateManager = void 0;
|
|
11
|
-
exports.createCLIArchitecture = createCLIArchitecture;
|
|
12
|
-
const events_1 = require("events");
|
|
13
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
5
|
+
import { EventEmitter } from 'events';
|
|
6
|
+
import chalk from 'chalk';
|
|
14
7
|
// State Management Layer
|
|
15
|
-
class StateManager extends
|
|
8
|
+
export class StateManager extends EventEmitter {
|
|
16
9
|
navigationStack = [];
|
|
17
10
|
userContext;
|
|
18
11
|
sessionMemory;
|
|
@@ -73,7 +66,7 @@ class StateManager extends events_1.EventEmitter {
|
|
|
73
66
|
renderBreadcrumb() {
|
|
74
67
|
if (this.navigationStack.length > 0) {
|
|
75
68
|
const path = this.navigationStack.map(s => s.name).join(' > ');
|
|
76
|
-
console.log(
|
|
69
|
+
console.log(chalk.dim(path));
|
|
77
70
|
}
|
|
78
71
|
}
|
|
79
72
|
// Context methods
|
|
@@ -119,9 +112,8 @@ class StateManager extends events_1.EventEmitter {
|
|
|
119
112
|
return this.sessionMemory.undoStack.pop();
|
|
120
113
|
}
|
|
121
114
|
}
|
|
122
|
-
exports.StateManager = StateManager;
|
|
123
115
|
// Interaction Engine
|
|
124
|
-
class InteractionEngine {
|
|
116
|
+
export class InteractionEngine {
|
|
125
117
|
stateManager;
|
|
126
118
|
promptSystem;
|
|
127
119
|
validationEngine;
|
|
@@ -147,9 +139,8 @@ class InteractionEngine {
|
|
|
147
139
|
return this.helpSystem.getHelp();
|
|
148
140
|
}
|
|
149
141
|
}
|
|
150
|
-
exports.InteractionEngine = InteractionEngine;
|
|
151
142
|
// Adaptive Prompt System
|
|
152
|
-
class AdaptivePromptSystem {
|
|
143
|
+
export class AdaptivePromptSystem {
|
|
153
144
|
stateManager;
|
|
154
145
|
constructor(stateManager) {
|
|
155
146
|
this.stateManager = stateManager;
|
|
@@ -175,9 +166,8 @@ class AdaptivePromptSystem {
|
|
|
175
166
|
return null;
|
|
176
167
|
}
|
|
177
168
|
}
|
|
178
|
-
exports.AdaptivePromptSystem = AdaptivePromptSystem;
|
|
179
169
|
// Contextual Validator
|
|
180
|
-
class ContextualValidator {
|
|
170
|
+
export class ContextualValidator {
|
|
181
171
|
validate(value, rules) {
|
|
182
172
|
const errors = [];
|
|
183
173
|
const warnings = [];
|
|
@@ -204,15 +194,14 @@ class ContextualValidator {
|
|
|
204
194
|
};
|
|
205
195
|
}
|
|
206
196
|
}
|
|
207
|
-
exports.ContextualValidator = ContextualValidator;
|
|
208
197
|
// Real-time Feedback System
|
|
209
|
-
class RealTimeFeedback {
|
|
198
|
+
export class RealTimeFeedback {
|
|
210
199
|
icons = {
|
|
211
|
-
success:
|
|
212
|
-
error:
|
|
213
|
-
warning:
|
|
214
|
-
info:
|
|
215
|
-
loading:
|
|
200
|
+
success: chalk.green('✓'),
|
|
201
|
+
error: chalk.red('✖'),
|
|
202
|
+
warning: chalk.yellow('⚠'),
|
|
203
|
+
info: chalk.cyan('ℹ'),
|
|
204
|
+
loading: chalk.blue('◐')
|
|
216
205
|
};
|
|
217
206
|
show(message, type) {
|
|
218
207
|
const icon = this.icons[type];
|
|
@@ -221,17 +210,16 @@ class RealTimeFeedback {
|
|
|
221
210
|
}
|
|
222
211
|
getColorFunction(type) {
|
|
223
212
|
switch (type) {
|
|
224
|
-
case 'success': return
|
|
225
|
-
case 'error': return
|
|
226
|
-
case 'warning': return
|
|
227
|
-
case 'info': return
|
|
228
|
-
default: return
|
|
213
|
+
case 'success': return chalk.green;
|
|
214
|
+
case 'error': return chalk.red;
|
|
215
|
+
case 'warning': return chalk.yellow;
|
|
216
|
+
case 'info': return chalk.cyan;
|
|
217
|
+
default: return chalk.white;
|
|
229
218
|
}
|
|
230
219
|
}
|
|
231
220
|
}
|
|
232
|
-
exports.RealTimeFeedback = RealTimeFeedback;
|
|
233
221
|
// Inline Help Provider
|
|
234
|
-
class InlineHelpProvider {
|
|
222
|
+
export class InlineHelpProvider {
|
|
235
223
|
stateManager;
|
|
236
224
|
constructor(stateManager) {
|
|
237
225
|
this.stateManager = stateManager;
|
|
@@ -256,9 +244,8 @@ class InlineHelpProvider {
|
|
|
256
244
|
return helps[state.name] || 'Type "?" for help, "←" to go back';
|
|
257
245
|
}
|
|
258
246
|
}
|
|
259
|
-
exports.InlineHelpProvider = InlineHelpProvider;
|
|
260
247
|
// Presentation Layer
|
|
261
|
-
class PresentationLayer {
|
|
248
|
+
export class PresentationLayer {
|
|
262
249
|
themeEngine;
|
|
263
250
|
layoutManager;
|
|
264
251
|
animationController;
|
|
@@ -277,32 +264,31 @@ class PresentationLayer {
|
|
|
277
264
|
this.animationController.animate(_element, _animation);
|
|
278
265
|
}
|
|
279
266
|
}
|
|
280
|
-
exports.PresentationLayer = PresentationLayer;
|
|
281
267
|
// Theme Engine
|
|
282
|
-
class AdaptiveThemeEngine {
|
|
268
|
+
export class AdaptiveThemeEngine {
|
|
283
269
|
currentTheme = 'default';
|
|
284
270
|
themes = {
|
|
285
271
|
default: {
|
|
286
|
-
primary:
|
|
287
|
-
secondary:
|
|
288
|
-
success:
|
|
289
|
-
warning:
|
|
290
|
-
error:
|
|
291
|
-
info:
|
|
292
|
-
accent:
|
|
293
|
-
muted:
|
|
294
|
-
highlight:
|
|
272
|
+
primary: chalk.blue.bold,
|
|
273
|
+
secondary: chalk.gray,
|
|
274
|
+
success: chalk.green,
|
|
275
|
+
warning: chalk.yellow,
|
|
276
|
+
error: chalk.red,
|
|
277
|
+
info: chalk.cyan,
|
|
278
|
+
accent: chalk.magenta,
|
|
279
|
+
muted: chalk.dim,
|
|
280
|
+
highlight: chalk.white.bold
|
|
295
281
|
},
|
|
296
282
|
dark: {
|
|
297
|
-
primary:
|
|
298
|
-
secondary:
|
|
299
|
-
success:
|
|
300
|
-
warning:
|
|
301
|
-
error:
|
|
302
|
-
info:
|
|
303
|
-
accent:
|
|
304
|
-
muted:
|
|
305
|
-
highlight:
|
|
283
|
+
primary: chalk.cyanBright.bold,
|
|
284
|
+
secondary: chalk.gray,
|
|
285
|
+
success: chalk.greenBright,
|
|
286
|
+
warning: chalk.yellowBright,
|
|
287
|
+
error: chalk.redBright,
|
|
288
|
+
info: chalk.blueBright,
|
|
289
|
+
accent: chalk.magentaBright,
|
|
290
|
+
muted: chalk.dim,
|
|
291
|
+
highlight: chalk.whiteBright.bold
|
|
306
292
|
}
|
|
307
293
|
};
|
|
308
294
|
setTheme(theme) {
|
|
@@ -314,9 +300,8 @@ class AdaptiveThemeEngine {
|
|
|
314
300
|
return this.themes[this.currentTheme];
|
|
315
301
|
}
|
|
316
302
|
}
|
|
317
|
-
exports.AdaptiveThemeEngine = AdaptiveThemeEngine;
|
|
318
303
|
// Layout Manager
|
|
319
|
-
class ResponsiveLayoutManager {
|
|
304
|
+
export class ResponsiveLayoutManager {
|
|
320
305
|
render(content, layout) {
|
|
321
306
|
// Implement different layout strategies
|
|
322
307
|
switch (layout) {
|
|
@@ -350,17 +335,15 @@ class ResponsiveLayoutManager {
|
|
|
350
335
|
// Implementation here
|
|
351
336
|
}
|
|
352
337
|
}
|
|
353
|
-
exports.ResponsiveLayoutManager = ResponsiveLayoutManager;
|
|
354
338
|
// Animation Controller
|
|
355
|
-
class SubtleAnimationController {
|
|
339
|
+
export class SubtleAnimationController {
|
|
356
340
|
animate(_element, _animation) {
|
|
357
341
|
// Implement subtle animations for CLI
|
|
358
342
|
// This would handle progress bars, spinners, etc.
|
|
359
343
|
}
|
|
360
344
|
}
|
|
361
|
-
exports.SubtleAnimationController = SubtleAnimationController;
|
|
362
345
|
// Factory to create the complete architecture
|
|
363
|
-
function createCLIArchitecture() {
|
|
346
|
+
export function createCLIArchitecture() {
|
|
364
347
|
const stateManager = new StateManager();
|
|
365
348
|
const interactionEngine = new InteractionEngine(stateManager);
|
|
366
349
|
const presentationLayer = new PresentationLayer();
|