The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.
TypeScript 3d-modelingagent-frameworkagent-harnessai-agentscadclaude-codecodexcoding-agentsdeveloper-toolsesp32game-developmentmcp-servermulti-agentopen-hardwareopencodeopenharnesspcbroboticsterminaltmux
feat(cli): serve the ESP32 dial over USB
0xdiego2578720ed18993
diff --git a/cli/scripts/sync-cable-vectors.sh b/cli/scripts/sync-cable-vectors.shnew file mode 100755index 000000000..f5700576a--- /dev/null+++ b/cli/scripts/sync-cable-vectors.sh@@ -0,0 +1,40 @@+#!/usr/bin/env bash+# Refresh src/cable/vectors/cable_frame.txt from the repository that generates it.+#+# scripts/sync-cable-vectors.sh # copy in, report whether anything changed+# scripts/sync-cable-vectors.sh --check # fail if the copy is stale (for CI, when the source is there)+#+# The vectors are generated in autonomous-code by apps/esp32-circle/scripts/gen_cable_vectors.py — a+# third implementation written from the format description, so neither the firmware's decoder nor this+# repository's blesses its own misreading. That only holds while the copy here is current: a stale copy+# lets both suites pass while the real cable disagrees.+#+# The source repository is private and most people cloning this one will not have it. Its absence is+# therefore NOT an error — the copy is checked in and works on its own; this script exists for whoever+# changes the format.+set -euo pipefail++here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"+dest="$here/../src/cable/vectors/cable_frame.txt"+src="${AUTONOMOUS_CODE:-$HOME/go/src/github.com/autonomous-ai/autonomous-code}/apps/esp32-circle/test/vectors/cable_frame.txt"++if [ ! -f "$src" ]; then+ echo "source vectors not found: $src"+ echo "(set AUTONOMOUS_CODE to the autonomous-code checkout; skipping)"+ exit 0+fi++if diff -q "$src" "$dest" >/dev/null 2>&1; then+ echo "up to date: $dest"+ exit 0+fi++if [ "${1:-}" = "--check" ]; then+ echo "STALE: $dest differs from $src" >&2+ diff "$dest" "$src" | head -20 >&2+ exit 1+fi++cp "$src" "$dest"+echo "updated: $dest"+echo "now run: npx vitest run src/cable/cableFrame.spec.ts"diff --git a/cli/src/backendSocket.ts b/cli/src/backendSocket.tsindex 8e2505bcc..b40102259 100644--- a/cli/src/backendSocket.ts+++ b/cli/src/backendSocket.ts@@ -589,7 +589,21 @@ export class BackendSocket {/** Send a DEVICE-audience frame (commanderEligible, not web). User/data frames are group-encrypted* (E2EE) here so the backend relays only ciphertext; system/presence frames pass through. */+ /**+ * A tap on everything bound for a device, taken BEFORE E2EE wrapping.+ *+ * The dial on the USB cable is a second device audience, and it wants exactly what this one gets — the+ * same `commander_event` cards, in the same order, with the same recaps. Teeing here rather than adding+ * a parallel emit at each of the two dozen call sites is what keeps the two surfaces from drifting: a+ * new event kind reaches the cable the day it reaches the socket, without anyone remembering to add it.+ *+ * Plaintext on purpose: E2EE exists because the backend relays those frames. The cable relays nothing —+ * it is a wire the user physically owns, running to a process on their own computer.+ */+ onOutboundCommander?: (frame: Frame) => void+sendCommander(frame: Frame): void {+ this.onOutboundCommander?.(frame)if (env.LOG_FRAMES) logFrame('→', 'device', frame)this.enqueue({ t: 'up', webEligible: false, commanderEligible: true, frame: this.e2ee.wrapCommander(frame) })}diff --git a/cli/src/cable/cableFrame.spec.ts b/cli/src/cable/cableFrame.spec.tsnew file mode 100644index 000000000..9c5683b99--- /dev/null+++ b/cli/src/cable/cableFrame.spec.ts@@ -0,0 +1,109 @@+// The TypeScript half of the framing agreement — see cableFrame.ts.+//+// The vectors in vectors/cable_frame.txt are a COPY. They are generated in the autonomous-code+// repository (apps/esp32-circle/scripts/gen_cable_vectors.py) by an implementation that is neither this+// one nor the firmware's, and the firmware's own host test asserts against the same file. Refresh the+// copy with scripts/sync-cable-vectors.sh; a stale copy makes this suite pass while the real link+// disagrees, which is the failure this whole arrangement exists to prevent.+import { readFileSync } from 'node:fs'+import { join } from 'node:path'+import { describe, expect, it } from 'vitest'++import { CABLE_FRAME_VERSION, CableDecoder, cableCrc16, encodeCableFrame } from './cableFrame.js'++const VECTORS = join(__dirname, 'vectors', 'cable_frame.txt')++function unhex(hex: string): Uint8Array {+ if (hex === '-' || hex === '') return new Uint8Array(0)+ const out = new Uint8Array(hex.length / 2)+ for (let i = 0; i < out.length; i++) out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16)+ return out+}++const hex = (bytes: Uint8Array) => Buffer.from(bytes).toString('hex')++interface EncodeCase {+ name: string+ type: number+ payload: string+ frame: string+}+interface StreamCase {+ name: string+ input: string+ frames: string+ discarded: number+ corrupt: number+}++function load() {+ const encode: EncodeCase[] = []+ const stream: StreamCase[] = []+ for (const line of readFileSync(VECTORS, 'utf8').split('\n')) {+ if (!line || line.startsWith('#')) continue+ const f = line.split('\t')+ if (f[0] === 'encode') encode.push({ name: f[1], type: Number(f[2]), payload: f[3], frame: f[4] })+ else if (f[0] === 'stream') {+ stream.push({ name: f[1], input: f[2], frames: f[3], discarded: Number(f[4]), corrupt: Number(f[5]) })+ }+ }+ return { encode, stream }+}++const { encode: encodeCases, stream: streamCases } = load()++/** Decode `input`, handing the decoder `chunk` bytes at a time. */+function decode(input: Uint8Array, chunk: number) {+ const d = new CableDecoder()+ const got: Array<{ type: number; payload: string }> = []+ for (let i = 0; i < input.length; i += chunk) {+ d.feed(input.subarray(i, Math.min(i + chunk, input.length)), (frame) => {+ expect(frame.version).toBe(CABLE_FRAME_VERSION)+ got.push({ type: frame.type, payload: hex(frame.payload) })+ })+ }+ return { got, discarded: d.discardedBytes, corrupt: d.corruptFrames }+}++describe('cable framing', () => {+ it('is CRC-16/CCITT-FALSE', () => {+ // If this is wrong every vector below is wrong, and the failures would read as unrelated bugs.+ expect(cableCrc16(new TextEncoder().encode('123456789'))).toBe(0x29b1)+ })++ it('has vectors to check against', () => {+ // A path typo would otherwise show up as a suite that passes by testing nothing at all.+ expect(encodeCases.length).toBeGreaterThan(5)+ expect(streamCases.length).toBeGreaterThan(5)+ })++ describe.each(encodeCases)('encode $name', (c) => {+ it('matches the vector byte for byte', () => {+ expect(hex(encodeCableFrame(c.type, unhex(c.payload)))).toBe(c.frame)+ })+ })++ describe.each(streamCases)('stream $name', (c) => {+ const want =+ c.frames === '-'+ ? []+ : c.frames.split(',').map((part) => {+ const [type, payload] = part.split(':')+ return { type: Number(type), payload: payload ?? '' }+ })++ // Both feeds, for the same reason the firmware's test runs both: the split that matters is a magic+ // pair straddling two reads, and on a real cable it happens whenever the kernel feels like it.+ it('decodes the whole buffer at once', () => {+ const { got, discarded, corrupt } = decode(unhex(c.input), Number.MAX_SAFE_INTEGER)+ expect(got).toEqual(want)+ expect({ discarded, corrupt }).toEqual({ discarded: c.discarded, corrupt: c.corrupt })+ })++ it('decodes a byte at a time', () => {+ const { got, discarded, corrupt } = decode(unhex(c.input), 1)+ expect(got).toEqual(want)+ expect({ discarded, corrupt }).toEqual({ discarded: c.discarded, corrupt: c.corrupt })+ })+ })+})diff --git a/cli/src/cable/cableFrame.ts b/cli/src/cable/cableFrame.tsnew file mode 100644index 000000000..ea6a78d1d--- /dev/null+++ b/cli/src/cable/cableFrame.ts@@ -0,0 +1,238 @@+// Framing for the USB link to the dial — turns a byte stream into messages, and messages back into bytes.+//+// The mirror image of apps/esp32-circle/main/cable_frame.c in the autonomous-code repository. Both halves+// are checked against ONE shared vector file (vectors/cable_frame.txt here, generated there by+// scripts/gen_cable_vectors.py from the format description rather than from either implementation), so a+// shared misreading shows up as a disagreement instead of being blessed by both. The two halves live in+// two repositories and cannot import each other; the vectors are the only thing they share.+//+// Wire format, little-endian throughout:+//+// A5 5A | ver:u8 | type:u8 | len:u16 | payload[len] | crc16:u16+//+// The magic is what the reader scans for after losing its place; the CRC is what separates a real frame+// from two bytes of noise that happened to look like the magic. That matters more here than on most+// links, and for a reason specific to this board: it has exactly ONE USB port, so the console and this+// protocol share a wire. The ROM, the second-stage bootloader and the panic handler all write plain text+// to it, and this reader walks into the middle of a stream at every boot.+//+// That is also why `Log` is a frame type: an ESP_LOG line arrives framed and can be filed, and only what+// the firmware cannot route — ROM chatter, a panic dump — comes as bare text, which the decoder steps+// over a byte at a time and counts.++export const CABLE_MAGIC_0 = 0xa5+export const CABLE_MAGIC_1 = 0x5a++/** Bumped only when the ENVELOPE changes. The vocabulary carries its own version in `hello`. */+export const CABLE_FRAME_VERSION = 1++export const CABLE_HEADER_BYTES = 6 // magic(2) + ver(1) + type(1) + len(2)+export const CABLE_CRC_BYTES = 2++/**+ * A bound on damage, not a capacity target. A corrupt length field can claim up to 65535 bytes, and with+ * no ceiling the reader would sit waiting for a frame that is never coming while real frames pile up+ * behind it — a hang, not a dropped message.+ */+export const CABLE_MAX_PAYLOAD = 8192++export const CABLE_MAX_FRAME = CABLE_HEADER_BYTES + CABLE_MAX_PAYLOAD + CABLE_CRC_BYTES++/** Payload kinds. An unknown code is handed up with its raw byte, never dropped. */+export const CableType = {+ Json: 0x01, // UTF-8 JSON object with a "t" discriminator — the vocabulary+ Pcm: 0x02, // one chunk of 16-bit mono PCM, dial → daemon, during a voice turn+ Fw: 0x03, // one slice of a firmware image, daemon → dial only+ Log: 0x04, // one ESP_LOG line, dial → daemon, raw bytes (no JSON escaping)+} as const++/**+ * CRC-16/CCITT-FALSE — poly 0x1021, init 0xFFFF, no reflection, no final xor.+ *+ * Named exactly because several 16-bit CRCs share the 0x1021 polynomial and differ only in init or+ * reflection; the published check value for "123456789" is 0x29B1, which both test suites assert.+ */+export function cableCrc16(data: Uint8Array, from = 0, to = data.length): number {+ let crc = 0xffff+ for (let i = from; i < to; i++) {+ crc ^= data[i] << 8+ for (let bit = 0; bit < 8; bit++) {+ crc = crc & 0x8000 ? ((crc << 1) ^ 0x1021) & 0xffff : (crc << 1) & 0xffff+ }+ }+ return crc+}++/**+ * Frame `payload`. Throws when it is over the cap rather than truncating: an oversized message is a bug+ * on this side, and the far end could only ever report it as noise.+ */+export function encodeCableFrame(type: number, payload: Uint8Array = new Uint8Array(0)): Uint8Array {+ if (payload.length > CABLE_MAX_PAYLOAD) {+ throw new Error(`cable frame payload ${payload.length} over the ${CABLE_MAX_PAYLOAD} cap`)+ }+ const out = new Uint8Array(CABLE_HEADER_BYTES + payload.length + CABLE_CRC_BYTES)+ out[0] = CABLE_MAGIC_0+ out[1] = CABLE_MAGIC_1+ out[2] = CABLE_FRAME_VERSION+ out[3] = type+ out[4] = payload.length & 0xff+ out[5] = (payload.length >> 8) & 0xff+ out.set(payload, CABLE_HEADER_BYTES)+ // Covers ver..payload. The magic is a marker, not data — including a constant would add nothing to+ // detect.+ const crc = cableCrc16(out, 2, CABLE_HEADER_BYTES + payload.length)+ out[out.length - 2] = crc & 0xff+ out[out.length - 1] = (crc >> 8) & 0xff+ return out+}++export interface CableFrame {+ version: number+ type: number+ payload: Uint8Array+}++/**+ * Reassembles frames from a byte stream that may start anywhere and contain anything.+ *+ * Never throws: everything arriving on this port is untrusted, and the only useful response to a byte+ * that makes no sense is to step over it.+ */+export class CableDecoder {+ private buf = new Uint8Array(CABLE_MAX_FRAME)+ private len = 0++ /**+ * The RATE is what matters, which is why these are counters and not booleans: a handful of discarded+ * bytes at every boot is the bootloader's parting words and is expected, while a steady trickle during+ * a session means the two sides disagree about the format or the cable is bad. Those are very+ * different problems and look identical without a count.+ */+ discardedBytes = 0+ corruptFrames = 0++ /**+ * Forget any partial frame. Call when the port is reopened: leftover bytes belong to a session that has+ * ended, and carrying them across would put a stale half-frame in front of the next real one.+ *+ * The counters deliberately survive — they exist to show a trend across the whole run.+ */+ reset(): void {+ this.len = 0+ }++ /** Feed bytes and emit every frame they complete, in order. */+ feed(data: Uint8Array, onFrame: (frame: CableFrame) => void): void {+ for (let i = 0; i < data.length; i++) {+ // Full and still no frame means the head was never a real one. Making room by dropping the oldest+ // byte keeps the link alive; refusing the new byte instead would wedge it permanently.+ if (this.len === this.buf.length) this.discard(1)++ this.buf[this.len++] = data[i]++ // Only worth attempting once a header could be complete. This also keeps the magic scan amortised:+ // it runs on resync, not per byte.+ if (this.len >= CABLE_HEADER_BYTES) {+ while (this.takeFront(onFrame)) {+ // keep going: one read can complete several frames+ }+ }+ }+ }++ /** Take `count` bytes off the front, keeping the rest. Says nothing about why. */+ private consume(count: number): void {+ if (count <= 0) return+ if (count >= this.len) {+ this.len = 0+ return+ }+ this.buf.copyWithin(0, count, this.len)+ this.len -= count+ }++ /**+ * Consume bytes that turned out not to be a frame, and say so.+ *+ * Split from consume() rather than counting inside it: the bytes of a frame that decoded fine are also+ * consumed, and counting those as discarded would make the health number read as "this link is full of+ * noise" on a link that is working perfectly.+ */+ private discard(count: number): void {+ this.discardedBytes += Math.min(count, this.len)+ this.consume(count)+ }++ /**+ * Offset of the next complete magic, or -1.+ *+ * Stops one short of the end on purpose: a final lone byte cannot be judged yet, and the caller keeps+ * it in case the next read completes the pair.+ */+ private indexOfMagic(): number {+ for (let i = 0; i + 1 < this.len; i++) {+ if (this.buf[i] === CABLE_MAGIC_0 && this.buf[i + 1] === CABLE_MAGIC_1) return i+ }+ return -1+ }++ /**+ * Try to take one frame off the front. True when one was emitted (so try again), false when more bytes+ * are needed. Noise is consumed internally rather than reported, so the caller never has to tell "wait"+ * from "that was rubbish".+ */+ private takeFront(onFrame: (frame: CableFrame) => void): boolean {+ for (;;) {+ const headIsMagic =+ this.len >= 2 && this.buf[0] === CABLE_MAGIC_0 && this.buf[1] === CABLE_MAGIC_1++ if (!headIsMagic) {+ const at = this.indexOfMagic()+ if (at < 0) {+ // Keep a trailing A5: the 5A may simply not have arrived yet.+ const keep = this.len > 0 && this.buf[this.len - 1] === CABLE_MAGIC_0 ? 1 : 0+ this.discard(this.len - keep)+ return false+ }+ this.discard(at)+ continue+ }++ if (this.len < CABLE_HEADER_BYTES) return false++ const payloadLen = this.buf[4] | (this.buf[5] << 8)++ // A length this large cannot be real, so those two bytes were noise rather than a header. Step over+ // one byte and keep hunting; waiting for 64 KB that is never coming would stall the link.+ if (payloadLen > CABLE_MAX_PAYLOAD) {+ this.discard(1)+ continue+ }++ const total = CABLE_HEADER_BYTES + payloadLen + CABLE_CRC_BYTES+ if (this.len < total) return false++ const expected = this.buf[total - 2] | (this.buf[total - 1] << 8)+ const actual = cableCrc16(this.buf, 2, CABLE_HEADER_BYTES + payloadLen)++ if (actual !== expected) {+ // Drop ONE byte, not the whole frame: the magic may have been a coincidence inside noise, and a+ // genuine frame can begin one byte further in. Dropping the lot would swallow it.+ this.corruptFrames+++ this.discard(1)+ continue+ }++ onFrame({+ version: this.buf[2],+ type: this.buf[3],+ // Copied, not a view: the caller keeps PCM and firmware payloads across ticks, and the buffer+ // underneath is about to be shifted by the next frame.+ payload: this.buf.slice(CABLE_HEADER_BYTES, CABLE_HEADER_BYTES + payloadLen),+ })+ this.consume(total)+ return true+ }+ }+}diff --git a/cli/src/cable/cableHost.ts b/cli/src/cable/cableHost.tsnew file mode 100644index 000000000..80f9eac73--- /dev/null+++ b/cli/src/cable/cableHost.ts@@ -0,0 +1,263 @@+// Everything the cable session needs from the rest of the daemon, in one place.+//+// The session owns the protocol and nothing else; this owns the answers. Keeping them apart is what lets+// the protocol be tested against a fake host — the alternative is a suite that needs tmux, a microphone+// and a network to prove that `hello` gets a `welcome`.+//+// Nothing here is new machinery. The agent list is the registry the web and the backend socket already+// read, the router is the one the backend already calls for remote machines, and the turn events arrive+// as the very `commander_event` cards the WiFi device receives — teed at the socket rather than emitted+// again here, so the two device surfaces cannot drift.+import { join } from 'node:path'++import { AuthSessionManager, readAuthSession } from '../lib/authSession.js'+import { registry, projectDisplayName, type RegisteredSession } from '../lib/registry.js'+import { fetchRelease, loadImage, shouldOffer } from './fwPush.js'+import { routeVoiceTask, type RouterAgent } from '../lib/voiceRouter.js'+import { env } from '../config/env.js'++import type { CableAgent, CableHost, RouteDecision } from './cableSession.js'++/** One completed turn's recap, as the mirror keeps them. */+export interface RecentTurn {+ recap?: string+ text?: string+}++export interface CableHostWiring {+ machineName: () => string+ /** Deliver text into an agent. The SAME path the web and the WiFi device use — see cli.ts. */+ sendTurn: (agentId: string, text: string) => void+ stopTurn: (agentId: string) => void+ answer: (agentId: string, id: string, optionId: string) => void+ /** Recaps of an agent's last `n` completed turns, for routing. */+ recent: (agentId: string, n: number) => RecentTurn[]+ /** The opaque runtime-v1 profile, which is where the dial's Model/Effort chips come from. */+ runtimeProfile?: (session: RegisteredSession) => string | null+ updateAgent?: (agentId: string, model?: string, effort?: string) => void+ /** The runtime catalog, from the same provider the web and the WiFi device read. */+ listModels?: (agentId: string) => Promise<Array<{ id: string }>>+ log: (line: string) => void+}++/** Split `runtime-v1:<sid>:<engine>:<model>@<effort>` back into the two words the dial's chips show. */+function chipsFromProfile(profile: string | null | undefined): { model?: string; effort?: string } {+ if (!profile || !profile.startsWith('runtime-v1:')) return {}+ const tail = profile.split(':').slice(3).join(':')+ if (!tail) return {}+ const [model, effort] = tail.split('@')+ return { model: model || undefined, effort: effort || undefined }+}++export class DaemonCableHost implements CableHost {+ constructor(private readonly wiring: CableHostWiring) {}++ machineName(): string {+ return this.wiring.machineName()+ }++ appName(): string {+ return 'harness'+ }++ voiceLang(): string {+ // A PROPOSAL, not a decision. The dial keeps its own choice in NVS and states it on every capture —+ // the person holding it may well speak something other than this laptop is set to.+ const locale = process.env.LANG ?? ''+ return locale.startsWith('vi') ? 'vi' : 'en'+ }++ async listAgents(): Promise<CableAgent[]> {+ const sessions = registry.list()+ // Oldest → newest: a stable order that does not reshuffle as agents become active, which matters more+ // on a carousel than on a list — a tile that moves under a swipe is a tile you cannot aim at.+ sessions.sort((a, b) => a.registeredAt - b.registeredAt)+ return sessions.map((s) => ({+ id: s.agentId,+ name: projectDisplayName(s),+ engine: s.engine ?? '',+ ...chipsFromProfile(this.wiring.runtimeProfile?.(s)),+ }))+ }++ sendTurn(agentId: string, text: string): void {+ this.wiring.sendTurn(agentId, text)+ }++ stopTurn(agentId: string): void {+ this.wiring.stopTurn(agentId)+ }++ answer(agentId: string, id: string, optionId: string): void {+ this.wiring.answer(agentId, id, optionId)+ }++ focus(agentId: string): void {+ // A statement about where the user is looking. Nothing on this machine has to move for it yet — the+ // daemon has no window of its own — so it is recorded and logged rather than acted on.+ this.wiring.log(`cable: focus ${agentId}`)+ }++ updateAgent(agentId: string, model?: string, effort?: string): void {+ this.wiring.updateAgent?.(agentId, model, effort)+ }++ async listModels(agentId: string): Promise<string[]> {+ const models = (await this.wiring.listModels?.(agentId)) ?? []+ return models.map((m) => m.id).filter(Boolean)+ }++ /**+ * The image to offer, or null for "nothing to do".+ *+ * Null covers three different situations on purpose, because the dial reacts to all of them the same+ * way — by carrying on: the dial is current, it is running a dev build that must not be touched, or the+ * manifest is unreachable. An update is an opportunity here, never a condition of working.+ */+ async firmwareFor(runningVersion: string): Promise<{ version: string; image: Buffer; sha256: string } | null> {+ if (env.CABLE_FW_DISABLE) return null+ const release = await fetchRelease(env.CABLE_FW_MANIFEST_URL)+ if (!release || !shouldOffer(runningVersion, release.version)) return null+ const image = await loadImage(release, join(env.ADAPTER_DATA_DIR, 'firmware'))+ if (!image) return null+ return { version: release.version, image, sha256: release.sha256 }+ }++ /**+ * Which agent the spoken words belong to.+ *+ * The daemon's own router: it scores by name and recent activity, and classifies with an engine CLI the+ * machine is ALREADY running when the score cannot separate the top two. No key, no relay, no network —+ * which is the whole reason voice on the cable does not inherit the hosted path's failure modes.+ */+ async route(transcript: string, agents: CableAgent[]): Promise<RouteDecision> {+ const candidates: RouterAgent[] = agents.map((a) => ({+ id: a.id,+ name: a.name,+ engine: a.engine,+ recentSummary: this.wiring+ .recent(a.id, 3)+ .map((r) => r?.recap || r?.text || '')+ .filter(Boolean)+ .join(' · '),+ }))+ const decision = await routeVoiceTask(transcript, candidates)+ return { agentId: decision.agentId, confidence: decision.confidence, reason: decision.reason }+ }++ /**+ * Transcribe one capture.+ *+ * The dial records and the daemon transcribes. The device holds no cloud credential and never talks to+ * one; THIS side has an account — `harness login` leaves a real SSO session behind, and the endpoint is+ * gated by it like every other control-plane call.+ *+ * No shared secret, deliberately. This repository is public, so a key baked into it is a key everybody+ * has; a bearer token is issued per person, expires on its own and can be revoked.+ *+ * The 401 retry is not defensive padding. A token can expire between the moment the user pressed the+ * dial's button and the moment the upload finishes — a long dictation is minutes — and losing a spoken+ * sentence to a clock is the one failure the person cannot work around.+ */+ async transcribe(pcm: Buffer, sampleRate: number, lang: string): Promise<string> {+ const session = readAuthSession()+ if (!session) throw new Error('Voice needs a signed-in harness — run `harness login`')++ const auth = new AuthSessionManager(this.backendHttpBase())+ const url = `${this.backendHttpBase()}${env.CABLE_STT_PATH}?lang=${encodeURIComponent(lang)}`+ // The WAV is built ONCE: it is the same bytes on a retry, and re-encoding megabytes to say the same+ // thing twice is time taken out of a person's turn.+ const boundary = `harness-${Math.random().toString(36).slice(2)}`+ const body = multipart(wav(pcm, sampleRate), 'voice.wav', 'audio/wav', boundary)++ const post = async (token: string) =>+ fetch(url, {+ method: 'POST',+ headers: {+ authorization: `Bearer ${token}`,+ 'x-autonomous-env': session.autonomousEnv,+ 'content-type': `multipart/form-data; boundary=${boundary}`,+ },+ body,+ })++ let token = await auth.accessToken()+ let res = await post(token)+ if (res.status === 401) {+ // `failedToken` is what makes this one refresh rather than a loop: the manager only refreshes when+ // the token that failed is still the current one, so two callers racing a stale token do not each+ // burn a refresh.+ token = await auth.accessToken({ failedToken: token })+ res = await post(token)+ }+ if (!res.ok) throw new Error(`Transcription failed (HTTP ${res.status})`)++ const json = (await res.json()) as { success?: boolean; data?: { transcript?: string }; error?: { message?: string } }+ if (!json.success) throw new Error(json.error?.message ?? 'Transcription failed')+ return json.data?.transcript ?? ''+ }++ /** The control plane, derived from the socket URL the daemon already talks to. */+ private backendHttpBase(): string {+ return env.BACKEND_WS_URL.replace(/\/$/, '').replace(/^wss:/, 'https:').replace(/^ws:/, 'http:')+ }++ log(line: string): void {+ this.wiring.log(line)+ }+}++/**+ * Wrap raw 16-bit little-endian mono PCM in a WAV header.+ *+ * A self-describing container rather than raw samples, and the server depends on it: it forwards the file+ * under its own Content-Type with NO encoding or sample-rate hints, precisely so the container can state+ * its own rate. Headerless PCM would be read as if the first 44 bytes were audio.+ */+export function wav(pcm: Buffer, sampleRate: number): Buffer {+ const header = Buffer.alloc(44)+ header.write('RIFF', 0)+ header.writeUInt32LE(36 + pcm.length, 4)+ header.write('WAVE', 8)+ header.write('fmt ', 12)+ header.writeUInt32LE(16, 16) // fmt chunk size+ header.writeUInt16LE(1, 20) // PCM+ header.writeUInt16LE(1, 22) // mono+ header.writeUInt32LE(sampleRate, 24)+ header.writeUInt32LE(sampleRate * 2, 28) // byte rate: rate * channels * 2+ header.writeUInt16LE(2, 32) // block align+ header.writeUInt16LE(16, 34) // bits per sample+ header.write('data', 36)+ header.writeUInt32LE(pcm.length, 40)+ return Buffer.concat([header, pcm])+}++/**+ * One file as multipart/form-data, in the shape the endpoint's `req.file()` expects.+ *+ * Every newline is CRLF: the format requires it, and a bare \n produces a body some parsers accept and+ * Fastify's does not — surfacing as "Missing audio file" for a request that plainly contains one.+ */+export function multipart(file: Buffer, filename: string, mimeType: string, boundary: string): Buffer {+ const head = Buffer.from(+ `--${boundary}\r\nContent-Disposition: form-data; name="file"; filename="${filename}"\r\n` ++ `Content-Type: ${mimeType}\r\n\r\n`,+ 'utf8',+ )+ return Buffer.concat([head, file, Buffer.from(`\r\n--${boundary}--\r\n`, 'utf8')])+}++/**+ * Translate one device-bound `commander_event` into the cable's vocabulary.+ *+ * Returns null for cards the dial has no use for. The kinds are the WiFi device's own, unchanged: a new+ * kind reaches the cable the day it reaches the socket.+ */+export function cableEventFor(+ frame: { type?: string; agentId?: string; payload?: { kind?: string; text?: string; recap?: string } },+): { kind: 'processing' | 'done' | 'summary' | 'error'; agentId: string; text: string; recap: string } | null {+ if (frame.type !== 'commander_event' || !frame.agentId) return null+ const kind = frame.payload?.kind+ if (kind !== 'processing' && kind !== 'done' && kind !== 'summary' && kind !== 'error') return null+ return { kind, agentId: frame.agentId, text: frame.payload?.text ?? '', recap: frame.payload?.recap ?? '' }+}diff --git a/cli/src/cable/cableSession.spec.ts b/cli/src/cable/cableSession.spec.tsnew file mode 100644index 000000000..a77880158--- /dev/null+++ b/cli/src/cable/cableSession.spec.ts@@ -0,0 +1,271 @@+// The protocol, driven through a loopback port — no dial, no tmux, no network.+//+// What is worth testing here is not that JSON round-trips. It is the three rules the header names, each of+// which was paid for on real hardware and each of which is invisible until it is wrong:+//+// · every `hello` is answered, but only an unfamiliar dial gets the whole state pushed again+// · silence reopens the port, because a dead handle keeps accepting writes+// · a voice turn with no agent named goes through the router before it goes anywhere+import { mkdtempSync, readFileSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import { describe, expect, it, vi } from 'vitest'++import { CableDecoder, CableType, encodeCableFrame } from './cableFrame.js'+import { CableSession, type CableAgent, type CableHost, type CablePort } from './cableSession.js'++/** A port whose two ends are both in this process. */+class LoopbackPort implements CablePort {+ readonly path = '/dev/loopback'+ isOpen = true+ /** Everything the daemon wrote, decoded back into messages. */+ readonly sent: Array<Record<string, unknown>> = []+ closedWith: string | null = null++ private decoder = new CableDecoder()++ constructor(private readonly onData: (chunk: Buffer) => void) {}++ async write(bytes: Uint8Array): Promise<void> {+ this.decoder.feed(Buffer.from(bytes), (frame) => {+ if (frame.type === CableType.Json) {+ this.sent.push(JSON.parse(Buffer.from(frame.payload).toString('utf8')) as Record<string, unknown>)+ }+ })+ }++ async close(why = 'closed'): Promise<void> {+ this.isOpen = false+ this.closedWith = why+ }++ /** Speak as the dial. */+ say(msg: Record<string, unknown>): void {+ this.onData(Buffer.from(encodeCableFrame(CableType.Json, Buffer.from(JSON.stringify(msg), 'utf8'))))+ }++ pcm(bytes: Buffer): void {+ this.onData(Buffer.from(encodeCableFrame(CableType.Pcm, bytes)))+ }++ /** A framed ESP_LOG line, as the dial sends while the daemon holds its only port. */+ logLine(text: string): void {+ this.onData(Buffer.from(encodeCableFrame(CableType.Log, Buffer.from(text, 'utf8'))))+ }++ /** Only the `t` of each message the daemon sent, in order. */+ types(): string[] {+ return this.sent.map((m) => m.t as string)+ }+}++const AGENTS: CableAgent[] = [+ { id: 'a1', name: 'Fix login screen', engine: 'claude' },+ { id: 'a2', name: 'Device firmware voice', engine: 'codex' },+]++function makeHost(over: Partial<CableHost> = {}) {+ const host: CableHost = {+ machineName: () => 'MacBook Pro',+ appName: () => 'harness',+ voiceLang: () => 'en',+ listAgents: async () => AGENTS,+ sendTurn: vi.fn(),+ stopTurn: vi.fn(),+ answer: vi.fn(),+ focus: vi.fn(),+ updateAgent: vi.fn(),+ listModels: async () => ['runtime-v1:s1:claude:opus@high', 'runtime-v1:s1:claude:sonnet@low'],+ transcribe: async () => 'fix the login screen',+ route: async () => ({ agentId: 'a1', confidence: 0.9, reason: 'name matched' }),+ log: () => {},+ ...over,+ }+ return host+}++/** Start a session on a loopback and hand back both ends. Never touches the real serial layer. */+async function connect(host: CableHost = makeHost(), logPath = '/dev/null') {+ let port!: LoopbackPort+ const session = new CableSession(host, logPath, async (onData) => {+ port = new LoopbackPort(onData)+ return port+ })+ session.start()+ await vi.waitFor(() => expect(port).toBeDefined())+ return { session, port, host }+}++/** Let the microtask queue drain — every send is async. */+const settle = () => new Promise((r) => setTimeout(r, 0))++describe('cable session', () => {+ it('answers hello with welcome and pushes the agent list once', async () => {+ const { session, port } = await connect()+ port.say({ t: 'hello', fw: '0.1.0', proto: 1, mac: 'aa:bb' })+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))++ expect(port.types()).toEqual(['welcome', 'agents.begin', 'agent', 'agent', 'agents.end'])+ const welcome = port.sent[0]+ expect(welcome).toMatchObject({ t: 'welcome', app: 'harness', machine: { name: 'MacBook Pro' } })+ // Streamed one per message: a hundred agents do not fit in one 8 KB frame, and the dial must not have+ // to reassemble anything.+ expect(port.sent[2]).toMatchObject({ t: 'agent', id: 'a1', name: 'Fix login screen', engine: 'claude' })+ await session.stop()+ })++ it('answers a repeat hello WITHOUT re-pushing the list', async () => {+ const { session, port } = await connect()+ port.say({ t: 'hello', mac: 'aa:bb' })+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))+ port.sent.length = 0++ // The dial greets every 15 s for as long as it is plugged in. Re-attaching on each of those re-sends+ // the whole state four times a minute and undoes the "say nothing when nothing changed" rule.+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ expect(port.types()).toEqual(['welcome'])+ await session.stop()+ })++ it('re-attaches for a DIFFERENT dial', async () => {+ const { session, port } = await connect()+ port.say({ t: 'hello', mac: 'aa:bb' })+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))+ port.sent.length = 0++ port.say({ t: 'hello', mac: 'cc:dd' })+ await vi.waitFor(() => expect(port.types()).toContain('agents.end'))+ expect(port.types()).toEqual(['welcome', 'agents.begin', 'agent', 'agent', 'agents.end'])+ await session.stop()+ })++ it('delivers a turn through the host, not through the protocol', async () => {+ const host = makeHost()+ const { session, port } = await connect(host)+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.say({ t: 'turn.send', agentId: 'a2', text: 'flash it' })+ await settle()+ expect(host.sendTurn).toHaveBeenCalledWith('a2', 'flash it')+ await session.stop()+ })++ it('routes a voice turn that names no agent', async () => {+ const host = makeHost()+ const { session, port } = await connect(host)+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.sent.length = 0++ port.say({ t: 'voice.begin', lang: 'vi' })+ port.pcm(Buffer.alloc(3200, 7))+ port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(port.types()).toContain('voice.transcript'))++ // The transcript went to the router's pick, and the dial was told which tile to land on.+ expect(host.sendTurn).toHaveBeenCalledWith('a1', 'fix the login screen')+ expect(port.sent.at(-1)).toMatchObject({ t: 'voice.transcript', agentId: 'a1', agentName: 'Fix login screen' })+ await session.stop()+ })++ it('sends a voice turn straight to the agent the dial named', async () => {+ const route = vi.fn()+ const host = makeHost({ route })+ const { session, port } = await connect(host)+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()++ port.say({ t: 'voice.begin', agentId: 'a2', lang: 'en' })+ port.pcm(Buffer.alloc(3200, 1))+ port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(host.sendTurn).toHaveBeenCalled())++ // Naming a tile IS the decision. Asking a router to confirm it is latency spent to reach the same answer.+ expect(route).not.toHaveBeenCalled()+ expect(host.sendTurn).toHaveBeenCalledWith('a2', 'fix the login screen')+ await session.stop()+ })++ it('transcribes at the rate the dial states, not a guess', async () => {+ // 8 kHz described as 16 kHz is not slightly-off speech: the container lies about itself and the+ // transcriber answers with an empty string.+ let sawRate = 0+ const host = makeHost({+ transcribe: async (_pcm, rate) => { sawRate = rate; return 'xin chào' },+ })+ const { session, port } = await connect(host)+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.say({ t: 'voice.begin', lang: 'vi', sr: 8000 })+ port.pcm(Buffer.alloc(1600, 3))+ port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(sawRate).toBe(8000))+ await session.stop()+ })++ it('says so rather than guessing when transcription fails', async () => {+ const host = makeHost({+ transcribe: async () => {+ throw new Error('Voice needs CABLE_STT_API_KEY')+ },+ })+ const { session, port } = await connect(host)+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.say({ t: 'voice.begin', lang: 'en' })+ port.pcm(Buffer.alloc(64))+ port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))++ expect(port.sent.at(-1)).toMatchObject({ t: 'voice.error', message: 'Voice needs CABLE_STT_API_KEY' })+ expect(host.sendTurn).not.toHaveBeenCalled()+ await session.stop()+ })++ it('answers models.list even when the catalog is empty', async () => {+ // The dial BLOCKS on this one message — it cannot draw a picker until the catalog is in hand. Silence+ // strands it on a spinner until its own timeout, which reads as a hang rather than "no choices here".+ const { session, port } = await connect(makeHost({ listModels: async () => [] }))+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.sent.length = 0+ port.say({ t: 'models.list', agentId: 'a1', mode: 'model' })+ await vi.waitFor(() => expect(port.types()).toContain('models'))+ expect(port.sent.at(-1)).toMatchObject({ t: 'models', agentId: 'a1', items: [] })+ await session.stop()+ })++ it('answers models.list when the provider throws', async () => {+ const { session, port } = await connect(makeHost({ listModels: async () => { throw new Error('no engine') } }))+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.say({ t: 'models.list', agentId: 'a1' })+ await vi.waitFor(() => expect(port.types()).toContain('models'))+ await session.stop()+ })++ it('files framed device logs instead of losing them', async () => {+ // The dial has ONE USB port, shared by its console and this protocol. While the daemon holds it,+ // these frames are the only copy of that console which exists anywhere — `idf.py monitor` cannot open+ // the port at the same time.+ const path = join(mkdtempSync(join(tmpdir(), 'cable-')), 'dial.log')+ const { session, port } = await connect(makeHost(), path)+ port.logLine('I (1234) cable: link up')+ await vi.waitFor(() => expect(readFileSync(path, 'utf8')).toContain('I (1234) cable: link up'))+ await session.stop()+ })++ it('drops audio that arrives outside a turn', async () => {+ // A dial that rebooted mid-capture starts sending PCM again with no `voice.begin` in front of it.+ const host = makeHost()+ const { session, port } = await connect(host)+ port.say({ t: 'hello', mac: 'aa:bb' })+ await settle()+ port.pcm(Buffer.alloc(3200, 9))+ port.say({ t: 'voice.end' })+ await vi.waitFor(() => expect(port.types()).toContain('voice.error'))+ expect(host.sendTurn).not.toHaveBeenCalled()+ await session.stop()+ })+})diff --git a/cli/src/cable/cableSession.ts b/cli/src/cable/cableSession.tsnew file mode 100644index 000000000..f1e5abe6e--- /dev/null+++ b/cli/src/cable/cableSession.ts@@ -0,0 +1,488 @@+// The message layer: what the daemon and the dial SAY to each other, on top of the bytes serial.ts moves.+//+// Written twice — here and in apps/esp32-circle/main/cable_client.c of the autonomous-code repository —+// with no shared code, because the two halves ship from different repositories. The framing underneath+// agrees by shared vectors; this layer agrees by docs/cable-protocol.md and by being small enough to read+// in one sitting.+//+// THE VOCABULARY IS THE PRODUCT'S: machine → agent → session. The machine is this computer, the agents+// are what the registry holds, and a session is one conversation underneath an agent.+//+// Three rules here were paid for on real hardware and are not style:+//+// 1. ANSWER EVERY `hello`, RE-ATTACH ONLY FOR A DIAL NOT ALREADY GREETED. The dial greets on a cadence+// because it has no port-open event to wait on. Attaching means "this device knows nothing" and+// pushes the whole state again; doing that on every greeting re-sends everything every 15 seconds.+//+// 2. PING EVEN WHEN IDLE, AND REOPEN THE PORT ON SILENCE. After the dial reboots, macOS hands back a+// `/dev/cu.usbmodem*` node with the same name, the same inode and the same device numbers. Writes to+// the old handle keep succeeding, the read never completes, and nothing raises. Without a heartbeat+// this daemon would talk to a dead file for as long as anyone watched.+//+// 3. SAY NOTHING WHEN NOTHING CHANGED. That is what keeps the link idle during a long turn, and it is+// why rule 2 has to exist at all.+import { appendFile } from 'node:fs/promises'++import { CableDecoder, CableType, encodeCableFrame } from './cableFrame.js'+import { FirmwareTransfer } from './fwPush.js'+import { SerialLink, findDialPort } from './serial.js'++/** Bumped when the VOCABULARY changes. Separate from the frame version, which is the envelope. */+export const CABLE_PROTO_VERSION = 1++const PING_EVERY_MS = 5_000+/** No bytes of any kind for this long → the handle is dead. Longer than the dial's own 15 s window, so a+ * single late message cannot trip both sides at once and have each conclude the other left. */+const SILENCE_MS = 20_000+const REOPEN_EVERY_MS = 2_000++/** What a `voice.begin` without an `sr` is assumed to be — firmware old enough not to say. */+const DEFAULT_VOICE_RATE = 16_000++/** A voice turn longer than this is a stuck dial, not a person talking. 16 kHz mono 16-bit ≈ 32 KB/s. */+const VOICE_MAX_BYTES = 10 * 60 * 32_000++export interface CableAgent {+ id: string+ name: string+ engine?: string+ model?: string+ effort?: string+}++export interface RouteDecision {+ agentId: string+ confidence: number+ reason: string+}++/**+ * Everything the session needs from the rest of the daemon. An interface rather than a direct import so+ * the protocol can be tested against a fake — the alternative is a suite that needs tmux, a microphone+ * and a network to prove that `hello` gets a `welcome`.+ */+export interface CableHost {+ machineName(): string+ appName(): string+ voiceLang(): string+ listAgents(): Promise<CableAgent[]>+ sendTurn(agentId: string, text: string): void+ stopTurn(agentId: string): void+ answer(agentId: string, id: string, optionId: string): void+ focus(agentId: string): void+ updateAgent(agentId: string, model?: string, effort?: string): void+ /** PCM is 16-bit mono at `sampleRate`; the daemon owns the credential this needs. */+ transcribe(pcm: Buffer, sampleRate: number, lang: string): Promise<string>+ /** Which agent the words belong to. Scored locally first; only a genuine tie should cost a network call. */+ route(transcript: string, agents: CableAgent[]): Promise<RouteDecision>+ /** The runtime model/effort catalog for one agent, as opaque profile ids the dial groups and shows. */+ listModels(agentId: string): Promise<string[]>+ /**+ * The image to offer a dial running `runningVersion`, or null for "nothing to do" — which covers a+ * dial that is current, a dev build that must not be touched, and an unreachable manifest.+ */+ firmwareFor?(runningVersion: string): Promise<{ version: string; image: Buffer; sha256: string } | null>+ log(line: string): void+}++interface Message {+ t: string+ [key: string]: unknown+}++/**+ * The part of a port this layer uses. An interface rather than the class, so the protocol can be driven+ * by a loopback in tests — proving that `hello` gets a `welcome` should not require a dial on the desk.+ */+export interface CablePort {+ readonly path: string+ readonly isOpen: boolean+ write(bytes: Uint8Array): Promise<void>+ close(why?: string): Promise<void>+}++/** Open the dial's port, or null when it is not there. Both are ordinary answers. */+export type PortOpener = (+ onData: (chunk: Buffer) => void,+ onClosed: (why: string) => void,+) => Promise<CablePort | null>++/** The real one: find the tty by USB id, open it raw. */+export const openDialPort: PortOpener = async (onData, onClosed) => {+ const port = await findDialPort()+ if (!port) return null+ return SerialLink.open(port.path, onData, onClosed)+}++export class CableSession {+ private link: CablePort | null = null+ private decoder = new CableDecoder()+ private timer: NodeJS.Timeout | null = null+ private greetedMac: string | null = null+ private lastRx = 0+ private stopped = false++ /** A firmware transfer in flight, and the versions already tried this session. */+ private transfer: FirmwareTransfer | null = null+ private offered = new Set<string>()++ /** Voice capture in flight: PCM chunks as they arrive, plus what `voice.begin` said about them. */+ private voice: { agentId?: string; cmd?: string; lang: string; rate: number; chunks: Buffer[]; bytes: number } | null = null++ constructor(+ private readonly host: CableHost,+ /** Where framed device logs are appended. The dial has one USB port, so this file is its console. */+ private readonly logPath: string,+ private readonly openPort: PortOpener = openDialPort,+ ) {}++ get isConnected(): boolean {+ return this.link?.isOpen === true && this.greetedMac !== null+ }++ start(): void {+ this.stopped = false+ this.timer = setInterval(() => void this.tick(), 1_000)+ void this.tick()+ }++ async stop(): Promise<void> {+ this.stopped = true+ if (this.timer) clearInterval(this.timer)+ this.timer = null+ await this.link?.close('daemon stopping')+ this.link = null+ }++ // ── port lifecycle ────────────────────────────────────────────────────────────────────────────────++ private async tick(): Promise<void> {+ if (this.stopped) return+ if (!this.link?.isOpen) {+ await this.tryOpen()+ return+ }+ // Rule 2. The read never fails on a dead handle, so silence is the only symptom there is.+ if (Date.now() - this.lastRx > SILENCE_MS) {+ this.host.log('cable: silent, reopening the port')+ await this.link.close('silence')+ this.link = null+ return+ }+ // The cadence is the contract: the dial reads a gap as absence, and the tick that watches for that+ // gap runs far more often than the ping that prevents it.+ if (Date.now() - this.lastPing >= PING_EVERY_MS) {+ this.lastPing = Date.now()+ await this.send({ t: 'ping' })+ }+ }++ private openAt = 0+ private lastPing = 0++ private async tryOpen(): Promise<void> {+ if (Date.now() - this.openAt < REOPEN_EVERY_MS) return+ this.openAt = Date.now()+ let opened: CablePort | null+ try {+ opened = await this.openPort(+ (chunk) => this.onBytes(chunk),+ (why) => this.onClosed(why),+ )+ } catch (err) {+ // A port that another process holds is the ordinary case, not a fault: esptool, a serial monitor,+ // or a second daemon. Say so and try again on the next tick.+ this.host.log(`cable: cannot open the dial: ${(err as Error).message}`)+ return+ }+ if (!opened) return // no dial plugged in — this daemon's resting state+ this.link = opened+ // Leftover bytes belong to a session that has ended; carrying them across would put a stale+ // half-frame in front of the first real frame of the new one.+ this.decoder.reset()+ this.greetedMac = null+ this.lastRx = Date.now()+ this.host.log(`cable: open on ${opened.path}`)+ }++ private onClosed(why: string): void {+ this.host.log(`cable: closed (${why})`)+ this.link = null+ this.greetedMac = null+ this.voice = null+ // The dial keeps its running image; the half-written slot is erased again by the next accepted offer.+ this.transfer?.finish('interrupted by the port closing')+ this.transfer = null+ }++ // ── inbound ───────────────────────────────────────────────────────────────────────────────────────++ private onBytes(chunk: Buffer): void {+ this.lastRx = Date.now()+ this.decoder.feed(chunk, (frame) => {+ if (frame.type === CableType.Json) {+ let msg: Message+ try {+ msg = JSON.parse(Buffer.from(frame.payload).toString('utf8')) as Message+ } catch {+ return // unreadable payloads are counted by the decoder, never fatal+ }+ void this.onMessage(msg)+ return+ }+ if (frame.type === CableType.Log) {+ // The dial's console. It shares its one USB port with this protocol, so these frames are the only+ // way its log survives at all while the daemon holds the port.+ const line = Buffer.from(frame.payload).toString('utf8')+ void appendFile(this.logPath, `${new Date().toISOString()} ${line}\n`).catch(() => {})+ return+ }+ if (frame.type === CableType.Pcm) {+ this.onPcm(Buffer.from(frame.payload))+ return+ }+ // An unknown type is a dial running ahead of this daemon. Visible, never fatal.+ this.host.log(`cable: unknown frame type 0x${frame.type.toString(16)}`)+ })+ }++ private async onMessage(msg: Message): Promise<void> {+ const str = (key: string): string | undefined =>+ typeof msg[key] === 'string' ? (msg[key] as string) : undefined++ switch (msg.t) {+ case 'hello': {+ const mac = str('mac') ?? ''+ // Rule 1: every greeting is answered, but only an unfamiliar dial gets the full state.+ await this.send({+ t: 'welcome',+ proto: CABLE_PROTO_VERSION,+ app: this.host.appName(),+ machine: { id: mac, name: this.host.machineName() },+ voiceLang: this.host.voiceLang(),+ })+ if (mac !== this.greetedMac) {+ this.greetedMac = mac+ this.host.log(`cable: dial ${mac} on fw ${str('fw') ?? '?'} proto ${msg.proto}`)+ await this.pushAgents()+ }+ // Offered on every greeting, but only ONCE per version per session: accepting makes the dial erase+ // a flash slot before it answers, so a cadence of retries would spend erase cycles on the user's+ // hardware every fifteen seconds, and nothing about the next greeting changes what went wrong.+ await this.maybeOfferFirmware(str('fw') ?? '')+ return+ }+ case 'pong':+ return+ case 'agents.list':+ await this.pushAgents()+ return+ case 'models.list': {+ // The one round trip in this protocol: the dial cannot draw a picker until the catalog is in hand,+ // so it waits on this — briefly, and off its own UI task.+ const agentId = str('agentId') ?? ''+ let items: string[] = []+ try {+ items = await this.host.listModels(agentId)+ } catch (err) {+ this.host.log(`cable: models for ${agentId} failed (${(err as Error).message})`)+ }+ // Answered either way. An empty catalog closes the dial's picker cleanly; silence strands it on a+ // spinner until its own timeout, which reads as a hang rather than "this engine has no choices".+ await this.send({ t: 'models', agentId, items: items.map((id) => ({ id })) })+ return+ }+ case 'focus':+ if (str('agentId')) this.host.focus(str('agentId')!)+ return+ case 'turn.send':+ if (str('agentId') && str('text')) this.host.sendTurn(str('agentId')!, str('text')!)+ return+ case 'turn.stop':+ if (str('agentId')) this.host.stopTurn(str('agentId')!)+ return+ case 'answer':+ if (str('agentId') && str('id') && str('optionId')) {+ this.host.answer(str('agentId')!, str('id')!, str('optionId')!)+ }+ return+ case 'agent.update':+ if (str('agentId')) this.host.updateAgent(str('agentId')!, str('model'), str('effort'))+ return+ case 'voice.begin':+ this.voice = {+ agentId: str('agentId'),+ cmd: str('cmd'),+ lang: str('lang') ?? this.host.voiceLang(),+ // The DIAL's rate, never this side's guess. Describing 8 kHz audio as 16 kHz does not make the+ // speech sound fast — the transcriber is handed a container that lies about itself and answers+ // with nothing at all.+ rate: typeof msg.sr === 'number' && msg.sr > 0 ? msg.sr : DEFAULT_VOICE_RATE,+ chunks: [],+ bytes: 0,+ }+ return+ case 'voice.abort':+ this.voice = null+ return+ case 'voice.end':+ await this.finishVoice()+ return+ case 'voice.confirm':+ if (str('routeId') && str('agentId')) this.host.focus(str('agentId')!)+ return+ case 'fw.accept':+ // The dial has erased its slot and is expecting bytes. Nothing was sent before this.+ await this.transfer?.pump()+ return+ case 'fw.progress':+ // Not only a progress bar: this ack IS the credit that lets the next slices go.+ if (typeof msg.written === 'number') await this.transfer?.onProgress(msg.written)+ return+ case 'fw.done':+ this.transfer?.finish('installed — the dial is rebooting')+ this.transfer = null+ return+ case 'fw.error':+ this.transfer?.finish(`refused: ${str('message') ?? 'no reason given'}`)+ this.transfer = null+ return+ default:+ this.host.log(`cable: unhandled message '${msg.t}'`)+ }+ }++ /** Offer an update if there is one, the dial is not on it, and this session has not tried it already. */+ private async maybeOfferFirmware(runningVersion: string): Promise<void> {+ if (!this.host.firmwareFor || this.transfer || !runningVersion) return+ const candidate = await this.host.firmwareFor(runningVersion).catch(() => null)+ if (!candidate || this.offered.has(candidate.version)) return+ this.offered.add(candidate.version)++ this.host.log(`cable: offering firmware ${candidate.version} (${candidate.image.length} B)`)+ this.transfer = new FirmwareTransfer(+ candidate.image,+ candidate.version,+ async (slice) => {+ if (!this.link?.isOpen) throw new Error('port closed mid-transfer')+ await this.link.write(encodeCableFrame(CableType.Fw, slice))+ },+ (line) => this.host.log(line),+ )+ await this.send({ t: 'fw.offer', version: candidate.version, size: candidate.image.length, sha256: candidate.sha256 })+ }++ private onPcm(chunk: Buffer): void {+ if (!this.voice) return // audio outside a turn is a dial that restarted mid-capture+ this.voice.bytes += chunk.length+ if (this.voice.bytes > VOICE_MAX_BYTES) {+ this.host.log('cable: voice over the length cap, dropped')+ this.voice = null+ return+ }+ this.voice.chunks.push(chunk)+ }++ private async finishVoice(): Promise<void> {+ const turn = this.voice+ this.voice = null+ if (!turn || turn.bytes === 0) {+ await this.send({ t: 'voice.error', message: "Didn't catch that" })+ return+ }++ const seconds = turn.bytes / (turn.rate * 2)+ this.host.log(`cable: voice ${seconds.toFixed(1)}s (${Math.round(turn.bytes / 1024)} KB) → stt`)++ let transcript: string+ try {+ transcript = (await this.host.transcribe(Buffer.concat(turn.chunks), turn.rate, turn.lang)).trim()+ } catch (err) {+ await this.send({ t: 'voice.error', message: (err as Error).message })+ return+ }+ if (!transcript) {+ await this.send({ t: 'voice.error', message: "Didn't catch that" })+ return+ }++ // Named an agent: the dial was on a tile and there is nothing to decide.+ let agentId = turn.agentId+ let agentName = ''+ const agents = await this.host.listAgents()+ if (!agentId) {+ try {+ const decision = await this.host.route(transcript, agents)+ agentId = decision.agentId+ this.host.log(`cable: routed → ${agentId} (${decision.reason})`)+ } catch (err) {+ await this.send({ t: 'voice.error', message: (err as Error).message })+ return+ }+ }+ agentName = agents.find((a) => a.id === agentId)?.name ?? ''++ if (!agentId) {+ await this.send({ t: 'voice.error', message: 'No agent to send that to' })+ return+ }+ const text = turn.cmd ? `/${turn.cmd} ${transcript}` : transcript+ this.host.sendTurn(agentId, text)+ await this.send({ t: 'voice.transcript', routeId: '', text: transcript, agentId, agentName, needsConfirm: false })+ }++ // ── outbound ──────────────────────────────────────────────────────────────────────────────────────++ private async send(msg: Message): Promise<boolean> {+ if (!this.link?.isOpen) return false+ try {+ await this.link.write(encodeCableFrame(CableType.Json, Buffer.from(JSON.stringify(msg), 'utf8')))+ return true+ } catch (err) {+ this.host.log(`cable: write failed (${(err as Error).message})`)+ await this.link.close('write failed')+ return false+ }+ }++ /**+ * Push the agent list, STREAMED — begin, one message per agent, end.+ *+ * A frame is capped at 8 KB and a hundred agents do not fit in it. One agent per message needs no chunk+ * arithmetic on either side and bounds the message length by construction rather than by hoping the+ * names stay short.+ */+ async pushAgents(): Promise<void> {+ const agents = await this.host.listAgents()+ await this.send({ t: 'agents.begin' })+ for (const a of agents) {+ await this.send({ t: 'agent', id: a.id, name: a.name, engine: a.engine ?? '', model: a.model ?? '', effort: a.effort ?? '' })+ }+ await this.send({ t: 'agents.end' })+ }++ // Turn state is UNSOLICITED: the daemon reports every turn in every agent, including ones started at the+ // keyboard. A dial that only saw answers to its own sends would sit idle through most of what the+ // machine actually does.+ async turnStarted(agentId: string): Promise<void> {+ await this.send({ t: 'turn.started', agentId })+ }+ async turnDone(agentId: string): Promise<void> {+ await this.send({ t: 'turn.done', agentId })+ }+ async summary(agentId: string, recap: string, text: string): Promise<void> {+ await this.send({ t: 'summary', agentId, recap, text })+ }+ async turnError(agentId: string, message: string): Promise<void> {+ await this.send({ t: 'turn.error', agentId, message })+ }+ async question(agentId: string, id: string, questions: unknown): Promise<void> {+ await this.send({ t: 'question', agentId, id, questions })+ }+ async focusAgent(agentId: string): Promise<void> {+ await this.send({ t: 'focus', agentId })+ }+ async toast(text: string): Promise<void> {+ await this.send({ t: 'toast', text })+ }+}diff --git a/cli/src/cable/fwPush.spec.ts b/cli/src/cable/fwPush.spec.tsnew file mode 100644index 000000000..fe4f91ee4--- /dev/null+++ b/cli/src/cable/fwPush.spec.ts@@ -0,0 +1,93 @@+// The two things about a firmware push that fail silently and at the far end.+//+// · WHICH image gets offered. Offering the wrong one is not a crash: the dial takes it, reboots, and runs+// software nobody chose — the sibling product lost a fresh build to an older bundle twice before anyone+// noticed, because `idf.py flash` said Done and the panel looked fine.+// · HOW FAST it goes out. The ESP32-S3 USB peripheral has no back-pressure, so sending past the credit+// window does not slow this side down — the dial's ring overflows and the bytes are gone with no error.+import { describe, expect, it, vi } from 'vitest'++import { FW_SLICE_BYTES, FW_WINDOW_BYTES, FirmwareTransfer, shouldOffer } from './fwPush.js'++describe('shouldOffer', () => {+ it('offers a strictly newer release', () => {+ expect(shouldOffer('0.0.35', '0.0.36')).toBe(true)+ expect(shouldOffer('0.0.35', '0.1.0')).toBe(true)+ expect(shouldOffer('v0.0.35', '0.1.0')).toBe(true)+ })++ it('does nothing for the same version', () => {+ expect(shouldOffer('0.0.35', '0.0.35')).toBe(false)+ })++ it('never rolls a dial backwards', () => {+ // A rollback is a decision made by publishing, not by whichever daemon happens to be plugged in.+ expect(shouldOffer('0.1.0', '0.0.36')).toBe(false)+ })++ it('never touches a dev build', () => {+ // ESP-IDF stamps `git describe` when the project sets no PROJECT_VER. Offering the published image to+ // one of these is exactly how a just-flashed build gets silently replaced seconds later.+ expect(shouldOffer('v0.3.38-36-gbc64073-dirty', '9.9.9')).toBe(false)+ expect(shouldOffer('0.0.35-dirty', '0.0.36')).toBe(false)+ expect(shouldOffer('', '0.0.36')).toBe(false)+ })+})++describe('FirmwareTransfer', () => {+ /** A transfer whose slices are collected instead of written to a port. */+ function make(size: number) {+ const sent: number[] = []+ const image = Buffer.alloc(size, 7)+ const t = new FirmwareTransfer(image, '1.2.3', async (slice) => { sent.push(slice.length) }, () => {})+ return { t, sent, image }+ }++ it('stops at the credit window and goes no further until acked', async () => {+ const { t, sent } = make(1_000_000)+ await t.pump()+ const inFlight = sent.reduce((a, b) => a + b, 0)+ expect(inFlight).toBeLessThanOrEqual(FW_WINDOW_BYTES + FW_SLICE_BYTES)++ // Nothing more moves without an ack — that is the whole mechanism. Calling pump() again must not+ // sneak another slice out.+ const before = sent.length+ await t.pump()+ expect(sent.length).toBe(before)+ })++ it('each ack releases exactly as much as it retired', async () => {+ const { t, sent } = make(1_000_000)+ await t.pump()+ const first = sent.length+ await t.onProgress(FW_SLICE_BYTES) // the dial wrote one slice+ expect(sent.length).toBe(first + 1)+ })++ it('delivers the whole image, in order, in slices no larger than the agreed one', async () => {+ const size = FW_SLICE_BYTES * 5 + 123+ const { t, sent } = make(size)+ await t.pump()+ let acked = 0+ while (acked < size) {+ acked = Math.min(acked + FW_SLICE_BYTES, size)+ await t.onProgress(acked)+ }+ expect(sent.reduce((a, b) => a + b, 0)).toBe(size)+ expect(Math.max(...sent)).toBeLessThanOrEqual(FW_SLICE_BYTES)+ expect(sent.at(-1)).toBe(123) // the tail is short, not padded+ })++ it('says how far it got when it is cut off', async () => {+ const log = vi.fn()+ const image = Buffer.alloc(100_000)+ const t = new FirmwareTransfer(image, '1.2.3', async () => {}, log)+ await t.pump()+ await t.onProgress(40_000)+ t.finish('interrupted by the port closing')+ expect(log).toHaveBeenCalledWith(expect.stringContaining('40000/100000'))+ // Finishing twice must not double-log: the port closing and the session ending both call it.+ t.finish('again')+ expect(log).toHaveBeenCalledTimes(1)+ })+})diff --git a/cli/src/cable/fwPush.ts b/cli/src/cable/fwPush.tsnew file mode 100644index 000000000..39da8057e--- /dev/null+++ b/cli/src/cable/fwPush.ts@@ -0,0 +1,146 @@+// Pushing a firmware image to the dial over the cable it is already talking on.+//+// The dial has no WiFi, so it cannot fetch its own updates any more. The daemon does it instead: it reads+// the SAME published manifest the device used to poll (`harness/esp32/ota/metadata.json` on GCS), caches+// the image, and offers it over the wire. Nothing about the release pipeline changes — `make+// upload-circle` still publishes, and this only changes WHO downloads.+//+// Deliberately NOT bundled into this CLI's own build. The sibling product does bundle its panel image, and+// it bought a trap with it: "different from mine" is a comparison, not an ordering, so an app build from+// two days earlier silently flashed a freshly-built panel BACK to the older image, twice, before anyone+// noticed. Reading the published manifest makes the newest release the reference for everyone.+import { createHash } from 'node:crypto'+import { mkdir, readFile, writeFile } from 'node:fs/promises'+import { join } from 'node:path'++/** What the manifest says about one board's current release. */+export interface FirmwareRelease {+ version: string+ url: string+ sha256: string+ size: number+}++/** The dial's key in the shared manifest. Other boards and the CLI itself live in the same file. */+export const CIRCLE_OTA_KEY = 'commander'++/**+ * Whether `published` should be offered to a dial running `running`.+ *+ * Two rules, both learned from the sibling firmware:+ *+ * - **A dev build is never touched.** ESP-IDF stamps `git describe` when a project sets no PROJECT_VER,+ * so a locally-flashed image self-describes as something like `v0.3.38-36-gbc64073-dirty`. Offering the+ * published image to that is the "flashed back to yesterday's build and nothing looked broken" failure:+ * `idf.py flash` says Done, and seconds later the dial is running the release again.+ * - **Strictly newer only.** Equal is nothing to do; older is someone else's decision to roll back, made+ * by publishing, not by whichever daemon happens to be plugged in.+ */+export function shouldOffer(running: string, published: string): boolean {+ const clean = /^v?(\d+)\.(\d+)\.(\d+)$/+ const a = clean.exec(running.trim())+ const b = clean.exec(published.trim())+ if (!a || !b) return false+ for (let i = 1; i <= 3; i++) {+ const mine = Number(a[i])+ const theirs = Number(b[i])+ if (theirs > mine) return true+ if (theirs < mine) return false+ }+ return false+}++/** Read the published release for the dial, or null when the manifest is unreachable or has no entry. */+export async function fetchRelease(manifestUrl: string, key = CIRCLE_OTA_KEY): Promise<FirmwareRelease | null> {+ try {+ // A cached copy is exactly the thing that makes a release look like it did not happen, and this+ // runtime's fetch has no `cache` option — so the URL carries the buster instead.+ const bust = manifestUrl.includes('?') ? '&' : '?'+ const res = await fetch(`${manifestUrl}${bust}t=${Date.now()}`)+ if (!res.ok) return null+ const all = (await res.json()) as Record<string, Partial<FirmwareRelease>>+ const entry = all?.[key]+ if (!entry?.version || !entry.url || !entry.sha256 || !entry.size) return null+ return { version: entry.version, url: entry.url, sha256: entry.sha256, size: entry.size }+ } catch {+ return null+ }+}++/**+ * Fetch the image, from the cache when it is already there and verified.+ *+ * The hash is checked on every load, not only after a download: a truncated file on disk (a laptop that+ * slept mid-download) would otherwise be pushed to the dial, which would then reject it after spending+ * three minutes and an erase cycle receiving it.+ */+export async function loadImage(release: FirmwareRelease, cacheDir: string): Promise<Buffer | null> {+ const path = join(cacheDir, `${release.version}.bin`)+ const verify = (buf: Buffer) =>+ buf.length === release.size && createHash('sha256').update(buf).digest('hex') === release.sha256++ const cached = await readFile(path).catch(() => null)+ if (cached && verify(cached)) return cached++ const res = await fetch(release.url).catch(() => null)+ if (!res?.ok) return null+ const fresh = Buffer.from(await res.arrayBuffer())+ if (!verify(fresh)) return null++ await mkdir(cacheDir, { recursive: true }).catch(() => {})+ await writeFile(path, fresh).catch(() => {})+ return fresh+}++/**+ * One transfer in flight: slices, and the credit the dial's acks release.+ *+ * THE THREE NUMBERS ARE ONE DECISION — see docs/specs/cable-protocol.md §7 in autonomous-code. The+ * ESP32-S3 USB Serial/JTAG peripheral has NO back-pressure: its ISR drains the hardware FIFO+ * unconditionally and drops whatever does not fit its ring, silently, with no NAK and no short write.+ * Sending faster than the dial reads does not slow this side down, it shreds the stream. The dial's reader+ * task is also its flash writer, so it is blocked for ~16 ms per slice with nothing draining the port.+ *+ * Measured on hardware by the sibling firmware: a 128 KB window with an ack every 64 KB wrote 0 of+ * 1,342,160 bytes.+ */+export const FW_SLICE_BYTES = 8192+export const FW_WINDOW_BYTES = 16 * 1024++export class FirmwareTransfer {+ private acked = 0+ private offset = 0+ private done = false++ constructor(+ private readonly image: Buffer,+ readonly version: string,+ private readonly sendSlice: (slice: Buffer) => Promise<void>,+ private readonly log: (line: string) => void,+ ) {}++ get isDone(): boolean {+ return this.done+ }++ /** Push as much as the credit window allows. Called on accept and again on every `fw.progress`. */+ async pump(): Promise<void> {+ while (!this.done && this.offset < this.image.length && this.offset - this.acked < FW_WINDOW_BYTES) {+ const end = Math.min(this.offset + FW_SLICE_BYTES, this.image.length)+ await this.sendSlice(this.image.subarray(this.offset, end))+ this.offset = end+ }+ }++ /** The dial acknowledged `written` bytes in flash. That ack IS the credit. */+ async onProgress(written: number): Promise<void> {+ this.acked = written+ await this.pump()+ }++ finish(reason: string): void {+ if (this.done) return+ this.done = true+ this.log(`cable: firmware ${this.version} ${reason} (${this.acked}/${this.image.length} B)`)+ }+}diff --git a/cli/src/cable/serial.ts b/cli/src/cable/serial.tsnew file mode 100644index 000000000..b9cc01d87--- /dev/null+++ b/cli/src/cable/serial.ts@@ -0,0 +1,193 @@+// The serial port under the cable protocol: finding the dial, opening it raw, reading and writing bytes.+//+// No native dependency, deliberately. This CLI ships as one bundled JavaScript file with seven pure-JS+// dependencies; a serial library would be its first native module and would drag node-gyp, prebuilds and+// a per-platform release matrix into a distribution that is currently a download. A tty is a file, `stty`+// puts it in raw mode, and that is the whole of what this needs.+import { exec } from 'node:child_process'+import { existsSync, readFileSync, readdirSync } from 'node:fs'+import { open, type FileHandle } from 'node:fs/promises'+import { promisify } from 'node:util'++const execFile = promisify(exec)++/** The SoC's own USB peripheral. The dial exposes this and nothing else — measured, see findDialPort. */+export const DIAL_VENDOR_ID = 0x303a+export const DIAL_PRODUCT_ID = 0x1001++export interface DialPort {+ path: string+ vendorId: number+ productId: number+}++/**+ * Find the dial's tty, matching on the USB id and nothing else.+ *+ * Never by name and never by "the only one there": names are localised and unstable, and a laptop has+ * other serial devices — this machine answers with `/dev/cu.debug-console` before anything else, which a+ * loose match happily returns.+ *+ * On macOS the ids and the device path live on DIFFERENT nodes of the `ioreg` tree: the USB device node+ * carries idVendor/idProduct, and IOCalloutDevice hangs several levels below it under the CDC driver. So+ * this arms a subtree at the matching node's indentation and takes the first path inside it. A flat scan+ * pairs a vendor id with whatever path happens to come next in the dump, which is a different device.+ */+export async function findDialPort(): Promise<DialPort | null> {+ if (process.platform === 'darwin') return findDarwin()+ if (process.platform === 'linux') return findLinux()+ return null+}++/** Indentation column of an ioreg line — the tree's only structure. */+function depthOf(line: string): number {+ const m = line.match(/^[\s|+-]*/)+ return m ? m[0].length : 0+}++async function findDarwin(): Promise<DialPort | null> {+ let dump: string+ try {+ const { stdout } = await execFile('ioreg -p IOService -w0 -l', { maxBuffer: 64 * 1024 * 1024 })+ dump = stdout+ } catch {+ return null+ }++ const lines = dump.split('\n')+ let armedAt: number | null = null+ let sawVendor = false+ let sawProduct = false+ let nodeDepth = 0++ for (const line of lines) {+ // A new node resets what we have seen about the current one. `+-o` opens a node in this dump.+ if (line.includes('+-o')) {+ const d = depthOf(line)+ if (armedAt !== null && d <= armedAt) armedAt = null // left the armed subtree without a path+ nodeDepth = d+ sawVendor = false+ sawProduct = false+ continue+ }++ if (line.includes('"idVendor"')) sawVendor = Number(line.split('=')[1]?.trim()) === DIAL_VENDOR_ID+ if (line.includes('"idProduct"')) sawProduct = Number(line.split('=')[1]?.trim()) === DIAL_PRODUCT_ID+ if (sawVendor && sawProduct && armedAt === null) armedAt = nodeDepth++ if (armedAt !== null && line.includes('"IOCalloutDevice"')) {+ const path = line.split('=')[1]?.trim().replace(/^"|"$/g, '')+ if (path) return { path, vendorId: DIAL_VENDOR_ID, productId: DIAL_PRODUCT_ID }+ }+ }+ return null+}++function findLinux(): DialPort | null {+ // /sys is the id, /dev/ttyACM* is the path, and the symlink between them is the only honest pairing.+ const base = '/sys/class/tty'+ if (!existsSync(base)) return null+ for (const name of readdirSync(base)) {+ if (!name.startsWith('ttyACM') && !name.startsWith('ttyUSB')) continue+ // The ids live on the USB device, a few directories up from the tty's own node.+ let dir = `${base}/${name}/device`+ for (let hop = 0; hop < 4; hop++) {+ try {+ const vid = parseInt(readFileSync(`${dir}/idVendor`, 'utf8').trim(), 16)+ const pid = parseInt(readFileSync(`${dir}/idProduct`, 'utf8').trim(), 16)+ if (vid === DIAL_VENDOR_ID && pid === DIAL_PRODUCT_ID) {+ return { path: `/dev/${name}`, vendorId: vid, productId: pid }+ }+ break+ } catch {+ dir = `${dir}/..`+ }+ }+ }+ return null+}++/**+ * An open port, in raw mode, with a read loop.+ *+ * The port coming and going — a flash, a crash, a nudged cable, the dial rebooting into a new image — is+ * the NORMAL case here, not the failure case. Everything about this class is written so that closing and+ * reopening is cheap and safe.+ */+export class SerialLink {+ private constructor(+ readonly path: string,+ private handle: FileHandle,+ private readonly onData: (chunk: Buffer) => void,+ private readonly onClosed: (why: string) => void,+ ) {}++ private closed = false++ static async open(+ path: string,+ onData: (chunk: Buffer) => void,+ onClosed: (why: string) => void,+ ): Promise<SerialLink> {+ // Raw mode is not optional. Left in the default line discipline the tty maps CR to NL, strips the+ // eighth bit on some paths and echoes what we write back at us — and a mangled frame is+ // indistinguishable from a bad cable at the far end.+ const flag = process.platform === 'darwin' ? '-f' : '-F'+ await execFile(`stty ${flag} ${JSON.stringify(path)} raw -echo -echoe -echok -echoctl -echoke`)++ const handle = await open(path, 'r+')+ const link = new SerialLink(path, handle, onData, onClosed)+ void link.readLoop()+ return link+ }++ private async readLoop(): Promise<void> {+ const buf = Buffer.allocUnsafe(4096)+ while (!this.closed) {+ try {+ const { bytesRead } = await this.handle.read(buf, 0, buf.length, null)+ if (bytesRead > 0) this.onData(Buffer.from(buf.subarray(0, bytesRead)))+ // A zero-byte read on a tty means EOF, which for a USB CDC device means it went away.+ else if (bytesRead === 0) return this.fail('end of stream')+ } catch (err) {+ const code = (err as NodeJS.ErrnoException).code+ if (this.closed) return+ // EAGAIN is a port with nothing to say, not a broken one.+ if (code === 'EAGAIN') {+ await new Promise((r) => setTimeout(r, 5))+ continue+ }+ return this.fail(code ?? String(err))+ }+ }+ }++ private fail(why: string): void {+ if (this.closed) return+ this.closed = true+ void this.handle.close().catch(() => {})+ this.onClosed(why)+ }++ /** Write every byte, looping over short writes. Rejects only when the port is gone. */+ async write(bytes: Uint8Array): Promise<void> {+ if (this.closed) throw new Error('port closed')+ let off = 0+ while (off < bytes.length) {+ const { bytesWritten } = await this.handle.write(bytes, off, bytes.length - off)+ if (bytesWritten <= 0) throw new Error('short write')+ off += bytesWritten+ }+ }++ get isOpen(): boolean {+ return !this.closed+ }++ async close(why = 'closed'): Promise<void> {+ if (this.closed) return+ this.closed = true+ await this.handle.close().catch(() => {})+ this.onClosed(why)+ }+}diff --git a/cli/src/cable/vectors/cable_frame.txt b/cli/src/cable/vectors/cable_frame.txtnew file mode 100644index 000000000..df32637cb--- /dev/null+++ b/cli/src/cable/vectors/cable_frame.txt@@ -0,0 +1,37 @@+# Shared framing vectors for the harness USB cable link.+# Generated by apps/esp32-circle/scripts/gen_cable_vectors.py — a third implementation, written+# from main/cable_frame.h's format description and from neither half's code. Do not hand-edit.+#+# encode <name> <type> <payload-hex> <frame-hex>+# stream <name> <input-hex> <type:payload-hex,...|-> <discarded> <corrupt>+#+# CRC-16/CCITT-FALSE check value for "123456789" = 0x29B1 (asserted at generation).++encode json_empty_object 1 7b7d a55a010102007b7d1077+encode json_hello 1 7b2274223a2268656c6c6f222c2270726f746f223a317d a55a010117007b2274223a2268656c6c6f222c2270726f746f223a317dbf97+encode json_utf8 1 7b2274223a226e6f7465222c2276223a22c491c3a320786f6e67227d a55a01011c007b2274223a226e6f7465222c2276223a22c491c3a320786f6e67227d923f+encode json_payload_holds_magic 1 7b2274223a2278222c2276223a22a55aa55a227d a55a010114007b2274223a2278222c2276223a22a55aa55a227d45d6+encode pcm_zero_length 2 a55a01020000149c+encode pcm_eight_bytes 2 00ff7f8001fea55a a55a0102080000ff7f8001fea55a99fd+encode pcm_chunk_1024 2 0d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff06 a55a010200040d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff066543+encode fw_slice_max 3 0d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff06 a55a010300200d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff061c8c+encode log_line 4 4920283132333429206361626c653a206c696e6b207570 a55a010417004920283132333429206361626c653a206c696e6b2075706a6b+encode unknown_type_0x7f 127 7768617465766572 a55a017f08007768617465766572c801++stream single_json_empty_object a55a010102007b7d1077 1:7b7d 0 0+stream single_json_hello a55a010117007b2274223a2268656c6c6f222c2270726f746f223a317dbf97 1:7b2274223a2268656c6c6f222c2270726f746f223a317d 0 0+stream single_json_utf8 a55a01011c007b2274223a226e6f7465222c2276223a22c491c3a320786f6e67227d923f 1:7b2274223a226e6f7465222c2276223a22c491c3a320786f6e67227d 0 0+stream single_json_payload_holds_magic a55a010114007b2274223a2278222c2276223a22a55aa55a227d45d6 1:7b2274223a2278222c2276223a22a55aa55a227d 0 0+stream single_pcm_zero_length a55a01020000149c 2: 0 0+stream single_pcm_eight_bytes a55a0102080000ff7f8001fea55a99fd 2:00ff7f8001fea55a 0 0+stream single_pcm_chunk_1024 a55a010200040d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff066543 2:0d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff06 0 0+stream single_fw_slice_max a55a010300200d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff061c8c 3:0d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff060d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6cdd4dbe2e9f0f7fe050c131a21282f363d444b525960676e757c838a91989fa6adb4bbc2c9d0d7dee5ecf3fa01080f161d242b323940474e555c636a71787f868d949ba2a9b0b7bec5ccd3dae1e8eff6fd040b121920272e353c434a51585f666d747b828990979ea5acb3bac1c8cfd6dde4ebf2f900070e151c232a31383f464d545b626970777e858c939aa1a8afb6bdc4cbd2d9e0e7eef5fc030a11181f262d343b424950575e656c737a81888f969da4abb2b9c0c7ced5dce3eaf1f8ff06 0 0+stream single_log_line a55a010417004920283132333429206361626c653a206c696e6b2075706a6b 4:4920283132333429206361626c653a206c696e6b207570 0 0+stream single_unknown_type_0x7f a55a017f08007768617465766572c801 127:7768617465766572 0 0+stream back_to_back a55a01010d007b2274223a2268656c6c6f227dc382a55a01010c007b2274223a22706f6e67227dbc33a55a010240000d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc65137 1:7b2274223a2268656c6c6f227d,1:7b2274223a22706f6e67227d,2:0d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6 0 0+stream leading_boot_text 4553502d524f4d3a657370333273332d32303231303332370d0a4275696c643a4d617220323720323032310d0aa55a01010d007b2274223a2268656c6c6f227dc382 1:7b2274223a2268656c6c6f227d 45 0+stream trailing_lone_magic0 a55a01010d007b2274223a2268656c6c6f227dc382a5 1:7b2274223a2268656c6c6f227d 0 0+stream bad_crc_then_good a55a01010d007b2274223a2268656c6c6f227dc37da55a01010c007b2274223a22706f6e67227dbc33 1:7b2274223a22706f6e67227d 21 1+stream oversized_length_then_good a55a0101ffff0000a55a01010c007b2274223a22706f6e67227dbc33 1:7b2274223a22706f6e67227d 8 0+stream magic_split_across_reads a55a01010d007b2274223a2268656c6c6f227dc382a55a010240000d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc65137 1:7b2274223a2268656c6c6f227d,2:0d141b222930373e454c535a61686f767d848b9299a0a7aeb5bcc3cad1d8dfe6edf4fb020910171e252c333a41484f565d646b727980878e959ca3aab1b8bfc6 0 0+stream magic_shaped_noise a55a99999999a55a01010c007b2274223a22706f6e67227dbc33 1:7b2274223a22706f6e67227d 6 0diff --git a/cli/src/cli.ts b/cli/src/cli.tsindex d86d3666f..f871c4760 100644--- a/cli/src/cli.ts+++ b/cli/src/cli.ts@@ -26,6 +26,8 @@ import { VERSION } from './version.js'import { sqlitePreflightMessage } from './lib/sqliteAvailability.js'import { ensureUtf8Locale } from './lib/childLocale.js'import { binaryOnPath } from './lib/binaryOnPath.js'+import { CableSession } from './cable/cableSession.js'+import { DaemonCableHost, cableEventFor } from './cable/cableHost.js'import { registry, projectDisplayName, type RegisteredSession } from './lib/registry.js'import { installAmpPlugin, installCodexHooks, installCommandCodeHooks, installCursorHooks, installDevinHooks, installGrokHooks, installAgyHooks, installCopilotHooks, installHermesHooks, installKiloPlugin, installOpencodePlugin, installPiExtension, installSessionHooks } from './lib/hooks.js'import { PID_FILE, daemonPort, isAlive, readPid } from './lib/daemonState.js'@@ -146,6 +148,10 @@ const COMPUTER_ID_FILE = env.ADAPTER_COMPUTER_ID_FILE// The machine's display name, mirrored from the backend (`machine_meta` on connect + web renames) by the// daemon so the separate `harness status` process can print it. Absent = unnamed machine.const MACHINE_NAME_FILE = join(env.ADAPTER_DATA_DIR, 'machine-name')++// The dial's session, held at module scope for the same reason `backendRef` is: shutdown() is defined+// before the wiring that creates it, and the port has to be released on the way out.+let cableRef: CableSession | null = null// OpenCode's SQLite store — polled per session by OpencodeReader (no per-session transcript file).const OPENCODE_DB = join(env.OPENCODE_DATA_DIR, 'opencode.db')// Kilo's SQLite store — same shape, its own file and its own reader (see engines/kilo/).@@ -2608,6 +2614,9 @@ async function runForeground(session: AuthSession): Promise<void> {const shutdown = async (signal: string): Promise<void> => {console.log(`\n[cli] ${signal} — shutting down`)+ // Release the serial port first. It is exclusive, and a daemon that exits still holding it makes+ // esptool fail in a way that reads exactly like dead hardware.+ void cableRef?.stop()updater?.stop()agentReconciler.stop()clearInterval(logTrimTimer)@@ -2656,6 +2665,50 @@ async function runForeground(session: AuthSession): Promise<void> {console.log('[backend] machine busy — this machine is already connected from another computer; stopping')void shutdown('busy')}++ // ── the dial on the USB cable ────────────────────────────────────────────────────────────────────+ //+ // A second device surface, served entirely over a wire the user physically owns: no backend, no+ // pairing, no E2EE, no credential on the device. Everything it can ask for is answered by the machinery+ // above — the same registry, the same delivery path, the same router — because a second implementation+ // of any of those is a second set of bugs.+ //+ // Deliberately not fatal and not blocking: an unplugged cable is this daemon's ordinary state.+ const cableHost = new DaemonCableHost({+ machineName: () => { try { return readFileSync(MACHINE_NAME_FILE, 'utf8').trim() || 'This machine' } catch { return 'This machine' } },+ // The SAME handlers the backend socket drives, called directly rather than reimplemented: the+ // slash-command adaptation, the turn bookkeeping and the question plumbing all live in them.+ sendTurn: (agentId, text) => backend.onMessage?.(agentId, text),+ stopTurn: (agentId) => backend.onCancel?.(agentId),+ answer: (agentId, id, optionId) => backend.onQuestionAnswer?.({ agentId, requestId: id, answers: { [id]: optionId } }),+ recent: (id, n) => mirror.recent(registry.resolve(id)?.sessionId || id, n),+ runtimeProfile: (session) => runtimeProfiles.selectedModel(session),+ updateAgent: (agentId, model, effort) => {+ const s = registry.resolve(agentId)+ if (!s || !model) return+ backend.onRuntimeProfileUpdate?.(s.sessionId || agentId, `runtime-v1:${s.sessionId || agentId}:${s.engine}:${model}@${effort || 'auto'}`)+ },+ // The same provider the web and the WiFi device read, so the dial's picker cannot show a different+ // catalog from the one the machine will actually honour.+ listModels: async (agentId) => (await backend.runtimeModelsProvider?.(agentId)) ?? [],+ log: (line) => console.log(`[cable] ${line}`),+ })+ const cable = new CableSession(cableHost, join(env.ADAPTER_DATA_DIR, 'dial.log'))+ cableRef = cable++ // Every card bound for the WiFi device goes down the cable too, translated once. Teeing beats emitting+ // again at each call site: a new event kind reaches the dial the day it reaches the socket.+ backend.onOutboundCommander = (frame) => {+ const event = cableEventFor(frame as { type?: string; agentId?: string; payload?: { kind?: string; text?: string; recap?: string } })+ if (!event) return+ if (event.kind === 'processing') void cable.turnStarted(event.agentId)+ else if (event.kind === 'done') void cable.turnDone(event.agentId)+ else if (event.kind === 'summary') void cable.summary(event.agentId, event.recap || event.text, event.text)+ else void cable.turnError(event.agentId, event.text)+ }++ if (env.CABLE_DISABLE) console.log('[cable] disabled (CABLE_DISABLE=true) — the serial port is left alone')+ else cable.start()}// ── info block ───────────────────────────────────────────────────────────────────────────────────diff --git a/cli/src/config/env.ts b/cli/src/config/env.tsindex eee46a094..8a2df2809 100644--- a/cli/src/config/env.ts+++ b/cli/src/config/env.ts@@ -356,6 +356,22 @@ const envSchema = z.object({ADAPTER_UPDATE_DISABLE: z.string().default('false').transform((v) => v === 'true'),// Install dir holding the packaged cli.js + notify.mjs that the self-updater swaps in place.ADAPTER_CLI_DIR: z.string().default(adapterCliDir),++ // ── the dial on the USB cable ──────────────────────────────────────────────────────────────────+ // Set 'true' to leave the serial port alone entirely. The port is exclusive, so this is what a+ // developer flips before running esptool or a serial monitor against the dial.+ CABLE_DISABLE: z.string().default('false').transform((v) => v === 'true'),+ // Transcription for voice captured on the dial. The device holds no cloud credential and never talks to+ // one; the daemon has an account, and this call is authenticated by the SSO session `harness login`+ // leaves behind — no shared secret, because this repository is public. Path only: the host comes from+ // BACKEND_WS_URL, so a daemon pointed at a local backend transcribes against that one too.+ CABLE_STT_PATH: z.string().default('/api/voice/stt'),+ // Firmware for the dial: the SAME published manifest the device used to poll before it lost WiFi, so+ // `make upload-circle` remains the only way a release happens — this only changes who downloads.+ CABLE_FW_MANIFEST_URL: z+ .string()+ .default('https://storage.googleapis.com/s3-autonomous-upgrade-3/harness/esp32/ota/metadata.json'),+ CABLE_FW_DISABLE: z.string().default('false').transform((v) => v === 'true'),})export type Env = z.infer<typeof envSchema>