dsh-vscode-mode 0.34.0 → 0.36.0
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/README.md +25 -4
- package/lib/client.js +63 -63
- package/lib/client.js.map +1 -1
- package/lib/index.js +1841 -73
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/skills/dsh-vscodemode-html-plan/SKILL.md +23 -0
- package/skills/dsh-vscodemode-html-plan/references/blocks.md +14 -0
- package/skills/dsh-vscodemode-html-plan/runtime/htmlplan.css +20 -0
- package/skills/dsh-vscodemode-html-plan/runtime/htmlplan.js +36 -1
- package/skills/dsh-vscodemode-html-plan/runtime/pack.mjs +35 -4
- package/skills/dsh-vscodemode-html-plan/runtime/plan.mjs +17 -6
- package/src/capture.ts +3 -0
- package/src/client/htmlPlan/HtmlPlanPanel.ts +8 -3
- package/src/client/htmlPlan/planPage.ts +31 -1
- package/src/client/reviewBatch.ts +8 -0
- package/src/client/state/diffSummary.ts +6 -1
- package/src/client/state/reviewFeed.ts +35 -4
- package/src/client/ui/EditorView.ts +7 -0
- package/src/client/ui/McpSettings.ts +21 -0
- package/src/client/ui/OfficialReview.ts +20 -2
- package/src/fileOpenSettings.ts +29 -0
- package/src/htmlPlanAttachments.ts +362 -0
- package/src/htmlPlanCommand.ts +257 -18
- package/src/index.ts +74 -6
- package/src/mcpManaged.ts +12 -3
- package/src/mcpManagerBridge.ts +5 -1
- package/src/mcpRuntime.ts +33 -4
- package/src/pending/capture.ts +32 -4
- package/src/pending/decide.ts +12 -3
- package/src/pending/externalAlign.ts +297 -0
- package/src/pending/externalCapture.ts +581 -0
- package/src/pending/kernel.ts +19 -1
- package/src/pending/persist.ts +114 -12
- package/src/pending/provenance.ts +239 -0
- package/src/pending/store.ts +30 -4
- package/src/pending/vcs.ts +122 -0
- package/src/pendingCompat.ts +13 -6
- package/src/pendingRpc.ts +19 -2
- package/src/rpc.ts +7 -2
- package/src/shared/pendingReview.ts +19 -1
- package/src/shared/review.ts +3 -1
- package/src/shared/rpc.ts +4 -0
package/src/htmlPlanCommand.ts
CHANGED
|
@@ -6,16 +6,28 @@
|
|
|
6
6
|
* - 处理器调用官方 /plan 命令并带上本插件的技能指令,官方 plan 处理器会
|
|
7
7
|
* 进入计划模式并用 agent.steer 把这段指令作为用户消息送出;
|
|
8
8
|
* - 因此这里不自行构造 UserMessage、不碰 plan 模式内部状态,官方不可用时直接报错(fail closed)。
|
|
9
|
+
*
|
|
10
|
+
* 附件:命令声明 input.attachments,官方执行器把 composer 的图片/文件入库后再交给本处理器。
|
|
11
|
+
* 处理器把字节复制到 plans/<slug>/assets/(agent 与打包脚本都读得到的工作区内路径),
|
|
12
|
+
* 并把路径写进指令;失败只降级为说明文字,绝不阻断进入计划模式。
|
|
9
13
|
* @author ddj 2026年11月21号
|
|
10
14
|
*/
|
|
15
|
+
import { mkdir, rmdir, unlink, writeFile } from 'node:fs/promises'
|
|
16
|
+
import { dirname, join } from 'node:path'
|
|
11
17
|
import { log } from './log.js'
|
|
12
|
-
import type
|
|
18
|
+
import { cwdOfSession, type Ctx } from './store.js'
|
|
19
|
+
import {
|
|
20
|
+
attachmentLines,
|
|
21
|
+
slugFromTask,
|
|
22
|
+
stageAttachments,
|
|
23
|
+
type AttachmentStage,
|
|
24
|
+
} from './htmlPlanAttachments.js'
|
|
13
25
|
|
|
14
26
|
/** 命令名(官方语法:小写字母开头,允许数字/_/-)。 */
|
|
15
27
|
export const HTML_PLAN_COMMAND = 'html-plan'
|
|
16
28
|
|
|
17
29
|
/** 命令描述(出现在 / 菜单与命令目录)。 */
|
|
18
|
-
export const HTML_PLAN_DESCRIPTION = '用 HTML 计划页进入计划模式:/html-plan
|
|
30
|
+
export const HTML_PLAN_DESCRIPTION = '用 HTML 计划页进入计划模式:/html-plan <任务>(可附图片或文件)'
|
|
19
31
|
|
|
20
32
|
/** 计划指令模板版本(改文案时便于测试断言)。 */
|
|
21
33
|
export const HTML_PLAN_INSTRUCTION_HEAD = '请使用技能 dsh-vscodemode-html-plan 规划下面的任务,并按 DSH 计划模式提交:'
|
|
@@ -34,7 +46,9 @@ export const HTML_PLAN_DELEGATE_INSTRUCTION = '写页方式:本次已获用户
|
|
|
34
46
|
|
|
35
47
|
/** 明确不委派的指令段(--no-delegate)。 */
|
|
36
48
|
export const HTML_PLAN_SINGLE_AGENT_INSTRUCTION = '写页方式:本次不要委派子 agent,由你自己写计划页并用 plan.mjs 打包。'
|
|
37
|
-
|
|
49
|
+
|
|
50
|
+
/** 官方命令运行时最小结构面(宿主服务,鸭子类型)。 */
|
|
51
|
+
interface CommandsLike {
|
|
38
52
|
register?: (definition: unknown) => unknown
|
|
39
53
|
execute?: (agent: unknown, line: string, attachments: readonly unknown[], signal: AbortSignal) => Promise<{ result?: { kind?: string; text?: string } } | undefined>
|
|
40
54
|
}
|
|
@@ -43,12 +57,55 @@ export const HTML_PLAN_SINGLE_AGENT_INSTRUCTION = '写页方式:本次不要
|
|
|
43
57
|
interface CommandCtxLike {
|
|
44
58
|
commands?: CommandsLike
|
|
45
59
|
effect?: (run: () => unknown, label?: string) => unknown
|
|
60
|
+
get?: (name: string) => unknown
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** 官方命令调用(只声明本命令用到的字段)。 */
|
|
64
|
+
export interface HtmlPlanInvocation {
|
|
65
|
+
/** 接收命令的 agent。 */
|
|
66
|
+
agent?: unknown
|
|
67
|
+
/** 命令名之后的原始输入。 */
|
|
68
|
+
rawInput?: unknown
|
|
69
|
+
/** 取消信号。 */
|
|
70
|
+
signal?: AbortSignal
|
|
71
|
+
/** 已入库的图片/文件块(未声明 attachments 时为空)。 */
|
|
72
|
+
attachments?: readonly unknown[]
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** 附件准备结果(默认实现是落盘;测试可注入假的)。 */
|
|
76
|
+
export interface AttachmentPrep {
|
|
77
|
+
/** 固定 slug;没附件时 null(沿用 agent 自选)。 */
|
|
78
|
+
slug: string | null
|
|
79
|
+
/** 落盘成功的附件数量。 */
|
|
80
|
+
count: number
|
|
81
|
+
/** 追加到指令里的附件段。 */
|
|
82
|
+
lines: string[]
|
|
83
|
+
/** /plan 失败时回滚本次写入的附件。 */
|
|
84
|
+
rollback: () => Promise<void>
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** 指令模板附加信息(固定 slug 与附件段)。 */
|
|
88
|
+
export interface HtmlPlanInstructionExtras {
|
|
89
|
+
/** 固定 slug(有附件时由命令决定)。 */
|
|
90
|
+
slug?: string | null
|
|
91
|
+
/** 附件说明行。 */
|
|
92
|
+
attachmentLines?: readonly string[]
|
|
46
93
|
}
|
|
47
94
|
|
|
48
|
-
/**
|
|
95
|
+
/** 附件存储服务最小结构面。 */
|
|
96
|
+
interface AttachmentStoreLike {
|
|
97
|
+
readImage?: (ref: unknown, signal?: AbortSignal) => Promise<{ data?: unknown }>
|
|
98
|
+
readFileStream?: (ref: unknown, signal?: AbortSignal) => AsyncIterable<Uint8Array>
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** 安装选项(测试可替换指令模板与附件准备)。 */
|
|
49
102
|
export interface HtmlPlanCommandOptions {
|
|
50
|
-
/**
|
|
51
|
-
instructionOf?: (task: string, delegate?: boolean | null) => string
|
|
103
|
+
/** 自定义指令模板(入参为任务文本、委派开关与附加信息)。 */
|
|
104
|
+
instructionOf?: (task: string, delegate?: boolean | null, extras?: HtmlPlanInstructionExtras) => string
|
|
105
|
+
/** 附件准备(默认落盘到 plans/<slug>/assets/);测试可替换。 */
|
|
106
|
+
prepareAttachments?: (invocation: HtmlPlanInvocation, task: string) => Promise<AttachmentPrep>
|
|
107
|
+
/** 宿主上下文:取 attachments 服务与会话工作区。 */
|
|
108
|
+
hostCtx?: unknown
|
|
52
109
|
}
|
|
53
110
|
|
|
54
111
|
/** 命令输入解析结果。 */
|
|
@@ -77,32 +134,194 @@ export function parseHtmlPlanInput(rawInput: unknown): HtmlPlanInput {
|
|
|
77
134
|
}
|
|
78
135
|
return { delegate, task: rest.trim() }
|
|
79
136
|
}
|
|
137
|
+
|
|
80
138
|
/**
|
|
81
139
|
* 构造交给 agent 的计划指令:点名技能、产出路径、打包、标记行与审批方式。
|
|
140
|
+
* 有附件时用命令固定下来的 slug,并把附件段插在步骤之后。
|
|
82
141
|
* @author ddj 2026年11月21号
|
|
83
142
|
* @param task 用户任务文本
|
|
143
|
+
* @param delegate 委派开关(null = 未指定)
|
|
144
|
+
* @param extras 固定 slug 与附件说明
|
|
84
145
|
* @returns 完整用户消息正文
|
|
85
146
|
*/
|
|
86
|
-
export function buildHtmlPlanInstruction(
|
|
147
|
+
export function buildHtmlPlanInstruction(
|
|
148
|
+
task: string,
|
|
149
|
+
delegate: boolean | null = null,
|
|
150
|
+
extras: HtmlPlanInstructionExtras = {},
|
|
151
|
+
): string {
|
|
87
152
|
const objective = String(task ?? '').trim()
|
|
153
|
+
const slug = typeof extras.slug === 'string' && /^[a-z0-9][a-z0-9-]*$/i.test(extras.slug) ? extras.slug : ''
|
|
154
|
+
const pagePath = slug ? 'plans/' + slug + '/plan.html' : 'plans/<slug>/plan.html'
|
|
155
|
+
const packedPath = slug ? 'plans/' + slug + '/plan.packed.html' : 'plans/<slug>/plan.packed.html'
|
|
156
|
+
const command = slug
|
|
157
|
+
? 'node <技能目录>/runtime/plan.mjs ' + slug + ' --root <工作区>'
|
|
158
|
+
: 'node <技能目录>/runtime/plan.mjs <slug> --root <工作区>'
|
|
159
|
+
const check = slug ? 'plan.mjs ' + slug + ' --check' : 'plan.mjs <slug> --check'
|
|
88
160
|
const steps = [
|
|
89
|
-
'1. 先读相关代码与文件,按技能规则写
|
|
90
|
-
'2. 用一条命令打包:
|
|
161
|
+
'1. 先读相关代码与文件,按技能规则写 ' + pagePath + (slug ? '(slug 已固定,不要另起目录)。' : '(slug 用 kebab-case)。'),
|
|
162
|
+
'2. 用一条命令打包:' + command + ',它会复制运行时、pack、清理;再跑 ' + check + ' 确认 plan.packed.html 在位。',
|
|
91
163
|
'3. 计划模式允许写 plans/ 下的计划文件:不要因为「在计划模式」跳过写页面,更不要让我退出计划模式来生成。',
|
|
92
|
-
'4. 页面确认生成后,才调用 exit_plan_mode:正文第一行必须是「# 计划:<标题>」,并单独一行「HTML 计划页:
|
|
164
|
+
'4. 页面确认生成后,才调用 exit_plan_mode:正文第一行必须是「# 计划:<标题>」,并单独一行「HTML 计划页:' + packedPath + '」;没生成成功就别写这一行,改交 Markdown 计划并说明原因。',
|
|
93
165
|
'5. 计划正文同时给出 3~6 行摘要与待决策清单;不要绕过计划模式直接开工。',
|
|
94
166
|
]
|
|
167
|
+
const attachment = (extras.attachmentLines ?? []).filter((line) => typeof line === 'string' && line.trim() !== '')
|
|
95
168
|
const extra = delegate === null ? '' : (delegate ? HTML_PLAN_DELEGATE_INSTRUCTION : HTML_PLAN_SINGLE_AGENT_INSTRUCTION)
|
|
96
|
-
const lines = [
|
|
169
|
+
const lines = [
|
|
170
|
+
HTML_PLAN_INSTRUCTION_HEAD,
|
|
171
|
+
...steps,
|
|
172
|
+
...(attachment.length ? ['', ...attachment] : []),
|
|
173
|
+
...(extra ? [String(steps.length + 1) + '. ' + extra] : []),
|
|
174
|
+
'',
|
|
175
|
+
'任务:' + objective,
|
|
176
|
+
]
|
|
97
177
|
return lines.join('\n')
|
|
98
178
|
}
|
|
99
179
|
|
|
100
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* 取异常的展示文案。
|
|
182
|
+
* @author ddj 2026年11月21号
|
|
183
|
+
* @param error 捕获值
|
|
184
|
+
* @returns 可读文案
|
|
185
|
+
*/
|
|
101
186
|
function messageOf(error: unknown): string {
|
|
102
187
|
if (error instanceof Error) return error.message
|
|
103
188
|
return String(error ?? '未知错误')
|
|
104
189
|
}
|
|
105
190
|
|
|
191
|
+
/**
|
|
192
|
+
* 把流式字节拼成一个 Uint8Array(附件可能是任意长度,不假设单块)。
|
|
193
|
+
* @author ddj 2026年11月24号
|
|
194
|
+
* @param source 按顺序产出的字节块
|
|
195
|
+
* @returns 拼接后的字节
|
|
196
|
+
*/
|
|
197
|
+
async function readChunks(source: AsyncIterable<Uint8Array>): Promise<Uint8Array> {
|
|
198
|
+
const parts: Uint8Array[] = []
|
|
199
|
+
let total = 0
|
|
200
|
+
for await (const part of source) {
|
|
201
|
+
parts.push(part)
|
|
202
|
+
total += part.byteLength
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
const merged = new Uint8Array(total)
|
|
206
|
+
let offset = 0
|
|
207
|
+
for (const part of parts) {
|
|
208
|
+
merged.set(part, offset)
|
|
209
|
+
offset += part.byteLength
|
|
210
|
+
}
|
|
211
|
+
return merged
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* 归一化附件存储返回的字节。
|
|
216
|
+
* @author ddj 2026年11月24号
|
|
217
|
+
* @param value 服务返回值
|
|
218
|
+
* @returns 字节视图
|
|
219
|
+
* @throws 无法识别时抛错(由上层记入 skipped)
|
|
220
|
+
*/
|
|
221
|
+
function toBytes(value: unknown): Uint8Array {
|
|
222
|
+
if (value instanceof Uint8Array) return value
|
|
223
|
+
if (value instanceof ArrayBuffer) return new Uint8Array(value)
|
|
224
|
+
if (ArrayBuffer.isView(value)) return new Uint8Array(value.buffer, value.byteOffset, value.byteLength)
|
|
225
|
+
throw new Error('附件存储返回了无法识别的字节')
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* 回滚本次写入的附件:逐个删除文件,再尝试移除空目录。
|
|
230
|
+
* @author ddj 2026年11月24号
|
|
231
|
+
* @param workspace 工作区绝对路径
|
|
232
|
+
* @param stage 落盘结果
|
|
233
|
+
* @returns 完成后的 Promise(单步失败只忽略)
|
|
234
|
+
*/
|
|
235
|
+
async function rollbackStage(workspace: string, stage: AttachmentStage): Promise<void> {
|
|
236
|
+
for (const file of stage.files) {
|
|
237
|
+
try {
|
|
238
|
+
await unlink(join(workspace, file.relativePath))
|
|
239
|
+
} catch {
|
|
240
|
+
/* 文件可能已被删除 */
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
try {
|
|
244
|
+
await rmdir(join(workspace, stage.dir))
|
|
245
|
+
} catch {
|
|
246
|
+
/* 目录非空或已不存在 */
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* 默认附件准备:把 composer 的图片/文件复制到 plans/<slug>/assets/。
|
|
252
|
+
*
|
|
253
|
+
* 任何失败(服务缺失、读字节失败、写盘失败)都降级成说明行,不阻断进入计划模式;
|
|
254
|
+
* 只有 /plan 调用失败时才会回滚本次写入。
|
|
255
|
+
* @author ddj 2026年11月24号
|
|
256
|
+
* @param hostCtx 宿主上下文
|
|
257
|
+
* @param invocation 官方命令调用
|
|
258
|
+
* @param task 任务文本(派生 slug)
|
|
259
|
+
* @returns 附件准备结果
|
|
260
|
+
*/
|
|
261
|
+
export async function stagePlanFiles(
|
|
262
|
+
hostCtx: unknown,
|
|
263
|
+
invocation: HtmlPlanInvocation,
|
|
264
|
+
task: string,
|
|
265
|
+
): Promise<AttachmentPrep> {
|
|
266
|
+
const empty: AttachmentPrep = { slug: null, count: 0, lines: [], rollback: async () => {} }
|
|
267
|
+
const blocks = Array.isArray(invocation?.attachments) ? invocation.attachments.filter(Boolean) : []
|
|
268
|
+
if (!blocks.length) return empty
|
|
269
|
+
|
|
270
|
+
const ctx = hostCtx as { get?: (name: string) => unknown } | undefined
|
|
271
|
+
const session = (invocation?.agent as { session?: unknown } | undefined)?.session
|
|
272
|
+
const workspace = typeof ctx?.get === 'function' ? cwdOfSession(ctx, session) : null
|
|
273
|
+
const store = typeof ctx?.get === 'function' ? ctx.get('attachments') as AttachmentStoreLike | undefined : undefined
|
|
274
|
+
const readImage = store?.readImage
|
|
275
|
+
const readFileStream = store?.readFileStream
|
|
276
|
+
if (!workspace || typeof readImage !== 'function' || typeof readFileStream !== 'function') {
|
|
277
|
+
return {
|
|
278
|
+
slug: null,
|
|
279
|
+
count: 0,
|
|
280
|
+
lines: ['附件读取失败:当前会话没有可用工作区或附件存储;本次按无附件规划。'],
|
|
281
|
+
rollback: async () => {},
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const slug = slugFromTask(task)
|
|
286
|
+
try {
|
|
287
|
+
const stage = await stageAttachments({
|
|
288
|
+
blocks,
|
|
289
|
+
slug,
|
|
290
|
+
signal: invocation.signal,
|
|
291
|
+
readImage: async (ref, signal) => toBytes((await readImage(ref, signal)).data),
|
|
292
|
+
readFile: async (ref, signal) => readChunks(readFileStream(ref, signal)),
|
|
293
|
+
write: async (relativePath, bytes) => {
|
|
294
|
+
const absolute = join(workspace, relativePath)
|
|
295
|
+
await mkdir(dirname(absolute), { recursive: true })
|
|
296
|
+
await writeFile(absolute, bytes)
|
|
297
|
+
},
|
|
298
|
+
})
|
|
299
|
+
return {
|
|
300
|
+
slug,
|
|
301
|
+
count: stage.files.length,
|
|
302
|
+
lines: attachmentLines(stage),
|
|
303
|
+
rollback: () => rollbackStage(workspace, stage),
|
|
304
|
+
}
|
|
305
|
+
} catch (error) {
|
|
306
|
+
return { slug: null, count: 0, lines: ['附件读取失败:' + messageOf(error) + ';本次按无附件规划。'], rollback: async () => {} }
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* 回滚但不覆盖原始错误。
|
|
312
|
+
* @author ddj 2026年11月24号
|
|
313
|
+
* @param prep 附件准备结果(可能为空)
|
|
314
|
+
* @returns 完成后的 Promise
|
|
315
|
+
*/
|
|
316
|
+
async function rollbackOf(prep: AttachmentPrep | null): Promise<void> {
|
|
317
|
+
if (!prep) return
|
|
318
|
+
try {
|
|
319
|
+
await prep.rollback()
|
|
320
|
+
} catch {
|
|
321
|
+
/* 收尾失败不影响错误上报 */
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
106
325
|
/**
|
|
107
326
|
* 构造 /html-plan 命令定义(导出便于单测直接调用 handler)。
|
|
108
327
|
* @author ddj 2026年11月21号
|
|
@@ -112,26 +331,46 @@ function messageOf(error: unknown): string {
|
|
|
112
331
|
*/
|
|
113
332
|
export function htmlPlanCommandDefinition(commands: CommandsLike, options: HtmlPlanCommandOptions = {}): unknown {
|
|
114
333
|
const instructionOf = typeof options.instructionOf === 'function' ? options.instructionOf : buildHtmlPlanInstruction
|
|
334
|
+
const prepareAttachments = typeof options.prepareAttachments === 'function'
|
|
335
|
+
? options.prepareAttachments
|
|
336
|
+
: (invocation: HtmlPlanInvocation, task: string) => stagePlanFiles(options.hostCtx, invocation, task)
|
|
115
337
|
return {
|
|
116
338
|
name: HTML_PLAN_COMMAND,
|
|
117
339
|
description: HTML_PLAN_DESCRIPTION,
|
|
118
|
-
input: { hint: '
|
|
340
|
+
input: { hint: '<任务描述>(可附图片或文件)', attachments: true },
|
|
119
341
|
/** @private @author ddj 2026年11月21号 @param invocation 官方命令调用。 @returns 成功/错误结算。 */
|
|
120
|
-
handler: async (invocation:
|
|
342
|
+
handler: async (invocation: HtmlPlanInvocation) => {
|
|
121
343
|
const parsed = parseHtmlPlanInput(invocation?.rawInput)
|
|
122
344
|
const task = parsed.task
|
|
123
345
|
if (typeof commands.execute !== 'function') return { kind: 'error', text: '无法进入计划模式:官方 /plan 命令不可用' }
|
|
124
346
|
const signal = invocation?.signal instanceof AbortSignal ? invocation.signal : new AbortController().signal
|
|
347
|
+
|
|
348
|
+
let prep: AttachmentPrep | null = null
|
|
349
|
+
try {
|
|
350
|
+
prep = await prepareAttachments(invocation, task)
|
|
351
|
+
} catch (error) {
|
|
352
|
+
prep = { slug: null, count: 0, lines: ['附件读取失败:' + messageOf(error)], rollback: async () => {} }
|
|
353
|
+
}
|
|
354
|
+
|
|
125
355
|
try {
|
|
126
356
|
const delegateNote = parsed.delegate === null ? '' : '\n' + (parsed.delegate ? HTML_PLAN_DELEGATE_INSTRUCTION : HTML_PLAN_SINGLE_AGENT_INSTRUCTION)
|
|
127
|
-
const
|
|
357
|
+
const extras: HtmlPlanInstructionExtras = { slug: prep?.slug ?? null, attachmentLines: prep?.lines ?? [] }
|
|
358
|
+
const message = task
|
|
359
|
+
? instructionOf(task, parsed.delegate, extras)
|
|
360
|
+
: HTML_PLAN_BARE_INSTRUCTION + delegateNote + (prep?.lines.length ? '\n\n' + prep.lines.join('\n') : '')
|
|
128
361
|
const execution = await commands.execute(invocation?.agent, '/plan ' + message, [], signal)
|
|
129
|
-
if (!execution)
|
|
362
|
+
if (!execution) {
|
|
363
|
+
await rollbackOf(prep)
|
|
364
|
+
return { kind: 'error', text: '无法进入计划模式:官方 /plan 命令不可用' }
|
|
365
|
+
}
|
|
130
366
|
if (execution.result?.kind !== 'success') {
|
|
367
|
+
await rollbackOf(prep)
|
|
131
368
|
return { kind: 'error', text: '无法进入计划模式:' + String(execution.result?.text ?? '未知原因') }
|
|
132
369
|
}
|
|
133
|
-
|
|
370
|
+
const saved = prep && prep.count > 0 && prep.slug ? '(' + String(prep.count) + ' 个附件在 plans/' + prep.slug + '/assets/)' : ''
|
|
371
|
+
return { kind: 'success', text: (task ? 'HTML 计划模式已开启:正在生成 HTML 计划页…' : 'HTML 计划模式已开启:请描述要规划的任务') + saved }
|
|
134
372
|
} catch (error) {
|
|
373
|
+
await rollbackOf(prep)
|
|
135
374
|
return { kind: 'error', text: '无法进入计划模式:' + messageOf(error) }
|
|
136
375
|
}
|
|
137
376
|
},
|
|
@@ -159,7 +398,7 @@ export function installHtmlPlanCommand(ctx: Ctx, options: HtmlPlanCommandOptions
|
|
|
159
398
|
log.warn('/html-plan 未注册:commands 服务不支持 register')
|
|
160
399
|
return
|
|
161
400
|
}
|
|
162
|
-
const mount = (): unknown => commands.register!(htmlPlanCommandDefinition(commands, options))
|
|
401
|
+
const mount = (): unknown => commands.register!(htmlPlanCommandDefinition(commands, { ...options, hostCtx: sctx }))
|
|
163
402
|
try {
|
|
164
403
|
if (typeof commandCtx.effect === 'function') commandCtx.effect(mount, 'vscode-mode: html-plan command')
|
|
165
404
|
else mount()
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,12 @@ import { captureToolResult } from './capture.js'
|
|
|
4
4
|
import { installCapture } from './officialCapture.js'
|
|
5
5
|
import { installEvidence } from './reviewCapture.js'
|
|
6
6
|
import { installPending } from './pending/capture.js'
|
|
7
|
+
import type { PendingWrite } from './pending/capture.js'
|
|
8
|
+
import { installExternalCapture, VCS_WRITE_METHODS, VCS_WRITE_TOOLS } from './pending/externalCapture.js'
|
|
9
|
+
import { windows } from './pending/provenance.js'
|
|
7
10
|
import { recordWrite } from './pending/store.js'
|
|
11
|
+
import { cwdOfSession } from './store.js'
|
|
12
|
+
import { resolveScope } from './registry.js'
|
|
8
13
|
import { trackPendingCover } from './pendingCompat.js'
|
|
9
14
|
import { closeArchiveDbs } from './archiveDb.js'
|
|
10
15
|
import { handleRpc, integrationBaseUrlOf } from './rpc.js'
|
|
@@ -64,7 +69,7 @@ function createRuntime(ctx: Ctx, config: unknown) {
|
|
|
64
69
|
const svnRpc = createSvnRpc({ ctx, settings })
|
|
65
70
|
const dapRpc = createDapRpc(ctx)
|
|
66
71
|
const fileVersions = createFileVersions(ctx)
|
|
67
|
-
return { registry, searcher, contentSearcher, lspManager, lspRpc, aiRpc, svnRpc, dapRpc, fileVersions }
|
|
72
|
+
return { registry, searcher, contentSearcher, lspManager, lspRpc, aiRpc, svnRpc, dapRpc, fileVersions, settings }
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
/**
|
|
@@ -73,14 +78,47 @@ function createRuntime(ctx: Ctx, config: unknown) {
|
|
|
73
78
|
* @param ctx Host context.
|
|
74
79
|
* @param runtime Managers created by this instance.
|
|
75
80
|
*/
|
|
76
|
-
function attachRuntime(ctx: Ctx, runtime: Runtime):
|
|
81
|
+
function attachRuntime(ctx: Ctx, runtime: Runtime): { external: ReturnType<typeof installExternalCapture> } {
|
|
77
82
|
const evidence = installEvidence(ctx)
|
|
78
83
|
const stopCapture = installCapture(ctx, (cwd, snapshot) => { evidence.persist(cwd, snapshot); return true })
|
|
79
|
-
|
|
80
|
-
|
|
84
|
+
/** @author ddj 2026年11月24号 @param write 已确认的一次写入 @returns 无;落库失败不打断用户工具调用 */
|
|
85
|
+
function recordPendingWrite(write: PendingWrite): void {
|
|
81
86
|
try { trackPendingCover(write.cwd, write.path, true, write.sessionId) } catch { /* 内存登记失败不阻断采集 */ }
|
|
82
87
|
try { recordWrite(write) } catch (error) { log.warn('待审差异落库失败:' + String(error)) }
|
|
88
|
+
}
|
|
89
|
+
// 待审累计基线:只有写后内容确实变化才落库,异常一律不打断用户工具调用
|
|
90
|
+
const pending = installPending(ctx, recordPendingWrite)
|
|
91
|
+
// 外部改动采集:非 DSH 文件工具(bash 里的 node -e、脚本、生成器)写盘也进审查面板
|
|
92
|
+
const external = installExternalCapture({
|
|
93
|
+
ctx,
|
|
94
|
+
settings: () => runtime.settings.external(),
|
|
95
|
+
record: recordPendingWrite,
|
|
83
96
|
})
|
|
97
|
+
/**
|
|
98
|
+
* @author ddj 2026年11月24号
|
|
99
|
+
* @description: 任一工具调用期间都是 agent 写入窗口:bash / python 写盘落在窗口内时归属 agent。
|
|
100
|
+
* 版本库写工具结束后再补扫一次,把命令造成的成片变化对齐进待审投影。
|
|
101
|
+
* @param exec 工具执行描述
|
|
102
|
+
* @param next 原始分发
|
|
103
|
+
* @returns 原始结果
|
|
104
|
+
*/
|
|
105
|
+
function aroundToolWindow(exec: { name?: unknown; agent?: { session?: unknown } }, next: () => Promise<unknown>): Promise<unknown> {
|
|
106
|
+
windows.enterTool()
|
|
107
|
+
return Promise.resolve()
|
|
108
|
+
.then(next)
|
|
109
|
+
.finally(() => {
|
|
110
|
+
windows.exitTool()
|
|
111
|
+
if (!VCS_WRITE_TOOLS.has(String(exec.name ?? ''))) return
|
|
112
|
+
const cwd = cwdOfSession(ctx, exec.agent?.session)
|
|
113
|
+
if (cwd) external.requestAlign(cwd)
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
/** @author ddj 2026年11月24号 @param session 新建会话 @returns 无;工作区可用即开始监听 */
|
|
117
|
+
function onCreated(session: { id?: unknown }): void {
|
|
118
|
+
if (typeof session.id !== 'string') return
|
|
119
|
+
const cwd = cwdOfSession(ctx, session)
|
|
120
|
+
if (cwd) external.ensure(cwd, session.id)
|
|
121
|
+
}
|
|
84
122
|
/** @author ddj 2026年09月28号 @param exec Tool execution. @param result Tool result. */
|
|
85
123
|
function onResult(exec: unknown, result: unknown): void {
|
|
86
124
|
void captureToolResult(ctx, runtime.registry, exec, result)
|
|
@@ -89,6 +127,7 @@ function attachRuntime(ctx: Ctx, runtime: Runtime): void {
|
|
|
89
127
|
function onDisposed(session: { id?: unknown }): void {
|
|
90
128
|
const cwd = cwdOf(session)
|
|
91
129
|
if (cwd) {
|
|
130
|
+
external.dismiss(cwd)
|
|
92
131
|
runtime.registry.delete(cwd)
|
|
93
132
|
runtime.searcher.dispose(cwd)
|
|
94
133
|
runtime.contentSearcher.dispose(cwd)
|
|
@@ -101,6 +140,8 @@ function attachRuntime(ctx: Ctx, runtime: Runtime): void {
|
|
|
101
140
|
await stopCapture()
|
|
102
141
|
evidence.dispose()
|
|
103
142
|
pending.dispose()
|
|
143
|
+
external.dispose()
|
|
144
|
+
windows.dispose()
|
|
104
145
|
runtime.fileVersions.dispose()
|
|
105
146
|
closeArchiveDbs()
|
|
106
147
|
disposeAllServers()
|
|
@@ -108,9 +149,14 @@ function attachRuntime(ctx: Ctx, runtime: Runtime): void {
|
|
|
108
149
|
await Promise.allSettled(tasks.map((run) => Promise.resolve().then(run)))
|
|
109
150
|
}
|
|
110
151
|
ctx.on('tools/result', onResult)
|
|
152
|
+
ctx.on('tools/execute', aroundToolWindow)
|
|
153
|
+
ctx.on('session/created', onCreated)
|
|
111
154
|
ctx.on('session/disposed', onDisposed)
|
|
155
|
+
// 启动时给已有会话的工作区各开一份监听(会话内 cd 后由 session/created 与 ensure 幂等补齐)
|
|
156
|
+
for (const session of ctx.get('sessions').list()) onCreated(session)
|
|
112
157
|
ctx.effect(() => cleanup, 'vscode-mode:runtime')
|
|
113
158
|
hookExitReclaim()
|
|
159
|
+
return { external }
|
|
114
160
|
}
|
|
115
161
|
|
|
116
162
|
/**
|
|
@@ -136,13 +182,35 @@ export async function apply(ctx: Ctx, config?: unknown): Promise<void> {
|
|
|
136
182
|
bindHostLog(ctx)
|
|
137
183
|
const runtime = createRuntime(ctx, config)
|
|
138
184
|
const warnings: string[] = []
|
|
139
|
-
attachRuntime(ctx, runtime)
|
|
185
|
+
const capture = attachRuntime(ctx, runtime)
|
|
140
186
|
installContent(ctx)
|
|
187
|
+
/** 版本库写操作后的补扫串行链:并发 RPC 也不会叠出多次补扫。 */
|
|
188
|
+
let alignChain: Promise<void> = Promise.resolve()
|
|
141
189
|
/** @author ddj 2026年09月28号 @param method RPC name. @param args Typed request. @returns RPC result. */
|
|
142
190
|
function dispatch<M extends RpcMethod>(method: M, args: RpcRequestMap[M]) {
|
|
143
191
|
const { registry, searcher, contentSearcher, lspRpc, aiRpc, fileVersions, svnRpc, dapRpc } = runtime
|
|
144
|
-
|
|
192
|
+
const pendingResult = handleRpc(ctx, registry, method, args, searcher, contentSearcher, lspRpc.handlers,
|
|
145
193
|
aiRpc.handlers, fileVersions, svnRpc.handlers as Partial<RpcHandlerMap>, dapRpc.handlers)
|
|
194
|
+
// 版本库写操作(提交/更新/还原/清理…)之后补扫一次:命令造成的成片变化要能进待审投影
|
|
195
|
+
if (!VCS_WRITE_METHODS.has(method)) return pendingResult
|
|
196
|
+
alignChain = alignChain.then(async () => {
|
|
197
|
+
const cwd = await workspaceOfSession((args as { sessionId?: string } | undefined)?.sessionId)
|
|
198
|
+
if (cwd) capture.external.requestAlign(cwd)
|
|
199
|
+
}).catch(() => {})
|
|
200
|
+
return pendingResult
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* @author ddj 2026年11月24号
|
|
204
|
+
* @description: 取 RPC 参数里的会话工作区;取不到就跳过补扫,绝不影响 RPC 本身。
|
|
205
|
+
* @param sessionId 请求会话
|
|
206
|
+
* @returns 工作区路径或 null
|
|
207
|
+
*/
|
|
208
|
+
async function workspaceOfSession(sessionId: string | undefined): Promise<string | null> {
|
|
209
|
+
try {
|
|
210
|
+
if (!sessionId) return null
|
|
211
|
+
const scope = await resolveScope(ctx, sessionId)
|
|
212
|
+
return 'err' in scope ? null : scope.cwd
|
|
213
|
+
} catch { return null }
|
|
146
214
|
}
|
|
147
215
|
/** @author ddj 2026年09月28号 @param warning Startup compatibility diagnostic. */
|
|
148
216
|
function noteWarning(warning: string): void { warnings.push(warning) }
|
package/src/mcpManaged.ts
CHANGED
|
@@ -25,6 +25,10 @@ export interface ManagedState {
|
|
|
25
25
|
error?: string
|
|
26
26
|
/** 官方报告的 OAuth 授权阶段。 */
|
|
27
27
|
phase?: string
|
|
28
|
+
/** 官方报告的真连上时刻(epoch 毫秒,仅 connected 状态有)。 */
|
|
29
|
+
connectedAt?: number
|
|
30
|
+
/** 本条注册的挂载时刻(epoch 毫秒),供会话卡片算耗时。 */
|
|
31
|
+
since?: number
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
/** 一条托管注册的账目。 */
|
|
@@ -39,6 +43,8 @@ interface Held {
|
|
|
39
43
|
key: string
|
|
40
44
|
/** 需求计数:归零才真正注销。 */
|
|
41
45
|
refs: number
|
|
46
|
+
/** 注册时刻:会话卡片按它算本服务器的耗时。 */
|
|
47
|
+
mountedAt: number
|
|
42
48
|
/** 注销函数;注册失败时缺省。 */
|
|
43
49
|
dispose?: () => void
|
|
44
50
|
}
|
|
@@ -197,7 +203,7 @@ export class ManagedProject {
|
|
|
197
203
|
*/
|
|
198
204
|
private mount(path: string, server: string, def: ManagedDef, refs: number): void {
|
|
199
205
|
const name = managedName(path, server)
|
|
200
|
-
const record: Held = { name, path, server, key: keyOf(def), refs }
|
|
206
|
+
const record: Held = { name, path, server, key: keyOf(def), refs, mountedAt: Date.now() }
|
|
201
207
|
this.held.set(name, record)
|
|
202
208
|
const reason = this.conflictOf(name)
|
|
203
209
|
if (reason) {
|
|
@@ -269,7 +275,7 @@ export class ManagedProject {
|
|
|
269
275
|
}
|
|
270
276
|
|
|
271
277
|
/**
|
|
272
|
-
*
|
|
278
|
+
* 读一条托管的当前状态;挂载时刻与官方连上时刻一并带出。
|
|
273
279
|
* @public @author ddj 2026年11月23号
|
|
274
280
|
* @param path 工作区路径
|
|
275
281
|
* @param server 服务器名
|
|
@@ -277,12 +283,15 @@ export class ManagedProject {
|
|
|
277
283
|
*/
|
|
278
284
|
stateOf(path: string, server: string): ManagedState {
|
|
279
285
|
const name = managedName(path, server)
|
|
286
|
+
const held = this.held.get(name)
|
|
280
287
|
const view = this.views.get(name)
|
|
281
288
|
// 没注册过就不是 disabled:那是「按需、还没人用」,面板按 configured 显示。
|
|
282
|
-
if (!view) return { state:
|
|
289
|
+
if (!view) return held ? { state: 'unknown', since: held.mountedAt } : { state: 'idle' }
|
|
283
290
|
const state: ManagedState = { state: view.state }
|
|
291
|
+
if (held) state.since = held.mountedAt
|
|
284
292
|
if (view.error) state.error = view.error
|
|
285
293
|
if (view.phase) state.phase = view.phase
|
|
294
|
+
if (view.connectedAt !== undefined) state.connectedAt = view.connectedAt
|
|
286
295
|
return state
|
|
287
296
|
}
|
|
288
297
|
|
package/src/mcpManagerBridge.ts
CHANGED
|
@@ -33,6 +33,8 @@ export interface ManagerView {
|
|
|
33
33
|
state: string
|
|
34
34
|
error?: string
|
|
35
35
|
phase?: string
|
|
36
|
+
/** 官方报告的真连上时刻(epoch 毫秒,仅 connected 状态有)。 */
|
|
37
|
+
connectedAt?: number
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
/** 官方 manager 的最小能力面;服务缺失即 available() === false。 */
|
|
@@ -56,7 +58,7 @@ interface HostLike { get: (name: string) => unknown }
|
|
|
56
58
|
interface RawView {
|
|
57
59
|
name?: unknown
|
|
58
60
|
configured?: unknown
|
|
59
|
-
status?: { state?: unknown; reason?: unknown; lastError?: unknown; result?: { message?: unknown } }
|
|
61
|
+
status?: { state?: unknown; reason?: unknown; lastError?: unknown; connectedAt?: unknown; result?: { message?: unknown } }
|
|
60
62
|
authorization?: { phase?: unknown }
|
|
61
63
|
}
|
|
62
64
|
|
|
@@ -165,6 +167,8 @@ export function toView(raw: unknown): ManagerView {
|
|
|
165
167
|
const result: ManagerView = { name, configured: view.configured === true, state }
|
|
166
168
|
if (message) result.error = message
|
|
167
169
|
if (phase) result.phase = phase
|
|
170
|
+
// 只有真连上才带这个时刻,会话卡片据此算本服务器的真实初始化耗时。
|
|
171
|
+
if (typeof status.connectedAt === 'number') result.connectedAt = status.connectedAt
|
|
168
172
|
return result
|
|
169
173
|
}
|
|
170
174
|
|
package/src/mcpRuntime.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { loadHostModule } from './hostImport.js'
|
|
|
3
3
|
import { entriesOf, MCP_PACKAGE, publicConfig, toolsOf } from './mcp.js'
|
|
4
4
|
import { isProjectEntryId } from './compat.js'
|
|
5
5
|
import { matchWorkspace } from './mcpIsolation.js'
|
|
6
|
-
import { ManagedProject, managedName } from './mcpManaged.js'
|
|
6
|
+
import { ManagedProject, managedName, type ManagedState } from './mcpManaged.js'
|
|
7
7
|
import { managerPort } from './mcpManagerBridge.js'
|
|
8
8
|
import { listProjects, projectEntryId, reconcileProject } from './mcpProject.js'
|
|
9
9
|
import { parseMcpPolicy, type McpPolicy, type McpPhase, type McpSessionServer, type McpSessionStatus, type MpcConfig, type MpcServer, type MpcStatus } from './shared/mcp.js'
|
|
@@ -257,6 +257,8 @@ export class McpRuntime {
|
|
|
257
257
|
if (!def.enabled || record.holds.has(name) || !path) continue
|
|
258
258
|
record.holds.set(name, managed.hold(path, name))
|
|
259
259
|
}
|
|
260
|
+
// 托管后端不经过 syncAgent,配置就绪时刻要在这里落账,否则会话状态永远停在 preparing。
|
|
261
|
+
record.finishedAt ??= Date.now()
|
|
260
262
|
this.changed()
|
|
261
263
|
}
|
|
262
264
|
|
|
@@ -453,9 +455,12 @@ export class McpRuntime {
|
|
|
453
455
|
|
|
454
456
|
/** @private @author ddj 2026年10月20号 @param agent Owner. @param record Ledger. @returns Server phases with caller-local timing, not pooled connection age. */
|
|
455
457
|
private sessionServers(agent: any, record: AgentRecord): McpSessionServer[] {
|
|
458
|
+
const managed = this.probeBackend() === 'manager' ? this.managedOf() : undefined
|
|
459
|
+
const path = managed ? this.workspace(agent) ?? '' : ''
|
|
456
460
|
return this.catalogue(agent).map(({ serverName, phase }) => {
|
|
457
461
|
const instance = record.instances.get(serverName)
|
|
458
|
-
|
|
462
|
+
// 托管后端不建本会话的连接账目,阶段与时间只能取官方报告,不能再按「没实例就是 idle」处理。
|
|
463
|
+
if (!instance) return this.managedServer(record, serverName, phase, managed?.stateOf(path, serverName))
|
|
459
464
|
const entry = instance.lease.entry
|
|
460
465
|
return { serverName, phase, startedAt: instance.startedAt, phaseAt: Math.max(instance.startedAt, entry.phaseAt),
|
|
461
466
|
finishedAt: entry.finishedAt && Math.max(instance.startedAt, entry.finishedAt), error: entry.error, reused: instance.reused,
|
|
@@ -464,6 +469,27 @@ export class McpRuntime {
|
|
|
464
469
|
})
|
|
465
470
|
}
|
|
466
471
|
|
|
472
|
+
/**
|
|
473
|
+
* 托管后端的一条服务器状态:阶段取 catalogue 的官方映射,时间取挂载时刻与官方连上时刻。
|
|
474
|
+
* @private @author ddj 2026年11月24号
|
|
475
|
+
* @param record 会话账目
|
|
476
|
+
* @param serverName 服务器名
|
|
477
|
+
* @param phase 官方状态映射后的阶段
|
|
478
|
+
* @param state 官方托管状态;连接池后端不传
|
|
479
|
+
* @returns 会话里的一条服务器状态
|
|
480
|
+
*/
|
|
481
|
+
private managedServer(record: AgentRecord, serverName: string, phase: McpPhase, state?: ManagedState): McpSessionServer {
|
|
482
|
+
const startedAt = state?.since ?? record.finishedAt ?? record.startedAt
|
|
483
|
+
// 只有落定的阶段才收尾,正在起来的阶段留空,前端按秒继续走。
|
|
484
|
+
let finishedAt: number | undefined
|
|
485
|
+
if (phase === 'ready') finishedAt = state?.connectedAt ?? startedAt
|
|
486
|
+
else if (phase === 'error') finishedAt = startedAt
|
|
487
|
+
|
|
488
|
+
const server: McpSessionServer = { serverName, phase, startedAt, phaseAt: finishedAt ?? startedAt, finishedAt }
|
|
489
|
+
if (state?.error) server.error = state.error
|
|
490
|
+
return server
|
|
491
|
+
}
|
|
492
|
+
|
|
467
493
|
/** @public @author ddj 2026年09月28号 @param path Workspace. @returns Masked configuration and pool/lease counts; initialization is not health. */
|
|
468
494
|
views(path: string): MpcServer[] {
|
|
469
495
|
if (this.probeBackend() === 'manager') return this.viewsManaged(path)
|
|
@@ -547,6 +573,9 @@ export function leftoverOf(ctx: Ctx): string[] {
|
|
|
547
573
|
.map((entry) => String(entry.id))
|
|
548
574
|
}
|
|
549
575
|
|
|
576
|
+
/** 官方状态里算「还在起来」的那几个:连接中、重连退避、等凭据、等授权。 */
|
|
577
|
+
const STARTING_STATES = new Set(['connecting', 'reconnecting', 'waiting-credentials', 'waiting-authorization'])
|
|
578
|
+
|
|
550
579
|
/**
|
|
551
580
|
* 官方状态 → 插件阶段:未知一律 idle,不假装连上。
|
|
552
581
|
* @private @author ddj 2026年11月23号
|
|
@@ -555,7 +584,7 @@ export function leftoverOf(ctx: Ctx): string[] {
|
|
|
555
584
|
*/
|
|
556
585
|
function managedPhase(state: string): McpPhase {
|
|
557
586
|
if (state === 'connected') return 'ready'
|
|
558
|
-
if (state
|
|
587
|
+
if (STARTING_STATES.has(state)) return 'starting'
|
|
559
588
|
if (state === 'failed') return 'error'
|
|
560
589
|
return 'idle'
|
|
561
590
|
}
|
|
@@ -570,7 +599,7 @@ function managedPhase(state: string): McpPhase {
|
|
|
570
599
|
function managedStatusOf(enabled: boolean, state: string): MpcStatus {
|
|
571
600
|
if (!enabled) return 'disabled'
|
|
572
601
|
if (state === 'connected') return 'connected'
|
|
573
|
-
if (state
|
|
602
|
+
if (STARTING_STATES.has(state)) return 'connecting'
|
|
574
603
|
if (state === 'failed') return 'error'
|
|
575
604
|
return 'configured'
|
|
576
605
|
}
|