Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
/**
* Options for controlling authentication behavior in OctoKit service methods.
*/
export
interface
AuthOptions
{
/**
* If provided, prompts the user to sign in if no authentication token is available,
* displaying the given detail message to explain why authentication is needed.
* If undefined, fails silently without prompting.
*/
readonly
?
:
{
readonly
:
string
}
;
}
export
type
IGetRepositoryInfoResponseData
=
[
'GET /repos/{owner}/{repo}'
]
[
'response'
]
[
'data'
]
;
export
const
=
createServiceIdentifier<IGithubRepositoryService>
(
'IGithubRepositoryService'
)
;
export
const
=
createServiceIdentifier<IOctoKitService>
(
'IOctoKitService'
)
;
export
const
=
1682102
;
export
type
GithubRepositoryItem
=
{
:
string
;
:
string
;
:
string
;
:
'file'
|
'dir'
;
}
;
export
interface
IGithubRepositoryService
{
:
undefined
;
/**
* Returns whether the given repository is available via GitHub APIs.
* @paramorg The GitHub organization
* @paramrepo The GitHub repository
*/
isAvailable
(
:
string
,
:
string
)
:
Promise
<
boolean
>
;
getRepositoryInfo
(
:
string
,
:
string
)
:
Promise
<
>
;
getRepositoryItems
(
:
string
,
:
string
,
:
string
)
:
Promise
<
[
]
>
;
getRepositoryItemContent
(
:
string
,
:
string
,
:
string
)
:
Promise
<
|
undefined
>
;
}
export
interface
IOctoKitUser
{
:
number
;
:
string
;
:
string
|
null
;
:
string
;
}
/**
* Result of checking if Copilot cloud agent is enabled for a repository.
*/
export
interface
CCAEnabledResult
{
/**
* Whether the cloud agent is enabled. `undefined` if unable to determine.
*/
:
boolean
|
undefined
;
/**
* The HTTP status code from the /enabled response. Known values: 401, 403, 422.
* Unexpected values (e.g. 429 rate-limit, 5xx) are also propagated for telemetry.
*/
?
:
number
;
}
export
interface
CustomAgentListItem
{
:
string
;
:
number
;
:
string
;
:
number
;
:
string
;
:
string
;
:
string
;
:
string
[
]
;
:
string
;
?
:
string
;
?
:
<
string
,
string
>
;
?
:
string
;
?
:
string
;
?
:
string
;
?
:
boolean
;
?
:
boolean
;
'mcp-servers'
?
:
{
[
:
string
]
:
{
:
string
;
?
:
string
;
?
:
string
[
]
;
?
:
string
[
]
;
?
:
{
[
:
string
]
:
string
}
;
?
:
{
[
:
string
]
:
string
}
;
}
;
}
;
}
export
interface
CustomAgentListOptions
{
?
:
'github-copilot'
|
'vscode'
;
?
:
boolean
;
?
:
boolean
;
?
:
(
'repo'
|
'org'
|
'enterprise'
)
[
]
;
}
export
interface
CustomAgentListOptions
{
?
:
'github-copilot'
|
'vscode'
;
?
:
boolean
;
?
:
boolean
;
?
:
(
'repo'
|
'org'
|
'enterprise'
)
[
]
;
}
export
interface
CustomAgentDetails
extends
CustomAgentListItem
{
:
string
;
}
export
interface
PullRequestFile
{
:
string
;
:
'added'
|
'removed'
|
'modified'
|
'renamed'
|
'copied'
|
'changed'
|
'unchanged'
;
:
number
;
:
number
;
:
number
;
?
:
string
;
?
:
string
;
?
:
string
;
}
/**
* Result of comparing two refs via the GitHub REST compare API. `baseSha`/`headSha` are
* the resolved commit SHAs that bound the {@link files} diff (base is the merge base).
*/
export
interface
RepositoryComparison
{
readonly
:
string
;
readonly
:
string
;
readonly
:
readonly
[
]
;
}
export
interface
CreatedPullRequest
{
number
:
number
;
:
string
;
}
interface
GitHubContentResponse
{
?
:
string
;
?
:
string
;
?
:
string
;
}
interface
GitHubBlobResponse
{
:
string
;
:
string
;
}
export
const
enum
{
,
,
,
}
export
class
PermissiveAuthRequiredError
extends
Error
{
constructor
(
)
{
super
(
'Permissive authentication is required'
)
;
this
.
=
'PermissiveAuthRequiredError'
;
}
}
export
interface
IOctoKitService
{
:
undefined
;
/**
* @returns The currently authenticated user or undefined if there isn't one
*/
getCurrentAuthedUser
(
)
:
Promise
<
|
undefined
>
;
/**
* Returns the list of Copilot pull requests for a given user on a specific repo.
* @paramauthOptions - Authentication options. By default, uses silent auth and returns empty array if not authenticated.
*/
getOpenPullRequestsForUser
(
:
string
,
:
string
,
:
)
:
Promise
<
[
]
>
;
/**
* Creates a pull request.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramtitle The pull request title
* @parambody The pull request body
* @paramhead The source branch name
* @parambase The target branch name
* @paramdraft Whether to create the PR as a draft
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
*/
createPullRequest
(
:
string
,
:
string
,
:
string
,
:
string
,
:
string
,
:
string
,
:
boolean
,
:
)
:
Promise
<
>
;
/**
* Gets pull request from global id.
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
*/
getPullRequestFromGlobalId
(
:
string
,
:
)
:
Promise
<
|
null
>
;
/**
* Gets the list of custom agents available for a repository.
* This includes both repo-level and org/enterprise-level custom agents.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramoptions Optional filtering options:
* - targetPlatform: Only include agents for the specified platform.
* - excludeInvalidConfigs: Exclude agents with invalid configurations.
* - deduplicate: Remove duplicate agents from the result.
* - source: Filter agents by their source (repo, org, enterprise).
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @returns An array of custom agent list items with basic metadata
*/
getCustomAgents
(
:
string
,
:
string
,
:
,
:
)
:
Promise
<
[
]
>
;
/**
* Gets the full configuration for a specific custom agent.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramagentName The name of the custom agent
* @paramversion Optional git ref (branch, tag, or commit SHA) to fetch from
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @returns The complete custom agent configuration including the prompt
*/
getCustomAgentDetails
(
:
string
,
:
string
,
:
string
,
:
string
,
:
)
:
Promise
<
|
undefined
>
;
/**
* Gets the list of files changed in a pull request.
* @paramowner The repository owner
* @paramrepo The repository name
* @parampullNumber The pull request number
* @paramauthOptions - Authentication options. By default, uses silent auth and returns empty array if not authenticated.
* @returns An array of changed files with their metadata
*/
getPullRequestFiles
(
:
string
,
:
string
,
:
number
,
:
)
:
Promise
<
[
]
>
;
/**
* Compares two refs via the GitHub REST compare API
* (`GET /repos/{owner}/{repo}/compare/{base}...{head}`), returning the changed files plus
* the resolved merge-base and head commit SHAs. Used to surface file changes for cloud
* tasks that pushed a branch but have no pull request yet.
* @paramauthOptions - Authentication options. By default, uses silent auth and returns undefined if not authenticated.
*/
compareCommits
(
:
string
,
:
string
,
:
string
,
:
string
,
:
)
:
Promise
<
|
undefined
>
;
/**
* Resolves a repository's `{owner, name}` from its numeric database id via
* `GET /repositories/{id}`. Used to recover repo identity for Task API payloads that only
* carry `repository.id` (no name-with-owner).
* @paramauthOptions - Authentication options. By default, uses silent auth and returns undefined if not authenticated or not found.
*/
getRepositoryById
(
:
number
,
:
)
:
Promise
<
{
:
string
;
:
string
}
|
undefined
>
;
/**
* Closes a pull request.
* @paramowner The repository owner
* @paramrepo The repository name
* @parampullNumber The pull request number
* @paramauthOptions - Authentication options. By default, uses silent auth and returns false if not authenticated.
* @returns A promise that resolves to true if the PR was successfully closed
*/
closePullRequest
(
:
string
,
:
string
,
:
number
,
:
)
:
Promise
<
boolean
>
;
/**
* Finds a pull request by its head branch name in a given repository.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramheadBranch The head branch name to search for
* @paramauthOptions - Authentication options. By default, uses silent auth and returns undefined if not authenticated.
* @returns The matching pull request or undefined if not found
*/
findPullRequestByHeadBranch
(
:
string
,
:
string
,
:
string
,
:
)
:
Promise
<
|
undefined
>
;
/**
* Get file content from a specific commit.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramref The commit SHA, branch name, or tag
* @parampath The file path within the repository
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @returns The file content as a string
*/
getFileContent
(
:
string
,
:
string
,
:
string
,
:
string
,
:
)
:
Promise
<
string
>
;
/**
* Gets the list of organizations that the authenticated user belongs to.
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @parampageSize - Number of organizations to fetch per page (max and default: 100)
* @returns An array of organization logins
*/
getUserOrganizations
(
:
,
?
:
number
)
:
Promise
<
string
[
]
>
;
/**
* Checks if the authenticated user is a member of a specific organization.
* This makes a direct API call and avoids pagination issues with getUserOrganizations.
* @paramorg The organization login to check membership for
* @paramauthOptions - Authentication options. By default, uses silent auth.
* @returns True if the user is a member, false otherwise
*/
isUserMemberOfOrg
(
:
string
,
:
)
:
Promise
<
boolean
>
;
/**
* Gets the list of repositories for an organization.
* @paramorg The organization name
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @parampageSize - Number of repositories to fetch per page (max and default: 100)
* @returns An array of repository names
*/
getOrganizationRepositories
(
:
string
,
:
,
?
:
number
)
:
Promise
<
string
[
]
>
;
/**
* Gets the custom instructions prompt for an organization.
* @paramorgLogin The organization login
* @returns The prompt string or undefined if not available
*/
getOrgCustomInstructions
(
:
string
,
:
)
:
Promise
<
string
|
undefined
>
;
/**
* Gets the list of repositories the authenticated user has access to.
* This includes repositories the user owns, collaborates on, and has access to through organization membership.
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @paramquery - Optional search query to filter repositories by name.
* @returns An array of repositories with owner/name format
*/
getUserRepositories
(
:
,
?
:
string
)
:
Promise
<
{
:
string
;
:
string
}
[
]
>
;
searchIssuesAndPullRequests
(
:
string
,
:
)
:
Promise
<
[
]
>
;
/**
* Gets the list of repositories the authenticated user has recently committed to.
* Uses the GitHub Events API to find repositories from recent PushEvent activity.
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @returns An array of repositories with owner/name format, ordered by most recent commit
*/
getRecentlyCommittedRepositories
(
:
)
:
Promise
<
{
:
string
;
:
string
}
[
]
>
;
/**
* Gets the list of available models for the Copilot coding agent.
* Returns an empty array if the user doesn't have access to the model picker
* (e.g., Copilot Business or Enterprise users before rollout).
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @returns An array of available models. The first model is always 'Auto' and should be the default.
*/
getCopilotAgentModels
(
:
)
:
Promise
<
[
]
>
;
/**
* Gets the list of assignable actors (users/bots) for a repository.
* This is used to check if partner agents like Copilot are available for assignment.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramauthOptions - Authentication options. By default, uses silent auth and throws {@link PermissiveAuthRequiredError} if not authenticated.
* @returns An array of assignable actors with their login names
*/
getAssignableActors
(
:
string
,
:
string
,
:
)
:
Promise
<
[
]
>
;
/**
* Checks if the Copilot cloud agent is enabled for a repository.
* @paramowner The repository owner
* @paramrepo The repository name
* @paramauthOptions - Authentication options. By default, uses silent auth.
* @returns An object indicating enabled status and status code if disabled.
* - 200: enabled = true
* - 401: enabled = false, statusCode = 401
* - 403: enabled = false, statusCode = 403
* - 422: enabled = false, statusCode = 422
* - Other errors: enabled = undefined
*/
isCCAEnabled
(
:
string
,
:
string
,
:
)
:
Promise
<
>
;
getGitHubOutageStatus
(
)
:
Promise
<
>
;
}
export
interface
GitHubIssueSearchItem
{
readonly
number
:
number
;
readonly
:
string
;
readonly
:
string
;
readonly
:
string
;
readonly
:
string
;
readonly
:
boolean
;
}
/**
* The same as {@link OctoKitService} but doesn't require the AuthService.
* This is because we want to call certain Octokit method inside the Authservice and must
* avoid a circular dependency.
* Note: Only OctoKitService is exposed on the accessor to avoid confusion.
*/
export
class
BaseOctoKitService
{
private
static
readonly
=
5
*
60
*
1000
;
// 5 minutes
private
:
{
:
;
:
number
}
|
undefined
;
private
static
readonly
=
5
*
60
*
1000
;
// 5 minutes
private
:
{
:
string
;
:
string
;
:
number
}
|
undefined
;
constructor
(
protected
readonly
:
,
protected
readonly
:
,
protected
readonly
:
,
protected
readonly
:
)
{
}
async
getCurrentAuthedUserWithToken
(
:
string
)
:
Promise
<
|
undefined
>
{
return
this
.
_makeGHAPIRequest
(
'user'
,
'GET'
,
,
undefined
,
undefined
,
'github-rest-get-user'
)
;
}
async
getGitHubOutageStatus
(
)
:
Promise
<
>
{
const
=
.
now
(
)
;
if
(
this
.
&&
(
-
this
.
.
)
<
.
)
{
return
this
.
.
;
}
try
{
// See docs at https://www.githubstatus.com/api/
const
=
await
this
.
.
fetch
(
'https://www.githubstatus.com/api/v2/status.json'
,
{
:
'GET'
,
:
'github-status'
}
)
;
const
=
await
.
json
(
)
;
const
=
?.
?.
;
let
:
;
switch
(
)
{
case
'none'
:
=
.
;
break
;
case
'minor'
:
=
.
;
break
;
case
'major'
:
=
.
;
break
;
case
'critical'
:
=
.
;
break
;
default
:
=
.
;
break
;
}
this
.
=
{
:
,
:
}
;
return
;
}
catch
{
// Cache the failure as None so callers don't re-attempt on every invocation