From 67b7227abf94e2750cfbfe1baf90c9e63b840f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chaonan=E2=80=9D?= Date: Thu, 13 Aug 2026 19:55:34 +0800 Subject: [PATCH] fix(popup): point record prompt at the ./trace directory bundle --- apps/extension/src/entrypoints/popup/App.test.tsx | 7 +++++++ packages/i18n/src/locales/en-US/extension.json | 4 ++-- packages/i18n/src/locales/zh-CN/extension.json | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/extension/src/entrypoints/popup/App.test.tsx b/apps/extension/src/entrypoints/popup/App.test.tsx index 5800104..3260e80 100644 --- a/apps/extension/src/entrypoints/popup/App.test.tsx +++ b/apps/extension/src/entrypoints/popup/App.test.tsx @@ -218,6 +218,13 @@ describe("App", () => { expect(copied).toContain("--browser 03c3e47f"); expect(copied).toContain('--purpose "发布 wiki 文档"'); expect(copied).not.toMatch(/bsk record start[^\n]*--url/); + expect(copied).toContain("./trace"); + expect(copied).toContain("trace.json"); + expect(copied).toContain("pages/"); + expect(copied).toContain("总结我做了什么"); + expect(copied).not.toContain("不要重跑"); + expect(copied).not.toContain("pages + steps"); + expect(copied).not.toContain("@eN"); // Button label stays static; a transient toast confirms the copy. expect(copyButton.textContent).toContain("复制录制指令"); await waitFor(() => expect(screen.getByRole("status").textContent).toContain("已复制")); diff --git a/packages/i18n/src/locales/en-US/extension.json b/packages/i18n/src/locales/en-US/extension.json index 4ef0956..5d73423 100644 --- a/packages/i18n/src/locales/en-US/extension.json +++ b/packages/i18n/src/locales/en-US/extension.json @@ -49,7 +49,7 @@ "record": { "sectionTitle": "Action recording", "cardDesc": "Record your actions for Agent reference", - "sectionHint": "Generates a recording instruction — send it to your Agent to start recording your actions; the Agent can then use the recording to automate similar tasks.", + "sectionHint": "Generates a recording instruction — send it to your Agent to start recording your actions; the Agent can then use the resulting trace bundle to automate similar tasks.", "topicLabel": "Topic (optional)", "topicPlaceholder": "e.g. Publish an article", "startUrlLabel": "Starting URL (optional)", @@ -57,7 +57,7 @@ "copyButton": "Copy recording instructions", "copied": "Copied", "hintDisconnected": "Available when connected", - "promptTemplate": "Use BrowserSkill's `bsk` CLI to record the browser actions I'm about to demonstrate.\n\nSteps:\n1. Run: {{command}}\n2. Once you confirm it's started, I'll operate in the opened window myself.\n3. After I click Finish, read the returned trace.json and summarize the actions (pages + steps); don't re-run or \"verify\"." + "promptTemplate": "Use BrowserSkill's `bsk` CLI to record the browser actions I'm about to demonstrate.\n\nSteps:\n1. Run: {{command}}\n2. Once you confirm it's started, I'll operate in the opened window myself.\n3. After I click Finish, read the written `./trace` bundle (`trace.json` + `pages/`) and summarize what I did." } }, "controlOverlay": { diff --git a/packages/i18n/src/locales/zh-CN/extension.json b/packages/i18n/src/locales/zh-CN/extension.json index 331e173..8a5b9f9 100644 --- a/packages/i18n/src/locales/zh-CN/extension.json +++ b/packages/i18n/src/locales/zh-CN/extension.json @@ -49,7 +49,7 @@ "record": { "sectionTitle": "操作录制", "cardDesc": "录制你的操作,供 Agent 参考", - "sectionHint": "生成一段录制指令,发给 Agent 后可以启动插件录制用户操作,之后 Agent 可以参考录制结果自动完成同类任务。", + "sectionHint": "生成一段录制指令,发给 Agent 后可以启动插件录制用户操作,之后 Agent 可以参考写出的 trace 目录包自动完成同类任务。", "topicLabel": "操作主题(可选)", "topicPlaceholder": "例如:发布一篇文章", "startUrlLabel": "起始网址(可选)", @@ -57,7 +57,7 @@ "copyButton": "复制录制指令", "copied": "已复制", "hintDisconnected": "连接后可用", - "promptTemplate": "用 BrowserSkill 的 `bsk` CLI 录制我接下来的浏览器操作。\n\n步骤:\n1. 执行:{{command}}\n2. 你确认已开始后,我会在打开的窗口里自己操作。\n3. 我点“结束”后,读取返回的 trace.json 并总结操作(pages + steps),不要重跑或“验证”。" + "promptTemplate": "用 BrowserSkill 的 `bsk` CLI 录制我接下来的浏览器操作。\n\n步骤:\n1. 执行:{{command}}\n2. 你确认已开始后,我会在打开的窗口里自己操作。\n3. 我点“结束”后,读取写出的 `./trace` 目录包(`trace.json` + `pages/`),总结我做了什么。" } }, "controlOverlay": {