reducer.ts ×29

Frontier kind: Code frontier

unlabeled · c_1e61b45a01c7

413 tests · 11408 LOC · 50 files · introduces 0 tests · 68 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
29 ranges68 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
695 ranges11408 lines · 50 files · Browse complete extent
All tests (intent)
413 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 68 introduced LOC across 29 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.ts 68 introduced LOC · 29 ranges

Open complete file

91 */
92 export function sessionReducer(state: SessionState, action: SessionAction, log?: (msg: string) => void): SessionState {
93 > switch (action.type) { reducer.ts
94 > // ── Lifecycle ──────────────────────────────────────────────────────────
95 >
96 > case ActionType.SessionReady:
97 // `SessionReady` is purely a lifecycle transition (Creating ->
98 // Ready). It must not touch `status`: for provisional sessions the
103 // is correct.
104 return { ...state, lifecycle: SessionLifecycle.Ready };
105 > reducer.ts
106 > case ActionType.SessionCreationFailed:
107 return {
108 ...state,
110 creationError: action.error,
111 };
112 > reducer.ts
113 > case ActionType.SessionChatAdded: {
114 const list = state.chats;
115 const idx = list.findIndex(c => c.resource === action.summary.resource);
121 return { ...state, chats: updated };
122 }
123 > reducer.ts
124 > case ActionType.SessionChatRemoved: {
125 const list = state.chats;
126 const idx = list.findIndex(c => c.resource === action.chat);
136 return next;
137 }
138 > reducer.ts
139 > case ActionType.SessionChatUpdated: {
140 const list = state.chats;
141 const idx = list.findIndex(c => c.resource === action.chat);
148 return { ...state, chats: updated };
149 }
150 > reducer.ts
151 > case ActionType.SessionDefaultChatChanged:
152 return { ...state, defaultChat: action.defaultChat };
153 > reducer.ts
154 > // ── Metadata ──────────────────────────────────────────────────────────
155 >
156 > case ActionType.SessionTitleChanged:
157 return { ...state, title: action.title };
158 > reducer.ts
159 > case ActionType.SessionIsReadChanged:
160 return {
161 ...state,
162 status: withStatusFlag(state.status, SessionStatus.IsRead, action.isRead),
163 };
164 > reducer.ts
165 > case ActionType.SessionIsArchivedChanged:
166 return {
167 ...state,
168 status: withStatusFlag(state.status, SessionStatus.IsArchived, action.isArchived),
169 };
170 > reducer.ts
171 > case ActionType.SessionActivityChanged:
172 return { ...state, activity: action.activity };
173 > reducer.ts
174 > case ActionType.SessionChangesetsChanged: {
175 const { changesets: _omit, ...stateWithoutChangesets } = state;
176 return action.changesets
178 : stateWithoutChangesets;
179 }
180 > reducer.ts
181 > case ActionType.SessionConfigChanged:
182 if (!state.config) {
183 return state;
190 },
191 };
192 > reducer.ts
193 > case ActionType.SessionMetaChanged:
194 return { ...state, _meta: action._meta };
195 > reducer.ts
196 > case ActionType.SessionServerToolsChanged:
197 return { ...state, serverTools: action.tools };
198 > reducer.ts
199 > case ActionType.SessionActiveClientSet: {
200 const list = state.activeClients;
201 const idx = list.findIndex(c => c.clientId === action.activeClient.clientId);
207 return { ...state, activeClients: updated };
208 }
209 > reducer.ts
210 > case ActionType.SessionActiveClientRemoved: {
211 const list = state.activeClients;
212 const idx = list.findIndex(c => c.clientId === action.clientId);
218 return { ...state, activeClients: updated };
219 }
220 > reducer.ts
221 > // ── Working Directories ─────────────────────────────────────────────
222 >
223 > case ActionType.SessionWorkingDirectorySet: {
224 const list = state.workingDirectories ?? [];
225 if (list.includes(action.directory)) {
228 return { ...state, workingDirectories: [...list, action.directory] };
229 }
230 > reducer.ts
231 > case ActionType.SessionWorkingDirectoryRemoved: {
232 const list = state.workingDirectories;
233 if (!list) {
242 return { ...state, workingDirectories: updated };
243 }
244 > reducer.ts
245 > // ── Input Needed ────────────────────────────────────────────────────
246 >
247 > case ActionType.SessionInputNeededSet: {
248 const list = state.inputNeeded ?? [];
249 const idx = list.findIndex(r => r.id === action.request.id);
254 return { ...state, inputNeeded, status: withInputNeededStatus(state.status, inputNeeded) };
255 }
256 > reducer.ts
257 > case ActionType.SessionInputNeededRemoved: {
258 const list = state.inputNeeded;
259 if (!list) {
274 return next;
275 }
276 > reducer.ts
277 > // ── Customizations ──────────────────────────────────────────────────
278 >
279 > case ActionType.SessionCustomizationsChanged:
280 return { ...state, customizations: action.customizations };
281 > reducer.ts
282 > case ActionType.SessionCustomizationToggled: {
283 const list = state.customizations;
284 if (!list) {
312 return state;
313 }
314 > reducer.ts
315 > case ActionType.SessionCustomizationUpdated: {
316 const list = state.customizations ?? [];
317 const idx = list.findIndex(c => c.id === action.customization.id);
323 return { ...state, customizations: updated };
324 }
325 > reducer.ts
326 > case ActionType.SessionCustomizationRemoved: {
327 const list = state.customizations;
328 if (!list) {
358 return { ...state, customizations: updated };
359 }
360 > reducer.ts
361 > case ActionType.SessionMcpServerStateChanged: {
362 return updateMcpServerCustomization(state, action.id, entry => ({
363 ...entry,
366 }));
367 }
368 > reducer.ts
369 > case ActionType.SessionMcpServerStartRequested: {
370 return updateMcpServerCustomization(state, action.id, entry => ({
371 ...entry,
374 }));
375 }
376 > reducer.ts
377 > case ActionType.SessionMcpServerStopRequested: {
378 return updateMcpServerCustomization(state, action.id, entry => ({
379 ...entry,
382 }));
383 }
384 > reducer.ts
385 > default:
386 softAssertNever(action, log);
387 return state;
388 > } reducer.ts
389 > }