@eventmodelers/cli 1.0.143 → 1.0.144
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/cli.js +7 -5
- package/package.json +1 -1
- package/shared/build-kit/code-export.mjs +3 -1
package/cli.js
CHANGED
|
@@ -3192,7 +3192,7 @@ program
|
|
|
3192
3192
|
// dir: a modeling run falls back to the global install (see ensureGlobalKit) rather than
|
|
3193
3193
|
// requiring one here, and the build-kit branch reports a better-targeted error of its own
|
|
3194
3194
|
// than this generic gate can.
|
|
3195
|
-
const NO_INIT_REQUIRED = new Set(['init', 'init-config', 'stacks', 'status', 'config', 'uninstall', 'fetch', 'activate-context', 'set-slice-status', 'release-notes', 'run']);
|
|
3195
|
+
const NO_INIT_REQUIRED = new Set(['init', 'init-config', 'stacks', 'status', 'config', 'uninstall', 'fetch', 'activate-context', 'set-slice-status', 'release-notes', 'run', 'listen']);
|
|
3196
3196
|
|
|
3197
3197
|
// Commands that install or refresh the kit themselves — a "your kit is outdated" hint in
|
|
3198
3198
|
// front of them would only be noise.
|
|
@@ -4005,22 +4005,24 @@ program
|
|
|
4005
4005
|
|
|
4006
4006
|
program
|
|
4007
4007
|
.command('listen')
|
|
4008
|
-
.description('Start the code-export listener (code-export.mjs) from the installed kit dir — receives slice/screen data pushed from the eventmodelers board UI and writes it into .slices/')
|
|
4008
|
+
.description('Start the code-export listener (code-export.mjs) from the installed kit dir, or the bundled copy when no kit is installed — receives slice/screen data pushed from the eventmodelers board UI and writes it into .slices/')
|
|
4009
4009
|
.option('--port <port>', 'Port to listen on (default 3001, or $PORT)')
|
|
4010
4010
|
.action((opts) => {
|
|
4011
4011
|
const cwd = process.cwd();
|
|
4012
4012
|
const kitDir = findInstalledKitDir(cwd);
|
|
4013
4013
|
|
|
4014
|
-
|
|
4014
|
+
// With a kit installed, run its own code-export.mjs. Without one, run the copy bundled
|
|
4015
|
+
// in this CLI, rooted at the current directory so .slices/ lands here, not in the npx cache.
|
|
4016
|
+
const serverPath = kitDir ? join(kitDir, 'code-export.mjs') : join(__dirname, 'shared', 'build-kit', 'code-export.mjs');
|
|
4015
4017
|
if (!existsSync(serverPath)) {
|
|
4016
4018
|
console.error(`❌ ${relative(cwd, serverPath)} not found.`);
|
|
4017
4019
|
process.exit(1);
|
|
4018
4020
|
}
|
|
4019
4021
|
|
|
4020
4022
|
console.log(`▶ Starting ${relative(cwd, serverPath)}...\n`);
|
|
4021
|
-
const env =
|
|
4023
|
+
const env = { ...process.env, ...(opts.port && { PORT: opts.port }), ...(!kitDir && { SLICES_ROOT: cwd, WORKSPACE_PATH: cwd }) };
|
|
4022
4024
|
try {
|
|
4023
|
-
execSync(`node "${serverPath}"`, { cwd: kitDir, stdio: 'inherit', env });
|
|
4025
|
+
execSync(`node "${serverPath}"`, { cwd: kitDir ?? cwd, stdio: 'inherit', env });
|
|
4024
4026
|
} catch (err) {
|
|
4025
4027
|
process.exit(err.status || 1);
|
|
4026
4028
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eventmodelers/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.144",
|
|
4
4
|
"description": "Eventmodelers CLI — real-time Claude agent + skills for Claude Code, for any stack (Node, Supabase, Axon, OpenCQRS, UmaDB, Kurrent, or modeling-only)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -7,7 +7,9 @@ import { fileURLToPath } from 'url';
|
|
|
7
7
|
|
|
8
8
|
const __filename = fileURLToPath(import.meta.url);
|
|
9
9
|
const __dirname = dirname(__filename);
|
|
10
|
-
|
|
10
|
+
// SLICES_ROOT lets `eventmodelers listen` run this bundled copy outside an installed kit,
|
|
11
|
+
// writing .slices/ into the caller's directory instead of next to this file.
|
|
12
|
+
const ROOT = process.env.SLICES_ROOT ?? __dirname;
|
|
11
13
|
const CONFIG_PATH = join(ROOT, 'config.json');
|
|
12
14
|
const SLICES_DIR = join(ROOT, '.slices');
|
|
13
15
|
const repoPath = process.env.WORKSPACE_PATH ?? join(__dirname, '..');
|