Skip to content

Commit 953159a

Browse files
committed
docs(skills): pay the ctx.title door note out of the same row
The skills token ratchet caps data-hooks.md; the door note is paid for by deleting the row's duplicate of the capability table (the no-argument form needs no capability) and its wordier phrasing. Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz Co-authored-by: Claude <noreply@anthropic.com>
1 parent eee9ae8 commit 953159a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎skills/objectstack-data/references/data-hooks.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ The sandbox is handed a **JSON snapshot** of these (built by
366366
| `ctx.api` | object | Cross-object CRUD. Gated by `api.read` / `api.write` — see below. |
367367
| `ctx.log` | `{ debug, info, warn, error }` | Gated by `log`. Call **`ctx.log.info(msg, data?)`** — `ctx.log` is an **object, not** callable as `ctx.log(msg)`. Emission is **best-effort** (see Troubleshooting). |
368368
| `ctx.crypto` | `{ randomUUID }` | Gated by `crypto.uuid`. |
369-
| `ctx.title` | `(field?) => Promise<string \| null>` | **Name the record instead of printing its id.** `await ctx.title()` resolves this object's `nameField` — including when it is a **formula**, evaluated server-side, with no extra read. `await ctx.title('account_id')` resolves the related record's title through a lookup column (one `findOne`, gated by `api.read`; the no-argument form needs no capability). `null` when there is no title — it never falls back to the id. **Not on every door:** a `body` has it (the recommended form); a deprecated `handler` gets it at runtime but `HookContext` does not declare it (an annotated handler fails to compile) — use `body`; `ql.registerHook` and a bare `ObjectQL` `bindHooks` do not provide it. |
369+
| `ctx.title` | `(field?) => Promise<string \| null>` | **Name the record, not its id.** `ctx.title()` resolves this object's `nameField`, a **formula** included (no extra read); `ctx.title('account_id')` resolves a lookup's title (needs `api.read`). `null` when there is no title, never the id. **Per door:** `body` has it; a deprecated `handler` gets it at runtime, undeclared on `HookContext` (TS2339 when annotated) — use `body`; `ql.registerHook` and a bare `ObjectQL` `bindHooks` lack it. |
370370

371371
(Action bodies additionally receive `ctx.recordId` and `ctx.record`, and their
372372
wrap is `(async (input, ctx) => { … })(input, ctx)` — the action params arrive as

0 commit comments

Comments
 (0)