ruvector 0.2.2 → 0.2.3

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
@@ -4106,7 +4106,7 @@ hooksCmd.command('suggest-context').description('Suggest relevant context').acti
4106
4106
  console.log(`RuVector Intelligence: ${stats.total_patterns} learned patterns, ${stats.total_errors} error fixes available. Use 'ruvector hooks route' for agent suggestions.`);
4107
4107
  });
4108
4108
 
4109
- hooksCmd.command('remember').description('Store in memory').requiredOption('-t, --type <type>', 'Memory type').option('--silent', 'Suppress output').option('--semantic', 'Use ONNX semantic embeddings (slower, better quality)').argument('<content...>', 'Content').action(async (content, opts) => {
4109
+ hooksCmd.command('remember').description('Store in memory').option('-t, --type <type>', 'Memory type', 'general').option('--silent', 'Suppress output').option('--semantic', 'Use ONNX semantic embeddings (slower, better quality)').argument('<content...>', 'Content').action(async (content, opts) => {
4110
4110
  const intel = new Intelligence();
4111
4111
  let id;
4112
4112
  if (opts.semantic) {
@@ -8219,7 +8219,9 @@ edgeCmd.command('balance')
8219
8219
  const piKey = process.env.PI;
8220
8220
  if (!piKey) { console.error(chalk.red('Set PI environment variable first.')); process.exit(1); }
8221
8221
  try {
8222
- const resp = await fetch(`${EDGE_GENESIS}/balance/${piKey}`, { headers: { 'Authorization': `Bearer ${piKey}` } });
8222
+ const pseudonym = require('crypto').createHash('shake256', { outputLength: 16 }).update(piKey).digest('hex');
8223
+ const resp = await fetch(`${EDGE_GENESIS}/balance/${pseudonym}`, { headers: { 'Authorization': `Bearer ${piKey}` } });
8224
+ if (!resp.ok) { console.error(chalk.red(`Edge network returned ${resp.status} ${resp.statusText}`)); process.exit(1); }
8223
8225
  const data = await resp.json();
8224
8226
  if (opts.json || !process.stdout.isTTY) { console.log(JSON.stringify(data, null, 2)); return; }
8225
8227
  console.log(chalk.bold.cyan('\nrUv Balance\n'));
package/bin/mcp-server.js CHANGED
@@ -363,7 +363,7 @@ class Intelligence {
363
363
  const server = new Server(
364
364
  {
365
365
  name: 'ruvector',
366
- version: '0.2.2',
366
+ version: '0.2.3',
367
367
  },
368
368
  {
369
369
  capabilities: {
@@ -3251,7 +3251,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
3251
3251
  switch (subCmd) {
3252
3252
  case 'status': endpoint = '/status'; break;
3253
3253
  case 'join': endpoint = '/join'; method = 'POST'; body = JSON.stringify({ contribution: args.contribution || 0.3, pi_key: process.env.PI }); break;
3254
- case 'balance': endpoint = `/balance/${process.env.PI || 'anonymous'}`; break;
3254
+ case 'balance': { const ps = process.env.PI ? require('crypto').createHash('shake256', { outputLength: 16 }).update(process.env.PI).digest('hex') : 'anonymous'; endpoint = `/balance/${ps}`; break; }
3255
3255
  case 'tasks': endpoint = `/tasks?limit=${args.limit || 20}`; break;
3256
3256
  }
3257
3257
  const resp = await fetch(`${genesisUrl}${endpoint}`, {
@@ -3259,6 +3259,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
3259
3259
  headers: { 'Content-Type': 'application/json', ...(process.env.PI ? { 'Authorization': `Bearer ${process.env.PI}` } : {}) },
3260
3260
  ...(body ? { body } : {})
3261
3261
  });
3262
+ if (!resp.ok) {
3263
+ const errText = await resp.text().catch(() => resp.statusText);
3264
+ return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: `${resp.status} ${errText}` }, null, 2) }], isError: true };
3265
+ }
3262
3266
  const data = await resp.json();
3263
3267
  return { content: [{ type: 'text', text: JSON.stringify({ success: true, ...data }, null, 2) }] };
3264
3268
  } catch (e) {
@@ -3521,7 +3525,7 @@ async function main() {
3521
3525
  transport: 'sse',
3522
3526
  sessions: sessions.size,
3523
3527
  tools: 91,
3524
- version: '0.2.2'
3528
+ version: '0.2.3'
3525
3529
  }));
3526
3530
 
3527
3531
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ruvector",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
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",