@sanqianx/ai-coding-event-bridge-console 0.4.0 → 0.5.0

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/package.json +2 -2
  2. package/src/bin.js +11 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanqianx/ai-coding-event-bridge-console",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Local console for the AI coding event bridge: project import with per-project journal storage, REST query API and a built-in conversation explorer page.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -24,6 +24,6 @@
24
24
  "test": "node ../../test/run-all.js"
25
25
  },
26
26
  "dependencies": {
27
- "@sanqianx/ai-coding-event-bridge": "0.4.0"
27
+ "@sanqianx/ai-coding-event-bridge": "0.5.0"
28
28
  }
29
29
  }
package/src/bin.js CHANGED
@@ -7,7 +7,8 @@ const { createConsoleServer } = require('./server');
7
7
  const { warmFolderPicker } = require('./pick-folder');
8
8
 
9
9
  /**
10
- * ai-coding-event-bridge-console CLI
10
+ * ai-coding-event-bridge-console CLI (also reachable as
11
+ * `ai-coding-event-bridge serve` via the core package's dispatcher).
11
12
  *
12
13
  * serve [--port 8790] [--host 127.0.0.1] [--home DIR]
13
14
  * Start the local console (explorer page + JSON API).
@@ -16,8 +17,7 @@ const { warmFolderPicker } = require('./pick-folder');
16
17
  * conversation bodies, so they stay on this machine unless --host says
17
18
  * otherwise.
18
19
  */
19
- async function main() {
20
- const argv = process.argv.slice(2);
20
+ async function main(argv = process.argv.slice(2)) {
21
21
  const command = argv[0];
22
22
  const get = (name) => {
23
23
  const i = argv.indexOf('--' + name);
@@ -47,7 +47,11 @@ async function main() {
47
47
  }
48
48
  }
49
49
 
50
- main().catch((err) => {
51
- console.error(err && err.stack ? err.stack : err);
52
- process.exit(1);
53
- });
50
+ module.exports = { main };
51
+
52
+ if (require.main === module) {
53
+ main().catch((err) => {
54
+ console.error(err && err.stack ? err.stack : err);
55
+ process.exit(1);
56
+ });
57
+ }