github-issue-tower-defence-management 1.122.2 → 1.122.4

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +3 -3
  3. package/bin/adapter/entry-points/cli/index.js +9 -0
  4. package/bin/adapter/entry-points/cli/index.js.map +1 -1
  5. package/bin/adapter/entry-points/console/consoleDoneStore.js +19 -5
  6. package/bin/adapter/entry-points/console/consoleDoneStore.js.map +1 -1
  7. package/bin/adapter/entry-points/console/consoleOperationApi.js +78 -39
  8. package/bin/adapter/entry-points/console/consoleOperationApi.js.map +1 -1
  9. package/bin/adapter/entry-points/console/consoleProjectResolver.js +8 -1
  10. package/bin/adapter/entry-points/console/consoleProjectResolver.js.map +1 -1
  11. package/bin/adapter/entry-points/console/webServer.js +5 -1
  12. package/bin/adapter/entry-points/console/webServer.js.map +1 -1
  13. package/bin/adapter/entry-points/handlers/consoleListsWriter.js +2 -0
  14. package/bin/adapter/entry-points/handlers/consoleListsWriter.js.map +1 -1
  15. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js +1 -1
  16. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js.map +1 -1
  17. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js +6 -7
  18. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js.map +1 -1
  19. package/bin/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.js +60 -11
  20. package/bin/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.js.map +1 -1
  21. package/bin/adapter/repositories/ProcessListSessionSubAgentActivityRepository.js +1 -0
  22. package/bin/adapter/repositories/ProcessListSessionSubAgentActivityRepository.js.map +1 -1
  23. package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js +64 -7
  24. package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js.map +1 -1
  25. package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js +23 -4
  26. package/bin/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.js.map +1 -1
  27. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js +5 -7
  28. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js.map +1 -1
  29. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js +51 -16
  30. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js.map +1 -1
  31. package/package.json +1 -1
  32. package/src/adapter/entry-points/cli/index.test.ts +3 -1
  33. package/src/adapter/entry-points/cli/index.ts +11 -0
  34. package/src/adapter/entry-points/console/consoleDoneStore.test.ts +38 -0
  35. package/src/adapter/entry-points/console/consoleDoneStore.ts +29 -4
  36. package/src/adapter/entry-points/console/consoleOperationApi.test.ts +190 -11
  37. package/src/adapter/entry-points/console/consoleOperationApi.ts +97 -56
  38. package/src/adapter/entry-points/console/consoleProjectResolver.test.ts +13 -0
  39. package/src/adapter/entry-points/console/consoleProjectResolver.ts +11 -0
  40. package/src/adapter/entry-points/console/ui/e2e/consoleTestHarness.ts +3 -0
  41. package/src/adapter/entry-points/console/webServer.test.ts +4 -0
  42. package/src/adapter/entry-points/console/webServer.ts +9 -1
  43. package/src/adapter/entry-points/handlers/consoleListsWriter.test.ts +72 -0
  44. package/src/adapter/entry-points/handlers/consoleListsWriter.ts +3 -0
  45. package/src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts +1 -0
  46. package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.test.ts +60 -37
  47. package/src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts +7 -18
  48. package/src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.test.ts +223 -0
  49. package/src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.ts +94 -10
  50. package/src/adapter/repositories/ProcessListSessionSubAgentActivityRepository.test.ts +12 -2
  51. package/src/adapter/repositories/ProcessListSessionSubAgentActivityRepository.ts +1 -0
  52. package/src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.test.ts +196 -4
  53. package/src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts +91 -7
  54. package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.test.ts +86 -0
  55. package/src/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.ts +34 -7
  56. package/src/domain/entities/LiveSessionActivitySnapshot.ts +1 -0
  57. package/src/domain/usecases/DefaultSilentSessionMessageComposer.test.ts +112 -51
  58. package/src/domain/usecases/DefaultSilentSessionMessageComposer.ts +8 -17
  59. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +250 -18
  60. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.ts +72 -22
  61. package/src/domain/usecases/adapter-interfaces/IssueRepository.ts +1 -0
  62. package/src/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.ts +8 -0
  63. package/src/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.ts +4 -7
  64. package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
  65. package/types/adapter/entry-points/console/consoleDoneStore.d.ts +2 -0
  66. package/types/adapter/entry-points/console/consoleDoneStore.d.ts.map +1 -1
  67. package/types/adapter/entry-points/console/consoleOperationApi.d.ts +2 -0
  68. package/types/adapter/entry-points/console/consoleOperationApi.d.ts.map +1 -1
  69. package/types/adapter/entry-points/console/consoleProjectResolver.d.ts +2 -1
  70. package/types/adapter/entry-points/console/consoleProjectResolver.d.ts.map +1 -1
  71. package/types/adapter/entry-points/console/webServer.d.ts +2 -1
  72. package/types/adapter/entry-points/console/webServer.d.ts.map +1 -1
  73. package/types/adapter/entry-points/handlers/consoleListsWriter.d.ts.map +1 -1
  74. package/types/adapter/entry-points/handlers/notifySilentTmuxSessions.d.ts.map +1 -1
  75. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts +2 -3
  76. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts.map +1 -1
  77. package/types/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.d.ts +13 -2
  78. package/types/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.d.ts.map +1 -1
  79. package/types/adapter/repositories/ProcessListSessionSubAgentActivityRepository.d.ts.map +1 -1
  80. package/types/adapter/repositories/TranscriptSessionSubAgentActivityRepository.d.ts +5 -1
  81. package/types/adapter/repositories/TranscriptSessionSubAgentActivityRepository.d.ts.map +1 -1
  82. package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts +2 -1
  83. package/types/adapter/repositories/issue/ApiV3CheerioRestIssueRepository.d.ts.map +1 -1
  84. package/types/domain/entities/LiveSessionActivitySnapshot.d.ts +1 -0
  85. package/types/domain/entities/LiveSessionActivitySnapshot.d.ts.map +1 -1
  86. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts +2 -3
  87. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts.map +1 -1
  88. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts +2 -1
  89. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts.map +1 -1
  90. package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts +1 -1
  91. package/types/domain/usecases/adapter-interfaces/IssueRepository.d.ts.map +1 -1
  92. package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts +8 -0
  93. package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts.map +1 -1
  94. package/types/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.d.ts +4 -4
  95. package/types/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.d.ts.map +1 -1
@@ -159,6 +159,12 @@ describe('NotifySilentLiveSessionsUseCase', () => {
159
159
  .fn()
160
160
  .mockResolvedValue(everyNameRecentSet()),
161
161
  saveCandidateSessionNames: jest.fn().mockResolvedValue(undefined),
162
+ loadAnnouncedRunningSubAgentLabels: jest
163
+ .fn()
164
+ .mockResolvedValue(new Set<string>()),
165
+ saveAnnouncedRunningSubAgentLabels: jest
166
+ .fn()
167
+ .mockResolvedValue(undefined),
162
168
  };
163
169
  mockMessageComposer = {
164
170
  composeMainStalledSection: jest
@@ -448,6 +454,7 @@ describe('NotifySilentLiveSessionsUseCase', () => {
448
454
  label: 'sub-process-1',
449
455
  silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
450
456
  runningSeconds: 60,
457
+ waitingOnExternalProcess: false,
451
458
  },
452
459
  ];
453
460
  mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName.mockResolvedValue(
@@ -456,27 +463,23 @@ describe('NotifySilentLiveSessionsUseCase', () => {
456
463
 
457
464
  await useCase.run(runParams());
458
465
 
459
- expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith(
460
- subAgents,
461
- {
462
- subAgentSilentThresholdSeconds:
463
- DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
464
- subAgentRunningThresholdSeconds:
465
- DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
466
- },
467
- );
466
+ expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
467
+ idleSubAgents: subAgents,
468
+ longRunningSubAgents: [],
469
+ });
468
470
  expect(
469
471
  mockNotificationRepository.sendSelfCheckNotification,
470
472
  ).toHaveBeenCalledWith(GITHUB_SESSION, SUBAGENT_SECTION);
471
473
  });
472
474
 
473
- it('passes a configured running threshold through to the sub-agent section composer', async () => {
475
+ it('applies a configured running threshold when selecting long-running sub-agents', async () => {
474
476
  setupLiveInteractiveSession(GITHUB_SESSION);
475
477
  const subAgents: SubAgentActivity[] = [
476
478
  {
477
479
  label: 'sub-process-1',
478
480
  silentSeconds: 10,
479
481
  runningSeconds: 600,
482
+ waitingOnExternalProcess: false,
480
483
  },
481
484
  ];
482
485
  mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName.mockResolvedValue(
@@ -488,14 +491,10 @@ describe('NotifySilentLiveSessionsUseCase', () => {
488
491
  subAgentRunningThresholdSeconds: 600,
489
492
  });
490
493
 
491
- expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith(
492
- subAgents,
493
- {
494
- subAgentSilentThresholdSeconds:
495
- DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
496
- subAgentRunningThresholdSeconds: 600,
497
- },
498
- );
494
+ expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
495
+ idleSubAgents: [],
496
+ longRunningSubAgents: subAgents,
497
+ });
499
498
  });
500
499
 
501
500
  it('excludes an owner-handover spawn from selection so no notification is sent', async () => {
@@ -656,6 +655,239 @@ describe('NotifySilentLiveSessionsUseCase', () => {
656
655
  });
657
656
  });
658
657
 
658
+ describe('sub-agent state-based reminder judgment', () => {
659
+ const hungSubAgent = (label: string): SubAgentActivity => ({
660
+ label,
661
+ silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
662
+ runningSeconds: 60,
663
+ waitingOnExternalProcess: false,
664
+ });
665
+ const waitingSubAgent = (label: string): SubAgentActivity => ({
666
+ label,
667
+ silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
668
+ runningSeconds: 60,
669
+ waitingOnExternalProcess: true,
670
+ });
671
+ const longRunningSubAgent = (
672
+ label: string,
673
+ waitingOnExternalProcess: boolean,
674
+ ): SubAgentActivity => ({
675
+ label,
676
+ silentSeconds: 30,
677
+ runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
678
+ waitingOnExternalProcess,
679
+ });
680
+
681
+ const setupSubAgents = (subAgents: SubAgentActivity[]): void => {
682
+ setupLiveInteractiveSession(GITHUB_SESSION);
683
+ mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName.mockResolvedValue(
684
+ new Map([[GITHUB_SESSION, subAgents]]),
685
+ );
686
+ };
687
+
688
+ it('never selects a waiting sub-agent as a silent-reminder candidate', async () => {
689
+ setupSubAgents([waitingSubAgent('sub-process-1')]);
690
+
691
+ await useCase.run(runParams());
692
+
693
+ expect(mockMessageComposer.composeSubAgentSection).not.toHaveBeenCalled();
694
+ expect(
695
+ mockNotificationRepository.sendSelfCheckNotification,
696
+ ).not.toHaveBeenCalled();
697
+ });
698
+
699
+ it('notifies a hung sub-agent whose in-flight tool has no live process', async () => {
700
+ setupSubAgents([hungSubAgent('sub-process-1')]);
701
+
702
+ await useCase.run(runParams());
703
+
704
+ expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
705
+ idleSubAgents: [hungSubAgent('sub-process-1')],
706
+ longRunningSubAgents: [],
707
+ });
708
+ expect(
709
+ mockNotificationRepository.sendSelfCheckNotification,
710
+ ).toHaveBeenCalledWith(GITHUB_SESSION, SUBAGENT_SECTION);
711
+ });
712
+
713
+ it('keeps notifying a hung sub-agent on every cycle while the condition holds', async () => {
714
+ setupSubAgents([hungSubAgent('sub-process-1')]);
715
+
716
+ await useCase.run(runParams());
717
+ await useCase.run(runParams());
718
+
719
+ expect(
720
+ mockNotificationRepository.sendSelfCheckNotification,
721
+ ).toHaveBeenCalledTimes(2);
722
+ });
723
+
724
+ it('announces a running-threshold crossing for a waiting sub-agent without any idle section', async () => {
725
+ setupSubAgents([
726
+ {
727
+ label: 'sub-process-1',
728
+ silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
729
+ runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
730
+ waitingOnExternalProcess: true,
731
+ },
732
+ ]);
733
+
734
+ await useCase.run(runParams());
735
+
736
+ expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
737
+ idleSubAgents: [],
738
+ longRunningSubAgents: [
739
+ {
740
+ label: 'sub-process-1',
741
+ silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
742
+ runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
743
+ waitingOnExternalProcess: true,
744
+ },
745
+ ],
746
+ });
747
+ expect(
748
+ mockNotificationRepository.sendSelfCheckNotification,
749
+ ).toHaveBeenCalledWith(GITHUB_SESSION, SUBAGENT_SECTION);
750
+ });
751
+
752
+ it('records the announced running label only after the notification is sent', async () => {
753
+ setupSubAgents([longRunningSubAgent('sub-process-1', false)]);
754
+
755
+ await useCase.run(runParams());
756
+
757
+ expect(
758
+ mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
759
+ ).toHaveBeenCalledWith({
760
+ sessionName: GITHUB_SESSION,
761
+ labels: ['sub-process-1'],
762
+ now,
763
+ });
764
+ });
765
+
766
+ it('does not record an announced running label when the first-cycle debounce defers the send', async () => {
767
+ setupSubAgents([longRunningSubAgent('sub-process-1', false)]);
768
+ mockCandidateStateRepository.loadRecentCandidateSessionNames.mockResolvedValue(
769
+ new Set<string>(),
770
+ );
771
+
772
+ await useCase.run(runParams());
773
+
774
+ expect(
775
+ mockNotificationRepository.sendSelfCheckNotification,
776
+ ).not.toHaveBeenCalled();
777
+ expect(
778
+ mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
779
+ ).not.toHaveBeenCalled();
780
+ });
781
+
782
+ it('does not repeat the running announcement while the same label stays over the threshold', async () => {
783
+ setupSubAgents([longRunningSubAgent('sub-process-1', false)]);
784
+ mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockResolvedValue(
785
+ new Set(['sub-process-1']),
786
+ );
787
+
788
+ await useCase.run(runParams());
789
+
790
+ expect(mockMessageComposer.composeSubAgentSection).not.toHaveBeenCalled();
791
+ expect(
792
+ mockNotificationRepository.sendSelfCheckNotification,
793
+ ).not.toHaveBeenCalled();
794
+ });
795
+
796
+ it('announces only the new label when another announced label is still over the threshold', async () => {
797
+ setupSubAgents([
798
+ longRunningSubAgent('sub-process-1', false),
799
+ longRunningSubAgent('sub-process-2', false),
800
+ ]);
801
+ mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockResolvedValue(
802
+ new Set(['sub-process-1']),
803
+ );
804
+
805
+ await useCase.run(runParams());
806
+
807
+ expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
808
+ idleSubAgents: [],
809
+ longRunningSubAgents: [longRunningSubAgent('sub-process-2', false)],
810
+ });
811
+ expect(
812
+ mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
813
+ ).toHaveBeenCalledWith({
814
+ sessionName: GITHUB_SESSION,
815
+ labels: ['sub-process-1', 'sub-process-2'],
816
+ now,
817
+ });
818
+ });
819
+
820
+ it('clears the announced record when the label disappears from the sub-agent set', async () => {
821
+ setupSubAgents([]);
822
+ mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockResolvedValue(
823
+ new Set(['sub-process-1']),
824
+ );
825
+
826
+ await useCase.run(runParams());
827
+
828
+ expect(
829
+ mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
830
+ ).toHaveBeenCalledWith({
831
+ sessionName: GITHUB_SESSION,
832
+ labels: [],
833
+ now,
834
+ });
835
+ });
836
+
837
+ it('announces exactly once per crossing across use-case instances sharing the persisted state', async () => {
838
+ setupSubAgents([longRunningSubAgent('sub-process-1', false)]);
839
+ const announcedLabelsBySessionName = new Map<string, string[]>();
840
+ mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockImplementation(
841
+ async ({ sessionName }) =>
842
+ new Set(announcedLabelsBySessionName.get(sessionName) ?? []),
843
+ );
844
+ mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels.mockImplementation(
845
+ async ({ sessionName, labels }) => {
846
+ announcedLabelsBySessionName.set(sessionName, labels);
847
+ },
848
+ );
849
+
850
+ await useCase.run(runParams());
851
+ expect(
852
+ mockNotificationRepository.sendSelfCheckNotification,
853
+ ).toHaveBeenCalledTimes(1);
854
+
855
+ const secondUseCase = new NotifySilentLiveSessionsUseCase(
856
+ mockSnapshotProvider,
857
+ mockTranscriptResolver,
858
+ mockSessionOutputActivityRepository,
859
+ mockSubAgentActivityRepository,
860
+ mockOwnerCallStatusProvider,
861
+ mockNotificationRepository,
862
+ mockCandidateStateRepository,
863
+ mockMessageComposer,
864
+ mockSleeper,
865
+ mockHubTaskStatusResolver,
866
+ mockHubTaskStatusCacheRepository,
867
+ );
868
+ await secondUseCase.run(
869
+ runParams({ now: new Date(now.getTime() + 60 * 1000) }),
870
+ );
871
+
872
+ expect(
873
+ mockNotificationRepository.sendSelfCheckNotification,
874
+ ).toHaveBeenCalledTimes(1);
875
+ });
876
+
877
+ it('does not touch the announced-label record for a main-only reminder', async () => {
878
+ setupSilentMainSession(GITHUB_SESSION);
879
+
880
+ await useCase.run(runParams());
881
+
882
+ expect(
883
+ mockNotificationRepository.sendSelfCheckNotification,
884
+ ).toHaveBeenCalledWith(GITHUB_SESSION, MAIN_STALLED_SECTION);
885
+ expect(
886
+ mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
887
+ ).not.toHaveBeenCalled();
888
+ });
889
+ });
890
+
659
891
  it('sends to multiple sessions sequentially with a stagger delay between sends', async () => {
660
892
  mockSnapshotProvider.getSnapshot.mockResolvedValue(
661
893
  snapshotWithSessions([GITHUB_SESSION_ALPHA, GITHUB_SESSION_BRAVO]),
@@ -54,6 +54,8 @@ export type HubTaskStatusResolver = Pick<IssueRepository, 'getIssueByUrl'>;
54
54
  type NotifyCandidate = {
55
55
  sessionName: string;
56
56
  message: string;
57
+ newlyAnnouncedRunningLabels: string[];
58
+ retainedAnnouncedRunningLabels: string[];
57
59
  };
58
60
 
59
61
  export class NotifySilentLiveSessionsUseCase {
@@ -111,9 +113,9 @@ export class NotifySilentLiveSessionsUseCase {
111
113
 
112
114
  const candidates: NotifyCandidate[] = [];
113
115
  for (const sessionSnapshot of snapshots) {
114
- const message = this.composeMessage(sessionSnapshot, params);
115
- if (message !== null) {
116
- candidates.push({ sessionName: sessionSnapshot.sessionName, message });
116
+ const candidate = await this.composeCandidate(sessionSnapshot, params);
117
+ if (candidate !== null) {
118
+ candidates.push(candidate);
117
119
  }
118
120
  }
119
121
  candidates.sort((left, right) =>
@@ -165,6 +167,16 @@ export class NotifySilentLiveSessionsUseCase {
165
167
  );
166
168
  sentCount += 1;
167
169
  console.log(`Notified ${candidate.sessionName}.`);
170
+ if (candidate.newlyAnnouncedRunningLabels.length > 0) {
171
+ await this.candidateStateRepository.saveAnnouncedRunningSubAgentLabels({
172
+ sessionName: candidate.sessionName,
173
+ labels: [
174
+ ...candidate.retainedAnnouncedRunningLabels,
175
+ ...candidate.newlyAnnouncedRunningLabels,
176
+ ],
177
+ now: params.now,
178
+ });
179
+ }
168
180
  }
169
181
  };
170
182
 
@@ -334,40 +346,47 @@ export class NotifySilentLiveSessionsUseCase {
334
346
  });
335
347
  };
336
348
 
337
- private composeMessage = (
349
+ private composeCandidate = async (
338
350
  snapshot: LiveSessionActivitySnapshot,
339
351
  thresholds: {
340
352
  mainSilentThresholdSeconds: number;
341
353
  subAgentSilentThresholdSeconds: number;
342
354
  subAgentRunningThresholdSeconds: number;
355
+ now: Date;
343
356
  },
344
- ): string | null => {
357
+ ): Promise<NotifyCandidate | null> => {
345
358
  const sections: string[] = [];
346
359
 
347
- if (
348
- snapshot.mainSilentSeconds !== null &&
349
- snapshot.mainSilentSeconds >= thresholds.mainSilentThresholdSeconds &&
350
- !snapshot.hasUnansweredOwnerCall
351
- ) {
360
+ const mainSilentSeconds = snapshot.mainSilentSeconds;
361
+ const mainTriggered =
362
+ mainSilentSeconds !== null &&
363
+ mainSilentSeconds >= thresholds.mainSilentThresholdSeconds &&
364
+ !snapshot.hasUnansweredOwnerCall;
365
+ if (mainTriggered) {
352
366
  sections.push(
353
- this.messageComposer.composeMainStalledSection(
354
- snapshot.mainSilentSeconds,
355
- ),
367
+ this.messageComposer.composeMainStalledSection(mainSilentSeconds),
356
368
  );
357
369
  }
358
370
 
359
- const stalledSubAgents = snapshot.subAgents.filter(
371
+ const idleSubAgents = snapshot.subAgents.filter(
372
+ (subAgent) =>
373
+ !subAgent.waitingOnExternalProcess &&
374
+ subAgent.silentSeconds >= thresholds.subAgentSilentThresholdSeconds,
375
+ );
376
+ const longRunningSubAgents = snapshot.subAgents.filter(
360
377
  (subAgent) =>
361
- subAgent.silentSeconds >= thresholds.subAgentSilentThresholdSeconds ||
362
378
  subAgent.runningSeconds >= thresholds.subAgentRunningThresholdSeconds,
363
379
  );
364
- if (stalledSubAgents.length > 0) {
380
+ const retainedAnnouncedRunningLabels =
381
+ await this.reconcileAnnouncedRunningLabels(snapshot, thresholds.now);
382
+ const newlyLongRunningSubAgents = longRunningSubAgents.filter(
383
+ (subAgent) => !retainedAnnouncedRunningLabels.includes(subAgent.label),
384
+ );
385
+ if (idleSubAgents.length > 0 || newlyLongRunningSubAgents.length > 0) {
365
386
  sections.push(
366
- this.messageComposer.composeSubAgentSection(stalledSubAgents, {
367
- subAgentSilentThresholdSeconds:
368
- thresholds.subAgentSilentThresholdSeconds,
369
- subAgentRunningThresholdSeconds:
370
- thresholds.subAgentRunningThresholdSeconds,
387
+ this.messageComposer.composeSubAgentSection({
388
+ idleSubAgents,
389
+ longRunningSubAgents: newlyLongRunningSubAgents,
371
390
  }),
372
391
  );
373
392
  }
@@ -375,6 +394,37 @@ export class NotifySilentLiveSessionsUseCase {
375
394
  if (sections.length === 0) {
376
395
  return null;
377
396
  }
378
- return sections.join('\n\n');
397
+ return {
398
+ sessionName: snapshot.sessionName,
399
+ message: sections.join('\n\n'),
400
+ newlyAnnouncedRunningLabels: newlyLongRunningSubAgents.map(
401
+ (subAgent) => subAgent.label,
402
+ ),
403
+ retainedAnnouncedRunningLabels,
404
+ };
405
+ };
406
+
407
+ private reconcileAnnouncedRunningLabels = async (
408
+ snapshot: LiveSessionActivitySnapshot,
409
+ now: Date,
410
+ ): Promise<string[]> => {
411
+ const announcedLabels =
412
+ await this.candidateStateRepository.loadAnnouncedRunningSubAgentLabels({
413
+ sessionName: snapshot.sessionName,
414
+ });
415
+ const currentLabels = new Set(
416
+ snapshot.subAgents.map((subAgent) => subAgent.label),
417
+ );
418
+ const retainedLabels = Array.from(announcedLabels).filter((label) =>
419
+ currentLabels.has(label),
420
+ );
421
+ if (retainedLabels.length !== announcedLabels.size) {
422
+ await this.candidateStateRepository.saveAnnouncedRunningSubAgentLabels({
423
+ sessionName: snapshot.sessionName,
424
+ labels: retainedLabels,
425
+ now,
426
+ });
427
+ }
428
+ return retainedLabels;
379
429
  };
380
430
  }
@@ -92,6 +92,7 @@ export interface IssueRepository {
92
92
  issueUrl: string,
93
93
  project: Project,
94
94
  date: Date,
95
+ projectItemId?: string,
95
96
  ) => Promise<void>;
96
97
  updateNextActionHour: (
97
98
  project: Project & {
@@ -7,4 +7,12 @@ export interface SilentSessionCandidateStateRepository {
7
7
  sessionNames: string[];
8
8
  now: Date;
9
9
  }) => Promise<void>;
10
+ loadAnnouncedRunningSubAgentLabels: (params: {
11
+ sessionName: string;
12
+ }) => Promise<Set<string>>;
13
+ saveAnnouncedRunningSubAgentLabels: (params: {
14
+ sessionName: string;
15
+ labels: string[];
16
+ now: Date;
17
+ }) => Promise<void>;
10
18
  }
@@ -1,14 +1,11 @@
1
1
  import { SubAgentActivity } from '../../entities/LiveSessionActivitySnapshot';
2
2
 
3
- export type SubAgentStallThresholds = {
4
- subAgentSilentThresholdSeconds: number;
5
- subAgentRunningThresholdSeconds: number;
3
+ export type SubAgentStallSections = {
4
+ idleSubAgents: SubAgentActivity[];
5
+ longRunningSubAgents: SubAgentActivity[];
6
6
  };
7
7
 
8
8
  export interface SilentSessionMessageComposer {
9
9
  composeMainStalledSection: (mainSilentSeconds: number) => string;
10
- composeSubAgentSection: (
11
- subAgents: SubAgentActivity[],
12
- thresholds: SubAgentStallThresholds,
13
- ) => string;
10
+ composeSubAgentSection: (sections: SubAgentStallSections) => string;
14
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAkIzB,eAAO,MAAM,OAAO,SAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/cli/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,UAAU,EACV,cAAc,EACd,wBAAwB,EACxB,YAAY,EACZ,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAmIzB,eAAO,MAAM,OAAO,SAAgB,CAAC"}
@@ -7,4 +7,6 @@ export declare const readDoneProjectItemIds: (consoleDataOutputDir: string, pjco
7
7
  export declare const recordDoneProjectItemId: (consoleDataOutputDir: string, pjcode: string, tab: string, projectItemId: string) => void;
8
8
  export declare const CONSOLE_DONE_TAB_NAMES: string[];
9
9
  export declare const recordDoneProjectItemIdAcrossTabs: (consoleDataOutputDir: string, pjcode: string, projectItemId: string) => void;
10
+ export declare const resetDoneProjectItemIds: (consoleDataOutputDir: string, pjcode: string, tab: string) => void;
11
+ export declare const resetDoneProjectItemIdsAcrossTabs: (consoleDataOutputDir: string, pjcode: string) => void;
10
12
  //# sourceMappingURL=consoleDoneStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consoleDoneStore.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleDoneStore.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAqBF,eAAO,MAAM,kBAAkB,GAC7B,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MACmE,CAAC;AAEvE,eAAO,MAAM,sBAAsB,GACjC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MAAM,EASR,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,eAAe,MAAM,KACpB,IAgBF,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAQ1C,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,eAAe,MAAM,KACpB,IAIF,CAAC"}
1
+ {"version":3,"file":"consoleDoneStore.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleDoneStore.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAEnD,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAqBF,eAAO,MAAM,kBAAkB,GAC7B,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MACmE,CAAC;AAYvE,eAAO,MAAM,sBAAsB,GACjC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,MAAM,EASR,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,EACX,eAAe,MAAM,KACpB,IAaF,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,MAAM,EAQ1C,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,eAAe,MAAM,KACpB,IAIF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,EACd,KAAK,MAAM,KACV,IAGF,CAAC;AAEF,eAAO,MAAM,iCAAiC,GAC5C,sBAAsB,MAAM,EAC5B,QAAQ,MAAM,KACb,IAIF,CAAC"}
@@ -7,9 +7,11 @@ export type ConsoleProjectBinding = {
7
7
  project: Project;
8
8
  };
9
9
  export type ConsoleProjectResolver = (pjcode: string) => Promise<ConsoleProjectBinding | null>;
10
+ export type ConsolePjcodeValidator = (pjcode: string) => boolean;
10
11
  export type ConsoleOperationContext = {
11
12
  issueRepository: IssueRepository;
12
13
  resolveProject: ConsoleProjectResolver;
14
+ isPjcodeConfigured: ConsolePjcodeValidator;
13
15
  consoleDataOutputDir: string | null;
14
16
  };
15
17
  export type ConsoleOperationResponse = {
@@ -1 +1 @@
1
- {"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEhB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAI3D,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CACnC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;AAE3C,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,sBAAsB,CAAC;IACvC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAkHF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA+ElC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAgGlC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA2BlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC"}
1
+ {"version":3,"file":"consoleOperationApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleOperationApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEhB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAI3D,eAAO,MAAM,8BAA8B,uBAAuB,CAAC;AACnE,eAAO,MAAM,4BAA4B,qBAAqB,CAAC;AAE/D,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,CACnC,MAAM,EAAE,MAAM,KACX,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;AAE3C,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;AAEjE,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,eAAe,CAAC;IACjC,cAAc,EAAE,sBAAsB,CAAC;IACvC,kBAAkB,EAAE,sBAAsB,CAAC;IAC3C,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAsJF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAoFlC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA6FlC,CAAC;AAEF,eAAO,MAAM,aAAa,GACxB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CA2BlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,SAAS,uBAAuB,EAChC,MAAM,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAC5B,OAAO,CAAC,wBAAwB,CAiClC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  import { Project } from '../../../domain/entities/Project';
2
- import { ConsoleProjectResolver } from './consoleOperationApi';
2
+ import { ConsolePjcodeValidator, ConsoleProjectResolver } from './consoleOperationApi';
3
3
  export type ConsoleProjectLoader = (projectUrl: string) => Promise<Project | null>;
4
4
  export declare const buildPjcodeToProjectUrl: (defaultPjcode: string, defaultProjectUrl: string, consoleProjects: Record<string, string> | null) => Record<string, string>;
5
+ export declare const createPjcodeConfigChecker: (pjcodeToProjectUrl: Record<string, string>) => ConsolePjcodeValidator;
5
6
  export declare const createConsoleProjectResolver: (pjcodeToProjectUrl: Record<string, string>, loadProject: ConsoleProjectLoader) => ConsoleProjectResolver;
6
7
  //# sourceMappingURL=consoleProjectResolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consoleProjectResolver.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleProjectResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EAEL,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,oBAAoB,GAAG,CACjC,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAE7B,eAAO,MAAM,uBAAuB,GAClC,eAAe,MAAM,EACrB,mBAAmB,MAAM,EACzB,iBAAiB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAWvB,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,oBAAoB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1C,aAAa,oBAAoB,KAChC,sBAmBF,CAAC"}
1
+ {"version":3,"file":"consoleProjectResolver.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleProjectResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAC3D,OAAO,EACL,sBAAsB,EAEtB,sBAAsB,EACvB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,oBAAoB,GAAG,CACjC,UAAU,EAAE,MAAM,KACf,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;AAE7B,eAAO,MAAM,uBAAuB,GAClC,eAAe,MAAM,EACrB,mBAAmB,MAAM,EACzB,iBAAiB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,KAC7C,MAAM,CAAC,MAAM,EAAE,MAAM,CAWvB,CAAC;AAKF,eAAO,MAAM,yBAAyB,GACpC,oBAAoB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KACzC,sBAGF,CAAC;AAEF,eAAO,MAAM,4BAA4B,GACvC,oBAAoB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC1C,aAAa,oBAAoB,KAChC,sBAmBF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import * as http from 'http';
2
2
  import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
3
3
  import { IssueTitleStateCache, PullRequestStatusCache } from './consoleReadApi';
4
- import { ConsoleProjectResolver } from './consoleOperationApi';
4
+ import { ConsolePjcodeValidator, ConsoleProjectResolver } from './consoleOperationApi';
5
5
  import { ImageFetcher } from './consoleImageProxy';
6
6
  export declare const DEFAULT_WEB_PORT = 9981;
7
7
  export declare const DEFAULT_DASHBOARD_PROJECT_NAMES: string[];
@@ -23,6 +23,7 @@ export type WebServerOptions = {
23
23
  imageFetcher?: ImageFetcher | null;
24
24
  issueRepository?: IssueRepository | null;
25
25
  resolveProject?: ConsoleProjectResolver | null;
26
+ isPjcodeConfigured?: ConsolePjcodeValidator | null;
26
27
  issueTitleStateCache?: IssueTitleStateCache | null;
27
28
  pullRequestStatusCache?: PullRequestStatusCache | null;
28
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"webServer.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/webServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAM9F,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EAQvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,sBAAsB,EAMvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AAOtE,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,eAAO,MAAM,+BAA+B,UAA0B,CAAC;AAEvE,eAAO,MAAM,oBAAoB,eAAe,CAAC;AAmCjD,eAAO,MAAM,aAAa,GAAI,aAAa,MAAM,KAAG,OAGiB,CAAC;AAEtE,eA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ClB,MAAM,GAAG,IAeX,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,SAAS,gBAAgB,EACzB,SAAS,IAAI,CAAC,eAAe,EAC7B,UAAU,IAAI,CAAC,cAAc,KAC5B,OAAO,CAAC,IAAI,CAwEd,CAAC;AAcF,eAAO,MAAM,eAAe,GAAI,SAAS,gBAAgB,KAAG,IAAI,CAAC,MAM7D,CAAC;AAEL,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG;IACrD,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,eAAO,MAAM,cAAc,GACzB,SAAS,qBAAqB,KAC7B,OAAO,CAAC,IAAI,CAAC,MAAM,CAQlB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"consoleListsWriter.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/consoleListsWriter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAOhE,MAAM,MAAM,wBAAwB,GAAG;IACrC,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChD,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,wBAAwB,GAAI,MAAM,IAAI,KAAG,MACR,CAAC;AAU/C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,wBAAwB,KAAG,IAuBpE,CAAC"}
1
+ {"version":3,"file":"consoleListsWriter.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/consoleListsWriter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAQhE,MAAM,MAAM,wBAAwB,GAAG;IACrC,oBAAoB,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAChD,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAWF,eAAO,MAAM,wBAAwB,GAAI,MAAM,IAAI,KAAG,MACR,CAAC;AAU/C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,wBAAwB,KAAG,IAyBpE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"notifySilentTmuxSessions.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAGpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAEL,qBAAqB,EAOtB,MAAM,0DAA0D,CAAC;AAclE,OAAO,EAEL,6BAA6B,EAC9B,MAAM,6DAA6D,CAAC;AAKrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,0BAA0B,EAAE,MAAM,CAAC;IACnC,8BAA8B,EAAE,MAAM,CAAC;IACvC,+BAA+B,EAAE,MAAM,CAAC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC,EAAE,MAAM,CAAC;IAC9C,8BAA8B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qBAAqB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpD,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,4BAA4B,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAoCF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,IAAI,CAyEd,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;;;;CAQ7C,CAAC"}
1
+ {"version":3,"file":"notifySilentTmuxSessions.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAGpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAEL,qBAAqB,EAOtB,MAAM,0DAA0D,CAAC;AAclE,OAAO,EAEL,6BAA6B,EAC9B,MAAM,6DAA6D,CAAC;AAKrE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,0BAA0B,EAAE,MAAM,CAAC;IACnC,8BAA8B,EAAE,MAAM,CAAC;IACvC,+BAA+B,EAAE,MAAM,CAAC;IACxC,cAAc,EAAE,MAAM,CAAC;IACvB,qCAAqC,EAAE,MAAM,CAAC;IAC9C,8BAA8B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9C,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,qBAAqB,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACpD,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,4BAA4B,EAAE,MAAM,CAAC;IACrC,gBAAgB,EAAE,6BAA6B,CAAC;IAChD,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAqCF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,IAAI,CAyEd,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;;;;CAQ7C,CAAC"}
@@ -1,5 +1,4 @@
1
- import { SubAgentActivity } from '../../domain/entities/LiveSessionActivitySnapshot';
2
- import { SilentSessionMessageComposer, SubAgentStallThresholds } from '../../domain/usecases/adapter-interfaces/SilentSessionMessageComposer';
1
+ import { SilentSessionMessageComposer, SubAgentStallSections } from '../../domain/usecases/adapter-interfaces/SilentSessionMessageComposer';
3
2
  export type SilentSessionMessageTemplates = {
4
3
  mainStalledMessage: string | null;
5
4
  subAgentIdleMessageHeader: string | null;
@@ -13,7 +12,7 @@ export declare class ConfigurableSilentSessionMessageComposer implements SilentS
13
12
  private readonly ownerCallMarker;
14
13
  constructor(templates: SilentSessionMessageTemplates, fallback: SilentSessionMessageComposer, ownerCallMarker?: string | null);
15
14
  composeMainStalledSection: (mainSilentSeconds: number) => string;
16
- composeSubAgentSection: (subAgents: SubAgentActivity[], thresholds: SubAgentStallThresholds) => string;
15
+ composeSubAgentSection: (stallSections: SubAgentStallSections) => string;
17
16
  private composeIdleSection;
18
17
  private composeLongRunningSection;
19
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurableSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAErF,OAAO,EACL,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,uEAAuE,CAAC;AAQ/E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjD,CAAC;AAOF,qBAAa,wCAAyC,YAAW,4BAA4B;IAEzF,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,4BAA4B,EACtC,eAAe,GAAE,MAAM,GAAG,IAAW;IAGxD,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAO7D;IAEF,sBAAsB,GACpB,WAAW,gBAAgB,EAAE,EAC7B,YAAY,uBAAuB,KAClC,MAAM,CAoDP;IAEF,OAAO,CAAC,kBAAkB,CAkBxB;IAEF,OAAO,CAAC,yBAAyB,CAkB/B;CACH"}
1
+ {"version":3,"file":"ConfigurableSilentSessionMessageComposer.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,4BAA4B,EAC5B,qBAAqB,EACtB,MAAM,uEAAuE,CAAC;AAQ/E,MAAM,MAAM,6BAA6B,GAAG;IAC1C,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,gCAAgC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjD,CAAC;AAOF,qBAAa,wCAAyC,YAAW,4BAA4B;IAEzF,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAFf,SAAS,EAAE,6BAA6B,EACxC,QAAQ,EAAE,4BAA4B,EACtC,eAAe,GAAE,MAAM,GAAG,IAAW;IAGxD,yBAAyB,GAAI,mBAAmB,MAAM,KAAG,MAAM,CAO7D;IAEF,sBAAsB,GAAI,eAAe,qBAAqB,KAAG,MAAM,CA4CrE;IAEF,OAAO,CAAC,kBAAkB,CAkBxB;IAEF,OAAO,CAAC,yBAAyB,CAkB/B;CACH"}
@@ -1,5 +1,6 @@
1
1
  import { SilentSessionCandidateStateRepository } from '../../domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository';
2
2
  export declare const DEFAULT_STATE_RETENTION_WINDOW_SECONDS: number;
3
+ export declare const ANNOUNCED_RUNNING_RETENTION_WINDOW_SECONDS: number;
3
4
  export declare class FileSystemSilentSessionCandidateStateRepository implements SilentSessionCandidateStateRepository {
4
5
  private readonly stateFilePath;
5
6
  private readonly retentionWindowSeconds;
@@ -12,7 +13,17 @@ export declare class FileSystemSilentSessionCandidateStateRepository implements
12
13
  sessionNames: string[];
13
14
  now: Date;
14
15
  }) => Promise<void>;
15
- private readEntries;
16
- private writeEntries;
16
+ loadAnnouncedRunningSubAgentLabels: (params: {
17
+ sessionName: string;
18
+ }) => Promise<Set<string>>;
19
+ saveAnnouncedRunningSubAgentLabels: (params: {
20
+ sessionName: string;
21
+ labels: string[];
22
+ now: Date;
23
+ }) => Promise<void>;
24
+ private readState;
25
+ private readCandidateEntries;
26
+ private readAnnouncedRunningEntries;
27
+ private writeState;
17
28
  }
18
29
  //# sourceMappingURL=FileSystemSilentSessionCandidateStateRepository.d.ts.map