Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
'Tracks item deletion in the Agent Customizations editor.'
;
}
;
//#endregion
//#region Editor Registration
.
as<IEditorPaneRegistry>
(
.
)
.
registerEditorPane
(
.
create
(
,
AI_CUSTOMIZATION_MANAGEMENT_EDITOR_ID
,
localize
(
'aiCustomizationManagementEditor'
,
"Agent Customizations Editor"
)
)
,
[
// Note: Using the class directly since we use a singleton pattern
new
SyncDescriptor
(
as
unknown
as
{
new
(
)
:
}
)
]
)
;
//#endregion
//#region Editor Serializer
class
AICustomizationManagementEditorInputSerializer
implements
IEditorSerializer
{
canSerialize
(
:
)
:
boolean
{
return
instanceof
AICustomizationManagementEditorInput
;
}
serialize
(
:
)
:
string
{
return
''
;
}
deserialize
(
:
)
:
{
return
.
getOrCreate
(
)
;
}
}
.
as<IEditorFactoryRegistry>
(
.
)
.
registerEditorSerializer
(
AI_CUSTOMIZATION_MANAGEMENT_EDITOR_INPUT_ID
,
)
;
//#endregion
//#region Context Menu Actions
/**
* Type for context passed to actions from list context menus.
* Handles both direct URI arguments and serialized context objects.
*/
type
AICustomizationContext
=
{
:
URI
|
string
;
?
:
string
;
?
:
;
?
:
;
[
:
string
]
:
unknown
;
}
|
URI
|
string
;
/**
* Extracts a URI from various context formats.
*/
function
extractURI
(
:
)
:
URI
{
if
(
URI
.
isUri
(
)
)
{
return
;
}
if
(
typeof
===
'string'
)
{
return
URI
.
parse
(
)
;
}
if
(
URI
.
isUri
(
.
)
)
{
return
.
;
}
return
URI
.
parse
(
.
as
string
)
;
}
/**
* Extracts storage type from context.
*/
function
extractSource
(
:
)
:
|
undefined
{
if
(
URI
.
isUri
(
)
||
typeof
===
'string'
)
{
return
undefined
;
}
return
.
;
}
/**
* Extracts prompt type from context.
*/
function
extractPromptType
(
:
)
:
|
undefined
{
if
(
URI
.
isUri
(
)
||
typeof
===
'string'
)
{
return
undefined
;
}
return
.
;
}
/**
* Extracts the parent plugin URI from context, if present.
*/
function
extractPluginUri
(
:
)
:
URI
|
undefined
{
if
(
URI
.
isUri
(
)
||
typeof
===
'string'
)
{
return
undefined
;
}
const
=
.
;
if
(
!
)
{
return
undefined
;
}
return
URI
.
isUri
(
)
?
:
typeof
===
'string'
?
URI
.
parse
(
)
:
undefined
;
}
/**
* Extracts the item ID from context (used for identifying individual hooks within a file).
*/
function
extractItemId
(
:
)
:
string
|
undefined
{
if
(
URI
.
isUri
(
)
||
typeof
===
'string'
)
{
return
undefined
;
}
return
typeof
.
===
'string'
?
.
:
undefined
;
}
/**
* Parses a hook item ID to extract the original hook type ID and array index.
* Hook item IDs have the format: `fileUri#originalId[index]`
* Returns undefined if the ID does not match this format.
*/
function
parseHookItemId
(
:
string
)
:
{
:
string
;
:
number
}
|
undefined
{
const
=
.
lastIndexOf
(
'#'
)
;
if
(
<
0
)
{
return
undefined
;
}
const
=
.
substring
(
+
1
)
;
const
=
/^([^[]+)\[(\d+)\]$/
.
exec
(
)
;
if
(
!
)
{
return
undefined
;
}
return
{
:
[
1
]
,
:
parseInt
(
[
2
]
,
10
)
}
;
}
// Open file action
const
OPEN_AI_CUSTOMIZATION_MGMT_FILE_ID
=
'aiCustomizationManagement.openFile'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
OPEN_AI_CUSTOMIZATION_MGMT_FILE_ID
,
:
localize2
(
'open'
,
"Open"
)
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
extractSource
(
)
;
const
=
await
.
openEditor
(
{
:
extractURI
(
)
}
)
;
const
=
getCodeEditor
(
?.
getControl
(
)
)
;
if
(
&&
(
===
.
||
===
.
)
)
{
.
updateOptions
(
{
:
true
,
:
new
MarkdownString
(
localize
(
'readonlyPluginFile'
,
"This file is provided by a plugin or extension and cannot be edited."
)
)
,
}
)
;
}
}
}
)
;
// Run prompt action
const
RUN_PROMPT_MGMT_ID
=
'aiCustomizationManagement.runPrompt'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
RUN_PROMPT_MGMT_ID
,
:
localize2
(
'runPrompt'
,
"Run Prompt"
)
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
await
.
executeCommand
(
'workbench.action.chat.run.prompt.current'
,
extractURI
(
)
)
;
}
}
)
;
// Reveal in Finder/Explorer action
const
REVEAL_IN_OS_LABEL
=
?
localize2
(
'revealInWindows'
,
"Reveal in File Explorer"
)
:
?
localize2
(
'revealInMac'
,
"Reveal in Finder"
)
:
localize2
(
'openContainer'
,
"Open Containing Folder"
)
;
const
REVEAL_AI_CUSTOMIZATION_IN_OS_ID
=
'aiCustomizationManagement.revealInOS'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
REVEAL_AI_CUSTOMIZATION_IN_OS_ID
,
:
REVEAL_IN_OS_LABEL
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
extractURI
(
)
;
// Use existing reveal command
await
.
executeCommand
(
'revealFileInOS'
,
)
;
}
}
)
;
// Delete action
const
DELETE_AI_CUSTOMIZATION_ID
=
'aiCustomizationManagement.delete'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
DELETE_AI_CUSTOMIZATION_ID
,
:
localize2
(
'delete'
,
"Delete"
)
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
extractURI
(
)
;
const
=
extractSource
(
)
;
const
=
extractPromptType
(
)
;
const
=
extractItemId
(
)
;
const
=
===
.
;
const
=
===
.
;
// For skills, use the parent folder name since skills are structured as <skillname>/SKILL.md.
const
=
?
basename
(
dirname
(
)
)
:
basename
(
)
;
// Plugin-provided files: offer to uninstall the plugin
if
(
===
.
)
{
const
=
.
get
(
)
;
const
=
.
.
get
(
)
.
find
(
=>
isEqualOrParent
(
,
.
)
)
;
if
(
)
{
const
=
await
.
confirm
(
{
:
localize
(
'cannotDeletePluginItem'
,
"This item is provided by the plugin '{0}'"
,
.
)
,
:
localize
(
'cannotDeletePluginItemDetail'
,
"Individual components from a plugin cannot be removed separately. Would you like to uninstall the entire plugin?"
)
,
:
localize
(
'uninstallPlugin'
,
"Uninstall Plugin"
)
,
:
'question'
,
}
)
;
if
(
.
)
{
await
.
?.
(
)
;
}
}
return
;
}
// Extension and built-in files cannot be deleted
if
(
===
.
||
===
.
)
{
await
.
info
(
localize
(
'cannotDeleteExtension'
,
"Cannot Delete Extension File"
)
,
localize
(
'cannotDeleteExtensionDetail'
,
"Files provided by extensions cannot be deleted. You can disable the extension if you no longer want to use this customization."
)
)
;
return
;
}
// Confirm deletion
const
=
&&
?
parseHookItemId
(
)
:
undefined
;
const
=
typeof
!==
'string'
&&
!
URI
.
isUri
(
)
?
.
:
undefined
;
const
=
?
localize
(
'confirmDeleteSkill'
,
"Are you sure you want to delete skill '{0}' and its folder?"
/**
* When clause that hides an action for read-only (extension, plugin, built-in) items.
*/
const
WHEN_ITEM_IS_DELETABLE
=
.
and
(
.
notEquals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
.
notEquals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
.
notEquals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
)
;
/**
* When clause that shows an action only for plugin items.
*
* Synced customizations are bundled into a synthetic plugin (under the
* `vscode-synced-customization:` scheme) as an implementation detail of the
* sync mechanism. Their plugin identity is not user-facing, so we hide
* plugin-related actions ("Show Plugin", "Uninstall Plugin") for them.
*/
const
WHEN_ITEM_IS_PLUGIN
=
.
and
(
.
equals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
.
regex
(
AI_CUSTOMIZATION_ITEM_PLUGIN_URI_KEY
,
new
RegExp
(
`^${SYNCED_CUSTOMIZATION_SCHEME}:`
)
)
.
negate
(
)
,
)
;
// Register context menu items
// Inline hover actions (shown as icon buttons on hover)
.
appendMenuItem
(
,
{
:
{
:
INSTALL_CHAT_CUSTOMIZATION_EXTENSION_ID
,
:
localize
(
'Install Chat Customization Extension'
,
"Install Chat Customization Extension"
)
,
:
.
}
,
:
'inline'
,
:
1
,
:
.
and
(
CHAT_CUSTOMIZATION_EXTENSION_NOT_INSTALLED
,
.
or
(
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
)
)
}
)
;
.
appendMenuItem
(
,
{
:
{
:
COPY_AI_CUSTOMIZATION_PATH_ID
,
:
localize
(
'copyPath'
,
"Copy Path"
)
,
:
.
}
,
:
'inline'
,
:
2
,
}
)
;
.
appendMenuItem
(
,
{
:
{
:
DELETE_AI_CUSTOMIZATION_ID
,
:
localize
(
'delete'
,
"Delete"
)
,
:
.
}
,
:
'inline'
,
:
10
,
:
WHEN_ITEM_IS_DELETABLE
,
}
)
;
// Context menu items (shown on right-click)
.
appendMenuItem
(
,
{
:
{
:
OPEN_AI_CUSTOMIZATION_MGMT_FILE_ID
,
:
localize
(
'open'
,
"Open"
)
}
,
:
'1_open'
,
:
1
,
}
)
;
.
appendMenuItem
(
,
{
:
{
:
RUN_PROMPT_MGMT_ID
,
:
localize
(
'runPrompt'
,
"Run Prompt"
)
,
:
.
}
,
:
'2_run'
,
:
1
,
:
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
}
)
;
.
appendMenuItem
(
,
{
:
{
:
REVEAL_AI_CUSTOMIZATION_IN_OS_ID
,
:
REVEAL_IN_OS_LABEL
.
}
,
:
'3_file'
,
:
1
,
:
.
or
(
.
regex
(
AI_CUSTOMIZATION_ITEM_URI_KEY
,
new
RegExp
(
`^${Schemas.file}:`
)
)
,
.
regex
(
AI_CUSTOMIZATION_ITEM_URI_KEY
,
new
RegExp
(
`^${Schemas.vscodeUserData}:`
)
)
)
,
}
)
;
.
appendMenuItem
(
,
{
:
{
:
DELETE_AI_CUSTOMIZATION_ID
,
:
localize
(
'delete'
,
"Delete"
)
}
,
:
'4_modify'
,
:
1
,
:
WHEN_ITEM_IS_DELETABLE
,
}
)
;
// Uninstall Plugin action - shown for plugin-provided items
const
UNINSTALL_PLUGIN_AI_CUSTOMIZATION_ID
=
'aiCustomizationManagement.uninstallPlugin'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
UNINSTALL_PLUGIN_AI_CUSTOMIZATION_ID
,
:
localize2
(
'uninstallPlugin'
,
"Uninstall Plugin"
)
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
extractURI
(
)
;
const
=
.
.
get
(
)
.
find
(
=>
isEqualOrParent
(
,
.
)
)
;
if
(
!
)
{
return
;
}
const
=
await
.
confirm
(
{
:
localize
(
'confirmUninstallPlugin'
,
"This item is provided by the plugin '{0}'"
,
.
)
,
:
localize
(
'confirmUninstallPluginDetail'
,
"Individual components from a plugin cannot be removed separately. Would you like to uninstall the entire plugin?"
)
,
:
localize
(
'uninstallPluginBtn'
,
"Uninstall Plugin"
)
,
:
'question'
,
}
)
;
if
(
.
)
{
await
.
?.
(
)
;
}
}
}
)
;
.
appendMenuItem
(
,
{
:
{
:
UNINSTALL_PLUGIN_AI_CUSTOMIZATION_ID
,
:
localize
(
'uninstallPlugin'
,
"Uninstall Plugin"
)
,
:
.
}
,
:
'inline'
,
:
10
,
:
WHEN_ITEM_IS_PLUGIN
,
}
)
;
.
appendMenuItem
(
,
{
:
{
:
UNINSTALL_PLUGIN_AI_CUSTOMIZATION_ID
,
:
localize
(
'uninstallPlugin'
,
"Uninstall Plugin"
)
}
,
:
'4_modify'
,
:
1
,
:
WHEN_ITEM_IS_PLUGIN
,
}
)
;
// Show Plugin action - navigates to the parent plugin detail page
const
SHOW_PLUGIN_AI_CUSTOMIZATION_ID
=
'aiCustomizationManagement.showPlugin'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
SHOW_PLUGIN_AI_CUSTOMIZATION_ID
,
:
localize2
(
'showPlugin'
,
"Show Plugin"
)
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
.
get
(
)
;
const
=
extractPluginUri
(
)
;
if
(
!
)
{
return
;
}
const
=
.
.
get
(
)
.
find
(
=>
.
.
toString
(
)
===
.
toString
(
)
)
;
if
(
!
)
{
return
;
}
const
=
{
:
.
as
const
,
:
.
,
:
.
?.
??
''
,
:
.
?.
,
,
}
;
// Try to show within the active AI Customization editor (with back navigation)
const
=
.
getOrCreate
(
)
;
const
=
await
.
openEditor
(
,
{
:
true
}
)
;
if
(
instanceof
AICustomizationManagementEditor
)
{
await
.
showPluginDetail
(
)
;
}
}
}
)
;
.
appendMenuItem
(
,
{
:
{
:
SHOW_PLUGIN_AI_CUSTOMIZATION_ID
,
:
localize
(
'showPlugin'
,
"Show Plugin"
)
}
,
:
'1_open'
,
:
2
,
:
WHEN_ITEM_IS_PLUGIN
,
}
)
;
// Disable item action
const
DISABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
=
'aiCustomizationManagement.disableItem'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
DISABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
,
:
localize2
(
'disable'
,
"Disable"
)
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
extractURI
(
)
;
const
=
extractPromptType
(
)
;
if
(
!
)
{
return
;
}
const
=
.
getDisabledPromptFiles
(
)
;
.
add
(
)
;
.
setDisabledPromptFiles
(
,
)
;
}
}
)
;
// Enable item action
const
ENABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
=
'aiCustomizationManagement.enableItem'
;
registerAction2
(
class
extends
{
constructor
(
)
{
super
(
{
:
ENABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
,
:
localize2
(
'enable'
,
"Enable"
)
,
:
.
,
}
)
;
}
async
run
(
:
,
:
)
:
Promise
<
void
>
{
const
=
.
get
(
)
;
const
=
extractURI
(
)
;
const
=
extractPromptType
(
)
;
if
(
!
)
{
return
;
}
const
=
.
getDisabledPromptFiles
(
)
;
.
delete
(
)
;
.
setDisabledPromptFiles
(
,
)
;
}
}
)
;
// Context menu: Disable (shown when builtin item is enabled)
.
appendMenuItem
(
,
{
:
{
:
DISABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
,
:
localize
(
'disable'
,
"Disable"
)
}
,
:
'5_toggle'
,
:
1
,
:
.
and
(
.
equals
(
AI_CUSTOMIZATION_ITEM_DISABLED_KEY
,
false
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
)
,
}
)
;
// Context menu: Enable (shown when builtin item is disabled)
.
appendMenuItem
(
,
{
:
{
:
ENABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
,
:
localize
(
'enable'
,
"Enable"
)
}
,
:
'5_toggle'
,
:
1
,
:
.
and
(
.
equals
(
AI_CUSTOMIZATION_ITEM_DISABLED_KEY
,
true
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
)
,
}
)
;
// Inline hover: Disable (shown when builtin item is enabled)
.
appendMenuItem
(
,
{
:
{
:
DISABLE_AI_CUSTOMIZATION_MGMT_ITEM_ID
,
:
localize
(
'disable'
,
"Disable"
)
,
:
.
}
,
:
'inline'
,
:
5
,
:
.
and
(
.
equals
(
AI_CUSTOMIZATION_ITEM_DISABLED_KEY
,
false
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_STORAGE_KEY
,
.
)
,
.
equals
(
AI_CUSTOMIZATION_ITEM_TYPE_KEY
,
.
)
,
)
,
}
)
;
// Inline hover: Enable (shown when builtin item is disabled)