@vscode/chat-lib 0.70.2026101301 → 0.71.0
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/common/config.d.ts +0 -1
- package/dist/src/_internal/extension/completions/common/config.d.ts.map +1 -1
- package/dist/src/_internal/extension/completions/common/config.js +0 -4
- package/dist/src/_internal/extension/completions/common/config.js.map +1 -1
- package/dist/src/_internal/extension/conversation/common/languageModelAccess.d.ts +3 -4
- package/dist/src/_internal/extension/conversation/common/languageModelAccess.d.ts.map +1 -1
- package/dist/src/_internal/extension/conversation/common/languageModelAccess.js +7 -8
- package/dist/src/_internal/extension/conversation/common/languageModelAccess.js.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.d.ts +0 -40
- package/dist/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.d.ts.map +1 -1
- package/dist/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.js +0 -153
- package/dist/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.js.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.d.ts.map +1 -1
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.js +2 -0
- package/dist/src/_internal/extension/prompt/node/chatMLFetcherTelemetry.js.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts +0 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js +0 -30
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
- package/dist/src/_internal/platform/authentication/common/authentication.d.ts +7 -0
- package/dist/src/_internal/platform/authentication/common/authentication.d.ts.map +1 -1
- package/dist/src/_internal/platform/authentication/common/authentication.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +0 -6
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +0 -9
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/validator.d.ts +0 -9
- package/dist/src/_internal/platform/configuration/common/validator.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/validator.js +0 -76
- package/dist/src/_internal/platform/configuration/common/validator.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/common/autoModeTiers.d.ts +34 -0
- package/dist/src/_internal/platform/endpoint/common/autoModeTiers.d.ts.map +1 -0
- package/dist/src/_internal/platform/endpoint/common/autoModeTiers.js +58 -0
- package/dist/src/_internal/platform/endpoint/common/autoModeTiers.js.map +1 -0
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.d.ts +16 -2
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.js +35 -16
- package/dist/src/_internal/platform/endpoint/node/autoChatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.d.ts +5 -0
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.d.ts.map +1 -1
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.js +17 -2
- package/dist/src/_internal/platform/endpoint/node/copilotChatEndpoint.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.d.ts +0 -18
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.js +0 -59
- package/dist/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditsModelService.d.ts +7 -0
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditsModelService.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditsModelService.js +2 -0
- package/dist/src/_internal/platform/inlineEdits/common/inlineEditsModelService.js.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/node/inlineEditsModelService.d.ts +3 -0
- package/dist/src/_internal/platform/inlineEdits/node/inlineEditsModelService.d.ts.map +1 -1
- package/dist/src/_internal/platform/inlineEdits/node/inlineEditsModelService.js +26 -0
- package/dist/src/_internal/platform/inlineEdits/node/inlineEditsModelService.js.map +1 -1
- package/dist/src/_internal/platform/languages/common/languageDiagnosticsService.d.ts +0 -2
- package/dist/src/_internal/platform/languages/common/languageDiagnosticsService.d.ts.map +1 -1
- package/dist/src/_internal/platform/languages/common/languageDiagnosticsService.js +0 -4
- package/dist/src/_internal/platform/languages/common/languageDiagnosticsService.js.map +1 -1
- package/dist/src/_internal/platform/proxyModels/common/proxyModelsService.d.ts +10 -0
- package/dist/src/_internal/platform/proxyModels/common/proxyModelsService.d.ts.map +1 -1
- package/dist/src/_internal/platform/proxyModels/common/proxyModelsService.js +3 -0
- package/dist/src/_internal/platform/proxyModels/common/proxyModelsService.js.map +1 -1
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.d.ts +12 -1
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.d.ts.map +1 -1
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.js +72 -41
- package/dist/src/_internal/platform/proxyModels/node/proxyModelsService.js.map +1 -1
- package/dist/src/_internal/platform/terminal/common/terminalService.d.ts +0 -2
- package/dist/src/_internal/platform/terminal/common/terminalService.d.ts.map +1 -1
- package/dist/src/_internal/platform/terminal/common/terminalService.js +0 -8
- package/dist/src/_internal/platform/terminal/common/terminalService.js.map +1 -1
- package/dist/src/_internal/shared-fetch-utils/common/middleware/rateLimitBackoffMiddleware.d.ts +2 -0
- package/dist/src/_internal/shared-fetch-utils/common/middleware/rateLimitBackoffMiddleware.d.ts.map +1 -1
- package/dist/src/_internal/shared-fetch-utils/common/middleware/rateLimitBackoffMiddleware.js +13 -0
- package/dist/src/_internal/shared-fetch-utils/common/middleware/rateLimitBackoffMiddleware.js.map +1 -1
- package/dist/src/_internal/util/common/crypto.d.ts +0 -1
- package/dist/src/_internal/util/common/crypto.d.ts.map +1 -1
- package/dist/src/_internal/util/common/crypto.js +0 -15
- package/dist/src/_internal/util/common/crypto.js.map +1 -1
- package/dist/src/main.d.ts +15 -0
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +23 -2
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +45 -22
- package/package.json +1 -1
|
@@ -7,20 +7,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.vString = vString;
|
|
8
8
|
exports.vNumber = vNumber;
|
|
9
9
|
exports.vBoolean = vBoolean;
|
|
10
|
-
exports.vObjAny = vObjAny;
|
|
11
10
|
exports.vUndefined = vUndefined;
|
|
12
|
-
exports.vNull = vNull;
|
|
13
11
|
exports.vNullable = vNullable;
|
|
14
|
-
exports.vUnchecked = vUnchecked;
|
|
15
|
-
exports.vUnknown = vUnknown;
|
|
16
12
|
exports.vRequired = vRequired;
|
|
17
13
|
exports.vObj = vObj;
|
|
18
14
|
exports.vArray = vArray;
|
|
19
|
-
exports.vTuple = vTuple;
|
|
20
15
|
exports.vUnion = vUnion;
|
|
21
16
|
exports.vEnum = vEnum;
|
|
22
|
-
exports.vLiteral = vLiteral;
|
|
23
|
-
exports.vLazy = vLazy;
|
|
24
17
|
class TypeofValidator {
|
|
25
18
|
constructor(type) {
|
|
26
19
|
this.type = type;
|
|
@@ -41,8 +34,6 @@ const vNumberValidator = new TypeofValidator('number');
|
|
|
41
34
|
function vNumber() { return vNumberValidator; }
|
|
42
35
|
const vBooleanValidator = new TypeofValidator('boolean');
|
|
43
36
|
function vBoolean() { return vBooleanValidator; }
|
|
44
|
-
const vObjAnyValidator = new TypeofValidator('object');
|
|
45
|
-
function vObjAny() { return vObjAnyValidator; }
|
|
46
37
|
const vUndefinedValidator = new TypeofValidator('undefined');
|
|
47
38
|
function vUndefined() { return vUndefinedValidator; }
|
|
48
39
|
class NullValidator {
|
|
@@ -57,23 +48,9 @@ class NullValidator {
|
|
|
57
48
|
}
|
|
58
49
|
}
|
|
59
50
|
const vNullValidator = new NullValidator();
|
|
60
|
-
function vNull() { return vNullValidator; }
|
|
61
51
|
function vNullable(validator) {
|
|
62
52
|
return vUnion(validator, vNullValidator);
|
|
63
53
|
}
|
|
64
|
-
function vUnchecked() {
|
|
65
|
-
return {
|
|
66
|
-
validate(content) {
|
|
67
|
-
return { content: content, error: undefined };
|
|
68
|
-
},
|
|
69
|
-
toSchema() {
|
|
70
|
-
return {};
|
|
71
|
-
},
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
function vUnknown() {
|
|
75
|
-
return vUnchecked();
|
|
76
|
-
}
|
|
77
54
|
function vRequired(validator) {
|
|
78
55
|
return {
|
|
79
56
|
validate(content) {
|
|
@@ -159,34 +136,6 @@ function vArray(validator) {
|
|
|
159
136
|
}
|
|
160
137
|
};
|
|
161
138
|
}
|
|
162
|
-
function vTuple(...validators) {
|
|
163
|
-
return {
|
|
164
|
-
validate(content) {
|
|
165
|
-
if (!Array.isArray(content)) {
|
|
166
|
-
return { content: undefined, error: { message: 'Expected array' } };
|
|
167
|
-
}
|
|
168
|
-
if (content.length !== validators.length) {
|
|
169
|
-
return { content: undefined, error: { message: `Expected tuple of length ${validators.length}, but got ${content.length}` } };
|
|
170
|
-
}
|
|
171
|
-
const result = [];
|
|
172
|
-
for (let i = 0; i < validators.length; i++) {
|
|
173
|
-
const validator = validators[i];
|
|
174
|
-
const { content: value, error } = validator.validate(content[i]);
|
|
175
|
-
if (error) {
|
|
176
|
-
return { content: undefined, error: { message: `Error in element ${i}: ${error.message}` } };
|
|
177
|
-
}
|
|
178
|
-
result.push(value);
|
|
179
|
-
}
|
|
180
|
-
return { content: result, error: undefined };
|
|
181
|
-
},
|
|
182
|
-
toSchema() {
|
|
183
|
-
return {
|
|
184
|
-
type: 'array',
|
|
185
|
-
items: validators.map(validator => validator.toSchema()),
|
|
186
|
-
};
|
|
187
|
-
}
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
139
|
function vUnion(...validators) {
|
|
191
140
|
return {
|
|
192
141
|
validate(content) {
|
|
@@ -222,29 +171,4 @@ function vEnum(...values) {
|
|
|
222
171
|
}
|
|
223
172
|
};
|
|
224
173
|
}
|
|
225
|
-
function vLiteral(value) {
|
|
226
|
-
return {
|
|
227
|
-
validate(content) {
|
|
228
|
-
if (content !== value) {
|
|
229
|
-
return { content: undefined, error: { message: `Expected: ${value}` } };
|
|
230
|
-
}
|
|
231
|
-
return { content, error: undefined };
|
|
232
|
-
},
|
|
233
|
-
toSchema() {
|
|
234
|
-
return {
|
|
235
|
-
const: value,
|
|
236
|
-
};
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
function vLazy(fn) {
|
|
241
|
-
return {
|
|
242
|
-
validate(content) {
|
|
243
|
-
return fn().validate(content);
|
|
244
|
-
},
|
|
245
|
-
toSchema() {
|
|
246
|
-
return fn().toSchema();
|
|
247
|
-
}
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
174
|
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/configuration/common/validator.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAiDhG,0BAA0E;AAG1E,0BAA0E;AAG1E,4BAA6E;AAG7E,
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/configuration/common/validator.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;AAiDhG,0BAA0E;AAG1E,0BAA0E;AAG1E,4BAA6E;AAG7E,gCAAmF;AAiBnF,8BAEC;AAID,8BAeC;AAED,oBAqDC;AAED,wBA2BC;AAED,wBAsBC;AAED,sBAgBC;AA9LD,MAAM,eAAe;IACpB,YAA6B,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AAU,EAAE,CAAC;gBACpC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC9D,IAAI,CAAC,KAAK,EAAE,CAAC;oBACZ,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;gBAC7C,CAAC;gBAED,SAAS,GAAG,KAAK,CAAC;YACnB,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,SAAU,EAAE,CAAC;QAClD,CAAC;QAED,QAAQ;YACP,OAAO;gBACN,KAAK,EAAE,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;aACxD,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC;AAED,SAAgB,KAAK,CAAqB,GAAG,MAAS;IACrD,OAAO;QACN,QAAQ,CAAC,OAAgB;YACxB,IAAI,MAAM,CAAC,OAAO,CAAC,OAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;gBAC3C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,oBAAoB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC;YAC5F,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;QACtC,CAAC;QAED,QAAQ;YACP,OAAO;gBACN,IAAI,EAAE,MAAM;aACZ,CAAC;QACH,CAAC;KACD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Routing profiles accepted by `POST /auto`. A tier is picked per session and
|
|
3
|
+
* biases which models the router may choose from.
|
|
4
|
+
*/
|
|
5
|
+
export declare const autoModeTiers: readonly ["efficiency", "balance", "intelligence", "fast"];
|
|
6
|
+
export type AutoModeTier = typeof autoModeTiers[number];
|
|
7
|
+
export declare function isAutoModeTier(value: unknown): value is AutoModeTier;
|
|
8
|
+
/**
|
|
9
|
+
* The tiers offered in the model picker. `fast` is excluded: it is the profile
|
|
10
|
+
* inline chat falls back to when the user has not picked a tier, and is not
|
|
11
|
+
* offered as a choice. It remains reachable through the internal
|
|
12
|
+
* {@link ConfigKey.Shared.AutoModeTierOverride} setting.
|
|
13
|
+
*/
|
|
14
|
+
export declare const selectableAutoModeTiers: readonly AutoModeTier[];
|
|
15
|
+
/** The tier used when the user has not picked one. */
|
|
16
|
+
export declare const defaultAutoModeTier: AutoModeTier;
|
|
17
|
+
/** The tier inline chat defaults to; latency matters more than routing depth there. */
|
|
18
|
+
export declare const inlineChatAutoModeTier: AutoModeTier;
|
|
19
|
+
/** Key the selected tier is stored under in the Auto model's configuration. */
|
|
20
|
+
export declare const AUTO_MODE_TIER_PROPERTY = "tier";
|
|
21
|
+
/**
|
|
22
|
+
* Maps a retired tier name to its current one, leaving anything else untouched.
|
|
23
|
+
* Needed for raw inputs that predate the rename, such as the override setting or a persisted picker
|
|
24
|
+
* value restored before its model's schema has loaded.
|
|
25
|
+
*/
|
|
26
|
+
export declare function normalizeAutoModeTier(value: unknown): unknown;
|
|
27
|
+
/**
|
|
28
|
+
* Narrows an untrusted value (persisted model configuration, or configuration
|
|
29
|
+
* supplied by a third-party extension through the `vscode.lm` API) to a tier the
|
|
30
|
+
* picker offers. `fast` is rejected so it stays an internal default rather than
|
|
31
|
+
* something a caller can select.
|
|
32
|
+
*/
|
|
33
|
+
export declare function isSelectableAutoModeTier(value: unknown): value is AutoModeTier;
|
|
34
|
+
//# sourceMappingURL=autoModeTiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoModeTiers.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/common/autoModeTiers.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,aAAa,4DAA6D,CAAC;AAExF,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAExD,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,YAAY,EAA8C,CAAC;AAE1G,sDAAsD;AACtD,eAAO,MAAM,mBAAmB,EAAE,YAAwB,CAAC;AAE3D,uFAAuF;AACvF,eAAO,MAAM,sBAAsB,EAAE,YAAqB,CAAC;AAE3D,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAY9C;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAE9E"}
|
|
@@ -0,0 +1,58 @@
|
|
|
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.AUTO_MODE_TIER_PROPERTY = exports.inlineChatAutoModeTier = exports.defaultAutoModeTier = exports.selectableAutoModeTiers = exports.autoModeTiers = void 0;
|
|
8
|
+
exports.isAutoModeTier = isAutoModeTier;
|
|
9
|
+
exports.normalizeAutoModeTier = normalizeAutoModeTier;
|
|
10
|
+
exports.isSelectableAutoModeTier = isSelectableAutoModeTier;
|
|
11
|
+
/**
|
|
12
|
+
* Routing profiles accepted by `POST /auto`. A tier is picked per session and
|
|
13
|
+
* biases which models the router may choose from.
|
|
14
|
+
*/
|
|
15
|
+
exports.autoModeTiers = ['efficiency', 'balance', 'intelligence', 'fast'];
|
|
16
|
+
function isAutoModeTier(value) {
|
|
17
|
+
return exports.autoModeTiers.some(tier => tier === value);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The tiers offered in the model picker. `fast` is excluded: it is the profile
|
|
21
|
+
* inline chat falls back to when the user has not picked a tier, and is not
|
|
22
|
+
* offered as a choice. It remains reachable through the internal
|
|
23
|
+
* {@link ConfigKey.Shared.AutoModeTierOverride} setting.
|
|
24
|
+
*/
|
|
25
|
+
exports.selectableAutoModeTiers = ['efficiency', 'balance', 'intelligence'];
|
|
26
|
+
/** The tier used when the user has not picked one. */
|
|
27
|
+
exports.defaultAutoModeTier = 'balance';
|
|
28
|
+
/** The tier inline chat defaults to; latency matters more than routing depth there. */
|
|
29
|
+
exports.inlineChatAutoModeTier = 'fast';
|
|
30
|
+
/** Key the selected tier is stored under in the Auto model's configuration. */
|
|
31
|
+
exports.AUTO_MODE_TIER_PROPERTY = 'tier';
|
|
32
|
+
/**
|
|
33
|
+
* Tier names retired in favour of the current ones. `POST /auto` still accepts
|
|
34
|
+
* them, but the agent runtime rejects them, so they are mapped forward on read.
|
|
35
|
+
*/
|
|
36
|
+
const retiredAutoModeTiers = {
|
|
37
|
+
eco: 'efficiency',
|
|
38
|
+
balanced: 'balance',
|
|
39
|
+
max: 'intelligence',
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Maps a retired tier name to its current one, leaving anything else untouched.
|
|
43
|
+
* Needed for raw inputs that predate the rename, such as the override setting or a persisted picker
|
|
44
|
+
* value restored before its model's schema has loaded.
|
|
45
|
+
*/
|
|
46
|
+
function normalizeAutoModeTier(value) {
|
|
47
|
+
return typeof value === 'string' ? retiredAutoModeTiers[value] ?? value : value;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Narrows an untrusted value (persisted model configuration, or configuration
|
|
51
|
+
* supplied by a third-party extension through the `vscode.lm` API) to a tier the
|
|
52
|
+
* picker offers. `fast` is rejected so it stays an internal default rather than
|
|
53
|
+
* something a caller can select.
|
|
54
|
+
*/
|
|
55
|
+
function isSelectableAutoModeTier(value) {
|
|
56
|
+
return typeof value === 'string' && exports.selectableAutoModeTiers.includes(value);
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=autoModeTiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autoModeTiers.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/common/autoModeTiers.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAUhG,wCAEC;AAkCD,sDAEC;AAQD,4DAEC;AAxDD;;;GAGG;AACU,QAAA,aAAa,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,CAAU,CAAC;AAIxF,SAAgB,cAAc,CAAC,KAAc;IAC5C,OAAO,qBAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;AACnD,CAAC;AAED;;;;;GAKG;AACU,QAAA,uBAAuB,GAA4B,CAAC,YAAY,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AAE1G,sDAAsD;AACzC,QAAA,mBAAmB,GAAiB,SAAS,CAAC;AAE3D,uFAAuF;AAC1E,QAAA,sBAAsB,GAAiB,MAAM,CAAC;AAE3D,+EAA+E;AAClE,QAAA,uBAAuB,GAAG,MAAM,CAAC;AAE9C;;;GAGG;AACH,MAAM,oBAAoB,GAA2C;IACpE,GAAG,EAAE,YAAY;IACjB,QAAQ,EAAE,SAAS;IACnB,GAAG,EAAE,cAAc;CACnB,CAAC;AAEF;;;;GAIG;AACH,SAAgB,qBAAqB,CAAC,KAAc;IACnD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACjF,CAAC;AAED;;;;;GAKG;AACH,SAAgB,wBAAwB,CAAC,KAAc;IACtD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,+BAA6C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACpG,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { IChatWebSocketManager } from '../../networking/node/chatWebSocketManage
|
|
|
10
10
|
import { IExperimentationService } from '../../telemetry/common/nullExperimentationService';
|
|
11
11
|
import { ITelemetryService } from '../../telemetry/common/telemetry';
|
|
12
12
|
import { ITokenizerProvider } from '../../tokenizer/node/tokenizer';
|
|
13
|
+
import type { AutoModeTier } from '../common/autoModeTiers';
|
|
13
14
|
import { ICAPIClientService } from '../common/capiClient';
|
|
14
15
|
import { IDomainService } from '../common/domainService';
|
|
15
16
|
import { CopilotChatEndpoint } from './copilotChatEndpoint';
|
|
@@ -18,16 +19,29 @@ import { CopilotChatEndpoint } from './copilotChatEndpoint';
|
|
|
18
19
|
* It just effectively wraps a different endpoint and adds the auto stuff on top
|
|
19
20
|
*/
|
|
20
21
|
export declare class AutoChatEndpoint extends CopilotChatEndpoint {
|
|
22
|
+
private readonly _autoSessionToken;
|
|
21
23
|
readonly discountRange: {
|
|
22
24
|
low: number;
|
|
23
25
|
high: number;
|
|
24
26
|
};
|
|
27
|
+
/** Routing tier the session token was minted for; `undefined` for the picker entry, which is never routed. */
|
|
28
|
+
readonly autoTier: AutoModeTier | undefined;
|
|
25
29
|
static readonly pseudoModelId = "auto";
|
|
26
|
-
constructor(_wrappedEndpoint: IChatEndpoint,
|
|
30
|
+
constructor(_wrappedEndpoint: IChatEndpoint, _autoSessionToken: string, _discountPercent: number, discountRange: {
|
|
27
31
|
low: number;
|
|
28
32
|
high: number;
|
|
29
|
-
},
|
|
33
|
+
},
|
|
34
|
+
/** Routing tier the session token was minted for; `undefined` for the picker entry, which is never routed. */
|
|
35
|
+
autoTier: AutoModeTier | undefined, _domainService: IDomainService, _capiClientService: ICAPIClientService, _fetcherService: IFetcherService, _envService: IEnvService, _telemetryService: ITelemetryService, _authService: IAuthenticationService, _chatMLFetcher: IChatMLFetcher, _tokenizerProvider: ITokenizerProvider, _instantiationService: IInstantiationService, _configurationService: IConfigurationService, _expService: IExperimentationService, _chatWebSocketService: IChatWebSocketManager, _logService: ILogService);
|
|
36
|
+
/**
|
|
37
|
+
* Stays an Auto endpoint so a request with a clamped context window keeps its
|
|
38
|
+
* Auto attribution. The metadata already carries the session token and the
|
|
39
|
+
* discounted multiplier, so no further discount is applied.
|
|
40
|
+
*/
|
|
41
|
+
cloneWithTokenOverride(modelMaxPromptTokens: number): IChatEndpoint;
|
|
30
42
|
}
|
|
31
43
|
export declare function isAutoModel(endpoint: IChatEndpoint | undefined): number;
|
|
44
|
+
/** The routing tier that served a request through Auto, or `undefined` when the request did not go through Auto. */
|
|
45
|
+
export declare function getAutoModeTier(endpoint: IChatEndpoint | undefined): AutoModeTier | undefined;
|
|
32
46
|
export declare function isAutoExplainabilityHidden(expService: IExperimentationService): boolean;
|
|
33
47
|
//# sourceMappingURL=autoChatEndpoint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoChatEndpoint.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/node/autoChatEndpoint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,mDAAmD,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 var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
12
12
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
13
13
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
14
14
|
};
|
|
15
|
+
var AutoChatEndpoint_1;
|
|
15
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
17
|
exports.AutoChatEndpoint = void 0;
|
|
17
18
|
exports.isAutoModel = isAutoModel;
|
|
19
|
+
exports.getAutoModeTier = getAutoModeTier;
|
|
18
20
|
exports.isAutoExplainabilityHidden = isAutoExplainabilityHidden;
|
|
19
21
|
const instantiation_1 = require("../../../util/vs/platform/instantiation/common/instantiation");
|
|
20
22
|
const authentication_1 = require("../../authentication/common/authentication");
|
|
@@ -36,27 +38,40 @@ const copilotChatEndpoint_1 = require("./copilotChatEndpoint");
|
|
|
36
38
|
* It just effectively wraps a different endpoint and adds the auto stuff on top
|
|
37
39
|
*/
|
|
38
40
|
let AutoChatEndpoint = class AutoChatEndpoint extends copilotChatEndpoint_1.CopilotChatEndpoint {
|
|
41
|
+
static { AutoChatEndpoint_1 = this; }
|
|
39
42
|
static { this.pseudoModelId = 'auto'; }
|
|
40
|
-
constructor(_wrappedEndpoint,
|
|
41
|
-
|
|
43
|
+
constructor(_wrappedEndpoint, _autoSessionToken, _discountPercent, discountRange,
|
|
44
|
+
/** Routing tier the session token was minted for; `undefined` for the picker entry, which is never routed. */
|
|
45
|
+
autoTier, _domainService, _capiClientService, _fetcherService, _envService, _telemetryService, _authService, _chatMLFetcher, _tokenizerProvider, _instantiationService, _configurationService, _expService, _chatWebSocketService, _logService) {
|
|
46
|
+
super(calculateAutoModelInfo(_wrappedEndpoint, _autoSessionToken, _discountPercent), _domainService, _capiClientService, _fetcherService, _envService, _telemetryService, _authService, _chatMLFetcher, _tokenizerProvider, _instantiationService, _configurationService, _expService, _chatWebSocketService, _logService);
|
|
47
|
+
this._autoSessionToken = _autoSessionToken;
|
|
42
48
|
this.discountRange = discountRange;
|
|
49
|
+
this.autoTier = autoTier;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Stays an Auto endpoint so a request with a clamped context window keeps its
|
|
53
|
+
* Auto attribution. The metadata already carries the session token and the
|
|
54
|
+
* discounted multiplier, so no further discount is applied.
|
|
55
|
+
*/
|
|
56
|
+
cloneWithTokenOverride(modelMaxPromptTokens) {
|
|
57
|
+
return this._instantiationService.createInstance(AutoChatEndpoint_1, super.cloneWithTokenOverride(modelMaxPromptTokens), this._autoSessionToken, 0, this.discountRange, this.autoTier);
|
|
43
58
|
}
|
|
44
59
|
};
|
|
45
60
|
exports.AutoChatEndpoint = AutoChatEndpoint;
|
|
46
|
-
exports.AutoChatEndpoint = AutoChatEndpoint = __decorate([
|
|
47
|
-
__param(
|
|
48
|
-
__param(
|
|
49
|
-
__param(
|
|
50
|
-
__param(
|
|
51
|
-
__param(
|
|
52
|
-
__param(
|
|
53
|
-
__param(
|
|
54
|
-
__param(
|
|
55
|
-
__param(
|
|
56
|
-
__param(
|
|
57
|
-
__param(
|
|
58
|
-
__param(
|
|
59
|
-
__param(
|
|
61
|
+
exports.AutoChatEndpoint = AutoChatEndpoint = AutoChatEndpoint_1 = __decorate([
|
|
62
|
+
__param(5, domainService_1.IDomainService),
|
|
63
|
+
__param(6, capiClient_1.ICAPIClientService),
|
|
64
|
+
__param(7, fetcherService_1.IFetcherService),
|
|
65
|
+
__param(8, envService_1.IEnvService),
|
|
66
|
+
__param(9, telemetry_1.ITelemetryService),
|
|
67
|
+
__param(10, authentication_1.IAuthenticationService),
|
|
68
|
+
__param(11, chatMLFetcher_1.IChatMLFetcher),
|
|
69
|
+
__param(12, tokenizer_1.ITokenizerProvider),
|
|
70
|
+
__param(13, instantiation_1.IInstantiationService),
|
|
71
|
+
__param(14, configurationService_1.IConfigurationService),
|
|
72
|
+
__param(15, nullExperimentationService_1.IExperimentationService),
|
|
73
|
+
__param(16, chatWebSocketManager_1.IChatWebSocketManager),
|
|
74
|
+
__param(17, logService_1.ILogService)
|
|
60
75
|
], AutoChatEndpoint);
|
|
61
76
|
function calculateAutoModelInfo(endpoint, sessionToken, discountPercent) {
|
|
62
77
|
let originalModelInfo;
|
|
@@ -124,6 +139,10 @@ function isAutoModel(endpoint) {
|
|
|
124
139
|
}
|
|
125
140
|
return (endpoint.model === AutoChatEndpoint.pseudoModelId || endpoint instanceof AutoChatEndpoint) ? 1 : -1;
|
|
126
141
|
}
|
|
142
|
+
/** The routing tier that served a request through Auto, or `undefined` when the request did not go through Auto. */
|
|
143
|
+
function getAutoModeTier(endpoint) {
|
|
144
|
+
return endpoint instanceof AutoChatEndpoint ? endpoint.autoTier : undefined;
|
|
145
|
+
}
|
|
127
146
|
/** Kept in sync with the workbench copy in `chatAutoModeExplainability.ts`. */
|
|
128
147
|
const HIDE_AUTO_EXPLAINABILITY_TREATMENT = 'copilotchat.hideAutoExplainability';
|
|
129
148
|
function isAutoExplainabilityHidden(expService) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoChatEndpoint.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/node/autoChatEndpoint.ts"],"names":[],"mappings":";AAAA;;;gGAGgG
|
|
1
|
+
{"version":3,"file":"autoChatEndpoint.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/node/autoChatEndpoint.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;;AAyIhG,kCAKC;AAGD,0CAEC;AAKD,gEAEC;AAxJD,gGAAqG;AACrG,+EAAoF;AACpF,mEAAiE;AACjE,0FAAwF;AACxF,4DAA0D;AAC1D,4DAA0D;AAC1D,2EAAyE;AAEzE,qFAAmF;AACnF,kGAA4F;AAC5F,gEAAqE;AACrE,8DAAoE;AAEpE,qDAA0D;AAC1D,2DAAyD;AAEzD,iDAA8C;AAC9C,+DAA4D;AAE5D;;;GAGG;AACI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,yCAAmB;;aACjC,kBA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CAAC;AAED,+EAA+E;AAC/E,MAAM,kCAAkC,GAAG,oCAAoC,CAAC;AAEhF,SAAgB,0BAA0B,CAAC,UAAmC;IAC7E,OAAO,UAAU,CAAC,oBAAoB,CAAU,kCAAkC,CAAC,KAAK,IAAI,CAAC;AAC9F,CAAC"}
|
|
@@ -19,6 +19,11 @@ import { IModelMetadataFetcher } from './modelMetadataFetcher';
|
|
|
19
19
|
export declare class CopilotChatEndpoint extends ChatEndpoint {
|
|
20
20
|
private readonly _copilotAuthService;
|
|
21
21
|
constructor(modelMetadata: IChatModelInformation, domainService: IDomainService, capiClientService: ICAPIClientService, fetcherService: IFetcherService, envService: IEnvService, telemetryService: ITelemetryService, _copilotAuthService: IAuthenticationService, chatMLFetcher: IChatMLFetcher, tokenizerProvider: ITokenizerProvider, instantiationService: IInstantiationService, configurationService: IConfigurationService, experimentService: IExperimentationService, chatWebSocketService: IChatWebSocketManager, logService: ILogService);
|
|
22
|
+
/**
|
|
23
|
+
* CAPI serves no embeddings to anonymous tokens, so tool search stays off for them, except
|
|
24
|
+
* when CAPI traffic (including embeddings) goes through an HMAC proxy that re-authenticates
|
|
25
|
+
* server-side, e.g. evals. Token-mode overrides (smoke tests, mock servers) stay gated.
|
|
26
|
+
*/
|
|
22
27
|
get supportsToolSearch(): boolean | undefined;
|
|
23
28
|
protected getCompletionsCallback(): RawMessageConversionCallback | undefined;
|
|
24
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilotChatEndpoint.d.ts","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/node/copilotChatEndpoint.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8DAA8D,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"copilotChatEndpoint.d.ts","sourceRoot":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,EAAE,iBAAiB,EACb,mBAAmB,EAAE,sBAAsB,EACpE,aAAa,EAAE,cAAc,EACzB,iBAAiB,EAAE,kBAAkB,EAClC,oBAAoB,EAAE,qBAAqB,EAC3C,oBAAoB,EAAE,qBAAqB,EACzC,iBAAiB,EAAE,uBAAuB,EAC5C,oBAAoB,EAAE,qBAAqB,EACrD,UAAU,EAAE,WAAW;IAerC;;;;OAIG;IACH,IAAoB,kBAAkB,IAAI,OAAO,GAAG,SAAS,CAa5D;cAEkB,sBAAsB,IAAI,4BAA4B,GAAG,SAAS;CAQrF;AAED;;;;;;;;GAQG;AACH,qBAAa,+BAA+B;IAC3C,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAwB;WAE7C,OAAO,CAAC,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;CAc9H;AAED;;;;;GAKG;AACH,qBAAa,0BAA0B;WACzB,OAAO,CAAC,YAAY,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;CAI9H"}
|
|
@@ -33,9 +33,24 @@ let CopilotChatEndpoint = class CopilotChatEndpoint extends chatEndpoint_1.ChatE
|
|
|
33
33
|
super(modelMetadata, domainService, chatMLFetcher, tokenizerProvider, instantiationService, configurationService, experimentService, chatWebSocketService, logService);
|
|
34
34
|
this._copilotAuthService = _copilotAuthService;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
/**
|
|
37
|
+
* CAPI serves no embeddings to anonymous tokens, so tool search stays off for them, except
|
|
38
|
+
* when CAPI traffic (including embeddings) goes through an HMAC proxy that re-authenticates
|
|
39
|
+
* server-side, e.g. evals. Token-mode overrides (smoke tests, mock servers) stay gated.
|
|
40
|
+
*/
|
|
37
41
|
get supportsToolSearch() {
|
|
38
|
-
|
|
42
|
+
if (!super.supportsToolSearch) {
|
|
43
|
+
return super.supportsToolSearch;
|
|
44
|
+
}
|
|
45
|
+
if (!this._copilotAuthService.copilotToken?.isNoAuthUser) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
if (!this._configurationService.getConfig(configurationService_1.ConfigKey.Shared.DebugOverrideCAPIUrl)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
// Only respect the auth type from user (global) settings so a workspace cannot opt in.
|
|
52
|
+
const authType = this._configurationService.inspectConfig(configurationService_1.ConfigKey.Shared.DebugOverrideAuthType)?.globalValue ?? 'hmac';
|
|
53
|
+
return authType === 'hmac';
|
|
39
54
|
}
|
|
40
55
|
getCompletionsCallback() {
|
|
41
56
|
return (out, data) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilotChatEndpoint.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/node/copilotChatEndpoint.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;AAEhG,gGAAqG;AACrG,+EAAoF;AACpF,mEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"copilotChatEndpoint.js","sourceRoot":"","sources":["../../../../../../src/_internal/platform/endpoint/node/copilotChatEndpoint.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;;;;;;;;;;AAEhG,gGAAqG;AACrG,+EAAoF;AACpF,mEAAiE;AACjE,0FAA+G;AAC/G,4DAA0D;AAC1D,4DAA0D;AAC1D,2EAAyE;AAGzE,qFAAmF;AACnF,kGAA4F;AAC5F,gEAAqE;AACrE,8DAAoE;AACpE,qDAA0D;AAC1D,2DAAyD;AAEzD,iDAA8C;AAGvC,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,2BAAY;IACpD,YACC,aAAoC,EACpB,aAA6B,EACzB,iBAAqC,EACxC,cAA+B,EACnC,UAAuB,EACjB,gBAAmC,EACb,mBAA2C,EACpE,aAA6B,EACzB,iBAAqC,EAClC,oBAA2C,EAC3C,oBAA2C,EACzC,iBAA0C,EAC5C,oBAA2C,EACrD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@
|
|
|
1
1
|
import { Position } from '../../../../../util/vs/editor/common/core/position';
|
|
2
2
|
import { Range } from '../../../../../util/vs/editor/common/core/range';
|
|
3
3
|
import { TextLength } from '../../../../../util/vs/editor/common/core/text/textLength';
|
|
4
|
-
/**
|
|
5
|
-
* The end must be greater than or equal to the start.
|
|
6
|
-
*/
|
|
7
|
-
export declare function lengthDiff(startLineCount: number, startColumnCount: number, endLineCount: number, endColumnCount: number): Length;
|
|
8
4
|
/**
|
|
9
5
|
* Represents a non-negative length in terms of line and column count.
|
|
10
6
|
* Does not allocate.
|
|
@@ -16,11 +12,6 @@ export declare const lengthZero: Length;
|
|
|
16
12
|
export declare function lengthIsZero(length: Length): boolean;
|
|
17
13
|
export declare function toLength(lineCount: number, columnCount: number): Length;
|
|
18
14
|
export declare function lengthToObj(length: Length): TextLength;
|
|
19
|
-
export declare function lengthGetLineCount(length: Length): number;
|
|
20
|
-
/**
|
|
21
|
-
* Returns the amount of columns of the given length, assuming that it does not span any line.
|
|
22
|
-
*/
|
|
23
|
-
export declare function lengthGetColumnCountIfZeroLineCount(length: Length): number;
|
|
24
15
|
export declare function lengthAdd(length1: Length, length2: Length): Length;
|
|
25
16
|
export declare function sumLengths<T>(items: readonly T[], lengthFn: (item: T) => Length): Length;
|
|
26
17
|
export declare function lengthEquals(length1: Length, length2: Length): boolean;
|
|
@@ -31,16 +22,7 @@ export declare function lengthDiffNonNegative(length1: Length, length2: Length):
|
|
|
31
22
|
export declare function lengthLessThan(length1: Length, length2: Length): boolean;
|
|
32
23
|
export declare function lengthLessThanEqual(length1: Length, length2: Length): boolean;
|
|
33
24
|
export declare function lengthGreaterThanEqual(length1: Length, length2: Length): boolean;
|
|
34
|
-
export declare function lengthToPosition(length: Length): Position;
|
|
35
25
|
export declare function positionToLength(position: Position): Length;
|
|
36
26
|
export declare function lengthsToRange(lengthStart: Length, lengthEnd: Length): Range;
|
|
37
|
-
export declare function lengthOfRange(range: Range): TextLength;
|
|
38
|
-
export declare function lengthCompare(length1: Length, length2: Length): number;
|
|
39
27
|
export declare function lengthOfString(str: string): Length;
|
|
40
|
-
export declare function lengthOfStringObj(str: string): TextLength;
|
|
41
|
-
/**
|
|
42
|
-
* Computes a numeric hash of the given length.
|
|
43
|
-
*/
|
|
44
|
-
export declare function lengthHash(length: Length): number;
|
|
45
|
-
export declare function lengthMax(length1: Length, length2: Length): Length;
|
|
46
28
|
//# sourceMappingURL=length.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"length.d.ts","sourceRoot":"","sources":["../../../../../../../../src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,iDAAiD,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AAEvF
|
|
1
|
+
{"version":3,"file":"length.d.ts","sourceRoot":"","sources":["../../../../../../../../src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,oDAAoD,CAAC;AAC9E,OAAO,EAAE,KAAK,EAAE,MAAM,iDAAiD,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AAEvF;;;EAGE;AACF,MAAM,MAAM,MAAM,GAAG;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC;AAE1C,eAAO,MAAM,UAAU,EAAe,MAAM,CAAC;AAE7C,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEpD;AAYD,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAQvE;AAED,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAKtD;AAID,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;AAOpE,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,MAAM,CAExF;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAsB9E;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGxE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAE7E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAEhF;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE3D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,KAAK,CAU5E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGlD"}
|
package/dist/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.js
CHANGED
|
@@ -5,12 +5,9 @@
|
|
|
5
5
|
*--------------------------------------------------------------------------------------------*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
exports.lengthZero = void 0;
|
|
8
|
-
exports.lengthDiff = lengthDiff;
|
|
9
8
|
exports.lengthIsZero = lengthIsZero;
|
|
10
9
|
exports.toLength = toLength;
|
|
11
10
|
exports.lengthToObj = lengthToObj;
|
|
12
|
-
exports.lengthGetLineCount = lengthGetLineCount;
|
|
13
|
-
exports.lengthGetColumnCountIfZeroLineCount = lengthGetColumnCountIfZeroLineCount;
|
|
14
11
|
exports.lengthAdd = lengthAdd;
|
|
15
12
|
exports.sumLengths = sumLengths;
|
|
16
13
|
exports.lengthEquals = lengthEquals;
|
|
@@ -18,27 +15,12 @@ exports.lengthDiffNonNegative = lengthDiffNonNegative;
|
|
|
18
15
|
exports.lengthLessThan = lengthLessThan;
|
|
19
16
|
exports.lengthLessThanEqual = lengthLessThanEqual;
|
|
20
17
|
exports.lengthGreaterThanEqual = lengthGreaterThanEqual;
|
|
21
|
-
exports.lengthToPosition = lengthToPosition;
|
|
22
18
|
exports.positionToLength = positionToLength;
|
|
23
19
|
exports.lengthsToRange = lengthsToRange;
|
|
24
|
-
exports.lengthOfRange = lengthOfRange;
|
|
25
|
-
exports.lengthCompare = lengthCompare;
|
|
26
20
|
exports.lengthOfString = lengthOfString;
|
|
27
|
-
exports.lengthOfStringObj = lengthOfStringObj;
|
|
28
|
-
exports.lengthHash = lengthHash;
|
|
29
|
-
exports.lengthMax = lengthMax;
|
|
30
21
|
const strings_1 = require("../../../../../util/vs/base/common/strings");
|
|
31
|
-
const position_1 = require("../../../../../util/vs/editor/common/core/position");
|
|
32
22
|
const range_1 = require("../../../../../util/vs/editor/common/core/range");
|
|
33
23
|
const textLength_1 = require("../../../../../util/vs/editor/common/core/text/textLength");
|
|
34
|
-
/**
|
|
35
|
-
* The end must be greater than or equal to the start.
|
|
36
|
-
*/
|
|
37
|
-
function lengthDiff(startLineCount, startColumnCount, endLineCount, endColumnCount) {
|
|
38
|
-
return (startLineCount !== endLineCount)
|
|
39
|
-
? toLength(endLineCount - startLineCount, endColumnCount)
|
|
40
|
-
: toLength(0, endColumnCount - startColumnCount);
|
|
41
|
-
}
|
|
42
24
|
exports.lengthZero = 0;
|
|
43
25
|
function lengthIsZero(length) {
|
|
44
26
|
return length === 0;
|
|
@@ -65,15 +47,6 @@ function lengthToObj(length) {
|
|
|
65
47
|
const columnCount = l - lineCount * factor;
|
|
66
48
|
return new textLength_1.TextLength(lineCount, columnCount);
|
|
67
49
|
}
|
|
68
|
-
function lengthGetLineCount(length) {
|
|
69
|
-
return Math.floor(length / factor);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Returns the amount of columns of the given length, assuming that it does not span any line.
|
|
73
|
-
*/
|
|
74
|
-
function lengthGetColumnCountIfZeroLineCount(length) {
|
|
75
|
-
return length;
|
|
76
|
-
}
|
|
77
50
|
function lengthAdd(l1, l2) {
|
|
78
51
|
let r = l1 + l2;
|
|
79
52
|
if (l2 >= factor) {
|
|
@@ -120,12 +93,6 @@ function lengthLessThanEqual(length1, length2) {
|
|
|
120
93
|
function lengthGreaterThanEqual(length1, length2) {
|
|
121
94
|
return length1 >= length2;
|
|
122
95
|
}
|
|
123
|
-
function lengthToPosition(length) {
|
|
124
|
-
const l = length;
|
|
125
|
-
const lineCount = Math.floor(l / factor);
|
|
126
|
-
const colCount = l - lineCount * factor;
|
|
127
|
-
return new position_1.Position(lineCount + 1, colCount + 1);
|
|
128
|
-
}
|
|
129
96
|
function positionToLength(position) {
|
|
130
97
|
return toLength(position.lineNumber - 1, position.column - 1);
|
|
131
98
|
}
|
|
@@ -138,34 +105,8 @@ function lengthsToRange(lengthStart, lengthEnd) {
|
|
|
138
105
|
const colCount2 = l2 - lineCount2 * factor;
|
|
139
106
|
return new range_1.Range(lineCount + 1, colCount + 1, lineCount2 + 1, colCount2 + 1);
|
|
140
107
|
}
|
|
141
|
-
function lengthOfRange(range) {
|
|
142
|
-
if (range.startLineNumber === range.endLineNumber) {
|
|
143
|
-
return new textLength_1.TextLength(0, range.endColumn - range.startColumn);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
return new textLength_1.TextLength(range.endLineNumber - range.startLineNumber, range.endColumn - 1);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function lengthCompare(length1, length2) {
|
|
150
|
-
const l1 = length1;
|
|
151
|
-
const l2 = length2;
|
|
152
|
-
return l1 - l2;
|
|
153
|
-
}
|
|
154
108
|
function lengthOfString(str) {
|
|
155
109
|
const lines = (0, strings_1.splitLines)(str);
|
|
156
110
|
return toLength(lines.length - 1, lines[lines.length - 1].length);
|
|
157
111
|
}
|
|
158
|
-
function lengthOfStringObj(str) {
|
|
159
|
-
const lines = (0, strings_1.splitLines)(str);
|
|
160
|
-
return new textLength_1.TextLength(lines.length - 1, lines[lines.length - 1].length);
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Computes a numeric hash of the given length.
|
|
164
|
-
*/
|
|
165
|
-
function lengthHash(length) {
|
|
166
|
-
return length;
|
|
167
|
-
}
|
|
168
|
-
function lengthMax(length1, length2) {
|
|
169
|
-
return length1 > length2 ? length1 : length2;
|
|
170
|
-
}
|
|
171
112
|
//# sourceMappingURL=length.js.map
|