@tyhld/conductor 0.12.83 → 0.12.84

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.
@@ -411,6 +411,7 @@ export class FollowSession {
411
411
  waitingNoted = false;
412
412
  oldRelayNoted = false;
413
413
  unreadableNoted = false;
414
+ troubleNoted = false;
414
415
  /** 道具の呼び出し(id)→ 道具の名前。結果の行を日本語でまとめるために覚えておく。 */
415
416
  toolNames = new Map();
416
417
  constructor(deps) {
@@ -431,19 +432,43 @@ export class FollowSession {
431
432
  rawPath(commandId, attempt) {
432
433
  return (this.deps.rawPath ?? rawLogPath)(commandId, attempt);
433
434
  }
434
- /** 開いたときの1回:いまの状態 → これまでの流れ → 以後は poll で続く。 */
435
- open() {
436
- this.out(this.header());
437
- const active = this.active();
438
- if (active !== null) {
439
- this.beginFollow(active, { announce: false, backlog: true });
435
+ /**
436
+ * 何かでつまずいても、英語の難しい文のまま落ちないようにする。
437
+ * ★黙って固まらない・理由と次の1手を日本語で出す(えふさん確定の決まり)。
438
+ */
439
+ safely(what, fn) {
440
+ try {
441
+ fn();
440
442
  }
441
- else {
442
- this.noteWaiting();
443
+ catch (err) {
444
+ if (this.troubleNoted)
445
+ return;
446
+ this.troubleNoted = true;
447
+ const why = err instanceof Error ? err.message : String(err);
448
+ this.out(`※${what}でつまずきました(${clip(maskSecrets(why), 80)})。`);
449
+ this.out(' 次の1手:Ctrl+C で閉じて、もう一度開いてください。何度も出るならサポートへこの画面をお送りください。');
443
450
  }
444
451
  }
452
+ /** 開いたときの1回:いまの状態 → これまでの流れ → 以後は poll で続く。 */
453
+ open() {
454
+ this.safely('画面の用意', () => {
455
+ this.out(this.header());
456
+ const active = this.active();
457
+ if (active !== null) {
458
+ this.beginFollow(active, { announce: false, backlog: true });
459
+ }
460
+ else {
461
+ this.noteWaiting();
462
+ }
463
+ });
464
+ }
445
465
  /** 1周ぶん。便の切れ目と、増えた記録だけを出す。 */
446
466
  poll() {
467
+ this.safely('様子の読み取り', () => {
468
+ this.pollOnce();
469
+ });
470
+ }
471
+ pollOnce() {
447
472
  const active = this.active();
448
473
  if (active === null) {
449
474
  if (this.cur !== null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tyhld/conductor",
3
- "version": "0.12.83",
3
+ "version": "0.12.84",
4
4
  "description": "采配くん管制の見守りアプリ(conductor-agent)。各PCで常駐し、中央(devlog-tracker)へ定期的に生存報告(heartbeat)を送る常駐CLI。",
5
5
  "type": "module",
6
6
  "bin": {