@eventmodelers/cli 0.0.19 → 0.0.21

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 CHANGED
@@ -1042,7 +1042,7 @@ async function runModeling(kitDir, projectDir) {
1042
1042
  body: JSON.stringify({ token: cfg.token, board_id: cfg.boardId, agent_type: 'MODELING', agent_id: cfg.agentId }),
1043
1043
  signal: AbortSignal.timeout(10_000),
1044
1044
  });
1045
- if (!res.ok) log(`ping failed: ${res.status}`);
1045
+ if (!res.ok) log(`ping failed: ${res.status} ${await res.text().catch(() => '')}`);
1046
1046
  } catch (err) {
1047
1047
  log(`ping error: ${err.message}`);
1048
1048
  }
@@ -1217,8 +1217,14 @@ program
1217
1217
  .option('--modeling', 'Keep one Claude process warm across prompts instead of spawning a fresh one per task, for low-latency voice/live use. Modeling-kit installs only — there is no cold-spawn/tasks.json loop for modeling-kit. Built into the CLI, not a per-project file.')
1218
1218
  .action(async (opts) => {
1219
1219
  const cwd = process.cwd();
1220
- const kitDir = findInstalledKitDir(cwd);
1221
- const isModelingKit = kitDir.endsWith(MODELING_KIT.kitDirName);
1220
+ // Both kit dirs can be installed side by side (e.g. running a build-kit and a
1221
+ // modeling-kit agent from the same project). findInstalledKitDir only ever
1222
+ // returns its first fixed-order match, which would silently prefer one stack
1223
+ // over the other regardless of which the caller actually asked for — so here
1224
+ // we resolve each stack's dir independently instead of relying on that order.
1225
+ const installedKitDirs = findAllInstalledKitDirs(cwd);
1226
+ const modelingKitDir = installedKitDirs.find((d) => d.endsWith(MODELING_KIT.kitDirName)) ?? null;
1227
+ const buildKitDir = installedKitDirs.find((d) => d !== modelingKitDir) ?? null;
1222
1228
 
1223
1229
  // No overlap between the two stacks' runtimes: modeling-kit only ever runs the
1224
1230
  // warm, direct-dispatch loop (--modeling); build-kit only ever runs the
@@ -1230,13 +1236,18 @@ program
1230
1236
  console.error('❌ --modeling is mutually exclusive with --bash/--ollama — those select a build-kit runner, which --modeling has no use for.');
1231
1237
  process.exit(1);
1232
1238
  }
1233
- if (!isModelingKit) {
1239
+ if (!modelingKitDir) {
1234
1240
  console.error(`❌ --modeling only supports a modeling-kit install (${MODELING_KIT.kitDirName}/) — it subscribes to the org-wide prompt queue, which build-kit stacks don't have. Use \`eventmodelers run\` (optionally with --ollama/--bash) for build-kit's slice-status loop instead.`);
1235
1241
  process.exit(1);
1236
1242
  }
1237
- console.log(`▶ Starting modeling loop (warm Claude process) for ${relative(cwd, kitDir)}...\n`);
1243
+ // Writes to a stdout pipe are asynchronous on POSIX — without waiting for this
1244
+ // write's own flush callback, the heavier synchronous/async work runModeling()
1245
+ // does right after (dynamic imports, config reads) can eat the event-loop tick
1246
+ // this write needed to drain, so a piped watcher sees the ping arrive after
1247
+ // runModeling's own [modeling] log lines instead of before them.
1248
+ await new Promise((res) => process.stdout.write(`▶ Starting modeling loop (warm Claude process) for ${relative(cwd, modelingKitDir)}...\n\n`, res));
1238
1249
  try {
1239
- await runModeling(kitDir, resolve(kitDir, '..'));
1250
+ await runModeling(modelingKitDir, resolve(modelingKitDir, '..'));
1240
1251
  } catch (err) {
1241
1252
  console.error('[modeling] Fatal:', err);
1242
1253
  process.exit(1);
@@ -1244,10 +1255,15 @@ program
1244
1255
  return;
1245
1256
  }
1246
1257
 
1247
- if (isModelingKit) {
1248
- console.error(`❌ A modeling-kit install (${MODELING_KIT.kitDirName}/) only runs via \`eventmodelers run --modeling\` — there is no cold-spawn/tasks.json loop for modeling-only projects.`);
1258
+ if (!buildKitDir) {
1259
+ if (modelingKitDir) {
1260
+ console.error(`❌ A modeling-kit install (${MODELING_KIT.kitDirName}/) only runs via \`eventmodelers run --modeling\` — there is no cold-spawn/tasks.json loop for modeling-only projects.`);
1261
+ } else {
1262
+ console.error(`❌ No kit installed in ${cwd} — run \`eventmodelers install\` first.`);
1263
+ }
1249
1264
  process.exit(1);
1250
1265
  }
1266
+ const kitDir = buildKitDir;
1251
1267
 
1252
1268
  const pickedCount = [opts.bash, opts.ollama].filter(Boolean).length;
1253
1269
  if (pickedCount > 1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventmodelers/cli",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "description": "Eventmodelers CLI — real-time Claude agent + skills for Claude Code, for any stack (Node, Supabase, Axon, Cratis, or modeling-only)",
5
5
  "type": "module",
6
6
  "bin": {
@@ -279,7 +279,7 @@ async function startRealtimeAgent(cfg, kitDir) {
279
279
  body: JSON.stringify({ token: cfg.token, board_id: cfg.boardId, agent_type: 'BUILD', agent_id: cfg.agentId }),
280
280
  signal: AbortSignal.timeout(10_000),
281
281
  });
282
- if (!res.ok) console.error(`[agent] Ping failed: ${res.status}`);
282
+ if (!res.ok) console.error(`[agent] Ping failed: ${res.status} ${await res.text().catch(() => '')}`);
283
283
  } catch (err) {
284
284
  console.error('[agent] Ping error:', err);
285
285
  }