@lanonasis/cli 1.1.0 ā 1.2.1
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 +129 -25
- package/dist/commands/api-keys.d.ts +3 -0
- package/dist/commands/api-keys.js +812 -0
- package/dist/commands/mcp.js +2 -2
- package/dist/commands/memory.js +13 -8
- package/dist/commands/topics.js +2 -2
- package/dist/index-simple.js +522 -189
- package/dist/index.js +319 -23
- package/dist/utils/api.d.ts +12 -2
- package/dist/utils/api.js +17 -0
- package/dist/utils/formatting.d.ts +2 -0
- package/dist/utils/formatting.js +13 -0
- package/dist/utils/mcp-client.js +13 -7
- package/package.json +8 -3
package/dist/commands/mcp.js
CHANGED
|
@@ -48,7 +48,7 @@ export function mcpCommands(program) {
|
|
|
48
48
|
spinner.fail('Failed to auto-connect to MCP');
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
catch
|
|
51
|
+
catch {
|
|
52
52
|
spinner.fail('MCP auto-connect failed');
|
|
53
53
|
}
|
|
54
54
|
});
|
|
@@ -196,7 +196,7 @@ export function mcpCommands(program) {
|
|
|
196
196
|
try {
|
|
197
197
|
args = JSON.parse(options.args);
|
|
198
198
|
}
|
|
199
|
-
catch
|
|
199
|
+
catch {
|
|
200
200
|
spinner.fail('Invalid JSON arguments');
|
|
201
201
|
process.exit(1);
|
|
202
202
|
}
|
package/dist/commands/memory.js
CHANGED
|
@@ -114,12 +114,13 @@ export function memoryCommands(program) {
|
|
|
114
114
|
params.user_id = options.userId;
|
|
115
115
|
const result = await apiClient.getMemories(params);
|
|
116
116
|
spinner.stop();
|
|
117
|
-
|
|
117
|
+
const memories = result.memories || result.data || [];
|
|
118
|
+
if (memories.length === 0) {
|
|
118
119
|
console.log(chalk.yellow('No memories found'));
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
122
|
console.log(chalk.blue.bold(`\nš Memories (${result.pagination.total} total)`));
|
|
122
|
-
console.log(chalk.gray(`Page ${result.pagination.page} of ${result.pagination.pages}`));
|
|
123
|
+
console.log(chalk.gray(`Page ${result.pagination.page || 1} of ${result.pagination.pages || Math.ceil(result.pagination.total / result.pagination.limit)}`));
|
|
123
124
|
console.log();
|
|
124
125
|
const outputFormat = process.env.CLI_OUTPUT_FORMAT || 'table';
|
|
125
126
|
if (outputFormat === 'json') {
|
|
@@ -127,7 +128,7 @@ export function memoryCommands(program) {
|
|
|
127
128
|
}
|
|
128
129
|
else {
|
|
129
130
|
// Table format
|
|
130
|
-
const tableData =
|
|
131
|
+
const tableData = memories.map((memory) => [
|
|
131
132
|
truncateText(memory.title, 30),
|
|
132
133
|
memory.memory_type,
|
|
133
134
|
memory.tags.slice(0, 3).join(', '),
|
|
@@ -148,7 +149,10 @@ export function memoryCommands(program) {
|
|
|
148
149
|
{ width: 8 }
|
|
149
150
|
]
|
|
150
151
|
};
|
|
151
|
-
console.log(table([tableConfig.header, ...tableData],
|
|
152
|
+
console.log(table([tableConfig.header, ...tableData], {
|
|
153
|
+
columnDefault: tableConfig.columnDefault,
|
|
154
|
+
columns: tableConfig.columns
|
|
155
|
+
}));
|
|
152
156
|
// Pagination info
|
|
153
157
|
if (result.pagination.pages > 1) {
|
|
154
158
|
console.log(chalk.gray(`\nUse --page ${result.pagination.page + 1} for next page`));
|
|
@@ -185,14 +189,15 @@ export function memoryCommands(program) {
|
|
|
185
189
|
}
|
|
186
190
|
const result = await apiClient.searchMemories(query, searchOptions);
|
|
187
191
|
spinner.stop();
|
|
188
|
-
|
|
192
|
+
const results = result.results || result.data || [];
|
|
193
|
+
if (results.length === 0) {
|
|
189
194
|
console.log(chalk.yellow('No memories found matching your search'));
|
|
190
195
|
return;
|
|
191
196
|
}
|
|
192
|
-
console.log(chalk.blue.bold(`\nš Search Results (${result.total_results} found)`));
|
|
193
|
-
console.log(chalk.gray(`Query: "${query}" | Search time: ${result.search_time_ms}ms`));
|
|
197
|
+
console.log(chalk.blue.bold(`\nš Search Results (${result.total_results || results.length} found)`));
|
|
198
|
+
console.log(chalk.gray(`Query: "${query}" | Search time: ${result.search_time_ms || 0}ms`));
|
|
194
199
|
console.log();
|
|
195
|
-
|
|
200
|
+
results.forEach((memory, index) => {
|
|
196
201
|
const score = (memory.relevance_score * 100).toFixed(1);
|
|
197
202
|
console.log(chalk.green(`${index + 1}. ${memory.title}`) + chalk.gray(` (${score}% match)`));
|
|
198
203
|
console.log(chalk.white(` ${truncateText(memory.content, 100)}`));
|
package/dist/commands/topics.js
CHANGED
|
@@ -117,7 +117,6 @@ export function topicCommands(program) {
|
|
|
117
117
|
topic.parent_topic_id ? 'ā' : ''
|
|
118
118
|
]);
|
|
119
119
|
const tableConfig = {
|
|
120
|
-
header: ['Name', 'Description', 'Color', 'Created', 'Child'],
|
|
121
120
|
columnDefault: {
|
|
122
121
|
width: 20,
|
|
123
122
|
wrapWord: true
|
|
@@ -130,7 +129,8 @@ export function topicCommands(program) {
|
|
|
130
129
|
{ width: 8 }
|
|
131
130
|
]
|
|
132
131
|
};
|
|
133
|
-
|
|
132
|
+
const tableHeaders = ['Name', 'Description', 'System', 'Created'];
|
|
133
|
+
console.log(table([tableHeaders, ...tableData], tableConfig));
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
catch (error) {
|