@delorenj/pjangler 1.5.26 โ†’ 1.5.28

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/crank/tui.js CHANGED
@@ -435,6 +435,7 @@ function CrankDashboard({ controller, refreshMs = 5e3, clock = Date.now, onQuit
435
435
  }
436
436
  async function runCrankDashboard(controller, run = {}) {
437
437
  const { refreshMs, ...ink } = run;
438
+ controller.read();
438
439
  await runInk((finish) => /* @__PURE__ */ jsx3(CrankDashboard, { controller, refreshMs, onQuit: () => finish() }), { alternateScreen: true, ...ink });
439
440
  }
440
441
  export {
package/dist/index.js CHANGED
@@ -10042,7 +10042,7 @@ import { join as join10 } from "node:path";
10042
10042
  import YAML3 from "yaml";
10043
10043
  var BMAD_RESERVED_DIR_NAMES = ["custom", "scripts", "_config", "_memory", "memory", "render"];
10044
10044
  var indentOf = (line) => line.length - line.trimStart().length;
10045
- var isBlankOrComment = (line) => /^\s*(#.*)?$/.test(line);
10045
+ var isBlankOrComment = (line) => /^\s*(#.*)?\r?\n?$/.test(line);
10046
10046
  var isAbsent = (value, sentinels = []) => value === void 0 || value === null || typeof value === "string" && (!value.trim() || sentinels.includes(value.trim().toLowerCase()));
10047
10047
  function isLegacyReservedModuleEntry(entry) {
10048
10048
  if (!entry || typeof entry !== "object" || Array.isArray(entry)) return false;
@@ -10068,7 +10068,12 @@ function stripReservedModuleEntries(raw) {
10068
10068
  const items = [];
10069
10069
  for (let index = first; index < end; index++) {
10070
10070
  if (indentOf(lines[index]) === itemIndent && /^\s*-(\s|$)/.test(lines[index]) && !isBlankOrComment(lines[index])) {
10071
- if (items.length) items[items.length - 1].stop = index;
10071
+ if (items.length) {
10072
+ let stop = index;
10073
+ const start = items[items.length - 1].start;
10074
+ while (stop - 1 > start && isBlankOrComment(lines[stop - 1]) && indentOf(lines[stop - 1]) <= itemIndent) stop--;
10075
+ items[items.length - 1].stop = stop;
10076
+ }
10072
10077
  items.push({ start: index, stop: end });
10073
10078
  }
10074
10079
  }
@@ -20415,7 +20420,7 @@ var TAB_STATUS_SUFFIX = /[\s๐ŸŸข๐ŸŸก๐Ÿ”ด๐Ÿ””โšซโœณโœปโ—ยทโ”€]+$/u;
20415
20420
  var defaultShell = (command, args) => {
20416
20421
  const result2 = spawnSync16(command, args, { encoding: "utf8", timeout: 1e4 });
20417
20422
  if (result2.error) return { stdout: "", status: 127 };
20418
- return { stdout: result2.stdout ?? "", status: result2.status ?? 1 };
20423
+ return { stdout: result2.stdout ?? "", status: result2.status ?? 1, stderr: result2.stderr ?? "" };
20419
20424
  };
20420
20425
  function tabDisplay(name) {
20421
20426
  const trimmed2 = (name ?? "").trim();
@@ -20498,10 +20503,28 @@ function redis(deps = {}) {
20498
20503
  const endpoint = redisEndpoint();
20499
20504
  const host = deps.host ?? endpoint.host;
20500
20505
  const port = deps.port ?? endpoint.port;
20501
- const call = (args) => shell("redis-cli", ["--raw", "-h", host, "-p", String(port), ...args]);
20506
+ const call = (args) => shell("redis-cli", ["--raw", "-e", "-h", host, "-p", String(port), ...args]);
20507
+ let errorExitSupport = "unprobed";
20508
+ const requireErrorExit = () => {
20509
+ if (errorExitSupport === "unprobed") {
20510
+ const help = shell("redis-cli", ["--help"]);
20511
+ errorExitSupport = help.status === 0 && /^usage: redis-cli/im.test(help.stdout) ? /(^|\n)\s+-e\s/.test(help.stdout) ? "yes" : "no" : "unknown";
20512
+ }
20513
+ if (errorExitSupport === "no") {
20514
+ throw new Error(
20515
+ `redis-cli is too old for the crank store at ${host}:${port}: no -e flag (needs redis-tools >= 6.2) to fail on Redis error replies \u2014 upgrade redis-tools`
20516
+ );
20517
+ }
20518
+ };
20519
+ const notAnswering = (stderr) => !stderr || stderr.startsWith("Could not connect to Redis at") || stderr.startsWith("Error: ");
20502
20520
  const run = (...args) => {
20521
+ requireErrorExit();
20503
20522
  const result2 = call(args);
20504
- if (result2.status !== 0) throw new Error(`Redis is not answering at ${host}:${port} (${args[0]} failed)`);
20523
+ if (result2.status !== 0) {
20524
+ const stderr = (result2.stderr ?? "").trim();
20525
+ if (notAnswering(stderr)) throw new Error(`Redis is not answering at ${host}:${port} (${args[0]} failed)`);
20526
+ throw new Error(`Redis error reply at ${host}:${port}: ${stderr.split("\n")[0]} (${args.join(" ")})`);
20527
+ }
20505
20528
  return result2.stdout.replace(/\r?\n$/, "");
20506
20529
  };
20507
20530
  const lines = (out) => out.split("\n").map((line) => line.replace(/\r$/, "")).filter(Boolean);
@@ -20510,6 +20533,7 @@ function redis(deps = {}) {
20510
20533
  endpoint: `${host}:${port}`,
20511
20534
  /** PING -> true only when Redis answers PONG. */
20512
20535
  ping: () => {
20536
+ requireErrorExit();
20513
20537
  const result2 = call(["PING"]);
20514
20538
  return result2.status === 0 && result2.stdout.replace(/\r?\n$/, "") === "PONG";
20515
20539
  },
@@ -20965,24 +20989,23 @@ function registerCrankCli(program2) {
20965
20989
  console.error(`${xmark} --tail needs a positive integer, got "${options.tail}"`);
20966
20990
  process.exit(1);
20967
20991
  }
20968
- let current;
20969
20992
  try {
20970
- current = resolveCurrentTab();
20993
+ const current = resolveCurrentTab();
20994
+ const store = redis();
20995
+ const rows = store.logRows(current.tab);
20996
+ if (!rows.length) {
20997
+ console.log(` ${dim(`no crank log rows for ${current.tab}`)}`);
20998
+ return;
20999
+ }
21000
+ const shown = rows.slice(-tail);
21001
+ console.log(` ${bold("crank log")} ${dim(glyph.dot)} ${cyan(current.tab)} ${dim(`(${shown.length}/${rows.length} rows, newest last)`)}`);
21002
+ for (const raw of shown) {
21003
+ console.log(renderLogRow(raw) ?? raw);
21004
+ }
20971
21005
  } catch (error) {
20972
21006
  console.error(`${xmark} ${error instanceof Error ? error.message : String(error)}`);
20973
21007
  process.exit(1);
20974
21008
  }
20975
- const store = redis();
20976
- const rows = store.logRows(current.tab);
20977
- if (!rows.length) {
20978
- console.log(` ${dim(`no crank log rows for ${current.tab}`)}`);
20979
- return;
20980
- }
20981
- const shown = rows.slice(-tail);
20982
- console.log(` ${bold("crank log")} ${dim(glyph.dot)} ${cyan(current.tab)} ${dim(`(${shown.length}/${rows.length} rows, newest last)`)}`);
20983
- for (const raw of shown) {
20984
- console.log(renderLogRow(raw) ?? raw);
20985
- }
20986
21009
  });
20987
21010
  }
20988
21011
  function fail(error, what) {
@@ -9205,7 +9205,7 @@ import { join as join10 } from "node:path";
9205
9205
  import YAML3 from "yaml";
9206
9206
  var BMAD_RESERVED_DIR_NAMES = ["custom", "scripts", "_config", "_memory", "memory", "render"];
9207
9207
  var indentOf = (line) => line.length - line.trimStart().length;
9208
- var isBlankOrComment = (line) => /^\s*(#.*)?$/.test(line);
9208
+ var isBlankOrComment = (line) => /^\s*(#.*)?\r?\n?$/.test(line);
9209
9209
  var isAbsent = (value, sentinels = []) => value === void 0 || value === null || typeof value === "string" && (!value.trim() || sentinels.includes(value.trim().toLowerCase()));
9210
9210
  function isLegacyReservedModuleEntry(entry) {
9211
9211
  if (!entry || typeof entry !== "object" || Array.isArray(entry)) return false;
@@ -9231,7 +9231,12 @@ function stripReservedModuleEntries(raw) {
9231
9231
  const items = [];
9232
9232
  for (let index = first; index < end; index++) {
9233
9233
  if (indentOf(lines[index]) === itemIndent && /^\s*-(\s|$)/.test(lines[index]) && !isBlankOrComment(lines[index])) {
9234
- if (items.length) items[items.length - 1].stop = index;
9234
+ if (items.length) {
9235
+ let stop = index;
9236
+ const start = items[items.length - 1].start;
9237
+ while (stop - 1 > start && isBlankOrComment(lines[stop - 1]) && indentOf(lines[stop - 1]) <= itemIndent) stop--;
9238
+ items[items.length - 1].stop = stop;
9239
+ }
9235
9240
  items.push({ start: index, stop: end });
9236
9241
  }
9237
9242
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delorenj/pjangler",
3
- "version": "1.5.26",
3
+ "version": "1.5.28",
4
4
  "description": "Project subsystem bootstrapper CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",