github-issue-tower-defence-management 1.122.11 → 1.122.12
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/CHANGELOG.md +7 -0
- package/bin/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.js +12 -50
- package/bin/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.js.map +1 -1
- package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js +32 -3
- package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js.map +1 -1
- package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js +14 -34
- package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.test.ts +42 -213
- package/src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.ts +11 -83
- package/src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.test.ts +68 -5
- package/src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts +43 -3
- package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +74 -127
- package/src/domain/usecases/NotifySilentLiveSessionsUseCase.ts +15 -51
- package/src/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.ts +0 -8
- package/types/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.d.ts +0 -10
- package/types/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.d.ts.map +1 -1
- package/types/adapter/repositories/TranscriptSessionSubAgentActivityRepository.d.ts.map +1 -1
- package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts +0 -1
- package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts.map +1 -1
- package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts +0 -8
- package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts.map +1 -1
|
@@ -167,12 +167,6 @@ describe('NotifySilentLiveSessionsUseCase', () => {
|
|
|
167
167
|
.fn()
|
|
168
168
|
.mockResolvedValue(everyNameRecentSet()),
|
|
169
169
|
saveCandidateSessionNames: jest.fn().mockResolvedValue(undefined),
|
|
170
|
-
loadAnnouncedRunningSubAgentLabels: jest
|
|
171
|
-
.fn()
|
|
172
|
-
.mockResolvedValue(new Set<string>()),
|
|
173
|
-
saveAnnouncedRunningSubAgentLabels: jest
|
|
174
|
-
.fn()
|
|
175
|
-
.mockResolvedValue(undefined),
|
|
176
170
|
};
|
|
177
171
|
mockMessageComposer = {
|
|
178
172
|
composeMainStalledSection: jest
|
|
@@ -573,7 +567,7 @@ describe('NotifySilentLiveSessionsUseCase', () => {
|
|
|
573
567
|
const subAgents: SubAgentActivity[] = [
|
|
574
568
|
{
|
|
575
569
|
label: 'sub-process-1',
|
|
576
|
-
silentSeconds:
|
|
570
|
+
silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
|
|
577
571
|
runningSeconds: 600,
|
|
578
572
|
waitingOnExternalProcess: false,
|
|
579
573
|
},
|
|
@@ -588,11 +582,33 @@ describe('NotifySilentLiveSessionsUseCase', () => {
|
|
|
588
582
|
});
|
|
589
583
|
|
|
590
584
|
expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
|
|
591
|
-
idleSubAgents:
|
|
585
|
+
idleSubAgents: subAgents,
|
|
592
586
|
longRunningSubAgents: subAgents,
|
|
593
587
|
});
|
|
594
588
|
});
|
|
595
589
|
|
|
590
|
+
it('suppresses the long-running section for a sub-agent that produced output recently even past the running threshold', async () => {
|
|
591
|
+
setupLiveInteractiveSession(GITHUB_SESSION);
|
|
592
|
+
const subAgents: SubAgentActivity[] = [
|
|
593
|
+
{
|
|
594
|
+
label: 'sub-process-1',
|
|
595
|
+
silentSeconds: 10,
|
|
596
|
+
runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
|
|
597
|
+
waitingOnExternalProcess: false,
|
|
598
|
+
},
|
|
599
|
+
];
|
|
600
|
+
mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName.mockResolvedValue(
|
|
601
|
+
new Map([[GITHUB_SESSION, subAgents]]),
|
|
602
|
+
);
|
|
603
|
+
|
|
604
|
+
await useCase.run(runParams());
|
|
605
|
+
|
|
606
|
+
expect(mockMessageComposer.composeSubAgentSection).not.toHaveBeenCalled();
|
|
607
|
+
expect(
|
|
608
|
+
mockNotificationRepository.sendSelfCheckNotification,
|
|
609
|
+
).not.toHaveBeenCalled();
|
|
610
|
+
});
|
|
611
|
+
|
|
596
612
|
it('excludes an owner-handover spawn from selection so no notification is sent', async () => {
|
|
597
613
|
mockSnapshotProvider.getSnapshot.mockResolvedValue({
|
|
598
614
|
sessions: [{ sessionName: 'aw-host', panePids: [100] }],
|
|
@@ -764,15 +780,21 @@ describe('NotifySilentLiveSessionsUseCase', () => {
|
|
|
764
780
|
runningSeconds: 60,
|
|
765
781
|
waitingOnExternalProcess: true,
|
|
766
782
|
});
|
|
767
|
-
const
|
|
783
|
+
const quietLongRunningSubAgent = (
|
|
768
784
|
label: string,
|
|
769
785
|
waitingOnExternalProcess: boolean,
|
|
770
786
|
): SubAgentActivity => ({
|
|
771
787
|
label,
|
|
772
|
-
silentSeconds:
|
|
788
|
+
silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
|
|
773
789
|
runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
|
|
774
790
|
waitingOnExternalProcess,
|
|
775
791
|
});
|
|
792
|
+
const producingLongRunningSubAgent = (label: string): SubAgentActivity => ({
|
|
793
|
+
label,
|
|
794
|
+
silentSeconds: 30,
|
|
795
|
+
runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
|
|
796
|
+
waitingOnExternalProcess: false,
|
|
797
|
+
});
|
|
776
798
|
|
|
777
799
|
const setupSubAgents = (subAgents: SubAgentActivity[]): void => {
|
|
778
800
|
setupLiveInteractiveSession(GITHUB_SESSION);
|
|
@@ -817,69 +839,19 @@ describe('NotifySilentLiveSessionsUseCase', () => {
|
|
|
817
839
|
).toHaveBeenCalledTimes(2);
|
|
818
840
|
});
|
|
819
841
|
|
|
820
|
-
it('
|
|
821
|
-
setupSubAgents([
|
|
822
|
-
{
|
|
823
|
-
label: 'sub-process-1',
|
|
824
|
-
silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
|
|
825
|
-
runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
|
|
826
|
-
waitingOnExternalProcess: true,
|
|
827
|
-
},
|
|
828
|
-
]);
|
|
829
|
-
|
|
830
|
-
await useCase.run(runParams());
|
|
831
|
-
|
|
832
|
-
expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
|
|
833
|
-
idleSubAgents: [],
|
|
834
|
-
longRunningSubAgents: [
|
|
835
|
-
{
|
|
836
|
-
label: 'sub-process-1',
|
|
837
|
-
silentSeconds: DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS,
|
|
838
|
-
runningSeconds: DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS,
|
|
839
|
-
waitingOnExternalProcess: true,
|
|
840
|
-
},
|
|
841
|
-
],
|
|
842
|
-
});
|
|
843
|
-
expect(
|
|
844
|
-
mockNotificationRepository.sendSelfCheckNotification,
|
|
845
|
-
).toHaveBeenCalledWith(GITHUB_SESSION, SUBAGENT_SECTION);
|
|
846
|
-
});
|
|
847
|
-
|
|
848
|
-
it('records the announced running label only after the notification is sent', async () => {
|
|
849
|
-
setupSubAgents([longRunningSubAgent('sub-process-1', false)]);
|
|
850
|
-
|
|
851
|
-
await useCase.run(runParams());
|
|
852
|
-
|
|
853
|
-
expect(
|
|
854
|
-
mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
|
|
855
|
-
).toHaveBeenCalledWith({
|
|
856
|
-
sessionName: GITHUB_SESSION,
|
|
857
|
-
labels: ['sub-process-1'],
|
|
858
|
-
now,
|
|
859
|
-
});
|
|
860
|
-
});
|
|
861
|
-
|
|
862
|
-
it('does not record an announced running label when the first-cycle debounce defers the send', async () => {
|
|
863
|
-
setupSubAgents([longRunningSubAgent('sub-process-1', false)]);
|
|
864
|
-
mockCandidateStateRepository.loadRecentCandidateSessionNames.mockResolvedValue(
|
|
865
|
-
new Set<string>(),
|
|
866
|
-
);
|
|
842
|
+
it('never selects a waiting sub-agent for the long-running section even when quiet past both thresholds', async () => {
|
|
843
|
+
setupSubAgents([quietLongRunningSubAgent('sub-process-1', true)]);
|
|
867
844
|
|
|
868
845
|
await useCase.run(runParams());
|
|
869
846
|
|
|
847
|
+
expect(mockMessageComposer.composeSubAgentSection).not.toHaveBeenCalled();
|
|
870
848
|
expect(
|
|
871
849
|
mockNotificationRepository.sendSelfCheckNotification,
|
|
872
850
|
).not.toHaveBeenCalled();
|
|
873
|
-
expect(
|
|
874
|
-
mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
|
|
875
|
-
).not.toHaveBeenCalled();
|
|
876
851
|
});
|
|
877
852
|
|
|
878
|
-
it('
|
|
879
|
-
setupSubAgents([
|
|
880
|
-
mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockResolvedValue(
|
|
881
|
-
new Set(['sub-process-1']),
|
|
882
|
-
);
|
|
853
|
+
it('never selects a long-running sub-agent that produced output within the silent threshold', async () => {
|
|
854
|
+
setupSubAgents([producingLongRunningSubAgent('sub-process-1')]);
|
|
883
855
|
|
|
884
856
|
await useCase.run(runParams());
|
|
885
857
|
|
|
@@ -889,98 +861,73 @@ describe('NotifySilentLiveSessionsUseCase', () => {
|
|
|
889
861
|
).not.toHaveBeenCalled();
|
|
890
862
|
});
|
|
891
863
|
|
|
892
|
-
it('
|
|
893
|
-
setupSubAgents([
|
|
894
|
-
longRunningSubAgent('sub-process-1', false),
|
|
895
|
-
longRunningSubAgent('sub-process-2', false),
|
|
896
|
-
]);
|
|
897
|
-
mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockResolvedValue(
|
|
898
|
-
new Set(['sub-process-1']),
|
|
899
|
-
);
|
|
864
|
+
it('includes a quiet long-running sub-agent in both the idle and long-running sections', async () => {
|
|
865
|
+
setupSubAgents([quietLongRunningSubAgent('sub-process-1', false)]);
|
|
900
866
|
|
|
901
867
|
await useCase.run(runParams());
|
|
902
868
|
|
|
903
869
|
expect(mockMessageComposer.composeSubAgentSection).toHaveBeenCalledWith({
|
|
904
|
-
idleSubAgents: [],
|
|
905
|
-
longRunningSubAgents: [
|
|
870
|
+
idleSubAgents: [quietLongRunningSubAgent('sub-process-1', false)],
|
|
871
|
+
longRunningSubAgents: [
|
|
872
|
+
quietLongRunningSubAgent('sub-process-1', false),
|
|
873
|
+
],
|
|
906
874
|
});
|
|
907
875
|
expect(
|
|
908
|
-
|
|
909
|
-
).toHaveBeenCalledWith(
|
|
910
|
-
sessionName: GITHUB_SESSION,
|
|
911
|
-
labels: ['sub-process-1', 'sub-process-2'],
|
|
912
|
-
now,
|
|
913
|
-
});
|
|
876
|
+
mockNotificationRepository.sendSelfCheckNotification,
|
|
877
|
+
).toHaveBeenCalledWith(GITHUB_SESSION, SUBAGENT_SECTION);
|
|
914
878
|
});
|
|
915
879
|
|
|
916
|
-
it('
|
|
917
|
-
setupSubAgents([]);
|
|
918
|
-
mockCandidateStateRepository.loadAnnouncedRunningSubAgentLabels.mockResolvedValue(
|
|
919
|
-
new Set(['sub-process-1']),
|
|
920
|
-
);
|
|
880
|
+
it('keeps notifying a quiet long-running sub-agent on every cycle while the condition holds', async () => {
|
|
881
|
+
setupSubAgents([quietLongRunningSubAgent('sub-process-1', false)]);
|
|
921
882
|
|
|
883
|
+
await useCase.run(runParams());
|
|
922
884
|
await useCase.run(runParams());
|
|
923
885
|
|
|
924
886
|
expect(
|
|
925
|
-
|
|
926
|
-
).
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
887
|
+
mockNotificationRepository.sendSelfCheckNotification,
|
|
888
|
+
).toHaveBeenCalledTimes(2);
|
|
889
|
+
expect(
|
|
890
|
+
mockMessageComposer.composeSubAgentSection,
|
|
891
|
+
).toHaveBeenNthCalledWith(2, {
|
|
892
|
+
idleSubAgents: [quietLongRunningSubAgent('sub-process-1', false)],
|
|
893
|
+
longRunningSubAgents: [
|
|
894
|
+
quietLongRunningSubAgent('sub-process-1', false),
|
|
895
|
+
],
|
|
930
896
|
});
|
|
931
897
|
});
|
|
932
898
|
|
|
933
|
-
it('
|
|
934
|
-
setupSubAgents([
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
async ({ sessionName }) =>
|
|
938
|
-
new Set(announcedLabelsBySessionName.get(sessionName) ?? []),
|
|
939
|
-
);
|
|
940
|
-
mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels.mockImplementation(
|
|
941
|
-
async ({ sessionName, labels }) => {
|
|
942
|
-
announcedLabelsBySessionName.set(sessionName, labels);
|
|
943
|
-
},
|
|
899
|
+
it('defers a first-cycle long-running candidate until it persists into the next cycle', async () => {
|
|
900
|
+
setupSubAgents([quietLongRunningSubAgent('sub-process-1', false)]);
|
|
901
|
+
mockCandidateStateRepository.loadRecentCandidateSessionNames.mockResolvedValue(
|
|
902
|
+
new Set<string>(),
|
|
944
903
|
);
|
|
945
904
|
|
|
946
905
|
await useCase.run(runParams());
|
|
906
|
+
|
|
947
907
|
expect(
|
|
948
908
|
mockNotificationRepository.sendSelfCheckNotification,
|
|
949
|
-
).
|
|
909
|
+
).not.toHaveBeenCalled();
|
|
910
|
+
expect(
|
|
911
|
+
mockCandidateStateRepository.saveCandidateSessionNames,
|
|
912
|
+
).toHaveBeenCalledWith({ sessionNames: [GITHUB_SESSION], now });
|
|
913
|
+
});
|
|
950
914
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
mockTranscriptResolver,
|
|
954
|
-
mockSessionOutputActivityRepository,
|
|
955
|
-
mockSubAgentActivityRepository,
|
|
956
|
-
mockOwnerCallStatusProvider,
|
|
957
|
-
mockNotificationRepository,
|
|
958
|
-
mockCandidateStateRepository,
|
|
959
|
-
mockMessageComposer,
|
|
960
|
-
mockSleeper,
|
|
961
|
-
mockHubTaskStatusResolver,
|
|
962
|
-
mockHubTaskStatusCacheRepository,
|
|
963
|
-
);
|
|
964
|
-
await secondUseCase.run(
|
|
965
|
-
runParams({ now: new Date(now.getTime() + 60 * 1000) }),
|
|
966
|
-
);
|
|
915
|
+
it('stops notifying once the long-running sub-agent drops out of the activity snapshot', async () => {
|
|
916
|
+
setupSubAgents([quietLongRunningSubAgent('sub-process-1', false)]);
|
|
967
917
|
|
|
918
|
+
await useCase.run(runParams());
|
|
968
919
|
expect(
|
|
969
920
|
mockNotificationRepository.sendSelfCheckNotification,
|
|
970
921
|
).toHaveBeenCalledTimes(1);
|
|
971
|
-
});
|
|
972
|
-
|
|
973
|
-
it('does not touch the announced-label record for a main-only reminder', async () => {
|
|
974
|
-
setupSilentMainSession(GITHUB_SESSION);
|
|
975
922
|
|
|
923
|
+
mockSubAgentActivityRepository.listSubAgentActivitiesBySessionName.mockResolvedValue(
|
|
924
|
+
new Map<string, SubAgentActivity[]>(),
|
|
925
|
+
);
|
|
976
926
|
await useCase.run(runParams());
|
|
977
927
|
|
|
978
928
|
expect(
|
|
979
929
|
mockNotificationRepository.sendSelfCheckNotification,
|
|
980
|
-
).
|
|
981
|
-
expect(
|
|
982
|
-
mockCandidateStateRepository.saveAnnouncedRunningSubAgentLabels,
|
|
983
|
-
).not.toHaveBeenCalled();
|
|
930
|
+
).toHaveBeenCalledTimes(1);
|
|
984
931
|
});
|
|
985
932
|
});
|
|
986
933
|
|
|
@@ -60,8 +60,6 @@ export type HubTaskStatusResolver = Pick<IssueRepository, 'getIssueByUrl'>;
|
|
|
60
60
|
type NotifyCandidate = {
|
|
61
61
|
sessionName: string;
|
|
62
62
|
message: string;
|
|
63
|
-
newlyAnnouncedRunningLabels: string[];
|
|
64
|
-
retainedAnnouncedRunningLabels: string[];
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
export class NotifySilentLiveSessionsUseCase {
|
|
@@ -144,7 +142,7 @@ export class NotifySilentLiveSessionsUseCase {
|
|
|
144
142
|
|
|
145
143
|
const candidates: NotifyCandidate[] = [];
|
|
146
144
|
for (const sessionSnapshot of snapshots) {
|
|
147
|
-
const candidate =
|
|
145
|
+
const candidate = this.composeCandidate(sessionSnapshot, params);
|
|
148
146
|
if (candidate !== null) {
|
|
149
147
|
candidates.push(candidate);
|
|
150
148
|
}
|
|
@@ -198,16 +196,6 @@ export class NotifySilentLiveSessionsUseCase {
|
|
|
198
196
|
);
|
|
199
197
|
sentCount += 1;
|
|
200
198
|
console.log(`Notified ${candidate.sessionName}.`);
|
|
201
|
-
if (candidate.newlyAnnouncedRunningLabels.length > 0) {
|
|
202
|
-
await this.candidateStateRepository.saveAnnouncedRunningSubAgentLabels({
|
|
203
|
-
sessionName: candidate.sessionName,
|
|
204
|
-
labels: [
|
|
205
|
-
...candidate.retainedAnnouncedRunningLabels,
|
|
206
|
-
...candidate.newlyAnnouncedRunningLabels,
|
|
207
|
-
],
|
|
208
|
-
now: params.now,
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
199
|
}
|
|
212
200
|
};
|
|
213
201
|
|
|
@@ -381,7 +369,7 @@ export class NotifySilentLiveSessionsUseCase {
|
|
|
381
369
|
});
|
|
382
370
|
};
|
|
383
371
|
|
|
384
|
-
private composeCandidate =
|
|
372
|
+
private composeCandidate = (
|
|
385
373
|
snapshot: LiveSessionActivitySnapshot,
|
|
386
374
|
thresholds: {
|
|
387
375
|
mainSilentThresholdSeconds: number;
|
|
@@ -390,7 +378,7 @@ export class NotifySilentLiveSessionsUseCase {
|
|
|
390
378
|
subAgentRunningThresholdSeconds: number;
|
|
391
379
|
now: Date;
|
|
392
380
|
},
|
|
393
|
-
):
|
|
381
|
+
): NotifyCandidate | null => {
|
|
394
382
|
const sections: string[] = [];
|
|
395
383
|
|
|
396
384
|
const mainSilentSeconds = snapshot.mainSilentSeconds;
|
|
@@ -421,20 +409,24 @@ export class NotifySilentLiveSessionsUseCase {
|
|
|
421
409
|
!subAgent.waitingOnExternalProcess &&
|
|
422
410
|
subAgent.silentSeconds >= thresholds.subAgentSilentThresholdSeconds,
|
|
423
411
|
);
|
|
412
|
+
// The long-running advisory is gated on output recency, mirroring the
|
|
413
|
+
// idle branch: a sub-agent that produced output recently is working, no
|
|
414
|
+
// matter how long it has been running, so it is never selected. Only a
|
|
415
|
+
// sub-agent that is BOTH long-running and quiet (and not waiting on a
|
|
416
|
+
// live external process) qualifies, and it is re-selected on EVERY cycle
|
|
417
|
+
// while the condition holds — there is intentionally no fire-once state
|
|
418
|
+
// and no time-window suppression, matching the idle-branch semantics.
|
|
424
419
|
const longRunningSubAgents = snapshot.subAgents.filter(
|
|
425
420
|
(subAgent) =>
|
|
426
|
-
subAgent.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
await this.reconcileAnnouncedRunningLabels(snapshot, thresholds.now);
|
|
430
|
-
const newlyLongRunningSubAgents = longRunningSubAgents.filter(
|
|
431
|
-
(subAgent) => !retainedAnnouncedRunningLabels.includes(subAgent.label),
|
|
421
|
+
!subAgent.waitingOnExternalProcess &&
|
|
422
|
+
subAgent.runningSeconds >= thresholds.subAgentRunningThresholdSeconds &&
|
|
423
|
+
subAgent.silentSeconds >= thresholds.subAgentSilentThresholdSeconds,
|
|
432
424
|
);
|
|
433
|
-
if (idleSubAgents.length > 0 ||
|
|
425
|
+
if (idleSubAgents.length > 0 || longRunningSubAgents.length > 0) {
|
|
434
426
|
sections.push(
|
|
435
427
|
this.messageComposer.composeSubAgentSection({
|
|
436
428
|
idleSubAgents,
|
|
437
|
-
longRunningSubAgents
|
|
429
|
+
longRunningSubAgents,
|
|
438
430
|
}),
|
|
439
431
|
);
|
|
440
432
|
}
|
|
@@ -445,34 +437,6 @@ export class NotifySilentLiveSessionsUseCase {
|
|
|
445
437
|
return {
|
|
446
438
|
sessionName: snapshot.sessionName,
|
|
447
439
|
message: sections.join('\n\n'),
|
|
448
|
-
newlyAnnouncedRunningLabels: newlyLongRunningSubAgents.map(
|
|
449
|
-
(subAgent) => subAgent.label,
|
|
450
|
-
),
|
|
451
|
-
retainedAnnouncedRunningLabels,
|
|
452
440
|
};
|
|
453
441
|
};
|
|
454
|
-
|
|
455
|
-
private reconcileAnnouncedRunningLabels = async (
|
|
456
|
-
snapshot: LiveSessionActivitySnapshot,
|
|
457
|
-
now: Date,
|
|
458
|
-
): Promise<string[]> => {
|
|
459
|
-
const announcedLabels =
|
|
460
|
-
await this.candidateStateRepository.loadAnnouncedRunningSubAgentLabels({
|
|
461
|
-
sessionName: snapshot.sessionName,
|
|
462
|
-
});
|
|
463
|
-
const currentLabels = new Set(
|
|
464
|
-
snapshot.subAgents.map((subAgent) => subAgent.label),
|
|
465
|
-
);
|
|
466
|
-
const retainedLabels = Array.from(announcedLabels).filter((label) =>
|
|
467
|
-
currentLabels.has(label),
|
|
468
|
-
);
|
|
469
|
-
if (retainedLabels.length !== announcedLabels.size) {
|
|
470
|
-
await this.candidateStateRepository.saveAnnouncedRunningSubAgentLabels({
|
|
471
|
-
sessionName: snapshot.sessionName,
|
|
472
|
-
labels: retainedLabels,
|
|
473
|
-
now,
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
return retainedLabels;
|
|
477
|
-
};
|
|
478
442
|
}
|
|
@@ -7,12 +7,4 @@ 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>;
|
|
18
10
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
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;
|
|
4
3
|
export declare class FileSystemSilentSessionCandidateStateRepository implements SilentSessionCandidateStateRepository {
|
|
5
4
|
private readonly stateFilePath;
|
|
6
5
|
private readonly retentionWindowSeconds;
|
|
@@ -13,17 +12,8 @@ export declare class FileSystemSilentSessionCandidateStateRepository implements
|
|
|
13
12
|
sessionNames: string[];
|
|
14
13
|
now: Date;
|
|
15
14
|
}) => Promise<void>;
|
|
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
15
|
private readState;
|
|
25
16
|
private readCandidateEntries;
|
|
26
|
-
private readAnnouncedRunningEntries;
|
|
27
17
|
private writeState;
|
|
28
18
|
}
|
|
29
19
|
//# sourceMappingURL=FileSystemSilentSessionCandidateStateRepository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileSystemSilentSessionCandidateStateRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qCAAqC,EAAE,MAAM,gFAAgF,CAAC;
|
|
1
|
+
{"version":3,"file":"FileSystemSilentSessionCandidateStateRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,qCAAqC,EAAE,MAAM,gFAAgF,CAAC;AAUvI,eAAO,MAAM,sCAAsC,QAAU,CAAC;AAe9D,qBAAa,+CAAgD,YAAW,qCAAqC;IAEzG,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,sBAAsB;gBADtB,aAAa,GAAE,MAA+B,EAC9C,sBAAsB,GAAE,MAA+C;IAG1F,+BAA+B,GAAU,QAAQ;QAC/C,GAAG,EAAE,IAAI,CAAC;QACV,oBAAoB,EAAE,MAAM,CAAC;KAC9B,KAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAYtB;IAEF,yBAAyB,GAAU,QAAQ;QACzC,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,GAAG,EAAE,IAAI,CAAC;KACX,KAAG,OAAO,CAAC,IAAI,CAAC,CAqBf;IAEF,OAAO,CAAC,SAAS,CAiBf;IAEF,OAAO,CAAC,oBAAoB,CAqB1B;IAEF,OAAO,CAAC,UAAU,CAMhB;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptSessionSubAgentActivityRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,4EAA4E,CAAC;AAC/H,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAC;AACvG,OAAO,EAAE,mCAAmC,EAAE,MAAM,8EAA8E,CAAC;AAuBnI,eAAO,MAAM,wBAAwB,GAAI,SAAS,MAAM,KAAG,MAIR,CAAC;
|
|
1
|
+
{"version":3,"file":"TranscriptSessionSubAgentActivityRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/TranscriptSessionSubAgentActivityRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,iCAAiC,EAAE,MAAM,4EAA4E,CAAC;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IAf5C,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CACD;gBAG3B,kCAAkC,EAAE,kCAAkC,EACtE,wCAAwC,EAAE,wCAAwC,EAClF,+BAA+B,EAAE,+BAA+B,EAChE,0BAA0B,EAAE,iCAAiC,EAC7D,uBAAuB,EAAE,uBAAuB,EAChD,sBAAsB,EAAE,mCAAmC,EAC3D,wBAAwB,EAAE,qCAAqC,EAC/D,eAAe,EAAE,4BAA4B,EAC7C,OAAO,EAAE,OAAO,EAChB,qBAAqB,GAAE,qBAAqB,GAAG,IAAW,EAC1D,4BAA4B,GAAE,yCAAyC,GAAG,IAAW,EACrF,yBAAyB,GAAE,yBAAyB,GAAG,IAAW;IAGrF,GAAG,GAAU,QAAQ;QACnB,0BAA0B,EAAE,MAAM,CAAC;QACnC,+BAA+B,EAAE,MAAM,CAAC;QACxC,8BAA8B,EAAE,MAAM,CAAC;QACvC,+BAA+B,EAAE,MAAM,CAAC;QACxC,cAAc,EAAE,MAAM,CAAC;QACvB,qCAAqC,EAAE,MAAM,CAAC;QAC9C,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;QACnC,4BAA4B,EAAE,MAAM,CAAC;QACrC,GAAG,EAAE,IAAI,CAAC;KACX,KAAG,OAAO,CAAC,IAAI,CAAC,CA0Gf;IAEF,OAAO,CAAC,eAAe,CAiErB;IAEF,OAAO,CAAC,yBAAyB,CA0C/B;IAEF,OAAO,CAAC,sBAAsB,CAImC;IAEjE,OAAO,CAAC,gBAAgB,CAmDtB;IAEF,OAAO,CAAC,gBAAgB,CAqEtB;CACH"}
|
|
@@ -7,13 +7,5 @@ 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>;
|
|
18
10
|
}
|
|
19
11
|
//# sourceMappingURL=SilentSessionCandidateStateRepository.d.ts.map
|
package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SilentSessionCandidateStateRepository.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qCAAqC;IACpD,+BAA+B,EAAE,CAAC,MAAM,EAAE;QACxC,GAAG,EAAE,IAAI,CAAC;QACV,oBAAoB,EAAE,MAAM,CAAC;KAC9B,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,yBAAyB,EAAE,CAAC,MAAM,EAAE;QAClC,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,GAAG,EAAE,IAAI,CAAC;KACX,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SilentSessionCandidateStateRepository.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qCAAqC;IACpD,+BAA+B,EAAE,CAAC,MAAM,EAAE;QACxC,GAAG,EAAE,IAAI,CAAC;QACV,oBAAoB,EAAE,MAAM,CAAC;KAC9B,KAAK,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3B,yBAAyB,EAAE,CAAC,MAAM,EAAE;QAClC,YAAY,EAAE,MAAM,EAAE,CAAC;QACvB,GAAG,EAAE,IAAI,CAAC;KACX,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrB"}
|