Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Use as the {@link IRequestOptions.callSite} value to prevent
* request telemetry from being emitted. This is needed for
* callers such as the telemetry sender to avoid cyclical calls.
*/
export
const
NO_FETCH_TELEMETRY
=
'NO_FETCH_TELEMETRY'
;
export
interface
IRequestCompleteEvent
{
readonly
:
string
;
readonly
:
number
;
readonly
:
number
|
undefined
;
}
export
interface
AuthInfo
{
:
boolean
;
:
string
;
:
string
;
:
number
;
:
string
;
:
number
;
}
export
interface
Credentials
{
:
string
;
:
string
;
}
export
interface
IRequestService
{
readonly
:
undefined
;
/**
* Fires when a request completes (successfully or with an error response).
*/
readonly
:
<
>
;
request
(
:
,
:
)
:
Promise
<
>
;
resolveProxy
(
:
string
)
:
Promise
<
string
|
undefined
>
;
lookupAuthorization
(
:
)
:
Promise
<
|
undefined
>
;
lookupKerberosAuthorization
(
:
string
)
:
Promise
<
string
|
undefined
>
;
loadCertificates
(
)
:
Promise
<
string
[
]
>
;
}
class
LoggableHeaders
{
private
:
|
undefined
;
constructor
(
private
readonly
:
)
{
}
toJSON
(
)
:
any
{
if
(
!
this
.
)
{
const
=
.
create
(
null
)
;
for
(
const
in
this
.
)
{
if
(
.
toLowerCase
(
)
===
'authorization'
||
.
toLowerCase
(
)
===
'proxy-authorization'
)
{
[
]
=
'*****'
;
}
else
{
[
]
=
this
.
[
]
;
}
}
this
.
=
;
}
return
this
.
;
}
}
export
abstract
class
AbstractRequestService
extends
Disposable
implements
IRequestService
{
declare
readonly
:
undefined
;
private
=
0
;
private
readonly
=
this
.
_register
(
new
Emitter<IRequestCompleteEvent>
(
)
)
;
readonly
=
this
.
.
;
constructor
(
protected
readonly
:
)
{
super
(
)
;
}
protected
async
logAndRequest
(
:
,
request
:
(
)
=>
Promise
<
>
)
:
Promise
<
>
{
const
=
`#${++this.counter}: ${options.url}`
;
this
.
.
trace
(
`${prefix} - begin`
,
.
,
new
LoggableHeaders
(
.
??
{
}
)
)
;
const
=
.
now
(
)
;
try
{
const
=
await
request
(
)
;
this
.
.
trace
(
`${prefix} - end`
,
.
,
.
.
,
.
.
)
;
this
.
.
fire
(
{
:
.
,
:
.
now
(
)
-
,
:
.
.
,
}
)
;
return
;
}
catch
(
)
{
this
.
.
error
(
`${prefix} - error`
,
.
,
getErrorMessage
(
)
)
;
throw
;
}
}
abstract
request
(
:
,
:
)
:
Promise
<
>
;
abstract
resolveProxy
(
:
string
)
:
Promise
<
string
|
undefined
>
;
abstract
lookupAuthorization
(
:
)
:
Promise
<
|
undefined
>
;
abstract
lookupKerberosAuthorization
(
:
string
)
:
Promise
<
string
|
undefined
>
;
abstract
loadCertificates
(
)
:
Promise
<
string
[
]
>
;
}
export
function
isSuccess
(
:
)
:
boolean
{
return
(
.
.
&&
.
.
>=
200
&&
.
.
<
300
)
||
.
.
===
1223
;
}
export
function
isClientError
(
:
)
:
boolean
{
return
!
!
.
.
&&
.
.
>=
400
&&
.
.
<
500
;
}
export
function
isServerError
(
:
)
:
boolean
{
return
!
!
.
.
&&
.
.
>=
500
&&
.
.
<
600
;
}
/**
* Reads a header value from an {@link IHeaders} map, tolerating array-shaped
* values and case-insensitive lookups.
*/
export
function
readHeader
(
:
|
undefined
,
:
string
)
:
string
|
undefined
{
if
(
!
)
{
return
undefined
;
}
const
=
[
]
??
[
.
toLowerCase
(
)
]
;
if
(
Array
.
isArray
(
)
)
{
return
[
0
]
;
}
return
;
}
/**
* Parses the `Retry-After` header as a number of seconds. Returns `undefined`
* if absent or not a finite positive number. The HTTP-date form is not parsed.
*/
export
function
retryAfterFromHeaders
(
:
|
undefined
)
:
number
|
undefined
{
const
=
readHeader
(
,
'retry-after'
)
;
if
(
!
)
{
return
undefined
;
}
const
=
parseInt
(
,
10
)
;
return
.
isFinite
(
)
&&
>
0
?
:
undefined
;
}
export
function
hasNoContent
(
:
)
:
boolean
{
return
.
.
===
204
;
}
export
async
function
asText
(
:
)
:
Promise
<
string
|
null
>
{
if
(
hasNoContent
(
)
)
{
return
null
;
}
const
=
await
streamToBuffer
(
.
)
;
return
.
toString
(
)
;
}
export
async
function
asTextOrError
(
:
)
:
Promise
<
string
|
null
>
{
if
(
!
isSuccess
(
)
)
{
throw
new
Error
(
'Server returned '
+
.
.
)
;
}
return
asText
(
)
;
}
export
async
function
asJson<T={}>
(
:
)
:
Promise
<
T
|
null
>
{
if
(
!
isSuccess
(
)
)
{
throw
new
Error
(
'Server returned '
+
.
.
)
;
}
if
(
hasNoContent
(
)
)
{
return
null
;
}
const
=
await
streamToBuffer
(
.
)
;
const
=
.
toString
(
)
;
try
{
return
JSON
.
parse
(
)
;
}
catch
(
)
{
.
+=
':\n'
+
;
throw
;
}
}
export
function
updateProxyConfigurationsScope
(
:
boolean
,
:
boolean
)
:
void
{
registerProxyConfigurations
(
,
)
;
}
export
const
USER_LOCAL_AND_REMOTE_SETTINGS
=
[
'http.proxy'
,
'http.proxyStrictSSL'
,
'http.proxyKerberosServicePrincipal'
,
'http.noProxy'
,
'http.proxyAuthorization'
,
'http.proxySupport'
,
'http.systemCertificates'
,
'http.systemCertificatesNode'
,
'http.experimental.systemCertificatesV2'
,
'http.fetchAdditionalSupport'
,
'http.experimental.networkInterfaceCheckInterval'
,
]
;
export
const
=
true
;
let
:
[
]
=
[
]
;
let
:
boolean
|
undefined
=
undefined
;
let
:
boolean
|
undefined
=
undefined
;
function
registerProxyConfigurations
(
=
true
,
=
true
)
:
void
{
if
(
===
&&
===
)
{
return
;
}
=
;
=
;
const
=
.
as<IConfigurationRegistry>
(
.
)
;
const
=
;
=
[
{
:
'http'
,
:
15
,
:
localize
(
'httpConfigurationTitle'
,
"HTTP"
)
,
:
'object'
,
:
.
MACHINE
,
:
{
'http.useLocalProxyConfiguration'
:
{
:
'boolean'
,
default
:
,
:
localize
(
'useLocalProxy'
,
"Controls whether in the remote extension host the local proxy configuration should be used. This setting only applies as a remote setting during [remote development](https://aka.ms/vscode-remote)."
)
,
:
true
}
,
}
}
,
{
:
'http'
,
:
15
,
:
localize
(
'httpConfigurationTitle'
,
"HTTP"
)
,
:
'object'
,
:
.
APPLICATION
,
:
{
'http.electronFetch'
:
{
:
'boolean'
,
default
:
false
,
:
localize
(
'electronFetch'
,
"Controls whether use of Electron's fetch implementation instead of Node.js' should be enabled. All local extensions will get Electron's fetch implementation for the global fetch API."
"The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
,
:
{
:
'http.proxy'
,
:
.
,
transform
:
=>
typeof
===
'string'
?
:
''
}
,
}
,
'http.proxyStrictSSL'
:
{
:
'boolean'
,
default
:
true
,
:
localize
(
'strictSSL'
,
"Controls whether the proxy server certificate should be verified against the list of supplied CAs. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
}
,
'http.proxyKerberosServicePrincipal'
:
{
:
'string'
,
:
localize
(
'proxyKerberosServicePrincipal'
,
"Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
,
:
{
:
'http.proxyKerberosServicePrincipal'
,
:
.
,
transform
:
=>
typeof
===
'string'
?
:
''
}
,
}
,
'http.noProxy'
:
{
:
'array'
,
:
{
:
'string'
}
,
:
localize
(
'noProxy'
,
"Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
,
:
{
:
'http.noProxy'
,
:
.
,
transform
:
=>
Array
.
isArray
(
)
?
:
[
]
}
,
}
,
'http.proxyAuthorization'
:
{
:
[
'null'
,
'string'
]
,
default
:
null
,
:
localize
(
'proxyAuthorization'
,
"The value to send as the `Proxy-Authorization` header for every network request. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
}
,
'http.proxySupport'
:
{
:
'string'
,
enum
:
[
'off'
,
'on'
,
'fallback'
,
'override'
]
,
:
[
localize
(
'proxySupportOff'
,
"Disable proxy support for extensions."
)
,
localize
(
'proxySupportOn'
,
"Enable proxy support for extensions."
)
,
localize
(
'proxySupportFallback'
,
"Enable proxy support for extensions, fall back to request options, when no proxy found."
)
,
localize
(
'proxySupportOverride'
,
"Enable proxy support for extensions, override request options."
)
,
]
,
default
:
'override'
,
:
localize
(
'proxySupport'
,
"Use the proxy support for extensions. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
}
,
'http.systemCertificates'
:
{
:
'boolean'
,
default
:
true
,
:
localize
(
'systemCertificates'
,
"Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
}
,
'http.systemCertificatesNode'
:
{
:
'boolean'
,
:
[
'experimental'
]
,
default
:
,
:
localize
(
'systemCertificatesNode'
,
"Controls whether system certificates should be loaded using Node.js built-in support. Reload the window after changing this setting. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
,
:
{
:
'auto'
}
}
,
'http.experimental.systemCertificatesV2'
:
{
:
'boolean'
,
:
[
'experimental'
]
,
default
:
false
,
:
localize
(
'systemCertificatesV2'
,
"Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implementation. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
)
,
:
true
}
,
'http.fetchAdditionalSupport'
:
{
:
'boolean'
,
default
:
true
,
:
localize
(
'fetchAdditionalSupport'
,
"Controls whether Node.js' fetch implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
,
'`#http.proxySupport#`'
,
'`#http.systemCertificates#`'
)
,
:
true
}
,
'http.webSocketAdditionalSupport'
:
{
:
'boolean'
,
default
:
true
,
:
localize
(
'webSocketAdditionalSupport'
,
"Controls whether the built-in WebSocket implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."
,
'`#http.useLocalProxyConfiguration#`'
,
'`#http.proxySupport#`'
,
'`#http.systemCertificates#`'
)
,
:
true
}
,
'http.experimental.networkInterfaceCheckInterval'
:
{
:
'number'
,
default
:
300
,
:
-
1
,
:
[
'experimental'
]
,
:
localize
(
'networkInterfaceCheckInterval'
,
"Controls the interval in seconds for checking network interface changes to invalidate the proxy cache. Set to -1 to disable. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately."