dsh-browser-firefox 0.3.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/src/token.ts ADDED
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Bridge bearer-token lifecycle: generation, constant-time verification, and
3
+ * file persistence under the dsh home directory.
4
+ *
5
+ * The token authenticates the browser extension against the bridge WebSocket.
6
+ * It is NOT the /api trust fence (that stays untouched); it is the bridge
7
+ * path's own auth because the bridge route lives outside the fence by design.
8
+ *
9
+ * @module
10
+ */
11
+
12
+ import { randomBytes, timingSafeEqual } from 'node:crypto'
13
+ import { chmod, mkdir, readFile, rename, writeFile } from 'node:fs/promises'
14
+ import { dirname } from 'node:path'
15
+ import { dshHomePath } from '@deepseek-ai/dsh-home-paths'
16
+
17
+ /** File name of the persisted token inside the dsh home. */
18
+ export const TOKEN_FILE_NAME = 'ext-bridge-token'
19
+
20
+ /**
21
+ * Generate a fresh token as lowercase hex.
22
+ * @param bytes - entropy bytes; defaults to DEFAULT_TOKEN_BYTES (256-bit).
23
+ * @returns the hex token string.
24
+ */
25
+ export function generateToken(bytes: number = 32): string {
26
+ return randomBytes(bytes).toString('hex')
27
+ }
28
+
29
+ /**
30
+ * Constant-time token comparison. Length mismatch fails fast (still constant
31
+ * time on the compared prefix) — a wrong-length token can never verify.
32
+ * @param expected - the configured token.
33
+ * @param actual - the token presented by the client.
34
+ * @returns true only when both are equal-length hex and byte-equal.
35
+ */
36
+ export function verifyToken(expected: string, actual: string): boolean {
37
+ // UTF-8 byte comparison, not hex decoding: hex would silently truncate
38
+ // non-hex configured tokens (Buffer.from('fixed-token','hex') is empty)
39
+ // and collapse 'deadbeef-team' to 'deadbeef', losing token entropy.
40
+ const expectedBuf = Buffer.from(expected, 'utf8')
41
+ const actualBuf = Buffer.from(actual, 'utf8')
42
+ if (expectedBuf.length === 0 || expectedBuf.length !== actualBuf.length) return false
43
+ return timingSafeEqual(expectedBuf, actualBuf)
44
+ }
45
+
46
+ /**
47
+ * Path of the persisted token file under the dsh home.
48
+ * @returns absolute path like `~/.dsh/ext-bridge-token`.
49
+ */
50
+ export function tokenFilePath(): string {
51
+ return dshHomePath(TOKEN_FILE_NAME)
52
+ }
53
+
54
+ /**
55
+ * Read the persisted token; returns undefined when absent or unreadable.
56
+ * @param file - token file path.
57
+ * @returns the stored hex token, trimmed.
58
+ */
59
+ export async function readTokenFile(file: string = tokenFilePath()): Promise<string | undefined> {
60
+ try {
61
+ return (await readFile(file, 'utf8')).trim()
62
+ } catch {
63
+ return undefined
64
+ }
65
+ }
66
+
67
+ /**
68
+ * Persist a token atomically (temp file + rename) with 0600 permissions.
69
+ * @param token - hex token to persist.
70
+ * @param file - token file path.
71
+ */
72
+ export async function writeTokenFile(token: string, file: string = tokenFilePath()): Promise<void> {
73
+ await mkdir(dirname(file), { recursive: true })
74
+ const temp = `${file}.tmp-${process.pid}`
75
+ await writeFile(temp, `${token}\n`, { mode: 0o600 })
76
+ await chmod(temp, 0o600)
77
+ await rename(temp, file)
78
+ }
79
+
80
+ /**
81
+ * Resolve the bridge token: an explicitly configured token wins; otherwise the
82
+ * persisted file is reused when present, and a fresh token is generated and
83
+ * persisted otherwise.
84
+ * @param configured - token from plugin config, or undefined.
85
+ * @param file - token file path (injectable for tests).
86
+ * @returns `{ token, file, generated }` where `generated` records whether a new token was minted.
87
+ */
88
+ export async function resolveToken(
89
+ configured: string | undefined,
90
+ file: string = tokenFilePath(),
91
+ ): Promise<{ token: string; file: string; generated: boolean }> {
92
+ if (configured !== undefined && configured.length > 0) {
93
+ return { token: configured, file, generated: false }
94
+ }
95
+ const persisted = await readTokenFile(file)
96
+ if (persisted !== undefined && persisted.length > 0) return { token: persisted, file, generated: false }
97
+ const token = generateToken()
98
+ await writeTokenFile(token, file)
99
+ return { token, file, generated: true }
100
+ }
package/src/tools.ts ADDED
@@ -0,0 +1,396 @@
1
+ /**
2
+ * Model-facing browser tools. Every tool executes by dispatching a `tool.call`
3
+ * over the bridge to the connected extension, which performs the action in the
4
+ * user's active tab and returns a pure-text result.
5
+ *
6
+ * The whole surface is text-only by design (DeepSeek models have no vision):
7
+ * `browser_snapshot` renders the page as structured text with a numbered
8
+ * interactive inventory, and every other tool addresses elements by that
9
+ * inventory's stable index. Results are single `{ text }` objects rendered as
10
+ * one text ContentBlock.
11
+ *
12
+ * @module
13
+ */
14
+
15
+ import type { Context } from '@deepseek-ai/cordis'
16
+ import type { ToolDefinition } from '@deepseek-ai/dsh-tools'
17
+ import { mkdir, readdir, unlink, writeFile } from 'node:fs/promises'
18
+ import { join } from 'node:path'
19
+ import { dshHomePath } from '@deepseek-ai/dsh-home-paths'
20
+ import type { BridgeServer } from './server.ts'
21
+
22
+ /** Options resolved from plugin config before tool registration. */
23
+ export interface BrowserToolsOptions {
24
+ /** Per-tool-call budget in ms (also the bridge's default). */
25
+ toolTimeoutMs: number
26
+ /** Upper bound on one snapshot's rendered characters. */
27
+ snapshotMaxChars: number
28
+ /** Upper bound on interactive inventory items per snapshot. */
29
+ maxInteractiveItems: number
30
+ }
31
+
32
+ /** 截图临时目录名(位于 session workspace 下)。 */
33
+ const SCREENSHOT_DIR_NAME = '.dsh-browser-tmp'
34
+ /** 截图目录最多保留的张数,超出自动删最旧(不留垃圾)。 */
35
+ const MAX_SCREENSHOTS = 20
36
+
37
+ /** 截图目录:保存在 session workspace 下(视觉工具能读),失败回退 dshHomePath。 */
38
+ function screenshotDir(workspacePath: string): string {
39
+ return join(workspacePath, SCREENSHOT_DIR_NAME)
40
+ }
41
+
42
+ /** 解析 session workspace:优先 exec.agent.session.header.cwd,回退 process.cwd / dshHomePath。 */
43
+ function resolveWorkspace(exec: { agent?: { session?: { header?: { cwd?: string } } } | null }): string {
44
+ const cwd = exec.agent?.session?.header?.cwd
45
+ if (cwd !== undefined && cwd !== '') return cwd
46
+ try {
47
+ return process.cwd()
48
+ } catch {
49
+ return dshHomePath('browser-screenshots')
50
+ }
51
+ }
52
+
53
+ /** 保存一张截图(data URL → PNG 文件),返回绝对路径;超上限删最旧。 */
54
+ async function saveScreenshot(dataUrl: string, workspacePath: string): Promise<string> {
55
+ const match = /^data:image\/(?:png|jpeg);base64,(.+)$/.exec(dataUrl)
56
+ if (match === null) throw new Error('扩展返回的不是图片 data URL')
57
+ const encoded = match[1]
58
+ if (encoded === undefined) throw new Error('data URL 缺少 base64 内容')
59
+ const dir = screenshotDir(workspacePath)
60
+ await mkdir(dir, { recursive: true })
61
+ const file = join(dir, `screenshot-${Date.now()}.png`)
62
+ await writeFile(file, Buffer.from(encoded, 'base64'))
63
+ await pruneScreenshots(dir)
64
+ return file
65
+ }
66
+
67
+ /** 删除截图目录里最旧的截图,直到数量 <= MAX_SCREENSHOTS。 */
68
+ async function pruneScreenshots(dir: string): Promise<void> {
69
+ let files: string[]
70
+ try {
71
+ files = (await readdir(dir)).filter((f) => /^screenshot-\d+\.png$/.test(f)).sort()
72
+ } catch {
73
+ return
74
+ }
75
+ while (files.length > MAX_SCREENSHOTS) {
76
+ const oldest = files.shift()
77
+ if (oldest !== undefined) await unlink(join(dir, oldest)).catch(() => {})
78
+ }
79
+ }
80
+
81
+ /** 清理全部截图,返回删除数量。 */
82
+ async function clearScreenshots(workspacePath: string): Promise<number> {
83
+ const dir = screenshotDir(workspacePath)
84
+ let count = 0
85
+ try {
86
+ const files = (await readdir(dir)).filter((f) => /\.png$/.test(f))
87
+ for (const f of files) {
88
+ await unlink(join(dir, f)).catch(() => {})
89
+ count += 1
90
+ }
91
+ } catch {
92
+ // 目录不存在等,视为无截图
93
+ }
94
+ return count
95
+ }
96
+
97
+ /** Canonical tool result: one text payload. */
98
+ interface TextResult {
99
+ text: string
100
+ }
101
+
102
+ /** Output contract shared by every browser tool. */
103
+ const TEXT_OUTPUT: ToolDefinition['output'] = {
104
+ schema: {
105
+ type: 'object',
106
+ additionalProperties: false,
107
+ properties: { text: { type: 'string' } },
108
+ required: ['text'],
109
+ },
110
+ render: (_args, value) => {
111
+ const result = value as unknown as TextResult
112
+ return [{ type: 'text', text: result.text }]
113
+ },
114
+ }
115
+
116
+ /** 显式 JSON Schema object 顶层:空 parameters 对象会被 DeepSeek 适配器序列化成
117
+ * `{ type: null }` 并遭 API 拒绝(400 INVALID_REQUEST),所以每个工具的参数
118
+ * schema 都必须显式声明 `type: 'object'`。 */
119
+ const OBJECT_SCHEMA = { type: 'object' as const, additionalProperties: false as const }
120
+
121
+ /** The keys the extension accepts as wire action names (tool name == action name). */
122
+ export const BROWSER_TOOL_NAMES = [
123
+ 'browser_snapshot',
124
+ 'browser_click',
125
+ 'browser_type',
126
+ 'browser_press',
127
+ 'browser_scroll',
128
+ 'browser_navigate',
129
+ 'browser_back',
130
+ 'browser_forward',
131
+ 'browser_reload',
132
+ 'browser_get_text',
133
+ 'browser_wait',
134
+ 'browser_evaluate',
135
+ 'browser_screenshot',
136
+ 'browser_list_tabs',
137
+ ] as const
138
+
139
+ /**
140
+ * Register the browser tools on `ctx.tools`. Disposers are returned for the
141
+ * caller's effect to own; each tool's cooperative timeout budget is declared
142
+ * so `@deepseek-ai/dsh-timeout-policy` can enforce it, and every execute
143
+ * forwards `exec.signal` into the bridge call (abort settles it).
144
+ *
145
+ * @param ctx - Cordis context with the tools service.
146
+ * @param bridge - the authenticated bridge server.
147
+ * @param options - resolved tool budgets.
148
+ * @returns disposers keyed by tool name.
149
+ */
150
+ export function registerBrowserTools(
151
+ ctx: Context,
152
+ bridge: BridgeServer,
153
+ options: BrowserToolsOptions,
154
+ ): Map<string, () => void> {
155
+ const disposers = new Map<string, () => void>()
156
+ const call = async (exec: { signal: AbortSignal; agent?: { id?: string } | null }, name: string, args: Record<string, unknown>): Promise<TextResult> => {
157
+ const sessionId = exec.agent?.id
158
+ const result = await bridge.requestTool(name, args, exec.signal, options.toolTimeoutMs, sessionId)
159
+ return normalizeTextResult(result, name)
160
+ }
161
+
162
+ for (const tool of defineTools(call, options)) {
163
+ disposers.set(tool.name, ctx.tools.register(tool))
164
+ }
165
+
166
+ // 截图工具:扩展 captureTab 返回 data URL,插件保存为 PNG(多张并存,超上限删最旧)。
167
+ const screenshot: ToolDefinition = {
168
+ name: 'browser_screenshot',
169
+ description: '对当前浏览器页面截图,保存为 PNG 文件并返回绝对路径。'
170
+ + '仅在页面内容是图片/公式/验证码等无法用文本表达时才调用(视觉兜底)。'
171
+ + '截图保存在 session workspace 的 .dsh-browser-tmp/ 目录,最多保留 20 张(超出自动删最旧);'
172
+ + '看完后可用 browser_clear_screenshots 清理。',
173
+ parameters: {
174
+ ...OBJECT_SCHEMA,
175
+ fullPage: { type: 'boolean', description: '整页滚动截图(暂未实现,预留)。' },
176
+ region: { type: 'string', description: '区域截图 CSS 选择器(暂未实现,预留)。' },
177
+ },
178
+ timeoutMs: options.toolTimeoutMs,
179
+ output: TEXT_OUTPUT,
180
+ execute: async (args, exec) => {
181
+ const sessionId = exec.agent?.id
182
+ const workspace = resolveWorkspace(exec)
183
+ const dataUrl = await bridge.requestTool('browser_screenshot', args as Record<string, unknown>, exec.signal, options.toolTimeoutMs, sessionId)
184
+ if (typeof dataUrl !== 'string') return { text: 'browser_screenshot 返回了非字符串结果' }
185
+ try {
186
+ const path = await saveScreenshot(dataUrl, workspace)
187
+ return { text: `截图已保存: ${path}` }
188
+ } catch (error) {
189
+ return { text: `截图保存失败: ${error instanceof Error ? error.message : String(error)}` }
190
+ }
191
+ },
192
+ }
193
+ disposers.set(screenshot.name, ctx.tools.register(screenshot))
194
+
195
+ // 清理工具:删除全部截图(bridge 本地处理,不经扩展)。
196
+ const clearScreenshotsTool: ToolDefinition = {
197
+ name: 'browser_clear_screenshots',
198
+ description: '删除 browser_screenshot 产生的全部临时截图文件,避免残留垃圾。看完截图后可调用。',
199
+ parameters: { ...OBJECT_SCHEMA, properties: {} },
200
+ timeoutMs: options.toolTimeoutMs,
201
+ output: TEXT_OUTPUT,
202
+ execute: async (_args, exec) => {
203
+ const workspace = resolveWorkspace(exec)
204
+ const count = await clearScreenshots(workspace)
205
+ return { text: `已清理 ${count} 张截图` }
206
+ },
207
+ }
208
+ disposers.set(clearScreenshotsTool.name, ctx.tools.register(clearScreenshotsTool))
209
+
210
+ return disposers
211
+ }
212
+
213
+ /** Normalize the extension's result payload to the canonical `{ text }` shape. */
214
+ function normalizeTextResult(result: unknown, name: string): TextResult {
215
+ if (typeof result === 'object' && result !== null && typeof (result as { text?: unknown }).text === 'string') {
216
+ return { text: (result as { text: string }).text }
217
+ }
218
+ return { text: `${name} returned no text: ${JSON.stringify(result)}` }
219
+ }
220
+
221
+ interface Call {
222
+ (exec: { signal: AbortSignal; agent?: { id?: string } | null }, name: string, args: Record<string, unknown>): Promise<TextResult>
223
+ }
224
+
225
+ /** The v1 tool set, model-perspective contracts only (no transport vocabulary). */
226
+ function defineTools(call: Call, options: BrowserToolsOptions): ToolDefinition[] {
227
+ const snapshot = (): ToolDefinition => ({
228
+ name: 'browser_snapshot',
229
+ description: '读取当前浏览器页面的结构化文本快照(无截图):标题、URL、正文摘要、带编号的可交互元素清单、表单字段。'
230
+ + '编号是后续 browser_click/browser_type 等操作的定位依据。页面未变化时设置 delta=true 只返回变化部分,节省上下文。',
231
+ parameters: {
232
+ ...OBJECT_SCHEMA,
233
+ delta: { type: 'boolean', description: 'true 时只返回相对上次快照的变化(编号、URL、标题)。默认 false 返回完整快照。' },
234
+ region: { type: 'string', description: '可选:只读取页面某个区域(CSS 选择器或 "main"),用于懒加载内容。' },
235
+ },
236
+ timeoutMs: options.toolTimeoutMs,
237
+ output: TEXT_OUTPUT,
238
+ execute: (args, exec) => {
239
+ const a = args as { delta?: boolean; region?: string }
240
+ return call(exec, 'browser_snapshot', {
241
+ ...a.delta !== undefined ? { delta: a.delta } : {},
242
+ ...a.region !== undefined ? { region: a.region } : {},
243
+ })
244
+ },
245
+ })
246
+
247
+ const click = (): ToolDefinition => ({
248
+ name: 'browser_click',
249
+ description: '点击页面元素。用编号 index(来自 browser_snapshot)或 CSS 选择器 selector(配 index 指定第几个匹配)定位。',
250
+ parameters: {
251
+ ...OBJECT_SCHEMA,
252
+ index: { type: 'number', description: 'browser_snapshot 清单中的元素编号(与 selector 二选一)。' },
253
+ selector: { type: 'string', description: 'CSS 选择器(与 index 二选一)。' },
254
+ },
255
+ timeoutMs: options.toolTimeoutMs,
256
+ output: TEXT_OUTPUT,
257
+ execute: (args, exec) => call(exec, 'browser_click', args as Record<string, unknown>),
258
+ })
259
+
260
+ const type = (): ToolDefinition => ({
261
+ name: 'browser_type',
262
+ description: '向当前页面编号为 index 的输入框输入文本。默认追加到现有值之后;replace=true 时先清空再输入。'
263
+ + '敏感字段(密码/卡号)的值不会回传,输入后立即清空本地记录。',
264
+ parameters: {
265
+ ...OBJECT_SCHEMA,
266
+ index: { type: 'number', required: true, description: '表单字段编号(来自 browser_snapshot 的 forms 清单)。' },
267
+ text: { type: 'string', required: true, description: '要输入的文本。' },
268
+ replace: { type: 'boolean', description: 'true 时清空现有值后输入。默认追加。' },
269
+ },
270
+ timeoutMs: options.toolTimeoutMs,
271
+ output: TEXT_OUTPUT,
272
+ execute: (args, exec) => {
273
+ const a = args as { index: number; text: string; replace?: boolean }
274
+ return call(exec, 'browser_type', {
275
+ index: a.index,
276
+ text: a.text,
277
+ ...a.replace !== undefined ? { replace: a.replace } : {},
278
+ })
279
+ },
280
+ })
281
+
282
+ const press = (): ToolDefinition => ({
283
+ name: 'browser_press',
284
+ description: '向当前页面发送一个按键。常用值:Enter、Tab、Escape、ArrowUp、ArrowDown、ArrowLeft、ArrowRight、Backspace、Delete。',
285
+ parameters: {
286
+ ...OBJECT_SCHEMA,
287
+ key: { type: 'string', required: true, description: '按键名(KeyboardEvent.key 语义)。' },
288
+ },
289
+ timeoutMs: options.toolTimeoutMs,
290
+ output: TEXT_OUTPUT,
291
+ execute: (args, exec) => call(exec, 'browser_press', args as Record<string, unknown>),
292
+ })
293
+
294
+ const scroll = (): ToolDefinition => ({
295
+ name: 'browser_scroll',
296
+ description: '滚动当前页面。direction 为 up/down/top/bottom;amount 为像素数(默认一屏)。',
297
+ parameters: {
298
+ ...OBJECT_SCHEMA,
299
+ direction: { type: 'string', required: true, enum: ['up', 'down', 'top', 'bottom'], description: '滚动方向。' },
300
+ amount: { type: 'number', description: '滚动像素数;top/bottom 时忽略。' },
301
+ },
302
+ timeoutMs: options.toolTimeoutMs,
303
+ output: TEXT_OUTPUT,
304
+ execute: (args, exec) => {
305
+ const a = args as { direction: 'up' | 'down' | 'top' | 'bottom'; amount?: number }
306
+ return call(exec, 'browser_scroll', {
307
+ direction: a.direction,
308
+ ...a.amount !== undefined ? { amount: a.amount } : {},
309
+ })
310
+ },
311
+ })
312
+
313
+ const navigate = (): ToolDefinition => ({
314
+ name: 'browser_navigate',
315
+ description: '在当前标签页导航到指定 URL。保留当前登录状态(cookie/会话)。',
316
+ parameters: {
317
+ ...OBJECT_SCHEMA,
318
+ url: { type: 'string', required: true, description: '完整 URL(http/https)。' },
319
+ },
320
+ timeoutMs: options.toolTimeoutMs,
321
+ output: TEXT_OUTPUT,
322
+ execute: (args, exec) => call(exec, 'browser_navigate', args as Record<string, unknown>),
323
+ })
324
+
325
+ const simple = (name: 'browser_back' | 'browser_forward' | 'browser_reload' | 'browser_list_tabs', description: string): ToolDefinition => ({
326
+ name,
327
+ description,
328
+ parameters: { ...OBJECT_SCHEMA, properties: {} },
329
+ timeoutMs: options.toolTimeoutMs,
330
+ output: TEXT_OUTPUT,
331
+ execute: (_args, exec) => call(exec, name, {}),
332
+ })
333
+
334
+ const getText = (): ToolDefinition => ({
335
+ name: 'browser_get_text',
336
+ description: '读取当前页面指定区域的文本(用于懒加载内容或局部更新)。不带 selector 时返回整个页面的纯文本。',
337
+ parameters: {
338
+ ...OBJECT_SCHEMA,
339
+ selector: { type: 'string', description: 'CSS 选择器;缺省为整个页面。' },
340
+ },
341
+ timeoutMs: options.toolTimeoutMs,
342
+ output: TEXT_OUTPUT,
343
+ execute: (args, exec) => {
344
+ const a = args as { selector?: string }
345
+ return call(exec, 'browser_get_text', { ...a.selector !== undefined ? { selector: a.selector } : {} })
346
+ },
347
+ })
348
+
349
+ const wait = (): ToolDefinition => ({
350
+ name: 'browser_wait',
351
+ description: '等待页面稳定(加载完成且无 DOM 变化)。在点击或导航后需要等结果渲染时使用。',
352
+ parameters: {
353
+ ...OBJECT_SCHEMA,
354
+ ms: { type: 'number', description: '额外等待毫秒数;缺省只做稳定性检测。' },
355
+ },
356
+ timeoutMs: options.toolTimeoutMs,
357
+ output: TEXT_OUTPUT,
358
+ execute: (args, exec) => {
359
+ const a = args as { ms?: number }
360
+ return call(exec, 'browser_wait', { ...a.ms !== undefined ? { ms: a.ms } : {} })
361
+ },
362
+ })
363
+
364
+ const evaluate = (): ToolDefinition => ({
365
+ name: 'browser_evaluate',
366
+ description: '在页面上下文执行受限的 DOM 操作(Firefox 禁止任意 JS,故用预编译操作)。'
367
+ + 'action 支持:count(计数匹配元素)、getText(读文本)、click(点击第 index 个匹配)、setValue(设置值)、querySelectorAll(列出匹配元素)。'
368
+ + '用 CSS 选择器 selector 定位,index 指定第几个匹配(默认 0)。用于 snapshot/click 覆盖不到的 DOM 操作。',
369
+ parameters: {
370
+ ...OBJECT_SCHEMA,
371
+ action: { type: 'string', required: true, enum: ['count', 'getText', 'click', 'setValue', 'querySelectorAll'], description: '操作类型。' },
372
+ selector: { type: 'string', required: true, description: 'CSS 选择器。' },
373
+ index: { type: 'number', description: '匹配元素的序号(默认 0)。' },
374
+ value: { type: 'string', description: 'setValue 时设置的值。' },
375
+ },
376
+ timeoutMs: options.toolTimeoutMs,
377
+ output: TEXT_OUTPUT,
378
+ execute: (args, exec) => call(exec, 'browser_evaluate', args as Record<string, unknown>),
379
+ })
380
+
381
+ return [
382
+ snapshot(),
383
+ click(),
384
+ type(),
385
+ press(),
386
+ scroll(),
387
+ navigate(),
388
+ simple('browser_back', '返回上一页。'),
389
+ simple('browser_forward', '前进到下一页。'),
390
+ simple('browser_reload', '重新加载当前页面。'),
391
+ getText(),
392
+ wait(),
393
+ evaluate(),
394
+ simple('browser_list_tabs', '列出当前会话标签页组中的所有标签页(id、标题、URL,当前工作的用 * 标记)。'),
395
+ ]
396
+ }