Commit 6fdc5c6
* feat(client,spec): `ai.agents.*` and `ai.pendingActions.*` — the AI routes the SDK could not reach (#3718)
#3718 deleted three `client.ai.*` methods whose URLs no route had ever mounted,
then expressed the surface that does exist. It expressed ONE builder's worth of
it. `service-ai` mounts seven; widening its ledger (objectstack-ai/cloud#903)
counted ten routes the SDK cannot reach, nine of which had never been counted.
This closes the six with the strongest evidence: objectui already ships product
on them, over URLs it hand-builds because there is nothing to call.
ai.agents — `/ai/chat` talks to the default agent; these talk to a named one.
list() — agents this CALLER may chat with; the route
filters by permission (ADR-0049), so empty is a
legitimate answer, not an error to retry
chat(name, req) — forces `stream: false`, same reason `ai.chat`
does: the route streams by default
chatStream(name, req) — same route, streaming mode. One route, two
methods, mirroring chat/chatStream rather than
inventing a third shape
ai.pendingActions — the HITL approval queue an embedding app must render.
list(options?) — status/conversationId/limit ONLY. The service
also accepts objectName; the route never
forwards it, so typing it would offer a filter
that silently does nothing
get(id)
approve(id) — approves AND executes. `{status:'failed'}` comes
back on HTTP 200: the approval succeeded, the
execution did not. Reading only `res.ok` reports
a failed write as a success
reject(id, reason?) — executes nothing
Typed from what the routes RETURN, not from what a client might like them to —
the failure #3718 exists to punish. Pending actions are the persisted row,
snake_case on the wire because that is what it is; agent rows require
`capabilities` because that object is what tells a UI what to render.
The capstone's `/api/v1/ai/` prefix exemption says the evidence lives across the
repo boundary. It does, and it now reaches these: cloud's ledger drives every
`ai.*` method against the tables its builders really return, and since #903 that
means all seven. Comment updated there — it still described the one-builder
version, under which `buildAgentRoutes()` and `buildPendingActionRoutes()` were
invisible.
Verification: client 184/184, spec 6836/6836 (24 in protocol.test.ts, extended
with the new shapes incl. the negative cases — an agent row without
capabilities, a non-enum status filter, `approve` yielding "rejected").
Mutation-checked: pointing `ai.pendingActions.get` off the AI prefix fails the
capstone by name, proving the new methods are really in its sweep rather than
silently absent. Generated artifacts regenerated: api-surface.json (+20 exports,
0 breaking) and json-schema.manifest.json.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJX6GnuNix7HisBc92THMN
* docs(spec,client): regenerate the protocol reference and document the new ai methods
`check:docs` regenerates `content/docs/references` from the schemas and fails
when the committed copy drifts. The seven new AI schemas produce new reference
entries, so that check went red on the first push — the artifact half of the
same commit, not a separate defect.
Also updates the hand-written SDK doc, which enumerates the whole `client.ai.*`
surface and carried the #3718 history note. Leaving it at ten methods while
shipping seventeen would be the exact drift this line of work keeps closing —
and the docs-drift check flagged `content/docs/api/client-sdk.mdx` as affected,
which on inspection it genuinely was (the other 107 files it lists are
package-level fan-out, unrelated to this diff).
The added block documents the two things a caller gets wrong by default: an
access-filtered agent catalog is legitimately EMPTY for a seat-less user, and
`pendingActions.approve` returns `{ status: 'failed' }` on HTTP 200 when the
tool fails after approval — reading only `res.ok` calls that a success.
check:docs / check:api-surface / check:spec-changes / check:upgrade-guide all
pass; 250 generated files in sync.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WJX6GnuNix7HisBc92THMN
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5602211 commit 6fdc5c6
9 files changed
Lines changed: 577 additions & 9 deletions
File tree
- .changeset
- content/docs
- api
- references/api
- packages
- client/src
- spec
- src/api
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
337 | 337 | | |
338 | 338 | | |
339 | 339 | | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
340 | 362 | | |
341 | 363 | | |
342 | 364 | | |
| |||
0 commit comments