SIGN IN SIGN UP

feat(js): add deletePrompt helper to the TypeScript client (#15733)

* feat(js): add deletePrompt helper to the TypeScript client

Add `deletePrompt` to the `prompts` subpath of `@arizeai/phoenix-client`.
It accepts a prompt name or Global ID and calls
`DELETE /v1/prompts/{prompt_identifier}`, gated behind a new DELETE_PROMPT
capability requirement (Phoenix server >= 13.20.0, where the route landed).
A 404 is reported as `Prompt not found: <identifier>` with the HttpError as
the cause; other statuses surface as HttpError.

Tests cover deletion by name and by Global ID, the empty-identifier guard,
404, a 500, and the version guard. Docs note that deletion cascades to
every version of the prompt along with its version tags and labels.

Closes #15668

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tm1GwErUWb2ggbULebSjnF

* refactor(js): take a prompt selector in deletePrompt

Follow the selector convention `getPrompt` established instead of the bare
`promptIdentifier: string` string. `deletePrompt` now takes
`prompt: PromptIdentifier` — `{ name }` or `{ promptId }` — so the call site
says which kind of thing the value is.

Add `PromptIdentifier` to types/prompts as the prompt-level half of the
selector union, and `resolvePromptIdentifier` to map it onto the REST
`{prompt_identifier}` path segment. It rejects version-level selectors at
runtime: `GetPromptByTagSelector` is structurally assignable to
`GetPromptByNameSelector`, so a `{ name, tag }` variable type-checks against a
prompt-level parameter and would silently widen to deleting the whole prompt.

Document the convention in the phoenix-client-development skill, including the
`updatePrompt` inconsistency, so the next helper does not copy it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tm1GwErUWb2ggbULebSjnF

* style(js): format the new prompts skill rule with oxfmt

`fmt:check` runs oxfmt across Markdown as well as TypeScript; the new rule
file was hand-formatted. No content change — table column widths and emphasis
markers only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tm1GwErUWb2ggbULebSjnF

---------

Co-authored-by: Claude <noreply@anthropic.com>
M
Mikyo King committed
d328c3eb89ce32a24e94bd497078bc8d07d07d7a
Parent: 57e2a70
Committed by GitHub <noreply@github.com> on 8/29/2026, 1:46:07 AM