github-issue-tower-defence-management 1.136.0 → 1.137.1
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 +19 -0
- package/README.md +7 -0
- package/bin/adapter/entry-points/cli/index.js +24 -0
- package/bin/adapter/entry-points/cli/index.js.map +1 -1
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js +1 -0
- package/bin/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.js.map +1 -1
- package/bin/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.js +2 -2
- package/bin/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.js.map +1 -1
- package/bin/adapter/repositories/NodeTmuxSessionRepository.js +51 -6
- package/bin/adapter/repositories/NodeTmuxSessionRepository.js.map +1 -1
- package/bin/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.js +10 -0
- package/bin/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.js.map +1 -0
- package/bin/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.js +1 -1
- package/bin/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.js.map +1 -1
- package/bin/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.js +6 -1
- package/bin/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.js.map +1 -1
- package/package.json +1 -1
- package/src/adapter/entry-points/cli/index.test.ts +118 -1
- package/src/adapter/entry-points/cli/index.ts +38 -0
- package/src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts +1 -0
- package/src/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.test.ts +37 -0
- package/src/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.ts +4 -0
- package/src/adapter/entry-points/handlers/staleTmuxSessionCleaner.test.ts +2 -2
- package/src/adapter/repositories/NodeTmuxSessionRepository.test.ts +78 -18
- package/src/adapter/repositories/NodeTmuxSessionRepository.ts +27 -6
- package/src/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.test.ts +34 -0
- package/src/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.ts +8 -0
- package/src/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.test.ts +25 -15
- package/src/domain/usecases/SetWorkflowManagementIssueToStoryUseCase.ts +1 -1
- package/src/domain/usecases/adapter-interfaces/TmuxSessionRepository.ts +1 -0
- package/src/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.test.ts +132 -8
- package/src/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.ts +13 -1
- package/types/adapter/entry-points/cli/index.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.d.ts.map +1 -1
- package/types/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.d.ts +2 -0
- package/types/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.d.ts.map +1 -1
- package/types/adapter/repositories/NodeTmuxSessionRepository.d.ts +4 -2
- package/types/adapter/repositories/NodeTmuxSessionRepository.d.ts.map +1 -1
- package/types/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.d.ts +2 -0
- package/types/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.d.ts.map +1 -0
- package/types/domain/usecases/adapter-interfaces/TmuxSessionRepository.d.ts +1 -0
- package/types/domain/usecases/adapter-interfaces/TmuxSessionRepository.d.ts.map +1 -1
- package/types/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.d.ts +3 -1
- package/types/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.d.ts.map +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Issue } from '../../entities/Issue';
|
|
2
2
|
import { IN_TMUX_STATUS_NAME } from '../../entities/WorkflowStatus';
|
|
3
|
+
import { IssueRepository } from '../adapter-interfaces/IssueRepository';
|
|
3
4
|
import { TmuxSessionRepository } from '../adapter-interfaces/TmuxSessionRepository';
|
|
4
5
|
import {
|
|
5
6
|
InTmuxByHumanSessionReconcileUseCase,
|
|
@@ -70,6 +71,26 @@ const createFakeTmuxSessionRepository = (state: {
|
|
|
70
71
|
launches.push({ sessionName, launcherCommand, issueUrl });
|
|
71
72
|
},
|
|
72
73
|
killSession: async () => undefined,
|
|
74
|
+
killOwnSession: async () => undefined,
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const createFakeIssueStateRepository = (
|
|
79
|
+
stateByUrl: Record<string, string> = {},
|
|
80
|
+
): Pick<IssueRepository, 'getIssueOrPullRequestState'> & {
|
|
81
|
+
fetchedUrls: string[];
|
|
82
|
+
} => {
|
|
83
|
+
const fetchedUrls: string[] = [];
|
|
84
|
+
return {
|
|
85
|
+
fetchedUrls,
|
|
86
|
+
getIssueOrPullRequestState: async (url: string) => {
|
|
87
|
+
fetchedUrls.push(url);
|
|
88
|
+
return {
|
|
89
|
+
state: stateByUrl[url] ?? 'open',
|
|
90
|
+
merged: false,
|
|
91
|
+
isPullRequest: false,
|
|
92
|
+
};
|
|
93
|
+
},
|
|
73
94
|
};
|
|
74
95
|
};
|
|
75
96
|
|
|
@@ -84,7 +105,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
84
105
|
liveSessionNames: [],
|
|
85
106
|
processCommandLines: [],
|
|
86
107
|
});
|
|
87
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
108
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
109
|
+
repository,
|
|
110
|
+
createFakeIssueStateRepository(),
|
|
111
|
+
);
|
|
88
112
|
|
|
89
113
|
const result = await useCase.run({
|
|
90
114
|
issues: [issue],
|
|
@@ -111,7 +135,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
111
135
|
`claude --model opus --agent leader --name ${issue.url}`,
|
|
112
136
|
],
|
|
113
137
|
});
|
|
114
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
138
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
139
|
+
repository,
|
|
140
|
+
createFakeIssueStateRepository(),
|
|
141
|
+
);
|
|
115
142
|
|
|
116
143
|
const result = await useCase.run({
|
|
117
144
|
issues: [issue],
|
|
@@ -130,7 +157,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
130
157
|
liveSessionNames: [toTmuxSessionName(issue.url)],
|
|
131
158
|
processCommandLines: ['claude --model opus --name some-other-task'],
|
|
132
159
|
});
|
|
133
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
160
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
161
|
+
repository,
|
|
162
|
+
createFakeIssueStateRepository(),
|
|
163
|
+
);
|
|
134
164
|
|
|
135
165
|
const result = await useCase.run({
|
|
136
166
|
issues: [issue],
|
|
@@ -151,7 +181,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
151
181
|
liveSessionNames: [toTmuxSessionName(liveIssue.url)],
|
|
152
182
|
processCommandLines: [`claude --model opus --name ${liveIssue.url}`],
|
|
153
183
|
});
|
|
154
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
184
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
185
|
+
repository,
|
|
186
|
+
createFakeIssueStateRepository(),
|
|
187
|
+
);
|
|
155
188
|
|
|
156
189
|
const result = await useCase.run({
|
|
157
190
|
issues: [liveIssue, missingIssueOne, missingIssueTwo],
|
|
@@ -178,7 +211,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
178
211
|
liveSessionNames: [],
|
|
179
212
|
processCommandLines: [],
|
|
180
213
|
});
|
|
181
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
214
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
215
|
+
repository,
|
|
216
|
+
createFakeIssueStateRepository(),
|
|
217
|
+
);
|
|
182
218
|
|
|
183
219
|
const result = await useCase.run({
|
|
184
220
|
issues: [otherStatusIssue, closedIssue, otherAssigneeIssue],
|
|
@@ -199,7 +235,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
199
235
|
liveSessionNames: [],
|
|
200
236
|
processCommandLines: [],
|
|
201
237
|
});
|
|
202
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
238
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
239
|
+
repository,
|
|
240
|
+
createFakeIssueStateRepository(),
|
|
241
|
+
);
|
|
203
242
|
|
|
204
243
|
const result = await useCase.run({
|
|
205
244
|
issues: [futureIssue],
|
|
@@ -218,7 +257,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
218
257
|
liveSessionNames: [],
|
|
219
258
|
processCommandLines: [],
|
|
220
259
|
});
|
|
221
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
260
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
261
|
+
repository,
|
|
262
|
+
createFakeIssueStateRepository(),
|
|
263
|
+
);
|
|
222
264
|
|
|
223
265
|
const result = await useCase.run({
|
|
224
266
|
issues: [hourIssue],
|
|
@@ -239,7 +281,10 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
239
281
|
liveSessionNames: [],
|
|
240
282
|
processCommandLines: [],
|
|
241
283
|
});
|
|
242
|
-
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
284
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
285
|
+
repository,
|
|
286
|
+
createFakeIssueStateRepository(),
|
|
287
|
+
);
|
|
243
288
|
|
|
244
289
|
const result = await useCase.run({
|
|
245
290
|
issues: [dueIssue],
|
|
@@ -251,6 +296,85 @@ describe('InTmuxByHumanSessionReconcileUseCase', () => {
|
|
|
251
296
|
expect(result.launchedIssueUrls).toEqual([dueIssue.url]);
|
|
252
297
|
});
|
|
253
298
|
|
|
299
|
+
it('does not launch a session for an issue whose live GitHub state is closed even when the cached issue still reports it as open', async () => {
|
|
300
|
+
const staleCachedIssue = makeIssue({ isClosed: false });
|
|
301
|
+
const repository = createFakeTmuxSessionRepository({
|
|
302
|
+
liveSessionNames: [],
|
|
303
|
+
processCommandLines: [],
|
|
304
|
+
});
|
|
305
|
+
const issueStateRepository = createFakeIssueStateRepository({
|
|
306
|
+
[staleCachedIssue.url]: 'closed',
|
|
307
|
+
});
|
|
308
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
309
|
+
repository,
|
|
310
|
+
issueStateRepository,
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
const result = await useCase.run({
|
|
314
|
+
issues: [staleCachedIssue],
|
|
315
|
+
assigneeLogin: ASSIGNEE,
|
|
316
|
+
launcherCommand: LAUNCHER,
|
|
317
|
+
now: NOW,
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
expect(issueStateRepository.fetchedUrls).toEqual([staleCachedIssue.url]);
|
|
321
|
+
expect(repository.launches).toEqual([]);
|
|
322
|
+
expect(result.launchedIssueUrls).toEqual([]);
|
|
323
|
+
});
|
|
324
|
+
|
|
325
|
+
it('launches only the issues whose live GitHub state is open when a stale cached issue is mixed in', async () => {
|
|
326
|
+
const staleClosedIssue = makeIssue({ isClosed: false });
|
|
327
|
+
const openIssue = makeIssue();
|
|
328
|
+
const repository = createFakeTmuxSessionRepository({
|
|
329
|
+
liveSessionNames: [],
|
|
330
|
+
processCommandLines: [],
|
|
331
|
+
});
|
|
332
|
+
const issueStateRepository = createFakeIssueStateRepository({
|
|
333
|
+
[staleClosedIssue.url]: 'closed',
|
|
334
|
+
[openIssue.url]: 'open',
|
|
335
|
+
});
|
|
336
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
337
|
+
repository,
|
|
338
|
+
issueStateRepository,
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
const result = await useCase.run({
|
|
342
|
+
issues: [staleClosedIssue, openIssue],
|
|
343
|
+
assigneeLogin: ASSIGNEE,
|
|
344
|
+
launcherCommand: LAUNCHER,
|
|
345
|
+
now: NOW,
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
expect(result.launchedIssueUrls).toEqual([openIssue.url]);
|
|
349
|
+
expect(repository.launches.map((launch) => launch.issueUrl)).toEqual([
|
|
350
|
+
openIssue.url,
|
|
351
|
+
]);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it('does not fetch the live state for an issue that already has a live session', async () => {
|
|
355
|
+
const issue = makeIssue();
|
|
356
|
+
const repository = createFakeTmuxSessionRepository({
|
|
357
|
+
liveSessionNames: [toTmuxSessionName(issue.url)],
|
|
358
|
+
processCommandLines: [
|
|
359
|
+
`claude --model opus --agent leader --name ${issue.url}`,
|
|
360
|
+
],
|
|
361
|
+
});
|
|
362
|
+
const issueStateRepository = createFakeIssueStateRepository();
|
|
363
|
+
const useCase = new InTmuxByHumanSessionReconcileUseCase(
|
|
364
|
+
repository,
|
|
365
|
+
issueStateRepository,
|
|
366
|
+
);
|
|
367
|
+
|
|
368
|
+
await useCase.run({
|
|
369
|
+
issues: [issue],
|
|
370
|
+
assigneeLogin: ASSIGNEE,
|
|
371
|
+
launcherCommand: LAUNCHER,
|
|
372
|
+
now: NOW,
|
|
373
|
+
});
|
|
374
|
+
|
|
375
|
+
expect(issueStateRepository.fetchedUrls).toEqual([]);
|
|
376
|
+
});
|
|
377
|
+
|
|
254
378
|
it('transforms an issue url into the same session name tmux derives from the raw url, replacing only "." and ":" and keeping "/"', () => {
|
|
255
379
|
expect(toTmuxSessionName('https://github.com/demo/repo/issues/42')).toBe(
|
|
256
380
|
'https_//github_com/demo/repo/issues/42',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Issue } from '../../entities/Issue';
|
|
2
2
|
import { IN_TMUX_STATUS_NAME } from '../../entities/WorkflowStatus';
|
|
3
|
+
import { IssueRepository } from '../adapter-interfaces/IssueRepository';
|
|
3
4
|
import { TmuxSessionRepository } from '../adapter-interfaces/TmuxSessionRepository';
|
|
4
5
|
|
|
5
6
|
export type InTmuxByHumanSessionReconcileInput = {
|
|
@@ -25,7 +26,13 @@ export const toTmuxSessionName = (issueUrl: string): string =>
|
|
|
25
26
|
issueUrl.replace(/[.:]/g, '_');
|
|
26
27
|
|
|
27
28
|
export class InTmuxByHumanSessionReconcileUseCase {
|
|
28
|
-
constructor(
|
|
29
|
+
constructor(
|
|
30
|
+
private readonly tmuxSessionRepository: TmuxSessionRepository,
|
|
31
|
+
private readonly issueStateRepository: Pick<
|
|
32
|
+
IssueRepository,
|
|
33
|
+
'getIssueOrPullRequestState'
|
|
34
|
+
>,
|
|
35
|
+
) {}
|
|
29
36
|
|
|
30
37
|
run = async (
|
|
31
38
|
input: InTmuxByHumanSessionReconcileInput,
|
|
@@ -52,6 +59,11 @@ export class InTmuxByHumanSessionReconcileUseCase {
|
|
|
52
59
|
) {
|
|
53
60
|
continue;
|
|
54
61
|
}
|
|
62
|
+
const liveState =
|
|
63
|
+
await this.issueStateRepository.getIssueOrPullRequestState(issue.url);
|
|
64
|
+
if (liveState.state.toLowerCase() !== 'open') {
|
|
65
|
+
continue;
|
|
66
|
+
}
|
|
55
67
|
await this.tmuxSessionRepository.launchDetachedSession(
|
|
56
68
|
toTmuxSessionName(issue.url),
|
|
57
69
|
launcherCommand,
|
|
@@ -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;
|
|
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;AAsJzB,eAAO,MAAM,OAAO,SAAgB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAiD3D,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,
|
|
1
|
+
{"version":3,"file":"HandleScheduledEventUseCaseHandler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/HandleScheduledEventUseCaseHandler.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,kCAAkC,CAAC;AAiD3D,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,CAwlBP;CACH"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Issue } from '../../../domain/entities/Issue';
|
|
2
|
+
import { IssueRepository } from '../../../domain/usecases/adapter-interfaces/IssueRepository';
|
|
2
3
|
import { LocalCommandRunner } from '../../../domain/usecases/adapter-interfaces/LocalCommandRunner';
|
|
3
4
|
export type ReconcileInTmuxByHumanSessionsParams = {
|
|
4
5
|
inTmuxLauncherCommand: string | null;
|
|
5
6
|
assigneeLogin: string;
|
|
6
7
|
issues: Issue[];
|
|
7
8
|
localCommandRunner: LocalCommandRunner;
|
|
9
|
+
issueStateRepository: Pick<IssueRepository, 'getIssueOrPullRequestState'>;
|
|
8
10
|
now: Date;
|
|
9
11
|
};
|
|
10
12
|
export declare const reconcileInTmuxByHumanSessions: (params: ReconcileInTmuxByHumanSessionsParams) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inTmuxByHumanSessionReconciler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAIpG,MAAM,MAAM,oCAAoC,GAAG;IACjD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,QAAQ,oCAAoC,KAC3C,OAAO,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"inTmuxByHumanSessionReconciler.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/handlers/inTmuxByHumanSessionReconciler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,6DAA6D,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,gEAAgE,CAAC;AAIpG,MAAM,MAAM,oCAAoC,GAAG;IACjD,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,oBAAoB,EAAE,IAAI,CAAC,eAAe,EAAE,4BAA4B,CAAC,CAAC;IAC1E,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,eAAO,MAAM,8BAA8B,GACzC,QAAQ,oCAAoC,KAC3C,OAAO,CAAC,IAAI,CAsBd,CAAC"}
|
|
@@ -3,12 +3,14 @@ import { TmuxSessionRepository } from '../../domain/usecases/adapter-interfaces/
|
|
|
3
3
|
import { LiveTmuxSession } from '../../domain/entities/LiveTmuxSession';
|
|
4
4
|
export declare class NodeTmuxSessionRepository implements TmuxSessionRepository {
|
|
5
5
|
private readonly localCommandRunner;
|
|
6
|
-
|
|
6
|
+
private readonly procDirectory;
|
|
7
|
+
constructor(localCommandRunner: LocalCommandRunner, procDirectory?: string);
|
|
7
8
|
listLiveSessionNames: () => Promise<string[]>;
|
|
8
9
|
listLiveSessionsWithActivity: () => Promise<LiveTmuxSession[]>;
|
|
9
10
|
listInteractiveProcessCommandLines: () => Promise<string[]>;
|
|
10
11
|
launchDetachedSession: (sessionName: string, launcherCommand: string, issueUrl: string) => Promise<void>;
|
|
11
12
|
killSession: (sessionName: string) => Promise<void>;
|
|
12
|
-
|
|
13
|
+
killOwnSession: () => Promise<void>;
|
|
14
|
+
private stopScopeUnit;
|
|
13
15
|
}
|
|
14
16
|
//# sourceMappingURL=NodeTmuxSessionRepository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NodeTmuxSessionRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/NodeTmuxSessionRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NodeTmuxSessionRepository.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/NodeTmuxSessionRepository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,gEAAgE,CAAC;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAIxE,qBAAa,yBAA0B,YAAW,qBAAqB;IAEnE,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,GAAE,MAAgB;IAGlD,oBAAoB,QAAa,OAAO,CAAC,MAAM,EAAE,CAAC,CAYhD;IAEF,4BAA4B,QAAa,OAAO,CAAC,eAAe,EAAE,CAAC,CAkBjE;IAEF,kCAAkC,QAAa,OAAO,CAAC,MAAM,EAAE,CAAC,CAY9D;IAEF,qBAAqB,GACnB,aAAa,MAAM,EACnB,iBAAiB,MAAM,EACvB,UAAU,MAAM,KACf,OAAO,CAAC,IAAI,CAAC,CAcd;IAEF,WAAW,GAAU,aAAa,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CActD;IAEF,cAAc,QAAa,OAAO,CAAC,IAAI,CAAC,CAatC;IAEF,OAAO,CAAC,aAAa,CAsBnB;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clSessionScopeUnitNameFromCgroupContent.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/clSessionScopeUnitNameFromCgroupContent.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uCAAuC,GAClD,eAAe,MAAM,KACpB,MAAM,GAAG,IAGX,CAAC"}
|
|
@@ -5,5 +5,6 @@ export interface TmuxSessionRepository {
|
|
|
5
5
|
listInteractiveProcessCommandLines: () => Promise<string[]>;
|
|
6
6
|
launchDetachedSession: (sessionName: string, launcherCommand: string, issueUrl: string) => Promise<void>;
|
|
7
7
|
killSession: (sessionName: string) => Promise<void>;
|
|
8
|
+
killOwnSession: () => Promise<void>;
|
|
8
9
|
}
|
|
9
10
|
//# sourceMappingURL=TmuxSessionRepository.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TmuxSessionRepository.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/adapter-interfaces/TmuxSessionRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,4BAA4B,EAAE,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC/D,kCAAkC,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5D,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"TmuxSessionRepository.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/adapter-interfaces/TmuxSessionRepository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,MAAM,WAAW,qBAAqB;IACpC,oBAAoB,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC9C,4BAA4B,EAAE,MAAM,OAAO,CAAC,eAAe,EAAE,CAAC,CAAC;IAC/D,kCAAkC,EAAE,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC5D,qBAAqB,EAAE,CACrB,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,MAAM,KACb,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB,WAAW,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Issue } from '../../entities/Issue';
|
|
2
|
+
import { IssueRepository } from '../adapter-interfaces/IssueRepository';
|
|
2
3
|
import { TmuxSessionRepository } from '../adapter-interfaces/TmuxSessionRepository';
|
|
3
4
|
export type InTmuxByHumanSessionReconcileInput = {
|
|
4
5
|
issues: Issue[];
|
|
@@ -12,7 +13,8 @@ export type InTmuxByHumanSessionReconcileResult = {
|
|
|
12
13
|
export declare const toTmuxSessionName: (issueUrl: string) => string;
|
|
13
14
|
export declare class InTmuxByHumanSessionReconcileUseCase {
|
|
14
15
|
private readonly tmuxSessionRepository;
|
|
15
|
-
|
|
16
|
+
private readonly issueStateRepository;
|
|
17
|
+
constructor(tmuxSessionRepository: TmuxSessionRepository, issueStateRepository: Pick<IssueRepository, 'getIssueOrPullRequestState'>);
|
|
16
18
|
run: (input: InTmuxByHumanSessionReconcileInput) => Promise<InTmuxByHumanSessionReconcileResult>;
|
|
17
19
|
private isInTmuxByHuman;
|
|
18
20
|
private hasLiveSession;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InTmuxByHumanSessionReconcileUseCase.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAUF,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,MACrB,CAAC;AAEjC,qBAAa,oCAAoC;
|
|
1
|
+
{"version":3,"file":"InTmuxByHumanSessionReconcileUseCase.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/intmux/InTmuxByHumanSessionReconcileUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,GAAG,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,MAAM,MAAM,mCAAmC,GAAG;IAChD,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B,CAAC;AAUF,eAAO,MAAM,iBAAiB,GAAI,UAAU,MAAM,KAAG,MACrB,CAAC;AAEjC,qBAAa,oCAAoC;IAE7C,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,oBAAoB;gBADpB,qBAAqB,EAAE,qBAAqB,EAC5C,oBAAoB,EAAE,IAAI,CACzC,eAAe,EACf,4BAA4B,CAC7B;IAGH,GAAG,GACD,OAAO,kCAAkC,KACxC,OAAO,CAAC,mCAAmC,CAAC,CAqC7C;IAEF,OAAO,CAAC,eAAe,CAUS;IAEhC,OAAO,CAAC,cAAc,CAYpB;CACH"}
|