M-7: Turn events — tokenStreamed(seq)/thinkingStreamed(seq)/turnTextComplete (F-018, B-06) #137

Open
opened 2026-05-12 19:37:35 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 19:37:35 +00:00 (Migrated from github.com)

Goal

Turn events: turnStarted, tokenStreamed(turnId, seq), thinkingStreamed(turnId, seq), toolCallStarted/Updated/Ended, confirmationRequested/Resolved, turnEnded, turnError, turnTextComplete. seq: Int per turn (F-018). turnTextComplete event (G-006 / B-06 partial).

Scope

  • 10 events with typed payloads
  • seq: Int monotonic per-turn for tokenStreamed/thinkingStreamed
  • turnTextComplete emits between last tokenStreamed and turnEnded (B-06 partial)
  • turnError(code:) with enum codes

Files

  • packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Turn+Adapter.swift

Acceptance

  • All 10 events emitted with correct payloads
  • F-018: seq == prevSeq + 1 across tokenStreamed/thinkingStreamed per turn
  • B-06 partial: turnTextComplete emitted between last tokenStreamed and turnEnded
  • turnError.code is exhaustive enum (not free-form string)

Test

S-TURN-006..014 cover event surface incl. seq monotonicity + turnTextComplete ordering.

Parent epic

#11

Source

.planning/architecture/JARVIS-API-MIGRATION-PLAN.md §2.8 (M-7.3)
.planning/architecture/JARVIS-API-DESIGN-v0.2.md F-018, G-006

## Goal Turn events: turnStarted, tokenStreamed(turnId, seq), thinkingStreamed(turnId, seq), toolCallStarted/Updated/Ended, confirmationRequested/Resolved, turnEnded, turnError, turnTextComplete. seq: Int per turn (F-018). turnTextComplete event (G-006 / B-06 partial). ## Scope - 10 events with typed payloads - `seq: Int` monotonic per-turn for tokenStreamed/thinkingStreamed - `turnTextComplete` emits between last `tokenStreamed` and `turnEnded` (B-06 partial) - `turnError(code:)` with enum codes ## Files - `packages/JarvisAPI/Sources/JarvisAPI/Surfaces/Turn+Adapter.swift` ## Acceptance - [ ] All 10 events emitted with correct payloads - [ ] **F-018:** `seq == prevSeq + 1` across `tokenStreamed`/`thinkingStreamed` per turn - [ ] **B-06 partial:** `turnTextComplete` emitted between last `tokenStreamed` and `turnEnded` - [ ] `turnError.code` is exhaustive enum (not free-form string) ## Test `S-TURN-006..014` cover event surface incl. seq monotonicity + turnTextComplete ordering. ## Parent epic #11 ## Source `.planning/architecture/JARVIS-API-MIGRATION-PLAN.md` §2.8 (M-7.3) `.planning/architecture/JARVIS-API-DESIGN-v0.2.md` F-018, G-006
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#137