elsemeet-bridge 0.1.4 → 0.1.5

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.
@@ -362,7 +362,7 @@ async function watch(productId, stop) {
362
362
  });
363
363
  if (!capped2) {
364
364
  log(`${name}: a new project \u2014 starting your AI to set it up from the code.`);
365
- const code2 = await startAgent(productId, p, false);
365
+ const code2 = await beating(productId, () => startAgent(productId, p, false));
366
366
  ended = Date.now() + offset;
367
367
  log(`${name}: the setup run finished (exit ${code2}).`);
368
368
  }
@@ -391,7 +391,7 @@ async function watch(productId, stop) {
391
391
  continue;
392
392
  }
393
393
  log(`${name}: ${w.marks} mark(s), ${w.ideas} idea(s) for your AI \u2014 starting it.`);
394
- const code = await startAgent(productId, p, w.push_yes === true);
394
+ const code = await beating(productId, () => startAgent(productId, p, w.push_yes === true));
395
395
  ended = Date.now() + offset;
396
396
  log(`${name}: the agent finished (exit ${code}).`);
397
397
  if (code === 0) updateProject(productId, (x) => x.since = w.since);
@@ -408,6 +408,18 @@ async function watch(productId, stop) {
408
408
  }
409
409
  }
410
410
  }
411
+ async function beating(productId, run2) {
412
+ const send = (state) => apiPost("/bridge/beat", { product_id: productId, state }).catch(() => {
413
+ });
414
+ void send("working");
415
+ const timer = setInterval(() => void send("working"), 3e4);
416
+ try {
417
+ return await run2();
418
+ } finally {
419
+ clearInterval(timer);
420
+ void send("idle");
421
+ }
422
+ }
411
423
  function sleep(ms, stop) {
412
424
  const end = Date.now() + ms;
413
425
  return new Promise((ok) => {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
- {
2
- "name": "elsemeet-bridge",
3
- "version": "0.1.4",
4
- "description": "Starts your Claude Code on /work when your Elsemeet project has something for it — connect once, in your project folder: npx elsemeet-bridge",
5
- "type": "module",
6
- "bin": { "elsemeet-bridge": "dist/elsemeet-bridge.mjs" },
7
- "files": ["dist/elsemeet-bridge.mjs", "README.md"],
8
- "engines": { "node": ">=20" },
9
- "license": "ISC",
10
- "homepage": "https://www.elsemeet.com"
11
- }
1
+ {
2
+ "name": "elsemeet-bridge",
3
+ "version": "0.1.5",
4
+ "description": "Starts your Claude Code on /work when your Elsemeet project has something for it — connect once, in your project folder: npx elsemeet-bridge",
5
+ "type": "module",
6
+ "bin": { "elsemeet-bridge": "dist/elsemeet-bridge.mjs" },
7
+ "files": ["dist/elsemeet-bridge.mjs", "README.md"],
8
+ "engines": { "node": ">=20" },
9
+ "license": "ISC",
10
+ "homepage": "https://www.elsemeet.com"
11
+ }