@vscode/chat-lib 0.0.1 → 0.0.2
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/common/promptCrafting.d.ts.map +1 -1
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js +6 -5
- package/dist/src/_internal/extension/xtab/common/promptCrafting.js.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts +1 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/configuration/common/configurationService.js +1 -0
- package/dist/src/_internal/platform/configuration/common/configurationService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.d.ts +5 -0
- package/dist/src/_internal/platform/env/common/envService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/envService.js +2 -1
- package/dist/src/_internal/platform/env/common/envService.js.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts +3 -0
- package/dist/src/_internal/platform/env/common/nullEnvService.d.ts.map +1 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js +8 -1
- package/dist/src/_internal/platform/env/common/nullEnvService.js.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts +7 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.d.ts.map +1 -1
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js +1 -0
- package/dist/src/_internal/platform/telemetry/common/nullExperimentationService.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts +8 -0
- package/dist/src/_internal/util/common/test/shims/chatTypes.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js +19 -1
- package/dist/src/_internal/util/common/test/shims/chatTypes.js.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.d.ts.map +1 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js +8 -1
- package/dist/src/_internal/util/common/test/shims/vscodeTypesShim.js.map +1 -1
- package/dist/src/_internal/vscodeTypes.d.ts +4 -0
- package/dist/src/_internal/vscodeTypes.d.ts.map +1 -1
- package/dist/src/_internal/vscodeTypes.js +5 -1
- package/dist/src/_internal/vscodeTypes.js.map +1 -1
- package/dist/src/main.d.ts +5 -0
- package/dist/src/main.d.ts.map +1 -1
- package/dist/src/main.js +12 -0
- package/dist/src/main.js.map +1 -1
- package/dist/src/package.json +46 -19
- package/package.json +3 -6
- package/src/_internal/extension/byok/node/openAIEndpoint.ts +0 -171
- package/src/_internal/extension/common/constants.ts +0 -90
- package/src/_internal/extension/inlineEdits/common/delayer.ts +0 -108
- package/src/_internal/extension/inlineEdits/common/editRebase.ts +0 -268
- package/src/_internal/extension/inlineEdits/common/ghNearbyNesProvider.tsx +0 -163
- package/src/_internal/extension/inlineEdits/common/nearbyCursorInlineEditProvider.ts +0 -225
- package/src/_internal/extension/inlineEdits/common/rejectionCollector.ts +0 -164
- package/src/_internal/extension/inlineEdits/node/debugRecorder.ts +0 -205
- package/src/_internal/extension/inlineEdits/node/importFiltering.ts +0 -25
- package/src/_internal/extension/inlineEdits/node/nesConfigs.ts +0 -12
- package/src/_internal/extension/inlineEdits/node/nextEditCache.ts +0 -278
- package/src/_internal/extension/inlineEdits/node/nextEditProvider.ts +0 -778
- package/src/_internal/extension/inlineEdits/node/nextEditProviderTelemetry.ts +0 -983
- package/src/_internal/extension/inlineEdits/node/nextEditResult.ts +0 -40
- package/src/_internal/extension/prompt/common/importStatement.ts +0 -25
- package/src/_internal/extension/prompt/node/chatMLFetcher.ts +0 -706
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/fragments.ts +0 -146
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/implementation.ts +0 -527
- package/src/_internal/extension/prompts/node/inline/summarizedDocument/projectedText.ts +0 -76
- package/src/_internal/extension/prompts/node/inline/visualization.ts +0 -65
- package/src/_internal/extension/vscode.proposed.activeComment.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.aiRelatedInformation.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.aiSettingsSearch.d.ts +0 -31
- package/src/_internal/extension/vscode.proposed.aiTextSearchProvider.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.authLearnMore.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.chatBinaryReferenceData.d.ts +0 -41
- package/src/_internal/extension/vscode.proposed.chatEditing.d.ts +0 -29
- package/src/_internal/extension/vscode.proposed.chatParticipantAdditions.d.ts +0 -636
- package/src/_internal/extension/vscode.proposed.chatParticipantPrivate.d.ts +0 -276
- package/src/_internal/extension/vscode.proposed.chatProvider.d.ts +0 -62
- package/src/_internal/extension/vscode.proposed.chatReadonlyPromptReference.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.chatReferenceDiagnostic.d.ts +0 -23
- package/src/_internal/extension/vscode.proposed.chatSessionsProvider.d.ts +0 -218
- package/src/_internal/extension/vscode.proposed.chatStatusItem.d.ts +0 -61
- package/src/_internal/extension/vscode.proposed.codeActionAI.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.commentReveal.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.contribCommentThreadAdditionalMenu.d.ts +0 -8
- package/src/_internal/extension/vscode.proposed.contribCommentsViewThreadMenus.d.ts +0 -6
- package/src/_internal/extension/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +0 -7
- package/src/_internal/extension/vscode.proposed.dataChannels.d.ts +0 -19
- package/src/_internal/extension/vscode.proposed.defaultChatParticipant.d.ts +0 -52
- package/src/_internal/extension/vscode.proposed.documentFiltersExclusive.d.ts +0 -13
- package/src/_internal/extension/vscode.proposed.embeddings.d.ts +0 -33
- package/src/_internal/extension/vscode.proposed.extensionsAny.d.ts +0 -40
- package/src/_internal/extension/vscode.proposed.findFiles2.d.ts +0 -125
- package/src/_internal/extension/vscode.proposed.findTextInFiles.d.ts +0 -104
- package/src/_internal/extension/vscode.proposed.findTextInFiles2.d.ts +0 -144
- package/src/_internal/extension/vscode.proposed.inlineCompletionsAdditions.d.ts +0 -202
- package/src/_internal/extension/vscode.proposed.interactive.d.ts +0 -11
- package/src/_internal/extension/vscode.proposed.languageModelCapabilities.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.languageModelDataPart.d.ts +0 -163
- package/src/_internal/extension/vscode.proposed.languageModelSystem.d.ts +0 -17
- package/src/_internal/extension/vscode.proposed.languageModelThinkingPart.d.ts +0 -49
- package/src/_internal/extension/vscode.proposed.languageModelToolResultAudience.d.ts +0 -36
- package/src/_internal/extension/vscode.proposed.mappedEditsProvider.d.ts +0 -110
- package/src/_internal/extension/vscode.proposed.newSymbolNamesProvider.d.ts +0 -47
- package/src/_internal/extension/vscode.proposed.readonlyMessage.d.ts +0 -14
- package/src/_internal/extension/vscode.proposed.resolvers.d.ts +0 -475
- package/src/_internal/extension/vscode.proposed.scmInputBoxValueProvider.d.ts +0 -25
- package/src/_internal/extension/vscode.proposed.taskProblemMatcherStatus.d.ts +0 -42
- package/src/_internal/extension/vscode.proposed.terminalDataWriteEvent.d.ts +0 -32
- package/src/_internal/extension/vscode.proposed.terminalExecuteCommandEvent.d.ts +0 -48
- package/src/_internal/extension/vscode.proposed.terminalQuickFixProvider.d.ts +0 -87
- package/src/_internal/extension/vscode.proposed.terminalSelection.d.ts +0 -16
- package/src/_internal/extension/vscode.proposed.testObserver.d.ts +0 -199
- package/src/_internal/extension/vscode.proposed.textDocumentChangeReason.d.ts +0 -30
- package/src/_internal/extension/vscode.proposed.textSearchProvider.d.ts +0 -281
- package/src/_internal/extension/vscode.proposed.textSearchProvider2.d.ts +0 -297
- package/src/_internal/extension/xtab/common/promptCrafting.ts +0 -670
- package/src/_internal/extension/xtab/node/xtabEndpoint.ts +0 -102
- package/src/_internal/extension/xtab/node/xtabProvider.ts +0 -976
- package/src/_internal/extension/xtab/node/xtabUtils.ts +0 -62
- package/src/_internal/platform/authentication/common/authentication.ts +0 -309
- package/src/_internal/platform/authentication/common/copilotToken.ts +0 -300
- package/src/_internal/platform/authentication/common/copilotTokenManager.ts +0 -59
- package/src/_internal/platform/authentication/common/copilotTokenStore.ts +0 -40
- package/src/_internal/platform/authentication/common/staticGitHubAuthenticationService.ts +0 -96
- package/src/_internal/platform/authentication/node/copilotTokenManager.ts +0 -303
- package/src/_internal/platform/chat/common/chatMLFetcher.ts +0 -124
- package/src/_internal/platform/chat/common/chatQuotaService.ts +0 -63
- package/src/_internal/platform/chat/common/chatQuotaServiceImpl.ts +0 -96
- package/src/_internal/platform/chat/common/commonTypes.ts +0 -353
- package/src/_internal/platform/chat/common/conversationOptions.ts +0 -16
- package/src/_internal/platform/chat/common/globalStringUtils.ts +0 -54
- package/src/_internal/platform/chat/common/interactionService.ts +0 -35
- package/src/_internal/platform/configuration/common/configurationService.ts +0 -803
- package/src/_internal/platform/configuration/common/defaultsOnlyConfigurationService.ts +0 -39
- package/src/_internal/platform/configuration/common/jsonSchema.ts +0 -139
- package/src/_internal/platform/configuration/common/validator.ts +0 -242
- package/src/_internal/platform/diff/common/diffService.ts +0 -41
- package/src/_internal/platform/diff/common/diffWorker.ts +0 -83
- package/src/_internal/platform/diff/node/diffServiceImpl.ts +0 -85
- package/src/_internal/platform/editing/common/abstractText.ts +0 -177
- package/src/_internal/platform/editing/common/notebookDocumentSnapshot.ts +0 -122
- package/src/_internal/platform/editing/common/positionOffsetTransformer.ts +0 -202
- package/src/_internal/platform/editing/common/textDocumentSnapshot.ts +0 -274
- package/src/_internal/platform/endpoint/common/capiClient.ts +0 -37
- package/src/_internal/platform/endpoint/common/chatModelCapabilities.ts +0 -115
- package/src/_internal/platform/endpoint/common/domainService.ts +0 -27
- package/src/_internal/platform/endpoint/common/endpointProvider.ts +0 -104
- package/src/_internal/platform/endpoint/common/endpointTypes.ts +0 -12
- package/src/_internal/platform/endpoint/common/licenseAgreement.ts +0 -11
- package/src/_internal/platform/endpoint/common/statefulMarkerContainer.tsx +0 -85
- package/src/_internal/platform/endpoint/common/thinkingDataContainer.tsx +0 -44
- package/src/_internal/platform/endpoint/node/capiClientImpl.ts +0 -18
- package/src/_internal/platform/endpoint/node/chatEndpoint.ts +0 -435
- package/src/_internal/platform/endpoint/node/domainServiceImpl.ts +0 -80
- package/src/_internal/platform/endpoint/node/proxyXtabEndpoint.ts +0 -43
- package/src/_internal/platform/endpoint/node/responsesApi.ts +0 -326
- package/src/_internal/platform/env/common/envService.ts +0 -134
- package/src/_internal/platform/env/common/nullEnvService.ts +0 -68
- package/src/_internal/platform/env/common/packagejson.ts +0 -49
- package/src/_internal/platform/git/common/gitExtensionService.ts +0 -21
- package/src/_internal/platform/git/common/nullGitExtensionService.ts +0 -20
- package/src/_internal/platform/git/vscode/git.d.ts +0 -414
- package/src/_internal/platform/github/common/githubAPI.ts +0 -44
- package/src/_internal/platform/github/common/githubService.ts +0 -87
- package/src/_internal/platform/github/common/nullOctokitServiceImpl.ts +0 -21
- package/src/_internal/platform/ignore/common/ignoreService.ts +0 -72
- package/src/_internal/platform/inlineCompletions/common/api.ts +0 -198
- package/src/_internal/platform/inlineEdits/common/dataTypes/diagnosticData.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/documentId.ts +0 -52
- package/src/_internal/platform/inlineEdits/common/dataTypes/edit.ts +0 -165
- package/src/_internal/platform/inlineEdits/common/dataTypes/editUtils.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/fetchCancellationError.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageContext.ts +0 -107
- package/src/_internal/platform/inlineEdits/common/dataTypes/languageId.ts +0 -14
- package/src/_internal/platform/inlineEdits/common/dataTypes/permutation.ts +0 -69
- package/src/_internal/platform/inlineEdits/common/dataTypes/rootedLineEdit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLength.ts +0 -74
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/combineTextEditInfos.ts +0 -132
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/length.ts +0 -184
- package/src/_internal/platform/inlineEdits/common/dataTypes/textEditLengthHelper/textEditInfo.ts +0 -32
- package/src/_internal/platform/inlineEdits/common/dataTypes/xtabPromptOptions.ts +0 -89
- package/src/_internal/platform/inlineEdits/common/debugRecorderBookmark.ts +0 -10
- package/src/_internal/platform/inlineEdits/common/editReason.ts +0 -134
- package/src/_internal/platform/inlineEdits/common/inlineEditLogContext.ts +0 -490
- package/src/_internal/platform/inlineEdits/common/observableGit.ts +0 -49
- package/src/_internal/platform/inlineEdits/common/observableWorkspace.ts +0 -239
- package/src/_internal/platform/inlineEdits/common/responseProcessor.ts +0 -249
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProvider.ts +0 -468
- package/src/_internal/platform/inlineEdits/common/statelessNextEditProviders.ts +0 -59
- package/src/_internal/platform/inlineEdits/common/utils/observable.ts +0 -54
- package/src/_internal/platform/inlineEdits/common/utils/stringifyChatMessages.ts +0 -29
- package/src/_internal/platform/inlineEdits/common/utils/utils.ts +0 -56
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/historyContextProvider.ts +0 -60
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesHistoryContextProvider.ts +0 -353
- package/src/_internal/platform/inlineEdits/common/workspaceEditTracker/nesXtabHistoryTracker.ts +0 -176
- package/src/_internal/platform/languageContextProvider/common/languageContextProviderService.ts +0 -25
- package/src/_internal/platform/languageContextProvider/common/nullLanguageContextProviderService.ts +0 -38
- package/src/_internal/platform/languageServer/common/languageContextService.ts +0 -186
- package/src/_internal/platform/languages/common/languageDiagnosticsService.ts +0 -67
- package/src/_internal/platform/languages/common/testLanguageDiagnosticsService.ts +0 -28
- package/src/_internal/platform/log/common/logService.ts +0 -232
- package/src/_internal/platform/nesFetch/common/completionsAPI.ts +0 -78
- package/src/_internal/platform/nesFetch/common/completionsFetchService.ts +0 -118
- package/src/_internal/platform/nesFetch/common/responseStream.ts +0 -151
- package/src/_internal/platform/nesFetch/node/completionsFetchServiceImpl.ts +0 -236
- package/src/_internal/platform/nesFetch/node/streamTransformer.ts +0 -95
- package/src/_internal/platform/networking/common/fetch.ts +0 -349
- package/src/_internal/platform/networking/common/fetcherService.ts +0 -84
- package/src/_internal/platform/networking/common/networking.ts +0 -442
- package/src/_internal/platform/networking/common/openai.ts +0 -273
- package/src/_internal/platform/networking/node/chatStream.ts +0 -137
- package/src/_internal/platform/networking/node/stream.ts +0 -749
- package/src/_internal/platform/notebook/common/alternativeContent.ts +0 -89
- package/src/_internal/platform/notebook/common/alternativeContentFormat.ts +0 -10
- package/src/_internal/platform/notebook/common/alternativeContentProvider.json.ts +0 -262
- package/src/_internal/platform/notebook/common/alternativeContentProvider.text.ts +0 -243
- package/src/_internal/platform/notebook/common/alternativeContentProvider.ts +0 -41
- package/src/_internal/platform/notebook/common/alternativeContentProvider.xml.ts +0 -205
- package/src/_internal/platform/notebook/common/alternativeNotebookDocument.ts +0 -155
- package/src/_internal/platform/notebook/common/helpers.ts +0 -212
- package/src/_internal/platform/notebook/common/notebookService.ts +0 -43
- package/src/_internal/platform/openai/node/fetch.ts +0 -596
- package/src/_internal/platform/parser/node/nodes.ts +0 -190
- package/src/_internal/platform/requestLogger/node/nullRequestLogger.ts +0 -26
- package/src/_internal/platform/requestLogger/node/requestLogger.ts +0 -383
- package/src/_internal/platform/simulationTestContext/common/simulationTestContext.ts +0 -29
- package/src/_internal/platform/snippy/common/snippyService.ts +0 -25
- package/src/_internal/platform/telemetry/common/nullExperimentationService.ts +0 -64
- package/src/_internal/platform/telemetry/common/nullTelemetryService.ts +0 -53
- package/src/_internal/platform/telemetry/common/telemetry.ts +0 -215
- package/src/_internal/platform/telemetry/common/telemetryData.ts +0 -205
- package/src/_internal/platform/thinking/common/thinking.ts +0 -61
- package/src/_internal/platform/thinking/common/thinkingUtils.ts +0 -57
- package/src/_internal/platform/tokenizer/node/parseTikTokens.ts +0 -23
- package/src/_internal/platform/tokenizer/node/tikTokenizerImpl.ts +0 -74
- package/src/_internal/platform/tokenizer/node/tikTokenizerWorker.ts +0 -24
- package/src/_internal/platform/tokenizer/node/tokenizer.ts +0 -357
- package/src/_internal/platform/workspace/common/workspaceService.ts +0 -226
- package/src/_internal/platform/workspaceRecorder/common/workspaceLog.ts +0 -118
- package/src/_internal/util/common/anomalyDetection.ts +0 -112
- package/src/_internal/util/common/arrays.ts +0 -81
- package/src/_internal/util/common/async.ts +0 -155
- package/src/_internal/util/common/cache.ts +0 -183
- package/src/_internal/util/common/crypto.ts +0 -41
- package/src/_internal/util/common/errors.ts +0 -22
- package/src/_internal/util/common/globals.d.ts +0 -12
- package/src/_internal/util/common/imageUtils.ts +0 -154
- package/src/_internal/util/common/languages.ts +0 -940
- package/src/_internal/util/common/notebooks.ts +0 -286
- package/src/_internal/util/common/result.ts +0 -71
- package/src/_internal/util/common/services.ts +0 -43
- package/src/_internal/util/common/test/shims/chatTypes.ts +0 -448
- package/src/_internal/util/common/test/shims/editing.ts +0 -233
- package/src/_internal/util/common/test/shims/enums.ts +0 -61
- package/src/_internal/util/common/test/shims/l10n.ts +0 -37
- package/src/_internal/util/common/test/shims/newSymbolName.ts +0 -23
- package/src/_internal/util/common/test/shims/terminal.ts +0 -33
- package/src/_internal/util/common/test/shims/vscodeTypesShim.ts +0 -115
- package/src/_internal/util/common/time.ts +0 -31
- package/src/_internal/util/common/tokenizer.ts +0 -30
- package/src/_internal/util/common/tracing.ts +0 -52
- package/src/_internal/util/common/types.ts +0 -33
- package/src/_internal/util/common/variableLengthQuantity.ts +0 -40
- package/src/_internal/util/node/worker.ts +0 -130
- package/src/_internal/util/vs/base/common/arrays.ts +0 -926
- package/src/_internal/util/vs/base/common/arraysFind.ts +0 -206
- package/src/_internal/util/vs/base/common/assert.ts +0 -89
- package/src/_internal/util/vs/base/common/async.ts +0 -2582
- package/src/_internal/util/vs/base/common/buffer.ts +0 -501
- package/src/_internal/util/vs/base/common/cache.ts +0 -122
- package/src/_internal/util/vs/base/common/cancellation.ts +0 -150
- package/src/_internal/util/vs/base/common/charCode.ts +0 -452
- package/src/_internal/util/vs/base/common/codicons.ts +0 -66
- package/src/_internal/util/vs/base/common/codiconsLibrary.ts +0 -618
- package/src/_internal/util/vs/base/common/codiconsUtil.ts +0 -30
- package/src/_internal/util/vs/base/common/collections.ts +0 -156
- package/src/_internal/util/vs/base/common/diff/diff.ts +0 -1317
- package/src/_internal/util/vs/base/common/diff/diffChange.ts +0 -62
- package/src/_internal/util/vs/base/common/equals.ts +0 -148
- package/src/_internal/util/vs/base/common/errors.ts +0 -342
- package/src/_internal/util/vs/base/common/event.ts +0 -1782
- package/src/_internal/util/vs/base/common/extpath.ts +0 -425
- package/src/_internal/util/vs/base/common/filters.ts +0 -928
- package/src/_internal/util/vs/base/common/functional.ts +0 -34
- package/src/_internal/util/vs/base/common/glob.ts +0 -839
- package/src/_internal/util/vs/base/common/hash.ts +0 -326
- package/src/_internal/util/vs/base/common/htmlContent.ts +0 -212
- package/src/_internal/util/vs/base/common/iconLabels.ts +0 -118
- package/src/_internal/util/vs/base/common/iterator.ts +0 -196
- package/src/_internal/util/vs/base/common/lazy.ts +0 -59
- package/src/_internal/util/vs/base/common/lifecycle.ts +0 -845
- package/src/_internal/util/vs/base/common/linkedList.ts +0 -144
- package/src/_internal/util/vs/base/common/map.ts +0 -954
- package/src/_internal/util/vs/base/common/marshallingIds.ts +0 -35
- package/src/_internal/util/vs/base/common/mime.ts +0 -136
- package/src/_internal/util/vs/base/common/naturalLanguage/korean.ts +0 -425
- package/src/_internal/util/vs/base/common/network.ts +0 -429
- package/src/_internal/util/vs/base/common/numbers.ts +0 -166
- package/src/_internal/util/vs/base/common/objects.ts +0 -242
- package/src/_internal/util/vs/base/common/observable.ts +0 -10
- package/src/_internal/util/vs/base/common/observableInternal/base.ts +0 -208
- package/src/_internal/util/vs/base/common/observableInternal/changeTracker.ts +0 -96
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/cancellation.ts +0 -9
- package/src/_internal/util/vs/base/common/observableInternal/commonFacade/deps.ts +0 -12
- package/src/_internal/util/vs/base/common/observableInternal/debugLocation.ts +0 -88
- package/src/_internal/util/vs/base/common/observableInternal/debugName.ts +0 -150
- package/src/_internal/util/vs/base/common/observableInternal/experimental/utils.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/index.ts +0 -61
- package/src/_internal/util/vs/base/common/observableInternal/logging/consoleObservableLogger.ts +0 -388
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerApi.d.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/debuggerRpc.ts +0 -80
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/devToolsLogger.ts +0 -485
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/rpc.ts +0 -103
- package/src/_internal/util/vs/base/common/observableInternal/logging/debugger/utils.ts +0 -69
- package/src/_internal/util/vs/base/common/observableInternal/logging/logging.ts +0 -133
- package/src/_internal/util/vs/base/common/observableInternal/map.ts +0 -81
- package/src/_internal/util/vs/base/common/observableInternal/observables/baseObservable.ts +0 -172
- package/src/_internal/util/vs/base/common/observableInternal/observables/constObservable.ts +0 -44
- package/src/_internal/util/vs/base/common/observableInternal/observables/derived.ts +0 -190
- package/src/_internal/util/vs/base/common/observableInternal/observables/derivedImpl.ts +0 -445
- package/src/_internal/util/vs/base/common/observableInternal/observables/lazyObservableValue.ts +0 -154
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableFromEvent.ts +0 -174
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignal.ts +0 -67
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableSignalFromEvent.ts +0 -62
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValue.ts +0 -131
- package/src/_internal/util/vs/base/common/observableInternal/observables/observableValueOpts.ts +0 -37
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorun.ts +0 -188
- package/src/_internal/util/vs/base/common/observableInternal/reactions/autorunImpl.ts +0 -256
- package/src/_internal/util/vs/base/common/observableInternal/set.ts +0 -78
- package/src/_internal/util/vs/base/common/observableInternal/transaction.ts +0 -115
- package/src/_internal/util/vs/base/common/observableInternal/utils/promise.ts +0 -129
- package/src/_internal/util/vs/base/common/observableInternal/utils/runOnChange.ts +0 -65
- package/src/_internal/util/vs/base/common/observableInternal/utils/utils.ts +0 -281
- package/src/_internal/util/vs/base/common/observableInternal/utils/utilsCancellation.ts +0 -101
- package/src/_internal/util/vs/base/common/observableInternal/utils/valueWithChangeEvent.ts +0 -31
- package/src/_internal/util/vs/base/common/path.ts +0 -1591
- package/src/_internal/util/vs/base/common/platform.ts +0 -282
- package/src/_internal/util/vs/base/common/process.ts +0 -78
- package/src/_internal/util/vs/base/common/resources.ts +0 -446
- package/src/_internal/util/vs/base/common/sequence.ts +0 -36
- package/src/_internal/util/vs/base/common/sseParser.ts +0 -247
- package/src/_internal/util/vs/base/common/stopwatch.ts +0 -43
- package/src/_internal/util/vs/base/common/stream.ts +0 -792
- package/src/_internal/util/vs/base/common/strings.ts +0 -1364
- package/src/_internal/util/vs/base/common/symbols.ts +0 -11
- package/src/_internal/util/vs/base/common/themables.ts +0 -106
- package/src/_internal/util/vs/base/common/types.ts +0 -345
- package/src/_internal/util/vs/base/common/uint.ts +0 -61
- package/src/_internal/util/vs/base/common/uri.ts +0 -752
- package/src/_internal/util/vs/base/common/uuid.ts +0 -72
- package/src/_internal/util/vs/base-common.d.ts +0 -42
- package/src/_internal/util/vs/editor/common/core/editOperation.ts +0 -62
- package/src/_internal/util/vs/editor/common/core/edits/edit.ts +0 -399
- package/src/_internal/util/vs/editor/common/core/edits/lineEdit.ts +0 -414
- package/src/_internal/util/vs/editor/common/core/edits/stringEdit.ts +0 -568
- package/src/_internal/util/vs/editor/common/core/edits/textEdit.ts +0 -411
- package/src/_internal/util/vs/editor/common/core/position.ts +0 -186
- package/src/_internal/util/vs/editor/common/core/range.ts +0 -519
- package/src/_internal/util/vs/editor/common/core/ranges/lineRange.ts +0 -416
- package/src/_internal/util/vs/editor/common/core/ranges/offsetRange.ts +0 -275
- package/src/_internal/util/vs/editor/common/core/text/abstractText.ts +0 -127
- package/src/_internal/util/vs/editor/common/core/text/positionToOffset.ts +0 -26
- package/src/_internal/util/vs/editor/common/core/text/positionToOffsetImpl.ts +0 -144
- package/src/_internal/util/vs/editor/common/core/text/textLength.ts +0 -150
- package/src/_internal/util/vs/editor/common/core/wordHelper.ts +0 -177
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/diffAlgorithm.ts +0 -210
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/dynamicProgrammingDiffing.ts +0 -109
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/algorithms/myersDiffAlgorithm.ts +0 -178
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/computeMovedLines.ts +0 -331
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/defaultLinesDiffComputer.ts +0 -273
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/heuristicSequenceOptimizations.ts +0 -475
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/lineSequence.ts +0 -47
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/linesSliceCharSequence.ts +0 -248
- package/src/_internal/util/vs/editor/common/diff/defaultLinesDiffComputer/utils.ts +0 -76
- package/src/_internal/util/vs/editor/common/diff/legacyLinesDiffComputer.ts +0 -693
- package/src/_internal/util/vs/editor/common/diff/linesDiffComputer.ts +0 -61
- package/src/_internal/util/vs/editor/common/diff/rangeMapping.ts +0 -418
- package/src/_internal/util/vs/editor/common/model/prefixSumComputer.ts +0 -304
- package/src/_internal/util/vs/nls.messages.ts +0 -21
- package/src/_internal/util/vs/nls.ts +0 -243
- package/src/_internal/util/vs/platform/instantiation/common/descriptors.ts +0 -23
- package/src/_internal/util/vs/platform/instantiation/common/graph.ts +0 -113
- package/src/_internal/util/vs/platform/instantiation/common/instantiation.ts +0 -127
- package/src/_internal/util/vs/platform/instantiation/common/instantiationService.ts +0 -483
- package/src/_internal/util/vs/platform/instantiation/common/serviceCollection.ts +0 -34
- package/src/_internal/util/vs/vscode-globals-nls.d.ts +0 -42
- package/src/_internal/util/vs/vscode-globals-product.d.ts +0 -35
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/diagnostic.ts +0 -109
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/es5ClassCompat.ts +0 -34
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/location.ts +0 -51
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/markdownString.ts +0 -83
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/notebooks.ts +0 -296
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/position.ts +0 -195
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/range.ts +0 -167
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/selection.ts +0 -94
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetString.ts +0 -103
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/snippetTextEdit.ts +0 -44
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/symbolInformation.ts +0 -89
- package/src/_internal/util/vs/workbench/api/common/extHostTypes/textEdit.ts +0 -99
- package/src/_internal/vscodeTypes.ts +0 -100
- package/src/main.ts +0 -207
- package/src/package.json +0 -4063
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import type { Point, SyntaxNode } from 'web-tree-sitter';
|
|
7
|
-
import { BugIndicatingError } from '../../../util/vs/base/common/errors';
|
|
8
|
-
import { Range, Uri } from '../../../util/common/test/shims/vscodeTypesShim';
|
|
9
|
-
export interface TreeSitterOffsetRange {
|
|
10
|
-
startIndex: number;
|
|
11
|
-
endIndex: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface TreeSitterExpressionInfo extends TreeSitterOffsetRange {
|
|
15
|
-
version?: number;
|
|
16
|
-
identifier: string;
|
|
17
|
-
text: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface TreeSitterExpressionLocationInfo extends TreeSitterOffsetRange {
|
|
21
|
-
text: string;
|
|
22
|
-
version?: number;
|
|
23
|
-
uri?: Uri;
|
|
24
|
-
range?: Range;
|
|
25
|
-
identifier?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export interface TreeSitterPoint {
|
|
29
|
-
row: number;
|
|
30
|
-
column: number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export interface TreeSitterPointRange {
|
|
34
|
-
startPosition: TreeSitterPoint;
|
|
35
|
-
endPosition: TreeSitterPoint;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** Util functions to deal with `TreeSitterOffsetRange` type */
|
|
39
|
-
export const TreeSitterOffsetRange = {
|
|
40
|
-
/** check if `container` contains `containee` (non-strict, ie [0, 3] contains [0, 3] */
|
|
41
|
-
doesContain: (container: TreeSitterOffsetRange, containee: TreeSitterOffsetRange): boolean => container.startIndex <= containee.startIndex && containee.endIndex <= container.endIndex,
|
|
42
|
-
|
|
43
|
-
ofSyntaxNode: (n: SyntaxNode): TreeSitterOffsetRange => ({ startIndex: n.startIndex, endIndex: n.endIndex }),
|
|
44
|
-
|
|
45
|
-
/** sort by `node.startIndex`, break ties by `node.endIndex` (so that nodes with same start index are sorted in descending order) */
|
|
46
|
-
compare: (a: TreeSitterOffsetRange, b: TreeSitterOffsetRange): number => a.startIndex - b.startIndex || b.endIndex - a.endIndex,
|
|
47
|
-
isEqual: (a: TreeSitterOffsetRange, b: TreeSitterOffsetRange): boolean => TreeSitterOffsetRange.compare(a, b) === 0,
|
|
48
|
-
|
|
49
|
-
doIntersect: (a: TreeSitterOffsetRange, b: TreeSitterOffsetRange) => {
|
|
50
|
-
const start = Math.max(a.startIndex, b.startIndex);
|
|
51
|
-
const end = Math.min(a.endIndex, b.endIndex);
|
|
52
|
-
return start < end;
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
len: (n: TreeSitterOffsetRange) => n.endIndex - n.startIndex,
|
|
56
|
-
|
|
57
|
-
/** Given offset ranges [a0, a1] and [b0, b1], returns overlap size */
|
|
58
|
-
intersectionSize: (a: TreeSitterOffsetRange, b: TreeSitterOffsetRange): number => {
|
|
59
|
-
const start = Math.max(a.startIndex, b.startIndex);
|
|
60
|
-
const end = Math.min(a.endIndex, b.endIndex);
|
|
61
|
-
return Math.max(end - start, 0);
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
/** Check the given object extends TreeSitterOffsetRange */
|
|
65
|
-
isTreeSitterOffsetRange(obj: any): obj is TreeSitterOffsetRange {
|
|
66
|
-
return typeof obj.startIndex === 'number' && typeof obj.endIndex === 'number';
|
|
67
|
-
},
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const TreeSitterPoint = {
|
|
71
|
-
|
|
72
|
-
isEqual(n: TreeSitterPoint, other: TreeSitterPoint): boolean {
|
|
73
|
-
return n.row === other.row && n.column === other.column;
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
isBefore(n: TreeSitterPoint, other: TreeSitterPoint): boolean {
|
|
77
|
-
if (n.row < other.row || (n.row === other.row && n.column < other.column)) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
return false;
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
isAfter(n: TreeSitterPoint, other: TreeSitterPoint): boolean {
|
|
84
|
-
return TreeSitterPoint.isBefore(other, n);
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
isBeforeOrEqual(n: TreeSitterPoint, other: TreeSitterPoint): boolean {
|
|
88
|
-
const isBefore = TreeSitterPoint.isBefore(n, other);
|
|
89
|
-
const isEqual = TreeSitterPoint.isEqual(n, other);
|
|
90
|
-
if (isBefore || isEqual) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
return false;
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
equals(n: TreeSitterPoint, other: TreeSitterPoint): boolean {
|
|
97
|
-
return n.column === other.column && n.row === other.row;
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
isAfterOrEqual(n: TreeSitterPoint, other: TreeSitterPoint): boolean {
|
|
101
|
-
return TreeSitterPoint.isBeforeOrEqual(other, n);
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
ofPoint: (n: Point): TreeSitterPoint => ({
|
|
105
|
-
row: n.row,
|
|
106
|
-
column: n.column
|
|
107
|
-
}),
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export const TreeSitterPointRange = {
|
|
111
|
-
|
|
112
|
-
/** check if `container` contains `containee` (non-strict) */
|
|
113
|
-
doesContain: (container: TreeSitterPointRange, containee: TreeSitterPointRange): boolean => {
|
|
114
|
-
return TreeSitterPoint.isBeforeOrEqual(container.startPosition, containee.startPosition) && TreeSitterPoint.isAfterOrEqual(container.endPosition, containee.endPosition);
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
equals: (a: TreeSitterPointRange, b: TreeSitterPointRange): boolean => {
|
|
118
|
-
return TreeSitterPoint.equals(a.startPosition, b.startPosition) && TreeSitterPoint.equals(a.endPosition, b.endPosition);
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
ofSyntaxNode: (n: SyntaxNode): TreeSitterPointRange => ({
|
|
122
|
-
startPosition: n.startPosition,
|
|
123
|
-
endPosition: n.endPosition
|
|
124
|
-
}),
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
export interface Node extends TreeSitterOffsetRange {
|
|
128
|
-
type: string;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
export const Node = {
|
|
132
|
-
ofSyntaxNode: (n: SyntaxNode) => ({
|
|
133
|
-
type: n.type,
|
|
134
|
-
startIndex: n.startIndex,
|
|
135
|
-
endIndex: n.endIndex,
|
|
136
|
-
}),
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
export interface TreeSitterChunkHeaderInfo extends TreeSitterOffsetRange {
|
|
140
|
-
text: string;
|
|
141
|
-
range: TreeSitterPointRange;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export const TreeSitterChunkHeaderInfo = {
|
|
145
|
-
ofSyntaxNode: (n: SyntaxNode): TreeSitterChunkHeaderInfo => ({
|
|
146
|
-
range: TreeSitterPointRange.ofSyntaxNode(n),
|
|
147
|
-
startIndex: n.startIndex,
|
|
148
|
-
text: n.text,
|
|
149
|
-
endIndex: n.endIndex,
|
|
150
|
-
}),
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Represents a node in the overlay tree.
|
|
155
|
-
*/
|
|
156
|
-
export class OverlayNode {
|
|
157
|
-
constructor(
|
|
158
|
-
public readonly startIndex: number,
|
|
159
|
-
public readonly endIndex: number,
|
|
160
|
-
/**
|
|
161
|
-
* @example `class_declaration`
|
|
162
|
-
*/
|
|
163
|
-
public kind: string, // TODO@ulugbekna: come up with more generic kinds so that these aren't per-language, then use enum?
|
|
164
|
-
public readonly children: OverlayNode[],
|
|
165
|
-
) {
|
|
166
|
-
if (startIndex > endIndex) {
|
|
167
|
-
throw new BugIndicatingError('startIndex must be less than endIndex');
|
|
168
|
-
}
|
|
169
|
-
let minStartIndex = startIndex;
|
|
170
|
-
for (const child of children) {
|
|
171
|
-
if (child.startIndex < minStartIndex) {
|
|
172
|
-
throw new BugIndicatingError('Invalid child startIndex');
|
|
173
|
-
}
|
|
174
|
-
if (child.endIndex > endIndex) {
|
|
175
|
-
throw new BugIndicatingError('Invalid child endIndex');
|
|
176
|
-
}
|
|
177
|
-
minStartIndex = Math.max(child.endIndex, minStartIndex);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
toString() {
|
|
182
|
-
const printedNodes: string[] = [];
|
|
183
|
-
function toString(node: OverlayNode, indent = '') {
|
|
184
|
-
printedNodes.push(`${indent}${node.kind} [${node.startIndex}, ${node.endIndex}]`);
|
|
185
|
-
node.children.forEach(child => toString(child, indent + ' '));
|
|
186
|
-
}
|
|
187
|
-
toString(this);
|
|
188
|
-
return printedNodes.join('\n');
|
|
189
|
-
}
|
|
190
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import type { RequestMetadata } from '@vscode/copilot-api';
|
|
7
|
-
import type { LanguageModelToolResult } from 'vscode';
|
|
8
|
-
import { AbstractRequestLogger, ILoggedRequestInfo, LoggedRequest } from '../../../platform/requestLogger/node/requestLogger';
|
|
9
|
-
import { Event } from '../../../util/vs/base/common/event';
|
|
10
|
-
import { IModelAPIResponse } from '../../endpoint/common/endpointProvider';
|
|
11
|
-
|
|
12
|
-
export class NullRequestLogger extends AbstractRequestLogger {
|
|
13
|
-
public override addPromptTrace(): void {
|
|
14
|
-
}
|
|
15
|
-
public addEntry(entry: LoggedRequest): void {
|
|
16
|
-
}
|
|
17
|
-
public override getRequests(): ILoggedRequestInfo[] {
|
|
18
|
-
return [];
|
|
19
|
-
}
|
|
20
|
-
public override logModelListCall(id: string, requestMetadata: RequestMetadata, models: IModelAPIResponse[]): void {
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
public override logToolCall(name: string | undefined, args: unknown, response: LanguageModelToolResult): void {
|
|
24
|
-
}
|
|
25
|
-
override onDidChangeRequests: Event<void> = Event.None;
|
|
26
|
-
}
|
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import type { RequestMetadata } from '@vscode/copilot-api';
|
|
7
|
-
import { HTMLTracer, IChatEndpointInfo, Raw, RenderPromptResult } from '@vscode/prompt-tsx';
|
|
8
|
-
import { AsyncLocalStorage } from 'async_hooks';
|
|
9
|
-
import type { Event } from 'vscode';
|
|
10
|
-
import { ChatFetchError, ChatFetchResponseType, ChatLocation, ChatResponses, FetchSuccess } from '../../../platform/chat/common/commonTypes';
|
|
11
|
-
import { IResponseDelta, OpenAiFunctionTool, OpenAiResponsesFunctionTool, OptionalChatRequestParams } from '../../../platform/networking/common/fetch';
|
|
12
|
-
import { IChatEndpoint, IEndpointBody } from '../../../platform/networking/common/networking';
|
|
13
|
-
import { Result } from '../../../util/common/result';
|
|
14
|
-
import { createServiceIdentifier } from '../../../util/common/services';
|
|
15
|
-
import { Disposable } from '../../../util/vs/base/common/lifecycle';
|
|
16
|
-
import { ThemeIcon } from '../../../util/vs/base/common/themables';
|
|
17
|
-
import { assertType } from '../../../util/vs/base/common/types';
|
|
18
|
-
import { OffsetRange } from '../../../util/vs/editor/common/core/ranges/offsetRange';
|
|
19
|
-
import type { ChatRequest, LanguageModelToolResult2 } from '../../../vscodeTypes';
|
|
20
|
-
import type { IModelAPIResponse } from '../../endpoint/common/endpointProvider';
|
|
21
|
-
import { Completion } from '../../nesFetch/common/completionsAPI';
|
|
22
|
-
import { CompletionsFetchFailure, ModelParams } from '../../nesFetch/common/completionsFetchService';
|
|
23
|
-
import { IFetchRequestParams } from '../../nesFetch/node/completionsFetchServiceImpl';
|
|
24
|
-
import { APIUsage } from '../../networking/common/openai';
|
|
25
|
-
import { ThinkingData } from '../../thinking/common/thinking';
|
|
26
|
-
|
|
27
|
-
export type UriData = { kind: 'request'; id: string } | { kind: 'latest' };
|
|
28
|
-
|
|
29
|
-
export class ChatRequestScheme {
|
|
30
|
-
public static readonly chatRequestScheme = 'ccreq';
|
|
31
|
-
|
|
32
|
-
public static buildUri(data: UriData, format: 'markdown' | 'json' = 'markdown'): string {
|
|
33
|
-
const extension = format === 'json' ? 'json' : 'copilotmd';
|
|
34
|
-
if (data.kind === 'latest') {
|
|
35
|
-
return `${ChatRequestScheme.chatRequestScheme}:latest.${extension}`;
|
|
36
|
-
} else {
|
|
37
|
-
return `${ChatRequestScheme.chatRequestScheme}:${data.id}.${extension}`;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
public static parseUri(uri: string): { data: UriData; format: 'markdown' | 'json' } | undefined {
|
|
42
|
-
// Check for latest markdown
|
|
43
|
-
if (uri === this.buildUri({ kind: 'latest' }, 'markdown')) {
|
|
44
|
-
return { data: { kind: 'latest' }, format: 'markdown' };
|
|
45
|
-
}
|
|
46
|
-
// Check for latest JSON
|
|
47
|
-
if (uri === this.buildUri({ kind: 'latest' }, 'json')) {
|
|
48
|
-
return { data: { kind: 'latest' }, format: 'json' };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Check for specific request markdown
|
|
52
|
-
const mdMatch = uri.match(/ccreq:([^\s]+)\.copilotmd/);
|
|
53
|
-
if (mdMatch) {
|
|
54
|
-
return { data: { kind: 'request', id: mdMatch[1] }, format: 'markdown' };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Check for specific request JSON
|
|
58
|
-
const jsonMatch = uri.match(/ccreq:([^\s]+)\.json/);
|
|
59
|
-
if (jsonMatch) {
|
|
60
|
-
return { data: { kind: 'request', id: jsonMatch[1] }, format: 'json' };
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return undefined;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
public static findAllUris(text: string): { uri: string; range: OffsetRange }[] {
|
|
67
|
-
const linkRE = /(ccreq:[^\s]+\.(copilotmd|json))/g;
|
|
68
|
-
return [...text.matchAll(linkRE)].map(
|
|
69
|
-
(m) => {
|
|
70
|
-
const identifier = m[1];
|
|
71
|
-
return {
|
|
72
|
-
uri: identifier,
|
|
73
|
-
range: new OffsetRange(m.index!, m.index! + identifier.length)
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export const enum LoggedInfoKind {
|
|
81
|
-
Element,
|
|
82
|
-
Request,
|
|
83
|
-
ToolCall,
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface ILoggedElementInfo {
|
|
87
|
-
kind: LoggedInfoKind.Element;
|
|
88
|
-
id: string;
|
|
89
|
-
name: string;
|
|
90
|
-
tokens: number;
|
|
91
|
-
maxTokens: number;
|
|
92
|
-
trace: HTMLTracer;
|
|
93
|
-
chatRequest: ChatRequest | undefined;
|
|
94
|
-
toJSON(): object;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export interface ILoggedRequestInfo {
|
|
98
|
-
kind: LoggedInfoKind.Request;
|
|
99
|
-
id: string;
|
|
100
|
-
entry: LoggedRequest;
|
|
101
|
-
chatRequest: ChatRequest | undefined;
|
|
102
|
-
toJSON(): object;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export interface ILoggedToolCall {
|
|
106
|
-
kind: LoggedInfoKind.ToolCall;
|
|
107
|
-
id: string;
|
|
108
|
-
name: string;
|
|
109
|
-
args: unknown;
|
|
110
|
-
response: LanguageModelToolResult2;
|
|
111
|
-
chatRequest: ChatRequest | undefined;
|
|
112
|
-
time: number;
|
|
113
|
-
thinking?: ThinkingData;
|
|
114
|
-
toJSON(): Promise<object>;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface ILoggedPendingRequest {
|
|
118
|
-
messages: Raw.ChatMessage[];
|
|
119
|
-
tools: (OpenAiFunctionTool | OpenAiResponsesFunctionTool)[] | undefined;
|
|
120
|
-
ourRequestId: string;
|
|
121
|
-
model: string;
|
|
122
|
-
location: ChatLocation;
|
|
123
|
-
intent?: string;
|
|
124
|
-
postOptions?: OptionalChatRequestParams;
|
|
125
|
-
body?: IEndpointBody;
|
|
126
|
-
ignoreStatefulMarker?: boolean;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export type LoggedInfo = ILoggedElementInfo | ILoggedRequestInfo | ILoggedToolCall;
|
|
130
|
-
|
|
131
|
-
export const IRequestLogger = createServiceIdentifier<IRequestLogger>('IRequestLogger');
|
|
132
|
-
export interface IRequestLogger {
|
|
133
|
-
|
|
134
|
-
readonly _serviceBrand: undefined;
|
|
135
|
-
|
|
136
|
-
promptRendererTracing: boolean;
|
|
137
|
-
|
|
138
|
-
captureInvocation<T>(request: ChatRequest, fn: () => Promise<T>): Promise<T>;
|
|
139
|
-
|
|
140
|
-
logToolCall(id: string, name: string, args: unknown, response: LanguageModelToolResult2, thinking?: ThinkingData): void;
|
|
141
|
-
|
|
142
|
-
logModelListCall(requestId: string, requestMetadata: RequestMetadata, models: IModelAPIResponse[]): void;
|
|
143
|
-
|
|
144
|
-
logChatRequest(debugName: string, chatEndpoint: IChatEndpointLogInfo, chatParams: ILoggedPendingRequest): PendingLoggedChatRequest;
|
|
145
|
-
|
|
146
|
-
logCompletionRequest(debugName: string, chatEndpoint: IChatEndpointLogInfo, chatParams: ICompletionFetchRequestLogParams, requestId: string): PendingLoggedCompletionRequest;
|
|
147
|
-
|
|
148
|
-
addPromptTrace(elementName: string, endpoint: IChatEndpointInfo, result: RenderPromptResult, trace: HTMLTracer): void;
|
|
149
|
-
addEntry(entry: LoggedRequest): void;
|
|
150
|
-
|
|
151
|
-
onDidChangeRequests: Event<void>;
|
|
152
|
-
getRequests(): LoggedInfo[];
|
|
153
|
-
|
|
154
|
-
enableWorkspaceEditTracing(): void;
|
|
155
|
-
disableWorkspaceEditTracing(): void;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
export const enum LoggedRequestKind {
|
|
159
|
-
ChatMLSuccess = 'ChatMLSuccess',
|
|
160
|
-
ChatMLFailure = 'ChatMLFailure',
|
|
161
|
-
ChatMLCancelation = 'ChatMLCancelation',
|
|
162
|
-
CompletionSuccess = 'CompletionSuccess',
|
|
163
|
-
CompletionFailure = 'CompletionFailure',
|
|
164
|
-
MarkdownContentRequest = 'MarkdownContentRequest',
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export type IChatEndpointLogInfo = Partial<Pick<IChatEndpoint, 'model' | 'modelMaxPromptTokens' | 'urlOrRequestMetadata'>>;
|
|
168
|
-
|
|
169
|
-
export interface ICompletionFetchRequestLogParams extends IFetchRequestParams {
|
|
170
|
-
ourRequestId: string;
|
|
171
|
-
postOptions?: ModelParams;
|
|
172
|
-
location: ChatLocation;
|
|
173
|
-
intent?: false;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
export interface ILoggedChatMLRequest {
|
|
177
|
-
debugName: string;
|
|
178
|
-
chatEndpoint: IChatEndpointLogInfo;
|
|
179
|
-
chatParams: ILoggedPendingRequest | ICompletionFetchRequestLogParams;
|
|
180
|
-
startTime: Date;
|
|
181
|
-
endTime: Date;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export interface ILoggedChatMLSuccessRequest extends ILoggedChatMLRequest {
|
|
185
|
-
type: LoggedRequestKind.ChatMLSuccess;
|
|
186
|
-
timeToFirstToken: number | undefined;
|
|
187
|
-
usage: APIUsage | undefined;
|
|
188
|
-
result: FetchSuccess<string[]>;
|
|
189
|
-
deltas?: IResponseDelta[];
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
export interface ILoggedChatMLFailureRequest extends ILoggedChatMLRequest {
|
|
193
|
-
type: LoggedRequestKind.ChatMLFailure;
|
|
194
|
-
timeToFirstToken: number | undefined;
|
|
195
|
-
result: ChatFetchError;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface ILoggedChatMLCancelationRequest extends ILoggedChatMLRequest {
|
|
199
|
-
type: LoggedRequestKind.ChatMLCancelation;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export interface IMarkdownContentRequest {
|
|
203
|
-
type: LoggedRequestKind.MarkdownContentRequest;
|
|
204
|
-
startTimeMs: number;
|
|
205
|
-
icon: ThemeIcon | undefined;
|
|
206
|
-
debugName: string;
|
|
207
|
-
markdownContent: string;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
export interface ILoggedCompletionSuccessRequest extends ILoggedChatMLRequest {
|
|
211
|
-
type: LoggedRequestKind.CompletionSuccess;
|
|
212
|
-
timeToFirstToken: number | undefined;
|
|
213
|
-
result: { type: ChatFetchResponseType.Success; value: string; requestId: string };
|
|
214
|
-
deltas?: undefined;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export interface ILoggedCompletionFailureRequest extends ILoggedChatMLRequest {
|
|
218
|
-
type: LoggedRequestKind.CompletionFailure;
|
|
219
|
-
timeToFirstToken: number | undefined;
|
|
220
|
-
result: { type: CompletionsFetchFailure | Error; requestId: string };
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export type LoggedRequest = (
|
|
224
|
-
ILoggedChatMLSuccessRequest
|
|
225
|
-
| ILoggedChatMLFailureRequest
|
|
226
|
-
| ILoggedChatMLCancelationRequest
|
|
227
|
-
| IMarkdownContentRequest
|
|
228
|
-
| ILoggedCompletionSuccessRequest
|
|
229
|
-
| ILoggedCompletionFailureRequest
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
const requestLogStorage = new AsyncLocalStorage<ChatRequest>();
|
|
233
|
-
|
|
234
|
-
export abstract class AbstractRequestLogger extends Disposable implements IRequestLogger {
|
|
235
|
-
declare _serviceBrand: undefined;
|
|
236
|
-
|
|
237
|
-
public get promptRendererTracing() {
|
|
238
|
-
return false;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
public captureInvocation<T>(request: ChatRequest, fn: () => Promise<T>): Promise<T> {
|
|
242
|
-
return requestLogStorage.run(request, () => fn());
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
public abstract logModelListCall(id: string, requestMetadata: RequestMetadata, models: IModelAPIResponse[]): void;
|
|
246
|
-
public abstract logToolCall(id: string, name: string | undefined, args: unknown, response: LanguageModelToolResult2): void;
|
|
247
|
-
|
|
248
|
-
public logChatRequest(debugName: string, chatEndpoint: IChatEndpoint, chatParams: ILoggedPendingRequest): PendingLoggedChatRequest {
|
|
249
|
-
return new PendingLoggedChatRequest(this, debugName, chatEndpoint, chatParams);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
public logCompletionRequest(debugName: string, chatEndpoint: IChatEndpointLogInfo, chatParams: ICompletionFetchRequestLogParams, requestId: string): PendingLoggedCompletionRequest {
|
|
253
|
-
return new PendingLoggedCompletionRequest(this, debugName, chatEndpoint, chatParams, requestId);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
public abstract addPromptTrace(elementName: string, endpoint: IChatEndpointInfo, result: RenderPromptResult, trace: HTMLTracer): void;
|
|
257
|
-
public abstract addEntry(entry: LoggedRequest): void;
|
|
258
|
-
public abstract getRequests(): LoggedInfo[];
|
|
259
|
-
abstract onDidChangeRequests: Event<void>;
|
|
260
|
-
|
|
261
|
-
public enableWorkspaceEditTracing(): void {
|
|
262
|
-
// no-op by default; concrete implementations can override
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
public disableWorkspaceEditTracing(): void {
|
|
266
|
-
// no-op by default; concrete implementations can override
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
/** Current request being made to the LM. */
|
|
270
|
-
protected get currentRequest() {
|
|
271
|
-
return requestLogStorage.getStore();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
class AbstractPendingLoggedRequest {
|
|
276
|
-
protected _time: Date;
|
|
277
|
-
protected _timeToFirstToken: number | undefined = undefined;
|
|
278
|
-
|
|
279
|
-
constructor(
|
|
280
|
-
protected _logbook: IRequestLogger,
|
|
281
|
-
protected _debugName: string,
|
|
282
|
-
protected _chatEndpoint: IChatEndpointLogInfo,
|
|
283
|
-
protected _chatParams: ILoggedPendingRequest | ICompletionFetchRequestLogParams
|
|
284
|
-
) {
|
|
285
|
-
this._time = new Date();
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
markTimeToFirstToken(timeToFirstToken: number): void {
|
|
289
|
-
this._timeToFirstToken = timeToFirstToken;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
resolveWithCancelation() {
|
|
293
|
-
this._logbook.addEntry({
|
|
294
|
-
type: LoggedRequestKind.ChatMLCancelation,
|
|
295
|
-
debugName: this._debugName,
|
|
296
|
-
chatEndpoint: this._chatEndpoint,
|
|
297
|
-
chatParams: this._chatParams,
|
|
298
|
-
startTime: this._time,
|
|
299
|
-
endTime: new Date()
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export class PendingLoggedCompletionRequest extends AbstractPendingLoggedRequest {
|
|
305
|
-
|
|
306
|
-
constructor(
|
|
307
|
-
logbook: IRequestLogger,
|
|
308
|
-
debugName: string,
|
|
309
|
-
chatEndpoint: IChatEndpointLogInfo,
|
|
310
|
-
chatParams: ICompletionFetchRequestLogParams,
|
|
311
|
-
private requestId: string
|
|
312
|
-
) {
|
|
313
|
-
super(logbook, debugName, chatEndpoint, chatParams);
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
resolve(result: Result<Completion, CompletionsFetchFailure | Error>): void {
|
|
317
|
-
if (result.isOk()) {
|
|
318
|
-
const completionText = result.val.choices.at(0)?.text;
|
|
319
|
-
assertType(completionText !== undefined, 'Completion with empty choices');
|
|
320
|
-
|
|
321
|
-
this._logbook.addEntry({
|
|
322
|
-
type: LoggedRequestKind.CompletionSuccess,
|
|
323
|
-
debugName: this._debugName,
|
|
324
|
-
chatEndpoint: this._chatEndpoint,
|
|
325
|
-
chatParams: this._chatParams,
|
|
326
|
-
startTime: this._time,
|
|
327
|
-
endTime: new Date(),
|
|
328
|
-
timeToFirstToken: this._timeToFirstToken,
|
|
329
|
-
result: { type: ChatFetchResponseType.Success, value: completionText, requestId: this.requestId },
|
|
330
|
-
});
|
|
331
|
-
} else {
|
|
332
|
-
this._logbook.addEntry({
|
|
333
|
-
type: LoggedRequestKind.CompletionFailure,
|
|
334
|
-
debugName: this._debugName,
|
|
335
|
-
chatEndpoint: this._chatEndpoint,
|
|
336
|
-
chatParams: this._chatParams,
|
|
337
|
-
startTime: this._time,
|
|
338
|
-
endTime: new Date(),
|
|
339
|
-
timeToFirstToken: this._timeToFirstToken,
|
|
340
|
-
result: { type: result.err, requestId: this.requestId },
|
|
341
|
-
});
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
export class PendingLoggedChatRequest extends AbstractPendingLoggedRequest {
|
|
347
|
-
constructor(
|
|
348
|
-
logbook: IRequestLogger,
|
|
349
|
-
debugName: string,
|
|
350
|
-
chatEndpoint: IChatEndpoint,
|
|
351
|
-
chatParams: ILoggedPendingRequest
|
|
352
|
-
) {
|
|
353
|
-
super(logbook, debugName, chatEndpoint, chatParams);
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
resolve(result: ChatResponses, deltas?: IResponseDelta[]): void {
|
|
357
|
-
if (result.type === ChatFetchResponseType.Success) {
|
|
358
|
-
this._logbook.addEntry({
|
|
359
|
-
type: LoggedRequestKind.ChatMLSuccess,
|
|
360
|
-
debugName: this._debugName,
|
|
361
|
-
usage: result.usage,
|
|
362
|
-
chatEndpoint: this._chatEndpoint,
|
|
363
|
-
chatParams: this._chatParams,
|
|
364
|
-
startTime: this._time,
|
|
365
|
-
endTime: new Date(),
|
|
366
|
-
timeToFirstToken: this._timeToFirstToken,
|
|
367
|
-
result,
|
|
368
|
-
deltas
|
|
369
|
-
});
|
|
370
|
-
} else {
|
|
371
|
-
this._logbook.addEntry({
|
|
372
|
-
type: result.type === ChatFetchResponseType.Canceled ? LoggedRequestKind.ChatMLCancelation : LoggedRequestKind.ChatMLFailure,
|
|
373
|
-
debugName: this._debugName,
|
|
374
|
-
chatEndpoint: this._chatEndpoint,
|
|
375
|
-
chatParams: this._chatParams,
|
|
376
|
-
startTime: this._time,
|
|
377
|
-
endTime: new Date(),
|
|
378
|
-
timeToFirstToken: this._timeToFirstToken,
|
|
379
|
-
result,
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import { createServiceIdentifier } from '../../../util/common/services';
|
|
7
|
-
|
|
8
|
-
export const ISimulationTestContext = createServiceIdentifier<ISimulationTestContext>('ISimulationTestContext');
|
|
9
|
-
|
|
10
|
-
export interface ISimulationTestContext {
|
|
11
|
-
|
|
12
|
-
_serviceBrand: undefined;
|
|
13
|
-
|
|
14
|
-
readonly isInSimulationTests: boolean;
|
|
15
|
-
|
|
16
|
-
writeFile(filename: string, contents: Uint8Array | string, tag: string): Promise<string>;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export class NulSimulationTestContext implements ISimulationTestContext {
|
|
21
|
-
|
|
22
|
-
_serviceBrand: undefined;
|
|
23
|
-
|
|
24
|
-
readonly isInSimulationTests = false;
|
|
25
|
-
|
|
26
|
-
async writeFile(filename: string, contents: Uint8Array | string, tag: string): Promise<string> {
|
|
27
|
-
return '';
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
import { createServiceIdentifier } from '../../../util/common/services';
|
|
7
|
-
import { URI } from '../../../util/vs/base/common/uri';
|
|
8
|
-
import { StringReplacement } from '../../../util/vs/editor/common/core/edits/stringEdit';
|
|
9
|
-
import { StringText } from '../../../util/vs/editor/common/core/text/abstractText';
|
|
10
|
-
|
|
11
|
-
export interface ISnippyService {
|
|
12
|
-
_serviceBrand: undefined;
|
|
13
|
-
|
|
14
|
-
handlePostInsertion(documentUri: URI, documentBeforeEdits: StringText, singleEdit: StringReplacement): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const ISnippyService = createServiceIdentifier<ISnippyService>('ISnippyService');
|
|
18
|
-
|
|
19
|
-
export class NullSnippyService implements ISnippyService {
|
|
20
|
-
_serviceBrand: undefined;
|
|
21
|
-
|
|
22
|
-
public async handlePostInsertion(): Promise<void> {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
}
|