feat(api): expose safari session list/get/export as app_key-callable OpenAPI endpoints#69
Merged
Merged
Conversation
…nAPI
Expose three AI SRE (safari) session read endpoints in the OpenAPI spec so
the go-flashduty SDK can generate against them, powering the /insight feature:
- POST /safari/session/list (session-read-list) — paginated session list
- POST /safari/session/get (session-read-info) — one session + recent events
- POST /safari/session/export (session-read-export) — streaming NDJSON transcript
All three are Auth:"all" in the pgy registry (any valid app_key may call them).
session/export returns application/x-ndjson (one JSON object per line, first line
a session_meta envelope) and is modeled as a streaming text body with an
ExportLine reference schema rather than a typed JSON object.
Schemas grounded verbatim in the fc-safari handler/request/response structs;
request and response examples captured from live api-dev. EN authored, ZH derived
(human-facing text only). Updates per-module safari.openapi.{en,zh}.json and the
consolidated openapi.{en,zh}.json.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds three AI SRE (safari) session read endpoints to the OpenAPI spec as
app_key-callable (AppKeyAuth) operations, so the publicgo-flashdutySDK can generate typed clients against them. These power the upcoming /insight feature (analyze past sessions → surface SRE-friction suggestions).POST /safari/session/listsession-read-listPOST /safari/session/getsession-read-infoPOST /safari/session/exportsession-read-exportAll three are
Auth:"all"in the fc-pgy registry (/safari/session/list= t_api 7002,/get= 7001,/export= 7011) — any validapp_keymay call them. Reads are scoped to the account + person theapp_keyresolves to.Modeling notes
session/exportis NOT typed JSON — it returnsContent-Type: application/x-ndjson, one JSON object per line, the first line always asession_metaenvelope. It is modeled as a streaming text body with anExportLinereference schema documenting the per-line shape (session_meta,user_message,llm_call,tool_call,subagent_dispatch,final_answer,agent_text,error). Consumers must parse line-by-line and write to a file, never buffer the whole transcript. The SDK will need a hand-written streaming method for this endpoint.SessionListRequest/SessionListResponse/SessionItem,SessionGetRequest/SessionGetResponse/EventItem,SessionExportRequest). Epoch-millis fields (created_at,updated_at,last_event_at, …) carry "Unix timestamp in milliseconds" descriptions so the description-driven SDK generator maps them toTimestampMilli.get/exportare permission-gated (CanChatSession) so they include a403;listdoes not. The not-found case surfaces as HTTP 400ResourceNotFound(per Flashduty convention), already covered by theBadRequestresponse.Files
api-reference/safari.openapi.en.json,safari.openapi.zh.json(per-module, what Mintlify renders)api-reference/openapi.en.json,openapi.zh.json(consolidated, for Apifox / cross-module audits)Validation
$refin the new operations resolves; EN/ZH structural parity (path keys, operationIds, response codes, schema keys, property keys) holds; all three ops markedsecurity: [{AppKeyAuth: []}].mint broken-links: my files introduce zero broken links (the 4 reported are pre-existing onmaininon-call/.../http-pull.mdx, untouched here).