Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/extensions/copilot/src/extension/chatSessions/claude/common/claudeRuntimeDataService.ts
13405 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
import type { AgentInfo, Query } from '@anthropic-ai/claude-agent-sdk';
7
import { Event } from '../../../../util/vs/base/common/event';
8
import { createDecorator } from '../../../../util/vs/platform/instantiation/common/instantiation';
9
10
export const IClaudeRuntimeDataService = createDecorator<IClaudeRuntimeDataService>('claudeRuntimeDataService');
11
12
export interface IClaudeRuntimeDataService {
13
readonly _serviceBrand: undefined;
14
15
/**
16
* Fires when cached runtime data is updated (e.g. after a new session initializes).
17
*/
18
readonly onDidChange: Event<void>;
19
20
/**
21
* Returns the cached list of agents from the most recent Claude session.
22
* Returns an empty array if no session has been initialized yet.
23
*/
24
getAgents(): readonly AgentInfo[];
25
26
/**
27
* Updates the cached runtime data by querying the given SDK Query instance.
28
* Called by ClaudeCodeSession after a new Query is created.
29
*/
30
update(query: Query): Promise<void>;
31
}
32
33