Member Junction
    Preparing search index...
    HarnessTurnEvent:
        | { Text: string; Type: "assistant-text" }
        | { Description: string; Type: "sandbox-activity" }
        | {
            Command?: string;
            Description: string;
            RequestId: string;
            Type: "permission-request";
        }
        | {
            CostUsd?: number;
            InputTokens: number;
            OutputTokens: number;
            Type: "usage";
        }
        | { RawText: string; Type: "turn-complete" }
        | { Error: string; Type: "session-error" }

    Events an adapter emits while a turn is in flight.

    Deliberately a small, closed set. Anything the harness does INSIDE its sandbox that does not cross one of these boundaries is governed by posture policy, not recorded as a run step — the opaque-super-step property of this design, which is intentional and must stay documented rather than quietly widened.

    Type Declaration

    • { Text: string; Type: "assistant-text" }

      Streamed narration, surfaced to onProgress and never persisted as a step.

    • { Description: string; Type: "sandbox-activity" }

      Informational in-sandbox activity (file edit, shell command) for live view only.

    • {
          Command?: string;
          Description: string;
          RequestId: string;
          Type: "permission-request";
      }

      The harness wants to do something the posture gates; becomes an MJ: AI Agent Requests row.

    • { CostUsd?: number; InputTokens: number; OutputTokens: number; Type: "usage" }

      Token/cost usage for the turn. Without this the run cannot be accounted for — see below.

    • { RawText: string; Type: "turn-complete" }

      The turn ended. RawText is expected to carry the Loop next-step JSON envelope.

    • { Error: string; Type: "session-error" }

      The session failed. Terminal for the turn; the run decides whether to retry.