Это 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.
*--------------------------------------------------------------------------------------------*/import{ MermaidConfig }from'mermaid';import{ MermaidExtensionConfig }from'./config';import{ IDisposable }from'./disposable';/**
* Identifier for the custom Mermaid theme that is derived from the current VS Code color theme.
*/exportconst vsCodeMermaidTheme ='vscode';/**
* Returns `true` when the active VS Code theme is a dark (or non-light high contrast) theme.
*/functionisDarkVsCodeTheme():boolean{return document.body.classList.contains('vscode-dark')||(document.body.classList documentbodyclassList
cssValue
probe document
probestyledisplay
probestylecolor cssValue
documentbodyprobe
probecolor
probe
value
match value
match
r match
g match
b match
a match Mathmatch
n Math Math n
VsCodeMermaidThemeVariables
_value
next
nextfingerprint _valuefingerprint
_value next
listener _listeners
_value
IDisposable
_listenerslistener
_listenerslistener
extensionConfig MermaidExtensionConfig PickMermaidConfig
themeName
extensionConfigdarkModeTheme
extensionConfiglightModeTheme
themeName vsCodeMermaidTheme
theme
themeVariables valuevariables
theme themeName MermaidConfig
themeVariables
IDisposable
observer
observerdocumentbody attributes attributeFilter
observerdocumentdocumentElement attributes attributeFilter
observer
VsCodeMermaidThemeVariables
variables Record
darkMode
key varNames
color varNames
color
variableskey color
chartPalette
i i chartPalettelength i
chartPalettei
chartPalettei
fontFamily
fontFamily
variablesfontFamily fontFamily
fontSize
fontSize
variablesfontSize fontSize
variables
fingerprint variables
/**
* Resolves a CSS color value (such as `var(--vscode-editor-background)`) to a hex color string
* by letting the browser compute it on a temporary element.
*/
a<255?`#${hex(r)}${hex(g)}${hex(b)}${hex(a)}`:`#${hex(r)}${hex(g)}${hex(b)}`;}functionpickColor(...varNames:string[]):string|undefined{for(const name of varNames){// Peek at the raw custom property first: setting `style.color = 'var(--missing)'`// silently drops the declaration and the probe falls back to the inherited// `color` (typically the webview foreground), which would otherwise mask later// fallbacks in `varNames`.if(!readCssVar(name)){continue;}const hex =resolveCssColor(`var(${name})`);if(hex){return hex;}}returnundefined;}functionreadCssVar(name:string):string{returngetComputedStyle(document.documentElement).getPropertyValue(name).trim();}/**
* The Mermaid `themeVariables` derived from the active VS Code color theme, plus a string
* fingerprint that changes whenever any of the resolved colors change.
*/exportinterface VsCodeMermaidThemeVariables {readonly variables: Record<string,string|boolean>;readonly fingerprint:string;}/**
* Resolves and caches Mermaid `themeVariables` derived from the active VS Code color theme.
*
* Each consumer should construct one tracker, read {@link value} when initializing mermaid, and
* subscribe to {@link onDidChange} (or call {@link refresh} after a theme-change signal) to keep
* its rendered diagrams in sync with theme switches.
*/exportclass VsCodeMermaidThemeTracker {private _value: VsCodeMermaidThemeVariables |undefined;privatereadonly _listeners =new Set<()=>void>
(
)
;
/**
* The Mermaid theme variables derived from the active VS Code theme. Computed lazily on
* first access and memoized until {@link refresh} or {@link invalidate} is called.
*/
get
value
(
)
:
{
return
this
.
??=
computeVsCodeMermaidThemeVariables
(
)
;
}
/**
* Recomputes the theme variables from the live CSS variables and fires {@link onDidChange}
* listeners when the resolved colors actually changed. Returns `true` when listeners fired.
*/
refresh
(
)
:
boolean
{
const
=
computeVsCodeMermaidThemeVariables
(
)
;
if
(
.
===
this
.
?.
)
{
return
false
;
}
this
.
=
;
for
(
const
of
this
.
)
{
listener
(
)
;
}
return
true
;
}
/**
* Drops the cached value without firing listeners. The next read of {@link value} will
* recompute from the live CSS variables.
*/
invalidate
(
)
:
void
{
this
.
=
undefined
;
}
/**
* Subscribes to changes. The listener fires when {@link refresh} detects that the resolved
* theme variables have changed; read {@link value} to get the new variables.
*/
onDidChange
(
listener
:
(
)
=>
void
)
:
{
this
.
.
add
(
)
;
return
{
dispose
:
(
)
=>
this
.
.
delete
(
)
}
;
}
/**
* Resolves the Mermaid `theme` / `themeVariables` pair for the given extension config,
* picking the dark or light slot based on the active VS Code theme and translating the
* `'vscode'` sentinel into mermaid's `base` theme plus VS Code-derived variables.
*/
resolveMermaidTheme
(
:
)
:
<
,
'theme'
|
'themeVariables'
>
{
const
=
isDarkVsCodeTheme
(
)
?
.
:
.
;
if
(
===
)
{
return
{
:
'base'
,
:
this
.
.
,
}
;
}
return
{
:
as
[
'theme'
]
,
// Reset theme variables in case mermaid.initialize was previously called with the
// vscode theme: mermaid merges configs and stale variables would otherwise leak through.
:
{
}
,
}
;
}
/**
* Starts a {@link MutationObserver} on the body and document element so that theme switches
* (class/data-attribute changes on `body`, CSS variable updates on `documentElement.style`)
* trigger a {@link refresh}. Returns a disposable that stops observing.
*/
observeDomChanges
(
)
:
{
const
=
new
MutationObserver
(
(
)
=>
this
.
refresh
(
)
)
;
.
observe
(
.
,
{
:
true
,
:
[
'class'
,
'data-vscode-theme-id'
,
'data-vscode-theme-kind'
]
}
)
;
.
observe
(
.
,
{
:
true
,
:
[
'style'
]
}
)
;
return
{
dispose
:
(
)
=>
.
disconnect
(
)
}
;
}
}
function
computeVsCodeMermaidThemeVariables
(
)
:
{
const
:
<
string
,
string
|
boolean
>
=
{
:
isDarkVsCodeTheme
(
)
,
}
;
const
set
=
(
:
string
,
...
:
string
[
]
)
=>
{
const
=
pickColor
(
...
)
;
if
(
)
{
[
]
=
;
}
}
;
// Canvas / text
set
(
'background'
,
'--vscode-editor-background'
)
;
set
(
'textColor'
,
'--vscode-charts-foreground'
,
'--vscode-editor-foreground'
,
'--vscode-foreground'
)
;
set
(
'lineColor'
,
'--vscode-chart-line'
,
'--vscode-charts-lines'
,
'--vscode-editor-foreground'
,
'--vscode-foreground'
)
;
// Primary (default node) colors
set
(
'primaryColor'
,
'--vscode-editorWidget-background'
)
;
set
(
'primaryTextColor'
,
'--vscode-charts-foreground'
,
'--vscode-editor-foreground'
,
'--vscode-foreground'
)
;
set
(
'primaryBorderColor'
,
'--vscode-chart-line'
,
'--vscode-editorWidget-border'
,
'--vscode-focusBorder'
)
;
set
(
'mainBkg'
,
'--vscode-editorWidget-background'
)
;
set
(
'nodeBorder'
,
'--vscode-chart-line'
,
'--vscode-editorWidget-border'
,
'--vscode-focusBorder'
)
;
// Secondary colors
set
(
'secondaryColor'
,
'--vscode-input-background'
,
'--vscode-editorWidget-background'
)
;
set
(
'secondaryTextColor'
,
'--vscode-input-foreground'
,
'--vscode-foreground'
)
;
set
(
'secondaryBorderColor'
,
'--vscode-input-border'
,
'--vscode-editorWidget-border'
)
;
// Tertiary / subgraph (cluster) colors
set
(
'tertiaryColor'
,
'--vscode-textBlockQuote-background'
,
'--vscode-input-background'
)
;
set
(
'tertiaryTextColor'
,
'--vscode-foreground'
)
;
set
(
'tertiaryBorderColor'
,
'--vscode-textBlockQuote-border'
,
'--vscode-editorWidget-border'
)
;
set
(
'clusterBkg'
,
'--vscode-textBlockQuote-background'
,
'--vscode-input-background'
)
;
set
(
'clusterBorder'
,
'--vscode-textBlockQuote-border'
,
'--vscode-editorWidget-border'
)
;
// Notes
set
(
'noteBkgColor'
,
'--vscode-textBlockQuote-background'
,
'--vscode-editorWidget-background'
)
;
set
(
'noteTextColor'
,
'--vscode-foreground'
)
;
set
(
'noteBorderColor'
,
'--vscode-textBlockQuote-border'
,
'--vscode-editorWidget-border'
)
;
// Errors
set
(
'errorBkgColor'
,
'--vscode-inputValidation-errorBackground'
,
'--vscode-editorError-background'
)
;
set
(
'errorTextColor'
,
'--vscode-editorError-foreground'
,
'--vscode-foreground'
)
;
// Misc
set
(
'titleColor'
,
'--vscode-charts-foreground'
,
'--vscode-editor-foreground'
,
'--vscode-foreground'
)
;
set
(
'edgeLabelBackground'
,
'--vscode-editor-background'
)
;
// Pie / palette slots — mermaid uses pie1..pie12 for pie chart slices and cScale0..cScale11
// as the accent palette for various diagram types. Map to the VS Code chart accent colors.