github-issue-tower-defence-management 1.113.0 → 1.114.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.
Files changed (78) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +2 -2
  3. package/bin/adapter/entry-points/console/consoleReadApi.js +11 -1
  4. package/bin/adapter/entry-points/console/consoleReadApi.js.map +1 -1
  5. package/bin/adapter/entry-points/console/ui-dist/assets/{index-CEJmPNRK.css → index-Blb_xqIx.css} +1 -1
  6. package/bin/adapter/entry-points/console/ui-dist/assets/index-DQyZ8KpG.js +101 -0
  7. package/bin/adapter/entry-points/console/ui-dist/index.html +2 -2
  8. package/bin/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.js +36 -27
  9. package/bin/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.js.map +1 -1
  10. package/bin/adapter/repositories/FileSystemSessionRecordReader.js +69 -0
  11. package/bin/adapter/repositories/FileSystemSessionRecordReader.js.map +1 -0
  12. package/bin/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.js +9 -2
  13. package/bin/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.js.map +1 -1
  14. package/bin/domain/usecases/ResolveInteractiveLiveSessionsUseCase.js +15 -0
  15. package/bin/domain/usecases/ResolveInteractiveLiveSessionsUseCase.js.map +1 -1
  16. package/bin/domain/usecases/adapter-interfaces/SessionRecordReader.js +3 -0
  17. package/bin/domain/usecases/adapter-interfaces/SessionRecordReader.js.map +1 -0
  18. package/package.json +1 -1
  19. package/src/adapter/entry-points/console/consoleReadApi.test.ts +82 -0
  20. package/src/adapter/entry-points/console/consoleReadApi.ts +21 -1
  21. package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMarkdownContent.stories.tsx +16 -0
  22. package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMarkdownContent.test.tsx +61 -0
  23. package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleMarkdownContent.tsx +59 -5
  24. package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleReferenceLink.stories.tsx +76 -0
  25. package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleReferenceLink.test.tsx +56 -0
  26. package/src/adapter/entry-points/console/ui/src/features/console/components/content/ConsoleReferenceLink.tsx +39 -0
  27. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleCommentList.tsx +4 -0
  28. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.stories.tsx +24 -4
  29. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.test.tsx +13 -3
  30. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsoleItemDetail.tsx +6 -0
  31. package/src/adapter/entry-points/console/ui/src/features/console/components/detail/ConsolePullRequestDetail.tsx +4 -0
  32. package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.test.ts +1 -0
  33. package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleItemDetailData.ts +1 -0
  34. package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleReferenceLink.test.ts +48 -0
  35. package/src/adapter/entry-points/console/ui/src/features/console/hooks/useConsoleReferenceLink.ts +39 -0
  36. package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.test.ts +25 -2
  37. package/src/adapter/entry-points/console/ui/src/features/console/lib/consoleApi.ts +2 -1
  38. package/src/adapter/entry-points/console/ui/src/features/console/logic/references.test.ts +80 -0
  39. package/src/adapter/entry-points/console/ui/src/features/console/logic/references.ts +44 -0
  40. package/src/adapter/entry-points/console/ui/src/features/console/logic/types.ts +1 -0
  41. package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.test.tsx +1 -0
  42. package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleItemDetailContainer.tsx +12 -0
  43. package/src/adapter/entry-points/console/ui/src/features/console/pages/ConsoleReferenceLinkContainer.tsx +25 -0
  44. package/src/adapter/entry-points/console/ui/src/features/console/testing/fixtures.ts +40 -0
  45. package/src/adapter/entry-points/console/ui/src/index.css +23 -0
  46. package/src/adapter/entry-points/console/ui-dist/assets/{index-CEJmPNRK.css → index-Blb_xqIx.css} +1 -1
  47. package/src/adapter/entry-points/console/ui-dist/assets/index-DQyZ8KpG.js +101 -0
  48. package/src/adapter/entry-points/console/ui-dist/index.html +2 -2
  49. package/src/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.test.ts +107 -26
  50. package/src/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.ts +49 -29
  51. package/src/adapter/repositories/FileSystemSessionRecordReader.test.ts +59 -0
  52. package/src/adapter/repositories/FileSystemSessionRecordReader.ts +31 -0
  53. package/src/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.test.ts +51 -0
  54. package/src/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.ts +10 -1
  55. package/src/domain/entities/InteractiveLiveSession.ts +1 -0
  56. package/src/domain/entities/LiveSessionProcessSnapshot.ts +1 -0
  57. package/src/domain/usecases/NotifySilentLiveSessionsUseCase.test.ts +4 -0
  58. package/src/domain/usecases/ResolveInteractiveLiveSessionsUseCase.test.ts +66 -59
  59. package/src/domain/usecases/ResolveInteractiveLiveSessionsUseCase.ts +19 -0
  60. package/src/domain/usecases/adapter-interfaces/SessionRecordReader.ts +3 -0
  61. package/types/adapter/entry-points/console/consoleReadApi.d.ts +1 -0
  62. package/types/adapter/entry-points/console/consoleReadApi.d.ts.map +1 -1
  63. package/types/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.d.ts +4 -11
  64. package/types/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.d.ts.map +1 -1
  65. package/types/adapter/repositories/FileSystemSessionRecordReader.d.ts +5 -0
  66. package/types/adapter/repositories/FileSystemSessionRecordReader.d.ts.map +1 -0
  67. package/types/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.d.ts +3 -1
  68. package/types/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.d.ts.map +1 -1
  69. package/types/domain/entities/InteractiveLiveSession.d.ts +1 -0
  70. package/types/domain/entities/InteractiveLiveSession.d.ts.map +1 -1
  71. package/types/domain/entities/LiveSessionProcessSnapshot.d.ts +1 -0
  72. package/types/domain/entities/LiveSessionProcessSnapshot.d.ts.map +1 -1
  73. package/types/domain/usecases/ResolveInteractiveLiveSessionsUseCase.d.ts +1 -0
  74. package/types/domain/usecases/ResolveInteractiveLiveSessionsUseCase.d.ts.map +1 -1
  75. package/types/domain/usecases/adapter-interfaces/SessionRecordReader.d.ts +4 -0
  76. package/types/domain/usecases/adapter-interfaces/SessionRecordReader.d.ts.map +1 -0
  77. package/bin/adapter/entry-points/console/ui-dist/assets/index-DfNrA5uV.js +0 -101
  78. package/src/adapter/entry-points/console/ui-dist/assets/index-DfNrA5uV.js +0 -101
@@ -1,9 +1,22 @@
1
1
  import { ResolveInteractiveLiveSessionsUseCase } from './ResolveInteractiveLiveSessionsUseCase';
2
- import { LiveSessionProcessSnapshot } from '../entities/LiveSessionProcessSnapshot';
2
+ import {
3
+ LiveSessionProcessInfo,
4
+ LiveSessionProcessSnapshot,
5
+ } from '../entities/LiveSessionProcessSnapshot';
3
6
 
4
7
  describe('ResolveInteractiveLiveSessionsUseCase', () => {
5
8
  const useCase = new ResolveInteractiveLiveSessionsUseCase();
6
9
 
10
+ const processInfo = (
11
+ overrides: Partial<LiveSessionProcessInfo> &
12
+ Pick<LiveSessionProcessInfo, 'pid' | 'ppid' | 'commandLine'>,
13
+ ): LiveSessionProcessInfo => ({
14
+ sessionId: null,
15
+ currentSessionId: null,
16
+ configDir: null,
17
+ ...overrides,
18
+ });
19
+
7
20
  it('resolves an issue-url-named session through its pane child process', () => {
8
21
  const snapshot: LiveSessionProcessSnapshot = {
9
22
  sessions: [
@@ -13,20 +26,14 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
13
26
  },
14
27
  ],
15
28
  processes: [
16
- {
17
- pid: 100,
18
- ppid: 1,
19
- commandLine: 'tmux pane shell',
20
- sessionId: null,
21
- configDir: null,
22
- },
23
- {
29
+ processInfo({ pid: 100, ppid: 1, commandLine: 'tmux pane shell' }),
30
+ processInfo({
24
31
  pid: 101,
25
32
  ppid: 100,
26
33
  commandLine: 'claude --model opus --resume abc',
27
34
  sessionId: 'abc',
28
35
  configDir: '/config/issues-9',
29
- },
36
+ }),
30
37
  ],
31
38
  };
32
39
 
@@ -36,29 +43,51 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
36
43
  {
37
44
  sessionName: 'https_//github_com/owner/repo/issues/9',
38
45
  sessionId: 'abc',
46
+ candidateSessionIds: ['abc'],
39
47
  configDir: '/config/issues-9',
40
48
  },
41
49
  ]);
42
50
  });
43
51
 
44
- it('resolves a plain-named session such as workbench', () => {
52
+ it('puts the rotated current session id before the launch env id', () => {
45
53
  const snapshot: LiveSessionProcessSnapshot = {
46
54
  sessions: [{ sessionName: 'workbench', panePids: [200] }],
47
55
  processes: [
48
- {
49
- pid: 200,
50
- ppid: 1,
51
- commandLine: 'shell',
52
- sessionId: null,
53
- configDir: null,
54
- },
55
- {
56
+ processInfo({
57
+ pid: 201,
58
+ ppid: 200,
59
+ commandLine: 'claude --name workbench',
60
+ sessionId: 'launch-uuid',
61
+ currentSessionId: 'rotated-uuid',
62
+ configDir: '/config/workbench',
63
+ }),
64
+ ],
65
+ };
66
+
67
+ const result = useCase.resolve(snapshot);
68
+
69
+ expect(result).toEqual([
70
+ {
71
+ sessionName: 'workbench',
72
+ sessionId: 'launch-uuid',
73
+ candidateSessionIds: ['rotated-uuid', 'launch-uuid'],
74
+ configDir: '/config/workbench',
75
+ },
76
+ ]);
77
+ });
78
+
79
+ it('keeps a single candidate id when the current id equals the launch id', () => {
80
+ const snapshot: LiveSessionProcessSnapshot = {
81
+ sessions: [{ sessionName: 'workbench', panePids: [200] }],
82
+ processes: [
83
+ processInfo({
56
84
  pid: 201,
57
85
  ppid: 200,
58
86
  commandLine: 'claude --model opus --name workbench',
59
87
  sessionId: 'wb-uuid',
88
+ currentSessionId: 'wb-uuid',
60
89
  configDir: '/config/workbench',
61
- },
90
+ }),
62
91
  ],
63
92
  };
64
93
 
@@ -68,6 +97,7 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
68
97
  {
69
98
  sessionName: 'workbench',
70
99
  sessionId: 'wb-uuid',
100
+ candidateSessionIds: ['wb-uuid'],
71
101
  configDir: '/config/workbench',
72
102
  },
73
103
  ]);
@@ -77,27 +107,15 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
77
107
  const snapshot: LiveSessionProcessSnapshot = {
78
108
  sessions: [{ sessionName: 'control-room', panePids: [300] }],
79
109
  processes: [
80
- {
81
- pid: 300,
82
- ppid: 1,
83
- commandLine: 'shell',
84
- sessionId: null,
85
- configDir: null,
86
- },
87
- {
88
- pid: 301,
89
- ppid: 300,
90
- commandLine: 'node wrapper',
91
- sessionId: null,
92
- configDir: null,
93
- },
94
- {
110
+ processInfo({ pid: 300, ppid: 1, commandLine: 'shell' }),
111
+ processInfo({ pid: 301, ppid: 300, commandLine: 'node wrapper' }),
112
+ processInfo({
95
113
  pid: 302,
96
114
  ppid: 301,
97
115
  commandLine: 'claude --name control-room',
98
116
  sessionId: 'cr-uuid',
99
117
  configDir: '/config/control-room',
100
- },
118
+ }),
101
119
  ],
102
120
  };
103
121
 
@@ -107,6 +125,7 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
107
125
  {
108
126
  sessionName: 'control-room',
109
127
  sessionId: 'cr-uuid',
128
+ candidateSessionIds: ['cr-uuid'],
110
129
  configDir: '/config/control-room',
111
130
  },
112
131
  ]);
@@ -116,21 +135,15 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
116
135
  const snapshot: LiveSessionProcessSnapshot = {
117
136
  sessions: [{ sessionName: 'aw-host', panePids: [400] }],
118
137
  processes: [
119
- {
120
- pid: 400,
121
- ppid: 1,
122
- commandLine: 'shell',
123
- sessionId: null,
124
- configDir: null,
125
- },
126
- {
138
+ processInfo({ pid: 400, ppid: 1, commandLine: 'shell' }),
139
+ processInfo({
127
140
  pid: 401,
128
141
  ppid: 400,
129
142
  commandLine:
130
143
  'claude --verbose -p Take ownership of https://example.com/issues/1 and finish it',
131
144
  sessionId: 'aw-uuid',
132
145
  configDir: '/config/aw',
133
- },
146
+ }),
134
147
  ],
135
148
  };
136
149
 
@@ -143,13 +156,12 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
143
156
  const snapshot: LiveSessionProcessSnapshot = {
144
157
  sessions: [{ sessionName: 'partial', panePids: [500] }],
145
158
  processes: [
146
- {
159
+ processInfo({
147
160
  pid: 501,
148
161
  ppid: 500,
149
162
  commandLine: 'claude --model opus',
150
- sessionId: null,
151
163
  configDir: '/config/partial',
152
- },
164
+ }),
153
165
  ],
154
166
  };
155
167
 
@@ -162,13 +174,13 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
162
174
  const snapshot: LiveSessionProcessSnapshot = {
163
175
  sessions: [{ sessionName: 'monitored', panePids: [600] }],
164
176
  processes: [
165
- {
177
+ processInfo({
166
178
  pid: 601,
167
179
  ppid: 600,
168
180
  commandLine: 'node monitor.js',
169
181
  sessionId: 'mon-uuid',
170
182
  configDir: '/config/monitor',
171
- },
183
+ }),
172
184
  ],
173
185
  };
174
186
 
@@ -184,20 +196,14 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
184
196
  { sessionName: 'empty', panePids: [800] },
185
197
  ],
186
198
  processes: [
187
- {
199
+ processInfo({
188
200
  pid: 701,
189
201
  ppid: 700,
190
202
  commandLine: 'claude --name workbench',
191
203
  sessionId: 'wb-uuid',
192
204
  configDir: '/config/workbench',
193
- },
194
- {
195
- pid: 801,
196
- ppid: 800,
197
- commandLine: 'bash idle',
198
- sessionId: null,
199
- configDir: null,
200
- },
205
+ }),
206
+ processInfo({ pid: 801, ppid: 800, commandLine: 'bash idle' }),
201
207
  ],
202
208
  };
203
209
 
@@ -207,6 +213,7 @@ describe('ResolveInteractiveLiveSessionsUseCase', () => {
207
213
  {
208
214
  sessionName: 'workbench',
209
215
  sessionId: 'wb-uuid',
216
+ candidateSessionIds: ['wb-uuid'],
210
217
  configDir: '/config/workbench',
211
218
  },
212
219
  ]);
@@ -69,12 +69,31 @@ export class ResolveInteractiveLiveSessionsUseCase {
69
69
  sessions.push({
70
70
  sessionName: session.sessionName,
71
71
  sessionId: interactiveProcess.sessionId,
72
+ candidateSessionIds:
73
+ this.collectCandidateSessionIds(interactiveProcess),
72
74
  configDir: interactiveProcess.configDir,
73
75
  });
74
76
  }
75
77
  return sessions;
76
78
  };
77
79
 
80
+ private collectCandidateSessionIds = (
81
+ interactiveProcess: LiveSessionProcessInfo,
82
+ ): string[] => {
83
+ const candidateSessionIds: string[] = [];
84
+ const seenSessionIds = new Set<string>();
85
+ for (const sessionId of [
86
+ interactiveProcess.currentSessionId,
87
+ interactiveProcess.sessionId,
88
+ ]) {
89
+ if (sessionId !== null && !seenSessionIds.has(sessionId)) {
90
+ seenSessionIds.add(sessionId);
91
+ candidateSessionIds.push(sessionId);
92
+ }
93
+ }
94
+ return candidateSessionIds;
95
+ };
96
+
78
97
  private findInteractiveProcess = (
79
98
  panePids: number[],
80
99
  processByPid: Map<number, LiveSessionProcessInfo>,
@@ -0,0 +1,3 @@
1
+ export interface SessionRecordReader {
2
+ readCurrentSessionId: (configDir: string, pid: number) => string | null;
3
+ }
@@ -5,6 +5,7 @@ export type IssueOrPullRequestState = {
5
5
  state: string;
6
6
  merged: boolean;
7
7
  isPullRequest: boolean;
8
+ title: string;
8
9
  };
9
10
  export type PullRequestStatus = {
10
11
  isConflicted: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"consoleReadApi.d.ts","sourceRoot":"","sources":["../../../../src/adapter/entry-points/console/consoleReadApi.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAGhB,MAAM,6DAA6D,CAAC;AAErE,eAAO,MA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M,eAAe,GAC1B,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAMhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,EAChC,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CA2BhC,CAAC;AAeF,eAAO,MAAM,gBAAgB,GAC3B,iBAAiB,eAAe,EAChC,OAAO,oBAAoB,EAC3B,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAiBhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,iBAAiB,eAAe,EAChC,OAAO,sBAAsB,EAC7B,KAAK,MAAM,GAAG,IAAI,KACjB,OAAO,CAAC,sBAAsB,CAwBhC,CAAC"}
@@ -1,18 +1,11 @@
1
1
  import { InteractiveLiveSession } from '../../domain/entities/InteractiveLiveSession';
2
2
  import { InteractiveLiveSessionTranscriptResolver } from '../../domain/usecases/adapter-interfaces/InteractiveLiveSessionTranscriptResolver';
3
- /**
4
- * Resolves the real transcript path of an interactive Claude Code session from
5
- * the session id and config directory taken from the session's process
6
- * environment. The transcript lives at
7
- * `<configDir>/projects/<cwd-slug>/<sessionId>.jsonl`; this resolver scans the
8
- * `projects` subdirectories for a file named `<sessionId>.jsonl` and returns the
9
- * most recently modified match. Because resolution is keyed on the process
10
- * session id rather than on a session name or issue URL, a plain-named session
11
- * (for example one named `workbench`) resolves just as well as an issue-url
12
- * named one.
13
- */
14
3
  export declare class FileSystemInteractiveLiveSessionTranscriptResolver implements InteractiveLiveSessionTranscriptResolver {
4
+ private readonly sharedProjectsDirectory;
5
+ constructor(sharedProjectsDirectory?: string);
15
6
  resolveTranscriptPaths: (sessions: InteractiveLiveSession[]) => Map<string, string>;
16
7
  private resolveTranscriptPath;
8
+ private listProjectsDirectories;
9
+ private listCandidatePaths;
17
10
  }
18
11
  //# sourceMappingURL=FileSystemInteractiveLiveSessionTranscriptResolver.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FileSystemInteractiveLiveSessionTranscriptResolver.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,wCAAwC,EAAE,MAAM,mFAAmF,CAAC;AAW7I;;;;;;;;;;GAUG;AACH,qBAAa,kDAAmD,YAAW,wCAAwC;IACjH,sBAAsB,GACpB,UAAU,sBAAsB,EAAE,KACjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CASpB;IAEF,OAAO,CAAC,qBAAqB,CAkC3B;CACH"}
1
+ {"version":3,"file":"FileSystemInteractiveLiveSessionTranscriptResolver.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemInteractiveLiveSessionTranscriptResolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,wCAAwC,EAAE,MAAM,mFAAmF,CAAC;AAc7I,qBAAa,kDAAmD,YAAW,wCAAwC;IAE/G,OAAO,CAAC,QAAQ,CAAC,uBAAuB;gBAAvB,uBAAuB,GAAE,MAAyC;IAGrF,sBAAsB,GACpB,UAAU,sBAAsB,EAAE,KACjC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CASpB;IAEF,OAAO,CAAC,qBAAqB,CAyB3B;IAEF,OAAO,CAAC,uBAAuB,CAM7B;IAEF,OAAO,CAAC,kBAAkB,CAsBxB;CACH"}
@@ -0,0 +1,5 @@
1
+ import { SessionRecordReader } from '../../domain/usecases/adapter-interfaces/SessionRecordReader';
2
+ export declare class FileSystemSessionRecordReader implements SessionRecordReader {
3
+ readCurrentSessionId: (configDir: string, pid: number) => string | null;
4
+ }
5
+ //# sourceMappingURL=FileSystemSessionRecordReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSystemSessionRecordReader.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/FileSystemSessionRecordReader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AAKnG,qBAAa,6BAA8B,YAAW,mBAAmB;IACvE,oBAAoB,GAAI,WAAW,MAAM,EAAE,KAAK,MAAM,KAAG,MAAM,GAAG,IAAI,CAqBpE;CACH"}
@@ -1,6 +1,7 @@
1
1
  import { LocalCommandRunner } from '../../domain/usecases/adapter-interfaces/LocalCommandRunner';
2
2
  import { LiveSessionProcessSnapshotProvider } from '../../domain/usecases/adapter-interfaces/LiveSessionProcessSnapshotProvider';
3
3
  import { ProcessEnvironReader } from '../../domain/usecases/adapter-interfaces/ProcessEnvironReader';
4
+ import { SessionRecordReader } from '../../domain/usecases/adapter-interfaces/SessionRecordReader';
4
5
  import { LiveSessionProcessSnapshot } from '../../domain/entities/LiveSessionProcessSnapshot';
5
6
  /**
6
7
  * Builds a live-session process snapshot from the local host: it lists the live
@@ -12,7 +13,8 @@ import { LiveSessionProcessSnapshot } from '../../domain/entities/LiveSessionPro
12
13
  export declare class LocalProcessLiveSessionProcessSnapshotProvider implements LiveSessionProcessSnapshotProvider {
13
14
  private readonly localCommandRunner;
14
15
  private readonly environReader;
15
- constructor(localCommandRunner: LocalCommandRunner, environReader: ProcessEnvironReader);
16
+ private readonly sessionRecordReader;
17
+ constructor(localCommandRunner: LocalCommandRunner, environReader: ProcessEnvironReader, sessionRecordReader?: SessionRecordReader);
16
18
  getSnapshot: () => Promise<LiveSessionProcessSnapshot>;
17
19
  private listSessionNames;
18
20
  private listPanePids;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalProcessLiveSessionProcessSnapshotProvider.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AACjG,OAAO,EAAE,kCAAkC,EAAE,MAAM,6EAA6E,CAAC;AACjI,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AACrG,OAAO,EAGL,0BAA0B,EAC3B,MAAM,kDAAkD,CAAC;AAK1D;;;;;;GAMG;AACH,qBAAa,8CAA+C,YAAW,kCAAkC;IAErG,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa;gBADb,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,oBAAoB;IAGtD,WAAW,QAAa,OAAO,CAAC,0BAA0B,CAAC,CASzD;IAEF,OAAO,CAAC,gBAAgB,CAYtB;IAEF,OAAO,CAAC,YAAY,CAYlB;IAEF,OAAO,CAAC,aAAa,CA2BnB;CACH"}
1
+ {"version":3,"file":"LocalProcessLiveSessionProcessSnapshotProvider.d.ts","sourceRoot":"","sources":["../../../src/adapter/repositories/LocalProcessLiveSessionProcessSnapshotProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,6DAA6D,CAAC;AACjG,OAAO,EAAE,kCAAkC,EAAE,MAAM,6EAA6E,CAAC;AACjI,OAAO,EAAE,oBAAoB,EAAE,MAAM,+DAA+D,CAAC;AACrG,OAAO,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAC;AACnG,OAAO,EAGL,0BAA0B,EAC3B,MAAM,kDAAkD,CAAC;AAM1D;;;;;;GAMG;AACH,qBAAa,8CAA+C,YAAW,kCAAkC;IAErG,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,mBAAmB;gBAFnB,kBAAkB,EAAE,kBAAkB,EACtC,aAAa,EAAE,oBAAoB,EACnC,mBAAmB,GAAE,mBAAyD;IAGjG,WAAW,QAAa,OAAO,CAAC,0BAA0B,CAAC,CASzD;IAEF,OAAO,CAAC,gBAAgB,CAYtB;IAEF,OAAO,CAAC,YAAY,CAYlB;IAEF,OAAO,CAAC,aAAa,CAiCnB;CACH"}
@@ -1,6 +1,7 @@
1
1
  export type InteractiveLiveSession = {
2
2
  sessionName: string;
3
3
  sessionId: string;
4
+ candidateSessionIds: string[];
4
5
  configDir: string;
5
6
  };
6
7
  //# sourceMappingURL=InteractiveLiveSession.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InteractiveLiveSession.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/InteractiveLiveSession.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
1
+ {"version":3,"file":"InteractiveLiveSession.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/InteractiveLiveSession.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -7,6 +7,7 @@ export type LiveSessionProcessInfo = {
7
7
  ppid: number;
8
8
  commandLine: string;
9
9
  sessionId: string | null;
10
+ currentSessionId: string | null;
10
11
  configDir: string | null;
11
12
  };
12
13
  export type LiveSessionProcessSnapshot = {
@@ -1 +1 @@
1
- {"version":3,"file":"LiveSessionProcessSnapshot.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/LiveSessionProcessSnapshot.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC,CAAC"}
1
+ {"version":3,"file":"LiveSessionProcessSnapshot.d.ts","sourceRoot":"","sources":["../../../src/domain/entities/LiveSessionProcessSnapshot.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,SAAS,EAAE,sBAAsB,EAAE,CAAC;CACrC,CAAC"}
@@ -18,6 +18,7 @@ export declare const OWNER_HANDOVER_COMMAND_MARKER = "Take ownership of";
18
18
  */
19
19
  export declare class ResolveInteractiveLiveSessionsUseCase {
20
20
  resolve: (snapshot: LiveSessionProcessSnapshot) => InteractiveLiveSession[];
21
+ private collectCandidateSessionIds;
21
22
  private findInteractiveProcess;
22
23
  }
23
24
  //# sourceMappingURL=ResolveInteractiveLiveSessionsUseCase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResolveInteractiveLiveSessionsUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/ResolveInteractiveLiveSessionsUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAEL,0BAA0B,EAC3B,MAAM,wCAAwC,CAAC;AAOhD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAejE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,qCAAqC;IAChD,OAAO,GACL,UAAU,0BAA0B,KACnC,sBAAsB,EAAE,CA+BzB;IAEF,OAAO,CAAC,sBAAsB,CA0B5B;CACH"}
1
+ {"version":3,"file":"ResolveInteractiveLiveSessionsUseCase.d.ts","sourceRoot":"","sources":["../../../src/domain/usecases/ResolveInteractiveLiveSessionsUseCase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAEL,0BAA0B,EAC3B,MAAM,wCAAwC,CAAC;AAOhD,eAAO,MAAM,6BAA6B,sBAAsB,CAAC;AAejE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,qCAAqC;IAChD,OAAO,GACL,UAAU,0BAA0B,KACnC,sBAAsB,EAAE,CAiCzB;IAEF,OAAO,CAAC,0BAA0B,CAehC;IAEF,OAAO,CAAC,sBAAsB,CA0B5B;CACH"}
@@ -0,0 +1,4 @@
1
+ export interface SessionRecordReader {
2
+ readCurrentSessionId: (configDir: string, pid: number) => string | null;
3
+ }
4
+ //# sourceMappingURL=SessionRecordReader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SessionRecordReader.d.ts","sourceRoot":"","sources":["../../../../src/domain/usecases/adapter-interfaces/SessionRecordReader.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,oBAAoB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACzE"}