feat: add v2 documents commands - #62
Conversation
Sync the OpenAPI spec to pull in the v2 documents API, which is now GA
— no experimental flags. These auto-generate as `omni documents
v2-create`, `v2-get`, `v2-get-draft`, `v2-patch-draft`,
`v2-patch-draft-by-identifier`, and `v2-publish-draft`. Upstream
replaced the one-shot PATCH /api/v2/documents/{identifier} with the
draft flow (patch a draft, then publish it) and added the create and
publish routes. The spec is synced from the monorepo GA branch
(dan/api-v2-documents-ga) ahead of its merge to main.
Add body shorthands promoting metadata fields to flags:
--name/--description/--summary on both draft PATCH commands plus
--branch-id on v2-patch-draft, and positional <model-id> <name> with
--identifier/--description/--folder-id on v2-create. Heavy nested
content (containers, controls, queryPresentations, settings) stays on
--body/stdin and round-trips cleanly from a v2-get response.
Also document the v2 create/read/edit/publish workflow in agent-help.
Side-effect operations pulled in by the full sync: a new `omni ai-eval`
group (aiEvalPromptSets*), plus aiBranding, aiConversationDetail,
aiConversationsList, connectionsDelete, connectionsGet,
documentsListDrafts, documentsListFavorites, modelAiAgentActions.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
708d4f1 to
4841432
Compare
lukebowerman
left a comment
There was a problem hiding this comment.
I'm not going to pretend to claim that I read the 16,000 lines here, but the small bits that look actually not related to the openAPI appear fine to me.
I'm not familiar with go or this library, so would appreciate if somebody with more experience (probably @n8agrin ) could weigh in here just in case I'm missing something obvious
|
Claude says (on Jack's behalf): two findings from live-testing this build while migrating the content-builder skill (omni-agent-skills#78):
|
The v2 document draft routes declare draftIdentifier before identifier in the spec's parameters array, so generated commands took args in the reverse of the URL shape (v2-get-draft <draftIdentifier> <identifier>), 404ing for anyone following the documented order. Sort path params by their position in the path template; only the two draft-by-identifier commands change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A non-empty --body short-circuited before shorthand assembly, silently dropping promoted flags like --branch-id — e.g. a draft PATCH meant for a branch landed on mainline. Fail fast instead, naming the conflicting flags. Uses Changed() so flag defaults don't false-positive, and covers the hidden --json-body alias. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
|
Merged the last of the breaking changes for the V2 API (removing |
Adds the AI Eval runs API surface (tag "AI Eval"), which generates an
omni ai-eval runs-* command set:
- runs-list GET /api/v1/ai/eval/runs (--prompt-set-id required, --archived)
- runs-create POST /api/v1/ai/eval/runs
- runs-get GET /api/v1/ai/eval/runs/{runId}
- runs-archive DELETE /api/v1/ai/eval/runs/{runId}
- runs-cancel POST /api/v1/ai/eval/runs/{runId}/cancel
- runs-unarchive POST /api/v1/ai/eval/runs/{runId}/unarchive
The full re-sync from exploreomni/omni@main also reorders/reformats the
embedded JSON; no other operations or params were added or removed.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Summary
Adds CLI commands for the v2 documents API, which is now GA — refreshed against the latest monorepo spec (no more experimental flags).
The six operations auto-generate from the embedded spec:
omni documents v2-create <model-id> <name>POST /api/v2/documents(create + publish)omni documents v2-get <identifier>GET /api/v2/documents/{identifier}omni documents v2-get-draft <identifier> <draft-identifier>GET .../draft/{draftIdentifier}omni documents v2-patch-draft <identifier>PATCH .../draft(create draft + apply)omni documents v2-patch-draft-by-identifier <identifier> <draft-identifier>PATCH .../draft/{draftIdentifier}omni documents v2-publish-draft <identifier>POST .../draft/publishSince the first cut of this branch, upstream removed the one-shot
PATCH /api/v2/documents/{identifier}in favor of the draft flow (patch a draft, then publish) and added the create and publish routes — this refresh tracks that.Body shorthands promote metadata to flags (
--name/--description/--summary,--branch-idonv2-patch-draft; positional<model-id> <name>plus--identifier/--description/--folder-idonv2-create). Heavy nested content (containers,controls,queryPresentations,settings) stays on--body/stdin and round-trips from av2-getresponse. The agent-help guide documents the create/read/edit/publish workflow.Note: the spec is synced from the monorepo branch
dan/api-v2-documents-ga(drops the experimental flags upstream) ahead of its merge to main. New body fields on POST/PATCH endpoints don't appear as flags — those endpoints take--body.Side-effect operations pulled in by the full sync: a new
omni ai-evalgroup (aiEvalPromptSets*), plusaiBranding,aiConversationDetail,aiConversationsList,connectionsDelete,connectionsGet,documentsListDrafts,documentsListFavorites,modelAiAgentActions.Test plan
make buildandmake testpassomni documents --helpshows all six v2 commands (nov2-patch), with GA summaries (no "experimental")omni documents v2-create --help/v2-publish-draft --helpshow expected args, flags, and examplesexperimentalmarkersomni documents v2-get <identifier>against a real org🤖 Generated with Claude Code