Skip to content

Commit 0fb0dda

Browse files
feat(spec): PLATFORM_TOOLS_BY_PACKAGE['service-ai'] lists read_package_doc and search_package_docs (#27002) (#27011)
<!-- claude-projects-attribution: {"github_login":"os-zhuang"} --> _Requested by **Sam** · [project thread](https://claude.ai/code/project/chan_01GsBogozeZG5sdpAARrN7HP?thread=cmsg_01GsBogozeZG5sdpAARrN7HPGgTM5iHGE5rDJQj2k1LQSS)_ Clause-②: yes (widening) Metadata-protocol: added Fixes #27002 ## 维护者速读 - **改了什么**:平台工具名登记表 `PLATFORM_TOOLS_BY_PACKAGE['service-ai']` 加上 `read_package_doc` 和 `search_package_docs` 两个名字,按字母序插入,其余名字不动。ui 的十个语言包同时补上这两个工具的 `chatbot.tool.*` 文案(各语言的完整句子),因为 ui 的标签一致性测试直接读这张登记表。 - **为什么**:cloud#3337(cloud#3335,#26691 的 cloud 半)给 Ask 助手加了这两个读包文档的工具。cloud 的一致性测试要求登记表与实际注册的工具一致,所以那个 PR 要等这条落地并挪 pin 才能变绿。 - **声明怎么选的**:这是常量列表,不是 schema。Metadata-protocol 记为 `added`,因为改动后 skill 的 `tools[]` 写这两个名字不再被 lint 判为虚构工具,即作者可写的取值多了两个;没有 schema 形状变化,没有导出增删。先例 #16844 的 changeset 没有写这两行声明(当时还没有这条规则);本 PR 按现行 AGENTS.md 补上,changeset 为 minor。ui 的文案改动单独一条 `@object-ui/i18n` patch changeset,声明为 Clause-② no / Metadata-protocol none。 - **需要你做的**:无治理路径。由 cloud seat 2 安排审阅与落地。 ## What changes - `packages/spec/src/system/constants/platform-tool-names.ts`: the two names in `'service-ai'`, alphabetical (`query_records` < `read_package_doc` < `search_knowledge` < `search_package_docs` < `visualize_data`); the group's doc line names the pair. - `packages/lint/src/validate-ai-tool-references.test.ts`: the behavioural pin, beside #16512's: a skill naming both resolves; a third name shaped like them (`list_package_docs`) and registered by nobody is still reported at `skills[0].tools[2]`. - `.changeset/27002-service-ai-package-doc-tool-names.md`: `@objectstack/spec` minor, carrying both declaration lines. - `ui/packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt,ru,zh}.ts`: `chatbot.tool.read_package_doc` and `chatbot.tool.search_package_docs` in every pack, each a sentence in that language (en "Read the app guide" / "Search the app guides", zh 「阅读应用文档」/「在应用文档中查找」), alphabetical beside `search_knowledge`. Required by `ui/packages/plugin-chatbot`'s `toolLabels-locale-parity-7481` and `toolLabels-sentences-12724`, which read this registry from the in-tree spec. - `.changeset/27002-chatbot-tool-labels-package-docs.md`: `@object-ui/i18n` patch, Clause-② no, Metadata-protocol none (root `.changeset/`, which owns the `@object-ui/*` fixed group; `ui/.changeset/` is not read by the release). - The registry's maintenance-contract comment now says a new name also needs its `chatbot.tool.<name>` label in every ui pack. ## Premise, measured At `origin/main` `5e99bd936c`, in `platform-tool-names.ts`: `package_doc` 0 occurrences (absence), `search_knowledge` 1 (positive control). ## Verification Head `29111be8a7` (ui labels), under `os-verify-lock`: - `ui`: `packages/i18n/` + `plugin-chatbot` `toolLabels*` tests: 91 files / 1,401 passed, 13 skipped, exit 0. - Ablation: `ko`'s `search_package_docs` line removed → both label tests red (`ko is missing chatbot.tool entries: [ 'search_package_docs' ]`); restored → 28 passed. Head `f70fec4289` (registry), under `os-verify-lock`: - `pnpm --filter @objectstack/spec build` then `check:generated`: all 14 generated artifacts up to date (no export moved, only a const's value). - `pnpm --filter @objectstack/spec test`: 738 files / 22,130 tests passed, exit 0. - `pnpm --filter @objectstack/spec typecheck`: exit 0, test-layer ledger held. - `packages/lint` `validate-ai-tool-references.test.ts`: 21 passed. - Ablation: the registry file restored to `HEAD~1` (names absent; spec `dist` rebuilt, `search_package_docs` in 0 built files) → the new lint case red (`1 failed | 20 passed`); restored to `HEAD` and rebuilt (2 built files carry the name) → 21 passed. `git status --porcelain` clean after. - `node scripts/check-changeset-no-major.mjs --base 5e99bd9`: exit 0 (the level axis is PR-scoped, judged in CI). ## Downstream - cloud#3337's `service-ai` platform-tool-names conformance test passes at a cloud pin carrying this merge; seat 2 runs that pin round. - Not done on the cloud card, and recorded there: the live Ask transcript for 「大单审批什么时候触发」. The container has no model key, and the HotCRM doc is `crm_sales`, not `crm_sales_opportunities`. It becomes a post-deploy staging read. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QUs3BvjuoCPEwU3eTt6se6 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f9f27a0 commit 0fb0dda

14 files changed

Lines changed: 68 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@object-ui/i18n': patch
3+
---
4+
5+
feat(i18n): `chatbot.tool.read_package_doc` and `chatbot.tool.search_package_docs` labels in all ten packs (#27002)
6+
7+
The spec registry `PLATFORM_TOOLS_BY_PACKAGE['service-ai']` now lists the cloud ask agent's two package-doc tools, so the chatbot's tool timeline can show them. Each pack gets a sentence in its own language ("Read the app guide", "Search the app guides" in English; "阅读应用文档", "在应用文档中查找" in Chinese), keeping the `toolLabels-locale-parity-7481` and `toolLabels-sentences-12724` tests green.
8+
9+
Clause-②: no
10+
Metadata-protocol: none
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): `PLATFORM_TOOLS_BY_PACKAGE['service-ai']` lists `read_package_doc` and `search_package_docs`
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: added
9+
10+
The cloud `ask` agent gains two `service-ai` tools that list and read the installed packages' `doc` items behind the `/meta/doc` audience gate (cloud#3335, the cloud half of #26691). The registry now lists both names, in its alphabetical order, so `PLATFORM_PROVIDED_TOOL_NAMES` carries them: a skill whose `tools[]` names either resolves under ADR-0109 reference integrity instead of being reported as a fictional tool (`ai-skill-tool-unresolved`). That is the whole widening: two more accepted `skill.tools[]` values. No schema shape changes, no export is added or removed, and every other name in the registry stays where it was.

‎packages/lint/src/validate-ai-tool-references.test.ts‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,26 @@ describe('validate-ai-tool-references', () => {
205205
expect(control[0].message).toContain('archive_flow');
206206
});
207207

208+
/**
209+
* [#27002] The two `service-ai` package-doc tools cloud#3335 adds to the
210+
* `ask` agent (`search_package_docs`, `read_package_doc`): the same widening
211+
* #16512 made for five `service-ai-studio` tools, so a skill naming either
212+
* resolves instead of being reported as a fictional tool.
213+
*/
214+
it('resolves the two service-ai package-doc tools (#27002)', () => {
215+
const two = ['search_package_docs', 'read_package_doc'];
216+
expect(validateAiToolReferences({ skills: [{ name: 's', tools: two }] })).toEqual([]);
217+
218+
// The control: a third name shaped like the two and registered by nobody
219+
// is still reported, so this pin fails on a universe widened too far.
220+
const control = validateAiToolReferences({
221+
skills: [{ name: 's', tools: [...two, 'list_package_docs'] }],
222+
});
223+
expect(control).toHaveLength(1);
224+
expect(control[0].path).toBe('skills[0].tools[2]');
225+
expect(control[0].message).toContain('list_package_docs');
226+
});
227+
208228
it('reports stable paths and tolerates junk shapes', () => {
209229
const stack = {
210230
skills: [{ name: 's', tools: ['query_records', 'nope_tool'] }],

‎packages/spec/src/system/constants/platform-tool-names.ts‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@
2828
* Maintenance contract: registering a new tool in a cloud AI package means
2929
* adding its name here. The owning package's conformance test fails
3030
* otherwise — an out-of-date registry is worse than no registry, because
31-
* consumers now trust it.
31+
* consumers now trust it. A new name also needs its `chatbot.tool.<name>`
32+
* label in every pack under `ui/packages/i18n/src/locales/` — the ui
33+
* plugin-chatbot label-parity tests read this registry.
3234
*/
3335

3436
/**
@@ -38,14 +40,18 @@
3840
export const PLATFORM_TOOLS_BY_PACKAGE: Readonly<Record<string, readonly string[]>> = {
3941
/**
4042
* `@objectstack/service-ai` (cloud) — the `ask` data product's shared
41-
* data/knowledge/visualization tools.
43+
* data/knowledge/visualization tools, and the package-doc pair that reads the
44+
* installed packages' `doc` items behind the `/meta/doc` audience gate
45+
* (cloud#3335).
4246
*/
4347
'service-ai': [
4448
'aggregate_data',
4549
'get_record',
4650
'query_data',
4751
'query_records',
52+
'read_package_doc',
4853
'search_knowledge',
54+
'search_package_docs',
4955
'visualize_data',
5056
],
5157
/**

‎ui/packages/i18n/src/locales/ar.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3926,7 +3926,9 @@ const ar = {
39263926
get_record: "قراءة هذا السجل",
39273927
query_data: "الاستعلام عن البيانات المطلوبة",
39283928
query_records: "البحث عن السجلات المطابقة",
3929+
read_package_doc: "قراءة دليل التطبيق",
39293930
search_knowledge: "البحث في قاعدة المعرفة عن معلومات",
3931+
search_package_docs: "البحث في أدلة التطبيق",
39303932
visualize_data: "عرض البيانات في رسم بياني",
39313933
add_field: "إضافة حقل إلى الكائن",
39323934
apply_blueprint: "بناء التطبيق وفق الخطة",

‎ui/packages/i18n/src/locales/de.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3649,7 +3649,9 @@ const de = {
36493649
get_record: "Den Datensatz lesen",
36503650
query_data: "Die benötigten Daten abfragen",
36513651
query_records: "Passende Datensätze suchen",
3652+
read_package_doc: "Die Anleitung der App lesen",
36523653
search_knowledge: "In der Wissensdatenbank nachsehen",
3654+
search_package_docs: "In den Anleitungen der App suchen",
36533655
visualize_data: "Die Daten als Diagramm darstellen",
36543656
add_field: "Dem Objekt ein Feld hinzufügen",
36553657
apply_blueprint: "Die App nach dem Plan erstellen",

‎ui/packages/i18n/src/locales/en.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4405,7 +4405,9 @@ const en = {
44054405
get_record: 'Read the record',
44064406
query_data: 'Query the data',
44074407
query_records: 'Look up the records',
4408+
read_package_doc: 'Read the app guide',
44084409
search_knowledge: 'Search the knowledge base',
4410+
search_package_docs: 'Search the app guides',
44094411
visualize_data: 'Chart the data',
44104412
add_field: 'Add a field',
44114413
apply_blueprint: 'Build the app from the plan',

‎ui/packages/i18n/src/locales/es.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,9 @@ const es = {
37193719
get_record: "Leer el registro",
37203720
query_data: "Consultar los datos necesarios",
37213721
query_records: "Buscar los registros",
3722+
read_package_doc: "Leer la guía de la aplicación",
37223723
search_knowledge: "Consultar la base de conocimiento",
3724+
search_package_docs: "Buscar en las guías de la aplicación",
37233725
visualize_data: "Representar los datos en un gráfico",
37243726
add_field: "Añadir un campo",
37253727
apply_blueprint: "Construir la aplicación según el plan",

‎ui/packages/i18n/src/locales/fr.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,7 +3715,9 @@ const fr = {
37153715
get_record: "Lire l’enregistrement",
37163716
query_data: "Interroger les données nécessaires",
37173717
query_records: "Rechercher les enregistrements",
3718+
read_package_doc: "Lire le guide de l’application",
37183719
search_knowledge: "Consulter la base de connaissances",
3720+
search_package_docs: "Chercher dans les guides de l’application",
37193721
visualize_data: "Représenter les données en graphique",
37203722
add_field: "Ajouter un champ à l’objet",
37213723
apply_blueprint: "Construire l’application selon le plan",

‎ui/packages/i18n/src/locales/ja.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,7 +3651,9 @@ const ja = {
36513651
get_record: "このレコードを読み込む",
36523652
query_data: "必要なデータを照会する",
36533653
query_records: "該当するレコードを探す",
3654+
read_package_doc: "アプリのガイドを読む",
36543655
search_knowledge: "ナレッジベースで調べる",
3656+
search_package_docs: "アプリのガイドで調べる",
36553657
visualize_data: "データをグラフにする",
36563658
add_field: "オブジェクトに項目を追加する",
36573659
apply_blueprint: "設計案どおりにアプリを構築する",

0 commit comments

Comments
 (0)