ide на основе vs code · VibeGit
ide на основе vs code Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
krutaya-ide-na-osnove-vs-code / src / vs / sessions / contrib / policyBlocked / browser / sessionsPolicyBlocked.ts 211 строк · изменён 14 нояб., 04:52
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
import './media/sessionsPolicyBlocked.css' ;
import { Disposable, toDisposable } from '../../../../base/common/lifecycle.js' ;
import { $, addDisposableGenericMouseDownListener, append, EventType, addDisposableListener, getWindow } from '../../../../base/browser/dom.js' ;
import { localize } from '../../../../nls.js' ;
import { Button } from '../../../../base/browser/ui/button/button.js' ;
import { defaultButtonStyles } from '../../../../platform/theme/browser/defaultStyles.js' ;
import { IOpenerService } from '../../../../platform/opener/common/opener.js'
IProductService
ICommandService
IWorkbenchLayoutService
IDefaultAccountService
IManagedSettingsFreshness ManagedSettingsFreshnessFailure ManagedSettingsFreshnessState
SessionsBlockedReason
AgentDisabled
Loading
AccountPolicyGate
ManagedSettingsRefresh
reason SessionsBlockedReason
approvedOrganizations
accountName
freshness Extract IManagedSettingsFreshness state ManagedSettingsFreshnessState Blocked
overlay HTMLElement
container HTMLElement
options ISessionsBlockedOverlayOptions
commandService ICommandService
openerService IOpenerService
productService IProductService
defaultAccountService IDefaultAccountService
layoutService IWorkbenchLayoutService
overlay container
overlay
overlay
overlay tabIndex
overlay
overlay
workbenchRoot layoutService mainContainer
workbenchRoot classList
workbenchRoot classList
card overlay
overlay EventType e KeyboardEvent
card e target Node
e
e
overlay e
e target overlay
e
e
card
options reason
SessionsBlockedReason AgentDisabled
card
SessionsBlockedReason Loading
card
SessionsBlockedReason AccountPolicyGate
card options
SessionsBlockedReason ManagedSettingsRefresh
card options freshness
card HTMLElement
overlay
card
description card
description document
description document
learnMore description HTMLAnchorElement
learnMore textContent
learnMore href
learnMore EventType e
e
openerService
button card defaultButtonStyles secondary
button label
button
card HTMLElement
overlay
card
card HTMLElement options ISessionsBlockedOverlayOptions
overlay
card
description card
options accountName
description document
options accountName
description document
approvedOrgs options approvedOrganizations
hasConcreteOrgs approvedOrgs length approvedOrgs
hasConcreteOrgs
orgSection card
orgSection
orgList orgSection
org approvedOrgs
orgList org
footer card
footer document
footer document
learnMore footer HTMLAnchorElement
learnMore textContent
learnMore href
learnMore EventType e
e
openerService
signInButton card defaultButtonStyles
signInButton label
signInButton
commandService
card HTMLElement freshness ISessionsBlockedOverlayOptions
overlay
card
message freshness failure ManagedSettingsFreshnessFailure NoToken
productService nameShort
freshness failure ManagedSettingsFreshnessFailure RateLimited
freshness failure ManagedSettingsFreshnessFailure NoUrl
productService nameShort
freshness failure ManagedSettingsFreshnessFailure UpdateRequired
productService nameShort
productService nameShort
card message
freshness failure ManagedSettingsFreshnessFailure NoToken
signInButton card defaultButtonStyles
signInButton label
signInButton commandService
freshness failure ManagedSettingsFreshnessFailure NoUrl
freshness failure ManagedSettingsFreshnessFailure UpdateRequired
retryButton card defaultButtonStyles
retryButton label
retryButton defaultAccountService forceRefresh retryManagedSettings
openVSCodeButton card defaultButtonStyles secondary
openVSCodeButton label
openVSCodeButton
scheme productService parentPolicyConfig urlProtocol productService urlProtocol
openerService scheme query openExternal
;
import
{
}
from
'../../../../platform/product/common/productService.js'
;
import
{
URI
}
from
'../../../../base/common/uri.js'
;
import
{
}
from
'../../../../platform/commands/common/commands.js'
;
import
{
}
from
'../../../../workbench/services/layout/browser/layoutService.js'
;
import
{
}
from
'../../../../platform/defaultAccount/common/defaultAccount.js'
;
import
{
,
,
}
from
'../../../../platform/policy/common/managedSettingsFreshness.js'
;
export
const
enum
{
=
'agentDisabled'
,
=
'loading'
,
=
'accountPolicyGate'
,
=
'managedSettingsRefresh'
,
}
export
interface
ISessionsBlockedOverlayOptions
{
readonly
:
;
readonly
?
:
readonly
string
[
]
;
readonly
?
:
string
;
readonly
?
:
<
,
{
:
.
}
>
;
}
export
class
SessionsPolicyBlockedOverlay
extends
Disposable
{
private
readonly
:
;
constructor
(
:
,
:
,
@ ICommandService
private
readonly
:
,
@ IOpenerService
private
readonly
:
,
@ IProductService
private
readonly
:
,
@ IDefaultAccountService
private
readonly
:
,
@ IWorkbenchLayoutService
:
,
)
{
super
(
)
;
this
.
=
append
(
,
$
(
'.sessions-policy-blocked-overlay'
)
)
;
this
.
.
setAttribute
(
'role'
,
'dialog'
)
;
this
.
.
setAttribute
(
'aria-modal'
,
'true'
)
;
this
.
.
=
-
1
;
this
.
.
focus
(
)
;
this
.
_register
(
toDisposable
(
(
)
=>
this
.
.
remove
(
)
)
)
;
const
=
.
;
.
.
add
(
'sessions-policy-blocked'
)
;
this
.
_register
(
toDisposable
(
(
)
=>
.
.
remove
(
'sessions-policy-blocked'
)
)
)
;
const
=
append
(
this
.
,
$
(
'.sessions-policy-blocked-card'
)
)
;
this
.
_register
(
addDisposableListener
(
getWindow
(
this
.
)
,
.
KEY_DOWN
,
(
:
)
=>
{
if
(
.
contains
(
.
as
)
)
{
return
;
}
.
preventDefault
(
)
;
.
stopPropagation
(
)
;
}
,
true
)
)
;
this
.
_register
(
addDisposableGenericMouseDownListener
(
this
.
,
=>
{
if
(
.
===
this
.
)
{
.
preventDefault
(
)
;
.
stopPropagation
(
)
;
}
}
)
)
;
append
(
,
$
(
'div.sessions-policy-blocked-logo'
)
)
;
switch
(
.
)
{
case
.
:
this
.
_renderAgentDisabled
(
)
;
break
;
case
.
:
this
.
_renderLoading
(
)
;
break
;
case
.
:
this
.
_renderAccountPolicyGate
(
,
)
;
break
;
case
.
:
this
.
_renderManagedSettingsRefresh
(
,
.
)
;
break
;
}
}
private
_renderAgentDisabled
(
:
)
:
void
{
this
.
.
setAttribute
(
'aria-label'
,
localize
(
'policyBlocked.aria'
,
"Agents disabled by organization policy"
)
)
;
append
(
,
$
(
'h2'
,
undefined
,
localize
(
'policyBlocked.title'
,
"Agents Disabled"
)
)
)
;
const
=
append
(
,
$
(
'p'
)
)
;
append
(
,
.
createTextNode
(
localize
(
'policyBlocked.description'
,
"Your organization has disabled Agents via policy."
)
)
)
;
append
(
,
.
createTextNode
(
' '
)
)
;
const
=
append
(
,
$
(
'a.sessions-policy-blocked-link'
)
)
as
;
.
=
localize
(
'policyBlocked.learnMore'
,
"Learn more"
)
;
.
=
'https://aka.ms/VSCode/Agents/docs'
;
this
.
_register
(
addDisposableListener
(
,
.
CLICK
,
(
)
=>
{
.
preventDefault
(
)
;
this
.
.
open
(
URI
.
parse
(
'https://aka.ms/VSCode/Agents/docs'
)
)
;
}
)
)
;
const
=
this
.
_register
(
new
Button
(
,
{
...
,
:
true
}
)
)
;
.
=
localize
(
'policyBlocked.openVSCode'
,
"Open VS Code"
)
;
this
.
_register
(
.
onDidClick
(
(
)
=>
this
.
_openVSCode
(
)
)
)
;
}
private
_renderLoading
(
:
)
:
void
{
this
.
.
setAttribute
(
'aria-label'
,
localize
(
'loading.aria'
,
"Loading"
)
)
;
append
(
,
$
(
'div.sessions-policy-blocked-progress-bar'
,
undefined
,
$
(
'div.sessions-policy-blocked-progress-bar-fill'
)
)
)
;
}
private
_renderAccountPolicyGate
(
:
,
:
)
:
void
{
this
.
.
setAttribute
(
'aria-label'
,
localize
(
'accountGate.aria'
,
"Sign-in required by your administrator"
)
)
;
append
(
,
$
(
'h2'
,
undefined
,
localize
(
'accountGate.title'
,
"Sign-In Required"
)
)
)
;
const
=
append
(
,
$
(
'p'
)
)
;
if
(
.
)
{
append
(
,
.
createTextNode
(
localize
(
'accountGate.descriptionWithAccount'
,
"The account \"{0}\" is not a member of an organization that your administrator allows for Agents."
,
.
)
)
)
;
}
else
{
append
(
,
.
createTextNode
(
localize
(
'accountGate.descriptionNoAccount'
,
"Your administrator restricts Agents to members of the organizations below."
)
)
)
;
}
const
=
.
??
[
]
;
const
=
.
>
0
&&
!
.
includes
(
'*'
)
;
if
(
)
{
const
=
append
(
,
$
(
'div.sessions-policy-blocked-orgs'
)
)
;
append
(
,
$
(
'p.sessions-policy-blocked-orgs-label'
,
undefined
,
localize
(
'accountGate.approvedOrgs'
,
"Allowed organizations:"
)
)
)
;
const
=
append
(
,
$
(
'ul'
)
)
;
for
(
const
of
)
{
append
(
,
$
(
'li'
,
undefined
,
)
)
;
}
}
const
=
append
(
,
$
(
'p.sessions-policy-blocked-footer'
)
)
;
append
(
,
.
createTextNode
(
localize
(
'accountGate.contactAdmin'
,
"Contact your administrator for more information."
)
)
)
;
append
(
,
.
createTextNode
(
' '
)
)
;
const
=
append
(
,
$
(
'a.sessions-policy-blocked-link'
)
)
as
;
.
=
localize
(
'accountGate.learnMore'
,
"Learn more"
)
;
.
=
'https://code.visualstudio.com/docs/enterprise/overview'
;
this
.
_register
(
addDisposableListener
(
,
.
CLICK
,
(
)
=>
{
.
preventDefault
(
)
;
this
.
.
open
(
URI
.
parse
(
'https://code.visualstudio.com/docs/enterprise/overview'
)
)
;
}
)
)
;
const
=
this
.
_register
(
new
Button
(
,
{
...
}
)
)
;
.
=
localize
(
'accountGate.signIn'
,
"Sign In"
)
;
this
.
_register
(
.
onDidClick
(
(
)
=>
{
this
.
.
executeCommand
(
'workbench.action.agenticSignIn'
)
;
}
)
)
;
}
private
_renderManagedSettingsRefresh
(
:
,
:
[
'freshness'
]
)
:
void
{
this
.
.
setAttribute
(
'aria-label'
,
localize
(
'managedSettingsRefresh.aria'
,
"Managed settings refresh required"
)
)
;
append
(
,
$
(
'h2'
,
undefined
,
localize
(
'managedSettingsRefresh.title'
,
"Managed Settings Unavailable"
)
)
)
;
const
=
?.
===
.
?
localize
(
'managedSettingsRefresh.noToken'
,
"Sign in so {0} can refresh your organization's managed settings before starting an agent."
,
this
.
.
)
:
?.
===
.
?
localize
(
'managedSettingsRefresh.rateLimited'
,
"Your organization's managed settings service is rate limiting requests. Try again later."
)
:
?.
===
.
?
localize
(
'managedSettingsRefresh.noUrl'
,
"{0} cannot locate your organization's managed settings service. Contact your administrator."
,
this
.
.
)
:
?.
===
.
?
localize
(
'managedSettingsRefresh.updateRequired'
,
"Update {0} to a version that supports your organization's managed settings before starting an agent."
,
this
.
.
)
:
localize
(
'managedSettingsRefresh.failed'
,
"Your organization requires {0} to refresh managed settings whenever it starts or reloads. An error prevented the required policy from being retrieved, so agents are unavailable. Retry, or contact your organization's administrator if the issue persists."
,
this
.
.
)
;
append
(
,
$
(
'p'
,
undefined
,
)
)
;
if
(
?.
===
.
)
{
const
=
this
.
_register
(
new
Button
(
,
{
...
}
)
)
;
.
=
localize
(
'managedSettingsRefresh.signIn'
,
"Sign In"
)
;
this
.
_register
(
.
onDidClick
(
(
)
=>
this
.
.
executeCommand
(
'workbench.action.agenticSignIn'
)
)
)
;
}
else
if
(
?.
!==
.
&&
?.
!==
.
)
{
const
=
this
.
_register
(
new
Button
(
,
{
...
}
)
)
;
.
=
localize
(
'managedSettingsRefresh.retry'
,
"Retry"
)
;
this
.
_register
(
.
onDidClick
(
(
)
=>
this
.
.
refresh
(
{
:
true
,
:
true
}
)
)
)
;
}
const
=
this
.
_register
(
new
Button
(
,
{
...
,
:
true
}
)
)
;
.
=
localize
(
'managedSettingsRefresh.openVSCode'
,
"Open VS Code"
)
;
this
.
_register
(
.
onDidClick
(
(
)
=>
this
.
_openVSCode
(
)
)
)
;
}
private
_openVSCode
(
)
:
void
{
const
=
this
.
.
?.
??
this
.
.
;
this
.
.
open
(
URI
.
from
(
{
,
:
'windowId=_blank'
}
)
,
{
:
true
}
)
;
}
}