You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 03e8ce4
Browse filesBrowse the repository at this point in the historyBrowse files
feat(runtime): the open MCP server lists metadata and pending drafts for an OAuth client with `metadata:write` whose user holds `manage_metadata`
6
+
7
+
Clause-②: yes (widening)
8
+
Metadata-protocol: none
9
+
10
+
An AI client connected over MCP with an OAuth token that carries `metadata:write` now gets three read tools on a self-hosted runtime, the first half of the open draft door (design `docs/design/mcp-local-first-door.md`, Design A):
11
+
12
+
-`list_metadata_items({ type, state? })` lists one metadata type's items as summaries (name, label, package). A pending draft is listed in place of its published version and marked `draft: true`; `state: "active"` lists the published items only, `state: "draft"` the pending drafts only. A type the platform does not declare is refused with `400 INVALID_REQUEST`, as the `/meta` list refuses it.
13
+
-`get_metadata_item({ type, name, state? })` reads one item's full definition: the pending draft where one exists, unless `state` selects the draft or the published version. An item that does not exist answers `404 RESOURCE_NOT_FOUND`.
14
+
-`list_drafts({ package? })` lists the pending drafts, optionally for one package.
15
+
16
+
The tools are served only where both halves hold: the token consents (`metadata:write`) and the user the token was issued to holds `manage_metadata` in the organization the token bound. The user's capability is read from their own grants on each request, because an OAuth agent's envelope carries no system permission without `actions:execute`. A token whose user lacks the capability is listed none of the three tools, and a call that reaches them anyway is refused `403 PERMISSION_DENIED`. A token without `metadata:write`, an API key and a session see none of them, as before. When the user's grants cannot be read, the tools are not served on that request and the runtime logs one warning.
17
+
18
+
The reads withhold what every `/meta` door withholds from that user, judged by the same read gates with the user as the caller: a dashboard, a list view or an app whose `requiredPermissions` the user does not hold, and a book or doc outside their audience, are refused `403 PERMISSION_DENIED` by `get_metadata_item` and left out of `list_metadata_items`. Before either gate, both reads ask the type-level read admission every `/meta` read asks: a metadata type the user may not read is refused `403 PERMISSION_DENIED` on both, whatever its spelling or `state`. Holding `manage_metadata` does not lift these refusals. A gate that cannot evaluate refuses the read.
19
+
20
+
The read tools are named `list_metadata_items` and `get_metadata_item`, not `list_metadata` and `get_metadata`, because `list_metadata` is a hosted platform tool. Nothing here writes: saving and discarding drafts, and the publish verdict a save answers with, come in a later change.
docs(skills): the sections served to MCP clients show their examples as JSON, and a check pins their headings
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A client that builds through MCP writes JSON, and the sections of `objectstack-data`, `objectstack-ui` and `objectstack-automation` that the hosted MCP door serves showed their examples in TypeScript. Those sections now give each example as JSON, with one line on how a TypeScript project wraps the same literal:
11
+
12
+
-`objectstack-data`: the object in Object Definition, the `state_machine` rule in State Machine Validation, and the `summary` field and the permission set in Roll-up Summaries. Field Type Selection names the `{ dialect: 'cel', source }` envelope beside the TypeScript tag.
13
+
-`objectstack-ui`: the write-button action in Actions.
14
+
-`objectstack-automation`: the `notify` node (its key notes are a list under the block), the `script` and `update_record` pair in Valid-but-silently-wrong, the whole approval flow in Approvals (Flow Nodes), and the start node and window filter of the time-relative trigger, beside its TypeScript flow.
15
+
16
+
The other served sections are prose and tables and read the same to both kinds of client; three of them drop a TypeScript-only phrase.
17
+
18
+
Every JSON block in a served section is parsed and validated against the spec schema for its kind in CI, and a renamed, removed or duplicated heading of a served section now fails there.
docs(skills): the `objectstack-ask` skill follows `list_datasets``nextStep` and cites `query_dataset``sourceLine` as given, before `provenance`
7
+
8
+
Clause-②: no
9
+
Metadata-protocol: none
10
+
11
+
The `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, now tell a connected client two things. Under the step 2 decision table: when the `list_datasets` answer has `nextStep`, follow its `decision` and `note`. In step 3's citation bullet: cite the `query_dataset` answer's `sourceLine` as given, and build the source from `provenance` only when the answer has no `sourceLine`. Both members are answered by servers whose dataset tools fill them; a server that does not answer them leaves the skill's existing steps in force, with the `provenance` citation as before. When a `nextStep` note says to answer one measure and to ask about a word that has only candidates, the skill says to do both and to use none of that word's candidates until the user answers; the question-alone rule (no tool call until the user answers) covers a reply that only asks.
12
+
13
+
Two sentences that restated another line of the same skill are removed: the fallback row's "and say in the answer that no governed metric was used" (step 4 opens every fallback answer with that line) and "no figure" in the paragraph under the table (its next sentence says the same). The `candidates` row also drops "one or several", which its own right cell states. `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes.
fix(ui): grouping headers and the filter value picker name a lookup by its target's `nameField`, and the empty group is translated
8
+
9
+
Clause-②: yes (widening)
10
+
Metadata-protocol: none
11
+
12
+
A lookup with no `displayField` is now named by the target object's declared `nameField`, the default the spec states for `displayField` ("the referenced object's name/title"). This is the same title the lookup's grid cell and the record header already show. Before, three places guessed a `name`, `label` or `title` key, and showed the raw record id when the target had none, for example a target titled by an autonumber such as `DEAL-2026-0001`:
13
+
14
+
-**Group headers of a list grouped by the lookup**, both server-grouped and client-grouped.
15
+
-**Filter builder value picker options** for the lookup, and the chip of the chosen value.
16
+
17
+
An explicit `displayField` on the lookup still wins. Grouping and filtering stay keyed by record id, so two records with the same title stay separate groups and separate options. The picker reads the target object's definition once per picker. The ObjectStack adapter serves later reads of it from its metadata cache.
18
+
19
+
The group of rows with no value now reads the grid's own empty-value string (`grid.empty`, for example "Empty" in English and "空" in Chinese) instead of the untranslated `(empty)`. It keeps its place in the group order: first when ascending and last when descending.
20
+
21
+
`@object-ui/core` adds `referencedRecordTitle(targetDef, record, displayField?)` to its public entry, a new export. It gives the title of a referenced record using the lookup's `displayField`, then the record-title ladder of `getRecordDisplayName`, and returns `undefined` instead of the `Record #<id>` floor.
Copy file name to clipboardExpand all lines: docs/design/mcp-local-first-door.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,8 @@ Tools, registered by a new open registry behind `metadata:write`, each checking
79
79
|`delete_metadata_draft({ type, name })`| Discards a pending draft ||
80
80
|`list_drafts({ package? })`| Pending drafts with their verdicts | The review queue, as the client sees it |
81
81
82
+
> **Note (2026-11-17):** the two read tools are named `list_metadata_items` and `get_metadata_item`, because `list_metadata` is a cloud platform tool (`packages/spec/src/system/constants/platform-tool-names.ts:97`) and the open registry must not collide with it (seat ruling D3 on #34766, 2026-11-17).
83
+
82
84
- No publish tool, no `force`: a draft executes nothing, and the destructive-change confirmation stays at the human publish.
83
85
-`initialize` instructions and discovery state `Authoring contract: @objectstack/spec <version>` and the install line for `@objectstack/skills@<version>`.
84
86
- The open runtime serves `GET /api/v1/discovery/restriction-profile` (mount what the CLI already reads).
'| Each word for a thing measured matches exactly one measure | Compute: step 3. Two words with one measure each ("营收和赢单率") are two metrics, not a choice: compute both, with one `query_dataset` per dataset. |',
43
43
'| One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate\'s label, its dataset\'s label and its description. Do not pick one. |',
44
44
'| Only a dimension matches | That is a grouping ("by stage"), not a number. You still need a measure match; without one, ask which number is meant. |',
45
-
'| A word matches nothing, and `candidates` lists members for it, one or several | Ask the user which one they mean, listing each candidate\'s label, its dataset\'s label and its description; with one candidate, ask whether it is the one meant. Do not pick one. |',
46
-
'| No match and no candidates for the word for a thing measured | Step 4, and say in the answer that no governed metric was used. |',
45
+
'| A word matches nothing, and `candidates` lists members for it | Ask the user which one they mean, listing each candidate\'s label, its dataset\'s label and its description; with one candidate, ask whether it is the one meant. Do not pick one. |',
46
+
'| No match and no candidates for the word for a thing measured | Step 4. |',
47
47
'| `membersWithheld: true` on a dataset | Say that it has members (measures or groupings) you may not read; the metric asked for may be among them. Do not say the metric does not exist. |',
48
48
'',
49
-
'When you ask, the reply is the question alone: no figure, and no tool call',
50
-
'until the user answers. State no figure of your own in it (no count, total',
49
+
'When the answer has `nextStep`, follow its `decision` and `note`. If `note`',
50
+
'says to answer one measure and ask about a word, do both; use none of that',
51
+
'word\'s candidates until the user answers.',
52
+
'',
53
+
'When you only ask, the reply is the question alone: no tool call until the user',
54
+
'answers. State no figure of your own in it (no count, total',
51
55
'or option number): name each option by its label in a bullet, and quote its',
52
56
'description as written. Ask only about matches or candidates for words the user',
53
57
'wrote; when their word matched nothing and has no candidates, go to step 4',
0 commit comments