convene-cli 1.6.0 → 1.8.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.
package/dist/render.js CHANGED
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SESSION_OPEN_TAG = exports.UNTRUSTED_LABEL = void 0;
3
+ exports.RELOCATE_TAG = exports.SESSION_OPEN_TAG = exports.UNTRUSTED_LABEL = void 0;
4
4
  exports.inertToken = inertToken;
5
5
  exports.renderHealthLine = renderHealthLine;
6
6
  exports.renderRecentLine = renderRecentLine;
7
7
  exports.renderOpenItem = renderOpenItem;
8
8
  exports.renderChannelBlock = renderChannelBlock;
9
9
  exports.renderSessionOpenBlock = renderSessionOpenBlock;
10
+ exports.renderRelocateBlock = renderRelocateBlock;
10
11
  /**
11
12
  * The `<convene-channel>` render contract (P0-RENDER) + untrusted-prompt fencing
12
13
  * (P0-PROMPT). This is the ONE place the agent-facing text grammar is produced,
@@ -176,6 +177,31 @@ function renderLaneHaltSection(L, lanes, halts) {
176
177
  L.push('');
177
178
  }
178
179
  }
180
+ /** Compact "Active sessions" block — a faint pulse of who else is working now. */
181
+ function renderPresenceSection(L, presence) {
182
+ if (!presence.length)
183
+ return;
184
+ L.push('Active sessions (working now):');
185
+ for (const p of presence.slice(0, 8)) {
186
+ const bits = [inertToken(p.session, 64)];
187
+ if (p.area)
188
+ bits.push(inertToken(p.area, 32));
189
+ if (p.edits)
190
+ bits.push(`${p.edits} edit${p.edits === 1 ? '' : 's'}`);
191
+ if (p.ageSec != null && Number.isFinite(p.ageSec))
192
+ bits.push(presenceAge(p.ageSec));
193
+ L.push(' · ' + bits.join(' · '));
194
+ }
195
+ L.push('');
196
+ }
197
+ function presenceAge(sec) {
198
+ const s = Math.max(0, Math.round(sec));
199
+ if (s < 60)
200
+ return `${s}s ago`;
201
+ if (s < 3600)
202
+ return `${Math.round(s / 60)}m ago`;
203
+ return `${Math.round(s / 3600)}h ago`;
204
+ }
179
205
  function renderChannelBlock(input) {
180
206
  const { slug, member, session, lookbackMin, openItems, recent, health } = input;
181
207
  const lanes = input.lanes ?? [];
@@ -204,6 +230,7 @@ function renderChannelBlock(input) {
204
230
  // High-priority interrupts + active deploy lanes, above Open items (DEGRADED
205
231
  // suppresses these structurally — the caller passes empty arrays).
206
232
  renderLaneHaltSection(L, lanes, halts);
233
+ renderPresenceSection(L, input.presence ?? []);
207
234
  L.push('Open items for you:');
208
235
  if (openItems.length === 0) {
209
236
  L.push(' (none)');
@@ -295,3 +322,20 @@ function renderSessionOpenBlock(input) {
295
322
  L.push(`</${exports.SESSION_OPEN_TAG}>`);
296
323
  return L.join('\n');
297
324
  }
325
+ // ── <convene-relocate> (auto-isolate) ────────────────────────────────────────
326
+ exports.RELOCATE_TAG = 'convene-relocate';
327
+ /**
328
+ * The `<convene-relocate>` block emitted at SessionStart when this session booted
329
+ * into a checkout that already has a live sibling and a clean isolated worktree was
330
+ * provisioned for it. It is an IMPERATIVE, NON-alarming instruction the agent acts
331
+ * on — framed as "a tree is ready, move there", not a warning. Deliberately no
332
+ * "WARNING"; the move is the recommended, friction-free path.
333
+ */
334
+ function renderRelocateBlock(input) {
335
+ const { dest, branch } = input;
336
+ return (`<${exports.RELOCATE_TAG}>\n` +
337
+ `Another live session is active in this checkout. A clean isolated worktree is ready for you ` +
338
+ `at ${dest} (branch ${branch}, based on fresh origin/main, gitignored config copied). ` +
339
+ `To avoid clobbering the other session's files, relocate now: run \`cd ${dest}\` and continue your work there.\n` +
340
+ `</${exports.RELOCATE_TAG}>`);
341
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "convene-cli",
3
- "version": "1.6.0",
3
+ "version": "1.8.0",
4
4
  "description": "Convene CLI — AI development coordination bus client + UserPromptSubmit hook. Install: npm i -g convene-cli; then `convene setup`.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://dev.convene.live",