Repository navigation
Commit cf4b9bf
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
- .changeset
- packages/spec/src/system/constants
- ui/packages/i18n/src/locales
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
74 | 77 | | |
75 | 78 | | |
76 | 79 | | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4363 | 4363 | | |
4364 | 4364 | | |
4365 | 4365 | | |
| 4366 | + | |
4366 | 4367 | | |
4367 | 4368 | | |
4368 | 4369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4054 | 4054 | | |
4055 | 4055 | | |
4056 | 4056 | | |
| 4057 | + | |
4057 | 4058 | | |
4058 | 4059 | | |
4059 | 4060 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4891 | 4891 | | |
4892 | 4892 | | |
4893 | 4893 | | |
| 4894 | + | |
4894 | 4895 | | |
4895 | 4896 | | |
4896 | 4897 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4132 | 4132 | | |
4133 | 4133 | | |
4134 | 4134 | | |
| 4135 | + | |
4135 | 4136 | | |
4136 | 4137 | | |
4137 | 4138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4128 | 4128 | | |
4129 | 4129 | | |
4130 | 4130 | | |
| 4131 | + | |
4131 | 4132 | | |
4132 | 4133 | | |
4133 | 4134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4056 | 4056 | | |
4057 | 4057 | | |
4058 | 4058 | | |
| 4059 | + | |
4059 | 4060 | | |
4060 | 4061 | | |
4061 | 4062 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4053 | 4053 | | |
4054 | 4054 | | |
4055 | 4055 | | |
| 4056 | + | |
4056 | 4057 | | |
4057 | 4058 | | |
4058 | 4059 | | |
| |||
0 commit comments