@andespindola/brainlink 0.1.0-alpha.1 → 0.1.0-alpha.2

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.
Files changed (2) hide show
  1. package/dist/cli/main.js +9 -2
  2. package/package.json +1 -1
package/dist/cli/main.js CHANGED
@@ -1,8 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command } from 'commander';
3
- import { basename } from 'node:path';
3
+ import { readFileSync } from 'node:fs';
4
+ import { basename, dirname, join } from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
4
6
  import { registerReadCommands } from './commands/read-commands.js';
5
7
  import { registerWriteCommands } from './commands/write-commands.js';
8
+ const readPackageVersion = () => {
9
+ const packagePath = join(dirname(fileURLToPath(import.meta.url)), '../../package.json');
10
+ const metadata = JSON.parse(readFileSync(packagePath, 'utf8'));
11
+ return metadata.version ?? '0.0.0';
12
+ };
6
13
  const program = new Command();
7
14
  const cliName = basename(process.argv[1] ?? 'brainlink');
8
15
  const displayName = cliName === 'blink' ? 'blink' : 'brainlink';
@@ -11,7 +18,7 @@ program
11
18
  .name(displayName)
12
19
  .alias(aliasName)
13
20
  .description('Local-first knowledge memory for agents')
14
- .version('0.1.0');
21
+ .version(readPackageVersion());
15
22
  registerWriteCommands(program);
16
23
  registerReadCommands(program);
17
24
  program.parseAsync().catch((error) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andespindola/brainlink",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.2",
4
4
  "description": "Local-first knowledge memory for agents with Markdown, backlinks, indexing and context retrieval.",
5
5
  "type": "module",
6
6
  "license": "MIT",