Skip to content
Draft
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
16 changes: 16 additions & 0 deletions .changeset/37857-skill-no-authored-ai-button.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
'@objectstack/skills': patch
---

docs(skills): `objectstack-ai` no longer teaches an authored AI button on a record page

Clause-②: no
Metadata-protocol: none

ADR-0160, seventh amendment (D6, "Entry point"): the entry to the in-app assistant is the shell's 「问 AI」 entry, and no page declares an AI button of its own.

`skills/objectstack-ai/SKILL.md`: the subsection *The Ask AI button — `type: 'ask_ai'`* under *Actions as AI Tools* is removed, with its `defineAction` example. One sentence stands in its place: no page declares an AI button of its own, so there is no action to write for one, and the shell's 「问 AI」 entry opens the in-app assistant and carries the current record automatically. The file's token ceiling follows the measurement down, 6799 to 6617.

`evals/skills-tools-knowledge.json`: case 10 keeps its prompt, an Ask AI button on the contract record page, and now expects the opposite answer: no action is written, and the answer names the shell's 「问 AI」 entry. Its `must_contain` is that entry's name, and its `must_not_contain` holds `defineAction(` and `locations:`, two tokens that only an authored action carries.

The `objectstack-ui` action-type table is unchanged: it is held row for row to the members of `ActionType`, which still include `ask_ai`.
5 changes: 4 additions & 1 deletion scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ export const CEILINGS = new Map([
// Modify All cast no field vote). 27230 -> 27225 bytes; the row follows the measurement down.
// 6800 -> 6799 (card #37304): the `supportKb` example's two renamed keys add
// two bytes and its comment gives back six; the row follows the measurement down.
['skills/objectstack-ai/SKILL.md', 6799], // -18 (was 6824), then -5 A2′ (was 6806)
// 6799 -> 6617: the section that taught an authored AI button on a record
// page is replaced by one sentence (ADR-0160 D6, "Entry point": the shell's
// entry is the only one); the row follows the measurement down.
['skills/objectstack-ai/SKILL.md', 6617], // -18 (was 6824), then -5 A2′ (was 6806)
// -12 (was 6331): the `http.server` decision-table row dropped a trailing
// clause that taught `contributes.routes` as a key that "parses but serves
// nothing". The key is retired — an authored entry is now REFUSED, carrying
Expand Down
28 changes: 3 additions & 25 deletions skills/objectstack-ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,31 +171,9 @@ decided entirely by the skip rule above — `actionSkipReason(action, ctx)` and
`actionRequiresApproval(action)` (from `@objectstack/service-ai`) answer both
questions, and Studio's "AI exposure" diagnostics use the same predicates.

### The **Ask AI** button — `type: 'ask_ai'` ☁️

Pins the assistant's conversation to the record the action runs on and opens
it, sending no message. Declare it on the object, in
`locations: ['record_header']` or `['record_more']`:

<!-- os:check -->
```typescript
import { defineAction } from '@objectstack/spec';

export default defineAction({
name: 'ask_about_contract',
label: 'Ask AI',
objectName: 'contract',
type: 'ask_ai',
locations: ['record_header'],
});
```

It names nothing and is never a tool: the parse refuses a `target`,
`ai.exposed: true`, and `actionType: 'ask_ai'` on a dashboard header (a header
runs on no record). Nothing serves it headless: `list_actions` skips it,
`run_action` refuses it, and no `action_` tool exists for it. The console draws
it only where the assistant surface is on **and** the AI service honours a
conversation focus; elsewhere it is absent, not disabled.
**No page declares an AI button of its own**, so there is no action to write
for one: the shell's 「问 AI」 entry opens the in-app assistant and carries the
current record automatically.

---

Expand Down
6 changes: 3 additions & 3 deletions skills/objectstack-ai/evals/skills-tools-knowledge.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@
{
"id": 10,
"prompt": "Add an Ask AI button to the contract record page, so a user can ask the assistant about the contract they are looking at. Write the action.",
"expected_output": "Emits a `defineAction` with `type: 'ask_ai'`, `objectName: 'contract'` and `locations: ['record_header']` (or `['record_more']`), with no `target` and no `ai.exposed: true`: the action pins the assistant's conversation to the record and opens it, sending no message. States that it is never a tool (`list_actions` skips it, `run_action` refuses it, no `action_` tool exists for it) and that the console draws it only where the in-app assistant is on and honours a conversation focus; elsewhere it is absent, not disabled.",
"expected_output": "Writes no action: no page declares an AI button of its own. The in-app assistant is opened from the shell's 「问 AI」 entry, which carries the current record automatically, so a user on the contract record page asks about that contract with nothing authored. Adds no `defineAction`, no entry under the object's `actions`, and no button on the page for it.",
"files": [],
"assertions": {
"must_contain": ["ask_ai", "record_header", "locations"],
"must_not_contain": ["target:"]
"must_contain": ["问 AI"],
"must_not_contain": ["defineAction(", "locations:"]
}
},
{
Expand Down
Loading