Path: blob/main/extensions/copilot/src/extension/chatSessions/claude/common/claudeRuntimeDataService.ts
13405 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import type { AgentInfo, Query } from '@anthropic-ai/claude-agent-sdk';6import { Event } from '../../../../util/vs/base/common/event';7import { createDecorator } from '../../../../util/vs/platform/instantiation/common/instantiation';89export const IClaudeRuntimeDataService = createDecorator<IClaudeRuntimeDataService>('claudeRuntimeDataService');1011export interface IClaudeRuntimeDataService {12readonly _serviceBrand: undefined;1314/**15* Fires when cached runtime data is updated (e.g. after a new session initializes).16*/17readonly onDidChange: Event<void>;1819/**20* Returns the cached list of agents from the most recent Claude session.21* Returns an empty array if no session has been initialized yet.22*/23getAgents(): readonly AgentInfo[];2425/**26* Updates the cached runtime data by querying the given SDK Query instance.27* Called by ClaudeCodeSession after a new Query is created.28*/29update(query: Query): Promise<void>;30}313233