@vscode/chat-lib 0.0.5-4 → 0.0.5-6
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/xtab/node/xtabProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js +1 -2
- package/dist/src/_internal/extension/xtab/node/xtabProvider.js.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.d.ts +5 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.d.ts.map +1 -1
- package/dist/src/_internal/platform/chat/common/commonTypes.js +4 -0
- package/dist/src/_internal/platform/chat/common/commonTypes.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +0 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +0 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts +1 -1
- package/dist/src/_internal/platform/endpoint/common/endpointProvider.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts +9 -0
- package/dist/src/_internal/platform/endpoint/node/responsesApi.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js +18 -27
- package/dist/src/_internal/platform/endpoint/node/responsesApi.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.d.ts +4 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.js +26 -0
- package/dist/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.js.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts +2 -1
- package/dist/src/_internal/platform/networking/common/networking.d.ts.map +1 -1
- package/dist/src/_internal/platform/networking/common/networking.js.map +1 -1
- package/dist/src/_internal/platform/openai/node/fetch.js +2 -0
- package/dist/src/_internal/platform/openai/node/fetch.js.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts +5 -42
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.d.ts.map +1 -1
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.js +1 -40
- package/dist/src/_internal/platform/requestLogger/node/requestLogger.js.map +1 -1
- package/dist/src/package.json +9 -13
- package/package.json +1 -1
- package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.d.ts +0 -16
- package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.d.ts.map +0 -1
- package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.js +0 -147
- package/dist/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.js.map +0 -1
- package/dist/src/_internal/platform/nesFetch/common/completionsAPI.d.ts +0 -69
- package/dist/src/_internal/platform/nesFetch/common/completionsAPI.d.ts.map +0 -1
- package/dist/src/_internal/platform/nesFetch/common/completionsAPI.js +0 -23
- package/dist/src/_internal/platform/nesFetch/common/completionsAPI.js.map +0 -1
- package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.d.ts +0 -80
- package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.d.ts.map +0 -1
- package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.js +0 -77
- package/dist/src/_internal/platform/nesFetch/common/completionsFetchService.js.map +0 -1
- package/dist/src/_internal/platform/nesFetch/common/responseStream.d.ts +0 -26
- package/dist/src/_internal/platform/nesFetch/common/responseStream.d.ts.map +0 -1
- package/dist/src/_internal/platform/nesFetch/common/responseStream.js +0 -125
- package/dist/src/_internal/platform/nesFetch/common/responseStream.js.map +0 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts +0 -27
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.d.ts.map +0 -1
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js +0 -222
- package/dist/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.js.map +0 -1
- package/dist/src/_internal/platform/nesFetch/node/streamTransformer.d.ts +0 -10
- package/dist/src/_internal/platform/nesFetch/node/streamTransformer.d.ts.map +0 -1
- package/dist/src/_internal/platform/nesFetch/node/streamTransformer.js +0 -86
- package/dist/src/_internal/platform/nesFetch/node/streamTransformer.js.map +0 -1
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.PendingLoggedChatRequest = exports.
|
|
7
|
+
exports.PendingLoggedChatRequest = exports.AbstractRequestLogger = exports.IRequestLogger = exports.ChatRequestScheme = void 0;
|
|
8
8
|
const async_hooks_1 = require("async_hooks");
|
|
9
9
|
const commonTypes_1 = require("../../../platform/chat/common/commonTypes");
|
|
10
10
|
const services_1 = require("../../../util/common/services");
|
|
11
11
|
const lifecycle_1 = require("../../../util/vs/base/common/lifecycle");
|
|
12
|
-
const types_1 = require("../../../util/vs/base/common/types");
|
|
13
12
|
const offsetRange_1 = require("../../../util/vs/editor/common/core/ranges/offsetRange");
|
|
14
13
|
class ChatRequestScheme {
|
|
15
14
|
static { this.chatRequestScheme = 'ccreq'; }
|
|
@@ -85,9 +84,6 @@ class AbstractRequestLogger extends lifecycle_1.Disposable {
|
|
|
85
84
|
logChatRequest(debugName, chatEndpoint, chatParams) {
|
|
86
85
|
return new PendingLoggedChatRequest(this, debugName, chatEndpoint, chatParams);
|
|
87
86
|
}
|
|
88
|
-
logCompletionRequest(debugName, chatEndpoint, chatParams, requestId) {
|
|
89
|
-
return new PendingLoggedCompletionRequest(this, debugName, chatEndpoint, chatParams, requestId);
|
|
90
|
-
}
|
|
91
87
|
enableWorkspaceEditTracing() {
|
|
92
88
|
// no-op by default; concrete implementations can override
|
|
93
89
|
}
|
|
@@ -123,41 +119,6 @@ class AbstractPendingLoggedRequest {
|
|
|
123
119
|
});
|
|
124
120
|
}
|
|
125
121
|
}
|
|
126
|
-
class PendingLoggedCompletionRequest extends AbstractPendingLoggedRequest {
|
|
127
|
-
constructor(logbook, debugName, chatEndpoint, chatParams, requestId) {
|
|
128
|
-
super(logbook, debugName, chatEndpoint, chatParams);
|
|
129
|
-
this.requestId = requestId;
|
|
130
|
-
}
|
|
131
|
-
resolve(result) {
|
|
132
|
-
if (result.isOk()) {
|
|
133
|
-
const completionText = result.val.choices.at(0)?.text;
|
|
134
|
-
(0, types_1.assertType)(completionText !== undefined, 'Completion with empty choices');
|
|
135
|
-
this._logbook.addEntry({
|
|
136
|
-
type: "CompletionSuccess" /* LoggedRequestKind.CompletionSuccess */,
|
|
137
|
-
debugName: this._debugName,
|
|
138
|
-
chatEndpoint: this._chatEndpoint,
|
|
139
|
-
chatParams: this._chatParams,
|
|
140
|
-
startTime: this._time,
|
|
141
|
-
endTime: new Date(),
|
|
142
|
-
timeToFirstToken: this._timeToFirstToken,
|
|
143
|
-
result: { type: commonTypes_1.ChatFetchResponseType.Success, value: completionText, requestId: this.requestId },
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
this._logbook.addEntry({
|
|
148
|
-
type: "CompletionFailure" /* LoggedRequestKind.CompletionFailure */,
|
|
149
|
-
debugName: this._debugName,
|
|
150
|
-
chatEndpoint: this._chatEndpoint,
|
|
151
|
-
chatParams: this._chatParams,
|
|
152
|
-
startTime: this._time,
|
|
153
|
-
endTime: new Date(),
|
|
154
|
-
timeToFirstToken: this._timeToFirstToken,
|
|
155
|
-
result: { type: result.err, requestId: this.requestId },
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
exports.PendingLoggedCompletionRequest = PendingLoggedCompletionRequest;
|
|
161
122
|
class PendingLoggedChatRequest extends AbstractPendingLoggedRequest {
|
|
162
123
|
constructor(logbook, debugName, chatEndpoint, chatParams) {
|
|
163
124
|
super(logbook, debugName, chatEndpoint, chatParams);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestLogger.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/requestLogger/node/requestLogger.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAIhG,6CAAgD;AAEhD,2EAA6I;
|
|
1
|
+
{"version":3,"file":"requestLogger.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/requestLogger/node/requestLogger.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAIhG,6CAAgD;AAEhD,2EAA6I;AAG7I,4DAAwE;AACxE,sEAAoE;AAEpE,wFAAqF;AAQrF,MAAa,iBAAiB;aACN,sBAAiB,GAAG,OAAO,CAAC;IAE5C,MAAM,CAAC,QAAQ,CAAC,IAAa,EAAE,SAA6C,UAAU;QAC5F,IAAI,SAAiB,CAAC;QACtB,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;YAC3B,SAAS,GAAG,WAAW,CAAC;QACzB,CAAC;aAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YAC9B,SAAS,GAAG,MAAM,CAAC;QACpB,CAAC;aAAM,CAAC,CAAC,aAAa;YACrB,SAAS,GAAG,cAAc,CAAC;QAC5B,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,OAAO,GAAG,iBAAiB,CAAC,iBAAiB,WAAW,SAAS,EAAE,CAAC;QACrE,CAAC;aAAM,CAAC;YACP,OAAO,GAAG,iBAAiB,CAAC,iBAAiB,IAAI,IAAI,CAAC,EAAE,IAAI,SAAS,EAAE,CAAC;QACzE,CAAC;IACF,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,GAAW;QACjC,4BAA4B;QAC5B,IAAI,GAAG,KAAK,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC;YAC3D,OAAO,EAAE,IAAI,E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C,UAAU,EAAE,IAAI,CAAC,WAAW;gBAC5B,SAAS,EAAE,IAAI,CAAC,KAAK;gBACrB,OAAO,EAAE,IAAI,IAAI,EAAE;gBACnB,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;gBACxC,MAAM;gBACN,MAAM;aACN,CAAC,CAAC;QACJ,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBACtB,IAAI,EAAE,MAAM,CAAC,IAAI,KAAK,mCAAqB,CAAC,QAAQ,CAAC,CAAC,+DAAqC,CAAC,sDAAgC;gBAC5H,SAAS,EAAE,IAAI,CAAC,UAAU;gBAC1B,YAAY,EAAE,IAAI,CAAC,aAAa;gBAChC,UAAU,EAAE,IAAI,CAAC,WAAW;gBAC5B,SAAS,EAAE,IAAI,CAAC,KAAK;gBACrB,OAAO,EAAE,IAAI,IAAI,EAAE;gBACnB,gBAAgB,EAAE,IAAI,CAAC,iBAAiB;gBACxC,MAAM;aACN,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD;AArCD,4DAqCC"}
|
package/dist/src/package.json
CHANGED
|
@@ -1679,6 +1679,7 @@
|
|
|
1679
1679
|
},
|
|
1680
1680
|
{
|
|
1681
1681
|
"vendor": "customoai",
|
|
1682
|
+
"when": "productQualityType != 'stable'",
|
|
1682
1683
|
"displayName": "OpenAI Compatible",
|
|
1683
1684
|
"managementCommand": "github.copilot.chat.manageBYOK"
|
|
1684
1685
|
}
|
|
@@ -3105,14 +3106,6 @@
|
|
|
3105
3106
|
],
|
|
3106
3107
|
"description": "%github.copilot.config.grokCodeAlternatePrompt%"
|
|
3107
3108
|
},
|
|
3108
|
-
"github.copilot.chat.claudeSonnet45AlternatePrompt": {
|
|
3109
|
-
"type": "string",
|
|
3110
|
-
"default": "default",
|
|
3111
|
-
"tags": [
|
|
3112
|
-
"experimental"
|
|
3113
|
-
],
|
|
3114
|
-
"description": "%github.copilot.config.claudeSonnet45AlternatePrompt%"
|
|
3115
|
-
},
|
|
3116
3109
|
"github.copilot.chat.useResponsesApi": {
|
|
3117
3110
|
"type": "boolean",
|
|
3118
3111
|
"default": true,
|
|
@@ -3963,8 +3956,8 @@
|
|
|
3963
3956
|
"agentSessions": [
|
|
3964
3957
|
{
|
|
3965
3958
|
"id": "codex-placeholder",
|
|
3966
|
-
"name": "OpenAI Codex
|
|
3967
|
-
"when": "github.copilot.chat.codex.
|
|
3959
|
+
"name": "OpenAI Codex",
|
|
3960
|
+
"when": "github.copilot.chat.codex.showPlaceholder && config.chat.experimental.codex.enabled",
|
|
3968
3961
|
"icon": "$(file)"
|
|
3969
3962
|
},
|
|
3970
3963
|
{
|
|
@@ -4221,7 +4214,7 @@
|
|
|
4221
4214
|
"welcomeMessage": "Run local background tasks",
|
|
4222
4215
|
"inputPlaceholder": "Describe your task, type `#` for adding context",
|
|
4223
4216
|
"order": 2,
|
|
4224
|
-
"description": "The Copilot CLI Agent works on your local machine",
|
|
4217
|
+
"description": "The GitHub Copilot CLI Agent works on your local machine",
|
|
4225
4218
|
"when": "!chatEntitlementSignedOut && chatIsEnabled",
|
|
4226
4219
|
"capabilities": {
|
|
4227
4220
|
"supportsFileAttachments": true,
|
|
@@ -4242,7 +4235,10 @@
|
|
|
4242
4235
|
],
|
|
4243
4236
|
"name": "cloud",
|
|
4244
4237
|
"displayName": "GitHub Copilot Cloud Agent",
|
|
4245
|
-
"icon":
|
|
4238
|
+
"icon": {
|
|
4239
|
+
"light": "assets/copilot-cloud.svg",
|
|
4240
|
+
"dark": "assets/copilot-cloud-dark.svg"
|
|
4241
|
+
},
|
|
4246
4242
|
"welcomeTitle": "GitHub Copilot Cloud Agent",
|
|
4247
4243
|
"welcomeMessage": "Delegate tasks to the cloud",
|
|
4248
4244
|
"inputPlaceholder": "Describe your task, type `#` for adding context",
|
|
@@ -4412,7 +4408,7 @@
|
|
|
4412
4408
|
"openai": "^5.11.0",
|
|
4413
4409
|
"outdent": "^0.8.0",
|
|
4414
4410
|
"picomatch": "^4.0.2",
|
|
4415
|
-
"playwright": "^1.
|
|
4411
|
+
"playwright": "^1.56.1",
|
|
4416
4412
|
"prettier": "^3.6.2",
|
|
4417
4413
|
"react": "^17.0.2",
|
|
4418
4414
|
"react-dom": "17.0.2",
|
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { StatelessNextEditDocument } from '../../../platform/inlineEdits/common/statelessNextEditProvider';
|
|
2
|
-
import { LineEdit } from '../../../util/vs/editor/common/core/edits/lineEdit';
|
|
3
|
-
import { StringEdit } from '../../../util/vs/editor/common/core/edits/stringEdit';
|
|
4
|
-
export declare function editWouldDeleteWhatWasJustInserted(activeDocument: StatelessNextEditDocument, lineEdit: LineEdit): boolean;
|
|
5
|
-
/**
|
|
6
|
-
* Represents information loss/gain (4-grams) via an edit.
|
|
7
|
-
*/
|
|
8
|
-
export declare class InformationDelta {
|
|
9
|
-
readonly inserted: Set<string>;
|
|
10
|
-
readonly deleted: Set<string>;
|
|
11
|
-
constructor(inserted?: Set<string>, deleted?: Set<string>);
|
|
12
|
-
combine(other: InformationDelta): InformationDelta;
|
|
13
|
-
isUndoneBy(other: InformationDelta): boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function getInformationDelta(source: string, edit: StringEdit): InformationDelta;
|
|
16
|
-
//# sourceMappingURL=ghNearbyNesProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ghNearbyNesProvider.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gEAAgE,CAAC;AAC3G,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAC;AAKlF,wBAAgB,kCAAkC,CAAC,cAAc,EAAE,yBAAyB,EAAE,QAAQ,EAAE,QAAQ,WAkB/G;AAQD;;GAEG;AACH,qBAAa,gBAAgB;aAGX,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC;aACrB,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC;gBADpB,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAqB,EACzC,OAAO,GAAE,GAAG,CAAC,MAAM,CAAqB;IAGzD,OAAO,CAAC,KAAK,EAAE,gBAAgB;IAI/B,UAAU,CAAC,KAAK,EAAE,gBAAgB;CAiBlC;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,gBAAgB,CAuCtF"}
|
|
@@ -1,147 +0,0 @@
|
|
|
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.InformationDelta = void 0;
|
|
8
|
-
exports.editWouldDeleteWhatWasJustInserted = editWouldDeleteWhatWasJustInserted;
|
|
9
|
-
exports.getInformationDelta = getInformationDelta;
|
|
10
|
-
const N_GRAM_UNDO_RATIO_TO_FILTER_OUT = 0.7;
|
|
11
|
-
function editWouldDeleteWhatWasJustInserted(activeDocument, lineEdit) {
|
|
12
|
-
let edit = lineEdit.toEdit(activeDocument.documentAfterEdits);
|
|
13
|
-
// ! important: reduce it to the minimal set of changes
|
|
14
|
-
edit = edit.normalizeOnSource(activeDocument.documentAfterEdits.value);
|
|
15
|
-
if (!editIsDeletion(edit)) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
// We are deleting something. Is it what was just inserted?
|
|
19
|
-
for (let i = activeDocument.recentEdits.edits.length - 1; i >= 0; i--) {
|
|
20
|
-
const recentEdit = activeDocument.recentEdits.edits[i];
|
|
21
|
-
const rebaseResult = edit.tryRebase(recentEdit);
|
|
22
|
-
if (!rebaseResult) {
|
|
23
|
-
// the edit we want to do cannot be rebased, which indicates that it would interfere with a recent edit
|
|
24
|
-
return true;
|
|
25
|
-
}
|
|
26
|
-
edit = rebaseResult;
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
function editIsDeletion(edit) {
|
|
31
|
-
const deletedChars = edit.replacements.reduce((acc, singleEdit) => acc + singleEdit.replaceRange.length, 0);
|
|
32
|
-
const insertedChars = edit.replacements.reduce((acc, singleEdit) => acc + singleEdit.newText.length, 0);
|
|
33
|
-
return insertedChars === 0 && deletedChars > 0;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Represents information loss/gain (4-grams) via an edit.
|
|
37
|
-
*/
|
|
38
|
-
class InformationDelta {
|
|
39
|
-
constructor(inserted = new Set(), deleted = new Set()) {
|
|
40
|
-
this.inserted = inserted;
|
|
41
|
-
this.deleted = deleted;
|
|
42
|
-
}
|
|
43
|
-
combine(other) {
|
|
44
|
-
return new InformationDelta(setUnion(this.inserted, other.inserted), setUnion(this.deleted, other.deleted));
|
|
45
|
-
}
|
|
46
|
-
isUndoneBy(other) {
|
|
47
|
-
const otherReallyNewInsertions = setMinus(other.inserted, other.deleted);
|
|
48
|
-
const otherReallyDeleted = setMinus(other.deleted, other.inserted);
|
|
49
|
-
const otherReallyDeletesMyInserts = setIntersectionCount(otherReallyDeleted, this.inserted);
|
|
50
|
-
const otherReallyInsertsMyDeletes = setIntersectionCount(otherReallyNewInsertions, this.deleted);
|
|
51
|
-
if (otherReallyDeleted.size > 6 && otherReallyDeletesMyInserts / otherReallyDeleted.size > N_GRAM_UNDO_RATIO_TO_FILTER_OUT) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
if (otherReallyNewInsertions.size > 6 && otherReallyInsertsMyDeletes / otherReallyNewInsertions.size > N_GRAM_UNDO_RATIO_TO_FILTER_OUT) {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
return false;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
exports.InformationDelta = InformationDelta;
|
|
61
|
-
function getInformationDelta(source, edit) {
|
|
62
|
-
const inserted = new Set();
|
|
63
|
-
const deleted = new Set();
|
|
64
|
-
const tryAddDeleted = (deletedRange) => {
|
|
65
|
-
if (!deletedRange) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const deletedText = source.substring(deletedRange.start, deletedRange.endExclusive);
|
|
69
|
-
for (let line of deletedText.split(/\r\n|\r|\n/)) {
|
|
70
|
-
line = line.trim();
|
|
71
|
-
for (const piece of to4grams(line)) {
|
|
72
|
-
deleted.add(piece);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const tryAddInserted = (insertedText) => {
|
|
77
|
-
for (let line of insertedText.split(/\r\n|\r|\n/)) {
|
|
78
|
-
line = line.trim();
|
|
79
|
-
for (const piece of to4grams(line)) {
|
|
80
|
-
inserted.add(piece);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
for (const e of edit.replacements) {
|
|
85
|
-
const e1 = e.removeCommonPrefix(source).removeCommonSuffix(source);
|
|
86
|
-
const e2 = e.removeCommonSuffix(source).removeCommonPrefix(source);
|
|
87
|
-
if (e1.isEmpty) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
tryAddDeleted(e1.replaceRange);
|
|
91
|
-
tryAddDeleted(e2.replaceRange);
|
|
92
|
-
tryAddDeleted(e1.replaceRange.intersect(e2.replaceRange));
|
|
93
|
-
// tryAddInserted(e1.newText);
|
|
94
|
-
// tryAddInserted(e2.newText);
|
|
95
|
-
// e1 might have a suffix overlap with the prefix of e1
|
|
96
|
-
tryAddInserted(trimOverlap(e1.newText, e2.newText));
|
|
97
|
-
}
|
|
98
|
-
return new InformationDelta(inserted, deleted);
|
|
99
|
-
}
|
|
100
|
-
function trimOverlap(stringToEliminateEnd, stringToEliminateStart) {
|
|
101
|
-
const length = Math.min(stringToEliminateEnd.length, stringToEliminateStart.length);
|
|
102
|
-
for (let trimLength = 0; trimLength < length; trimLength++) {
|
|
103
|
-
const str1 = stringToEliminateEnd.slice(0, stringToEliminateEnd.length - trimLength);
|
|
104
|
-
const str2 = stringToEliminateStart.slice(trimLength);
|
|
105
|
-
if (str1 === str2) {
|
|
106
|
-
return str1;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return '';
|
|
110
|
-
}
|
|
111
|
-
function to4grams(text) {
|
|
112
|
-
const result = [];
|
|
113
|
-
for (let i = 4; i < text.length; i++) {
|
|
114
|
-
const ngram = text.slice(i - 4, i);
|
|
115
|
-
result.push(ngram);
|
|
116
|
-
}
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
|
-
function setUnion(a, b) {
|
|
120
|
-
const result = new Set();
|
|
121
|
-
for (const el of a) {
|
|
122
|
-
result.add(el);
|
|
123
|
-
}
|
|
124
|
-
for (const el of b) {
|
|
125
|
-
result.add(el);
|
|
126
|
-
}
|
|
127
|
-
return result;
|
|
128
|
-
}
|
|
129
|
-
function setMinus(a, b) {
|
|
130
|
-
const result = new Set();
|
|
131
|
-
for (const el of a) {
|
|
132
|
-
if (!b.has(el)) {
|
|
133
|
-
result.add(el);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
return result;
|
|
137
|
-
}
|
|
138
|
-
function setIntersectionCount(a, b) {
|
|
139
|
-
let result = 0;
|
|
140
|
-
for (const el of a) {
|
|
141
|
-
if (b.has(el)) {
|
|
142
|
-
result++;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return result;
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=ghNearbyNesProvider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ghNearbyNesProvider.js","sourceRoot":"","sources":["../../../../../../src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx"],"names":[],"mappings":";AAAA;;;gGAG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CAAC,CAAC;QACnC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,CAAc,EAAE,CAAc;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IACD,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,CAAc,EAAE,CAAc;IAC/C,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IACjC,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAChB,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED,SAAS,oBAAoB,CAAC,CAAc,EAAE,CAAc;IAC3D,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YACf,MAAM,EAAE,CAAC;QACV,CAAC;IACF,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Represents a completion response from the API. Note: both the streamed and non-streamed response objects share the same shape (unlike the chat endpoint).
|
|
3
|
-
*
|
|
4
|
-
* Based (updated 31.10.2024) on https://platform.openai.com/docs/api-reference/completions/object
|
|
5
|
-
* (! except `Choice#finish_reason` can be a null during streaming)
|
|
6
|
-
* (! omits `id`, `model`, and `created` for performance)
|
|
7
|
-
*/
|
|
8
|
-
export interface Completion {
|
|
9
|
-
/** The list of completion choices the model generated for the input prompt. */
|
|
10
|
-
choices: Completion.Choice[];
|
|
11
|
-
/** This fingerprint represents the backend configuration that the model runs with. */
|
|
12
|
-
system_fingerprint: string;
|
|
13
|
-
/** The object type, which is always "text_completion". */
|
|
14
|
-
object: string;
|
|
15
|
-
/** Usage statistics for the completion request. */
|
|
16
|
-
usage: Completion.Usage | undefined;
|
|
17
|
-
}
|
|
18
|
-
export declare namespace Completion {
|
|
19
|
-
interface Choice {
|
|
20
|
-
/** The index of the choice. */
|
|
21
|
-
index: number;
|
|
22
|
-
/** The reason the model stopped generating tokens. */
|
|
23
|
-
finish_reason: FinishReason | null;
|
|
24
|
-
/** The log probabilities of the tokens. */
|
|
25
|
-
logprobs?: LogProbs | null;
|
|
26
|
-
/** The generated text. */
|
|
27
|
-
text: string | undefined;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* The reason the model stopped generating tokens.
|
|
31
|
-
*/
|
|
32
|
-
enum FinishReason {
|
|
33
|
-
/** If the model hit a natural stop point or a provided stop sequence. */
|
|
34
|
-
Stop = "stop",
|
|
35
|
-
/** If the maximum number of tokens specified in the request was reached. */
|
|
36
|
-
Length = "length",
|
|
37
|
-
/** If content was omitted due to a flag from our content filters. */
|
|
38
|
-
ContentFilter = "content_filter"
|
|
39
|
-
}
|
|
40
|
-
type LogProbs = {
|
|
41
|
-
/** The list of tokens generated by the model. */
|
|
42
|
-
tokens: string[];
|
|
43
|
-
/** The log probabilities of the tokens. */
|
|
44
|
-
token_logprobs: number[];
|
|
45
|
-
/** The text offsets of the tokens. */
|
|
46
|
-
text_offset: number[];
|
|
47
|
-
/** The top log probabilities of the tokens. */
|
|
48
|
-
top_logprobs: Record<string, number>[];
|
|
49
|
-
};
|
|
50
|
-
interface Usage {
|
|
51
|
-
/** Number of tokens in the generated completion. */
|
|
52
|
-
completion_tokens: number;
|
|
53
|
-
/** Number of tokens in the prompt. */
|
|
54
|
-
prompt_tokens: number;
|
|
55
|
-
/** Total number of tokens used in the request (prompt + completion). */
|
|
56
|
-
total_tokens: number;
|
|
57
|
-
/** Breakdown of tokens used in a completion. */
|
|
58
|
-
completion_tokens_details: TokensDetails;
|
|
59
|
-
/** Breakdown of tokens used in the prompt. */
|
|
60
|
-
prompt_tokens_details: TokensDetails;
|
|
61
|
-
}
|
|
62
|
-
interface TokensDetails {
|
|
63
|
-
/** Audio input tokens present in the prompt. */
|
|
64
|
-
audio_tokens: number;
|
|
65
|
-
/** Tokens generated by the model for reasoning. */
|
|
66
|
-
reasoning_tokens: number;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=completionsAPI.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completionsAPI.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsAPI.ts"],"names":[],"mappings":"AAKA;;;;;;GAMG;AACH,MAAM,WAAW,UAAU;IAC1B,+EAA+E;IAC/E,OAAO,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;IAC7B,sFAAsF;IACtF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,KAAK,EAAE,UAAU,CAAC,KAAK,GAAG,SAAS,CAAC;CACpC;AAED,yBAAiB,UAAU,CAAC;IAC3B,UAAiB,MAAM;QACtB,+BAA+B;QAC/B,KAAK,EAAE,MAAM,CAAC;QACd,sDAAsD;QACtD,aAAa,EAAE,YAAY,GAAG,IAAI,CAAC;QACnC,2CAA2C;QAC3C,QAAQ,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;QAC3B,0BAA0B;QAC1B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;KACzB;IAED;;OAEG;IACH,KAAY,YAAY;QACvB,yEAAyE;QACzE,IAAI,SAAS;QACb,4EAA4E;QAC5E,MAAM,WAAW;QACjB,qEAAqE;QACrE,aAAa,mBAAmB;KAChC;IAED,KAAY,QAAQ,GAAG;QACtB,iDAAiD;QACjD,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,2CAA2C;QAC3C,cAAc,EAAE,MAAM,EAAE,CAAC;QACzB,sCAAsC;QACtC,WAAW,EAAE,MAAM,EAAE,CAAC;QACtB,+CAA+C;QAC/C,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;KACvC,CAAC;IAEF,UAAiB,KAAK;QACrB,oDAAoD;QACpD,iBAAiB,EAAE,MAAM,CAAC;QAC1B,sCAAsC;QACtC,aAAa,EAAE,MAAM,CAAC;QACtB,wEAAwE;QACxE,YAAY,EAAE,MAAM,CAAC;QACrB,gDAAgD;QAChD,yBAAyB,EAAE,aAAa,CAAC;QACzC,8CAA8C;QAC9C,qBAAqB,EAAE,aAAa,CAAC;KACrC;IAED,UAAiB,aAAa;QAC7B,gDAAgD;QAChD,YAAY,EAAE,MAAM,CAAC;QACrB,mDAAmD;QACnD,gBAAgB,EAAE,MAAM,CAAC;KACzB;CACD"}
|
|
@@ -1,23 +0,0 @@
|
|
|
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.Completion = void 0;
|
|
8
|
-
var Completion;
|
|
9
|
-
(function (Completion) {
|
|
10
|
-
/**
|
|
11
|
-
* The reason the model stopped generating tokens.
|
|
12
|
-
*/
|
|
13
|
-
let FinishReason;
|
|
14
|
-
(function (FinishReason) {
|
|
15
|
-
/** If the model hit a natural stop point or a provided stop sequence. */
|
|
16
|
-
FinishReason["Stop"] = "stop";
|
|
17
|
-
/** If the maximum number of tokens specified in the request was reached. */
|
|
18
|
-
FinishReason["Length"] = "length";
|
|
19
|
-
/** If content was omitted due to a flag from our content filters. */
|
|
20
|
-
FinishReason["ContentFilter"] = "content_filter";
|
|
21
|
-
})(FinishReason = Completion.FinishReason || (Completion.FinishReason = {}));
|
|
22
|
-
})(Completion || (exports.Completion = Completion = {}));
|
|
23
|
-
//# sourceMappingURL=completionsAPI.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completionsAPI.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsAPI.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAoBhG,IAAiB,UAAU,CAsD1B;AAtDD,WAAiB,UAAU;IAY1B;;OAEG;IACH,IAAY,YAOX;IAPD,WAAY,YAAY;QACvB,yEAAyE;QACzE,6BAAa,CAAA;QACb,4EAA4E;QAC5E,iCAAiB,CAAA;QACjB,qEAAqE;QACrE,gDAAgC,CAAA;IACjC,CAAC,EAPW,YAAY,GAAZ,uBAAY,KAAZ,uBAAY,QAOvB;AAgCF,CAAC,EAtDgB,UAAU,0BAAV,UAAU,QAsD1B"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import type { ChatErrorDetails } from 'vscode';
|
|
2
|
-
import { Result } from '../../../util/common/result';
|
|
3
|
-
import { CancellationToken } from '../../../util/vs/base/common/cancellation';
|
|
4
|
-
import { ResponseStream } from './responseStream';
|
|
5
|
-
interface BaseCompletionsParams {
|
|
6
|
-
prompt: string;
|
|
7
|
-
stop?: string[];
|
|
8
|
-
top_p?: number;
|
|
9
|
-
best_of?: number;
|
|
10
|
-
max_tokens?: number;
|
|
11
|
-
temperature?: number;
|
|
12
|
-
presence_penalty?: number;
|
|
13
|
-
frequency_penalty?: number;
|
|
14
|
-
model?: string;
|
|
15
|
-
logprobs?: number;
|
|
16
|
-
n?: number;
|
|
17
|
-
stream: true;
|
|
18
|
-
}
|
|
19
|
-
interface CodexV2Params {
|
|
20
|
-
suffix?: string;
|
|
21
|
-
extra?: {
|
|
22
|
-
[key: string]: any;
|
|
23
|
-
};
|
|
24
|
-
code_annotations?: boolean;
|
|
25
|
-
}
|
|
26
|
-
export interface ModelParams extends BaseCompletionsParams, CodexV2Params {
|
|
27
|
-
}
|
|
28
|
-
export type FetchOptions = {
|
|
29
|
-
requestId: string;
|
|
30
|
-
headers: {
|
|
31
|
-
[name: string]: string;
|
|
32
|
-
};
|
|
33
|
-
body: any;
|
|
34
|
-
};
|
|
35
|
-
export type CompletionsFetchFailure = {
|
|
36
|
-
kind: 'cancelled';
|
|
37
|
-
} | {
|
|
38
|
-
kind: 'model_overloaded';
|
|
39
|
-
} | {
|
|
40
|
-
kind: 'model_error';
|
|
41
|
-
} | {
|
|
42
|
-
kind: 'not-registered';
|
|
43
|
-
} | {
|
|
44
|
-
kind: 'not-configured';
|
|
45
|
-
} | {
|
|
46
|
-
kind: 'quota-exceeded';
|
|
47
|
-
} | {
|
|
48
|
-
kind: 'context-window-exceeded';
|
|
49
|
-
/** Message we get in response body. */
|
|
50
|
-
message: string;
|
|
51
|
-
} | {
|
|
52
|
-
kind: 'invalid-api-key';
|
|
53
|
-
/** Message we get in response body. */
|
|
54
|
-
message: string;
|
|
55
|
-
} | {
|
|
56
|
-
kind: 'exceeded-rate-limit';
|
|
57
|
-
/** Message we get in response body. */
|
|
58
|
-
message: string;
|
|
59
|
-
} | {
|
|
60
|
-
kind: 'not-200-status';
|
|
61
|
-
status: number;
|
|
62
|
-
statusText: string;
|
|
63
|
-
};
|
|
64
|
-
export type CompletionsFetchErrorType = 'stop_content_filter' | 'stop_length' | 'unknown';
|
|
65
|
-
export declare class CompletionsFetchError extends Error {
|
|
66
|
-
readonly type: CompletionsFetchErrorType;
|
|
67
|
-
readonly requestId: string;
|
|
68
|
-
constructor(type: CompletionsFetchErrorType, requestId: string, message: string);
|
|
69
|
-
}
|
|
70
|
-
export declare const ICompletionsFetchService: import("../../../util/common/services").ServiceIdentifier<ICompletionsFetchService>;
|
|
71
|
-
/**
|
|
72
|
-
* OpenAI has completions and _chat_ completions endpoints. This's (non-chat) completions endpoint fetcher.
|
|
73
|
-
*/
|
|
74
|
-
export interface ICompletionsFetchService {
|
|
75
|
-
readonly _serviceBrand: undefined;
|
|
76
|
-
fetch(url: string, secretKey: string, params: ModelParams, requestId: string, ct: CancellationToken, headerOverrides?: Record<string, string>): Promise<Result<ResponseStream, CompletionsFetchFailure>>;
|
|
77
|
-
}
|
|
78
|
-
export declare function getErrorDetailsFromFetchError(requestId: string, error: CompletionsFetchFailure): ChatErrorDetails;
|
|
79
|
-
export {};
|
|
80
|
-
//# sourceMappingURL=completionsFetchService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completionsFetchService.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsFetchService.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,UAAU,qBAAqB;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,CAAC,EAAE,MAAM,CA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9C,QAAQ,CAAC,IAAI,EAAE,yBAAyB;IACxC,QAAQ,CAAC,SAAS,EAAE,MAAM;gBADjB,IAAI,EAAE,yBAAyB,EAC/B,SAAS,EAAE,MAAM,EAC1B,OAAO,EAAE,MAAM;CAIhB;AAED,eAAO,MAAM,wBAAwB,qFAAgF,CAAC;AAEtH;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,aAAa,EAAE,SAAS,CAAC;IAElC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,EAAE,iBAAiB,EAAE,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC,CAAC;CACzM;AAED,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,uBAAuB,GAAG,gBAAgB,CAuBjH"}
|
|
@@ -1,77 +0,0 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
-
if (k2 === undefined) k2 = k;
|
|
8
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
-
}
|
|
12
|
-
Object.defineProperty(o, k2, desc);
|
|
13
|
-
}) : (function(o, m, k, k2) {
|
|
14
|
-
if (k2 === undefined) k2 = k;
|
|
15
|
-
o[k2] = m[k];
|
|
16
|
-
}));
|
|
17
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
-
}) : function(o, v) {
|
|
20
|
-
o["default"] = v;
|
|
21
|
-
});
|
|
22
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
-
var ownKeys = function(o) {
|
|
24
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
-
var ar = [];
|
|
26
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
-
return ar;
|
|
28
|
-
};
|
|
29
|
-
return ownKeys(o);
|
|
30
|
-
};
|
|
31
|
-
return function (mod) {
|
|
32
|
-
if (mod && mod.__esModule) return mod;
|
|
33
|
-
var result = {};
|
|
34
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
-
__setModuleDefault(result, mod);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
})();
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.ICompletionsFetchService = exports.CompletionsFetchError = void 0;
|
|
41
|
-
exports.getErrorDetailsFromFetchError = getErrorDetailsFromFetchError;
|
|
42
|
-
const l10n = __importStar(require("@vscode/l10n"));
|
|
43
|
-
const services_1 = require("../../../util/common/services");
|
|
44
|
-
class CompletionsFetchError extends Error {
|
|
45
|
-
constructor(type, requestId, message) {
|
|
46
|
-
super(message);
|
|
47
|
-
this.type = type;
|
|
48
|
-
this.requestId = requestId;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.CompletionsFetchError = CompletionsFetchError;
|
|
52
|
-
exports.ICompletionsFetchService = (0, services_1.createServiceIdentifier)('ICompletionsFetchService');
|
|
53
|
-
function getErrorDetailsFromFetchError(requestId, error) {
|
|
54
|
-
switch (error.kind) {
|
|
55
|
-
case 'cancelled':
|
|
56
|
-
return { message: 'Cancelled' };
|
|
57
|
-
case 'exceeded-rate-limit':
|
|
58
|
-
return {
|
|
59
|
-
message: l10n.t(`Sorry, your request was rate-limited. Please wait and try again.`),
|
|
60
|
-
responseIsFiltered: true,
|
|
61
|
-
};
|
|
62
|
-
case 'quota-exceeded':
|
|
63
|
-
return {
|
|
64
|
-
message: l10n.t(`You've reached your monthly chat messages limit. [Upgrade to Copilot Pro]({0}) (30-day Free Trial) or wait for your limit to reset.`, 'https://aka.ms/github-copilot-upgrade-plan'),
|
|
65
|
-
};
|
|
66
|
-
case 'model_overloaded':
|
|
67
|
-
case 'model_error':
|
|
68
|
-
case 'not-registered':
|
|
69
|
-
case 'not-200-status':
|
|
70
|
-
case 'context-window-exceeded':
|
|
71
|
-
case 'invalid-api-key':
|
|
72
|
-
case 'not-configured':
|
|
73
|
-
default:
|
|
74
|
-
return { message: l10n.t(`Sorry, your request failed. Please try again. Request id: {0}`, requestId) };
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
//# sourceMappingURL=completionsFetchService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"completionsFetchService.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/completionsFetchService.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2FhG,sEAuBC;AAhHD,mDAAqC;AAGrC,4DAAwE;AAiExE,MAAa,qBAAsB,SAAQ,KAAK;IAC/C,YACU,IAA+B,EAC/B,SAAiB,EAC1B,OAAe;QAEf,KAAK,CAAC,OAAO,CAAC,CAAC;QAJN,SAAI,GAAJ,IAAI,CAA2B;QAC/B,cAAS,GAAT,SAAS,CAAQ;IAI3B,CAAC;CACD;AARD,sDAQC;AAEY,QAAA,wBAAwB,GAAG,IAAA,kCAAuB,EAA2B,0BAA0B,CAAC,CAAC;AAWtH,SAAgB,6BAA6B,CAAC,SAAiB,EAAE,KAA8B;IAC9F,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,WAAW;YACf,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;QACjC,KAAK,qBAAqB;YACzB,OAAO;gBACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,kEAAkE,CAAC;gBACnF,kBAAkB,EAAE,IAAI;aACxB,CAAC;QACH,KAAK,gBAAgB;YACpB,OAAO;gBACN,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,qIAAqI,EAAE,4CAA4C,CAAC;aACpM,CAAC;QACH,KAAK,kBAAkB,CAAC;QACxB,KAAK,aAAa,CAAC;QACnB,KAAK,gBAAgB,CAAC;QACtB,KAAK,gBAAgB,CAAC;QACtB,KAAK,yBAAyB,CAAC;QAC/B,KAAK,iBAAiB,CAAC;QACvB,KAAK,gBAAgB,CAAC;QACtB;YACC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,+DAA+D,EAAE,SAAS,CAAC,EAAE,CAAC;IACzG,CAAC;AACF,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Result } from '../../../util/common/result';
|
|
2
|
-
import { AsyncIterableObject } from '../../../util/vs/base/common/async';
|
|
3
|
-
import { Completion } from './completionsAPI';
|
|
4
|
-
export declare class ResponseStream {
|
|
5
|
-
/**
|
|
6
|
-
* A promise that resolves to the array of completions that were emitted by the stream.
|
|
7
|
-
*
|
|
8
|
-
* (it's expected to not throw)
|
|
9
|
-
*/
|
|
10
|
-
readonly aggregatedStream: Promise<Result<Completion[], Error>>;
|
|
11
|
-
/**
|
|
12
|
-
* A completion that aggregates completions stream.
|
|
13
|
-
*
|
|
14
|
-
* (it's expected to not throw)
|
|
15
|
-
*/
|
|
16
|
-
readonly response: Promise<Result<Completion, Error>>;
|
|
17
|
-
/**
|
|
18
|
-
* The stream of completions that were emitted by the response.
|
|
19
|
-
*
|
|
20
|
-
* @throws {Error} if the response stream throws an error.
|
|
21
|
-
*/
|
|
22
|
-
readonly stream: AsyncIterableObject<Completion>;
|
|
23
|
-
constructor(stream: AsyncIterable<Completion>);
|
|
24
|
-
private static aggregateCompletionsStream;
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=responseStream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responseStream.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/nesFetch/common/responseStream.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAmB,MAAM,oCAAoC,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,qBAAa,cAAc;IAC1B;;;;OAIG;IACH,SAAgB,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC;IAEvE;;;;OAIG;IACH,SAAgB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC;IAE7D;;;;OAIG;IACH,SAAgB,MAAM,EAAE,mBAAmB,CAAC,UAAU,CAAC,CAAC;gBAE5C,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC;IAqC7C,OAAO,CAAC,MAAM,CAAC,0BAA0B;CAgFzC"}
|