Это 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.
*--------------------------------------------------------------------------------------------*/// Design-token validators that need block (selector + declaration) awareness,// which the line-based variable-name validator cannot provide.constRE_FONT_SIZE_PX=/font-size\s*:\s*([\d.]+)px/i;constRE_CODICON_SELECTOR=/codicon/i;/** The two standard codicon sizes: 16px base, 12px compact. */constALLOWED_CODICON_PX=newSet([16,12]);export
line
message
px
px px
px nearMiss
note nearMiss
text
text match match
text line selector declaration
source text
selectorStack
pending
line
i i sourcelength i
ch sourcei
ch
line
ch
selectorStackpending
pending
selectorStack
pending
line selectorStackselectorStacklength pending
pending
pending ch
text IDesignTokenViolation
violations IDesignTokenViolation
text line selector declaration
selector
match declaration
match
px match
px
nearMiss px
violations line message match nearMiss
violations
ReadonlyMap
text IDesignTokenViolation
violations IDesignTokenViolation
text line selector declaration
selector
match declaration
match
px match
suggestion px
suggestion
violations
line
message
violations
px
name
ICornerRadiusToken
px name
px name
px name
px name
px name
px ICornerRadiusToken
px
px name
best
bestDistance Mathbestpx px
token
distance Mathtokenpx px
distance bestDistance
best token
bestDistance distance
best
text IDesignTokenViolation
violations IDesignTokenViolation
text line _selector declaration
decl declaration
decl
value decl
value
pxMatch value
pxMatch
px pxMatch
px
token px
exact tokenpx px
note exact
violations
line
message
violations
weight
name
IFontWeightToken
weight name
weight name
value
trimmed value
trimmed
trimmed
numeric trimmed
numeric numeric
weight IFontWeightToken
best
bestDistance Mathbestweight weight
token
distance Mathtokenweight weight
distance bestDistance
best token
bestDistance distance
best
text IDesignTokenViolation
violations IDesignTokenViolation
text line _selector declaration
decl declaration
decl
value decl
value
weight value
weight
token weight
exact tokenweight weight
shown value
note exact
violations
line
message
violations
px
best
bestDistance Mathbest px
value
distance Mathvalue px
distance bestDistance
best value
bestDistance distance
best
px
px
text IDesignTokenViolation
violations IDesignTokenViolation
scale
text line _selector declaration
decl declaration
decl
value decl
value
parts value
snapped
vars
hasOffScale
ok
part parts
part part
snappedpart
vars
pxMatch part
pxMatch
ok
px pxMatch
scalepx
snappedpart
varspx
hasOffScale
nearest px
snapped
varsnearest
ok hasOffScale
violations
line
message
violations
text IDesignTokenViolation
violations IDesignTokenViolation
text line _selector declaration
decl declaration
decl
value decl
value
pxMatch value
pxMatch pxMatch
violations
line
message
violations
deprecated
replacement
IDeprecatedToken
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
deprecated replacement
a b bdeprecatedlength adeprecatedlength
text IDesignTokenViolation
violations IDesignTokenViolation
text line _selector declaration
deprecated replacement
idx declarationdeprecated idx idx declarationdeprecated idx deprecatedlength
nextChar declarationidx deprecatedlength
nextChar
violations
line
message
violations
/** Near-miss band: a codicon at 13/14/15px is always a mistake for 12 or 16. */
function
isNearMiss
(
:
number
)
:
boolean
{
return
>
12
&&
<
16
;
}
/** The two standard codicon sizes, formatted for the suggestion. */
const
STANDARD_CODICON_SIZES
=
'var(--vscode-codiconFontSize) [16] or var(--vscode-codiconFontSize-compact) [12]'
;
/** Builds a compact, single-line warning for an off-scale codicon font-size. */
function
formatCodiconMessage
(
:
string
,
:
boolean
)
:
string
{
const
=
?
''
:
' (large/small glyph - may be intentional)'
;
return
`${px}px -> ${STANDARD_CODICON_SIZES}${note}`
;
}
/**
* Replace the body of every `/* ... *\/` comment with spaces while preserving
* newlines, so brace/semicolon scanning is not confused by comment content and
* line numbers stay accurate.
*/
function
blankComments
(
:
string
)
:
string
{
return
.
replace
(
/\/\*[\s\S]*?\*\//g
,
=>
.
replace
(
/[^\n]/g
,
' '
)
)
;
}
/**
* Scans CSS character-by-character, tracking the nesting stack of rule selectors,
* and invokes `callback` for every declaration (text terminated by `;`) with the
* 1-based line it ends on and the innermost selector that contains it. This gives
* block (selector + declaration) awareness that a line-based linter lacks and
* correctly handles native CSS nesting. Comment bodies are blanked first so their
* contents cannot disturb the scan.
*/
function
forEachDeclaration
(
:
string
,
callback
:
(
:
number
,
:
string
,
:
string
)
=>
void
)
:
void
{
const
=
blankComments
(
)
;
const
:
string
[
]
=
[
]
;
let
=
''
;
let
=
1
;
for
(
let
=
0
;
<
.
;
++
)
{
const
=
[
]
;
if
(
===
'\n'
)
{
++
;
}
switch
(
)
{
case
'{'
:
.
push
(
.
trim
(
)
)
;
=
''
;
break
;
case
'}'
:
.
pop
(
)
;
=
''
;
break
;
case
';'
:
callback
(
,
[
.
-
1
]
??
''
,
)
;
=
''
;
break
;
default
:
+=
;
}
}
}
/**
* Validates that any `font-size` applied to a codicon resolves to one of the two
* allowed codicon sizes (16px base, 12px compact). Off-scale values are reported
* as warnings: the 13-15px near-miss band is always a mistake for 12 or 16, while
* other off sizes (large hero icons / small chevrons) may be intentional and are
* worded accordingly. Values expressed via `var(--vscode-codiconFontSize...)` are
* not matched by the px regex and are therefore always accepted.
*/
// Unlike codicons (which have a clean 12/16 off-ramp), text font-sizes such as
// 14px and 16px are common and often intentional, so flagging "off-ramp" values
// would be noise. Instead this only suggests adopting a token when a hardcoded px
// value EXACTLY matches a design-ramp token value, where the var is a drop-in
// replacement. Findings are advisory (warning-only), one clickable link per
// occurrence.
/** Exact px value -> suggested token var(s). Ambiguous values list alternatives. */
const
FONT_SIZE_RAMP
:
<
number
,
string
>
=
new
Map
(
[
[
26
,
'var(--vscode-fontSize-heading1)'
]
,
[
18
,
'var(--vscode-fontSize-heading2)'
]
,
[
13
,
'var(--vscode-fontSize-body1) or var(--vscode-fontSize-heading3)'
]
,
[
12
,
'var(--vscode-fontSize-label1)'
]
,
[
11
,
'var(--vscode-fontSize-body2) or var(--vscode-fontSize-label2)'
]
,
[
10
,
'var(--vscode-fontSize-label3)'
]
,
]
)
;
/**
* Finds hardcoded `font-size` px values that exactly match a design-ramp token
* value and could be replaced by the token var. Codicon selectors are skipped
* (covered by {@link validateCodiconFontSizes}). Returns one finding per
* occurrence with the line it appears on, so callers can emit a clickable
* `file(line,col)` link per match (the terminal linkifies that prefix).
*/
/** At/above this px a radius reads as fully rounded -> `circle`. */
const
CIRCLE_THRESHOLD_PX
=
100
;
/** Maps a px radius to its token, snapping off-scale values (ties round up). */
function
snapCornerRadius
(
:
number
)
:
{
if
(
>=
CIRCLE_THRESHOLD_PX
)
{
return
{
:
9999
,
:
'circle'
}
;
}
let
=
CORNER_RADIUS_TOKENS
[
0
]
;
let
=
.
abs
(
.
-
)
;
for
(
const
of
CORNER_RADIUS_TOKENS
)
{
const
=
.
abs
(
.
-
)
;
// `<=` makes ties prefer the later (larger) token, i.e. round up.
if
(
<=
)
{
=
;
=
;
}
}
return
;
}
/**
* Finds hardcoded `border-radius` px values and suggests the corner-radius token
* var. Exact token-value matches are flagged as drop-in replacements; off-scale
* values are snapped to the nearest token (with the token's px shown so the
* size change is explicit). `0`, `50%`, `inherit` and var()/calc() expressions
* are ignored. Returns one finding per occurrence so the terminal can linkify
* each `file(line,col)` prefix.
*/
// The font ramp defines exactly two weights: regular (400) and
// semiBold (600). Any other numeric weight (e.g. 500, 700) is off the ramp and
// snaps to the nearer of the two. The CSS keywords `normal` (400) and `bold`
// (700) are normalised before snapping. `inherit`, `lighter`, `bolder` and
// var()/calc() expressions are left untouched.
const
RE_FONT_WEIGHT
=
/font-weight\s*:\s*([^;{}]+)/i
;
interface
IFontWeightToken
{
readonly
:
number
;
readonly
:
string
;
}
/** The only two weights in the font ramp. */
const
FONT_WEIGHT_TOKENS
:
readonly
[
]
=
[
{
:
400
,
:
'regular'
}
,
{
:
600
,
:
'semiBold'
}
,
]
;
/** Resolves a font-weight value to a number, or undefined if not numeric. */
function
parseFontWeight
(
:
string
)
:
number
|
undefined
{
const
=
.
trim
(
)
.
toLowerCase
(
)
;
if
(
===
'normal'
)
{
return
400
;
}
if
(
===
'bold'
)
{
return
700
;
}
const
=
/^(\d{3})$/
.
exec
(
)
;
return
?
parseInt
(
[
1
]
,
10
)
:
undefined
;
}
/** Maps a numeric weight to its token, snapping off-ramp values to the nearer. */
function
snapFontWeight
(
:
number
)
:
{
let
=
FONT_WEIGHT_TOKENS
[
0
]
;
let
=
.
abs
(
.
-
)
;
for
(
const
of
FONT_WEIGHT_TOKENS
)
{
const
=
.
abs
(
.
-
)
;
// `<=` makes the 500 tie prefer the heavier (600) token.
if
(
<=
)
{
=
;
=
;
}
}
return
;
}
/**
* Finds hardcoded `font-weight` values and suggests the weight-ramp var.
* Exact ramp values (400 / 600, plus `normal` = 400) are flagged as drop-in
* replacements; off-ramp values (e.g. 500, 700, `bold`) snap to the nearer
* token and call out that the value is off the two-weight ramp. `inherit`,
* `lighter`, `bolder` and var()/calc() expressions are ignored. Returns one
* finding per occurrence so the terminal can linkify each `file(line,col)`.
*/
/** Snaps an off-scale spacing px to the nearest ramp value (ties round up). */
function
snapSpacing
(
:
number
)
:
number
{
let
=
SPACING_SCALE
[
0
]
;
let
=
.
abs
(
-
)
;
for
(
const
of
SPACING_SCALE
)
{
const
=
.
abs
(
-
)
;
if
(
<=
)
{
=
;
=
;
}
}
return
;
}
/** Maps an on-scale spacing px to its CSS variable (0 -> sizeNone). */
function
spacingVar
(
:
number
)
:
string
{
return
===
0
?
'var(--vscode-spacing-sizeNone)'
:
`var(--vscode-spacing-size${px *10})`
;
}
/**
* Finds `padding`/`margin`/`gap` lengths that are off the spacing scale and
* suggests the nearest on-scale px value. On-scale literals are accepted as-is
* (token adoption is optional). `0`, `auto`, `%`, `em`/`rem`, var()/calc() are
* ignored. Returns one finding per declaration that contains an off-scale value.
*/
/**
* Finds `border`/`outline` declarations whose width is exactly `1px` and
* suggests `var(--vscode-strokeThickness)`. Returns one finding per occurrence.
*/
export
function
validateStrokeTokens
(
:
string
)
:
[
]
{
const
:
[
]
=
[
]
;
forEachDeclaration
(
,
(
,
,
)
=>
{
const
=
RE_STROKE_PROP
.
exec
(
)
;
if
(
!
)
{
return
;
}
const
=
[
2
]
;
// Skip when the width is already tokenised or computed.
if
(
/var\(|calc\(/i
.
test
(
)
)
{
return
;
}
const
=
RE_FIRST_PX
.
exec
(
)
;
if
(
!
||
parseFloat
(
[
1
]
)
!==
1
)
{
return
;
}
.
push
(
{
,
:
`${decl[1].trim()}: ${value.trim()} -> use var(--vscode-strokeThickness) for the 1px width`
// Some `--vscode-*` size tokens have been superseded by more generic ones and
// are marked `@deprecated` in the size registry. Any remaining usage of a
// deprecated token var is reported with its drop-in replacement, regardless of
// which property it appears in.
interface
IDeprecatedToken
{
readonly
:
string
;
readonly
:
string
;
}
/** Deprecated token var -> its replacement. */
const
DEPRECATED_TOKENS
:
readonly
[
]
=
[
{
:
'--vscode-agents-fontSize-heading1'
,
:
'--vscode-fontSize-heading1'
}
,
{
:
'--vscode-agents-fontSize-heading2'
,
:
'--vscode-fontSize-heading2'
}
,
{
:
'--vscode-agents-fontSize-heading3'
,
:
'--vscode-fontSize-heading3'
}
,
{
:
'--vscode-agents-fontSize-body1'
,
:
'--vscode-fontSize-body1'
}
,
{
:
'--vscode-agents-fontSize-body2'
,
:
'--vscode-fontSize-body2'
}
,
{
:
'--vscode-agents-fontSize-label1'
,
:
'--vscode-fontSize-label1'
}
,
{
:
'--vscode-agents-fontSize-label2'
,
:
'--vscode-fontSize-label2'
}
,
{
:
'--vscode-agents-fontSize-label3'
,
:
'--vscode-fontSize-label3'
}
,
{
:
'--vscode-agents-fontWeight-regular'
,
:
'--vscode-fontWeight-regular'
}
,
{
:
'--vscode-agents-fontWeight-semiBold'
,
:
'--vscode-fontWeight-semiBold'
}
,
{
:
'--vscode-bodyFontSize'
,
:
'--vscode-fontSize-body1'
}
,
{
:
'--vscode-bodyFontSize-small'
,
:
'--vscode-fontSize-label1'
}
,
{
:
'--vscode-bodyFontSize-xSmall'
,
:
'--vscode-fontSize-body2'
}
,
]
;
// Longest-first so a suffixed token (e.g. `-small`) matches before the base
// token that is its prefix (`--vscode-bodyFontSize`).
const
DEPRECATED_TOKENS_SORTED
=
[
...
DEPRECATED_TOKENS
]
.
sort
(
(
,
)
=>
.
.
-
.
.
)
;
/**
* Finds usages of deprecated token vars and suggests the replacement token.
* A match is only reported when the token is not the prefix of a longer token
* (the next character does not continue the identifier). Returns one finding
* per occurrence so the terminal can linkify each `file(line,col)`.
*/