@lanonasis/cli 1.5.1 → 2.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/README.md +301 -317
- package/dist/commands/auth.d.ts +2 -0
- package/dist/commands/auth.js +140 -1
- package/dist/commands/completion.d.ts +33 -0
- package/dist/commands/completion.js +378 -0
- package/dist/commands/guide.d.ts +19 -0
- package/dist/commands/guide.js +446 -0
- package/dist/completions/bash-completion.sh +88 -0
- package/dist/completions/fish-completion.fish +132 -0
- package/dist/completions/zsh-completion.zsh +196 -0
- package/dist/core/achievements.d.ts +102 -0
- package/dist/core/achievements.js +425 -0
- package/dist/core/architecture.d.ts +145 -0
- package/dist/core/architecture.js +355 -0
- package/dist/core/dashboard.d.ts +71 -0
- package/dist/core/dashboard.js +569 -0
- package/dist/core/error-handler.d.ts +97 -0
- package/dist/core/error-handler.js +380 -0
- package/dist/core/power-mode.d.ts +118 -0
- package/dist/core/power-mode.js +460 -0
- package/dist/core/progress.d.ts +160 -0
- package/dist/core/progress.js +428 -0
- package/dist/core/welcome.d.ts +40 -0
- package/dist/core/welcome.js +466 -0
- package/dist/enhanced-cli.d.ts +15 -0
- package/dist/enhanced-cli.js +296 -0
- package/dist/index-simple.js +128 -11
- package/dist/mcp-server.d.ts +37 -1
- package/dist/mcp-server.js +142 -507
- package/dist/utils/api.js +21 -4
- package/dist/utils/config.d.ts +5 -0
- package/dist/utils/config.js +39 -2
- package/dist/utils/mcp-client.js +1 -3
- package/package.json +11 -6
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
#compdef lanonasis onasis memory maas
|
|
2
|
+
|
|
3
|
+
# Lanonasis/Onasis CLI Zsh Completion
|
|
4
|
+
# Installation: Place in your $fpath (e.g., ~/.zsh/completions/) and run 'compinit'
|
|
5
|
+
|
|
6
|
+
_lanonasis() {
|
|
7
|
+
local context curcontext="$curcontext" state line
|
|
8
|
+
typeset -A opt_args
|
|
9
|
+
|
|
10
|
+
_arguments -C \
|
|
11
|
+
'1: :_lanonasis_commands' \
|
|
12
|
+
'*:: :->args' \
|
|
13
|
+
'--help[Show help information]' \
|
|
14
|
+
'--version[Show version information]' \
|
|
15
|
+
'--verbose[Enable verbose logging]' \
|
|
16
|
+
'--output[Output format]:format:(table json yaml csv)' \
|
|
17
|
+
'--api-url[Override API URL]:url:' \
|
|
18
|
+
'--no-mcp[Disable MCP and use direct API]'
|
|
19
|
+
|
|
20
|
+
case $state in
|
|
21
|
+
args)
|
|
22
|
+
case $words[1] in
|
|
23
|
+
auth|login)
|
|
24
|
+
_lanonasis_auth_commands
|
|
25
|
+
;;
|
|
26
|
+
memory|mem)
|
|
27
|
+
_lanonasis_memory_commands
|
|
28
|
+
;;
|
|
29
|
+
topic|topics)
|
|
30
|
+
_lanonasis_topic_commands
|
|
31
|
+
;;
|
|
32
|
+
config)
|
|
33
|
+
_lanonasis_config_commands
|
|
34
|
+
;;
|
|
35
|
+
api-keys)
|
|
36
|
+
_lanonasis_apikeys_commands
|
|
37
|
+
;;
|
|
38
|
+
mcp)
|
|
39
|
+
_lanonasis_mcp_commands
|
|
40
|
+
;;
|
|
41
|
+
dashboard)
|
|
42
|
+
_lanonasis_dashboard_commands
|
|
43
|
+
;;
|
|
44
|
+
deploy|deployment)
|
|
45
|
+
_lanonasis_deploy_commands
|
|
46
|
+
;;
|
|
47
|
+
service|services)
|
|
48
|
+
_lanonasis_service_commands
|
|
49
|
+
;;
|
|
50
|
+
esac
|
|
51
|
+
;;
|
|
52
|
+
esac
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
_lanonasis_commands() {
|
|
56
|
+
local commands; commands=(
|
|
57
|
+
'init:Initialize CLI configuration'
|
|
58
|
+
'login:Authenticate with your account'
|
|
59
|
+
'auth:Authentication commands'
|
|
60
|
+
'logout:Logout from your account'
|
|
61
|
+
'status:Show system status'
|
|
62
|
+
'health:Comprehensive health check'
|
|
63
|
+
'docs:Open documentation'
|
|
64
|
+
'memory:Memory management commands'
|
|
65
|
+
'mem:Memory management (alias)'
|
|
66
|
+
'topic:Topic management commands'
|
|
67
|
+
'topics:Topic management (alias)'
|
|
68
|
+
'config:Configuration management'
|
|
69
|
+
'org:Organization management'
|
|
70
|
+
'organization:Organization management (alias)'
|
|
71
|
+
'api-keys:API key management'
|
|
72
|
+
'mcp:Model Context Protocol commands'
|
|
73
|
+
'dashboard:Dashboard management'
|
|
74
|
+
'documentation:Documentation management'
|
|
75
|
+
'sdk:SDK management'
|
|
76
|
+
'api:REST API management'
|
|
77
|
+
'rest:REST API management (alias)'
|
|
78
|
+
'deploy:Deployment management'
|
|
79
|
+
'deployment:Deployment management (alias)'
|
|
80
|
+
'service:Service management'
|
|
81
|
+
'services:Service management (alias)'
|
|
82
|
+
)
|
|
83
|
+
_describe 'commands' commands
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
_lanonasis_auth_commands() {
|
|
87
|
+
local subcommands; subcommands=(
|
|
88
|
+
'login:Login to your account'
|
|
89
|
+
'logout:Logout from your account'
|
|
90
|
+
'status:Show authentication status'
|
|
91
|
+
'vendor-key:Authenticate with vendor key'
|
|
92
|
+
'oauth:Browser-based OAuth authentication'
|
|
93
|
+
)
|
|
94
|
+
_describe 'auth commands' subcommands
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
_lanonasis_memory_commands() {
|
|
98
|
+
local subcommands; subcommands=(
|
|
99
|
+
'list:List memories'
|
|
100
|
+
'create:Create a new memory'
|
|
101
|
+
'get:Get a specific memory'
|
|
102
|
+
'update:Update an existing memory'
|
|
103
|
+
'delete:Delete a memory'
|
|
104
|
+
'search:Search memories'
|
|
105
|
+
'stats:Show memory statistics'
|
|
106
|
+
'bulk-delete:Delete multiple memories'
|
|
107
|
+
'export:Export memories'
|
|
108
|
+
'import:Import memories'
|
|
109
|
+
)
|
|
110
|
+
_describe 'memory commands' subcommands
|
|
111
|
+
|
|
112
|
+
# Add memory type completion for relevant commands
|
|
113
|
+
if [[ "$words[2]" == "create" || "$words[2]" == "update" || "$words[2]" == "list" ]]; then
|
|
114
|
+
_arguments \
|
|
115
|
+
'--memory-type[Memory type]:type:(context project knowledge reference personal workflow)' \
|
|
116
|
+
'--tags[Tags]:tags:' \
|
|
117
|
+
'--topic-id[Topic ID]:topic:'
|
|
118
|
+
fi
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
_lanonasis_topic_commands() {
|
|
122
|
+
local subcommands; subcommands=(
|
|
123
|
+
'list:List topics'
|
|
124
|
+
'create:Create a new topic'
|
|
125
|
+
'get:Get a specific topic'
|
|
126
|
+
'update:Update an existing topic'
|
|
127
|
+
'delete:Delete a topic'
|
|
128
|
+
)
|
|
129
|
+
_describe 'topic commands' subcommands
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_lanonasis_config_commands() {
|
|
133
|
+
local subcommands; subcommands=(
|
|
134
|
+
'get:Get configuration value'
|
|
135
|
+
'set:Set configuration value'
|
|
136
|
+
'list:List all configuration'
|
|
137
|
+
'reset:Reset configuration'
|
|
138
|
+
)
|
|
139
|
+
_describe 'config commands' subcommands
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
_lanonasis_apikeys_commands() {
|
|
143
|
+
local subcommands; subcommands=(
|
|
144
|
+
'list:List API keys'
|
|
145
|
+
'create:Create a new API key'
|
|
146
|
+
'revoke:Revoke an API key'
|
|
147
|
+
'rotate:Rotate an API key'
|
|
148
|
+
)
|
|
149
|
+
_describe 'api-keys commands' subcommands
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
_lanonasis_mcp_commands() {
|
|
153
|
+
local subcommands; subcommands=(
|
|
154
|
+
'status:Show MCP server status'
|
|
155
|
+
'connect:Connect to MCP server'
|
|
156
|
+
'disconnect:Disconnect from MCP server'
|
|
157
|
+
'servers:List MCP servers'
|
|
158
|
+
'tools:List available tools'
|
|
159
|
+
'resources:List available resources'
|
|
160
|
+
)
|
|
161
|
+
_describe 'mcp commands' subcommands
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
_lanonasis_dashboard_commands() {
|
|
165
|
+
local subcommands; subcommands=(
|
|
166
|
+
'status:Check dashboard status'
|
|
167
|
+
'logs:View dashboard logs'
|
|
168
|
+
'open:Open dashboard in browser'
|
|
169
|
+
)
|
|
170
|
+
_describe 'dashboard commands' subcommands
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
_lanonasis_deploy_commands() {
|
|
174
|
+
local subcommands; subcommands=(
|
|
175
|
+
'status:Show deployment status'
|
|
176
|
+
'health:Check deployment health'
|
|
177
|
+
'list:List deployments'
|
|
178
|
+
)
|
|
179
|
+
_describe 'deploy commands' subcommands
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
_lanonasis_service_commands() {
|
|
183
|
+
local subcommands; subcommands=(
|
|
184
|
+
'list:List services'
|
|
185
|
+
'status:Show service status'
|
|
186
|
+
'restart:Restart a service'
|
|
187
|
+
'logs:View service logs'
|
|
188
|
+
)
|
|
189
|
+
_describe 'service commands' subcommands
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
# Initialize completion for all aliases
|
|
193
|
+
compdef _lanonasis lanonasis
|
|
194
|
+
compdef _lanonasis onasis
|
|
195
|
+
compdef _lanonasis memory
|
|
196
|
+
compdef _lanonasis maas
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Achievement System and Engagement Features
|
|
3
|
+
* Gamification elements to enhance user engagement
|
|
4
|
+
*/
|
|
5
|
+
import { StateManager } from './architecture.js';
|
|
6
|
+
import { EventEmitter } from 'events';
|
|
7
|
+
export interface Achievement {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
points: number;
|
|
13
|
+
category: 'usage' | 'milestone' | 'special' | 'hidden';
|
|
14
|
+
unlocked: boolean;
|
|
15
|
+
unlockedAt?: Date;
|
|
16
|
+
progress?: number;
|
|
17
|
+
maxProgress?: number;
|
|
18
|
+
condition: (stats: UserStats) => boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface UserStats {
|
|
21
|
+
totalMemories: number;
|
|
22
|
+
totalSearches: number;
|
|
23
|
+
totalTopics: number;
|
|
24
|
+
totalApiCalls: number;
|
|
25
|
+
daysActive: number;
|
|
26
|
+
longestStreak: number;
|
|
27
|
+
currentStreak: number;
|
|
28
|
+
powerModeUsage: number;
|
|
29
|
+
memoriesCreatedToday: number;
|
|
30
|
+
searchAccuracy: number;
|
|
31
|
+
}
|
|
32
|
+
export declare class AchievementSystem extends EventEmitter {
|
|
33
|
+
private stateManager;
|
|
34
|
+
private achievements;
|
|
35
|
+
private userStats;
|
|
36
|
+
private unlockedAchievements;
|
|
37
|
+
constructor(stateManager: StateManager);
|
|
38
|
+
/**
|
|
39
|
+
* Initialize all available achievements
|
|
40
|
+
*/
|
|
41
|
+
private initializeAchievements;
|
|
42
|
+
/**
|
|
43
|
+
* Check for new achievements
|
|
44
|
+
*/
|
|
45
|
+
checkAchievements(): Achievement[];
|
|
46
|
+
/**
|
|
47
|
+
* Update achievement progress
|
|
48
|
+
*/
|
|
49
|
+
private updateProgress;
|
|
50
|
+
/**
|
|
51
|
+
* Unlock an achievement
|
|
52
|
+
*/
|
|
53
|
+
private unlockAchievement;
|
|
54
|
+
/**
|
|
55
|
+
* Show achievement celebration
|
|
56
|
+
*/
|
|
57
|
+
celebrate(achievement: Achievement): void;
|
|
58
|
+
/**
|
|
59
|
+
* Show all achievements
|
|
60
|
+
*/
|
|
61
|
+
showAchievements(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Display single achievement
|
|
64
|
+
*/
|
|
65
|
+
private displayAchievement;
|
|
66
|
+
/**
|
|
67
|
+
* Get category title
|
|
68
|
+
*/
|
|
69
|
+
private getCategoryTitle;
|
|
70
|
+
/**
|
|
71
|
+
* Get total possible points
|
|
72
|
+
*/
|
|
73
|
+
getTotalPoints(): number;
|
|
74
|
+
/**
|
|
75
|
+
* Get unlocked points
|
|
76
|
+
*/
|
|
77
|
+
getUnlockedPoints(): number;
|
|
78
|
+
/**
|
|
79
|
+
* Update user stats
|
|
80
|
+
*/
|
|
81
|
+
updateStats(updates: Partial<UserStats>): void;
|
|
82
|
+
/**
|
|
83
|
+
* Get leaderboard position
|
|
84
|
+
*/
|
|
85
|
+
getLeaderboardPosition(): number;
|
|
86
|
+
/**
|
|
87
|
+
* Load user stats from storage
|
|
88
|
+
*/
|
|
89
|
+
private loadUserStats;
|
|
90
|
+
/**
|
|
91
|
+
* Save user stats to storage
|
|
92
|
+
*/
|
|
93
|
+
private saveUserStats;
|
|
94
|
+
/**
|
|
95
|
+
* Load unlocked achievements from storage
|
|
96
|
+
*/
|
|
97
|
+
private loadUnlockedAchievements;
|
|
98
|
+
/**
|
|
99
|
+
* Save unlocked achievements to storage
|
|
100
|
+
*/
|
|
101
|
+
private saveUnlockedAchievements;
|
|
102
|
+
}
|