{"version":3,"sources":["../src/protocolDeadline.ts"],"sourcesContent":["// Deadlines for host protocol calls (R3-298) — so no platform request can hang forever.\n//\n// THE FAILURE THIS FIXES. `protocolRequest` and `hostFetch` carried no timeout, so a host\n// operation that never resolved presented as an indefinite \"Running…\" with no error, no\n// cancel, and nothing in the console. The GLM dogfood run hit exactly this: the first\n// `chat()` of a session parks on a WebAuthn unseal that never completes, and the surface\n// simply waits. A first-run user inside the setup wizard (R3-299) would be stranded on\n// \"Testing…\" — at the worst possible moment, on the screen whose whole purpose is to prove\n// setup worked.\n//\n// WHY A SINGLE CONSTANT IS THE WRONG ANSWER, AND WHAT IS DONE INSTEAD. A blanket timeout\n// was deferred once as risky, correctly: some host operations legitimately await a HUMAN —\n// a passkey tap, a consent decision, a file picker — and a flat deadline aborts those. So\n// calls are classified, and the two classes get very different bounds:\n//\n//   unattended — a network call or a channel round-trip. Nobody is being asked anything, so\n//                a reply that has not arrived in tens of seconds is a fault. Short bound.\n//   attended   — the host may draw chrome and wait for the user. The bound exists only to\n//                stop an ABANDONED prompt from pinning the caller forever, so it is set far\n//                beyond human reaction time.\n//\n// NOTHING IS UNBOUNDED. \"A long or absent deadline\" was the licence; absent is declined,\n// because absent is the bug. An attended bound of minutes never aborts a person who is\n// actually deciding, and does release a caller whose user walked away — which is the\n// difference between a slow flow and a wedged one.\n//\n// THE IMPRECISION, AND HOW R3-307 REMOVED IT. Attendedness is classified per\n// (scheme, method), but it is really a property of a MOMENT: `spaces:mount` is unattended\n// when the grant is already held and attended on first use, because the host raises consent\n// inside the request (`spaceHandler` `presentMountConsent`). A per-method table cannot see\n// that, so R3-298 classified any method that MAY prompt as `attended` and gave it the long\n// bound — which meant the common grant-held path also waited ten minutes before reporting a\n// fault.\n//\n// R3-307 added the host-attention channel (`hostAttention.ts`), on which the host says\n// whether a person is being asked something RIGHT NOW. So a call now carries TWO bounds:\n//\n//   idle    — in force while the host is not prompting. A may-prompt call runs on this,\n//             which is a real correctness gain: the grant-held `spaces:mount` faults in\n//             seconds, as it always should have.\n//   ceiling — absolute, from call start, NEVER suspended. An abandoned prompt still\n//             releases the caller. The signal may EXTEND a deadline, never remove it.\n//\n// AND THE SHORTENING IS OPT-IN PER ENTRY, which is the part worth not losing. A scheme\n// drops to the short idle bound only when EVERY prompt it can raise is one the host\n// actually announces on that channel (the powerbox, the add-secret modal, the passkey\n// unlock, and the spaceHandler consent surfaces — the presenters site-main wraps). A task\n// app's interaction and the contribute diff-approval are human-paced but are NOT host\n// prompts, so no signal would ever fire for them and they keep the full attended bound. A\n// signal that cannot fire must never be allowed to shorten a deadline.\n\nimport type { HostAttentionKind } from './hostAttention';\n\n/** Whether a call may block on a human being asked something. */\nexport type Attendance = 'unattended' | 'attended';\n\n/** Milliseconds. Exported so callers can reason about the defaults they are overriding. */\nexport const UNATTENDED_TIMEOUT_MS = 30_000;\n/** Network calls reach arbitrary upstreams; the host bounds the fetch itself, so this is a\n *  backstop against the host never replying, not a request budget. */\nexport const NETWORK_TIMEOUT_MS = 120_000;\n/** Far beyond human reaction time — this exists only so an ABANDONED prompt releases the\n *  caller. It must never be short enough to abort someone who is deciding. */\nexport const ATTENDED_TIMEOUT_MS = 600_000;\n/** A stream's first frame may be behind an unseal, so it gets an attended-scale bound of\n *  its own. See `firstFrameTimeoutFor`. */\nexport const ATTENDED_FIRST_FRAME_MS = 300_000;\n/** After the first frame, silence this long means the stream is wedged: the host is no\n *  longer producing and no human is being asked. */\nexport const STREAM_IDLE_TIMEOUT_MS = 120_000;\n/** When a call passes this, `onPending` fires so a caller can render a waiting state\n *  instead of an unexplained stall. */\nexport const PENDING_NOTICE_MS = 3_000;\n\n/**\n * Methods that may draw host chrome and wait for the user.\n *\n * Each entry is a `scheme:method` or a bare `scheme` (matching every method of it). The\n * REASON is recorded per entry, because this table is the item's actual content — a future\n * reader must be able to see why a method is on the long bound without re-deriving it from\n * the host source.\n */\ninterface AttendedEntry {\n  /** Why this call may block on a human. */\n  reason: string;\n  /**\n   * The bound this call runs on while the host reports NOBODY is being asked (R3-307).\n   *\n   * Set it ONLY when every prompt this entry can raise is one the host announces on the\n   * host-attention channel — i.e. a presenter site-main wraps (`hostAttention.ts` in that\n   * repo). Omitted ⇒ the call keeps the full attended bound at all times, because a signal\n   * that never fires must not be allowed to shorten a deadline.\n   */\n  idleMs?: number;\n}\n\nconst ATTENDED: Record<string, AttendedEntry> = {\n  // The powerbox and the add-secret modal are host-drawn and wait for the user to type or\n  // pick; the first use of any stored secret additionally raises a WebAuthn assertion\n  // (SECRETS_SPEC §3 — one unlock per session, from a live gesture). All three are wrapped\n  // presenters, so the signal covers this scheme completely.\n  secrets: {\n    reason: 'host-drawn key entry / picker, and the per-session passkey unlock',\n    idleMs: UNATTENDED_TIMEOUT_MS,\n  },\n  // Consent is raised INSIDE the request: presentMountConsent, presentGrantPicker,\n  // presentCreateConsent, presentShareDisclosure, presentReferenceConsent — every one of\n  // them a wrapped presenter. Unattended once the grant is held, attended on first use, and\n  // since R3-307 the host says which of those is happening.\n  spaces: {\n    reason: 'first-use mount/share/create consent is drawn inside the request',\n    idleMs: UNATTENDED_TIMEOUT_MS,\n  },\n  settings: {\n    reason: 'settings verbs reach the same consent and picker surfaces as spaces',\n    idleMs: UNATTENDED_TIMEOUT_MS,\n  },\n  // R3-1011 — `recents:list` can raise the R3-786 lazy `recents:read` consent INSIDE the\n  // request, through `presentCapabilityConsent` — a presenter site-main's SandboxListener\n  // wraps (announcingPresenters, kind 'consent'), so the idle bound is safe to shorten.\n  // Until this entry the call was classified unattended: a user who took longer than 30 s\n  // to answer the dialog got `timeout` while it was still on screen, and a later Allow\n  // replied to a call the SDK had already abandoned.\n  recents: {\n    reason: 'the lazy recents:read consent (R3-786) is drawn inside the request, via presentCapabilityConsent',\n    idleMs: UNATTENDED_TIMEOUT_MS,\n  },\n  // R3-1011's table survey found two more HOST schemes that can raise the lazy offer\n  // (device:geolocation, diagnostics:read) — but this package emits no\n  // protocol-device/protocol-diagnostics call (the wire vocabulary has neither, and\n  // diagnostics reads ride the push channel), so an entry here would classify a call\n  // nothing makes. It lands with the wrapper that adds one.\n  // The contribute flow shows the full diff for approval before anything is written\n  // (TRUST_AND_SAFETY TS-19b: the approval MUST show the real diff, so a human reads it).\n  // NOT a wrapped presenter — no `idleMs`.\n  contribute: { reason: 'the diff-approval step is a human read of the whole change' },\n  // A task is an app bound to a transient slot that the user interacts with; it returns\n  // when they finish, which is human-paced by construction. That is an APP's interaction,\n  // not a host prompt, so the attention channel never fires for it — no `idleMs`.\n  task: { reason: 'a task app runs an interaction and returns when the user finishes' },\n  // Launching a target can raise consent for a not-yet-granted app — through the launch\n  // flow's own surface, not one of the wrapped presenters. No `idleMs`.\n  launch: { reason: 'may raise first-use consent for the launched target' },\n  // A drag is a gesture in progress — its duration is the user's hand, and no host prompt\n  // is up while it happens. No `idleMs`.\n  dnd: { reason: 'a drag is a human gesture in flight' },\n  // The chat stream's FIRST frame sits behind the session's first passkey unseal — the\n  // exact hang the dogfood run found — and that unseal IS a wrapped presenter. But the idle\n  // bound here is the NETWORK one, not the channel one: with no prompt up, this call is\n  // waiting on an arbitrary upstream model, and thirty seconds is a normal generation.\n  llm: {\n    reason: 'the first frame can sit behind the session passkey unseal',\n    idleMs: NETWORK_TIMEOUT_MS,\n  },\n};\n\n/** Look up a scheme/method in the attended table, preferring the exact method entry. */\nfunction attendedEntry(scheme: string, method: string): AttendedEntry | undefined {\n  return ATTENDED[`${scheme}:${method}`] ?? ATTENDED[scheme];\n}\n\n/** Look up a scheme/method in the attended table, preferring the exact method entry. */\nfunction attendedReason(scheme: string, method: string): string | undefined {\n  return attendedEntry(scheme, method)?.reason;\n}\n\n/** Whether a call may block on a human. Exported for the classification test + tooling. */\nexport function attendanceOf(scheme: string, method: string): Attendance {\n  return attendedReason(scheme, method) ? 'attended' : 'unattended';\n}\n\n/** Why a call is classified attended, or `undefined` when it is not. Exported so the\n *  classification is legible from a test failure rather than only from this source. */\nexport function attendanceReason(scheme: string, method: string): string | undefined {\n  return attendedReason(scheme, method);\n}\n\n/** The default deadline for a one-shot `protocolRequest`. */\nexport function timeoutFor(scheme: string, method: string): number {\n  if (attendanceOf(scheme, method) === 'attended') return ATTENDED_TIMEOUT_MS;\n  // `fetch` reaches an arbitrary upstream, so it gets the network bound rather than the\n  // channel-round-trip one.\n  if (scheme === 'fetch') return NETWORK_TIMEOUT_MS;\n  return UNATTENDED_TIMEOUT_MS;\n}\n\n/**\n * The default TIME-TO-FIRST-FRAME bound for a stream.\n *\n * Deliberately not a total-duration bound: a long generation that is streaming normally is\n * healthy, and killing it would be a worse bug than the one being fixed. The hang has a\n * distinct shape — NO frames at all — so that is what is bounded, plus an idle gap between\n * frames once flowing. Together they fire exactly on a wedged stream and never on a slow\n * one.\n */\nexport function firstFrameTimeoutFor(scheme: string, method: string): number {\n  return attendanceOf(scheme, method) === 'attended' ? ATTENDED_FIRST_FRAME_MS : NETWORK_TIMEOUT_MS;\n}\n\n/**\n * The two bounds a call runs under (R3-307).\n *\n * `idleMs` is in force while the host reports nobody is being asked; it is cleared while a\n * host prompt is up and restarted, in full, when the prompt goes away. `ceilingMs` runs from\n * call start and is NEVER suspended — it is what releases a caller whose user walked away.\n */\nexport interface CallBounds {\n  /** The bound in force while the host is not waiting on a person. */\n  idleMs: number;\n  /** The absolute bound from call start. Never suspended. */\n  ceilingMs: number;\n}\n\n/** Which of a call's two bounds elapsed. `idle` means the host was NOT prompting — nobody\n *  was being asked anything, so this is a fault. `ceiling` means the absolute bound ran out,\n *  which for an attended call is an abandoned prompt. */\nexport type DeadlineBound = 'idle' | 'ceiling';\n\n/** The bounds for a one-shot `protocolRequest`. */\nexport function boundsFor(scheme: string, method: string): CallBounds {\n  const ceilingMs = timeoutFor(scheme, method);\n  const idleMs = attendedEntry(scheme, method)?.idleMs;\n  // `Math.min` so an `idleMs` can only ever tighten: an entry that named a bound longer than\n  // its own ceiling would otherwise silently disable the idle leg.\n  return { idleMs: idleMs === undefined ? ceilingMs : Math.min(idleMs, ceilingMs), ceilingMs };\n}\n\n/** The bounds for a stream's time-to-first-frame. */\nexport function firstFrameBoundsFor(scheme: string, method: string): CallBounds {\n  const ceilingMs = firstFrameTimeoutFor(scheme, method);\n  const idleMs = attendedEntry(scheme, method)?.idleMs;\n  return { idleMs: idleMs === undefined ? ceilingMs : Math.min(idleMs, ceilingMs), ceilingMs };\n}\n\n/** A live deadline that the host-attention signal can suspend. */\nexport interface SuspendableDeadline {\n  /** Tell the deadline whether the host is waiting on a person right now. */\n  setAwaiting(awaiting: boolean): void;\n  /** Clear every timer. Idempotent — safe to call from a `finally`. */\n  dispose(): void;\n}\n\n/**\n * A deadline with a suspendable idle leg and an unsuspendable ceiling.\n *\n * Pure and injectable (`setTimer`/`clearTimer`) so the suspension rules are unit-testable\n * against a fake clock rather than by waiting minutes for real ones.\n *\n * The idle leg RESTARTS in full when a prompt clears rather than resuming where it left off.\n * That is deliberate: after the user dismisses a prompt the host begins fresh work, and the\n * seconds that elapsed before the prompt say nothing about how long that work should take.\n * The ceiling is what stops a repeatedly-prompting call from running forever.\n */\nexport function createSuspendableDeadline(opts: {\n  bounds: CallBounds;\n  /** Called once, with the bound that elapsed and its length in ms. */\n  onExpire: (bound: DeadlineBound, boundMs: number) => void;\n  setTimer?: (fn: () => void, ms: number) => unknown;\n  clearTimer?: (handle: unknown) => void;\n}): SuspendableDeadline {\n  const setTimer = opts.setTimer ?? ((fn, ms) => setTimeout(fn, ms));\n  const clearTimer = opts.clearTimer ?? ((h) => clearTimeout(h as ReturnType<typeof setTimeout>));\n  const { idleMs, ceilingMs } = opts.bounds;\n  // An idle leg at or above the ceiling can never fire first, so don't arm one — that keeps\n  // the common unattended case (idle === ceiling) on exactly one timer, as before R3-307.\n  const hasIdleLeg = Number.isFinite(idleMs) && idleMs < ceilingMs;\n\n  let done = false;\n  let idle: unknown;\n  let ceiling: unknown;\n\n  const expire = (bound: DeadlineBound, boundMs: number) => {\n    if (done) return;\n    done = true;\n    opts.onExpire(bound, boundMs);\n  };\n\n  const armIdle = () => {\n    if (done || !hasIdleLeg || idle !== undefined) return;\n    idle = setTimer(() => {\n      idle = undefined;\n      expire('idle', idleMs);\n    }, idleMs);\n  };\n  const disarmIdle = () => {\n    if (idle !== undefined) {\n      clearTimer(idle);\n      idle = undefined;\n    }\n  };\n\n  if (Number.isFinite(ceilingMs)) {\n    ceiling = setTimer(() => {\n      ceiling = undefined;\n      expire('ceiling', ceilingMs);\n    }, ceilingMs);\n  }\n  armIdle();\n\n  return {\n    setAwaiting(awaiting: boolean) {\n      if (done) return;\n      if (awaiting) disarmIdle();\n      else armIdle();\n    },\n    dispose() {\n      done = true;\n      disarmIdle();\n      if (ceiling !== undefined) {\n        clearTimer(ceiling);\n        ceiling = undefined;\n      }\n    },\n  };\n}\n\n/** The error a bounded call rejects with. `code` is `'timeout'` — the code R3-303's typed\n *  provider-error taxonomy adopts, so apps see one vocabulary. */\nexport class ProtocolTimeoutError extends Error {\n  readonly code = 'timeout';\n  /** `scheme:method` of the call that timed out. */\n  readonly call: string;\n  /** The bound that elapsed, in ms. */\n  readonly timeoutMs: number;\n  /** Whether the call was on the attended or unattended bound — the first thing anyone\n   *  debugging a timeout needs, and otherwise invisible. */\n  readonly attendance: Attendance;\n  /** WHICH bound elapsed (R3-307). An attended call that faults on its `idle` bound was not\n   *  waiting on anyone — the host said so — and that is a genuinely different diagnosis from\n   *  an abandoned prompt hitting the `ceiling`. */\n  readonly bound: DeadlineBound;\n  constructor(\n    call: string,\n    timeoutMs: number,\n    attendance: Attendance,\n    bound: DeadlineBound = attendance === 'attended' ? 'ceiling' : 'idle',\n  ) {\n    super(\n      attendance === 'attended' && bound === 'ceiling'\n        ? `immediately.run: ${call} was abandoned after ${Math.round(timeoutMs / 1000)}s waiting for you`\n        : `immediately.run: ${call} did not respond within ${Math.round(timeoutMs / 1000)}s`,\n    );\n    this.name = 'ProtocolTimeoutError';\n    this.call = call;\n    this.timeoutMs = timeoutMs;\n    this.attendance = attendance;\n    this.bound = bound;\n  }\n}\n\n/** The error a cancelled call rejects with. */\nexport class ProtocolCancelledError extends Error {\n  readonly code = 'cancelled';\n  constructor(call: string) {\n    super(`immediately.run: ${call} was cancelled`);\n    this.name = 'ProtocolCancelledError';\n  }\n}\n\n/** What the host is waiting for at this moment, as reported on the host-attention channel\n *  (R3-307). Present on a {@link PendingState} only while the host IS prompting. */\nexport interface PendingAttention {\n  /** The kind of prompt on screen, or `null` when the host reports a wait it cannot name. */\n  kind: HostAttentionKind | null;\n  /** `Date.now()` when the wait began, or `null`. */\n  since: number | null;\n}\n\n/** What `onPending` is told when a call is taking a while. */\nexport interface PendingState {\n  call: string;\n  attendance: Attendance;\n  elapsedMs: number;\n  /** Why this call *may* be waiting on a person — present only when attended. It comes from\n   *  the classification table, so it is a standing possibility, not a live fact. */\n  reason?: string;\n  /**\n   * What the host is waiting for RIGHT NOW (R3-307) — present only while a host prompt is\n   * actually up. Prefer it over {@link reason} when rendering: \"tap your passkey\" is a\n   * sentence the user can act on; \"this may need you\" is not.\n   */\n  awaiting?: PendingAttention;\n}\n\n/** Options accepted by every bounded host call. */\nexport interface BoundedCallOptions {\n  /** Override the classified default. `Infinity` disables the bound — an escape hatch for a\n   *  caller that genuinely owns the wait (it must then provide its own way out).\n   *\n   *  An explicit value is the WHOLE bound: it is never suspended by the host-attention\n   *  signal, because a caller that named a number owns the wait. */\n  timeoutMs?: number;\n  /** Abort the wait. The SDK stops waiting and rejects with `code: 'cancelled'`. */\n  signal?: AbortSignal;\n  /** Fired when the call passes `PENDING_NOTICE_MS`, so a caller can render a waiting state\n   *  rather than an unexplained pause — and again, after that, whenever the host starts or\n   *  stops waiting on the user, so the waiting state can name what is on screen now. */\n  onPending?: (state: PendingState) => void;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAyDO,MAAM,wBAAwB;AAG9B,MAA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