Make agentic terms review and refusal guidance actionable

Merged
DE
1mo ago
+141-7

Summary

Agents receiving a provider terms refusal need an explicit review and approval step, including when they only consume CLI stdout. Preserve the API action metadata and include guidance in JSON and stderr. Terms reads request explicit user approval; 403 responses retain the original error and point admins to Settings.

Adds regression coverage for presentation without acceptance, access refusal without retries, missing confirmation/version/digest, exact confirmed payloads, stale agreements, and ambiguous success responses. No real terms were accepted.

Follow-up to merged CLI #237/#239; related to firecrawl/exchange#563 and #540. Acceptance uses the existing endpoint from firecrawl/firecrawl#4668: POST /exchange/provider-terms/accept with provider, version, digest and confirmed:true. Its organization and credential come from the authenticated key, and retrieval consults the acceptance ledger. A failed catalog GET is separate from acceptance availability. No additional Core PR is required by this change.

Validation

  • TypeScript build passed.
  • 32 focused terms and Alexandria CLI integration tests passed.
  • Diff whitespace check passed.

No npm release or production deployment performed.

Existing acceptance implementation: https://github.com/firecrawl/firecrawl/pull/4668. Companion MCP update: https://github.com/firecrawl/firecrawl-mcp-server/pull/405.