Repository navigation
Closes the loop on the New chat UX.
Before
New chat cleared the local panel and reconnected with a fresh anonId. But:
- token-flow kept the same
clientId→ server-side transcript was untouched. v0.13.2 patched this with a one-shotskipNextTranscriptflag so the replay was suppressed, but history just piled up on the server with no way to roll it over. - public flow with stable
anonIdhad the same long-term problem once hub started honoringanonId(planned).
Now
The SDK calls POST /api/agent/<id>/transcript/archive?channel=<clientId> right before the reconnect. Best-effort: if the endpoint isn't there (older hub) or the request fails, we still clear locally and skipNextTranscript keeps the replay from undoing it. Net effect: New chat is consistent regardless of which hub version the embed talks to.
Hub-side implementations
Bridle hub (bridle/nestjs/): new IBridleTranscriptGateway.archive() method on the persistence contract, default falls back to delete(). Integrators override to do the right thing for their storage (rename to timestamped sibling, move to cold tier, etc.). New endpoint POST :agentId/transcript/archive returns { archivedPath? }.
Ranch hub (ranch/api/.../bridle.controller.ts): real implementation. Reads data/sessions/bridle:<channel>.jsonl, writes the same content to data/sessions/bridle:<channel>.<iso-ts>.archived.jsonl, deletes the live file. No-op when the live file is empty/missing. Admins still have full history under .archived. files; visitor gets a clean slate.
Install
CDN — pinned:
<script src="https://bridle.cleanslice.org/sdk/v0.13.3.js" ...></script>NPM:
bun add @cleanslice/bridle@0.13.3Changelog: sdk-v0.13.2…sdk-v0.13.3