1
>
/*---------------------------------------------------------------------------------------------
sessionReducers.ts
2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
// Re-exports the protocol reducers and adds VS Code-specific helpers.
7
>
// The actual reducer logic lives in the auto-generated protocol layer.
8
>
9
>
// Re-export reducers from the protocol layer
10
>
export { rootReducer, sessionReducer, chatReducer, changesetReducer, annotationsReducer, softAssertNever, isClientDispatchable } from './protocol/reducers.js';
11
>
12
>
import { readToolCallMeta, type ToolKind } from '../meta/agentToolCallMeta.js';
13
>
import type { ICompletedToolCall, ToolCallState } from './sessionState.js';
14
>
15
>
/**
16
>
* Extracts the VS Code-specific `toolKind` hint from a tool call's `_meta`
17
>
* bag. This is not part of the protocol and is injected by the agent adapter
18
>
* (e.g. `copilotEventMapper`).
19
>
*/
20
>
export function getToolKind(tc: ToolCallState | ICompletedToolCall): ToolKind | undefined {
21
return readToolCallMeta(tc).toolKind;
22
}