Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Persisted map of `${owner}/${repo}/${prNumber}` to the PR head SHA for which
* the user last requested a CI fix. Used to suppress the "Fix Checks" action
* until a new commit lands on the PR.
*/
const
STORAGE_KEY_FIX_REQUESTED
=
'sessions.ci.fixRequested'
;
export
class
GitHubPullRequestCIModelReferenceCollection
extends
ReferenceCollection<GitHubPullRequestCIModel>
{
private
readonly
:
;
constructor
(
:
,
@ILogService
private
readonly
:
,
@IStorageService
private
readonly
:
,
)
{
super
(
)
;
this
.
=
new
GitHubPRCIFetcher
(
)
;
}
protected
createReferencedObject
(
:
string
,
:
string
,
:
string
,
:
number
,
:
string
)
:
{
this
.
.
trace
(
`${TRACE_PREFIX} [GitHubPullRequestCIModelReferenceCollection][createReferencedObject] Creating CI model for ${key}`
)
;
return
new
GitHubPullRequestCIModel
(
,
,
,
,
this
.
,
this
.
,
this
.
)
;
}
protected
destroyReferencedObject
(
:
string
,
:
)
:
void
{
this
.
.
trace
(
`${TRACE_PREFIX} [GitHubPullRequestCIModelReferenceCollection][destroyReferencedObject] Disposing CI model for ${key}`
)
;
.
dispose
(
)
;
}
}
/**
* Reactive model for CI check status on a pull request head ref.
* Wraps fetcher data in observables and supports periodic polling.
*/
export
class
GitHubPullRequestCIModel
extends
Disposable
{
private
:
string
|
undefined
=
undefined
;
private
readonly
=
observableValue<readonly IGitHubCICheck[]>
(
this
,
[
]
)
;
readonly
:
<
readonly
[
]
>
=
this
.
;
private
readonly
=
observableValue<GitHubCIOverallStatus>
(
this
,
.
)
;
readonly
:
<
>
=
this
.
;
private
readonly
=
observableValue<boolean>
(
this
,
false
)
;
/**
* Whether the user has already requested a CI fix for this PR head SHA.
* Resets automatically once a new commit lands (a new model is created for
* the new head SHA) so the "Fix Checks" action surfaces again.
*/
readonly
:
<
boolean
>
=
this
.
;
private
:
Promise
<
void
>
|
undefined
=
undefined
;
private
=
0
;
private
readonly
:
;
/** `${owner}/${repo}/${prNumber}` — stable across commits to the same PR. */
private
readonly
:
string
;
constructor
(
readonly
:
string
,
readonly
:
string
,
readonly
:
number
,
readonly
:
string
,
private
readonly
:
,
private
readonly
:
,
private
readonly
:
,
)
{
super
(
)
;
this
.
=
`${owner}/${repo}/${prNumber}`
;
this
.
.
set
(
this
.
_readFixRequested
(
)
,
undefined
)
;
// Keep in sync with other windows/profiles that request a fix.
this
.
_register
(
this
.
.
onDidChangeValue
(
.
PROFILE
,
STORAGE_KEY_FIX_REQUESTED
,
this
.
)
(
(
)
=>
{
this
.
.
set
(
this
.
_readFixRequested
(
)
,
undefined
)
;
}
)
)
;
this
.
=
this
.
_register
(
new
RunOnceScheduler
(
(
)
=>
this
.
_poll
(
)
,
DEFAULT_POLL_INTERVAL_MS
)
)
;
}
/**
* Remember that the user requested a CI fix for the current head SHA so the
* "Fix Checks" action is suppressed until a new commit lands on the PR.
*/
markFixRequested
(
)
:
void
{
const
=
this
.
_readFixRequestedMap
(
)
;
.
set
(
this
.
,
this
.
)
;
this
.
.
store
(
STORAGE_KEY_FIX_REQUESTED
,
JSON
.
stringify
(
.
fromEntries
(
)
)
,
.
PROFILE
,
.
USER
)
;
this
.
.
set
(
true
,
undefined
)
;
}
private
_readFixRequested
(
)
:
boolean
{
return
this
.
_readFixRequestedMap
(
)
.
get
(
this
.
)
===
this
.
;
}
private
_readFixRequestedMap
(
)
:
<
string
,
string
>
{
const
=
this
.
.
get
(
STORAGE_KEY_FIX_REQUESTED
,
.
PROFILE
)
;
if
(
!
)
{
return
new
Map
(
)
;
}
try
{
const
=
JSON
.
parse
(
)
;
if
(
&&
typeof
===
'object'
)
{
return
new
Map
(
.
entries
(
)
.
filter
(
(
)
:
is
[
string
,
string
]
=>
typeof
[
1
]
===
'string'
)
)
;
}
}
catch
{
// Ignore malformed storage
}
return
new
Map
(
)
;
}
/**
* Refresh all CI check data.
*/
refresh
(
=
false
)
:
Promise
<
void
>
{
if
(
&&
this
.
)
{
return
this
.
.
then
(
(
)
=>
this
.
refresh
(
true
)
)
;
}
if
(
)
{
return
this
.
_refresh
(
)
;
}
if
(
!
this
.
)
{
this
.
=
this
.
_refresh
(
)
.
finally
(
(
)
=>
{
this
.
=
undefined
;
}
)
;
}
return
this
.
;
}
private
async
_refresh
(
)
:
Promise
<
void
>
{
this
.
.
trace
(
`${TRACE_PREFIX} [CIModel] Refreshing CI for ${this.owner}/${this.repo}#${this.prNumber}@${this.headSha} (checksEtag ${this._checksEtag ??'none'})`
)
;
try
{
const
=
await
this
.
.
getCheckRuns
(
this
.
,
this
.
,
this
.
,
this
.
)
;
if
(
.
===
200
&&
.
)
{
this
.
=
.
;
this
.
.
set
(
.
,
undefined
)
;
this
.
.
set
(
computeOverallCIStatus
(
.
)
,
undefined
)
;
}
this
.
.
trace
(
`${TRACE_PREFIX} [CIModel] Refreshed CI for ${this.owner}/${this.repo}#${this.prNumber}@${this.headSha}: status ${response.statusCode}, ${this._checks.get().length} check(s), overallStatus ${this._overallStatus.get()}`
)
;
}
catch
(
)
{
this
.
.
error
(
`${TRACE_PREFIX}${LOG_PREFIX} Failed to refresh CI checks for ${this.owner}/${this.repo}#${this.prNumber}@${this.headSha}:`
,
)
;
}
}
/**
* Get annotations (structured logs) for a specific check run.
*/
async
getCheckRunAnnotations
(
:
number
)
:
Promise
<
string
>
{
return
this
.
.
getCheckRunAnnotations
(
this
.
,
this
.
,
)
;
}
/**
* Rerun a failed check by extracting the workflow run ID from its details URL
* and calling the GitHub Actions rerun-failed-jobs API, then refresh status.
*/
async
rerunFailedCheck
(
:
)
:
Promise
<
void
>
{
const
=
parseWorkflowRunId
(
.
)
;
if
(
!
)
{
this
.
.
warn
(
`${LOG_PREFIX} Cannot rerun check "${check.name}": no workflow run ID found in detailsUrl`
)
;
return
;
}
await
this
.
.
rerunFailedJobs
(
this
.
,
this
.
,
)
;
await
this
.
refresh
(
true
)
;
}
/**
* Start periodic polling. Each cycle refreshes CI check data.
*/
startPolling
(
:
number
=
DEFAULT_POLL_INTERVAL_MS
)
:
{
if
(
this
.
++
===
0
)
{
this
.
.
trace
(
`${TRACE_PREFIX} [CIModel] Start polling ${this.owner}/${this.repo}#${this.prNumber}@${this.headSha} every ${intervalMs}ms`
)
;
this
.
.
schedule
(
)
;
}
return
toDisposable
(
(
)
=>
{
if
(
this
.
.
)
{
return
;
}
if
(
--
this
.
===
0
)
{
this
.
.
cancel
(
)
;
}
}
)
;
}
private
async
_poll
(
)
:
Promise
<
void
>
{
this
.
.
trace
(
`${TRACE_PREFIX} [CIModel] Poll cycle for ${this.owner}/${this.repo}#${this.prNumber}@${this.headSha}`
)
;
await
this
.
refresh
(
)
;
// Re-schedule if not disposed (RunOnceScheduler is one-shot)
if
(
!
this
.
.
&&
this
.
>
0
)
{
this
.
.
schedule
(
)
;
}
}
dispose
(
)
:
void
{
super
.
dispose
(
)
;
}
}
/**
* Extract the GitHub Actions workflow run ID from a check run's details URL.
* URLs follow the pattern: `https://github.com/{owner}/{repo}/actions/runs/{run_id}/job/{job_id}`
*/