Это 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{ generateUuid }from'../../../../base/common/uuid.js';import{ ArtifactServerToolName,LEGACY_ARTIFACT_SERVER_TOOL_NAMES}from'../../common/serverToolNames.js';import{ parseSessionArtifactInput, SessionArtifactCollection }from'../../common/sessionArtifactCollection.js';import{ readSessionArtifacts,SESSION_ARTIFACT_TYPES, SessionArtifactType, withSessionArtifacts,typeISessionArtifact}from'../../common/sessionArtifacts.js';import{ parseRequiredSessionUriFromChatUri,typeToolDefinition}from'../../common/state/sessionState.js';
AgentHostStateManager
IServerToolDisplay IServerToolExecutionContext IServerToolGroup
addArtifactInputSchema ToolDefinition
type
properties
type
type
description
label type description
isArtifact
type
description
link type description
uri type description
commitHash type description
required
removeArtifactInputSchema ToolDefinition
type
properties
id type description
required
listArtifactsInputSchema ToolDefinition
type
properties
artifactServerToolDefinitions ToolDefinition
name ArtifactServerToolNameAddArtifactOrReference
title
description
inputSchema addArtifactInputSchema
annotations readOnlyHint
name ArtifactServerToolNameRemoveArtifactOrReference
title
description
inputSchema removeArtifactInputSchema
annotations readOnlyHint destructiveHint
name ArtifactServerToolNameListArtifactsAndReferences
title
description
inputSchema listArtifactsInputSchema
annotations readOnlyHint
session artifacts ISessionArtifact
isArtifact
isArtifact
artifact ISessionArtifact
value artifactlink artifacturi artifactcommitHash
_session
_stateManager AgentHostStateManager
context IServerToolExecutionContext
_session contextchatUri
SessionArtifactCollection
_stateManager_session_meta
artifacts ISessionArtifact accessor IArtifactServerToolAccessor
meta _stateManager_session_meta
_stateManager_session meta artifacts
accessor_session artifacts
accessor IArtifactServerToolAccessor IServerToolGroup
definitions artifactServerToolDefinitions
legacyToolNames
accessor
toolName args result IServerToolDisplay
toolName
ArtifactServerToolNameAddArtifactOrReference
label isArtifact args label isArtifact
noun isArtifact isArtifact
suffix label labellength
displayName isArtifact isArtifact
invocationMessage
pastTenseMessage
ArtifactServerToolNameRemoveArtifactOrReference
text resulttext
pastTenseMessage text
text
displayName
invocationMessage
pastTenseMessage pastTenseMessage
ArtifactServerToolNameListArtifactsAndReferences
displayName invocationMessage pastTenseMessage
stateManager context toolName rawArgs
accessor
artifacts stateManager context
toolName
ArtifactServerToolNameAddArtifactOrReference
input rawArgs ArtifactServerToolNameAddArtifactOrReference
result artifactsinput generateUuid
resultadded
artifactsresultartifacts accessor
ArtifactServerToolNameRemoveArtifactOrReference
id rawArgs id id
id idlength
result artifactsid
resultremoved
artifactsresultartifacts accessor
message resultremovedisArtifact
ArtifactServerToolNameListArtifactsAndReferences
current artifactsartifacts
currentlength
currentdescribeArtifact
'The kind of artifact or reference. Use `resource` only when no other kind applies.'
,
}
,
:
{
:
'string'
,
:
'Short label shown to the user.'
}
,
:
{
:
'boolean'
,
:
'Required. `true` for an artifact — something this session produced, such as a pull request or issue it opened, a plan file it wrote outside the workspace, or another side effect of its work. `false` for a reference — something it did not produce but the user should look at, such as the pull request or commit that introduced a bug, or a website that matters for the task.'
,
}
,
:
{
:
'string'
,
:
'URL of the pull request, issue, commit or website. Required for those kinds.'
}
,
:
{
:
'string'
,
:
'Absolute URI including its scheme. For a local file, pass a file URI such as `file:///C:/path/to/file`, not a plain file system path such as `C:\\path\\to\\file`. Required for the `file` and `resource` kinds.'
}
,
:
{
:
'string'
,
:
'The commit hash. Required for the `commit` kind.'
}
,
}
,
:
[
'type'
,
'label'
,
'isArtifact'
]
,
}
;
const
:
[
'inputSchema'
]
=
{
:
'object'
,
:
{
:
{
:
'string'
,
:
`The id returned by \`${ArtifactServerToolName.AddArtifactOrReference}\` or \`${ArtifactServerToolName.ListArtifactsAndReferences}\`.`
}
,
}
,
:
[
'id'
]
,
}
;
const
:
[
'inputSchema'
]
=
{
:
'object'
,
:
{
}
,
}
;
export
const
:
[
]
=
[
{
:
.
,
:
'Add Artifact or Reference'
,
:
'Record an artifact or a reference so it is surfaced next to the chat input. An artifact is something this session produced that is not just an ordinary workspace edit: a pull request or issue it opened, a plan or report file it wrote outside the workspace, or another side effect of its work. A reference is something the session did not produce but the user should look at because of this task: the pull request or commit that introduced a bug, an issue it investigated, or a website worth reading. Set `isArtifact` accordingly. Do not record routine files you merely edited.'
,
:
,
:
{
:
false
}
,
}
,
{
:
.
,
:
'Remove Artifact or Reference'
,
:
'Remove an artifact or reference from this session by id.'
,
:
,
:
{
:
false
,
:
true
}
,
}
,
{
:
.
,
:
'List Artifacts and References'
,
:
'List the artifacts and references recorded on this session, with their ids.'
,
:
,
:
{
:
true
}
,
}
,
]
;
/** Host services the artifact tools need beyond the session state. */
export
interface
IArtifactServerToolAccessor
{
/** Whether the artifact tools are advertised and executable. */
readonly
isEnabled
:
(
)
=>
boolean
;
/** Persists a session's artifacts and references so they survive a host restart. */
readonly
persist
:
(
:
string
,
:
readonly
[
]
)
=>
void
;
}
/** The noun an entry is described by, so every message names what it acted on. */
/**
* Reads, mutates and republishes the artifacts and references of the session
* that owns the executing chat. They live on the session's `_meta` bag, so a
* change reaches subscribed clients through the regular action envelope.
*/
class
SessionArtifacts
{
private
readonly
:
string
;
constructor
(
private
readonly
:
,
:
,
)
{
this
.
=
parseRequiredSessionUriFromChatUri
(
.
)
;
}
read
(
)
:
{
return
new
SessionArtifactCollection
(
readSessionArtifacts
(
this
.
.
getSessionState
(
this
.
)
?.
)
)
;
}
write
(
:
readonly
[
]
,
:
)
:
void
{
const
=
this
.
.
getSessionState
(
this
.
)
?.
;
this
.
.
setSessionMeta
(
this
.
,
withSessionArtifacts
(
,
)
)
;
.
persist
(
this
.
,
)
;
}
}
export
function
createArtifactServerToolGroup
(
?
:
)
:
{
return
{
:
,
:
LEGACY_ARTIFACT_SERVER_TOOL_NAMES
,
isEnabled
(
)
:
boolean
{
return
?.
isEnabled
(
)
===
true
;
}
,
getDisplay
(
,
,
)
:
|
undefined
{
switch
(
)
{
case
.
:
{
const
{
,
}
=
(
??
{
}
)
as
{
?
:
unknown
;
?
:
unknown
}
;
// The flag is only trusted for display when the agent actually sent
// a boolean; `execute` rejects anything else.
const
=
typeof
===
'boolean'
?
entryNoun
(
)
:
'artifact or reference'
;
const
=
typeof
===
'string'
&&
.
>
0
?
` "${label}"`
:
''
;
return
{
:
typeof
===
'boolean'
?
(
?
'Add Artifact'
:
'Add Reference'
)
:
'Add Artifact or Reference'
,
:
`Add ${noun}${suffix}`
,
:
`Added ${noun}${suffix}`
,
}
;
}
case
.
:
{
// Only the result says whether an artifact or a reference was removed.
`Invalid ${ArtifactServerToolName.RemoveArtifactOrReference} input: id must be a non-empty string.`
)
;
}
const
=
.
read
(
)
.
remove
(
)
;
if
(
!
.
)
{
return
`No artifact or reference with id ${id}.`
;
}
.
write
(
.
,
)
;
const
=
.
.
?
REMOVED_ARTIFACT_MESSAGE
:
REMOVED_REFERENCE_MESSAGE
;
return
`${message}: ${describeArtifact(result.removed)}`
;
}
case
.
:
{
const
=
.
read
(
)
.
;
return
.
===
0
?
'No artifacts or references recorded for this session.'
:
.
map
(
)
.
join
(
'\n'
)
;
}
default
:
throw
new
Error
(
`Unknown artifact tool: ${toolName}`
)
;
}
}
,
}
;
}
/**
* The instruction appended to every agent's host instructions while the
* artifact tools are enabled.
*/
export
const
ARTIFACT_TOOLS_INSTRUCTION
=
`Record the notable results of your work with \`${ArtifactServerToolName.AddArtifactOrReference}\` (types: ${SESSION_ARTIFACT_TYPES.join(', ')}; use \`${SessionArtifactType.Resource}\` when nothing else fits) so they are surfaced next to the chat input. Pass \`isArtifact: true\` for an artifact — something this session produced beyond ordinary workspace edits, such as a pull request or issue you opened, a plan or report file you wrote outside the workspace, or another side effect of your work. Pass \`isArtifact: false\` for a reference — something you did not produce but the user should look at because of this task, such as the pull request or commit that introduced a bug, an issue you investigated, or a website worth reading. Record each one once, and do not record routine files you merely edited or commits you create unless the user asks for them.`