Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/33733-dataset-tool-labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
'@objectstack/spec': minor
'@object-ui/i18n': patch
---

feat(spec, i18n): the platform tool registry lists the ask agent's dataset pair, `list_datasets` and `query_dataset`, and every locale pack names their chat steps

Clause-②: yes (widening) — `PLATFORM_TOOLS_BY_PACKAGE['service-ai']` (and so `PLATFORM_PROVIDED_TOOL_NAMES`) gains `list_datasets` and `query_dataset`, two more names a `skill.tools[]` entry resolves to; the `@object-ui/i18n` packs gain `chatbot.tool.list_datasets` and `chatbot.tool.query_dataset` in all eleven shipped locales. Nothing is removed or narrowed.
Metadata-protocol: added
Skills-docs: none — `skills/objectstack-ai/SKILL.md` teaches the registry by name (`PLATFORM_PROVIDED_TOOL_NAMES`) and lists no `service-ai` member it would now miss.

Cloud's `service-ai` registers the dataset pair for the in-product ask agent (cloud#4551): `list_datasets` reads the installed datasets and the metrics each defines, and `query_dataset` answers a question through one governed metric. The names and shapes are the ones ADR-0149 D2 declares in `@objectstack/spec` (`LIST_DATASETS_TOOL_NAME`, `QUERY_DATASET_TOOL_NAME`).

- **Skill references resolve.** A skill naming either tool was reported by `ai-skill-tool-unresolved` as a tool nothing registers; both now resolve as platform tools.
- **The chat names the step.** While the agent ran either tool, the step list showed the English title-caser's output of the tool id on every console language. Each pack now carries a sentence for both, for example 「查看指标」 and 「按指标查询」 in Simplified Chinese.
15 changes: 15 additions & 0 deletions packages/spec/src/system/constants/platform-tool-names.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
PLATFORM_TOOL_FAMILY_PREFIXES,
isPlatformProvidedToolName,
} from './platform-tool-names';
import { LIST_DATASETS_TOOL_NAME, QUERY_DATASET_TOOL_NAME } from '../../ai/dataset-tools.zod';

describe('PLATFORM_PROVIDED_TOOL_NAMES — internal invariants', () => {
it('every name is snake_case (ToolSchema name grammar)', () => {
Expand Down Expand Up @@ -49,6 +50,20 @@ describe('PLATFORM_PROVIDED_TOOL_NAMES — internal invariants', () => {
expect(isPlatformProvidedToolName('action_create_case')).toBe(false);
});

it('lists the service-ai dataset pair the ask agent registers (cloud#4551)', () => {
// Cloud `service-ai` registers both for the ask agent. While the registry
// lacked them, a skill naming either read as a fictional tool and the chat
// showed the raw tool id as the step name.
// The spelling is the one ADR-0149 D2 declares for both registrations.
expect(PLATFORM_TOOLS_BY_PACKAGE['service-ai']).toEqual(
expect.arrayContaining([LIST_DATASETS_TOOL_NAME, QUERY_DATASET_TOOL_NAME]),
);
expect(isPlatformProvidedToolName(LIST_DATASETS_TOOL_NAME)).toBe(true);
expect(isPlatformProvidedToolName(QUERY_DATASET_TOOL_NAME)).toBe(true);
// The control: a neighbour spelling nobody registers still misses.
expect(isPlatformProvidedToolName('query_datasets')).toBe(false);
});

it('each group is sorted, so diffs stay reviewable', () => {
for (const [pkg, names] of Object.entries(PLATFORM_TOOLS_BY_PACKAGE)) {
expect([...names].sort(), pkg).toEqual([...names]);
Expand Down
10 changes: 8 additions & 2 deletions packages/spec/src/system/constants/platform-tool-names.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@
export const PLATFORM_TOOLS_BY_PACKAGE: Readonly<Record<string, readonly string[]>> = {
/**
* `@objectstack/service-ai` (cloud) — the `ask` data product's shared
* data/knowledge/visualization tools, and the package-doc pair that reads the
* data/knowledge/visualization tools, the package-doc pair that reads the
* installed packages' `doc` items behind the `/meta/doc` audience gate
* (cloud#3335).
* (cloud#3335), and the dataset pair (cloud#4551): `list_datasets` reads
* the installed datasets and the metrics each defines, and `query_dataset`
* answers a question through one governed metric instead of an ad-hoc
* aggregate. Their names and shapes are declared once in
* `../../ai/dataset-tools.zod` (ADR-0149 D2), which MCP registers too.
*/
'service-ai': [
'aggregate_data',
'get_record',
'list_datasets',
'query_data',
'query_dataset',
'query_records',
'read_package_doc',
'search_knowledge',
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4339,7 +4339,9 @@ const ar = {
tool: {
aggregate_data: "تجميع البيانات ذات الصلة",
get_record: "قراءة هذا السجل",
list_datasets: "عرض المؤشرات المتاحة",
query_data: "الاستعلام عن البيانات المطلوبة",
query_dataset: "الاستعلام حسب المؤشر",
query_records: "البحث عن السجلات المطابقة",
read_package_doc: "قراءة دليل التطبيق",
search_knowledge: "البحث في قاعدة المعرفة عن معلومات",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4002,7 +4002,9 @@ const de = {
tool: {
aggregate_data: "Die Daten zusammenfassen",
get_record: "Den Datensatz lesen",
list_datasets: "Die verfügbaren Kennzahlen ansehen",
query_data: "Die benötigten Daten abfragen",
query_dataset: "Über eine Kennzahl abfragen",
query_records: "Passende Datensätze suchen",
read_package_doc: "Die Anleitung der App lesen",
search_knowledge: "In der Wissensdatenbank nachsehen",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4927,7 +4927,9 @@ const en = {
tool: {
aggregate_data: 'Aggregate the data',
get_record: 'Read the record',
list_datasets: 'Check the available metrics',
query_data: 'Query the data',
query_dataset: 'Query by a metric',
query_records: 'Look up the records',
read_package_doc: 'Read the app guide',
search_knowledge: 'Search the knowledge base',
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4087,7 +4087,9 @@ const es = {
tool: {
aggregate_data: "Resumir los datos",
get_record: "Leer el registro",
list_datasets: "Ver las métricas disponibles",
query_data: "Consultar los datos necesarios",
query_dataset: "Consultar por métrica",
query_records: "Buscar los registros",
read_package_doc: "Leer la guía de la aplicación",
search_knowledge: "Consultar la base de conocimiento",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4083,7 +4083,9 @@ const fr = {
tool: {
aggregate_data: "Synthétiser les données",
get_record: "Lire l’enregistrement",
list_datasets: "Consulter les indicateurs disponibles",
query_data: "Interroger les données nécessaires",
query_dataset: "Interroger un indicateur",
query_records: "Rechercher les enregistrements",
read_package_doc: "Lire le guide de l’application",
search_knowledge: "Consulter la base de connaissances",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4004,7 +4004,9 @@ const ja = {
tool: {
aggregate_data: "関連データを集計する",
get_record: "このレコードを読み込む",
list_datasets: "利用できる指標を確認する",
query_data: "必要なデータを照会する",
query_dataset: "指標で照会する",
query_records: "該当するレコードを探す",
read_package_doc: "アプリのガイドを読む",
search_knowledge: "ナレッジベースで調べる",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4001,7 +4001,9 @@ const ko = {
tool: {
aggregate_data: "관련 데이터 집계하기",
get_record: "이 레코드 읽기",
list_datasets: "사용 가능한 지표 확인하기",
query_data: "필요한 데이터 조회하기",
query_dataset: "지표로 조회하기",
query_records: "해당 레코드 찾기",
read_package_doc: "앱 안내서 읽기",
search_knowledge: "지식 베이스에서 찾아보기",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4082,7 +4082,9 @@ const pt = {
tool: {
aggregate_data: "Resumir os dados",
get_record: "Ler o registro",
list_datasets: "Ver as métricas disponíveis",
query_data: "Consultar os dados necessários",
query_dataset: "Consultar por métrica",
query_records: "Buscar os registros",
read_package_doc: "Ler o guia do aplicativo",
search_knowledge: "Consultar a base de conhecimento",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4181,7 +4181,9 @@ const ru = {
tool: {
aggregate_data: "Агрегировать данные",
get_record: "Прочитать запись",
list_datasets: "Посмотреть доступные метрики",
query_data: "Запросить нужные данные",
query_dataset: "Запросить данные по метрике",
query_records: "Найти нужные записи",
read_package_doc: "Прочитать руководство приложения",
search_knowledge: "Поискать в базе знаний",
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/zh-Hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4250,7 +4250,9 @@ const zh = {
tool: {
aggregate_data: '汇总相关数据',
get_record: '读取这条记录',
list_datasets: '查看指标',
query_data: '查询所需数据',
query_dataset: '按指标查询',
query_records: '查找相关记录',
read_package_doc: '阅读应用文档',
search_knowledge: '在知识库中查找',
Expand Down
2 changes: 2 additions & 0 deletions ui/packages/i18n/src/locales/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4250,7 +4250,9 @@ const zhHant = {
tool: {
aggregate_data: '彙總相關資料',
get_record: '讀取這條記錄',
list_datasets: '檢視指標',
query_data: '查詢所需資料',
query_dataset: '按指標查詢',
query_records: '查詢相關記錄',
read_package_doc: '閱讀應用文件',
search_knowledge: '在知識庫中查詢',
Expand Down
Loading