import { z } from 'zod'; /** * Live-control: the narrowed payload of a HUMAN_CONTROL event. The server safeParses * `event.data` against this at the inbound boundary (unknown → narrowed; never `any`). */ export declare const HumanControlDataSchema: z.ZodObject<{ kind: z.ZodNativeEnum<{ readonly PAUSE: "pause"; readonly RESUME: "resume"; readonly END: "end"; readonly MESSAGE: "message"; readonly REPLAY: "replay"; readonly SYNC: "sync"; }>; text: z.ZodOptional; }, "strip", z.ZodTypeAny, { kind: "message" | "pause" | "resume" | "end" | "replay" | "sync"; text?: string | undefined; }, { kind: "message" | "pause" | "resume" | "end" | "replay" | "sync"; text?: string | undefined; }>; export type HumanControlData = z.infer; /** * Human review: the narrowed payload of a HUMAN_MARK event. A human flagged a mistake pinned to an * element on the running page; the server safeParses `event.data` against this at the inbound * boundary (unknown → narrowed; never `any`) and stores it for the agent to drain. * * `anchor` is the re-resolvable element address (auto-anchor's string, e.g. * `component:Submit@src/Checkout.tsx:42`); `strategy` is its durability tier; `source` is the * stamped file:line when the framework provided one — the single most useful field for the agent, * because it points straight at the code to fix. */ export declare const HumanMarkDataSchema: z.ZodObject<{ note: z.ZodString; anchor: z.ZodString; strategy: z.ZodNativeEnum<{ readonly TESTID: "testid"; readonly COMPONENT: "component"; readonly ROLE: "role"; readonly POSITION: "position"; }>; /** Human-legible element label (role + accessible name / text), to show the agent what was flagged. */ label: z.ZodOptional; /** Source file:line stamped by the framework's compiler/plugin, when available. */ source: z.ZodOptional>; /** Route/URL the mark was made on, so the agent can reproduce the context. */ route: z.ZodOptional; }, "strip", z.ZodTypeAny, { anchor: string; note: string; strategy: "role" | "testid" | "component" | "position"; label?: string | undefined; route?: string | undefined; source?: { file: string; line: number; } | undefined; }, { anchor: string; note: string; strategy: "role" | "testid" | "component" | "position"; label?: string | undefined; route?: string | undefined; source?: { file: string; line: number; } | undefined; }>; export type HumanMarkData = z.infer; /** * A normalized observation pushed from the browser into the ring buffer. * `t` is a monotonic millisecond timestamp relative to session start (clock injected, * never `Date.now` inside pure logic — see plan engineering standards). */ export declare const ReticleEventSchema: z.ZodObject<{ t: z.ZodNumber; type: z.ZodNativeEnum<{ readonly DOM_ADDED: "dom.added"; readonly DOM_REMOVED: "dom.removed"; readonly DOM_ATTR: "dom.attr"; readonly DOM_TEXT: "dom.text"; readonly NET_REQUEST: "net.request"; readonly NET_PENDING: "net.pending"; readonly NET_STREAM: "net.stream"; readonly PERF: "perf"; readonly ROUTE_CHANGE: "route.change"; readonly CONSOLE_LOG: "console.log"; readonly CONSOLE_WARN: "console.warn"; readonly CONSOLE_ERROR: "console.error"; readonly CONSOLE_INFO: "console.info"; readonly CONSOLE_DEBUG: "console.debug"; readonly ERROR_UNCAUGHT: "error.uncaught"; readonly VISIBLE_SHOWN: "visible.shown"; readonly ANIM_START: "anim.start"; readonly ANIM_END: "anim.end"; readonly SCROLL_POSITION: "scroll.position"; readonly REVEAL_SHOWN: "reveal.shown"; readonly SIGNAL: "signal"; readonly STATE_CHANGE: "state.change"; readonly STORAGE_CHANGE: "storage.change"; readonly PAGE_HEALTH: "page.health"; readonly CONTEXT_OPENED: "context.opened"; readonly DIALOG_OPENED: "dialog.opened"; readonly RENDER_COMMIT: "render.commit"; readonly FOCUS_CHANGE: "focus.change"; readonly FLOW_RECORDED: "flow.recorded"; readonly TRANSPORT_OVERFLOW: "transport.overflow"; readonly TRUNCATED: "truncated"; readonly BLIND_SPOT: "blind-spot"; readonly SDK_FAILED: "sdk.failed"; readonly NET_DETAIL: "net.detail"; readonly HUMAN_CONTROL: "human.control"; readonly HUMAN_MARK: "human.mark"; readonly DOWNLOAD: "download"; }>; sessionId: z.ZodString; /** Stable element reference this event concerns, when applicable (e.g. "e7"). */ ref: z.ZodOptional; /** * Monotonic per-session sequence number stamped by the SDK. Gives events a total order independent * of `t` (which can tie at millisecond resolution). Optional for back-compat with pre-2.2 SDKs. */ seq: z.ZodOptional; /** * The action this event is attributed to, when one was active at observation time. Set together with * `attribution` (the tier of that link). Optional: ambient events observed outside any action window * carry neither. */ actionId: z.ZodOptional; /** How `actionId` was derived. Present iff `actionId` is. */ attribution: z.ZodOptional>; /** * The document this was observed under. Minted once per real document; a full navigation replaces * both. Lets evidence from a superseded document be excluded rather than counted against an action * taken now. Optional for back-compat with SDKs that predate it, which is why absence is read as * "current" rather than "foreign" — see `isSameDocument`. */ documentId: z.ZodOptional; /** * The round of source edits this was observed under — a counter the SDK advances once per applied * hot update. A hot update replaces modules and re-renders INSIDE the same document, so * `documentId` cannot see it; this is the edit-shaped half of the same question. * * Optional, and absent while nothing has hot-updated, which is why absence is read as "current" * rather than "foreign" — see `isSameEditEpoch`. Most pages have no channel that could report an * update at all, so a stamp of `NO_EDITS_OBSERVED` would be wire spent on the word "unknown". */ editEpoch: z.ZodOptional; /** Event-type-specific payload. Kept open here; refined per observer at the edges. */ data: z.ZodDefault>; }, "strip", z.ZodTypeAny, { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; data: Record; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; }, { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; data?: Record | undefined; }>; export type ReticleEvent = z.infer; /** Browser announces itself to the bridge on connect. */ export declare const HelloMessageSchema: z.ZodObject<{ kind: z.ZodLiteral<"hello">; /** * The wire protocol this peer speaks. * * A RANGE, not a fixed number. An exact match is right while both halves ship together and wrong * as soon as anything else implements this: a peer one version behind is not incompatible, it is * behind. The bridge accepts anything from the oldest version it still talks to up to its own. * * Out of range is still a hard door, with the diagnostics that already name which side is stale. */ protocolVersion: z.ZodNumber; sessionId: z.ZodString; url: z.ZodString; title: z.ZodString; /** * Stable project identity stamped by the build plugin (e.g. "acme-web-9f3c1d"). Survives port * changes, so session resolution can scope to the right app even when its dev server boots on a * different port than usual. Optional for back-compat with v1.0 SDKs that don't send it; absent * ⇒ resolution falls back to origin + recency. */ projectId: z.ZodOptional; adapters: z.ZodArray; /** Optional browser/bridge pairing token. Required when the bridge configures one. */ token: z.ZodOptional; /** * What kind of surface this is: a browser document, a web page in somebody else's window, a * native view tree, or no rendering surface at all. See platform.ts. * * ABSENT MEANS `web`, never "unknown". Everything that connected before this field existed was a * browser document, so absence is not a gap -- it is the answer those connections would have * given. This is the same convention five other fields on this message already use. * * It is deliberately not the shell name. Electron and Tauri are two shells and one surface, and * verification wants the surface: the question being asked is what can be demanded of you, not * which product you are. */ platform: z.ZodOptional>; /** * The channels this build can actually observe. See channel.ts. * * ABSENT MEANS "everything", not "nothing" -- an SDK built before this field existed watched * whatever it watched, and reading its silence as "observes nothing" would refuse every claim it * makes. Same convention as every other optional field on this message. * * A closed list rather than free strings, because the rule that refuses a claim reading an * undeclared channel has to switch on these. Commands below are free strings for the opposite * reason: nothing switches on them, and command names are already opaque on this wire. */ channels: z.ZodOptional, "many">>; /** * The commands this build can serve. * * Absent means "assume the usual set". Present and missing a name means asking for it is a * mistake somebody can be told about before they spend an action on it, rather than after. */ commands: z.ZodOptional>; /** * The wire names this peer actually speaks, so compatibility can be judged name by name. * * The fingerprint beside it is a hash over the whole vocabulary: it can say "same" or "different" * and nothing else. An implementation that speaks part of the contract -- which is the right thing * for anything that is not a browser to do -- can never produce a matching hash, and was therefore * reported as skewed on every call forever. * * Absent means "compare the fingerprint", which is what a build predating this field does. */ contractParts: z.ZodOptional; events: z.ZodArray; actions: z.ZodArray; }, "strip", z.ZodTypeAny, { events: string[]; commands: string[]; actions: string[]; }, { events: string[]; commands: string[]; actions: string[]; }>>; /** Whether the app has advertised a capability registry (reticle.describe). */ hasCapabilities: z.ZodOptional; /** * Whether this page records request/response bodies (`connect({ captureNetworkBodies: true })`). * * Announced so an assertion that can only be answered from a body is refused BEFORE the action is * spent, rather than after. Reported from the field: an `act_and_wait` matched the right call and * came back `verified: "no"` with "a matching call with no recorded body" — knowable in advance, * and on a drive that mutates state the action is not always repeatable. * * ABSENT means unknown, never false. An SDK predating this field says nothing, and treating * silence as "off" would refuse a clause every one of those sessions can satisfy. */ captureBodies: z.ZodOptional; /** * Whether the build plugin's `data-reticle-source` stamp is switched OFF for this project. * * Announced for the same reason `captureBodies` is, and read by the same kind of rule: a verdict * that cannot name a file and line needs to know WHY before it prescribes a fix. Without it, an * app that disabled the stamp deliberately — which react-three-fiber apps must, and which `reticle * init` now does for them automatically — was told on every red verdict to install a build plugin * it already had. * * ABSENT means unknown, never false. An older SDK says nothing, and reading silence as "off" * would suppress the honest gap for every app that simply has no source mapping at all. */ sourceMapping: z.ZodOptional; /** * The version of the SDK in the page, so a version-skewed pair can SAY so. * * `protocolVersion` only catches an incompatible wire format. A 2.2.1 SDK against a 2.4.0 daemon * agrees on the protocol, connects fine, and then disagrees about tool behaviour — which surfaced * as a bare `-32000` with nothing on either side naming a version. Supplied by the build plugin * (which can read the installed package's version Node-side); absent means "unknown", never * "matching", so a hand-wired connect is not falsely reported as in sync. */ sdkVersion: z.ZodOptional; /** * The wire contract this SDK build speaks (see contract-fingerprint.ts) — DERIVED from core's * vocabulary, so it moves only when a name on the wire genuinely changes. * * `sdkVersion` above answers "which release is this"; this answers the question that actually * decides whether the pair works, and it answers it for the two cases a version cannot: a patch * bump that changed nothing (equal here → stay quiet) and two different BUILDS of one version * number, which is what a stale daemon or a cached npx install is (unequal here → say so). */ contract: z.ZodOptional; /** * Extra key names this app declared sensitive via `connect({ redact: { keys } })`. * * Sent so the DRIVEN path redacts them too: a request body captured by the daemon from the network * stack never passes through the SDK, so an app-declared credential would otherwise reach the * journal in cleartext on exactly the path the user cannot see. Literal names only — a pattern * compiled from the wire would be a ReDoS surface, and the exemption list is never sent because it * is the only part of the config that could REMOVE redaction. See `wireRedactionKeys`. */ redactKeys: z.ZodOptional>; }, "strip", z.ZodTypeAny, { kind: "hello"; url: string; sessionId: string; protocolVersion: number; title: string; adapters: string[]; projectId?: string | undefined; token?: string | undefined; platform?: "native" | "web" | "webview" | "service" | undefined; channels?: ("visual" | "signal" | "net" | "state" | "route" | "ui" | "log" | "storage" | "time")[] | undefined; commands?: string[] | undefined; contractParts?: { events: string[]; commands: string[]; actions: string[]; } | undefined; hasCapabilities?: boolean | undefined; captureBodies?: boolean | undefined; sourceMapping?: boolean | undefined; sdkVersion?: string | undefined; contract?: string | undefined; redactKeys?: string[] | undefined; }, { kind: "hello"; url: string; sessionId: string; protocolVersion: number; title: string; adapters: string[]; projectId?: string | undefined; token?: string | undefined; platform?: "native" | "web" | "webview" | "service" | undefined; channels?: ("visual" | "signal" | "net" | "state" | "route" | "ui" | "log" | "storage" | "time")[] | undefined; commands?: string[] | undefined; contractParts?: { events: string[]; commands: string[]; actions: string[]; } | undefined; hasCapabilities?: boolean | undefined; captureBodies?: boolean | undefined; sourceMapping?: boolean | undefined; sdkVersion?: string | undefined; contract?: string | undefined; redactKeys?: string[] | undefined; }>; export type HelloMessage = z.infer; /** Agent -> browser request, routed by the bridge with a correlation id. */ export declare const CommandMessageSchema: z.ZodObject<{ kind: z.ZodLiteral<"command">; id: z.ZodString; sessionId: z.ZodOptional; name: z.ZodString; args: z.ZodDefault>; }, "strip", z.ZodTypeAny, { id: string; kind: "command"; name: string; args: Record; sessionId?: string | undefined; }, { id: string; kind: "command"; name: string; args?: Record | undefined; sessionId?: string | undefined; }>; export type CommandMessage = z.infer; /** Browser -> agent reply to a command. */ export declare const CommandResultSchema: z.ZodObject<{ kind: z.ZodLiteral<"command_result">; id: z.ZodString; ok: z.ZodBoolean; result: z.ZodOptional; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; ok: boolean; kind: "command_result"; error?: string | undefined; result?: unknown; }, { id: string; ok: boolean; kind: "command_result"; error?: string | undefined; result?: unknown; }>; export type CommandResult = z.infer; /** Browser -> bridge streamed observation. */ export declare const EventMessageSchema: z.ZodObject<{ kind: z.ZodLiteral<"event">; event: z.ZodObject<{ t: z.ZodNumber; type: z.ZodNativeEnum<{ readonly DOM_ADDED: "dom.added"; readonly DOM_REMOVED: "dom.removed"; readonly DOM_ATTR: "dom.attr"; readonly DOM_TEXT: "dom.text"; readonly NET_REQUEST: "net.request"; readonly NET_PENDING: "net.pending"; readonly NET_STREAM: "net.stream"; readonly PERF: "perf"; readonly ROUTE_CHANGE: "route.change"; readonly CONSOLE_LOG: "console.log"; readonly CONSOLE_WARN: "console.warn"; readonly CONSOLE_ERROR: "console.error"; readonly CONSOLE_INFO: "console.info"; readonly CONSOLE_DEBUG: "console.debug"; readonly ERROR_UNCAUGHT: "error.uncaught"; readonly VISIBLE_SHOWN: "visible.shown"; readonly ANIM_START: "anim.start"; readonly ANIM_END: "anim.end"; readonly SCROLL_POSITION: "scroll.position"; readonly REVEAL_SHOWN: "reveal.shown"; readonly SIGNAL: "signal"; readonly STATE_CHANGE: "state.change"; readonly STORAGE_CHANGE: "storage.change"; readonly PAGE_HEALTH: "page.health"; readonly CONTEXT_OPENED: "context.opened"; readonly DIALOG_OPENED: "dialog.opened"; readonly RENDER_COMMIT: "render.commit"; readonly FOCUS_CHANGE: "focus.change"; readonly FLOW_RECORDED: "flow.recorded"; readonly TRANSPORT_OVERFLOW: "transport.overflow"; readonly TRUNCATED: "truncated"; readonly BLIND_SPOT: "blind-spot"; readonly SDK_FAILED: "sdk.failed"; readonly NET_DETAIL: "net.detail"; readonly HUMAN_CONTROL: "human.control"; readonly HUMAN_MARK: "human.mark"; readonly DOWNLOAD: "download"; }>; sessionId: z.ZodString; /** Stable element reference this event concerns, when applicable (e.g. "e7"). */ ref: z.ZodOptional; /** * Monotonic per-session sequence number stamped by the SDK. Gives events a total order independent * of `t` (which can tie at millisecond resolution). Optional for back-compat with pre-2.2 SDKs. */ seq: z.ZodOptional; /** * The action this event is attributed to, when one was active at observation time. Set together with * `attribution` (the tier of that link). Optional: ambient events observed outside any action window * carry neither. */ actionId: z.ZodOptional; /** How `actionId` was derived. Present iff `actionId` is. */ attribution: z.ZodOptional>; /** * The document this was observed under. Minted once per real document; a full navigation replaces * both. Lets evidence from a superseded document be excluded rather than counted against an action * taken now. Optional for back-compat with SDKs that predate it, which is why absence is read as * "current" rather than "foreign" — see `isSameDocument`. */ documentId: z.ZodOptional; /** * The round of source edits this was observed under — a counter the SDK advances once per applied * hot update. A hot update replaces modules and re-renders INSIDE the same document, so * `documentId` cannot see it; this is the edit-shaped half of the same question. * * Optional, and absent while nothing has hot-updated, which is why absence is read as "current" * rather than "foreign" — see `isSameEditEpoch`. Most pages have no channel that could report an * update at all, so a stamp of `NO_EDITS_OBSERVED` would be wire spent on the word "unknown". */ editEpoch: z.ZodOptional; /** Event-type-specific payload. Kept open here; refined per observer at the edges. */ data: z.ZodDefault>; }, "strip", z.ZodTypeAny, { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; data: Record; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; }, { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; data?: Record | undefined; }>; }, "strip", z.ZodTypeAny, { event: { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; data: Record; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; }; kind: "event"; }, { event: { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; data?: Record | undefined; }; kind: "event"; }>; export type EventMessage = z.infer; export declare const ReticleMessageSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"hello">; /** * The wire protocol this peer speaks. * * A RANGE, not a fixed number. An exact match is right while both halves ship together and wrong * as soon as anything else implements this: a peer one version behind is not incompatible, it is * behind. The bridge accepts anything from the oldest version it still talks to up to its own. * * Out of range is still a hard door, with the diagnostics that already name which side is stale. */ protocolVersion: z.ZodNumber; sessionId: z.ZodString; url: z.ZodString; title: z.ZodString; /** * Stable project identity stamped by the build plugin (e.g. "acme-web-9f3c1d"). Survives port * changes, so session resolution can scope to the right app even when its dev server boots on a * different port than usual. Optional for back-compat with v1.0 SDKs that don't send it; absent * ⇒ resolution falls back to origin + recency. */ projectId: z.ZodOptional; adapters: z.ZodArray; /** Optional browser/bridge pairing token. Required when the bridge configures one. */ token: z.ZodOptional; /** * What kind of surface this is: a browser document, a web page in somebody else's window, a * native view tree, or no rendering surface at all. See platform.ts. * * ABSENT MEANS `web`, never "unknown". Everything that connected before this field existed was a * browser document, so absence is not a gap -- it is the answer those connections would have * given. This is the same convention five other fields on this message already use. * * It is deliberately not the shell name. Electron and Tauri are two shells and one surface, and * verification wants the surface: the question being asked is what can be demanded of you, not * which product you are. */ platform: z.ZodOptional>; /** * The channels this build can actually observe. See channel.ts. * * ABSENT MEANS "everything", not "nothing" -- an SDK built before this field existed watched * whatever it watched, and reading its silence as "observes nothing" would refuse every claim it * makes. Same convention as every other optional field on this message. * * A closed list rather than free strings, because the rule that refuses a claim reading an * undeclared channel has to switch on these. Commands below are free strings for the opposite * reason: nothing switches on them, and command names are already opaque on this wire. */ channels: z.ZodOptional, "many">>; /** * The commands this build can serve. * * Absent means "assume the usual set". Present and missing a name means asking for it is a * mistake somebody can be told about before they spend an action on it, rather than after. */ commands: z.ZodOptional>; /** * The wire names this peer actually speaks, so compatibility can be judged name by name. * * The fingerprint beside it is a hash over the whole vocabulary: it can say "same" or "different" * and nothing else. An implementation that speaks part of the contract -- which is the right thing * for anything that is not a browser to do -- can never produce a matching hash, and was therefore * reported as skewed on every call forever. * * Absent means "compare the fingerprint", which is what a build predating this field does. */ contractParts: z.ZodOptional; events: z.ZodArray; actions: z.ZodArray; }, "strip", z.ZodTypeAny, { events: string[]; commands: string[]; actions: string[]; }, { events: string[]; commands: string[]; actions: string[]; }>>; /** Whether the app has advertised a capability registry (reticle.describe). */ hasCapabilities: z.ZodOptional; /** * Whether this page records request/response bodies (`connect({ captureNetworkBodies: true })`). * * Announced so an assertion that can only be answered from a body is refused BEFORE the action is * spent, rather than after. Reported from the field: an `act_and_wait` matched the right call and * came back `verified: "no"` with "a matching call with no recorded body" — knowable in advance, * and on a drive that mutates state the action is not always repeatable. * * ABSENT means unknown, never false. An SDK predating this field says nothing, and treating * silence as "off" would refuse a clause every one of those sessions can satisfy. */ captureBodies: z.ZodOptional; /** * Whether the build plugin's `data-reticle-source` stamp is switched OFF for this project. * * Announced for the same reason `captureBodies` is, and read by the same kind of rule: a verdict * that cannot name a file and line needs to know WHY before it prescribes a fix. Without it, an * app that disabled the stamp deliberately — which react-three-fiber apps must, and which `reticle * init` now does for them automatically — was told on every red verdict to install a build plugin * it already had. * * ABSENT means unknown, never false. An older SDK says nothing, and reading silence as "off" * would suppress the honest gap for every app that simply has no source mapping at all. */ sourceMapping: z.ZodOptional; /** * The version of the SDK in the page, so a version-skewed pair can SAY so. * * `protocolVersion` only catches an incompatible wire format. A 2.2.1 SDK against a 2.4.0 daemon * agrees on the protocol, connects fine, and then disagrees about tool behaviour — which surfaced * as a bare `-32000` with nothing on either side naming a version. Supplied by the build plugin * (which can read the installed package's version Node-side); absent means "unknown", never * "matching", so a hand-wired connect is not falsely reported as in sync. */ sdkVersion: z.ZodOptional; /** * The wire contract this SDK build speaks (see contract-fingerprint.ts) — DERIVED from core's * vocabulary, so it moves only when a name on the wire genuinely changes. * * `sdkVersion` above answers "which release is this"; this answers the question that actually * decides whether the pair works, and it answers it for the two cases a version cannot: a patch * bump that changed nothing (equal here → stay quiet) and two different BUILDS of one version * number, which is what a stale daemon or a cached npx install is (unequal here → say so). */ contract: z.ZodOptional; /** * Extra key names this app declared sensitive via `connect({ redact: { keys } })`. * * Sent so the DRIVEN path redacts them too: a request body captured by the daemon from the network * stack never passes through the SDK, so an app-declared credential would otherwise reach the * journal in cleartext on exactly the path the user cannot see. Literal names only — a pattern * compiled from the wire would be a ReDoS surface, and the exemption list is never sent because it * is the only part of the config that could REMOVE redaction. See `wireRedactionKeys`. */ redactKeys: z.ZodOptional>; }, "strip", z.ZodTypeAny, { kind: "hello"; url: string; sessionId: string; protocolVersion: number; title: string; adapters: string[]; projectId?: string | undefined; token?: string | undefined; platform?: "native" | "web" | "webview" | "service" | undefined; channels?: ("visual" | "signal" | "net" | "state" | "route" | "ui" | "log" | "storage" | "time")[] | undefined; commands?: string[] | undefined; contractParts?: { events: string[]; commands: string[]; actions: string[]; } | undefined; hasCapabilities?: boolean | undefined; captureBodies?: boolean | undefined; sourceMapping?: boolean | undefined; sdkVersion?: string | undefined; contract?: string | undefined; redactKeys?: string[] | undefined; }, { kind: "hello"; url: string; sessionId: string; protocolVersion: number; title: string; adapters: string[]; projectId?: string | undefined; token?: string | undefined; platform?: "native" | "web" | "webview" | "service" | undefined; channels?: ("visual" | "signal" | "net" | "state" | "route" | "ui" | "log" | "storage" | "time")[] | undefined; commands?: string[] | undefined; contractParts?: { events: string[]; commands: string[]; actions: string[]; } | undefined; hasCapabilities?: boolean | undefined; captureBodies?: boolean | undefined; sourceMapping?: boolean | undefined; sdkVersion?: string | undefined; contract?: string | undefined; redactKeys?: string[] | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"command">; id: z.ZodString; sessionId: z.ZodOptional; name: z.ZodString; args: z.ZodDefault>; }, "strip", z.ZodTypeAny, { id: string; kind: "command"; name: string; args: Record; sessionId?: string | undefined; }, { id: string; kind: "command"; name: string; args?: Record | undefined; sessionId?: string | undefined; }>, z.ZodObject<{ kind: z.ZodLiteral<"command_result">; id: z.ZodString; ok: z.ZodBoolean; result: z.ZodOptional; error: z.ZodOptional; }, "strip", z.ZodTypeAny, { id: string; ok: boolean; kind: "command_result"; error?: string | undefined; result?: unknown; }, { id: string; ok: boolean; kind: "command_result"; error?: string | undefined; result?: unknown; }>, z.ZodObject<{ kind: z.ZodLiteral<"event">; event: z.ZodObject<{ t: z.ZodNumber; type: z.ZodNativeEnum<{ readonly DOM_ADDED: "dom.added"; readonly DOM_REMOVED: "dom.removed"; readonly DOM_ATTR: "dom.attr"; readonly DOM_TEXT: "dom.text"; readonly NET_REQUEST: "net.request"; readonly NET_PENDING: "net.pending"; readonly NET_STREAM: "net.stream"; readonly PERF: "perf"; readonly ROUTE_CHANGE: "route.change"; readonly CONSOLE_LOG: "console.log"; readonly CONSOLE_WARN: "console.warn"; readonly CONSOLE_ERROR: "console.error"; readonly CONSOLE_INFO: "console.info"; readonly CONSOLE_DEBUG: "console.debug"; readonly ERROR_UNCAUGHT: "error.uncaught"; readonly VISIBLE_SHOWN: "visible.shown"; readonly ANIM_START: "anim.start"; readonly ANIM_END: "anim.end"; readonly SCROLL_POSITION: "scroll.position"; readonly REVEAL_SHOWN: "reveal.shown"; readonly SIGNAL: "signal"; readonly STATE_CHANGE: "state.change"; readonly STORAGE_CHANGE: "storage.change"; readonly PAGE_HEALTH: "page.health"; readonly CONTEXT_OPENED: "context.opened"; readonly DIALOG_OPENED: "dialog.opened"; readonly RENDER_COMMIT: "render.commit"; readonly FOCUS_CHANGE: "focus.change"; readonly FLOW_RECORDED: "flow.recorded"; readonly TRANSPORT_OVERFLOW: "transport.overflow"; readonly TRUNCATED: "truncated"; readonly BLIND_SPOT: "blind-spot"; readonly SDK_FAILED: "sdk.failed"; readonly NET_DETAIL: "net.detail"; readonly HUMAN_CONTROL: "human.control"; readonly HUMAN_MARK: "human.mark"; readonly DOWNLOAD: "download"; }>; sessionId: z.ZodString; /** Stable element reference this event concerns, when applicable (e.g. "e7"). */ ref: z.ZodOptional; /** * Monotonic per-session sequence number stamped by the SDK. Gives events a total order independent * of `t` (which can tie at millisecond resolution). Optional for back-compat with pre-2.2 SDKs. */ seq: z.ZodOptional; /** * The action this event is attributed to, when one was active at observation time. Set together with * `attribution` (the tier of that link). Optional: ambient events observed outside any action window * carry neither. */ actionId: z.ZodOptional; /** How `actionId` was derived. Present iff `actionId` is. */ attribution: z.ZodOptional>; /** * The document this was observed under. Minted once per real document; a full navigation replaces * both. Lets evidence from a superseded document be excluded rather than counted against an action * taken now. Optional for back-compat with SDKs that predate it, which is why absence is read as * "current" rather than "foreign" — see `isSameDocument`. */ documentId: z.ZodOptional; /** * The round of source edits this was observed under — a counter the SDK advances once per applied * hot update. A hot update replaces modules and re-renders INSIDE the same document, so * `documentId` cannot see it; this is the edit-shaped half of the same question. * * Optional, and absent while nothing has hot-updated, which is why absence is read as "current" * rather than "foreign" — see `isSameEditEpoch`. Most pages have no channel that could report an * update at all, so a stamp of `NO_EDITS_OBSERVED` would be wire spent on the word "unknown". */ editEpoch: z.ZodOptional; /** Event-type-specific payload. Kept open here; refined per observer at the edges. */ data: z.ZodDefault>; }, "strip", z.ZodTypeAny, { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; data: Record; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; }, { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; data?: Record | undefined; }>; }, "strip", z.ZodTypeAny, { event: { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; data: Record; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; }; kind: "event"; }, { event: { type: "dom.added" | "dom.removed" | "dom.attr" | "dom.text" | "net.request" | "net.pending" | "net.stream" | "perf" | "route.change" | "console.log" | "console.warn" | "console.error" | "console.info" | "console.debug" | "error.uncaught" | "visible.shown" | "anim.start" | "anim.end" | "scroll.position" | "reveal.shown" | "signal" | "state.change" | "storage.change" | "page.health" | "context.opened" | "dialog.opened" | "render.commit" | "focus.change" | "flow.recorded" | "transport.overflow" | "truncated" | "blind-spot" | "sdk.failed" | "net.detail" | "human.control" | "human.mark" | "download"; t: number; sessionId: string; ref?: string | undefined; seq?: number | undefined; actionId?: string | undefined; attribution?: "window" | undefined; documentId?: string | undefined; editEpoch?: number | undefined; data?: Record | undefined; }; kind: "event"; }>]>;