Path: blob/main/extensions/copilot/src/platform/notebook/common/notebookService.ts
13401 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 { NotebookCell, Uri } from 'vscode';6import { createServiceIdentifier } from '../../../util/common/services';789export interface Variable {10name: string;11value: string;12type?: string;13summary?: string;14}1516export interface VariablesResult {17variable: Variable;18hasNamedChildren: boolean;19indexedChildrenCount: number;20}2122export interface PipPackage {23name: string;24version: string;25}2627export const INotebookService = createServiceIdentifier<INotebookService>('INotebookService');2829export interface INotebookService {30readonly _serviceBrand: undefined;31getVariables(notebook: Uri): Promise<VariablesResult[]>;32getPipPackages(notebook: Uri): Promise<PipPackage[]>;33getCellExecutions(notebook: Uri): NotebookCell[];34runCells(notebook: Uri, range: { start: number; end: number }, autoReveal: boolean): Promise<void>;35trackAgentUsage(): void;36setFollowState(state: boolean): void;37getFollowState(): boolean;38ensureKernelSelected(notebook: Uri): Promise<void>;39hasSupportedNotebooks(uri: Uri): boolean;40// testing utility41setVariables(notebook: Uri, variables: VariablesResult[]): void;42}434445