You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bd1b768
Browse filesBrowse the repository at this point in the historyBrowse files
feat(app-shell): Connect an AI Assistant opens with what a connected assistant can do, in plain words (#31052)
<!-- claude-projects-attribution: {"github_login":"os-tesla"} -->
_Requested by **Tesla** · [project
thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao4R5vgzn4JR1Ewtt4rWD5cr)_
Part of #30898
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:「连接 AI 助手」页最上方新增一张卡片,用两句白话说明连接后 AI
助手能做什么(以你的身份查找、新建、修改、删除你有权操作的记录,并运行系统操作),再给三条可一键复制的示例请求,并提示先试第一条来确认连接成功。地址卡片和
Claude Code 步骤不再出现 MCP、OAuth 等协议词,只有客户端自己的菜单或表单里用到的地方保留。各客户端里「改用 API
密钥」的提示现在指向「高级:脚本与 CI」区域。
- 为什么改:这个页面的读者不懂 MCP;连接前要先知道助手能为自己做什么,连接后要知道先问什么来确认连上了。
- 风险与回滚:只改页面文案和一张展示卡片,不改服务端行为和连接步骤本身。回滚即 revert 本 PR。
- 先看:`ConnectAgentWidget.tsx`
顶部新卡片,`ui/packages/i18n/src/locales/zh-Hans.ts` 和 `en.ts` 的
`connectAgent.capabilities`,测试文件末尾新增的 describe。
- 两分钟验证:本地部署打开 设置 → 连接 AI 助手,第一张卡片是「连接后,AI
助手能做什么」,下面是三条示例请求和复制按钮;往下的地址卡片标题是「本系统的连接地址」,不再提 OAuth 2.1。
- 需要你做的:无,席位落地。
- **席位意见**:ui 席 2 对照 head `bcbc29ec` 的 diff 复核:15 个文件、+342 /
−102,无受治理路径。「连接 AI
助手」页顶部新增一张卡:用两句白话说明连接后助手能查找、新建、修改、删除你有权操作的记录并运行操作,始终以你的身份;附三条可复制的示例请求和「先试第一条」的提示(页面尚不能判断是否已连接,所以对所有人显示)。地址卡、Claude
Code 步骤和关闭状态不再出现 MCP / OAuth,协议词只留在客户端自己的菜单和表单里;API 密钥提示指向「高级:脚本与
CI」。十个语言包同步,繁体由简体生成。阿语一条旧文案断言改为 toContain,因标题已改写。遗留:Expected
2(已连接的助手与最近调用,等 #30894)和页头副标题。CI 全绿,Clause-② no,不欠契约复审。同意落地。
## What changes
- `ConnectAgentWidget.tsx`: a new first card, "What your AI assistant
can do here". It holds two plain sentences (look up, create, change and
delete the records you may, run actions, always as you), three example
requests each with a copy button, and a line saying to try the first
one, because an answer listing your objects shows the connection works.
The address card follows, then the client picker, as before.
- Copy without protocol words (Expected 3): the address card title and
body, the Claude Code step, and the turned-off empty state now say
"connection address", "sign in in the browser" and "AI assistant
connections". MCP, OAuth and Streamable HTTP remain only where a
client's own menu or form uses them: Codex's "MCP servers" menu,
WorkBuddy's "Configure MCP" button, QwenWork's Streamable HTTP transport
choice, the Transport field values, and the operator setting
`OS_MCP_SERVER_ENABLED` named in the turned-off state.
- The four hints that fall back to an API key (Codex, WorkBuddy, Doubao
Work, QwenWork) said "create a key below". The key form now sits in the
collapsed Advanced section, so they name it: "(create one under
Advanced: scripts and CI below)".
- i18n: seven new keys under `connectAgent.capabilities` and the
reworded strings, in all ten packs; `zh-Hant.ts` regenerated with
`gen:zh-hant`.
- Root changeset `.changeset/30898-connect-agent-what-it-can-do.md`
(`@object-ui/app-shell`, `@object-ui/i18n`: patch).
## Tests
`ConnectAgentWidget.keyName-13355.test.tsx` gets a new describe:
- §1: the capabilities card comes before the address, with body, three
example requests each beside a copy button, and the try-first line.
- §2: every pack carries the seven capability strings, and none is an
English copy.
- §3: no `connectAgent.*` string in any pack contains MCP, OAuth or
Streamable HTTP, outside the four client-form keys.
- §4: each fallback hint contains that pack's `advanced.title`.
Ablation: putting `en.ts` back to its state before this change fails §2,
§3 and §4 (§3 lists `en disabled.title`, `url.title`, `url.body` and
`claudeCode.body`).
Two existing i18n pins moved with the copy:
- `residue-namespaces-3546.test.tsx` pinned the old Arabic turned-off
title verbatim. It now checks that the title keeps the pack's deployment
word, `في هذا النشر`, which is what that case claims.
- The German hints name Advanced without „…“ quotes, so
`de-quote-pairing-3876`'s pinned pair count stays 107.
## Leftovers
- Expected 2, the "connected: which assistant, last call" line, reads
the same per-person records as #30894, which is blocked. This PR ships
only the nothing-connected-yet part: the try-first line, shown to
everyone and never derived from a click.
- Expected 3, outside this PR's surface: the page header subtitle is
page metadata in `packages/mcp/src/connect-ui.ts` ("Give any MCP-capable
AI client governed access … row-level security."). Its translations live
in `packages/platform-objects/src/apps/translations`
(`pages.connect_agent.subtitle`, source-hashed). It still uses protocol
words and goes with Expected 2.
## Verification
Head `bcbc29ec`. The branch was restarted on `main` `115a43ad`, after PR
#30973 merged as `d9d3eb70`, and the change was cherry-picked cleanly. A
full `pnpm build` on that base ran 119/119.
<details><summary>Live check on a local deployment (showcase with the
fresh flag, console Vite dev, admin and member)</summary>
- Before (`main` with #30897): the page opens with "This system's MCP
endpoint" and a paragraph on OAuth 2.1 and row-level security, and no
sentence says what an assistant can do. As admin and as member alike,
the widget plus header carried 7 protocol-word hits on the Claude tab
and 8 on Codex.
- After: the first card is "What your AI assistant can do here", with
the two sentences, then "List the objects I can see." / "Count how many
records each of those objects has." / "What actions can I run here, and
what does each one do?" with copy buttons, then the try-first line.
Below it comes "This system's connection address".
- Protocol-word hits after: 2 on Claude, Cursor and Doubao Work, both
from the page header subtitle (a leftover, see above). Codex has 4: the
header plus its "MCP servers" menu and Streamable HTTP field. WorkBuddy
has 3 (its "Configure MCP" button) and QwenWork 3 (its transport
choice). Admin and member read the same.
</details>
<details><summary>Local tests and gates</summary>
- `pnpm --dir ui exec vitest run packages/app-shell/src/console/connect/
packages/i18n/
packages/app-shell/src/__tests__/product-neutral-renderer.ratchet.test.ts`
→ 100 files, 1693 passed, 13 skipped (widget file 16/16)
- app-shell `tsc --noEmit` and `tsc -p tsconfig.test.json` → exit 0.
eslint on `packages/app-shell/src/console/connect/` → 0 errors (3
pre-existing `no-explicit-any` warnings).
- `pnpm --filter @object-ui/i18n gen:zh-hant` → zh-Hant.ts current.
`pnpm check:test-source-alias` → OK.
- `dispatch-gates --commands` derived 38 commands on bcbc29e, and all
38 exit 0. That includes `node scripts/check-sdui-manifest.mjs` and
`pnpm --dir ui exec vitest run scripts/` (170 files passed). `--ran`
with exit codes: 38 run, 0 NOT-MEASURED (derived zero), 0 UNRUN.
</details>
<!-- signed: domain:ui#2 · os-tesla · session_01L9qibw7DekEe3wx5f3zphf
-->
Co-authored-by: Claude <noreply@anthropic.com>
feat(app-shell): Connect an AI Assistant opens with what a connected assistant can do, in plain words
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
The page now opens with two plain sentences: once connected, your AI assistant can look up, create, change and delete the records you are allowed to, and run this system's actions, always as you. Three example requests follow, each with a copy button, plus a line on which one to try first to see that the connection works. The page cannot yet tell whether you have connected, so that line is shown to everyone. The address card and the Claude Code step no longer speak of MCP or OAuth. Protocol words stay only where a client's own menu or form uses them. The steps that fall back to an API key now point to the "Advanced: scripts and CI" section where the key is created. Seven new strings and the reworded ones ship in every console language pack, with Traditional Chinese generated from Simplified.
Copy file name to clipboardExpand all lines: ui/packages/i18n/src/locales/ar.ts
+18-9Lines changed: 18 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4089,13 +4089,22 @@ const ar = {
4089
4089
requiredFields: "الحقول المطلوبة: {{fields}}",
4090
4090
},
4091
4091
connectAgent: {
4092
+
capabilities: {
4093
+
title: 'ما يمكن لمساعد الذكاء الاصطناعي فعله هنا',
4094
+
body: 'بعد الاتصال، يستطيع مساعد الذكاء الاصطناعي البحث عن السجلات المسموح لك بها وإنشاءها وتعديلها وحذفها، وتشغيل إجراءات هذا النظام. وهو يعمل دائمًا بهويتك: لا يرى ولا يفعل إلا ما تسمح به صلاحياتك.',
4095
+
examplesTitle: 'طلبات يمكنك تجربتها في مساعدك',
4096
+
example1: 'اعرض الكائنات التي يمكنني رؤيتها.',
4097
+
example2: 'احسب عدد السجلات في كل كائن منها.',
4098
+
example3: 'ما الإجراءات التي يمكنني تشغيلها هنا، وماذا يفعل كل منها؟',
4099
+
tryFirst: 'ابدأ بالطلب الأول: إذا أجاب مساعدك بالكائنات التي تعمل عليها، فالاتصال يعمل.',
4100
+
},
4092
4101
disabled: {
4093
-
title: 'MCP معطّل في هذا النشر',
4094
-
body: 'واجهة MCP متوقفة (OS_MCP_SERVER_ENABLED=false). اطلب من المشغّل إعادة تفعيلها.',
4102
+
title: 'الاتصال بمساعدي الذكاء الاصطناعي متوقف في هذا النشر',
4103
+
body: 'الاتصال بمساعدي الذكاء الاصطناعي متوقف في هذا النشر (OS_MCP_SERVER_ENABLED=false)، لذا لا يوجد ما يمكن الاتصال به. اطلب من المشغّل إعادة تشغيله.',
4095
4104
},
4096
4105
url: {
4097
-
title: 'نقطة نهاية MCP لهذا النظام',
4098
-
body: 'أي عميل ذكاء اصطناعي يدعم MCP يتصل عبر هذا العنوان. الهوية ذاتية الخدمة: النشر هو خادم تفويض OAuth 2.1 الخاص به — تسجّل الدخول بهويتك، وكل استدعاء يخضع لصلاحياتك وأمان مستوى الصفوف.',
4106
+
title: 'عنوان الاتصال بهذا النظام',
4107
+
body: 'يتصل مساعد الذكاء الاصطناعي الخاص بك عبر هذا العنوان. تسجّل الدخول بهويتك في المتصفح، لذا يجري كل ما يفعله ضمن صلاحياتك أنت.',
4099
4108
downloadSkill: 'تنزيل SKILL.md',
4100
4109
skillHint: 'مهارة الوكيل المحمولة: تعلّم أي وكيل داعم للمهارات كيفية العمل مع هذا النظام.',
4101
4110
},
@@ -4104,7 +4113,7 @@ const ar = {
4104
4113
reachability: 'يتصل claude.ai (الويب) من خوادم Anthropic — يجب أن يكون النشر متاحًا عبر HTTPS عام. عملاء سطح المكتب والمحليون يصلون أيضًا إلى نشر الشبكات الداخلية.',
4105
4114
},
4106
4115
claudeCode: {
4107
-
body: 'أمر واحد — يفتح تسجيل دخول OAuth تلقائيًا عند أول استخدام:',
4116
+
body: 'أمر واحد — يفتح تسجيل الدخول في المتصفح تلقائيًا عند أول استخدام:',
body: 'في تطبيق Codex: الإعدادات ← خوادم MCP ← إضافة خادم، ثم املأ:',
4121
-
hint: 'احفظ وأعد التشغيل عند المطالبة، ثم انقر على Authenticate بجوار objectstack وسجّل الدخول عبر المتصفح. اكتب /mcp في مربع الكتابة للتحقق من الاتصال. إذا لم يدعم إصدارك تسجيل الدخول عبر المتصفح، فأضف الترويسة Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا أدناه).',
4130
+
hint: 'احفظ وأعد التشغيل عند المطالبة، ثم انقر على Authenticate بجوار objectstack وسجّل الدخول عبر المتصفح. اكتب /mcp في مربع الكتابة للتحقق من الاتصال. إذا لم يدعم إصدارك تسجيل الدخول عبر المتصفح، فأضف الترويسة Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا ضمن «متقدم: البرامج النصية وCI» أدناه).',
4122
4131
},
4123
4132
workbuddy: {
4124
4133
body: 'الموصلات ← موصل مخصص ← إعداد MCP، ثم ادمج هذا الإدخال في mcpServers (يُحفظ في ~/.workbuddy/mcp.json):',
4125
-
hint: 'احفظ ثم انقر على «ثقة» في الموصل objectstack — لا يعمل قبل منحه الثقة. إذا لم يظهر تسجيل الدخول في إصدارك، أضف ترويسة الطلب Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا أدناه).',
4134
+
hint: 'احفظ ثم انقر على «ثقة» في الموصل objectstack — لا يعمل قبل منحه الثقة. إذا لم يظهر تسجيل الدخول في إصدارك، أضف ترويسة الطلب Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا ضمن «متقدم: البرامج النصية وCI» أدناه).',
4126
4135
},
4127
4136
doubao: {
4128
4137
title: 'Doubao Work',
4129
4138
body: 'المهارات · الموصلات ← جديد ← موصل مخصص جديد، ثم املأ:',
4130
-
hint: 'سجّل الدخول عبر المتصفح عند المطالبة. إذا لم يظهر تسجيل الدخول، أضف الترويسة المخصصة Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا أدناه). المهام التي تعمل في السحابة تتطلب نشرًا يمكن الوصول إليه عبر HTTPS عام.',
4139
+
hint: 'سجّل الدخول عبر المتصفح عند المطالبة. إذا لم يظهر تسجيل الدخول، أضف الترويسة المخصصة Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا ضمن «متقدم: البرامج النصية وCI» أدناه). المهام التي تعمل في السحابة تتطلب نشرًا يمكن الوصول إليه عبر HTTPS عام.',
hint: 'أو أضفه يدويًا كـ Streamable HTTP بهذا العنوان. إذا لم يدعم إصدارك تسجيل الدخول عبر المتصفح، أضف ترويسة الطلب Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا أدناه).',
4144
+
hint: 'أو أضفه يدويًا كـ Streamable HTTP بهذا العنوان. إذا لم يدعم إصدارك تسجيل الدخول عبر المتصفح، أضف ترويسة الطلب Authorization: Bearer <مفتاح API> (أنشئ مفتاحًا ضمن «متقدم: البرامج النصية وCI» أدناه).',
0 commit comments