Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/agentHost/common/state/sessionReducers.ts
13399 views
1
/*---------------------------------------------------------------------------------------------
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, softAssertNever, isClientDispatchable } from './protocol/reducers.js';
11
12
import type { ICompletedToolCall, ToolCallState } from './sessionState.js';
13
14
/**
15
* Extracts the VS Code-specific `toolKind` hint from a tool call's `_meta`
16
* bag. This is not part of the protocol and is injected by the agent adapter
17
* (e.g. `copilotEventMapper`).
18
*/
19
export function getToolKind(tc: ToolCallState | ICompletedToolCall): 'terminal' | 'subagent' | undefined {
20
return tc._meta?.toolKind as 'terminal' | 'subagent' | undefined;
21
}
22
23