@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.
@@ -48,7 +48,7 @@ export function mcpCommands(program) {
48
48
  spinner.fail('Failed to auto-connect to MCP');
49
49
  }
50
50
  }
51
- catch (error) {
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 (error) {
199
+ catch {
200
200
  spinner.fail('Invalid JSON arguments');
201
201
  process.exit(1);
202
202
  }
@@ -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
- if (result.memories.length === 0) {
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 = result.memories.map((memory) => [
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], tableConfig));
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
- if (result.results.length === 0) {
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
- result.results.forEach((memory, index) => {
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)}`));
@@ -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
- console.log(table([tableConfig.header, ...tableData], tableConfig));
132
+ const tableHeaders = ['Name', 'Description', 'System', 'Created'];
133
+ console.log(table([tableHeaders, ...tableData], tableConfig));
134
134
  }
135
135
  }
136
136
  catch (error) {