@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/core/welcome.js
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* Welcome and Onboarding Experience
|
|
4
3
|
* Provides first-time user experience and guided setup
|
|
5
4
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
12
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
13
|
-
const boxen_1 = __importDefault(require("boxen"));
|
|
14
|
-
const ora_1 = __importDefault(require("ora"));
|
|
15
|
-
class WelcomeExperience {
|
|
5
|
+
import chalk from 'chalk';
|
|
6
|
+
import inquirer from 'inquirer';
|
|
7
|
+
import boxen from 'boxen';
|
|
8
|
+
import ora from 'ora';
|
|
9
|
+
export class WelcomeExperience {
|
|
16
10
|
stateManager;
|
|
17
11
|
isFirstRun = false;
|
|
18
12
|
constructor(stateManager) {
|
|
@@ -24,8 +18,8 @@ class WelcomeExperience {
|
|
|
24
18
|
await this.handleMenuChoice(choice);
|
|
25
19
|
}
|
|
26
20
|
displayWelcomeBanner() {
|
|
27
|
-
const banner = (
|
|
28
|
-
|
|
21
|
+
const banner = boxen(chalk.bold.blue('š§ Welcome to Onasis Memory Service\n') +
|
|
22
|
+
chalk.cyan(' Your Knowledge, Amplified'), {
|
|
29
23
|
padding: 2,
|
|
30
24
|
margin: 1,
|
|
31
25
|
borderStyle: 'round',
|
|
@@ -38,7 +32,7 @@ class WelcomeExperience {
|
|
|
38
32
|
async showMainMenu() {
|
|
39
33
|
const newUserOptions = [
|
|
40
34
|
{
|
|
41
|
-
name:
|
|
35
|
+
name: chalk.green.bold('[āµ] Start Interactive Setup') + chalk.gray(' (Recommended)'),
|
|
42
36
|
value: 'setup',
|
|
43
37
|
short: 'Setup'
|
|
44
38
|
},
|
|
@@ -60,7 +54,7 @@ class WelcomeExperience {
|
|
|
60
54
|
];
|
|
61
55
|
const existingUserOptions = [
|
|
62
56
|
{
|
|
63
|
-
name:
|
|
57
|
+
name: chalk.bold('[āµ] Continue to Dashboard'),
|
|
64
58
|
value: 'dashboard',
|
|
65
59
|
short: 'Dashboard'
|
|
66
60
|
},
|
|
@@ -77,7 +71,7 @@ class WelcomeExperience {
|
|
|
77
71
|
];
|
|
78
72
|
const isAuthenticated = await this.checkAuthentication();
|
|
79
73
|
const choices = isAuthenticated ? existingUserOptions : newUserOptions;
|
|
80
|
-
const { choice } = await
|
|
74
|
+
const { choice } = await inquirer.prompt([
|
|
81
75
|
{
|
|
82
76
|
type: 'list',
|
|
83
77
|
name: 'choice',
|
|
@@ -127,26 +121,26 @@ class WelcomeExperience {
|
|
|
127
121
|
});
|
|
128
122
|
}
|
|
129
123
|
showDocumentation() {
|
|
130
|
-
console.log((
|
|
131
|
-
'Online Docs: ' +
|
|
132
|
-
'Quick Start: ' +
|
|
133
|
-
'API Reference: ' +
|
|
134
|
-
|
|
124
|
+
console.log(boxen(chalk.bold('š Documentation\n\n') +
|
|
125
|
+
'Online Docs: ' + chalk.cyan('https://docs.lanonasis.com/cli\n') +
|
|
126
|
+
'Quick Start: ' + chalk.cyan('https://docs.lanonasis.com/quickstart\n') +
|
|
127
|
+
'API Reference: ' + chalk.cyan('https://api.lanonasis.com/docs\n\n') +
|
|
128
|
+
chalk.dim('Press any key to continue...'), {
|
|
135
129
|
padding: 1,
|
|
136
130
|
borderStyle: 'single',
|
|
137
131
|
borderColor: 'gray'
|
|
138
132
|
}));
|
|
139
133
|
}
|
|
140
134
|
showAbout() {
|
|
141
|
-
console.log((
|
|
135
|
+
console.log(boxen(chalk.bold('š§ About Onasis Memory Service\n\n') +
|
|
142
136
|
'Onasis is an enterprise-grade Memory as a Service platform that:\n\n' +
|
|
143
|
-
' ⢠' +
|
|
144
|
-
' ⢠' +
|
|
145
|
-
' ⢠' +
|
|
146
|
-
' ⢠' +
|
|
137
|
+
' ⢠' + chalk.green('Captures') + ' and organizes your knowledge\n' +
|
|
138
|
+
' ⢠' + chalk.blue('Searches') + ' with AI-powered semantic understanding\n' +
|
|
139
|
+
' ⢠' + chalk.magenta('Integrates') + ' with your existing tools\n' +
|
|
140
|
+
' ⢠' + chalk.yellow('Scales') + ' from personal to enterprise use\n\n' +
|
|
147
141
|
'Built for developers, teams, and organizations who want to\n' +
|
|
148
142
|
'transform information into actionable intelligence.\n\n' +
|
|
149
|
-
|
|
143
|
+
chalk.dim('Learn more at lanonasis.com'), {
|
|
150
144
|
padding: 1,
|
|
151
145
|
borderStyle: 'double',
|
|
152
146
|
borderColor: 'cyan'
|
|
@@ -154,10 +148,10 @@ class WelcomeExperience {
|
|
|
154
148
|
}
|
|
155
149
|
async showSettings() {
|
|
156
150
|
// Settings implementation
|
|
157
|
-
console.log(
|
|
151
|
+
console.log(chalk.yellow('Settings panel coming soon...'));
|
|
158
152
|
}
|
|
159
153
|
showHelp() {
|
|
160
|
-
console.log(
|
|
154
|
+
console.log(chalk.cyan('š” Tip: You can always type "help" for assistance'));
|
|
161
155
|
}
|
|
162
156
|
async checkAuthentication() {
|
|
163
157
|
// Check if user is authenticated
|
|
@@ -165,11 +159,10 @@ class WelcomeExperience {
|
|
|
165
159
|
return !!context.userId;
|
|
166
160
|
}
|
|
167
161
|
}
|
|
168
|
-
exports.WelcomeExperience = WelcomeExperience;
|
|
169
162
|
/**
|
|
170
163
|
* Interactive Setup Flow
|
|
171
164
|
*/
|
|
172
|
-
class InteractiveSetup {
|
|
165
|
+
export class InteractiveSetup {
|
|
173
166
|
stateManager;
|
|
174
167
|
setupProgress = {
|
|
175
168
|
connection: false,
|
|
@@ -209,10 +202,10 @@ class InteractiveSetup {
|
|
|
209
202
|
{ name: 'Ready!', done: this.setupProgress.ready }
|
|
210
203
|
];
|
|
211
204
|
console.clear();
|
|
212
|
-
console.log((
|
|
205
|
+
console.log(boxen('Setup Progress\n' +
|
|
213
206
|
steps.map((step, i) => {
|
|
214
207
|
const num = `[${i + 1}]`;
|
|
215
|
-
const name = step.done ?
|
|
208
|
+
const name = step.done ? chalk.green(step.name) : chalk.gray(step.name);
|
|
216
209
|
return `${num} ${name}`;
|
|
217
210
|
}).join(' ') + '\n' +
|
|
218
211
|
this.renderProgressBar(steps), {
|
|
@@ -229,29 +222,29 @@ class InteractiveSetup {
|
|
|
229
222
|
const barLength = 40;
|
|
230
223
|
const filled = Math.round((completed / total) * barLength);
|
|
231
224
|
const bar = 'ā'.repeat(filled) + 'ā'.repeat(barLength - filled);
|
|
232
|
-
return
|
|
225
|
+
return chalk.cyan(bar) + ' ' + chalk.bold(`${percentage}%`);
|
|
233
226
|
}
|
|
234
227
|
async setupConnection() {
|
|
235
|
-
console.log(
|
|
228
|
+
console.log(chalk.bold.blue('š Step 1: Connection Setup'));
|
|
236
229
|
console.log("Let's connect to your Onasis service\n");
|
|
237
|
-
const { connectionType } = await
|
|
230
|
+
const { connectionType } = await inquirer.prompt([
|
|
238
231
|
{
|
|
239
232
|
type: 'list',
|
|
240
233
|
name: 'connectionType',
|
|
241
234
|
message: 'Where is your Onasis service hosted?',
|
|
242
235
|
choices: [
|
|
243
236
|
{
|
|
244
|
-
name: 'āļø Cloud (api.lanonasis.com)' +
|
|
237
|
+
name: 'āļø Cloud (api.lanonasis.com)' + chalk.gray(' ā Recommended for most users'),
|
|
245
238
|
value: 'cloud',
|
|
246
239
|
short: 'Cloud'
|
|
247
240
|
},
|
|
248
241
|
{
|
|
249
|
-
name: 'š¢ Self-hosted' +
|
|
242
|
+
name: 'š¢ Self-hosted' + chalk.gray(' Enter your server URL'),
|
|
250
243
|
value: 'self-hosted',
|
|
251
244
|
short: 'Self-hosted'
|
|
252
245
|
},
|
|
253
246
|
{
|
|
254
|
-
name: 'š» Local development' +
|
|
247
|
+
name: 'š» Local development' + chalk.gray(' Use localhost:3000'),
|
|
255
248
|
value: 'local',
|
|
256
249
|
short: 'Local'
|
|
257
250
|
}
|
|
@@ -260,7 +253,7 @@ class InteractiveSetup {
|
|
|
260
253
|
]);
|
|
261
254
|
let serverUrl = 'https://api.lanonasis.com';
|
|
262
255
|
if (connectionType === 'self-hosted') {
|
|
263
|
-
const { customUrl } = await
|
|
256
|
+
const { customUrl } = await inquirer.prompt([
|
|
264
257
|
{
|
|
265
258
|
type: 'input',
|
|
266
259
|
name: 'customUrl',
|
|
@@ -280,7 +273,7 @@ class InteractiveSetup {
|
|
|
280
273
|
serverUrl = 'http://localhost:3000';
|
|
281
274
|
}
|
|
282
275
|
// Test connection
|
|
283
|
-
const spinner = (
|
|
276
|
+
const spinner = ora('Testing connection...').start();
|
|
284
277
|
await this.simulateDelay(1500);
|
|
285
278
|
spinner.succeed('Connection successful!');
|
|
286
279
|
// Save to state
|
|
@@ -289,14 +282,14 @@ class InteractiveSetup {
|
|
|
289
282
|
});
|
|
290
283
|
}
|
|
291
284
|
async setupAuthentication() {
|
|
292
|
-
console.log(
|
|
285
|
+
console.log(chalk.bold.blue('\nš Step 2: Authentication'));
|
|
293
286
|
console.log('Choose how you\'d like to connect:\n');
|
|
294
287
|
const authBox = (title, description, features) => {
|
|
295
|
-
return
|
|
296
|
-
|
|
297
|
-
features.map(f =>
|
|
288
|
+
return chalk.bold(title) + '\n' +
|
|
289
|
+
chalk.gray(description) + '\n' +
|
|
290
|
+
features.map(f => chalk.dim(` āŖ ${f}`)).join('\n');
|
|
298
291
|
};
|
|
299
|
-
const { authMethod } = await
|
|
292
|
+
const { authMethod } = await inquirer.prompt([
|
|
300
293
|
{
|
|
301
294
|
type: 'list',
|
|
302
295
|
name: 'authMethod',
|
|
@@ -334,7 +327,7 @@ class InteractiveSetup {
|
|
|
334
327
|
}
|
|
335
328
|
}
|
|
336
329
|
async authenticateWithVendorKey() {
|
|
337
|
-
const { vendorKey } = await
|
|
330
|
+
const { vendorKey } = await inquirer.prompt([
|
|
338
331
|
{
|
|
339
332
|
type: 'password',
|
|
340
333
|
name: 'vendorKey',
|
|
@@ -349,7 +342,7 @@ class InteractiveSetup {
|
|
|
349
342
|
}
|
|
350
343
|
]);
|
|
351
344
|
void vendorKey; // collected for future use when hooking real auth
|
|
352
|
-
const spinner = (
|
|
345
|
+
const spinner = ora('Authenticating...').start();
|
|
353
346
|
await this.simulateDelay(1000);
|
|
354
347
|
spinner.succeed('Authentication successful!');
|
|
355
348
|
this.stateManager.updateUserContext({
|
|
@@ -358,9 +351,9 @@ class InteractiveSetup {
|
|
|
358
351
|
});
|
|
359
352
|
}
|
|
360
353
|
async authenticateWithBrowser() {
|
|
361
|
-
console.log(
|
|
362
|
-
console.log(
|
|
363
|
-
const spinner = (
|
|
354
|
+
console.log(chalk.cyan('\nš Opening browser for authentication...'));
|
|
355
|
+
console.log(chalk.gray('Please complete the login in your browser'));
|
|
356
|
+
const spinner = ora('Waiting for browser authentication...').start();
|
|
364
357
|
await this.simulateDelay(3000);
|
|
365
358
|
spinner.succeed('Browser authentication successful!');
|
|
366
359
|
this.stateManager.updateUserContext({
|
|
@@ -369,7 +362,7 @@ class InteractiveSetup {
|
|
|
369
362
|
});
|
|
370
363
|
}
|
|
371
364
|
async authenticateWithEmail() {
|
|
372
|
-
const auth = await
|
|
365
|
+
const auth = await inquirer.prompt([
|
|
373
366
|
{
|
|
374
367
|
type: 'input',
|
|
375
368
|
name: 'email',
|
|
@@ -389,7 +382,7 @@ class InteractiveSetup {
|
|
|
389
382
|
mask: '*'
|
|
390
383
|
}
|
|
391
384
|
]);
|
|
392
|
-
const spinner = (
|
|
385
|
+
const spinner = ora('Signing in...').start();
|
|
393
386
|
await this.simulateDelay(1000);
|
|
394
387
|
spinner.succeed('Sign in successful!');
|
|
395
388
|
this.stateManager.updateUserContext({
|
|
@@ -398,9 +391,9 @@ class InteractiveSetup {
|
|
|
398
391
|
});
|
|
399
392
|
}
|
|
400
393
|
async setupConfiguration() {
|
|
401
|
-
console.log(
|
|
394
|
+
console.log(chalk.bold.blue('\nāļø Step 3: Configuration'));
|
|
402
395
|
console.log("Let's personalize your experience\n");
|
|
403
|
-
const answers = await
|
|
396
|
+
const answers = await inquirer.prompt([
|
|
404
397
|
{
|
|
405
398
|
type: 'list',
|
|
406
399
|
name: 'outputFormat',
|
|
@@ -433,22 +426,22 @@ class InteractiveSetup {
|
|
|
433
426
|
// Update preferences
|
|
434
427
|
const currentPrefs = this.stateManager.getPreferences();
|
|
435
428
|
Object.assign(currentPrefs, preferences);
|
|
436
|
-
console.log(
|
|
429
|
+
console.log(chalk.green('\nā Configuration saved!'));
|
|
437
430
|
}
|
|
438
431
|
async showSetupComplete() {
|
|
439
|
-
console.log((
|
|
432
|
+
console.log(boxen(chalk.green.bold('š Setup Complete!\n\n') +
|
|
440
433
|
'Your Onasis CLI is ready to use.\n\n' +
|
|
441
|
-
|
|
442
|
-
' ' +
|
|
443
|
-
' ' +
|
|
444
|
-
' ' +
|
|
445
|
-
|
|
434
|
+
chalk.bold('Quick Commands:\n') +
|
|
435
|
+
' ' + chalk.cyan('onasis memory create') + ' - Create a new memory\n' +
|
|
436
|
+
' ' + chalk.cyan('onasis search "query"') + ' - Search your memories\n' +
|
|
437
|
+
' ' + chalk.cyan('onasis help') + ' - Show all commands\n\n' +
|
|
438
|
+
chalk.dim('Press Enter to continue to the dashboard...'), {
|
|
446
439
|
padding: 1,
|
|
447
440
|
borderStyle: 'double',
|
|
448
441
|
borderColor: 'green',
|
|
449
442
|
textAlignment: 'center'
|
|
450
443
|
}));
|
|
451
|
-
await
|
|
444
|
+
await inquirer.prompt([
|
|
452
445
|
{
|
|
453
446
|
type: 'input',
|
|
454
447
|
name: 'continue',
|
|
@@ -460,4 +453,3 @@ class InteractiveSetup {
|
|
|
460
453
|
return new Promise(resolve => setTimeout(resolve, ms));
|
|
461
454
|
}
|
|
462
455
|
}
|
|
463
|
-
exports.InteractiveSetup = InteractiveSetup;
|
package/dist/enhanced-cli.js
CHANGED
|
@@ -1,46 +1,35 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
2
|
/**
|
|
4
3
|
* Enhanced CLI Entry Point
|
|
5
4
|
* Integrates all the enhanced experience components
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const error_handler_js_1 = require("./core/error-handler.js");
|
|
19
|
-
const power_mode_js_1 = require("./core/power-mode.js");
|
|
20
|
-
const achievements_js_1 = require("./core/achievements.js");
|
|
21
|
-
const progress_js_1 = require("./core/progress.js");
|
|
22
|
-
const config_js_1 = require("./utils/config.js");
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
import { config } from 'dotenv';
|
|
9
|
+
import { createCLIArchitecture } from './core/architecture.js';
|
|
10
|
+
import { WelcomeExperience } from './core/welcome.js';
|
|
11
|
+
import { DashboardCommandCenter } from './core/dashboard.js';
|
|
12
|
+
import { ErrorHandler, ErrorBoundary } from './core/error-handler.js';
|
|
13
|
+
import { PowerUserMode } from './core/power-mode.js';
|
|
14
|
+
import { AchievementSystem } from './core/achievements.js';
|
|
15
|
+
import { ProgressIndicator } from './core/progress.js';
|
|
16
|
+
import { CLIConfig } from './utils/config.js';
|
|
23
17
|
// Load environment variables
|
|
24
|
-
|
|
18
|
+
config();
|
|
25
19
|
// Initialize the enhanced architecture
|
|
26
|
-
const architecture =
|
|
27
|
-
exports.architecture = architecture;
|
|
20
|
+
const architecture = createCLIArchitecture();
|
|
28
21
|
const { stateManager } = architecture;
|
|
29
|
-
exports.stateManager = stateManager;
|
|
30
22
|
// Initialize systems
|
|
31
|
-
const errorHandler = new
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
const progressIndicator = new progress_js_1.ProgressIndicator();
|
|
37
|
-
exports.progressIndicator = progressIndicator;
|
|
38
|
-
const cliConfig = new config_js_1.CLIConfig();
|
|
23
|
+
const errorHandler = new ErrorHandler(stateManager);
|
|
24
|
+
const errorBoundary = new ErrorBoundary(errorHandler);
|
|
25
|
+
const achievementSystem = new AchievementSystem(stateManager);
|
|
26
|
+
const progressIndicator = new ProgressIndicator();
|
|
27
|
+
const cliConfig = new CLIConfig();
|
|
39
28
|
// Create the main program
|
|
40
|
-
const program = new
|
|
29
|
+
const program = new Command();
|
|
41
30
|
program
|
|
42
31
|
.name('onasis')
|
|
43
|
-
.description(
|
|
32
|
+
.description(chalk.cyan('š§ Onasis Memory Service - Enhanced CLI Experience'))
|
|
44
33
|
.version('2.0.0', '-v, --version', 'display version number')
|
|
45
34
|
.option('-V, --verbose', 'enable verbose logging')
|
|
46
35
|
.option('--api-url <url>', 'override API URL')
|
|
@@ -53,7 +42,7 @@ program
|
|
|
53
42
|
.command('init')
|
|
54
43
|
.description('Initialize and configure Onasis CLI')
|
|
55
44
|
.action(errorBoundary.wrapAsync(async () => {
|
|
56
|
-
const welcome = new
|
|
45
|
+
const welcome = new WelcomeExperience(stateManager);
|
|
57
46
|
await welcome.show();
|
|
58
47
|
}));
|
|
59
48
|
// Interactive dashboard command
|
|
@@ -62,7 +51,7 @@ program
|
|
|
62
51
|
.alias('home')
|
|
63
52
|
.description('Open the interactive command center')
|
|
64
53
|
.action(errorBoundary.wrapAsync(async () => {
|
|
65
|
-
const dashboard = new
|
|
54
|
+
const dashboard = new DashboardCommandCenter(stateManager);
|
|
66
55
|
await dashboard.show();
|
|
67
56
|
}));
|
|
68
57
|
// Power mode for expert users
|
|
@@ -71,7 +60,7 @@ program
|
|
|
71
60
|
.alias('expert')
|
|
72
61
|
.description('Enter power user mode for streamlined operations')
|
|
73
62
|
.action(errorBoundary.wrapAsync(async () => {
|
|
74
|
-
const powerMode = new
|
|
63
|
+
const powerMode = new PowerUserMode(stateManager);
|
|
75
64
|
await powerMode.enter();
|
|
76
65
|
}));
|
|
77
66
|
// Enhanced memory commands with progress and feedback
|
|
@@ -103,7 +92,7 @@ program
|
|
|
103
92
|
else {
|
|
104
93
|
await progressIndicator.withSpinner(async () => {
|
|
105
94
|
// Create memory logic here
|
|
106
|
-
console.log(
|
|
95
|
+
console.log(chalk.green('ā Memory created successfully'));
|
|
107
96
|
}, 'Creating memory...');
|
|
108
97
|
}
|
|
109
98
|
break;
|
|
@@ -118,12 +107,12 @@ program
|
|
|
118
107
|
case 'list':
|
|
119
108
|
await progressIndicator.withSpinner(async () => {
|
|
120
109
|
// List memories logic
|
|
121
|
-
console.log(
|
|
110
|
+
console.log(chalk.cyan('Memories listed'));
|
|
122
111
|
}, 'Loading memories...');
|
|
123
112
|
break;
|
|
124
113
|
default: {
|
|
125
114
|
// If no action specified, go to interactive mode
|
|
126
|
-
const dashboard = new
|
|
115
|
+
const dashboard = new DashboardCommandCenter(stateManager);
|
|
127
116
|
await dashboard.show();
|
|
128
117
|
break;
|
|
129
118
|
}
|
|
@@ -151,19 +140,19 @@ program
|
|
|
151
140
|
]);
|
|
152
141
|
name = topicName;
|
|
153
142
|
}
|
|
154
|
-
console.log(
|
|
143
|
+
console.log(chalk.green(`ā Topic "${name}" created`));
|
|
155
144
|
break;
|
|
156
145
|
case 'list':
|
|
157
|
-
console.log(
|
|
146
|
+
console.log(chalk.bold('š Topics:'));
|
|
158
147
|
console.log(' ⢠Architecture');
|
|
159
148
|
console.log(' ⢠API Documentation');
|
|
160
149
|
console.log(' ⢠Meeting Notes');
|
|
161
150
|
break;
|
|
162
151
|
case 'delete':
|
|
163
|
-
console.log(
|
|
152
|
+
console.log(chalk.red(`ā Topic "${name}" deleted`));
|
|
164
153
|
break;
|
|
165
154
|
default:
|
|
166
|
-
console.log(
|
|
155
|
+
console.log(chalk.yellow('Usage: onasis topic [create|list|delete] [name]'));
|
|
167
156
|
}
|
|
168
157
|
}));
|
|
169
158
|
// Achievement system
|
|
@@ -195,15 +184,15 @@ program
|
|
|
195
184
|
if (!key) {
|
|
196
185
|
// Show all settings
|
|
197
186
|
const prefs = stateManager.getPreferences();
|
|
198
|
-
console.log(
|
|
187
|
+
console.log(chalk.bold('āļø Settings:\n'));
|
|
199
188
|
Object.entries(prefs).forEach(([k, v]) => {
|
|
200
|
-
console.log(` ${
|
|
189
|
+
console.log(` ${chalk.cyan(k)}: ${v}`);
|
|
201
190
|
});
|
|
202
191
|
}
|
|
203
192
|
else if (value !== undefined) {
|
|
204
193
|
// Set a value
|
|
205
194
|
stateManager.updatePreference(key, value);
|
|
206
|
-
console.log(
|
|
195
|
+
console.log(chalk.green(`ā ${key} set to ${value}`));
|
|
207
196
|
}
|
|
208
197
|
else {
|
|
209
198
|
// Get a value
|
|
@@ -222,16 +211,16 @@ program
|
|
|
222
211
|
cmd.outputHelp();
|
|
223
212
|
}
|
|
224
213
|
else {
|
|
225
|
-
console.log(
|
|
214
|
+
console.log(chalk.red(`Command "${command}" not found`));
|
|
226
215
|
}
|
|
227
216
|
}
|
|
228
217
|
else {
|
|
229
|
-
console.log(
|
|
218
|
+
console.log(chalk.bold.cyan('\nš§ Onasis Memory Service - Enhanced CLI\n'));
|
|
230
219
|
console.log('Available commands:\n');
|
|
231
220
|
program.commands.forEach(cmd => {
|
|
232
221
|
const name = cmd.name().padEnd(15);
|
|
233
222
|
const desc = cmd.description();
|
|
234
|
-
console.log(` ${
|
|
223
|
+
console.log(` ${chalk.cyan(name)} ${desc}`);
|
|
235
224
|
});
|
|
236
225
|
console.log('\nFor detailed help: onasis help [command]');
|
|
237
226
|
console.log('Interactive mode: onasis (no arguments)');
|
|
@@ -248,11 +237,11 @@ program
|
|
|
248
237
|
// Check API connection
|
|
249
238
|
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
250
239
|
}, 'Checking service status...');
|
|
251
|
-
console.log(
|
|
252
|
-
console.log(
|
|
253
|
-
console.log(
|
|
254
|
-
console.log(
|
|
255
|
-
console.log(
|
|
240
|
+
console.log(chalk.green('ā Service: Online'));
|
|
241
|
+
console.log(chalk.green('ā API: Connected'));
|
|
242
|
+
console.log(chalk.green('ā Auth: Valid'));
|
|
243
|
+
console.log(chalk.cyan(' Endpoint: api.lanonasis.com'));
|
|
244
|
+
console.log(chalk.cyan(' Version: 2.0.0'));
|
|
256
245
|
}));
|
|
257
246
|
// Default action - show interactive dashboard if no command
|
|
258
247
|
if (process.argv.length === 2) {
|
|
@@ -261,11 +250,11 @@ if (process.argv.length === 2) {
|
|
|
261
250
|
// Check if first run
|
|
262
251
|
const isFirstRun = !(await cliConfig.isAuthenticated());
|
|
263
252
|
if (isFirstRun) {
|
|
264
|
-
const welcome = new
|
|
253
|
+
const welcome = new WelcomeExperience(stateManager);
|
|
265
254
|
await welcome.show();
|
|
266
255
|
}
|
|
267
256
|
else {
|
|
268
|
-
const dashboard = new
|
|
257
|
+
const dashboard = new DashboardCommandCenter(stateManager);
|
|
269
258
|
await dashboard.show();
|
|
270
259
|
}
|
|
271
260
|
}
|
|
@@ -283,11 +272,11 @@ else {
|
|
|
283
272
|
const options = program.opts();
|
|
284
273
|
if (options.verbose) {
|
|
285
274
|
process.env.CLI_VERBOSE = 'true';
|
|
286
|
-
console.log(
|
|
275
|
+
console.log(chalk.dim('Verbose mode enabled'));
|
|
287
276
|
}
|
|
288
277
|
if (options.apiUrl) {
|
|
289
278
|
process.env.MEMORY_API_URL = options.apiUrl;
|
|
290
|
-
console.log(
|
|
279
|
+
console.log(chalk.dim(`API URL set to: ${options.apiUrl}`));
|
|
291
280
|
}
|
|
292
281
|
if (options.output) {
|
|
293
282
|
stateManager.updatePreference('outputFormat', options.output);
|
|
@@ -298,11 +287,13 @@ if (options.noAnimations) {
|
|
|
298
287
|
if (options.expert) {
|
|
299
288
|
// Start directly in power mode
|
|
300
289
|
(async () => {
|
|
301
|
-
const powerMode = new
|
|
290
|
+
const powerMode = new PowerUserMode(stateManager);
|
|
302
291
|
await powerMode.enter();
|
|
303
292
|
})();
|
|
304
293
|
}
|
|
305
294
|
if (options.offline) {
|
|
306
295
|
process.env.CLI_OFFLINE = 'true';
|
|
307
|
-
console.log(
|
|
296
|
+
console.log(chalk.yellow('ā Running in offline mode'));
|
|
308
297
|
}
|
|
298
|
+
// Export for testing and extension
|
|
299
|
+
export { architecture, stateManager, errorHandler, achievementSystem, progressIndicator };
|