@vscode/chat-lib 0.2.1-30 → 0.2.1-32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/asyncCompletions.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/asyncCompletions.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.d.ts +19 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.d.ts.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.js +12 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.js.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.d.ts +49 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.d.ts.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.js +331 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.js.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.d.ts +2 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.js +2 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.js +2 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostText.d.ts +27 -75
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostText.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostText.js +366 -830
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostText.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostTextStrategy.d.ts +16 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostTextStrategy.d.ts.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostTextStrategy.js +196 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/ghostTextStrategy.js.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/last.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/last.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/last.js +3 -3
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/last.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/requestContext.d.ts +37 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/requestContext.d.ts.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/requestContext.js +7 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/requestContext.js.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/resultType.d.ts +8 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/resultType.d.ts.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/resultType.js +16 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/resultType.js.map +1 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/telemetry.d.ts +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/telemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/telemetry.js +6 -6
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/telemetry.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.js +2 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/inlineCompletion.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/completionsPromptFactory/componentsCompletionsPromptFactory.d.ts +5 -4
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/completionsPromptFactory/componentsCompletionsPromptFactory.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/completionsPromptFactory/componentsCompletionsPromptFactory.js +63 -6
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/completionsPromptFactory/componentsCompletionsPromptFactory.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/contextProviderRegistry.d.ts +9 -0
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/contextProviderRegistry.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/contextProviderRegistry.js +50 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/prompt/contextProviderRegistry.js.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/suggestions/suggestions.d.ts +2 -2
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/suggestions/suggestions.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/suggestions/suggestions.js +2 -4
- package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/suggestions/suggestions.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/common/nesTriggerHint.d.ts +16 -0
- package/dist/src/_internal/extension/inlineEdits/common/nesTriggerHint.d.ts.map +1 -0
- package/dist/src/_internal/extension/inlineEdits/common/nesTriggerHint.js +27 -0
- package/dist/src/_internal/extension/inlineEdits/common/nesTriggerHint.js.map +1 -0
- package/dist/src/_internal/extension/inlineEdits/common/userInteractionMonitor.d.ts +8 -1
- package/dist/src/_internal/extension/inlineEdits/common/userInteractionMonitor.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/common/userInteractionMonitor.js +10 -4
- package/dist/src/_internal/extension/inlineEdits/common/userInteractionMonitor.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts +2 -0
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js +1 -0
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProvider.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js +6 -2
- package/dist/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts +6 -0
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js +101 -49
- package/dist/src/_internal/extension/prompt/node/chatMLFetcher.js.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts +0 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js +8 -2
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
- package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts +0 -4
- package/dist/src/_internal/platform/authentication/common/copilotToken.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/common/copilotToken.js +0 -5
- package/dist/src/_internal/platform/authentication/common/copilotToken.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +4 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +6 -2
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/messagesApi.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/messagesApi.js +9 -0
- package/dist/src/_internal/platform/endpoint/node/messagesApi.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts +6 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js +10 -0
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/fetch.d.ts +1 -1
- package/dist/src/_internal/platform/networking/common/fetch.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts +3 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.js +4 -4
- package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
- package/dist/src/_internal/platform/networking/node/stream.js +5 -6
- package/dist/src/_internal/platform/networking/node/stream.js.map +1 -1
- package/dist/src/main.js +2 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +27 -3
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { ICompletionsLogTargetService } from '../logger';
|
|
|
4
4
|
import { APIChoice } from '../openai/openai';
|
|
5
5
|
import { Prompt } from '../prompt/prompt';
|
|
6
6
|
import { TelemetryWithExp } from '../telemetry';
|
|
7
|
-
import { GetNetworkCompletionsType } from './
|
|
7
|
+
import { GetNetworkCompletionsType } from './completionsFromNetwork';
|
|
8
8
|
export declare const ICompletionsAsyncManagerService: import("../../../../../../util/common/services").ServiceIdentifier<ICompletionsAsyncManagerService>;
|
|
9
9
|
export interface ICompletionsAsyncManagerService {
|
|
10
10
|
readonly _serviceBrand: undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asyncCompletions.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/asyncCompletions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAU,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"asyncCompletions.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/asyncCompletions.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAU,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AA8BrE,eAAO,MAAM,+BAA+B,q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L;;;;;;;OAOG;IACH,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAYtE;;;OAGG;IACH,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAOtD;;;OAGG;IACH,sBAAsB,CACrB,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,uBAAuB,EAAE,uBAAuB,EAChD,aAAa,EAAE,OAAO,CAAC,yBAAyB,CAAC;IA6ClD,0DAA0D;IAC1D,kCAAkC,CACjC,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,OAAO,EACtB,gBAAgB,EAAE,gBAAgB,GAChC,OAAO,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IAmBlD;;;OAGG;IACG,uBAAuB,CAC5B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,OAAO,GACpB,OAAO,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,SAAS,CAAC;IA+DlD;;;;;;;;OAQG;IACH,OAAO,CAAC,aAAa;CAOrB"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { APIChoice } from '../openai/openai';
|
|
2
|
+
import { Prompt } from '../prompt/prompt';
|
|
3
|
+
import { ICompletionsCacheService } from './completionsCache';
|
|
4
|
+
/** Info for caching completions. */
|
|
5
|
+
interface CacheContext {
|
|
6
|
+
/** The text content up to the cursor. */
|
|
7
|
+
prefix: string;
|
|
8
|
+
/** The prompt to send to the model. */
|
|
9
|
+
prompt: Prompt;
|
|
10
|
+
/**
|
|
11
|
+
* If true, add an extra newline at the end of the prefix of the prompt. This is used to get a completion for the next line.
|
|
12
|
+
* Unset if the feature is disabled.
|
|
13
|
+
*/
|
|
14
|
+
requestForNextLine?: boolean;
|
|
15
|
+
}
|
|
16
|
+
/** Appends completions to existing entry in cache or creates new entry. */
|
|
17
|
+
export declare function appendToCache(completionsCacheService: ICompletionsCacheService, requestContext: CacheContext, choice: APIChoice): void;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=cacheUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheUtils.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,oCAAoC;AACpC,UAAU,YAAY;IACrB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,uCAAuC;IACvC,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,uBAAuB,EAAE,wBAAwB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,QAE/H"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.appendToCache = appendToCache;
|
|
8
|
+
/** Appends completions to existing entry in cache or creates new entry. */
|
|
9
|
+
function appendToCache(completionsCacheService, requestContext, choice) {
|
|
10
|
+
completionsCacheService.append(requestContext.prefix, requestContext.prompt.suffix, choice);
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=cacheUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cacheUtils.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/cacheUtils.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAoBhG,sCAEC;AAHD,2EAA2E;AAC3E,SAAgB,aAAa,CAAC,uBAAiD,EAAE,cAA4B,EAAE,MAAiB;IAC/H,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC7F,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CancellationToken as ICancellationToken } from 'vscode-languageserver-protocol';
|
|
2
|
+
import { IConfigurationService } from '../../../../../../platform/configuration/common/configurationService';
|
|
3
|
+
import { IExperimentationService } from '../../../../../../platform/telemetry/common/nullExperimentationService';
|
|
4
|
+
import { IInstantiationService, ServicesAccessor } from '../../../../../../util/vs/platform/instantiation/common/instantiation';
|
|
5
|
+
import { ICompletionsUserErrorNotifierService } from '../error/userErrorNotifier';
|
|
6
|
+
import { ICompletionsFeaturesService } from '../experiments/featuresService';
|
|
7
|
+
import { ICompletionsLogTargetService, Logger } from '../logger';
|
|
8
|
+
import { FinishedCallback, ICompletionsOpenAIFetcherService } from '../openai/fetch';
|
|
9
|
+
import { APIChoice } from '../openai/openai';
|
|
10
|
+
import { TelemetryWithExp } from '../telemetry';
|
|
11
|
+
import { ICompletionsRuntimeModeService } from '../util/runtimeMode';
|
|
12
|
+
import { ICompletionsCacheService } from './completionsCache';
|
|
13
|
+
import { RequestContext } from './requestContext';
|
|
14
|
+
import { GhostTextResultWithTelemetry } from './telemetry';
|
|
15
|
+
export type GetNetworkCompletionsType = GhostTextResultWithTelemetry<[APIChoice, Promise<void>]>;
|
|
16
|
+
export type GetAllNetworkCompletionsType = GhostTextResultWithTelemetry<[APIChoice[], Promise<void>]>;
|
|
17
|
+
export declare const logger: Logger;
|
|
18
|
+
export declare class CompletionsFromNetwork {
|
|
19
|
+
private readonly instantiationService;
|
|
20
|
+
private readonly fetcherService;
|
|
21
|
+
private readonly featuresService;
|
|
22
|
+
private readonly runtimeMode;
|
|
23
|
+
private readonly logTarget;
|
|
24
|
+
private readonly completionsCacheService;
|
|
25
|
+
private readonly userErrorNotifier;
|
|
26
|
+
private readonly configurationService;
|
|
27
|
+
private readonly expService;
|
|
28
|
+
constructor(instantiationService: IInstantiationService, fetcherService: ICompletionsOpenAIFetcherService, featuresService: ICompletionsFeaturesService, runtimeMode: ICompletionsRuntimeModeService, logTarget: ICompletionsLogTargetService, completionsCacheService: ICompletionsCacheService, userErrorNotifier: ICompletionsUserErrorNotifierService, configurationService: IConfigurationService, expService: IExperimentationService);
|
|
29
|
+
/** Requests new completion from OpenAI, should be called if and only if the completions for given prompt were not cached before.
|
|
30
|
+
* It returns only first completion, additional completions are added to the caches in the background.
|
|
31
|
+
* Copies from the base telemetry data are used as the basis for each choice's telemetry.
|
|
32
|
+
*/
|
|
33
|
+
getCompletionsFromNetwork(requestContext: RequestContext, baseTelemetryData: TelemetryWithExp, cancellationToken: ICancellationToken | undefined, finishedCb: FinishedCallback): Promise<GetNetworkCompletionsType>;
|
|
34
|
+
/** Requests new completion from OpenAI, should be called if and only if we are in the servers-side termination mode, and it's follow-up cycling request
|
|
35
|
+
* It returns all requested completions
|
|
36
|
+
* Copies from the base telemetry data are used as the basis for each choice's telemetry.
|
|
37
|
+
*/
|
|
38
|
+
getAllCompletionsFromNetwork(requestContext: RequestContext, baseTelemetryData: TelemetryWithExp, cancellationToken: ICancellationToken | undefined, finishedCb: FinishedCallback): Promise<GetAllNetworkCompletionsType>;
|
|
39
|
+
private genericGetCompletionsFromNetwork;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Post-proceses a completion choice based on the current request context and existing choices.
|
|
43
|
+
*/
|
|
44
|
+
export declare function postProcessChoices(newChoice: APIChoice, currentChoices?: APIChoice[]): APIChoice | undefined;
|
|
45
|
+
export declare function makeGhostAPIChoice(choice: APIChoice, options: {
|
|
46
|
+
forceSingleLine: boolean;
|
|
47
|
+
}): APIChoice;
|
|
48
|
+
export declare function telemetryPerformance(accessor: ServicesAccessor, performanceKind: string, choice: APIChoice, requestStart: number, processingTimeMs: number): void;
|
|
49
|
+
//# sourceMappingURL=completionsFromNetwork.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completionsFromNetwork.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,IAAI,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,EAA8B,qBAAqB,EAAE,MAAM,sEAAsE,CAAC;AACzI,OAAO,EAAE,uBAAuB,EAAE,MAAM,wEAAwE,CAAC;AACjH,OAAO,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,uEAAuE,CAAC;AAEhI,OAAO,EAAE,oCAAoC,EAAE,MAAM,4BAA4B,CAAC;AAClF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEjE,OAAO,EAAyC,gBAAgB,EAAE,gCAAgC,EAAe,MAAM,iBAAiB,CAAC;AACzI,OAAO,EAAE,SAAS,EAA4B,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAa,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,qBA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,CAAC;IAyFrC;;;OAGG;IACU,4BAA4B,CACxC,cAAc,EAAE,cAAc,EAC9B,iBAAiB,EAAE,gBAAgB,EACnC,iBAAiB,EAAE,kBAAkB,GAAG,SAAS,EACjD,UAAU,EAAE,gBAAgB,GAC1B,OAAO,CAAC,4BAA4B,CAAC;YAyC1B,gCAAgC;CAuH9C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CACjC,SAAS,EAAE,SAAS,EACpB,cAAc,CAAC,EAAE,SAAS,EAAE,GAC1B,SAAS,GAAG,SAAS,CASvB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE;IAAE,eAAe,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,CAatG;AAED,wBAAgB,oBAAoB,CACnC,QAAQ,EAAE,gBAAgB,EAC1B,eAAe,EAAE,MAAM,EACvB,MAAM,EAAE,SAAS,EACjB,YAAY,EAAE,MAAM,EACpB,gBAAgB,EAAE,MAAM,QAmBxB"}
|
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*---------------------------------------------------------------------------------------------
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
|
+
*--------------------------------------------------------------------------------------------*/
|
|
6
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
7
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
+
};
|
|
12
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
13
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
14
|
+
};
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.CompletionsFromNetwork = exports.logger = void 0;
|
|
17
|
+
exports.postProcessChoices = postProcessChoices;
|
|
18
|
+
exports.makeGhostAPIChoice = makeGhostAPIChoice;
|
|
19
|
+
exports.telemetryPerformance = telemetryPerformance;
|
|
20
|
+
const configurationService_1 = require("../../../../../../platform/configuration/common/configurationService");
|
|
21
|
+
const nullExperimentationService_1 = require("../../../../../../platform/telemetry/common/nullExperimentationService");
|
|
22
|
+
const instantiation_1 = require("../../../../../../util/vs/platform/instantiation/common/instantiation");
|
|
23
|
+
const config_1 = require("../config");
|
|
24
|
+
const userErrorNotifier_1 = require("../error/userErrorNotifier");
|
|
25
|
+
const featuresService_1 = require("../experiments/featuresService");
|
|
26
|
+
const logger_1 = require("../logger");
|
|
27
|
+
const networkingTypes_1 = require("../networkingTypes");
|
|
28
|
+
const fetch_1 = require("../openai/fetch");
|
|
29
|
+
const openai_1 = require("../openai/openai");
|
|
30
|
+
const telemetry_1 = require("../telemetry");
|
|
31
|
+
const runtimeMode_1 = require("../util/runtimeMode");
|
|
32
|
+
const blockTrimmer_1 = require("./blockTrimmer");
|
|
33
|
+
const cacheUtils_1 = require("./cacheUtils");
|
|
34
|
+
const completionsCache_1 = require("./completionsCache");
|
|
35
|
+
const resultType_1 = require("./resultType");
|
|
36
|
+
const telemetry_2 = require("./telemetry");
|
|
37
|
+
exports.logger = new logger_1.Logger('ghostText');
|
|
38
|
+
let CompletionsFromNetwork = class CompletionsFromNetwork {
|
|
39
|
+
constructor(instantiationService, fetcherService, featuresService, runtimeMode, logTarget, completionsCacheService, userErrorNotifier, configurationService, expService) {
|
|
40
|
+
this.instantiationService = instantiationService;
|
|
41
|
+
this.fetcherService = fetcherService;
|
|
42
|
+
this.featuresService = featuresService;
|
|
43
|
+
this.runtimeMode = runtimeMode;
|
|
44
|
+
this.logTarget = logTarget;
|
|
45
|
+
this.completionsCacheService = completionsCacheService;
|
|
46
|
+
this.userErrorNotifier = userErrorNotifier;
|
|
47
|
+
this.configurationService = configurationService;
|
|
48
|
+
this.expService = expService;
|
|
49
|
+
}
|
|
50
|
+
/** Requests new completion from OpenAI, should be called if and only if the completions for given prompt were not cached before.
|
|
51
|
+
* It returns only first completion, additional completions are added to the caches in the background.
|
|
52
|
+
* Copies from the base telemetry data are used as the basis for each choice's telemetry.
|
|
53
|
+
*/
|
|
54
|
+
async getCompletionsFromNetwork(requestContext, baseTelemetryData, cancellationToken, finishedCb) {
|
|
55
|
+
return this.genericGetCompletionsFromNetwork(requestContext, baseTelemetryData, cancellationToken, finishedCb, 'completions', async (requestStart, processingTime, choicesStream) => {
|
|
56
|
+
const choicesIterator = choicesStream[Symbol.asyncIterator]();
|
|
57
|
+
const firstRes = await choicesIterator.next();
|
|
58
|
+
if (firstRes.done) {
|
|
59
|
+
exports.logger.debug(this.logTarget, 'All choices redacted');
|
|
60
|
+
return {
|
|
61
|
+
type: 'empty',
|
|
62
|
+
reason: 'all choices redacted',
|
|
63
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (cancellationToken?.isCancellationRequested) {
|
|
67
|
+
exports.logger.debug(this.logTarget, 'Cancelled after awaiting redactedChoices iterator');
|
|
68
|
+
return {
|
|
69
|
+
type: 'canceled',
|
|
70
|
+
reason: 'after awaiting redactedChoices iterator',
|
|
71
|
+
telemetryData: (0, telemetry_2.mkCanceledResultTelemetry)(baseTelemetryData),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
const firstChoice = firstRes.value;
|
|
75
|
+
if (firstChoice === undefined) {
|
|
76
|
+
// This is probably unreachable given the firstRes.done check above
|
|
77
|
+
exports.logger.debug(this.logTarget, 'Got undefined choice from redactedChoices iterator');
|
|
78
|
+
return {
|
|
79
|
+
type: 'empty',
|
|
80
|
+
reason: 'got undefined choice from redactedChoices iterator',
|
|
81
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
this.instantiationService.invokeFunction(telemetryPerformance, 'performance', firstChoice, requestStart, processingTime);
|
|
85
|
+
exports.logger.debug(this.logTarget, `Awaited first result, id: ${firstChoice.choiceIndex}`);
|
|
86
|
+
// Adds first result to cache
|
|
87
|
+
const processedFirstChoice = postProcessChoices(firstChoice);
|
|
88
|
+
if (processedFirstChoice) {
|
|
89
|
+
(0, cacheUtils_1.appendToCache)(this.completionsCacheService, requestContext, processedFirstChoice);
|
|
90
|
+
exports.logger.debug(this.logTarget, `GhostText first completion (index ${processedFirstChoice?.choiceIndex}): ${JSON.stringify(processedFirstChoice?.completionText)}`);
|
|
91
|
+
}
|
|
92
|
+
//Create promise for each result, don't `await` it (unless in test mode) but handle asynchronously with `.then()`
|
|
93
|
+
const cacheDone = (async () => {
|
|
94
|
+
const apiChoices = processedFirstChoice !== undefined ? [processedFirstChoice] : [];
|
|
95
|
+
for await (const choice of choicesStream) {
|
|
96
|
+
if (choice === undefined) {
|
|
97
|
+
continue;
|
|
98
|
+
}
|
|
99
|
+
exports.logger.debug(this.logTarget, `GhostText later completion (index ${choice?.choiceIndex}): ${JSON.stringify(choice.completionText)}`);
|
|
100
|
+
const processedChoice = postProcessChoices(choice, apiChoices);
|
|
101
|
+
if (!processedChoice) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
apiChoices.push(processedChoice);
|
|
105
|
+
(0, cacheUtils_1.appendToCache)(this.completionsCacheService, requestContext, processedChoice);
|
|
106
|
+
}
|
|
107
|
+
})();
|
|
108
|
+
if (this.runtimeMode.isRunningInTest()) {
|
|
109
|
+
await cacheDone;
|
|
110
|
+
}
|
|
111
|
+
if (processedFirstChoice) {
|
|
112
|
+
// Because we ask the server to stop at \n above, we don't need to force single line here
|
|
113
|
+
return {
|
|
114
|
+
type: 'success',
|
|
115
|
+
value: [makeGhostAPIChoice(processedFirstChoice, { forceSingleLine: false }), cacheDone],
|
|
116
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
117
|
+
telemetryBlob: baseTelemetryData,
|
|
118
|
+
resultType: resultType_1.ResultType.Network,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
return {
|
|
123
|
+
type: 'empty',
|
|
124
|
+
reason: 'got undefined processedFirstChoice',
|
|
125
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/** Requests new completion from OpenAI, should be called if and only if we are in the servers-side termination mode, and it's follow-up cycling request
|
|
131
|
+
* It returns all requested completions
|
|
132
|
+
* Copies from the base telemetry data are used as the basis for each choice's telemetry.
|
|
133
|
+
*/
|
|
134
|
+
async getAllCompletionsFromNetwork(requestContext, baseTelemetryData, cancellationToken, finishedCb) {
|
|
135
|
+
return this.genericGetCompletionsFromNetwork(requestContext, baseTelemetryData, cancellationToken, finishedCb, 'all completions', async (requestStart, processingTime, choicesStream) => {
|
|
136
|
+
const apiChoices = [];
|
|
137
|
+
for await (const choice of choicesStream) {
|
|
138
|
+
if (cancellationToken?.isCancellationRequested) {
|
|
139
|
+
exports.logger.debug(this.logTarget, 'Cancelled after awaiting choices iterator');
|
|
140
|
+
return {
|
|
141
|
+
type: 'canceled',
|
|
142
|
+
reason: 'after awaiting choices iterator',
|
|
143
|
+
telemetryData: (0, telemetry_2.mkCanceledResultTelemetry)(baseTelemetryData),
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
const processedChoice = postProcessChoices(choice, apiChoices);
|
|
147
|
+
if (!processedChoice) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
apiChoices.push(processedChoice);
|
|
151
|
+
}
|
|
152
|
+
//Append results to current completions cache, and network cache
|
|
153
|
+
if (apiChoices.length > 0) {
|
|
154
|
+
for (const choice of apiChoices) {
|
|
155
|
+
(0, cacheUtils_1.appendToCache)(this.completionsCacheService, requestContext, choice);
|
|
156
|
+
}
|
|
157
|
+
this.instantiationService.invokeFunction(telemetryPerformance, 'cyclingPerformance', apiChoices[0], requestStart, processingTime);
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
type: 'success',
|
|
161
|
+
value: [apiChoices, Promise.resolve()],
|
|
162
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
163
|
+
telemetryBlob: baseTelemetryData,
|
|
164
|
+
resultType: resultType_1.ResultType.Cycling,
|
|
165
|
+
};
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
async genericGetCompletionsFromNetwork(requestContext, baseTelemetryData, cancellationToken, finishedCb, what, processChoices) {
|
|
169
|
+
exports.logger.debug(this.logTarget, `Getting ${what} from network`);
|
|
170
|
+
// copy the base telemetry data
|
|
171
|
+
baseTelemetryData = baseTelemetryData.extendedBy();
|
|
172
|
+
// Request one choice for automatic requests, three for invoked (cycling) requests.
|
|
173
|
+
const n = requestContext.isCycling ? 3 : 1;
|
|
174
|
+
const temperature = (0, openai_1.getTemperatureForSamples)(this.runtimeMode, n);
|
|
175
|
+
const extra = {
|
|
176
|
+
language: requestContext.languageId,
|
|
177
|
+
next_indent: requestContext.indentation.next ?? 0,
|
|
178
|
+
trim_by_indentation: (0, config_1.shouldDoServerTrimming)(requestContext.blockMode),
|
|
179
|
+
prompt_tokens: requestContext.prompt.prefixTokens ?? 0,
|
|
180
|
+
suffix_tokens: requestContext.prompt.suffixTokens ?? 0,
|
|
181
|
+
};
|
|
182
|
+
const postOptions = { n, temperature, code_annotations: false };
|
|
183
|
+
const modelTerminatesSingleline = this.featuresService.modelAlwaysTerminatesSingleline(baseTelemetryData);
|
|
184
|
+
const simulateSingleline = requestContext.blockMode === config_1.BlockMode.MoreMultiline &&
|
|
185
|
+
blockTrimmer_1.BlockTrimmer.isSupported(requestContext.languageId) &&
|
|
186
|
+
!modelTerminatesSingleline;
|
|
187
|
+
if (!requestContext.multiline && !simulateSingleline) {
|
|
188
|
+
// If we are not in multiline mode, we get the server to truncate the results. This does mean that we
|
|
189
|
+
// also cache a single line result which will be reused even if we are later in multiline mode. This is
|
|
190
|
+
// an acceptable trade-off as the transition should be relatively rare and truncating on the server is
|
|
191
|
+
// more efficient.
|
|
192
|
+
// Note that this also means we don't need to truncate when creating the GhostAPIChoice object below.
|
|
193
|
+
postOptions['stop'] = ['\n'];
|
|
194
|
+
}
|
|
195
|
+
else if (requestContext.stop) {
|
|
196
|
+
postOptions['stop'] = requestContext.stop;
|
|
197
|
+
}
|
|
198
|
+
if (requestContext.maxTokens !== undefined) {
|
|
199
|
+
postOptions['max_tokens'] = requestContext.maxTokens;
|
|
200
|
+
}
|
|
201
|
+
const requestStart = Date.now();
|
|
202
|
+
// extend telemetry data
|
|
203
|
+
const newProperties = {
|
|
204
|
+
endpoint: 'completions',
|
|
205
|
+
uiKind: fetch_1.CopilotUiKind.GhostText,
|
|
206
|
+
temperature: JSON.stringify(temperature),
|
|
207
|
+
n: JSON.stringify(n),
|
|
208
|
+
stop: JSON.stringify(postOptions['stop']) ?? 'unset',
|
|
209
|
+
logit_bias: JSON.stringify(null),
|
|
210
|
+
};
|
|
211
|
+
Object.assign(baseTelemetryData.properties, newProperties);
|
|
212
|
+
try {
|
|
213
|
+
const completionParams = {
|
|
214
|
+
prompt: requestContext.prompt,
|
|
215
|
+
languageId: requestContext.languageId,
|
|
216
|
+
repoInfo: requestContext.repoInfo,
|
|
217
|
+
ourRequestId: requestContext.ourRequestId,
|
|
218
|
+
engineModelId: requestContext.engineModelId,
|
|
219
|
+
count: n,
|
|
220
|
+
uiKind: fetch_1.CopilotUiKind.GhostText,
|
|
221
|
+
postOptions,
|
|
222
|
+
headers: requestContext.headers,
|
|
223
|
+
extra,
|
|
224
|
+
};
|
|
225
|
+
const res = this.configurationService.getExperimentBasedConfig(configurationService_1.ConfigKey.TeamInternal.GhostTextUseCompletionsFetchService, this.expService)
|
|
226
|
+
? await this.fetcherService.fetchAndStreamCompletions2(completionParams, baseTelemetryData, finishedCb, cancellationToken)
|
|
227
|
+
: await this.fetcherService.fetchAndStreamCompletions(completionParams, baseTelemetryData, finishedCb, cancellationToken);
|
|
228
|
+
if (res.type === 'failed') {
|
|
229
|
+
return {
|
|
230
|
+
type: 'failed',
|
|
231
|
+
reason: res.reason,
|
|
232
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
if (res.type === 'canceled') {
|
|
236
|
+
exports.logger.debug(this.logTarget, 'Cancelled after awaiting fetchCompletions');
|
|
237
|
+
return {
|
|
238
|
+
type: 'canceled',
|
|
239
|
+
reason: res.reason,
|
|
240
|
+
telemetryData: (0, telemetry_2.mkCanceledResultTelemetry)(baseTelemetryData),
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
return processChoices(requestStart, res.getProcessingTime(), res.choices);
|
|
244
|
+
}
|
|
245
|
+
catch (err) {
|
|
246
|
+
// If we cancelled a network request, we don't want to log an error
|
|
247
|
+
if ((0, networkingTypes_1.isAbortError)(err)) {
|
|
248
|
+
return {
|
|
249
|
+
type: 'canceled',
|
|
250
|
+
reason: 'network request aborted',
|
|
251
|
+
telemetryData: (0, telemetry_2.mkCanceledResultTelemetry)(baseTelemetryData, {
|
|
252
|
+
cancelledNetworkRequest: true,
|
|
253
|
+
}),
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
else {
|
|
257
|
+
this.instantiationService.invokeFunction(acc => exports.logger.exception(acc, err, `Error on ghost text request`));
|
|
258
|
+
this.userErrorNotifier.notifyUser(err);
|
|
259
|
+
if (this.runtimeMode.shouldFailForDebugPurposes()) {
|
|
260
|
+
throw err;
|
|
261
|
+
}
|
|
262
|
+
// not including err in this result because it'll end up in standard telemetry
|
|
263
|
+
return {
|
|
264
|
+
type: 'failed',
|
|
265
|
+
reason: 'non-abort error on ghost text request',
|
|
266
|
+
telemetryData: (0, telemetry_2.mkBasicResultTelemetry)(baseTelemetryData),
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
exports.CompletionsFromNetwork = CompletionsFromNetwork;
|
|
273
|
+
exports.CompletionsFromNetwork = CompletionsFromNetwork = __decorate([
|
|
274
|
+
__param(0, instantiation_1.IInstantiationService),
|
|
275
|
+
__param(1, fetch_1.ICompletionsOpenAIFetcherService),
|
|
276
|
+
__param(2, featuresService_1.ICompletionsFeaturesService),
|
|
277
|
+
__param(3, runtimeMode_1.ICompletionsRuntimeModeService),
|
|
278
|
+
__param(4, logger_1.ICompletionsLogTargetService),
|
|
279
|
+
__param(5, completionsCache_1.ICompletionsCacheService),
|
|
280
|
+
__param(6, userErrorNotifier_1.ICompletionsUserErrorNotifierService),
|
|
281
|
+
__param(7, configurationService_1.IConfigurationService),
|
|
282
|
+
__param(8, nullExperimentationService_1.IExperimentationService)
|
|
283
|
+
], CompletionsFromNetwork);
|
|
284
|
+
/**
|
|
285
|
+
* Post-proceses a completion choice based on the current request context and existing choices.
|
|
286
|
+
*/
|
|
287
|
+
function postProcessChoices(newChoice, currentChoices) {
|
|
288
|
+
if (!currentChoices) {
|
|
289
|
+
currentChoices = [];
|
|
290
|
+
}
|
|
291
|
+
newChoice.completionText = newChoice.completionText.trimEnd();
|
|
292
|
+
if (!newChoice.completionText) {
|
|
293
|
+
return undefined;
|
|
294
|
+
}
|
|
295
|
+
// Collect only unique displayTexts
|
|
296
|
+
if (currentChoices.findIndex(v => v.completionText.trim() === newChoice.completionText.trim()) !== -1) {
|
|
297
|
+
return undefined;
|
|
298
|
+
}
|
|
299
|
+
return newChoice;
|
|
300
|
+
}
|
|
301
|
+
function makeGhostAPIChoice(choice, options) {
|
|
302
|
+
const ghostChoice = { ...choice };
|
|
303
|
+
if (options.forceSingleLine) {
|
|
304
|
+
const { completionText } = ghostChoice;
|
|
305
|
+
// Special case for when completion starts with a newline, don't count that as its own line
|
|
306
|
+
const initialLineBreak = completionText.match(/^\r?\n/);
|
|
307
|
+
if (initialLineBreak) {
|
|
308
|
+
ghostChoice.completionText = initialLineBreak[0] + completionText.split('\n')[1];
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
ghostChoice.completionText = completionText.split('\n')[0];
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
return ghostChoice;
|
|
315
|
+
}
|
|
316
|
+
function telemetryPerformance(accessor, performanceKind, choice, requestStart, processingTimeMs) {
|
|
317
|
+
const requestTimeMs = Date.now() - requestStart;
|
|
318
|
+
const deltaMs = requestTimeMs - processingTimeMs;
|
|
319
|
+
const telemetryData = choice.telemetryData.extendedBy({}, {
|
|
320
|
+
completionCharLen: choice.completionText.length,
|
|
321
|
+
requestTimeMs: requestTimeMs,
|
|
322
|
+
processingTimeMs: processingTimeMs,
|
|
323
|
+
deltaMs: deltaMs,
|
|
324
|
+
// Choice properties
|
|
325
|
+
meanLogProb: choice.meanLogProb || NaN,
|
|
326
|
+
meanAlternativeLogProb: choice.meanAlternativeLogProb || NaN,
|
|
327
|
+
});
|
|
328
|
+
telemetryData.extendWithRequestId(choice.requestId);
|
|
329
|
+
(0, telemetry_1.telemetry)(accessor, `ghostText.${performanceKind}`, telemetryData);
|
|
330
|
+
}
|
|
331
|
+
//# sourceMappingURL=completionsFromNetwork.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completionsFromNetwork.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/completionsFromNetwork.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;AA0ThG,gDAYC;AAED,gDAaC;AAED,oDAwBC;AA5WD,+GAAyI;AACzI,uHAAiH;AACjH,yGAAgI;AAChI,sC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W,CAAC;AACpB,CAAC;AAED,SAAgB,oBAAoB,CACnC,QAA0B,EAC1B,eAAuB,EACvB,MAAiB,EACjB,YAAoB,EACpB,gBAAwB;IAExB,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC;IAChD,MAAM,OAAO,GAAG,aAAa,GAAG,gBAAgB,CAAC;IAEjD,MAAM,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC,UAAU,CACpD,EAAE,EACF;QACC,iBAAiB,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM;QAC/C,aAAa,EAAE,aAAa;QAC5B,gBAAgB,EAAE,gBAAgB;QAClC,OAAO,EAAE,OAAO;QAChB,oBAAoB;QACpB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,GAAG;QACtC,sBAAsB,EAAE,MAAM,CAAC,sBAAsB,IAAI,GAAG;KAC5D,CACD,CAAC;IACF,aAAa,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACpD,IAAA,qBAAS,EAAC,QAAQ,EAAE,aAAa,eAAe,EAAE,EAAE,aAAa,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { CopilotNamedAnnotationList } from '../../../../../../platform/completions-core/common/openai/copilotAnnotations';
|
|
2
2
|
import { TelemetryWithExp } from '../telemetry';
|
|
3
3
|
import { IPosition, IRange, TextDocumentContents } from '../textDocument';
|
|
4
|
-
import { CompletionResult
|
|
4
|
+
import { CompletionResult } from './ghostText';
|
|
5
5
|
import { ITextEditorOptions } from './normalizeIndent';
|
|
6
|
+
import { ResultType } from './resultType';
|
|
6
7
|
export interface CopilotCompletion {
|
|
7
8
|
uuid: string;
|
|
8
9
|
insertText: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilotCompletion.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8EAA8E,CAAC;AAE1H,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAmB,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"copilotCompletion.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8EAA8E,CAAC;AAE1H,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAmB,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAA4B,MAAM,mBAAmB,CAAC;AACjF,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,gBAAgB,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,kBAAkB,CAAC,EAAE,0BAA0B,CAAC;IAChD,kBAAkB,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,+BAA+B,CAC9C,iBAAiB,EAAE,gBAAgB,EAAE,EACrC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,oBAAoB,EAC9B,QAAQ,EAAE,SAAS,EACnB,iBAAiB,CAAC,EAAE,kBAAkB,EACtC,wBAAwB,CAAC,EAAE,MAAM,GAC/B,iBAAiB,EAAE,CAoDrB"}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.completionsFromGhostTextResults = completionsFromGhostTextResults;
|
|
4
4
|
const uuid_1 = require("../../../../../../util/vs/base/common/uuid");
|
|
5
5
|
const textDocument_1 = require("../textDocument");
|
|
6
|
-
const ghostText_1 = require("./ghostText");
|
|
7
6
|
const normalizeIndent_1 = require("./normalizeIndent");
|
|
7
|
+
const resultType_1 = require("./resultType");
|
|
8
8
|
function completionsFromGhostTextResults(completionResults, resultType, document, position, textEditorOptions, lastShownCompletionIndex) {
|
|
9
9
|
const currentLine = document.lineAt(position);
|
|
10
10
|
let completions = completionResults.map(result => {
|
|
@@ -40,7 +40,7 @@ function completionsFromGhostTextResults(completionResults, resultType, document
|
|
|
40
40
|
return completion;
|
|
41
41
|
});
|
|
42
42
|
//If we are in typing as suggested flow, we want to put the last displayed completion at the top of the list to keep it selected
|
|
43
|
-
if (resultType ===
|
|
43
|
+
if (resultType === resultType_1.ResultType.TypingAsSuggested && lastShownCompletionIndex !== undefined) {
|
|
44
44
|
const lastShownCompletion = completions.find(predicate => predicate.index === lastShownCompletionIndex);
|
|
45
45
|
if (lastShownCompletion) {
|
|
46
46
|
const restCompletions = completions.filter(predicate => predicate.index !== lastShownCompletionIndex);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilotCompletion.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"copilotCompletion.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/copilotCompletion.ts"],"names":[],"mappings":";;AA2BA,0EA2DC;AAjFD,qEAA0E;AAE1E,kDAA2F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IAAI,EAAE,IAAA,mBAAY,GAAE;YACpB,UAAU;YACV,KAAK;YACL,GAAG,EAAE,QAAQ,CAAC,GAAG;YACjB,KAAK,EAAE,MAAM,CAAC,UAAU,CAAC,eAAe;YACxC,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,WAAW,EAAE,MAAM,CAAC,UAAU,CAAC,WAAW;YAC1C,QAAQ;YACR,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;YACnC,UAAU;YACV,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;SAC7C,CAAC;QACF,OAAO,UAAU,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,gIAAgI;IAChI,IAAI,UAAU,KAAK,uBAAU,CAAC,iBAAiB,IAAI,wBAAwB,KAAK,SAAS,EAAE,CAAC;QAC3F,MAAM,mBAAmB,GAAG,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,KAAK,wBAAwB,CAAC,CAAC;QACxG,IAAI,mBAAmB,EAAE,CAAC;YACzB,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,KAAK,KAAK,wBAAwB,CAAC,CAAC;YACtG,WAAW,GAAG,CAAC,mBAAmB,EAAE,GAAG,eAAe,CAAC,CAAC;QACzD,CAAC;IACF,CAAC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIChoice } from '../openai/openai';
|
|
2
|
-
import { ResultType } from './
|
|
2
|
+
import { ResultType } from './resultType';
|
|
3
3
|
export declare const ICompletionsCurrentGhostText: import("../../../../../../util/common/services").ServiceIdentifier<ICompletionsCurrentGhostText>;
|
|
4
4
|
export interface ICompletionsCurrentGhostText {
|
|
5
5
|
readonly _serviceBrand: undefined;
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"current.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,eAAO,MAAM,4BAA4B,kGAAwF,CAAC;AAClI,MAAM,WAAW,4BAA4B;IAC5C,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAElC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC;IAEhD,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IACjG,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,SAAS,CAAC;IACrF,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACtE;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,YAAW,4BAA4B;IAC5D,aAAa,EAAE,SAAS,CAAC;IACjC;;6CAEyC;IACzC,OAAO,CAAC,MAAM,CAAC,CAAS;IAExB,sEAAsE;IACtE,OAAO,CAAC,MAAM,CAAC,CAAS;IAExB;;uCAEmC;IACnC,OAAO,CAAC,OAAO,CAAmB;IAElC,yCAAyC;IACzC,IAAI,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAE3C;IAED,oFAAoF;IACpF,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IAErC;gFAC4E;IAC5E,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,UAAU;IAOzF,mEAAmE;IACnE,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,SAAS;IASpF,yFAAyF;IACzF,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAYrE;;qEAEiE;IACjE,OAAO,CAAC,kBAAkB;CAa1B"}
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.js
CHANGED
|
@@ -6,7 +6,7 @@ exports.CurrentGhostText = exports.ICompletionsCurrentGhostText = void 0;
|
|
|
6
6
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
7
7
|
*--------------------------------------------------------------------------------------------*/
|
|
8
8
|
const services_1 = require("../../../../../../util/common/services");
|
|
9
|
-
const
|
|
9
|
+
const resultType_1 = require("./resultType");
|
|
10
10
|
exports.ICompletionsCurrentGhostText = (0, services_1.createServiceIdentifier)('ICompletionsCurrentGhostText');
|
|
11
11
|
/**
|
|
12
12
|
* Stores the internal concept of the currently shown completion, as inferred by
|
|
@@ -27,7 +27,7 @@ class CurrentGhostText {
|
|
|
27
27
|
/** Updates the current ghost text if it was not produced via
|
|
28
28
|
* TypingAsSuggested. Should only be called from the end of getGhostText. */
|
|
29
29
|
setGhostText(prefix, suffix, choices, resultType) {
|
|
30
|
-
if (resultType ===
|
|
30
|
+
if (resultType === resultType_1.ResultType.TypingAsSuggested) {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
this.prefix = prefix;
|
package/dist/src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,qEAAiF;AAEjF,
|
|
1
|
+
{"version":3,"file":"current.js","sourceRoot":"","sources":["../../../../../../../../../src/_internal/extension/completions-core/vscode-node/lib/src/ghostText/current.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,qEAAiF;AAEjF,6CAA0C;AAE7B,QAAA,4BAA4B,GAAG,IAAA,kCAAuB,EAA+B,8BAA8B,CAAC,CAAC;AAalI;;;;GAIG;AACH,MAAa,gBAAgB;IAA7B;QAUC;;2CAEmC;QAC3B,YAAO,GAAgB,EAAE,CAAC;IA0DnC,CAAC;IAxDA,yCAAyC;IACzC,IAAI,kBAAkB;QACrB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC;IAC5C,CAAC;IAKD;gFAC4E;IAC5E,YAAY,CAAC,MAAc,EAAE,MAAc,EAAE,OAAoB,EAAE,UAAsB;QACxF,IAAI,UAAU,KAAK,uBAAU,CAAC,iBAAiB,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,mEAAmE;IACnE,2BAA2B,CAAC,MAAc,EAAE,MAAc;QACzD,MAAM,eAAe,GAAG,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAChE,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;YAAC,OAAO;QAAC,CAAC;QAC9C,uEAAuE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