@vpxa/aikit 0.1.296 → 0.1.297

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/aikit.mjs CHANGED
@@ -11,23 +11,48 @@ const AIKIT_HOME = join(homedir(), '.aikit');
11
11
  const CURRENT_VERSION_FILE = join(AIKIT_HOME, 'current-version.json');
12
12
 
13
13
  let cliPath;
14
+ let serverPath;
14
15
  if (existsSync(CURRENT_VERSION_FILE)) {
15
16
  try {
16
17
  const { version } = JSON.parse(readFileSync(CURRENT_VERSION_FILE, 'utf-8'));
17
18
  const verDir = join(AIKIT_HOME, 'versions', `v${version}`);
18
19
  cliPath = join(verDir, 'packages', 'cli', 'dist', 'index.js');
20
+ serverPath = join(verDir, 'packages', 'server', 'dist', 'bin.js');
19
21
  if (!existsSync(cliPath)) {
20
22
  // Fallback to bundled path if version dir is incomplete
21
23
  cliPath = resolve(__dirname, '..', 'packages', 'cli', 'dist', 'index.js');
22
24
  }
25
+ if (!existsSync(serverPath)) {
26
+ serverPath = resolve(__dirname, '..', 'packages', 'server', 'dist', 'bin.js');
27
+ }
23
28
  } catch {
24
29
  // Fallback to bundled path on any parse error
25
30
  cliPath = resolve(__dirname, '..', 'packages', 'cli', 'dist', 'index.js');
31
+ serverPath = resolve(__dirname, '..', 'packages', 'server', 'dist', 'bin.js');
26
32
  }
27
33
  } else {
28
34
  // Fallback to bundled path
29
35
  cliPath = resolve(__dirname, '..', 'packages', 'cli', 'dist', 'index.js');
36
+ serverPath = resolve(__dirname, '..', 'packages', 'server', 'dist', 'bin.js');
30
37
  }
31
38
 
32
- const cli = await import(pathToFileURL(cliPath).href);
33
- await cli.run(process.argv.slice(2));
39
+ const argv = process.argv.slice(2);
40
+ const commandName = argv[0];
41
+ if (commandName === 'serve' && !argv.includes('--daemon') && existsSync(serverPath)) {
42
+ const readFlag = (flag) => {
43
+ const index = argv.indexOf(flag);
44
+ if (index === -1 || index + 1 >= argv.length) return undefined;
45
+ return argv[index + 1];
46
+ };
47
+
48
+ const transport = readFlag('--transport');
49
+ if (transport) process.env.AIKIT_TRANSPORT = transport;
50
+
51
+ const port = readFlag('--port');
52
+ if (port) process.env.AIKIT_PORT = port;
53
+
54
+ await import(pathToFileURL(serverPath).href);
55
+ } else {
56
+ const cli = await import(pathToFileURL(cliPath).href);
57
+ await cli.run(argv);
58
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vpxa/aikit",
3
- "version": "0.1.296",
3
+ "version": "0.1.297",
4
4
  "type": "module",
5
5
  "description": "Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents",
6
6
  "license": "MIT",