github-issue-tower-defence-management 2.45.0 → 2.45.2

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 (97) hide show
  1. package/README.md +3 -25
  2. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +0 -52
  3. package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
  4. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js +4 -49
  5. package/bin/adapter/entry-points/handlers/notifySilentTmuxSessions.js.map +1 -1
  6. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js +1 -231
  7. package/bin/domain/usecases/NotifySilentLiveSessionsUseCase.js.map +1 -1
  8. package/bin/domain/usecases/StaleTaskPullRequestCloseUseCase.js +2 -0
  9. package/bin/domain/usecases/StaleTaskPullRequestCloseUseCase.js.map +1 -1
  10. package/package.json +1 -1
  11. package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
  12. package/types/adapter/entry-points/handlers/notifySilentTmuxSessions.d.ts +1 -29
  13. package/types/adapter/entry-points/handlers/notifySilentTmuxSessions.d.ts.map +1 -1
  14. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts +0 -45
  15. package/types/domain/usecases/NotifySilentLiveSessionsUseCase.d.ts.map +1 -1
  16. package/types/domain/usecases/StaleTaskPullRequestCloseUseCase.d.ts +4 -4
  17. package/types/domain/usecases/StaleTaskPullRequestCloseUseCase.d.ts.map +1 -1
  18. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js +0 -71
  19. package/bin/adapter/repositories/ConfigurableSilentSessionMessageComposer.js.map +0 -1
  20. package/bin/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.js +0 -137
  21. package/bin/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.js.map +0 -1
  22. package/bin/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.js +0 -126
  23. package/bin/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.js.map +0 -1
  24. package/bin/adapter/repositories/FileSystemSubAgentLivenessResolver.js +0 -81
  25. package/bin/adapter/repositories/FileSystemSubAgentLivenessResolver.js.map +0 -1
  26. package/bin/adapter/repositories/FileSystemSubAgentSilentSecondsResolver.js +0 -67
  27. package/bin/adapter/repositories/FileSystemSubAgentSilentSecondsResolver.js.map +0 -1
  28. package/bin/adapter/repositories/FileSystemSubAgentTranscriptDirectoryResolver.js +0 -57
  29. package/bin/adapter/repositories/FileSystemSubAgentTranscriptDirectoryResolver.js.map +0 -1
  30. package/bin/adapter/repositories/NodeSubAgentProcessLister.js +0 -37
  31. package/bin/adapter/repositories/NodeSubAgentProcessLister.js.map +0 -1
  32. package/bin/adapter/repositories/ProcessListSessionSubAgentActivityRepository.js +0 -50
  33. package/bin/adapter/repositories/ProcessListSessionSubAgentActivityRepository.js.map +0 -1
  34. package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js +0 -382
  35. package/bin/adapter/repositories/TranscriptSessionSubAgentActivityRepository.js.map +0 -1
  36. package/bin/domain/entities/LiveSessionActivitySnapshot.js +0 -3
  37. package/bin/domain/entities/LiveSessionActivitySnapshot.js.map +0 -1
  38. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js +0 -49
  39. package/bin/domain/usecases/DefaultSilentSessionMessageComposer.js.map +0 -1
  40. package/bin/domain/usecases/adapter-interfaces/SessionSubAgentActivityRepository.js +0 -3
  41. package/bin/domain/usecases/adapter-interfaces/SessionSubAgentActivityRepository.js.map +0 -1
  42. package/bin/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.js +0 -3
  43. package/bin/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.js.map +0 -1
  44. package/bin/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.js +0 -3
  45. package/bin/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.js.map +0 -1
  46. package/bin/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.js +0 -3
  47. package/bin/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.js.map +0 -1
  48. package/bin/domain/usecases/adapter-interfaces/SubAgentLivenessResolver.js +0 -3
  49. package/bin/domain/usecases/adapter-interfaces/SubAgentLivenessResolver.js.map +0 -1
  50. package/bin/domain/usecases/adapter-interfaces/SubAgentProcessLister.js +0 -3
  51. package/bin/domain/usecases/adapter-interfaces/SubAgentProcessLister.js.map +0 -1
  52. package/bin/domain/usecases/adapter-interfaces/SubAgentSilentSecondsResolver.js +0 -3
  53. package/bin/domain/usecases/adapter-interfaces/SubAgentSilentSecondsResolver.js.map +0 -1
  54. package/bin/domain/usecases/adapter-interfaces/SubAgentTranscriptDirectoryResolver.js +0 -3
  55. package/bin/domain/usecases/adapter-interfaces/SubAgentTranscriptDirectoryResolver.js.map +0 -1
  56. package/bin/domain/usecases/silentSessionReminderSentinel.js +0 -12
  57. package/bin/domain/usecases/silentSessionReminderSentinel.js.map +0 -1
  58. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts +0 -18
  59. package/types/adapter/repositories/ConfigurableSilentSessionMessageComposer.d.ts.map +0 -1
  60. package/types/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.d.ts +0 -20
  61. package/types/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.d.ts.map +0 -1
  62. package/types/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.d.ts +0 -21
  63. package/types/adapter/repositories/FileSystemSilentSessionHubTaskStatusCacheRepository.d.ts.map +0 -1
  64. package/types/adapter/repositories/FileSystemSubAgentLivenessResolver.d.ts +0 -11
  65. package/types/adapter/repositories/FileSystemSubAgentLivenessResolver.d.ts.map +0 -1
  66. package/types/adapter/repositories/FileSystemSubAgentSilentSecondsResolver.d.ts +0 -9
  67. package/types/adapter/repositories/FileSystemSubAgentSilentSecondsResolver.d.ts.map +0 -1
  68. package/types/adapter/repositories/FileSystemSubAgentTranscriptDirectoryResolver.d.ts +0 -7
  69. package/types/adapter/repositories/FileSystemSubAgentTranscriptDirectoryResolver.d.ts.map +0 -1
  70. package/types/adapter/repositories/NodeSubAgentProcessLister.d.ts +0 -8
  71. package/types/adapter/repositories/NodeSubAgentProcessLister.d.ts.map +0 -1
  72. package/types/adapter/repositories/ProcessListSessionSubAgentActivityRepository.d.ts +0 -12
  73. package/types/adapter/repositories/ProcessListSessionSubAgentActivityRepository.d.ts.map +0 -1
  74. package/types/adapter/repositories/TranscriptSessionSubAgentActivityRepository.d.ts +0 -21
  75. package/types/adapter/repositories/TranscriptSessionSubAgentActivityRepository.d.ts.map +0 -1
  76. package/types/domain/entities/LiveSessionActivitySnapshot.d.ts +0 -12
  77. package/types/domain/entities/LiveSessionActivitySnapshot.d.ts.map +0 -1
  78. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts +0 -7
  79. package/types/domain/usecases/DefaultSilentSessionMessageComposer.d.ts.map +0 -1
  80. package/types/domain/usecases/adapter-interfaces/SessionSubAgentActivityRepository.d.ts +0 -5
  81. package/types/domain/usecases/adapter-interfaces/SessionSubAgentActivityRepository.d.ts.map +0 -1
  82. package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts +0 -11
  83. package/types/domain/usecases/adapter-interfaces/SilentSessionCandidateStateRepository.d.ts.map +0 -1
  84. package/types/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.d.ts +0 -19
  85. package/types/domain/usecases/adapter-interfaces/SilentSessionHubTaskStatusCacheRepository.d.ts.map +0 -1
  86. package/types/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.d.ts +0 -10
  87. package/types/domain/usecases/adapter-interfaces/SilentSessionMessageComposer.d.ts.map +0 -1
  88. package/types/domain/usecases/adapter-interfaces/SubAgentLivenessResolver.d.ts +0 -7
  89. package/types/domain/usecases/adapter-interfaces/SubAgentLivenessResolver.d.ts.map +0 -1
  90. package/types/domain/usecases/adapter-interfaces/SubAgentProcessLister.d.ts +0 -8
  91. package/types/domain/usecases/adapter-interfaces/SubAgentProcessLister.d.ts.map +0 -1
  92. package/types/domain/usecases/adapter-interfaces/SubAgentSilentSecondsResolver.d.ts +0 -4
  93. package/types/domain/usecases/adapter-interfaces/SubAgentSilentSecondsResolver.d.ts.map +0 -1
  94. package/types/domain/usecases/adapter-interfaces/SubAgentTranscriptDirectoryResolver.d.ts +0 -4
  95. package/types/domain/usecases/adapter-interfaces/SubAgentTranscriptDirectoryResolver.d.ts.map +0 -1
  96. package/types/domain/usecases/silentSessionReminderSentinel.d.ts +0 -2
  97. package/types/domain/usecases/silentSessionReminderSentinel.d.ts.map +0 -1
@@ -19,7 +19,9 @@ class StaleTaskPullRequestCloseUseCase {
19
19
  if (!everyReferencedTaskIssueClosed) {
20
20
  continue;
21
21
  }
22
+ const closedRefs = issue.closingIssueReferenceUrls.join(', ');
22
23
  try {
24
+ await this.issueRepository.createCommentByUrl(issue.url, `Closing this pull request because all referenced task issues are already closed: ${closedRefs}`);
23
25
  await this.issueRepository.closePullRequest(issue.url);
24
26
  }
25
27
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"StaleTaskPullRequestCloseUseCase.js","sourceRoot":"","sources":["../../../src/domain/usecases/StaleTaskPullRequestCloseUseCase.ts"],"names":[],"mappings":";;;AAGA,MAAa,gCAAgC;IAC3C,YACW,eAA0D;QAA1D,oBAAe,GAAf,eAAe,CAA2C;QAGrE,QAAG,GAAG,KAAK,EAAE,KAA0B,EAAiB,EAAE;YACxD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,KAAK,CAAC,MAAM;iBACT,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC;iBAChD,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAC7B,CAAC;YACF,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBACjC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;oBAClC,SAAS;gBACX,CAAC;gBACD,IAAI,KAAK,CAAC,yBAAyB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACjD,SAAS;gBACX,CAAC;gBACD,MAAM,8BAA8B,GAClC,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAC5C,mBAAmB,CAAC,GAAG,CAAC,GAAG,CAAC,CAC7B,CAAC;gBACJ,IAAI,CAAC,8BAA8B,EAAE,CAAC;oBACpC,SAAS;gBACX,CAAC;gBACD,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzD,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,CAAC,IAAI,CACV,sCAAsC,KAAK,CAAC,GAAG,2DAA2D,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CACnK,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC,CAAC;IA9BC,CAAC;CA+BL;AAlCD,4EAkCC"}
1
+ {"version":3,"file":"StaleTaskPullRequestCloseUseCase.js","sourceRoot":"","sources":["../../../src/domain/usecases/StaleTaskPullRequestCloseUseCase.ts"],"names":[],"mappings":";;;AAGA,MAAa,gCAAgC;IAC3C,YACW,eAGR;QAHQ,oBAAe,GAAf,eAAe,CAGvB;QAGH,QAAG,GAAG,KAAK,EAAE,KAA0B,EAAiB,EAAE;YACxD,MAAM,mBAAmB,GAAG,IAAI,GAAG,CACjC,KAAK,CAAC,MAAM;iBACT,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,QAAQ,CAAC;iBA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": "2.45.2",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- {"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"AAqDA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AA2D3D,qBAAa,kCAAkC;IAC7C,MAAM,GACJ,gBAAgB,MAAM,EACtB,UAAU,OAAO,EACjB,6BAA4B,MAAM,EAAE,GAAG,IAAW,KACjD,OAAO,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,IAAI,EAAE,CAAC;KACzB,GAAG,IAAI,CAAC,CAi0BP;CACH"}
1
+ {"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"AAgDA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AA2D3D,qBAAa,kCAAkC;IAC7C,MAAM,GACJ,gBAAgB,MAAM,EACtB,UAAU,OAAO,EACjB,6BAA4B,MAAM,EAAE,GAAG,IAAW,KACjD,OAAO,CAAC;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,IAAI,EAAE,CAAC;KACzB,GAAG,IAAI,CAAC,CAguBP;CACH"}
@@ -1,34 +1,6 @@
1
- import { LocalCommandRunner } from '../../../domain/usecases/adapter-interfaces/LocalCommandRunner';
2
- import { ProcessEnvironReader } from '../../../domain/usecases/adapter-interfaces/ProcessEnvironReader';
3
- import { HubTaskStatusResolver } from '../../../domain/usecases/NotifySilentLiveSessionsUseCase';
4
- import { SilentSessionMessageTemplates } from '../../repositories/ConfigurableSilentSessionMessageComposer';
5
1
  export type NotifySilentTmuxSessionsParams = {
6
2
  enabled: boolean;
7
- localCommandRunner: LocalCommandRunner;
8
- processEnvironReader?: ProcessEnvironReader;
9
- subAgentOutputRootDirectory: string | null;
10
- subAgentProcessMatchPattern: string | null;
11
- subAgentTranscriptRootDirectory: string | null;
12
- subAgentRuntimeRootDirectory: string | null;
13
- subAgentSilentThresholdSeconds: number;
14
- subAgentRunningThresholdSeconds: number;
15
- staggerSeconds: number;
16
- candidateDebounceRecencyWindowSeconds: number;
17
- candidateDebounceStateFilePath: string | null;
18
- activeHubTaskStatus: string | null;
19
- hubTaskStatusResolver: HubTaskStatusResolver | null;
20
- hubTaskStatusCacheStateFilePath: string | null;
21
- hubTaskStatusCacheTtlSeconds: number;
22
- messageTemplates: SilentSessionMessageTemplates;
23
- submitPushOutWaitMilliseconds?: number;
24
- now: Date;
25
3
  };
26
4
  export declare const notifySilentTmuxSessions: (params: NotifySilentTmuxSessionsParams) => Promise<void>;
27
- export declare const DEFAULT_NOTIFY_SILENT_TMUX_SESSIONS_PARAMS: {
28
- readonly subAgentSilentThresholdSeconds: number;
29
- readonly subAgentRunningThresholdSeconds: number;
30
- readonly staggerSeconds: 25;
31
- readonly candidateDebounceRecencyWindowSeconds: number;
32
- readonly hubTaskStatusCacheTtlSeconds: number;
33
- };
5
+ export declare const DEFAULT_NOTIFY_SILENT_TMUX_SESSIONS_PARAMS: {};
34
6
  //# sourceMappingURL=notifySilentTmuxSessions.d.ts.map
@@ -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;AAEpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,kEAAkE,CAAC;AACxG,OAAO,EAEL,qBAAqB,EAMtB,MAAM,0DAA0D,CAAC;AAiBlE,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,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,2BAA2B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,4BAA4B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,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,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AA+BF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,IAAI,CA6Ed,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;;;;CAO7C,CAAC"}
1
+ {"version":3,"file":"notifySilentTmuxSessions.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/notifySilentTmuxSessions.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,8BAA8B,GAAG;IAC3C,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,IAAI,CAUd,CAAC;AAEF,eAAO,MAAM,0CAA0C,IAAc,CAAC"}
@@ -1,47 +1,2 @@
1
- import { LiveSessionProcessSnapshotProvider } from './adapter-interfaces/LiveSessionProcessSnapshotProvider';
2
- import { InteractiveLiveSessionTranscriptResolver } from './adapter-interfaces/InteractiveLiveSessionTranscriptResolver';
3
- import { RefusalTailStatusProvider } from './adapter-interfaces/RefusalTailStatusProvider';
4
- import { SessionSubAgentActivityRepository } from './adapter-interfaces/SessionSubAgentActivityRepository';
5
- import { SilentSessionMessageComposer } from './adapter-interfaces/SilentSessionMessageComposer';
6
- import { SilentSessionNotificationRepository } from './adapter-interfaces/SilentSessionNotificationRepository';
7
- import { SilentSessionCandidateStateRepository } from './adapter-interfaces/SilentSessionCandidateStateRepository';
8
- import { SilentSessionHubTaskStatusCacheRepository } from './adapter-interfaces/SilentSessionHubTaskStatusCacheRepository';
9
- import { Sleeper } from './adapter-interfaces/Sleeper';
10
- import { IssueRepository } from './adapter-interfaces/IssueRepository';
11
- export declare const DEFAULT_SUBAGENT_SILENT_THRESHOLD_SECONDS: number;
12
- export declare const DEFAULT_SUBAGENT_RUNNING_THRESHOLD_SECONDS: number;
13
- export declare const DEFAULT_NOTIFICATION_STAGGER_SECONDS = 25;
14
- export declare const DEFAULT_CANDIDATE_DEBOUNCE_RECENCY_WINDOW_SECONDS: number;
15
- export declare const DEFAULT_HUB_TASK_STATUS_CACHE_TTL_SECONDS: number;
16
- export declare const parseHubTaskIssueUrlFromSessionName: (sessionName: string) => string | null;
17
1
  export declare const isGitHubIssueOrPullRequestSessionName: (sessionName: string) => boolean;
18
- export type HubTaskStatusResolver = Pick<IssueRepository, 'getIssueByUrl'>;
19
- export declare class NotifySilentLiveSessionsUseCase {
20
- private readonly liveSessionProcessSnapshotProvider;
21
- private readonly interactiveLiveSessionTranscriptResolver;
22
- private readonly subAgentActivityRepository;
23
- private readonly notificationRepository;
24
- private readonly candidateStateRepository;
25
- private readonly messageComposer;
26
- private readonly sleeper;
27
- private readonly hubTaskStatusResolver;
28
- private readonly hubTaskStatusCacheRepository;
29
- private readonly refusalTailStatusProvider;
30
- private readonly resolveInteractiveLiveSessions;
31
- constructor(liveSessionProcessSnapshotProvider: LiveSessionProcessSnapshotProvider, interactiveLiveSessionTranscriptResolver: InteractiveLiveSessionTranscriptResolver, subAgentActivityRepository: SessionSubAgentActivityRepository, notificationRepository: SilentSessionNotificationRepository, candidateStateRepository: SilentSessionCandidateStateRepository, messageComposer: SilentSessionMessageComposer, sleeper: Sleeper, hubTaskStatusResolver?: HubTaskStatusResolver | null, hubTaskStatusCacheRepository?: SilentSessionHubTaskStatusCacheRepository | null, refusalTailStatusProvider?: RefusalTailStatusProvider | null);
32
- run: (params: {
33
- subAgentSilentThresholdSeconds: number;
34
- subAgentRunningThresholdSeconds: number;
35
- staggerSeconds: number;
36
- candidateDebounceRecencyWindowSeconds: number;
37
- activeHubTaskStatus: string | null;
38
- hubTaskStatusCacheTtlSeconds: number;
39
- now: Date;
40
- }) => Promise<void>;
41
- private isHubTaskActive;
42
- private tryResolveAndCacheHubTask;
43
- private isResolvedStatusActive;
44
- private collectSnapshots;
45
- private composeCandidate;
46
- }
47
2
  //# sourceMappingURL=NotifySilentLiveSessionsUseCase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"NotifySilentLiveSessionsUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/NotifySilentLiveSessionsUseCase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kCAAkC,EAAE,MAAM,yDAAyD,CAAC;AAC7G,OAAO,EAAE,wCAAwC,EAAE,MAAM,+DAA+D,CAAC;AACzH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAE,iCAAiC,EAAE,MAAM,wDAAwD,CAAC;AAC3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EAAE,wCAAwC,EAClF,0BAA0B,EAAE,iCAAiC,EAC7D,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,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,CA6Hf;IAEF,OAAO,CAAC,eAAe,CAiErB;IAEF,OAAO,CAAC,yBAAyB,CA0C/B;IAEF,OAAO,CAAC,sBAAsB,CAImC;IAEjE,OAAO,CAAC,gBAAgB,CAkBtB;IAEF,OAAO,CAAC,gBAAgB,CA6DtB;CACH"}
1
+ {"version":3,"file":"NotifySilentLiveSessionsUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/NotifySilentLiveSessionsUseCase.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qCAAqC,GAChD,aAAa,MAAM,KAClB,OACkE,CAAC"}
@@ -1,8 +1,8 @@
1
- import { Issue } from '../entities/Issue';
2
- import { IssueRepository } from './adapter-interfaces/IssueRepository';
1
+ import type { Issue } from '../entities/Issue';
2
+ import type { IssueRepository } from './adapter-interfaces/IssueRepository';
3
3
  export declare class StaleTaskPullRequestCloseUseCase {
4
- readonly issueRepository: Pick<IssueRepository, 'closePullRequest'>;
5
- constructor(issueRepository: Pick<IssueRepository, 'closePullRequest'>);
4
+ readonly issueRepository: Pick<IssueRepository, 'closePullRequest' | 'createCommentByUrl'>;
5
+ constructor(issueRepository: Pick<IssueRepository, 'closePullRequest' | 'createCommentByUrl'>);
6
6
  run: (input: {
7
7
  issues: Issue[];
8
8
  }) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"StaleTaskPullRequestCloseUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/StaleTaskPullRequestCloseUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,qBAAa,gCAAgC;IAEzC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC;gBAA1D,eAAe,EAAE,IAAI,CAAC,eAAe,EAAE,kBAAkB,CAAC;IAGrE,GAAG,GAAU,OAAO;QAAE,MAAM,EAAE,KAAK,EAAE,CAAA;KAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CA4BrD;CACH"}
1
+ {"version":3,"file":"StaleTaskPullRequestCloseUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/StaleTaskPullRequestCloseUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,qBAAa,gCAAgC;IAEzC,QAAQ,CAAC,eAAe,EAAE,IAAI,CAC5B,eAAe,EACf,kBAAkB,GAAG,oBAAoB,CAC1C;gBAHQ,eAAe,EAAE,IAAI,CAC5B,eAAe,EACf,kBAAkB,GAAG,oBAAoB,CAC1C;IAGH,GAAG,GAAU,OAAO;QAAE,MAAM,EAAE,KAAK,EAAE,CAAA;KAAE,KAAG,OAAO,CAAC,IAAI,CAAC,CAiCrD;CACH"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ConfigurableSilentSessionMessageComposer = void 0;
4
- const silentSessionReminderSentinel_1 = require("../../domain/usecases/silentSessionReminderSentinel");
5
- const withReminderSentinel = (message) => message.includes(silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL)
6
- ? message
7
- : `${silentSessionReminderSentinel_1.SILENT_SESSION_REMINDER_SENTINEL} ${message}`;
8
- const formatMinutes = (seconds) => {
9
- const minutes = Math.floor(seconds / 60);
10
- return `${minutes}m`;
11
- };
12
- class ConfigurableSilentSessionMessageComposer {
13
- constructor(templates, fallback) {
14
- this.templates = templates;
15
- this.fallback = fallback;
16
- this.composeSubAgentSection = (stallSections) => {
17
- const hasIdleTemplate = this.templates.subAgentIdleMessageHeader !== null ||
18
- this.templates.subAgentIdleMessageFooter !== null;
19
- const hasLongRunningTemplate = this.templates.subAgentLongRunningMessageHeader !== null ||
20
- this.templates.subAgentLongRunningMessageFooter !== null;
21
- if (!hasIdleTemplate && !hasLongRunningTemplate) {
22
- return this.fallback.composeSubAgentSection(stallSections);
23
- }
24
- const { idleSubAgents, longRunningSubAgents } = stallSections;
25
- const sections = [];
26
- if (idleSubAgents.length > 0 && hasIdleTemplate) {
27
- sections.push(this.composeIdleSection(idleSubAgents, this.templates.subAgentIdleMessageHeader, this.templates.subAgentIdleMessageFooter));
28
- }
29
- else if (idleSubAgents.length > 0) {
30
- sections.push(this.fallback.composeSubAgentSection({
31
- idleSubAgents,
32
- longRunningSubAgents: [],
33
- }));
34
- }
35
- if (longRunningSubAgents.length > 0 && hasLongRunningTemplate) {
36
- sections.push(this.composeLongRunningSection(longRunningSubAgents, this.templates.subAgentLongRunningMessageHeader, this.templates.subAgentLongRunningMessageFooter));
37
- }
38
- else if (longRunningSubAgents.length > 0) {
39
- sections.push(this.composeLongRunningSection(longRunningSubAgents, null, null));
40
- }
41
- return withReminderSentinel(sections.join('\n\n'));
42
- };
43
- this.composeSubAgentUnconsumedResultSection = (unconsumedResultSubAgents) => this.fallback.composeSubAgentUnconsumedResultSection(unconsumedResultSubAgents);
44
- this.composeIdleSection = (idleSubAgents, header, footer) => {
45
- const lines = idleSubAgents.map((subAgent) => `- ${subAgent.label}: no output for ${formatMinutes(subAgent.silentSeconds)}`);
46
- const parts = [];
47
- if (header !== null) {
48
- parts.push(header);
49
- }
50
- parts.push(...lines);
51
- if (footer !== null) {
52
- parts.push(footer);
53
- }
54
- return parts.join('\n');
55
- };
56
- this.composeLongRunningSection = (longRunningSubAgents, header, footer) => {
57
- const lines = longRunningSubAgents.map((subAgent) => `- ${subAgent.label}: running for ${formatMinutes(subAgent.runningSeconds)}`);
58
- const parts = [];
59
- if (header !== null) {
60
- parts.push(header);
61
- }
62
- parts.push(...lines);
63
- if (footer !== null) {
64
- parts.push(footer);
65
- }
66
- return parts.join('\n');
67
- };
68
- }
69
- }
70
- exports.ConfigurableSilentSessionMessageComposer = ConfigurableSilentSessionMessageComposer;
71
- //# sourceMappingURL=ConfigurableSilentSessionMessageComposer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ConfigurableSilentSessionMessageComposer.js","sourceRoot":"","sources":["../../../src/adapter/repositories/ConfigurableSilentSessionMessageComposer.ts"],"names":[],"mappings":";;;AAKA,uGAAuG;AAEvG,MAAM,oBAAoB,GAAG,CAAC,OAAe,EAAU,EAAE,CACvD,OAAO,CAAC,QAAQ,CAAC,gEAAgC,CAAC;IAChD,CAAC,CAAC,OAAO;IACT,CAAC,CAAC,GAAG,gEAAgC,IAAI,OAAO,EAAE,CAAC;AASvD,MAAM,aAAa,GAAG,CAAC,OAAe,EAAU,EAAE;IAChD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAC;IACzC,OAAO,GAAG,OAAO,GAAG,CAAC;AACvB,CAAC,CAAC;AAEF,MAAa,wCAAwC;IACnD,YACmB,SAAwC,EACxC,QAAsC;QADtC,cAAS,GAAT,SAAS,CAA+B;QACxC,aAAQ,GAAR,QAAQ,CAA8B;QA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,MAAM,KAAK,GAAa,EAAE,CAAC;YAC3B,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,CAAC;YACD,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;YACrB,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;gBACpB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,CAAC;YACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC,CAAC;IA7FC,CAAC;CA8FL;AAlGD,4FAkGC"}
@@ -1,137 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FileSystemSilentSessionCandidateStateRepository = exports.defaultSilentSessionCandidateStateFilePath = exports.DEFAULT_STATE_RETENTION_WINDOW_SECONDS = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- const localStorageCacheDirectory_1 = require("./localStorageCacheDirectory");
40
- const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
41
- exports.DEFAULT_STATE_RETENTION_WINDOW_SECONDS = 60 * 60;
42
- const defaultSilentSessionCandidateStateFilePath = () => path.join((0, localStorageCacheDirectory_1.tdpmCacheDirectory)(), 'silent-session-candidates.json');
43
- exports.defaultSilentSessionCandidateStateFilePath = defaultSilentSessionCandidateStateFilePath;
44
- // Persists only the candidate set used by the two-consecutive-cycle
45
- // debounce. The formerly persisted announced-running-sub-agent labels
46
- // (fire-once state for the long-running advisory) were removed: the
47
- // long-running advisory now re-fires on every qualifying cycle, so no
48
- // per-label announcement state exists anymore. An old state file that
49
- // still contains an `announcedRunningSubAgents` key is read without
50
- // error (unknown keys are ignored) and the key is dropped on the next
51
- // write.
52
- class FileSystemSilentSessionCandidateStateRepository {
53
- constructor(stateFilePath = (0, exports.defaultSilentSessionCandidateStateFilePath)(), retentionWindowSeconds = exports.DEFAULT_STATE_RETENTION_WINDOW_SECONDS) {
54
- this.stateFilePath = stateFilePath;
55
- this.retentionWindowSeconds = retentionWindowSeconds;
56
- this.loadRecentCandidateSessionNames = async (params) => {
57
- const nowEpochSeconds = Math.floor(params.now.getTime() / 1000);
58
- const oldestAllowedEpochSeconds = nowEpochSeconds - params.recencyWindowSeconds;
59
- const entries = this.readCandidateEntries();
60
- const recentSessionNames = new Set();
61
- for (const entry of entries) {
62
- if (entry.recordedEpochSeconds >= oldestAllowedEpochSeconds) {
63
- recentSessionNames.add(entry.sessionName);
64
- }
65
- }
66
- return recentSessionNames;
67
- };
68
- this.saveCandidateSessionNames = async (params) => {
69
- const recordedEpochSeconds = Math.floor(params.now.getTime() / 1000);
70
- const oldestRetainedEpochSeconds = recordedEpochSeconds - this.retentionWindowSeconds;
71
- const currentSessionNames = new Set(params.sessionNames);
72
- const mergedBySessionName = new Map();
73
- for (const entry of this.readCandidateEntries()) {
74
- if (entry.recordedEpochSeconds >= oldestRetainedEpochSeconds &&
75
- !currentSessionNames.has(entry.sessionName)) {
76
- mergedBySessionName.set(entry.sessionName, entry);
77
- }
78
- }
79
- for (const sessionName of currentSessionNames) {
80
- mergedBySessionName.set(sessionName, {
81
- sessionName,
82
- recordedEpochSeconds,
83
- });
84
- }
85
- this.writeState(Array.from(mergedBySessionName.values()));
86
- };
87
- this.readState = () => {
88
- let raw;
89
- try {
90
- raw = fs.readFileSync(this.stateFilePath, 'utf8');
91
- }
92
- catch {
93
- return {};
94
- }
95
- let parsed;
96
- try {
97
- parsed = JSON.parse(raw);
98
- }
99
- catch {
100
- return {};
101
- }
102
- if (!isRecord(parsed)) {
103
- return {};
104
- }
105
- return parsed;
106
- };
107
- this.readCandidateEntries = () => {
108
- const storedEntries = this.readState().candidates;
109
- if (!Array.isArray(storedEntries)) {
110
- return [];
111
- }
112
- const entries = [];
113
- for (const storedEntry of storedEntries) {
114
- if (!isRecord(storedEntry)) {
115
- continue;
116
- }
117
- const sessionName = storedEntry.sessionName;
118
- const recordedEpochSeconds = storedEntry.recordedEpochSeconds;
119
- if (typeof sessionName === 'string' &&
120
- typeof recordedEpochSeconds === 'number' &&
121
- Number.isFinite(recordedEpochSeconds)) {
122
- entries.push({ sessionName, recordedEpochSeconds });
123
- }
124
- }
125
- return entries;
126
- };
127
- this.writeState = (candidates) => {
128
- const directory = path.dirname(this.stateFilePath);
129
- fs.mkdirSync(directory, { recursive: true });
130
- const temporaryPath = `${this.stateFilePath}.${process.pid}.tmp`;
131
- fs.writeFileSync(temporaryPath, JSON.stringify({ candidates }));
132
- fs.renameSync(temporaryPath, this.stateFilePath);
133
- };
134
- }
135
- }
136
- exports.FileSystemSilentSessionCandidateStateRepository = FileSystemSilentSessionCandidateStateRepository;
137
- //# sourceMappingURL=FileSystemSilentSessionCandidateStateRepository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileSystemSilentSessionCandidateStateRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemSilentSessionCandidateStateRepository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,6EAAkE;AAOlE,MAAM,QAAQ,GAAG,CAAC,KAAc,EAAoC,EAAE,CACpE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAE1D,QAAA,sCAAsC,GAAG,EAAE,GAAG,EAAE,CAAC;AAEvD,MAAM,0CAA0C,GAAG,GAAW,EAAE,CACrE,IAAI,CAAC,IAAI,CAAC,IAAA,+CAAkB,GAAE,EAAE,gCAAgC,CAAC,CAAC;AADvD,QAAA,0CAA0C,8CACa;AAEpE,oEAAoE;AACpE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AACtE,SAAS;AACT,MAAa,+CAA+C;IAC1D,YACmB,gBAAwB,IAAA,kDAA0C,GAAE,EACpE,yBAAiC,8CAAsC;QADvE,kBAAa,GAAb,aAAa,CAAuD;QACpE,2BAAsB,GAAtB,sBAAsB,CAAiD;QAG1F,oCAA+B,GAAG,KAAK,EAAE,MAGxC,EAAwB,EAAE;YACzB,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;YAChE,MAAM,yBAAyB,GAC7B,eAAe,GAAG,MAAM,CAAC,oBAAoB,CAAC;YAChD,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC5C,MAAM,kBAAkB,GAAG,IAAI,GAAG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,GAAG,CAAC,UAAkC,EAAQ,EAAE;YAChE,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACnD,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YAC7C,MAAM,aAAa,GAAG,GAAG,IAAI,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,MAAM,CAAC;YACjE,EAAE,CAAC,aAAa,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC;YAChE,EAAE,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACnD,CAAC,CAAC;IA7FC,CAAC;CA8FL;AAlGD,0GAkGC"}
@@ -1,126 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FileSystemSilentSessionHubTaskStatusCacheRepository = exports.defaultSilentSessionHubTaskStatusCacheFilePath = exports.DEFAULT_HUB_TASK_STATUS_RETENTION_WINDOW_SECONDS = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- const localStorageCacheDirectory_1 = require("./localStorageCacheDirectory");
40
- const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
41
- const isIssueState = (value) => value === 'OPEN' || value === 'CLOSED' || value === 'MERGED';
42
- exports.DEFAULT_HUB_TASK_STATUS_RETENTION_WINDOW_SECONDS = 60 * 60;
43
- const defaultSilentSessionHubTaskStatusCacheFilePath = () => path.join((0, localStorageCacheDirectory_1.tdpmCacheDirectory)(), 'silent-session-hub-task-status.json');
44
- exports.defaultSilentSessionHubTaskStatusCacheFilePath = defaultSilentSessionHubTaskStatusCacheFilePath;
45
- class FileSystemSilentSessionHubTaskStatusCacheRepository {
46
- constructor(stateFilePath = (0, exports.defaultSilentSessionHubTaskStatusCacheFilePath)(), retentionWindowSeconds = exports.DEFAULT_HUB_TASK_STATUS_RETENTION_WINDOW_SECONDS) {
47
- this.stateFilePath = stateFilePath;
48
- this.retentionWindowSeconds = retentionWindowSeconds;
49
- this.loadHubTaskStatus = async (params) => {
50
- for (const entry of this.readEntries()) {
51
- if (entry.url === params.url) {
52
- return entry;
53
- }
54
- }
55
- return null;
56
- };
57
- this.saveHubTaskStatus = async (params) => {
58
- const recordedEpochSeconds = Math.floor(params.now.getTime() / 1000);
59
- const oldestRetainedEpochSeconds = recordedEpochSeconds - this.retentionWindowSeconds;
60
- const mergedByUrl = new Map();
61
- for (const entry of this.readEntries()) {
62
- if (entry.recordedEpochSeconds >= oldestRetainedEpochSeconds &&
63
- entry.url !== params.url) {
64
- mergedByUrl.set(entry.url, entry);
65
- }
66
- }
67
- mergedByUrl.set(params.url, {
68
- url: params.url,
69
- state: params.state,
70
- status: params.status,
71
- recordedEpochSeconds,
72
- });
73
- this.writeEntries(Array.from(mergedByUrl.values()));
74
- };
75
- this.readEntries = () => {
76
- let raw;
77
- try {
78
- raw = fs.readFileSync(this.stateFilePath, 'utf8');
79
- }
80
- catch {
81
- return [];
82
- }
83
- let parsed;
84
- try {
85
- parsed = JSON.parse(raw);
86
- }
87
- catch {
88
- return [];
89
- }
90
- if (!isRecord(parsed)) {
91
- return [];
92
- }
93
- const storedEntries = parsed.hubTaskStatuses;
94
- if (!Array.isArray(storedEntries)) {
95
- return [];
96
- }
97
- const entries = [];
98
- for (const storedEntry of storedEntries) {
99
- if (!isRecord(storedEntry)) {
100
- continue;
101
- }
102
- const url = storedEntry.url;
103
- const state = storedEntry.state;
104
- const status = storedEntry.status;
105
- const recordedEpochSeconds = storedEntry.recordedEpochSeconds;
106
- if (typeof url === 'string' &&
107
- isIssueState(state) &&
108
- (typeof status === 'string' || status === null) &&
109
- typeof recordedEpochSeconds === 'number' &&
110
- Number.isFinite(recordedEpochSeconds)) {
111
- entries.push({ url, state, status, recordedEpochSeconds });
112
- }
113
- }
114
- return entries;
115
- };
116
- this.writeEntries = (entries) => {
117
- const directory = path.dirname(this.stateFilePath);
118
- fs.mkdirSync(directory, { recursive: true });
119
- const temporaryPath = `${this.stateFilePath}.${process.pid}.tmp`;
120
- fs.writeFileSync(temporaryPath, JSON.stringify({ hubTaskStatuses: entries }));
121
- fs.renameSync(temporaryPath, this.stateFilePath);
122
- };
123
- }
124
- }
125
- exports.FileSystemSilentSessionHubTaskStatusCacheRepository = FileSystemSilentSessionHubTaskStatusCacheRepository;
126
- //# sourceMappingURL=FileSystemSilentSessionHubTaskStatusCacheRepository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileSystemSilentSessionHubTaskStatusCacheRepository.js","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSyst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AAO,EAAE,CAAC,CAC7C,CAAC;YACF,EAAE,CAAC,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACnD,CAAC,CAAC;IA7FC,CAAC;CA8FL;AAlGD,kHAkGC"}
@@ -1,81 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FileSystemSubAgentLivenessResolver = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- const RUNNING_SUBAGENTS_FILE_NAME = 'running-subagents.txt';
40
- class FileSystemSubAgentLivenessResolver {
41
- constructor(runtimeRootDirectory) {
42
- this.runtimeRootDirectory = runtimeRootDirectory;
43
- this.resolveLiveSubAgentIds = async (params) => {
44
- const runningFilePath = this.resolveRunningSubAgentsFilePath(params.mainTranscriptPath);
45
- if (runningFilePath === null) {
46
- return null;
47
- }
48
- let content;
49
- try {
50
- content = fs.readFileSync(runningFilePath, 'utf8');
51
- }
52
- catch {
53
- return null;
54
- }
55
- const liveIds = new Set();
56
- for (const line of content.split('\n')) {
57
- const agentId = line.trim().split(/\s+/)[0];
58
- if (agentId.length > 0) {
59
- liveIds.add(agentId);
60
- }
61
- }
62
- return liveIds;
63
- };
64
- this.resolveRunningSubAgentsFilePath = (mainTranscriptPath) => {
65
- if (this.runtimeRootDirectory === null || mainTranscriptPath === null) {
66
- return null;
67
- }
68
- const sessionUuid = path.basename(mainTranscriptPath, '.jsonl');
69
- if (sessionUuid.length === 0 || sessionUuid.endsWith('.jsonl')) {
70
- return null;
71
- }
72
- const cwdSlug = path.basename(path.dirname(mainTranscriptPath));
73
- if (cwdSlug.length === 0 || cwdSlug === '.') {
74
- return null;
75
- }
76
- return path.join(this.runtimeRootDirectory, cwdSlug, sessionUuid, RUNNING_SUBAGENTS_FILE_NAME);
77
- };
78
- }
79
- }
80
- exports.FileSystemSubAgentLivenessResolver = FileSystemSubAgentLivenessResolver;
81
- //# sourceMappingURL=FileSystemSubAgentLivenessResolver.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FileSystemSubAgentLivenessResolver.js","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemSubAgentLivenessResolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAG7B,MAAM,2BAA2B,GAAG,uBAAuB,CAAC;AAE5D,MAAa,kCAAkC;IAC7C,YAA6B,oBAAmC;QAAnC,yBAAoB,GAApB,oBAAoB,CAAe;QAEhE,2BAAsB,GAAG,KAAK,EAAE,MAG/B,EAA+B,EAAE;YAChC,MAAM,eAAe,GAAG,IAAI,CAAC,+BAA+B,CAC1D,MAAM,CAAC,k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