ruvector 0.2.7 → 0.2.8

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/bin/cli.js CHANGED
@@ -7952,6 +7952,7 @@ async function brainFetch(config, endpoint, opts = {}) {
7952
7952
  const errText = await resp.text().catch(() => resp.statusText);
7953
7953
  throw new Error(`${resp.status} ${errText}`);
7954
7954
  }
7955
+ if (resp.status === 204 || resp.headers.get('content-length') === '0') return {};
7955
7956
  return resp.json();
7956
7957
  }
7957
7958
 
@@ -7997,10 +7998,12 @@ brainCmd.command('share <title>')
7997
7998
  .option('--code <snippet>', 'Code snippet')
7998
7999
  .option('--url <url>', 'Brain server URL')
7999
8000
  .option('--key <key>', 'Pi key')
8001
+ .option('--json', 'Output as JSON')
8000
8002
  .action(async (title, opts) => {
8001
8003
  const config = getBrainConfig(opts);
8002
8004
  try {
8003
8005
  const result = await brainFetch(config, '/v1/memories', { body: { title, content: opts.content || title, category: opts.category, tags: opts.tags ? opts.tags.split(',').map(t => t.trim()) : [], code_snippet: opts.code } });
8006
+ if (opts.json || !process.stdout.isTTY) { console.log(JSON.stringify(result, null, 2)); return; }
8004
8007
  console.log(chalk.green(`Shared: ${result.id || 'OK'}`));
8005
8008
  } catch (e) { console.error(chalk.red(`Error: ${e.message}`)); process.exit(1); }
8006
8009
  });
@@ -8027,10 +8030,12 @@ brainCmd.command('vote <id> <direction>')
8027
8030
  .description('Quality vote on a memory (up or down)')
8028
8031
  .option('--url <url>', 'Brain server URL')
8029
8032
  .option('--key <key>', 'Pi key')
8033
+ .option('--json', 'Output as JSON')
8030
8034
  .action(async (id, direction, opts) => {
8031
8035
  const config = getBrainConfig(opts);
8032
8036
  try {
8033
- await brainFetch(config, `/v1/memories/${id}/vote`, { body: { direction } });
8037
+ const result = await brainFetch(config, `/v1/memories/${id}/vote`, { body: { direction } });
8038
+ if (opts.json || !process.stdout.isTTY) { console.log(JSON.stringify(result, null, 2)); return; }
8034
8039
  console.log(chalk.green(`Voted ${direction} on ${id}`));
8035
8040
  } catch (e) { console.error(chalk.red(`Error: ${e.message}`)); process.exit(1); }
8036
8041
  });
@@ -8067,10 +8072,12 @@ brainCmd.command('delete <id>')
8067
8072
  .description('Delete your own contribution')
8068
8073
  .option('--url <url>', 'Brain server URL')
8069
8074
  .option('--key <key>', 'Pi key')
8075
+ .option('--json', 'Output as JSON')
8070
8076
  .action(async (id, opts) => {
8071
8077
  const config = getBrainConfig(opts);
8072
8078
  try {
8073
- await brainFetch(config, `/v1/memories/${id}`, { method: 'DELETE' });
8079
+ const result = await brainFetch(config, `/v1/memories/${id}`, { method: 'DELETE' });
8080
+ if (opts.json || !process.stdout.isTTY) { console.log(JSON.stringify(result, null, 2)); return; }
8074
8081
  console.log(chalk.green(`Deleted: ${id}`));
8075
8082
  } catch (e) { console.error(chalk.red(`Error: ${e.message}`)); process.exit(1); }
8076
8083
  });
@@ -8165,10 +8172,12 @@ brainCmd.command('sync [direction]')
8165
8172
  .description('Synchronize LoRA weights (pull, push, or both)')
8166
8173
  .option('--url <url>', 'Brain server URL')
8167
8174
  .option('--key <key>', 'Pi key')
8175
+ .option('--json', 'Output as JSON')
8168
8176
  .action(async (direction, opts) => {
8169
8177
  const config = getBrainConfig(opts);
8170
8178
  try {
8171
8179
  const result = await brainFetch(config, '/v1/lora/latest', { params: { direction: direction || 'both' } });
8180
+ if (opts.json || !process.stdout.isTTY) { console.log(JSON.stringify(result, null, 2)); return; }
8172
8181
  console.log(chalk.green(`Sync ${direction || 'both'}: ${result.status || 'OK'}`));
8173
8182
  } catch (e) { console.error(chalk.red(`Error: ${e.message}`)); process.exit(1); }
8174
8183
  });
package/bin/mcp-server.js CHANGED
@@ -428,7 +428,7 @@ class Intelligence {
428
428
  const server = new Server(
429
429
  {
430
430
  name: 'ruvector',
431
- version: '0.2.7',
431
+ version: '0.2.8',
432
432
  },
433
433
  {
434
434
  capabilities: {
@@ -3899,7 +3899,7 @@ async function main() {
3899
3899
  transport: 'sse',
3900
3900
  sessions: sessions.size,
3901
3901
  tools: 91,
3902
- version: '0.2.7'
3902
+ version: '0.2.8'
3903
3903
  }));
3904
3904
 
3905
3905
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruvector",
3
- "version": "0.2.7",
3
+ "version": "0.2.8",
4
4
  "description": "High-performance vector database for Node.js with automatic native/WASM fallback",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",