Files
famous-ly4-ev/.ai/rules/bnfexpress.md
T
Nyan Lin Paing b8d31e3dc4 Add bnfexpress signed admin client and AI Agent Filament UI
- Modules\Shared\Bnfexpress\BnfexpressAdminClient: HMAC-signed HTTP client
  for bnfexpress's admin API (EV FAQs, agent instructions, chat history),
  with a bnfexpress:smoke-test command and full unit coverage.
- New ai-agent module: Filament pages to manage EV FAQs, publish/roll back
  agent instruction versions, and browse EV chat history + transcripts.
- New manage_ai_agent permission (super_admin/admin).
- Recorded .ai/rules for the client's auth scheme and non-Resource
  Filament page/table testing gotchas.
2026-08-30 23:52:21 +07:00

1.1 KiB

paths
paths
app-modules/shared/src/Bnfexpress/**

Bnfexpress

bnfexpress admin API calls go through BnfexpressAdminClient

Signed backend-to-backend calls to bnfexpress's admin API (EV FAQs, agent instructions, chat history) go through Modules\Shared\Bnfexpress\BnfexpressAdminClient — do not call Http:: directly against BNFEXPRESS_AI_API_URL elsewhere.

Auth is HMAC, not JWT/session: X-Client-Id/X-Timestamp/X-Signature per BnfexpressSignature::headers(), signed over METHOD\nPATH\nTIMESTAMP\nRAW_BODY (path only, no query string; empty string body for GET/DELETE). Timestamps must be generated fresh per request (server rejects >300s skew) — never cache/reuse a signed header set.

Config lives in config('services.bnfexpress') (BNFEXPRESS_AI_API_URL/CLIENT_ID/CLIENT_SECRET in .env). The client_secret must match bnfexpress's own ADMIN_SERVICE_CLIENTS entry for ev_admin — get it from whoever manages that deploy.

Non-2xx responses throw BnfexpressApiException carrying the gateway's {"detail": "..."} message. Verify signing end-to-end with php artisan bnfexpress:smoke-test before wiring up any UI.