Это 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{ LRUCache }from'../../../../base/common/map.js';import{ createDecorator }from'../../../instantiation/common/instantiation.js';import{ ILogService }from'../../../log/common/log.js';import{ IAgentHostGitHubEndpointService }from'../agentHostGitHubEndpointService.js';exporttypeFetchFunction=typeof globalThis.fetch;/**
* Successful result of {@link IAgentHostOctoKitService.createPullRequest}.
*
* Mirrors the `CreatedPullRequest` type returned by `OctoKitService` in
* `extensions/copilot/src/platform/github/common/githubService.ts` so the
* shapes line up if/when the two are ported together.
*/exportinterfaceCreatedPullRequest{readonly url:
nodeId
createdAt
html_url
node_id
created_at
state
head sha
item GitHubPullRequestResponseItem CreatedPullRequest
html_url itemhtml_url
item
node_id itemnode_id
created_at itemcreated_at
createdAt created_at Datecreated_at
html_url
url html_url
nodeId node_id node_id
createdAt NumbercreatedAt createdAt
title
body
title
body
data
statusCode
etag
_serviceBrand
owner
repo
title
body
head
base
draft
token
signal AbortSignal
CreatedPullRequest
owner repo branch token signal AbortSignal headOwner CreatedPullRequest
owner repo sha token signal AbortSignal CreatedPullRequest
owner repo token signal AbortSignal GitHubIssueOrPullRequest
pullRequestId mergeMethod AutoMergeMethod token signal AbortSignal
IAgentHostOctoKitService
routeSlug method statusCode responseText
method statusCode routeSlug responseText
body message responseText
message bodymessage
message message
_serviceBrand
_fetch FetchFunction
pullRequestSearchCache
fetchFn FetchFunction
_logService ILogService
_endpoint IAgentHostGitHubEndpointService
_fetch fetchFn globalThisfetch
owner
repo
title
body
head
base
draft
token
signal AbortSignal
CreatedPullRequest
response
token
signal
title body head base draft
responsedata
html_url responsedatahtml_url
html_url
node_id responsedatanode_id
url html_url nodeId node_id node_id
owner repo branch token signal AbortSignal headOwner owner CreatedPullRequest
routeSlug
items routeSlug token signal
items
owner repo sha token signal AbortSignal CreatedPullRequest
routeSlug
items routeSlug token signal
itemslength
_logService
atHead itemsitem itemheadsha sha
open atHeaditem itemstate
candidates openlength open atHead
candidateslength candidates
routeSlug token signal AbortSignal GitHubPullRequestResponseItem
cacheKey
cached pullRequestSearchCachecacheKey
response routeSlug token signal cachedetag
responsestatusCode
cacheditems
items responsedata responsedata
responseetag
pullRequestSearchCachecacheKey etag responseetag items
items
owner repo token signal AbortSignal GitHubIssueOrPullRequest
response
token
signal
title responsedatatitle
body responsedatabody
title body body
title body body
pullRequestId mergeMethod AutoMergeMethod token signal AbortSignal
pullRequestId mergeMethod token signal
routeSlug
method
token
signal AbortSignal
body Record
etag
IGitHubApiResponse
url
headers Record
etag
headers etag
body
headers
response Response
response url
method
headers
body body body
signal
err
signalaborted
err
_logService err
err
rateLimitHeader responseheaders
rateLimitHeader
rateLimitRemaining rateLimitHeader
rateLimitRemaining rateLimitRemaining
_logService
statusCode responsestatus
responseETag responseheaders
statusCode
statusCode
data statusCode etag responseETag
responseok
errorText response
routeSlug method statusCode errorText
data statusCode etag
errorDetail errorText
_logService
data response
data statusCode etag responseETag
err
_logService err
err
query
variables Record
token
signal AbortSignal
url _endpoint
headers Record
response Response
response url
method
headers
body query variables
signal
err
signalaborted
err
_logService err
err
responseok
errorText response
errorDetail errorText
_logService
json data errors ReadonlyArray message
json response
err
_logService err
err
jsonerrors jsonerrorslength
message jsonerrorserror
errormessage
errormessage
error
_logService
jsondata
errorText
normalized errorText
normalized
normalizedlength
normalized
value
value
str value value value
parsed str
parsed parsed
/**
* Merge strategy used when enabling auto-merge on a pull request.
* Mirrors the GitHub GraphQL `PullRequestMergeMethod` enum.
*/
export
type
AutoMergeMethod
=
'MERGE'
|
'SQUASH'
|
'REBASE'
;
interface
GitHubPullRequestResponseItem
{
readonly
number
?
:
unknown
;
readonly
?
:
unknown
;
readonly
?
:
unknown
;
readonly
?
:
unknown
;
readonly
?
:
unknown
;
readonly
?
:
{
readonly
?
:
unknown
}
;
}
function
toCreatedPullRequest
(
:
|
undefined
)
:
|
undefined
{
const
=
?.
;
const
number
=
?.
number
;
const
=
?.
;
const
=
?.
;
const
=
typeof
===
'string'
?
.
parse
(
)
:
undefined
;
return
typeof
===
'string'
&&
typeof
number
===
'number'
?
{
number
,
:
,
:
typeof
===
'string'
?
:
undefined
,
...
(
!==
undefined
&&
.
isFinite
(
)
?
{
}
:
{
}
)
,
}
:
undefined
;
}
interface
GitHubIssueOrPullRequestResponseItem
{
readonly
?
:
unknown
;
readonly
?
:
unknown
;
}
export
interface
GitHubIssueOrPullRequest
{
readonly
:
string
;
readonly
:
string
;
}
export
interface
IGitHubApiResponse<T>
{
readonly
:
T
|
undefined
;
readonly
:
number
;
readonly
?
:
string
;
}
/**
* Minimal GitHub REST client living in the agent-host process.
*
* The agent host runs headless and has no access to the workbench
* `IOctoKitService` / Octokit / VS Code auth providers. This service is a
* deliberately small re-implementation of the bits we need, modelled on
* `OctoKitService` from the Copilot extension so the API surface is
* familiar. Only operations the agent host actually needs are exposed —
* extend this interface as new changeset operations are added.
*
* The caller is responsible for supplying a GitHub OAuth token with the
* scopes required by the operation (e.g. `repo` for {@link createPullRequest}).
* Tokens are typically obtained from the agent host's
* `authenticate(resource, token)` token store, which the workbench pushes
* on session create via the same channel used for `ICopilotApiService`.
*/
export
interface
IAgentHostOctoKitService
{
readonly
:
undefined
;
/**
* Creates a pull request on github.com.
*
* Mirrors `OctoKitService.createPullRequest` from the Copilot extension.
* Throws on non-2xx responses or malformed payloads.
*/
createPullRequest
(
:
string
,
:
string
,
:
string
,
:
string
,
:
string
,
:
string
,
:
boolean
,
:
string
,
:
,
)
:
Promise
<
>
;
/** Finds the most recently updated pull request for `headOwner:branch`, if any. */
findPullRequestByHeadBranch
(
:
string
,
:
string
,
:
string
,
:
string
,
:
,
?
:
string
)
:
Promise
<
|
undefined
>
;
/**
* Finds the pull request whose head commit is exactly `sha`, if any.
*
* Unlike {@link findPullRequestByHeadBranch} this does not depend on the
* local branch carrying the same name as the remote head branch, so it also
* resolves branches checked out from a pull request head under a different
* name or pushed with an explicit refspec.
*/
findPullRequestByHeadSha
(
:
string
,
:
string
,
:
string
,
:
string
,
:
)
:
Promise
<
|
undefined
>
;
/** Fetches the title and body of an issue or pull request. */
getIssueOrPullRequest
(
:
string
,
:
string
,
number
:
number
,
:
string
,
:
)
:
Promise
<
>
;
/**
* Enables auto-merge on a pull request so GitHub merges it automatically
* once all required reviews and status checks pass.
*
* Issues the GraphQL `enablePullRequestAutoMerge` mutation. `pullRequestId`
* is the pull request's GraphQL global node id (see
* {@link CreatedPullRequest.nodeId}). Throws on GraphQL or transport errors,
* including when the repository does not allow the requested merge method or
* auto-merge is not enabled for the repository.
*/
enablePullRequestAutoMerge
(
:
string
,
:
,
:
string
,
:
)
:
Promise
<
void
>
;
}
export
const
=
createDecorator<IAgentHostOctoKitService>
(
'agentHostOctoKitService'
)
;
const
GITHUB_API_VERSION
=
'2022-11-28'
;
const
MAX_ERROR_RESPONSE_BODY_LENGTH
=
500
;
/** Page size, and therefore upper bound, for the pull requests read per commit. */
/**
* Cached pull request listings keyed by route, with the ETag that validated
* them. The items are kept alongside the ETag because a `304` response
* carries no body: without them a revalidated route would look empty.
*/