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.
*--------------------------------------------------------------------------------------------*/
/*
* Extracts the explicit AI-written text chunks from a file-edit tool's
* input payload. Both Claude (via @anthropic-ai/claude-agent-sdk) and
* Copilot CLI (via @github/copilot-sdk) accept canonical tool schemas
* whose shapes we can read structurally — Claude uses PascalCase names
* (`Write`, `Edit`, `MultiEdit`) with `_string` fields, Copilot uses
* snake_case (`create`, `edit`, `str_replace`, `insert`,
* `str_replace_editor` command-dispatched, `apply_patch` /
* `git_apply_patch` V4A patch body) with `_str` / `file_text` fields.
*
* Returning an empty array means "we couldn't read this — fall back to
* whole-file scoring." Defensive against malformed SDK input: every
* branch checks the value shape before reading.
*
* Coverage invariant: every tool the agent host currently treats as a
* file-edit tool (`isClaudeFileEditTool`, `isEditTool` in Copilot) has
* a matching case below — so in practice every edit gets chunked
* scoring. The whole-file fallback is a safety net for SDK shape drift
* (a tool input changes shape) and for newly added tools (a new edit
* tool added to one of those gates without a matching case here). If
* you add a new file-edit tool to either gate, add a case here too so
* the survival reporter keeps producing chunked scores.
*/
/**
* Returns the AI-written text chunks for a known file-edit tool, or
* `[]` if the tool / input shape is not recognised. Callers should
* treat `[]` as "fall back to whole-file scoring."
*
* Supported Claude SDK tools (one file per call):
* - `Write { content }` → `[content]`
* - `Edit { new_string }` → `[new_string]`
* - `MultiEdit { edits: [{ new_string }] }` → one chunk per edit
*
* Supported Copilot CLI tools (one file per call unless noted):
* - `create { file_text }` → `[file_text]`
* - `edit`, `str_replace { new_str }` → `[new_str]`
* - `insert { new_str ` → `[new_str]`
* - `str_replace_editor command, ... ` → dispatch on command
* - `apply_patch`, `git_apply_patch` → `+` lines from the
* V4A patch body, scoped to forFilePath when supplied
* (the patch may touch multiple files; we only want chunks for
* the file we're sampling).
*
* `NotebookEdit` is not handled here: the reporter currently skips
* `.ipynb` files at launch time, so notebook tool inputs never reach
* the survival math. Add a branch here if we extend tracking to
* notebooks.
*
* Tool identifier (Claude PascalCase or Copilot
* snake_case; tools we don't recognise just return `[]`).
* The tool input. May be `unknown`, a JSON object,
* or — for `apply_patch` — a bare V4A patch string. Defensive
* against all three.
* Optional. When supplied and the tool is a
* multi-file patch (`apply_patch` / `git_apply_patch`), only the
* `+` lines under that file's header contribute. Single-file tools
* ignore this argument.
*/
toolName input forFilePath
toolName
input
input
input
input
input
input
input forFilePath
input field
input input
value input Record field
value value
input field
input input
edits input Record edits
edits
chunks
entry edits
entry entry
value entry Record field
value
chunksvalue
chunks
input
input input
obj input Record
objcommand
objfile_text objfile_text
objnew_str objnew_str
input forFilePath
text
input
text input
input input
obj input Record
objinput
text objinput
objpatch
text objpatch
text
additionsByFile
order
currentFile
line text
matchedHeader
re
m reline
m m
currentFile m
additionsByFilecurrentFile
additionsByFilecurrentFile
ordercurrentFile
matchedHeader
matchedHeader currentFile
line line
additionsByFilecurrentFileline
lines lineslength lines
forFilePath
lines additionsByFileforFilePath
lines lineslength
lines
out
file order
joined additionsByFilefile
joinedlength
outjoined
out