Реверснутый zcode с своими фишками и плагинами · VibeGit
Реверснутый zcode с своими фишками и плагинами Реверснутая ade zcode без z ai, с массовой загрузкой ключей, умным апи роутингом, плагином для командной разработки
reversnutyy-zcode-s-svoimi-fishkami-i-plaginami / fork / marketplace / plugins / aura-team / scripts / mcp-server.mjs 247 строк · изменён 13 нояб., 21:19
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
import { createInterface } from 'node:readline' ;
import { agentRpc, taskLine, ServiceError , STATUS_RU } from './client.mjs' ;
const SERVER_INFO = { name : 'aura-team' , version : '1.0.0' } ;
const STATUS_ENUM = [ 'todo' , 'doing' , 'review' , 'done' ] ;
const PRIORITY_ENUM = [ 'low' ,
teamIdProp
taskIdProp
taskFields
tools
teamIdProp
r a
lines
r
r length lines
r lines
lines r
teamIdProp
r a
text r
r
text r
teamIdProp
r a
r a r
groups a s a
list r t s
list
groups r
teamIdProp
r a
head
head r taskLine r
teamIdProp taskIdProp
t a
lines t
t lines t
t length lines t
t length
lines
h t lines
lines t
teamIdProp taskFields
t a
t
teamIdProp taskIdProp taskFields
t a
t
teamIdProp taskIdProp
t a
t
teamIdProp
r a
text r
r
text r
byName tools t t
process
tool byName params name
tool
args params params params
text data tool args
text
data data data data data
err
text err err
text
id method params msg
isRequest id id
method
isRequest
id
params protocolVersion
isRequest id
isRequest
id
tools name description inputSchema annotations
isRequest id params
isRequest id
err
isRequest id err message err
rl process
inflight
rl
s line
s
msg
msg s
batch msg msg msg
m batch
p m inflight p
inflight p
rl
inflight
process
'normal'
,
'high'
,
'urgent'
]
;
const
=
{
teamId
:
{
type
:
'string'
,
description
:
'ID команды; по умолчанию — выбранная в панели. Team id (defaults to the selected team).'
}
}
;
const
=
{
taskId
:
{
type
:
'string'
,
description
:
'ID задачи или префикс ≥6 символов (можно с #). Task id or ≥6-char prefix, e.g. "#1a2b3c4d".'
}
}
;
const
=
{
title
:
{
type
:
'string'
,
description
:
'Заголовок. Title.'
}
,
description
:
{
type
:
'string'
,
description
:
'Описание (markdown). Description.'
}
,
status
:
{
type
:
'string'
,
enum
:
STATUS_ENUM
,
description
:
'Колонка: todo / doing / review / done.'
}
,
priority
:
{
type
:
'string'
,
enum
:
PRIORITY_ENUM
,
description
:
'Приоритет. Priority.'
}
,
labels
:
{
type
:
'array'
,
items
:
{
type
:
'string'
}
,
maxItems
:
8
,
description
:
'Метки (до 8). Labels.'
}
,
assignee
:
{
type
:
'string'
,
description
:
'Исполнитель: имя, email или id участника. Assignee display name / email / id.'
}
,
dueAt
:
{
type
:
[
'string'
,
'null'
]
,
description
:
'Дедлайн ISO-8601 (например 2026-11-20) или null. Due date.'
}
,
}
;
const
READ
=
{
readOnlyHint
:
true
,
destructiveHint
:
false
,
idempotentHint
:
true
,
openWorldHint
:
false
}
;
const
WRITE
=
{
readOnlyHint
:
false
,
destructiveHint
:
false
,
idempotentHint
:
false
,
openWorldHint
:
false
}
;
const
=
[
{
name
:
'team_whoami'
,
description
:
'Кто я в Aura Team: пользователь, выбранная команда, роль, список команд. Who am I: user, selected team, role.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
}
,
additionalProperties
:
false
}
,
annotations
:
{
title
:
'Aura Team: кто я'
,
...
READ
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'whoami'
,
)
;
const
=
[
` Пользователь: ${ r. user ?. displayName ?? '—' } < ${ r. user ?. email ?? '—' } > `
,
.
teamId
?
` Команда: « ${ r. teamName } » ( ${ r. role } ) · id ${ r. teamId } `
:
'Команда не выбрана.'
,
]
;
if
(
.
teams
?.
>
1
)
.
push
(
` Все команды: ${ r. teams . map ( ( t ) => ` « ${ t. name } » ( ${ t. role } ) ` ) . join ( ', ' ) } `
)
;
if
(
.
workspace
)
.
push
(
` Рабочая папка: ${ r. workspace } `
)
;
return
{
text
:
.
join
(
'\n'
)
,
data
:
}
;
}
,
}
,
{
name
:
'team_members'
,
description
:
'Участники команды: имя, email, роль, онлайн. Team members with roles and online status.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
}
,
additionalProperties
:
false
}
,
annotations
:
{
title
:
'Aura Team: участники'
,
...
READ
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'members'
,
)
;
const
=
.
length
?
.
map
(
(
m
)
=>
` ${ m. online ? '●' : '○' } ${ m. displayName } < ${ m. email } > — ${ m. role } `
)
.
join
(
'\n'
)
:
'В команде нет участников.'
;
return
{
,
data
:
{
members
:
}
}
;
}
,
}
,
{
name
:
'team_board'
,
description
:
'Канбан-доска команды (все задачи или одна колонка). Team kanban board, optionally filtered by status.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
status
:
{
type
:
'string'
,
enum
:
STATUS_ENUM
,
description
:
'Только эта колонка. Filter by status.'
}
}
,
additionalProperties
:
false
,
}
,
annotations
:
{
title
:
'Aura Team: доска'
,
...
READ
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'board'
,
)
;
if
(
!
.
tasks
.
length
)
return
{
text
:
.
status
?
` В колонке « ${ STATUS_RU [ a. status ] } » задач нет. `
:
'На доске нет задач.'
,
data
:
}
;
const
=
STATUS_ENUM
.
filter
(
(
s
)
=>
!
.
status
||
===
.
status
)
.
map
(
(
s
)
=>
{
const
=
.
tasks
.
filter
(
(
t
)
=>
.
status
===
)
;
return
.
length
?
` ## ${ STATUS_RU [ s] } ( ${ list. length } )\n ${ list. map ( taskLine) . join ( '\n' ) } `
:
null
;
}
)
.
filter
(
Boolean
)
;
return
{
text
:
.
join
(
'\n\n'
)
,
data
:
}
;
}
,
}
,
{
name
:
'team_my_tasks'
,
description
:
'Мои открытые задачи в выбранной команде. My open tasks in the selected team.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
includeDone
:
{
type
:
'boolean'
,
description
:
'Включить завершённые. Include done tasks.'
}
}
,
additionalProperties
:
false
,
}
,
annotations
:
{
title
:
'Aura Team: мои задачи'
,
...
READ
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'myTasks'
,
)
;
const
=
` Команда « ${ r. teamName ?? r. teamId } »: ${ r. tasks . length ? ` ваших открытых задач — ${ r. tasks . length } ` : 'у вас нет открытых задач' } . `
;
return
{
text
:
[
,
...
.
tasks
.
map
(
)
]
.
join
(
'\n'
)
,
data
:
}
;
}
,
}
,
{
name
:
'team_get_task'
,
description
:
'Полная карточка задачи: описание, история изменений, связанные коммиты. Full task details with history and linked commits.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
...
}
,
required
:
[
'taskId'
]
,
additionalProperties
:
false
}
,
annotations
:
{
title
:
'Aura Team: задача'
,
...
READ
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'getTask'
,
)
;
const
=
[
taskLine
(
)
,
` id: ${ t. id } `
]
;
if
(
.
description
)
.
push
(
''
,
.
description
)
;
if
(
.
commits
?.
)
.
push
(
''
,
'Коммиты:'
,
...
.
commits
.
map
(
(
c
)
=>
` - ${ String ( c. hash ) . slice ( 0 , 10 ) } ${ c. author ?? '' } ${ c. repositoryUrl ?? '' } `
.
trim
(
)
)
)
;
if
(
.
history
?.
)
{
.
push
(
''
,
'История:'
)
;
for
(
const
of
.
history
.
slice
(
0
,
10
)
)
.
push
(
` - ${ String ( h. createdAt ) . slice ( 0 , 16 ) . replace ( 'T' , ' ' ) } ${ h. userName } : ${ h. action } ${ h. details ?. status ? ` → ${ h. details . status } ` : '' } `
)
;
}
return
{
text
:
.
join
(
'\n'
)
,
data
:
}
;
}
,
}
,
{
name
:
'team_create_task'
,
description
:
'Создать задачу на доске команды (исполнитель по умолчанию — я). Create a task; assignee defaults to me.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
...
}
,
required
:
[
'title'
]
,
additionalProperties
:
false
}
,
annotations
:
{
title
:
'Aura Team: создать задачу'
,
...
WRITE
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'createTask'
,
)
;
return
{
text
:
` Создана задача ${ taskLine ( t) } \nСсылайтесь на неё как # ${ t. shortId } . `
,
data
:
}
;
}
,
}
,
{
name
:
'team_update_task'
,
description
:
'Изменить задачу: статус, приоритет, заголовок, описание, метки, исполнителя, дедлайн. Update task fields.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
...
,
...
,
assignee
:
{
type
:
[
'string'
,
'null'
]
,
description
:
'Исполнитель (имя/email/id) или null — снять. Assignee or null to unassign.'
}
}
,
required
:
[
'taskId'
]
,
additionalProperties
:
false
,
}
,
annotations
:
{
title
:
'Aura Team: изменить задачу'
,
...
WRITE
,
idempotentHint
:
true
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'updateTask'
,
)
;
return
{
text
:
` Обновлено: ${ taskLine ( t) } `
,
data
:
}
;
}
,
}
,
{
name
:
'team_move_task'
,
description
:
'Переместить задачу в колонку: doing — взял в работу, review — готово к проверке, done — завершено. Move a task to a column.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
...
,
status
:
{
type
:
'string'
,
enum
:
STATUS_ENUM
}
}
,
required
:
[
'taskId'
,
'status'
]
,
additionalProperties
:
false
,
}
,
annotations
:
{
title
:
'Aura Team: переместить задачу'
,
...
WRITE
,
idempotentHint
:
true
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'moveTask'
,
)
;
return
{
text
:
` # ${ t. shortId } → ${ STATUS_RU [ t. status ] ?? t. status } : « ${ t. title } » `
,
data
:
}
;
}
,
}
,
{
name
:
'team_activity'
,
description
:
'Лента событий команды (последние действия). Recent team activity feed.'
,
inputSchema
:
{
type
:
'object'
,
properties
:
{
...
,
limit
:
{
type
:
'integer'
,
minimum
:
1
,
maximum
:
100
,
description
:
'Сколько событий (по умолчанию 20).'
}
}
,
additionalProperties
:
false
,
}
,
annotations
:
{
title
:
'Aura Team: лента'
,
...
READ
}
,
run
:
async
(
a
)
=>
{
const
=
await
agentRpc
(
'activity'
,
)
;
const
=
.
length
?
.
map
(
(
e
)
=>
` ${ String ( e. createdAt ) . slice ( 0 , 16 ) . replace ( 'T' , ' ' ) } ${ e. userName } : ${ e. action } ${ e. taskTitle ? ` « ${ e. taskTitle } » ` : '' } `
)
.
join
(
'\n'
)
:
'Событий пока нет.'
;
return
{
,
data
:
{
events
:
}
}
;
}
,
}
,
]
;
const
=
new
Map
(
.
map
(
(
t
)
=>
[
.
name
,
]
)
)
;
function
write
(
msg
)
{
.
stdout
.
write
(
` ${ JSON . stringify ( msg) } \n `
)
;
}
async
function
callTool
(
params
)
{
const
=
.
get
(
?.
)
;
if
(
!
)
return
{
content
:
[
{
type
:
'text'
,
text
:
` Неизвестный инструмент: ${ params?. name} `
}
]
,
isError
:
true
}
;
const
=
.
arguments
&&
typeof
.
arguments
===
'object'
?
.
arguments
:
{
}
;
try
{
const
{
,
}
=
await
.
run
(
)
;
return
{
content
:
[
{
type
:
'text'
,
}
]
,
structuredContent
:
&&
typeof
===
'object'
&&
!
Array
.
isArray
(
)
?
:
{
result
:
}
,
}
;
}
catch
(
)
{
const
=
instanceof
ServiceError
?
.
message
:
` Ошибка Aura Team: ${ err?. message ?? err} `
;
return
{
content
:
[
{
type
:
'text'
,
}
]
,
isError
:
true
}
;
}
}
async
function
handle
(
msg
)
{
const
{
,
,
}
=
;
const
=
!==
undefined
&&
!==
null
;
try
{
switch
(
)
{
case
'initialize'
:
return
&&
write
(
{
jsonrpc
:
'2.0'
,
,
result
:
{
protocolVersion
:
?.
??
'2025-06-18'
,
capabilities
:
{
tools
:
{
listChanged
:
false
}
}
,
serverInfo
:
SERVER_INFO
,
instructions
:
'Aura Team: задачи команды (канбан). Ссылайтесь на задачи как #<shortId>; берёте в работу — team_move_task doing, закончили — review; добавляйте #<shortId> в сообщение коммита.'
,
}
,
}
)
;
case
'notifications/initialized'
:
case
'notifications/cancelled'
:
return
undefined
;
case
'ping'
:
return
&&
write
(
{
jsonrpc
:
'2.0'
,
,
result
:
{
}
}
)
;
case
'tools/list'
:
return
&&
write
(
{
jsonrpc
:
'2.0'
,
,
result
:
{
tools
:
.
map
(
(
{ name, description, inputSchema, annotations }
)
=>
(
{
,
,
,
}
)
)
}
,
}
)
;
case
'tools/call'
:
return
&&
write
(
{
jsonrpc
:
'2.0'
,
,
result
:
await
callTool
(
)
}
)
;
default
:
return
&&
write
(
{
jsonrpc
:
'2.0'
,
,
error
:
{
code
:
-
32601
,
message
:
` Method not found: ${ method} `
}
}
)
;
}
}
catch
(
)
{
if
(
)
write
(
{
jsonrpc
:
'2.0'
,
,
error
:
{
code
:
-
32603
,
message
:
String
(
?.
??
)
}
}
)
;
}
}
const
=
createInterface
(
{
input
:
.
stdin
,
crlfDelay
:
Infinity
}
)
;
const
=
new
Set
(
)
;
.
on
(
'line'
,
(
line
)
=>
{
const
=
.
trim
(
)
;
if
(
!
)
return
;
let
;
try
{
=
JSON
.
parse
(
)
;
}
catch
{
write
(
{
jsonrpc
:
'2.0'
,
id
:
null
,
error
:
{
code
:
-
32700
,
message
:
'Parse error'
}
}
)
;
return
;
}
const
=
Array
.
isArray
(
)
?
:
[
]
;
for
(
const
of
)
{
const
=
handle
(
)
.
finally
(
(
)
=>
.
delete
(
)
)
;
.
add
(
)
;
}
}
)
;
.
on
(
'close'
,
async
(
)
=>
{
await
Promise
.
allSettled
(
[
...
]
)
;
.
exit
(
0
)
;
}
)
;