Skip to content

Commit cf4b9bf

Browse files
feat(spec,i18n): register the delete_package platform tool and label it in every pack (cloud#3656) (#31037)
Fixes #31020 Clause-②: no Metadata-protocol: none ## 维护者速读 - **改了什么**:平台工具名单 `PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']` 登记了 `delete_package`,十种界面语言都补上了这一步的显示名(中文「删除一个应用包」)。 - **为什么改**:cloud 新增的「删除环境里搭的应用包」工具(只发起删除,由人确认)要求在平台名单里登记;不登记,cloud 的工具名一致性测试一直是红的(objectstack-ai/cloud#3686)。 - **风险与回滚**:风险很低——只是名单里多一个名字、语言包里多一行文字,不改任何结构或行为;回滚即撤掉这一个 PR。 - **先看**:`packages/spec/src/system/constants/platform-tool-names.ts`(新名字的位置与注释);`ui/packages/i18n/src/locales/zh.ts`(中文措辞);`ui/packages/i18n/src/locales/en.ts`。 - **两分钟验证**:`cd ui && pnpm exec vitest run packages/plugin-chatbot/src/__tests__/toolLabels-locale-parity-7481.test.ts`,预期全部通过(每种语言都有 `delete_package` 的显示名)。 - **需要你做的**:无,席位落地。 ## What changes - **spec** — `PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']` gains `delete_package` in its sorted place (after `delete_field`), and the group's docblock says what the tool is: it only stages the removal of a package built in the environment, and a person confirms before anything is deleted (objectstack-ai/cloud#3656). `PLATFORM_PROVIDED_TOOL_NAMES` therefore carries it, so a skill whose `tools[]` names `delete_package` resolves under ADR-0109 reference integrity. - **i18n** — `chatbot.tool.delete_package` in all ten `ui/packages/i18n/src/locales/` packs, worded like the sibling `delete_field` / `create_package` labels: en "Delete a package", zh 「删除一个应用包」, ar "حذف حزمة", de "Ein Paket löschen", es "Eliminar un paquete", fr "Supprimer un paquet", ja 「パッケージを削除する」, ko 「패키지 삭제하기」, pt "Excluir um pacote", ru "Удалить пакет". - Two `patch` changesets (`@objectstack/spec`, `@object-ui/i18n`), each carrying both declaration lines. Consumer: objectstack-ai/cloud#3686 (cloud#3656) — its `platform-tool-names-conformance.test.ts` goes green once a cloud pin round carries this change. Same file set as the cloud record-write precedent (eca7cd2) minus its chatbot card work, which this tool does not need. ## Tests - `packages/spec/src/system/constants/platform-tool-names.test.ts` — 5/5 (snake_case, no cross-package collision, no family-prefix shadowing, sorted groups). - `ui` — `toolLabels-locale-parity-7481`, `toolLabels-sentences-12724` and the whole `packages/i18n/` suite: Test Files 99 passed (99), Tests 1549 passed / 13 skipped, against a rebuilt spec `dist` that carries `delete_package` (so the parity suite read the new name from the registry, not a stale build). - `pnpm --filter @objectstack/spec run typecheck` and `pnpm --filter @object-ui/i18n run type-check`: exit 0. ## Acceptance notes - `delete_package` is not added to `PLATFORM_DESTRUCTIVE_TOOL_NAMES` in `packages/mcp/src/mcp-server-runtime.ts`. That set is a by-name fallback for platform tools that carry no `requiresConfirmation`; a tool outside it gets no `destructiveHint`, which MCP reads as its own default `true`. `remove_sample_data` (the precedent's destructive tool) is not in it either. No change needed for this card. ## Verification All readings at head `97f93b5503`, objectstack, worktree off `origin/main` `7d9f1e973e`. <details><summary>Derived gate union — 77 families, reconciled with dispatch-gates --ran (exit 0)</summary> `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ran` over a record carrying every command's exit code, captured before any pipe: **77 derived, 74 run, 3 NOT-MEASURED, 0 UNRUN**. - 73 families exit 0 (all `packages/spec` checks incl. `check:api-surface`, `check:authorable-surface`, `check:docs`, `check:export-origins`, `check:liveness`; `check:nul-bytes`, `check:doc-authoring`, `check:issue-citations`, `check:published-files`, the changeset gates, and the rest of the list). - NOT MEASURED, reason: prerequisite not built in this fresh worktree (exit 3, the gates' own refusal) — `pnpm --filter @objectstack/lint run check:doc-formula-expressions`, `pnpm check:dual-build-cjs-loads`, `pnpm check:lean-entry-closure`. They read built `dist/` of packages this diff does not touch; CI's `Lint & Repo Gates` runs them on a built tree. - NOT MEASURED, reason: prerequisite not built (exit 1) — `pnpm --dir ui exec vitest run scripts/`: 169/170 files pass; the one failure is `unit-registry-absence-collision` refusing because `@objectstack/client` has no `dist/` here (37 import failures, all that one package). CI's `Test UI` owns it. - A closure build to measure those four waited 18 minutes on the shared verify lock (two `queue-timeout` 99s behind another run) and did not acquire it — a declared narrowing, not a pass. </details> <details><summary>Beyond the derivation</summary> - `pnpm --dir ui run check:i18n-keys`, `check:i18n-drift`, `check:i18n-dead-keys`: exit 0. - `pnpm --filter @objectstack/spec run typecheck`, `pnpm --filter @object-ui/i18n run type-check`: exit 0. - `node scripts/check-platform-checklist.mjs --changed-from origin/main`: exit 0 (no anchored file in the change set). - `pnpm check:i18n`, `pnpm check:i18n-coverage`: NOT MEASURED (exit 3, workspace CLI not built). Both gate the server-side `*.generated.ts` translation bundles and example configs, none of which this diff touches; the ui locale packs are covered by the suites under Tests. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01Q4EjjRhUZjdy8VXs6Kkur2)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 902f162 commit cf4b9bf

14 files changed

Lines changed: 36 additions & 1 deletion

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.delete_package` label in every pack
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The spec registry now lists the cloud build agent's `delete_package` tool (cloud#3656), so the chatbot's tool timeline gets a sentence for that step in every pack ("Delete a package" / 「删除一个应用包」; the zh-Hant pack regenerated from zh-Hans as 「刪除一個應用包」), matching the sibling `delete_field` and `create_package` labels and keeping `toolLabels-locale-parity-7481` and `toolLabels-sentences-12724` green.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec): `PLATFORM_TOOLS_BY_PACKAGE['service-ai-studio']` lists `delete_package`
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The cloud build agent gains a `delete_package` tool that only stages the removal of a package built in the environment; a person confirms before anything is deleted (cloud#3656). The registry lists the name in its alphabetical place, so `PLATFORM_PROVIDED_TOOL_NAMES` carries it, cloud's tool-name conformance test agrees with what `service-ai-studio` registers, and a skill whose `tools[]` names `delete_package` resolves under ADR-0109 reference integrity instead of being reported as a fictional tool. No schema shape changes and no export is added or removed.

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ export const PLATFORM_TOOLS_BY_PACKAGE: Readonly<Record<string, readonly string[
6262
* two record-write proposals (`create_record`, `update_record`) and the
6363
* sample-data cleanup (`remove_sample_data`), which write ONE record or the
6464
* seeded rows only after the user confirms a card and as that user
65-
* (cloud#3565; they replaced `draft_record`).
65+
* (cloud#3565; they replaced `draft_record`), and the package removal
66+
* (`delete_package`), which only stages the removal of a package built in
67+
* the environment — a person confirms before anything is deleted
68+
* (cloud#3656).
6669
*/
6770
'service-ai-studio': [
6871
'add_field',
@@ -74,6 +77,7 @@ export const PLATFORM_TOOLS_BY_PACKAGE: Readonly<Record<string, readonly string[
7477
'create_record',
7578
'create_seed',
7679
'delete_field',
80+
'delete_package',
7781
'describe_metadata',
7882
'describe_object',
7983
'get_active_package',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4363,6 +4363,7 @@ const ar = {
43634363
create_record: "إنشاء السجل",
43644364
create_seed: "توليد بيانات تجريبية للكائنات",
43654365
delete_field: "حذف أحد الحقول",
4366+
delete_package: "حذف حزمة",
43664367
describe_metadata: "مراجعة البيانات الوصفية",
43674368
describe_object: "مراجعة بنية الكائن",
43684369
get_active_package: "التحقق من الحزمة النشطة",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4054,6 +4054,7 @@ const de = {
40544054
create_record: "Den Datensatz anlegen",
40554055
create_seed: "Beispieldaten für die Objekte erzeugen",
40564056
delete_field: "Ein Feld löschen",
4057+
delete_package: "Ein Paket löschen",
40574058
describe_metadata: "Die Metadaten ansehen",
40584059
describe_object: "Die Struktur des Objekts ansehen",
40594060
get_active_package: "Das aktive Paket prüfen",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4891,6 +4891,7 @@ const en = {
48914891
create_record: 'Create the record',
48924892
create_seed: 'Generate sample data',
48934893
delete_field: 'Delete a field',
4894+
delete_package: 'Delete a package',
48944895
describe_metadata: 'Look at the metadata',
48954896
describe_object: 'Look at the object structure',
48964897
get_active_package: 'Check the active package',

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4132,6 +4132,7 @@ const es = {
41324132
create_record: "Crear el registro",
41334133
create_seed: "Generar datos de ejemplo para los objetos",
41344134
delete_field: "Eliminar un campo",
4135+
delete_package: "Eliminar un paquete",
41354136
describe_metadata: "Revisar los metadatos",
41364137
describe_object: "Revisar la estructura del objeto",
41374138
get_active_package: "Comprobar el paquete activo",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4128,6 +4128,7 @@ const fr = {
41284128
create_record: "Créer la fiche",
41294129
create_seed: "Générer des données d’exemple pour les objets",
41304130
delete_field: "Supprimer le champ",
4131+
delete_package: "Supprimer un paquet",
41314132
describe_metadata: "Examiner les métadonnées",
41324133
describe_object: "Examiner la structure de l’objet",
41334134
get_active_package: "Vérifier le paquet actif",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,6 +4056,7 @@ const ja = {
40564056
create_record: "レコードを作成する",
40574057
create_seed: "オブジェクトのサンプルデータを生成する",
40584058
delete_field: "項目を削除する",
4059+
delete_package: "パッケージを削除する",
40594060
describe_metadata: "メタデータの内容を確認する",
40604061
describe_object: "オブジェクトの構造を確認する",
40614062
get_active_package: "現在のパッケージを確認する",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4053,6 +4053,7 @@ const ko = {
40534053
create_record: "레코드 만들기",
40544054
create_seed: "오브젝트 샘플 데이터 만들기",
40554055
delete_field: "필드 삭제하기",
4056+
delete_package: "패키지 삭제하기",
40564057
describe_metadata: "메타데이터 내용 확인하기",
40574058
describe_object: "오브젝트 구조 살펴보기",
40584059
get_active_package: "현재 패키지 확인하기",

0 commit comments

Comments
 (0)