ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
/*
* Edit-survival math for agent-host file edits.
*
* Sister implementation of the chat extension's `EditSurvivalTracker`
* (`extensions/copilot/src/platform/editSurvivalTracking/common/editSurvivalTracker.ts`).
* The extension version operates on multi-range `StringEdit`s with a
* live `TextModel`; here we only have whole-file snapshots and (when
* the tool input is recognisable) the explicit text the AI wrote. The
* whole-file path is the baseline; the chunked path uses asymmetric
* "fraction of AI 4-grams still present in the file" scoring so an
* edit's score doesn't decay as the file grows around it.
*
* Mostly carried over from the chat extension's version.
*/
/**
* Computes a number between 0 and 1 that reflects how similar the two
* texts are by counting how many 4-grams are shared between them.
*/
export function compute4GramTextSimilarity(text1: string, text2: string): number {
const n = 4;
if (text1.length < n || text2.length < n) {
return text1 === text2 ? 1 : 0;
nGramIdx
i i text1length n i
nGram text1i i n
count nGramIdxnGram
nGramIdxnGram count
i i text2length n i
nGram text2i i n
count nGramIdxnGram
nGramIdxnGram count
totalNGramCount text1length n text2length n
differentNGramCount
count nGramIdx
differentNGramCount Mathcount
equalNGramCount totalNGramCount differentNGramCount
equalNGramCount totalNGramCount
chunk currentText
n
chunklength
chunklength n
currentTextchunk
currentTextlength n
chunk currentText n n
text n Set
set
i i textlength n i
settexti i n
set
chunk fileNGrams ReadonlySet n
total chunklength n
present
i i total i
fileNGramschunki i n
present
present total
aiChunks currentText
aiChunkslength
n
fileNGrams currentTextlength n currentText n
totalWeight
weightedSum
chunk aiChunks
weight Math chunklength n
fraction
chunklength
fraction
chunklength n
fraction currentTextchunk
fileNGrams
fraction
fraction chunk fileNGrams n
weightedSum fraction weight
totalWeight weight
weightedSum totalWeight
fourGram
noRevert
beforeText afterText currentText
aiSimilarity afterText beforeText
aiSimilarity
userSimilarity currentText beforeText
MathuserSimilarity aiSimilarity aiSimilarity
beforeText
afterText
currentText
IEditSurvivalScore
fourGram currentText afterText
noRevert beforeText afterText currentText
beforeText
afterText
aiChunks
currentText
IEditSurvivalScore
fourGram aiChunkslength
currentText afterText
aiChunks currentText
fourGram
noRevert beforeText afterText currentText