Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
`Capture a screenshot of the current browser page. You can't perform actions based on the screenshot; use ${ReadBrowserToolData.id} for actions.`
,
:
.
,
:
.
,
:
{
:
'object'
,
:
{
:
{
:
'string'
,
:
`The browser page ID to capture, acquired from context or the open tool.`
}
,
:
{
:
'string'
,
:
'Element reference to capture. If omitted, captures the whole viewport.'
}
,
:
{
:
'string'
,
:
'Playwright selector of an element to capture when "ref" is not available. If omitted, captures the whole viewport.'
}
,
:
{
:
'string'
,
:
'Human-readable description of the element to capture (e.g., "chart diagram", "product image").'
}
,
:
{
:
'boolean'
,
:
'Whether to scroll the element into view before capturing. Defaults to false.'
,
}
}
,
:
[
'pageId'
]
,
}
,
}
;
interface
IScreenshotBrowserToolParams
{
:
string
;
?
:
string
;
?
:
string
;
?
:
string
;
?
:
boolean
;
}
type
ScreenshotType
=
/** A specific element identified by an aria ref or Playwright selector. */
|
'element'
/** The current viewport (no element targeted, or the element bounds could not be resolved). */
|
'viewport'
;
type
ScreenshotSelectorSource
=
/** Caller passed an `aria-ref` reference. */
|
'ref'
/** Caller passed a Playwright selector string. */
|
'selector'
/** Caller did not target an element (viewport screenshot was requested). */
|
'none'
;
type
ScreenshotCapturedEvent
=
{
// Screenshot tool options
:
;
:
;
:
boolean
;
// Image metadata
:
number
|
undefined
;
:
number
|
undefined
;
:
number
;
// Conversion factors
:
number
|
undefined
;
:
number
|
undefined
;
:
number
;
// Window metadata
:
number
|
undefined
;
:
number
|
undefined
;
:
boolean
|
undefined
;
:
boolean
;
// Screen metadata
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
:
number
|
undefined
;
}
;
type
ScreenshotCapturedClassification
=
{
// Screenshot tool options
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'What kind of screenshot was captured (element or viewport).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
'How the screenshot tool received its target element (ref, selector, or none).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the tool was asked to scroll the target element into view before capturing.'
}
;
// Image metadata
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Width of the captured screenshot image in pixels (undefined if it could not be determined).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Height of the captured screenshot image in pixels (undefined if it could not be determined).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Encoded size of the screenshot buffer in bytes.'
}
;
// Conversion factors
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'VS Code per-window zoom factor for the hosting window (undefined if no editor currently holds the browser view).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'OS HiDPI scaling factor for the hosting window (window.devicePixelRatio). Includes windowZoomFactor. Undefined if no editor currently holds the browser view.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Content zoom factor of the integrated browser view.'
}
;
// Window metadata
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Inner width of the hosting VS Code window viewport, in workbench CSS pixels (window.innerWidth). Undefined if no editor currently holds the browser view.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Inner height of the hosting VS Code window viewport, in workbench CSS pixels (window.innerHeight). Undefined if no editor currently holds the browser view.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the browser view was hosted in a VS Code auxiliary window at capture time (undefined if no editor currently holds the browser view).'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Whether the browser view was mounted and being painted in an editor pane at capture time (false if the model was not bound to a visible editor).'
}
;
// Screen metadata
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Width of the screen the hosting VS Code window is on, in OS-level CSS pixels (window.screen.width, unaffected by windowZoomFactor). Undefined if no editor currently holds the browser view.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Height of the screen the hosting VS Code window is on, in OS-level CSS pixels (window.screen.height, unaffected by windowZoomFactor). Undefined if no editor currently holds the browser view.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Width of the available screen area (excluding OS chrome such as the taskbar/dock), in OS-level CSS pixels (window.screen.availWidth, unaffected by windowZoomFactor). Undefined if no editor currently holds the browser view.'
}
;
:
{
:
'SystemMetaData'
;
:
'FeatureInsight'
;
:
true
;
:
'Height of the available screen area (excluding OS chrome such as the taskbar/dock), in OS-level CSS pixels (window.screen.availHeight, unaffected by windowZoomFactor). Undefined if no editor currently holds the browser view.'
}
;
:
'jruales'
;
:
'A screenshot was successfully captured by the Integrated Browser screenshot tool.'
;
}
;
export
class
ScreenshotBrowserTool
implements
IToolImpl
{
constructor
(
@IBrowserViewWorkbenchService
private
readonly
:
,
@IPlaywrightService
private
readonly
:
,
@ITelemetryService
private
readonly
:
,
@IEditorGroupsService
private
readonly
:
,
)
{
}
async
prepareToolInvocation
(
:
,
:
)
:
Promise
<
|
undefined
>
{
const
=
.
as
;
if
(
.
)
{
const
=
escapeMarkdownSyntaxTokens
(
.
)
;
return
{
:
new
MarkdownString
(
localize
(
'browser.screenshot.invocation.element'
,
"Capturing screenshot of {0}"
,
)
)
,
:
new
MarkdownString
(
localize
(
'browser.screenshot.past.element'
,
"Captured screenshot of {0}"
,
)
)
,
}
;
}
return
{
:
localize
(
'browser.screenshot.invocation'
,
"Capturing browser screenshot"
)
,
:
localize
(
'browser.screenshot.past'
,
"Captured browser screenshot"
)
,
}
;
}
async
invoke
(
:
,
:
,
:
,
:
)
:
Promise
<
>
{
const
=
.
as
;
const
=
getSessionId
(
)
;
if
(
!
.
)
{
return
errorResult
(
`No page ID provided. Use '${OpenPageToolId}' first.`
)
;
}
let
=
.
;
if
(
.
)
{
=
`aria-ref=${params.ref}`
;
}
// Note that we don't use Playwright's screenshot methods because they cause brief flashing on the page,