@maka/maka-cli 5.165.0 → 5.167.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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maka/maka-cli",
3
- "version": "5.165.0",
3
+ "version": "5.167.0",
4
4
  "type": "module",
5
5
  "summary": "A command line tool for scaffolding Meteor 3.x applications using either React.",
6
6
  "description": "A command line tool for scaffolding Meteor 3.x applications using React.",
@@ -156,6 +156,70 @@ export function readReproFile(candidate) {
156
156
  * accepts a sink array, so per step we take the meta events emitted
157
157
  * since the last step and print them under the output they explain.
158
158
  */
159
+ /** The bench's actor. One name, used for the seat and for the
160
+ * visibility filter below. */
161
+ export const REPRO_ACTOR = 'Tester';
162
+ const stripTags = (s) => s.replace(/\{\/?[a-z-]+\}/g, '');
163
+ /**
164
+ * ONE STEP OF TRANSCRIPT, pure: the command's return string, then what
165
+ * the actor HEARD, then the dice, then the panels.
166
+ *
167
+ * THE LOG CHANNEL IS PART OF THE TRANSCRIPT, and it was missing
168
+ * (aCjJiDDJM9jGZJeER, 2026-09-11). A command's return string is what the
169
+ * engine says to the one who typed it; everything a room is told -- an
170
+ * NPC drawing, closing, taking cover, a companion's line, the exchange
171
+ * narration itself -- goes out as `log` events scoped to the room and
172
+ * resolved to the players standing in it. The dry run printed the reply
173
+ * and the dice and dropped every one of those, so a bench whose whole
174
+ * point is "the room now sees Joe's Action Phase" showed Joe's roll in
175
+ * the mechanics block and NOT the line the fix added -- the same "a
176
+ * bench that cannot display its own point" shape this renderer has been
177
+ * extended for twice already (mechanics, then panels).
178
+ *
179
+ * Only what THE ACTOR can see: an event resolved to other players is
180
+ * not on this transcript, because the bench sits one runner at one
181
+ * table and a line they never saw is not evidence of anything.
182
+ */
183
+ export function renderStepLines(step, text, fresh, actor = REPRO_ACTOR) {
184
+ const lines = [];
185
+ lines.push(`> ${step}`);
186
+ lines.push(stripTags(text ?? '(no output)'));
187
+ const heard = fresh.filter(e => e.channel === 'log'
188
+ && (e.visibleTo === 'all' || e.visibleTo.includes(actor)));
189
+ for (const h of heard) {
190
+ const body = stripTags(h.text).replace(/\s+$/gm, '');
191
+ if (body.trim().length === 0)
192
+ continue;
193
+ for (const row of body.split('\n'))
194
+ lines.push(` [heard] ${row}`);
195
+ }
196
+ for (const m of fresh.filter(e => e.channel === 'meta')) {
197
+ lines.push(` [mechanics] ${stripTags(m.text)}`);
198
+ }
199
+ // THE DOCKED PANELS ARE PART OF THE TRANSCRIPT TOO, for exactly
200
+ // the reason the mechanics ticker above is.
201
+ //
202
+ // The map and room boxes are a THIRD channel: not the command's
203
+ // return string, not the meta ticker, but per-player `system`
204
+ // events. A bench whose subject is a panel -- "the NPC I can see
205
+ // is not on the room map", an elevation bar, a district caption --
206
+ // dry-ran green while showing none of what it exists to show,
207
+ // which is the same "a bench that cannot display its own point"
208
+ // failure this function was already extended once to fix.
209
+ //
210
+ // Printed only when the panel has something to say: an empty
211
+ // event is the jacked-into-the-matrix contract, and blank
212
+ // [room]/[map] blocks on every step would bury the steps.
213
+ for (const p of fresh.filter(e => e.channel === 'system' && (e.kind === 'map' || e.kind === 'room'))) {
214
+ const body = stripTags(p.text ?? '').replace(/\s+$/gm, '');
215
+ if (body.trim().length === 0)
216
+ continue;
217
+ for (const row of body.split('\n'))
218
+ lines.push(` [${p.kind}] ${row}`);
219
+ }
220
+ lines.push('');
221
+ return lines;
222
+ }
159
223
  export async function dryRunRepro(repro) {
160
224
  const [{ buildReproScene, reproArchetypeName }, { bootSession, saveForArchetype }] = await Promise.all([
161
225
  import('../factories/repro-scene.js'),
@@ -170,10 +234,9 @@ export async function dryRunRepro(repro) {
170
234
  const events = [];
171
235
  const session = await bootSession({
172
236
  seed: built.seed,
173
- players: [saveForArchetype('Tester', reproArchetypeName(fixture))],
237
+ players: [saveForArchetype(REPRO_ACTOR, reproArchetypeName(fixture))],
174
238
  events,
175
239
  });
176
- const strip = (s) => s.replace(/\{\/?[a-z-]+\}/g, '');
177
240
  const lines = [];
178
241
  // THE FIRST PAINT IS NOT PART OF STEP ONE. bootSession pushes every
179
242
  // player's panels the moment the session comes up (B7NNNesy5gvRSbZpp),
@@ -183,40 +246,13 @@ export async function dryRunRepro(repro) {
183
246
  let drained = events.length;
184
247
  try {
185
248
  for (const step of repro.steps) {
186
- const { text } = await session.command('Tester', step);
187
- lines.push(`> ${step}`);
188
- lines.push(strip(text ?? '(no output)'));
249
+ const { text } = await session.command(REPRO_ACTOR, step);
189
250
  // Only what THIS step produced: the cursor advances past
190
- // everything seen, including log events, so a step that emits no
191
- // dice prints no Mechanics block rather than repeating the last
192
- // one that did.
251
+ // everything seen, so a step that emits no dice prints no
252
+ // Mechanics block rather than repeating the last one that did.
193
253
  const fresh = events.slice(drained);
194
254
  drained = events.length;
195
- for (const m of fresh.filter(e => e.channel === 'meta')) {
196
- lines.push(` [mechanics] ${strip(m.text)}`);
197
- }
198
- // THE DOCKED PANELS ARE PART OF THE TRANSCRIPT TOO, for exactly
199
- // the reason the mechanics ticker above is.
200
- //
201
- // The map and room boxes are a THIRD channel: not the command's
202
- // return string, not the meta ticker, but per-player `system`
203
- // events. A bench whose subject is a panel -- "the NPC I can see
204
- // is not on the room map", an elevation bar, a district caption --
205
- // dry-ran green while showing none of what it exists to show,
206
- // which is the same "a bench that cannot display its own point"
207
- // failure this function was already extended once to fix.
208
- //
209
- // Printed only when the panel has something to say: an empty
210
- // event is the jacked-into-the-matrix contract, and blank
211
- // [room]/[map] blocks on every step would bury the steps.
212
- for (const p of fresh.filter(e => e.channel === 'system' && (e.kind === 'map' || e.kind === 'room'))) {
213
- const body = strip(p.text ?? '').replace(/\s+$/gm, '');
214
- if (body.trim().length === 0)
215
- continue;
216
- for (const row of body.split('\n'))
217
- lines.push(` [${p.kind}] ${row}`);
218
- }
219
- lines.push('');
255
+ lines.push(...renderStepLines(step, text, fresh));
220
256
  }
221
257
  }
222
258
  finally {
@@ -1204,6 +1204,11 @@ export class SharedRunSession {
1204
1204
  sessionID: this.sessionID,
1205
1205
  query: inviteMatch[1].trim(),
1206
1206
  });
1207
+ // A mid-run seat needs the runner REACHABLE now (site ruling
1208
+ // 2026-09-11: a CLI alive on the account, or a browser logged
1209
+ // in); the server refuses with `offline` otherwise, so `online`
1210
+ // is always true past this point. The aside stays for a server
1211
+ // older than the rule.
1207
1212
  return `Invite sent to ${res.memberRunner} -- a seat at this table, mid-job.${res.online ? '' : ` (They're off the street -- it'll wait on their link.)`}`;
1208
1213
  }
1209
1214
  catch (err) {
@@ -1290,10 +1295,21 @@ export class SharedRunSession {
1290
1295
  return `You pull out of the run. The crew's voices fade off the link.`;
1291
1296
  }
1292
1297
  /** Quit-as-pause (ruling 2026-08-24): the seat survives, the run
1293
- * keeps rolling server-side, and the server marks us disconnected
1294
- * the moment this process's link closes. No leave call, no
1295
- * forfeiture -- "call taxi" rides back in. */
1298
+ * keeps rolling server-side, and the server marks us disconnected.
1299
+ * No leave call, no forfeiture -- "call taxi" rides back in.
1300
+ *
1301
+ * SAID OUT LOUD (2026-09-11): the server used to learn of this only
1302
+ * when the process's socket closed -- and this process does not
1303
+ * close it; the hub link stays up for invites and pages. So a runner
1304
+ * who stepped away sat `joined` on the doc with nobody at the
1305
+ * keyboard, and the site's sheet could not tell "at the table" from
1306
+ * "stepped away". sideQuest.stepAway is that one word; best effort,
1307
+ * and the socket-close path still stands behind it. */
1296
1308
  async stepAway() {
1309
+ try {
1310
+ await HubLink.call('sideQuest.stepAway', { sessionID: this.sessionID }, { timeoutMs: 5000 });
1311
+ }
1312
+ catch { /* the seat stays warm either way; the socket close says the same later */ }
1297
1313
  this.finish('');
1298
1314
  // THE OTHER HALF OF blankRunPanels. Entering a run clears the hub's
1299
1315
  // maps so the server's paint cannot be confused with them; stepping
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maka/maka-cli",
3
- "version": "5.165.0",
3
+ "version": "5.167.0",
4
4
  "type": "module",
5
5
  "summary": "A command line tool for scaffolding Meteor 3.x applications using either React.",
6
6
  "description": "A command line tool for scaffolding Meteor 3.x applications using React.",