AHP Swift Package v0.5.1
[0.5.1] — 2026-07-02
Implements AHP 0.5.1.
Added
- Optional
noncefield onContentRef. SubscribeParams.delivery.maxLatencyMsand
AHPClient.subscribe(_:delivery:)for clients to request a maximum
subscription delivery latency, including0for no intentional coalescing.- Optional
capabilitiesfield onAgentInfo(AgentCapabilitieswith a
nestedmultipleChatscapability carryingfork) so clients gate multi-chat
and fork via advertised capabilities instead of provider-id switches. - Cursor-based pagination for
listSessions, via new sharedPaginatedParams
(limit+cursor) andPaginatedResult(nextCursor) types:
ListSessionsParamsandListSessionsResultnow carry these fields, letting
clients page through a large session catalogue. Fully additive — omitting the
fields preserves prior behaviour. SubscribeParams.view.turns,ChatState.turnsNextCursor, and the
chat/turnsLoadedaction so clients can subscribe to a bounded tail of chat
history and page older turns into the reduced chat state on demand.SessionState.inputNeeded— a session-level aggregate of outstanding input
requests across all chats (SessionInputRequestenum with
SessionChatInputRequest,SessionToolConfirmationRequest, and
SessionToolClientExecutionRequestcases), plus the
StateAction.sessionInputNeededSet/StateAction.sessionInputNeededRemoved
actions and theToolCallConfirmationStateunion. The session reducer
maintains theSessionStatus.inputNeededactivity bit from the queue,
clearing it (falling back to.inProgress) when the last entry is removed.- Optional
intentionfield onChatToolCallStartActionand every tool-call
lifecycle state. - Optional
modelandtoolsfields onAgentCustomizationfor a custom
agent's pinned model and tool allowlist.
Changed
fetchTurnsnow acceptscursorfromChatState.turnsNextCursorand returns
an empty result after the host has loaded older turns into chat state, instead
of returning a detached{ turns, hasMore }page.- Generated clients now advertise only protocol
0.5.1, since thefetchTurns
contract is not wire-compatible with0.5.0.
Removed
filterfield fromListSessionsParams. It was an untyped placeholder with
no defined semantics; it will return with a concrete shape once session
filtering/sorting is specified.
Fixed
SnapshotStatenow decodes thechatvariant. Its decoder previously never
attemptedChatState, so chat snapshots failed to decode. Variant
disambiguation also no longer relies on the removedsummaryfield (a leftover
from beforeSessionStatewas flattened).