Repository navigation
Commit 875ae40
feat(ai): get_record_context joins the service-ai platform tool group, with its chat label (ADR-0160 row 9) (#37210)
<!-- claude-projects-attribution: {"github_login":"os-warren"} -->
_Requested by **Warren** · [project
thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ84wsrfBFiVrUB868HPtFvKC)_
Fixes #37190
## 维护者速读
- 做什么:平台的「云端注册了哪些工具」清单加上 `get_record_context`;11
个语言包加上它在对话里显示的步骤名(中文「读取记录资料」)。
- 为什么:这是 cloud#4978(应用内助手注册这个工具)在本仓的一半,两边要一起落地。
- 出错会怎样:只影响清单注释与一条 lint 提示;作者写的东西不变。
- 要你做什么:无。**按卡上的落地顺序,本 PR 保持草稿,等 cloud#4978 的 PR(cloud#4987)就绪再合,然后由
cloud#4987 自己把 pin 前移过本 PR 的合并提交。**
## What changes
-
`packages/spec/src/system/constants/platform-tool-names.ts#PLATFORM_TOOLS_BY_PACKAGE`:
`get_record_context` joins the `service-ai` group (cloud
`@objectstack/service-ai` registers it for the in-app assistant from the
same definition the MCP door serves, delegating to the same
`record-context` executor, ADR-0160 D4). The group's docblock says so.
It stays in `MCP_DOOR_TOOL_NAMES` too.
- `chatbot.tool.get_record_context` in all eleven packs under
`ui/packages/i18n/src/locales/` (en "Read the record context", zh-Hans
读取记录资料, zh-Hant 讀取記錄資料, …), placed after `get_record`.
- The `skill.tools[]` lint rule
(`packages/lint/src/validate-ai-tool-references.ts`) now resolves
`get_record_context` for a skill kept out of MCP (`mcpPrompt: false`),
so the expected report ADR-0160's implementation split note describes
ends. No rule code changes: the name resolving through
`PLATFORM_PROVIDED_TOOL_NAMES` is what ends it.
- Pins: `platform-tool-names.test.ts` (in the `service-ai` group, at the
door, not in `service-ai-studio`); `validate-ai-tool-references.test.ts`
(resolves on `mcpPrompt: false`, `true` and unset, with a neighbour
spelling as the control).
- Changeset: `@objectstack/spec` patch, `@object-ui/i18n` patch.
## Why
The registry's maintenance contract: a group is the exact set one cloud
package registers, so the name joins with cloud's registration
(cloud#4978, PR objectstack-ai/cloud#4987) and not before (card's *Order
with cloud*). Cloud's `platform-tool-names-conformance.test.ts` asserts
the `service-ai` group exactly, and cloud#4987 adds `get_record_context`
to it: merge this first, then cloud#4987 carries the pin move past this
merge sha (an unrelated cloud pin bump past it would turn that test
red).
## Verification
Container, worktree on `29f1280d` + this commit:
- `pnpm --filter @objectstack/spec build` then `pnpm --filter
@objectstack/spec check:generated`: all 14 artifacts up to date.
- `packages/spec`: `vitest run
src/system/constants/platform-tool-names.test.ts` → 12 passed.
- `packages/lint`: `vitest run src/validate-ai-tool-references.test.ts`
→ 30 passed.
- `ui`: `vitest run` of
`plugin-chatbot/.../toolLabels-locale-parity-7481.test.ts`,
`ChatbotEnhanced.answerSource-31868.test.tsx`,
`i18n/.../all-locales-key-parity.test.ts` → all passed (94 tests).
- Cloud side, against this head's framework build: cloud#4987's
`platform-tool-names-conformance.test.ts` green with
`get_record_context` in the group.
Clause-②: yes (widening) — `PLATFORM_TOOLS_BY_PACKAGE` and
`PLATFORM_PROVIDED_TOOL_NAMES` gain `get_record_context`, so
`ai-skill-tool-unresolved` stops reporting it on a `mcpPrompt: false`
skill; nothing that resolved before is reported
Metadata-protocol: none
Skills-docs: none — `skills/objectstack-ai/SKILL.md` points at the
registry file and names no tool
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent b7dee0e commit 875ae40
15 files changed
Lines changed: 64 additions & 1 deletion
File tree
- .changeset
- packages
- lint/src
- 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 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
362 | 383 | | |
363 | 384 | | |
364 | 385 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
69 | 81 | | |
70 | 82 | | |
71 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5069 | 5069 | | |
5070 | 5070 | | |
5071 | 5071 | | |
| 5072 | + | |
5072 | 5073 | | |
5073 | 5074 | | |
5074 | 5075 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4683 | 4683 | | |
4684 | 4684 | | |
4685 | 4685 | | |
| 4686 | + | |
4686 | 4687 | | |
4687 | 4688 | | |
4688 | 4689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5655 | 5655 | | |
5656 | 5656 | | |
5657 | 5657 | | |
| 5658 | + | |
5658 | 5659 | | |
5659 | 5660 | | |
5660 | 5661 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4780 | 4780 | | |
4781 | 4781 | | |
4782 | 4782 | | |
| 4783 | + | |
4783 | 4784 | | |
4784 | 4785 | | |
4785 | 4786 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4776 | 4776 | | |
4777 | 4777 | | |
4778 | 4778 | | |
| 4779 | + | |
4779 | 4780 | | |
4780 | 4781 | | |
4781 | 4782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4685 | 4685 | | |
4686 | 4686 | | |
4687 | 4687 | | |
| 4688 | + | |
4688 | 4689 | | |
4689 | 4690 | | |
4690 | 4691 | | |
| |||
0 commit comments