@codingame/monaco-vscode-katex-common 33.0.9 → 34.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.css +169 -0
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.d.ts +28 -0
- package/vscode/src/vs/base/browser/ui/pixelSpinner/pixelSpinner.js +61 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +1 -1
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +1 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +18 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +40 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution.js +4 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.d.ts +16 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.js +81 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostGenericConfigChips.js +5 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionUri.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionUri.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/media/agentHostChatInputPicker.css +18 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +177 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +34 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +69 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatArtifactsWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +25 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.d.ts +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatEditPillElement.js +140 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExternalEditContentPart.js +134 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +49 -117
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPlanReviewPart.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +47 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +52 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +18 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatResourceGroupWidget.js +23 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +13 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.d.ts +15 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +87 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +21 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +102 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +21 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMissingSandboxDepsConfirmationSubPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatModifiedFilesConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +35 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +62 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationCarouselPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +15 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +13 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/toolRiskBadgeWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +19 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +154 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +17 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +113 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatGoalBannerWidget.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationWidget.js +18 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +361 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputStatusActionViewItem.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +11 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +133 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.js +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatGoalBannerWidget.css +81 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatInputNotificationWidget.css +32 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/permissionPickerActionItem.js +39 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +23 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +66 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +3 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +373 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +18 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/common/chatPermissionWarnings.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +54 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +3 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +30 -30
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +0 -76
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +0 -191
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +0 -50
- package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +0 -138
- package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +0 -12
- package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -14
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +0 -18
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +0 -13
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +0 -87
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminal/terminalContribChatExports.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +0 -142
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +0 -232
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +0 -225
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +0 -143
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +0 -205
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +0 -174
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +0 -43
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +0 -260
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +0 -98
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +0 -225
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +0 -392
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +0 -243
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +0 -53
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.js +0 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +0 -310
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +0 -177
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +0 -33
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +0 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineBackgroundDetachRewriter.js +0 -102
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +0 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +0 -29
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePwshChainOperatorRewriter.js +0 -33
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +0 -53
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +0 -177
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +0 -512
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +0 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/outputAnalyzer.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +0 -258
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +0 -2623
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +0 -43
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalToolAutoApprove.js +0 -44
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +0 -58
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +0 -223
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxCommandRules.js +0 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxReadAllowList.js +0 -302
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxRuntimeConfigurationPerOperation.js +0 -118
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +0 -114
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +0 -788
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { ITerminalSandboxService } from "../../common/terminalSandboxService.js";
|
|
3
|
-
import type { IOutputAnalyzer, IOutputAnalyzerOptions } from "./outputAnalyzer.js";
|
|
4
|
-
export declare class SandboxOutputAnalyzer extends Disposable implements IOutputAnalyzer {
|
|
5
|
-
private readonly _sandboxService;
|
|
6
|
-
constructor(_sandboxService: ITerminalSandboxService);
|
|
7
|
-
analyze(options: IOutputAnalyzerOptions): Promise<string | undefined>;
|
|
8
|
-
/**
|
|
9
|
-
* Checks whether the command output contains strings that typically indicate
|
|
10
|
-
* the sandbox blocked the operation. Used when exit code is unavailable.
|
|
11
|
-
*
|
|
12
|
-
* The output may contain newlines inserted by terminal wrapping, so we
|
|
13
|
-
* strip them before testing.
|
|
14
|
-
*/
|
|
15
|
-
private _outputLooksSandboxBlocked;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Checks whether the command output contains strings that typically indicate
|
|
19
|
-
* the sandbox blocked the operation. The output may contain newlines inserted
|
|
20
|
-
* by terminal wrapping, so we strip them before testing.
|
|
21
|
-
*/
|
|
22
|
-
export declare function outputLooksSandboxBlocked(output: string): boolean;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
-
import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
5
|
-
import '../../common/terminalSandboxService.js';
|
|
6
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
7
|
-
import { AgentNetworkDomainSettingId } from '../../../../../../platform/networkFilter/common/settings.js';
|
|
8
|
-
import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/platform/sandbox/common/terminalSandboxService.service';
|
|
9
|
-
|
|
10
|
-
let SandboxOutputAnalyzer = class SandboxOutputAnalyzer extends Disposable {
|
|
11
|
-
constructor(_sandboxService) {
|
|
12
|
-
super();
|
|
13
|
-
this._sandboxService = _sandboxService;
|
|
14
|
-
}
|
|
15
|
-
async analyze(options) {
|
|
16
|
-
if (!options.isSandboxWrapped) {
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
const knownFailure = options.exitCode !== undefined && options.exitCode !== 0;
|
|
20
|
-
const suspectedFailure = !knownFailure && options.exitCode === undefined && this._outputLooksSandboxBlocked(options.exitResult);
|
|
21
|
-
if (!knownFailure && !suspectedFailure) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
const os = await this._sandboxService.getOS();
|
|
25
|
-
const fileSystemSetting = os === OperatingSystem.Linux ? TerminalChatAgentToolsSettingId.AgentSandboxLinuxFileSystem : TerminalChatAgentToolsSettingId.AgentSandboxMacFileSystem;
|
|
26
|
-
const prefix = knownFailure ? "Command failed while running in sandboxed mode. If the command failed due to sandboxing:" : "Command ran in sandboxed mode and may have been blocked by the sandbox. If the command failed due to sandboxing:";
|
|
27
|
-
return `${prefix}
|
|
28
|
-
- If it would be reasonable to extend the sandbox rules, work with the user to update allowWrite for file system access problems in ${fileSystemSetting}, or to add required domains to ${AgentNetworkDomainSettingId.AllowedNetworkDomains}.
|
|
29
|
-
- Otherwise, immediately retry the command with requestUnsandboxedExecution=true. Do NOT ask the user — setting this flag automatically shows a confirmation prompt to the user.
|
|
30
|
-
|
|
31
|
-
Here is the output of the command:\n`;
|
|
32
|
-
}
|
|
33
|
-
_outputLooksSandboxBlocked(output) {
|
|
34
|
-
return outputLooksSandboxBlocked(output);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
SandboxOutputAnalyzer = ( __decorate([( __param(0, ITerminalSandboxService))], SandboxOutputAnalyzer));
|
|
38
|
-
function outputLooksSandboxBlocked(output) {
|
|
39
|
-
const normalized = output.replace(/\n/g, " ");
|
|
40
|
-
return /Operation not permitted|Permission denied|Read-only file system|sandbox-exec|bwrap|sandbox_violation/i.test(normalized);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { SandboxOutputAnalyzer, outputLooksSandboxBlocked };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IChatTerminalToolInvocationData } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService";
|
|
2
|
-
import { ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
3
|
-
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
4
|
-
export declare class TerminalCommandArtifactCollector {
|
|
5
|
-
private readonly _logService;
|
|
6
|
-
constructor(_logService: ITerminalLogService);
|
|
7
|
-
capture(toolSpecificData: IChatTerminalToolInvocationData, instance: ITerminalInstance, commandId: string | undefined): Promise<void>;
|
|
8
|
-
private _captureCommandOutput;
|
|
9
|
-
/**
|
|
10
|
-
* Captures output from a partial/current command that hasn't finished yet.
|
|
11
|
-
* This is used when the command is cancelled mid-execution.
|
|
12
|
-
*/
|
|
13
|
-
private _capturePartialCommandOutput;
|
|
14
|
-
private _applyTheme;
|
|
15
|
-
private _createTerminalCommandUri;
|
|
16
|
-
private _tryGetCommand;
|
|
17
|
-
}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { getCommandOutputSnapshot } from '../../../../terminal/browser/chatTerminalCommandMirror.js';
|
|
4
|
-
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
5
|
-
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
6
|
-
|
|
7
|
-
let TerminalCommandArtifactCollector = class TerminalCommandArtifactCollector {
|
|
8
|
-
constructor(_logService) {
|
|
9
|
-
this._logService = _logService;
|
|
10
|
-
}
|
|
11
|
-
async capture(toolSpecificData, instance, commandId) {
|
|
12
|
-
if (commandId) {
|
|
13
|
-
try {
|
|
14
|
-
toolSpecificData.terminalCommandUri = this._createTerminalCommandUri(instance, commandId);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
this._logService.warn(
|
|
17
|
-
`RunInTerminalTool: Failed to create terminal command URI for ${commandId}`,
|
|
18
|
-
error
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
const command = await this._tryGetCommand(instance, commandId);
|
|
22
|
-
if (command) {
|
|
23
|
-
toolSpecificData.terminalCommandState = {
|
|
24
|
-
exitCode: command.exitCode,
|
|
25
|
-
timestamp: command.timestamp,
|
|
26
|
-
duration: command.duration
|
|
27
|
-
};
|
|
28
|
-
const snapshot = await this._captureCommandOutput(instance, command);
|
|
29
|
-
if (snapshot) {
|
|
30
|
-
toolSpecificData.terminalCommandOutput = snapshot;
|
|
31
|
-
}
|
|
32
|
-
this._applyTheme(toolSpecificData, instance);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
const partialSnapshot = await this._capturePartialCommandOutput(instance, commandId);
|
|
36
|
-
if (partialSnapshot) {
|
|
37
|
-
toolSpecificData.terminalCommandOutput = partialSnapshot;
|
|
38
|
-
this._logService.debug(`RunInTerminalTool: Captured partial command output for ${commandId}`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
this._applyTheme(toolSpecificData, instance);
|
|
42
|
-
}
|
|
43
|
-
async _captureCommandOutput(instance, command) {
|
|
44
|
-
try {
|
|
45
|
-
await instance.xtermReadyPromise;
|
|
46
|
-
} catch {
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
const xterm = instance.xterm;
|
|
50
|
-
if (!xterm) {
|
|
51
|
-
return undefined;
|
|
52
|
-
}
|
|
53
|
-
return getCommandOutputSnapshot(xterm, command, (reason, error) => {
|
|
54
|
-
const suffix = reason === "fallback" ? " (fallback)" : "";
|
|
55
|
-
this._logService.debug(`RunInTerminalTool: Failed to snapshot command output${suffix}`, error);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
async _capturePartialCommandOutput(instance, commandId) {
|
|
59
|
-
try {
|
|
60
|
-
await instance.xtermReadyPromise;
|
|
61
|
-
} catch {
|
|
62
|
-
return undefined;
|
|
63
|
-
}
|
|
64
|
-
const xterm = instance.xterm;
|
|
65
|
-
if (!xterm) {
|
|
66
|
-
return undefined;
|
|
67
|
-
}
|
|
68
|
-
const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
69
|
-
const currentCommand = commandDetection?.currentCommand;
|
|
70
|
-
if (currentCommand && currentCommand.id === commandId) {
|
|
71
|
-
const executedMarker = currentCommand.commandExecutedMarker;
|
|
72
|
-
if (executedMarker && !executedMarker.isDisposed) {
|
|
73
|
-
try {
|
|
74
|
-
const raw = xterm.raw;
|
|
75
|
-
const buffer = raw.buffer.active;
|
|
76
|
-
const endLine = buffer.baseY + buffer.cursorY;
|
|
77
|
-
const startLine = executedMarker.line;
|
|
78
|
-
const lineCount = Math.max(endLine - startLine, 0);
|
|
79
|
-
if (lineCount > 0) {
|
|
80
|
-
const text = await xterm.getRangeAsVT(executedMarker, undefined, true);
|
|
81
|
-
if (text) {
|
|
82
|
-
return {
|
|
83
|
-
text,
|
|
84
|
-
lineCount
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
} catch (error) {
|
|
89
|
-
this._logService.debug(`RunInTerminalTool: Failed to capture partial command output`, error);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
_applyTheme(toolSpecificData, instance) {
|
|
96
|
-
const theme = instance.xterm?.getXtermTheme();
|
|
97
|
-
if (theme) {
|
|
98
|
-
toolSpecificData.terminalTheme = {
|
|
99
|
-
background: theme.background,
|
|
100
|
-
foreground: theme.foreground
|
|
101
|
-
};
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
_createTerminalCommandUri(instance, commandId) {
|
|
105
|
-
const params = ( new URLSearchParams(instance.resource.query));
|
|
106
|
-
params.set("command", commandId);
|
|
107
|
-
return instance.resource.with({
|
|
108
|
-
query: ( params.toString())
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
async _tryGetCommand(instance, commandId) {
|
|
112
|
-
const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
113
|
-
return commandDetection?.commands.find(c => c.id === commandId);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
TerminalCommandArtifactCollector = ( __decorate([( __param(0, ITerminalLogService))], TerminalCommandArtifactCollector));
|
|
117
|
-
|
|
118
|
-
export { TerminalCommandArtifactCollector };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
-
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
4
|
-
import { IChatWidgetService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service";
|
|
5
|
-
import { IChatService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service";
|
|
6
|
-
/**
|
|
7
|
-
* Returns true if the chat session's permission level (Autopilot/Bypass Approvals)
|
|
8
|
-
* auto-approves all tool calls, unless enterprise policy restricts it.
|
|
9
|
-
* Checks both the request-stamped level and the live picker level.
|
|
10
|
-
*/
|
|
11
|
-
export declare function isSessionAutoApproveLevel(chatSessionResource: URI, configurationService: IConfigurationService, chatWidgetService: IChatWidgetService, chatService: IChatService): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Checks whether a terminal tool is eligible for auto-approval based on user configuration.
|
|
14
|
-
* @param toolReferenceName The tool's reference name (e.g. 'runInTerminal', 'sendToTerminal').
|
|
15
|
-
* @param legacyToolReferenceFullNames Legacy names to check for backward compatibility.
|
|
16
|
-
*/
|
|
17
|
-
export declare function isToolEligibleForTerminalAutoApproval(toolReferenceName: string, configurationService: IConfigurationService, legacyToolReferenceFullNames?: string[]): boolean;
|
|
18
|
-
/**
|
|
19
|
-
* Determines whether terminal auto-approve rules are allowed to take effect.
|
|
20
|
-
* This checks the setting enablement, the opt-in warning acceptance, and the per-tool eligibility.
|
|
21
|
-
*/
|
|
22
|
-
export declare function isTerminalAutoApproveAllowed(toolReferenceName: string, configurationService: IConfigurationService, storageService: IStorageService, legacyToolReferenceFullNames?: string[]): boolean;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { StorageScope } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage';
|
|
3
|
-
import { TerminalToolConfirmationStorageKeys } from '../../../../chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js';
|
|
4
|
-
import { ChatConfiguration, isAutoApproveLevel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
5
|
-
import { TerminalChatAgentToolsSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration';
|
|
6
|
-
|
|
7
|
-
function isSessionAutoApproveLevel(chatSessionResource, configurationService, chatWidgetService, chatService) {
|
|
8
|
-
const inspected = configurationService.inspect(ChatConfiguration.GlobalAutoApprove);
|
|
9
|
-
if (inspected.policyValue === false) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
const widget = chatWidgetService.getWidgetBySessionResource(chatSessionResource)
|
|
13
|
-
?? chatWidgetService.lastFocusedWidget;
|
|
14
|
-
if (widget && isAutoApproveLevel(widget.input.currentModeInfo.permissionLevel)) {
|
|
15
|
-
return true;
|
|
16
|
-
}
|
|
17
|
-
const model = chatService.getSession(chatSessionResource);
|
|
18
|
-
const request = model?.getRequests().at(-1);
|
|
19
|
-
return isAutoApproveLevel(request?.modeInfo?.permissionLevel);
|
|
20
|
-
}
|
|
21
|
-
function isToolEligibleForTerminalAutoApproval(toolReferenceName, configurationService, legacyToolReferenceFullNames) {
|
|
22
|
-
const config = configurationService.getValue(ChatConfiguration.EligibleForAutoApproval);
|
|
23
|
-
if (config && typeof config === 'object') {
|
|
24
|
-
if (Object.prototype.hasOwnProperty.call(config, toolReferenceName)) {
|
|
25
|
-
return config[toolReferenceName];
|
|
26
|
-
}
|
|
27
|
-
if (legacyToolReferenceFullNames) {
|
|
28
|
-
for (const legacyName of legacyToolReferenceFullNames) {
|
|
29
|
-
if (Object.prototype.hasOwnProperty.call(config, legacyName)) {
|
|
30
|
-
return config[legacyName];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
function isTerminalAutoApproveAllowed(toolReferenceName, configurationService, storageService, legacyToolReferenceFullNames) {
|
|
38
|
-
const isEligible = isToolEligibleForTerminalAutoApproval(toolReferenceName, configurationService, legacyToolReferenceFullNames);
|
|
39
|
-
const isAutoApproveEnabled = configurationService.getValue(TerminalChatAgentToolsSettingId.EnableAutoApprove) === true;
|
|
40
|
-
const isAutoApproveWarningAccepted = storageService.getBoolean(TerminalToolConfirmationStorageKeys.TerminalAutoApproveWarningAccepted, StorageScope.APPLICATION, false);
|
|
41
|
-
return isEligible && isAutoApproveEnabled && isAutoApproveWarningAccepted;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export { isSessionAutoApproveLevel, isTerminalAutoApproveAllowed, isToolEligibleForTerminalAutoApproval };
|
package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { TerminalToolId } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/terminalToolIds";
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { QueryCapture } from "@codingame/monaco-vscode-api/external/@vscode/tree-sitter-wasm/wasm/tree-sitter";
|
|
2
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
-
import { ITreeSitterLibraryService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/treeSitter/treeSitterLibraryService.service";
|
|
4
|
-
import type { ITerminalSandboxCommand } from "../../../../../platform/sandbox/common/terminalSandboxService.js";
|
|
5
|
-
export declare enum TreeSitterCommandParserLanguage {
|
|
6
|
-
Bash = "bash",
|
|
7
|
-
PowerShell = "powershell"
|
|
8
|
-
}
|
|
9
|
-
export declare class TreeSitterCommandParser extends Disposable {
|
|
10
|
-
private readonly _treeSitterLibraryService;
|
|
11
|
-
private readonly _parser;
|
|
12
|
-
private readonly _treeCache;
|
|
13
|
-
private readonly _commandFileWriteParsers;
|
|
14
|
-
constructor(_treeSitterLibraryService: ITreeSitterLibraryService);
|
|
15
|
-
extractSubCommands(languageId: TreeSitterCommandParserLanguage, commandLine: string): Promise<string[]>;
|
|
16
|
-
extractPwshDoubleAmpersandChainOperators(commandLine: string): Promise<QueryCapture[]>;
|
|
17
|
-
/**
|
|
18
|
-
* Extracts executable command invocations from the command line and returns
|
|
19
|
-
* normalized command details for sandbox allow-listing.
|
|
20
|
-
*
|
|
21
|
-
* Example: `PATH=/bin /usr/bin/git commit -S -m "test" && npm install`
|
|
22
|
-
* returns:
|
|
23
|
-
* `[
|
|
24
|
-
* { keyword: 'git', args: ['commit', '-S', '-m', 'test'] },
|
|
25
|
-
* { keyword: 'npm', args: ['install'] }
|
|
26
|
-
* ]`.
|
|
27
|
-
*/
|
|
28
|
-
extractCommands(languageId: TreeSitterCommandParserLanguage, commandLine: string): Promise<ITerminalSandboxCommand[]>;
|
|
29
|
-
getFileWrites(languageId: TreeSitterCommandParserLanguage, commandLine: string): Promise<string[]>;
|
|
30
|
-
/**
|
|
31
|
-
* Extracts file targets from commands that perform file writes beyond shell redirections.
|
|
32
|
-
* Uses registered command parsers (e.g., for `sed -i`) to detect command-specific file writes.
|
|
33
|
-
* Returns an array of file paths that would be modified.
|
|
34
|
-
*/
|
|
35
|
-
getCommandFileWrites(languageId: TreeSitterCommandParserLanguage, commandLine: string): Promise<string[]>;
|
|
36
|
-
private _queryTree;
|
|
37
|
-
/**
|
|
38
|
-
* Converts a command token to the stable keyword used by sandbox allow-list
|
|
39
|
-
* rules by stripping quotes, path segments, and common executable suffixes.
|
|
40
|
-
*/
|
|
41
|
-
private _normalizeCommandKeyword;
|
|
42
|
-
/**
|
|
43
|
-
* Parses a single tree-sitter command node into command details, ignoring
|
|
44
|
-
* leading environment variable assignments such as `NODE_ENV=test npm run build`.
|
|
45
|
-
*/
|
|
46
|
-
private _parseCommand;
|
|
47
|
-
/**
|
|
48
|
-
* Splits enough shell syntax for sandbox allow-listing: whitespace separates
|
|
49
|
-
* tokens, quotes are removed, and backslash escapes preserve the escaped char.
|
|
50
|
-
*/
|
|
51
|
-
private _splitCommandTokens;
|
|
52
|
-
/**
|
|
53
|
-
* Returns true for simple shell-style environment variable assignments that
|
|
54
|
-
* can prefix a command invocation.
|
|
55
|
-
*/
|
|
56
|
-
private _isVariableAssignment;
|
|
57
|
-
private _doQuery;
|
|
58
|
-
}
|
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
-
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
-
import { BugIndicatingError, ErrorNoTelemetry } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
5
|
-
import { Lazy } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lazy';
|
|
6
|
-
import { Disposable, MutableDisposable, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
-
import { win32, posix } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
8
|
-
import { ITreeSitterLibraryService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/treeSitter/treeSitterLibraryService.service';
|
|
9
|
-
import { SedFileWriteParser } from './commandParsers/sedFileWriteParser.js';
|
|
10
|
-
|
|
11
|
-
var TreeSitterCommandParserLanguage;
|
|
12
|
-
(function(TreeSitterCommandParserLanguage) {
|
|
13
|
-
TreeSitterCommandParserLanguage["Bash"] = "bash";
|
|
14
|
-
TreeSitterCommandParserLanguage["PowerShell"] = "powershell";
|
|
15
|
-
})(TreeSitterCommandParserLanguage || (TreeSitterCommandParserLanguage = {}));
|
|
16
|
-
const pwshFlagEqualsRegex = /(^|\s)(-{1,2}[\w-]+)=/g;
|
|
17
|
-
function maskPwshFlagEquals(commandLine) {
|
|
18
|
-
return commandLine.replace(pwshFlagEqualsRegex, (_, pre, flag) => `${pre}${flag} `);
|
|
19
|
-
}
|
|
20
|
-
let TreeSitterCommandParser = class TreeSitterCommandParser extends Disposable {
|
|
21
|
-
constructor(_treeSitterLibraryService) {
|
|
22
|
-
super();
|
|
23
|
-
this._treeSitterLibraryService = _treeSitterLibraryService;
|
|
24
|
-
this._treeCache = this._register(( new TreeCache()));
|
|
25
|
-
this._commandFileWriteParsers = [( new SedFileWriteParser())];
|
|
26
|
-
this._parser = ( new Lazy(
|
|
27
|
-
() => this._treeSitterLibraryService.getParserClass().then(ParserCtor => ( new ParserCtor()))
|
|
28
|
-
));
|
|
29
|
-
}
|
|
30
|
-
async extractSubCommands(languageId, commandLine) {
|
|
31
|
-
if (languageId === TreeSitterCommandParserLanguage.PowerShell) {
|
|
32
|
-
const masked = maskPwshFlagEquals(commandLine);
|
|
33
|
-
if (masked !== commandLine) {
|
|
34
|
-
const captures = await this._queryTree(languageId, masked, "(command) @command");
|
|
35
|
-
return ( captures.map(e => commandLine.substring(e.node.startIndex, e.node.endIndex)));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const captures = await this._queryTree(languageId, commandLine, "(command) @command");
|
|
39
|
-
return ( captures.map(e => e.node.text));
|
|
40
|
-
}
|
|
41
|
-
async extractPwshDoubleAmpersandChainOperators(commandLine) {
|
|
42
|
-
const captures = await this._queryTree(
|
|
43
|
-
TreeSitterCommandParserLanguage.PowerShell,
|
|
44
|
-
commandLine,
|
|
45
|
-
["(", " (pipeline", " (pipeline_chain_tail) @double.ampersand)", ")"].join("\n")
|
|
46
|
-
);
|
|
47
|
-
return captures;
|
|
48
|
-
}
|
|
49
|
-
async extractCommands(languageId, commandLine) {
|
|
50
|
-
const commands = [];
|
|
51
|
-
for (const commandText of await this.extractSubCommands(languageId, commandLine)) {
|
|
52
|
-
const command = this._parseCommand(commandText);
|
|
53
|
-
if (command) {
|
|
54
|
-
commands.push(command);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return commands;
|
|
58
|
-
}
|
|
59
|
-
async getFileWrites(languageId, commandLine) {
|
|
60
|
-
let query;
|
|
61
|
-
switch (languageId) {
|
|
62
|
-
case TreeSitterCommandParserLanguage.Bash:
|
|
63
|
-
query = [
|
|
64
|
-
"(file_redirect",
|
|
65
|
-
" destination: [(word) (string (string_content)) (raw_string) (concatenation)] @file)"
|
|
66
|
-
].join("\n");
|
|
67
|
-
break;
|
|
68
|
-
case TreeSitterCommandParserLanguage.PowerShell:
|
|
69
|
-
query = ["(redirection", " (redirected_file_name) @file)"].join("\n");
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
const captures = await this._queryTree(languageId, commandLine, query);
|
|
73
|
-
return ( captures.map(e => e.node.text.trim()));
|
|
74
|
-
}
|
|
75
|
-
async getCommandFileWrites(languageId, commandLine) {
|
|
76
|
-
if (languageId !== TreeSitterCommandParserLanguage.Bash) {
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
const query = "(command) @command";
|
|
80
|
-
const captures = await this._queryTree(languageId, commandLine, query);
|
|
81
|
-
const result = [];
|
|
82
|
-
for (const capture of captures) {
|
|
83
|
-
const commandText = capture.node.text;
|
|
84
|
-
for (const parser of this._commandFileWriteParsers) {
|
|
85
|
-
if (parser.canHandle(commandText)) {
|
|
86
|
-
result.push(...parser.extractFileWrites(commandText));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
return result;
|
|
91
|
-
}
|
|
92
|
-
async _queryTree(languageId, commandLine, querySource) {
|
|
93
|
-
const {
|
|
94
|
-
tree,
|
|
95
|
-
query
|
|
96
|
-
} = await this._doQuery(languageId, commandLine, querySource);
|
|
97
|
-
return query.captures(tree.rootNode);
|
|
98
|
-
}
|
|
99
|
-
_normalizeCommandKeyword(token) {
|
|
100
|
-
const unquoted = token.replace(/^['"]|['"]$/g, "");
|
|
101
|
-
if (!unquoted) {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
const pathBase = unquoted.includes("\\") ? win32.basename(unquoted) : posix.basename(unquoted);
|
|
105
|
-
const normalized = pathBase.toLowerCase().replace(/\.(?:exe|cmd|bat|ps1)$/i, "");
|
|
106
|
-
return normalized || undefined;
|
|
107
|
-
}
|
|
108
|
-
_parseCommand(commandText) {
|
|
109
|
-
const tokens = this._splitCommandTokens(commandText);
|
|
110
|
-
let commandIndex = 0;
|
|
111
|
-
while (commandIndex < tokens.length && this._isVariableAssignment(tokens[commandIndex])) {
|
|
112
|
-
commandIndex++;
|
|
113
|
-
}
|
|
114
|
-
const keyword = this._normalizeCommandKeyword(tokens[commandIndex] ?? "");
|
|
115
|
-
if (!keyword) {
|
|
116
|
-
return undefined;
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
keyword,
|
|
120
|
-
args: tokens.slice(commandIndex + 1)
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
_splitCommandTokens(commandText) {
|
|
124
|
-
const tokens = [];
|
|
125
|
-
let current = "";
|
|
126
|
-
let quote;
|
|
127
|
-
let escaping = false;
|
|
128
|
-
for (const char of commandText.trim()) {
|
|
129
|
-
if (escaping) {
|
|
130
|
-
current += char;
|
|
131
|
-
escaping = false;
|
|
132
|
-
continue;
|
|
133
|
-
}
|
|
134
|
-
if (char === "\\" && quote !== "'") {
|
|
135
|
-
escaping = true;
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
if (quote) {
|
|
139
|
-
if (char === quote) {
|
|
140
|
-
quote = undefined;
|
|
141
|
-
} else {
|
|
142
|
-
current += char;
|
|
143
|
-
}
|
|
144
|
-
continue;
|
|
145
|
-
}
|
|
146
|
-
if (char === "'" || char === "\"") {
|
|
147
|
-
quote = char;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
if (/\s/.test(char)) {
|
|
151
|
-
if (current) {
|
|
152
|
-
tokens.push(current);
|
|
153
|
-
current = "";
|
|
154
|
-
}
|
|
155
|
-
continue;
|
|
156
|
-
}
|
|
157
|
-
current += char;
|
|
158
|
-
}
|
|
159
|
-
if (escaping) {
|
|
160
|
-
current += "\\";
|
|
161
|
-
}
|
|
162
|
-
if (current) {
|
|
163
|
-
tokens.push(current);
|
|
164
|
-
}
|
|
165
|
-
return tokens;
|
|
166
|
-
}
|
|
167
|
-
_isVariableAssignment(token) {
|
|
168
|
-
return /^[A-Za-z_][A-Za-z0-9_]*=.*/.test(token);
|
|
169
|
-
}
|
|
170
|
-
async _doQuery(languageId, commandLine, querySource) {
|
|
171
|
-
const language = await this._treeSitterLibraryService.getLanguagePromise(languageId);
|
|
172
|
-
if (!language) {
|
|
173
|
-
throw ( new BugIndicatingError("Failed to fetch language grammar"));
|
|
174
|
-
}
|
|
175
|
-
let tree = this._treeCache.get(languageId, commandLine);
|
|
176
|
-
if (!tree) {
|
|
177
|
-
const parser = await this._parser.value;
|
|
178
|
-
parser.setLanguage(language);
|
|
179
|
-
const parsedTree = parser.parse(commandLine);
|
|
180
|
-
if (!parsedTree) {
|
|
181
|
-
throw ( new ErrorNoTelemetry("Failed to parse tree"));
|
|
182
|
-
}
|
|
183
|
-
tree = parsedTree;
|
|
184
|
-
this._treeCache.set(languageId, commandLine, tree);
|
|
185
|
-
}
|
|
186
|
-
const query = await this._treeSitterLibraryService.createQuery(language, querySource);
|
|
187
|
-
if (!query) {
|
|
188
|
-
throw ( new BugIndicatingError("Failed to create tree sitter query"));
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
tree,
|
|
192
|
-
query
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
};
|
|
196
|
-
TreeSitterCommandParser = ( __decorate([( __param(0, ITreeSitterLibraryService))], TreeSitterCommandParser));
|
|
197
|
-
class TreeCache extends Disposable {
|
|
198
|
-
constructor() {
|
|
199
|
-
super();
|
|
200
|
-
this._cache = ( new Map());
|
|
201
|
-
this._clearScheduler = this._register(( new MutableDisposable()));
|
|
202
|
-
this._register(toDisposable(() => this._cache.clear()));
|
|
203
|
-
}
|
|
204
|
-
get(languageId, commandLine) {
|
|
205
|
-
this._resetClearTimer();
|
|
206
|
-
return this._cache.get(this._getCacheKey(languageId, commandLine));
|
|
207
|
-
}
|
|
208
|
-
set(languageId, commandLine, tree) {
|
|
209
|
-
this._resetClearTimer();
|
|
210
|
-
this._cache.set(this._getCacheKey(languageId, commandLine), tree);
|
|
211
|
-
}
|
|
212
|
-
_getCacheKey(languageId, commandLine) {
|
|
213
|
-
return `${languageId}:${commandLine}`;
|
|
214
|
-
}
|
|
215
|
-
_resetClearTimer() {
|
|
216
|
-
this._clearScheduler.value = ( new RunOnceScheduler(() => {
|
|
217
|
-
this._cache.clear();
|
|
218
|
-
}, 10000));
|
|
219
|
-
this._clearScheduler.value.schedule();
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export { TreeSitterCommandParser, TreeSitterCommandParserLanguage };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
-
import type { ITerminalSandboxCommand } from "../../../../../platform/sandbox/common/terminalSandboxService.js";
|
|
3
|
-
export interface ITerminalSandboxCommandRuleContext {
|
|
4
|
-
readonly os: OperatingSystem;
|
|
5
|
-
}
|
|
6
|
-
export interface ITerminalSandboxCommandRule<T> {
|
|
7
|
-
readonly keywords: readonly string[];
|
|
8
|
-
readonly value: T;
|
|
9
|
-
readonly subcommands?: readonly string[];
|
|
10
|
-
readonly optionsWithValue?: ReadonlySet<string>;
|
|
11
|
-
/** Context-wide guard for rules, such as OS-specific sandbox capabilities. */
|
|
12
|
-
readonly condition?: (context: ITerminalSandboxCommandRuleContext) => boolean;
|
|
13
|
-
/** Command-specific guard for argument-sensitive rules. */
|
|
14
|
-
readonly when?: (command: ITerminalSandboxCommand) => boolean;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Git global options that consume the following argument. These need to be
|
|
18
|
-
* skipped when finding the subcommand so `git -C repo commit` matches `commit`
|
|
19
|
-
* instead of treating `repo` as the subcommand.
|
|
20
|
-
*/
|
|
21
|
-
export declare const gitGlobalOptionsWithValue: Set<string>;
|
|
22
|
-
export declare function matchesTerminalSandboxCommandRule<T>(command: ITerminalSandboxCommand, rule: ITerminalSandboxCommandRule<T>, context?: ITerminalSandboxCommandRuleContext): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Returns the first non-option argument, treating it as the command's subcommand.
|
|
25
|
-
* Options are skipped, and options listed in `optionsWithValue` also skip the
|
|
26
|
-
* following argument so global option values are not mistaken for subcommands.
|
|
27
|
-
*
|
|
28
|
-
* For example, with `-C` in `optionsWithValue`, `git -C repo commit` returns
|
|
29
|
-
* `commit` instead of `repo`.
|
|
30
|
-
*/
|
|
31
|
-
export declare function getCommandSubcommand(args: readonly string[], optionsWithValue?: ReadonlySet<string>): string | undefined;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const gitGlobalOptionsWithValue = ( new Set([
|
|
4
|
-
"-C",
|
|
5
|
-
"-c",
|
|
6
|
-
"--config-env",
|
|
7
|
-
"--exec-path",
|
|
8
|
-
"--git-dir",
|
|
9
|
-
"--html-path",
|
|
10
|
-
"--info-path",
|
|
11
|
-
"--man-path",
|
|
12
|
-
"--namespace",
|
|
13
|
-
"--super-prefix",
|
|
14
|
-
"--work-tree"
|
|
15
|
-
]));
|
|
16
|
-
function matchesTerminalSandboxCommandRule(command, rule, context) {
|
|
17
|
-
if (!rule.keywords.includes(command.keyword.toLowerCase())) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
if (rule.condition && (!context || !rule.condition(context))) {
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
if (rule.subcommands) {
|
|
24
|
-
const subcommand = getCommandSubcommand(command.args, rule.optionsWithValue);
|
|
25
|
-
if (subcommand === undefined || !rule.subcommands.includes(subcommand)) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return rule.when?.(command) ?? true;
|
|
30
|
-
}
|
|
31
|
-
function getCommandSubcommand(args, optionsWithValue) {
|
|
32
|
-
for (let i = 0; i < args.length; i++) {
|
|
33
|
-
const arg = args[i];
|
|
34
|
-
if (arg === "--") {
|
|
35
|
-
return undefined;
|
|
36
|
-
}
|
|
37
|
-
if (arg.startsWith("-")) {
|
|
38
|
-
const option = arg.includes("=") ? arg.substring(0, arg.indexOf("=")) : arg;
|
|
39
|
-
if (!arg.includes("=") && optionsWithValue?.has(option)) {
|
|
40
|
-
i++;
|
|
41
|
-
}
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
return arg.toLowerCase();
|
|
45
|
-
}
|
|
46
|
-
return undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export { getCommandSubcommand, gitGlobalOptionsWithValue, matchesTerminalSandboxCommandRule };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
-
import type { ITerminalSandboxCommand } from "../../../../../platform/sandbox/common/terminalSandboxService.js";
|
|
3
|
-
export declare enum TerminalSandboxReadAllowListOperation {
|
|
4
|
-
Git = "git",
|
|
5
|
-
Node = "node",
|
|
6
|
-
Rust = "rust",
|
|
7
|
-
Go = "go",
|
|
8
|
-
Python = "python",
|
|
9
|
-
Java = "java",
|
|
10
|
-
Dotnet = "dotnet",
|
|
11
|
-
Nuget = "nuget",
|
|
12
|
-
Msbuild = "msbuild",
|
|
13
|
-
Ruby = "ruby",
|
|
14
|
-
NativeBuild = "nativeBuild",
|
|
15
|
-
Conan = "conan",
|
|
16
|
-
GnuPG = "gnupg"
|
|
17
|
-
}
|
|
18
|
-
export declare function getTerminalSandboxReadAllowListForCommands(os: OperatingSystem, commandKeywords: readonly string[], commandDetails?: readonly ITerminalSandboxCommand[]): readonly string[];
|